expedite-components 0.0.4 → 0.0.7
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.
|
@@ -24328,12 +24328,18 @@ async function F8() {
|
|
|
24328
24328
|
}
|
|
24329
24329
|
const Iu = (e) => class extends e {
|
|
24330
24330
|
async connectedCallback() {
|
|
24331
|
-
|
|
24332
|
-
|
|
24333
|
-
|
|
24334
|
-
|
|
24335
|
-
|
|
24336
|
-
|
|
24331
|
+
const t = () => {
|
|
24332
|
+
var n, r;
|
|
24333
|
+
if ((r = (n = this._instance) == null ? void 0 : n.appContext) != null && r.app) {
|
|
24334
|
+
const i = this._instance.appContext.app;
|
|
24335
|
+
if (!i.config.globalProperties.$formatCurrency)
|
|
24336
|
+
return i.use($8), !0;
|
|
24337
|
+
}
|
|
24338
|
+
return !1;
|
|
24339
|
+
};
|
|
24340
|
+
if (t() || Promise.resolve().then(() => {
|
|
24341
|
+
t() || setTimeout(t, 0);
|
|
24342
|
+
}), super.connectedCallback && super.connectedCallback(), !!this.shadowRoot && !this.shadowRoot.querySelector("style[data-vue-expedite-style]"))
|
|
24337
24343
|
try {
|
|
24338
24344
|
const n = await F8();
|
|
24339
24345
|
if (n) {
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[pu]=this[pu]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=zr(a);r[s]||(C3(i,a),r[s]=!0)}return de.isArray(t)?t.forEach(o):o(t),this}}io.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),de.reduceDescriptors(io.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),de.freezeMethods(io);const jt=io;function Va(e,t){const n=this||$a,r=t||n,i=jt.from(r.headers);let o=r.data;return de.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function mu(e){return!!(e&&e.__CANCEL__)}function cr(e,t,n){Pe.call(this,e??"canceled",Pe.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(cr,Pe,{__CANCEL__:!0});function gu(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Pe("Request failed with status code "+n.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function w3(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function x3(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(l){const p=Date.now(),c=r[o];a||(a=p),n[i]=l,r[i]=p;let f=o,u=0;for(;f!==i;)u+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),p-a<t)return;const m=c&&p-c;return m?Math.round(u*1e3/m):void 0}}function k3(e,t){let n=0,r=1e3/t,i,o;const a=(p,c=Date.now())=>{n=c,i=null,o&&(clearTimeout(o),o=null),e(...p)};return[(...p)=>{const c=Date.now(),f=c-n;f>=r?a(p,c):(i=p,o||(o=setTimeout(()=>{o=null,a(i)},r-f)))},()=>i&&a(i)]}const oo=(e,t,n=3)=>{let r=0;const i=x3(50,250);return k3(o=>{const a=o.loaded,s=o.lengthComputable?o.total:void 0,l=a-r,p=i(l),c=a<=s;r=a;const f={loaded:a,total:s,progress:s?a/s:void 0,bytes:l,rate:p||void 0,estimated:p&&s&&c?(s-a)/p:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},vu=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},yu=e=>(...t)=>de.asap(()=>e(...t)),E3=ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,O3=ft.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),de.isString(r)&&s.push(`path=${r}`),de.isString(i)&&s.push(`domain=${i}`),o===!0&&s.push("secure"),de.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function S3(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function I3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _u(e,t,n){let r=!S3(t);return e&&(r||n==!1)?I3(e,t):t}const bu=e=>e instanceof jt?{...e}:e;function Vn(e,t){t=t||{};const n={};function r(p,c,f,u){return de.isPlainObject(p)&&de.isPlainObject(c)?de.merge.call({caseless:u},p,c):de.isPlainObject(c)?de.merge({},c):de.isArray(c)?c.slice():c}function i(p,c,f,u){if(de.isUndefined(c)){if(!de.isUndefined(p))return r(void 0,p,f,u)}else return r(p,c,f,u)}function o(p,c){if(!de.isUndefined(c))return r(void 0,c)}function a(p,c){if(de.isUndefined(c)){if(!de.isUndefined(p))return r(void 0,p)}else return r(void 0,c)}function s(p,c,f){if(f in t)return r(p,c);if(f in e)return r(void 0,p)}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(p,c,f)=>i(bu(p),bu(c),f,!0)};return de.forEach(Object.keys({...e,...t}),function(c){const f=l[c]||i,u=f(e[c],t[c],c);de.isUndefined(u)&&f!==s||(n[c]=u)}),n}const Cu=e=>{const t=Vn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:s}=t;if(t.headers=a=jt.from(a),t.url=uu(_u(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),de.isFormData(n)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(de.isFunction(n.getHeaders)){const l=n.getHeaders(),p=["content-type","content-length"];Object.entries(l).forEach(([c,f])=>{p.includes(c.toLowerCase())&&a.set(c,f)})}}if(ft.hasStandardBrowserEnv&&(r&&de.isFunction(r)&&(r=r(t)),r||r!==!1&&E3(t.url))){const l=i&&o&&O3.read(o);l&&a.set(i,l)}return t},A3=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=Cu(e);let o=i.data;const a=jt.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:p}=i,c,f,u,m,h;function g(){m&&m(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let d=new XMLHttpRequest;d.open(i.method.toUpperCase(),i.url,!0),d.timeout=i.timeout;function v(){if(!d)return;const C=jt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:C,config:e,request:d};gu(function(I){n(I),g()},function(I){r(I),g()},w),d=null}"onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(v)},d.onabort=function(){d&&(r(new Pe("Request aborted",Pe.ECONNABORTED,e,d)),d=null)},d.onerror=function(y){const w=y&&y.message?y.message:"Network Error",A=new Pe(w,Pe.ERR_NETWORK,e,d);A.event=y||null,r(A),d=null},d.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||du;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),r(new Pe(y,w.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,e,d)),d=null},o===void 0&&a.setContentType(null),"setRequestHeader"in d&&de.forEach(a.toJSON(),function(y,w){d.setRequestHeader(w,y)}),de.isUndefined(i.withCredentials)||(d.withCredentials=!!i.withCredentials),s&&s!=="json"&&(d.responseType=i.responseType),p&&([u,h]=oo(p,!0),d.addEventListener("progress",u)),l&&d.upload&&([f,m]=oo(l),d.upload.addEventListener("progress",f),d.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(c=C=>{d&&(r(!C||C.type?new cr(null,e,d):C),d.abort(),d=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const _=w3(i.url);if(_&&ft.protocols.indexOf(_)===-1){r(new Pe("Unsupported protocol "+_+":",Pe.ERR_BAD_REQUEST,e));return}d.send(o||null)})},T3=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(p){if(!i){i=!0,s();const c=p instanceof Error?p:this.reason;r.abort(c instanceof Pe?c:new cr(c instanceof Error?c.message:c))}};let a=t&&setTimeout(()=>{a=null,o(new Pe(`timeout ${t} of ms exceeded`,Pe.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>de.asap(s),l}},N3=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},P3=async function*(e,t){for await(const n of L3(e))yield*N3(n,t)},L3=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},wu=(e,t,n,r)=>{const i=P3(e,t);let o=0,a,s=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:p,value:c}=await i.next();if(p){s(),l.close();return}let f=c.byteLength;if(n){let u=o+=f;n(u)}l.enqueue(new Uint8Array(c))}catch(p){throw s(p),p}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},xu=64*1024,{isFunction:ao}=de,R3=(({Request:e,Response:t})=>({Request:e,Response:t}))(de.global),{ReadableStream:ku,TextEncoder:Eu}=de.global,Ou=(e,...t)=>{try{return!!e(...t)}catch{return!1}},M3=e=>{e=de.merge.call({skipUndefined:!0},R3,e);const{fetch:t,Request:n,Response:r}=e,i=t?ao(t):typeof fetch=="function",o=ao(n),a=ao(r);if(!i)return!1;const s=i&&ao(ku),l=i&&(typeof Eu=="function"?(h=>g=>h.encode(g))(new Eu):async h=>new Uint8Array(await new n(h).arrayBuffer())),p=o&&s&&Ou(()=>{let h=!1;const g=new n(ft.origin,{body:new ku,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!g}),c=a&&s&&Ou(()=>de.isReadableStream(new r("").body)),f={stream:c&&(h=>h.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!f[h]&&(f[h]=(g,d)=>{let v=g&&g[h];if(v)return v.call(g);throw new Pe(`Response type '${h}' is not supported`,Pe.ERR_NOT_SUPPORT,d)})});const u=async h=>{if(h==null)return 0;if(de.isBlob(h))return h.size;if(de.isSpecCompliantForm(h))return(await new n(ft.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(de.isArrayBufferView(h)||de.isArrayBuffer(h))return h.byteLength;if(de.isURLSearchParams(h)&&(h=h+""),de.isString(h))return(await l(h)).byteLength},m=async(h,g)=>{const d=de.toFiniteNumber(h.getContentLength());return d??u(g)};return async h=>{let{url:g,method:d,data:v,signal:_,cancelToken:C,timeout:y,onDownloadProgress:w,onUploadProgress:A,responseType:I,headers:S,withCredentials:N="same-origin",fetchOptions:T}=Cu(h),k=t||fetch;I=I?(I+"").toLowerCase():"text";let E=T3([_,C&&C.toAbortSignal()],y),L=null;const V=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let K;try{if(A&&p&&d!=="get"&&d!=="head"&&(K=await m(S,v))!==0){let O=new n(g,{method:"POST",body:v,duplex:"half"}),P;if(de.isFormData(v)&&(P=O.headers.get("content-type"))&&S.setContentType(P),O.body){const[M,Z]=vu(K,oo(yu(A)));v=wu(O.body,xu,M,Z)}}de.isString(N)||(N=N?"include":"omit");const W=o&&"credentials"in n.prototype,te={...T,signal:E,method:d.toUpperCase(),headers:S.normalize().toJSON(),body:v,duplex:"half",credentials:W?N:void 0};L=o&&new n(g,te);let fe=await(o?k(L,T):k(g,te));const ee=c&&(I==="stream"||I==="response");if(c&&(w||ee&&V)){const O={};["status","statusText","headers"].forEach(Q=>{O[Q]=fe[Q]});const P=de.toFiniteNumber(fe.headers.get("content-length")),[M,Z]=w&&vu(P,oo(yu(w),!0))||[];fe=new r(wu(fe.body,xu,M,()=>{Z&&Z(),V&&V()}),O)}I=I||"text";let j=await f[de.findKey(f,I)||"text"](fe,h);return!ee&&V&&V(),await new Promise((O,P)=>{gu(O,P,{data:j,headers:jt.from(fe.headers),status:fe.status,statusText:fe.statusText,config:h,request:L})})}catch(W){throw V&&V(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,h,L),{cause:W.cause||W}):Pe.from(W,W&&W.code,h,L)}}},q3=new Map,Su=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,s=a,l,p,c=q3;for(;s--;)l=o[s],p=c.get(l),p===void 0&&c.set(l,p=s?new Map:M3(t)),c=p;return p};Su();const Ha={http:i3,xhr:A3,fetch:{get:Su}};de.forEach(Ha,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Iu=e=>`- ${e}`,j3=e=>de.isFunction(e)||e===null||e===!1;function D3(e,t){e=de.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let s;if(i=r,!j3(r)&&(i=Ha[(s=String(r)).toLowerCase()],i===void 0))throw new Pe(`Unknown adapter '${s}'`);if(i&&(de.isFunction(i)||(i=i.get(t))))break;o[s||"#"+a]=i}if(!i){const a=Object.entries(o).map(([l,p])=>`adapter ${l} `+(p===!1?"is not supported by the environment":"is not available in the build"));let s=n?a.length>1?`since :
|
|
84
84
|
`+a.map(Iu).join(`
|
|
85
85
|
`):" "+Iu(a[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const Au={getAdapter:D3,adapters:Ha};function Ua(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cr(null,e)}function Tu(e){return Ua(e),e.headers=jt.from(e.headers),e.data=Va.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Au.getAdapter(e.adapter||$a.adapter,e)(e).then(function(r){return Ua(e),r.data=Va.call(e,e.transformResponse,r),r.headers=jt.from(r.headers),r},function(r){return mu(r)||(Ua(e),r&&r.response&&(r.response.data=Va.call(e,e.transformResponse,r.response),r.response.headers=jt.from(r.response.headers))),Promise.reject(r)})}const Nu="1.13.2",so={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{so[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Pu={};so.transitional=function(t,n,r){function i(o,a){return"[Axios v"+Nu+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(t===!1)throw new Pe(i(a," has been removed"+(n?" in "+n:"")),Pe.ERR_DEPRECATED);return n&&!Pu[a]&&(Pu[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,s):!0}},so.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function B3(e,t,n){if(typeof e!="object")throw new Pe("options must be an object",Pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const s=e[o],l=s===void 0||a(s,o,e);if(l!==!0)throw new Pe("option "+o+" must be "+l,Pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Pe("Unknown option "+o,Pe.ERR_BAD_OPTION)}}const lo={assertOptions:B3,validators:so},Xt=lo.validators;class co{constructor(t){this.defaults=t||{},this.interceptors={request:new fu,response:new fu}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
86
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&lo.assertOptions(r,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),i!=null&&(de.isFunction(i)?n.paramsSerializer={serialize:i}:lo.assertOptions(i,{encode:Xt.function,serialize:Xt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),lo.assertOptions(n,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&de.merge(o.common,o[n.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=jt.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const p=[];this.interceptors.response.forEach(function(g){p.push(g.fulfilled,g.rejected)});let c,f=0,u;if(!l){const h=[Tu.bind(this),void 0];for(h.unshift(...s),h.push(...p),u=h.length,c=Promise.resolve(n);f<u;)c=c.then(h[f++],h[f++]);return c}u=s.length;let m=n;for(;f<u;){const h=s[f++],g=s[f++];try{m=h(m)}catch(d){g.call(this,d);break}}try{c=Tu.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,u=p.length;f<u;)c=c.then(p[f++],p[f++]);return c}getUri(t){t=Vn(this.defaults,t);const n=_u(t.baseURL,t.url,t.allowAbsoluteUrls);return uu(n,t.params,t.paramsSerializer)}}de.forEach(["delete","get","head","options"],function(t){co.prototype[t]=function(n,r){return this.request(Vn(r||{},{method:t,url:n,data:(r||{}).data}))}}),de.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,s){return this.request(Vn(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}co.prototype[t]=n(),co.prototype[t+"Form"]=n(!0)});const uo=co;class za{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new cr(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new za(function(i){t=i}),cancel:t}}}const $3=za;function F3(e){return function(n){return e.apply(null,n)}}function V3(e){return de.isObject(e)&&e.isAxiosError===!0}const Ka={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ka).forEach(([e,t])=>{Ka[t]=e});const H3=Ka;function Lu(e){const t=new uo(e),n=Xc(uo.prototype.request,t);return de.extend(n,uo.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Lu(Vn(e,i))},n}const Be=Lu($a);Be.Axios=uo,Be.CanceledError=cr,Be.CancelToken=$3,Be.isCancel=mu,Be.VERSION=Nu,Be.toFormData=no,Be.AxiosError=Pe,Be.Cancel=Be.CanceledError,Be.all=function(t){return Promise.all(t)},Be.spread=F3,Be.isAxiosError=V3,Be.mergeConfig=Vn,Be.AxiosHeaders=jt,Be.formToJSON=e=>hu(de.isHTMLForm(e)?new FormData(e):e),Be.getAdapter=Au.getAdapter,Be.HttpStatusCode=H3,Be.default=Be;class U3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}async getProductConfiguration(t){return(await Be.post(`${this.restURL}?methodName=getProductConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItems({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItems`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItemAttributes({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItemAttributes`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductOptionsPricing({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductOptionsPricing`,t,{headers:{"Content-Type":"application/json"}})).data}async calculateBestOfferPrice({request:t}){return(await Be.post(`${this.restURL}?methodName=calculateBestOfferPrice`,t,{headers:{"Content-Type":"application/json"}})).data}async getRecords({request:t}){return(await Be.post(`${this.restURL}?methodName=getRecords`,t,{headers:{"Content-Type":"application/json"}})).data}async maintainQuoteConfiguration({request:t}){return(await Be.post(`${this.restURL}?methodName=maintainQuoteConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductCrossSells({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductCrossSells`,t,{headers:{"Content-Type":"application/json"}})).data}async createQuoteProducts({request:t}){return(await Be.post(`${this.restURL}?methodName=createQuoteProducts`,t,{headers:{"Content-Type":"application/json"}})).data}}class z3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}getReturn(t){return{error:null,data:JSON.stringify(t.data),isSuccess:!0}}async getOrgInformation(){return(await Be.post(`${this.restURL}?methodName=getOrgInformation`,{},{headers:{"Content-Type":"application/json"}})).data}async getRecordInfo(t){return(await Be.post(`${this.restURL}?methodName=getRecordInfo`,t,{headers:{"Content-Type":"application/json"}})).data}getPrimaryQuote(){return new Promise((t,n)=>{setTimeout(()=>{t({userLocale:null,templateId:"a1RA000000XMtU7MAL",recordId:"a0jKb000004V2dsIACC",orgType:null,orgId:null,opportunityId:null,objectType:"XX_ORD1__Quote__c",name:"QUOTE-1379639",maxSequenceNumber:null,lineItemsCount:1,eCatalogId:"a1BKb000004oKC9MAM",currencycode:null,accountId:"0012G0000277jkgQAA"})},500)})}}const K3=(e=>(Yn("data-v-adfc84e9"),e=e(),er(),e))(()=>b("div",{class:"dropdowntp"},null,-1)),Z3={class:"app-wrapper"},Q3=Ve({__name:"ExpediteConfigurator",props:{itemId:{type:String,required:!0},qliId:{type:String,required:!1},quoteId:{type:String,required:!1},restUrl:{type:String,required:"https://ec-ord1-dev-ed.my.salesforce-sites.com/Order"}},setup(e){const t=ar(),n=Ui(),r=an(),i=ae(!1),o=e;return wn(async()=>{window.productManagerController=new U3(o.restUrl),window.salesforceConnector=new z3(o.restUrl),i.value=!0,await t.start(o.quoteId),i.value=!1}),(a,s)=>(X(),ne(Oe,null,[_e(h0),_e(y0),Xe(r).errorPopup?(X(),Te(e0,{key:0,data:Xe(r).errorPopup,onClose:s[0]||(s[0]=l=>Xe(r).errorPopup=null)},null,8,["data"])):ye("",!0),Xe(n).unsavedChanges?(X(),Te(r0,{key:1,data:Xe(n).unsavedChanges,onClose:s[1]||(s[1]=l=>Xe(n).unsavedChanges=null)},null,8,["data"])):ye("",!0),K3,b("div",Z3,[i.value?(X(),Te(Ca,{key:1})):(X(),Te(_p,{key:0,"item-id":o.itemId,"qli-id":o.qliId},null,8,["item-id","qli-id"]))])],64))}},[["__scopeId","data-v-adfc84e9"]]),X3=Rt("mygpt",()=>{const e=ae("");async function t(r,i="gpt-3.5-turbo",o=300){var a,s,l;if(!e.value)throw new Error("Secret key is required. Please set it in the store.");try{const p=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.value}`},body:JSON.stringify({model:i,messages:r,max_tokens:Math.min(o,300),temperature:.7})});if(!p.ok){const f=await p.json().catch(()=>({}));throw new Error(((a=f.error)==null?void 0:a.message)||`API Error: ${p.status} ${p.statusText}`)}return((l=(s=(await p.json()).choices[0])==null?void 0:s.message)==null?void 0:l.content)||"No response generated"}catch(p){throw new Error(p.message||"Failed to get response from GPT")}}function n(r){e.value=r}return{secretKey:e,getGptResponse:t,setSecretKey:n}}),Kr=e=>(Yn("data-v-46273585"),e=e(),er(),e),J3={class:"custom-gpt-container"},W3={class:"gpt-header"},G3=Kr(()=>b("h3",{class:"gpt-title"},"GPT Chat",-1)),Y3={class:"gpt-response-area"},e8={key:0,class:"loading-indicator"},t8=[Kr(()=>b("div",{class:"spinner"},null,-1)),Kr(()=>b("span",null,"Thinking...",-1))],n8={key:1,class:"error-message"},r8=Kr(()=>b("strong",null,"Error:",-1)),i8={key:2,class:"response-content"},o8={key:3,class:"empty-state"},a8=[Kr(()=>b("p",null,"Enter a message below to start a conversation with GPT 5.0",-1))],s8={class:"gpt-input-area"},l8={class:"input-wrapper"},c8=["placeholder","disabled"],u8=["disabled"],f8={key:0},d8={key:1},h8={key:0,class:"warning-message"},p8=Ve({__name:"ExpediteGPT",props:{secretKey:{type:String,required:!1,default:""},model:{type:String,required:!1,default:"gpt-3.5-turbo"},maxTokens:{type:Number,required:!1,default:300},placeholder:{type:String,required:!1,default:"Enter your message..."}},setup(e){const t=e,n=X3(),r=be(()=>t.secretKey||n.secretKey),i=ae(""),o=ae(""),a=ae(!1),s=ae(null),l=ae([]),p=be(()=>o.value.trim().length>0),c=be(()=>i.value.trim().length>0&&!a.value&&r.value),f=async()=>{if(!c.value)return;const h=i.value.trim();if(h){a.value=!0,s.value=null,i.value="";try{l.value.push({role:"user",content:h});const g=l.value.reduce((_,C)=>_+Math.ceil(C.content.length/4),0);let d=[...l.value];g>t.maxTokens&&(d=l.value.slice(-3));const v=await n.getGptResponse(d,t.model,t.maxTokens);o.value=v,l.value.push({role:"assistant",content:v})}catch(g){s.value=g.message||"Failed to get response from GPT",console.error("GPT API Error:",g)}finally{a.value=!1}}},u=h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),f())},m=()=>{l.value=[],o.value="",s.value=null};return wn(()=>{n.setSecretKey(t.secretKey)}),(h,g)=>(X(),ne("div",J3,[b("div",W3,[G3,p.value||l.value.length>0?(X(),ne("button",{key:0,onClick:m,class:"clear-button",type:"button"}," Clear ")):ye("",!0)]),b("div",Y3,[a.value?(X(),ne("div",e8,t8)):s.value?(X(),ne("div",n8,[r8,Fe(" "+ve(s.value),1)])):p.value?(X(),ne("div",i8,ve(o.value),1)):(X(),ne("div",o8,a8))]),b("div",s8,[b("div",l8,[Cn(b("textarea",{"onUpdate:modelValue":g[0]||(g[0]=d=>i.value=d),placeholder:e.placeholder,disabled:a.value||!r.value,onKeypress:u,class:"gpt-input",rows:"3"},null,40,c8),[[Di,i.value]]),b("button",{onClick:f,disabled:!c.value,class:"send-button",type:"button"},[a.value?(X(),ne("span",f8,"...")):(X(),ne("span",d8,"Send"))],8,u8)]),r.value?ye("",!0):(X(),ne("div",h8," ⚠️ Secret key is required to use this component. Set it via prop or in the store. "))])]))}},[["__scopeId","data-v-46273585"]]),m8={install(e){e.config.globalProperties.$formatCurrency=(t,n={})=>{const r={},i=n.locale||r.locale||"en-US",o=n.currency||r.currency||"USD";let a=t;return typeof t=="string"&&(a=Number(t.replace(/[^0-9.-]/g,""))),new Intl.NumberFormat(i,{style:"currency",currency:o,...n}).format(Number.isFinite(a)?a:0)}}};let fo=null;if(typeof window<"u"){try{fo=y1()}catch{}fo||(fo=_1(),jr(fo))}let ho=null,po=null;async function g8(){return ho||po||(po=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,t=await fetch(e);if(t.ok)return ho=await t.text(),ho}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),po)}const Ru=e=>class extends e{async connectedCallback(){var t;if(this._instance){const n=(t=this._instance.appContext)==null?void 0:t.app;n&&(n.config.globalProperties.$formatCurrency||n.use(m8))}if(super.connectedCallback&&super.connectedCallback(),!!this.shadowRoot&&!this.shadowRoot.querySelector("style[data-vue-expedite-style]"))try{const n=await g8();if(n){const r=document.createElement("style");r.setAttribute("data-vue-expedite-style","true"),r.textContent=n,this.shadowRoot.prepend(r)}else{const r=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("data-vue-expedite-style","true"),i.href=r,this.shadowRoot.prepend(i)}}catch(n){console.warn("[ExpediteComponents] Failed to inject CSS:",n)}}},Mu=Ru(uc(Q3)),qu=Ru(uc(p8));function Za(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",Mu),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",qu))}typeof window<"u"&&Za();const v8={register:Za};en.ExpediteConfiguratorElement=Mu,en.ExpediteGPTElement=qu,en.default=v8,en.registerWebComponents=Za,Object.defineProperties(en,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
86
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&lo.assertOptions(r,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),i!=null&&(de.isFunction(i)?n.paramsSerializer={serialize:i}:lo.assertOptions(i,{encode:Xt.function,serialize:Xt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),lo.assertOptions(n,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&de.merge(o.common,o[n.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=jt.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const p=[];this.interceptors.response.forEach(function(g){p.push(g.fulfilled,g.rejected)});let c,f=0,u;if(!l){const h=[Tu.bind(this),void 0];for(h.unshift(...s),h.push(...p),u=h.length,c=Promise.resolve(n);f<u;)c=c.then(h[f++],h[f++]);return c}u=s.length;let m=n;for(;f<u;){const h=s[f++],g=s[f++];try{m=h(m)}catch(d){g.call(this,d);break}}try{c=Tu.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,u=p.length;f<u;)c=c.then(p[f++],p[f++]);return c}getUri(t){t=Vn(this.defaults,t);const n=_u(t.baseURL,t.url,t.allowAbsoluteUrls);return uu(n,t.params,t.paramsSerializer)}}de.forEach(["delete","get","head","options"],function(t){co.prototype[t]=function(n,r){return this.request(Vn(r||{},{method:t,url:n,data:(r||{}).data}))}}),de.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,s){return this.request(Vn(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}co.prototype[t]=n(),co.prototype[t+"Form"]=n(!0)});const uo=co;class za{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new cr(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new za(function(i){t=i}),cancel:t}}}const $3=za;function F3(e){return function(n){return e.apply(null,n)}}function V3(e){return de.isObject(e)&&e.isAxiosError===!0}const Ka={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ka).forEach(([e,t])=>{Ka[t]=e});const H3=Ka;function Lu(e){const t=new uo(e),n=Xc(uo.prototype.request,t);return de.extend(n,uo.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Lu(Vn(e,i))},n}const Be=Lu($a);Be.Axios=uo,Be.CanceledError=cr,Be.CancelToken=$3,Be.isCancel=mu,Be.VERSION=Nu,Be.toFormData=no,Be.AxiosError=Pe,Be.Cancel=Be.CanceledError,Be.all=function(t){return Promise.all(t)},Be.spread=F3,Be.isAxiosError=V3,Be.mergeConfig=Vn,Be.AxiosHeaders=jt,Be.formToJSON=e=>hu(de.isHTMLForm(e)?new FormData(e):e),Be.getAdapter=Au.getAdapter,Be.HttpStatusCode=H3,Be.default=Be;class U3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}async getProductConfiguration(t){return(await Be.post(`${this.restURL}?methodName=getProductConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItems({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItems`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItemAttributes({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItemAttributes`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductOptionsPricing({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductOptionsPricing`,t,{headers:{"Content-Type":"application/json"}})).data}async calculateBestOfferPrice({request:t}){return(await Be.post(`${this.restURL}?methodName=calculateBestOfferPrice`,t,{headers:{"Content-Type":"application/json"}})).data}async getRecords({request:t}){return(await Be.post(`${this.restURL}?methodName=getRecords`,t,{headers:{"Content-Type":"application/json"}})).data}async maintainQuoteConfiguration({request:t}){return(await Be.post(`${this.restURL}?methodName=maintainQuoteConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductCrossSells({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductCrossSells`,t,{headers:{"Content-Type":"application/json"}})).data}async createQuoteProducts({request:t}){return(await Be.post(`${this.restURL}?methodName=createQuoteProducts`,t,{headers:{"Content-Type":"application/json"}})).data}}class z3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}getReturn(t){return{error:null,data:JSON.stringify(t.data),isSuccess:!0}}async getOrgInformation(){return(await Be.post(`${this.restURL}?methodName=getOrgInformation`,{},{headers:{"Content-Type":"application/json"}})).data}async getRecordInfo(t){return(await Be.post(`${this.restURL}?methodName=getRecordInfo`,t,{headers:{"Content-Type":"application/json"}})).data}getPrimaryQuote(){return new Promise((t,n)=>{setTimeout(()=>{t({userLocale:null,templateId:"a1RA000000XMtU7MAL",recordId:"a0jKb000004V2dsIACC",orgType:null,orgId:null,opportunityId:null,objectType:"XX_ORD1__Quote__c",name:"QUOTE-1379639",maxSequenceNumber:null,lineItemsCount:1,eCatalogId:"a1BKb000004oKC9MAM",currencycode:null,accountId:"0012G0000277jkgQAA"})},500)})}}const K3=(e=>(Yn("data-v-adfc84e9"),e=e(),er(),e))(()=>b("div",{class:"dropdowntp"},null,-1)),Z3={class:"app-wrapper"},Q3=Ve({__name:"ExpediteConfigurator",props:{itemId:{type:String,required:!0},qliId:{type:String,required:!1},quoteId:{type:String,required:!1},restUrl:{type:String,required:"https://ec-ord1-dev-ed.my.salesforce-sites.com/Order"}},setup(e){const t=ar(),n=Ui(),r=an(),i=ae(!1),o=e;return wn(async()=>{window.productManagerController=new U3(o.restUrl),window.salesforceConnector=new z3(o.restUrl),i.value=!0,await t.start(o.quoteId),i.value=!1}),(a,s)=>(X(),ne(Oe,null,[_e(h0),_e(y0),Xe(r).errorPopup?(X(),Te(e0,{key:0,data:Xe(r).errorPopup,onClose:s[0]||(s[0]=l=>Xe(r).errorPopup=null)},null,8,["data"])):ye("",!0),Xe(n).unsavedChanges?(X(),Te(r0,{key:1,data:Xe(n).unsavedChanges,onClose:s[1]||(s[1]=l=>Xe(n).unsavedChanges=null)},null,8,["data"])):ye("",!0),K3,b("div",Z3,[i.value?(X(),Te(Ca,{key:1})):(X(),Te(_p,{key:0,"item-id":o.itemId,"qli-id":o.qliId},null,8,["item-id","qli-id"]))])],64))}},[["__scopeId","data-v-adfc84e9"]]),X3=Rt("mygpt",()=>{const e=ae("");async function t(r,i="gpt-3.5-turbo",o=300){var a,s,l;if(!e.value)throw new Error("Secret key is required. Please set it in the store.");try{const p=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.value}`},body:JSON.stringify({model:i,messages:r,max_tokens:Math.min(o,300),temperature:.7})});if(!p.ok){const f=await p.json().catch(()=>({}));throw new Error(((a=f.error)==null?void 0:a.message)||`API Error: ${p.status} ${p.statusText}`)}return((l=(s=(await p.json()).choices[0])==null?void 0:s.message)==null?void 0:l.content)||"No response generated"}catch(p){throw new Error(p.message||"Failed to get response from GPT")}}function n(r){e.value=r}return{secretKey:e,getGptResponse:t,setSecretKey:n}}),Kr=e=>(Yn("data-v-46273585"),e=e(),er(),e),J3={class:"custom-gpt-container"},W3={class:"gpt-header"},G3=Kr(()=>b("h3",{class:"gpt-title"},"GPT Chat",-1)),Y3={class:"gpt-response-area"},e8={key:0,class:"loading-indicator"},t8=[Kr(()=>b("div",{class:"spinner"},null,-1)),Kr(()=>b("span",null,"Thinking...",-1))],n8={key:1,class:"error-message"},r8=Kr(()=>b("strong",null,"Error:",-1)),i8={key:2,class:"response-content"},o8={key:3,class:"empty-state"},a8=[Kr(()=>b("p",null,"Enter a message below to start a conversation with GPT 5.0",-1))],s8={class:"gpt-input-area"},l8={class:"input-wrapper"},c8=["placeholder","disabled"],u8=["disabled"],f8={key:0},d8={key:1},h8={key:0,class:"warning-message"},p8=Ve({__name:"ExpediteGPT",props:{secretKey:{type:String,required:!1,default:""},model:{type:String,required:!1,default:"gpt-3.5-turbo"},maxTokens:{type:Number,required:!1,default:300},placeholder:{type:String,required:!1,default:"Enter your message..."}},setup(e){const t=e,n=X3(),r=be(()=>t.secretKey||n.secretKey),i=ae(""),o=ae(""),a=ae(!1),s=ae(null),l=ae([]),p=be(()=>o.value.trim().length>0),c=be(()=>i.value.trim().length>0&&!a.value&&r.value),f=async()=>{if(!c.value)return;const h=i.value.trim();if(h){a.value=!0,s.value=null,i.value="";try{l.value.push({role:"user",content:h});const g=l.value.reduce((_,C)=>_+Math.ceil(C.content.length/4),0);let d=[...l.value];g>t.maxTokens&&(d=l.value.slice(-3));const v=await n.getGptResponse(d,t.model,t.maxTokens);o.value=v,l.value.push({role:"assistant",content:v})}catch(g){s.value=g.message||"Failed to get response from GPT",console.error("GPT API Error:",g)}finally{a.value=!1}}},u=h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),f())},m=()=>{l.value=[],o.value="",s.value=null};return wn(()=>{n.setSecretKey(t.secretKey)}),(h,g)=>(X(),ne("div",J3,[b("div",W3,[G3,p.value||l.value.length>0?(X(),ne("button",{key:0,onClick:m,class:"clear-button",type:"button"}," Clear ")):ye("",!0)]),b("div",Y3,[a.value?(X(),ne("div",e8,t8)):s.value?(X(),ne("div",n8,[r8,Fe(" "+ve(s.value),1)])):p.value?(X(),ne("div",i8,ve(o.value),1)):(X(),ne("div",o8,a8))]),b("div",s8,[b("div",l8,[Cn(b("textarea",{"onUpdate:modelValue":g[0]||(g[0]=d=>i.value=d),placeholder:e.placeholder,disabled:a.value||!r.value,onKeypress:u,class:"gpt-input",rows:"3"},null,40,c8),[[Di,i.value]]),b("button",{onClick:f,disabled:!c.value,class:"send-button",type:"button"},[a.value?(X(),ne("span",f8,"...")):(X(),ne("span",d8,"Send"))],8,u8)]),r.value?ye("",!0):(X(),ne("div",h8," ⚠️ Secret key is required to use this component. Set it via prop or in the store. "))])]))}},[["__scopeId","data-v-46273585"]]),m8={install(e){e.config.globalProperties.$formatCurrency=(t,n={})=>{const r={},i=n.locale||r.locale||"en-US",o=n.currency||r.currency||"USD";let a=t;return typeof t=="string"&&(a=Number(t.replace(/[^0-9.-]/g,""))),new Intl.NumberFormat(i,{style:"currency",currency:o,...n}).format(Number.isFinite(a)?a:0)}}};let fo=null;if(typeof window<"u"){try{fo=y1()}catch{}fo||(fo=_1(),jr(fo))}let ho=null,po=null;async function g8(){return ho||po||(po=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,t=await fetch(e);if(t.ok)return ho=await t.text(),ho}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),po)}const Ru=e=>class extends e{async connectedCallback(){const t=()=>{var n,r;if((r=(n=this._instance)==null?void 0:n.appContext)!=null&&r.app){const i=this._instance.appContext.app;if(!i.config.globalProperties.$formatCurrency)return i.use(m8),!0}return!1};if(t()||Promise.resolve().then(()=>{t()||setTimeout(t,0)}),super.connectedCallback&&super.connectedCallback(),!!this.shadowRoot&&!this.shadowRoot.querySelector("style[data-vue-expedite-style]"))try{const n=await g8();if(n){const r=document.createElement("style");r.setAttribute("data-vue-expedite-style","true"),r.textContent=n,this.shadowRoot.prepend(r)}else{const r=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("data-vue-expedite-style","true"),i.href=r,this.shadowRoot.prepend(i)}}catch(n){console.warn("[ExpediteComponents] Failed to inject CSS:",n)}}},Mu=Ru(uc(Q3)),qu=Ru(uc(p8));function Za(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",Mu),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",qu))}typeof window<"u"&&Za();const v8={register:Za};en.ExpediteConfiguratorElement=Mu,en.ExpediteGPTElement=qu,en.default=v8,en.registerWebComponents=Za,Object.defineProperties(en,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|