@escalated-dev/escalated 0.11.10 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -359,6 +359,47 @@ npm install @escalated-dev/plugin-jira
359
359
 
360
360
  ## For Package Maintainers
361
361
 
362
+ Verified guest access is enabled by backend capabilities. `Escalated/Guest/Create`
363
+ accepts optional `verification_url` and `lookup_url` props. With these URLs, the
364
+ form requests an email code before posting a ticket; a separate form verifies
365
+ email to find existing tickets by tracking/ticket reference and renew private
366
+ links. `Guest/Show` displays `ticket.guest_access_expires_at` when supplied.
367
+
368
+ The built-in widget enables the same flow only when `/config` returns
369
+ `guest_verification_required: true`. The backend must provide POST `/verification`
370
+ with email and purpose (`ticket`, `chat`, `lookup`), returning `verification_id`;
371
+ creation accepts `verification_id` and the eight-digit `verification_code`.
372
+ POST `/lookup` returns `{ data: [{ reference, subject, guest_access_token,
373
+ expires_at }] }`; subsequent widget status reads send the token as a Bearer
374
+ header. Chat creation returns an opaque `id` and polling uses
375
+ `/chat/{id}/messages`. Proofs and private results are cleared on destination or
376
+ identity changes. Tokens remain in component memory. CSRF headers are sent only
377
+ to the page's own origin.
378
+
379
+ Backends that omit these capabilities retain their existing form contract. Hosts
380
+ must ship these forms before requiring verification in their backend. This does
381
+ not implement verification in the other backend packages or release the separate
382
+ web-widget plugin.
383
+
384
+ The widget can also be embedded on other sites, as a launcher or an on-page
385
+ support form, with host parameters (department, prefill, metadata) and a
386
+ JavaScript API. Backends opt in with an origin allow list, CORS and a CSRF
387
+ exemption for those origins. See [Embedding the widget](docs/embedding-the-widget.md).
388
+
389
+ Backends with account isolation can share `escalated.broadcasting.channel_prefix`
390
+ through Inertia, for example `escalated.tenants.<opaque-account-namespace>`.
391
+ Ticket, agent, chat and presence subscriptions use this prefix and rejoin when it
392
+ changes. Omitting it preserves the existing `escalated` channels. Standalone
393
+ `PresenceIndicator` consumers can pass its `channelPrefix` prop; `useRealtime`
394
+ and `useChat` accept `channelPrefix` as a string, ref or getter. Raw
395
+ `useRealtime().listen(channel, event, callback)` still treats the channel literally.
396
+
397
+ The backend must authorize the current account and each private/presence join.
398
+ Channel names alone are not authorization. Ticket presence should expose only
399
+ agent identity/display names, with requester access limited to private ticket
400
+ updates. Deploy a frontend version containing this support before enabling a
401
+ backend's account-scoped channels.
402
+
362
403
  If you're building a new backend integration, this package is available on npm:
363
404
 
364
405
  ```bash
@@ -376,7 +417,68 @@ import { StatusBadge, SlaTimer } from '@escalated-dev/escalated'
376
417
  import CustomerIndex from '@escalated-dev/escalated/pages/Customer/Index.vue'
377
418
  ```
378
419
 
379
- Peer dependencies: `vue` ^3.3.0, `@inertiajs/vue3` ^1.0.0 || ^2.0.0
420
+ Peer dependencies: `vue` ^3.3.0, `@inertiajs/vue3` ^1.0.0 || ^2.0.0 || ^3.0.0
421
+
422
+ The API token and two-factor pages accept flash data from `page.props.flash`
423
+ (legacy shared props) and `page.flash` (Inertia 3). Top-level values take
424
+ precedence, including explicit `null` values that clear legacy data. Inertia 3
425
+ backends should send one-time tokens, setup URIs, and recovery codes through
426
+ top-level flash so they are excluded from the adapter's browser history state.
427
+ Hosts must deploy a frontend release containing this support before changing
428
+ their backend's flash protocol.
429
+
430
+ ## Contributing
431
+
432
+ The development tools require Node **22.22.2+ on the 22.x line**, **24.15.0+
433
+ on the 24.x line**, or **26+**. Use `nvm use` to select the version in `.nvmrc`.
434
+ These requirements apply when working on this repository; the published Vue
435
+ and Inertia peer dependencies are listed above.
436
+
437
+ ```bash
438
+ npm ci
439
+ npm test
440
+ npm run lint
441
+ npm run format:check
442
+ npm run pages:check
443
+ npm run build-storybook
444
+ npm audit
445
+ ```
446
+
447
+ Commit `package-lock.json` with dependency updates. CI installs that exact graph
448
+ with `npm ci`, checks dependency engines and peer requirements, and runs the test
449
+ suite on Node 22.22.2, 24.15.0, and 26. Storybook's production build and the full
450
+ dependency audit also run before merging.
451
+
452
+ The browser contract packs the current source, installs that tarball in isolated
453
+ consumers with real Inertia 1, 2, and 3 adapters, audits each consumer, and tests
454
+ token and two-factor flows on desktop and mobile Chromium. It uses a local HTTP
455
+ server and synthetic credentials. The clipboard boundary is simulated so the
456
+ test does not change your clipboard.
457
+
458
+ ```bash
459
+ npx --no-install playwright install chromium
460
+ npm run test:inertia
461
+ # Or select a single adapter major:
462
+ npm run test:inertia -- 3
463
+ ```
464
+
465
+ Reports and screenshots are written to `test-results/inertia-flash/`. CI runs
466
+ each adapter separately and uploads that evidence on success or failure.
467
+
468
+ ## Backend settings capabilities
469
+
470
+ The `Escalated/Admin/Settings` page accepts optional `supported_settings` and
471
+ `update_url` props. Pass an array of editable setting names to show and submit only
472
+ those fields, and a URL accepting a flat POST payload. An empty array exposes no
473
+ editable settings. Omitting these props preserves the full settings form and its
474
+ Laravel named route. Backends must validate their own setting allowlist; hiding a
475
+ control is not authorization.
476
+
477
+ For example, a backend implementing only knowledge-base and branding preferences
478
+ can expose `knowledge_base_enabled`, `knowledge_base_public`,
479
+ `knowledge_base_feedback_enabled`, and `show_powered_by`. Supply typed values in
480
+ the `settings` prop. Changing the settings/account props clears stale form values
481
+ and pending requests, including previously entered credentials.
380
482
 
381
483
  ## Ecosystem
382
484
 
