@ujet/websdk-headless 3.0.4 → 3.0.5

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/README.md CHANGED
@@ -87,13 +87,29 @@ interface CompanyResponse {
87
87
  }
88
88
  ```
89
89
 
90
+ ### `getAfterHourMessage`
91
+
92
+ This method is used for fetching the message for after hour deflection.
93
+
94
+ Request parameter:
95
+
96
+ ```ts
97
+ (lang?: string)
98
+ ```
99
+
100
+ Example:
101
+
102
+ ```js
103
+ const message: string = await client.getAfterHourMessage()
104
+ ```
105
+
90
106
  ### `getMenus`
91
107
 
92
108
  This method is used to list all the menu items available for the tenant.
93
109
 
94
110
  Request parameter:
95
111
 
96
- ```js
112
+ ```ts
97
113
  (key?: string, lang?: string)
98
114
  ```
99
115
 
@@ -139,7 +155,7 @@ This method is used to get available time slots for scheduled calls.
139
155
 
140
156
  Request parameter:
141
157
 
142
- ```js
158
+ ```ts
143
159
  (menuId: number | string, lang?: string)
144
160
  ```
145
161
 
@@ -166,6 +182,22 @@ Response data example:
166
182
  ]
167
183
  ```
168
184
 
185
+ ### `getWaitTimes`
186
+
187
+ This method is used to get the waiting time for chat channel and call channel of
188
+ a menu.
189
+
190
+ Request parameter:
191
+
192
+ ```ts
193
+ (menuId: number | string, lang?: string)
194
+ ```
195
+
196
+ Example:
197
+
198
+ ```ts
199
+ const {chat, voice_call} = await client.getWaitTimes(123)
200
+ ```
169
201
 
170
202
  ### `createCall`
171
203
 
@@ -298,6 +330,27 @@ method will try to load the ongoing chat information.
298
330
  const chat = await client.loadOngoingChat()
299
331
  ```
300
332
 
333
+ ### `getChatDeflection`
334
+
335
+ This method is used to fetch the chat deflection configuration.
336
+
337
+ Example:
338
+
339
+ ```ts
340
+ // this method can only be used when there is a chat
341
+ const deflection = await client.getChatDeflection()
342
+ ```
343
+
344
+ The response is `null` or:
345
+
346
+ ```ts
347
+ interface ChatDeflectionResponse {
348
+ enabled: boolean;
349
+ threshold: number;
350
+ keep_waiting: boolean;
351
+ }
352
+ ```
353
+
301
354
  ### `escalateChat`
302
355
 
303
356
  This method will transfer the chat from virtual agent to human agent.
@@ -324,6 +377,18 @@ This method will destroy current ongoing chat.
324
377
  client.destroyChat()
325
378
  ```
326
379
 
380
+ ### `fetchMessages`
381
+
382
+ This method is used to get all the previous messages, it is usually used
383
+ together with `loadOngoingChat`. You would use this method after chat
384
+ is connected.
385
+
386
+ ```ts
387
+ client.on("chat.connected", async () => {
388
+ const messages = await client.fetchMessages()
389
+ })
390
+ ```
391
+
327
392
  ### `sendTextMessage`
328
393
 
329
394
  Send a text message:
@@ -358,12 +423,12 @@ Create cobrowse code digits:
358
423
  client.createCobrowseCode()
359
424
  ```
360
425
 
361
- ### `sendChatTranscript`
426
+ ### `sendChatTranscripts`
362
427
 
363
- Send current chat transcript to the given emails.
428
+ Send current chat transcripts to the given emails.
364
429
 
365
430
  ```ts
