@walker-di/fortalece-ai-sdk 0.3.18 → 0.3.19
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/CHANGELOG.md +6 -0
- package/dist/fortalece-ai-sdk.iife.js +2 -2
- package/dist/fortalece-ai-sdk.js +235 -235
- package/dist/fortalece-ai-sdk.umd.cjs +2 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(b,Dt){typeof exports=="object"&&typeof module<"u"?Dt(exports):typeof define=="function"&&define.amd?define(["exports"],Dt):(b=typeof globalThis<"u"?globalThis:b||self,Dt(b.FortaleceAI={}))})(this,(function(b){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const _i=1,bi=2,wi=16,yi=1,$i=2,tr="[",Lt="[!",hn="]",ct={},B=Symbol(),Si="http://www.w3.org/1999/xhtml",pn=!1;var nr=Array.isArray,ki=Array.prototype.indexOf,ut=Array.prototype.includes,Pt=Array.from,Ft=Object.keys,Nt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,Ei=Object.getOwnPropertyDescriptors,xi=Object.prototype,Ci=Array.prototype,rr=Object.getPrototypeOf,ir=Object.isExtensible;function Ai(e){for(var t=0;t<e.length;t++)e[t]()}function sr(){var e,t,n=new Promise((r,i)=>{e=r,t=i});return{promise:n,resolve:e,reject:t}}const H=2,Ut=4,jt=8,ar=1<<24,Me=16,_e=32,Be=64,vn=128,fe=512,U=1024,W=2048,be=4096,ie=8192,Ie=16384,Bt=32768,dt=65536,or=1<<17,lr=1<<18,Qe=1<<19,Ti=1<<20,He=1<<25,et=32768,gn=1<<21,mn=1<<22,We=1<<23,Ht=Symbol("$state"),zi=Symbol("legacy props"),Ri=Symbol(""),ht=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Wt=3,pt=8;function Mi(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ii(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Oi(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Di(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Li(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Pi(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Fi(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ni(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ui(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ji(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Bi(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function qt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Hi(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let x=!1;function Oe(e){x=e}let E;function se(e){if(e===null)throw qt(),ct;return E=e}function Vt(){return se(xe(E))}function R(e){if(x){if(xe(E)!==null)throw qt(),ct;E=e}}function _n(e=1){if(x){for(var t=e,n=E;t--;)n=xe(n);E=n}}function Gt(e=!0){for(var t=0,n=E;;){if(n.nodeType===pt){var r=n.data;if(r===hn){if(t===0)return n;t-=1}else(r===tr||r===Lt)&&(t+=1)}var i=xe(n);e&&n.remove(),n=i}}function cr(e){if(!e||e.nodeType!==pt)throw qt(),ct;return e.data}function ur(e){return e===this.v}function Wi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function fr(e){return!Wi(e,this.v)}let qi=!1,ae=null;function vt(e){ae=e}function bn(e,t=!1,n){ae={p:ae,i:!1,c:null,e:null,s:e,x:null,l:null}}function wn(e){var t=ae,n=t.e;if(n!==null){t.e=null;for(var r of n)Dr(r)}return e!==void 0&&(t.x=e),t.i=!0,ae=t.p,e??{}}function dr(){return!0}let tt=[];function hr(){var e=tt;tt=[],Ai(e)}function nt(e){if(tt.length===0&&!$t){var t=tt;queueMicrotask(()=>{t===tt&&hr()})}tt.push(e)}function Vi(){for(;tt.length>0;)hr()}function pr(e){var t=C;if(t===null)return k.f|=We,e;if((t.f&Bt)===0){if((t.f&vn)===0)throw e;t.b.error(e)}else gt(e,t)}function gt(e,t){for(;t!==null;){if((t.f&vn)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e}const Gi=-7169;function N(e,t){e.f=e.f&Gi|t}function yn(e){(e.f&fe)!==0||e.deps===null?N(e,U):N(e,be)}function vr(e){if(e!==null)for(const t of e)(t.f&H)===0||(t.f&et)===0||(t.f^=et,vr(t.deps))}function gr(e,t,n){(e.f&W)!==0?t.add(e):(e.f&be)!==0&&n.add(e),vr(e.deps),N(e,U)}const Kt=new Set;let D=null,we=null,oe=[],Jt=null,$n=!1,$t=!1;class De{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#a=0;#o=null;#i=new Set;#r=new Set;#s=new Map;is_fork=!1;#l=!1;is_deferred(){return this.is_fork||this.#a>0}skip_effect(t){this.#s.has(t)||this.#s.set(t,{d:[],m:[]})}unskip_effect(t){var n=this.#s.get(t);if(n){this.#s.delete(t);for(var r of n.d)N(r,W),ye(r);for(r of n.m)N(r,be),ye(r)}}process(t){oe=[],this.apply();var n=[],r=[];for(const i of t)this.#c(i,n,r);if(this.is_deferred()){this.#f(r),this.#f(n);for(const[i,s]of this.#s)yr(i,s)}else{for(const i of this.#e)i();this.#e.clear(),this.#n===0&&this.#u(),D=null,_r(r),_r(n),this.#o?.resolve()}we=null}#c(t,n,r){t.f^=U;for(var i=t.first,s=null;i!==null;){var a=i.f,o=(a&(_e|Be))!==0,l=o&&(a&U)!==0,u=l||(a&ie)!==0||this.#s.has(i);if(!u&&i.fn!==null){o?i.f^=U:s!==null&&(a&(Ut|jt|ar))!==0?s.b.defer_effect(i):(a&Ut)!==0?n.push(i):kt(i)&&((a&Me)!==0&&this.#r.add(i),Et(i));var f=i.first;if(f!==null){i=f;continue}}var d=i.parent;for(i=i.next;i===null&&d!==null;)d===s&&(s=null),i=d.next,d=d.parent}}#f(t){for(var n=0;n<t.length;n+=1)gr(t[n],this.#i,this.#r)}capture(t,n){n!==B&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&We)===0&&(this.current.set(t,t.v),we?.set(t,t.v))}activate(){D=this,this.apply()}deactivate(){D===this&&(D=null,we=null)}flush(){if(this.activate(),oe.length>0){if(mr(),D!==null&&D!==this)return}else this.#n===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#t)t(this);this.#t.clear()}#u(){if(Kt.size>1){this.previous.clear();var t=we,n=!0;for(const i of Kt){if(i===this){n=!1;continue}const s=[];for(const[o,l]of this.current){if(i.current.has(o))if(n&&l!==i.current.get(o))i.current.set(o,l);else continue;s.push(o)}if(s.length===0)continue;const a=[...i.current.keys()].filter(o=>!this.current.has(o));if(a.length>0){var r=oe;oe=[];const o=new Set,l=new Map;for(const u of s)br(u,a,o,l);if(oe.length>0){D=i,i.apply();for(const u of oe)i.#c(u,[],[]);i.deactivate()}oe=r}}D=null,we=t}this.committed=!0,Kt.delete(this)}increment(t){this.#n+=1,t&&(this.#a+=1)}decrement(t){this.#n-=1,t&&(this.#a-=1),!this.#l&&(this.#l=!0,nt(()=>{this.#l=!1,this.is_deferred()?oe.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#i)this.#r.delete(t),N(t,W),ye(t);for(const t of this.#r)N(t,be),ye(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#t.add(t)}settled(){return(this.#o??=sr()).promise}static ensure(){if(D===null){const t=D=new De;Kt.add(D),$t||nt(()=>{D===t&&t.flush()})}return D}apply(){}}function G(e){var t=$t;$t=!0;try{for(var n;;){if(Vi(),oe.length===0&&(D?.flush(),oe.length===0))return Jt=null,n;mr()}}finally{$t=t}}function mr(){$n=!0;var e=null;try{for(var t=0;oe.length>0;){var n=De.ensure();if(t++>1e3){var r,i;Ki()}n.process(oe),qe.clear()}}finally{$n=!1,Jt=null}}function Ki(){try{Pi()}catch(e){gt(e,Jt)}}let Le=null;function _r(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(Ie|ie))===0&&kt(r)&&(Le=new Set,Et(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?Nr(r):r.fn=null),Le?.size>0)){qe.clear();for(const i of Le){if((i.f&(Ie|ie))!==0)continue;const s=[i];let a=i.parent;for(;a!==null;)Le.has(a)&&(Le.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){const l=s[o];(l.f&(Ie|ie))===0&&Et(l)}}Le.clear()}}Le=null}}function br(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;(s&H)!==0?br(i,t,n,r):(s&(mn|Me))!==0&&(s&W)===0&&wr(i,t,r)&&(N(i,W),ye(i))}}function wr(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(ut.call(t,i))return!0;if((i.f&H)!==0&&wr(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function ye(e){for(var t=Jt=e;t.parent!==null;){t=t.parent;var n=t.f;if($n&&t===C&&(n&Me)!==0&&(n&lr)===0)return;if((n&(Be|_e))!==0){if((n&U)===0)return;t.f^=U}}oe.push(t)}function yr(e,t){if(!((e.f&_e)!==0&&(e.f&U)!==0)){(e.f&W)!==0?t.d.push(e):(e.f&be)!==0&&t.m.push(e),N(e,U);for(var n=e.first;n!==null;)yr(n,t),n=n.next}}function Ji(e){let t=0,n=rt(0),r;return()=>{An()&&(c(n),Tn(()=>(t===0&&(r=Mn(()=>e(()=>St(n)))),t+=1,()=>{nt(()=>{t-=1,t===0&&(r?.(),r=void 0,St(n))})})))}}var Yi=dt|Qe|vn;function Zi(e,t,n){new Xi(e,t,n)}class Xi{parent;is_pending=!1;#e;#t=x?E:null;#n;#a;#o;#i=null;#r=null;#s=null;#l=null;#c=null;#f=0;#u=0;#p=!1;#h=!1;#v=new Set;#g=new Set;#d=null;#y=Ji(()=>(this.#d=rt(this.#f),()=>{this.#d=null}));constructor(t,n,r){this.#e=t,this.#n=n,this.#a=r,this.parent=C.b,this.is_pending=!!this.#n.pending,this.#o=zn(()=>{if(C.b=this,x){const s=this.#t;Vt(),s.nodeType===pt&&s.data===Lt?this.#S():(this.#$(),this.#u===0&&(this.is_pending=!1))}else{var i=this.#b();try{this.#i=de(()=>r(i))}catch(s){this.error(s)}this.#u>0?this.#_():this.is_pending=!1}return()=>{this.#c?.remove()}},Yi),x&&(this.#e=E)}#$(){try{this.#i=de(()=>this.#a(this.#e))}catch(t){this.error(t)}}#S(){const t=this.#n.pending;t&&(this.#r=de(()=>t(this.#e)),nt(()=>{var n=this.#b();this.#i=this.#m(()=>(De.ensure(),de(()=>this.#a(n)))),this.#u>0?this.#_():(it(this.#r,()=>{this.#r=null}),this.is_pending=!1)}))}#b(){var t=this.#e;return this.is_pending&&(this.#c=Se(),this.#e.before(this.#c),t=this.#c),t}defer_effect(t){gr(t,this.#v,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#m(t){var n=C,r=k,i=ae;Ae(this.#o),he(this.#o),vt(this.#o.ctx);try{return t()}catch(s){return pr(s),null}finally{Ae(n),he(r),vt(i)}}#_(){const t=this.#n.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),Br(this.#i,this.#l)),this.#r===null&&(this.#r=de(()=>t(this.#e)))}#w(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(t);return}if(this.#u+=t,this.#u===0){this.is_pending=!1;for(const n of this.#v)N(n,W),ye(n);for(const n of this.#g)N(n,be),ye(n);this.#v.clear(),this.#g.clear(),this.#r&&it(this.#r,()=>{this.#r=null}),this.#l&&(this.#e.before(this.#l),this.#l=null)}}update_pending_count(t){this.#w(t),this.#f+=t,!(!this.#d||this.#p)&&(this.#p=!0,nt(()=>{this.#p=!1,this.#d&&mt(this.#d,this.#f)}))}get_effect_pending(){return this.#y(),c(this.#d)}error(t){var n=this.#n.onerror;let r=this.#n.failed;if(this.#h||!n&&!r)throw t;this.#i&&(Y(this.#i),this.#i=null),this.#r&&(Y(this.#r),this.#r=null),this.#s&&(Y(this.#s),this.#s=null),x&&(se(this.#t),_n(),se(Gt()));var i=!1,s=!1;const a=()=>{if(i){Hi();return}i=!0,s&&Bi(),De.ensure(),this.#f=0,this.#s!==null&&it(this.#s,()=>{this.#s=null}),this.is_pending=this.has_pending_snippet(),this.#i=this.#m(()=>(this.#h=!1,de(()=>this.#a(this.#e)))),this.#u>0?this.#_():this.is_pending=!1};nt(()=>{try{s=!0,n?.(t,a),s=!1}catch(o){gt(o,this.#o&&this.#o.parent)}r&&(this.#s=this.#m(()=>{De.ensure(),this.#h=!0;try{return de(()=>{r(this.#e,()=>t,()=>a)})}catch(o){return gt(o,this.#o.parent),null}finally{this.#h=!1}}))})}}function Qi(e,t,n,r){const i=Yt;var s=e.filter(h=>!h.settled);if(n.length===0&&s.length===0){r(t.map(i));return}var a=D,o=C,l=es(),u=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(h=>h.promise)):null;function f(h){l();try{r(h)}catch(g){(o.f&Ie)===0&>(g,o)}a?.deactivate(),Sn()}if(n.length===0){u.then(()=>f(t.map(i)));return}function d(){l(),Promise.all(n.map(h=>ts(h))).then(h=>f([...t.map(i),...h])).catch(h=>gt(h,o))}u?u.then(d):d()}function es(){var e=C,t=k,n=ae,r=D;return function(s=!0){Ae(e),he(t),vt(n),s&&r?.activate()}}function Sn(){Ae(null),he(null),vt(null)}function Yt(e){var t=H|W,n=k!==null&&(k.f&H)!==0?k:null;return C!==null&&(C.f|=Qe),{ctx:ae,deps:null,effects:null,equals:ur,f:t,fn:e,reactions:null,rv:0,v:B,wv:0,parent:n??C,ac:null}}function ts(e,t,n){let r=C;r===null&&Ii();var i=r.b,s=void 0,a=rt(B),o=!k,l=new Map;return us(()=>{var u=sr();s=u.promise;try{Promise.resolve(e()).then(u.resolve,u.reject).then(()=>{f===D&&f.committed&&f.deactivate(),Sn()})}catch(g){u.reject(g),Sn()}var f=D;if(o){var d=i.is_rendered();i.update_pending_count(1),f.increment(d),l.get(f)?.reject(ht),l.delete(f),l.set(f,u)}const h=(g,p=void 0)=>{if(f.activate(),p)p!==ht&&(a.f|=We,mt(a,p));else{(a.f&We)!==0&&(a.f^=We),mt(a,g);for(const[_,I]of l){if(l.delete(_),_===f)break;I.reject(ht)}}o&&(i.update_pending_count(-1),f.decrement(d))};u.promise.then(h,g=>h(null,g||"unknown"))}),os(()=>{for(const u of l.values())u.reject(ht)}),new Promise(u=>{function f(d){function h(){d===s?u(a):f(s)}d.then(h,h)}f(s)})}function $e(e){const t=Yt(e);return Wr(t),t}function ns(e){const t=Yt(e);return t.equals=fr,t}function $r(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Y(t[n])}}function rs(e){for(var t=e.parent;t!==null;){if((t.f&H)===0)return(t.f&Ie)===0?t:null;t=t.parent}return null}function kn(e){var t,n=C;Ae(rs(e));try{e.f&=~et,$r(e),t=Jr(e)}finally{Ae(n)}return t}function Sr(e){var t=kn(e);if(!e.equals(t)&&(e.wv=Gr(),(!D?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){N(e,U);return}Ge||(we!==null?(An()||D?.is_fork)&&we.set(e,t):yn(e))}let En=new Set;const qe=new Map;let kr=!1;function rt(e,t){var n={f:0,v:e,reactions:null,equals:ur,rv:0,wv:0};return n}function T(e,t){const n=rt(e);return Wr(n),n}function Er(e,t=!1,n=!0){const r=rt(e);return t||(r.equals=fr),r}function m(e,t,n=!1){k!==null&&(!ke||(k.f&or)!==0)&&dr()&&(k.f&(H|Me|mn|or))!==0&&(pe===null||!ut.call(pe,e))&&ji();let r=n?Pe(t):t;return mt(e,r)}function mt(e,t){if(!e.equals(t)){var n=e.v;Ge?qe.set(e,t):qe.set(e,n),e.v=t;var r=De.ensure();if(r.capture(e,n),(e.f&H)!==0){const i=e;(e.f&W)!==0&&kn(i),yn(i)}e.wv=Gr(),xr(e,W),C!==null&&(C.f&U)!==0&&(C.f&(_e|Be))===0&&(ve===null?hs([e]):ve.push(e)),!r.is_fork&&En.size>0&&!kr&&is()}return t}function is(){kr=!1;for(const e of En)(e.f&U)!==0&&N(e,be),kt(e)&&Et(e);En.clear()}function St(e){m(e,e.v+1)}function xr(e,t){var n=e.reactions;if(n!==null)for(var r=n.length,i=0;i<r;i++){var s=n[i],a=s.f,o=(a&W)===0;if(o&&N(s,t),(a&H)!==0){var l=s;we?.delete(l),(a&et)===0&&(a&fe&&(s.f|=et),xr(l,be))}else o&&((a&Me)!==0&&Le!==null&&Le.add(s),ye(s))}}function Pe(e){if(typeof e!="object"||e===null||Ht in e)return e;const t=rr(e);if(t!==xi&&t!==Ci)return e;var n=new Map,r=nr(e),i=T(0),s=at,a=o=>{if(at===s)return o();var l=k,u=at;he(null),Vr(s);var f=o();return he(l),Vr(u),f};return r&&n.set("length",T(e.length)),new Proxy(e,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Ni();var f=n.get(l);return f===void 0?f=a(()=>{var d=T(u.value);return n.set(l,d),d}):m(f,u.value,!0),!0},deleteProperty(o,l){var u=n.get(l);if(u===void 0){if(l in o){const f=a(()=>T(B));n.set(l,f),St(i)}}else m(u,B),St(i);return!0},get(o,l,u){if(l===Ht)return e;var f=n.get(l),d=l in o;if(f===void 0&&(!d||ft(o,l)?.writable)&&(f=a(()=>{var g=Pe(d?o[l]:B),p=T(g);return p}),n.set(l,f)),f!==void 0){var h=c(f);return h===B?void 0:h}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var f=n.get(l);f&&(u.value=c(f))}else if(u===void 0){var d=n.get(l),h=d?.v;if(d!==void 0&&h!==B)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(o,l){if(l===Ht)return!0;var u=n.get(l),f=u!==void 0&&u.v!==B||Reflect.has(o,l);if(u!==void 0||C!==null&&(!f||ft(o,l)?.writable)){u===void 0&&(u=a(()=>{var h=f?Pe(o[l]):B,g=T(h);return g}),n.set(l,u));var d=c(u);if(d===B)return!1}return f},set(o,l,u,f){var d=n.get(l),h=l in o;if(r&&l==="length")for(var g=u;g<d.v;g+=1){var p=n.get(g+"");p!==void 0?m(p,B):g in o&&(p=a(()=>T(B)),n.set(g+"",p))}if(d===void 0)(!h||ft(o,l)?.writable)&&(d=a(()=>T(void 0)),m(d,Pe(u)),n.set(l,d));else{h=d.v!==B;var _=a(()=>Pe(u));m(d,_)}var I=Reflect.getOwnPropertyDescriptor(o,l);if(I?.set&&I.set.call(f,u),!h){if(r&&typeof l=="string"){var y=n.get("length"),S=Number(l);Number.isInteger(S)&&S>=y.v&&m(y,S+1)}St(i)}return!0},ownKeys(o){c(i);var l=Reflect.ownKeys(o).filter(d=>{var h=n.get(d);return h===void 0||h.v!==B});for(var[u,f]of n)f.v!==B&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Ui()}})}var Cr,Ar,Tr,zr;function xn(){if(Cr===void 0){Cr=window,Ar=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Tr=ft(t,"firstChild").get,zr=ft(t,"nextSibling").get,ir(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ir(n)&&(n.__t=void 0)}}function Se(e=""){return document.createTextNode(e)}function Ve(e){return Tr.call(e)}function xe(e){return zr.call(e)}function M(e,t){if(!x)return Ve(e);var n=Ve(E);if(n===null)n=E.appendChild(Se());else if(t&&n.nodeType!==Wt){var r=Se();return n?.before(r),se(r),r}return t&&Cn(n),se(n),n}function Rr(e,t=!1){if(!x){var n=Ve(e);return n instanceof Comment&&n.data===""?xe(n):n}if(t){if(E?.nodeType!==Wt){var r=Se();return E?.before(r),se(r),r}Cn(E)}return E}function F(e,t=1,n=!1){let r=x?E:e;for(var i;t--;)i=r,r=xe(r);if(!x)return r;if(n){if(r?.nodeType!==Wt){var s=Se();return r===null?i?.after(s):r.before(s),se(s),s}Cn(r)}return se(r),r}function Mr(e){e.textContent=""}function Ir(){return!1}function Cn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Wt;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Or(e){var t=k,n=C;he(null),Ae(null);try{return e()}finally{he(t),Ae(n)}}function ss(e){C===null&&(k===null&&Li(),Di()),Ge&&Oi()}function as(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Ce(e,t,n){var r=C;r!==null&&(r.f&ie)!==0&&(e|=ie);var i={ctx:ae,deps:null,nodes:null,f:e|W|fe,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{Et(i),i.f|=Bt}catch(o){throw Y(i),o}else t!==null&&ye(i);var s=i;if(n&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Qe)===0&&(s=s.first,(e&Me)!==0&&(e&dt)!==0&&s!==null&&(s.f|=dt)),s!==null&&(s.parent=r,r!==null&&as(s,r),k!==null&&(k.f&H)!==0&&(e&Be)===0)){var a=k;(a.effects??=[]).push(s)}return i}function An(){return k!==null&&!ke}function os(e){const t=Ce(jt,null,!1);return N(t,U),t.teardown=e,t}function Zt(e){ss();var t=C.f,n=!k&&(t&_e)!==0&&(t&Bt)===0;if(n){var r=ae;(r.e??=[]).push(e)}else return Dr(e)}function Dr(e){return Ce(Ut|Ti,e,!1)}function ls(e){De.ensure();const t=Ce(Be|Qe,e,!0);return()=>{Y(t)}}function cs(e){De.ensure();const t=Ce(Be|Qe,e,!0);return(n={})=>new Promise(r=>{n.outro?it(t,()=>{Y(t),r(void 0)}):(Y(t),r(void 0))})}function Lr(e){return Ce(Ut,e,!1)}function us(e){return Ce(mn|Qe,e,!0)}function Tn(e,t=0){return Ce(jt|t,e,!0)}function Q(e,t=[],n=[],r=[]){Qi(r,t,n,i=>{Ce(jt,()=>e(...i.map(c)),!0)})}function zn(e,t=0){var n=Ce(Me|t,e,!0);return n}function de(e){return Ce(_e|Qe,e,!0)}function Pr(e){var t=e.teardown;if(t!==null){const n=Ge,r=k;Hr(!0),he(null);try{t.call(null)}finally{Hr(n),he(r)}}}function Fr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&Or(()=>{i.abort(ht)});var r=n.next;(n.f&Be)!==0?n.parent=null:Y(n,t),n=r}}function fs(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&_e)===0&&Y(t),t=n}}function Y(e,t=!0){var n=!1;(t||(e.f&lr)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ds(e.nodes.start,e.nodes.end),n=!0),Fr(e,t&&!n),Qt(e,0),N(e,Ie);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();Pr(e);var i=e.parent;i!==null&&i.first!==null&&Nr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function ds(e,t){for(;e!==null;){var n=e===t?null:xe(e);e.remove(),e=n}}function Nr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function it(e,t,n=!0){var r=[];Ur(e,r,!0);var i=()=>{n&&Y(e),t&&t()},s=r.length;if(s>0){var a=()=>--s||i();for(var o of r)o.out(a)}else i()}function Ur(e,t,n){if((e.f&ie)===0){e.f^=ie;var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&t.push(o);for(var i=e.first;i!==null;){var s=i.next,a=(i.f&dt)!==0||(i.f&_e)!==0&&(e.f&Me)!==0;Ur(i,t,a?n:!1),i=s}}}function Rn(e){jr(e,!0)}function jr(e,t){if((e.f&ie)!==0){e.f^=ie,(e.f&U)===0&&(N(e,W),ye(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&dt)!==0||(n.f&_e)!==0;jr(n,i?t:!1),n=r}var s=e.nodes&&e.nodes.t;if(s!==null)for(const a of s)(a.is_global||t)&&a.in()}}function Br(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:xe(n);t.append(n),n=i}}let Xt=!1,Ge=!1;function Hr(e){Ge=e}let k=null,ke=!1;function he(e){k=e}let C=null;function Ae(e){C=e}let pe=null;function Wr(e){k!==null&&(pe===null?pe=[e]:pe.push(e))}let ee=null,le=0,ve=null;function hs(e){ve=e}let qr=1,st=0,at=st;function Vr(e){at=e}function Gr(){return++qr}function kt(e){var t=e.f;if((t&W)!==0)return!0;if(t&H&&(e.f&=~et),(t&be)!==0){for(var n=e.deps,r=n.length,i=0;i<r;i++){var s=n[i];if(kt(s)&&Sr(s),s.wv>e.wv)return!0}(t&fe)!==0&&we===null&&N(e,U)}return!1}function Kr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(pe!==null&&ut.call(pe,e)))for(var i=0;i<r.length;i++){var s=r[i];(s.f&H)!==0?Kr(s,t,!1):t===s&&(n?N(s,W):(s.f&U)!==0&&N(s,be),ye(s))}}function Jr(e){var t=ee,n=le,r=ve,i=k,s=pe,a=ae,o=ke,l=at,u=e.f;ee=null,le=0,ve=null,k=(u&(_e|Be))===0?e:null,pe=null,vt(e.ctx),ke=!1,at=++st,e.ac!==null&&(Or(()=>{e.ac.abort(ht)}),e.ac=null);try{e.f|=gn;var f=e.fn,d=f(),h=e.deps,g=D?.is_fork;if(ee!==null){var p;if(g||Qt(e,le),h!==null&&le>0)for(h.length=le+ee.length,p=0;p<ee.length;p++)h[le+p]=ee[p];else e.deps=h=ee;if(An()&&(e.f&fe)!==0)for(p=le;p<h.length;p++)(h[p].reactions??=[]).push(e)}else!g&&h!==null&&le<h.length&&(Qt(e,le),h.length=le);if(dr()&&ve!==null&&!ke&&h!==null&&(e.f&(H|be|W))===0)for(p=0;p<ve.length;p++)Kr(ve[p],e);if(i!==null&&i!==e){if(st++,i.deps!==null)for(let _=0;_<n;_+=1)i.deps[_].rv=st;if(t!==null)for(const _ of t)_.rv=st;ve!==null&&(r===null?r=ve:r.push(...ve))}return(e.f&We)!==0&&(e.f^=We),d}catch(_){return pr(_)}finally{e.f^=gn,ee=t,le=n,ve=r,k=i,pe=s,vt(a),ke=o,at=l}}function ps(e,t){let n=t.reactions;if(n!==null){var r=ki.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(t.f&H)!==0&&(ee===null||!ut.call(ee,t))){var s=t;(s.f&fe)!==0&&(s.f^=fe,s.f&=~et),yn(s),$r(s),Qt(s,0)}}function Qt(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)ps(e,n[r])}function Et(e){var t=e.f;if((t&Ie)===0){N(e,U);var n=C,r=Xt;C=e,Xt=!0;try{(t&(Me|ar))!==0?fs(e):Fr(e),Pr(e);var i=Jr(e);e.teardown=typeof i=="function"?i:null,e.wv=qr;var s;pn&&qi&&(e.f&W)!==0&&e.deps}finally{Xt=r,C=n}}}function c(e){var t=e.f,n=(t&H)!==0;if(k!==null&&!ke){var r=C!==null&&(C.f&Ie)!==0;if(!r&&(pe===null||!ut.call(pe,e))){var i=k.deps;if((k.f&gn)!==0)e.rv<st&&(e.rv=st,ee===null&&i!==null&&i[le]===e?le++:ee===null?ee=[e]:ee.push(e));else{(k.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[k]:ut.call(s,k)||s.push(k)}}}if(Ge&&qe.has(e))return qe.get(e);if(n){var a=e;if(Ge){var o=a.v;return((a.f&U)===0&&a.reactions!==null||Zr(a))&&(o=kn(a)),qe.set(a,o),o}var l=(a.f&fe)===0&&!ke&&k!==null&&(Xt||(k.f&fe)!==0),u=a.deps===null;kt(a)&&(l&&(a.f|=fe),Sr(a)),l&&!u&&Yr(a)}if(we?.has(e))return we.get(e);if((e.f&We)!==0)throw e.v;return e.v}function Yr(e){if(e.deps!==null){e.f|=fe;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&H)!==0&&(t.f&fe)===0&&Yr(t)}}function Zr(e){if(e.v===B)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(qe.has(t)||(t.f&H)!==0&&Zr(t))return!0;return!1}function Mn(e){var t=ke;try{return ke=!0,e()}finally{ke=t}}const Xr=new Set,In=new Set;function Qr(e){for(var t=0;t<e.length;t++)Xr.add(e[t]);for(var n of In)n(e)}let ei=null;function en(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],s=i[0]||e.target;ei=e;var a=0,o=ei===e&&e.__root;if(o){var l=i.indexOf(o);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var u=i.indexOf(t);if(u===-1)return;l<=u&&(a=l)}if(s=i[a]||e.target,s!==t){Nt(e,"currentTarget",{configurable:!0,get(){return s||n}});var f=k,d=C;he(null),Ae(null);try{for(var h,g=[];s!==null;){var p=s.assignedSlot||s.parentNode||s.host||null;try{var _=s["__"+r];_!=null&&(!s.disabled||e.target===s)&&_.call(s,e)}catch(I){h?g.push(I):h=I}if(e.cancelBubble||p===t||p===null)break;s=p}if(h){for(let I of g)queueMicrotask(()=>{throw I});throw h}}finally{e.__root=t,delete e.currentTarget,he(f),Ae(d)}}}function ti(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Ke(e,t){var n=C;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function j(e,t){var n=(t&yi)!==0,r=(t&$i)!==0,i,s=!e.startsWith("<!>");return()=>{if(x)return Ke(E,null),E;i===void 0&&(i=ti(s?e:"<!>"+e),n||(i=Ve(i)));var a=r||Ar?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Ve(a),l=a.lastChild;Ke(o,l)}else Ke(a,a);return a}}function vs(e,t,n="svg"){var r=!e.startsWith("<!>"),i=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if(x)return Ke(E,null),E;if(!s){var a=ti(i),o=Ve(a);s=Ve(o)}var l=s.cloneNode(!0);return Ke(l,l),l}}function tn(e,t){return vs(e,t,"svg")}function gs(){if(x)return Ke(E,null),E;var e=document.createDocumentFragment(),t=document.createComment(""),n=Se();return e.append(t,n),Ke(t,n),e}function L(e,t){if(x){var n=C;((n.f&Bt)===0||n.nodes.end===null)&&(n.nodes.end=E),Vt();return}e!==null&&e.before(t)}const ms=["touchstart","touchmove"];function _s(e){return ms.includes(e)}function Je(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function ni(e,t){return ri(e,t)}function bs(e,t){xn(),t.intro=t.intro??!1;const n=t.target,r=x,i=E;try{for(var s=Ve(n);s&&(s.nodeType!==pt||s.data!==tr);)s=xe(s);if(!s)throw ct;Oe(!0),se(s);const a=ri(e,{...t,anchor:s});return Oe(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
|
|
2
2
|
`).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==ct&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Fi(),xn(),Mr(n),Oe(!1),ni(e,t)}finally{Oe(r),se(i)}}const _t=new Map;function ri(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:a=!0}){xn();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var g=d[h];if(!o.has(g)){o.add(g);var p=_s(g);t.addEventListener(g,en,{passive:p});var _=_t.get(g);_===void 0?(document.addEventListener(g,en,{passive:p}),_t.set(g,1)):_t.set(g,_+1)}}};l(Pt(Xr)),In.add(l);var u=void 0,f=cs(()=>{var d=n??t.appendChild(Se());return Zi(d,{pending:()=>{}},h=>{if(s){bn({});var g=ae;g.c=s}if(i&&(r.$$events=i),x&&Ke(h,null),u=e(h,r)||{},x&&(C.nodes.end=E,E===null||E.nodeType!==pt||E.data!==hn))throw qt(),ct;s&&wn()}),()=>{for(var h of o){t.removeEventListener(h,en);var g=_t.get(h);--g===0?(document.removeEventListener(h,en),_t.delete(h)):_t.set(h,g)}In.delete(l),d!==n&&d.parentNode?.removeChild(d)}});return On.set(u,f),u}let On=new WeakMap;function ws(e,t){const n=On.get(e);return n?(On.delete(e),n(t)):Promise.resolve()}class ys{anchor;#e=new Map;#t=new Map;#n=new Map;#a=new Set;#o=!0;constructor(t,n=!0){this.anchor=t,this.#o=n}#i=()=>{var t=D;if(this.#e.has(t)){var n=this.#e.get(t),r=this.#t.get(n);if(r)Rn(r),this.#a.delete(n);else{var i=this.#n.get(n);i&&(this.#t.set(n,i.effect),this.#n.delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,a]of this.#e){if(this.#e.delete(s),s===t)break;const o=this.#n.get(a);o&&(Y(o.effect),this.#n.delete(a))}for(const[s,a]of this.#t){if(s===n||this.#a.has(s))continue;const o=()=>{if(Array.from(this.#e.values()).includes(s)){var u=document.createDocumentFragment();Br(a,u),u.append(Se()),this.#n.set(s,{effect:a,fragment:u})}else Y(a);this.#a.delete(s),this.#t.delete(s)};this.#o||!r?(this.#a.add(s),it(a,o,!1)):o()}}};#r=t=>{this.#e.delete(t);const n=Array.from(this.#e.values());for(const[r,i]of this.#n)n.includes(r)||(Y(i.effect),this.#n.delete(r))};ensure(t,n){var r=D,i=Ir();if(n&&!this.#t.has(t)&&!this.#n.has(t))if(i){var s=document.createDocumentFragment(),a=Se();s.append(a),this.#n.set(t,{effect:de(()=>n(a)),fragment:s})}else this.#t.set(t,de(()=>n(this.anchor)));if(this.#e.set(r,t),i){for(const[o,l]of this.#t)o===t?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of this.#n)o===t?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(this.#i),r.ondiscard(this.#r)}else x&&(this.anchor=E),this.#i()}}function ii(e){ae===null&&Mi(),Zt(()=>{const t=Mn(e);if(typeof t=="function")return t})}function q(e,t,n=!1){x&&Vt();var r=new ys(e),i=n?dt:0;function s(a,o){if(x){const u=cr(e)===Lt;if(a===u){var l=Gt();se(l),r.anchor=l,Oe(!1),r.ensure(a,o),Oe(!0);return}}r.ensure(a,o)}zn(()=>{var a=!1;t((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},i)}function $s(e,t,n){for(var r=[],i=t.length,s,a=t.length,o=0;o<i;o++){let d=t[o];it(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=e.outrogroups;Dn(Pt(s.done)),h.delete(s),h.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=r.length===0&&n!==null;if(l){var u=n,f=u.parentNode;Mr(f),f.append(u),e.items.clear()}Dn(t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(s)}function Dn(e,t=!0){for(var n=0;n<e.length;n++)Y(e[n],t)}var si;function Ss(e,t,n,r,i,s=null){var a=e,o=new Map;x&&Vt();var l=null,u=ns(()=>{var _=n();return nr(_)?_:_==null?[]:Pt(_)}),f,d=!0;function h(){p.fallback=l,ks(p,f,a,t,r),l!==null&&(f.length===0?(l.f&He)===0?Rn(l):(l.f^=He,Ct(l,null,a)):it(l,()=>{l=null}))}var g=zn(()=>{f=c(u);var _=f.length;let I=!1;if(x){var y=cr(a)===Lt;y!==(_===0)&&(a=Gt(),se(a),Oe(!1),I=!0)}for(var S=new Set,te=D,K=Ir(),J=0;J<_;J+=1){x&&E.nodeType===pt&&E.data===hn&&(a=E,I=!0,Oe(!1));var Fe=f[J],Te=r(Fe,J),O=d?null:o.get(Te);O?(O.v&&mt(O.v,Fe),O.i&&mt(O.i,J),K&&te.unskip_effect(O.e)):(O=Es(o,d?a:si??=Se(),Fe,Te,J,i,t,n),d||(O.e.f|=He),o.set(Te,O)),S.add(Te)}if(_===0&&s&&!l&&(d?l=de(()=>s(a)):(l=de(()=>s(si??=Se())),l.f|=He)),x&&_>0&&se(Gt()),!d)if(K){for(const[wt,Ee]of o)S.has(wt)||te.skip_effect(Ee.e);te.oncommit(h),te.ondiscard(()=>{})}else h();I&&Oe(!0),c(u)}),p={effect:g,items:o,outrogroups:null,fallback:l};d=!1,x&&(a=E)}function xt(e){for(;e!==null&&(e.f&_e)===0;)e=e.next;return e}function ks(e,t,n,r,i){var s=t.length,a=e.items,o=xt(e.effect.first),l,u=null,f=[],d=[],h,g,p,_;for(_=0;_<s;_+=1){if(h=t[_],g=i(h,_),p=a.get(g).e,e.outrogroups!==null)for(const O of e.outrogroups)O.pending.delete(p),O.done.delete(p);if((p.f&He)!==0)if(p.f^=He,p===o)Ct(p,null,n);else{var I=u?u.next:o;p===e.effect.last&&(e.effect.last=p.prev),p.prev&&(p.prev.next=p.next),p.next&&(p.next.prev=p.prev),Ye(e,u,p),Ye(e,p,I),Ct(p,I,n),u=p,f=[],d=[],o=xt(u.next);continue}if((p.f&ie)!==0&&Rn(p),p!==o){if(l!==void 0&&l.has(p)){if(f.length<d.length){var y=d[0],S;u=y.prev;var te=f[0],K=f[f.length-1];for(S=0;S<f.length;S+=1)Ct(f[S],y,n);for(S=0;S<d.length;S+=1)l.delete(d[S]);Ye(e,te.prev,K.next),Ye(e,u,te),Ye(e,K,y),o=y,u=K,_-=1,f=[],d=[]}else l.delete(p),Ct(p,o,n),Ye(e,p.prev,p.next),Ye(e,p,u===null?e.effect.first:u.next),Ye(e,u,p),u=p;continue}for(f=[],d=[];o!==null&&o!==p;)(l??=new Set).add(o),d.push(o),o=xt(o.next);if(o===null)continue}(p.f&He)===0&&f.push(p),u=p,o=xt(p.next)}if(e.outrogroups!==null){for(const O of e.outrogroups)O.pending.size===0&&(Dn(Pt(O.done)),e.outrogroups?.delete(O));e.outrogroups.size===0&&(e.outrogroups=null)}if(o!==null||l!==void 0){var J=[];if(l!==void 0)for(p of l)(p.f&ie)===0&&J.push(p);for(;o!==null;)(o.f&ie)===0&&o!==e.fallback&&J.push(o),o=xt(o.next);var Fe=J.length;if(Fe>0){var Te=null;$s(e,J,Te)}}}function Es(e,t,n,r,i,s,a,o){var l=(a&_i)!==0?(a&wi)===0?Er(n,!1,!1):rt(n):null,u=(a&bi)!==0?rt(i):null;return{v:l,i:u,e:de(()=>(s(t,l??n,u??i,o),()=>{e.delete(r)}))}}function Ct(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,s=t&&(t.f&He)===0?t.nodes.start:n;r!==null;){var a=xe(r);if(s.before(r),r===i)return;r=a}}function Ye(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function ai(e,t){Lr(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,r.appendChild(i)}})}const oi=[...`
|
|
3
|
-
\r\f \v\uFEFF`];function xs(e,t,n){var r=e==null?"":""+e;if(n){for(var i in n)if(n[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,a=0;(a=r.indexOf(i,a))>=0;){var o=a+s;(a===0||oi.includes(r[a-1]))&&(o===r.length||oi.includes(r[o]))?r=(a===0?"":r.substring(0,a))+r.substring(o+1):a=o}}return r===""?null:r}function li(e,t=!1){var n=t?" !important;":";",r="";for(var i in e){var s=e[i];s!=null&&s!==""&&(r+=" "+i+": "+s+n)}return r}function Ln(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Cs(e,t){if(t){var n="",r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(Ln)),i&&l.push(...Object.keys(i).map(Ln));var u=0,f=-1;const _=e.length;for(var d=0;d<_;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):s?s===h&&(s=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?s=h:h==="("?a++:h===")"&&a--,!o&&s===!1&&a===0){if(h===":"&&f===-1)f=d;else if(h===";"||d===_-1){if(f!==-1){var g=Ln(e.substring(u,f).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(u,d).trim();n+=" "+p+";"}}u=d+1,f=-1}}}}return r&&(n+=li(r)),i&&(n+=li(i,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function bt(e,t,n,r,i,s){var a=e.__className;if(x||a!==n||a===void 0){var o=xs(n,r,s);(!x||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=n}else if(s&&i!==s)for(var l in s){var u=!!s[l];(i==null||u!==!!i[l])&&e.classList.toggle(l,u)}return s}function Pn(e,t={},n,r){for(var i in n){var s=n[i];t[i]!==s&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,s,r))}}function Fn(e,t,n,r){var i=e.__style;if(x||i!==t){var s=Cs(t,r);(!x||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}else r&&(Array.isArray(r)?(Pn(e,n?.[0],r[0]),Pn(e,n?.[1],r[1],"important")):Pn(e,n,r));return r}const As=Symbol("is custom element"),Ts=Symbol("is html");function nn(e,t,n,r){var i=zs(e);x&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=n)&&(t==="loading"&&(e[Ri]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Rs(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function zs(e){return e.__attributes??={[As]:e.nodeName.includes("-"),[Ts]:e.namespaceURI===Si}}var ci=new Map;function Rs(e){var t=e.getAttribute("is")||e.nodeName,n=ci.get(t);if(n)return n;ci.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=Ei(i);for(var a in r)r[a].set&&n.push(a);i=rr(i)}return n}function ui(e,t){return e===t||e?.[Ht]===t}function Nn(e={},t,n,r){return Lr(()=>{var i,s;return Tn(()=>{i=s,s=[],Mn(()=>{e!==n(...s)&&(t(e,...s),i&&ui(n(...i),e)&&t(null,...i))})}),()=>{nt(()=>{s&&ui(n(...s),e)&&t(null,...s)})}}),e}function Z(e,t,n,r){var i=r,s=!0,a=()=>(s&&(s=!1,i=r),i),o;o=e[t],o===void 0&&r!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(s=!0,h)};var u=!1,f=Yt(()=>(u=!1,l())),d=C;return(function(h,g){if(arguments.length>0){const p=g?c(f):h;return m(f,p),u=!0,i!==void 0&&(i=p),h}return Ge&&u||(d.f&Ie)!==0?f.v:c(f)})}function Ms(e){return new Is(e)}class Is{#e;#t;constructor(t){var n=new Map,r=(s,a)=>{var o=Er(a,!1,!1);return n.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return c(n.get(a)??r(a,Reflect.get(s,a)))},has(s,a){return a===zi?!0:(c(n.get(a)??r(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return m(n.get(a)??r(a,o),o),Reflect.set(s,a,o)}});this.#t=(t.hydrate?bs:ni)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&G(),this.#e=i.$$events;for(const s of Object.keys(this.#t))s==="$set"||s==="$destroy"||s==="$on"||Nt(this,s,{get(){return this.#t[s]},set(a){this.#t[s]=a},enumerable:!0});this.#t.$set=s=>{Object.assign(i,s)},this.#t.$destroy=()=>{ws(this.#t)}}$set(t){this.#t.$set(t)}$on(t,n){this.#e[t]=this.#e[t]||[];const r=(...i)=>n.call(this,...i);return this.#e[t].push(r),()=>{this.#e[t]=this.#e[t].filter(i=>i!==r)}}$destroy(){this.#t.$destroy()}}let fi;typeof HTMLElement=="function"&&(fi=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return i=>{const s=document.createElement("slot");r!=="default"&&(s.name=r),L(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=Os(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=rn(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Ms({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ls(()=>{Tn(()=>{this.$$r=!0;for(const r of Ft(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=rn(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const s=this.$$c.$on(r,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=rn(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Ft(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function rn(e,t,n,r){const i=n[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Os(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function di(e,t,n,r,i,s){let a=class extends fi{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return Ft(t).map(o=>(t[o].attribute||o).toLowerCase())}};return Ft(t).forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=rn(o,l,t),this.$$d[o]=l;var u=this.$$c;if(u){var f=ft(u,o)?.get;f?u[o]=l:u.$set({[o]:l})}}})}),r.forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const Ds=50,At=5;class hi{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,n){const r={level:t,message:n.map(i=>this.stringifyArg(i)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(r),this.consoleErrors.length>Ds&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!0,preferCurrentTab:!0});let n=null;try{n=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const r=new AudioContext,i=r.createMediaStreamDestination(),s=t.getAudioTracks()[0];if(s&&r.createMediaStreamSource(new MediaStream([s])).connect(i),n){const d=n.getAudioTracks()[0];d&&r.createMediaStreamSource(new MediaStream([d])).connect(i)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=i.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=n,this.mediaStream._audioContext=r;const u=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let f="video/webm";for(const d of u)if(MediaRecorder.isTypeSupported(d)){f=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:f}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const r=this.mediaStream,i=r._originalDisplayStream;if(i)for(const o of i.getTracks())o.stop();const s=r._originalMicStream;if(s)for(const o of s.getTracks())o.stop();const a=r._audioContext;a&&a.close(),this.mediaStream=null}const n=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(n)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),n=document.createElement("video");n.srcObject=t,n.autoplay=!0,await new Promise(s=>{n.onloadedmetadata=s});const r=document.createElement("canvas");r.width=n.videoWidth,r.height=n.videoHeight;const i=r.getContext("2d");if(!i){for(const s of t.getTracks())s.stop();return null}i.drawImage(n,0,0);for(const s of t.getTracks())s.stop();return new Promise(s=>{r.toBlob(a=>s(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const r=await this.fileToDataUrl(t),i={id:this.generateId(),name:t.name,type:n,size:t.size,dataUrl:r};return this.attachments.push(i),i}async addBlobAttachment(t,n){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const i=await this.blobToDataUrl(t),s={id:this.generateId(),name:n,type:r,size:t.size,dataUrl:i};return this.attachments.push(s),s}removeAttachment(t){const n=this.attachments.findIndex(r=>r.id===t);return n!==-1?(this.attachments.splice(n,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<At}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((n,r)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=r,i.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((n,r)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=r,i.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Un=null;function jn(){return Un||(Un=new hi),Un}var Ls=j('<button class="recording-btn svelte-1105cax" aria-label="Stop recording"><span class="recording-dot svelte-1105cax"></span> <span class="recording-time svelte-1105cax"> </span> <span class="stop-label svelte-1105cax">Stop</span></button>'),Ps=j('<span class="unread-badge svelte-1105cax"> </span>'),Fs=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Ns=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Us=j('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),js=j('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),Bs=j('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Hs={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
|
|
3
|
+
\r\f \v\uFEFF`];function xs(e,t,n){var r=e==null?"":""+e;if(n){for(var i in n)if(n[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,a=0;(a=r.indexOf(i,a))>=0;){var o=a+s;(a===0||oi.includes(r[a-1]))&&(o===r.length||oi.includes(r[o]))?r=(a===0?"":r.substring(0,a))+r.substring(o+1):a=o}}return r===""?null:r}function li(e,t=!1){var n=t?" !important;":";",r="";for(var i in e){var s=e[i];s!=null&&s!==""&&(r+=" "+i+": "+s+n)}return r}function Ln(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Cs(e,t){if(t){var n="",r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(Ln)),i&&l.push(...Object.keys(i).map(Ln));var u=0,f=-1;const _=e.length;for(var d=0;d<_;d++){var h=e[d];if(o?h==="/"&&e[d-1]==="*"&&(o=!1):s?s===h&&(s=!1):h==="/"&&e[d+1]==="*"?o=!0:h==='"'||h==="'"?s=h:h==="("?a++:h===")"&&a--,!o&&s===!1&&a===0){if(h===":"&&f===-1)f=d;else if(h===";"||d===_-1){if(f!==-1){var g=Ln(e.substring(u,f).trim());if(!l.includes(g)){h!==";"&&d++;var p=e.substring(u,d).trim();n+=" "+p+";"}}u=d+1,f=-1}}}}return r&&(n+=li(r)),i&&(n+=li(i,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function bt(e,t,n,r,i,s){var a=e.__className;if(x||a!==n||a===void 0){var o=xs(n,r,s);(!x||o!==e.getAttribute("class"))&&(o==null?e.removeAttribute("class"):e.className=o),e.__className=n}else if(s&&i!==s)for(var l in s){var u=!!s[l];(i==null||u!==!!i[l])&&e.classList.toggle(l,u)}return s}function Pn(e,t={},n,r){for(var i in n){var s=n[i];t[i]!==s&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,s,r))}}function Fn(e,t,n,r){var i=e.__style;if(x||i!==t){var s=Cs(t,r);(!x||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}else r&&(Array.isArray(r)?(Pn(e,n?.[0],r[0]),Pn(e,n?.[1],r[1],"important")):Pn(e,n,r));return r}const As=Symbol("is custom element"),Ts=Symbol("is html");function nn(e,t,n,r){var i=zs(e);x&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=n)&&(t==="loading"&&(e[Ri]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Rs(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function zs(e){return e.__attributes??={[As]:e.nodeName.includes("-"),[Ts]:e.namespaceURI===Si}}var ci=new Map;function Rs(e){var t=e.getAttribute("is")||e.nodeName,n=ci.get(t);if(n)return n;ci.set(t,n=[]);for(var r,i=e,s=Element.prototype;s!==i;){r=Ei(i);for(var a in r)r[a].set&&n.push(a);i=rr(i)}return n}function ui(e,t){return e===t||e?.[Ht]===t}function Nn(e={},t,n,r){return Lr(()=>{var i,s;return Tn(()=>{i=s,s=[],Mn(()=>{e!==n(...s)&&(t(e,...s),i&&ui(n(...i),e)&&t(null,...i))})}),()=>{nt(()=>{s&&ui(n(...s),e)&&t(null,...s)})}}),e}function Z(e,t,n,r){var i=r,s=!0,a=()=>(s&&(s=!1,i=r),i),o;o=e[t],o===void 0&&r!==void 0&&(o=a());var l;l=()=>{var h=e[t];return h===void 0?a():(s=!0,h)};var u=!1,f=Yt(()=>(u=!1,l())),d=C;return(function(h,g){if(arguments.length>0){const p=g?c(f):h;return m(f,p),u=!0,i!==void 0&&(i=p),h}return Ge&&u||(d.f&Ie)!==0?f.v:c(f)})}function Ms(e){return new Is(e)}class Is{#e;#t;constructor(t){var n=new Map,r=(s,a)=>{var o=Er(a,!1,!1);return n.set(s,o),o};const i=new Proxy({...t.props||{},$$events:{}},{get(s,a){return c(n.get(a)??r(a,Reflect.get(s,a)))},has(s,a){return a===zi?!0:(c(n.get(a)??r(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return m(n.get(a)??r(a,o),o),Reflect.set(s,a,o)}});this.#t=(t.hydrate?bs:ni)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&G(),this.#e=i.$$events;for(const s of Object.keys(this.#t))s==="$set"||s==="$destroy"||s==="$on"||Nt(this,s,{get(){return this.#t[s]},set(a){this.#t[s]=a},enumerable:!0});this.#t.$set=s=>{Object.assign(i,s)},this.#t.$destroy=()=>{ws(this.#t)}}$set(t){this.#t.$set(t)}$on(t,n){this.#e[t]=this.#e[t]||[];const r=(...i)=>n.call(this,...i);return this.#e[t].push(r),()=>{this.#e[t]=this.#e[t].filter(i=>i!==r)}}$destroy(){this.#t.$destroy()}}let fi;typeof HTMLElement=="function"&&(fi=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return i=>{const s=document.createElement("slot");r!=="default"&&(s.name=r),L(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=Os(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(const r of this.attributes){const i=this.$$g_p(r.name);i in this.$$d||(this.$$d[i]=rn(i,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=Ms({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ls(()=>{Tn(()=>{this.$$r=!0;for(const r of Ft(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const i=rn(r,this.$$d[r],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,i)}this.$$r=!1})});for(const r in this.$$l)for(const i of this.$$l[r]){const s=this.$$c.$on(r,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=rn(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Ft(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function rn(e,t,n,r){const i=n[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Os(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function di(e,t,n,r,i,s){let a=class extends fi{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return Ft(t).map(o=>(t[o].attribute||o).toLowerCase())}};return Ft(t).forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=rn(o,l,t),this.$$d[o]=l;var u=this.$$c;if(u){var f=ft(u,o)?.get;f?u[o]=l:u.$set({[o]:l})}}})}),r.forEach(o=>{Nt(a.prototype,o,{get(){return this.$$c?.[o]}})}),e.element=a,a}const Ds=50,At=5;class hi{consoleErrors=[];attachments=[];mediaRecorder=null;recordingChunks=[];mediaStream=null;originalConsoleError;originalConsoleWarn;isCapturingConsole=!1;constructor(){this.originalConsoleError=console.error,this.originalConsoleWarn=console.warn}startConsoleCapture(){this.isCapturingConsole||(this.isCapturingConsole=!0,console.error=(...t)=>{this.captureLog("error",t),this.originalConsoleError.apply(console,t)},console.warn=(...t)=>{this.captureLog("warn",t),this.originalConsoleWarn.apply(console,t)})}stopConsoleCapture(){this.isCapturingConsole&&(this.isCapturingConsole=!1,console.error=this.originalConsoleError,console.warn=this.originalConsoleWarn)}captureLog(t,n){const r={level:t,message:n.map(i=>this.stringifyArg(i)).join(" "),timestamp:Date.now(),stack:new Error().stack};this.consoleErrors.push(r),this.consoleErrors.length>Ds&&this.consoleErrors.shift()}stringifyArg(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(t instanceof Error)return`${t.name}: ${t.message}`;try{return JSON.stringify(t)}catch{return String(t)}}getConsoleErrors(){return[...this.consoleErrors]}clearConsoleErrors(){this.consoleErrors=[]}getPageContext(){return{pageUrl:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}}}isScreenRecordingSupported(){return!!navigator.mediaDevices?.getDisplayMedia}async startScreenRecording(){if(!this.isScreenRecordingSupported())throw new Error("Screen recording is not supported in this browser");try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!0,preferCurrentTab:!0});let n=null;try{n=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{console.warn("[SDK] Microphone access denied or unavailable")}const r=new AudioContext,i=r.createMediaStreamDestination(),s=t.getAudioTracks()[0];if(s&&r.createMediaStreamSource(new MediaStream([s])).connect(i),n){const d=n.getAudioTracks()[0];d&&r.createMediaStreamSource(new MediaStream([d])).connect(i)}const a=new MediaStream,o=t.getVideoTracks()[0];o&&a.addTrack(o);const l=i.stream.getAudioTracks()[0];l&&a.addTrack(l),this.mediaStream=a,this.mediaStream._originalDisplayStream=t,this.mediaStream._originalMicStream=n,this.mediaStream._audioContext=r;const u=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"];let f="video/webm";for(const d of u)if(MediaRecorder.isTypeSupported(d)){f=d;break}this.mediaRecorder=new MediaRecorder(a,{mimeType:f}),this.recordingChunks=[],this.mediaRecorder.ondataavailable=d=>{d.data.size>0&&this.recordingChunks.push(d.data)},this.mediaRecorder.start()}catch(t){throw console.error("[SDK] Screen recording failed:",t),new Error("Failed to start screen recording")}}async stopScreenRecording(){return new Promise(t=>{if(!this.mediaRecorder){t(null);return}this.mediaRecorder.onstop=()=>{if(this.mediaStream){for(const o of this.mediaStream.getTracks())o.stop();const r=this.mediaStream,i=r._originalDisplayStream;if(i)for(const o of i.getTracks())o.stop();const s=r._originalMicStream;if(s)for(const o of s.getTracks())o.stop();const a=r._audioContext;a&&a.close(),this.mediaStream=null}const n=new Blob(this.recordingChunks,{type:"video/webm"});this.recordingChunks=[],this.mediaRecorder=null,t(n)},this.mediaRecorder.stop()})}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}async captureScreenshot(){if(!this.isScreenRecordingSupported())return null;try{const t=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:1920},height:{ideal:1080}},audio:!1}),n=document.createElement("video");n.srcObject=t,n.autoplay=!0,await new Promise(s=>{n.onloadedmetadata=s});const r=document.createElement("canvas");r.width=n.videoWidth,r.height=n.videoHeight;const i=r.getContext("2d");if(!i){for(const s of t.getTracks())s.stop();return null}i.drawImage(n,0,0);for(const s of t.getTracks())s.stop();return new Promise(s=>{r.toBlob(a=>s(a),"image/png")})}catch{return null}}async addAttachment(t){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} attachments allowed`),null;const n=this.getAttachmentType(t.type);if(!n)return console.warn(`[SDK] Unsupported file type: ${t.type}`),null;const r=await this.fileToDataUrl(t),i={id:this.generateId(),name:t.name,type:n,size:t.size,dataUrl:r};return this.attachments.push(i),i}async addBlobAttachment(t,n){if(this.attachments.length>=At)return console.warn(`[SDK] Maximum ${At} attachments allowed`),null;const r=this.getAttachmentType(t.type);if(!r)return console.warn(`[SDK] Unsupported blob type: ${t.type}`),null;const i=await this.blobToDataUrl(t),s={id:this.generateId(),name:n,type:r,size:t.size,dataUrl:i};return this.attachments.push(s),s}removeAttachment(t){const n=this.attachments.findIndex(r=>r.id===t);return n!==-1?(this.attachments.splice(n,1),!0):!1}getAttachments(){return[...this.attachments]}clearAttachments(){this.attachments=[]}canAddAttachment(){return this.attachments.length<At}getAttachmentType(t){return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":null}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}fileToDataUrl(t){return new Promise((n,r)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=r,i.readAsDataURL(t)})}blobToDataUrl(t){return new Promise((n,r)=>{const i=new FileReader;i.onload=()=>n(i.result),i.onerror=r,i.readAsDataURL(t)})}destroy(){this.stopConsoleCapture(),this.isRecording()&&this.stopScreenRecording(),this.clearConsoleErrors(),this.clearAttachments()}}let Un=null;function jn(){return Un||(Un=new hi),Un}var Ls=j('<button class="recording-btn svelte-1105cax" aria-label="Stop recording"><span class="recording-dot svelte-1105cax"></span> <span class="recording-time svelte-1105cax"> </span> <span class="stop-label svelte-1105cax">Stop</span></button>'),Ps=j('<span class="unread-badge svelte-1105cax"> </span>'),Fs=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Ns=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-1105cax"><path fill-rule="evenodd" d="M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z" clip-rule="evenodd" class="svelte-1105cax"></path></svg>'),Us=j('<button class="toggle-btn svelte-1105cax"><!> <!></button>'),js=j('<div class="loading-state svelte-1105cax"><div class="loading-spinner svelte-1105cax"></div> <p class="svelte-1105cax">Loading...</p></div>'),Bs=j('<div class="support-chat svelte-1105cax"><!> <div><!> <iframe title="Support Chat" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation" allow="clipboard-write; display-capture; microphone"></iframe></div></div>');const Hs={hash:"svelte-1105cax",code:`.svelte-1105cax {box-sizing:border-box;margin:0;padding:0;}.support-chat.svelte-1105cax {--primary-color: #6366f1;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
|
|
4
4
|
0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
5
5
|
"Helvetica Neue", Arial, sans-serif;}.toggle-btn.svelte-1105cax {position:absolute;bottom:0;right:0;width:3.5rem;height:3.5rem;border-radius:50%;border:none;background:var(--primary-color);color:white;cursor:pointer;box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;transition:transform 0.2s,
|
|
6
6
|
opacity 0.2s;}.toggle-btn.svelte-1105cax:hover {transform:scale(1.05);}.toggle-btn.svelte-1105cax .icon:where(.svelte-1105cax) {width:1.5rem;height:1.5rem;}.unread-badge.svelte-1105cax {position:absolute;top:-4px;right:-4px;min-width:1.25rem;height:1.25rem;padding:0 0.25rem;background:#ef4444;color:white;font-size:0.625rem;font-weight:bold;border-radius:9999px;display:flex;align-items:center;justify-content:center;}.chat-window.svelte-1105cax {position:absolute;bottom:4.5rem;right:0;width:380px;max-width:calc(100vw - 2rem);height:500px;max-height:calc(100vh - 8rem);background:#ffffff;border-radius:1rem;box-shadow:var(--shadow);overflow:hidden;border:1px solid #e5e7eb;}.chat-window.svelte-1105cax iframe:where(.svelte-1105cax) {width:100%;height:100%;border:none;display:block;}.chat-window.svelte-1105cax iframe.hidden:where(.svelte-1105cax) {visibility:hidden;position:absolute;}.chat-window.chat-window-hidden.svelte-1105cax {display:none;}.chat-window.chat-window-fullscreen.svelte-1105cax {position:fixed;inset:1vh 1vw;width:auto;height:auto;max-width:none;max-height:none;border-radius:0.5rem;transition:all 0.3s ease;}.loading-state.svelte-1105cax {position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#f9fafb;color:#6b7280;font-size:0.875rem;}.loading-spinner.svelte-1105cax {width:2rem;height:2rem;border:3px solid #e5e7eb;border-top-color:var(--primary-color);border-radius:50%;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
var(--shadow),
|
|
43
43
|
0 0 30px rgba(239, 68, 68, 0.6);
|
|
44
44
|
}
|
|
45
|
-
}`};function pi(e,t){bn(t,!0),ai(e,Hs);let n=Z(t,"embedId"),r=Z(t,"embedUrl",7,"https://app.fortalece.ai"),i=Z(t,"position",7,"bottom-right"),s=Z(t,"showHeader",7,"true"),a=Z(t,"allowAttachments",7,!0),o=Z(t,"allowScreenRecording",7,!0),l=Z(t,"captureConsoleLogs",7,!0),u=T(!1),f=T(!1),d=T(!1),h=T(0),g=T(!1),p=T(null),_=T("00:00"),I=T(void 0),y=T(null),S=T(Pe([])),te=T(Pe([]));Zt(()=>{if(c(g)&&c(p)!==null){const $=setInterval(()=>{const P=Math.floor((Date.now()-c(p))/1e3),ue=Math.floor(P/60).toString().padStart(2,"0"),ze=(P%60).toString().padStart(2,"0");m(_,`${ue}:${ze}`)},1e3);return()=>clearInterval($)}});const K=$e(()=>s()==="false"||s()===!1),J=$e(()=>!c(u)||c(K)||!c(f)),Fe=$e(()=>`${r()}/embed/${n()}${c(K)?"?showHeader=false":""}`),Te=$e(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");ii(()=>{m(y,jn(),!0),l()&&c(y).startConsoleCapture();function $(P){try{const Xe=new URL(r()).origin;if(P.origin!==Xe)return}catch{return}const{type:ue,payload:ze}=P.data||{};switch(ue){case"fortalece:ready":m(f,!0);break;case"fortalece:close-request":m(u,!1);break;case"fortalece:request-context":zt();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Rt();break;case"fortalece:resize":m(d,ze?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ze?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(_,"00:00"),m(u,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(_,"00:00"),m(u,!0);break}}return window.addEventListener("message",$),()=>{window.removeEventListener("message",$),l()&&c(y)&&c(y).stopConsoleCapture()}});function O(){m(u,!c(u)),c(u)&&m(h,0)}function wt(){Ee("fortalece:stop-recording"),m(g,!1),m(p,null),m(_,"00:00")}function Ee($,P={}){if(c(I)?.contentWindow)try{const ue=new URL(r()).origin;c(I).contentWindow.postMessage({type:$,payload:P},ue)}catch{}}function zt(){if(!c(y))return;const $=c(y).getPageContext();if(Ee("fortalece:page-context",$),l()){const P=c(y).getConsoleErrors();m(te,P,!0),Ee("fortalece:console-logs",{logs:P})}Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(S).length,maxAttachments:5})}function ce(){c(S).forEach($=>{Ee("fortalece:attachment-added",$)})}function Rt(){c(y)&&(c(y).clearAttachments(),c(y).clearConsoleErrors(),m(S,[],!0),m(te,[],!0),Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Zt(()=>{c(u)&&c(f)&&(Ee("fortalece:opened"),zt(),ce())});var sn={get embedId(){return n()},set embedId($){n($),G()},get embedUrl(){return r()},set embedUrl($="https://app.fortalece.ai"){r($),G()},get position(){return i()},set position($="bottom-right"){i($),G()},get showHeader(){return s()},set showHeader($="true"){s($),G()},get allowAttachments(){return a()},set allowAttachments($=!0){a($),G()},get allowScreenRecording(){return o()},set allowScreenRecording($=!0){o($),G()},get captureConsoleLogs(){return l()},set captureConsoleLogs($=!0){l($),G()}},Ze=Bs(),an=M(Ze);{var Wn=$=>{var P=Ls();P.__click=wt;var ue=F(M(P),2),ze=M(ue,!0);R(ue),_n(2),R(P),Q(()=>Je(ze,c(_))),L($,P)},qn=$=>{var P=gs(),ue=Rr(P);{var ze=Xe=>{var ot=Us();ot.__click=O;var It=M(ot);{var Gn=ge=>{var Ne=Ps(),v=M(Ne,!0);R(Ne),Q(()=>Je(v,c(h)>9?"9+":c(h))),L(ge,Ne)};q(It,ge=>{c(h)>0&&!c(u)&&ge(Gn)})}var fn=F(It,2);{var Kn=ge=>{var Ne=Fs();L(ge,Ne)},Ot=ge=>{var Ne=Ns();L(ge,Ne)};q(fn,ge=>{c(u)?ge(Kn):ge(Ot,!1)})}R(ot),Q(()=>nn(ot,"aria-label",c(u)?"Close chat":"Open chat")),L(Xe,ot)};q(ue,Xe=>{c(J)&&Xe(ze)},!0)}L($,P)};q(an,$=>{c(g)?$(Wn):$(qn,!1)})}var yt=F(an,2);let on,ln;var cn=M(yt);{var Vn=$=>{var P=js();L($,P)};q(cn,$=>{c(f)||$(Vn)})}var Mt=F(cn,2);let un;return Nn(Mt,$=>m(I,$),()=>c(I)),R(yt),R(Ze),Q(()=>{Fn(Ze,c(Te)),on=bt(yt,1,"chat-window svelte-1105cax",null,on,{"chat-window-hidden":!c(u),"chat-window-fullscreen":c(d)}),ln=Fn(yt,"",ln,{bottom:c(d)?void 0:c(J)?"4.5rem":"0"}),nn(Mt,"src",c(Fe)),un=bt(Mt,1,"svelte-1105cax",null,un,{hidden:!c(f)})}),L(e,Ze),wn(sn)}Qr(["click"]),customElements.define("support-chat",di(pi,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},showHeader:{attribute:"show-header",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],{mode:"open"}));var Ws=j('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),qs=j('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),Vs=j('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),Gs=j('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),Ks=j('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),Js=j('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),Ys=j('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),Zs=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Xs=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Qs=j('<button class="toggle-btn svelte-p7nz7"><!></button>'),ea=j('<span class="badge svelte-p7nz7"> </span>'),ta=j('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),na=j('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),ra=j('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox" allow="clipboard-write; display-capture; microphone"></iframe></div>'),ia=j('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const sa={hash:"svelte-p7nz7",code:`
|
|
45
|
+
}`};function pi(e,t){bn(t,!0),ai(e,Hs);let n=Z(t,"embedId"),r=Z(t,"embedUrl",7,"https://app.fortalece.ai"),i=Z(t,"position",7,"bottom-right"),s=Z(t,"showHeader",7,"true"),a=Z(t,"allowAttachments",7,!0),o=Z(t,"allowScreenRecording",7,!0),l=Z(t,"captureConsoleLogs",7,!0),u=T(!1),f=T(!1),d=T(!1),h=T(0),g=T(!1),p=T(null),_=T("00:00"),I=T(void 0),y=T(null),S=T(Pe([])),te=T(Pe([]));Zt(()=>{if(c(g)&&c(p)!==null){const $=setInterval(()=>{const P=Math.floor((Date.now()-c(p))/1e3),ue=Math.floor(P/60).toString().padStart(2,"0"),ze=(P%60).toString().padStart(2,"0");m(_,`${ue}:${ze}`)},1e3);return()=>clearInterval($)}});const K=$e(()=>s()==="false"||s()===!1),J=$e(()=>!c(u)||c(K)||!c(f)),Fe=$e(()=>`${r()}/embed/${n()}${c(K)?"?showHeader=false":""}`),Te=$e(()=>i()==="bottom-left"?"left: 1rem; right: auto;":"right: 1rem; left: auto;");ii(()=>{m(y,jn(),!0),l()&&c(y).startConsoleCapture();function $(P){try{const Xe=new URL(r()).origin;if(P.origin!==Xe)return}catch{return}const{type:ue,payload:ze}=P.data||{};switch(ue){case"fortalece:ready":m(f,!0);break;case"fortalece:close-request":m(u,!1);break;case"fortalece:request-context":zt();break;case"fortalece:request-attachments":ce();break;case"fortalece:clear-attachments":Rt();break;case"fortalece:resize":m(d,ze?.fullscreen??!1,!0);break;case"fortalece:unread":m(h,ze?.count||0,!0);break;case"fortalece:recording-started":m(g,!0),m(p,Date.now(),!0),m(_,"00:00"),m(u,!1);break;case"fortalece:recording-stopped":m(g,!1),m(p,null),m(_,"00:00"),m(u,!0);break}}return window.addEventListener("message",$),()=>{window.removeEventListener("message",$),l()&&c(y)&&c(y).stopConsoleCapture()}});function O(){m(u,!c(u)),c(u)&&m(h,0)}function wt(){Ee("fortalece:stop-recording"),m(g,!1),m(p,null),m(_,"00:00")}function Ee($,P={}){if(c(I)?.contentWindow)try{const ue=new URL(r()).origin;c(I).contentWindow.postMessage({type:$,payload:P},ue)}catch{}}function zt(){if(!c(y))return;const $=c(y).getPageContext();if(Ee("fortalece:page-context",$),l()){const P=c(y).getConsoleErrors();m(te,P,!0),Ee("fortalece:console-logs",{logs:P})}Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:c(S).length,maxAttachments:5})}function ce(){c(S).forEach($=>{Ee("fortalece:attachment-added",$)})}function Rt(){c(y)&&(c(y).clearAttachments(),c(y).clearConsoleErrors(),m(S,[],!0),m(te,[],!0),Ee("fortalece:capture-state",{allowAttachments:a(),allowScreenRecording:o(),captureConsoleLogs:l(),attachmentCount:0,maxAttachments:5}))}Zt(()=>{c(u)&&c(f)&&(Ee("fortalece:opened"),zt(),ce())});var sn={get embedId(){return n()},set embedId($){n($),G()},get embedUrl(){return r()},set embedUrl($="https://app.fortalece.ai"){r($),G()},get position(){return i()},set position($="bottom-right"){i($),G()},get showHeader(){return s()},set showHeader($="true"){s($),G()},get allowAttachments(){return a()},set allowAttachments($=!0){a($),G()},get allowScreenRecording(){return o()},set allowScreenRecording($=!0){o($),G()},get captureConsoleLogs(){return l()},set captureConsoleLogs($=!0){l($),G()}},Ze=Bs(),an=M(Ze);{var Wn=$=>{var P=Ls();P.__click=wt;var ue=F(M(P),2),ze=M(ue,!0);R(ue),_n(2),R(P),Q(()=>Je(ze,c(_))),L($,P)},qn=$=>{var P=gs(),ue=Rr(P);{var ze=Xe=>{var ot=Us();ot.__click=O;var It=M(ot);{var Gn=ge=>{var Ne=Ps(),v=M(Ne,!0);R(Ne),Q(()=>Je(v,c(h)>9?"9+":c(h))),L(ge,Ne)};q(It,ge=>{c(h)>0&&!c(u)&&ge(Gn)})}var fn=F(It,2);{var Kn=ge=>{var Ne=Fs();L(ge,Ne)},Ot=ge=>{var Ne=Ns();L(ge,Ne)};q(fn,ge=>{c(u)?ge(Kn):ge(Ot,!1)})}R(ot),Q(()=>nn(ot,"aria-label",c(u)?"Close chat":"Open chat")),L(Xe,ot)};q(ue,Xe=>{c(J)&&Xe(ze)},!0)}L($,P)};q(an,$=>{c(g)?$(Wn):$(qn,!1)})}var yt=F(an,2);let on,ln;var cn=M(yt);{var Vn=$=>{var P=js();L($,P)};q(cn,$=>{c(f)||$(Vn)})}var Mt=F(cn,2);let un;return Nn(Mt,$=>m(I,$),()=>c(I)),R(yt),R(Ze),Q(()=>{Fn(Ze,c(Te)),on=bt(yt,1,"chat-window svelte-1105cax",null,on,{"chat-window-hidden":!c(u),"chat-window-fullscreen":c(d)}),ln=Fn(yt,"",ln,{bottom:c(d)?void 0:c(J)?"4.5rem":"0"}),nn(Mt,"src",c(Fe)),un=bt(Mt,1,"svelte-1105cax",null,un,{hidden:!c(f)})}),L(e,Ze),wn(sn)}Qr(["click"]),customElements.define("support-chat",di(pi,{embedId:{attribute:"embed-id",reflect:!0},embedUrl:{attribute:"embed-url",reflect:!0},position:{attribute:"position",reflect:!0},showHeader:{attribute:"show-header",reflect:!0},allowAttachments:{attribute:"allow-attachments",reflect:!0,type:"Boolean"},allowScreenRecording:{attribute:"allow-screen-recording",reflect:!0,type:"Boolean"},captureConsoleLogs:{attribute:"capture-console-logs",reflect:!0,type:"Boolean"}},[],[],{mode:"open"}));var Ws=j('<div class="recording-indicator svelte-p7nz7"><div class="recording-dot svelte-p7nz7"></div> <span class="svelte-p7nz7">Recording...</span> <button class="stop-recording-btn svelte-p7nz7">Stop</button></div>'),qs=j('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📎</span> <span class="svelte-p7nz7">Add File</span></button>'),Vs=j('<button class="capture-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">📸</span> <span class="svelte-p7nz7">Screenshot</span></button> <button class="capture-btn record-btn svelte-p7nz7"><span class="capture-icon svelte-p7nz7">🔴</span> <span class="svelte-p7nz7">Record Screen</span></button>',1),Gs=j('<div class="attachment-item svelte-p7nz7"><span class="attachment-icon svelte-p7nz7"> </span> <div class="attachment-info svelte-p7nz7"><span class="attachment-name svelte-p7nz7"> </span> <span class="attachment-size svelte-p7nz7"> </span></div> <button class="remove-attachment-btn svelte-p7nz7">✕</button></div>'),Ks=j('<div class="attachment-list svelte-p7nz7"><div class="attachment-header svelte-p7nz7"><span class="svelte-p7nz7"> </span></div> <!></div>'),Js=j('<div class="console-info svelte-p7nz7"><span class="console-icon svelte-p7nz7">🔧</span> <span class="svelte-p7nz7"> </span></div>'),Ys=j('<div class="capture-panel svelte-p7nz7"><div class="capture-panel-header svelte-p7nz7"><span class="svelte-p7nz7">Capture</span> <button class="close-capture-btn svelte-p7nz7">✕</button></div> <div class="capture-actions svelte-p7nz7"><!> <!></div> <!> <!></div>'),Zs=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Xs=tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path fill-rule="evenodd" d="M4.848 2.771A49.144 49.144 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52 1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97a48.901 48.901 0 0 1-3.476.383.39.39 0 0 0-.297.17l-2.755 4.133a.75.75 0 0 1-1.248 0l-2.755-4.133a.39.39 0 0 0-.297-.17 48.9 48.9 0 0 1-3.476-.384c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg>'),Qs=j('<button class="toggle-btn svelte-p7nz7"><!></button>'),ea=j('<span class="badge svelte-p7nz7"> </span>'),ta=j('<button aria-label="Toggle capture panel"><!> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon svelte-p7nz7"><path d="M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" class="svelte-p7nz7"></path><path fill-rule="evenodd" d="M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3H4.5a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" class="svelte-p7nz7"></path></svg></button>'),na=j('<div class="loading-state svelte-p7nz7"><div class="loading-spinner svelte-p7nz7"></div> <p class="svelte-p7nz7">Loading...</p></div>'),ra=j('<div><!> <iframe title="Feedback Panel" sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation" allow="clipboard-write; display-capture; microphone"></iframe></div>'),ia=j('<div><!> <!> <!> <!> <input type="file" accept="image/*,audio/*,video/*" multiple style="display: none;" class="svelte-p7nz7"/> <!></div>');const sa={hash:"svelte-p7nz7",code:`
|
|
46
46
|
/* Host element styling for inline mode */:host {display:block;}:host([display="inline"]) {display:block;width:100%;height:100%;}.svelte-p7nz7 {box-sizing:border-box;margin:0;padding:0;}.feedback-panel.svelte-p7nz7 {--primary-color: #6366f1;--danger-color: #ef4444;--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
|
|
47
47
|
0 8px 10px -6px rgba(0, 0, 0, 0.1);position:fixed;bottom:1rem;z-index:9999;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
48
48
|
"Helvetica Neue", Arial, sans-serif;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walker-di/fortalece-ai-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fortalece AI Web Components SDK - Support Chat and Feedback widgets",
|
|
6
6
|
"author": "Fortalece AI",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@chromatic-com/storybook": "^4.1.3",
|
|
90
90
|
"@inlang/paraglide-js": "^2.5.0",
|
|
91
|
-
"@playwright/test": "^1.
|
|
91
|
+
"@playwright/test": "^1.59.1",
|
|
92
92
|
"@storybook/addon-a11y": "^10.1.6",
|
|
93
93
|
"@storybook/addon-docs": "^10.1.6",
|
|
94
94
|
"@storybook/addon-svelte-csf": "^5.0.10",
|