@@ -0,0 +1,215 @@
1
+ /*! @escalated-dev/escalated 0.12.1 widget | MIT */
2
+ globalThis.__ESCALATED_WIDGET_CSS__=".guest-email-code[data-v-0e8356f7]{margin:12px 0;font-size:14px}.guest-email-code label[data-v-0e8356f7],.guest-email-code input[data-v-0e8356f7]{display:block}.guest-email-code input[data-v-0e8356f7]{box-sizing:border-box;color:#111827;background:#fff;border:1px solid #d1d5db;border-radius:8px;width:100%;margin-top:6px;padding:8px}.guest-email-code button[data-v-0e8356f7]{cursor:pointer;margin-top:8px;text-decoration:underline}\n";
3
+ var EscalatedWidgetBundle=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var n={},r=[],i=()=>{},a=()=>!1,o=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith(`onUpdate:`),c=Object.assign,l=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},u=Object.prototype.hasOwnProperty,d=(e,t)=>u.call(e,t),f=Array.isArray,p=e=>S(e)===`[object Map]`,m=e=>S(e)===`[object Set]`,h=e=>S(e)===`[object Date]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,ee=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,te=t(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},re=/-\w/g,T=ne(e=>e.replace(re,e=>e.slice(1).toUpperCase())),ie=/\B([A-Z])/g,E=ne(e=>e.replace(ie,`-$1`).toLowerCase()),ae=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),oe=ne(e=>e?`on${ae(e)}`:``),D=(e,t)=>!Object.is(e,t),O=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le,ue=()=>le||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function k(e){if(f(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?A(r):k(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var de=/;(?![^(]*\))/g,fe=/:([^]+)/,pe=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function A(e){let t={};return e.replace(pe,e=>e.startsWith(`/*`)?``:e).split(de).forEach(e=>{if(e){let n=e.split(fe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function me(e){let t=``;if(_(e))t=e;else if(f(e))for(let n=0;n<e.length;n++){let r=me(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var he=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,j=t(he);he+``;function ge(e){return!!e||e===``}function _e(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=P(e[i],t[i],n);return r}function M(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&P(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function ve(e,t,n){let r=p(e),i=p(t);if(r||i||(r=m(e),i=m(t),r||i))return r&&i?M(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!P(e[r],t[r],n))return!1}return String(e)===String(t)}function N(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function P(e,t,n){if(e===t)return!0;let r=h(e),i=h(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=f(e),i=f(t),r||i?r&&i?N(e,t,n,_e):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:N(e,t,n,ve):String(e)===String(t))))}function ye(e,t){return e.findIndex(e=>P(e,t))}var be=e=>!!(e&&e.__v_isRef===!0),F=e=>_(e)?e:e==null?``:f(e)||y(e)&&(e.toString===x||!g(e.toString))?be(e)?F(e.value):JSON.stringify(e,I,2):String(e),I=(e,t)=>be(t)?I(e,t.value):p(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[xe(t,r)+` =>`]=n,e),{})}:m(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>xe(e))}:v(t)?xe(t):y(t)&&!f(t)&&!w(t)?String(t):t,xe=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e,L,Se=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&L&&(L.active?(this.parent=L,this.index=(L.scopes||(L.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=L;try{return L=this,e()}finally{L=t}}}on(){++this._on===1&&(this.prevScope=L,L=this)}off(){if(this._on>0&&--this._on===0){if(L===this)L=this.prevScope;else{let e=L;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Ce(){return L}function we(e,t=!1){L&&L.cleanups.push(e)}var R,z=new WeakSet,Te=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,L&&(L.active?L.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,z.has(this)&&(z.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ke(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,He(this),Me(this);let e=R,t=Re;R=this,Re=!0;try{return this.fn()}finally{Ne(this),R=e,Re=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ie(e);this.deps=this.depsTail=void 0,He(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?z.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Pe(this)&&this.run()}get dirty(){return Pe(this)}},Ee=0,De,Oe;function ke(e,t=!1){if(e.flags|=8,t){e.next=Oe,Oe=e;return}e.next=De,De=e}function Ae(){Ee++}function je(){if(--Ee>0)return;if(Oe){let e=Oe;for(Oe=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;De;){let t=De;for(De=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Me(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ne(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ie(r),Le(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Pe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fe(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Fe(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ue)||(e.globalVersion=Ue,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Pe(e))))return;e.flags|=2;let t=e.dep,n=R,r=Re;R=e,Re=!0;try{Me(e);let n=e.fn(e._value);(t.version===0||D(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{R=n,Re=r,Ne(e),e.flags&=-3}}function Ie(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ie(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Le(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Re=!0,ze=[];function Be(){ze.push(Re),Re=!1}function Ve(){let e=ze.pop();Re=e===void 0||e}function He(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=R;R=void 0;try{t()}finally{R=e}}}var Ue=0,We=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ge=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!R||!Re||R===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==R)t=this.activeLink=new We(R,this),R.deps?(t.prevDep=R.depsTail,R.depsTail.nextDep=t,R.depsTail=t):R.deps=R.depsTail=t,Ke(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=R.depsTail,t.nextDep=void 0,R.depsTail.nextDep=t,R.depsTail=t,R.deps===t&&(R.deps=e)}return t}trigger(e){this.version++,Ue++,this.notify(e)}notify(e){Ae();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{je()}}};function Ke(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ke(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var qe=new WeakMap,Je=Symbol(``),Ye=Symbol(``),Xe=Symbol(``);function B(e,t,n){if(Re&&R){let t=qe.get(e);t||qe.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Ge),r.map=t,r.key=n),r.track()}}function Ze(e,t,n,r,i,a){let o=qe.get(e);if(!o){Ue++;return}let s=e=>{e&&e.trigger()};if(Ae(),t===`clear`)o.forEach(s);else{let i=f(e),a=i&&ee(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Xe||!v(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Xe)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Je)),p(e)&&s(o.get(Ye)));break;case`delete`:i||(s(o.get(Je)),p(e)&&s(o.get(Ye)));break;case`set`:p(e)&&s(o.get(Je))}}je()}function Qe(e){let t=V(e);return t===e||(B(t,`iterate`,Xe),Lt(e))?t:It(e)?Ft(e)?t.map(e=>Vt(Bt(e))):t.map(Vt):t.map(Bt)}function $e(e){return B(e=V(e),`iterate`,Xe),e}function et(e,t){return It(e)?Vt(Ft(e)?Bt(t):t):Bt(t)}var tt={__proto__:null,[Symbol.iterator](){return nt(this,Symbol.iterator,e=>et(this,e))},concat(...e){return Qe(this).concat(...e.map(e=>f(e)?Qe(e):e))},entries(){return nt(this,`entries`,e=>(e[1]=et(this,e[1]),e))},every(e,t){return it(this,`every`,e,t,void 0,arguments)},filter(e,t){return it(this,`filter`,e,t,e=>e.map(e=>et(this,e)),arguments)},find(e,t){return it(this,`find`,e,t,e=>et(this,e),arguments)},findIndex(e,t){return it(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return it(this,`findLast`,e,t,e=>et(this,e),arguments)},findLastIndex(e,t){return it(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return it(this,`forEach`,e,t,void 0,arguments)},includes(...e){return ot(this,`includes`,e)},indexOf(...e){return ot(this,`indexOf`,e)},join(e){return Qe(this).join(e)},lastIndexOf(...e){return ot(this,`lastIndexOf`,e)},map(e,t){return it(this,`map`,e,t,void 0,arguments)},pop(){return st(this,`pop`)},push(...e){return st(this,`push`,e)},reduce(e,...t){return at(this,`reduce`,e,t)},reduceRight(e,...t){return at(this,`reduceRight`,e,t)},shift(){return st(this,`shift`)},some(e,t){return it(this,`some`,e,t,void 0,arguments)},splice(...e){return st(this,`splice`,e)},toReversed(){return Qe(this).toReversed()},toSorted(e){return Qe(this).toSorted(e)},toSpliced(...e){return Qe(this).toSpliced(...e)},unshift(...e){return st(this,`unshift`,e)},values(){return nt(this,`values`,e=>et(this,e))}};function nt(e,t,n){let r=$e(e),i=r[t]();return r!==e&&!Lt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var rt=Array.prototype;function it(e,t,n,r,i,a){let o=$e(e),s=o!==e&&!Lt(e),c=o[t];if(c!==rt[t]){let t=c.apply(e,a);return s?Bt(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,et(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function at(e,t,n,r){let i=$e(e),a=i!==e&&!Lt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=et(e,t)),n.call(this,t,et(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?et(e,c):c}function ot(e,t,n){let r=V(e);B(r,`iterate`,Xe);let i=r[t](...n);return(i===-1||i===!1)&&Rt(n[0])?(n[0]=V(n[0]),r[t](...n)):i}function st(e,t,n=[]){Be(),Ae();let r=V(e)[t].apply(e,n);return je(),Ve(),r}var ct=t(`__proto__,__v_isRef,__isVue`),lt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(v));function ut(e){v(e)||(e=String(e));let t=V(this);return B(t,`has`,e),t.hasOwnProperty(e)}var dt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?kt:Ot:i?Dt:Et).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=f(e);if(!r){let e;if(a&&(e=tt[t]))return e;if(t===`hasOwnProperty`)return ut}let o=Reflect.get(e,t,H(e)?e:n);if((v(t)?lt.has(t):ct(t))||(r||B(e,`get`,t),i))return o;if(H(o)){let e=a&&ee(t)?o:o.value;return r&&y(e)?Nt(e):e}return y(o)?r?Nt(o):jt(o):o}},ft=class extends dt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=f(e)&&ee(t);if(!this._isShallow){let e=It(i);if(!Lt(n)&&!It(n)&&(i=V(i),n=V(n)),!a&&H(i)&&!H(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:d(e,t),s=Reflect.set(e,t,n,H(e)?e:r);return e===V(r)&&s&&(o?D(n,i)&&Ze(e,`set`,t,n,i):Ze(e,`add`,t,n)),s}deleteProperty(e,t){let n=d(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Ze(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!v(t)||!lt.has(t))&&B(e,`has`,t),n}ownKeys(e){return B(e,`iterate`,f(e)?`length`:Je),Reflect.ownKeys(e)}},pt=class extends dt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},mt=new ft,ht=new pt,gt=new ft(!0),_t=e=>e,vt=e=>Reflect.getPrototypeOf(e);function yt(e,t,n){return function(...r){let i=this.__v_raw,a=V(i),o=p(a),s=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?_t:t?Vt:Bt;return!t&&B(a,`iterate`,l?Ye:Je),c(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function bt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function xt(e,t){let n={get(n){let r=this.__v_raw,i=V(r),a=V(n);e||(D(n,a)&&B(i,`get`,n),B(i,`get`,a));let{has:o}=vt(i),s=t?_t:e?Vt:Bt;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&B(V(t),`iterate`,Je),t.size},has(t){let n=this.__v_raw,r=V(n),i=V(t);return e||(D(t,i)&&B(r,`has`,t),B(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=V(a),s=t?_t:e?Vt:Bt;return!e&&B(o,`iterate`,Je),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return c(n,e?{add:bt(`add`),set:bt(`set`),delete:bt(`delete`),clear:bt(`clear`)}:{add(e){let n=V(this),r=vt(n),i=V(e),a=!t&&!Lt(e)&&!It(e)?i:e;return r.has.call(n,a)||D(e,a)&&r.has.call(n,e)||D(i,a)&&r.has.call(n,i)||(n.add(a),Ze(n,`add`,a,a)),this},set(e,n){!t&&!Lt(n)&&!It(n)&&(n=V(n));let r=V(this),{has:i,get:a}=vt(r),o=i.call(r,e);o||=(e=V(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?D(n,s)&&Ze(r,`set`,e,n,s):Ze(r,`add`,e,n),this},delete(e){let t=V(this),{has:n,get:r}=vt(t),i=n.call(t,e);i||=(e=V(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Ze(t,`delete`,e,void 0,a),o},clear(){let e=V(this),t=e.size!==0,n=e.clear();return t&&Ze(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=yt(r,e,t)}),n}function St(e,t){let n=xt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(d(n,r)&&r in t?n:t,r,i)}var Ct={get:St(!1,!1)},wt={get:St(!1,!0)},Tt={get:St(!0,!1)},Et=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,kt=new WeakMap;function At(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function jt(e){return It(e)?e:Pt(e,!1,mt,Ct,Et)}function Mt(e){return Pt(e,!1,gt,wt,Dt)}function Nt(e){return Pt(e,!0,ht,Tt,Ot)}function Pt(e,t,n,r,i){if(!y(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=At(C(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Ft(e){return It(e)?Ft(e.__v_raw):!!(e&&e.__v_isReactive)}function It(e){return!!(e&&e.__v_isReadonly)}function Lt(e){return!!(e&&e.__v_isShallow)}function Rt(e){return e?!!e.__v_raw:!1}function V(e){let t=e&&e.__v_raw;return t?V(t):e}function zt(e){return!d(e,`__v_skip`)&&Object.isExtensible(e)&&se(e,`__v_skip`,!0),e}var Bt=e=>y(e)?jt(e):e,Vt=e=>y(e)?Nt(e):e;function H(e){return e?e.__v_isRef===!0:!1}function U(e){return Ht(e,!1)}function Ht(e,t){return H(e)?e:new Ut(e,t)}var Ut=class{constructor(e,t){this.dep=new Ge,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:V(e),this._value=t?e:Bt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Lt(e)||It(e);e=n?e:V(e),D(e,t)&&(this._rawValue=e,this._value=n?e:Bt(e),this.dep.trigger())}};function W(e){return H(e)?e.value:e}var Wt={get:(e,t,n)=>t===`__v_raw`?e:W(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return H(i)&&!H(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Gt(e){return Ft(e)?e:new Proxy(e,Wt)}var Kt=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ge(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ue-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&R!==this)return ke(this,!0),!0}get value(){let e=this.dep.track();return Fe(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function qt(e,t,n=!1){let r,i;return g(e)?r=e:(r=e.get,i=e.set),new Kt(r,i,n)}var Jt={},Yt=new WeakMap,Xt=void 0;function Zt(e,t=!1,n=Xt){if(n){let t=Yt.get(n);t||Yt.set(n,t=[]),t.push(e)}}function Qt(e,t,r=n){let{immediate:a,deep:o,once:s,scheduler:c,augmentJob:u,call:d}=r,p=e=>o?e:Lt(e)||o===!1||o===0?$t(e,1):$t(e),m,h,_,v,y=!1,b=!1;if(H(e)?(h=()=>e.value,y=Lt(e)):Ft(e)?(h=()=>p(e),y=!0):f(e)?(b=!0,y=e.some(e=>Ft(e)||Lt(e)),h=()=>e.map(e=>{if(H(e))return e.value;if(Ft(e))return p(e);if(g(e))return d?d(e,2):e()})):h=g(e)?t?d?()=>d(e,2):e:()=>{if(_){Be();try{_()}finally{Ve()}}let t=Xt;Xt=m;try{return d?d(e,3,[v]):e(v)}finally{Xt=t}}:i,t&&o){let e=h,t=o===!0?1/0:o;h=()=>$t(e(),t)}let x=Ce(),S=()=>{m.stop(),x&&x.active&&l(x.effects,m)};if(s&&t){let e=t;t=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(Jt):Jt,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e)){if(t){let n=m.run();if(e||o||y||(b?n.some((e,t)=>D(e,C[t])):D(n,C))){_&&_();let e=Xt;Xt=m;try{let e=[n,C===Jt?void 0:b&&C[0]===Jt?[]:C,v];C=n,d?d(t,3,e):t(...e)}finally{Xt=e}}}else m.run()}};return u&&u(w),m=new Te(h),m.scheduler=c?()=>c(w,!1):w,v=e=>Zt(e,!1,m),_=m.onStop=()=>{let e=Yt.get(m);if(e){if(d)d(e,4);else for(let t of e)t();Yt.delete(m)}},t?a?w(!0):C=m.run():c?c(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function $t(e,t=1/0,n){if(t<=0||!y(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,H(e))$t(e.value,t,n);else if(f(e))for(let r=0;r<e.length;r++)$t(e[r],t,n);else if(m(e)||p(e))e.forEach(e=>{$t(e,t,n)});else if(w(e)){for(let r in e)$t(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&$t(e[r],t,n)}return e}function en(e,t,n,r){try{return r?e(...r):e()}catch(e){nn(e,t,n)}}function tn(e,t,n,r){if(g(e)){let i=en(e,t,n,r);return i&&b(i)&&i.catch(e=>{nn(e,t,n)}),i}if(f(e)){let i=[];for(let a=0;a<e.length;a++)i.push(tn(e[a],t,n,r));return i}}function nn(e,t,r,i=!0){let a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||n;if(t){let n=t.parent,i=t.proxy,a=`https://vuejs.org/error-reference/#runtime-${r}`;for(;n;){let t=n.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,a)===!1)return}n=n.parent}if(o){Be(),en(o,null,10,[e,i,a]),Ve();return}}rn(e,r,a,i,s)}function rn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var G=[],an=-1,on=[],sn=null,cn=0,ln=Promise.resolve(),un=null;function dn(e){let t=un||ln;return e?t.then(this?e.bind(this):e):t}function fn(e){let t=an+1,n=G.length;for(;t<n;){let r=t+n>>>1,i=G[r],a=vn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function pn(e){if(!(e.flags&1)){let t=vn(e),n=G[G.length-1];!n||!(e.flags&2)&&t>=vn(n)?G.push(e):G.splice(fn(t),0,e),e.flags|=1,mn()}}function mn(){un||=ln.then(yn)}function hn(e){if(!f(e))sn&&e.id===-1?sn.splice(cn+1,0,e):e.flags&1||(on.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)on.push(e[t]);mn()}function gn(e,t,n=an+1){for(;n<G.length;n++){let t=G[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;G.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function _n(e){if(on.length){let e=[...new Set(on)].sort((e,t)=>vn(e)-vn(t));if(on.length=0,sn){for(let t=0;t<e.length;t++)sn.push(e[t]);return}for(sn=e,cn=0;cn<sn.length;cn++){let e=sn[cn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}sn=null,cn=0}}var vn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function yn(e){try{for(an=0;an<G.length;an++){let e=G[an];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),en(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;an<G.length;an++){let e=G[an];e&&(e.flags&=-2)}an=-1,G.length=0,_n(e),un=null,(G.length||on.length)&&yn(e)}}var bn=null,xn=null;function Sn(e){let t=bn;return bn=e,xn=e&&e.type.__scopeId||null,t}function Cn(e,t=bn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ki(-1);let i=Sn(t),a=Ti.length,o;try{o=e(...n)}finally{for(let e=Ti.length;e>a;e--)Di();Sn(i),r._d&&ki(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function K(e,t){if(bn===null)return e;let r=ua(bn),i=e.dirs||=[];for(let e=0;e<t.length;e++){let[a,o,s,c=n]=t[e];a&&(g(a)&&(a={mounted:a,updated:a}),a.deep&&$t(o),i.push({dir:a,instance:r,value:o,oldValue:void 0,arg:s,modifiers:c}))}return e}function wn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(Be(),tn(c,n,8,[e.el,s,e,t]),Ve())}}function Tn(e,t){if($){let n=$.provides,r=$.parent&&$.parent.provides;r===n&&(n=$.provides=Object.create(r)),n[e]=t}}function En(e,t,n=!1){let r=Yi();if(r||Mr){let i=Mr?Mr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&g(t)?t.call(r&&r.proxy):t}}var Dn=Symbol.for(`v-scx`),On=()=>En(Dn);function kn(e,t,n){return An(e,t,n)}function An(e,t,r=n){let{immediate:a,deep:o,flush:s,once:l}=r,u=c({},r),d=t&&a||!t&&s!==`post`,f;if(ta){if(s===`sync`){let e=On();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=i,e.resume=i,e.pause=i,e}}let p=$;u.call=(e,t,n)=>tn(e,p,t,n);let m=!1;s===`post`?u.scheduler=e=>{li(e,p&&p.suspense)}:s!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():pn(e)}),u.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=Qt(e,t,u);return ta&&(f?f.push(h):d&&h()),h}function jn(e,t,n){let r=this.proxy,i=_(e)?e.includes(`.`)?Mn(r,e):()=>r[e]:e.bind(r,r),a;g(t)?a=t:(a=t.handler,n=t);let o=Qi(this),s=An(i,a.bind(r),n);return o(),s}function Mn(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Nn=Symbol(`_vte`),Pn=e=>e.__isTeleport,Fn=Symbol(`_leaveCb`);function In(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==Ci){t=n;break}}return t}function Ln(e){if(!Gn(e))return Pn(e.type)&&e.children?In(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&g(n.default))return n.default()}}function Rn(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;Rn(Pn(n.type)&&Ln(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function zn(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Bn(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Vn=new WeakMap;function Hn(e,t,r,i,o=!1){if(f(e)){e.forEach((e,n)=>Hn(e,t&&(f(t)?t[n]:t),r,i,o));return}if(Wn(i)&&!o){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Hn(e,t,r,i.component.subTree);return}let s=i.shapeFlag&4?ua(i.component):i.el,c=o?null:s,{i:u,r:p}=e,m=t&&t.r,h=u.refs===n?u.refs={}:u.refs,v=u.setupState,y=V(v),b=v===n?a:e=>!Bn(h,e)&&d(y,e),x=(e,t)=>!(t&&Bn(h,t));if(m!=null&&m!==p){if(Un(t),_(m))h[m]=null,b(m)&&(v[m]=null);else if(H(m)){let e=t;x(m,e.k)&&(m.value=null),e.k&&(h[e.k]=null)}}if(g(p))en(p,u,12,[c,h]);else{let t=_(p),n=H(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:h[p]:x(p)||!e.k?p.value:h[e.k];if(o)f(n)&&l(n,s);else if(f(n))n.includes(s)||n.push(s);else if(t)h[p]=[s],b(p)&&(v[p]=h[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(h[e.k]=t)}}else t?(h[p]=c,b(p)&&(v[p]=c)):n&&(x(p,e.k)&&(p.value=c),e.k&&(h[e.k]=c))};if(c){let t=()=>{i(),Vn.delete(e)};t.id=-1,Vn.set(e,t),li(t,r)}else Un(e),i()}}}function Un(e){let t=Vn.get(e);t&&(t.flags|=8,Vn.delete(e))}ue().requestIdleCallback,ue().cancelIdleCallback;var Wn=e=>!!e.type.__asyncLoader,Gn=e=>e.type.__isKeepAlive;function Kn(e,t){Jn(e,`a`,t)}function qn(e,t){Jn(e,`da`,t)}function Jn(e,t,n=$){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Xn(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Gn(e.parent.vnode)&&Yn(r,t,n,e),e=e.parent}}function Yn(e,t,n,r){let i=Xn(t,e,r,!0);rr(()=>{l(r[t],i)},n)}function Xn(e,t,n=$,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Be();let i=Qi(n),a=tn(t,n,e,r);return i(),Ve(),a};return r?i.unshift(a):i.push(a),a}}var Zn=e=>(t,n=$)=>{(!ta||e===`sp`)&&Xn(e,(...e)=>t(...e),n)},Qn=Zn(`bm`),$n=Zn(`m`),er=Zn(`bu`),tr=Zn(`u`),nr=Zn(`bum`),rr=Zn(`um`),ir=Zn(`sp`),ar=Zn(`rtg`),or=Zn(`rtc`);function sr(e,t=$){Xn(`ec`,e,t)}var cr=Symbol.for(`v-ndc`);function lr(e,t,n,r){let i,a=n&&n[r],o=f(e);if(o||_(e)){let n=o&&Ft(e),r=!1,s=!1;n&&(r=!Lt(e),s=It(e),e=$e(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?Vt(Bt(e[n])):Bt(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(y(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}var ur=e=>e?ea(e)?ua(e):ur(e.parent):null,dr=c(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ur(e.parent),$root:e=>ur(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>br(e),$forceUpdate:e=>e.f||=()=>{pn(e.update)},$nextTick:e=>e.n||=dn.bind(e.proxy),$watch:e=>jn.bind(e)}),fr=(e,t)=>e!==n&&!e.__isScriptSetup&&d(e,t),pr={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return i[t];case 2:return a[t];case 4:return r[t];case 3:return o[t]}else if(fr(i,t))return s[t]=1,i[t];else if(a!==n&&d(a,t))return s[t]=2,a[t];else if(d(o,t))return s[t]=3,o[t];else if(r!==n&&d(r,t))return s[t]=4,r[t];else hr&&(s[t]=0)}let u=dr[t],f,p;if(u)return t===`$attrs`&&B(e.attrs,`get`,``),u(e);if((f=c.__cssModules)&&(f=f[t]))return f;if(r!==n&&d(r,t))return s[t]=4,r[t];if(p=l.config.globalProperties,d(p,t))return p[t]},set({_:e},t,r){let{data:i,setupState:a,ctx:o}=e;return fr(a,t)?(a[t]=r,!0):i!==n&&d(i,t)?(i[t]=r,!0):d(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(o[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==n&&c[0]!==`$`&&d(e,c)||fr(t,c)||d(o,c)||d(i,c)||d(dr,c)||d(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?d(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function mr(e){return f(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var hr=!0;function gr(e){let t=br(e),n=e.proxy,r=e.ctx;hr=!1,t.beforeCreate&&vr(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:d,beforeMount:p,mounted:m,beforeUpdate:h,updated:_,activated:v,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:ee,renderTracked:te,renderTriggered:ne,errorCaptured:re,serverPrefetch:T,expose:ie,inheritAttrs:E,components:ae,directives:oe,filters:D}=t;if(u&&_r(u,r,null),s)for(let e in s){let t=s[e];g(t)&&(r[e]=t.bind(n))}if(a){let t=a.call(n,n);y(t)&&(e.data=jt(t))}if(hr=!0,o)for(let e in o){let t=o[e],a=fa({get:g(t)?t.bind(n,n):g(t.get)?t.get.bind(n,n):i,set:!g(t)&&g(t.set)?t.set.bind(n):i});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)yr(c[e],r,n,e);if(l){let e=g(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{Tn(t,e[t])})}d&&vr(d,e,`c`);function O(e,t){f(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(O(Qn,p),O($n,m),O(er,h),O(tr,_),O(Kn,v),O(qn,b),O(sr,re),O(or,te),O(ar,ne),O(nr,S),O(rr,w),O(ir,T),f(ie)){if(ie.length){let t=e.exposed||={};ie.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}ee&&e.render===i&&(e.render=ee),E!=null&&(e.inheritAttrs=E),ae&&(e.components=ae),oe&&(e.directives=oe),T&&zn(e)}function _r(e,t,n=i){f(e)&&(e=Tr(e));for(let n in e){let r=e[n],i;i=y(r)?`default`in r?En(r.from||n,r.default,!0):En(r.from||n):En(r),H(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function vr(e,t,n){tn(f(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function yr(e,t,n,r){let i=r.includes(`.`)?Mn(n,r):()=>n[r];if(_(e)){let n=t[e];g(n)&&kn(i,n)}else if(g(e))kn(i,e.bind(n));else if(y(e)){if(f(e))e.forEach(e=>yr(e,t,n,r));else{let r=g(e.handler)?e.handler.bind(n):t[e.handler];g(r)&&kn(i,r,e)}}}function br(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>xr(c,e,o,!0)),xr(c,t,o)),y(t)&&a.set(t,c),c}function xr(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&xr(e,a,n,!0),i&&i.forEach(t=>xr(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Sr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Sr={data:Cr,props:Dr,emits:Dr,methods:Er,computed:Er,beforeCreate:q,created:q,beforeMount:q,mounted:q,beforeUpdate:q,updated:q,beforeDestroy:q,beforeUnmount:q,destroyed:q,unmounted:q,activated:q,deactivated:q,errorCaptured:q,serverPrefetch:q,components:Er,directives:Er,watch:Or,provide:Cr,inject:wr};function Cr(e,t){return t?e?function(){return c(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function wr(e,t){return Er(Tr(e),Tr(t))}function Tr(e){if(f(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function q(e,t){return e?[...new Set([].concat(e,t))]:t}function Er(e,t){return e?c(Object.create(null),e,t):t}function Dr(e,t){return e?f(e)&&f(t)?[...new Set([...e,...t])]:c(Object.create(null),mr(e),mr(t??{})):t}function Or(e,t){if(!e)return t;if(!t)return e;let n=c(Object.create(null),e);for(let r in t)n[r]=q(e[r],t[r]);return n}function kr(){return{app:null,config:{isNativeTag:a,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Ar=0;function jr(e,t){return function(n,r=null){g(n)||(n=c({},n)),r!=null&&!y(r)&&(r=null);let i=kr(),a=new WeakSet,o=[],s=!1,l=i.app={_uid:Ar++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:ma,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&g(e.install)?(a.add(e),e.install(l,...t)):g(e)&&(a.add(e),e(l,...t))),l},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),l},component(e,t){return t?(i.components[e]=t,l):i.components[e]},directive(e,t){return t?(i.directives[e]=t,l):i.directives[e]},mount(a,o,c){if(!s){let u=l._ceVNode||Ii(n,r);return u.appContext=i,c===!0?c=`svg`:c===!1&&(c=void 0),o&&t?t(u,a):e(u,a,c),s=!0,l._container=a,a.__vue_app__=l,ua(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(tn(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide(e,t){return i.provides[e]=t,l},runWithContext(e){let t=Mr;Mr=l;try{return e()}finally{Mr=t}}};return l}}var Mr=null,Nr=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${T(t)}Modifiers`]||e[`${E(t)}Modifiers`];function Pr(e,t,...r){if(e.isUnmounted)return;let i=e.vnode.props||n,a=r,o=t.startsWith(`update:`),s=o&&Nr(i,t.slice(7));s&&(s.trim&&(a=r.map(e=>_(e)?e.trim():e)),s.number&&(a=a.map(ce)));let c,l=i[c=oe(t)]||i[c=oe(T(t))];!l&&o&&(l=i[c=oe(E(t))]),l&&tn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,tn(u,e,6,a)}}var Fr=new WeakMap;function Ir(e,t,n=!1){let r=n?Fr:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!g(e)){let r=e=>{let n=Ir(e,t,!0);n&&(s=!0,c(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(y(e)&&r.set(e,null),null):(f(a)?a.forEach(e=>o[e]=null):c(o,a),y(e)&&r.set(e,o),o)}function Lr(e,t){return!e||!o(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),d(e,t[0].toLowerCase()+t.slice(1))||d(e,E(t))||d(e,t))}function Rr(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=Sn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Vi(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Vi(e.length>1?e(f,{attrs:c,slots:o,emit:l}):e(f,null)),y=t.props?c:zr(c)}}catch(t){Ti.length=0,nn(t,e,1),v=Ii(Ci)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(s)&&(y=Br(y,a)),b=zi(b,y,!1,!0))}return n.dirs&&(b=zi(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Rn(Pn(b.type)&&Ln(b)||b,n.transition),v=b,Sn(_),v}var zr=e=>{let t;for(let n in e)(n===`class`||n===`style`||o(n))&&((t||={})[n]=e[n]);return t},Br=(e,t)=>{let n={};for(let r in e)(!s(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Vr(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Hr(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Ur(o,r,n)&&!Lr(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Hr(r,o,l):!!o;return!1}function Hr(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Ur(t,e,a)&&!Lr(n,a))return!0}return!1}function Ur(e,t,n){let r=e[n],i=t[n];return n===`style`&&y(r)&&y(i)?!P(r,i):r!==i}function Wr({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Gr={},Kr=()=>Object.create(Gr),qr=e=>Object.getPrototypeOf(e)===Gr;function Jr(e,t,n,r=!1){let i={},a=Kr();e.propsDefaults=Object.create(null),Xr(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Mt(i):e.type.props?i:a,e.attrs=a}function Yr(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=V(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Lr(e.emitsOptions,o))continue;let u=t[o];if(c){if(d(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=T(o);i[t]=Zr(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Xr(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!d(t,a)&&((r=E(a))===a||!d(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Zr(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!d(t,e))&&(delete a[e],l=!0)}l&&Ze(e.attrs,`set`,``)}function Xr(e,t,r,i){let[a,o]=e.propsOptions,s=!1,c;if(t)for(let n in t){if(te(n))continue;let l=t[n],u;a&&d(a,u=T(n))?!o||!o.includes(u)?r[u]=l:(c||={})[u]=l:Lr(e.emitsOptions,n)||(!(n in i)||l!==i[n])&&(i[n]=l,s=!0)}if(o){let t=V(r),i=c||n;for(let n=0;n<o.length;n++){let s=o[n];r[s]=Zr(a,t,s,i[s],e,!d(i,s))}}return s}function Zr(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=d(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&g(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Qi(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===E(n))&&(r=!0))}return r}var Qr=new WeakMap;function $r(e,t,i=!1){let a=i?Qr:t.propsCache,o=a.get(e);if(o)return o;let s=e.props,l={},u=[],p=!1;if(!g(e)){let n=e=>{p=!0;let[n,r]=$r(e,t,!0);c(l,n),r&&u.push(...r)};!i&&t.mixins.length&&t.mixins.forEach(n),e.extends&&n(e.extends),e.mixins&&e.mixins.forEach(n)}if(!s&&!p)return y(e)&&a.set(e,r),r;if(f(s))for(let e=0;e<s.length;e++){let t=T(s[e]);ei(t)&&(l[t]=n)}else if(s)for(let e in s){let t=T(e);if(ei(t)){let n=s[e],r=l[t]=f(n)||g(n)?{type:n}:c({},n),i=r.type,a=!1,o=!0;if(f(i))for(let e=0;e<i.length;++e){let t=i[e],n=g(t)&&t.name;if(n===`Boolean`){a=!0;break}n===`String`&&(o=!1)}else a=g(i)&&i.name===`Boolean`;r[0]=a,r[1]=o,(a||d(r,`default`))&&u.push(t)}}let m=[l,u];return y(e)&&a.set(e,m),m}function ei(e){return e[0]!==`$`&&!te(e)}var ti=e=>e===`_`||e===`_ctx`||e===`$stable`,ni=e=>f(e)?e.map(Vi):[Vi(e)],ri=(e,t,n)=>{if(t._n)return t;let r=Cn((...e)=>ni(t(...e)),n);return r._c=!1,r},ii=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ti(n))continue;let i=e[n];if(g(i))t[n]=ri(n,i,r);else if(i!=null){let e=ni(i);t[n]=()=>e}}},ai=(e,t)=>{let n=ni(t);e.slots.default=()=>n},oi=(e,t,n)=>{for(let r in t)(n||!ti(r))&&(e[r]=t[r])},si=(e,t,n)=>{let r=e.slots=Kr();if(e.vnode.shapeFlag&32){let e=t._;e?(oi(r,t,n),n&&se(r,`_`,e,!0)):ii(t,r)}else t&&ai(e,t)},ci=(e,t,r)=>{let{vnode:i,slots:a}=e,o=!0,s=n;if(i.shapeFlag&32){let e=t._;e?r&&e===1?o=!1:oi(a,t,r):(o=!t.$stable,ii(t,a)),s=t}else t&&(ai(e,t),s={default:1});if(o)for(let e in a)!ti(e)&&s[e]==null&&delete a[e]},li=xi;function ui(e){return di(e)}function di(e,t){let a=ue();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=i,insertStaticContent:_}=e,v=(e,t,n,i=null,a=null,o=null,s=void 0,c=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ni(e,t)&&(i=_e(e),A(e,a,o,!0),e=null),t.patchFlag===-2&&(l=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===r&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:u,ref:d,shapeFlag:f}=t;switch(u){case Si:y(e,t,n,i);break;case Ci:b(e,t,n,i);break;case wi:e??x(t,n,i,s);break;case J:ae(e,t,n,i,a,o,s,c,l);break;default:f&1?w(e,t,n,i,a,o,s,c,l):f&6?oe(e,t,n,i,a,o,s,c,l):(f&64||f&128)&&u.process(e,t,n,i,a,o,s,c,l,N)}d!=null&&a?Hn(d,e&&e.ref,o,t||e,!t):d==null&&e&&e.ref!=null&&Hn(e.ref,null,o,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ee(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ee=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&re(e.children,d,null,r,i,fi(e,a),s,u),_&&wn(e,null,r,`created`),ne(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!te(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Gi(f,r,e)}_&&wn(e,null,r,`beforeMount`);let v=mi(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&li(()=>{try{f&&Gi(f,r,e),v&&g.enter(d),_&&wn(e,null,r,`mounted`)}finally{}},i)},ne=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||bi(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;ne(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},re=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Hi(e[l]):Vi(e[l]);v(null,c,t,n,r,i,a,o,s)}},T=(e,t,r,i,a,o,s)=>{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||n,h=t.props||n,g;if(r&&pi(r,!1),(g=h.onVnodeBeforeUpdate)&&Gi(g,r,t,e),f&&wn(t,e,r,`beforeUpdate`),r&&pi(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?ie(e.dynamicChildren,d,l,r,i,fi(t,a),o):s||k(e,t,l,null,r,i,fi(t,a),o,!1),u>0){if(u&16)E(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t],i=m[n],o=h[n];(o!==i||n===`value`)&&c(l,n,i,o,a,r)}}u&1&&e.children!==t.children&&p(l,t.children)}else!s&&d==null&&E(l,m,h,r,a);((g=h.onVnodeUpdated)||f)&&li(()=>{g&&Gi(g,r,t,e),f&&wn(t,e,r,`updated`)},i)},ie=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===J||!Ni(c,l)||c.shapeFlag&198)?m(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},E=(e,t,r,i,a)=>{if(t!==r){if(t!==n)for(let n in t)!te(n)&&!(n in r)&&c(e,n,t[n],null,a,i);for(let n in r){if(te(n))continue;let o=r[n],s=t[n];o!==s&&n!==`value`&&c(e,n,s,o,a,i)}`value`in r&&c(e,`value`,t.value,r.value,a)}},ae=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),re(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ie(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&hi(e,t,!0)):k(e,t,n,f,i,a,s,c,l)},oe=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):D(t,n,r,i,a,o,c):se(e,t,c)},D=(e,t,n,r,i,a,o)=>{let s=e.component=Ji(e,r,i);if(Gn(e)&&(s.ctx.renderer=N),na(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ce,o),!e.el){let r=s.subTree=Ii(Ci);b(null,r,t,n),e.placeholder=r.el}}else ce(s,e,t,n,i,a,o)},se=(e,t,n)=>{let r=t.component=e.component;if(Vr(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,le(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},ce=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=_i(e);if(n){t&&(t.el=c.el,le(e,t,o)),n.asyncDep.then(()=>{li(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;pi(e,!1),t?(t.el=c.el,le(e,t,o)):t=c,n&&O(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Gi(d,s,t,c),pi(e,!0);let f=Rr(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),_e(p),e,i,a),t.el=f.el,u===null&&Wr(e,f.el),r&&li(r,i),(d=t.props&&t.props.onVnodeUpdated)&&li(()=>Gi(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Wn(t);if(pi(e,!1),l&&O(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Gi(o,d,t),pi(e,!0),s&&ye){let t=()=>{e.subTree=Rr(e),ye(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Rr(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&li(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;li(()=>Gi(o,d,e),i)}(t.shapeFlag&256||d&&Wn(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&li(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Te(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>pn(u),pi(e,!0),l()},le=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Yr(e,t.props,r,n),ci(e,t.children,n),Be(),gn(e),Ve()},k=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){fe(l,d,n,r,i,a,o,s,c);return}if(f&256){de(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&ge(l,i,a),d!==l&&p(n,d)):u&16?m&16?fe(l,d,n,r,i,a,o,s,c):ge(l,i,a,!0):(u&8&&p(n,``),m&16&&re(d,n,r,i,a,o,s,c))},de=(e,t,n,i,a,o,s,c,l)=>{e||=r,t||=r;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;p<f;p++){let r=t[p]=l?Hi(t[p]):Vi(t[p]);v(e[p],r,n,null,a,o,s,c,l)}u>d?ge(e,a,o,!0,!1,f):re(t,n,i,a,o,s,c,l,f)},fe=(e,t,n,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],i=t[u]=l?Hi(t[u]):Vi(t[u]);if(Ni(r,i))v(r,i,n,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],i=t[p]=l?Hi(t[p]):Vi(t[p]);if(Ni(r,i))v(r,i,n,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,r=e<d?t[e].el:i;for(;u<=p;)v(null,t[u]=l?Hi(t[u]):Vi(t[u]),n,r,a,o,s,c,l),u++}}else if(u>p)for(;u<=f;)A(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Hi(t[u]):Vi(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u<b;u++)C[u]=0;for(u=m;u<=f;u++){let r=e[u];if(y>=b){A(r,a,o,!0);continue}let i;if(r.key!=null)i=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&Ni(r,t[_])){i=_;break}i===void 0?A(r,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(r,t[i],n,null,a,o,s,c,l),y++)}let w=x?gi(C):r;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,r=t[e],f=t[e+1],p=e+1<d?f.el||yi(f):i;C[u]===0?v(null,r,n,p,a,o,s,c,l):x&&(_<0||u!==w[_]?pe(r,n,p,2):_--)}}},pe=(e,t,n,r,i=null)=>{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){pe(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,N);return}if(c===J){o(a,t,n);for(let e=0;e<u.length;e++)pe(u[e],t,n,r);o(e.anchor,t,n);return}if(c===wi){S(e,t,n);return}if(r!==2&&d&1&&l){if(r===0)l.persisted&&!a[Fn]?o(a,t,n):(l.beforeEnter(a),o(a,t,n),li(()=>l.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Fn];a._isLeaving&&a[Fn](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},A=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(Be(),Hn(s,null,n,e,!0),Ve()),p!=null&&(!e.ctx||e.ctx===t)&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Wn(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Gi(_,t,e),u&6)j(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&wn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,N,r):l&&!l.hasOnce&&(a!==J||d>0&&d&64)?ge(l,t,n,!1,!0):(a===J&&d&384||!i&&u&16)&&ge(c,t,n),r&&me(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&li(()=>{_&&Gi(_,t,e),h&&wn(e,null,t,`unmounted`),v&&(e.el=null)},n)},me=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===J){he(n,r);return}if(t===wi){C(e),i&&!i.persisted&&i.afterLeave&&i.afterLeave();return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},he=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},j=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;vi(c),vi(l),r&&O(r),i.stop(),a?(a.flags|=8,A(o,e,t,n)):e.vnode.el&&o&&(o.transition=e.vnode.transition,A(o,e,t,n)),s&&li(s,t),li(()=>{e.isUnmounted=!0},t)},ge=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)A(e[o],t,n,r,i)},_e=e=>{if(e.shapeFlag&6)return _e(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Nn];return n?h(n):t},M=!1,ve=(e,t,n)=>{let r;e==null?t._vnode&&(A(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,M||=(M=!0,gn(r),_n(),!1)},N={p:v,um:A,m:pe,r:me,mt:D,mc:re,pc:k,pbc:ie,n:_e,o:e},P,ye;return t&&([P,ye]=t(N)),{render:ve,hydrate:P,createApp:jr(ve,P)}}function fi({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function pi({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function mi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function hi(e,t,n=!1){let r=e.children,i=t.children;if(f(r)&&f(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Hi(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&hi(t,a)),a.type===Si&&(a.patchFlag===-1&&(a=i[e]=Hi(a)),a.el=t.el),a.type===Ci&&!a.el&&(a.el=t.el)}}function gi(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function _i(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_i(t)}function vi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function yi(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?yi(t.subTree):null}var bi=e=>e.__isSuspense;function xi(e,t){t&&t.pendingBranch?f(e)?t.effects.push(...e):t.effects.push(e):hn(e)}var J=Symbol.for(`v-fgt`),Si=Symbol.for(`v-txt`),Ci=Symbol.for(`v-cmt`),wi=Symbol.for(`v-stc`),Ti=[],Ei=null;function Y(e=!1){Ti.push(Ei=e?null:[])}function Di(){Ti.pop(),Ei=Ti[Ti.length-1]||null}var Oi=1;function ki(e,t=!1){Oi+=e,e<0&&Ei&&t&&(Ei.hasOnce=!0)}function Ai(e){return e.dynamicChildren=Oi>0?Ei||r:null,Di(),Oi>0&&Ei&&Ei.push(e),e}function X(e,t,n,r,i,a){return Ai(Z(e,t,n,r,i,a,!0))}function ji(e,t,n,r,i){return Ai(Ii(e,t,n,r,i,!0))}function Mi(e){return e?e.__v_isVNode===!0:!1}function Ni(e,t){return e.type===t.type&&e.key===t.key}var Pi=({key:e})=>e??null,Fi=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:_(e)||H(e)||g(e)?{i:bn,r:e,k:t,f:!!n}:e);function Z(e,t=null,n=null,r=0,i=null,a=e===J?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pi(t),ref:t&&Fi(t),scopeId:xn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:bn};return s?(Ui(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=_(n)?8:16),Oi>0&&!o&&Ei&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Ei.push(c),c}var Ii=Li;function Li(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===cr)&&(e=Ci),Mi(e)){let r=zi(e,t,!0);return n&&Ui(r,n),Oi>0&&!a&&Ei&&(r.shapeFlag&6?Ei[Ei.indexOf(e)]=r:Ei.push(r)),r.patchFlag=-2,r}if(da(e)&&(e=e.__vccOpts),t){t=Ri(t);let{class:e,style:n}=t;e&&!_(e)&&(t.class=me(e)),y(n)&&(Rt(n)&&!f(n)&&(n=c({},n)),t.style=k(n))}let o=_(e)?1:bi(e)?128:Pn(e)?64:y(e)?4:g(e)?2:0;return Z(e,t,n,r,i,o,a,!0)}function Ri(e){return e?Rt(e)||qr(e)?c({},e):e:null}function zi(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Wi(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Pi(l),ref:t&&t.ref?n&&a?f(a)?a.concat(Fi(t)):[a,Fi(t)]:Fi(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==J?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zi(e.ssContent),ssFallback:e.ssFallback&&zi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&Rn(u,c.clone(u)),u}function Bi(e=` `,t=0){return Ii(Si,null,e,t)}function Q(e=``,t=!1){return t?(Y(),ji(Ci,null,e)):Ii(Ci,null,e)}function Vi(e){return e==null||typeof e==`boolean`?Ii(Ci):f(e)?Ii(J,null,e.slice()):Mi(e)?Hi(e):Ii(Si,null,String(e))}function Hi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:zi(e)}function Ui(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(f(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Ui(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!qr(t)?t._ctx=bn:r===3&&bn&&(bn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(g(t)){if(r&65){Ui(e,{default:t});return}t={default:t,_ctx:bn},n=32}else t=String(t),r&64?(n=16,t=[Bi(t)]):n=8;e.children=t,e.shapeFlag|=n}function Wi(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=me([t.class,r.class]));else if(e===`style`)t.style=k([t.style,r.style]);else if(o(e)){let n=t[e],i=r[e];i&&n!==i&&!(f(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!s(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Gi(e,t,n,r=null){tn(e,t,7,[n,r])}var Ki=kr(),qi=0;function Ji(e,t,r){let i=e.type,a=(t?t.appContext:e.appContext)||Ki,o={uid:qi++,vnode:e,type:i,parent:t,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Se(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(a.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:$r(i,a),emitsOptions:Ir(i,a),emit:null,emitted:null,propsDefaults:n,inheritAttrs:i.inheritAttrs,ctx:n,data:n,props:n,attrs:n,slots:n,refs:n,setupState:n,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Pr.bind(null,o),e.ce&&e.ce(o),o}var $=null,Yi=()=>$||bn,Xi,Zi;{let e=ue(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Xi=t(`__VUE_INSTANCE_SETTERS__`,e=>$=e),Zi=t(`__VUE_SSR_SETTERS__`,e=>ta=e)}var Qi=e=>{let t=$;return Xi(e),e.scope.on(),()=>{e.scope.off(),Xi(t)}},$i=()=>{$&&$.scope.off(),Xi(null)};function ea(e){return e.vnode.shapeFlag&4}var ta=!1;function na(e,t=!1,n=!1){t&&Zi(t);let{props:r,children:i}=e.vnode,a=ea(e);Jr(e,r,a,t),si(e,i,n||t);let o=a?ra(e,t):void 0;return t&&Zi(!1),o}function ra(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,pr);let{setup:r}=n;if(r){Be();let n=e.setupContext=r.length>1?la(e):null,i=Qi(e),a=en(r,e,0,[e.props,n]),o=b(a);if(Ve(),i(),(o||e.sp)&&!Wn(e)&&zn(e),o){if(a.then($i,$i),t)return a.then(n=>{Zi(!0);try{ia(e,n,t)}finally{Zi(!1)}}).catch(t=>{nn(t,e,0)});e.asyncDep=a}else ia(e,a,t)}else sa(e,t)}function ia(e,t,n){g(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:y(t)&&(e.setupState=Gt(t)),sa(e,n)}var aa,oa;function sa(e,t,n){let r=e.type;if(!e.render){if(!t&&aa&&!r.render){let t=r.template||br(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=aa(t,c(c({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||i,oa&&oa(e)}{let t=Qi(e);Be();try{gr(e)}finally{Ve(),t()}}}var ca={get(e,t){return B(e,`get`,``),e[t]}};function la(e){return{attrs:new Proxy(e.attrs,ca),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function ua(e){return e.exposed?e.exposeProxy||=new Proxy(Gt(zt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in dr)return dr[n](e)},has(e,t){return t in e||t in dr}}):e.proxy}function da(e){return g(e)&&`__vccOpts`in e}var fa=(e,t)=>qt(e,t,ta);function pa(e,t,n){try{ki(-1);let r=arguments.length;return r===2?y(t)&&!f(t)?Mi(t)?Ii(e,null,[t]):Ii(e,t):Ii(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Mi(n)&&(n=[n]),Ii(e,t,n))}finally{ki(1)}}var ma=`3.5.43`,ha=void 0,ga=typeof window<`u`&&window.trustedTypes;if(ga)try{ha=ga.createPolicy(`vue`,{createHTML:e=>e})}catch{}var _a=ha?e=>ha.createHTML(e):e=>e,va=`http://www.w3.org/2000/svg`,ya=`http://www.w3.org/1998/Math/MathML`,ba=typeof document<`u`?document:null,xa=ba&&ba.createElement(`template`),Sa={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?ba.createElementNS(va,e):t===`mathml`?ba.createElementNS(ya,e):n?ba.createElement(e,{is:n}):ba.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ba.createTextNode(e),createComment:e=>ba.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ba.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{xa.innerHTML=_a(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=xa.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ca=Symbol(`_vtc`);function wa(e,t,n){let r=e[Ca];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Ta=Symbol(`_vod`),Ea=Symbol(`_vsh`),Da=Symbol(``),Oa=/(?:^|;)\s*display\s*:/;function ka(e,t,n){let r=e.style,i=_(n),a=!1;if(n&&!i){if(t){if(_(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??ja(r,t,``)}else for(let e in t)n[e]??ja(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?ja(r,i,``):Fa(e,i,!_(t)&&t?t[i]:void 0,o)||ja(r,i,o)}}else if(i){if(t!==n){let e=r[Da];e&&(n+=`;`+e),r.cssText=n,a=Oa.test(n)}}else t&&e.removeAttribute(`style`);Ta in e&&(e[Ta]=a?r.display:``,e[Ea]&&(r.display=`none`))}var Aa=/\s*!important$/;function ja(e,t,n){if(f(n))n.forEach(n=>ja(e,t,n));else if(n??=``,t.startsWith(`--`))Aa.test(n)?e.setProperty(t,n.replace(Aa,``),`important`):e.setProperty(t,n);else{let r=Pa(e,t);Aa.test(n)?e.setProperty(E(r),n.replace(Aa,``),`important`):e[r]=n}}var Ma=[`Webkit`,`Moz`,`ms`],Na={};function Pa(e,t){let n=Na[t];if(n)return n;let r=T(t);if(r!==`filter`&&r in e)return Na[t]=r;r=ae(r);for(let n=0;n<Ma.length;n++){let i=Ma[n]+r;if(i in e)return Na[t]=i}return t}function Fa(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&_(r)&&n===r}var Ia=`http://www.w3.org/1999/xlink`;function La(e,t,n,r,i,a=j(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Ia,t.slice(6,t.length)):e.setAttributeNS(Ia,t,n):n==null||a&&!ge(n)?e.removeAttribute(t):e.setAttribute(t,a?``:v(n)?String(n):n)}function Ra(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?_a(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ge(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function za(e,t,n,r){e.addEventListener(t,n,r)}function Ba(e,t,n,r){e.removeEventListener(t,n,r)}var Va=Symbol(`_vei`);function Ha(e,t,n,r,i=null){let a=e[Va]||(e[Va]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Ga(t);r?za(e,n,a[t]=Ya(r,i),s):o&&(Ba(e,n,o,s),a[t]=void 0)}}var Ua=/(Once|Passive|Capture)$/,Wa=/^on:?(?:Once|Passive|Capture)$/;function Ga(e){let t,n;for(;(n=e.match(Ua))&&!Wa.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):E(e.slice(2)),t]}var Ka=0,qa=Promise.resolve(),Ja=()=>Ka||=(qa.then(()=>Ka=0),Date.now());function Ya(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(f(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&tn(e,t,5,a)}}else tn(r,t,5,[e])};return n.value=e,n.attached=Ja(),n}var Xa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Za=(e,t,n,r,i,a)=>{let c=i===`svg`;t===`class`?wa(e,r,c):t===`style`?ka(e,n,r):o(t)?s(t)||Ha(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Qa(e,t,r,c))?(Ra(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&La(e,t,r,c,a,t!==`value`)):e._isVueCE&&($a(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!_(r)))?Ra(e,T(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),La(e,t,r,c))};function Qa(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Xa(t)&&g(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Xa(t)&&_(n)?!1:t in e}function $a(e,t){let n=e._def.props;if(!n)return!1;let r=T(t);return Array.isArray(n)?n.some(e=>T(e)===r):Object.keys(n).some(e=>T(e)===r)}var eo=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return f(t)?e=>O(t,e):t};function to(e){e.target.composing=!0}function no(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var ro=Symbol(`_assign`),io=Symbol(`_initialValue`);function ao(e,t,n){return t&&(e=e.trim()),n&&(e=ce(e)),e}var oo={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[io]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[io]=e.defaultValue.replace(/\r\n?/g,`
4
+ `))),e[ro]=eo(i);let a=r||i.props&&i.props.type===`number`;za(e,t?`change`:`input`,t=>{t.target.composing||e[ro](ao(e.value,n,a))}),(n||a)&&za(e,`change`,()=>{e.value=ao(e.value,n,a)}),t||(za(e,`compositionstart`,to),za(e,`compositionend`,no),za(e,`change`,no))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[io];delete e[io],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[ro](ao(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[ro]=eo(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},so={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,za(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(uo(e)):uo(e)),r=e.multiple,i=r?m(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?f(i)?t.slice():t:i];try{e[ro](i)}finally{dn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[ro]=eo(r)},mounted(e,{value:t}){lo(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[ro]=eo(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!co(t,n[1],n[0]))&&lo(e,t)}};function co(e,t,n){if(!n||f(e))return P(e,t);if(m(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function lo(e,t){let n=e.multiple,r=f(t);if(!(n&&!r&&!m(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=uo(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):ye(t,o)>-1}else a.selected=t.has(o)}else if(P(uo(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function uo(e){return`_value`in e?e._value:e.value}var fo=[`ctrl`,`shift`,`alt`,`meta`],po={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>fo.some(n=>e[`${n}Key`]&&!t.includes(n))},mo=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=po[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ho=c({patchProp:Za},Sa),go;function _o(){return go||=ui(ho)}var vo=((...e)=>{let t=_o().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=bo(e);if(!r)return;let i=t._component;!g(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,yo(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function yo(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function bo(e){return _(e)?document.querySelector(e):e}var xo=new Set([`script`,`style`,`iframe`,`object`,`embed`,`form`,`input`,`textarea`,`button`,`select`,`option`,`link`,`meta`,`base`,`applet`,`noscript`,`noframes`]),So=new Set([`href`,`src`,`action`,`formaction`,`xlink:href`]);function Co(e){if(!e)return``;let t=new DOMParser().parseFromString(e,`text/html`);for(let e of xo){let n=t.body.getElementsByTagName(e);for(;n.length;)n[0].remove()}let n=t.body.querySelectorAll(`*`);for(let e=0;e<n.length;e++){let t=n[e],r=[...t.attributes];for(let e=0;e<r.length;e++){let n=r[e].name.toLowerCase();if(n.startsWith(`on`)){t.removeAttribute(r[e].name);continue}if(So.has(n)){let n=(r[e].value||``).replace(/[\s\u0000-\u001F]+/g,``).toLowerCase();(n.startsWith(`javascript:`)||n.startsWith(`vbscript:`)||n.startsWith(`data:`)&&!n.startsWith(`data:image/`))&&t.removeAttribute(r[e].name)}if(n===`style`){let n=(r[e].value||``).toLowerCase();(n.includes(`expression(`)||n.includes(`javascript:`)||n.includes(`url(`))&&t.removeAttribute(r[e].name)}}}return t.body.innerHTML}var wo=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},To={class:`guest-email-code space-y-2`,"aria-live":`polite`},Eo={key:0,class:`text-sm`},Do={key:1,class:`text-sm text-red-600`,role:`alert`},Oo={key:2,class:`block text-sm`},ko=[`value`],Ao=[`disabled`],jo=wo({__name:`GuestEmailCode`,props:{verification:{type:Object,required:!0}},emits:[`code`],setup(e){return(t,n)=>(Y(),X(`div`,To,[e.verification.state.message?(Y(),X(`p`,Eo,F(e.verification.state.message),1)):Q(``,!0),e.verification.state.error?(Y(),X(`p`,Do,F(e.verification.state.error),1)):Q(``,!0),e.verification.state.id?(Y(),X(`label`,Oo,[n[2]||=Bi(` Email verification code `,-1),Z(`input`,{value:e.verification.state.code,type:`text`,inputmode:`numeric`,autocomplete:`one-time-code`,maxlength:`8`,class:`mt-1 block w-full rounded-lg border border-gray-300 p-2 text-gray-900`,onInput:n[0]||=e=>t.$emit(`code`,e.target.value)},null,40,ko)])):Q(``,!0),e.verification.state.id?(Y(),X(`button`,{key:3,type:`button`,class:`text-sm underline`,disabled:e.verification.state.pending,onClick:n[1]||=t=>e.verification.send()},` Send a new code `,8,Ao)):Q(``,!0)]))}},[[`__scopeId`,`data-v-0e8356f7`]]);function Mo(e,t,n,r=()=>``){let i=jt({id:``,code:``,message:``,error:``,pending:!1}),a=0;function o(){a++,Object.assign(i,{id:``,code:``,message:``,error:``,pending:!1})}kn([e,r],o,{flush:`sync`}),we(o);async function s(){if(i.pending)return;o();let r=a;i.pending=!0;try{let o=await n(e(),t);if(r!==a)return;if(typeof o.verification_id!=`string`||!o.verification_id)throw Error(`Could not request a verification code.`);i.id=o.verification_id,i.message=`Check your email. Enter the 8-digit code to continue; it expires in 10 minutes.`}catch(e){r===a&&(i.error=e.message||`Could not request a verification code.`)}finally{r===a&&(i.pending=!1)}}async function c(){return i.id?(i.error=``,/^[0-9]{8}$/.test(i.code)?!0:(i.error=`Enter the 8-digit code from your email.`,!1)):(await s(),!1)}return{state:i,ready:c,send:s,reset:o,fields:()=>({verification_id:i.id,verification_code:i.code})}}function No(e){if(typeof window>`u`||new URL(e,window.location.href).origin!==window.location.origin)return{};let t=document.querySelector(`meta[name="csrf-token"]`)?.content;if(t)return{"X-CSRF-TOKEN":t};let n=document.cookie.split(`; `).find(e=>e.startsWith(`XSRF-TOKEN=`));if(!n)return{};try{return{"X-XSRF-TOKEN":decodeURIComponent(n.slice(11))}}catch{return{}}}var Po=[`aria-label`],Fo={key:0,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`},Io={key:1,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`},Lo={key:0,class:`esc-w-tabs`},Ro=[`onClick`],zo={class:`esc-w-body`},Bo={class:`esc-w-field`},Vo={key:0,class:`esc-w-spinner`},Ho={key:1},Uo=[`onClick`],Wo={key:2,class:`esc-w-empty`},Go={key:1,class:`esc-w-article-detail`},Ko={key:0,class:`esc-w-spinner`},qo=[`innerHTML`],Jo={key:0,class:`esc-w-success`},Yo={class:`esc-w-ref`},Xo={key:0,class:`esc-w-error`},Zo={class:`esc-w-field`},Qo={class:`esc-w-field`},$o={class:`esc-w-field`},es={class:`esc-w-field`},ts={key:0,class:`esc-w-field`},ns=[`value`],rs=[`disabled`],is={class:`esc-w-chat-avail`},as={key:0,class:`esc-w-error`},os={class:`esc-w-field`},ss={class:`esc-w-field`},cs={key:0,class:`esc-w-field`},ls=[`value`],us={class:`esc-w-field`},ds=[`disabled`],fs={class:`esc-w-chat-header-bar`},ps={class:`esc-w-chat-agent-info`},ms={key:0,class:`esc-w-chat-agent-avatar`},hs={key:1},gs={key:2},_s={class:`esc-w-chat-header-actions`},vs={id:`esc-chat-messages`,class:`esc-w-chat-messages`},ys={key:0,class:`esc-w-chat-avatar-sm`},bs={key:1,class:`esc-w-chat-avatar-sm esc-w-chat-avatar-agent`},xs={key:0,class:`esc-w-chat-typing`},Ss={key:1,class:`esc-w-empty`},Cs={class:`esc-w-chat-input-bar`},ws=[`disabled`],Ts={class:`esc-w-chat-rating`},Es=[`onClick`],Ds={class:`esc-w-field`},Os=[`disabled`],ks={key:0,class:`esc-w-error`},As={class:`esc-w-field`},js={class:`esc-w-field`},Ms={class:`esc-w-label`},Ns=[`disabled`],Ps={key:0,class:`esc-w-results`},Fs=[`onClick`],Is={class:`esc-w-status-card`},Ls={style:{display:`flex`,"justify-content":`space-between`,"align-items":`flex-start`,"margin-bottom":`8px`}},Rs={style:{"font-size":`12px`,color:`#6b7280`}},zs={key:0},Bs={key:0},Vs={style:{display:`flex`,"justify-content":`space-between`,"align-items":`center`}},Hs={class:`esc-w-reply-author`},Us={key:0,class:`esc-w-reply-agent`},Ws={class:`esc-w-reply-time`},Gs=[`innerHTML`],Ks={key:1,class:`esc-w-empty`},qs={__name:`EscalatedWidget`,props:{baseUrl:{type:String,default:``},widgetPath:{type:String,default:`/support/widget`},initialColor:{type:String,default:`#4F46E5`},initialPosition:{type:String,default:`bottom-right`},mode:{type:String,default:`launcher`},tabs:{type:Array,default:null},defaultTab:{type:String,default:null},department:{type:[String,Number],default:null},lockDepartment:{type:Boolean,default:!1},prefill:{type:Object,default:()=>({})},title:{type:String,default:`Support`},greeting:{type:String,default:null},openOnLoad:{type:Boolean,default:!1},hideLauncher:{type:Boolean,default:!1},metadata:{type:Object,default:()=>({})},metadataProvider:{type:Function,default:null}},setup(e,{expose:t}){let n=e,r=fa(()=>n.mode===`inline`),i=U(n.mode===`inline`||n.openOnLoad),a=U(n.defaultTab),o=U(``),s=U(null),c=fa(()=>s.value?.color||n.initialColor),l=fa(()=>s.value?.position||n.initialPosition),u=fa(()=>n.greeting||s.value?.greeting||`Hi there! How can we help?`),d=fa(()=>s.value?.departments||[]),f=fa(()=>s.value?.kb_enabled??!0),p=U(!1),m=fa(()=>{let e={help:f.value,contact:!0,chat:p.value,status:!0};return(n.tabs?.length?n.tabs:[`help`,`contact`,`chat`,`status`]).filter(t=>e[t])}),h=fa(()=>m.value.includes(a.value)?a.value:m.value[0]||null),g=U({name:n.prefill?.name||``,email:n.prefill?.email||``}),_=U(n.lockDepartment&&n.department!=null?n.department:null),v=U(n.department??``),y=fa(()=>_.value!=null),b=U({...n.metadata||{}}),x=U(``),S=U(`pre`),C=U(null),w=U([]),ee=U(null),te=U(null),ne=U(0),re=U(``),T=U(!1),ie=U(``),E=U(!1),ae=U(`disconnected`),oe=()=>({name:g.value.name,email:g.value.email,department_id:v.value,message:n.prefill?.message||``}),D=()=>({name:g.value.name,email:g.value.email,subject:n.prefill?.subject||``,description:n.prefill?.message||``,department_id:v.value}),O=U(oe()),se=U(!1),ce=null,le=null,ue=0,de=U(``),fe=U([]),pe=U(!1),A=U(null),he=U(!1),j=U(D()),ge=U(!1),_e=U(null),M=U({email:g.value.email,reference:``}),ve=U(!1),N=U(null),P=U([]),ye=0,be=!1,I=fa(()=>s.value?.guest_verification_required===!0),xe=()=>`${n.baseUrl}|${n.widgetPath}`,L=(e,t)=>z(`POST`,`/verification`,{email:e,purpose:t}),Se=Mo(()=>j.value.email,`ticket`,L,xe),Ce=Mo(()=>O.value.email,`chat`,L,xe),we=Mo(()=>M.value.email,`lookup`,L,xe);kn(()=>`${M.value.email}|${M.value.reference}`,()=>{P.value=[],N.value=null},{flush:`sync`}),kn(xe,()=>{ye++,Me(),clearTimeout(le),_e.value=null,P.value=[],N.value=null,Fe(),j.value=D(),M.value={email:g.value.email,reference:``},s.value=null,p.value=!1,o.value=``,Te()},{flush:`sync`});let R=null;async function z(e,t,r=null,i=null){let a=ye,o=`${n.baseUrl}${n.widgetPath}${t}`,s={method:e,headers:{Accept:`application/json`,"Content-Type":`application/json`,...No(o),...i?{Authorization:`Bearer ${i}`}:{}}};r&&(s.body=JSON.stringify(r));let c=await fetch(o,s),l=await c.json();if(be||a!==ye)throw Object.assign(Error(`Widget destination changed.`),{name:`AbortError`});if(!c.ok)throw Object.assign(Error(l.errors?Object.values(l.errors).flat().join(` `):l.message||`Request failed.`),{status:c.status,data:l});return l}async function Te(){let e=ye;try{s.value=await z(`GET`,`/config`)}catch{}if(!(be||e!==ye))try{let e=await z(`GET`,`/chat/availability`);p.value=e.available,x.value=e.message||``}catch{e===ye&&!be&&(p.value=!1)}}$n(Te);async function Ee(){let e=O.value.email;se.value=!0,o.value=``;try{if(I.value&&!await Ce.ready())return;let t=await z(`POST`,`/chat/start`,{name:O.value.name,email:O.value.email,department_id:O.value.department_id||null,message:O.value.message,...He(),...I.value?Ce.fields():{}});if(e!==O.value.email)return;C.value=t,Ce.reset(),S.value=`live`,w.value=t.messages||[],t.agent&&(te.value=t.agent),ae.value=`connected`,je()}catch(e){if(e.name===`AbortError`)return;e.data?.errors?o.value=Object.values(e.data.errors).flat().join(` `):o.value=e.data?.message||`Failed to start chat.`}finally{se.value=!1}}async function De(){if(!ie.value.trim()||E.value||!C.value)return;E.value=!0;let e=ie.value;ie.value=``,w.value.push({id:Date.now(),body:e,is_agent:!1,author:{name:O.value.name||`You`},created_at:new Date().toISOString()});try{await z(`POST`,`/chat/${C.value.id}/messages`,{body:e})}catch{o.value=`Failed to send message.`}finally{E.value=!1}}function Oe(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),De())}let ke=0;async function Ae(){if(!C.value)return;let e=Date.now();if(!(e-ke<3e3)){ke=e;try{await z(`POST`,`/chat/${C.value.id}/typing`)}catch{}}}function je(){Me(),ce=setInterval(async()=>{if(!C.value)return;let e=C.value.id;try{let t=await z(`GET`,`/chat/${C.value.id}/messages`);if(C.value?.id!==e)return;t.messages&&(w.value=t.messages),t.typing&&(ee.value=t.typing,clearTimeout(le),le=setTimeout(()=>{ee.value=null},4e3)),t.agent&&(te.value=t.agent),t.ended&&(S.value=`post`,Me()),ae.value=`connected`,ue=0}catch(t){if(t.name===`AbortError`||C.value?.id!==e)return;ue++,ue>3?ae.value=`disconnected`:ae.value=`reconnecting`}},3e3)}function Me(){ce&&=(clearInterval(ce),null)}rr(()=>{be=!0,Me(),clearTimeout(R),clearTimeout(le)});async function Ne(){if(!C.value)return;let e=C.value.id;try{await z(`POST`,`/chat/${C.value.id}/end`)}catch{}C.value?.id!==e||be||(S.value=`post`,Me())}async function Pe(){if(!C.value||!ne.value)return;let e=C.value.id;try{await z(`POST`,`/chat/${C.value.id}/rate`,{rating:ne.value,comment:re.value}),C.value?.id===e&&(T.value=!0)}catch(t){if(t.name===`AbortError`||C.value?.id!==e)return;o.value=`Failed to submit rating.`}}function Fe(){Me(),clearTimeout(le),ee.value=null,ue=0,S.value=`pre`,C.value=null,w.value=[],te.value=null,ne.value=0,re.value=``,T.value=!1,ie.value=``,ae.value=`disconnected`,O.value=oe()}function Ie(e){return(e||`U`).split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2)}kn(de,e=>{if(clearTimeout(R),!e||e.length<2){fe.value=[];return}R=setTimeout(async()=>{pe.value=!0,o.value=``;try{let t=await z(`GET`,`/articles?q=${encodeURIComponent(e)}`);fe.value=t.articles||[]}catch{fe.value=[]}finally{pe.value=!1}},300)});async function Le(e){he.value=!0,o.value=``;try{A.value=await z(`GET`,`/articles/${e}`)}catch{o.value=`Could not load article.`}finally{he.value=!1}}function Re(){A.value=null}async function ze(){let e=j.value.email;ge.value=!0,o.value=``;try{if(I.value&&!await Se.ready())return;let t=await z(`POST`,`/tickets`,{name:j.value.name,email:j.value.email,subject:j.value.subject,description:j.value.description,department_id:j.value.department_id||null,...He(),...I.value?Se.fields():{}});if(e!==j.value.email)return;_e.value=t,Se.reset(),j.value=D()}catch(e){if(e.name===`AbortError`)return;e.data?.errors?o.value=Object.values(e.data.errors).flat().join(` `):o.value=e.data?.message||`Failed to submit ticket.`}finally{ge.value=!1}}async function Be(){let e=`${M.value.email}|${M.value.reference}`;ve.value=!0,o.value=``,N.value=null;try{if(I.value){if(!await we.ready())return;let t=await z(`POST`,`/lookup`,{...M.value,...we.fields()});if(e!==`${M.value.email}|${M.value.reference}`)return;we.reset(),P.value=t.data||[],P.value.length===1&&await Ve(P.value[0]),P.value.length||(o.value=`No tickets matched that reference and email.`);return}let t=await z(`GET`,`/tickets/${encodeURIComponent(M.value.reference)}?email=${encodeURIComponent(M.value.email)}`);e===`${M.value.email}|${M.value.reference}`&&(N.value=t)}catch(e){if(e.name===`AbortError`)return;o.value=e.data?.message||`Ticket not found.`}finally{ve.value=!1}}async function Ve(e){let t=`${M.value.email}|${M.value.reference}`;o.value=``;try{let n=await z(`GET`,`/tickets/${encodeURIComponent(e.reference)}`,null,e.guest_access_token);t===`${M.value.email}|${M.value.reference}`&&(N.value=n)}catch(e){if(e.name===`AbortError`)return;o.value=e.data?.message||`The link has expired. Verify your email for a new one.`}}function He(){if(s.value?.accepts_metadata!==!0)return{};let e;try{e=n.metadataProvider?.()||{}}catch{e={}}let t={...b.value,...typeof e==`object`?e:{}};return t.page_url==null&&typeof window<`u`&&window.location?.origin&&(t.page_url=window.location.origin+window.location.pathname),{metadata:t}}let Ue={help:`Help`,contact:`Contact`,chat:`Chat`,status:`Check Status`};function We(e){a.value=e,o.value=``,e===`contact`&&(_e.value=null),e===`status`&&(N.value=null)}function Ge(){r.value||(i.value=!i.value,o.value=``)}function Ke(e=null){e&&(a.value=e),i.value=!0}function qe(){r.value||(i.value=!1)}function Je(e={}){g.value={name:e.name??g.value.name,email:e.email??g.value.email};for(let e of[j,O])e.value.name||(e.value.name=g.value.name),e.value.email||(e.value.email=g.value.email);M.value.email||(M.value.email=g.value.email)}function Ye(e={},{merge:t=!0}={}){b.value=t?{...b.value,...e}:{...e}}function Xe(e,{lock:t=!1}={}){v.value=e??``,_.value=t&&e!=null?e:null,j.value.department_id=v.value,O.value.department_id=v.value}t({open:Ke,close:qe,toggle:Ge,identify:Je,setMetadata:Ye,setDepartment:Xe});function B(e){try{return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return e}}return(t,n)=>(Y(),X(J,null,[!r.value&&!e.hideLauncher?(Y(),X(`button`,{key:0,class:me([`esc-w-fab`,l.value]),style:k({backgroundColor:c.value}),"aria-label":i.value?`Close support widget`:`Open support widget`,onClick:Ge},[i.value?(Y(),X(`svg`,Io,[...n[20]||=[Z(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`},null,-1)]])):(Y(),X(`svg`,Fo,[...n[19]||=[Z(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z`},null,-1),Z(`path`,{d:`M7 9h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z`},null,-1)]]))],14,Po)):Q(``,!0),Z(`div`,{class:me([`esc-w-panel`,r.value?[`esc-w-inline`,`esc-open`]:[l.value,{"esc-open":i.value}]]),style:k({"--esc-widget-color":c.value}),"data-widget-panel":``},[Z(`div`,{class:`esc-w-header`,style:k({backgroundColor:c.value})},[Z(`h2`,null,F(e.title),1),Z(`p`,null,F(u.value),1)],4),m.value.length>1?(Y(),X(`div`,Lo,[(Y(!0),X(J,null,lr(m.value,e=>(Y(),X(`button`,{key:e,class:me([`esc-w-tab`,{active:h.value===e}]),onClick:t=>We(e)},F(Ue[e]),11,Ro))),128))])):Q(``,!0),Z(`div`,zo,[h.value===`help`&&f.value?(Y(),X(J,{key:0},[A.value?(Y(),X(`div`,Go,[Z(`button`,{class:`esc-w-back`,onClick:Re},[...n[21]||=[Z(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`},[Z(`path`,{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`})],-1),Bi(` Back `,-1)]]),he.value?(Y(),X(`div`,Ko)):(Y(),X(J,{key:1},[Z(`h3`,null,F(A.value.title),1),Z(`div`,{class:`esc-w-article-body`,innerHTML:W(Co)(A.value.body)},null,8,qo)],64))])):(Y(),X(J,{key:0},[Z(`div`,Bo,[K(Z(`input`,{"onUpdate:modelValue":n[0]||=e=>de.value=e,type:`text`,class:`esc-w-input`,placeholder:`Search for help...`},null,512),[[oo,de.value]])]),pe.value?(Y(),X(`div`,Vo)):fe.value.length?(Y(),X(`div`,Ho,[(Y(!0),X(J,null,lr(fe.value,e=>(Y(),X(`div`,{key:e.slug,class:`esc-w-article`,onClick:t=>Le(e.slug)},[Z(`h4`,null,F(e.title),1),Z(`p`,null,F(e.excerpt),1)],8,Uo))),128))])):de.value.length>=2&&!pe.value?(Y(),X(`div`,Wo,` No articles found. `)):Q(``,!0)],64))],64)):Q(``,!0),h.value===`contact`?(Y(),X(J,{key:1},[_e.value?(Y(),X(`div`,Jo,[n[22]||=Z(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[Z(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z`})],-1),n[23]||=Z(`h4`,null,`Ticket Submitted`,-1),n[24]||=Z(`p`,null,`We'll get back to you shortly.`,-1),Z(`span`,Yo,F(_e.value.reference),1)])):(Y(),X(J,{key:1},[o.value?(Y(),X(`div`,Xo,F(o.value),1)):Q(``,!0),Z(`form`,{onSubmit:mo(ze,[`prevent`])},[Z(`div`,Zo,[n[25]||=Z(`label`,{class:`esc-w-label`},`Name`,-1),K(Z(`input`,{"onUpdate:modelValue":n[1]||=e=>j.value.name=e,type:`text`,class:`esc-w-input`,required:``},null,512),[[oo,j.value.name]])]),Z(`div`,Qo,[n[26]||=Z(`label`,{class:`esc-w-label`},`Email`,-1),K(Z(`input`,{"onUpdate:modelValue":n[2]||=e=>j.value.email=e,type:`email`,class:`esc-w-input`,required:``},null,512),[[oo,j.value.email]])]),Z(`div`,$o,[n[27]||=Z(`label`,{class:`esc-w-label`},`Subject`,-1),K(Z(`input`,{"onUpdate:modelValue":n[3]||=e=>j.value.subject=e,type:`text`,class:`esc-w-input`,required:``},null,512),[[oo,j.value.subject]])]),Z(`div`,es,[n[28]||=Z(`label`,{class:`esc-w-label`},`Description`,-1),K(Z(`textarea`,{"onUpdate:modelValue":n[4]||=e=>j.value.description=e,class:`esc-w-textarea`,required:``},null,512),[[oo,j.value.description]])]),d.value.length&&!y.value?(Y(),X(`div`,ts,[n[30]||=Z(`label`,{class:`esc-w-label`},`Department`,-1),K(Z(`select`,{"onUpdate:modelValue":n[5]||=e=>j.value.department_id=e,class:`esc-w-select`},[n[29]||=Z(`option`,{value:``},`Select a department...`,-1),(Y(!0),X(J,null,lr(d.value,e=>(Y(),X(`option`,{key:e.id,value:e.id},F(e.name),9,ns))),128))],512),[[so,j.value.department_id]])])):Q(``,!0),I.value?(Y(),ji(jo,{key:1,verification:W(Se),onCode:n[6]||=e=>W(Se).state.code=e},null,8,[`verification`])):Q(``,!0),Z(`button`,{type:`submit`,class:`esc-w-btn`,style:k({backgroundColor:c.value}),disabled:ge.value||W(Se).state.pending},F(ge.value?`Submitting...`:I.value&&!W(Se).state.id?`Send verification code`:`Submit Ticket`),13,rs)],32)],64))],64)):Q(``,!0),h.value===`chat`?(Y(),X(J,{key:2},[S.value===`pre`?(Y(),X(J,{key:0},[Z(`div`,is,[n[31]||=Z(`span`,{class:`esc-w-chat-dot-green`},null,-1),Bi(` `+F(x.value||`Chat with us — typically replies in under 2 min`),1)]),o.value?(Y(),X(`div`,as,F(o.value),1)):Q(``,!0),Z(`form`,{onSubmit:mo(Ee,[`prevent`])},[Z(`div`,os,[n[32]||=Z(`label`,{class:`esc-w-label`},`Name`,-1),K(Z(`input`,{"onUpdate:modelValue":n[7]||=e=>O.value.name=e,type:`text`,class:`esc-w-input`,required:``},null,512),[[oo,O.value.name]])]),Z(`div`,ss,[n[33]||=Z(`label`,{class:`esc-w-label`},`Email`,-1),K(Z(`input`,{"onUpdate:modelValue":n[8]||=e=>O.value.email=e,type:`email`,class:`esc-w-input`,required:``},null,512),[[oo,O.value.email]])]),d.value.length>1&&!y.value?(Y(),X(`div`,cs,[n[35]||=Z(`label`,{class:`esc-w-label`},`Department`,-1),K(Z(`select`,{"onUpdate:modelValue":n[9]||=e=>O.value.department_id=e,class:`esc-w-select`},[n[34]||=Z(`option`,{value:``},`Select a department...`,-1),(Y(!0),X(J,null,lr(d.value,e=>(Y(),X(`option`,{key:e.id,value:e.id},F(e.name),9,ls))),128))],512),[[so,O.value.department_id]])])):Q(``,!0),Z(`div`,us,[n[36]||=Z(`label`,{class:`esc-w-label`},`Message (optional)`,-1),K(Z(`textarea`,{"onUpdate:modelValue":n[10]||=e=>O.value.message=e,class:`esc-w-textarea`},null,512),[[oo,O.value.message]])]),I.value?(Y(),ji(jo,{key:1,verification:W(Ce),onCode:n[11]||=e=>W(Ce).state.code=e},null,8,[`verification`])):Q(``,!0),Z(`button`,{type:`submit`,class:`esc-w-btn`,style:k({backgroundColor:c.value}),disabled:se.value||W(Ce).state.pending},F(se.value?`Starting...`:I.value&&!W(Ce).state.id?`Send verification code`:`Start Chat`),13,ds)],32)],64)):S.value===`live`?(Y(),X(J,{key:1},[Z(`div`,fs,[Z(`div`,ps,[te.value?(Y(),X(`div`,ms,F(Ie(te.value.name)),1)):Q(``,!0),te.value?(Y(),X(`span`,hs,`Chatting with `+F(te.value.name),1)):(Y(),X(`span`,gs,`Waiting for agent...`))]),Z(`div`,_s,[Z(`span`,{class:me([`esc-w-chat-conn-dot`,`esc-w-chat-conn-`+ae.value])},null,2),Z(`button`,{class:`esc-w-chat-end-link`,onClick:Ne},`End`)])]),Z(`div`,vs,[(Y(!0),X(J,null,lr(w.value,e=>(Y(),X(`div`,{key:e.id,class:me([`esc-w-chat-bubble-row`,e.is_agent?`esc-w-chat-agent`:`esc-w-chat-customer`])},[e.is_agent?Q(``,!0):(Y(),X(`div`,ys,F(Ie(e.author?.name)),1)),Z(`div`,{class:me([`esc-w-chat-bubble`,e.is_agent?`esc-w-chat-bubble-agent`:`esc-w-chat-bubble-customer`]),style:k(e.is_agent?{backgroundColor:c.value}:{})},F(e.body),7),e.is_agent?(Y(),X(`div`,bs,F(Ie(e.author?.name)),1)):Q(``,!0)],2))),128)),ee.value?(Y(),X(`div`,xs,[n[37]||=Z(`span`,{class:`esc-w-chat-typing-dots`},[Z(`span`),Z(`span`),Z(`span`)],-1),Bi(` `+F(ee.value)+` is typing... `,1)])):Q(``,!0),!w.value.length&&!ee.value?(Y(),X(`div`,Ss,` Chat started — waiting for messages `)):Q(``,!0)]),Z(`div`,Cs,[K(Z(`input`,{"onUpdate:modelValue":n[12]||=e=>ie.value=e,type:`text`,class:`esc-w-chat-input`,placeholder:`Type a message...`,onKeydown:Oe,onInput:Ae},null,544),[[oo,ie.value]]),Z(`button`,{class:`esc-w-chat-send`,style:k({backgroundColor:c.value}),disabled:!ie.value.trim()||E.value,onClick:De},[...n[38]||=[Z(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`currentColor`},[Z(`path`,{d:`M2.01 21L23 12 2.01 3 2 10l15 2-15 2z`})],-1)]],12,ws)])],64)):S.value===`post`?(Y(),X(J,{key:2},[T.value?(Y(),X(J,{key:1},[n[41]||=Z(`div`,{class:`esc-w-success`},[Z(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[Z(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z`})]),Z(`h4`,null,`Thank you!`),Z(`p`,null,`Your feedback has been submitted.`)],-1),Z(`button`,{class:`esc-w-btn`,style:k({backgroundColor:c.value}),onClick:Fe},` Start New Chat `,4),Z(`button`,{class:`esc-w-back`,style:{"margin-top":`12px`},onClick:n[14]||=e=>a.value=`status`},`Close`)],64)):(Y(),X(J,{key:0},[n[40]||=Z(`div`,{class:`esc-w-success`},[Z(`h4`,null,`Chat Ended`),Z(`p`,null,`How was your experience?`)],-1),Z(`div`,Ts,[(Y(),X(J,null,lr(5,e=>Z(`button`,{key:e,class:me([`esc-w-chat-star`,ne.value>=e?`esc-w-chat-star-active`:``]),onClick:t=>ne.value=e},[...n[39]||=[Z(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,width:`28`,height:`28`},[Z(`path`,{d:`M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z`})],-1)]],10,Es)),64))]),Z(`div`,Ds,[K(Z(`textarea`,{"onUpdate:modelValue":n[13]||=e=>re.value=e,class:`esc-w-textarea`,placeholder:`Any additional feedback? (optional)`},null,512),[[oo,re.value]])]),Z(`button`,{class:`esc-w-btn`,style:k({backgroundColor:c.value}),disabled:!ne.value,onClick:Pe},` Submit Rating `,12,Os),Z(`button`,{class:`esc-w-back`,style:{"margin-top":`12px`},onClick:Fe},` Start New Chat `)],64))],64)):Q(``,!0)],64)):Q(``,!0),h.value===`status`?(Y(),X(J,{key:3},[o.value?(Y(),X(`div`,ks,F(o.value),1)):Q(``,!0),N.value?(Y(),X(J,{key:2},[Z(`button`,{class:`esc-w-back`,onClick:n[18]||=e=>{N.value=null,o.value=``}},[...n[43]||=[Z(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`},[Z(`path`,{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`})],-1),Bi(` Back `,-1)]]),Z(`div`,Is,[Z(`div`,Ls,[Z(`h4`,null,F(N.value.subject),1),Z(`span`,{class:`esc-w-status-badge`,style:k({backgroundColor:N.value.status_color})},F(N.value.status_label),5)]),Z(`div`,Rs,[Z(`span`,null,F(N.value.reference),1),N.value.department?(Y(),X(`span`,zs,` · `+F(N.value.department),1)):Q(``,!0),Z(`span`,null,` · `+F(B(N.value.created_at)),1)])]),N.value.replies?.length?(Y(),X(`div`,Bs,[(Y(!0),X(J,null,lr(N.value.replies,(e,t)=>(Y(),X(`div`,{key:t,class:`esc-w-reply`},[Z(`div`,Vs,[Z(`span`,null,[Z(`span`,Hs,F(e.author),1),e.is_agent?(Y(),X(`span`,Us,`Staff`)):Q(``,!0)]),Z(`span`,Ws,F(B(e.created_at)),1)]),Z(`div`,{class:`esc-w-reply-body`,innerHTML:W(Co)(e.body)},null,8,Gs)]))),128))])):(Y(),X(`div`,Ks,`No replies yet.`))],64)):(Y(),X(J,{key:1},[Z(`form`,{onSubmit:mo(Be,[`prevent`])},[Z(`div`,As,[n[42]||=Z(`label`,{class:`esc-w-label`},`Email Address`,-1),K(Z(`input`,{"onUpdate:modelValue":n[15]||=e=>M.value.email=e,type:`email`,class:`esc-w-input`,placeholder:`you@example.com`,required:``},null,512),[[oo,M.value.email]])]),Z(`div`,js,[Z(`label`,Ms,F(I.value?`Tracking or ticket reference`:`Ticket Reference`),1),K(Z(`input`,{"onUpdate:modelValue":n[16]||=e=>M.value.reference=e,type:`text`,class:`esc-w-input`,placeholder:`ESC-00001`,required:``},null,512),[[oo,M.value.reference]])]),I.value?(Y(),ji(jo,{key:0,verification:W(we),onCode:n[17]||=e=>W(we).state.code=e},null,8,[`verification`])):Q(``,!0),Z(`button`,{type:`submit`,class:`esc-w-btn`,style:k({backgroundColor:c.value}),disabled:ve.value||W(we).state.pending},F(ve.value?`Checking...`:I.value&&!W(we).state.id?`Send verification code`:`Check Status`),13,Ns)],32),P.value.length?(Y(),X(`ul`,Ps,[(Y(!0),X(J,null,lr(P.value,e=>(Y(),X(`li`,{key:e.reference},[Z(`button`,{type:`button`,class:`esc-w-back`,onClick:t=>Ve(e)},F(e.reference)+`: `+F(e.subject),9,Fs)]))),128))])):Q(``,!0)],64))],64)):Q(``,!0)])],6)],64))}},Js={help:`help`,kb:`help`,articles:`help`,contact:`contact`,ticket:`contact`,chat:`chat`,status:`status`};function Ys(e){return Js[String(e??``).trim().toLowerCase()]??null}function Xs(e){if(e==null||e===``)return null;let t=Array.isArray(e)?e:String(e).split(`,`),n=[...new Set(t.map(Ys).filter(Boolean))];return n.length?n:null}function Zs(e,t=!1){return e==null?t:typeof e==`boolean`?e:![`false`,`0`,`no`,`off`].includes(String(e).trim().toLowerCase())}function Qs(e){if(!e)return{};try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}function $s(e){let t={};for(let n of e?.attributes??[])n.name.startsWith(`data-meta-`)&&n.name.length>10&&(t[n.name.slice(10).replace(/-/g,`_`)]=n.value);return t}function ec(e,t){let n=e?.getAttribute(`src`);if(!n)return{};try{let e=new URL(n,t?.href),r=e.pathname.match(/^(.*\/widget)\/embed\.js$/);return r?{baseUrl:e.origin,widgetPath:r[1]}:{}}catch{return{}}}function tc(e,t={},n=globalThis.location){let r=t=>e?.getAttribute(`data-${t}`)??void 0,i=t&&typeof t==`object`?t:{},a=(e,t=e)=>r(e)??i[t],o=ec(e,n),s=a(`department`),c={...typeof i.metadata==`object`&&i.metadata?i.metadata:{},...Qs(r(`metadata`)),...$s(e)};return{baseUrl:r(`base-url`)??i.baseUrl??o.baseUrl??``,widgetPath:r(`widget-path`)??i.widgetPath??o.widgetPath??`/support/widget`,color:a(`color`)||`#4F46E5`,position:a(`position`)||`bottom-right`,mode:a(`mode`)===`inline`?`inline`:`launcher`,target:a(`target`)??null,tabs:Xs(a(`tabs`)),defaultTab:Ys(r(`tab`)??r(`default-tab`)??i.defaultTab),department:s===``||s==null?null:s,lockDepartment:Zs(a(`lock-department`,`lockDepartment`)),prefill:{name:a(`name`)??i.prefill?.name??``,email:a(`email`)??i.prefill?.email??``,subject:a(`subject`)??i.prefill?.subject??``,message:a(`message`)??i.prefill?.message??``},title:a(`title`)||`Support`,greeting:a(`greeting`)??null,openOnLoad:Zs(a(`open`,`openOnLoad`)),hideLauncher:Zs(a(`hide-launcher`,`hideLauncher`)),metadata:c,metadataProvider:typeof i.metadata==`function`?i.metadata:null}}function nc(e={}){let t={...tc(null,{}),...e};e.prefill&&(t.prefill={...tc(null,{}).prefill,...e.prefill});let n=t.mode===`inline`,r=typeof t.target==`string`?document.querySelector(t.target):t.target;if(n&&!r)return console.warn(`[Escalated] Inline widget target not found:`,t.target),null;let i=document.createElement(`div`);i.className=n?`escalated-widget-inline`:``,n||(i.id=`escalated-widget-host`),(n?r:document.body).appendChild(i);let a=i.attachShadow({mode:`open`}),o=document.createElement(`style`);o.textContent=ic()+(globalThis.__ESCALATED_WIDGET_CSS__||``),a.appendChild(o);let s=document.createElement(`div`);s.id=`escalated-widget-root`,a.appendChild(s);let c=U(null),l=vo({render:()=>pa(qs,{ref:c,baseUrl:t.baseUrl,widgetPath:t.widgetPath,initialColor:t.color,initialPosition:t.position,mode:t.mode,tabs:t.tabs,defaultTab:t.defaultTab,department:t.department,lockDepartment:t.lockDepartment,prefill:t.prefill,title:t.title,greeting:t.greeting,openOnLoad:t.openOnLoad,hideLauncher:t.hideLauncher,metadata:t.metadata,metadataProvider:t.metadataProvider})});return l.mount(s),{open:e=>c.value?.open(Ys(e)),close:()=>c.value?.close(),toggle:()=>c.value?.toggle(),identify:e=>c.value?.identify(e),setMetadata:(e,t)=>c.value?.setMetadata(e,t),setDepartment:(e,t)=>c.value?.setDepartment(e,t),destroy(){l.unmount(),i.remove()}}}function rc(){let e=window.EscalatedWidget;if(e&&e.__escalatedLoaded)return;let t=tc(document.currentScript||document.querySelector(`script[data-escalated-widget]`),e||{}),n=nc(t);window.EscalatedWidget=Object.assign(e&&typeof e==`object`?e:{},{__escalatedLoaded:!0,open:e=>n?.open(e),close:()=>n?.close(),toggle:()=>n?.toggle(),identify:e=>n?.identify(e),setMetadata:(e,t)=>n?.setMetadata(e,t),setDepartment:(e,t)=>n?.setDepartment(e,t),destroy:()=>n?.destroy(),mount:e=>nc({...t,...e})}),window.dispatchEvent(new window.CustomEvent(`escalated:widget-ready`,{detail:window.EscalatedWidget}))}typeof window<`u`&&!globalThis.__ESCALATED_WIDGET_NO_AUTOBOOT__&&(document.body?rc():document.addEventListener(`DOMContentLoaded`,rc,{once:!0}));function ic(){return`
5
+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
6
+ #escalated-widget-root {
7
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
8
+ font-size: 14px; line-height: 1.5; color: #1f2937; -webkit-font-smoothing: antialiased;
9
+ }
10
+ .esc-w-fab {
11
+ position: fixed; z-index: 2147483646; width: 56px; height: 56px;
12
+ border-radius: 50%; border: none; cursor: pointer;
13
+ display: flex; align-items: center; justify-content: center;
14
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
15
+ transition: transform 0.2s, box-shadow 0.2s; color: #fff;
16
+ }
17
+ .esc-w-fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
18
+ .esc-w-fab.bottom-right { bottom: 20px; right: 20px; }
19
+ .esc-w-fab.bottom-left { bottom: 20px; left: 20px; }
20
+ .esc-w-fab svg { width: 24px; height: 24px; fill: currentColor; }
21
+ .esc-w-panel {
22
+ position: fixed; z-index: 2147483647;
23
+ width: 380px; max-width: calc(100vw - 24px);
24
+ height: 560px; max-height: calc(100vh - 100px);
25
+ border-radius: 12px; background: #ffffff;
26
+ box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
27
+ display: flex; flex-direction: column; overflow: hidden;
28
+ transform: scale(0.95) translateY(10px); opacity: 0;
29
+ pointer-events: none; transition: transform 0.25s ease, opacity 0.25s ease;
30
+ }
31
+ .esc-w-panel.esc-open { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
32
+ .esc-w-panel.bottom-right { bottom: 84px; right: 20px; }
33
+ .esc-w-panel.bottom-left { bottom: 84px; left: 20px; }
34
+ @media (max-width: 440px) {
35
+ .esc-w-panel {
36
+ width: calc(100vw - 16px); height: calc(100vh - 80px);
37
+ max-height: calc(100vh - 80px); bottom: 8px !important;
38
+ right: 8px !important; left: 8px !important; border-radius: 10px;
39
+ }
40
+ }
41
+ .esc-w-header { padding: 16px 20px; color: #fff; flex-shrink: 0; }
42
+ .esc-w-header h2 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
43
+ .esc-w-header p { font-size: 13px; opacity: 0.9; }
44
+ .esc-w-tabs { display: flex; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; background: #f9fafb; }
45
+ .esc-w-tab {
46
+ flex: 1; padding: 10px 8px; font-size: 12px; font-weight: 500;
47
+ text-align: center; border: none; background: none; cursor: pointer;
48
+ color: #6b7280; border-bottom: 2px solid transparent;
49
+ transition: color 0.15s, border-color 0.15s;
50
+ }
51
+ .esc-w-tab:hover { color: #374151; }
52
+ .esc-w-tab.active { color: #1f2937; border-bottom-color: var(--esc-widget-color, #4F46E5); }
53
+ .esc-w-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
54
+ .esc-w-input {
55
+ width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
56
+ border-radius: 8px; font-size: 13px; outline: none;
57
+ transition: border-color 0.15s; background: #fff; color: #1f2937;
58
+ }
59
+ .esc-w-input:focus { border-color: var(--esc-widget-color, #4F46E5); box-shadow: 0 0 0 2px rgba(79,70,229,0.1); }
60
+ .esc-w-textarea {
61
+ width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
62
+ border-radius: 8px; font-size: 13px; outline: none;
63
+ resize: vertical; min-height: 80px; font-family: inherit;
64
+ transition: border-color 0.15s; background: #fff; color: #1f2937;
65
+ }
66
+ .esc-w-textarea:focus { border-color: var(--esc-widget-color, #4F46E5); box-shadow: 0 0 0 2px rgba(79,70,229,0.1); }
67
+ .esc-w-select {
68
+ width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
69
+ border-radius: 8px; font-size: 13px; outline: none;
70
+ background: #fff; color: #1f2937; cursor: pointer;
71
+ }
72
+ .esc-w-select:focus { border-color: var(--esc-widget-color, #4F46E5); }
73
+ .esc-w-label { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; }
74
+ .esc-w-field { margin-bottom: 12px; }
75
+ .esc-w-btn {
76
+ width: 100%; padding: 10px 16px; border: none; border-radius: 8px;
77
+ font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; transition: opacity 0.15s;
78
+ }
79
+ .esc-w-btn:hover { opacity: 0.9; }
80
+ .esc-w-btn:disabled { opacity: 0.5; cursor: not-allowed; }
81
+ .esc-w-article { padding: 10px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
82
+ .esc-w-article:last-child { border-bottom: none; }
83
+ .esc-w-article:hover { background: #f9fafb; margin: 0 -20px; padding: 10px 20px; }
84
+ .esc-w-article h4 { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 2px; }
85
+ .esc-w-article p { font-size: 12px; color: #6b7280; }
86
+ .esc-w-back {
87
+ display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
88
+ color: #6b7280; cursor: pointer; margin-bottom: 12px;
89
+ background: none; border: none; padding: 0;
90
+ }
91
+ .esc-w-back:hover { color: #374151; }
92
+ .esc-w-article-detail h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #1f2937; }
93
+ .esc-w-article-detail .esc-w-article-body { font-size: 13px; line-height: 1.7; color: #374151; }
94
+ .esc-w-article-detail .esc-w-article-body p { margin-bottom: 8px; }
95
+ .esc-w-article-detail .esc-w-article-body a { color: var(--esc-widget-color, #4F46E5); }
96
+ .esc-w-success { text-align: center; padding: 24px 0; }
97
+ .esc-w-success svg { width: 48px; height: 48px; color: #10b981; margin: 0 auto 12px; }
98
+ .esc-w-success h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
99
+ .esc-w-success p { font-size: 13px; color: #6b7280; }
100
+ .esc-w-success .esc-w-ref {
101
+ display: inline-block; margin-top: 8px; padding: 4px 12px;
102
+ background: #f0fdf4; border-radius: 6px; font-size: 14px; font-weight: 600; color: #059669;
103
+ }
104
+ .esc-w-status-card { padding: 16px; border-radius: 10px; border: 1px solid #e5e7eb; margin-bottom: 12px; }
105
+ .esc-w-status-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
106
+ .esc-w-status-badge {
107
+ display: inline-block; padding: 2px 8px; border-radius: 12px;
108
+ font-size: 11px; font-weight: 600; color: #fff;
109
+ }
110
+ .esc-w-reply { padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
111
+ .esc-w-reply:last-child { border-bottom: none; }
112
+ .esc-w-reply-author { font-size: 12px; font-weight: 600; color: #374151; }
113
+ .esc-w-reply-agent {
114
+ font-size: 10px; padding: 1px 6px; background: #eff6ff;
115
+ color: #3b82f6; border-radius: 4px; margin-left: 4px;
116
+ }
117
+ .esc-w-reply-time { font-size: 11px; color: #9ca3af; }
118
+ .esc-w-reply-body { font-size: 13px; color: #374151; margin-top: 4px; line-height: 1.6; }
119
+ .esc-w-error {
120
+ padding: 8px 12px; background: #fef2f2; border: 1px solid #fecaca;
121
+ border-radius: 8px; font-size: 12px; color: #dc2626; margin-bottom: 12px;
122
+ }
123
+ .esc-w-empty { text-align: center; padding: 24px 0; color: #9ca3af; font-size: 13px; }
124
+ .esc-w-chat-avail {
125
+ display: flex; align-items: center; gap: 8px; padding: 10px 14px;
126
+ background: #f0fdf4; border-radius: 8px; font-size: 13px; color: #166534; margin-bottom: 16px;
127
+ }
128
+ .esc-w-chat-dot-green {
129
+ width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
130
+ }
131
+ .esc-w-chat-header-bar {
132
+ display: flex; justify-content: space-between; align-items: center;
133
+ padding: 8px 0; margin-bottom: 8px; border-bottom: 1px solid #e5e7eb;
134
+ }
135
+ .esc-w-chat-agent-info { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #1f2937; }
136
+ .esc-w-chat-agent-avatar {
137
+ width: 28px; height: 28px; border-radius: 50%; background: var(--esc-widget-color, #4F46E5);
138
+ color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
139
+ }
140
+ .esc-w-chat-header-actions { display: flex; align-items: center; gap: 8px; }
141
+ .esc-w-chat-conn-dot { width: 6px; height: 6px; border-radius: 50%; }
142
+ .esc-w-chat-conn-connected { background: #22c55e; }
143
+ .esc-w-chat-conn-reconnecting { background: #eab308; }
144
+ .esc-w-chat-conn-disconnected { background: #ef4444; }
145
+ .esc-w-chat-end-link { background: none; border: none; color: #6b7280; font-size: 12px; cursor: pointer; }
146
+ .esc-w-chat-end-link:hover { color: #ef4444; }
147
+ .esc-w-chat-messages {
148
+ flex: 1; overflow-y: auto; max-height: 280px; min-height: 120px;
149
+ padding: 8px 0; display: flex; flex-direction: column; gap: 6px;
150
+ }
151
+ .esc-w-chat-bubble-row { display: flex; align-items: flex-end; gap: 6px; }
152
+ .esc-w-chat-bubble-row.esc-w-chat-agent { flex-direction: row-reverse; }
153
+ .esc-w-chat-bubble-row.esc-w-chat-customer { flex-direction: row; }
154
+ .esc-w-chat-avatar-sm {
155
+ width: 24px; height: 24px; border-radius: 50%; background: #e5e7eb;
156
+ display: flex; align-items: center; justify-content: center;
157
+ font-size: 9px; font-weight: 700; color: #6b7280; flex-shrink: 0;
158
+ }
159
+ .esc-w-chat-avatar-agent { background: var(--esc-widget-color, #4F46E5); color: #fff; }
160
+ .esc-w-chat-bubble {
161
+ max-width: 75%; padding: 8px 12px; border-radius: 16px; font-size: 13px; line-height: 1.5; word-break: break-word;
162
+ }
163
+ .esc-w-chat-bubble-customer { background: #f3f4f6; color: #1f2937; border-bottom-left-radius: 4px; }
164
+ .esc-w-chat-bubble-agent { color: #fff; border-bottom-right-radius: 4px; }
165
+ .esc-w-chat-typing { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9ca3af; padding: 4px 0; }
166
+ .esc-w-chat-typing-dots { display: inline-flex; gap: 3px; }
167
+ .esc-w-chat-typing-dots span {
168
+ width: 5px; height: 5px; border-radius: 50%; background: #9ca3af;
169
+ animation: esc-chat-bounce 1.4s infinite both;
170
+ }
171
+ .esc-w-chat-typing-dots span:nth-child(2) { animation-delay: 0.16s; }
172
+ .esc-w-chat-typing-dots span:nth-child(3) { animation-delay: 0.32s; }
173
+ @keyframes esc-chat-bounce {
174
+ 0%, 80%, 100% { transform: scale(0); }
175
+ 40% { transform: scale(1); }
176
+ }
177
+ .esc-w-chat-input-bar {
178
+ display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; margin-top: 8px;
179
+ }
180
+ .esc-w-chat-input {
181
+ flex: 1; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 20px;
182
+ font-size: 13px; outline: none; background: #fff; color: #1f2937;
183
+ }
184
+ .esc-w-chat-input:focus { border-color: var(--esc-widget-color, #4F46E5); }
185
+ .esc-w-chat-send {
186
+ width: 36px; height: 36px; border-radius: 50%; border: none; color: #fff;
187
+ display: flex; align-items: center; justify-content: center; cursor: pointer;
188
+ transition: opacity 0.15s; flex-shrink: 0;
189
+ }
190
+ .esc-w-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
191
+ .esc-w-chat-rating { display: flex; justify-content: center; gap: 4px; margin: 12px 0; }
192
+ .esc-w-chat-star { background: none; border: none; cursor: pointer; color: #d1d5db; padding: 2px; transition: color 0.15s; }
193
+ .esc-w-chat-star:hover, .esc-w-chat-star-active { color: #f59e0b; }
194
+ .esc-w-chat-star svg { width: 28px; height: 28px; }
195
+ .esc-w-spinner {
196
+ width: 20px; height: 20px; border: 2px solid #e5e7eb;
197
+ border-top-color: var(--esc-widget-color, #4F46E5);
198
+ border-radius: 50%; animation: esc-spin 0.6s linear infinite; margin: 24px auto;
199
+ }
200
+ @keyframes esc-spin { to { transform: rotate(360deg); } }
201
+ .esc-w-panel.esc-w-inline {
202
+ position: relative; inset: auto; z-index: auto; width: 100%; max-width: none;
203
+ height: auto; min-height: 420px; max-height: none;
204
+ transform: none; opacity: 1; pointer-events: auto; transition: none;
205
+ box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #e5e7eb;
206
+ }
207
+ .esc-w-panel.esc-w-inline .esc-w-body { overflow: visible; }
208
+ .esc-w-panel.esc-w-inline .esc-w-chat-messages { max-height: 360px; }
209
+ @media (max-width: 440px) {
210
+ .esc-w-panel.esc-w-inline {
211
+ width: 100%; height: auto; max-height: none; border-radius: 12px;
212
+ bottom: auto !important; right: auto !important; left: auto !important;
213
+ }
214
+ }
215
+ `}return e.mountEscalatedWidget=nc,e})({});