gci-chatbot-ai 1.0.6 → 1.0.8
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(oe,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(oe=typeof globalThis<"u"?globalThis:oe||self,h(oe.GciChatbotAi={},oe.Vue))})(this,function(oe,h){"use strict";const
|
|
1
|
+
(function(oe,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(oe=typeof globalThis<"u"?globalThis:oe||self,h(oe.GciChatbotAi={},oe.Vue))})(this,function(oe,h){"use strict";const Ol="",xn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjMwIiB2aWV3Qm94PSIwIDAgMTIwIDMwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiPg0KICA8Y2lyY2xlIGN4PSIxNSIgY3k9IjE1IiByPSI2IiBmaWxsPSIjNUI4Q0ZGIj4NCiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjAuMzsxOzAuMyIgZHVyPSIxLjRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIj48L2FuaW1hdGU+DQogIDwvY2lyY2xlPg0KDQogIDxjaXJjbGUgY3g9IjQ1IiBjeT0iMTUiIHI9IjYiIGZpbGw9IiM1QjhDRkYiPg0KICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMC4zOzE7MC4zIiBkdXI9IjEuNHMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC4ycyI+PC9hbmltYXRlPg0KICA8L2NpcmNsZT4NCg0KICA8Y2lyY2xlIGN4PSI3NSIgY3k9IjE1IiByPSI2IiBmaWxsPSIjNUI4Q0ZGIj4NCiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjAuMzsxOzAuMyIgZHVyPSIxLjRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuNHMiPjwvYW5pbWF0ZT4NCiAgPC9jaXJjbGU+DQo8L3N2Zz4NCg==";var ht="vercel.ai.error",jn=Symbol.for(ht),gt,vt,H=class Rn extends(vt=Error,gt=jn,vt){constructor({name:t,message:r,cause:n}){super(r),this[gt]=!0,this.name=t,this.cause=n}static isInstance(t){return Rn.hasMarker(t,ht)}static hasMarker(t,r){const n=Symbol.for(r);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}};function _t(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var yt="AI_InvalidArgumentError",bt=`vercel.ai.error.${yt}`,Cn=Symbol.for(bt),wt,It,Mn=class extends(It=H,wt=Cn,It){constructor({message:e,cause:t,argument:r}){super({name:yt,message:e,cause:t}),this[wt]=!0,this.argument=r}static isInstance(e){return H.hasMarker(e,bt)}},Et="AI_JSONParseError",kt=`vercel.ai.error.${Et}`,Dn=Symbol.for(kt),zt,St,Ot=class extends(St=H,zt=Dn,St){constructor({text:e,cause:t}){super({name:Et,message:`JSON parsing failed: Text: ${e}.
|
|
2
2
|
Error message: ${_t(t)}`,cause:t}),this[zt]=!0,this.text=e}static isInstance(e){return H.hasMarker(e,kt)}},Zt="AI_TypeValidationError",$t=`vercel.ai.error.${Zt}`,Un=Symbol.for($t),Nt,Tt,ue=class mt extends(Tt=H,Nt=Un,Tt){constructor({value:t,cause:r}){super({name:Zt,message:`Type validation failed: Value: ${JSON.stringify(t)}.
|
|
3
3
|
Error message: ${_t(r)}`,cause:r}),this[Nt]=!0,this.value=t}static isInstance(t){return H.hasMarker(t,$t)}static wrap({value:t,cause:r}){return mt.isInstance(r)&&r.value===t?r:new mt({value:t,cause:r})}};function p(e,t,r){function n(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);const c=i.prototype,l=Object.keys(c);for(let d=0;d<l.length;d++){const _=l[d];_ in a||(a[_]=c[_].bind(a))}}const o=(r==null?void 0:r.Parent)??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var u;const c=r!=null&&r.Parent?new s:this;n(c,a),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>{var u,c;return r!=null&&r.Parent&&a instanceof r.Parent?!0:(c=(u=a==null?void 0:a._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class le extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Je={};function Q(e){return e&&Object.assign(Je,e),Je}function At(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function We(e,t){return typeof t=="bigint"?t.toString():t}function Ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ye(e){return e==null}function qe(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ln(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const u=n.match(/\d?e-(\d?)/);u!=null&&u[1]&&(o=Number.parseInt(u[1]))}const s=r>o?r:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}const Rt=Symbol("evaluating");function O(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Rt)return n===void 0&&(n=Rt,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function se(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function K(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function xt(e){return JSON.stringify(e)}function Vn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Bn=Ze(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function de(e){if(_e(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(_e(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ct(e){return de(e)?{...e}:Array.isArray(e)?[...e]:e}const Fn=new Set(["string","number","symbol"]);function pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ee(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function b(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Jn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Wn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Yn(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=K(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return se(this,"shape",i),i},checks:[]});return ee(e,s)}function qn(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=K(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return se(this,"shape",i),i},checks:[]});return ee(e,s)}function Gn(e,t){if(!de(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=K(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return se(this,"shape",s),s}});return ee(e,o)}function Hn(e,t){if(!de(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=K(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return se(this,"shape",n),n}});return ee(e,r)}function Xn(e,t){const r=K(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return se(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ee(e,r)}function Qn(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=K(t._zod.def,{get shape(){const a=t._zod.def.shape,u={...a};if(r)for(const c in r){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(u[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)u[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return se(this,"shape",u),u},checks:[]});return ee(t,i)}function Kn(e,t,r){const n=K(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return se(this,"shape",s),s}});return ee(t,n)}function fe(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function me(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function $e(e){return typeof e=="string"?e:e==null?void 0:e.message}function te(e,t,r){var o,s,i,a,u,c;const n={...e,path:e.path??[]};if(!e.message){const l=$e((i=(s=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:s.error)==null?void 0:i.call(s,e))??$e((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??$e((u=r.customError)==null?void 0:u.call(r,e))??$e((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";n.message=l}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function Ge(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ye(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Mt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,We,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Dt=p("$ZodError",Mt),Ut=p("$ZodError",Mt,{Parent:Error});function eo(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function to(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>n({issues:i}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let i=r,a=0;for(;a<s.path.length;){const u=s.path[a];a===s.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(t(s))):i[u]=i[u]||{_errors:[]},i=i[u],a++}}};return n(e),r}const He=e=>(t,r,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new le;if(i.issues.length){const a=new((o==null?void 0:o.Err)??e)(i.issues.map(u=>te(u,s,Q())));throw jt(a,o==null?void 0:o.callee),a}return i.value},Xe=e=>async(t,r,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new((o==null?void 0:o.Err)??e)(i.issues.map(u=>te(u,s,Q())));throw jt(a,o==null?void 0:o.callee),a}return i.value},Ne=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new le;return s.issues.length?{success:!1,error:new(e??Dt)(s.issues.map(i=>te(i,o,Q())))}:{success:!0,data:s.value}},ro=Ne(Ut),Te=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>te(i,o,Q())))}:{success:!0,data:s.value}},no=Te(Ut),oo=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return He(e)(t,r,o)},so=e=>(t,r,n)=>He(e)(t,r,n),ao=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,r,o)},io=e=>async(t,r,n)=>Xe(e)(t,r,n),co=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ne(e)(t,r,o)},uo=e=>(t,r,n)=>Ne(e)(t,r,n),lo=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Te(e)(t,r,o)},po=e=>async(t,r,n)=>Te(e)(t,r,n),fo=/^[cC][^\s-]{8,}$/,mo=/^[0-9a-z]+$/,ho=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,go=/^[0-9a-vA-V]{20}$/,vo=/^[A-Za-z0-9]{27}$/,_o=/^[a-zA-Z0-9_-]{21}$/,yo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Lt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,wo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Io="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Eo(){return new RegExp(Io,"u")}const ko=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,So=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Oo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vt=/^[A-Za-z0-9_-]*$/,$o=/^\+[1-9]\d{6,14}$/,Bt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",No=new RegExp(`^${Bt}$`);function Ft(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function To(e){return new RegExp(`^${Ft(e)}$`)}function Po(e){const t=Ft({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Bt}T(?:${n})$`)}const Ao=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ro=/^-?\d+$/,Jt=/^-?\d+(?:\.\d+)?$/,xo=/^(?:true|false)$/i,jo=/^null$/i,Co=/^[^A-Z]*$/,Mo=/^[^a-z]*$/,F=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Wt={number:"number",bigint:"bigint",object:"date"},Yt=p("$ZodCheckLessThan",(e,t)=>{F.init(e,t);const r=Wt[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qt=p("$ZodCheckGreaterThan",(e,t)=>{F.init(e,t);const r=Wt[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Do=p("$ZodCheckMultipleOf",(e,t)=>{F.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ln(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Uo=p("$ZodCheckNumberFormat",(e,t)=>{var i;F.init(e,t),t.format=t.format||"float64";const r=(i=t.format)==null?void 0:i.includes("int"),n=r?"int":"number",[o,s]=Wn[t.format];e._zod.onattach.push(a=>{const u=a._zod.bag;u.format=t.format,u.minimum=o,u.maximum=s,r&&(u.pattern=Ro)}),e._zod.check=a=>{const u=a.value;if(r){if(!Number.isInteger(u)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}u<o&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>s&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Lo=p("$ZodCheckMaxLength",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ye(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const i=Ge(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vo=p("$ZodCheckMinLength",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ye(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=Ge(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Bo=p("$ZodCheckLengthEquals",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ye(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const i=Ge(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Pe=p("$ZodCheckStringFormat",(e,t)=>{var r,n;F.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Fo=p("$ZodCheckRegex",(e,t)=>{Pe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jo=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Co),Pe.init(e,t)}),Wo=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mo),Pe.init(e,t)}),Yo=p("$ZodCheckIncludes",(e,t)=>{F.init(e,t);const r=pe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),qo=p("$ZodCheckStartsWith",(e,t)=>{F.init(e,t);const r=new RegExp(`^${pe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Go=p("$ZodCheckEndsWith",(e,t)=>{F.init(e,t);const r=new RegExp(`.*${pe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ho=p("$ZodCheckOverwrite",(e,t)=>{F.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Xo{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
4
4
|
`).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
|
|
@@ -90,4 +90,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const dl=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pl={class:"z-[1000] w-fit flex flex-col items-end gap-y-5 relative"},fl={class:"flex items-center justify-between"},ml={key:0,class:"h-full flex flex-col justify-center text-xl title-hello"},hl={class:"gradient-text text-5xl leading-[80px]"},gl={key:0,class:"flex justify-end"},vl={class:"bg-[#bedeff] px-3 py-2.5 rounded-lg max-w-[90%] overflow-wrap-anywhere"},_l={key:0},yl={key:1,class:"flex justify-start"},bl={class:"px-3 py-2.5 rounded-lg whitespace-pre-wrap overflow-wrap-anywhere"},wl={key:0},Il={key:1,src:xn,alt:"",class:"w-16"},El=["disabled"],kl=h.defineComponent({__name:"ChatbotComponent",props:{clientId:{type:String,default:""},endpoint:{type:String,default:""},token:{type:String,default:""}
|
|
93
|
+
*/const dl=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pl={class:"z-[1000] w-fit flex flex-col items-end gap-y-5 relative"},fl={class:"flex items-center justify-between"},ml={key:0,class:"h-full flex flex-col justify-center text-xl title-hello"},hl={class:"gradient-text text-5xl leading-[80px]"},gl={key:0,class:"flex justify-end"},vl={class:"bg-[#bedeff] px-3 py-2.5 rounded-lg max-w-[90%] overflow-wrap-anywhere"},_l={key:0},yl={key:1,class:"flex justify-start"},bl={class:"px-3 py-2.5 rounded-lg whitespace-pre-wrap overflow-wrap-anywhere"},wl={key:0},Il={key:1,src:xn,alt:"",class:"w-16"},El=["disabled"],kl={class:"chat-button"},zl=h.defineComponent({__name:"ChatbotComponent",props:{clientId:{type:String,default:""},endpoint:{type:String,default:""},token:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,n=h.ref(""),o=h.ref(!1),s=h.ref(null),i=h.ref(!1),a=new nl({transport:new $n({api:"https://ai-chat-backend.dev02.dtsmart.dev/api/chat",body:{client_id:r.clientId,mcp_token:r.token}})}),u=async _=>{try{if(!n.value.trim())return;const m=n.value.trim();n.value="",i.value=!0,_.preventDefault(),await a.sendMessage({text:m})}catch(m){console.error(m)}finally{i.value=!1}},c=()=>{console.log("handleOpenToggle nha"),o.value=!0,console.log(o.value,"visible aaa")},l=()=>{console.log("handleCloseToggle nha"),o.value=!1,console.log(o.value,"visible bbb")},d=()=>{o.value=!1,a.messages=[]};return h.watch(()=>a.messages,async()=>{var _;await h.nextTick(),(_=s.value)==null||_.scrollTo({top:s.value.scrollHeight,behavior:"smooth"})},{deep:!0}),(_,m)=>{var I;return h.openBlock(),h.createElementBlock(h.Fragment,null,[o.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"bg-[#ffffff00] absolute w-full h-full",onClick:m[0]||(m[0]=g=>o.value=!1)})):h.createCommentVNode("",!0),h.createElementVNode("div",pl,[h.createTextVNode(h.toDisplayString(o.value+"aaa")+" ",1),h.createElementVNode("div",{class:h.normalizeClass(["ai-card chat-popup transition-all duration-7 gap-y-5",{"opacity-0":!o.value,"opacity-100":o.value}])},[h.createElementVNode("div",fl,[m[2]||(m[2]=h.createElementVNode("p",{class:"ai-hello"},"Hi, I’m Boko AI",-1)),h.createElementVNode("button",{class:"ai-close",onClick:d},[h.createVNode(h.unref(dl))])]),h.createElementVNode("div",{ref_key:"scrollRef",ref:s,class:"grow h-[440px] overflow-y-auto"},[h.unref(a).messages.length===0?(h.openBlock(),h.createElementBlock("div",ml,[h.createElementVNode("div",null,[h.createElementVNode("p",hl," Hello "+h.toDisplayString(e.clientId),1),m[3]||(m[3]=h.createElementVNode("p",{class:"text-5xl text-[#2a2f3c] leading-[80px]"}," How Can I Help You Today ? ",-1))]),m[4]||(m[4]=h.createElementVNode("p",{class:"text-base text-[#545e7f]"}," I’m Boko, your friendly assistant. ",-1)),m[5]||(m[5]=h.createElementVNode("p",{class:"text-base text-[#545e7f]"}," Here to help — anytime you’re ready! ",-1))])):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(h.unref(a).messages,(g,y)=>(h.openBlock(),h.createElementBlock("div",{key:g.id??y,class:"mb-3"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(g==null?void 0:g.parts,(w,z)=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:`${g.id}-${w.type}-${z}`},[g.role==="user"?(h.openBlock(),h.createElementBlock("div",gl,[h.createElementVNode("div",vl,[(w==null?void 0:w.type)==="text"?(h.openBlock(),h.createElementBlock("div",_l,h.toDisplayString(w==null?void 0:w.text),1)):h.createCommentVNode("",!0)])])):(h.openBlock(),h.createElementBlock("div",yl,[h.createElementVNode("div",bl,[(w==null?void 0:w.type)==="text"?(h.openBlock(),h.createElementBlock("div",wl,h.toDisplayString(w==null?void 0:w.text),1)):h.createCommentVNode("",!0)])]))],64))),128))]))),128)),i.value?(h.openBlock(),h.createElementBlock("img",Il)):h.createCommentVNode("",!0)],512),h.createElementVNode("form",{onSubmit:u,class:"ai-input-wrap"},[h.withDirectives(h.createElementVNode("input",{class:"ai-input","onUpdate:modelValue":m[1]||(m[1]=g=>n.value=g),placeholder:"Ask me anything…"},null,512),[[h.vModelText,n.value]]),h.createElementVNode("button",{class:"ai-send",disabled:!n.value||((I=n.value)==null?void 0:I.length)==0||i.value},[h.createVNode(h.unref(cl),{class:"w-5 h-5 text-white"})],8,El)],32)],2),h.createElementVNode("div",null,[h.createElementVNode("button",kl,[o.value?(h.openBlock(),h.createBlock(h.unref(ul),{key:1,class:"text-white",onClick:l})):(h.openBlock(),h.createBlock(h.unref(ll),{key:0,class:"text-white",onClick:c}))])])])],64)}}}),$l="",Sl=((e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r})(zl,[["__scopeId","data-v-a4593790"]]);oe.ChatbotComponent=Sl,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -11,10 +11,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
11
11
|
type: StringConstructor;
|
|
12
12
|
default: string;
|
|
13
13
|
};
|
|
14
|
-
modelValue: {
|
|
15
|
-
type: BooleanConstructor;
|
|
16
|
-
default: boolean;
|
|
17
|
-
};
|
|
18
14
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
15
|
"update:modelValue": (...args: any[]) => void;
|
|
20
16
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -30,16 +26,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
30
26
|
type: StringConstructor;
|
|
31
27
|
default: string;
|
|
32
28
|
};
|
|
33
|
-
modelValue: {
|
|
34
|
-
type: BooleanConstructor;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
29
|
}>> & Readonly<{
|
|
38
30
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
39
31
|
}>, {
|
|
40
32
|
clientId: string;
|
|
41
33
|
endpoint: string;
|
|
42
34
|
token: string;
|
|
43
|
-
modelValue: boolean;
|
|
44
35
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
45
36
|
export default _default;
|