@vunex/support-chat 1.0.0

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.
@@ -0,0 +1,9 @@
1
+ (function(V,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(V=typeof globalThis<"u"?globalThis:V||self,r(V.GigSupportChat={},V.Vue))})(this,(function(V,r){"use strict";function G(s,e,t){return Array.isArray(s)?(s.length=Math.max(s.length,e),s.splice(e,1,t),t):(s[e]=t,t)}function ae(s,e){if(Array.isArray(s)){s.splice(e,1);return}delete s[e]}/*!
2
+ * pinia v2.3.1
3
+ * (c) 2025 Eduardo San Martin Morote
4
+ * @license MIT
5
+ */let q;const J=s=>q=s,Ze=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function P(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}var $;(function(s){s.direct="direct",s.patchObject="patch object",s.patchFunction="patch function"})($||($={}));const F=typeof window<"u";function Te(s,e){for(const t in e){const n=e[t];if(!(t in s))continue;const i=s[t];P(i)&&P(n)&&!r.isRef(n)&&!r.isReactive(n)?s[t]=Te(i,n):s[t]=n}return s}const Oe=()=>{};function xe(s,e,t,n=Oe){s.push(e);const i=()=>{const o=s.indexOf(e);o>-1&&(s.splice(o,1),n())};return!t&&r.getCurrentScope()&&r.onScopeDispose(i),i}function I(s,...e){s.slice().forEach(t=>{t(...e)})}const et=s=>s(),Re=Symbol(),ce=Symbol();function le(s,e){s instanceof Map&&e instanceof Map?e.forEach((t,n)=>s.set(n,t)):s instanceof Set&&e instanceof Set&&e.forEach(s.add,s);for(const t in e){if(!e.hasOwnProperty(t))continue;const n=e[t],i=s[t];P(i)&&P(n)&&s.hasOwnProperty(t)&&!r.isRef(n)&&!r.isReactive(n)?s[t]=le(i,n):s[t]=n}return s}const tt=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function st(s){return!P(s)||!s.hasOwnProperty(tt)}const{assign:C}=Object;function Be(s){return!!(r.isRef(s)&&s.effect)}function Ae(s,e,t,n){const{state:i,actions:o,getters:l}=e,h=t.state.value[s];let u;function f(){!h&&(process.env.NODE_ENV==="production"||!n)&&(t.state.value[s]=i?i():{});const p=process.env.NODE_ENV!=="production"&&n?r.toRefs(r.ref(i?i():{}).value):r.toRefs(t.state.value[s]);return C(p,o,Object.keys(l||{}).reduce((g,w)=>(process.env.NODE_ENV!=="production"&&w in p&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${w}" in store "${s}".`),g[w]=r.markRaw(r.computed(()=>{J(t);const N=t._s.get(s);return l[w].call(N,N)})),g),{}))}return u=he(s,f,e,t,n,!0),u}function he(s,e,t={},n,i,o){let l;const h=C({actions:{}},t);if(process.env.NODE_ENV!=="production"&&!n._e.active)throw new Error("Pinia destroyed");const u={deep:!0};process.env.NODE_ENV!=="production"&&(u.onTrigger=a=>{f?N=a:f==!1&&!d._hotUpdating&&(Array.isArray(N)?N.push(a):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let f,p,g=[],w=[],N;const T=n.state.value[s];!o&&!T&&(process.env.NODE_ENV==="production"||!i)&&(n.state.value[s]={});const U=r.ref({});let z;function j(a){let c;f=p=!1,process.env.NODE_ENV!=="production"&&(N=[]),typeof a=="function"?(a(n.state.value[s]),c={type:$.patchFunction,storeId:s,events:N}):(le(n.state.value[s],a),c={type:$.patchObject,payload:a,storeId:s,events:N});const _=z=Symbol();r.nextTick().then(()=>{z===_&&(f=!0)}),p=!0,I(g,c,n.state.value[s])}const D=o?function(){const{state:c}=t,_=c?c():{};this.$patch(O=>{C(O,_)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${s}" is built using the setup syntax and does not implement $reset().`)}:Oe;function oe(){l.stop(),g=[],w=[],n._s.delete(s)}const k=(a,c="")=>{if(Re in a)return a[ce]=c,a;const _=function(){J(n);const O=Array.from(arguments),Y=[],Se=[];function Bs(x){Y.push(x)}function As(x){Se.push(x)}I(w,{args:O,name:_[ce],store:d,after:Bs,onError:As});let X;try{X=a.apply(this&&this.$id===s?this:d,O)}catch(x){throw I(Se,x),x}return X instanceof Promise?X.then(x=>(I(Y,x),x)).catch(x=>(I(Se,x),Promise.reject(x))):(I(Y,X),X)};return _[Re]=!0,_[ce]=c,_},E=r.markRaw({actions:{},getters:{},state:[],hotState:U}),v={_p:n,$id:s,$onAction:xe.bind(null,w),$patch:j,$reset:D,$subscribe(a,c={}){const _=xe(g,a,c.detached,()=>O()),O=l.run(()=>r.watch(()=>n.state.value[s],Y=>{(c.flush==="sync"?p:f)&&a({storeId:s,type:$.direct,events:N},Y)},C({},u,c)));return _},$dispose:oe},d=r.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&F?C({_hmrPayload:E,_customProperties:r.markRaw(new Set)},v):v);n._s.set(s,d);const m=(n._a&&n._a.runWithContext||et)(()=>n._e.run(()=>(l=r.effectScope()).run(()=>e({action:k}))));for(const a in m){const c=m[a];if(r.isRef(c)&&!Be(c)||r.isReactive(c))process.env.NODE_ENV!=="production"&&i?G(U.value,a,r.toRef(m,a)):o||(T&&st(c)&&(r.isRef(c)?c.value=T[a]:le(c,T[a])),n.state.value[s][a]=c),process.env.NODE_ENV!=="production"&&E.state.push(a);else if(typeof c=="function"){const _=process.env.NODE_ENV!=="production"&&i?c:k(c,a);m[a]=_,process.env.NODE_ENV!=="production"&&(E.actions[a]=c),h.actions[a]=c}else process.env.NODE_ENV!=="production"&&Be(c)&&(E.getters[a]=o?t.getters[a]:c,F&&(m._getters||(m._getters=r.markRaw([]))).push(a))}if(C(d,m),C(r.toRaw(d),m),Object.defineProperty(d,"$state",{get:()=>process.env.NODE_ENV!=="production"&&i?U.value:n.state.value[s],set:a=>{if(process.env.NODE_ENV!=="production"&&i)throw new Error("cannot set hotState");j(c=>{C(c,a)})}}),process.env.NODE_ENV!=="production"&&(d._hotUpdate=r.markRaw(a=>{d._hotUpdating=!0,a._hmrPayload.state.forEach(c=>{if(c in d.$state){const _=a.$state[c],O=d.$state[c];typeof _=="object"&&P(_)&&P(O)?Te(_,O):a.$state[c]=O}G(d,c,r.toRef(a.$state,c))}),Object.keys(d.$state).forEach(c=>{c in a.$state||ae(d,c)}),f=!1,p=!1,n.state.value[s]=r.toRef(a._hmrPayload,"hotState"),p=!0,r.nextTick().then(()=>{f=!0});for(const c in a._hmrPayload.actions){const _=a[c];G(d,c,k(_,c))}for(const c in a._hmrPayload.getters){const _=a._hmrPayload.getters[c],O=o?r.computed(()=>(J(n),_.call(d,d))):_;G(d,c,O)}Object.keys(d._hmrPayload.getters).forEach(c=>{c in a._hmrPayload.getters||ae(d,c)}),Object.keys(d._hmrPayload.actions).forEach(c=>{c in a._hmrPayload.actions||ae(d,c)}),d._hmrPayload=a._hmrPayload,d._getters=a._getters,d._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&F){const a={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(c=>{Object.defineProperty(d,c,C({value:d[c]},a))})}return n._p.forEach(a=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&F){const c=l.run(()=>a({store:d,app:n._a,pinia:n,options:h}));Object.keys(c||{}).forEach(_=>d._customProperties.add(_)),C(d,c)}else C(d,l.run(()=>a({store:d,app:n._a,pinia:n,options:h})))}),process.env.NODE_ENV!=="production"&&d.$state&&typeof d.$state=="object"&&typeof d.$state.constructor=="function"&&!d.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
6
+ state: () => new MyClass()
7
+ Found in store "${d.$id}".`),T&&o&&t.hydrate&&t.hydrate(d.$state,T),f=!0,p=!0,d}/*! #__NO_SIDE_EFFECTS__ */function nt(s,e,t){let n,i;const o=typeof e=="function";n=s,i=o?t:e;function l(h,u){const f=r.hasInjectionContext();if(h=(process.env.NODE_ENV==="test"&&q&&q._testing?null:h)||(f?r.inject(Ze,null):null),h&&J(h),process.env.NODE_ENV!=="production"&&!q)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
8
+ See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
9
+ This will fail in production.`);h=q,h._s.has(n)||(o?he(n,e,i,h):Ae(n,i,h),process.env.NODE_ENV!=="production"&&(l._pinia=h));const p=h._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const g="__hot:"+n,w=o?he(g,e,i,h,!0):Ae(g,C({},i),h,!0);u._hotUpdate(w),delete h.state.value[g],h._s.delete(g)}if(process.env.NODE_ENV!=="production"&&F){const g=r.getCurrentInstance();if(g&&g.proxy&&!u){const w=g.proxy,N="_pStores"in w?w._pStores:w._pStores={};N[n]=p}}return p}return l.$id=n,l}const B=Object.create(null);B.open="0",B.close="1",B.ping="2",B.pong="3",B.message="4",B.upgrade="5",B.noop="6";const Q=Object.create(null);Object.keys(B).forEach(s=>{Q[B[s]]=s});const ue={type:"error",data:"parser error"},Ve=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Le=typeof ArrayBuffer=="function",Pe=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,fe=({type:s,data:e},t,n)=>Ve&&e instanceof Blob?t?n(e):De(e,n):Le&&(e instanceof ArrayBuffer||Pe(e))?t?n(e):De(new Blob([e]),n):n(B[s]+(e||"")),De=(s,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(s)};function Ie(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let de;function rt(s,e){if(Ve&&s.data instanceof Blob)return s.data.arrayBuffer().then(Ie).then(e);if(Le&&(s.data instanceof ArrayBuffer||Pe(s.data)))return e(Ie(s.data));fe(s,!1,t=>{de||(de=new TextEncoder),e(de.encode(t))})}const Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",H=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Me.length;s++)H[Me.charCodeAt(s)]=s;const it=s=>{let e=s.length*.75,t=s.length,n,i=0,o,l,h,u;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);const f=new ArrayBuffer(e),p=new Uint8Array(f);for(n=0;n<t;n+=4)o=H[s.charCodeAt(n)],l=H[s.charCodeAt(n+1)],h=H[s.charCodeAt(n+2)],u=H[s.charCodeAt(n+3)],p[i++]=o<<2|l>>4,p[i++]=(l&15)<<4|h>>2,p[i++]=(h&3)<<6|u&63;return f},ot=typeof ArrayBuffer=="function",pe=(s,e)=>{if(typeof s!="string")return{type:"message",data:Ue(s,e)};const t=s.charAt(0);return t==="b"?{type:"message",data:at(s.substring(1),e)}:Q[t]?s.length>1?{type:Q[t],data:s.substring(1)}:{type:Q[t]}:ue},at=(s,e)=>{if(ot){const t=it(s);return Ue(t,e)}else return{base64:!0,data:s}},Ue=(s,e)=>{switch(e){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},qe="",ct=(s,e)=>{const t=s.length,n=new Array(t);let i=0;s.forEach((o,l)=>{fe(o,!1,h=>{n[l]=h,++i===t&&e(n.join(qe))})})},lt=(s,e)=>{const t=s.split(qe),n=[];for(let i=0;i<t.length;i++){const o=pe(t[i],e);if(n.push(o),o.type==="error")break}return n};function ht(){return new TransformStream({transform(s,e){rt(s,t=>{const n=t.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,n)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(n))}s.data&&typeof s.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let ge;function Z(s){return s.reduce((e,t)=>e+t.length,0)}function ee(s,e){if(s[0].length===e)return s.shift();const t=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)t[i]=s[0][n++],n===s[0].length&&(s.shift(),n=0);return s.length&&n<s[0].length&&(s[0]=s[0].slice(n)),t}function ut(s,e){ge||(ge=new TextDecoder);const t=[];let n=0,i=-1,o=!1;return new TransformStream({transform(l,h){for(t.push(l);;){if(n===0){if(Z(t)<1)break;const u=ee(t,1);o=(u[0]&128)===128,i=u[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(Z(t)<2)break;const u=ee(t,2);i=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),n=3}else if(n===2){if(Z(t)<8)break;const u=ee(t,8),f=new DataView(u.buffer,u.byteOffset,u.length),p=f.getUint32(0);if(p>Math.pow(2,21)-1){h.enqueue(ue);break}i=p*Math.pow(2,32)+f.getUint32(4),n=3}else{if(Z(t)<i)break;const u=ee(t,i);h.enqueue(pe(o?u:ge.decode(u),e)),n=0}if(i===0||i>s){h.enqueue(ue);break}}}})}const $e=4;function b(s){if(s)return ft(s)}function ft(s){for(var e in b.prototype)s[e]=b.prototype[e];return s}b.prototype.on=b.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this},b.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this},b.prototype.off=b.prototype.removeListener=b.prototype.removeAllListeners=b.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+s],this},b.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this},b.prototype.emitReserved=b.prototype.emit,b.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]},b.prototype.hasListeners=function(s){return!!this.listeners(s).length};const te=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),S=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),dt="arraybuffer";function Vs(){}function Fe(s,...e){return e.reduce((t,n)=>(s.hasOwnProperty(n)&&(t[n]=s[n]),t),{})}const pt=S.setTimeout,gt=S.clearTimeout;function se(s,e){e.useNativeTimers?(s.setTimeoutFn=pt.bind(S),s.clearTimeoutFn=gt.bind(S)):(s.setTimeoutFn=S.setTimeout.bind(S),s.clearTimeoutFn=S.clearTimeout.bind(S))}const mt=1.33;function yt(s){return typeof s=="string"?_t(s):Math.ceil((s.byteLength||s.size)*mt)}function _t(s){let e=0,t=0;for(let n=0,i=s.length;n<i;n++)e=s.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function He(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Et(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function wt(s){let e={},t=s.split("&");for(let n=0,i=t.length;n<i;n++){let o=t[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class bt extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class me extends b{constructor(e){super(),this.writable=!1,se(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new bt(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=pe(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Et(e);return t.length?"?"+t:""}}class kt extends me{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};lt(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,ct(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=He()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let We=!1;try{We=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const vt=We;function Nt(){}class Ct extends kt{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class A extends b{constructor(e,t,n){super(),this.createRequest=e,se(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=Fe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=A.requestsCount++,A.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Nt,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete A.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(A.requestsCount=0,A.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ze);else if(typeof addEventListener=="function"){const s="onpagehide"in S?"pagehide":"unload";addEventListener(s,ze,!1)}}function ze(){for(let s in A.requests)A.requests.hasOwnProperty(s)&&A.requests[s].abort()}const St=(function(){const s=je({xdomain:!1});return s&&s.responseType!==null})();class Tt extends Ct{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=St&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new A(je,this.uri(),e)}}function je(s){const e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||vt))return new XMLHttpRequest}catch{}if(!e)try{return new S[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ke=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ot extends me{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Ke?{}:Fe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;fe(n,this.supportsBinary,o=>{try{this.doWrite(n,o)}catch{}i&&te(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=He()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const ye=S.WebSocket||S.MozWebSocket;class xt extends Ot{createSocket(e,t,n){return Ke?new ye(e,t,n):t?new ye(e,t):new ye(e)}doWrite(e,t){this.ws.send(t)}}class Rt extends me{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=ut(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),i=ht();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{n.read().then(({done:h,value:u})=>{h||(this.onPacket(u),o())}).catch(h=>{})};o();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;this._writer.write(n).then(()=>{i&&te(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Bt={websocket:xt,webtransport:Rt,polling:Tt},At=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Vt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _e(s){if(s.length>8e3)throw"URI too long";const e=s,t=s.indexOf("["),n=s.indexOf("]");t!=-1&&n!=-1&&(s=s.substring(0,t)+s.substring(t,n).replace(/:/g,";")+s.substring(n,s.length));let i=At.exec(s||""),o={},l=14;for(;l--;)o[Vt[l]]=i[l]||"";return t!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Lt(o,o.path),o.queryKey=Pt(o,o.query),o}function Lt(s,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Pt(s,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,o){i&&(t[i]=o)}),t}const Ee=typeof addEventListener=="function"&&typeof removeEventListener=="function",ne=[];Ee&&addEventListener("offline",()=>{ne.forEach(s=>s())},!1);class L extends b{constructor(e,t){if(super(),this.binaryType=dt,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=_e(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=_e(t.host).host);se(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=wt(this.opts.query)),Ee&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ne.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=$e,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&L.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",L.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(t+=yt(i)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,te(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,i){if(typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(L.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ee&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=ne.indexOf(this._offlineEventListener);n!==-1&&ne.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}L.protocol=$e;class Dt extends L{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;L.priorWebsocketSuccess=!1;const i=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",g=>{if(!n)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;L.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=t.name,this.emitReserved("upgradeError",w)}}))};function o(){n||(n=!0,p(),t.close(),t=null)}const l=g=>{const w=new Error("probe error: "+g);w.transport=t.name,o(),this.emitReserved("upgradeError",w)};function h(){l("transport closed")}function u(){l("socket closed")}function f(g){t&&g.name!==t.name&&o()}const p=()=>{t.removeListener("open",i),t.removeListener("error",l),t.removeListener("close",h),this.off("close",u),this.off("upgrading",f)};t.once("open",i),t.once("error",l),t.once("close",h),this.once("close",u),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let It=class extends Dt{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>Bt[i]).filter(i=>!!i)),super(e,n)}};function Mt(s,e="",t){let n=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),n=_e(s)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(t&&t.port===n.port?"":":"+n.port),n}const Ut=typeof ArrayBuffer=="function",qt=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Ye=Object.prototype.toString,$t=typeof Blob=="function"||typeof Blob<"u"&&Ye.call(Blob)==="[object BlobConstructor]",Ft=typeof File=="function"||typeof File<"u"&&Ye.call(File)==="[object FileConstructor]";function we(s){return Ut&&(s instanceof ArrayBuffer||qt(s))||$t&&s instanceof Blob||Ft&&s instanceof File}function re(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,n=s.length;t<n;t++)if(re(s[t]))return!0;return!1}if(we(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return re(s.toJSON(),!0);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&re(s[t]))return!0;return!1}function Ht(s){const e=[],t=s.data,n=s;return n.data=be(t,e),n.attachments=e.length,{packet:n,buffers:e}}function be(s,e){if(!s)return s;if(we(s)){const t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){const t=new Array(s.length);for(let n=0;n<s.length;n++)t[n]=be(s[n],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){const t={};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=be(s[n],e));return t}return s}function Wt(s,e){return s.data=ke(s.data,e),delete s.attachments,s}function ke(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=ke(s[t],e);else if(typeof s=="object")for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=ke(s[t],e));return s}const zt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var y;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(y||(y={}));class jt{constructor(e){this.replacer=e}encode(e){return(e.type===y.EVENT||e.type===y.ACK)&&re(e)?this.encodeAsBinary({type:e.type===y.EVENT?y.BINARY_EVENT:y.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===y.BINARY_EVENT||e.type===y.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Ht(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}}class ve extends b{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===y.BINARY_EVENT;n||t.type===y.BINARY_ACK?(t.type=n?y.EVENT:y.ACK,this.reconstructor=new Kt(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(we(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(y[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===y.BINARY_EVENT||n.type===y.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const l=e.substring(o,t);if(l!=Number(l)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(l)}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(o,t)}else n.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const o=t+1;for(;++t;){const l=e.charAt(t);if(l==null||Number(l)!=l){--t;break}if(t===e.length)break}n.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(ve.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case y.CONNECT:return Xe(t);case y.DISCONNECT:return t===void 0;case y.CONNECT_ERROR:return typeof t=="string"||Xe(t);case y.EVENT:case y.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&zt.indexOf(t[0])===-1);case y.ACK:case y.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Kt{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Wt(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Xe(s){return Object.prototype.toString.call(s)==="[object Object]"}const Yt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ve,Encoder:jt,get PacketType(){return y}},Symbol.toStringTag,{value:"Module"}));function R(s,e,t){return s.on(e,t),function(){s.off(e,t)}}const Xt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ge extends b{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[R(e,"open",this.onopen.bind(this)),R(e,"packet",this.onpacket.bind(this)),R(e,"error",this.onerror.bind(this)),R(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,i,o;if(Xt.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const l={type:y.EVENT,data:t};if(l.options={},l.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const p=this.ids++,g=t.pop();this._registerAckCallback(p,g),l.id=p}const h=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,u=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!h||(u?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l)),this.flags={},this}_registerAckCallback(e,t){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===e&&this.sendBuffer.splice(h,1);t.call(this,new Error("operation has timed out"))},i),l=(...h)=>{this.io.clearTimeoutFn(o),t.apply(this,h)};l.withError=!0,this.acks[e]=l}emitWithAck(e,...t){return new Promise((n,i)=>{const o=(l,h)=>l?i(l):n(h);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...o)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:y.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case y.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case y.EVENT:case y.BINARY_EVENT:this.onevent(e);break;case y.ACK:case y.BINARY_ACK:this.onack(e);break;case y.DISCONNECT:this.ondisconnect();break;case y.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...i){n||(n=!0,t.packet({type:y.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:y.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function M(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}M.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=(Math.floor(e*10)&1)==0?s-t:s+t}return Math.min(s,this.max)|0},M.prototype.reset=function(){this.attempts=0},M.prototype.setMin=function(s){this.ms=s},M.prototype.setMax=function(s){this.max=s},M.prototype.setJitter=function(s){this.jitter=s};class Ne extends b{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,se(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new M({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||Yt;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new It(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=R(t,"open",function(){n.onopen(),e&&e()}),o=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),e?e(h):this.maybeReconnectOnOpen()},l=R(t,"error",o);if(this._timeout!==!1){const h=this._timeout,u=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),t.close()},h);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(i),this.subs.push(l),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(R(e,"ping",this.onping.bind(this)),R(e,"data",this.ondata.bind(this)),R(e,"error",this.onerror.bind(this)),R(e,"close",this.onclose.bind(this)),R(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){te(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ge(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const W={};function ie(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};const t=Mt(s,e.path||"/socket.io"),n=t.source,i=t.id,o=t.path,l=W[i]&&o in W[i].nsps,h=e.forceNew||e["force new connection"]||e.multiplex===!1||l;let u;return h?u=new Ne(n,e):(W[i]||(W[i]=new Ne(n,e)),u=W[i]),t.query&&!e.query&&(e.query=t.queryKey),u.socket(t.path,e)}Object.assign(ie,{Manager:Ne,Socket:Ge,io:ie,connect:ie});const Ce=nt("gigSupportChat",()=>{const s=r.ref(null),e=r.ref([]),t=r.ref(!1),n=r.ref(!1),i=r.ref(0),o=r.ref(""),l=r.ref([]),h=r.ref(!1),u=r.ref(null),f=r.ref(null),p=k=>{f.value=k},g=()=>{var k;(k=s.value)!=null&&k.connected||!f.value||(s.value=ie(f.value.apiUrl,{path:f.value.path||"/ws",transports:["websocket","polling"],auth:{apiKey:f.value.apiKey,uuid:f.value.uuid,metaUser:f.value.metaUser}}),s.value.on("connect",()=>{console.log("[GigSupportChat] Connected"),t.value=!0}),s.value.on("connected",E=>{console.log("[GigSupportChat] Registered as:",E.userId),o.value=E.userId,T()}),s.value.on("disconnect",()=>{console.log("[GigSupportChat] Disconnected"),t.value=!1}),s.value.on("new_message",E=>{E.status==="SUCCESS"&&(e.value.find(v=>v.id===E.message.id)||(e.value.push(E.message),n.value||i.value++))}),s.value.on("message_sent",E=>{E.status==="SUCCESS"&&(e.value.find(v=>v.id===E.message.id)||e.value.push(E.message))}),s.value.on("history",E=>{E.status==="SUCCESS"&&(e.value=E.messages)}),s.value.on("error",E=>{console.error("[GigSupportChat] Socket error:",E)}))},w=()=>{s.value&&(s.value.disconnect(),s.value=null),t.value=!1,e.value=[],i.value=0,o.value=""},N=k=>{var E,v;!s.value||!t.value||(s.value.emit("send_message",{userId:o.value,text:k,replyToMessageId:(E=u.value)==null?void 0:E.id,metaUser:(v=f.value)==null?void 0:v.metaUser}),u.value=null)},T=()=>{!s.value||!o.value||s.value.emit("get_history",{userId:o.value,limit:50,offset:0})};return{messages:e,isConnected:t,isWidgetOpen:n,unreadCount:i,currentUserId:o,stickers:l,isLoadingStickers:h,replyingToMessage:u,init:p,connect:g,disconnect:w,sendMessage:N,sendSticker:k=>{var E,v;!s.value||!t.value||(s.value.emit("send_message",{userId:o.value,stickerId:k,messageType:"sticker",replyToMessageId:(E=u.value)==null?void 0:E.id,metaUser:(v=f.value)==null?void 0:v.metaUser}),u.value=null)},fetchStickers:async()=>{var k;if((k=f.value)!=null&&k.apiUrl){h.value=!0;try{const v=await(await fetch(`${f.value.apiUrl}/api/v1.0/stickers?activeOnly=true`,{headers:{"x-api-key":f.value.apiKey||""}})).json();v.status==="SUCCESS"&&(l.value=v.content)}catch(E){console.error("[GigSupportChat] Error fetching stickers:",E)}finally{h.value=!1}}},toggleWidget:()=>{n.value=!n.value,n.value&&(i.value=0)},loadHistory:T,startReply:k=>{u.value=k},cancelReply:()=>{u.value=null}}}),Gt=["data-message-id"],Jt={key:0,class:"gig-message-author"},Qt={class:"gig-author-name"},Zt={class:"gig-reply-author"},es={class:"gig-reply-text"},ts=["src","alt"],ss=["innerHTML"],ns={class:"gig-message-meta"},rs={class:"gig-message-time"},is=r.defineComponent({__name:"ChatMessage",props:{message:{},currentUserId:{}},emits:["reply","scroll-to"],setup(s){const e=s,t=r.computed(()=>e.message.userId===e.currentUserId),n=l=>new Date(l).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),i=l=>{if(!l||l==="GIGMARKET Support")return l;const h=l.trim().split(/\s+/);return h.length>=2&&h[1]?`${h[0]} ${h[1][0]}.`:l},o=l=>{if(!l)return"";const u=(p=>p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"))(l),f=/(https?:\/\/[^\s<]+[^\s<.,;:!?'")\]}>])/gi;return u.replace(f,p=>`<a href="${p.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'")}" target="_blank" rel="noopener noreferrer">${p}</a>`)};return(l,h)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["gig-message-wrapper",t.value?"sent":"received"]),"data-message-id":s.message.id},[t.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Jt,[h[2]||(h[2]=r.createElementVNode("div",{class:"gig-author-avatar"},"GP",-1)),r.createElementVNode("span",Qt,r.toDisplayString(i(s.message.userName||"Support")),1)])),r.createElementVNode("div",{class:r.normalizeClass(["gig-message-bubble",s.message.messageType==="sticker"?"is-sticker":""])},[s.message.replyToMessage?(r.openBlock(),r.createElementBlock("div",{key:0,class:"gig-reply-preview",onClick:h[0]||(h[0]=u=>l.$emit("scroll-to",s.message.replyToMessageId))},[r.createElementVNode("div",Zt,r.toDisplayString(s.message.replyToMessage.userId===s.currentUserId?"Вы":i(s.message.replyToMessage.userName||"Support")),1),r.createElementVNode("div",es,r.toDisplayString(s.message.replyToMessage.messageType==="sticker"?"[Стикер]":s.message.replyToMessage.text),1)])):r.createCommentVNode("",!0),s.message.messageType==="sticker"&&s.message.sticker?(r.openBlock(),r.createElementBlock("img",{key:1,src:`data:${s.message.sticker.mimeType||"image/png"};base64,${s.message.sticker.base64}`,class:"gig-sticker-img",alt:s.message.sticker.name},null,8,ts)):(r.openBlock(),r.createElementBlock("div",{key:2,class:"gig-message-text",innerHTML:o(s.message.text||"")},null,8,ss)),r.createElementVNode("div",ns,[r.createElementVNode("span",rs,r.toDisplayString(n(s.message.createdAt)),1)]),r.createElementVNode("button",{class:"gig-message-reply-btn",onClick:h[1]||(h[1]=u=>l.$emit("reply",s.message))},[...h[3]||(h[3]=[r.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2"},[r.createElementVNode("polyline",{points:"9 17 4 12 9 7"}),r.createElementVNode("path",{d:"M20 18v-2a4 4 0 0 0-4-4H4"})],-1)])])],2)],10,Gt))}}),Je=(s,e)=>{const t=s.__vccOpts||s;for(const[n,i]of e)t[n]=i;return t},os=Je(is,[["__scopeId","data-v-0f2196d9"]]),as={class:"gig-header-info"},cs={class:"gig-status-area"},ls={class:"gig-status-text"},hs={key:0,class:"gig-empty-state"},us={key:0,class:"gig-sticker-picker"},fs={class:"gig-picker-header"},ds={class:"gig-sticker-grid"},ps={key:0,class:"gig-loading"},gs=["onClick"],ms=["src","alt"],ys={key:0,class:"gig-reply-bar"},_s={class:"gig-reply-content"},Es={class:"gig-reply-title"},ws={class:"gig-reply-preview"},bs={class:"gig-chat-input-area"},ks={class:"gig-input-wrapper"},vs=["onKeydown"],Ns=["disabled"],Cs=Je(r.defineComponent({__name:"ChatWindow",props:{messages:{},isConnected:{type:Boolean},currentUserId:{}},emits:["close"],setup(s,{emit:e}){const t=s,n=Ce(),i=r.ref(""),o=r.ref(null),l=r.ref({x:30,y:110}),h=r.ref({width:440,height:600}),u=r.ref(!1),f=r.ref(null),p=r.ref({x:0,y:0,w:0,h:0}),g=r.ref(!1),w=()=>{g.value=!g.value,g.value&&n.stickers.length===0&&n.fetchStickers()},N=m=>{n.sendSticker(m),g.value=!1,D()},T=()=>{i.value.trim()&&(n.sendMessage(i.value),i.value="",D())},U=m=>m.userId===t.currentUserId?"вам":j(m.userName||"Support"),z=m=>m.messageType==="sticker"?"[Стикер]":m.text||"",j=m=>m.trim().split(/\s+/)[0],D=async()=>{await r.nextTick(),o.value&&(o.value.scrollTop=o.value.scrollHeight)},oe=m=>{var c;const a=(c=o.value)==null?void 0:c.querySelector(`[data-message-id="${m}"]`);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.classList.add("gig-highlight"),setTimeout(()=>a.classList.remove("gig-highlight"),2e3))},k=m=>{m.target.closest("button")||(u.value=!0,p.value={x:m.clientX+l.value.x,y:m.clientY+l.value.y,w:0,h:0},window.addEventListener("mousemove",E),window.addEventListener("mouseup",K))},E=m=>{u.value&&(l.value={x:p.value.x-m.clientX,y:p.value.y-m.clientY})},v=(m,a)=>{m.preventDefault(),f.value=a,p.value={x:m.clientX,y:m.clientY,w:h.value.width,h:h.value.height},window.addEventListener("mousemove",d),window.addEventListener("mouseup",K)},d=m=>{if(!f.value)return;const a=p.value.x-m.clientX,c=p.value.y-m.clientY;if(f.value==="left"||f.value==="corner"){const _=p.value.w+a;_>320&&_<800&&(h.value.width=_)}if(f.value==="top"||f.value==="corner"){const _=p.value.h+c;_>400&&_<900&&(h.value.height=_)}},K=()=>{u.value=!1,f.value=null,window.removeEventListener("mousemove",E),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",K)};return r.watch(()=>t.messages.length,D),r.onMounted(D),r.onUnmounted(K),(m,a)=>(r.openBlock(),r.createElementBlock("div",{class:"gig-chat-window",style:r.normalizeStyle({width:h.value.width+"px",height:h.value.height+"px",bottom:l.value.y+"px",right:l.value.x+"px",cursor:u.value?"grabbing":"auto"})},[r.createElementVNode("div",{class:"gig-resize-h gig-resize-left",onMousedown:a[0]||(a[0]=c=>v(c,"left"))},null,32),r.createElementVNode("div",{class:"gig-resize-h gig-resize-top",onMousedown:a[1]||(a[1]=c=>v(c,"top"))},null,32),r.createElementVNode("div",{class:"gig-resize-corner",onMousedown:a[2]||(a[2]=c=>v(c,"corner"))},null,32),r.createElementVNode("div",{class:"gig-chat-header",onMousedown:k},[a[13]||(a[13]=r.createElementVNode("div",{class:"gig-header-brand-overlay"},null,-1)),r.createElementVNode("div",as,[a[11]||(a[11]=r.createElementVNode("div",{class:"gig-header-avatar"},[r.createElementVNode("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},[r.createElementVNode("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])],-1)),r.createElementVNode("div",null,[a[10]||(a[10]=r.createElementVNode("h3",null,"Поддержка",-1)),r.createElementVNode("div",cs,[a[9]||(a[9]=r.createElementVNode("span",{class:"gig-status-pulse"},null,-1)),r.createElementVNode("span",ls,r.toDisplayString(s.isConnected?"В сети":"Подключение..."),1)])])]),r.createElementVNode("button",{onClick:a[3]||(a[3]=r.withModifiers(c=>m.$emit("close"),["stop"])),class:"gig-close-btn"},[...a[12]||(a[12]=[r.createElementVNode("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},[r.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])],32),r.createElementVNode("div",{class:"gig-messages-container",ref_key:"messagesContainer",ref:o},[s.messages.length===0?(r.openBlock(),r.createElementBlock("div",hs,[...a[14]||(a[14]=[r.createElementVNode("div",{class:"gig-empty-icon"},[r.createElementVNode("svg",{viewBox:"0 0 24 24",width:"40",height:"40",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[r.createElementVNode("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])],-1),r.createElementVNode("p",null,"Чем мы можем вам помочь?",-1)])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.messages,c=>(r.openBlock(),r.createBlock(os,{key:c.id,message:c,"current-user-id":s.currentUserId,onReply:a[4]||(a[4]=_=>r.unref(n).startReply(_)),onScrollTo:oe},null,8,["message","current-user-id"]))),128))],512),r.createVNode(r.Transition,{name:"gig-slide-up"},{default:r.withCtx(()=>[g.value?(r.openBlock(),r.createElementBlock("div",us,[r.createElementVNode("div",fs,[a[15]||(a[15]=r.createElementVNode("span",null,"Выберите стикер",-1)),r.createElementVNode("button",{onClick:a[5]||(a[5]=c=>g.value=!1),class:"gig-picker-close"},"×")]),r.createElementVNode("div",ds,[r.unref(n).isLoadingStickers?(r.openBlock(),r.createElementBlock("div",ps,"...")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(n).stickers,c=>(r.openBlock(),r.createElementBlock("div",{key:c.id,class:"gig-sticker-item",onClick:_=>N(c.id)},[r.createElementVNode("img",{src:`data:${c.mimeType||"image/png"};base64,${c.base64}`,alt:c.name},null,8,ms)],8,gs))),128))])])):r.createCommentVNode("",!0)]),_:1}),r.createVNode(r.Transition,{name:"gig-fade"},{default:r.withCtx(()=>[r.unref(n).replyingToMessage?(r.openBlock(),r.createElementBlock("div",ys,[a[16]||(a[16]=r.createElementVNode("div",{class:"gig-reply-line"},null,-1)),r.createElementVNode("div",_s,[r.createElementVNode("div",Es,"Ответ "+r.toDisplayString(U(r.unref(n).replyingToMessage)),1),r.createElementVNode("div",ws,r.toDisplayString(z(r.unref(n).replyingToMessage)),1)]),r.createElementVNode("button",{onClick:a[6]||(a[6]=c=>r.unref(n).cancelReply()),class:"gig-reply-close"},"×")])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",bs,[r.createElementVNode("div",ks,[r.createElementVNode("button",{class:r.normalizeClass(["gig-sticker-toggle",{active:g.value}]),onClick:w},[...a[17]||(a[17]=[r.createStaticVNode('<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" data-v-4a6ac4c2><circle cx="12" cy="12" r="10" data-v-4a6ac4c2></circle><path d="M8 14s1.5 2 4 2 4-2 4-2" data-v-4a6ac4c2></path><line x1="9" y1="9" x2="9.01" y2="9" data-v-4a6ac4c2></line><line x1="15" y1="9" x2="15.01" y2="9" data-v-4a6ac4c2></line></svg>',1)])],2),r.withDirectives(r.createElementVNode("textarea",{"onUpdate:modelValue":a[7]||(a[7]=c=>i.value=c),onKeydown:r.withKeys(r.withModifiers(T,["exact","prevent"]),["enter"]),placeholder:"Введите сообщение...",class:"gig-chat-input",rows:"1",onFocus:a[8]||(a[8]=c=>g.value=!1)},null,40,vs),[[r.vModelText,i.value]]),r.createElementVNode("button",{onClick:T,class:"gig-send-btn",disabled:!i.value.trim()},[...a[18]||(a[18]=[r.createElementVNode("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},[r.createElementVNode("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),r.createElementVNode("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})],-1)])],8,Ns)]),a[19]||(a[19]=r.createElementVNode("div",{class:"gig-powered-by"},[r.createElementVNode("span",null,"Powered by GIGMARKET")],-1))])],4))}}),[["__scopeId","data-v-4a6ac4c2"]]),Ss={class:"gig-chat-wrapper"},Ts={key:0,class:"gig-chat-badge"},Os={key:1,viewBox:"0 0 24 24",width:"32",height:"32",fill:"none",stroke:"white","stroke-width":"2"},xs={key:2,viewBox:"0 0 24 24",width:"32",height:"32",fill:"none",stroke:"white","stroke-width":"2"},Qe=r.defineComponent({__name:"GigSupportChat",props:{config:{}},setup(s){const e=s,t=Ce();return r.onMounted(()=>{t.init(e.config),t.connect()}),r.onUnmounted(()=>{t.disconnect()}),(n,i)=>(r.openBlock(),r.createElementBlock("div",Ss,[r.createVNode(r.Transition,{name:"gig-fade"},{default:r.withCtx(()=>[r.unref(t).isWidgetOpen?(r.openBlock(),r.createBlock(Cs,{key:0,messages:r.unref(t).messages,"is-connected":r.unref(t).isConnected,"current-user-id":r.unref(t).currentUserId,onSend:i[0]||(i[0]=o=>r.unref(t).sendMessage(o)),onClose:i[1]||(i[1]=o=>r.unref(t).toggleWidget())},null,8,["messages","is-connected","current-user-id"])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("button",{class:"gig-chat-trigger",onClick:i[2]||(i[2]=o=>r.unref(t).toggleWidget())},[r.unref(t).unreadCount>0?(r.openBlock(),r.createElementBlock("div",Ts,r.toDisplayString(r.unref(t).unreadCount),1)):r.createCommentVNode("",!0),r.unref(t).isWidgetOpen?(r.openBlock(),r.createElementBlock("svg",xs,[...i[4]||(i[4]=[r.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),r.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)])])):(r.openBlock(),r.createElementBlock("svg",Os,[...i[3]||(i[3]=[r.createElementVNode("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},null,-1)])]))])]))}}),Rs={install:s=>{s.component("GigSupportChat",Qe)}};V.GigSupportChat=Qe,V.default=Rs,V.useSupportChat=Ce,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1,9 @@
1
+ import { App } from 'vue';
2
+ import { default as GigSupportChat } from './components/GigSupportChat.vue';
3
+ import { useSupportChat, ChatConfig, ChatMessage } from './store/supportChat';
4
+ declare const _default: {
5
+ install: (app: App) => void;
6
+ };
7
+ export default _default;
8
+ export { GigSupportChat, useSupportChat };
9
+ export type { ChatConfig, ChatMessage };
@@ -0,0 +1,349 @@
1
+ export interface ChatMessage {
2
+ id: number;
3
+ text?: string;
4
+ userId: string;
5
+ recipientId?: string;
6
+ isRead: boolean;
7
+ createdAt: string;
8
+ userName?: string;
9
+ messageType: string;
10
+ internalLink?: any;
11
+ sticker?: {
12
+ id: number;
13
+ name: string;
14
+ base64: string;
15
+ mimeType?: string;
16
+ };
17
+ attachmentMimeType?: string;
18
+ replyToMessageId?: number;
19
+ replyToMessage?: ChatMessage;
20
+ }
21
+ export interface Sticker {
22
+ id: number;
23
+ name: string;
24
+ base64: string;
25
+ mimeType?: string;
26
+ }
27
+ export interface ChatConfig {
28
+ apiUrl: string;
29
+ apiKey: string;
30
+ uuid: string;
31
+ metaUser?: Record<string, any>;
32
+ path?: string;
33
+ }
34
+ export declare const useSupportChat: import('pinia').StoreDefinition<"gigSupportChat", Pick<{
35
+ messages: import('vue').Ref<{
36
+ id: number;
37
+ text?: string | undefined;
38
+ userId: string;
39
+ recipientId?: string | undefined;
40
+ isRead: boolean;
41
+ createdAt: string;
42
+ userName?: string | undefined;
43
+ messageType: string;
44
+ internalLink?: any;
45
+ sticker?: {
46
+ id: number;
47
+ name: string;
48
+ base64: string;
49
+ mimeType?: string | undefined;
50
+ } | undefined;
51
+ attachmentMimeType?: string | undefined;
52
+ replyToMessageId?: number | undefined;
53
+ replyToMessage?: /*elided*/ any | undefined;
54
+ }[], ChatMessage[] | {
55
+ id: number;
56
+ text?: string | undefined;
57
+ userId: string;
58
+ recipientId?: string | undefined;
59
+ isRead: boolean;
60
+ createdAt: string;
61
+ userName?: string | undefined;
62
+ messageType: string;
63
+ internalLink?: any;
64
+ sticker?: {
65
+ id: number;
66
+ name: string;
67
+ base64: string;
68
+ mimeType?: string | undefined;
69
+ } | undefined;
70
+ attachmentMimeType?: string | undefined;
71
+ replyToMessageId?: number | undefined;
72
+ replyToMessage?: /*elided*/ any | undefined;
73
+ }[]>;
74
+ isConnected: import('vue').Ref<boolean, boolean>;
75
+ isWidgetOpen: import('vue').Ref<boolean, boolean>;
76
+ unreadCount: import('vue').Ref<number, number>;
77
+ currentUserId: import('vue').Ref<string, string>;
78
+ stickers: import('vue').Ref<{
79
+ id: number;
80
+ name: string;
81
+ base64: string;
82
+ mimeType?: string | undefined;
83
+ }[], Sticker[] | {
84
+ id: number;
85
+ name: string;
86
+ base64: string;
87
+ mimeType?: string | undefined;
88
+ }[]>;
89
+ isLoadingStickers: import('vue').Ref<boolean, boolean>;
90
+ replyingToMessage: import('vue').Ref<{
91
+ id: number;
92
+ text?: string | undefined;
93
+ userId: string;
94
+ recipientId?: string | undefined;
95
+ isRead: boolean;
96
+ createdAt: string;
97
+ userName?: string | undefined;
98
+ messageType: string;
99
+ internalLink?: any;
100
+ sticker?: {
101
+ id: number;
102
+ name: string;
103
+ base64: string;
104
+ mimeType?: string | undefined;
105
+ } | undefined;
106
+ attachmentMimeType?: string | undefined;
107
+ replyToMessageId?: number | undefined;
108
+ replyToMessage?: /*elided*/ any | undefined;
109
+ } | null, ChatMessage | {
110
+ id: number;
111
+ text?: string | undefined;
112
+ userId: string;
113
+ recipientId?: string | undefined;
114
+ isRead: boolean;
115
+ createdAt: string;
116
+ userName?: string | undefined;
117
+ messageType: string;
118
+ internalLink?: any;
119
+ sticker?: {
120
+ id: number;
121
+ name: string;
122
+ base64: string;
123
+ mimeType?: string | undefined;
124
+ } | undefined;
125
+ attachmentMimeType?: string | undefined;
126
+ replyToMessageId?: number | undefined;
127
+ replyToMessage?: /*elided*/ any | undefined;
128
+ } | null>;
129
+ init: (chatConfig: ChatConfig) => void;
130
+ connect: () => void;
131
+ disconnect: () => void;
132
+ sendMessage: (text: string) => void;
133
+ sendSticker: (stickerId: number) => void;
134
+ fetchStickers: () => Promise<void>;
135
+ toggleWidget: () => void;
136
+ loadHistory: () => void;
137
+ startReply: (message: ChatMessage) => void;
138
+ cancelReply: () => void;
139
+ }, "messages" | "isConnected" | "isWidgetOpen" | "unreadCount" | "currentUserId" | "stickers" | "isLoadingStickers" | "replyingToMessage">, Pick<{
140
+ messages: import('vue').Ref<{
141
+ id: number;
142
+ text?: string | undefined;
143
+ userId: string;
144
+ recipientId?: string | undefined;
145
+ isRead: boolean;
146
+ createdAt: string;
147
+ userName?: string | undefined;
148
+ messageType: string;
149
+ internalLink?: any;
150
+ sticker?: {
151
+ id: number;
152
+ name: string;
153
+ base64: string;
154
+ mimeType?: string | undefined;
155
+ } | undefined;
156
+ attachmentMimeType?: string | undefined;
157
+ replyToMessageId?: number | undefined;
158
+ replyToMessage?: /*elided*/ any | undefined;
159
+ }[], ChatMessage[] | {
160
+ id: number;
161
+ text?: string | undefined;
162
+ userId: string;
163
+ recipientId?: string | undefined;
164
+ isRead: boolean;
165
+ createdAt: string;
166
+ userName?: string | undefined;
167
+ messageType: string;
168
+ internalLink?: any;
169
+ sticker?: {
170
+ id: number;
171
+ name: string;
172
+ base64: string;
173
+ mimeType?: string | undefined;
174
+ } | undefined;
175
+ attachmentMimeType?: string | undefined;
176
+ replyToMessageId?: number | undefined;
177
+ replyToMessage?: /*elided*/ any | undefined;
178
+ }[]>;
179
+ isConnected: import('vue').Ref<boolean, boolean>;
180
+ isWidgetOpen: import('vue').Ref<boolean, boolean>;
181
+ unreadCount: import('vue').Ref<number, number>;
182
+ currentUserId: import('vue').Ref<string, string>;
183
+ stickers: import('vue').Ref<{
184
+ id: number;
185
+ name: string;
186
+ base64: string;
187
+ mimeType?: string | undefined;
188
+ }[], Sticker[] | {
189
+ id: number;
190
+ name: string;
191
+ base64: string;
192
+ mimeType?: string | undefined;
193
+ }[]>;
194
+ isLoadingStickers: import('vue').Ref<boolean, boolean>;
195
+ replyingToMessage: import('vue').Ref<{
196
+ id: number;
197
+ text?: string | undefined;
198
+ userId: string;
199
+ recipientId?: string | undefined;
200
+ isRead: boolean;
201
+ createdAt: string;
202
+ userName?: string | undefined;
203
+ messageType: string;
204
+ internalLink?: any;
205
+ sticker?: {
206
+ id: number;
207
+ name: string;
208
+ base64: string;
209
+ mimeType?: string | undefined;
210
+ } | undefined;
211
+ attachmentMimeType?: string | undefined;
212
+ replyToMessageId?: number | undefined;
213
+ replyToMessage?: /*elided*/ any | undefined;
214
+ } | null, ChatMessage | {
215
+ id: number;
216
+ text?: string | undefined;
217
+ userId: string;
218
+ recipientId?: string | undefined;
219
+ isRead: boolean;
220
+ createdAt: string;
221
+ userName?: string | undefined;
222
+ messageType: string;
223
+ internalLink?: any;
224
+ sticker?: {
225
+ id: number;
226
+ name: string;
227
+ base64: string;
228
+ mimeType?: string | undefined;
229
+ } | undefined;
230
+ attachmentMimeType?: string | undefined;
231
+ replyToMessageId?: number | undefined;
232
+ replyToMessage?: /*elided*/ any | undefined;
233
+ } | null>;
234
+ init: (chatConfig: ChatConfig) => void;
235
+ connect: () => void;
236
+ disconnect: () => void;
237
+ sendMessage: (text: string) => void;
238
+ sendSticker: (stickerId: number) => void;
239
+ fetchStickers: () => Promise<void>;
240
+ toggleWidget: () => void;
241
+ loadHistory: () => void;
242
+ startReply: (message: ChatMessage) => void;
243
+ cancelReply: () => void;
244
+ }, never>, Pick<{
245
+ messages: import('vue').Ref<{
246
+ id: number;
247
+ text?: string | undefined;
248
+ userId: string;
249
+ recipientId?: string | undefined;
250
+ isRead: boolean;
251
+ createdAt: string;
252
+ userName?: string | undefined;
253
+ messageType: string;
254
+ internalLink?: any;
255
+ sticker?: {
256
+ id: number;
257
+ name: string;
258
+ base64: string;
259
+ mimeType?: string | undefined;
260
+ } | undefined;
261
+ attachmentMimeType?: string | undefined;
262
+ replyToMessageId?: number | undefined;
263
+ replyToMessage?: /*elided*/ any | undefined;
264
+ }[], ChatMessage[] | {
265
+ id: number;
266
+ text?: string | undefined;
267
+ userId: string;
268
+ recipientId?: string | undefined;
269
+ isRead: boolean;
270
+ createdAt: string;
271
+ userName?: string | undefined;
272
+ messageType: string;
273
+ internalLink?: any;
274
+ sticker?: {
275
+ id: number;
276
+ name: string;
277
+ base64: string;
278
+ mimeType?: string | undefined;
279
+ } | undefined;
280
+ attachmentMimeType?: string | undefined;
281
+ replyToMessageId?: number | undefined;
282
+ replyToMessage?: /*elided*/ any | undefined;
283
+ }[]>;
284
+ isConnected: import('vue').Ref<boolean, boolean>;
285
+ isWidgetOpen: import('vue').Ref<boolean, boolean>;
286
+ unreadCount: import('vue').Ref<number, number>;
287
+ currentUserId: import('vue').Ref<string, string>;
288
+ stickers: import('vue').Ref<{
289
+ id: number;
290
+ name: string;
291
+ base64: string;
292
+ mimeType?: string | undefined;
293
+ }[], Sticker[] | {
294
+ id: number;
295
+ name: string;
296
+ base64: string;
297
+ mimeType?: string | undefined;
298
+ }[]>;
299
+ isLoadingStickers: import('vue').Ref<boolean, boolean>;
300
+ replyingToMessage: import('vue').Ref<{
301
+ id: number;
302
+ text?: string | undefined;
303
+ userId: string;
304
+ recipientId?: string | undefined;
305
+ isRead: boolean;
306
+ createdAt: string;
307
+ userName?: string | undefined;
308
+ messageType: string;
309
+ internalLink?: any;
310
+ sticker?: {
311
+ id: number;
312
+ name: string;
313
+ base64: string;
314
+ mimeType?: string | undefined;
315
+ } | undefined;
316
+ attachmentMimeType?: string | undefined;
317
+ replyToMessageId?: number | undefined;
318
+ replyToMessage?: /*elided*/ any | undefined;
319
+ } | null, ChatMessage | {
320
+ id: number;
321
+ text?: string | undefined;
322
+ userId: string;
323
+ recipientId?: string | undefined;
324
+ isRead: boolean;
325
+ createdAt: string;
326
+ userName?: string | undefined;
327
+ messageType: string;
328
+ internalLink?: any;
329
+ sticker?: {
330
+ id: number;
331
+ name: string;
332
+ base64: string;
333
+ mimeType?: string | undefined;
334
+ } | undefined;
335
+ attachmentMimeType?: string | undefined;
336
+ replyToMessageId?: number | undefined;
337
+ replyToMessage?: /*elided*/ any | undefined;
338
+ } | null>;
339
+ init: (chatConfig: ChatConfig) => void;
340
+ connect: () => void;
341
+ disconnect: () => void;
342
+ sendMessage: (text: string) => void;
343
+ sendSticker: (stickerId: number) => void;
344
+ fetchStickers: () => Promise<void>;
345
+ toggleWidget: () => void;
346
+ loadHistory: () => void;
347
+ startReply: (message: ChatMessage) => void;
348
+ cancelReply: () => void;
349
+ }, "init" | "connect" | "disconnect" | "sendMessage" | "sendSticker" | "fetchStickers" | "toggleWidget" | "loadHistory" | "startReply" | "cancelReply">>;
@@ -0,0 +1 @@
1
+ .gig-message-wrapper[data-v-0f2196d9]{display:flex;flex-direction:column;margin-bottom:4px;max-width:85%;position:relative}.gig-message-wrapper.sent[data-v-0f2196d9]{align-self:flex-end}.gig-message-wrapper.received[data-v-0f2196d9]{align-self:flex-start}.gig-message-author[data-v-0f2196d9]{display:flex;align-items:center;gap:8px;margin-bottom:6px;margin-left:2px}.gig-author-avatar[data-v-0f2196d9]{width:20px;height:20px;border-radius:50%;background:var(--gig-primary-gradient);color:#fff;font-size:8px;font-weight:900;display:flex;align-items:center;justify-content:center}.gig-author-name[data-v-0f2196d9]{font-size:11px;font-weight:700;color:var(--gig-text-muted)}.gig-message-bubble[data-v-0f2196d9]{padding:12px 16px;border-radius:var(--gig-radius-sm);font-size:14px;line-height:1.5;position:relative;box-shadow:var(--gig-shadow-sm)}.gig-message-bubble.is-sticker[data-v-0f2196d9]{padding:0;background:transparent!important;box-shadow:none!important}.sent .gig-message-bubble[data-v-0f2196d9]{background:var(--gig-brand-dark-green);color:#fff;border-bottom-right-radius:4px}.received .gig-message-bubble[data-v-0f2196d9]{background:#fff;color:var(--gig-text-main);border-bottom-left-radius:4px;border:1px solid var(--gig-border-light)}.gig-sticker-img[data-v-0f2196d9]{max-width:160px;max-height:160px;display:block}.gig-message-meta[data-v-0f2196d9]{margin-top:4px;font-size:10px;opacity:.6}.sent .gig-message-meta[data-v-0f2196d9]{text-align:right}.gig-reply-preview[data-v-0f2196d9]{background:#0000000d;border-left:3px solid var(--gig-brand-dark-green);padding:6px 10px;border-radius:8px;margin-bottom:8px;font-size:12px;cursor:pointer}.sent .gig-reply-preview[data-v-0f2196d9]{background:#ffffff1a;border-left-color:#fff}.gig-reply-author[data-v-0f2196d9]{font-weight:700;font-size:10px;margin-bottom:2px}.gig-reply-text[data-v-0f2196d9]{opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gig-message-reply-btn[data-v-0f2196d9]{position:absolute;top:50%;transform:translateY(-50%);width:32px;height:32px;border-radius:50%;background:#fff;border:1px solid var(--gig-border-light);color:var(--gig-text-muted);display:flex;align-items:center;justify-content:center;opacity:0;transition:var(--gig-transition);cursor:pointer;box-shadow:var(--gig-shadow-sm)}.gig-message-bubble:hover .gig-message-reply-btn[data-v-0f2196d9]{opacity:1}.sent .gig-message-reply-btn[data-v-0f2196d9]{left:-40px}.received .gig-message-reply-btn[data-v-0f2196d9]{right:-40px}[data-v-0f2196d9] .gig-message-text a{color:inherit;font-weight:600;text-decoration:underline}.gig-chat-window[data-v-4a6ac4c2]{position:fixed;background:var(--gig-glass-bg);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);border:1px solid var(--gig-glass-border);border-radius:var(--gig-radius);box-shadow:var(--gig-shadow-premium);display:flex;flex-direction:column;overflow:hidden;z-index:9999;-webkit-user-select:none;user-select:none}.gig-resize-h[data-v-4a6ac4c2]{position:absolute;z-index:10}.gig-resize-left[data-v-4a6ac4c2]{left:0;top:0;width:6px;height:100%;cursor:w-resize}.gig-resize-top[data-v-4a6ac4c2]{left:0;top:0;width:100%;height:6px;cursor:n-resize}.gig-resize-corner[data-v-4a6ac4c2]{left:0;top:0;width:20px;height:20px;cursor:nw-resize;z-index:11}.gig-chat-header[data-v-4a6ac4c2]{padding:24px;background:var(--gig-brand-dark-green);color:#fff;display:flex;justify-content:space-between;align-items:center;cursor:grab;position:relative;overflow:hidden}.gig-chat-header[data-v-4a6ac4c2]:active{cursor:grabbing}.gig-header-brand-overlay[data-v-4a6ac4c2]{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--gig-primary-gradient);opacity:.1}.gig-header-info[data-v-4a6ac4c2]{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.gig-header-avatar[data-v-4a6ac4c2]{width:40px;height:40px;background:#ffffff1a;border-radius:50%;display:flex;align-items:center;justify-content:center}.gig-header-info h3[data-v-4a6ac4c2]{margin:0;font-size:18px;font-weight:700;line-height:1.2}.gig-status-area[data-v-4a6ac4c2]{display:flex;align-items:center;gap:6px;margin-top:2px}.gig-status-pulse[data-v-4a6ac4c2]{width:8px;height:8px;background:#4ade80;border-radius:50%;box-shadow:0 0 0 2px #4ade8033}.gig-status-text[data-v-4a6ac4c2]{font-size:12px;font-weight:500;color:#ffffffb3}.gig-close-btn[data-v-4a6ac4c2]{background:transparent;border:none;color:#fff;opacity:.6;cursor:pointer;padding:4px;transition:var(--gig-transition);z-index:1}.gig-close-btn[data-v-4a6ac4c2]:hover{opacity:1;transform:scale(1.1)}.gig-messages-container[data-v-4a6ac4c2]{flex:1;overflow-y:auto;padding:24px;background:var(--gig-bg-light);display:flex;flex-direction:column;gap:16px;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,.1) transparent}.gig-empty-state[data-v-4a6ac4c2]{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--gig-text-muted);text-align:center}.gig-empty-icon[data-v-4a6ac4c2]{width:80px;height:80px;background:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:16px;box-shadow:var(--gig-shadow-sm)}.gig-reply-bar[data-v-4a6ac4c2]{background:#fff;padding:12px 20px;border-top:1px solid var(--gig-border-light);display:flex;align-items:center;gap:12px}.gig-reply-line[data-v-4a6ac4c2]{width:3px;height:32px;background:var(--gig-brand-dark-green);border-radius:4px}.gig-reply-content[data-v-4a6ac4c2]{flex:1;min-width:0}.gig-reply-title[data-v-4a6ac4c2]{font-size:10px;font-weight:800;color:var(--gig-brand-dark-green);text-transform:uppercase;letter-spacing:.5px}.gig-reply-preview[data-v-4a6ac4c2]{font-size:12px;color:var(--gig-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gig-reply-close[data-v-4a6ac4c2]{background:none;border:none;font-size:18px;color:var(--gig-text-muted);cursor:pointer}.gig-sticker-picker[data-v-4a6ac4c2]{position:absolute;bottom:100px;left:20px;right:20px;background:#fff;border-radius:20px;box-shadow:var(--gig-shadow-premium);border:1px solid var(--gig-border-light);z-index:100;max-height:250px;display:flex;flex-direction:column}.gig-picker-header[data-v-4a6ac4c2]{padding:12px 16px;border-bottom:1px solid var(--gig-border-light);display:flex;justify-content:space-between;font-size:12px;font-weight:700;color:var(--gig-text-muted)}.gig-sticker-grid[data-v-4a6ac4c2]{flex:1;overflow-y:auto;display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:12px}.gig-sticker-item[data-v-4a6ac4c2]{aspect-ratio:1;padding:4px;cursor:pointer;transition:.2s}.gig-sticker-item[data-v-4a6ac4c2]:hover{transform:scale(1.1);background:var(--gig-bg-light);border-radius:12px}.gig-sticker-item img[data-v-4a6ac4c2]{width:100%;height:100%;object-fit:contain}.gig-chat-input-area[data-v-4a6ac4c2]{padding:24px;background:#fff;border-top:1px solid var(--gig-border-light)}.gig-input-wrapper[data-v-4a6ac4c2]{background:var(--gig-bg-light);border-radius:16px;padding:8px;display:flex;align-items:flex-end;gap:8px;border:1px solid transparent;transition:var(--gig-transition)}.gig-input-wrapper[data-v-4a6ac4c2]:focus-within{background:#fff;border-color:rgba(var(--gig-brand-dark-green-rgb),.2);box-shadow:0 0 0 4px rgba(var(--gig-brand-dark-green-rgb),.05)}.gig-chat-input[data-v-4a6ac4c2]{flex:1;background:transparent;border:none;outline:none;padding:10px 4px;font-size:14px;line-height:1.5;resize:none;max-height:120px}.gig-sticker-toggle[data-v-4a6ac4c2]{background:transparent;border:none;color:var(--gig-text-muted);width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:10px;transition:.2s}.gig-sticker-toggle[data-v-4a6ac4c2]:hover{background:#fff;color:var(--gig-brand-dark-green)}.gig-sticker-toggle.active[data-v-4a6ac4c2]{color:var(--gig-brand-dark-green);background:#fff}.gig-send-btn[data-v-4a6ac4c2]{background:var(--gig-brand-dark-green);color:#fff;border:none;width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--gig-transition)}.gig-send-btn[data-v-4a6ac4c2]:disabled{background:#cbd5e1;cursor:not-allowed}.gig-send-btn[data-v-4a6ac4c2]:not(:disabled):hover{transform:scale(1.05);box-shadow:0 4px 12px rgba(var(--gig-brand-dark-green-rgb),.3)}.gig-powered-by[data-v-4a6ac4c2]{text-align:center;margin-top:12px;font-size:9px;font-weight:800;color:var(--gig-text-muted);opacity:.4;text-transform:uppercase;letter-spacing:1px}.gig-slide-up-enter-active[data-v-4a6ac4c2],.gig-slide-up-leave-active[data-v-4a6ac4c2]{transition:all .3s ease}.gig-slide-up-enter-from[data-v-4a6ac4c2],.gig-slide-up-leave-to[data-v-4a6ac4c2]{opacity:0;transform:translateY(10px)}.gig-fade-enter-active[data-v-4a6ac4c2],.gig-fade-leave-active[data-v-4a6ac4c2]{transition:all .2s ease}.gig-fade-enter-from[data-v-4a6ac4c2],.gig-fade-leave-to[data-v-4a6ac4c2]{opacity:0}@keyframes gig-highlight-anim-4a6ac4c2{0%{background:rgba(var(--gig-brand-dark-green-rgb),.05)}to{background:transparent}}.gig-highlight[data-v-4a6ac4c2]{animation:gig-highlight-anim-4a6ac4c2 2s ease-out}:root{--gig-brand-dark-green: #00332c;--gig-brand-dark-green-rgb: 0, 51, 44;--gig-primary-gradient: linear-gradient(135deg, #FED733 0%, #F54E19 100%);--gig-brand-gradient: linear-gradient(135deg, #00332c 0%, #004d42 100%);--gig-glass-bg: rgba(255, 255, 255, .95);--gig-glass-border: rgba(0, 0, 0, .08);--gig-shadow-premium: 0 20px 50px rgba(0, 0, 0, .15);--gig-shadow-sm: 0 4px 12px rgba(0, 0, 0, .05);--gig-text-main: #1e293b;--gig-text-muted: #64748b;--gig-text-on-primary: #ffffff;--gig-radius: 24px;--gig-radius-sm: 12px;--gig-transition: all .3s cubic-bezier(.4, 0, .2, 1);--gig-bg-light: #f8fafc;--gig-border-light: #f1f5f9}.gig-chat-wrapper{font-family:Inter,system-ui,-apple-system,sans-serif;position:fixed;bottom:30px;right:30px;z-index:9999;display:flex;flex-direction:column;align-items:flex-end}.gig-chat-trigger{width:64px;height:64px;border-radius:50%;background:var(--gig-primary-gradient);box-shadow:0 8px 24px #f54e194d;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:var(--gig-transition);position:relative;overflow:hidden}.gig-chat-trigger:hover{transform:scale(1.08) translateY(-4px);box-shadow:0 12px 32px #f54e1966}.gig-chat-trigger:active{transform:scale(.95)}.gig-chat-badge{position:absolute;top:0;right:0;background:#ff3b30;color:#fff;font-size:12px;font-weight:700;padding:4px 8px;border-radius:10px;border:2px solid white}.gig-chat-window{width:400px;height:600px;background:var(--gig-glass-bg);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid var(--gig-glass-border);border-radius:var(--gig-radius);box-shadow:var(--gig-shadow-premium);margin-bottom:20px;display:flex;flex-direction:column;overflow:hidden;transition:var(--gig-transition);transform-origin:bottom right}.gig-chat-header{padding:20px;background:var(--gig-primary-gradient);color:#fff;display:flex;justify-content:space-between;align-items:center}.gig-chat-header h3{margin:0;font-size:18px;font-weight:700}.gig-messages-container{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin}.gig-message{max-width:80%;padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.5;position:relative;animation:messageSlide .4s ease-out}@keyframes messageSlide{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.gig-message.sent{align-self:flex-end;background:var(--gig-primary-gradient);color:#fff;border-bottom-right-radius:4px}.gig-message.received{align-self:flex-start;background:#fff;color:var(--gig-text-main);border-bottom-left-radius:4px;box-shadow:0 4px 12px #0000000d}.gig-chat-input-area{padding:20px;background:#ffffff80;border-top:1px solid rgba(0,0,0,.05);display:flex;gap:10px;align-items:center}.gig-chat-input{flex:1;background:#fff;border:1px solid rgba(0,0,0,.1);border-radius:25px;padding:12px 20px;outline:none;font-size:14px;transition:var(--gig-transition)}.gig-chat-input:focus{border-color:#f54e19;box-shadow:0 0 0 4px #f54e191a}.gig-send-btn{background:var(--gig-primary-gradient);width:44px;height:44px;border-radius:50%;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;transition:var(--gig-transition)}.gig-send-btn:hover{transform:rotate(15deg) scale(1.1)}.gig-fade-enter-active,.gig-fade-leave-active{transition:all .4s cubic-bezier(.175,.885,.32,1.275)}.gig-fade-enter-from,.gig-fade-leave-to{opacity:0;transform:scale(.8) translateY(40px)}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@vunex/support-chat",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "type": "module",
9
+ "scripts": {
10
+ "dev": "vite",
11
+ "build": "vue-tsc && vite build",
12
+ "preview": "vite preview"
13
+ },
14
+ "main": "./dist/gig-support-chat.umd.js",
15
+ "module": "./dist/gig-support-chat.es.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/gig-support-chat.es.js",
20
+ "require": "./dist/gig-support-chat.umd.js",
21
+ "types": "./dist/index.d.ts"
22
+ },
23
+ "./style.css": "./dist/style.css"
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "peerDependencies": {
29
+ "vue": "^3.0.0"
30
+ },
31
+ "dependencies": {
32
+ "socket.io-client": "^4.8.1",
33
+ "pinia": "^2.3.1"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "^20.0.0",
37
+ "@vitejs/plugin-vue": "^5.2.1",
38
+ "typescript": "^5.6.3",
39
+ "vite": "^6.0.7",
40
+ "vite-plugin-dts": "^4.5.4",
41
+ "vue-tsc": "^2.1.10"
42
+ }
43
+ }