366
- client.sendChatTranscript([
431
+ client.sendChatTranscripts([
367
432
  "name1@example.com",
368
433
  "name2@example.com",
369
434
  ])
@@ -486,6 +551,16 @@ client.on("authenticated", () => {
486
551
  })
487
552
  ```
488
553
 
554
+ ### chat.ongoing
555
+
556
+ Emit when there is an ongoing chat.
557
+
558
+ ```js
559
+ client.on("chat.ongoing", (chat) => {
560
+ console.log(chat)
561
+ })
562
+ ```
563
+
489
564
  ### chat.updated
490
565
 
491
566
  Emit when `chat` instance has updated.
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var E$=Object.defineProperty;var k$=(e,r,t)=>r in e?E$(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var bt=(e,r,t)=>(k$(e,typeof r!="symbol"?r+"":r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R$="qa",h0="3.0.4",vg="https://main.api.ujetqa.co",Or={companyId:"",tenant:"",trackerId:"",deviceId:"",application:"websdk",version:h0};function $$(e){return(e==null?void 0:e.constructor)===Object}async function mg(e,r=3){let t=0,n;for(;t<=r;){t+=1;try{return await e()}catch(i){n=i,console.error(i),await O$(1e3*Math.pow(2,t))}}throw n}function O$(e){return new Promise(r=>{setTimeout(()=>{r(0)},e)})}const gg=[];class ts{constructor(r){bt(this,"channel");this.channel=r}static addHandler(r){gg.push(r)}debug(...r){this._log("debug",...r)}info(...r){this._log("info",...r)}warn(...r){this._log("warn",...r)}error(...r){this._log("error",...r)}_log(r,...t){gg.forEach(n=>{n(this.channel,r,...t)})}}const I$=(e,r,...t)=>{console[r](`[${r}][${e}]`,...t)};function P$(e){return function(r,t,...n){const i="https://log-api.newrelic.com/log/v1",a=v0(r,t,...n);return fetch(i,{method:"POST",body:JSON.stringify(a),headers:{"api-key":e,"content-type":"application/json"}})}}function v0(e,r,...t){let n=t.pop();typeof n=="string"&&(t.push(n),n={});const i=t.join(" "),a={loglevel:r,channel:e,timestamp:new Date().toISOString(),application:Or.application,version:Or.version,device:Or.deviceId,tenant:Or.tenant,company_id:Or.companyId,location_url:location.href,data:M$(n),message:fv(i)};return Or.trackerId&&(a.tracker_id=Or.trackerId),a}const A$=["user","phone","phone_number","phoneNumber","email"],x$=[/(?:3[47]\d|(?:4\d|5[1-5]|65)\d{2}|6011)\d{12}/g,/(?!(000|666|9))\d{3}-(?!00)\d{2}-(?!0000)\d{4}/g,/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/g];function fv(e){return typeof e=="string"?x$.forEach(r=>{e=e.replace(r,"__MASKED__")}):e&&$$(e)&&(e={...e},Object.keys(e).forEach(r=>{A$.indexOf(r)!==-1?e[r]="__MASKED__":fv(e[r])})),e}function M$(e){if(e.error){const r=e.error;return{error:{name:r.name,message:r.message,stack:r.stack}}}return fv(e.data)}const $f=new ts("communicator");class N${constructor(r,t){bt(this,"events");bt(this,"options");bt(this,"channel");bt(this,"authenticate");bt(this,"channelReady",!1);bt(this,"pending",[]);bt(this,"promises",{});bt(this,"user");this.authenticate=r.authenticate,this.events=t,this.options=L$(r),this.channel=new MessageChannel,this.refreshToken(),this.useConnect(this.options)}useConnect(r){const t=document.createElement("iframe");t.id="ujet-bridge",t.src=r.bridge,t.setAttribute("style","display:none");let n="*";/^https\:/.test(r.bridge)&&(n=new URL(r.bridge).origin),t.addEventListener("load",()=>{if($f.debug("iframe bridge ready for",n),!this.channelReady){const i={type:"_init",data:r};t.contentWindow.postMessage(i,n,[this.channel.port2])}}),this.channel.port1.onmessage=i=>{this.receiveMessage(i)},document.body.appendChild(t)}receiveMessage(r){const t=r.data;if(t)if($f.debug("receiveMessage",t),t.type==="ready")this.channelReady=!0,Or.deviceId=t.result.deviceId,this.runPending(),this.events.triggerEvent("ready");else if(t.type==="callback"&&t.callbackId){const[n,i]=this.promises[t.callbackId];t.error?i(t.error):(n(t.result),t.request==="_auth"&&this.events.triggerEvent("authenticated")),delete this.promises[t.callbackId]}else t.type==="refreshToken"&&this.refreshToken()}postMessage(r){this.channelReady?($f.debug("postMessage",r),this.channel.port1.postMessage(r)):this.pending.push(r)}runPending(){for(;this.pending.length;){const r=this.pending.shift();this.postMessage(r)}}postPromise(r,t){return new Promise((n,i)=>{const a=Math.random().toString(36).slice(2)+"_"+Date.now();this.promises[a]=[n,i];const s={type:r,callbackId:a,data:t};this.postMessage(s)})}async refreshToken(){const r=await this.authenticate(),t=["twilio_chat","nexmo_chat"];this.options.cobrowse&&t.push("cobrowse");const i={type:"_auth",data:{modules:t,user:{token:r.token,company_id:this.options.companyId}}};this.postMessage(i);const a=JSON.parse(atob(r.token.split(".")[1]));this.user={identity:a.identity,name:a.name,email:a.email}}request(r,t){const n={url:r,options:t};return this.postPromise("request",n)}}function L$(e){var i;let r=e.host;r||(e.tenant?r=vg.replace("main.api",e.tenant+".api"):r=vg);const t=e.lang||"en",n=!!((i=e.cobrowse)!=null&&i.enabled);return{host:r,lang:t,cobrowse:n,companyId:e.companyId,location:location.href,bridge:e.bridge||"https://websdk.ujetqa.co/v3/bridge.html"}}const yg=new ts("MediaStore"),D$=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB,j$="chat-media",bg=1,el="file";class m0{constructor(){bt(this,"db")}store(){return new Promise((r,t)=>{if(this.db)return r(_g(this.db));const n=D$.open(j$,bg);n.onerror=()=>{t(new Error("indexedDB open failed"))},n.onsuccess=()=>{const i=n.result;this.db=i,r(_g(i))},n.onupgradeneeded=i=>{const a=n.result;i.oldVersion>0&&i.oldVersion<bg&&(yg.info("deprecating media store"),a.deleteObjectStore(el)),yg.info("creating media store"),a.createObjectStore(el)}})}async save(r,t){(await this.store()).put({index:r,file:t},r)}async getAll(){const r=await this.store();return await new Promise((t,n)=>{const i=r.getAll();i.onerror=()=>{n(new Error("indexedDB getAll failed"))},i.onsuccess=()=>{t(i.result)}})}async getAllFiles(){const r={};return(await this.getAll()).forEach(n=>{r[n.index]=n.file}),r}async clear(){(await this.store()).clear()}}function _g(e){return e.transaction(el,"readwrite").objectStore(el)}class dv{constructor(){bt(this,"handlers",{})}addEventListener(r,t){this.handlers[r]||(this.handlers[r]=[]),this.handlers[r].push(t)}triggerEvent(r,t){const n=this.handlers[r];n&&n.forEach(i=>{i(t)})}removeEventListener(r,t){if(this.handlers[r]){const n=this.handlers[r].indexOf(t);this.handlers[r].splice(n,1)}}destroy(){this.handlers={}}}const F$=new ts("chat-provider");class pv{constructor(r,t){bt(this,"audio");bt(this,"issueChatToken");bt(this,"identity");bt(this,"channelId");bt(this,"region");bt(this,"events");this.events=new dv,this.region=r.region,this.issueChatToken=t}ping(){this.audio||(this.audio=new window.Audio("https://websdk.ujetqa.co/v3/ping.mp3"));try{this.audio.play()}catch(r){F$.warn("Chat audio play failed",{error:r})}}on(r,t){this.events.addEventListener(r,t)}off(r,t){this.events.removeEventListener(r,t)}}bt(pv,"type","base");const g0={};function hv(e){g0[e.type]=e}function U$(e){return g0[e]}const B$=["assigned","va_assigned"],y0=["dismissed","va_dismissed"],q$=["queued",...B$,...y0],G$=["timeout","canceled","failed","finished"],wg=new ts("Chat");class V${constructor(r,t){bt(this,"provider");bt(this,"state");bt(this,"store");bt(this,"globalEvents");bt(this,"connected",!1);bt(this,"allowSkipVirtualAgent",!1);this.state=r,this.store=new m0;const n=U$(this.state.provider_type);this.provider=new n(r,t)}_setGlobalEvents(r){this.globalEvents=r,this.on("message",t=>{r.triggerEvent("chat.message",t),this.registerMessageEvents(t)}),this.on("memberJoined",t=>{r.triggerEvent("chat.memberJoined",t)}),this.on("memberLeft",t=>{r.triggerEvent("chat.memberLeft",t)}),this.on("typingStarted",t=>{r.triggerEvent("chat.typingStarted",t)}),this.on("typingEnded",t=>{r.triggerEvent("chat.typingEnded",t)})}get id(){return this.state.id}get menuId(){return this.state.menus[this.state.menus.length-1].id}get channelId(){return this.state.provider_channel_id}get lang(){return this.state.lang}get userIdentity(){return this.provider.identity}get status(){return this.state.status}get statusText(){return this.state.status_text}get cobrowsable(){return this.state.features.indexOf("cobrowse")!==-1}get ongoing(){return q$.indexOf(this.state.status)!=-1}get dismissed(){return y0.indexOf(this.state.status)!=-1}get ended(){return G$.indexOf(this.state.status)!=-1}get transcriptCount(){return this.state.transcript_requested_count}get createdAt(){return this.state.created_at}get feedbackType(){var r;return this.state.survey_enabled?"survey":(r=this.state.csat_settings)!=null&&r.enabled?"rate":"none"}update(r){r.id==this.state.id&&(this.state=r,this.triggerEvent("updated",this))}on(r,t){this.provider.events.addEventListener(r,t)}off(r,t){this.provider.events.removeEventListener(r,t)}async connect(){try{return await mg(()=>this.provider.create(),3),await mg(()=>this.provider.join(this.state.provider_channel_id),3),this.connected=!0,this.triggerEvent("connected"),wg.info("connected with provider",this.state.provider_type),!0}catch{return!1}}async disconnect(){this.connected=!1,this.triggerEvent("disconnected"),this.provider.events.destroy(),await this.provider.destroy(),wg.info("disconnect with provider",this.state.provider_type)}async sendMessage(r,t){const n=await this.provider.sendMessage(r);return t&&this.store.save(n,t),n}preview(r){return this.provider.preview(r)}async fetchMessages(){const r=await this.store.getAllFiles();return this.provider.fetchMessages(r)}startTyping(){return this.provider.startTyping()}stopTyping(){return this.provider.stopTyping()}async destroy(){this.provider&&(await this.clearMediaStore(),this.triggerEvent("destroyed"),this.provider=null),this.state=null}async clearMediaStore(){await this.store.clear()}triggerEvent(r,t){this.provider.events.triggerEvent(r,t),this.globalEvents&&this.globalEvents.triggerEvent("chat."+r,t)}registerMessageEvents(r){r.event==="cobrowseRequestedFromAgent"?this.provider.events.triggerEvent("_requestCobrowse","agent"):r.event==="cobrowseRequestedFromEndUser"?this.provider.events.triggerEvent("_requestCobrowse","end_user"):r.event==="chatDismissed"?(this.state.status="dismissed",this.triggerEvent("dismissed")):r.event==="chatEnded"&&(this.disconnect(),r.timeout?(this.state.status="timeout",this.triggerEvent("timeout")):(this.state.status="finished",this.triggerEvent("ended")))}}function z$(e,r,t,n){const i=new FormData;Object.keys(t).forEach(s=>{i.append(s,t[s])}),i.append("file",e);const a=new XMLHttpRequest;return a.open("POST",r,!0),n&&(a.onprogress=s=>{n(s.loaded)}),new Promise((s,c)=>{a.onreadystatechange=function(){if(a.readyState===a.DONE){if(a.status>=500){const o=new Error(`xhr:${a.status}:server_error`);return c(o)}if(a.status>=200&&a.status<300){const o=W$(a.responseText);s(o)}else if(a.status>=400){let o="unknown";const u=new Error(`xhr:${a.status}:${o}`);c(u)}}},a.ontimeout=function(){const o=new Error("xhr:ontimeout");c(o),a.abort()},a.onerror=function(){const o=new Error("xhr:onerror");c(o)},a.send(i)})}function W$(e){return new window.DOMParser().parseFromString(e,"text/xml").getElementsByTagName("Key")[0].childNodes[0].nodeValue}function H$(e="none"){return/^image/.test(e)?"photo":/^video/.test(e)?"video":"file"}function b0(e){return e.map(K$).filter(r=>r.enabled)}function K$(e){const r={id:e.id,enabled:!0,channels:[]};if(e.hidden||!e.name||!e.name.trim())return r.enabled=!1,r;r.name=e.name.trim();const t=J$(e);if(t&&(r.redirection=e.redirection),e.children&&e.children.length){const n=b0(e.children);return r.enabled=n.length>0||t,r.children=n,r}if(!e.channels)r.enabled=t;else{const{channels:n,deflection:i}=Y$(e.channels);r.deflection=i,t||(r.channels=n),r.enabled=n.length>0||t}return r}function J$(e){let r=!1;const t=e.redirection;return t&&(t.option==="message"||t.option==="url")&&(r=!!t.data),r}function Y$(e){const r=X$(e);Q$(e).forEach(a=>{r.push(a)});let n=null;const i=e.chat;return i&&i.deflected&&(n={enabled:!0,type:i.deflected_reason}),{channels:r,deflection:n}}function X$(e){const r=[],t=e.chat;return t&&(t.enabled||t.virtual_agent_available)&&r.push({...e.chat,type:"chat"}),e.voice_call&&e.voice_call.instant_enabled&&r.push({...e.voice_call,type:"instant_call"}),e.voice_call&&e.voice_call.schedule_enabled&&r.push({...e.voice_call,type:"scheduled_call",deflection_type:e.voice_call.schedule_deflection_type}),e.email&&e.email.enabled&&r.push({...e.email,type:"email"}),t&&t.deflected&&t.deflected_reason==="over_capacity"&&t.keep_waiting&&r.push({...t,enabled:!0,type:"keep_waiting",deflection_type:t.deflected_reason}),r}function Q$(e){const r=[];return e.external_deflection_link&&e.external_deflection_link.enabled&&e.external_deflection_link.links.forEach(n=>{n.enabled&&r.push({...n,type:"external_link"})}),r}const Z$={en:"English (US)","en-CA":"English (Canada)","en-GB":"English (UK)",es:"Español (España)","es-MX":"Español (México)",fr:"Français (France)","fr-CA":"Français (Canada)",de:"Deutsch",ja:"日本語",ko:"한국어",it:"Italiano",zh:"中文 (简体)","zh-Hant":"中文 (繁體)",sv:"Svenska",pt:"Português (Portugal)","pt-BR":"Português (Brasil)",fi:"Suomi",nb:"Norsk",da:"Dansk",nl:"Nederlands",tr:"Türk",vi:"Tiếng Việt",th:"คนไทย",ar:"اَلْعَرَبِيَّةُ"};function eO(e){return{languages:e.languages.filter(t=>t.enabled).map(t=>({lang:t.lang,name:t.name,localeName:Z$[t.lang]})),name:e.display_name,subdomain:e.subdomain,support_email:e.support_email,action_tracking:e.action_tracking_enabled,email_transcripts:e.chat_settings.email_transcripts,message_preview:e.chat_settings.message_preview,email_enhancement:e.email_enhancement_enabled}}class tO{constructor(r){bt(this,"request");this.request=r}get(r,t){if(t){let n=[];Object.keys(t).forEach(i=>{const a=t[i];a!==void 0&&n.push(`${encodeURIComponent(i)}=${encodeURIComponent(a)}`)}),r+="?"+n.join("&")}return this.request(r,{method:"GET"})}post(r,t){const n={method:"POST"};return n.body=JSON.stringify(t),this.request(r,n)}patch(r,t){const n={method:"PATCH"};return n.body=JSON.stringify(t),this.request(r,n)}put(r,t){const n={method:"PUT"};return n.body=JSON.stringify(t),this.request(r,n)}async getTriggers(r){const t={"UJET-Company-Id":r};return(await this.request("proactive_chat_triggers",{method:"GET",headers:t})).data}async getCompany(){const r=await this.get("company");return eO(r.data)}async getMenus(r,t){const n={type:"web_menu",lang:r,direct_access_key:t},i=await this.get("menus",n),a={key:!!t,user:!1},s=i.headers["ujet-direct-access"];return s&&s!="false"&&(a.user=!0),{menus:b0(i.data),direct:a}}async getAfterHourMessage(r){return(await this.get(`audible_messages/${r}`)).data["after_hours.message"].text}async getTimeSlots(r,t="en"){return(await this.get(`menus/${r}/time_slots`,{type:"web_menu",lang:t})).data}async getWaitTimes(r,t="en"){return(await this.get(`menus/${r}/wait_times`,{type:"web_menu",lang:t})).data}async finishChat(r){return(await this.patch(`chats/${r}`,{status:"finished"})).data}getChatDeflection(r){return this.get(`chats/${r}/deflections`)}sendChatCustomData(r,t){let n;return typeof t=="string"?n={signed:!0,signed_data:t}:n={signed:!1,data:t},this.post(`chats/${r}/custom_data`,n)}sendChatTranscript(r,t){return this.post(`chats/${r}/transcripts`,{emails:t.join(",")})}escalateChat(r,t){return this.post(`chats/${r}/escalations`,t)}trackEscalation(r,t,n){return this.put(`chats/${r}/escalations/${t}`,{escalation_id:t,deflection_channel:n})}requestChatCobrowse(r,t){return this.post(`chats/${r}/cobrowse`,t)}rateChat(r,t){return this.patch(`chats/${r}/rating`,t)}async getChatSurvey(r){return(await this.get(`chats/${r}/survey`)).data}sendChatSurvey(r,t){const n={chat_id:r,answers:t};return this.put(`chats/${r}/survey`,n)}async createChat(r,t,n,i){const a={chat:{menu_id:r,lang:t,email:n.email,greeting:n.greeting,trigger_id:n.trigger_id,ticket_id:n.ticket_id},cobrowsable:n.cobrowsable},c=(await this.post("chats",a)).data;return this.wrapChat(c,i)}async loadChat(r,t){const n=await this.getChat(r);return this.wrapChat(n,t)}async resumeChat(r,t){const n=await this.patch(`chats/${r}`,{status:"queued"});return this.wrapChat(n.data,t)}async uploadChatFile(r,t,n){const i=H$(t.type),a=t.name.replace(/\.[^.]+$/i,""),s=await this.post(`chats/${r}/${i}s/upload`,{filename:a}),c=await z$(t,s.data.url,s.data.fields,n),u=(await this.post(`chats/${r}/${i}s`,{chat_id:r,[i]:{s3_path:c,photo_type:i}})).data;return u.type=i,u}async getChat(r){return(await this.get(`chats/${r}`)).data}wrapChat(r,t){const n=async()=>(await this.post(`chats/${r.id}/tokens`,{provider_type:r.provider_type,device_id:t})).data,i=new V$(r,n),a=async()=>{if(i.status==="va_assigned"){const c=(await this.get(`menus/${i.menuId}/virtual_agent_settings`,{lang:i.lang})).data.allow_skip_virtual_agent;i.allowSkipVirtualAgent=c}};if(i.channelId)i.connect(),a();else{const s=setInterval(async()=>{const c=await this.getChat(i.id);c.provider_channel_id&&(i.update(c),i.connect(),a(),clearInterval(s))},1500)}return i}async createCall(r,t,n){let i="recording_permission_not_asked";n.recording_permission===!0?i="recording_permission_granted":i="recording_permission_denied";const a={type:n.scheduled_at?"web_scheduled_call":"web_instant_call",menu_id:r,lang:t,email:n.email,ticket_id:n.ticket_id,recording_permission:i,scheduled_at:n.scheduled_at,end_user:{phone_number:n.phone_number}},c=(await this.post("calls",{call:a,cobrowsable:!1})).data;return c.menu_id=c.selected_menu.id,c}async fetchCall(r){const n=(await this.get(`calls/${r}`)).data;return n.menu_id=n.selected_menu.id,n}async cancelCall(r){const n=(await this.patch(`calls/${r}`,{status:"failed",fail_reason:"canceled"})).data;return n.menu_id=n.selected_menu.id,n}async listFileTypes(){return(await this.get("email_prohibited_file_types")).data}createEmail(r,t,n){const i={end_user_email:n.email,email_body:n.content,menu_id:r.toString(),lang:t};return n.name&&(i.end_user_name=n.name),n.recaptcha&&(i.recaptcha_response=n.recaptcha),n.files&&(i["email_attachments[]"]=[...n.files]),this.request("emails",{form:i})}}const Of="ujet:",Dr={set(e,r){return localStorage.setItem(Of+e,r)},get(e){return localStorage.getItem(Of+e)},del(e){return localStorage.removeItem(Of+e)}},_0={href:window.location.href,interval:24*60*60};function rO(e,r){if(!Array.isArray(e)||!e.length)return null;const t=oO(),n=t===0,i=t+1;return uO(i),e.filter(s=>{const c=nO(s,_0.href),o=iO(s.visitor_type,n),u=aO(s.messages,r),l=i>=s.page_visit_count,f=!sO(s.id);return c&&o&&u&&l&&f}).sort((s,c)=>s.stay_time-c.stay_time)[0]||null}function nO(e,r){const t=e.keywords_included||[],n=e.keywords_excluded||[];if(!t.length&&!n.length)return!0;const i=t.filter(s=>r.indexOf(s)!==-1).length,a=n.filter(s=>r.indexOf(s)===-1).length;return!!i||!!a}function iO(e,r){return e==="visitor_type_new"?r:e==="visitor_type_returning"?!r:!0}function aO(e,r){return e.filter(n=>n.lang===r).length>0}function sO(e){try{const r=parseInt(Dr.get(`trigger:${e}`),10);return Date.now()/1e3-r<_0.interval}catch{return!1}}function oO(){try{const e=Dr.get("visits");return e?parseInt(e,10):0}catch{return 0}}function uO(e){try{Dr.set("visits",e.toString())}catch{}}class vv{constructor(r,t,n){bt(this,"lang");bt(this,"messages");bt(this,"_cobrowse");bt(this,"_started",!1);this._cobrowse=r,this.messages=t,this.lang=n}static async create(r){const t=await cO();t.license=r.license;const n=r.trustedOrigins||[];return n.push(location.origin),t.trustedOrigins=n,["api","capabilities","registration","redactedViews","unredactedViews"].forEach(a=>{r[a]!==void 0&&(t[a]=r[a])}),new vv(t,r.messages,r.lang)}setCustomData(r){this._cobrowse.customData=r}on(r,t){this._cobrowse.on(r,t)}async start(){this._started||(await this._cobrowse.client(),await this._cobrowse.start(),this._started=!0,fO(this._cobrowse,this.messages,this.lang),dO(this._cobrowse,this.messages.endSessionText,this.lang))}async stop(){await this._cobrowse.stop(),this._started=!1}async endSession(){this._cobrowse.currentSession&&await this._cobrowse.currentSession.end()}async createSessionCode(){return this._cobrowse.currentSession?this._cobrowse.currentSession.code():await this._cobrowse.createSessionCode()}}function cO(){return window.CobrowseIO?window.CobrowseIO:new Promise(e=>{const r=document.createElement("script");r.src="https://js.cobrowse.io/CobrowseIO.js",r.async=!0;const t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(r,t),r.onload=function(){e(window.CobrowseIO)}})}const lO=`<dialog open class="cobrowse-dialog">
1
+ "use strict";var E$=Object.defineProperty;var k$=(e,r,t)=>r in e?E$(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var bt=(e,r,t)=>(k$(e,typeof r!="symbol"?r+"":r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R$="qa",h0="3.0.5",vg="https://main.api.ujetqa.co",Or={companyId:"",tenant:"",trackerId:"",deviceId:"",application:"websdk",version:h0};function $$(e){return(e==null?void 0:e.constructor)===Object}async function mg(e,r=3){let t=0,n;for(;t<=r;){t+=1;try{return await e()}catch(i){n=i,console.error(i),await O$(1e3*Math.pow(2,t))}}throw n}function O$(e){return new Promise(r=>{setTimeout(()=>{r(0)},e)})}const gg=[];class ts{constructor(r){bt(this,"channel");this.channel=r}static addHandler(r){gg.push(r)}debug(...r){this._log("debug",...r)}info(...r){this._log("info",...r)}warn(...r){this._log("warn",...r)}error(...r){this._log("error",...r)}_log(r,...t){gg.forEach(n=>{n(this.channel,r,...t)})}}const I$=(e,r,...t)=>{console[r](`[${r}][${e}]`,...t)};function P$(e){return function(r,t,...n){const i="https://log-api.newrelic.com/log/v1",a=v0(r,t,...n);return fetch(i,{method:"POST",body:JSON.stringify(a),headers:{"api-key":e,"content-type":"application/json"}})}}function v0(e,r,...t){let n=t.pop();typeof n=="string"&&(t.push(n),n={});const i=t.join(" "),a={loglevel:r,channel:e,timestamp:new Date().toISOString(),application:Or.application,version:Or.version,device:Or.deviceId,tenant:Or.tenant,company_id:Or.companyId,location_url:location.href,data:M$(n),message:fv(i)};return Or.trackerId&&(a.tracker_id=Or.trackerId),a}const A$=["user","phone","phone_number","phoneNumber","email"],x$=[/(?:3[47]\d|(?:4\d|5[1-5]|65)\d{2}|6011)\d{12}/g,/(?!(000|666|9))\d{3}-(?!00)\d{2}-(?!0000)\d{4}/g,/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/g];function fv(e){return typeof e=="string"?x$.forEach(r=>{e=e.replace(r,"__MASKED__")}):e&&$$(e)&&(e={...e},Object.keys(e).forEach(r=>{A$.indexOf(r)!==-1?e[r]="__MASKED__":fv(e[r])})),e}function M$(e){if(e.error){const r=e.error;return{error:{name:r.name,message:r.message,stack:r.stack}}}return fv(e.data)}const $f=new ts("communicator");class N${constructor(r,t){bt(this,"events");bt(this,"options");bt(this,"channel");bt(this,"authenticate");bt(this,"channelReady",!1);bt(this,"pending",[]);bt(this,"promises",{});bt(this,"user");this.authenticate=r.authenticate,this.events=t,this.options=L$(r),this.channel=new MessageChannel,this.refreshToken(),this.useConnect(this.options)}useConnect(r){const t=document.createElement("iframe");t.id="ujet-bridge",t.src=r.bridge,t.setAttribute("style","display:none");let n="*";/^https\:/.test(r.bridge)&&(n=new URL(r.bridge).origin),t.addEventListener("load",()=>{if($f.debug("iframe bridge ready for",n),!this.channelReady){const i={type:"_init",data:r};t.contentWindow.postMessage(i,n,[this.channel.port2])}}),this.channel.port1.onmessage=i=>{this.receiveMessage(i)},document.body.appendChild(t)}receiveMessage(r){const t=r.data;if(t)if($f.debug("receiveMessage",t),t.type==="ready")this.channelReady=!0,Or.deviceId=t.result.deviceId,this.runPending(),this.events.triggerEvent("ready");else if(t.type==="callback"&&t.callbackId){const[n,i]=this.promises[t.callbackId];t.error?i(t.error):(n(t.result),t.request==="_auth"&&this.events.triggerEvent("authenticated")),delete this.promises[t.callbackId]}else t.type==="refreshToken"&&this.refreshToken()}postMessage(r){this.channelReady?($f.debug("postMessage",r),this.channel.port1.postMessage(r)):this.pending.push(r)}runPending(){for(;this.pending.length;){const r=this.pending.shift();this.postMessage(r)}}postPromise(r,t){return new Promise((n,i)=>{const a=Math.random().toString(36).slice(2)+"_"+Date.now();this.promises[a]=[n,i];const s={type:r,callbackId:a,data:t};this.postMessage(s)})}async refreshToken(){const r=await this.authenticate(),t=["twilio_chat","nexmo_chat"];this.options.cobrowse&&t.push("cobrowse");const i={type:"_auth",data:{modules:t,user:{token:r.token,company_id:this.options.companyId}}};this.postMessage(i);const a=JSON.parse(atob(r.token.split(".")[1]));this.user={identity:a.identity,name:a.name,email:a.email}}request(r,t){const n={url:r,options:t};return this.postPromise("request",n)}}function L$(e){var i;let r=e.host;r||(e.tenant?r=vg.replace("main.api",e.tenant+".api"):r=vg);const t=e.lang||"en",n=!!((i=e.cobrowse)!=null&&i.enabled);return{host:r,lang:t,cobrowse:n,companyId:e.companyId,location:location.href,bridge:e.bridge||"https://websdk.ujetqa.co/v3/bridge.html"}}const yg=new ts("MediaStore"),D$=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB,j$="chat-media",bg=1,el="file";class m0{constructor(){bt(this,"db")}store(){return new Promise((r,t)=>{if(this.db)return r(_g(this.db));const n=D$.open(j$,bg);n.onerror=()=>{t(new Error("indexedDB open failed"))},n.onsuccess=()=>{const i=n.result;this.db=i,r(_g(i))},n.onupgradeneeded=i=>{const a=n.result;i.oldVersion>0&&i.oldVersion<bg&&(yg.info("deprecating media store"),a.deleteObjectStore(el)),yg.info("creating media store"),a.createObjectStore(el)}})}async save(r,t){(await this.store()).put({index:r,file:t},r)}async getAll(){const r=await this.store();return await new Promise((t,n)=>{const i=r.getAll();i.onerror=()=>{n(new Error("indexedDB getAll failed"))},i.onsuccess=()=>{t(i.result)}})}async getAllFiles(){const r={};return(await this.getAll()).forEach(n=>{r[n.index]=n.file}),r}async clear(){(await this.store()).clear()}}function _g(e){return e.transaction(el,"readwrite").objectStore(el)}class dv{constructor(){bt(this,"handlers",{})}addEventListener(r,t){this.handlers[r]||(this.handlers[r]=[]),this.handlers[r].push(t)}triggerEvent(r,t){const n=this.handlers[r];n&&n.forEach(i=>{i(t)})}removeEventListener(r,t){if(this.handlers[r]){const n=this.handlers[r].indexOf(t);this.handlers[r].splice(n,1)}}destroy(){this.handlers={}}}const F$=new ts("chat-provider");class pv{constructor(r,t){bt(this,"audio");bt(this,"issueChatToken");bt(this,"identity");bt(this,"channelId");bt(this,"region");bt(this,"events");this.events=new dv,this.region=r.region,this.issueChatToken=t}ping(){this.audio||(this.audio=new window.Audio("https://websdk.ujetqa.co/v3/ping.mp3"));try{this.audio.play()}catch(r){F$.warn("Chat audio play failed",{error:r})}}on(r,t){this.events.addEventListener(r,t)}off(r,t){this.events.removeEventListener(r,t)}}bt(pv,"type","base");const g0={};function hv(e){g0[e.type]=e}function U$(e){return g0[e]}const B$=["assigned","va_assigned"],y0=["dismissed","va_dismissed"],q$=["queued",...B$,...y0],G$=["timeout","canceled","failed","finished"],wg=new ts("Chat");class V${constructor(r,t){bt(this,"provider");bt(this,"state");bt(this,"store");bt(this,"globalEvents");bt(this,"connected",!1);bt(this,"allowSkipVirtualAgent",!1);this.state=r,this.store=new m0;const n=U$(this.state.provider_type);this.provider=new n(r,t)}_setGlobalEvents(r){this.globalEvents=r,this.on("message",t=>{r.triggerEvent("chat.message",t),this.registerMessageEvents(t)}),this.on("memberJoined",t=>{r.triggerEvent("chat.memberJoined",t)}),this.on("memberLeft",t=>{r.triggerEvent("chat.memberLeft",t)}),this.on("typingStarted",t=>{r.triggerEvent("chat.typingStarted",t)}),this.on("typingEnded",t=>{r.triggerEvent("chat.typingEnded",t)})}get id(){return this.state.id}get menuId(){return this.state.menus[this.state.menus.length-1].id}get channelId(){return this.state.provider_channel_id}get lang(){return this.state.lang}get userIdentity(){return this.provider.identity}get status(){return this.state.status}get statusText(){return this.state.status_text}get cobrowsable(){return this.state.features.indexOf("cobrowse")!==-1}get ongoing(){return q$.indexOf(this.state.status)!=-1}get dismissed(){return y0.indexOf(this.state.status)!=-1}get ended(){return G$.indexOf(this.state.status)!=-1}get transcriptCount(){return this.state.transcript_requested_count}get createdAt(){return this.state.created_at}get feedbackType(){var r;return this.state.survey_enabled?"survey":(r=this.state.csat_settings)!=null&&r.enabled?"rate":"none"}update(r){r.id==this.state.id&&(this.state=r,this.triggerEvent("updated",this))}on(r,t){this.provider.events.addEventListener(r,t)}off(r,t){this.provider.events.removeEventListener(r,t)}async connect(){try{return await mg(()=>this.provider.create(),3),await mg(()=>this.provider.join(this.state.provider_channel_id),3),this.connected=!0,this.triggerEvent("connected",this),wg.info("connected with provider",this.state.provider_type),!0}catch{return!1}}async disconnect(){this.connected=!1,this.triggerEvent("disconnected"),this.provider.events.destroy(),await this.provider.destroy(),wg.info("disconnect with provider",this.state.provider_type)}async sendMessage(r,t){const n=await this.provider.sendMessage(r);return t&&this.store.save(n,t),n}preview(r){return this.provider.preview(r)}async fetchMessages(){if(this.connected){const r=await this.store.getAllFiles();return this.provider.fetchMessages(r)}else throw new Error("Please fetchMessages after chat connected.")}startTyping(){return this.provider.startTyping()}stopTyping(){return this.provider.stopTyping()}async destroy(){this.provider&&(await this.clearMediaStore(),this.triggerEvent("destroyed"),this.provider=null),this.state=null}async clearMediaStore(){await this.store.clear()}triggerEvent(r,t){this.provider.events.triggerEvent(r,t),this.globalEvents&&this.globalEvents.triggerEvent("chat."+r,t)}registerMessageEvents(r){r.event==="cobrowseRequestedFromAgent"?this.provider.events.triggerEvent("_requestCobrowse","agent"):r.event==="cobrowseRequestedFromEndUser"?this.provider.events.triggerEvent("_requestCobrowse","end_user"):r.event==="chatDismissed"?(this.state.status="dismissed",this.triggerEvent("dismissed")):r.event==="chatEnded"&&(this.disconnect(),r.timeout?(this.state.status="timeout",this.triggerEvent("timeout")):(this.state.status="finished",this.triggerEvent("ended")))}}function z$(e,r,t,n){const i=new FormData;Object.keys(t).forEach(s=>{i.append(s,t[s])}),i.append("file",e);const a=new XMLHttpRequest;return a.open("POST",r,!0),n&&(a.onprogress=s=>{n(s.loaded)}),new Promise((s,c)=>{a.onreadystatechange=function(){if(a.readyState===a.DONE){if(a.status>=500){const o=new Error(`xhr:${a.status}:server_error`);return c(o)}if(a.status>=200&&a.status<300){const o=W$(a.responseText);s(o)}else if(a.status>=400){let o="unknown";const u=new Error(`xhr:${a.status}:${o}`);c(u)}}},a.ontimeout=function(){const o=new Error("xhr:ontimeout");c(o),a.abort()},a.onerror=function(){const o=new Error("xhr:onerror");c(o)},a.send(i)})}function W$(e){return new window.DOMParser().parseFromString(e,"text/xml").getElementsByTagName("Key")[0].childNodes[0].nodeValue}function H$(e="none"){return/^image/.test(e)?"photo":/^video/.test(e)?"video":"file"}function b0(e){return e.map(K$).filter(r=>r.enabled)}function K$(e){const r={id:e.id,enabled:!0,channels:[]};if(e.hidden||!e.name||!e.name.trim())return r.enabled=!1,r;r.name=e.name.trim();const t=J$(e);if(t&&(r.redirection=e.redirection),e.children&&e.children.length){const n=b0(e.children);return r.enabled=n.length>0||t,r.children=n,r}if(!e.channels)r.enabled=t;else{const{channels:n,deflection:i}=Y$(e.channels);r.deflection=i,t||(r.channels=n),r.enabled=n.length>0||t}return r}function J$(e){let r=!1;const t=e.redirection;return t&&(t.option==="message"||t.option==="url")&&(r=!!t.data),r}function Y$(e){const r=X$(e);Q$(e).forEach(a=>{r.push(a)});let n=null;const i=e.chat;return i&&i.deflected&&(n={enabled:!0,type:i.deflected_reason}),{channels:r,deflection:n}}function X$(e){const r=[],t=e.chat;return t&&(t.enabled||t.virtual_agent_available)&&r.push({...e.chat,type:"chat"}),e.voice_call&&e.voice_call.instant_enabled&&r.push({...e.voice_call,type:"instant_call"}),e.voice_call&&e.voice_call.schedule_enabled&&r.push({...e.voice_call,type:"scheduled_call",deflection_type:e.voice_call.schedule_deflection_type}),e.email&&e.email.enabled&&r.push({...e.email,type:"email"}),t&&t.deflected&&t.deflected_reason==="over_capacity"&&t.keep_waiting&&r.push({...t,enabled:!0,type:"keep_waiting",deflection_type:t.deflected_reason}),r}function Q$(e){const r=[];return e.external_deflection_link&&e.external_deflection_link.enabled&&e.external_deflection_link.links.forEach(n=>{n.enabled&&r.push({...n,type:"external_link"})}),r}const Z$={en:"English (US)","en-CA":"English (Canada)","en-GB":"English (UK)",es:"Español (España)","es-MX":"Español (México)",fr:"Français (France)","fr-CA":"Français (Canada)",de:"Deutsch",ja:"日本語",ko:"한국어",it:"Italiano",zh:"中文 (简体)","zh-Hant":"中文 (繁體)",sv:"Svenska",pt:"Português (Portugal)","pt-BR":"Português (Brasil)",fi:"Suomi",nb:"Norsk",da:"Dansk",nl:"Nederlands",tr:"Türk",vi:"Tiếng Việt",th:"คนไทย",ar:"اَلْعَرَبِيَّةُ"};function eO(e){return{languages:e.languages.filter(t=>t.enabled).map(t=>({lang:t.lang,name:t.name,localeName:Z$[t.lang]})),name:e.display_name,subdomain:e.subdomain,support_email:e.support_email,action_tracking:e.action_tracking_enabled,email_transcripts:e.chat_settings.email_transcripts,message_preview:e.chat_settings.message_preview,email_enhancement:e.email_enhancement_enabled}}class tO{constructor(r){bt(this,"request");this.request=r}get(r,t){if(t){let n=[];Object.keys(t).forEach(i=>{const a=t[i];a!==void 0&&n.push(`${encodeURIComponent(i)}=${encodeURIComponent(a)}`)}),r+="?"+n.join("&")}return this.request(r,{method:"GET"})}post(r,t){const n={method:"POST"};return n.body=JSON.stringify(t),this.request(r,n)}patch(r,t){const n={method:"PATCH"};return n.body=JSON.stringify(t),this.request(r,n)}put(r,t){const n={method:"PUT"};return n.body=JSON.stringify(t),this.request(r,n)}async getTriggers(r){const t={"UJET-Company-Id":r};return(await this.request("proactive_chat_triggers",{method:"GET",headers:t})).data}async getCompany(){const r=await this.get("company");return eO(r.data)}async getMenus(r,t){const n={type:"web_menu",lang:r,direct_access_key:t},i=await this.get("menus",n),a={key:!!t,user:!1},s=i.headers["ujet-direct-access"];return s&&s!="false"&&(a.user=!0),{menus:b0(i.data),direct:a}}async getAfterHourMessage(r){return(await this.get(`audible_messages/${r}`)).data["after_hours.message"].text}async getTimeSlots(r,t="en"){return(await this.get(`menus/${r}/time_slots`,{type:"web_menu",lang:t})).data}async getWaitTimes(r,t="en"){return(await this.get(`menus/${r}/wait_times`,{type:"web_menu",lang:t})).data}async finishChat(r){return(await this.patch(`chats/${r}`,{status:"finished"})).data}async getChatDeflection(r){const{data:t}=await this.get(`chats/${r}/deflections`);return t&&t.enabled?t:null}sendChatCustomData(r,t){let n;return typeof t=="string"?n={signed:!0,signed_data:t}:n={signed:!1,data:t},this.post(`chats/${r}/custom_data`,n)}sendChatTranscripts(r,t){return this.post(`chats/${r}/transcripts`,{emails:t.join(",")})}escalateChat(r,t){return this.post(`chats/${r}/escalations`,t)}trackEscalation(r,t,n){return this.put(`chats/${r}/escalations/${t}`,{escalation_id:t,deflection_channel:n})}requestChatCobrowse(r,t){return this.post(`chats/${r}/cobrowse`,t)}rateChat(r,t){return this.patch(`chats/${r}/rating`,t)}async getChatSurvey(r){return(await this.get(`chats/${r}/survey`)).data}sendChatSurvey(r,t){const n={chat_id:r,answers:t};return this.put(`chats/${r}/survey`,n)}async createChat(r,t,n,i){const a={chat:{menu_id:r,lang:t,email:n.email,greeting:n.greeting,trigger_id:n.trigger_id,ticket_id:n.ticket_id},cobrowsable:n.cobrowsable},c=(await this.post("chats",a)).data;return this.wrapChat(c,i)}async loadChat(r,t){const n=await this.getChat(r);return this.wrapChat(n,t)}async resumeChat(r,t){const n=await this.patch(`chats/${r}`,{status:"queued"});return this.wrapChat(n.data,t)}async uploadChatFile(r,t,n){const i=H$(t.type),a=t.name.replace(/\.[^.]+$/i,""),s=await this.post(`chats/${r}/${i}s/upload`,{filename:a}),c=await z$(t,s.data.url,s.data.fields,n),u=(await this.post(`chats/${r}/${i}s`,{chat_id:r,[i]:{s3_path:c,photo_type:i}})).data;return u.type=i,u}async getChat(r){return(await this.get(`chats/${r}`)).data}wrapChat(r,t){const n=async()=>(await this.post(`chats/${r.id}/tokens`,{provider_type:r.provider_type,device_id:t})).data,i=new V$(r,n),a=async()=>{if(i.status==="va_assigned"){const c=(await this.get(`menus/${i.menuId}/virtual_agent_settings`,{lang:i.lang})).data.allow_skip_virtual_agent;i.allowSkipVirtualAgent=c}};if(i.channelId)i.connect(),a();else{const s=setInterval(async()=>{const c=await this.getChat(i.id);c.provider_channel_id&&(i.update(c),i.connect(),a(),clearInterval(s))},1500)}return i}async createCall(r,t,n){let i="recording_permission_not_asked";n.recording_permission===!0?i="recording_permission_granted":i="recording_permission_denied";const a={type:n.scheduled_at?"web_scheduled_call":"web_instant_call",menu_id:r,lang:t,email:n.email,ticket_id:n.ticket_id,recording_permission:i,scheduled_at:n.scheduled_at,end_user:{phone_number:n.phone_number}},c=(await this.post("calls",{call:a,cobrowsable:!1})).data;return c.menu_id=c.selected_menu.id,c}async fetchCall(r){const n=(await this.get(`calls/${r}`)).data;return n.menu_id=n.selected_menu.id,n}async cancelCall(r){const n=(await this.patch(`calls/${r}`,{status:"failed",fail_reason:"canceled"})).data;return n.menu_id=n.selected_menu.id,n}async listFileTypes(){return(await this.get("email_prohibited_file_types")).data}createEmail(r,t,n){const i={end_user_email:n.email,email_body:n.content,menu_id:r.toString(),lang:t};return n.name&&(i.end_user_name=n.name),n.recaptcha&&(i.recaptcha_response=n.recaptcha),n.files&&(i["email_attachments[]"]=[...n.files]),this.request("emails",{form:i})}}const Of="ujet:",Dr={set(e,r){return localStorage.setItem(Of+e,r)},get(e){return localStorage.getItem(Of+e)},del(e){return localStorage.removeItem(Of+e)}},_0={href:window.location.href,interval:24*60*60};function rO(e,r){if(!Array.isArray(e)||!e.length)return null;const t=oO(),n=t===0,i=t+1;return uO(i),e.filter(s=>{const c=nO(s,_0.href),o=iO(s.visitor_type,n),u=aO(s.messages,r),l=i>=s.page_visit_count,f=!sO(s.id);return c&&o&&u&&l&&f}).sort((s,c)=>s.stay_time-c.stay_time)[0]||null}function nO(e,r){const t=e.keywords_included||[],n=e.keywords_excluded||[];if(!t.length&&!n.length)return!0;const i=t.filter(s=>r.indexOf(s)!==-1).length,a=n.filter(s=>r.indexOf(s)===-1).length;return!!i||!!a}function iO(e,r){return e==="visitor_type_new"?r:e==="visitor_type_returning"?!r:!0}function aO(e,r){return e.filter(n=>n.lang===r).length>0}function sO(e){try{const r=parseInt(Dr.get(`trigger:${e}`),10);return Date.now()/1e3-r<_0.interval}catch{return!1}}function oO(){try{const e=Dr.get("visits");return e?parseInt(e,10):0}catch{return 0}}function uO(e){try{Dr.set("visits",e.toString())}catch{}}class vv{constructor(r,t,n){bt(this,"lang");bt(this,"messages");bt(this,"_cobrowse");bt(this,"_started",!1);this._cobrowse=r,this.messages=t,this.lang=n}static async create(r){const t=await cO();t.license=r.license;const n=r.trustedOrigins||[];return n.push(location.origin),t.trustedOrigins=n,["api","capabilities","registration","redactedViews","unredactedViews"].forEach(a=>{r[a]!==void 0&&(t[a]=r[a])}),new vv(t,r.messages,r.lang)}setCustomData(r){this._cobrowse.customData=r}on(r,t){this._cobrowse.on(r,t)}async start(){this._started||(await this._cobrowse.client(),await this._cobrowse.start(),this._started=!0,fO(this._cobrowse,this.messages,this.lang),dO(this._cobrowse,this.messages.endSessionText,this.lang))}async stop(){await this._cobrowse.stop(),this._started=!1}async endSession(){this._cobrowse.currentSession&&await this._cobrowse.currentSession.end()}async createSessionCode(){return this._cobrowse.currentSession?this._cobrowse.currentSession.code():await this._cobrowse.createSessionCode()}}function cO(){return window.CobrowseIO?window.CobrowseIO:new Promise(e=>{const r=document.createElement("script");r.src="https://js.cobrowse.io/CobrowseIO.js",r.async=!0;const t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(r,t),r.onload=function(){e(window.CobrowseIO)}})}const lO=`<dialog open class="cobrowse-dialog">
2
2
  <h1>$title</h1>
3
3
  <div class="cobrowse-dialog_content">$content</div>
4
4
  <div class="cobrowse-dialog_footer">
5
5
  <button class="cobrowse-dialog_allow js-cobrowse-allow">$allow</button>
6
6
  <button class="cobrowse-dialog_deny js-cobrowse-deny">$deny</button>
7
7
  </div>
8
- </dialog>`;function fO(e,r,t){const n=(i,a)=>{const s=document.createElement("div");s.className="cobrowse-wrapper",s.lang=t;const c=document.querySelector(".cobrowse-template");let o;c?o=c.textContent:o=lO,o=o.replace(/\$title/g,i).replace(/\$content/g,a),o=o.replace(/\$allow/g,r.allowText).replace(/\$deny/g,r.denyText),s.innerHTML=o;const u=()=>{s.parentNode&&s.parentNode.removeChild(s)};return new Promise(l=>{document.body&&document.body.appendChild(s);const f=s.querySelector(".js-cobrowse-allow");f==null||f.addEventListener("click",()=>{l(!0),u()});const d=s.querySelector(".js-cobrowse-deny");d==null||d.addEventListener("click",()=>{l(!1),u()})})};e.confirmSession=function(){return n(r.confirmSessionTitle,r.confirmSessionContent)},e.confirmRemoteControl=function(){return n(r.confirmRemoteControlTitle,r.confirmRemoteControlContent)},e.confirmFullDevice=function(){return n(r.confirmFullDeviceTitle,r.confirmFullDeviceContent)}}function dO(e,r,t){const n=()=>{e.currentSession&&e.currentSession.end()};e.showSessionControls=function(){let i=document.querySelector("#cobrowse-end-button");i||(i=document.createElement("button"),i.id="cobrowse-end-button",i.setAttribute("lang",t),i.textContent=r,i.addEventListener("click",n)),document.body.appendChild(i)},e.hideSessionControls=function(){let i=document.querySelector("#cobrowse-end-button");i&&i.parentNode&&(i.removeEventListener("click",n),i.parentNode.removeChild(i))}}const pO={confirmSessionTitle:"Co-browse Session Request",confirmSessionContent:"Do you want to share your current screen with the agent?",endSessionText:"End Co-browse Session",confirmRemoteControlTitle:"Remote Access Request",confirmRemoteControlContent:"The agent would like to have access to your currently shared screen to further assist you. Do you want to allow this?",confirmFullDeviceTitle:"Screen Share Request",confirmFullDeviceContent:"Do you want to share your full screen with the agent? The agent will not be able to control anything on the screen.",allowText:"Allow",denyText:"Deny"},hO={confirmSessionTitle:"Solicitud de sesión de conavegación",confirmSessionContent:"¿Desea compartir su pantalla actual con el agente?",endSessionText:"Fin de la sesión de conavegación",confirmRemoteControlTitle:"Solicitud de acceso remoto",confirmRemoteControlContent:"El agente desea tener acceso a su pantalla actual compartida para seguir asistiéndole. ¿Desea permitirlo?",confirmFullDeviceTitle:"Solicitud de compartir pantalla",confirmFullDeviceContent:"¿Desea compartir su pantalla completa con el agente? El agente no podrá controlar nada de la pantalla.",allowText:"Permitir",denyText:"Denegar"},vO={confirmSessionTitle:"Demande de session de co-navigation",confirmSessionContent:"Voulez-vous partager votre écran actuel avec l'agent ?",endSessionText:"Terminer la session de co-navigation",confirmRemoteControlTitle:"Demande d'accès à distance",confirmRemoteControlContent:"L'agent souhaite avoir accès à l'écran que vous partagez actuellement pour mieux vous aider. Voulez-vous l'y autoriser ?",confirmFullDeviceTitle:"Demande de partage d'écran",confirmFullDeviceContent:"Voulez-vous partager votre écran complet avec l'agent ? L'agent ne sera pas en mesure de contrôler quoi que ce soit sur l'écran.",allowText:"Autoriser",denyText:"Refuser"},mO={confirmSessionTitle:"Co-Browsing-Sitzungsanfrage",confirmSessionContent:"Möchten Sie Ihren aktuellen Bildschirm für den Agenten freigeben?",endSessionText:"Co-Browsing-Sitzung beenden",confirmRemoteControlTitle:"Fernzugriff-Anfrage",confirmRemoteControlContent:"Der Agent möchte Zugriff auf Ihren aktuell freigegebenen Bildschirm erhalten, um Ihnen weiterhelfen zu können. Möchten Sie dies erlauben?",confirmFullDeviceTitle:"Bildschirmfreigabe",confirmFullDeviceContent:"Möchten Sie Ihren gesamten Bildschirm für den Agenten freigeben? Der Agent ist dadurch nicht in der Lage, Elemente auf Ihrem Bildschirm zu steuern.",allowText:"Erlauben",denyText:"Verweigern"},gO={confirmSessionTitle:"共同ブラウジングセッションリクエスト",confirmSessionContent:"現在の画面を担当者と共有したいですか。",endSessionText:"共同ブラウジングセッションを終了",confirmRemoteControlTitle:"リモートアクセスリクエスト",confirmRemoteControlContent:"担当者は、お客様をさらにお手伝いするために、現在共有中の画面へのアクセスを希望しています。許可しますか。",confirmFullDeviceTitle:"画面共有リクエスト",confirmFullDeviceContent:"画面全体を担当者と共有したいですか。担当者は画面上で一切の操作ができません。",allowText:"許可",denyText:"拒否"},yO={confirmSessionTitle:"코브라우징 세션 요청",confirmSessionContent:"현재 화면을 상담원과 공유하시겠습니까?",endSessionText:"코브라우징 세션 종료",confirmRemoteControlTitle:"원격 액세스 요청",confirmRemoteControlContent:"상담원이 추가 지원을 위해 현재 공유된 화면에 액세스할 수 있기를 원합니다. 허용하시겠습니까?",confirmFullDeviceTitle:"화면 공유 요청",confirmFullDeviceContent:"상담원과 전체 화면을 공유하시겠습니까? 상담원은 화면의 어떤 부분도 제어할 수 없습니다.",allowText:"허용",denyText:"거절"},bO={confirmSessionTitle:"Richiesta di sessione di co-browsing",confirmSessionContent:"Vuoi condividere la tua schermata attuale con l'operatore?",endSessionText:"Termina sessione di co-browsing",confirmRemoteControlTitle:"Richiesta di accesso remoto",confirmRemoteControlContent:"L'operatore vorrebbe accedere alla tua schermata attualmente condivisa per assisterti al meglio. Acconsenti?",confirmFullDeviceTitle:"Richiesta di condivisione schermo",confirmFullDeviceContent:"Vuoi condividere il tuo intero schermo con l'operatore? L'operatore non potrà controllare nessun elemento sullo schermo.",allowText:"Consenti",denyText:"Rifiuta"},_O={confirmSessionTitle:"同步浏览会话请求",confirmSessionContent:"您是否要向该客服代表共享当前的屏幕?",endSessionText:"结束同步浏览会话",confirmRemoteControlTitle:"远程访问请求",confirmRemoteControlContent:"为了进一步协助您,客服代表想访问您当前的共享屏幕。您是否允许这样做?",confirmFullDeviceTitle:"屏幕共享请求",confirmFullDeviceContent:"您是否要向该客服代表共享全屏?客服代表将不能控制屏幕上的任何东西。",allowText:"允许",denyText:"拒绝"},wO={confirmSessionTitle:"Samwebbläsningssession har begärts",confirmSessionContent:"Vill du dela din aktuella skärm med vår medarbetare?",endSessionText:"Avsluta samwebbläsningssession",confirmRemoteControlTitle:"Begäran om fjärråtkomst",confirmRemoteControlContent:"Vår medarbetare skulle vilja få åtkomst till skärmen som du delar just nu för att kunna hjälpa dig vidare. Vill du tillåta detta?",confirmFullDeviceTitle:"Begäran om skärmdelning",confirmFullDeviceContent:"Vill du dela hela skärmen med medarbetaren? Medarbetaren kommer inte kunna kontrollera något på skärmen.",allowText:"Tillåt",denyText:"Neka"},SO={confirmSessionTitle:"Solicitação de Sessão de Co-navegação",confirmSessionContent:"Deseja partilhar o seu ecrã atual com o agente?",endSessionText:"Terminar Sessão de Co-navegação",confirmRemoteControlTitle:"Solicitação de Acesso Remoto",confirmRemoteControlContent:"O agente gostaria de ter acesso ao seu ecrã partilhado atualmente para ajudá-lo ainda mais. Quer permitir isto?",confirmFullDeviceTitle:"Solicitação de Partilha de Ecrã",confirmFullDeviceContent:"Deseja partilhar o seu ecrã inteiro com o agente? O agente não poderá controlar nada no ecrã.",allowText:"Permitir",denyText:"Negar"},TO={confirmSessionTitle:"Pyyntö yhteisselausistunnosta",confirmSessionContent:"Haluatko jakaa nykyisen näyttösi edustajan kanssa?",endSessionText:"Lopeta yhteisselausistunto",confirmRemoteControlTitle:"Etäkäyttöpyyntö",confirmRemoteControlContent:"Edustaja haluaisi saada käyttää tällä hetkellä jakamaasi näyttöä voidakseen auttaa sinua enemmän. Haluatko antaa siihen luvan?",confirmFullDeviceTitle:"Näytön jakamispyyntö",confirmFullDeviceContent:"Haluatko jakaa koko näyttösi edustajan kanssa? Edustaja ei pysty käyttämään mitään näytöllä olevaa.",allowText:"Salli",denyText:"Estä"},CO={confirmSessionTitle:"Samlesingsøkten er startet",confirmSessionContent:"Vil du dele skjermen din med agenten?",endSessionText:"Avslutt samlesingsøkt",confirmRemoteControlTitle:"Forespørsel om fjerntilgang",confirmRemoteControlContent:"Agenten vil ha tilgang til skjermen din for å kunne hjelpe deg videre. Vil du tillate dette?",confirmFullDeviceTitle:"Forespørsel om skjermdeling",confirmFullDeviceContent:"Vil du dele hele skjermen din med agenten? Agenten kan ikke kontrollere noe på skjermen.",allowText:"Tillat",denyText:"Avvis"},EO={confirmSessionTitle:"Forespørgsel om sambrowsingsession",confirmSessionContent:"Vil du dele din nuværende skærm med agenten",endSessionText:"Afslut sambrowsingsession",confirmRemoteControlTitle:"Anmodning om fjernadgang",confirmRemoteControlContent:"Agenten vil gerne have adgang til din nuværende delte skærm for at kunne hjælpe dig yderligere. Ønsker du at tillade dette?",confirmFullDeviceTitle:"Forespørgsel om skærmdeling",confirmFullDeviceContent:"Vil du dele din fulde skærm med agenten? Agenten vil ikke kunne styre noget på skærmen",allowText:"Tillad",denyText:"Afvis"},kO={confirmSessionTitle:"Verzoek om cobrowse-sessie",confirmSessionContent:"Wilt u uw huidige scherm delen met de agent?",endSessionText:"Cobrowse-sessie beëindigen",confirmRemoteControlTitle:"Verzoek om toegang op afstand",confirmRemoteControlContent:"De agent wil graag toegang hebben tot uw momenteel gedeelde scherm om u verder te helpen. Wilt u dit toestaan?",confirmFullDeviceTitle:"Verzoek om scherm te delen",confirmFullDeviceContent:"Wilt u uw volledige scherm delen met de agent? De agent kan niets op het scherm bedienen.",allowText:"Toestaan",denyText:"Weigeren"},RO={confirmSessionTitle:"Oturum İsteğini Eş Zamanlı Tara",confirmSessionContent:"Mevcut ekranınızı temsilciyle paylaşmak ister misiniz?",endSessionText:"Eş zamanlı Oturum Taramayı Sonlandır",confirmRemoteControlTitle:"Uzaktan Erişim İsteği",confirmRemoteControlContent:"Temsilci şu anda paylaşılan ekranınıza size daha fazla yardımcı olabilmek için erişim sağlamak istiyor. Buna izin vermek istiyor musunuz?",confirmFullDeviceTitle:"Ekran Paylaşım İsteği",confirmFullDeviceContent:"Temsilciyle tam ekranınızı paylaşmak istiyor musunuz? Temsilci ekrandaki hiçbir şeyi kontrol edemez.",allowText:"İzin Ver",denyText:"Reddet"},$O={confirmSessionTitle:"Yêu cầu phiên cùng duyệt",confirmSessionContent:"Bạn có muốn chia sẻ màn hình hiện tại của mình với chuyên viên không?",endSessionText:"Kết thúc phiên cùng duyệt",confirmRemoteControlTitle:"Yêu cầu truy cập từ xa",confirmRemoteControlContent:"Chuyên viên muốn được cấp quyền truy cập vào màn hình bạn đang chia sẻ để hỗ trợ bạn nhiều hơn. Bạn có muốn cho phép không?",confirmFullDeviceTitle:"Yêu cầu chia sẻ màn hình",confirmFullDeviceContent:"Bạn có muốn chia sẻ toàn bộ màn hình của mình với chuyên viên không? Chuyên viên sẽ không thể điều khiển bất cứ phần nào trên màn hình.",allowText:"Cho phép",denyText:"Từ chối"},OO={confirmSessionTitle:"ขอเซสชันเรียกดูร่วม",confirmSessionContent:"คุณต้องการแชร์หน้าจอปัจจุบันกับตัวแทนหรือไม่",endSessionText:"สิ้นสุดเซสชันเรียกดูร่วม",confirmRemoteControlTitle:"ขอการเข้าถึงระยะไกล",confirmRemoteControlContent:"ตัวแทนต้องการเข้าถึงหน้าจอของคุณที่แชร์อยู่ในปัจจุบันเพื่อให้ความช่วยเหลือคุณต่อไป คุณจะอนุญาตหรือไม่",confirmFullDeviceTitle:"ขอแชร์หน้าจอ",confirmFullDeviceContent:"คุณต้องการแชร์ทั้งหน้าของคุณกับตัวแทนหรือไม่ ตัวแทนจะไม่สามารถควบคุมอะไรบนหน้าจอ",allowText:"ยินยอม",denyText:"ปฏิเสธ"},IO={confirmSessionTitle:"طلب جلسة تصفح مشترك",confirmSessionContent:"هل تريد مشاركة شاشتك الحالية مع الموظف؟",endSessionText:"إنهاء جلسة التصفح المشترك",confirmRemoteControlTitle:"طلب التحكم عن بعد",confirmRemoteControlContent:"يرغب مسئول الدعم في رؤية شاشتك المشاركة حالياً لمساعدتك بشكلٍ أكبر. هل تسمح بذلك؟",confirmFullDeviceTitle:"طلب مشاركة الشاشة",confirmFullDeviceContent:"هل تريد مشاركة شاشتك الكاملة مع مسئول الدعم؟ لن يتمكن المسئول من التحكم في أي شيء على الشاشة.",allowText:"السماح",denyText:"الرفض"},PO={en:pO,"en-CA":{confirmSessionTitle:"Co-browse Session Request",confirmSessionContent:"Do you want to share your current screen with the agent?",endSessionText:"End Co-browse Session",confirmRemoteControlTitle:"Remote Access Request",confirmRemoteControlContent:"The agent would like to have access to your currently shared screen to further assist you. Do you want to allow this?",confirmFullDeviceTitle:"Screen Share Request",confirmFullDeviceContent:"Do you want to share your full screen with the agent? The agent will not be able to control anything on the screen.",allowText:"Allow",denyText:"Deny"},"en-GB":{confirmSessionTitle:"Co-browse Session Request",confirmSessionContent:"Do you want to share your current screen with the agent?",endSessionText:"End Co-browse Session",confirmRemoteControlTitle:"Remote Access Request",confirmRemoteControlContent:"The agent would like to have access to your currently shared screen to further assist you. Do you want to allow this?",confirmFullDeviceTitle:"Screen Share Request",confirmFullDeviceContent:"Do you want to share your full screen with the agent? The agent will not be able to control anything on the screen.",allowText:"Allow",denyText:"Deny"},es:hO,"es-MX":{confirmSessionTitle:"Solicitud de Sesión de Co-navegación",confirmSessionContent:"¿Quiere compartir su pantalla actual con el agente?",endSessionText:"Fin de la sesión de co-navegación",confirmRemoteControlTitle:"Solicitud de acceso remoto",confirmRemoteControlContent:"El agente desea tener acceso a su pantalla actualmente compartida para poder ayudarlo. ¿Quiere permitirlo?",confirmFullDeviceTitle:"Petición de pantalla compartida",confirmFullDeviceContent:"¿Quiere compartir su pantalla completa con el agente? El agente no podrá controlar nada en la pantalla.",allowText:"Permitir",denyText:"Denegar"},fr:vO,"fr-CA":{confirmSessionTitle:"Demande de session co-navigation",confirmSessionContent:"Voulez-vous partager votre écran actuel avec l'agent?",endSessionText:"Fin de la session de co-navigation",confirmRemoteControlTitle:"Demande d'accès à distance",confirmRemoteControlContent:"L'agent souhaiterait avoir accès à votre écran actuellement partagé pour mieux vous aider. Voulez-vous l'autoriser?",confirmFullDeviceTitle:"Demande de partage d'écran",confirmFullDeviceContent:"Voulez-vous partager votre écran complet avec l'agent? L'agent ne sera pas en mesure de contrôler quoi que ce soit sur l'écran.",allowText:"Autoriser",denyText:"Refuser"},de:mO,ja:gO,ko:yO,it:bO,zh:_O,"zh-Hant":{confirmSessionTitle:"共同瀏覽工作階段要求",confirmSessionContent:"要與專員分享您目前的畫面嗎?",endSessionText:"結束共同瀏覽工作階段",confirmRemoteControlTitle:"遠端存取要求",confirmRemoteControlContent:"專員想要存取您目前分享的螢幕畫面以進一步協助您。要允許嗎?",confirmFullDeviceTitle:"螢幕畫面分享要求",confirmFullDeviceContent:"要與專員分享全螢幕嗎?專員將無法控制畫面上的任何項目。",allowText:"允許",denyText:"拒絕"},sv:wO,pt:SO,"pt-BR":{confirmSessionTitle:"Solicitação de Sessão de Co-navegação",confirmSessionContent:"Você deseja compartilhar sua tela atual com o agente?",endSessionText:"Encerrar Sessão de Co-navegação",confirmRemoteControlTitle:"Solicitação de Acesso Remoto",confirmRemoteControlContent:"O agente gostaria de acessar sua tela atualmente compartilhada para melhor ajudá-lo. Você deseja permitir isso?",confirmFullDeviceTitle:"Solicitação de Compartilhamento de Tela",confirmFullDeviceContent:"Você deseja compartilhar sua tela inteira com o agente? O agente não poderá controlar nada na tela.",allowText:"Permitir",denyText:"Negar"},fi:TO,nb:CO,da:EO,nl:kO,tr:RO,vi:$O,th:OO,ar:IO};let AO=class{constructor(r){bt(this,"options");bt(this,"communicator");bt(this,"methods");bt(this,"events",new dv);bt(this,"request");bt(this,"chat");bt(this,"cobrowse");this.options=r,this.communicator=new N$(r,this.events);const t=this.communicator.request.bind(this.communicator);this.methods=new tO(t),this.request=t,Or.companyId=r.companyId,r.tenant&&(Or.tenant=r.tenant)}get deviceId(){return Or.deviceId}get user(){return this.communicator.user}get lang(){return this.options.lang?this.options.lang:Dr.get("lang")||"en"}set lang(r){this.options.lang||Dr.set("lang",r)}on(r,t){this.events.addEventListener(r,t)}off(r,t){this.events.removeEventListener(r,t)}async getCompany(){const r=await this.methods.getCompany();return Or.tenant=r.subdomain,r}async getTrigger(r){const t=await this.methods.getTriggers(this.options.companyId);return rO(t,r||this.lang)}getMenus(r,t){return this.methods.getMenus(t||this.lang,r)}getTimeSlots(r,t){return this.methods.getTimeSlots(r,t||this.lang)}createCall(r,t){var n;return!t.email&&((n=this.user)!=null&&n.email)&&(t.email=this.user.email),this.methods.createCall(Number(r),t.lang||this.lang,t)}loadCall(r){return this.methods.fetchCall(r)}cancelCall(r){return this.methods.cancelCall(r)}createEmail(r,t){return this.methods.createEmail(r,t.lang||this.lang,t)}async createChat(r,t={},n){var a,s;if(this.chat&&this.chat.ongoing)throw new Error("There is an ongoing chat.");!t.email&&((a=this.user)!=null&&a.email)&&(t.email=this.user.email),t.cobrowsable===void 0&&(t.cobrowsable=!!((s=this.options.cobrowse)!=null&&s.enabled));const i=await this.methods.createChat(Number(r),t.lang||this.lang,t,this.deviceId);return this.registerOngoingChat(i),await i.clearMediaStore(),n&&this.methods.sendChatCustomData(i.id,n),i}async loadChat(r){const t=await this.methods.loadChat(r,this.deviceId);return t.ongoing?this.registerOngoingChat(t):(Dr.del("chat"),Dr.del("cobrowse")),t}async resumeChat(r){const t=await this.methods.resumeChat(r,this.deviceId);return this.registerOngoingChat(t),t}async loadOngoingChat(){const r=Dr.get("chat");if(r){const t=await this.loadChat(r);if(t.ongoing)return t}}async finishChat(){if(this.chat){await this.chat.disconnect();const r=await this.methods.finishChat(this.chat.id);this.chat.update(r),this.events.triggerEvent("chat.ended")}}async destroyChat(){this.chat&&(this.chat.ongoing&&await this.finishChat(),await this.chat.destroy(),this.chat=null,Or.trackerId="")}sendChatTranscript(r){return this.methods.sendChatTranscript(this.chat.id,r)}getChatSurvey(){return this.methods.getChatSurvey(this.chat.id)}sendChatSurvey(r){if(this.chat.feedbackType!=="survey")throw new Error("Chat feedback type is: "+this.chat.feedbackType);return this.methods.sendChatSurvey(this.chat.id,r)}sendChatRate(r){if(this.chat.feedbackType!=="rate")throw new Error("Chat feedback type is: "+this.chat.feedbackType);return this.methods.rateChat(this.chat.id,r)}escalateChat(r){return this.methods.escalateChat(this.chat.id,r)}async sendFileMessage(r,t){const n=await this.methods.uploadChatFile(this.chat.id,r,t);return this.chat.sendMessage(n,r)}async sendTextMessage(r){const t={type:"text",content:r};return this.chat.sendMessage(t)}async createCobrowseCode(r,t){await this.initializeCobrowse(r||this.lang);let n=Dr.get("cobrowse");n||(n=Date.now().toString(),Dr.set("cobrowse",n));const i={device_id:this.deviceId,device_name:`${Or.application} / ${Or.version}`,nonce:n,...t};return this.user.name&&(i.user_name=this.user.name),this.cobrowse.setCustomData(i),this.cobrowse.createSessionCode()}async startCobrowse(r="end_user"){if(!this.chat.cobrowsable)throw new Error(`Chat ${this.chat.id} does not support cobrowse.`);const t={chatId:`chat_${this.chat.id}`},n=await this.createCobrowseCode(this.chat.lang,t);if(n){const i=Dr.get("cobrowse");await this.methods.requestChatCobrowse(this.chat.id,{code:n,from:r,nonce:i})}}async initializeCobrowse(r){if(!this.cobrowse){const t=this.options.cobrowse.messages||PO[r],n={...this.options.cobrowse,messages:t,lang:r};this.cobrowse=await vv.create(n),this.cobrowse.start(),["loaded","updated","ended"].forEach(a=>{this.cobrowse.on(`session.${a}`,s=>{this.events.triggerEvent(`cobrowse.${a}`,s)})})}}registerOngoingChat(r){r._setGlobalEvents(this.events),r.on("_requestCobrowse",t=>{t==="agent"?this.startCobrowse(t):this.initializeCobrowse(r.lang),this.events.triggerEvent("cobrowse.request",{from:t})}),r.on("disconnected",()=>{Dr.del("chat"),Dr.del("cobrowse")}),this.chat=r,Or.trackerId=`chat_${r.id}`,Dr.set("chat",r.id.toString()),r.cobrowsable&&Dr.get("cobrowse")&&this.initializeCobrowse(r.lang)}};var Ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function w0(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function n(){if(this instanceof n){var i=[null];i.push.apply(i,arguments);var a=Function.bind.apply(r,i);return new a}return r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),t}var S0={},Fu=function(e){return e&&e.Math==Math&&e},Rt=Fu(typeof globalThis=="object"&&globalThis)||Fu(typeof window=="object"&&window)||Fu(typeof self=="object"&&self)||Fu(typeof Ve=="object"&&Ve)||function(){return this}()||Ve||Function("return this")(),ii={},mt=function(e){try{return!!e()}catch{return!0}},xO=mt,Yt=!xO(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),MO=mt,ou=!MO(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),NO=ou,Uu=Function.prototype.call,qt=NO?Uu.bind(Uu):function(){return Uu.apply(Uu,arguments)},uu={},T0={}.propertyIsEnumerable,C0=Object.getOwnPropertyDescriptor,LO=C0&&!T0.call({1:2},1);uu.f=LO?function(r){var t=C0(this,r);return!!t&&t.enumerable}:T0;var rs=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},E0=ou,k0=Function.prototype,$p=k0.call,DO=E0&&k0.bind.bind($p,$p),_t=E0?DO:function(e){return function(){return $p.apply(e,arguments)}},R0=_t,jO=R0({}.toString),FO=R0("".slice),ai=function(e){return FO(jO(e),8,-1)},UO=_t,BO=mt,qO=ai,If=Object,GO=UO("".split),cu=BO(function(){return!If("z").propertyIsEnumerable(0)})?function(e){return qO(e)=="String"?GO(e,""):If(e)}:If,si=function(e){return e==null},VO=si,zO=TypeError,oi=function(e){if(VO(e))throw zO("Can't call method on "+e);return e},WO=cu,HO=oi,ln=function(e){return WO(HO(e))},Op=typeof document=="object"&&document.all,KO=typeof Op>"u"&&Op!==void 0,$0={all:Op,IS_HTMLDDA:KO},O0=$0,JO=O0.all,Bt=O0.IS_HTMLDDA?function(e){return typeof e=="function"||e===JO}:function(e){return typeof e=="function"},Sg=Bt,I0=$0,YO=I0.all,tr=I0.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Sg(e)||e===YO}:function(e){return typeof e=="object"?e!==null:Sg(e)},Pf=Rt,XO=Bt,QO=function(e){return XO(e)?e:void 0},Vn=function(e,r){return arguments.length<2?QO(Pf[e]):Pf[e]&&Pf[e][r]},ZO=_t,Di=ZO({}.isPrototypeOf),ns=typeof navigator<"u"&&String(navigator.userAgent)||"",P0=Rt,Af=ns,Tg=P0.process,Cg=P0.Deno,Eg=Tg&&Tg.versions||Cg&&Cg.version,kg=Eg&&Eg.v8,jn,tl;kg&&(jn=kg.split("."),tl=jn[0]>0&&jn[0]<4?1:+(jn[0]+jn[1]));!tl&&Af&&(jn=Af.match(/Edge\/(\d+)/),(!jn||jn[1]>=74)&&(jn=Af.match(/Chrome\/(\d+)/),jn&&(tl=+jn[1])));var no=tl,Rg=no,eI=mt,tI=Rt,rI=tI.String,io=!!Object.getOwnPropertySymbols&&!eI(function(){var e=Symbol();return!rI(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rg&&Rg<41}),nI=io,A0=nI&&!Symbol.sham&&typeof Symbol.iterator=="symbol",iI=Vn,aI=Bt,sI=Di,oI=A0,uI=Object,ao=oI?function(e){return typeof e=="symbol"}:function(e){var r=iI("Symbol");return aI(r)&&sI(r.prototype,uI(e))},cI=String,is=function(e){try{return cI(e)}catch{return"Object"}},lI=Bt,fI=is,dI=TypeError,En=function(e){if(lI(e))return e;throw dI(fI(e)+" is not a function")},pI=En,hI=si,as=function(e,r){var t=e[r];return hI(t)?void 0:pI(t)},xf=qt,Mf=Bt,Nf=tr,vI=TypeError,mI=function(e,r){var t,n;if(r==="string"&&Mf(t=e.toString)&&!Nf(n=xf(t,e))||Mf(t=e.valueOf)&&!Nf(n=xf(t,e))||r!=="string"&&Mf(t=e.toString)&&!Nf(n=xf(t,e)))return n;throw vI("Can't convert object to primitive value")},x0={exports:{}},M0=!1,$g=Rt,gI=Object.defineProperty,gv=function(e,r){try{gI($g,e,{value:r,configurable:!0,writable:!0})}catch{$g[e]=r}return r},yI=Rt,bI=gv,Og="__core-js_shared__",_I=yI[Og]||bI(Og,{}),yv=_I,Ig=yv;(x0.exports=function(e,r){return Ig[e]||(Ig[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var so=x0.exports,wI=oi,SI=Object,Mr=function(e){return SI(wI(e))},TI=_t,CI=Mr,EI=TI({}.hasOwnProperty),rr=Object.hasOwn||function(r,t){return EI(CI(r),t)},kI=_t,RI=0,$I=Math.random(),OI=kI(1 .toString),lu=function(e){return"Symbol("+(e===void 0?"":e)+")_"+OI(++RI+$I,36)},II=Rt,PI=so,Pg=rr,AI=lu,xI=io,MI=A0,Ps=II.Symbol,Lf=PI("wks"),NI=MI?Ps.for||Ps:Ps&&Ps.withoutSetter||AI,Gt=function(e){return Pg(Lf,e)||(Lf[e]=xI&&Pg(Ps,e)?Ps[e]:NI("Symbol."+e)),Lf[e]},LI=qt,Ag=tr,xg=ao,DI=as,jI=mI,FI=Gt,UI=TypeError,BI=FI("toPrimitive"),bv=function(e,r){if(!Ag(e)||xg(e))return e;var t=DI(e,BI),n;if(t){if(r===void 0&&(r="default"),n=LI(t,e,r),!Ag(n)||xg(n))return n;throw UI("Can't convert object to primitive value")}return r===void 0&&(r="number"),jI(e,r)},qI=bv,GI=ao,fu=function(e){var r=qI(e,"string");return GI(r)?r:r+""},VI=Rt,Mg=tr,Ip=VI.document,zI=Mg(Ip)&&Mg(Ip.createElement),Cl=function(e){return zI?Ip.createElement(e):{}},WI=Yt,HI=mt,KI=Cl,N0=!WI&&!HI(function(){return Object.defineProperty(KI("div"),"a",{get:function(){return 7}}).a!=7}),JI=Yt,YI=qt,XI=uu,QI=rs,ZI=ln,eP=fu,tP=rr,rP=N0,Ng=Object.getOwnPropertyDescriptor;ii.f=JI?Ng:function(r,t){if(r=ZI(r),t=eP(t),rP)try{return Ng(r,t)}catch{}if(tP(r,t))return QI(!YI(XI.f,r,t),r[t])};var qr={},nP=Yt,iP=mt,L0=nP&&iP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),aP=tr,sP=String,oP=TypeError,sr=function(e){if(aP(e))return e;throw oP(sP(e)+" is not an object")},uP=Yt,cP=N0,lP=L0,Bu=sr,Lg=fu,fP=TypeError,Df=Object.defineProperty,dP=Object.getOwnPropertyDescriptor,jf="enumerable",Ff="configurable",Uf="writable";qr.f=uP?lP?function(r,t,n){if(Bu(r),t=Lg(t),Bu(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Uf in n&&!n[Uf]){var i=dP(r,t);i&&i[Uf]&&(r[t]=n.value,n={configurable:Ff in n?n[Ff]:i[Ff],enumerable:jf in n?n[jf]:i[jf],writable:!1})}return Df(r,t,n)}:Df:function(r,t,n){if(Bu(r),t=Lg(t),Bu(n),cP)try{return Df(r,t,n)}catch{}if("get"in n||"set"in n)throw fP("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var pP=Yt,hP=qr,vP=rs,ji=pP?function(e,r,t){return hP.f(e,r,vP(1,t))}:function(e,r,t){return e[r]=t,e},D0={exports:{}},Pp=Yt,mP=rr,j0=Function.prototype,gP=Pp&&Object.getOwnPropertyDescriptor,_v=mP(j0,"name"),yP=_v&&function(){}.name==="something",bP=_v&&(!Pp||Pp&&gP(j0,"name").configurable),du={EXISTS:_v,PROPER:yP,CONFIGURABLE:bP},_P=_t,wP=Bt,Ap=yv,SP=_P(Function.toString);wP(Ap.inspectSource)||(Ap.inspectSource=function(e){return SP(e)});var wv=Ap.inspectSource,TP=Rt,CP=Bt,Dg=TP.WeakMap,EP=CP(Dg)&&/native code/.test(String(Dg)),kP=so,RP=lu,jg=kP("keys"),El=function(e){return jg[e]||(jg[e]=RP(e))},pu={},$P=EP,F0=Rt,OP=tr,IP=ji,Bf=rr,qf=yv,PP=El,AP=pu,Fg="Object already initialized",xp=F0.TypeError,xP=F0.WeakMap,rl,Qo,nl,MP=function(e){return nl(e)?Qo(e):rl(e,{})},NP=function(e){return function(r){var t;if(!OP(r)||(t=Qo(r)).type!==e)throw xp("Incompatible receiver, "+e+" required");return t}};if($P||qf.state){var Yn=qf.state||(qf.state=new xP);Yn.get=Yn.get,Yn.has=Yn.has,Yn.set=Yn.set,rl=function(e,r){if(Yn.has(e))throw xp(Fg);return r.facade=e,Yn.set(e,r),r},Qo=function(e){return Yn.get(e)||{}},nl=function(e){return Yn.has(e)}}else{var ms=PP("state");AP[ms]=!0,rl=function(e,r){if(Bf(e,ms))throw xp(Fg);return r.facade=e,IP(e,ms,r),r},Qo=function(e){return Bf(e,ms)?e[ms]:{}},nl=function(e){return Bf(e,ms)}}var kn={set:rl,get:Qo,has:nl,enforce:MP,getterFor:NP},Sv=_t,LP=mt,DP=Bt,qu=rr,Mp=Yt,jP=du.CONFIGURABLE,FP=wv,U0=kn,UP=U0.enforce,BP=U0.get,Ug=String,qc=Object.defineProperty,qP=Sv("".slice),GP=Sv("".replace),VP=Sv([].join),zP=Mp&&!LP(function(){return qc(function(){},"length",{value:8}).length!==8}),WP=String(String).split("String"),HP=D0.exports=function(e,r,t){qP(Ug(r),0,7)==="Symbol("&&(r="["+GP(Ug(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!qu(e,"name")||jP&&e.name!==r)&&(Mp?qc(e,"name",{value:r,configurable:!0}):e.name=r),zP&&t&&qu(t,"arity")&&e.length!==t.arity&&qc(e,"length",{value:t.arity});try{t&&qu(t,"constructor")&&t.constructor?Mp&&qc(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=UP(e);return qu(n,"source")||(n.source=VP(WP,typeof r=="string"?r:"")),e};Function.prototype.toString=HP(function(){return DP(this)&&BP(this).source||FP(this)},"toString");var B0=D0.exports,KP=Bt,JP=qr,YP=B0,XP=gv,Gr=function(e,r,t,n){n||(n={});var i=n.enumerable,a=n.name!==void 0?n.name:r;if(KP(t)&&YP(t,a,n),n.global)i?e[r]=t:XP(r,t);else{try{n.unsafe?e[r]&&(i=!0):delete e[r]}catch{}i?e[r]=t:JP.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},ba={},QP=Math.ceil,ZP=Math.floor,eA=Math.trunc||function(r){var t=+r;return(t>0?ZP:QP)(t)},tA=eA,ui=function(e){var r=+e;return r!==r||r===0?0:tA(r)},rA=ui,nA=Math.max,iA=Math.min,ss=function(e,r){var t=rA(e);return t<0?nA(t+r,0):iA(t,r)},aA=ui,sA=Math.min,Fi=function(e){return e>0?sA(aA(e),9007199254740991):0},oA=Fi,Ir=function(e){return oA(e.length)},uA=ln,cA=ss,lA=Ir,Bg=function(e){return function(r,t,n){var i=uA(r),a=lA(i),s=cA(n,a),c;if(e&&t!=t){for(;a>s;)if(c=i[s++],c!=c)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===t)return e||s||0;return!e&&-1}},kl={includes:Bg(!0),indexOf:Bg(!1)},fA=_t,Gf=rr,dA=ln,pA=kl.indexOf,hA=pu,qg=fA([].push),q0=function(e,r){var t=dA(e),n=0,i=[],a;for(a in t)!Gf(hA,a)&&Gf(t,a)&&qg(i,a);for(;r.length>n;)Gf(t,a=r[n++])&&(~pA(i,a)||qg(i,a));return i},Tv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vA=q0,mA=Tv,gA=mA.concat("length","prototype");ba.f=Object.getOwnPropertyNames||function(r){return vA(r,gA)};var hu={};hu.f=Object.getOwnPropertySymbols;var yA=Vn,bA=_t,_A=ba,wA=hu,SA=sr,TA=bA([].concat),G0=yA("Reflect","ownKeys")||function(r){var t=_A.f(SA(r)),n=wA.f;return n?TA(t,n(r)):t},Gg=rr,CA=G0,EA=ii,kA=qr,V0=function(e,r,t){for(var n=CA(r),i=kA.f,a=EA.f,s=0;s<n.length;s++){var c=n[s];!Gg(e,c)&&!(t&&Gg(t,c))&&i(e,c,a(r,c))}},RA=mt,$A=Bt,OA=/#|\.prototype\./,vu=function(e,r){var t=PA[IA(e)];return t==xA?!0:t==AA?!1:$A(r)?RA(r):!!r},IA=vu.normalize=function(e){return String(e).replace(OA,".").toLowerCase()},PA=vu.data={},AA=vu.NATIVE="N",xA=vu.POLYFILL="P",Rl=vu,Vf=Rt,MA=ii.f,NA=ji,LA=Gr,DA=gv,jA=V0,FA=Rl,wt=function(e,r){var t=e.target,n=e.global,i=e.stat,a,s,c,o,u,l;if(n?s=Vf:i?s=Vf[t]||DA(t,{}):s=(Vf[t]||{}).prototype,s)for(c in r){if(u=r[c],e.dontCallGetSet?(l=MA(s,c),o=l&&l.value):o=s[c],a=FA(n?c:t+(i?".":"#")+c,e.forced),!a&&o!==void 0){if(typeof u==typeof o)continue;jA(u,o)}(e.sham||o&&o.sham)&&NA(u,"sham",!0),LA(s,c,u,e)}},UA=qr.f,BA=rr,qA=Gt,Vg=qA("toStringTag"),Ui=function(e,r,t){e&&!t&&(e=e.prototype),e&&!BA(e,Vg)&&UA(e,Vg,{configurable:!0,value:r})},GA=wt,VA=Rt,zA=Ui;GA({global:!0},{Reflect:{}});zA(VA.Reflect,"Reflect",!0);var WA=ou,z0=Function.prototype,zg=z0.apply,Wg=z0.call,_a=typeof Reflect=="object"&&Reflect.apply||(WA?Wg.bind(zg):function(){return Wg.apply(zg,arguments)}),HA=_t,oo=HA([].slice),W0=_t,KA=En,JA=tr,YA=rr,Hg=oo,XA=ou,H0=Function,QA=W0([].concat),ZA=W0([].join),zf={},ex=function(e,r,t){if(!YA(zf,r)){for(var n=[],i=0;i<r;i++)n[i]="a["+i+"]";zf[r]=H0("C,a","return new C("+ZA(n,",")+")")}return zf[r](e,t)},tx=XA?H0.bind:function(r){var t=KA(this),n=t.prototype,i=Hg(arguments,1),a=function(){var c=QA(i,Hg(arguments));return this instanceof a?ex(t,c.length,c):t.apply(r,c)};return JA(n)&&(a.prototype=n),a},rx=Gt,nx=rx("toStringTag"),K0={};K0[nx]="z";var Cv=String(K0)==="[object z]",ix=Cv,ax=Bt,Gc=ai,sx=Gt,ox=sx("toStringTag"),ux=Object,cx=Gc(function(){return arguments}())=="Arguments",lx=function(e,r){try{return e[r]}catch{}},Bi=ix?Gc:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=lx(r=ux(e),ox))=="string"?t:cx?Gc(r):(n=Gc(r))=="Object"&&ax(r.callee)?"Arguments":n},fx=_t,dx=mt,J0=Bt,px=Bi,hx=Vn,vx=wv,Y0=function(){},mx=[],X0=hx("Reflect","construct"),Ev=/^\s*(?:class|function)\b/,gx=fx(Ev.exec),yx=!Ev.exec(Y0),So=function(r){if(!J0(r))return!1;try{return X0(Y0,mx,r),!0}catch{return!1}},Q0=function(r){if(!J0(r))return!1;switch(px(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return yx||!!gx(Ev,vx(r))}catch{return!0}};Q0.sham=!0;var $l=!X0||dx(function(){var e;return So(So.call)||!So(Object)||!So(function(){e=!0})||e})?Q0:So,bx=$l,_x=is,wx=TypeError,kv=function(e){if(bx(e))return e;throw wx(_x(e)+" is not a constructor")},Rv={},Sx=q0,Tx=Tv,mu=Object.keys||function(r){return Sx(r,Tx)},Cx=Yt,Ex=L0,kx=qr,Rx=sr,$x=ln,Ox=mu;Rv.f=Cx&&!Ex?Object.defineProperties:function(r,t){Rx(r);for(var n=$x(t),i=Ox(t),a=i.length,s=0,c;a>s;)kx.f(r,c=i[s++],n[c]);return r};var Ix=Vn,Z0=Ix("document","documentElement"),Px=sr,Ax=Rv,Kg=Tv,xx=pu,Mx=Z0,Nx=Cl,Lx=El,Jg=">",Yg="<",Np="prototype",Lp="script",eT=Lx("IE_PROTO"),Wf=function(){},tT=function(e){return Yg+Lp+Jg+e+Yg+"/"+Lp+Jg},Xg=function(e){e.write(tT("")),e.close();var r=e.parentWindow.Object;return e=null,r},Dx=function(){var e=Nx("iframe"),r="java"+Lp+":",t;return e.style.display="none",Mx.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(tT("document.F=Object")),t.close(),t.F},Gu,Vc=function(){try{Gu=new ActiveXObject("htmlfile")}catch{}Vc=typeof document<"u"?document.domain&&Gu?Xg(Gu):Dx():Xg(Gu);for(var e=Kg.length;e--;)delete Vc[Np][Kg[e]];return Vc()};xx[eT]=!0;var wa=Object.create||function(r,t){var n;return r!==null?(Wf[Np]=Px(r),n=new Wf,Wf[Np]=null,n[eT]=r):n=Vc(),t===void 0?n:Ax.f(n,t)},jx=wt,Fx=Vn,Hf=_a,Ux=tx,Qg=kv,Bx=sr,Zg=tr,qx=wa,rT=mt,$v=Fx("Reflect","construct"),Gx=Object.prototype,Vx=[].push,nT=rT(function(){function e(){}return!($v(function(){},[],e)instanceof e)}),iT=!rT(function(){$v(function(){})}),ey=nT||iT;jx({target:"Reflect",stat:!0,forced:ey,sham:ey},{construct:function(r,t){Qg(r),Bx(t);var n=arguments.length<3?r:Qg(arguments[2]);if(iT&&!nT)return $v(r,t,n);if(r==n){switch(t.length){case 0:return new r;case 1:return new r(t[0]);case 2:return new r(t[0],t[1]);case 3:return new r(t[0],t[1],t[2]);case 4:return new r(t[0],t[1],t[2],t[3])}var i=[null];return Hf(Vx,i,t),new(Hf(Ux,r,i))}var a=n.prototype,s=qx(Zg(a)?a:Gx),c=Hf(r,s,t);return Zg(c)?c:s}});var zx=wt,Wx=Mr,aT=mu,Hx=mt,Kx=Hx(function(){aT(1)});zx({target:"Object",stat:!0,forced:Kx},{keys:function(r){return aT(Wx(r))}});var Jx=Bi,Yx=String,br=function(e){if(Jx(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Yx(e)},Ov={},Xx=fu,Qx=qr,Zx=rs,uo=function(e,r,t){var n=Xx(r);n in e?Qx.f(e,n,Zx(0,t)):e[n]=t},ty=ss,eM=Ir,tM=uo,rM=Array,nM=Math.max,gu=function(e,r,t){for(var n=eM(e),i=ty(r,n),a=ty(t===void 0?n:t,n),s=rM(nM(a-i,0)),c=0;i<a;i++,c++)tM(s,c,e[i]);return s.length=c,s},iM=ai,aM=ln,sT=ba.f,sM=gu,oT=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],oM=function(e){try{return sT(e)}catch{return sM(oT)}};Ov.f=function(r){return oT&&iM(r)=="Window"?oM(r):sT(aM(r))};var ry=B0,uM=qr,ci=function(e,r,t){return t.get&&ry(t.get,r,{getter:!0}),t.set&&ry(t.set,r,{setter:!0}),uM.f(e,r,t)},Iv={},cM=Gt;Iv.f=cM;var lM=Rt,uT=lM,ny=uT,fM=rr,dM=Iv,pM=qr.f,cT=function(e){var r=ny.Symbol||(ny.Symbol={});fM(r,e)||pM(r,e,{value:dM.f(e)})},hM=qt,vM=Vn,mM=Gt,gM=Gr,yM=function(){var e=vM("Symbol"),r=e&&e.prototype,t=r&&r.valueOf,n=mM("toPrimitive");r&&!r[n]&&gM(r,n,function(i){return hM(t,this)},{arity:1})},bM=ai,_M=_t,Ol=function(e){if(bM(e)==="Function")return _M(e)},iy=Ol,wM=En,SM=ou,TM=iy(iy.bind),qi=function(e,r){return wM(e),r===void 0?e:SM?TM(e,r):function(){return e.apply(r,arguments)}},CM=ai,yu=Array.isArray||function(r){return CM(r)=="Array"},ay=yu,EM=$l,kM=tr,RM=Gt,$M=RM("species"),sy=Array,OM=function(e){var r;return ay(e)&&(r=e.constructor,EM(r)&&(r===sy||ay(r.prototype))?r=void 0:kM(r)&&(r=r[$M],r===null&&(r=void 0))),r===void 0?sy:r},IM=OM,Pv=function(e,r){return new(IM(e))(r===0?0:r)},PM=qi,AM=_t,xM=cu,MM=Mr,NM=Ir,LM=Pv,oy=AM([].push),ra=function(e){var r=e==1,t=e==2,n=e==3,i=e==4,a=e==6,s=e==7,c=e==5||a;return function(o,u,l,f){for(var d=MM(o),p=xM(d),h=PM(u,l),E=NM(p),x=0,I=f||LM,M=r?I(o,E):t||s?I(o,0):void 0,j,V;E>x;x++)if((c||x in p)&&(j=p[x],V=h(j,x,d),e))if(r)M[x]=V;else if(V)switch(e){case 3:return!0;case 5:return j;case 6:return x;case 2:oy(M,j)}else switch(e){case 4:return!1;case 7:oy(M,j)}return a?-1:n||i?i:M}},fn={forEach:ra(0),map:ra(1),filter:ra(2),some:ra(3),every:ra(4),find:ra(5),findIndex:ra(6),filterReject:ra(7)},Il=wt,Av=Rt,xv=qt,DM=_t,Hs=Yt,Ks=io,jM=mt,Sr=rr,FM=Di,Dp=sr,Pl=ln,Mv=fu,UM=br,jp=rs,Zo=wa,lT=mu,BM=ba,fT=Ov,qM=hu,dT=ii,pT=qr,GM=Rv,hT=uu,Kf=Gr,VM=ci,Nv=so,zM=El,vT=pu,uy=lu,WM=Gt,HM=Iv,KM=cT,JM=yM,YM=Ui,mT=kn,Al=fn.forEach,Qr=zM("hidden"),xl="Symbol",eu="prototype",XM=mT.set,cy=mT.getterFor(xl),Tn=Object[eu],Ka=Av.Symbol,Do=Ka&&Ka[eu],QM=Av.TypeError,Jf=Av.QObject,gT=dT.f,za=pT.f,yT=fT.f,ZM=hT.f,bT=DM([].push),Ai=Nv("symbols"),bu=Nv("op-symbols"),eN=Nv("wks"),Fp=!Jf||!Jf[eu]||!Jf[eu].findChild,Up=Hs&&jM(function(){return Zo(za({},"a",{get:function(){return za(this,"a",{value:7}).a}})).a!=7})?function(e,r,t){var n=gT(Tn,r);n&&delete Tn[r],za(e,r,t),n&&e!==Tn&&za(Tn,r,n)}:za,Yf=function(e,r){var t=Ai[e]=Zo(Do);return XM(t,{type:xl,tag:e,description:r}),Hs||(t.description=r),t},Ml=function(r,t,n){r===Tn&&Ml(bu,t,n),Dp(r);var i=Mv(t);return Dp(n),Sr(Ai,i)?(n.enumerable?(Sr(r,Qr)&&r[Qr][i]&&(r[Qr][i]=!1),n=Zo(n,{enumerable:jp(0,!1)})):(Sr(r,Qr)||za(r,Qr,jp(1,{})),r[Qr][i]=!0),Up(r,i,n)):za(r,i,n)},Lv=function(r,t){Dp(r);var n=Pl(t),i=lT(n).concat(ST(n));return Al(i,function(a){(!Hs||xv(Bp,n,a))&&Ml(r,a,n[a])}),r},tN=function(r,t){return t===void 0?Zo(r):Lv(Zo(r),t)},Bp=function(r){var t=Mv(r),n=xv(ZM,this,t);return this===Tn&&Sr(Ai,t)&&!Sr(bu,t)?!1:n||!Sr(this,t)||!Sr(Ai,t)||Sr(this,Qr)&&this[Qr][t]?n:!0},_T=function(r,t){var n=Pl(r),i=Mv(t);if(!(n===Tn&&Sr(Ai,i)&&!Sr(bu,i))){var a=gT(n,i);return a&&Sr(Ai,i)&&!(Sr(n,Qr)&&n[Qr][i])&&(a.enumerable=!0),a}},wT=function(r){var t=yT(Pl(r)),n=[];return Al(t,function(i){!Sr(Ai,i)&&!Sr(vT,i)&&bT(n,i)}),n},ST=function(e){var r=e===Tn,t=yT(r?bu:Pl(e)),n=[];return Al(t,function(i){Sr(Ai,i)&&(!r||Sr(Tn,i))&&bT(n,Ai[i])}),n};Ks||(Ka=function(){if(FM(Do,this))throw QM("Symbol is not a constructor");var r=!arguments.length||arguments[0]===void 0?void 0:UM(arguments[0]),t=uy(r),n=function(i){this===Tn&&xv(n,bu,i),Sr(this,Qr)&&Sr(this[Qr],t)&&(this[Qr][t]=!1),Up(this,t,jp(1,i))};return Hs&&Fp&&Up(Tn,t,{configurable:!0,set:n}),Yf(t,r)},Do=Ka[eu],Kf(Do,"toString",function(){return cy(this).tag}),Kf(Ka,"withoutSetter",function(e){return Yf(uy(e),e)}),hT.f=Bp,pT.f=Ml,GM.f=Lv,dT.f=_T,BM.f=fT.f=wT,qM.f=ST,HM.f=function(e){return Yf(WM(e),e)},Hs&&(VM(Do,"description",{configurable:!0,get:function(){return cy(this).description}}),Kf(Tn,"propertyIsEnumerable",Bp,{unsafe:!0})));Il({global:!0,constructor:!0,wrap:!0,forced:!Ks,sham:!Ks},{Symbol:Ka});Al(lT(eN),function(e){KM(e)});Il({target:xl,stat:!0,forced:!Ks},{useSetter:function(){Fp=!0},useSimple:function(){Fp=!1}});Il({target:"Object",stat:!0,forced:!Ks,sham:!Hs},{create:tN,defineProperty:Ml,defineProperties:Lv,getOwnPropertyDescriptor:_T});Il({target:"Object",stat:!0,forced:!Ks},{getOwnPropertyNames:wT});JM();YM(Ka,xl);vT[Qr]=!0;var rN=io,TT=rN&&!!Symbol.for&&!!Symbol.keyFor,nN=wt,iN=Vn,aN=rr,sN=br,CT=so,oN=TT,Xf=CT("string-to-symbol-registry"),uN=CT("symbol-to-string-registry");nN({target:"Symbol",stat:!0,forced:!oN},{for:function(e){var r=sN(e);if(aN(Xf,r))return Xf[r];var t=iN("Symbol")(r);return Xf[r]=t,uN[t]=r,t}});var cN=wt,lN=rr,fN=ao,dN=is,pN=so,hN=TT,ly=pN("symbol-to-string-registry");cN({target:"Symbol",stat:!0,forced:!hN},{keyFor:function(r){if(!fN(r))throw TypeError(dN(r)+" is not a symbol");if(lN(ly,r))return ly[r]}});var vN=_t,fy=yu,mN=Bt,dy=ai,gN=br,py=vN([].push),yN=function(e){if(mN(e))return e;if(fy(e)){for(var r=e.length,t=[],n=0;n<r;n++){var i=e[n];typeof i=="string"?py(t,i):(typeof i=="number"||dy(i)=="Number"||dy(i)=="String")&&py(t,gN(i))}var a=t.length,s=!0;return function(c,o){if(s)return s=!1,o;if(fy(this))return o;for(var u=0;u<a;u++)if(t[u]===c)return o}}},bN=wt,ET=Vn,kT=_a,_N=qt,_u=_t,RT=mt,hy=Bt,vy=ao,$T=oo,wN=yN,SN=io,TN=String,da=ET("JSON","stringify"),Vu=_u(/./.exec),my=_u("".charAt),CN=_u("".charCodeAt),EN=_u("".replace),kN=_u(1 .toString),RN=/[\uD800-\uDFFF]/g,gy=/^[\uD800-\uDBFF]$/,yy=/^[\uDC00-\uDFFF]$/,by=!SN||RT(function(){var e=ET("Symbol")();return da([e])!="[null]"||da({a:e})!="{}"||da(Object(e))!="{}"}),_y=RT(function(){return da("\uDF06\uD834")!=='"\\udf06\\ud834"'||da("\uDEAD")!=='"\\udead"'}),$N=function(e,r){var t=$T(arguments),n=wN(r);if(!(!hy(n)&&(e===void 0||vy(e))))return t[1]=function(i,a){if(hy(n)&&(a=_N(n,this,TN(i),a)),!vy(a))return a},kT(da,null,t)},ON=function(e,r,t){var n=my(t,r-1),i=my(t,r+1);return Vu(gy,e)&&!Vu(yy,i)||Vu(yy,e)&&!Vu(gy,n)?"\\u"+kN(CN(e,0),16):e};da&&bN({target:"JSON",stat:!0,arity:3,forced:by||_y},{stringify:function(r,t,n){var i=$T(arguments),a=kT(by?$N:da,null,i);return _y&&typeof a=="string"?EN(a,RN,ON):a}});var IN=wt,PN=io,AN=mt,OT=hu,xN=Mr,MN=!PN||AN(function(){OT.f(1)});IN({target:"Object",stat:!0,forced:MN},{getOwnPropertySymbols:function(r){var t=OT.f;return t?t(xN(r)):[]}});var NN=mt,LN=Gt,DN=no,jN=LN("species"),wu=function(e){return DN>=51||!NN(function(){var r=[],t=r.constructor={};return t[jN]=function(){return{foo:1}},r[e](Boolean).foo!==1})},FN=wt,UN=fn.filter,BN=wu,qN=BN("filter");FN({target:"Array",proto:!0,forced:!qN},{filter:function(r){return UN(this,r,arguments.length>1?arguments[1]:void 0)}});var GN=wt,VN=mt,zN=ln,IT=ii.f,PT=Yt,WN=!PT||VN(function(){IT(1)});GN({target:"Object",stat:!0,forced:WN,sham:!PT},{getOwnPropertyDescriptor:function(r,t){return IT(zN(r),t)}});var HN=wt,KN=Yt,JN=G0,YN=ln,XN=ii,QN=uo;HN({target:"Object",stat:!0,sham:!KN},{getOwnPropertyDescriptors:function(r){for(var t=YN(r),n=XN.f,i=JN(t),a={},s=0,c,o;i.length>s;)o=n(t,c=i[s++]),o!==void 0&&QN(a,c,o);return a}});var AT={exports:{}};(function(e){function r(n,i,a,s,c,o,u){try{var l=n[o](u),f=l.value}catch(d){a(d);return}l.done?i(f):Promise.resolve(f).then(s,c)}function t(n){return function(){var i=this,a=arguments;return new Promise(function(s,c){var o=n.apply(i,a);function u(f){r(o,s,c,u,l,"next",f)}function l(f){r(o,s,c,u,l,"throw",f)}u(void 0)})}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(AT);var Su=AT.exports,xT={exports:{}};(function(e){function r(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(xT);var os=xT.exports,MT={exports:{}},NT={exports:{}};(function(e){function r(t,n){return e.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(NT);var Dv=NT.exports;(function(e){var r=Dv;function t(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&r(n,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(MT);var li=MT.exports,LT={exports:{}},DT={exports:{}};(function(e){function r(t){"@babel/helpers - typeof";return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(DT);var Rn=DT.exports;(function(e){var r=Rn.default,t=os;function n(i,a){if(a&&(r(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(LT);var fi=LT.exports,jT={exports:{}};(function(e){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(jT);var $n=jT.exports,FT={exports:{}},UT={exports:{}},BT={exports:{}};(function(e){var r=Rn.default;function t(n,i){if(r(n)!=="object"||n===null)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var s=a.call(n,i||"default");if(r(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(BT);var ZN=BT.exports;(function(e){var r=Rn.default,t=ZN;function n(i){var a=t(i,"string");return r(a)==="symbol"?a:String(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(UT);var qT=UT.exports;(function(e){var r=qT;function t(n,i,a){return i=r(i),i in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a,n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(FT);var us=FT.exports,GT={exports:{}};(function(e){var r=qT;function t(i,a){for(var s=0;s<a.length;s++){var c=a[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(i,r(c.key),c)}}function n(i,a,s){return a&&t(i.prototype,a),s&&t(i,s),Object.defineProperty(i,"prototype",{writable:!1}),i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(GT);var Sa=GT.exports,VT={exports:{}};(function(e){function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(VT);var di=VT.exports,eL=Cv,tL=Bi,rL=eL?{}.toString:function(){return"[object "+tL(this)+"]"},nL=Cv,iL=Gr,aL=rL;nL||iL(Object.prototype,"toString",aL,{unsafe:!0});var sL=ai,Nl=typeof process<"u"&&sL(process)=="process",oL=_t,uL=En,cL=function(e,r,t){try{return oL(uL(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}},lL=Bt,fL=String,dL=TypeError,pL=function(e){if(typeof e=="object"||lL(e))return e;throw dL("Can't set "+fL(e)+" as a prototype")},hL=cL,vL=sr,mL=pL,co=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=hL(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(i,a){return vL(i),mL(a),e?t(i,a):i.__proto__=a,i}}():void 0),gL=Vn,yL=ci,bL=Gt,_L=Yt,wy=bL("species"),Ll=function(e){var r=gL(e);_L&&r&&!r[wy]&&yL(r,wy,{configurable:!0,get:function(){return this}})},wL=Di,SL=TypeError,cs=function(e,r){if(wL(r,e))return e;throw SL("Incorrect invocation")},Sy=sr,TL=kv,CL=si,EL=Gt,kL=EL("species"),jv=function(e,r){var t=Sy(e).constructor,n;return t===void 0||CL(n=Sy(t)[kL])?r:TL(n)},RL=TypeError,Fv=function(e,r){if(e<r)throw RL("Not enough arguments");return e},$L=ns,zT=/(?:ipad|iphone|ipod).*applewebkit/i.test($L),cn=Rt,OL=_a,IL=qi,Ty=Bt,PL=rr,WT=mt,Cy=Z0,AL=oo,Ey=Cl,xL=Fv,ML=zT,NL=Nl,qp=cn.setImmediate,Gp=cn.clearImmediate,LL=cn.process,Qf=cn.Dispatch,DL=cn.Function,ky=cn.MessageChannel,jL=cn.String,Zf=0,Wo={},Ry="onreadystatechange",tu,Da,ed,td;WT(function(){tu=cn.location});var Uv=function(e){if(PL(Wo,e)){var r=Wo[e];delete Wo[e],r()}},rd=function(e){return function(){Uv(e)}},$y=function(e){Uv(e.data)},Oy=function(e){cn.postMessage(jL(e),tu.protocol+"//"+tu.host)};(!qp||!Gp)&&(qp=function(r){xL(arguments.length,1);var t=Ty(r)?r:DL(r),n=AL(arguments,1);return Wo[++Zf]=function(){OL(t,void 0,n)},Da(Zf),Zf},Gp=function(r){delete Wo[r]},NL?Da=function(e){LL.nextTick(rd(e))}:Qf&&Qf.now?Da=function(e){Qf.now(rd(e))}:ky&&!ML?(ed=new ky,td=ed.port2,ed.port1.onmessage=$y,Da=IL(td.postMessage,td)):cn.addEventListener&&Ty(cn.postMessage)&&!cn.importScripts&&tu&&tu.protocol!=="file:"&&!WT(Oy)?(Da=Oy,cn.addEventListener("message",$y,!1)):Ry in Ey("script")?Da=function(e){Cy.appendChild(Ey("script"))[Ry]=function(){Cy.removeChild(this),Uv(e)}}:Da=function(e){setTimeout(rd(e),0)});var HT={set:qp,clear:Gp},KT=function(){this.head=null,this.tail=null};KT.prototype={add:function(e){var r={item:e,next:null},t=this.tail;t?t.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}};var JT=KT,FL=ns,UL=/ipad|iphone|ipod/i.test(FL)&&typeof Pebble<"u",BL=ns,qL=/web0s(?!.*chrome)/i.test(BL),Ya=Rt,Iy=qi,GL=ii.f,nd=HT.set,VL=JT,zL=zT,WL=UL,HL=qL,id=Nl,Py=Ya.MutationObserver||Ya.WebKitMutationObserver,Ay=Ya.document,xy=Ya.process,zu=Ya.Promise,My=GL(Ya,"queueMicrotask"),Vp=My&&My.value,gs,ad,sd,Wu,Ny;if(!Vp){var Hu=new VL,Ku=function(){var e,r;for(id&&(e=xy.domain)&&e.exit();r=Hu.get();)try{r()}catch(t){throw Hu.head&&gs(),t}e&&e.enter()};!zL&&!id&&!HL&&Py&&Ay?(ad=!0,sd=Ay.createTextNode(""),new Py(Ku).observe(sd,{characterData:!0}),gs=function(){sd.data=ad=!ad}):!WL&&zu&&zu.resolve?(Wu=zu.resolve(void 0),Wu.constructor=zu,Ny=Iy(Wu.then,Wu),gs=function(){Ny(Ku)}):id?gs=function(){xy.nextTick(Ku)}:(nd=Iy(nd,Ya),gs=function(){nd(Ku)}),Vp=function(e){Hu.head||gs(),Hu.add(e)}}var KL=Vp,JL=function(e,r){try{arguments.length==1?console.error(e):console.error(e,r)}catch{}},Bv=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}},YL=Rt,Dl=YL.Promise,YT=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",XL=YT,QL=Nl,ZL=!XL&&!QL&&typeof window=="object"&&typeof document=="object",eD=Rt,Ho=Dl,tD=Bt,rD=Rl,nD=wv,iD=Gt,aD=ZL,sD=YT,od=no;Ho&&Ho.prototype;var oD=iD("species"),zp=!1,XT=tD(eD.PromiseRejectionEvent),uD=rD("Promise",function(){var e=nD(Ho),r=e!==String(Ho);if(!r&&od===66)return!0;if(!od||od<51||!/native code/.test(e)){var t=new Ho(function(a){a(1)}),n=function(a){a(function(){},function(){})},i=t.constructor={};if(i[oD]=n,zp=t.then(function(){})instanceof n,!zp)return!0}return!r&&(aD||sD)&&!XT}),Tu={CONSTRUCTOR:uD,REJECTION_EVENT:XT,SUBCLASSING:zp},lo={},Ly=En,cD=TypeError,lD=function(e){var r,t;this.promise=new e(function(n,i){if(r!==void 0||t!==void 0)throw cD("Bad Promise constructor");r=n,t=i}),this.resolve=Ly(r),this.reject=Ly(t)};lo.f=function(e){return new lD(e)};var fD=wt,il=Nl,ma=Rt,Js=qt,Dy=Gr,jy=co,dD=Ui,pD=Ll,hD=En,zc=Bt,vD=tr,mD=cs,gD=jv,QT=HT.set,qv=KL,yD=JL,bD=Bv,_D=JT,ZT=kn,al=Dl,Gv=Tu,eC=lo,jl="Promise",tC=Gv.CONSTRUCTOR,wD=Gv.REJECTION_EVENT,SD=Gv.SUBCLASSING,ud=ZT.getterFor(jl),TD=ZT.set,Rs=al&&al.prototype,Wa=al,Ju=Rs,rC=ma.TypeError,Wp=ma.document,Vv=ma.process,Hp=eC.f,CD=Hp,ED=!!(Wp&&Wp.createEvent&&ma.dispatchEvent),nC="unhandledrejection",kD="rejectionhandled",Fy=0,iC=1,RD=2,zv=1,aC=2,Yu,Uy,$D,By,sC=function(e){var r;return vD(e)&&zc(r=e.then)?r:!1},oC=function(e,r){var t=r.value,n=r.state==iC,i=n?e.ok:e.fail,a=e.resolve,s=e.reject,c=e.domain,o,u,l;try{i?(n||(r.rejection===aC&&ID(r),r.rejection=zv),i===!0?o=t:(c&&c.enter(),o=i(t),c&&(c.exit(),l=!0)),o===e.promise?s(rC("Promise-chain cycle")):(u=sC(o))?Js(u,o,a,s):a(o)):s(t)}catch(f){c&&!l&&c.exit(),s(f)}},uC=function(e,r){e.notified||(e.notified=!0,qv(function(){for(var t=e.reactions,n;n=t.get();)oC(n,e);e.notified=!1,r&&!e.rejection&&OD(e)}))},cC=function(e,r,t){var n,i;ED?(n=Wp.createEvent("Event"),n.promise=r,n.reason=t,n.initEvent(e,!1,!0),ma.dispatchEvent(n)):n={promise:r,reason:t},!wD&&(i=ma["on"+e])?i(n):e===nC&&yD("Unhandled promise rejection",t)},OD=function(e){Js(QT,ma,function(){var r=e.facade,t=e.value,n=qy(e),i;if(n&&(i=bD(function(){il?Vv.emit("unhandledRejection",t,r):cC(nC,r,t)}),e.rejection=il||qy(e)?aC:zv,i.error))throw i.value})},qy=function(e){return e.rejection!==zv&&!e.parent},ID=function(e){Js(QT,ma,function(){var r=e.facade;il?Vv.emit("rejectionHandled",r):cC(kD,r,e.value)})},As=function(e,r,t){return function(n){e(r,n,t)}},Ls=function(e,r,t){e.done||(e.done=!0,t&&(e=t),e.value=r,e.state=RD,uC(e,!0))},Kp=function(e,r,t){if(!e.done){e.done=!0,t&&(e=t);try{if(e.facade===r)throw rC("Promise can't be resolved itself");var n=sC(r);n?qv(function(){var i={done:!1};try{Js(n,r,As(Kp,i,e),As(Ls,i,e))}catch(a){Ls(i,a,e)}}):(e.value=r,e.state=iC,uC(e,!1))}catch(i){Ls({done:!1},i,e)}}};if(tC&&(Wa=function(r){mD(this,Ju),hD(r),Js(Yu,this);var t=ud(this);try{r(As(Kp,t),As(Ls,t))}catch(n){Ls(t,n)}},Ju=Wa.prototype,Yu=function(r){TD(this,{type:jl,done:!1,notified:!1,parent:!1,reactions:new _D,rejection:!1,state:Fy,value:void 0})},Yu.prototype=Dy(Ju,"then",function(r,t){var n=ud(this),i=Hp(gD(this,Wa));return n.parent=!0,i.ok=zc(r)?r:!0,i.fail=zc(t)&&t,i.domain=il?Vv.domain:void 0,n.state==Fy?n.reactions.add(i):qv(function(){oC(i,n)}),i.promise}),Uy=function(){var e=new Yu,r=ud(e);this.promise=e,this.resolve=As(Kp,r),this.reject=As(Ls,r)},eC.f=Hp=function(e){return e===Wa||e===$D?new Uy(e):CD(e)},zc(al)&&Rs!==Object.prototype)){By=Rs.then,SD||Dy(Rs,"then",function(r,t){var n=this;return new Wa(function(i,a){Js(By,n,i,a)}).then(r,t)},{unsafe:!0});try{delete Rs.constructor}catch{}jy&&jy(Rs,Ju)}fD({global:!0,constructor:!0,wrap:!0,forced:tC},{Promise:Wa});dD(Wa,jl,!1);pD(jl);var Cu={},PD=Gt,AD=Cu,xD=PD("iterator"),MD=Array.prototype,Wv=function(e){return e!==void 0&&(AD.Array===e||MD[xD]===e)},ND=Bi,Gy=as,LD=si,DD=Cu,jD=Gt,FD=jD("iterator"),Eu=function(e){if(!LD(e))return Gy(e,FD)||Gy(e,"@@iterator")||DD[ND(e)]},UD=qt,BD=En,qD=sr,GD=is,VD=Eu,zD=TypeError,Fl=function(e,r){var t=arguments.length<2?VD(e):r;if(BD(t))return qD(UD(t,e));throw zD(GD(e)+" is not iterable")},WD=qt,Vy=sr,HD=as,lC=function(e,r,t){var n,i;Vy(e);try{if(n=HD(e,"return"),!n){if(r==="throw")throw t;return t}n=WD(n,e)}catch(a){i=!0,n=a}if(r==="throw")throw t;if(i)throw n;return Vy(n),t},KD=qi,JD=qt,YD=sr,XD=is,QD=Wv,ZD=Ir,zy=Di,e2=Fl,t2=Eu,Wy=lC,r2=TypeError,Wc=function(e,r){this.stopped=e,this.result=r},Hy=Wc.prototype,Ul=function(e,r,t){var n=t&&t.that,i=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),c=!!(t&&t.INTERRUPTED),o=KD(r,n),u,l,f,d,p,h,E,x=function(M){return u&&Wy(u,"normal",M),new Wc(!0,M)},I=function(M){return i?(YD(M),c?o(M[0],M[1],x):o(M[0],M[1])):c?o(M,x):o(M)};if(a)u=e.iterator;else if(s)u=e;else{if(l=t2(e),!l)throw r2(XD(e)+" is not iterable");if(QD(l)){for(f=0,d=ZD(e);d>f;f++)if(p=I(e[f]),p&&zy(Hy,p))return p;return new Wc(!1)}u=e2(e,l)}for(h=a?e.next:u.next;!(E=JD(h,u)).done;){try{p=I(E.value)}catch(M){Wy(u,"throw",M)}if(typeof p=="object"&&p&&zy(Hy,p))return p}return new Wc(!1)},n2=Gt,fC=n2("iterator"),dC=!1;try{var i2=0,Ky={next:function(){return{done:!!i2++}},return:function(){dC=!0}};Ky[fC]=function(){return this},Array.from(Ky,function(){throw 2})}catch{}var Bl=function(e,r){if(!r&&!dC)return!1;var t=!1;try{var n={};n[fC]=function(){return{next:function(){return{done:t=!0}}}},e(n)}catch{}return t},a2=Dl,s2=Bl,o2=Tu.CONSTRUCTOR,pC=o2||!s2(function(e){a2.all(e).then(void 0,function(){})}),u2=wt,c2=qt,l2=En,f2=lo,d2=Bv,p2=Ul,h2=pC;u2({target:"Promise",stat:!0,forced:h2},{all:function(r){var t=this,n=f2.f(t),i=n.resolve,a=n.reject,s=d2(function(){var c=l2(t.resolve),o=[],u=0,l=1;p2(r,function(f){var d=u++,p=!1;l++,c2(c,t,f).then(function(h){p||(p=!0,o[d]=h,--l||i(o))},a)}),--l||i(o)});return s.error&&a(s.value),n.promise}});var v2=wt,m2=Tu.CONSTRUCTOR,Jp=Dl,g2=Vn,y2=Bt,b2=Gr,Jy=Jp&&Jp.prototype;v2({target:"Promise",proto:!0,forced:m2,real:!0},{catch:function(e){return this.then(void 0,e)}});if(y2(Jp)){var Yy=g2("Promise").prototype.catch;Jy.catch!==Yy&&b2(Jy,"catch",Yy,{unsafe:!0})}var _2=wt,w2=qt,S2=En,T2=lo,C2=Bv,E2=Ul,k2=pC;_2({target:"Promise",stat:!0,forced:k2},{race:function(r){var t=this,n=T2.f(t),i=n.reject,a=C2(function(){var s=S2(t.resolve);E2(r,function(c){w2(s,t,c).then(n.resolve,i)})});return a.error&&i(a.value),n.promise}});var R2=wt,$2=qt,O2=lo,I2=Tu.CONSTRUCTOR;R2({target:"Promise",stat:!0,forced:I2},{reject:function(r){var t=O2.f(this);return $2(t.reject,void 0,r),t.promise}});var P2=sr,A2=tr,x2=lo,M2=function(e,r){if(P2(e),A2(r)&&r.constructor===e)return r;var t=x2.f(e),n=t.resolve;return n(r),t.promise},N2=wt,L2=Vn,D2=Tu.CONSTRUCTOR,j2=M2;L2("Promise");N2({target:"Promise",stat:!0,forced:D2},{resolve:function(r){return j2(this,r)}});var F2=wt,U2=fn.map,B2=wu,q2=B2("map");F2({target:"Array",proto:!0,forced:!q2},{map:function(r){return U2(this,r,arguments.length>1?arguments[1]:void 0)}});var hC={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},G2=Cl,cd=G2("span").classList,Xy=cd&&cd.constructor&&cd.constructor.prototype,vC=Xy===Object.prototype?void 0:Xy,V2=mt,ql=function(e,r){var t=[][e];return!!t&&V2(function(){t.call(null,r||function(){return 1},1)})},z2=fn.forEach,W2=ql,H2=W2("forEach"),K2=H2?[].forEach:function(r){return z2(this,r,arguments.length>1?arguments[1]:void 0)},Qy=Rt,Zy=hC,J2=vC,ld=K2,Y2=ji,mC=function(e){if(e&&e.forEach!==ld)try{Y2(e,"forEach",ld)}catch{e.forEach=ld}};for(var fd in Zy)Zy[fd]&&mC(Qy[fd]&&Qy[fd].prototype);mC(J2);var gC={exports:{}};(function(e){var r=Rn.default;function t(){e.exports=t=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(be,Te,Se){be[Te]=Se.value},c=typeof Symbol=="function"?Symbol:{},o=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(be,Te,Se){return Object.defineProperty(be,Te,{value:Se,enumerable:!0,configurable:!0,writable:!0}),be[Te]}try{f({},"")}catch{f=function(Se,ge,$e){return Se[ge]=$e}}function d(be,Te,Se,ge){var $e=Te&&Te.prototype instanceof E?Te:E,De=Object.create($e.prototype),G=new Re(ge||[]);return s(De,"_invoke",{value:L(be,Se,G)}),De}function p(be,Te,Se){try{return{type:"normal",arg:be.call(Te,Se)}}catch(ge){return{type:"throw",arg:ge}}}n.wrap=d;var h={};function E(){}function x(){}function I(){}var M={};f(M,o,function(){return this});var j=Object.getPrototypeOf,V=j&&j(j(ae([])));V&&V!==i&&a.call(V,o)&&(M=V);var ie=I.prototype=E.prototype=Object.create(M);function oe(be){["next","throw","return"].forEach(function(Te){f(be,Te,function(Se){return this._invoke(Te,Se)})})}function J(be,Te){function Se($e,De,G,Qe){var Et=p(be[$e],be,De);if(Et.type!=="throw"){var ut=Et.arg,je=ut.value;return je&&r(je)=="object"&&a.call(je,"__await")?Te.resolve(je.__await).then(function(te){Se("next",te,G,Qe)},function(te){Se("throw",te,G,Qe)}):Te.resolve(je).then(function(te){ut.value=te,G(ut)},function(te){return Se("throw",te,G,Qe)})}Qe(Et.arg)}var ge;s(this,"_invoke",{value:function(De,G){function Qe(){return new Te(function(Et,ut){Se(De,G,Et,ut)})}return ge=ge?ge.then(Qe,Qe):Qe()}})}function L(be,Te,Se){var ge="suspendedStart";return function($e,De){if(ge==="executing")throw new Error("Generator is already running");if(ge==="completed"){if($e==="throw")throw De;return We()}for(Se.method=$e,Se.arg=De;;){var G=Se.delegate;if(G){var Qe=Y(G,Se);if(Qe){if(Qe===h)continue;return Qe}}if(Se.method==="next")Se.sent=Se._sent=Se.arg;else if(Se.method==="throw"){if(ge==="suspendedStart")throw ge="completed",Se.arg;Se.dispatchException(Se.arg)}else Se.method==="return"&&Se.abrupt("return",Se.arg);ge="executing";var Et=p(be,Te,Se);if(Et.type==="normal"){if(ge=Se.done?"completed":"suspendedYield",Et.arg===h)continue;return{value:Et.arg,done:Se.done}}Et.type==="throw"&&(ge="completed",Se.method="throw",Se.arg=Et.arg)}}}function Y(be,Te){var Se=Te.method,ge=be.iterator[Se];if(ge===void 0)return Te.delegate=null,Se==="throw"&&be.iterator.return&&(Te.method="return",Te.arg=void 0,Y(be,Te),Te.method==="throw")||Se!=="return"&&(Te.method="throw",Te.arg=new TypeError("The iterator does not provide a '"+Se+"' method")),h;var $e=p(ge,be.iterator,Te.arg);if($e.type==="throw")return Te.method="throw",Te.arg=$e.arg,Te.delegate=null,h;var De=$e.arg;return De?De.done?(Te[be.resultName]=De.value,Te.next=be.nextLoc,Te.method!=="return"&&(Te.method="next",Te.arg=void 0),Te.delegate=null,h):De:(Te.method="throw",Te.arg=new TypeError("iterator result is not an object"),Te.delegate=null,h)}function Z(be){var Te={tryLoc:be[0]};1 in be&&(Te.catchLoc=be[1]),2 in be&&(Te.finallyLoc=be[2],Te.afterLoc=be[3]),this.tryEntries.push(Te)}function ye(be){var Te=be.completion||{};Te.type="normal",delete Te.arg,be.completion=Te}function Re(be){this.tryEntries=[{tryLoc:"root"}],be.forEach(Z,this),this.reset(!0)}function ae(be){if(be){var Te=be[o];if(Te)return Te.call(be);if(typeof be.next=="function")return be;if(!isNaN(be.length)){var Se=-1,ge=function $e(){for(;++Se<be.length;)if(a.call(be,Se))return $e.value=be[Se],$e.done=!1,$e;return $e.value=void 0,$e.done=!0,$e};return ge.next=ge}}return{next:We}}function We(){return{value:void 0,done:!0}}return x.prototype=I,s(ie,"constructor",{value:I,configurable:!0}),s(I,"constructor",{value:x,configurable:!0}),x.displayName=f(I,l,"GeneratorFunction"),n.isGeneratorFunction=function(be){var Te=typeof be=="function"&&be.constructor;return!!Te&&(Te===x||(Te.displayName||Te.name)==="GeneratorFunction")},n.mark=function(be){return Object.setPrototypeOf?Object.setPrototypeOf(be,I):(be.__proto__=I,f(be,l,"GeneratorFunction")),be.prototype=Object.create(ie),be},n.awrap=function(be){return{__await:be}},oe(J.prototype),f(J.prototype,u,function(){return this}),n.AsyncIterator=J,n.async=function(be,Te,Se,ge,$e){$e===void 0&&($e=Promise);var De=new J(d(be,Te,Se,ge),$e);return n.isGeneratorFunction(Te)?De:De.next().then(function(G){return G.done?G.value:De.next()})},oe(ie),f(ie,l,"Generator"),f(ie,o,function(){return this}),f(ie,"toString",function(){return"[object Generator]"}),n.keys=function(be){var Te=Object(be),Se=[];for(var ge in Te)Se.push(ge);return Se.reverse(),function $e(){for(;Se.length;){var De=Se.pop();if(De in Te)return $e.value=De,$e.done=!1,$e}return $e.done=!0,$e}},n.values=ae,Re.prototype={constructor:Re,reset:function(Te){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(ye),!Te)for(var Se in this)Se.charAt(0)==="t"&&a.call(this,Se)&&!isNaN(+Se.slice(1))&&(this[Se]=void 0)},stop:function(){this.done=!0;var Te=this.tryEntries[0].completion;if(Te.type==="throw")throw Te.arg;return this.rval},dispatchException:function(Te){if(this.done)throw Te;var Se=this;function ge(ut,je){return G.type="throw",G.arg=Te,Se.next=ut,je&&(Se.method="next",Se.arg=void 0),!!je}for(var $e=this.tryEntries.length-1;$e>=0;--$e){var De=this.tryEntries[$e],G=De.completion;if(De.tryLoc==="root")return ge("end");if(De.tryLoc<=this.prev){var Qe=a.call(De,"catchLoc"),Et=a.call(De,"finallyLoc");if(Qe&&Et){if(this.prev<De.catchLoc)return ge(De.catchLoc,!0);if(this.prev<De.finallyLoc)return ge(De.finallyLoc)}else if(Qe){if(this.prev<De.catchLoc)return ge(De.catchLoc,!0)}else{if(!Et)throw new Error("try statement without catch or finally");if(this.prev<De.finallyLoc)return ge(De.finallyLoc)}}}},abrupt:function(Te,Se){for(var ge=this.tryEntries.length-1;ge>=0;--ge){var $e=this.tryEntries[ge];if($e.tryLoc<=this.prev&&a.call($e,"finallyLoc")&&this.prev<$e.finallyLoc){var De=$e;break}}De&&(Te==="break"||Te==="continue")&&De.tryLoc<=Se&&Se<=De.finallyLoc&&(De=null);var G=De?De.completion:{};return G.type=Te,G.arg=Se,De?(this.method="next",this.next=De.finallyLoc,h):this.complete(G)},complete:function(Te,Se){if(Te.type==="throw")throw Te.arg;return Te.type==="break"||Te.type==="continue"?this.next=Te.arg:Te.type==="return"?(this.rval=this.arg=Te.arg,this.method="return",this.next="end"):Te.type==="normal"&&Se&&(this.next=Se),h},finish:function(Te){for(var Se=this.tryEntries.length-1;Se>=0;--Se){var ge=this.tryEntries[Se];if(ge.finallyLoc===Te)return this.complete(ge.completion,ge.afterLoc),ye(ge),h}},catch:function(Te){for(var Se=this.tryEntries.length-1;Se>=0;--Se){var ge=this.tryEntries[Se];if(ge.tryLoc===Te){var $e=ge.completion;if($e.type==="throw"){var De=$e.arg;ye(ge)}return De}}throw new Error("illegal catch attempt")},delegateYield:function(Te,Se,ge){return this.delegate={iterator:ae(Te),resultName:Se,nextLoc:ge},this.method==="next"&&(this.arg=void 0),h}},n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(gC);var X2=gC.exports,Hc=X2(),ku=Hc;try{regeneratorRuntime=Hc}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Hc:Function("r","regeneratorRuntime = r")(Hc)}var Q2=TypeError,Z2=9007199254740991,yC=function(e){if(e>Z2)throw Q2("Maximum allowed index exceeded");return e},ej=wt,tj=mt,rj=yu,nj=tr,ij=Mr,aj=Ir,eb=yC,tb=uo,sj=Pv,oj=wu,uj=Gt,cj=no,bC=uj("isConcatSpreadable"),lj=cj>=51||!tj(function(){var e=[];return e[bC]=!1,e.concat()[0]!==e}),fj=function(e){if(!nj(e))return!1;var r=e[bC];return r!==void 0?!!r:rj(e)},dj=!lj||!oj("concat");ej({target:"Array",proto:!0,arity:1,forced:dj},{concat:function(r){var t=ij(this),n=sj(t,0),i=0,a,s,c,o,u;for(a=-1,c=arguments.length;a<c;a++)if(u=a===-1?t:arguments[a],fj(u))for(o=aj(u),eb(i+o),s=0;s<o;s++,i++)s in u&&tb(n,i,u[s]);else eb(i+1),tb(n,i++,u);return n.length=i,n}});var pj=sr,hj=lC,vj=function(e,r,t,n){try{return n?r(pj(t)[0],t[1]):r(t)}catch(i){hj(e,"throw",i)}},mj=qi,gj=qt,yj=Mr,bj=vj,_j=Wv,wj=$l,Sj=Ir,rb=uo,Tj=Fl,Cj=Eu,nb=Array,_C=function(r){var t=yj(r),n=wj(this),i=arguments.length,a=i>1?arguments[1]:void 0,s=a!==void 0;s&&(a=mj(a,i>2?arguments[2]:void 0));var c=Cj(t),o=0,u,l,f,d,p,h;if(c&&!(this===nb&&_j(c)))for(d=Tj(t,c),p=d.next,l=n?new this:[];!(f=gj(p,d)).done;o++)h=s?bj(d,a,[f.value,o],!0):f.value,rb(l,o,h);else for(u=Sj(t),l=n?new this(u):nb(u);u>o;o++)h=s?a(t[o],o):t[o],rb(l,o,h);return l.length=o,l},Ej=wt,kj=_C,Rj=Bl,$j=!Rj(function(e){Array.from(e)});Ej({target:"Array",stat:!0,forced:$j},{from:kj});var Hv=_t,Oj=ui,Ij=br,Pj=oi,Aj=Hv("".charAt),ib=Hv("".charCodeAt),xj=Hv("".slice),ab=function(e){return function(r,t){var n=Ij(Pj(r)),i=Oj(t),a=n.length,s,c;return i<0||i>=a?e?"":void 0:(s=ib(n,i),s<55296||s>56319||i+1===a||(c=ib(n,i+1))<56320||c>57343?e?Aj(n,i):s:e?xj(n,i,i+2):(s-55296<<10)+(c-56320)+65536)}},Kv={codeAt:ab(!1),charAt:ab(!0)},Mj=mt,Nj=!Mj(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Lj=rr,Dj=Bt,jj=Mr,Fj=El,Uj=Nj,sb=Fj("IE_PROTO"),Yp=Object,Bj=Yp.prototype,Gl=Uj?Yp.getPrototypeOf:function(e){var r=jj(e);if(Lj(r,sb))return r[sb];var t=r.constructor;return Dj(t)&&r instanceof t?t.prototype:r instanceof Yp?Bj:null},qj=mt,Gj=Bt,Vj=tr,ob=Gl,zj=Gr,Wj=Gt,Xp=Wj("iterator"),wC=!1,Xa,dd,pd;[].keys&&(pd=[].keys(),"next"in pd?(dd=ob(ob(pd)),dd!==Object.prototype&&(Xa=dd)):wC=!0);var Hj=!Vj(Xa)||qj(function(){var e={};return Xa[Xp].call(e)!==e});Hj&&(Xa={});Gj(Xa[Xp])||zj(Xa,Xp,function(){return this});var SC={IteratorPrototype:Xa,BUGGY_SAFARI_ITERATORS:wC},Kj=SC.IteratorPrototype,Jj=wa,Yj=rs,Xj=Ui,Qj=Cu,Zj=function(){return this},TC=function(e,r,t,n){var i=r+" Iterator";return e.prototype=Jj(Kj,{next:Yj(+!n,t)}),Xj(e,i,!1),Qj[i]=Zj,e},eF=wt,tF=qt,CC=du,rF=Bt,nF=TC,ub=Gl,cb=co,iF=Ui,aF=ji,hd=Gr,sF=Gt,oF=Cu,EC=SC,uF=CC.PROPER,cF=CC.CONFIGURABLE,lb=EC.IteratorPrototype,Xu=EC.BUGGY_SAFARI_ITERATORS,To=sF("iterator"),fb="keys",Co="values",db="entries",lF=function(){return this},Jv=function(e,r,t,n,i,a,s){nF(t,r,n);var c=function(I){if(I===i&&d)return d;if(!Xu&&I in l)return l[I];switch(I){case fb:return function(){return new t(this,I)};case Co:return function(){return new t(this,I)};case db:return function(){return new t(this,I)}}return function(){return new t(this)}},o=r+" Iterator",u=!1,l=e.prototype,f=l[To]||l["@@iterator"]||i&&l[i],d=!Xu&&f||c(i),p=r=="Array"&&l.entries||f,h,E,x;if(p&&(h=ub(p.call(new e)),h!==Object.prototype&&h.next&&(ub(h)!==lb&&(cb?cb(h,lb):rF(h[To])||hd(h,To,lF)),iF(h,o,!0))),uF&&i==Co&&f&&f.name!==Co&&(cF?aF(l,"name",Co):(u=!0,d=function(){return tF(f,this)})),i)if(E={values:c(Co),keys:a?d:c(fb),entries:c(db)},s)for(x in E)(Xu||u||!(x in l))&&hd(l,x,E[x]);else eF({target:r,proto:!0,forced:Xu||u},E);return l[To]!==d&&hd(l,To,d,{name:i}),oF[r]=d,E},Yv=function(e,r){return{value:e,done:r}},fF=Kv.charAt,dF=br,kC=kn,pF=Jv,pb=Yv,RC="String Iterator",hF=kC.set,vF=kC.getterFor(RC);pF(String,"String",function(e){hF(this,{type:RC,string:dF(e),index:0})},function(){var r=vF(this),t=r.string,n=r.index,i;return n>=t.length?pb(void 0,!0):(i=fF(t,n),r.index+=i.length,pb(i,!1))});var $C={exports:{}};(function(e){(function(r,t){e.exports?e.exports=t():r.log=t()})(Ve,function(){var r=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function a(E,x){var I=E[x];if(typeof I.bind=="function")return I.bind(E);try{return Function.prototype.bind.call(I,E)}catch{return function(){return Function.prototype.apply.apply(I,[E,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(E){return E==="debug"&&(E="log"),typeof console===t?!1:E==="trace"&&n?s:console[E]!==void 0?a(console,E):console.log!==void 0?a(console,"log"):r}function o(E,x){for(var I=0;I<i.length;I++){var M=i[I];this[M]=I<E?r:this.methodFactory(M,E,x)}this.log=this.debug}function u(E,x,I){return function(){typeof console!==t&&(o.call(this,x,I),this[E].apply(this,arguments))}}function l(E,x,I){return c(E)||u.apply(this,arguments)}function f(E,x,I){var M=this,j;x=x??"WARN";var V="loglevel";typeof E=="string"?V+=":"+E:typeof E=="symbol"&&(V=void 0);function ie(Y){var Z=(i[Y]||"silent").toUpperCase();if(!(typeof window===t||!V)){try{window.localStorage[V]=Z;return}catch{}try{window.document.cookie=encodeURIComponent(V)+"="+Z+";"}catch{}}}function oe(){var Y;if(!(typeof window===t||!V)){try{Y=window.localStorage[V]}catch{}if(typeof Y===t)try{var Z=window.document.cookie,ye=Z.indexOf(encodeURIComponent(V)+"=");ye!==-1&&(Y=/^([^;]+)/.exec(Z.slice(ye))[1])}catch{}return M.levels[Y]===void 0&&(Y=void 0),Y}}function J(){if(!(typeof window===t||!V)){try{window.localStorage.removeItem(V);return}catch{}try{window.document.cookie=encodeURIComponent(V)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}M.name=E,M.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},M.methodFactory=I||l,M.getLevel=function(){return j},M.setLevel=function(Y,Z){if(typeof Y=="string"&&M.levels[Y.toUpperCase()]!==void 0&&(Y=M.levels[Y.toUpperCase()]),typeof Y=="number"&&Y>=0&&Y<=M.levels.SILENT){if(j=Y,Z!==!1&&ie(Y),o.call(M,Y,E),typeof console===t&&Y<M.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+Y},M.setDefaultLevel=function(Y){x=Y,oe()||M.setLevel(Y,!1)},M.resetLevel=function(){M.setLevel(x,!1),J()},M.enableAll=function(Y){M.setLevel(M.levels.TRACE,Y)},M.disableAll=function(Y){M.setLevel(M.levels.SILENT,Y)};var L=oe();L==null&&(L=x),M.setLevel(L,!1)}var d=new f,p={};d.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var I=p[x];return I||(I=p[x]=new f(x,d.getLevel(),d.methodFactory)),I};var h=typeof window!==t?window.log:void 0;return d.noConflict=function(){return typeof window!==t&&window.log===d&&(window.log=h),d},d.getLoggers=function(){return p},d.default=d,d})})($C);var pr=$C.exports;const Ja="\\d+(?:[\\.,]\\d+)?",mF=`(${Ja}W)`,gF=`(${Ja}Y)?(${Ja}M)?(${Ja}D)?`,yF=`T(${Ja}H)?(${Ja}M)?(${Ja}S)?`,bF=`P(?:${mF}|${gF}(?:${yF})?)`,_F=["weeks","years","months","days","hours","minutes","seconds"],Xv=new RegExp(bF),OC=e=>e.match(Xv).slice(1).reduce((r,t,n)=>(r[_F[n]]=parseFloat(t)||0,r),{}),Qv=(e,r)=>{const t=r?r.getTime():Date.now(),n=new Date(t);return n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+e.days),n.setHours(n.getHours()+e.hours),n.setMinutes(n.getMinutes()+e.minutes),n.setMilliseconds(n.getMilliseconds()+e.seconds*1e3),n.setDate(n.getDate()+e.weeks*7),n},IC=(e,r)=>{const t=r?r.getTime():Date.now(),n=new Date(t);return(Qv(e,n).getTime()-n.getTime())/1e3},wF={end:Qv,toSeconds:IC,pattern:Xv,parse:OC},SF=Object.freeze(Object.defineProperty({__proto__:null,default:wF,end:Qv,parse:OC,pattern:Xv,toSeconds:IC},Symbol.toStringTag,{value:"Module"})),TF=w0(SF);var CF=Gt,EF=wa,kF=qr.f,Qp=CF("unscopables"),Zp=Array.prototype;Zp[Qp]==null&&kF(Zp,Qp,{configurable:!0,value:EF(null)});var Zv=function(e){Zp[Qp][e]=!0},RF=ln,em=Zv,hb=Cu,PC=kn,$F=qr.f,OF=Jv,Qu=Yv,IF=Yt,AC="Array Iterator",PF=PC.set,AF=PC.getterFor(AC),xC=OF(Array,"Array",function(e,r){PF(this,{type:AC,target:RF(e),index:0,kind:r})},function(){var e=AF(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,Qu(void 0,!0)):t=="keys"?Qu(n,!1):t=="values"?Qu(r[n],!1):Qu([n,r[n]],!1)},"values"),vb=hb.Arguments=hb.Array;em("keys");em("values");em("entries");if(IF&&vb.name!=="values")try{$F(vb,"name",{value:"values"})}catch{}var mb=Rt,MC=hC,xF=vC,jo=xC,vd=ji,NC=Gt,md=NC("iterator"),gb=NC("toStringTag"),gd=jo.values,LC=function(e,r){if(e){if(e[md]!==gd)try{vd(e,md,gd)}catch{e[md]=gd}if(e[gb]||vd(e,gb,r),MC[r]){for(var t in jo)if(e[t]!==jo[t])try{vd(e,t,jo[t])}catch{e[t]=jo[t]}}}};for(var yd in MC)LC(mb[yd]&&mb[yd].prototype,yd);LC(xF,"DOMTokenList");var MF=Bt,NF=tr,yb=co,tm=function(e,r,t){var n,i;return yb&&MF(n=r.constructor)&&n!==t&&NF(i=n.prototype)&&i!==t.prototype&&yb(e,i),e},LF=_t,DF=LF(1 .valueOf),jF=`
8
+ </dialog>`;function fO(e,r,t){const n=(i,a)=>{const s=document.createElement("div");s.className="cobrowse-wrapper",s.lang=t;const c=document.querySelector(".cobrowse-template");let o;c?o=c.textContent:o=lO,o=o.replace(/\$title/g,i).replace(/\$content/g,a),o=o.replace(/\$allow/g,r.allowText).replace(/\$deny/g,r.denyText),s.innerHTML=o;const u=()=>{s.parentNode&&s.parentNode.removeChild(s)};return new Promise(l=>{document.body&&document.body.appendChild(s);const f=s.querySelector(".js-cobrowse-allow");f==null||f.addEventListener("click",()=>{l(!0),u()});const d=s.querySelector(".js-cobrowse-deny");d==null||d.addEventListener("click",()=>{l(!1),u()})})};e.confirmSession=function(){return n(r.confirmSessionTitle,r.confirmSessionContent)},e.confirmRemoteControl=function(){return n(r.confirmRemoteControlTitle,r.confirmRemoteControlContent)},e.confirmFullDevice=function(){return n(r.confirmFullDeviceTitle,r.confirmFullDeviceContent)}}function dO(e,r,t){const n=()=>{e.currentSession&&e.currentSession.end()};e.showSessionControls=function(){let i=document.querySelector("#cobrowse-end-button");i||(i=document.createElement("button"),i.id="cobrowse-end-button",i.setAttribute("lang",t),i.textContent=r,i.addEventListener("click",n)),document.body.appendChild(i)},e.hideSessionControls=function(){let i=document.querySelector("#cobrowse-end-button");i&&i.parentNode&&(i.removeEventListener("click",n),i.parentNode.removeChild(i))}}const pO={confirmSessionTitle:"Co-browse Session Request",confirmSessionContent:"Do you want to share your current screen with the agent?",endSessionText:"End Co-browse Session",confirmRemoteControlTitle:"Remote Access Request",confirmRemoteControlContent:"The agent would like to have access to your currently shared screen to further assist you. Do you want to allow this?",confirmFullDeviceTitle:"Screen Share Request",confirmFullDeviceContent:"Do you want to share your full screen with the agent? The agent will not be able to control anything on the screen.",allowText:"Allow",denyText:"Deny"},hO={confirmSessionTitle:"Solicitud de sesión de conavegación",confirmSessionContent:"¿Desea compartir su pantalla actual con el agente?",endSessionText:"Fin de la sesión de conavegación",confirmRemoteControlTitle:"Solicitud de acceso remoto",confirmRemoteControlContent:"El agente desea tener acceso a su pantalla actual compartida para seguir asistiéndole. ¿Desea permitirlo?",confirmFullDeviceTitle:"Solicitud de compartir pantalla",confirmFullDeviceContent:"¿Desea compartir su pantalla completa con el agente? El agente no podrá controlar nada de la pantalla.",allowText:"Permitir",denyText:"Denegar"},vO={confirmSessionTitle:"Demande de session de co-navigation",confirmSessionContent:"Voulez-vous partager votre écran actuel avec l'agent ?",endSessionText:"Terminer la session de co-navigation",confirmRemoteControlTitle:"Demande d'accès à distance",confirmRemoteControlContent:"L'agent souhaite avoir accès à l'écran que vous partagez actuellement pour mieux vous aider. Voulez-vous l'y autoriser ?",confirmFullDeviceTitle:"Demande de partage d'écran",confirmFullDeviceContent:"Voulez-vous partager votre écran complet avec l'agent ? L'agent ne sera pas en mesure de contrôler quoi que ce soit sur l'écran.",allowText:"Autoriser",denyText:"Refuser"},mO={confirmSessionTitle:"Co-Browsing-Sitzungsanfrage",confirmSessionContent:"Möchten Sie Ihren aktuellen Bildschirm für den Agenten freigeben?",endSessionText:"Co-Browsing-Sitzung beenden",confirmRemoteControlTitle:"Fernzugriff-Anfrage",confirmRemoteControlContent:"Der Agent möchte Zugriff auf Ihren aktuell freigegebenen Bildschirm erhalten, um Ihnen weiterhelfen zu können. Möchten Sie dies erlauben?",confirmFullDeviceTitle:"Bildschirmfreigabe",confirmFullDeviceContent:"Möchten Sie Ihren gesamten Bildschirm für den Agenten freigeben? Der Agent ist dadurch nicht in der Lage, Elemente auf Ihrem Bildschirm zu steuern.",allowText:"Erlauben",denyText:"Verweigern"},gO={confirmSessionTitle:"共同ブラウジングセッションリクエスト",confirmSessionContent:"現在の画面を担当者と共有したいですか。",endSessionText:"共同ブラウジングセッションを終了",confirmRemoteControlTitle:"リモートアクセスリクエスト",confirmRemoteControlContent:"担当者は、お客様をさらにお手伝いするために、現在共有中の画面へのアクセスを希望しています。許可しますか。",confirmFullDeviceTitle:"画面共有リクエスト",confirmFullDeviceContent:"画面全体を担当者と共有したいですか。担当者は画面上で一切の操作ができません。",allowText:"許可",denyText:"拒否"},yO={confirmSessionTitle:"코브라우징 세션 요청",confirmSessionContent:"현재 화면을 상담원과 공유하시겠습니까?",endSessionText:"코브라우징 세션 종료",confirmRemoteControlTitle:"원격 액세스 요청",confirmRemoteControlContent:"상담원이 추가 지원을 위해 현재 공유된 화면에 액세스할 수 있기를 원합니다. 허용하시겠습니까?",confirmFullDeviceTitle:"화면 공유 요청",confirmFullDeviceContent:"상담원과 전체 화면을 공유하시겠습니까? 상담원은 화면의 어떤 부분도 제어할 수 없습니다.",allowText:"허용",denyText:"거절"},bO={confirmSessionTitle:"Richiesta di sessione di co-browsing",confirmSessionContent:"Vuoi condividere la tua schermata attuale con l'operatore?",endSessionText:"Termina sessione di co-browsing",confirmRemoteControlTitle:"Richiesta di accesso remoto",confirmRemoteControlContent:"L'operatore vorrebbe accedere alla tua schermata attualmente condivisa per assisterti al meglio. Acconsenti?",confirmFullDeviceTitle:"Richiesta di condivisione schermo",confirmFullDeviceContent:"Vuoi condividere il tuo intero schermo con l'operatore? L'operatore non potrà controllare nessun elemento sullo schermo.",allowText:"Consenti",denyText:"Rifiuta"},_O={confirmSessionTitle:"同步浏览会话请求",confirmSessionContent:"您是否要向该客服代表共享当前的屏幕?",endSessionText:"结束同步浏览会话",confirmRemoteControlTitle:"远程访问请求",confirmRemoteControlContent:"为了进一步协助您,客服代表想访问您当前的共享屏幕。您是否允许这样做?",confirmFullDeviceTitle:"屏幕共享请求",confirmFullDeviceContent:"您是否要向该客服代表共享全屏?客服代表将不能控制屏幕上的任何东西。",allowText:"允许",denyText:"拒绝"},wO={confirmSessionTitle:"Samwebbläsningssession har begärts",confirmSessionContent:"Vill du dela din aktuella skärm med vår medarbetare?",endSessionText:"Avsluta samwebbläsningssession",confirmRemoteControlTitle:"Begäran om fjärråtkomst",confirmRemoteControlContent:"Vår medarbetare skulle vilja få åtkomst till skärmen som du delar just nu för att kunna hjälpa dig vidare. Vill du tillåta detta?",confirmFullDeviceTitle:"Begäran om skärmdelning",confirmFullDeviceContent:"Vill du dela hela skärmen med medarbetaren? Medarbetaren kommer inte kunna kontrollera något på skärmen.",allowText:"Tillåt",denyText:"Neka"},SO={confirmSessionTitle:"Solicitação de Sessão de Co-navegação",confirmSessionContent:"Deseja partilhar o seu ecrã atual com o agente?",endSessionText:"Terminar Sessão de Co-navegação",confirmRemoteControlTitle:"Solicitação de Acesso Remoto",confirmRemoteControlContent:"O agente gostaria de ter acesso ao seu ecrã partilhado atualmente para ajudá-lo ainda mais. Quer permitir isto?",confirmFullDeviceTitle:"Solicitação de Partilha de Ecrã",confirmFullDeviceContent:"Deseja partilhar o seu ecrã inteiro com o agente? O agente não poderá controlar nada no ecrã.",allowText:"Permitir",denyText:"Negar"},TO={confirmSessionTitle:"Pyyntö yhteisselausistunnosta",confirmSessionContent:"Haluatko jakaa nykyisen näyttösi edustajan kanssa?",endSessionText:"Lopeta yhteisselausistunto",confirmRemoteControlTitle:"Etäkäyttöpyyntö",confirmRemoteControlContent:"Edustaja haluaisi saada käyttää tällä hetkellä jakamaasi näyttöä voidakseen auttaa sinua enemmän. Haluatko antaa siihen luvan?",confirmFullDeviceTitle:"Näytön jakamispyyntö",confirmFullDeviceContent:"Haluatko jakaa koko näyttösi edustajan kanssa? Edustaja ei pysty käyttämään mitään näytöllä olevaa.",allowText:"Salli",denyText:"Estä"},CO={confirmSessionTitle:"Samlesingsøkten er startet",confirmSessionContent:"Vil du dele skjermen din med agenten?",endSessionText:"Avslutt samlesingsøkt",confirmRemoteControlTitle:"Forespørsel om fjerntilgang",confirmRemoteControlContent:"Agenten vil ha tilgang til skjermen din for å kunne hjelpe deg videre. Vil du tillate dette?",confirmFullDeviceTitle:"Forespørsel om skjermdeling",confirmFullDeviceContent:"Vil du dele hele skjermen din med agenten? Agenten kan ikke kontrollere noe på skjermen.",allowText:"Tillat",denyText:"Avvis"},EO={confirmSessionTitle:"Forespørgsel om sambrowsingsession",confirmSessionContent:"Vil du dele din nuværende skærm med agenten",endSessionText:"Afslut sambrowsingsession",confirmRemoteControlTitle:"Anmodning om fjernadgang",confirmRemoteControlContent:"Agenten vil gerne have adgang til din nuværende delte skærm for at kunne hjælpe dig yderligere. Ønsker du at tillade dette?",confirmFullDeviceTitle:"Forespørgsel om skærmdeling",confirmFullDeviceContent:"Vil du dele din fulde skærm med agenten? Agenten vil ikke kunne styre noget på skærmen",allowText:"Tillad",denyText:"Afvis"},kO={confirmSessionTitle:"Verzoek om cobrowse-sessie",confirmSessionContent:"Wilt u uw huidige scherm delen met de agent?",endSessionText:"Cobrowse-sessie beëindigen",confirmRemoteControlTitle:"Verzoek om toegang op afstand",confirmRemoteControlContent:"De agent wil graag toegang hebben tot uw momenteel gedeelde scherm om u verder te helpen. Wilt u dit toestaan?",confirmFullDeviceTitle:"Verzoek om scherm te delen",confirmFullDeviceContent:"Wilt u uw volledige scherm delen met de agent? De agent kan niets op het scherm bedienen.",allowText:"Toestaan",denyText:"Weigeren"},RO={confirmSessionTitle:"Oturum İsteğini Eş Zamanlı Tara",confirmSessionContent:"Mevcut ekranınızı temsilciyle paylaşmak ister misiniz?",endSessionText:"Eş zamanlı Oturum Taramayı Sonlandır",confirmRemoteControlTitle:"Uzaktan Erişim İsteği",confirmRemoteControlContent:"Temsilci şu anda paylaşılan ekranınıza size daha fazla yardımcı olabilmek için erişim sağlamak istiyor. Buna izin vermek istiyor musunuz?",confirmFullDeviceTitle:"Ekran Paylaşım İsteği",confirmFullDeviceContent:"Temsilciyle tam ekranınızı paylaşmak istiyor musunuz? Temsilci ekrandaki hiçbir şeyi kontrol edemez.",allowText:"İzin Ver",denyText:"Reddet"},$O={confirmSessionTitle:"Yêu cầu phiên cùng duyệt",confirmSessionContent:"Bạn có muốn chia sẻ màn hình hiện tại của mình với chuyên viên không?",endSessionText:"Kết thúc phiên cùng duyệt",confirmRemoteControlTitle:"Yêu cầu truy cập từ xa",confirmRemoteControlContent:"Chuyên viên muốn được cấp quyền truy cập vào màn hình bạn đang chia sẻ để hỗ trợ bạn nhiều hơn. Bạn có muốn cho phép không?",confirmFullDeviceTitle:"Yêu cầu chia sẻ màn hình",confirmFullDeviceContent:"Bạn có muốn chia sẻ toàn bộ màn hình của mình với chuyên viên không? Chuyên viên sẽ không thể điều khiển bất cứ phần nào trên màn hình.",allowText:"Cho phép",denyText:"Từ chối"},OO={confirmSessionTitle:"ขอเซสชันเรียกดูร่วม",confirmSessionContent:"คุณต้องการแชร์หน้าจอปัจจุบันกับตัวแทนหรือไม่",endSessionText:"สิ้นสุดเซสชันเรียกดูร่วม",confirmRemoteControlTitle:"ขอการเข้าถึงระยะไกล",confirmRemoteControlContent:"ตัวแทนต้องการเข้าถึงหน้าจอของคุณที่แชร์อยู่ในปัจจุบันเพื่อให้ความช่วยเหลือคุณต่อไป คุณจะอนุญาตหรือไม่",confirmFullDeviceTitle:"ขอแชร์หน้าจอ",confirmFullDeviceContent:"คุณต้องการแชร์ทั้งหน้าของคุณกับตัวแทนหรือไม่ ตัวแทนจะไม่สามารถควบคุมอะไรบนหน้าจอ",allowText:"ยินยอม",denyText:"ปฏิเสธ"},IO={confirmSessionTitle:"طلب جلسة تصفح مشترك",confirmSessionContent:"هل تريد مشاركة شاشتك الحالية مع الموظف؟",endSessionText:"إنهاء جلسة التصفح المشترك",confirmRemoteControlTitle:"طلب التحكم عن بعد",confirmRemoteControlContent:"يرغب مسئول الدعم في رؤية شاشتك المشاركة حالياً لمساعدتك بشكلٍ أكبر. هل تسمح بذلك؟",confirmFullDeviceTitle:"طلب مشاركة الشاشة",confirmFullDeviceContent:"هل تريد مشاركة شاشتك الكاملة مع مسئول الدعم؟ لن يتمكن المسئول من التحكم في أي شيء على الشاشة.",allowText:"السماح",denyText:"الرفض"},PO={en:pO,"en-CA":{confirmSessionTitle:"Co-browse Session Request",confirmSessionContent:"Do you want to share your current screen with the agent?",endSessionText:"End Co-browse Session",confirmRemoteControlTitle:"Remote Access Request",confirmRemoteControlContent:"The agent would like to have access to your currently shared screen to further assist you. Do you want to allow this?",confirmFullDeviceTitle:"Screen Share Request",confirmFullDeviceContent:"Do you want to share your full screen with the agent? The agent will not be able to control anything on the screen.",allowText:"Allow",denyText:"Deny"},"en-GB":{confirmSessionTitle:"Co-browse Session Request",confirmSessionContent:"Do you want to share your current screen with the agent?",endSessionText:"End Co-browse Session",confirmRemoteControlTitle:"Remote Access Request",confirmRemoteControlContent:"The agent would like to have access to your currently shared screen to further assist you. Do you want to allow this?",confirmFullDeviceTitle:"Screen Share Request",confirmFullDeviceContent:"Do you want to share your full screen with the agent? The agent will not be able to control anything on the screen.",allowText:"Allow",denyText:"Deny"},es:hO,"es-MX":{confirmSessionTitle:"Solicitud de Sesión de Co-navegación",confirmSessionContent:"¿Quiere compartir su pantalla actual con el agente?",endSessionText:"Fin de la sesión de co-navegación",confirmRemoteControlTitle:"Solicitud de acceso remoto",confirmRemoteControlContent:"El agente desea tener acceso a su pantalla actualmente compartida para poder ayudarlo. ¿Quiere permitirlo?",confirmFullDeviceTitle:"Petición de pantalla compartida",confirmFullDeviceContent:"¿Quiere compartir su pantalla completa con el agente? El agente no podrá controlar nada en la pantalla.",allowText:"Permitir",denyText:"Denegar"},fr:vO,"fr-CA":{confirmSessionTitle:"Demande de session co-navigation",confirmSessionContent:"Voulez-vous partager votre écran actuel avec l'agent?",endSessionText:"Fin de la session de co-navigation",confirmRemoteControlTitle:"Demande d'accès à distance",confirmRemoteControlContent:"L'agent souhaiterait avoir accès à votre écran actuellement partagé pour mieux vous aider. Voulez-vous l'autoriser?",confirmFullDeviceTitle:"Demande de partage d'écran",confirmFullDeviceContent:"Voulez-vous partager votre écran complet avec l'agent? L'agent ne sera pas en mesure de contrôler quoi que ce soit sur l'écran.",allowText:"Autoriser",denyText:"Refuser"},de:mO,ja:gO,ko:yO,it:bO,zh:_O,"zh-Hant":{confirmSessionTitle:"共同瀏覽工作階段要求",confirmSessionContent:"要與專員分享您目前的畫面嗎?",endSessionText:"結束共同瀏覽工作階段",confirmRemoteControlTitle:"遠端存取要求",confirmRemoteControlContent:"專員想要存取您目前分享的螢幕畫面以進一步協助您。要允許嗎?",confirmFullDeviceTitle:"螢幕畫面分享要求",confirmFullDeviceContent:"要與專員分享全螢幕嗎?專員將無法控制畫面上的任何項目。",allowText:"允許",denyText:"拒絕"},sv:wO,pt:SO,"pt-BR":{confirmSessionTitle:"Solicitação de Sessão de Co-navegação",confirmSessionContent:"Você deseja compartilhar sua tela atual com o agente?",endSessionText:"Encerrar Sessão de Co-navegação",confirmRemoteControlTitle:"Solicitação de Acesso Remoto",confirmRemoteControlContent:"O agente gostaria de acessar sua tela atualmente compartilhada para melhor ajudá-lo. Você deseja permitir isso?",confirmFullDeviceTitle:"Solicitação de Compartilhamento de Tela",confirmFullDeviceContent:"Você deseja compartilhar sua tela inteira com o agente? O agente não poderá controlar nada na tela.",allowText:"Permitir",denyText:"Negar"},fi:TO,nb:CO,da:EO,nl:kO,tr:RO,vi:$O,th:OO,ar:IO};let AO=class{constructor(r){bt(this,"options");bt(this,"communicator");bt(this,"methods");bt(this,"events",new dv);bt(this,"request");bt(this,"chat");bt(this,"cobrowse");this.options=r,this.communicator=new N$(r,this.events);const t=this.communicator.request.bind(this.communicator);this.methods=new tO(t),this.request=t,Or.companyId=r.companyId,r.tenant&&(Or.tenant=r.tenant)}get deviceId(){return Or.deviceId}get user(){return this.communicator.user}get lang(){return this.options.lang?this.options.lang:Dr.get("lang")||"en"}set lang(r){this.options.lang||Dr.set("lang",r)}on(r,t){this.events.addEventListener(r,t)}off(r,t){this.events.removeEventListener(r,t)}async getCompany(){const r=await this.methods.getCompany();return Or.tenant=r.subdomain,r}async getTrigger(r){const t=await this.methods.getTriggers(this.options.companyId);return rO(t,r||this.lang)}getMenus(r,t){return this.methods.getMenus(t||this.lang,r)}getAfterHourMessage(r){return this.methods.getAfterHourMessage(r||this.lang)}getTimeSlots(r,t){return this.methods.getTimeSlots(r,t||this.lang)}getWaitTimes(r,t){return this.methods.getWaitTimes(r,t||this.lang)}createCall(r,t){var n;return!t.email&&((n=this.user)!=null&&n.email)&&(t.email=this.user.email),this.methods.createCall(Number(r),t.lang||this.lang,t)}loadCall(r){return this.methods.fetchCall(r)}cancelCall(r){return this.methods.cancelCall(r)}createEmail(r,t){return this.methods.createEmail(r,t.lang||this.lang,t)}async createChat(r,t={},n){var a,s;if(this.chat&&this.chat.ongoing)throw new Error("There is an ongoing chat.");!t.email&&((a=this.user)!=null&&a.email)&&(t.email=this.user.email),t.cobrowsable===void 0&&(t.cobrowsable=!!((s=this.options.cobrowse)!=null&&s.enabled));const i=await this.methods.createChat(Number(r),t.lang||this.lang,t,this.deviceId);return this.registerOngoingChat(i),await i.clearMediaStore(),n&&this.methods.sendChatCustomData(i.id,n),i}async loadChat(r){const t=await this.methods.loadChat(r,this.deviceId);return t.ongoing?this.registerOngoingChat(t):(Dr.del("chat"),Dr.del("cobrowse")),t}async resumeChat(r){const t=await this.methods.resumeChat(r,this.deviceId);return this.registerOngoingChat(t),t}async loadOngoingChat(){const r=Dr.get("chat");if(r){const t=await this.loadChat(r);if(t.ongoing)return t}}async finishChat(){if(this.chat){await this.chat.disconnect();const r=await this.methods.finishChat(this.chat.id);this.chat.update(r),this.events.triggerEvent("chat.ended")}}async destroyChat(){this.chat&&(this.chat.ongoing&&await this.finishChat(),await this.chat.destroy(),this.chat=null,Or.trackerId="")}getChatDeflection(){return this.methods.getChatDeflection(this.chat.id)}sendChatTranscripts(r){return this.methods.sendChatTranscripts(this.chat.id,r)}getChatSurvey(){return this.methods.getChatSurvey(this.chat.id)}sendChatSurvey(r){if(this.chat.feedbackType!=="survey")throw new Error("Chat feedback type is: "+this.chat.feedbackType);return this.methods.sendChatSurvey(this.chat.id,r)}sendChatRate(r){if(this.chat.feedbackType!=="rate")throw new Error("Chat feedback type is: "+this.chat.feedbackType);return this.methods.rateChat(this.chat.id,r)}escalateChat(r){return this.methods.escalateChat(this.chat.id,r)}fetchMessages(){return this.chat.fetchMessages()}async sendFileMessage(r,t){const n=await this.methods.uploadChatFile(this.chat.id,r,t);return this.chat.sendMessage(n,r)}async sendTextMessage(r){const t={type:"text",content:r};return this.chat.sendMessage(t)}async createCobrowseCode(r,t){await this.initializeCobrowse(r||this.lang);let n=Dr.get("cobrowse");n||(n=Date.now().toString(),Dr.set("cobrowse",n));const i={device_id:this.deviceId,device_name:`${Or.application} / ${Or.version}`,nonce:n,...t};return this.user.name&&(i.user_name=this.user.name),this.cobrowse.setCustomData(i),this.cobrowse.createSessionCode()}async startCobrowse(r="end_user"){if(!this.chat.cobrowsable)throw new Error(`Chat ${this.chat.id} does not support cobrowse.`);const t={chatId:`chat_${this.chat.id}`},n=await this.createCobrowseCode(this.chat.lang,t);if(n){const i=Dr.get("cobrowse");await this.methods.requestChatCobrowse(this.chat.id,{code:n,from:r,nonce:i})}}async initializeCobrowse(r){if(!this.cobrowse){const t=this.options.cobrowse.messages||PO[r],n={...this.options.cobrowse,messages:t,lang:r};this.cobrowse=await vv.create(n),this.cobrowse.start(),["loaded","updated","ended"].forEach(a=>{this.cobrowse.on(`session.${a}`,s=>{this.events.triggerEvent(`cobrowse.${a}`,s)})})}}registerOngoingChat(r){this.events.triggerEvent("chat.ongoing",r),r._setGlobalEvents(this.events),r.on("_requestCobrowse",t=>{t==="agent"?this.startCobrowse(t):this.initializeCobrowse(r.lang),this.events.triggerEvent("cobrowse.request",{from:t})}),r.on("disconnected",()=>{Dr.del("chat"),Dr.del("cobrowse")}),this.chat=r,Or.trackerId=`chat_${r.id}`,Dr.set("chat",r.id.toString()),r.cobrowsable&&Dr.get("cobrowse")&&this.initializeCobrowse(r.lang)}};var Ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function w0(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function n(){if(this instanceof n){var i=[null];i.push.apply(i,arguments);var a=Function.bind.apply(r,i);return new a}return r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),t}var S0={},Fu=function(e){return e&&e.Math==Math&&e},Rt=Fu(typeof globalThis=="object"&&globalThis)||Fu(typeof window=="object"&&window)||Fu(typeof self=="object"&&self)||Fu(typeof Ve=="object"&&Ve)||function(){return this}()||Ve||Function("return this")(),ii={},mt=function(e){try{return!!e()}catch{return!0}},xO=mt,Yt=!xO(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),MO=mt,ou=!MO(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),NO=ou,Uu=Function.prototype.call,qt=NO?Uu.bind(Uu):function(){return Uu.apply(Uu,arguments)},uu={},T0={}.propertyIsEnumerable,C0=Object.getOwnPropertyDescriptor,LO=C0&&!T0.call({1:2},1);uu.f=LO?function(r){var t=C0(this,r);return!!t&&t.enumerable}:T0;var rs=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},E0=ou,k0=Function.prototype,$p=k0.call,DO=E0&&k0.bind.bind($p,$p),_t=E0?DO:function(e){return function(){return $p.apply(e,arguments)}},R0=_t,jO=R0({}.toString),FO=R0("".slice),ai=function(e){return FO(jO(e),8,-1)},UO=_t,BO=mt,qO=ai,If=Object,GO=UO("".split),cu=BO(function(){return!If("z").propertyIsEnumerable(0)})?function(e){return qO(e)=="String"?GO(e,""):If(e)}:If,si=function(e){return e==null},VO=si,zO=TypeError,oi=function(e){if(VO(e))throw zO("Can't call method on "+e);return e},WO=cu,HO=oi,ln=function(e){return WO(HO(e))},Op=typeof document=="object"&&document.all,KO=typeof Op>"u"&&Op!==void 0,$0={all:Op,IS_HTMLDDA:KO},O0=$0,JO=O0.all,Bt=O0.IS_HTMLDDA?function(e){return typeof e=="function"||e===JO}:function(e){return typeof e=="function"},Sg=Bt,I0=$0,YO=I0.all,tr=I0.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Sg(e)||e===YO}:function(e){return typeof e=="object"?e!==null:Sg(e)},Pf=Rt,XO=Bt,QO=function(e){return XO(e)?e:void 0},Vn=function(e,r){return arguments.length<2?QO(Pf[e]):Pf[e]&&Pf[e][r]},ZO=_t,Di=ZO({}.isPrototypeOf),ns=typeof navigator<"u"&&String(navigator.userAgent)||"",P0=Rt,Af=ns,Tg=P0.process,Cg=P0.Deno,Eg=Tg&&Tg.versions||Cg&&Cg.version,kg=Eg&&Eg.v8,jn,tl;kg&&(jn=kg.split("."),tl=jn[0]>0&&jn[0]<4?1:+(jn[0]+jn[1]));!tl&&Af&&(jn=Af.match(/Edge\/(\d+)/),(!jn||jn[1]>=74)&&(jn=Af.match(/Chrome\/(\d+)/),jn&&(tl=+jn[1])));var no=tl,Rg=no,eI=mt,tI=Rt,rI=tI.String,io=!!Object.getOwnPropertySymbols&&!eI(function(){var e=Symbol();return!rI(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Rg&&Rg<41}),nI=io,A0=nI&&!Symbol.sham&&typeof Symbol.iterator=="symbol",iI=Vn,aI=Bt,sI=Di,oI=A0,uI=Object,ao=oI?function(e){return typeof e=="symbol"}:function(e){var r=iI("Symbol");return aI(r)&&sI(r.prototype,uI(e))},cI=String,is=function(e){try{return cI(e)}catch{return"Object"}},lI=Bt,fI=is,dI=TypeError,En=function(e){if(lI(e))return e;throw dI(fI(e)+" is not a function")},pI=En,hI=si,as=function(e,r){var t=e[r];return hI(t)?void 0:pI(t)},xf=qt,Mf=Bt,Nf=tr,vI=TypeError,mI=function(e,r){var t,n;if(r==="string"&&Mf(t=e.toString)&&!Nf(n=xf(t,e))||Mf(t=e.valueOf)&&!Nf(n=xf(t,e))||r!=="string"&&Mf(t=e.toString)&&!Nf(n=xf(t,e)))return n;throw vI("Can't convert object to primitive value")},x0={exports:{}},M0=!1,$g=Rt,gI=Object.defineProperty,gv=function(e,r){try{gI($g,e,{value:r,configurable:!0,writable:!0})}catch{$g[e]=r}return r},yI=Rt,bI=gv,Og="__core-js_shared__",_I=yI[Og]||bI(Og,{}),yv=_I,Ig=yv;(x0.exports=function(e,r){return Ig[e]||(Ig[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var so=x0.exports,wI=oi,SI=Object,Mr=function(e){return SI(wI(e))},TI=_t,CI=Mr,EI=TI({}.hasOwnProperty),rr=Object.hasOwn||function(r,t){return EI(CI(r),t)},kI=_t,RI=0,$I=Math.random(),OI=kI(1 .toString),lu=function(e){return"Symbol("+(e===void 0?"":e)+")_"+OI(++RI+$I,36)},II=Rt,PI=so,Pg=rr,AI=lu,xI=io,MI=A0,Ps=II.Symbol,Lf=PI("wks"),NI=MI?Ps.for||Ps:Ps&&Ps.withoutSetter||AI,Gt=function(e){return Pg(Lf,e)||(Lf[e]=xI&&Pg(Ps,e)?Ps[e]:NI("Symbol."+e)),Lf[e]},LI=qt,Ag=tr,xg=ao,DI=as,jI=mI,FI=Gt,UI=TypeError,BI=FI("toPrimitive"),bv=function(e,r){if(!Ag(e)||xg(e))return e;var t=DI(e,BI),n;if(t){if(r===void 0&&(r="default"),n=LI(t,e,r),!Ag(n)||xg(n))return n;throw UI("Can't convert object to primitive value")}return r===void 0&&(r="number"),jI(e,r)},qI=bv,GI=ao,fu=function(e){var r=qI(e,"string");return GI(r)?r:r+""},VI=Rt,Mg=tr,Ip=VI.document,zI=Mg(Ip)&&Mg(Ip.createElement),Cl=function(e){return zI?Ip.createElement(e):{}},WI=Yt,HI=mt,KI=Cl,N0=!WI&&!HI(function(){return Object.defineProperty(KI("div"),"a",{get:function(){return 7}}).a!=7}),JI=Yt,YI=qt,XI=uu,QI=rs,ZI=ln,eP=fu,tP=rr,rP=N0,Ng=Object.getOwnPropertyDescriptor;ii.f=JI?Ng:function(r,t){if(r=ZI(r),t=eP(t),rP)try{return Ng(r,t)}catch{}if(tP(r,t))return QI(!YI(XI.f,r,t),r[t])};var qr={},nP=Yt,iP=mt,L0=nP&&iP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),aP=tr,sP=String,oP=TypeError,sr=function(e){if(aP(e))return e;throw oP(sP(e)+" is not an object")},uP=Yt,cP=N0,lP=L0,Bu=sr,Lg=fu,fP=TypeError,Df=Object.defineProperty,dP=Object.getOwnPropertyDescriptor,jf="enumerable",Ff="configurable",Uf="writable";qr.f=uP?lP?function(r,t,n){if(Bu(r),t=Lg(t),Bu(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Uf in n&&!n[Uf]){var i=dP(r,t);i&&i[Uf]&&(r[t]=n.value,n={configurable:Ff in n?n[Ff]:i[Ff],enumerable:jf in n?n[jf]:i[jf],writable:!1})}return Df(r,t,n)}:Df:function(r,t,n){if(Bu(r),t=Lg(t),Bu(n),cP)try{return Df(r,t,n)}catch{}if("get"in n||"set"in n)throw fP("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var pP=Yt,hP=qr,vP=rs,ji=pP?function(e,r,t){return hP.f(e,r,vP(1,t))}:function(e,r,t){return e[r]=t,e},D0={exports:{}},Pp=Yt,mP=rr,j0=Function.prototype,gP=Pp&&Object.getOwnPropertyDescriptor,_v=mP(j0,"name"),yP=_v&&function(){}.name==="something",bP=_v&&(!Pp||Pp&&gP(j0,"name").configurable),du={EXISTS:_v,PROPER:yP,CONFIGURABLE:bP},_P=_t,wP=Bt,Ap=yv,SP=_P(Function.toString);wP(Ap.inspectSource)||(Ap.inspectSource=function(e){return SP(e)});var wv=Ap.inspectSource,TP=Rt,CP=Bt,Dg=TP.WeakMap,EP=CP(Dg)&&/native code/.test(String(Dg)),kP=so,RP=lu,jg=kP("keys"),El=function(e){return jg[e]||(jg[e]=RP(e))},pu={},$P=EP,F0=Rt,OP=tr,IP=ji,Bf=rr,qf=yv,PP=El,AP=pu,Fg="Object already initialized",xp=F0.TypeError,xP=F0.WeakMap,rl,Qo,nl,MP=function(e){return nl(e)?Qo(e):rl(e,{})},NP=function(e){return function(r){var t;if(!OP(r)||(t=Qo(r)).type!==e)throw xp("Incompatible receiver, "+e+" required");return t}};if($P||qf.state){var Yn=qf.state||(qf.state=new xP);Yn.get=Yn.get,Yn.has=Yn.has,Yn.set=Yn.set,rl=function(e,r){if(Yn.has(e))throw xp(Fg);return r.facade=e,Yn.set(e,r),r},Qo=function(e){return Yn.get(e)||{}},nl=function(e){return Yn.has(e)}}else{var ms=PP("state");AP[ms]=!0,rl=function(e,r){if(Bf(e,ms))throw xp(Fg);return r.facade=e,IP(e,ms,r),r},Qo=function(e){return Bf(e,ms)?e[ms]:{}},nl=function(e){return Bf(e,ms)}}var kn={set:rl,get:Qo,has:nl,enforce:MP,getterFor:NP},Sv=_t,LP=mt,DP=Bt,qu=rr,Mp=Yt,jP=du.CONFIGURABLE,FP=wv,U0=kn,UP=U0.enforce,BP=U0.get,Ug=String,qc=Object.defineProperty,qP=Sv("".slice),GP=Sv("".replace),VP=Sv([].join),zP=Mp&&!LP(function(){return qc(function(){},"length",{value:8}).length!==8}),WP=String(String).split("String"),HP=D0.exports=function(e,r,t){qP(Ug(r),0,7)==="Symbol("&&(r="["+GP(Ug(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!qu(e,"name")||jP&&e.name!==r)&&(Mp?qc(e,"name",{value:r,configurable:!0}):e.name=r),zP&&t&&qu(t,"arity")&&e.length!==t.arity&&qc(e,"length",{value:t.arity});try{t&&qu(t,"constructor")&&t.constructor?Mp&&qc(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=UP(e);return qu(n,"source")||(n.source=VP(WP,typeof r=="string"?r:"")),e};Function.prototype.toString=HP(function(){return DP(this)&&BP(this).source||FP(this)},"toString");var B0=D0.exports,KP=Bt,JP=qr,YP=B0,XP=gv,Gr=function(e,r,t,n){n||(n={});var i=n.enumerable,a=n.name!==void 0?n.name:r;if(KP(t)&&YP(t,a,n),n.global)i?e[r]=t:XP(r,t);else{try{n.unsafe?e[r]&&(i=!0):delete e[r]}catch{}i?e[r]=t:JP.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},ba={},QP=Math.ceil,ZP=Math.floor,eA=Math.trunc||function(r){var t=+r;return(t>0?ZP:QP)(t)},tA=eA,ui=function(e){var r=+e;return r!==r||r===0?0:tA(r)},rA=ui,nA=Math.max,iA=Math.min,ss=function(e,r){var t=rA(e);return t<0?nA(t+r,0):iA(t,r)},aA=ui,sA=Math.min,Fi=function(e){return e>0?sA(aA(e),9007199254740991):0},oA=Fi,Ir=function(e){return oA(e.length)},uA=ln,cA=ss,lA=Ir,Bg=function(e){return function(r,t,n){var i=uA(r),a=lA(i),s=cA(n,a),c;if(e&&t!=t){for(;a>s;)if(c=i[s++],c!=c)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===t)return e||s||0;return!e&&-1}},kl={includes:Bg(!0),indexOf:Bg(!1)},fA=_t,Gf=rr,dA=ln,pA=kl.indexOf,hA=pu,qg=fA([].push),q0=function(e,r){var t=dA(e),n=0,i=[],a;for(a in t)!Gf(hA,a)&&Gf(t,a)&&qg(i,a);for(;r.length>n;)Gf(t,a=r[n++])&&(~pA(i,a)||qg(i,a));return i},Tv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vA=q0,mA=Tv,gA=mA.concat("length","prototype");ba.f=Object.getOwnPropertyNames||function(r){return vA(r,gA)};var hu={};hu.f=Object.getOwnPropertySymbols;var yA=Vn,bA=_t,_A=ba,wA=hu,SA=sr,TA=bA([].concat),G0=yA("Reflect","ownKeys")||function(r){var t=_A.f(SA(r)),n=wA.f;return n?TA(t,n(r)):t},Gg=rr,CA=G0,EA=ii,kA=qr,V0=function(e,r,t){for(var n=CA(r),i=kA.f,a=EA.f,s=0;s<n.length;s++){var c=n[s];!Gg(e,c)&&!(t&&Gg(t,c))&&i(e,c,a(r,c))}},RA=mt,$A=Bt,OA=/#|\.prototype\./,vu=function(e,r){var t=PA[IA(e)];return t==xA?!0:t==AA?!1:$A(r)?RA(r):!!r},IA=vu.normalize=function(e){return String(e).replace(OA,".").toLowerCase()},PA=vu.data={},AA=vu.NATIVE="N",xA=vu.POLYFILL="P",Rl=vu,Vf=Rt,MA=ii.f,NA=ji,LA=Gr,DA=gv,jA=V0,FA=Rl,wt=function(e,r){var t=e.target,n=e.global,i=e.stat,a,s,c,o,u,l;if(n?s=Vf:i?s=Vf[t]||DA(t,{}):s=(Vf[t]||{}).prototype,s)for(c in r){if(u=r[c],e.dontCallGetSet?(l=MA(s,c),o=l&&l.value):o=s[c],a=FA(n?c:t+(i?".":"#")+c,e.forced),!a&&o!==void 0){if(typeof u==typeof o)continue;jA(u,o)}(e.sham||o&&o.sham)&&NA(u,"sham",!0),LA(s,c,u,e)}},UA=qr.f,BA=rr,qA=Gt,Vg=qA("toStringTag"),Ui=function(e,r,t){e&&!t&&(e=e.prototype),e&&!BA(e,Vg)&&UA(e,Vg,{configurable:!0,value:r})},GA=wt,VA=Rt,zA=Ui;GA({global:!0},{Reflect:{}});zA(VA.Reflect,"Reflect",!0);var WA=ou,z0=Function.prototype,zg=z0.apply,Wg=z0.call,_a=typeof Reflect=="object"&&Reflect.apply||(WA?Wg.bind(zg):function(){return Wg.apply(zg,arguments)}),HA=_t,oo=HA([].slice),W0=_t,KA=En,JA=tr,YA=rr,Hg=oo,XA=ou,H0=Function,QA=W0([].concat),ZA=W0([].join),zf={},ex=function(e,r,t){if(!YA(zf,r)){for(var n=[],i=0;i<r;i++)n[i]="a["+i+"]";zf[r]=H0("C,a","return new C("+ZA(n,",")+")")}return zf[r](e,t)},tx=XA?H0.bind:function(r){var t=KA(this),n=t.prototype,i=Hg(arguments,1),a=function(){var c=QA(i,Hg(arguments));return this instanceof a?ex(t,c.length,c):t.apply(r,c)};return JA(n)&&(a.prototype=n),a},rx=Gt,nx=rx("toStringTag"),K0={};K0[nx]="z";var Cv=String(K0)==="[object z]",ix=Cv,ax=Bt,Gc=ai,sx=Gt,ox=sx("toStringTag"),ux=Object,cx=Gc(function(){return arguments}())=="Arguments",lx=function(e,r){try{return e[r]}catch{}},Bi=ix?Gc:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=lx(r=ux(e),ox))=="string"?t:cx?Gc(r):(n=Gc(r))=="Object"&&ax(r.callee)?"Arguments":n},fx=_t,dx=mt,J0=Bt,px=Bi,hx=Vn,vx=wv,Y0=function(){},mx=[],X0=hx("Reflect","construct"),Ev=/^\s*(?:class|function)\b/,gx=fx(Ev.exec),yx=!Ev.exec(Y0),So=function(r){if(!J0(r))return!1;try{return X0(Y0,mx,r),!0}catch{return!1}},Q0=function(r){if(!J0(r))return!1;switch(px(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return yx||!!gx(Ev,vx(r))}catch{return!0}};Q0.sham=!0;var $l=!X0||dx(function(){var e;return So(So.call)||!So(Object)||!So(function(){e=!0})||e})?Q0:So,bx=$l,_x=is,wx=TypeError,kv=function(e){if(bx(e))return e;throw wx(_x(e)+" is not a constructor")},Rv={},Sx=q0,Tx=Tv,mu=Object.keys||function(r){return Sx(r,Tx)},Cx=Yt,Ex=L0,kx=qr,Rx=sr,$x=ln,Ox=mu;Rv.f=Cx&&!Ex?Object.defineProperties:function(r,t){Rx(r);for(var n=$x(t),i=Ox(t),a=i.length,s=0,c;a>s;)kx.f(r,c=i[s++],n[c]);return r};var Ix=Vn,Z0=Ix("document","documentElement"),Px=sr,Ax=Rv,Kg=Tv,xx=pu,Mx=Z0,Nx=Cl,Lx=El,Jg=">",Yg="<",Np="prototype",Lp="script",eT=Lx("IE_PROTO"),Wf=function(){},tT=function(e){return Yg+Lp+Jg+e+Yg+"/"+Lp+Jg},Xg=function(e){e.write(tT("")),e.close();var r=e.parentWindow.Object;return e=null,r},Dx=function(){var e=Nx("iframe"),r="java"+Lp+":",t;return e.style.display="none",Mx.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(tT("document.F=Object")),t.close(),t.F},Gu,Vc=function(){try{Gu=new ActiveXObject("htmlfile")}catch{}Vc=typeof document<"u"?document.domain&&Gu?Xg(Gu):Dx():Xg(Gu);for(var e=Kg.length;e--;)delete Vc[Np][Kg[e]];return Vc()};xx[eT]=!0;var wa=Object.create||function(r,t){var n;return r!==null?(Wf[Np]=Px(r),n=new Wf,Wf[Np]=null,n[eT]=r):n=Vc(),t===void 0?n:Ax.f(n,t)},jx=wt,Fx=Vn,Hf=_a,Ux=tx,Qg=kv,Bx=sr,Zg=tr,qx=wa,rT=mt,$v=Fx("Reflect","construct"),Gx=Object.prototype,Vx=[].push,nT=rT(function(){function e(){}return!($v(function(){},[],e)instanceof e)}),iT=!rT(function(){$v(function(){})}),ey=nT||iT;jx({target:"Reflect",stat:!0,forced:ey,sham:ey},{construct:function(r,t){Qg(r),Bx(t);var n=arguments.length<3?r:Qg(arguments[2]);if(iT&&!nT)return $v(r,t,n);if(r==n){switch(t.length){case 0:return new r;case 1:return new r(t[0]);case 2:return new r(t[0],t[1]);case 3:return new r(t[0],t[1],t[2]);case 4:return new r(t[0],t[1],t[2],t[3])}var i=[null];return Hf(Vx,i,t),new(Hf(Ux,r,i))}var a=n.prototype,s=qx(Zg(a)?a:Gx),c=Hf(r,s,t);return Zg(c)?c:s}});var zx=wt,Wx=Mr,aT=mu,Hx=mt,Kx=Hx(function(){aT(1)});zx({target:"Object",stat:!0,forced:Kx},{keys:function(r){return aT(Wx(r))}});var Jx=Bi,Yx=String,br=function(e){if(Jx(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Yx(e)},Ov={},Xx=fu,Qx=qr,Zx=rs,uo=function(e,r,t){var n=Xx(r);n in e?Qx.f(e,n,Zx(0,t)):e[n]=t},ty=ss,eM=Ir,tM=uo,rM=Array,nM=Math.max,gu=function(e,r,t){for(var n=eM(e),i=ty(r,n),a=ty(t===void 0?n:t,n),s=rM(nM(a-i,0)),c=0;i<a;i++,c++)tM(s,c,e[i]);return s.length=c,s},iM=ai,aM=ln,sT=ba.f,sM=gu,oT=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],oM=function(e){try{return sT(e)}catch{return sM(oT)}};Ov.f=function(r){return oT&&iM(r)=="Window"?oM(r):sT(aM(r))};var ry=B0,uM=qr,ci=function(e,r,t){return t.get&&ry(t.get,r,{getter:!0}),t.set&&ry(t.set,r,{setter:!0}),uM.f(e,r,t)},Iv={},cM=Gt;Iv.f=cM;var lM=Rt,uT=lM,ny=uT,fM=rr,dM=Iv,pM=qr.f,cT=function(e){var r=ny.Symbol||(ny.Symbol={});fM(r,e)||pM(r,e,{value:dM.f(e)})},hM=qt,vM=Vn,mM=Gt,gM=Gr,yM=function(){var e=vM("Symbol"),r=e&&e.prototype,t=r&&r.valueOf,n=mM("toPrimitive");r&&!r[n]&&gM(r,n,function(i){return hM(t,this)},{arity:1})},bM=ai,_M=_t,Ol=function(e){if(bM(e)==="Function")return _M(e)},iy=Ol,wM=En,SM=ou,TM=iy(iy.bind),qi=function(e,r){return wM(e),r===void 0?e:SM?TM(e,r):function(){return e.apply(r,arguments)}},CM=ai,yu=Array.isArray||function(r){return CM(r)=="Array"},ay=yu,EM=$l,kM=tr,RM=Gt,$M=RM("species"),sy=Array,OM=function(e){var r;return ay(e)&&(r=e.constructor,EM(r)&&(r===sy||ay(r.prototype))?r=void 0:kM(r)&&(r=r[$M],r===null&&(r=void 0))),r===void 0?sy:r},IM=OM,Pv=function(e,r){return new(IM(e))(r===0?0:r)},PM=qi,AM=_t,xM=cu,MM=Mr,NM=Ir,LM=Pv,oy=AM([].push),ra=function(e){var r=e==1,t=e==2,n=e==3,i=e==4,a=e==6,s=e==7,c=e==5||a;return function(o,u,l,f){for(var d=MM(o),p=xM(d),h=PM(u,l),E=NM(p),x=0,I=f||LM,M=r?I(o,E):t||s?I(o,0):void 0,j,V;E>x;x++)if((c||x in p)&&(j=p[x],V=h(j,x,d),e))if(r)M[x]=V;else if(V)switch(e){case 3:return!0;case 5:return j;case 6:return x;case 2:oy(M,j)}else switch(e){case 4:return!1;case 7:oy(M,j)}return a?-1:n||i?i:M}},fn={forEach:ra(0),map:ra(1),filter:ra(2),some:ra(3),every:ra(4),find:ra(5),findIndex:ra(6),filterReject:ra(7)},Il=wt,Av=Rt,xv=qt,DM=_t,Hs=Yt,Ks=io,jM=mt,Sr=rr,FM=Di,Dp=sr,Pl=ln,Mv=fu,UM=br,jp=rs,Zo=wa,lT=mu,BM=ba,fT=Ov,qM=hu,dT=ii,pT=qr,GM=Rv,hT=uu,Kf=Gr,VM=ci,Nv=so,zM=El,vT=pu,uy=lu,WM=Gt,HM=Iv,KM=cT,JM=yM,YM=Ui,mT=kn,Al=fn.forEach,Qr=zM("hidden"),xl="Symbol",eu="prototype",XM=mT.set,cy=mT.getterFor(xl),Tn=Object[eu],Ka=Av.Symbol,Do=Ka&&Ka[eu],QM=Av.TypeError,Jf=Av.QObject,gT=dT.f,za=pT.f,yT=fT.f,ZM=hT.f,bT=DM([].push),Ai=Nv("symbols"),bu=Nv("op-symbols"),eN=Nv("wks"),Fp=!Jf||!Jf[eu]||!Jf[eu].findChild,Up=Hs&&jM(function(){return Zo(za({},"a",{get:function(){return za(this,"a",{value:7}).a}})).a!=7})?function(e,r,t){var n=gT(Tn,r);n&&delete Tn[r],za(e,r,t),n&&e!==Tn&&za(Tn,r,n)}:za,Yf=function(e,r){var t=Ai[e]=Zo(Do);return XM(t,{type:xl,tag:e,description:r}),Hs||(t.description=r),t},Ml=function(r,t,n){r===Tn&&Ml(bu,t,n),Dp(r);var i=Mv(t);return Dp(n),Sr(Ai,i)?(n.enumerable?(Sr(r,Qr)&&r[Qr][i]&&(r[Qr][i]=!1),n=Zo(n,{enumerable:jp(0,!1)})):(Sr(r,Qr)||za(r,Qr,jp(1,{})),r[Qr][i]=!0),Up(r,i,n)):za(r,i,n)},Lv=function(r,t){Dp(r);var n=Pl(t),i=lT(n).concat(ST(n));return Al(i,function(a){(!Hs||xv(Bp,n,a))&&Ml(r,a,n[a])}),r},tN=function(r,t){return t===void 0?Zo(r):Lv(Zo(r),t)},Bp=function(r){var t=Mv(r),n=xv(ZM,this,t);return this===Tn&&Sr(Ai,t)&&!Sr(bu,t)?!1:n||!Sr(this,t)||!Sr(Ai,t)||Sr(this,Qr)&&this[Qr][t]?n:!0},_T=function(r,t){var n=Pl(r),i=Mv(t);if(!(n===Tn&&Sr(Ai,i)&&!Sr(bu,i))){var a=gT(n,i);return a&&Sr(Ai,i)&&!(Sr(n,Qr)&&n[Qr][i])&&(a.enumerable=!0),a}},wT=function(r){var t=yT(Pl(r)),n=[];return Al(t,function(i){!Sr(Ai,i)&&!Sr(vT,i)&&bT(n,i)}),n},ST=function(e){var r=e===Tn,t=yT(r?bu:Pl(e)),n=[];return Al(t,function(i){Sr(Ai,i)&&(!r||Sr(Tn,i))&&bT(n,Ai[i])}),n};Ks||(Ka=function(){if(FM(Do,this))throw QM("Symbol is not a constructor");var r=!arguments.length||arguments[0]===void 0?void 0:UM(arguments[0]),t=uy(r),n=function(i){this===Tn&&xv(n,bu,i),Sr(this,Qr)&&Sr(this[Qr],t)&&(this[Qr][t]=!1),Up(this,t,jp(1,i))};return Hs&&Fp&&Up(Tn,t,{configurable:!0,set:n}),Yf(t,r)},Do=Ka[eu],Kf(Do,"toString",function(){return cy(this).tag}),Kf(Ka,"withoutSetter",function(e){return Yf(uy(e),e)}),hT.f=Bp,pT.f=Ml,GM.f=Lv,dT.f=_T,BM.f=fT.f=wT,qM.f=ST,HM.f=function(e){return Yf(WM(e),e)},Hs&&(VM(Do,"description",{configurable:!0,get:function(){return cy(this).description}}),Kf(Tn,"propertyIsEnumerable",Bp,{unsafe:!0})));Il({global:!0,constructor:!0,wrap:!0,forced:!Ks,sham:!Ks},{Symbol:Ka});Al(lT(eN),function(e){KM(e)});Il({target:xl,stat:!0,forced:!Ks},{useSetter:function(){Fp=!0},useSimple:function(){Fp=!1}});Il({target:"Object",stat:!0,forced:!Ks,sham:!Hs},{create:tN,defineProperty:Ml,defineProperties:Lv,getOwnPropertyDescriptor:_T});Il({target:"Object",stat:!0,forced:!Ks},{getOwnPropertyNames:wT});JM();YM(Ka,xl);vT[Qr]=!0;var rN=io,TT=rN&&!!Symbol.for&&!!Symbol.keyFor,nN=wt,iN=Vn,aN=rr,sN=br,CT=so,oN=TT,Xf=CT("string-to-symbol-registry"),uN=CT("symbol-to-string-registry");nN({target:"Symbol",stat:!0,forced:!oN},{for:function(e){var r=sN(e);if(aN(Xf,r))return Xf[r];var t=iN("Symbol")(r);return Xf[r]=t,uN[t]=r,t}});var cN=wt,lN=rr,fN=ao,dN=is,pN=so,hN=TT,ly=pN("symbol-to-string-registry");cN({target:"Symbol",stat:!0,forced:!hN},{keyFor:function(r){if(!fN(r))throw TypeError(dN(r)+" is not a symbol");if(lN(ly,r))return ly[r]}});var vN=_t,fy=yu,mN=Bt,dy=ai,gN=br,py=vN([].push),yN=function(e){if(mN(e))return e;if(fy(e)){for(var r=e.length,t=[],n=0;n<r;n++){var i=e[n];typeof i=="string"?py(t,i):(typeof i=="number"||dy(i)=="Number"||dy(i)=="String")&&py(t,gN(i))}var a=t.length,s=!0;return function(c,o){if(s)return s=!1,o;if(fy(this))return o;for(var u=0;u<a;u++)if(t[u]===c)return o}}},bN=wt,ET=Vn,kT=_a,_N=qt,_u=_t,RT=mt,hy=Bt,vy=ao,$T=oo,wN=yN,SN=io,TN=String,da=ET("JSON","stringify"),Vu=_u(/./.exec),my=_u("".charAt),CN=_u("".charCodeAt),EN=_u("".replace),kN=_u(1 .toString),RN=/[\uD800-\uDFFF]/g,gy=/^[\uD800-\uDBFF]$/,yy=/^[\uDC00-\uDFFF]$/,by=!SN||RT(function(){var e=ET("Symbol")();return da([e])!="[null]"||da({a:e})!="{}"||da(Object(e))!="{}"}),_y=RT(function(){return da("\uDF06\uD834")!=='"\\udf06\\ud834"'||da("\uDEAD")!=='"\\udead"'}),$N=function(e,r){var t=$T(arguments),n=wN(r);if(!(!hy(n)&&(e===void 0||vy(e))))return t[1]=function(i,a){if(hy(n)&&(a=_N(n,this,TN(i),a)),!vy(a))return a},kT(da,null,t)},ON=function(e,r,t){var n=my(t,r-1),i=my(t,r+1);return Vu(gy,e)&&!Vu(yy,i)||Vu(yy,e)&&!Vu(gy,n)?"\\u"+kN(CN(e,0),16):e};da&&bN({target:"JSON",stat:!0,arity:3,forced:by||_y},{stringify:function(r,t,n){var i=$T(arguments),a=kT(by?$N:da,null,i);return _y&&typeof a=="string"?EN(a,RN,ON):a}});var IN=wt,PN=io,AN=mt,OT=hu,xN=Mr,MN=!PN||AN(function(){OT.f(1)});IN({target:"Object",stat:!0,forced:MN},{getOwnPropertySymbols:function(r){var t=OT.f;return t?t(xN(r)):[]}});var NN=mt,LN=Gt,DN=no,jN=LN("species"),wu=function(e){return DN>=51||!NN(function(){var r=[],t=r.constructor={};return t[jN]=function(){return{foo:1}},r[e](Boolean).foo!==1})},FN=wt,UN=fn.filter,BN=wu,qN=BN("filter");FN({target:"Array",proto:!0,forced:!qN},{filter:function(r){return UN(this,r,arguments.length>1?arguments[1]:void 0)}});var GN=wt,VN=mt,zN=ln,IT=ii.f,PT=Yt,WN=!PT||VN(function(){IT(1)});GN({target:"Object",stat:!0,forced:WN,sham:!PT},{getOwnPropertyDescriptor:function(r,t){return IT(zN(r),t)}});var HN=wt,KN=Yt,JN=G0,YN=ln,XN=ii,QN=uo;HN({target:"Object",stat:!0,sham:!KN},{getOwnPropertyDescriptors:function(r){for(var t=YN(r),n=XN.f,i=JN(t),a={},s=0,c,o;i.length>s;)o=n(t,c=i[s++]),o!==void 0&&QN(a,c,o);return a}});var AT={exports:{}};(function(e){function r(n,i,a,s,c,o,u){try{var l=n[o](u),f=l.value}catch(d){a(d);return}l.done?i(f):Promise.resolve(f).then(s,c)}function t(n){return function(){var i=this,a=arguments;return new Promise(function(s,c){var o=n.apply(i,a);function u(f){r(o,s,c,u,l,"next",f)}function l(f){r(o,s,c,u,l,"throw",f)}u(void 0)})}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(AT);var Su=AT.exports,xT={exports:{}};(function(e){function r(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(xT);var os=xT.exports,MT={exports:{}},NT={exports:{}};(function(e){function r(t,n){return e.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(NT);var Dv=NT.exports;(function(e){var r=Dv;function t(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&r(n,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(MT);var li=MT.exports,LT={exports:{}},DT={exports:{}};(function(e){function r(t){"@babel/helpers - typeof";return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(DT);var Rn=DT.exports;(function(e){var r=Rn.default,t=os;function n(i,a){if(a&&(r(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(LT);var fi=LT.exports,jT={exports:{}};(function(e){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(jT);var $n=jT.exports,FT={exports:{}},UT={exports:{}},BT={exports:{}};(function(e){var r=Rn.default;function t(n,i){if(r(n)!=="object"||n===null)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var s=a.call(n,i||"default");if(r(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(BT);var ZN=BT.exports;(function(e){var r=Rn.default,t=ZN;function n(i){var a=t(i,"string");return r(a)==="symbol"?a:String(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(UT);var qT=UT.exports;(function(e){var r=qT;function t(n,i,a){return i=r(i),i in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a,n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(FT);var us=FT.exports,GT={exports:{}};(function(e){var r=qT;function t(i,a){for(var s=0;s<a.length;s++){var c=a[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(i,r(c.key),c)}}function n(i,a,s){return a&&t(i.prototype,a),s&&t(i,s),Object.defineProperty(i,"prototype",{writable:!1}),i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(GT);var Sa=GT.exports,VT={exports:{}};(function(e){function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(VT);var di=VT.exports,eL=Cv,tL=Bi,rL=eL?{}.toString:function(){return"[object "+tL(this)+"]"},nL=Cv,iL=Gr,aL=rL;nL||iL(Object.prototype,"toString",aL,{unsafe:!0});var sL=ai,Nl=typeof process<"u"&&sL(process)=="process",oL=_t,uL=En,cL=function(e,r,t){try{return oL(uL(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}},lL=Bt,fL=String,dL=TypeError,pL=function(e){if(typeof e=="object"||lL(e))return e;throw dL("Can't set "+fL(e)+" as a prototype")},hL=cL,vL=sr,mL=pL,co=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=hL(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(i,a){return vL(i),mL(a),e?t(i,a):i.__proto__=a,i}}():void 0),gL=Vn,yL=ci,bL=Gt,_L=Yt,wy=bL("species"),Ll=function(e){var r=gL(e);_L&&r&&!r[wy]&&yL(r,wy,{configurable:!0,get:function(){return this}})},wL=Di,SL=TypeError,cs=function(e,r){if(wL(r,e))return e;throw SL("Incorrect invocation")},Sy=sr,TL=kv,CL=si,EL=Gt,kL=EL("species"),jv=function(e,r){var t=Sy(e).constructor,n;return t===void 0||CL(n=Sy(t)[kL])?r:TL(n)},RL=TypeError,Fv=function(e,r){if(e<r)throw RL("Not enough arguments");return e},$L=ns,zT=/(?:ipad|iphone|ipod).*applewebkit/i.test($L),cn=Rt,OL=_a,IL=qi,Ty=Bt,PL=rr,WT=mt,Cy=Z0,AL=oo,Ey=Cl,xL=Fv,ML=zT,NL=Nl,qp=cn.setImmediate,Gp=cn.clearImmediate,LL=cn.process,Qf=cn.Dispatch,DL=cn.Function,ky=cn.MessageChannel,jL=cn.String,Zf=0,Wo={},Ry="onreadystatechange",tu,Da,ed,td;WT(function(){tu=cn.location});var Uv=function(e){if(PL(Wo,e)){var r=Wo[e];delete Wo[e],r()}},rd=function(e){return function(){Uv(e)}},$y=function(e){Uv(e.data)},Oy=function(e){cn.postMessage(jL(e),tu.protocol+"//"+tu.host)};(!qp||!Gp)&&(qp=function(r){xL(arguments.length,1);var t=Ty(r)?r:DL(r),n=AL(arguments,1);return Wo[++Zf]=function(){OL(t,void 0,n)},Da(Zf),Zf},Gp=function(r){delete Wo[r]},NL?Da=function(e){LL.nextTick(rd(e))}:Qf&&Qf.now?Da=function(e){Qf.now(rd(e))}:ky&&!ML?(ed=new ky,td=ed.port2,ed.port1.onmessage=$y,Da=IL(td.postMessage,td)):cn.addEventListener&&Ty(cn.postMessage)&&!cn.importScripts&&tu&&tu.protocol!=="file:"&&!WT(Oy)?(Da=Oy,cn.addEventListener("message",$y,!1)):Ry in Ey("script")?Da=function(e){Cy.appendChild(Ey("script"))[Ry]=function(){Cy.removeChild(this),Uv(e)}}:Da=function(e){setTimeout(rd(e),0)});var HT={set:qp,clear:Gp},KT=function(){this.head=null,this.tail=null};KT.prototype={add:function(e){var r={item:e,next:null},t=this.tail;t?t.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}};var JT=KT,FL=ns,UL=/ipad|iphone|ipod/i.test(FL)&&typeof Pebble<"u",BL=ns,qL=/web0s(?!.*chrome)/i.test(BL),Ya=Rt,Iy=qi,GL=ii.f,nd=HT.set,VL=JT,zL=zT,WL=UL,HL=qL,id=Nl,Py=Ya.MutationObserver||Ya.WebKitMutationObserver,Ay=Ya.document,xy=Ya.process,zu=Ya.Promise,My=GL(Ya,"queueMicrotask"),Vp=My&&My.value,gs,ad,sd,Wu,Ny;if(!Vp){var Hu=new VL,Ku=function(){var e,r;for(id&&(e=xy.domain)&&e.exit();r=Hu.get();)try{r()}catch(t){throw Hu.head&&gs(),t}e&&e.enter()};!zL&&!id&&!HL&&Py&&Ay?(ad=!0,sd=Ay.createTextNode(""),new Py(Ku).observe(sd,{characterData:!0}),gs=function(){sd.data=ad=!ad}):!WL&&zu&&zu.resolve?(Wu=zu.resolve(void 0),Wu.constructor=zu,Ny=Iy(Wu.then,Wu),gs=function(){Ny(Ku)}):id?gs=function(){xy.nextTick(Ku)}:(nd=Iy(nd,Ya),gs=function(){nd(Ku)}),Vp=function(e){Hu.head||gs(),Hu.add(e)}}var KL=Vp,JL=function(e,r){try{arguments.length==1?console.error(e):console.error(e,r)}catch{}},Bv=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}},YL=Rt,Dl=YL.Promise,YT=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",XL=YT,QL=Nl,ZL=!XL&&!QL&&typeof window=="object"&&typeof document=="object",eD=Rt,Ho=Dl,tD=Bt,rD=Rl,nD=wv,iD=Gt,aD=ZL,sD=YT,od=no;Ho&&Ho.prototype;var oD=iD("species"),zp=!1,XT=tD(eD.PromiseRejectionEvent),uD=rD("Promise",function(){var e=nD(Ho),r=e!==String(Ho);if(!r&&od===66)return!0;if(!od||od<51||!/native code/.test(e)){var t=new Ho(function(a){a(1)}),n=function(a){a(function(){},function(){})},i=t.constructor={};if(i[oD]=n,zp=t.then(function(){})instanceof n,!zp)return!0}return!r&&(aD||sD)&&!XT}),Tu={CONSTRUCTOR:uD,REJECTION_EVENT:XT,SUBCLASSING:zp},lo={},Ly=En,cD=TypeError,lD=function(e){var r,t;this.promise=new e(function(n,i){if(r!==void 0||t!==void 0)throw cD("Bad Promise constructor");r=n,t=i}),this.resolve=Ly(r),this.reject=Ly(t)};lo.f=function(e){return new lD(e)};var fD=wt,il=Nl,ma=Rt,Js=qt,Dy=Gr,jy=co,dD=Ui,pD=Ll,hD=En,zc=Bt,vD=tr,mD=cs,gD=jv,QT=HT.set,qv=KL,yD=JL,bD=Bv,_D=JT,ZT=kn,al=Dl,Gv=Tu,eC=lo,jl="Promise",tC=Gv.CONSTRUCTOR,wD=Gv.REJECTION_EVENT,SD=Gv.SUBCLASSING,ud=ZT.getterFor(jl),TD=ZT.set,Rs=al&&al.prototype,Wa=al,Ju=Rs,rC=ma.TypeError,Wp=ma.document,Vv=ma.process,Hp=eC.f,CD=Hp,ED=!!(Wp&&Wp.createEvent&&ma.dispatchEvent),nC="unhandledrejection",kD="rejectionhandled",Fy=0,iC=1,RD=2,zv=1,aC=2,Yu,Uy,$D,By,sC=function(e){var r;return vD(e)&&zc(r=e.then)?r:!1},oC=function(e,r){var t=r.value,n=r.state==iC,i=n?e.ok:e.fail,a=e.resolve,s=e.reject,c=e.domain,o,u,l;try{i?(n||(r.rejection===aC&&ID(r),r.rejection=zv),i===!0?o=t:(c&&c.enter(),o=i(t),c&&(c.exit(),l=!0)),o===e.promise?s(rC("Promise-chain cycle")):(u=sC(o))?Js(u,o,a,s):a(o)):s(t)}catch(f){c&&!l&&c.exit(),s(f)}},uC=function(e,r){e.notified||(e.notified=!0,qv(function(){for(var t=e.reactions,n;n=t.get();)oC(n,e);e.notified=!1,r&&!e.rejection&&OD(e)}))},cC=function(e,r,t){var n,i;ED?(n=Wp.createEvent("Event"),n.promise=r,n.reason=t,n.initEvent(e,!1,!0),ma.dispatchEvent(n)):n={promise:r,reason:t},!wD&&(i=ma["on"+e])?i(n):e===nC&&yD("Unhandled promise rejection",t)},OD=function(e){Js(QT,ma,function(){var r=e.facade,t=e.value,n=qy(e),i;if(n&&(i=bD(function(){il?Vv.emit("unhandledRejection",t,r):cC(nC,r,t)}),e.rejection=il||qy(e)?aC:zv,i.error))throw i.value})},qy=function(e){return e.rejection!==zv&&!e.parent},ID=function(e){Js(QT,ma,function(){var r=e.facade;il?Vv.emit("rejectionHandled",r):cC(kD,r,e.value)})},As=function(e,r,t){return function(n){e(r,n,t)}},Ls=function(e,r,t){e.done||(e.done=!0,t&&(e=t),e.value=r,e.state=RD,uC(e,!0))},Kp=function(e,r,t){if(!e.done){e.done=!0,t&&(e=t);try{if(e.facade===r)throw rC("Promise can't be resolved itself");var n=sC(r);n?qv(function(){var i={done:!1};try{Js(n,r,As(Kp,i,e),As(Ls,i,e))}catch(a){Ls(i,a,e)}}):(e.value=r,e.state=iC,uC(e,!1))}catch(i){Ls({done:!1},i,e)}}};if(tC&&(Wa=function(r){mD(this,Ju),hD(r),Js(Yu,this);var t=ud(this);try{r(As(Kp,t),As(Ls,t))}catch(n){Ls(t,n)}},Ju=Wa.prototype,Yu=function(r){TD(this,{type:jl,done:!1,notified:!1,parent:!1,reactions:new _D,rejection:!1,state:Fy,value:void 0})},Yu.prototype=Dy(Ju,"then",function(r,t){var n=ud(this),i=Hp(gD(this,Wa));return n.parent=!0,i.ok=zc(r)?r:!0,i.fail=zc(t)&&t,i.domain=il?Vv.domain:void 0,n.state==Fy?n.reactions.add(i):qv(function(){oC(i,n)}),i.promise}),Uy=function(){var e=new Yu,r=ud(e);this.promise=e,this.resolve=As(Kp,r),this.reject=As(Ls,r)},eC.f=Hp=function(e){return e===Wa||e===$D?new Uy(e):CD(e)},zc(al)&&Rs!==Object.prototype)){By=Rs.then,SD||Dy(Rs,"then",function(r,t){var n=this;return new Wa(function(i,a){Js(By,n,i,a)}).then(r,t)},{unsafe:!0});try{delete Rs.constructor}catch{}jy&&jy(Rs,Ju)}fD({global:!0,constructor:!0,wrap:!0,forced:tC},{Promise:Wa});dD(Wa,jl,!1);pD(jl);var Cu={},PD=Gt,AD=Cu,xD=PD("iterator"),MD=Array.prototype,Wv=function(e){return e!==void 0&&(AD.Array===e||MD[xD]===e)},ND=Bi,Gy=as,LD=si,DD=Cu,jD=Gt,FD=jD("iterator"),Eu=function(e){if(!LD(e))return Gy(e,FD)||Gy(e,"@@iterator")||DD[ND(e)]},UD=qt,BD=En,qD=sr,GD=is,VD=Eu,zD=TypeError,Fl=function(e,r){var t=arguments.length<2?VD(e):r;if(BD(t))return qD(UD(t,e));throw zD(GD(e)+" is not iterable")},WD=qt,Vy=sr,HD=as,lC=function(e,r,t){var n,i;Vy(e);try{if(n=HD(e,"return"),!n){if(r==="throw")throw t;return t}n=WD(n,e)}catch(a){i=!0,n=a}if(r==="throw")throw t;if(i)throw n;return Vy(n),t},KD=qi,JD=qt,YD=sr,XD=is,QD=Wv,ZD=Ir,zy=Di,e2=Fl,t2=Eu,Wy=lC,r2=TypeError,Wc=function(e,r){this.stopped=e,this.result=r},Hy=Wc.prototype,Ul=function(e,r,t){var n=t&&t.that,i=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),c=!!(t&&t.INTERRUPTED),o=KD(r,n),u,l,f,d,p,h,E,x=function(M){return u&&Wy(u,"normal",M),new Wc(!0,M)},I=function(M){return i?(YD(M),c?o(M[0],M[1],x):o(M[0],M[1])):c?o(M,x):o(M)};if(a)u=e.iterator;else if(s)u=e;else{if(l=t2(e),!l)throw r2(XD(e)+" is not iterable");if(QD(l)){for(f=0,d=ZD(e);d>f;f++)if(p=I(e[f]),p&&zy(Hy,p))return p;return new Wc(!1)}u=e2(e,l)}for(h=a?e.next:u.next;!(E=JD(h,u)).done;){try{p=I(E.value)}catch(M){Wy(u,"throw",M)}if(typeof p=="object"&&p&&zy(Hy,p))return p}return new Wc(!1)},n2=Gt,fC=n2("iterator"),dC=!1;try{var i2=0,Ky={next:function(){return{done:!!i2++}},return:function(){dC=!0}};Ky[fC]=function(){return this},Array.from(Ky,function(){throw 2})}catch{}var Bl=function(e,r){if(!r&&!dC)return!1;var t=!1;try{var n={};n[fC]=function(){return{next:function(){return{done:t=!0}}}},e(n)}catch{}return t},a2=Dl,s2=Bl,o2=Tu.CONSTRUCTOR,pC=o2||!s2(function(e){a2.all(e).then(void 0,function(){})}),u2=wt,c2=qt,l2=En,f2=lo,d2=Bv,p2=Ul,h2=pC;u2({target:"Promise",stat:!0,forced:h2},{all:function(r){var t=this,n=f2.f(t),i=n.resolve,a=n.reject,s=d2(function(){var c=l2(t.resolve),o=[],u=0,l=1;p2(r,function(f){var d=u++,p=!1;l++,c2(c,t,f).then(function(h){p||(p=!0,o[d]=h,--l||i(o))},a)}),--l||i(o)});return s.error&&a(s.value),n.promise}});var v2=wt,m2=Tu.CONSTRUCTOR,Jp=Dl,g2=Vn,y2=Bt,b2=Gr,Jy=Jp&&Jp.prototype;v2({target:"Promise",proto:!0,forced:m2,real:!0},{catch:function(e){return this.then(void 0,e)}});if(y2(Jp)){var Yy=g2("Promise").prototype.catch;Jy.catch!==Yy&&b2(Jy,"catch",Yy,{unsafe:!0})}var _2=wt,w2=qt,S2=En,T2=lo,C2=Bv,E2=Ul,k2=pC;_2({target:"Promise",stat:!0,forced:k2},{race:function(r){var t=this,n=T2.f(t),i=n.reject,a=C2(function(){var s=S2(t.resolve);E2(r,function(c){w2(s,t,c).then(n.resolve,i)})});return a.error&&i(a.value),n.promise}});var R2=wt,$2=qt,O2=lo,I2=Tu.CONSTRUCTOR;R2({target:"Promise",stat:!0,forced:I2},{reject:function(r){var t=O2.f(this);return $2(t.reject,void 0,r),t.promise}});var P2=sr,A2=tr,x2=lo,M2=function(e,r){if(P2(e),A2(r)&&r.constructor===e)return r;var t=x2.f(e),n=t.resolve;return n(r),t.promise},N2=wt,L2=Vn,D2=Tu.CONSTRUCTOR,j2=M2;L2("Promise");N2({target:"Promise",stat:!0,forced:D2},{resolve:function(r){return j2(this,r)}});var F2=wt,U2=fn.map,B2=wu,q2=B2("map");F2({target:"Array",proto:!0,forced:!q2},{map:function(r){return U2(this,r,arguments.length>1?arguments[1]:void 0)}});var hC={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},G2=Cl,cd=G2("span").classList,Xy=cd&&cd.constructor&&cd.constructor.prototype,vC=Xy===Object.prototype?void 0:Xy,V2=mt,ql=function(e,r){var t=[][e];return!!t&&V2(function(){t.call(null,r||function(){return 1},1)})},z2=fn.forEach,W2=ql,H2=W2("forEach"),K2=H2?[].forEach:function(r){return z2(this,r,arguments.length>1?arguments[1]:void 0)},Qy=Rt,Zy=hC,J2=vC,ld=K2,Y2=ji,mC=function(e){if(e&&e.forEach!==ld)try{Y2(e,"forEach",ld)}catch{e.forEach=ld}};for(var fd in Zy)Zy[fd]&&mC(Qy[fd]&&Qy[fd].prototype);mC(J2);var gC={exports:{}};(function(e){var r=Rn.default;function t(){e.exports=t=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(be,Te,Se){be[Te]=Se.value},c=typeof Symbol=="function"?Symbol:{},o=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(be,Te,Se){return Object.defineProperty(be,Te,{value:Se,enumerable:!0,configurable:!0,writable:!0}),be[Te]}try{f({},"")}catch{f=function(Se,ge,$e){return Se[ge]=$e}}function d(be,Te,Se,ge){var $e=Te&&Te.prototype instanceof E?Te:E,De=Object.create($e.prototype),G=new Re(ge||[]);return s(De,"_invoke",{value:L(be,Se,G)}),De}function p(be,Te,Se){try{return{type:"normal",arg:be.call(Te,Se)}}catch(ge){return{type:"throw",arg:ge}}}n.wrap=d;var h={};function E(){}function x(){}function I(){}var M={};f(M,o,function(){return this});var j=Object.getPrototypeOf,V=j&&j(j(ae([])));V&&V!==i&&a.call(V,o)&&(M=V);var ie=I.prototype=E.prototype=Object.create(M);function oe(be){["next","throw","return"].forEach(function(Te){f(be,Te,function(Se){return this._invoke(Te,Se)})})}function J(be,Te){function Se($e,De,G,Qe){var Et=p(be[$e],be,De);if(Et.type!=="throw"){var ut=Et.arg,je=ut.value;return je&&r(je)=="object"&&a.call(je,"__await")?Te.resolve(je.__await).then(function(te){Se("next",te,G,Qe)},function(te){Se("throw",te,G,Qe)}):Te.resolve(je).then(function(te){ut.value=te,G(ut)},function(te){return Se("throw",te,G,Qe)})}Qe(Et.arg)}var ge;s(this,"_invoke",{value:function(De,G){function Qe(){return new Te(function(Et,ut){Se(De,G,Et,ut)})}return ge=ge?ge.then(Qe,Qe):Qe()}})}function L(be,Te,Se){var ge="suspendedStart";return function($e,De){if(ge==="executing")throw new Error("Generator is already running");if(ge==="completed"){if($e==="throw")throw De;return We()}for(Se.method=$e,Se.arg=De;;){var G=Se.delegate;if(G){var Qe=Y(G,Se);if(Qe){if(Qe===h)continue;return Qe}}if(Se.method==="next")Se.sent=Se._sent=Se.arg;else if(Se.method==="throw"){if(ge==="suspendedStart")throw ge="completed",Se.arg;Se.dispatchException(Se.arg)}else Se.method==="return"&&Se.abrupt("return",Se.arg);ge="executing";var Et=p(be,Te,Se);if(Et.type==="normal"){if(ge=Se.done?"completed":"suspendedYield",Et.arg===h)continue;return{value:Et.arg,done:Se.done}}Et.type==="throw"&&(ge="completed",Se.method="throw",Se.arg=Et.arg)}}}function Y(be,Te){var Se=Te.method,ge=be.iterator[Se];if(ge===void 0)return Te.delegate=null,Se==="throw"&&be.iterator.return&&(Te.method="return",Te.arg=void 0,Y(be,Te),Te.method==="throw")||Se!=="return"&&(Te.method="throw",Te.arg=new TypeError("The iterator does not provide a '"+Se+"' method")),h;var $e=p(ge,be.iterator,Te.arg);if($e.type==="throw")return Te.method="throw",Te.arg=$e.arg,Te.delegate=null,h;var De=$e.arg;return De?De.done?(Te[be.resultName]=De.value,Te.next=be.nextLoc,Te.method!=="return"&&(Te.method="next",Te.arg=void 0),Te.delegate=null,h):De:(Te.method="throw",Te.arg=new TypeError("iterator result is not an object"),Te.delegate=null,h)}function Z(be){var Te={tryLoc:be[0]};1 in be&&(Te.catchLoc=be[1]),2 in be&&(Te.finallyLoc=be[2],Te.afterLoc=be[3]),this.tryEntries.push(Te)}function ye(be){var Te=be.completion||{};Te.type="normal",delete Te.arg,be.completion=Te}function Re(be){this.tryEntries=[{tryLoc:"root"}],be.forEach(Z,this),this.reset(!0)}function ae(be){if(be){var Te=be[o];if(Te)return Te.call(be);if(typeof be.next=="function")return be;if(!isNaN(be.length)){var Se=-1,ge=function $e(){for(;++Se<be.length;)if(a.call(be,Se))return $e.value=be[Se],$e.done=!1,$e;return $e.value=void 0,$e.done=!0,$e};return ge.next=ge}}return{next:We}}function We(){return{value:void 0,done:!0}}return x.prototype=I,s(ie,"constructor",{value:I,configurable:!0}),s(I,"constructor",{value:x,configurable:!0}),x.displayName=f(I,l,"GeneratorFunction"),n.isGeneratorFunction=function(be){var Te=typeof be=="function"&&be.constructor;return!!Te&&(Te===x||(Te.displayName||Te.name)==="GeneratorFunction")},n.mark=function(be){return Object.setPrototypeOf?Object.setPrototypeOf(be,I):(be.__proto__=I,f(be,l,"GeneratorFunction")),be.prototype=Object.create(ie),be},n.awrap=function(be){return{__await:be}},oe(J.prototype),f(J.prototype,u,function(){return this}),n.AsyncIterator=J,n.async=function(be,Te,Se,ge,$e){$e===void 0&&($e=Promise);var De=new J(d(be,Te,Se,ge),$e);return n.isGeneratorFunction(Te)?De:De.next().then(function(G){return G.done?G.value:De.next()})},oe(ie),f(ie,l,"Generator"),f(ie,o,function(){return this}),f(ie,"toString",function(){return"[object Generator]"}),n.keys=function(be){var Te=Object(be),Se=[];for(var ge in Te)Se.push(ge);return Se.reverse(),function $e(){for(;Se.length;){var De=Se.pop();if(De in Te)return $e.value=De,$e.done=!1,$e}return $e.done=!0,$e}},n.values=ae,Re.prototype={constructor:Re,reset:function(Te){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(ye),!Te)for(var Se in this)Se.charAt(0)==="t"&&a.call(this,Se)&&!isNaN(+Se.slice(1))&&(this[Se]=void 0)},stop:function(){this.done=!0;var Te=this.tryEntries[0].completion;if(Te.type==="throw")throw Te.arg;return this.rval},dispatchException:function(Te){if(this.done)throw Te;var Se=this;function ge(ut,je){return G.type="throw",G.arg=Te,Se.next=ut,je&&(Se.method="next",Se.arg=void 0),!!je}for(var $e=this.tryEntries.length-1;$e>=0;--$e){var De=this.tryEntries[$e],G=De.completion;if(De.tryLoc==="root")return ge("end");if(De.tryLoc<=this.prev){var Qe=a.call(De,"catchLoc"),Et=a.call(De,"finallyLoc");if(Qe&&Et){if(this.prev<De.catchLoc)return ge(De.catchLoc,!0);if(this.prev<De.finallyLoc)return ge(De.finallyLoc)}else if(Qe){if(this.prev<De.catchLoc)return ge(De.catchLoc,!0)}else{if(!Et)throw new Error("try statement without catch or finally");if(this.prev<De.finallyLoc)return ge(De.finallyLoc)}}}},abrupt:function(Te,Se){for(var ge=this.tryEntries.length-1;ge>=0;--ge){var $e=this.tryEntries[ge];if($e.tryLoc<=this.prev&&a.call($e,"finallyLoc")&&this.prev<$e.finallyLoc){var De=$e;break}}De&&(Te==="break"||Te==="continue")&&De.tryLoc<=Se&&Se<=De.finallyLoc&&(De=null);var G=De?De.completion:{};return G.type=Te,G.arg=Se,De?(this.method="next",this.next=De.finallyLoc,h):this.complete(G)},complete:function(Te,Se){if(Te.type==="throw")throw Te.arg;return Te.type==="break"||Te.type==="continue"?this.next=Te.arg:Te.type==="return"?(this.rval=this.arg=Te.arg,this.method="return",this.next="end"):Te.type==="normal"&&Se&&(this.next=Se),h},finish:function(Te){for(var Se=this.tryEntries.length-1;Se>=0;--Se){var ge=this.tryEntries[Se];if(ge.finallyLoc===Te)return this.complete(ge.completion,ge.afterLoc),ye(ge),h}},catch:function(Te){for(var Se=this.tryEntries.length-1;Se>=0;--Se){var ge=this.tryEntries[Se];if(ge.tryLoc===Te){var $e=ge.completion;if($e.type==="throw"){var De=$e.arg;ye(ge)}return De}}throw new Error("illegal catch attempt")},delegateYield:function(Te,Se,ge){return this.delegate={iterator:ae(Te),resultName:Se,nextLoc:ge},this.method==="next"&&(this.arg=void 0),h}},n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(gC);var X2=gC.exports,Hc=X2(),ku=Hc;try{regeneratorRuntime=Hc}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Hc:Function("r","regeneratorRuntime = r")(Hc)}var Q2=TypeError,Z2=9007199254740991,yC=function(e){if(e>Z2)throw Q2("Maximum allowed index exceeded");return e},ej=wt,tj=mt,rj=yu,nj=tr,ij=Mr,aj=Ir,eb=yC,tb=uo,sj=Pv,oj=wu,uj=Gt,cj=no,bC=uj("isConcatSpreadable"),lj=cj>=51||!tj(function(){var e=[];return e[bC]=!1,e.concat()[0]!==e}),fj=function(e){if(!nj(e))return!1;var r=e[bC];return r!==void 0?!!r:rj(e)},dj=!lj||!oj("concat");ej({target:"Array",proto:!0,arity:1,forced:dj},{concat:function(r){var t=ij(this),n=sj(t,0),i=0,a,s,c,o,u;for(a=-1,c=arguments.length;a<c;a++)if(u=a===-1?t:arguments[a],fj(u))for(o=aj(u),eb(i+o),s=0;s<o;s++,i++)s in u&&tb(n,i,u[s]);else eb(i+1),tb(n,i++,u);return n.length=i,n}});var pj=sr,hj=lC,vj=function(e,r,t,n){try{return n?r(pj(t)[0],t[1]):r(t)}catch(i){hj(e,"throw",i)}},mj=qi,gj=qt,yj=Mr,bj=vj,_j=Wv,wj=$l,Sj=Ir,rb=uo,Tj=Fl,Cj=Eu,nb=Array,_C=function(r){var t=yj(r),n=wj(this),i=arguments.length,a=i>1?arguments[1]:void 0,s=a!==void 0;s&&(a=mj(a,i>2?arguments[2]:void 0));var c=Cj(t),o=0,u,l,f,d,p,h;if(c&&!(this===nb&&_j(c)))for(d=Tj(t,c),p=d.next,l=n?new this:[];!(f=gj(p,d)).done;o++)h=s?bj(d,a,[f.value,o],!0):f.value,rb(l,o,h);else for(u=Sj(t),l=n?new this(u):nb(u);u>o;o++)h=s?a(t[o],o):t[o],rb(l,o,h);return l.length=o,l},Ej=wt,kj=_C,Rj=Bl,$j=!Rj(function(e){Array.from(e)});Ej({target:"Array",stat:!0,forced:$j},{from:kj});var Hv=_t,Oj=ui,Ij=br,Pj=oi,Aj=Hv("".charAt),ib=Hv("".charCodeAt),xj=Hv("".slice),ab=function(e){return function(r,t){var n=Ij(Pj(r)),i=Oj(t),a=n.length,s,c;return i<0||i>=a?e?"":void 0:(s=ib(n,i),s<55296||s>56319||i+1===a||(c=ib(n,i+1))<56320||c>57343?e?Aj(n,i):s:e?xj(n,i,i+2):(s-55296<<10)+(c-56320)+65536)}},Kv={codeAt:ab(!1),charAt:ab(!0)},Mj=mt,Nj=!Mj(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Lj=rr,Dj=Bt,jj=Mr,Fj=El,Uj=Nj,sb=Fj("IE_PROTO"),Yp=Object,Bj=Yp.prototype,Gl=Uj?Yp.getPrototypeOf:function(e){var r=jj(e);if(Lj(r,sb))return r[sb];var t=r.constructor;return Dj(t)&&r instanceof t?t.prototype:r instanceof Yp?Bj:null},qj=mt,Gj=Bt,Vj=tr,ob=Gl,zj=Gr,Wj=Gt,Xp=Wj("iterator"),wC=!1,Xa,dd,pd;[].keys&&(pd=[].keys(),"next"in pd?(dd=ob(ob(pd)),dd!==Object.prototype&&(Xa=dd)):wC=!0);var Hj=!Vj(Xa)||qj(function(){var e={};return Xa[Xp].call(e)!==e});Hj&&(Xa={});Gj(Xa[Xp])||zj(Xa,Xp,function(){return this});var SC={IteratorPrototype:Xa,BUGGY_SAFARI_ITERATORS:wC},Kj=SC.IteratorPrototype,Jj=wa,Yj=rs,Xj=Ui,Qj=Cu,Zj=function(){return this},TC=function(e,r,t,n){var i=r+" Iterator";return e.prototype=Jj(Kj,{next:Yj(+!n,t)}),Xj(e,i,!1),Qj[i]=Zj,e},eF=wt,tF=qt,CC=du,rF=Bt,nF=TC,ub=Gl,cb=co,iF=Ui,aF=ji,hd=Gr,sF=Gt,oF=Cu,EC=SC,uF=CC.PROPER,cF=CC.CONFIGURABLE,lb=EC.IteratorPrototype,Xu=EC.BUGGY_SAFARI_ITERATORS,To=sF("iterator"),fb="keys",Co="values",db="entries",lF=function(){return this},Jv=function(e,r,t,n,i,a,s){nF(t,r,n);var c=function(I){if(I===i&&d)return d;if(!Xu&&I in l)return l[I];switch(I){case fb:return function(){return new t(this,I)};case Co:return function(){return new t(this,I)};case db:return function(){return new t(this,I)}}return function(){return new t(this)}},o=r+" Iterator",u=!1,l=e.prototype,f=l[To]||l["@@iterator"]||i&&l[i],d=!Xu&&f||c(i),p=r=="Array"&&l.entries||f,h,E,x;if(p&&(h=ub(p.call(new e)),h!==Object.prototype&&h.next&&(ub(h)!==lb&&(cb?cb(h,lb):rF(h[To])||hd(h,To,lF)),iF(h,o,!0))),uF&&i==Co&&f&&f.name!==Co&&(cF?aF(l,"name",Co):(u=!0,d=function(){return tF(f,this)})),i)if(E={values:c(Co),keys:a?d:c(fb),entries:c(db)},s)for(x in E)(Xu||u||!(x in l))&&hd(l,x,E[x]);else eF({target:r,proto:!0,forced:Xu||u},E);return l[To]!==d&&hd(l,To,d,{name:i}),oF[r]=d,E},Yv=function(e,r){return{value:e,done:r}},fF=Kv.charAt,dF=br,kC=kn,pF=Jv,pb=Yv,RC="String Iterator",hF=kC.set,vF=kC.getterFor(RC);pF(String,"String",function(e){hF(this,{type:RC,string:dF(e),index:0})},function(){var r=vF(this),t=r.string,n=r.index,i;return n>=t.length?pb(void 0,!0):(i=fF(t,n),r.index+=i.length,pb(i,!1))});var $C={exports:{}};(function(e){(function(r,t){e.exports?e.exports=t():r.log=t()})(Ve,function(){var r=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function a(E,x){var I=E[x];if(typeof I.bind=="function")return I.bind(E);try{return Function.prototype.bind.call(I,E)}catch{return function(){return Function.prototype.apply.apply(I,[E,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(E){return E==="debug"&&(E="log"),typeof console===t?!1:E==="trace"&&n?s:console[E]!==void 0?a(console,E):console.log!==void 0?a(console,"log"):r}function o(E,x){for(var I=0;I<i.length;I++){var M=i[I];this[M]=I<E?r:this.methodFactory(M,E,x)}this.log=this.debug}function u(E,x,I){return function(){typeof console!==t&&(o.call(this,x,I),this[E].apply(this,arguments))}}function l(E,x,I){return c(E)||u.apply(this,arguments)}function f(E,x,I){var M=this,j;x=x??"WARN";var V="loglevel";typeof E=="string"?V+=":"+E:typeof E=="symbol"&&(V=void 0);function ie(Y){var Z=(i[Y]||"silent").toUpperCase();if(!(typeof window===t||!V)){try{window.localStorage[V]=Z;return}catch{}try{window.document.cookie=encodeURIComponent(V)+"="+Z+";"}catch{}}}function oe(){var Y;if(!(typeof window===t||!V)){try{Y=window.localStorage[V]}catch{}if(typeof Y===t)try{var Z=window.document.cookie,ye=Z.indexOf(encodeURIComponent(V)+"=");ye!==-1&&(Y=/^([^;]+)/.exec(Z.slice(ye))[1])}catch{}return M.levels[Y]===void 0&&(Y=void 0),Y}}function J(){if(!(typeof window===t||!V)){try{window.localStorage.removeItem(V);return}catch{}try{window.document.cookie=encodeURIComponent(V)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}M.name=E,M.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},M.methodFactory=I||l,M.getLevel=function(){return j},M.setLevel=function(Y,Z){if(typeof Y=="string"&&M.levels[Y.toUpperCase()]!==void 0&&(Y=M.levels[Y.toUpperCase()]),typeof Y=="number"&&Y>=0&&Y<=M.levels.SILENT){if(j=Y,Z!==!1&&ie(Y),o.call(M,Y,E),typeof console===t&&Y<M.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+Y},M.setDefaultLevel=function(Y){x=Y,oe()||M.setLevel(Y,!1)},M.resetLevel=function(){M.setLevel(x,!1),J()},M.enableAll=function(Y){M.setLevel(M.levels.TRACE,Y)},M.disableAll=function(Y){M.setLevel(M.levels.SILENT,Y)};var L=oe();L==null&&(L=x),M.setLevel(L,!1)}var d=new f,p={};d.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var I=p[x];return I||(I=p[x]=new f(x,d.getLevel(),d.methodFactory)),I};var h=typeof window!==t?window.log:void 0;return d.noConflict=function(){return typeof window!==t&&window.log===d&&(window.log=h),d},d.getLoggers=function(){return p},d.default=d,d})})($C);var pr=$C.exports;const Ja="\\d+(?:[\\.,]\\d+)?",mF=`(${Ja}W)`,gF=`(${Ja}Y)?(${Ja}M)?(${Ja}D)?`,yF=`T(${Ja}H)?(${Ja}M)?(${Ja}S)?`,bF=`P(?:${mF}|${gF}(?:${yF})?)`,_F=["weeks","years","months","days","hours","minutes","seconds"],Xv=new RegExp(bF),OC=e=>e.match(Xv).slice(1).reduce((r,t,n)=>(r[_F[n]]=parseFloat(t)||0,r),{}),Qv=(e,r)=>{const t=r?r.getTime():Date.now(),n=new Date(t);return n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+e.days),n.setHours(n.getHours()+e.hours),n.setMinutes(n.getMinutes()+e.minutes),n.setMilliseconds(n.getMilliseconds()+e.seconds*1e3),n.setDate(n.getDate()+e.weeks*7),n},IC=(e,r)=>{const t=r?r.getTime():Date.now(),n=new Date(t);return(Qv(e,n).getTime()-n.getTime())/1e3},wF={end:Qv,toSeconds:IC,pattern:Xv,parse:OC},SF=Object.freeze(Object.defineProperty({__proto__:null,default:wF,end:Qv,parse:OC,pattern:Xv,toSeconds:IC},Symbol.toStringTag,{value:"Module"})),TF=w0(SF);var CF=Gt,EF=wa,kF=qr.f,Qp=CF("unscopables"),Zp=Array.prototype;Zp[Qp]==null&&kF(Zp,Qp,{configurable:!0,value:EF(null)});var Zv=function(e){Zp[Qp][e]=!0},RF=ln,em=Zv,hb=Cu,PC=kn,$F=qr.f,OF=Jv,Qu=Yv,IF=Yt,AC="Array Iterator",PF=PC.set,AF=PC.getterFor(AC),xC=OF(Array,"Array",function(e,r){PF(this,{type:AC,target:RF(e),index:0,kind:r})},function(){var e=AF(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,Qu(void 0,!0)):t=="keys"?Qu(n,!1):t=="values"?Qu(r[n],!1):Qu([n,r[n]],!1)},"values"),vb=hb.Arguments=hb.Array;em("keys");em("values");em("entries");if(IF&&vb.name!=="values")try{$F(vb,"name",{value:"values"})}catch{}var mb=Rt,MC=hC,xF=vC,jo=xC,vd=ji,NC=Gt,md=NC("iterator"),gb=NC("toStringTag"),gd=jo.values,LC=function(e,r){if(e){if(e[md]!==gd)try{vd(e,md,gd)}catch{e[md]=gd}if(e[gb]||vd(e,gb,r),MC[r]){for(var t in jo)if(e[t]!==jo[t])try{vd(e,t,jo[t])}catch{e[t]=jo[t]}}}};for(var yd in MC)LC(mb[yd]&&mb[yd].prototype,yd);LC(xF,"DOMTokenList");var MF=Bt,NF=tr,yb=co,tm=function(e,r,t){var n,i;return yb&&MF(n=r.constructor)&&n!==t&&NF(i=n.prototype)&&i!==t.prototype&&yb(e,i),e},LF=_t,DF=LF(1 .valueOf),jF=`
9
9
  \v\f\r                 \u2028\u2029\uFEFF`,FF=_t,UF=oi,BF=br,eh=jF,bb=FF("".replace),qF=RegExp("^["+eh+"]+"),GF=RegExp("(^|[^"+eh+"])["+eh+"]+$"),bd=function(e){return function(r){var t=BF(UF(r));return e&1&&(t=bb(t,qF,"")),e&2&&(t=bb(t,GF,"$1")),t}},VF={start:bd(1),end:bd(2),trim:bd(3)},zF=wt,DC=M0,WF=Yt,jC=Rt,FC=uT,UC=_t,HF=Rl,_b=rr,KF=tm,JF=Di,YF=ao,BC=bv,XF=mt,QF=ba.f,ZF=ii.f,eU=qr.f,tU=DF,rU=VF.trim,Vl="Number",Ds=jC[Vl];FC[Vl];var rm=Ds.prototype,nU=jC.TypeError,iU=UC("".slice),Zu=UC("".charCodeAt),aU=function(e){var r=BC(e,"number");return typeof r=="bigint"?r:sU(r)},sU=function(e){var r=BC(e,"number"),t,n,i,a,s,c,o,u;if(YF(r))throw nU("Cannot convert a Symbol value to a number");if(typeof r=="string"&&r.length>2){if(r=rU(r),t=Zu(r,0),t===43||t===45){if(n=Zu(r,2),n===88||n===120)return NaN}else if(t===48){switch(Zu(r,1)){case 66:case 98:i=2,a=49;break;case 79:case 111:i=8,a=55;break;default:return+r}for(s=iU(r,2),c=s.length,o=0;o<c;o++)if(u=Zu(s,o),u<48||u>a)return NaN;return parseInt(s,i)}}return+r},nm=HF(Vl,!Ds(" 0o1")||!Ds("0b1")||Ds("+0x1")),oU=function(e){return JF(rm,e)&&XF(function(){tU(e)})},zl=function(r){var t=arguments.length<1?0:Ds(aU(r));return oU(this)?KF(Object(t),this,zl):t};zl.prototype=rm;nm&&!DC&&(rm.constructor=zl);zF({global:!0,constructor:!0,wrap:!0,forced:nm},{Number:zl});var uU=function(e,r){for(var t=WF?QF(r):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),n=0,i;t.length>n;n++)_b(r,i=t[n])&&!_b(e,i)&&eU(e,i,ZF(r,i))};(nm||DC)&&uU(FC[Vl],Ds);var cU=sr,qC=function(){var e=cU(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},im=mt,lU=Rt,am=lU.RegExp,sm=im(function(){var e=am("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),fU=sm||im(function(){return!am("a","y").sticky}),dU=sm||im(function(){var e=am("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),GC={BROKEN_CARET:dU,MISSED_STICKY:fU,UNSUPPORTED_Y:sm},pU=mt,hU=Rt,vU=hU.RegExp,mU=pU(function(){var e=vU(".","s");return!(e.dotAll&&e.exec(`
10
10
  `)&&e.flags==="s")}),gU=mt,yU=Rt,bU=yU.RegExp,_U=gU(function(){var e=bU("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),xs=qt,Wl=_t,wU=br,SU=qC,TU=GC,CU=so,EU=wa,kU=kn.get,RU=mU,$U=_U,OU=CU("native-string-replace",String.prototype.replace),sl=RegExp.prototype.exec,th=sl,IU=Wl("".charAt),PU=Wl("".indexOf),AU=Wl("".replace),_d=Wl("".slice),rh=function(){var e=/a/,r=/b*/g;return xs(sl,e,"a"),xs(sl,r,"a"),e.lastIndex!==0||r.lastIndex!==0}(),VC=TU.BROKEN_CARET,nh=/()??/.exec("")[1]!==void 0,xU=rh||nh||VC||RU||$U;xU&&(th=function(r){var t=this,n=kU(t),i=wU(r),a=n.raw,s,c,o,u,l,f,d;if(a)return a.lastIndex=t.lastIndex,s=xs(th,a,i),t.lastIndex=a.lastIndex,s;var p=n.groups,h=VC&&t.sticky,E=xs(SU,t),x=t.source,I=0,M=i;if(h&&(E=AU(E,"y",""),PU(E,"g")===-1&&(E+="g"),M=_d(i,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&IU(i,t.lastIndex-1)!==`
11
11
  `)&&(x="(?: "+x+")",M=" "+M,I++),c=new RegExp("^(?:"+x+")",E)),nh&&(c=new RegExp("^"+x+"$(?!\\s)",E)),rh&&(o=t.lastIndex),u=xs(sl,h?c:t,M),h?u?(u.input=_d(u.input,I),u[0]=_d(u[0],I),u.index=t.lastIndex,t.lastIndex+=u[0].length):t.lastIndex=0:rh&&u&&(t.lastIndex=t.global?u.index+u[0].length:o),nh&&u&&u.length>1&&xs(OU,u[0],c,function(){for(l=1;l<arguments.length-2;l++)arguments[l]===void 0&&(u[l]=void 0)}),u&&p)for(u.groups=f=EU(null),l=0;l<p.length;l++)d=p[l],f[d[0]]=u[d[1]];return u});var Hl=th,MU=wt,wb=Hl;MU({target:"RegExp",proto:!0,forced:/./.exec!==wb},{exec:wb});var Sb=Ol,Tb=Gr,NU=Hl,Cb=mt,zC=Gt,LU=ji,DU=zC("species"),wd=RegExp.prototype,Kl=function(e,r,t,n){var i=zC(e),a=!Cb(function(){var u={};return u[i]=function(){return 7},""[e](u)!=7}),s=a&&!Cb(function(){var u=!1,l=/a/;return e==="split"&&(l={},l.constructor={},l.constructor[DU]=function(){return l},l.flags="",l[i]=/./[i]),l.exec=function(){return u=!0,null},l[i](""),!u});if(!a||!s||t){var c=Sb(/./[i]),o=r(i,""[e],function(u,l,f,d,p){var h=Sb(u),E=l.exec;return E===NU||E===wd.exec?a&&!p?{done:!0,value:c(l,f,d)}:{done:!0,value:h(f,l,d)}:{done:!1}});Tb(String.prototype,e,o[0]),Tb(wd,i,o[1])}n&&LU(wd[i],"sham",!0)},jU=Kv.charAt,om=function(e,r,t){return r+(t?jU(e,r).length:1)},um=_t,FU=Mr,UU=Math.floor,Sd=um("".charAt),BU=um("".replace),Td=um("".slice),qU=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,GU=/\$([$&'`]|\d{1,2})/g,VU=function(e,r,t,n,i,a){var s=t+e.length,c=n.length,o=GU;return i!==void 0&&(i=FU(i),o=qU),BU(a,o,function(u,l){var f;switch(Sd(l,0)){case"$":return"$";case"&":return e;case"`":return Td(r,0,t);case"'":return Td(r,s);case"<":f=i[Td(l,1,-1)];break;default:var d=+l;if(d===0)return u;if(d>c){var p=UU(d/10);return p===0?u:p<=c?n[p-1]===void 0?Sd(l,1):n[p-1]+Sd(l,1):u}f=n[d-1]}return f===void 0?"":f})},Eb=qt,zU=sr,WU=Bt,HU=ai,KU=Hl,JU=TypeError,Jl=function(e,r){var t=e.exec;if(WU(t)){var n=Eb(t,e,r);return n!==null&&zU(n),n}if(HU(e)==="RegExp")return Eb(KU,e,r);throw JU("RegExp#exec called on incompatible receiver")},YU=_a,kb=qt,Yl=_t,XU=Kl,QU=mt,ZU=sr,eB=Bt,tB=si,rB=ui,nB=Fi,ys=br,iB=oi,aB=om,sB=as,oB=VU,uB=Jl,cB=Gt,ih=cB("replace"),lB=Math.max,fB=Math.min,dB=Yl([].concat),Cd=Yl([].push),Rb=Yl("".indexOf),$b=Yl("".slice),pB=function(e){return e===void 0?e:String(e)},hB=function(){return"a".replace(/./,"$0")==="$0"}(),Ob=function(){return/./[ih]?/./[ih]("a","$0")==="":!1}(),vB=!QU(function(){var e=/./;return e.exec=function(){var r=[];return r.groups={a:"7"},r},"".replace(e,"$<a>")!=="7"});XU("replace",function(e,r,t){var n=Ob?"$":"$0";return[function(a,s){var c=iB(this),o=tB(a)?void 0:sB(a,ih);return o?kb(o,a,c,s):kb(r,ys(c),a,s)},function(i,a){var s=ZU(this),c=ys(i);if(typeof a=="string"&&Rb(a,n)===-1&&Rb(a,"$<")===-1){var o=t(r,s,c,a);if(o.done)return o.value}var u=eB(a);u||(a=ys(a));var l=s.global;if(l){var f=s.unicode;s.lastIndex=0}for(var d=[];;){var p=uB(s,c);if(p===null||(Cd(d,p),!l))break;var h=ys(p[0]);h===""&&(s.lastIndex=aB(c,nB(s.lastIndex),f))}for(var E="",x=0,I=0;I<d.length;I++){p=d[I];for(var M=ys(p[0]),j=lB(fB(rB(p.index),c.length),0),V=[],ie=1;ie<p.length;ie++)Cd(V,pB(p[ie]));var oe=p.groups;if(u){var J=dB([M],V,j,c);oe!==void 0&&Cd(J,oe);var L=ys(YU(a,void 0,J))}else L=oB(M,c,j,V,oe,a);j>=x&&(E+=$b(c,x,j)+L,x=j+M.length)}return E+$b(c,x)}]},!vB||!hB||Ob);var mB=wt,gB=_t,yB=cu,bB=ln,_B=ql,wB=gB([].join),SB=yB!=Object,TB=SB||!_B("join",",");mB({target:"Array",proto:!0,forced:TB},{join:function(r){return wB(bB(this),r===void 0?",":r)}});var Tr={},CB=wt,Ib=yu,EB=$l,kB=tr,Pb=ss,RB=Ir,$B=ln,OB=uo,IB=Gt,PB=wu,AB=oo,xB=PB("slice"),MB=IB("species"),Ed=Array,NB=Math.max;CB({target:"Array",proto:!0,forced:!xB},{slice:function(r,t){var n=$B(this),i=RB(n),a=Pb(r,i),s=Pb(t===void 0?i:t,i),c,o,u;if(Ib(n)&&(c=n.constructor,EB(c)&&(c===Ed||Ib(c.prototype))?c=void 0:kB(c)&&(c=c[MB],c===null&&(c=void 0)),c===Ed||c===void 0))return AB(n,a,s);for(o=new(c===void 0?Ed:c)(NB(s-a,0)),u=0;a<s;a++,u++)a in n&&OB(o,u,n[a]);return o.length=u,o}});var LB=wt,Ab=qt,DB=Bt,xb=sr,jB=br,FB=function(){var e=!1,r=/[ac]/;return r.exec=function(){return e=!0,/./.exec.apply(this,arguments)},r.test("abc")===!0&&e}(),UB=/./.test;LB({target:"RegExp",proto:!0,forced:!FB},{test:function(e){var r=xb(this),t=jB(e),n=r.exec;if(!DB(n))return Ab(UB,r,t);var i=Ab(n,r,t);return i===null?!1:(xb(i),!0)}});var BB=wt,qB=Yt,GB=Rt,ec=_t,VB=rr,zB=Bt,WB=Di,HB=br,KB=ci,JB=V0,Ci=GB.Symbol,ja=Ci&&Ci.prototype;if(qB&&zB(Ci)&&(!("description"in ja)||Ci().description!==void 0)){var Mb={},tc=function(){var r=arguments.length<1||arguments[0]===void 0?void 0:HB(arguments[0]),t=WB(ja,this)?new Ci(r):r===void 0?Ci():Ci(r);return r===""&&(Mb[t]=!0),t};JB(tc,Ci),tc.prototype=ja,ja.constructor=tc;var YB=String(Ci("test"))=="Symbol(test)",XB=ec(ja.valueOf),QB=ec(ja.toString),ZB=/^Symbol\((.*)\)[^)]+$/,e3=ec("".replace),t3=ec("".slice);KB(ja,"description",{configurable:!0,get:function(){var r=XB(this);if(VB(Mb,r))return"";var t=QB(r),n=YB?t3(t,7,-1):e3(t,ZB,"$1");return n===""?void 0:n}}),BB({global:!0,constructor:!0,forced:!0},{Symbol:tc})}var r3=cT;r3("iterator");var n3=Yt,i3=du.EXISTS,WC=_t,a3=ci,HC=Function.prototype,s3=WC(HC.toString),KC=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,o3=WC(KC.exec),u3="name";n3&&!i3&&a3(HC,u3,{configurable:!0,get:function(){try{return o3(KC,s3(this))[1]}catch{return""}}});var JC={exports:{}},YC={exports:{}};(function(e){function r(t){if(Array.isArray(t))return t}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(YC);var c3=YC.exports,XC={exports:{}};(function(e){function r(t,n){var i=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i!=null){var a,s,c,o,u=[],l=!0,f=!1;try{if(c=(i=i.call(t)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(a=c.call(i)).done)&&(u.push(a.value),u.length!==n);l=!0);}catch(d){f=!0,s=d}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(f)throw s}}return u}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(XC);var l3=XC.exports,QC={exports:{}},ZC={exports:{}};(function(e){function r(t,n){(n==null||n>t.length)&&(n=t.length);for(var i=0,a=new Array(n);i<n;i++)a[i]=t[i];return a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(ZC);var eE=ZC.exports;(function(e){var r=eE;function t(n,i){if(n){if(typeof n=="string")return r(n,i);var a=Object.prototype.toString.call(n).slice(8,-1);if(a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set")return Array.from(n);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return r(n,i)}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(QC);var tE=QC.exports,rE={exports:{}};(function(e){function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
package/dist/index.d.ts CHANGED
@@ -129,6 +129,7 @@ export interface CompanyResponse {
129
129
  export interface MenuChannel {
130
130
  enabled: boolean;
131
131
  type: string;
132
+ menu_id: number;
132
133
  [key: string]: unknown;
133
134
  }
134
135
  export interface MenuItem {
@@ -153,6 +154,10 @@ export interface MenuResponse {
153
154
  user: boolean;
154
155
  };
155
156
  }
157
+ export interface WaitTimeResponse {
158
+ chat: number;
159
+ voice_call: number;
160
+ }
156
161
  export interface HumanAgent {
157
162
  id: number;
158
163
  name: string;
@@ -191,6 +196,11 @@ export interface ChatResponse {
191
196
  all_agents: HumanAgent[];
192
197
  all_virtual_agents: VirtualAgent[];
193
198
  }
199
+ export interface ChatDeflectionResponse {
200
+ enabled: boolean;
201
+ threshold: number;
202
+ keep_waiting: boolean;
203
+ }
194
204
  export interface MessageResponse {
195
205
  $index: number;
196
206
  $sid: string;
@@ -322,7 +332,9 @@ export declare class Client {
322
332
  getCompany(): Promise<CompanyResponse>;
323
333
  getTrigger(lang?: string): Promise<TriggerItem>;
324
334
  getMenus(key?: string, lang?: string): Promise<MenuResponse>;
335
+ getAfterHourMessage(lang?: string): Promise<string>;
325
336
  getTimeSlots(menuId: number | string, lang?: string): Promise<string[]>;
337
+ getWaitTimes(menuId: number | string, lang?: string): Promise<WaitTimeResponse>;
326
338
  createCall(menuId: number | string, data: CallRequest): Promise<CallResponse>;
327
339
  loadCall(callId: number | string): Promise<CallResponse>;
328
340
  cancelCall(callId: number | string): Promise<CallResponse>;
@@ -333,11 +345,13 @@ export declare class Client {
333
345
  loadOngoingChat(): Promise<Chat>;
334
346
  finishChat(): Promise<void>;
335
347
  destroyChat(): Promise<void>;
336
- sendChatTranscript(emails: string[]): Promise<RequestReturn>;
348
+ getChatDeflection(): Promise<ChatDeflectionResponse | null>;
349
+ sendChatTranscripts(emails: string[]): Promise<RequestReturn>;
337
350
  getChatSurvey(): Promise<ChatSurveyResponse>;
338
351
  sendChatSurvey(answers: SurveyAnswers): Promise<RequestReturn>;
339
352
  sendChatRate(data: RateRequest): Promise<RequestReturn>;
340
353
  escalateChat(data?: EscalateRequest): Promise<RequestReturn>;
354
+ fetchMessages(): Promise<MessageResponse[]>;
341
355
  sendFileMessage(file: File, progress?: ProgressMethod): Promise<number>;
342
356
  sendTextMessage(content: string): Promise<number>;
343
357
  createCobrowseCode(lang?: string, customData?: Record<string, string>): Promise<string>;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var S$ = Object.defineProperty;
2
2
  var T$ = (e, r, t) => r in e ? S$(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
3
  var bt = (e, r, t) => (T$(e, typeof r != "symbol" ? r + "" : r, t), t);
4
- const EQ = "qa", C$ = "3.0.4", pg = "https://main.api.ujetqa.co", xr = {
4
+ const EQ = "qa", C$ = "3.0.5", pg = "https://main.api.ujetqa.co", xr = {
5
5
  companyId: "",
6
6
  tenant: "",
7
7
  trackerId: "",
@@ -409,7 +409,7 @@ class B$ {
409
409
  }
410
410
  async connect() {
411
411
  try {
412
- return await hg(() => this.provider.create(), 3), await hg(() => this.provider.join(this.state.provider_channel_id), 3), this.connected = !0, this.triggerEvent("connected"), bg.info("connected with provider", this.state.provider_type), !0;
412
+ return await hg(() => this.provider.create(), 3), await hg(() => this.provider.join(this.state.provider_channel_id), 3), this.connected = !0, this.triggerEvent("connected", this), bg.info("connected with provider", this.state.provider_type), !0;
413
413
  } catch {
414
414
  return !1;
415
415
  }
@@ -425,8 +425,11 @@ class B$ {
425
425
  return this.provider.preview(r);
426
426
  }
427
427
  async fetchMessages() {
428
- const r = await this.store.getAllFiles();
429
- return this.provider.fetchMessages(r);
428
+ if (this.connected) {
429
+ const r = await this.store.getAllFiles();
430
+ return this.provider.fetchMessages(r);
431
+ } else
432
+ throw new Error("Please fetchMessages after chat connected.");
430
433
  }
431
434
  startTyping() {
432
435
  return this.provider.startTyping();
@@ -650,8 +653,9 @@ class Q$ {
650
653
  async finishChat(r) {
651
654
  return (await this.patch(`chats/${r}`, { status: "finished" })).data;
652
655
  }
653
- getChatDeflection(r) {
654
- return this.get(`chats/${r}/deflections`);
656
+ async getChatDeflection(r) {
657
+ const { data: t } = await this.get(`chats/${r}/deflections`);
658
+ return t && t.enabled ? t : null;
655
659
  }
656
660
  sendChatCustomData(r, t) {
657
661
  let n;
@@ -663,7 +667,7 @@ class Q$ {
663
667
  data: t
664
668
  }, this.post(`chats/${r}/custom_data`, n);
665
669
  }
666
- sendChatTranscript(r, t) {
670
+ sendChatTranscripts(r, t) {
667
671
  return this.post(`chats/${r}/transcripts`, {
668
672
  emails: t.join(",")
669
673
  });
@@ -1252,9 +1256,15 @@ let $Q = class {
1252
1256
  getMenus(r, t) {
1253
1257
  return this.methods.getMenus(t || this.lang, r);
1254
1258
  }
1259
+ getAfterHourMessage(r) {
1260
+ return this.methods.getAfterHourMessage(r || this.lang);
1261
+ }
1255
1262
  getTimeSlots(r, t) {
1256
1263
  return this.methods.getTimeSlots(r, t || this.lang);
1257
1264
  }
1265
+ getWaitTimes(r, t) {
1266
+ return this.methods.getWaitTimes(r, t || this.lang);
1267
+ }
1258
1268
  createCall(r, t) {
1259
1269
  var n;
1260
1270
  return !t.email && ((n = this.user) != null && n.email) && (t.email = this.user.email), this.methods.createCall(Number(r), t.lang || this.lang, t);
@@ -1302,8 +1312,11 @@ let $Q = class {
1302
1312
  async destroyChat() {
1303
1313
  this.chat && (this.chat.ongoing && await this.finishChat(), await this.chat.destroy(), this.chat = null, xr.trackerId = "");
1304
1314
  }
1305
- sendChatTranscript(r) {
1306
- return this.methods.sendChatTranscript(this.chat.id, r);
1315
+ getChatDeflection() {
1316
+ return this.methods.getChatDeflection(this.chat.id);
1317
+ }
1318
+ sendChatTranscripts(r) {
1319
+ return this.methods.sendChatTranscripts(this.chat.id, r);
1307
1320
  }
1308
1321
  getChatSurvey() {
1309
1322
  return this.methods.getChatSurvey(this.chat.id);
@@ -1321,6 +1334,9 @@ let $Q = class {
1321
1334
  escalateChat(r) {
1322
1335
  return this.methods.escalateChat(this.chat.id, r);
1323
1336
  }
1337
+ fetchMessages() {
1338
+ return this.chat.fetchMessages();
1339
+ }
1324
1340
  async sendFileMessage(r, t) {
1325
1341
  const n = await this.methods.uploadChatFile(this.chat.id, r, t);
1326
1342
  return this.chat.sendMessage(n, r);
@@ -1361,7 +1377,7 @@ let $Q = class {
1361
1377
  }
1362
1378
  }
1363
1379
  registerOngoingChat(r) {
1364
- r._setGlobalEvents(this.events), r.on("_requestCobrowse", (t) => {
1380
+ this.events.triggerEvent("chat.ongoing", r), r._setGlobalEvents(this.events), r.on("_requestCobrowse", (t) => {
1365
1381
  t === "agent" ? this.startCobrowse(t) : this.initializeCobrowse(r.lang), this.events.triggerEvent("cobrowse.request", { from: t });
1366
1382
  }), r.on("disconnected", () => {
1367
1383
  Dr.del("chat"), Dr.del("cobrowse");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ujet/websdk-headless",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",