@debales/ai 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module/ai.js CHANGED
@@ -76669,16 +76669,15 @@ class K_e extends c4 {
76669
76669
  })
76670
76670
  }), l = await o.json();
76671
76671
  if (!o.ok) {
76672
- const h = l;
76672
+ const c = l;
76673
76673
  return this.createErrorResult(
76674
- h.description || `Failed to add item to cart: ${o.status}`
76674
+ c.description || `Failed to add item to cart: ${o.status}`
76675
76675
  );
76676
76676
  }
76677
- const c = await this.fetchCart();
76678
- return c.success ? this.createSuccessResult(
76679
- c.data,
76677
+ return this.createSuccessResult(
76678
+ {},
76680
76679
  `Successfully added ${r} item(s) to cart`
76681
- ) : this.createErrorResult(c.error);
76680
+ );
76682
76681
  } catch (o) {
76683
76682
  return this.createErrorResult(
76684
76683
  o instanceof Error ? `Error adding to cart: ${o.message}` : "Unknown error occurred while adding to cart"
@@ -76844,16 +76843,15 @@ class Q_e extends c4 {
76844
76843
  try {
76845
76844
  window.require(
76846
76845
  ["Magento_Customer/js/customer-data"],
76847
- (h) => h.reload(["cart"], !0)
76846
+ (c) => c.reload(["cart"], !0)
76848
76847
  );
76849
- } catch (h) {
76850
- console.warn("Failed to reload cart data:", h);
76848
+ } catch (c) {
76849
+ console.warn("Failed to reload cart data:", c);
76851
76850
  }
76852
- const c = await this.fetchCart();
76853
- return c.success ? this.createSuccessResult(
76854
- c.data,
76851
+ return this.createSuccessResult(
76852
+ {},
76855
76853
  `Successfully added ${r} item(s) to cart`
76856
- ) : this.createErrorResult(c.error);
76854
+ );
76857
76855
  } catch (o) {
76858
76856
  return this.createErrorResult(
76859
76857
  o instanceof Error ? `Error adding to cart: ${o.message}` : "Unknown error occurred while adding to cart"
@@ -82020,15 +82018,12 @@ class fwe extends c4 {
82020
82018
  },
82021
82019
  body: JSON.stringify(p)
82022
82020
  });
82023
- if (!m.ok)
82024
- return this.createErrorResult(
82025
- `Failed to add item to cart: ${m.status}`
82026
- );
82027
- const g = await this.fetchCart();
82028
- return g.success ? this.createSuccessResult(
82029
- g.data,
82021
+ return m.ok ? this.createSuccessResult(
82022
+ {},
82030
82023
  "Item added to cart successfully"
82031
- ) : this.createErrorResult(g.error);
82024
+ ) : this.createErrorResult(
82025
+ `Failed to add item to cart: ${m.status}`
82026
+ );
82032
82027
  } catch (o) {
82033
82028
  return this.createErrorResult(
82034
82029
  o instanceof Error ? o.message : "Unknown error"
@@ -82246,14 +82241,14 @@ const xwe = ({
82246
82241
  l(null);
82247
82242
  const U = await e.addToCart(M, $, L);
82248
82243
  if (U.success) {
82249
- const P = await e.fetchCart();
82250
- return P.success ? {
82244
+ const P = await g();
82245
+ return P ? {
82251
82246
  success: !0,
82252
- data: P.data,
82247
+ data: P,
82253
82248
  message: U.message
82254
82249
  } : {
82255
82250
  success: !1,
82256
- error: P.error
82251
+ error: "Failed to fetch updated cart"
82257
82252
  };
82258
82253
  }
82259
82254
  return U;
@@ -3793,7 +3793,7 @@ Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map=="funct
3793
3793
  You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}pb.createRoot=function(a,s){if(!E(a))throw Error("Target container is not a DOM element.");fk(a);var f=!1,y="",_=Xb,C=UT,B=_v,z=null;return s!=null&&(s.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof s=="object"&&s!==null&&s.$$typeof===_c&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
3794
3794
 
3795
3795
  let root = createRoot(domContainer);
3796
- root.render(<App />);`),s.unstable_strictMode===!0&&(f=!0),s.identifierPrefix!==void 0&&(y=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(C=s.onCaughtError),s.onRecoverableError!==void 0&&(B=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(z=s.unstable_transitionCallbacks)),s=Z_(a,1,!1,null,null,f,y,_,C,B,z,null),a[Ac]=s.current,O_(a),new py(s)},pb.hydrateRoot=function(a,s,f){if(!E(a))throw Error("Target container is not a DOM element.");fk(a),s===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var y=!1,_="",C=Xb,B=UT,z=_v,Q=null,J=null;return f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(_=f.identifierPrefix),f.onUncaughtError!==void 0&&(C=f.onUncaughtError),f.onCaughtError!==void 0&&(B=f.onCaughtError),f.onRecoverableError!==void 0&&(z=f.onRecoverableError),f.unstable_transitionCallbacks!==void 0&&(Q=f.unstable_transitionCallbacks),f.formState!==void 0&&(J=f.formState)),s=Z_(a,1,!0,s,f??null,y,_,C,B,z,Q,J),s.context=K_(null),f=s.current,y=to(f),y=Re(y),_=tl(y),_.callback=null,ws(f,_,y),f=y,s.current.lanes=f,it(s,f),Jo(s),a[Ac]=s.current,O_(a),new L0(s)},pb.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),pb}var dG;function nbe(){if(dG)return B2.exports;dG=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}return process.env.NODE_ENV==="production"?(e(),B2.exports=ebe()):B2.exports=tbe(),B2.exports}var rbe=nbe();const hG="debales-ai-assistant",pG="debales-chatbot-container",ibe=ee.forwardRef(({children:e,globalStyles:t="",containerStyles:n={},onReady:r},i)=>{const o=ee.useRef(null),[l,c]=ee.useState(null),h=ee.useRef(null),p=ee.useRef(null),m=ee.useRef({get shadowRoot(){return h.current},get container(){return l},querySelector:g=>{var x;return((x=h.current)==null?void 0:x.querySelector(g))||null},querySelectorAll:g=>{var x;return((x=h.current)==null?void 0:x.querySelectorAll(g))||null}});return ee.useImperativeHandle(i,()=>m.current,[]),ee.useEffect(()=>{const g=document.getElementById(hG);if(g?o.current=g:o.current&&(o.current.id=hG),o.current&&(o.current.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;"),o.current){if(o.current.shadowRoot){h.current=o.current.shadowRoot;const w=h.current.querySelector(`#${pG}`);w&&c(w);return}const x=o.current.attachShadow({mode:"open"});if(h.current=x,t){const w=document.createElement("style");w.textContent=t,x.appendChild(w)}const S=document.createElement("div");S.id=pG,S.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;",x.appendChild(S),c(S),r&&r(x,S)}},[t,r]),ee.useEffect(()=>(l&&!p.current&&(p.current=rbe.createRoot(l)),p.current&&l&&window.self===window.top&&p.current.render(I.jsx(oe.StyleSheetManager,{target:l,children:I.jsx(mP,{value:m.current,children:e})})),()=>{p.current&&p.current.unmount()}),[l,e]),I.jsx("div",{ref:o,style:n})});typeof window<"u"&&fi.init(Qse,{api_host:fs+"/ingest",ui_host:"https://us.posthog.com",defaults:"2025-11-30",debug:!0});class $2{isSupported(){return zd.detect()===this.platform}createSuccessResult(t,n){return{success:!0,data:t,message:n}}createErrorResult(t){return{success:!1,error:t}}}class abe extends $2{constructor(){super(...arguments);Br(this,"platform",di.DEFAULT)}async fetchCart(){return console.log("DefaultCartAdapter: fetchCart called"),this.createSuccessResult({items:[],total:0,itemCount:0,currency:"USD",token:"default-token"},"Default cart fetched")}async addToCart(n,r=1,i){return console.log("DefaultCartAdapter: addToCart called",{variantId:n,quantity:r,properties:i}),this.createSuccessResult({items:[],total:0,itemCount:0,currency:"USD",token:"default-token"},"Item added to cart (mock)")}async removeFromCart(n){return console.log("DefaultCartAdapter: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("DefaultCartAdapter: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("DefaultCartAdapter: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=n.replace(/^https?:\/\//,"");return console.log("DefaultCartAdapter: generateCartUrl called",{domain:n,sanitizedDomain:r}),`https://${r}/cart`}generateProductUrl(n,r){if(r.handle){const i=new URL(`https://${n}/products/${r.handle}`);return i.searchParams.append("variant",r.product_id),Yl(i.toString())}else return Yl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}class obe extends $2{constructor(){var n,r;super();Br(this,"platform",di.SHOPIFY);Br(this,"cartEndpoint");Br(this,"localCartKey","debales_track_cart");this.cartEndpoint=((r=(n=window.Shopify)==null?void 0:n.routes)==null?void 0:r.root)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:r.id,variant_id:r.variant_id,quantity:r.quantity,title:r.title,price:r.price,properties:r.properties})),total:n.total_price/100,itemCount:n.item_count,currency:n.currency,token:n.token.split("?")[0]}}generateProductUrl(n,r){const i=MR(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/products/${r.handle}`,i.url);return o.searchParams.append("variant",r.product_id),Yl(o.toString())}else return Yl(r.link)}updateTrackCart({cartToken:n,sessionId:r=Er()}){localStorage.setItem(this.localCartKey,JSON.stringify({sessionId:r,cartToken:n}))}async fetchCart(){try{const n=await fetch(`${this.cartEndpoint}cart.js`),r=await n.json();if(!n.ok){const o=r;return this.createErrorResult(o.description||`Failed to fetch cart: ${n.status}`)}const i=r;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1,i){try{const o=await fetch(`${this.cartEndpoint}cart/add.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:n,quantity:r,properties:i}],attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:Er(),dbls_method:"add_to_cart"}})}),l=await o.json();if(!o.ok){const h=l;return this.createErrorResult(h.description||`Failed to add item to cart: ${o.status}`)}const c=await this.fetchCart();return c.success?this.createSuccessResult(c.data,`Successfully added ${r} item(s) to cart`):this.createErrorResult(c.error)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return this.updateQuantity({id:n,quantity:0})}async updateQuantity(n){try{const r=await fetch(`${this.cartEndpoint}cart/change.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n.id,quantity:n.quantity})}),i=await r.json();if(!r.ok){const o=i;return this.createErrorResult(o.description||`Failed to update item quantity: ${r.status}`)}return this.fetchCart().then(o=>{o.success&&this.updateTrackCart({cartToken:o==null?void 0:o.data.token})}),this.createSuccessResult(void 0,n.quantity===0?"Item removed from cart":`Quantity updated to ${n.quantity}`)}catch(r){return this.createErrorResult(r instanceof Error?`Error updating quantity: ${r.message}`:"Unknown error occurred while updating quantity")}}async clearCart(){try{const n=await fetch(`${this.cartEndpoint}cart/clear.js`,{method:"POST"});if(!n.ok){const r=await n.json();return this.createErrorResult(r.description||`Failed to clear cart: ${n.status}`)}return this.createSuccessResult(void 0,"Cart cleared successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error clearing cart: ${n.message}`:"Unknown error occurred while clearing cart")}}async addCartAttributes(n={}){try{const r=await fetch(`${this.cartEndpoint}cart/update.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:Er(),...n}})});if(!r.ok){const i=await r.json();return this.createErrorResult(i.description||`Failed to update cart attributes: ${r.status}`)}return this.createSuccessResult(void 0,"Cart attributes updated successfully")}catch(r){return this.createErrorResult(r instanceof Error?`Error updating cart attributes: ${r.message}`:"Unknown error occurred while updating cart attributes")}}generateCartUrl(n){const r=MR(n);if(!r.isValid)return"";const i=new URL("/cart",r.url);return i.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),i.searchParams.append("attributes[from]","debales-ai-chatbot"),i.searchParams.append("attributes[through]","add-to-cart"),i.searchParams.append("attributes[dbls_session_id]",Er()),i.searchParams.append("timestamp",Date.now().toString()),Yl(i.toString())}}class sbe extends $2{constructor(){var n,r;super();Br(this,"platform",di.MAGENTO);Br(this,"checkoutEndpoint");Br(this,"baseUrl");this.checkoutEndpoint=((n=window.checkout)==null?void 0:n.checkoutUrl)||"/",this.baseUrl=((r=window.checkout)==null?void 0:r.baseUrl)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:parseInt(r.item_id),variant_id:parseInt(r.product_id),quantity:r.qty,title:r.product_name,price:r.product_price_value,properties:{name:r.product_name}})),total:parseFloat(n.subtotalAmount),itemCount:n.summary_count,currency:"USD",token:n.data_id.toString()}}async fetchCart(){try{const n=await fetch(`${this.baseUrl}customer/section/load/?sections=cart&update_section_id=false`),r=await n.json();if(!n.ok)return this.createErrorResult(`Failed to fetch cart: ${n.status}`);const i=r.cart;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1){var i;try{const o=(i=document.querySelector('input[name="form_key"]'))==null?void 0:i.value;if(!o)return this.createErrorResult("Form key not found");const l=await fetch(`${this.checkoutEndpoint}cart/add`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({product:n,qty:r.toString(),form_key:o})});if(!l.ok)return this.createErrorResult(`Failed to add item to cart: ${l.status}`);try{window.require(["Magento_Customer/js/customer-data"],h=>h.reload(["cart"],!0))}catch(h){console.warn("Failed to reload cart data:",h)}const c=await this.fetchCart();return c.success?this.createSuccessResult(c.data,`Successfully added ${r} item(s) to cart`):this.createErrorResult(c.error)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return console.log("MethodNotImplemented: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("MethodNotImplemented: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("MethodNotImplemented: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=new URL(`https://${n}/checkout/cart?ref=debales-ai-${new Date().toISOString()}&attributes[from]=debales-ai-chatbot&attributes[through]=add-to-cart`);return r.searchParams.append("timestamp",Date.now().toString()),r.toString()}generateProductUrl(n,r){const i=MR(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/${r.handle}.html`,i.url);return Yl(o.toString())}else return Yl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}var L2={exports:{}};function lbe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var N2={exports:{}};const ube=aK(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var cbe=N2.exports,mG;function $n(){return mG||(mG=1,function(e,t){(function(n,r){e.exports=r()})(cbe,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof o4<"u"&&o4.crypto&&(o=o4.crypto),!o&&typeof lbe=="function")try{o=ube}catch{}var l=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function D(){}return function(R){var M;return D.prototype=R,M=new D,D.prototype=null,M}}(),h={},p=h.lib={},m=p.Base=function(){return{extend:function(D){var R=c(this);return D&&R.mixIn(D),(!R.hasOwnProperty("init")||this.init===R.init)&&(R.init=function(){R.$super.init.apply(this,arguments)}),R.init.prototype=R,R.$super=this,R},create:function(){var D=this.extend();return D.init.apply(D,arguments),D},init:function(){},mixIn:function(D){for(var R in D)D.hasOwnProperty(R)&&(this[R]=D[R]);D.hasOwnProperty("toString")&&(this.toString=D.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=p.WordArray=m.extend({init:function(D,R){D=this.words=D||[],R!=i?this.sigBytes=R:this.sigBytes=D.length*4},toString:function(D){return(D||S).stringify(this)},concat:function(D){var R=this.words,M=D.words,$=this.sigBytes,L=D.sigBytes;if(this.clamp(),$%4)for(var U=0;U<L;U++){var P=M[U>>>2]>>>24-U%4*8&255;R[$+U>>>2]|=P<<24-($+U)%4*8}else for(var G=0;G<L;G+=4)R[$+G>>>2]=M[G>>>2];return this.sigBytes+=L,this},clamp:function(){var D=this.words,R=this.sigBytes;D[R>>>2]&=4294967295<<32-R%4*8,D.length=r.ceil(R/4)},clone:function(){var D=m.clone.call(this);return D.words=this.words.slice(0),D},random:function(D){for(var R=[],M=0;M<D;M+=4)R.push(l());return new g.init(R,D)}}),x=h.enc={},S=x.Hex={stringify:function(D){for(var R=D.words,M=D.sigBytes,$=[],L=0;L<M;L++){var U=R[L>>>2]>>>24-L%4*8&255;$.push((U>>>4).toString(16)),$.push((U&15).toString(16))}return $.join("")},parse:function(D){for(var R=D.length,M=[],$=0;$<R;$+=2)M[$>>>3]|=parseInt(D.substr($,2),16)<<24-$%8*4;return new g.init(M,R/2)}},w=x.Latin1={stringify:function(D){for(var R=D.words,M=D.sigBytes,$=[],L=0;L<M;L++){var U=R[L>>>2]>>>24-L%4*8&255;$.push(String.fromCharCode(U))}return $.join("")},parse:function(D){for(var R=D.length,M=[],$=0;$<R;$++)M[$>>>2]|=(D.charCodeAt($)&255)<<24-$%4*8;return new g.init(M,R)}},A=x.Utf8={stringify:function(D){try{return decodeURIComponent(escape(w.stringify(D)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(D){return w.parse(unescape(encodeURIComponent(D)))}},E=p.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(D){typeof D=="string"&&(D=A.parse(D)),this._data.concat(D),this._nDataBytes+=D.sigBytes},_process:function(D){var R,M=this._data,$=M.words,L=M.sigBytes,U=this.blockSize,P=U*4,G=L/P;D?G=r.ceil(G):G=r.max((G|0)-this._minBufferSize,0);var N=G*U,V=r.min(N*4,L);if(N){for(var W=0;W<N;W+=U)this._doProcessBlock($,W);R=$.splice(0,N),M.sigBytes-=V}return new g.init(R,V)},clone:function(){var D=m.clone.call(this);return D._data=this._data.clone(),D},_minBufferSize:0});p.Hasher=E.extend({cfg:m.extend(),init:function(D){this.cfg=this.cfg.extend(D),this.reset()},reset:function(){E.reset.call(this),this._doReset()},update:function(D){return this._append(D),this._process(),this},finalize:function(D){D&&this._append(D);var R=this._doFinalize();return R},blockSize:16,_createHelper:function(D){return function(R,M){return new D.init(M).finalize(R)}},_createHmacHelper:function(D){return function(R,M){return new k.HMAC.init(D,M).finalize(R)}}});var k=h.algo={};return h}(Math);return n})}(N2)),N2.exports}var z2={exports:{}},fbe=z2.exports,gG;function F2(){return gG||(gG=1,function(e,t){(function(n,r){e.exports=r($n())})(fbe,function(n){return function(r){var i=n,o=i.lib,l=o.Base,c=o.WordArray,h=i.x64={};h.Word=l.extend({init:function(p,m){this.high=p,this.low=m}}),h.WordArray=l.extend({init:function(p,m){p=this.words=p||[],m!=r?this.sigBytes=m:this.sigBytes=p.length*8},toX32:function(){for(var p=this.words,m=p.length,g=[],x=0;x<m;x++){var S=p[x];g.push(S.high),g.push(S.low)}return c.create(g,this.sigBytes)},clone:function(){for(var p=l.clone.call(this),m=p.words=this.words.slice(0),g=m.length,x=0;x<g;x++)m[x]=m[x].clone();return p}})}(),n})}(z2)),z2.exports}var U2={exports:{}},dbe=U2.exports,vG;function hbe(){return vG||(vG=1,function(e,t){(function(n,r){e.exports=r($n())})(dbe,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,o=i.WordArray,l=o.init,c=o.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var p=h.byteLength,m=[],g=0;g<p;g++)m[g>>>2]|=h[g]<<24-g%4*8;l.call(this,m,p)}else l.apply(this,arguments)};c.prototype=o}}(),n.lib.WordArray})}(U2)),U2.exports}var P2={exports:{}},pbe=P2.exports,yG;function mbe(){return yG||(yG=1,function(e,t){(function(n,r){e.exports=r($n())})(pbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.enc;l.Utf16=l.Utf16BE={stringify:function(h){for(var p=h.words,m=h.sigBytes,g=[],x=0;x<m;x+=2){var S=p[x>>>2]>>>16-x%4*8&65535;g.push(String.fromCharCode(S))}return g.join("")},parse:function(h){for(var p=h.length,m=[],g=0;g<p;g++)m[g>>>1]|=h.charCodeAt(g)<<16-g%2*16;return o.create(m,p*2)}},l.Utf16LE={stringify:function(h){for(var p=h.words,m=h.sigBytes,g=[],x=0;x<m;x+=2){var S=c(p[x>>>2]>>>16-x%4*8&65535);g.push(String.fromCharCode(S))}return g.join("")},parse:function(h){for(var p=h.length,m=[],g=0;g<p;g++)m[g>>>1]|=c(h.charCodeAt(g)<<16-g%2*16);return o.create(m,p*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),n.enc.Utf16})}(P2)),P2.exports}var H2={exports:{}},gbe=H2.exports,xG;function Mp(){return xG||(xG=1,function(e,t){(function(n,r){e.exports=r($n())})(gbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.enc;l.Base64={stringify:function(h){var p=h.words,m=h.sigBytes,g=this._map;h.clamp();for(var x=[],S=0;S<m;S+=3)for(var w=p[S>>>2]>>>24-S%4*8&255,A=p[S+1>>>2]>>>24-(S+1)%4*8&255,E=p[S+2>>>2]>>>24-(S+2)%4*8&255,k=w<<16|A<<8|E,D=0;D<4&&S+D*.75<m;D++)x.push(g.charAt(k>>>6*(3-D)&63));var R=g.charAt(64);if(R)for(;x.length%4;)x.push(R);return x.join("")},parse:function(h){var p=h.length,m=this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var x=0;x<m.length;x++)g[m.charCodeAt(x)]=x}var S=m.charAt(64);if(S){var w=h.indexOf(S);w!==-1&&(p=w)}return c(h,p,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,p,m){for(var g=[],x=0,S=0;S<p;S++)if(S%4){var w=m[h.charCodeAt(S-1)]<<S%4*2,A=m[h.charCodeAt(S)]>>>6-S%4*2,E=w|A;g[x>>>2]|=E<<24-x%4*8,x++}return o.create(g,x)}}(),n.enc.Base64})}(H2)),H2.exports}var j2={exports:{}},vbe=j2.exports,bG;function ybe(){return bG||(bG=1,function(e,t){(function(n,r){e.exports=r($n())})(vbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.enc;l.Base64url={stringify:function(h,p){p===void 0&&(p=!0);var m=h.words,g=h.sigBytes,x=p?this._safe_map:this._map;h.clamp();for(var S=[],w=0;w<g;w+=3)for(var A=m[w>>>2]>>>24-w%4*8&255,E=m[w+1>>>2]>>>24-(w+1)%4*8&255,k=m[w+2>>>2]>>>24-(w+2)%4*8&255,D=A<<16|E<<8|k,R=0;R<4&&w+R*.75<g;R++)S.push(x.charAt(D>>>6*(3-R)&63));var M=x.charAt(64);if(M)for(;S.length%4;)S.push(M);return S.join("")},parse:function(h,p){p===void 0&&(p=!0);var m=h.length,g=p?this._safe_map:this._map,x=this._reverseMap;if(!x){x=this._reverseMap=[];for(var S=0;S<g.length;S++)x[g.charCodeAt(S)]=S}var w=g.charAt(64);if(w){var A=h.indexOf(w);A!==-1&&(m=A)}return c(h,m,x)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,p,m){for(var g=[],x=0,S=0;S<p;S++)if(S%4){var w=m[h.charCodeAt(S-1)]<<S%4*2,A=m[h.charCodeAt(S)]>>>6-S%4*2,E=w|A;g[x>>>2]|=E<<24-x%4*8,x++}return o.create(g,x)}}(),n.enc.Base64url})}(j2)),j2.exports}var q2={exports:{}},xbe=q2.exports,_G;function Bp(){return _G||(_G=1,function(e,t){(function(n,r){e.exports=r($n())})(xbe,function(n){return function(r){var i=n,o=i.lib,l=o.WordArray,c=o.Hasher,h=i.algo,p=[];(function(){for(var A=0;A<64;A++)p[A]=r.abs(r.sin(A+1))*4294967296|0})();var m=h.MD5=c.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(A,E){for(var k=0;k<16;k++){var D=E+k,R=A[D];A[D]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}var M=this._hash.words,$=A[E+0],L=A[E+1],U=A[E+2],P=A[E+3],G=A[E+4],N=A[E+5],V=A[E+6],W=A[E+7],K=A[E+8],re=A[E+9],le=A[E+10],Y=A[E+11],ae=A[E+12],te=A[E+13],be=A[E+14],j=A[E+15],ce=M[0],ie=M[1],q=M[2],he=M[3];ce=g(ce,ie,q,he,$,7,p[0]),he=g(he,ce,ie,q,L,12,p[1]),q=g(q,he,ce,ie,U,17,p[2]),ie=g(ie,q,he,ce,P,22,p[3]),ce=g(ce,ie,q,he,G,7,p[4]),he=g(he,ce,ie,q,N,12,p[5]),q=g(q,he,ce,ie,V,17,p[6]),ie=g(ie,q,he,ce,W,22,p[7]),ce=g(ce,ie,q,he,K,7,p[8]),he=g(he,ce,ie,q,re,12,p[9]),q=g(q,he,ce,ie,le,17,p[10]),ie=g(ie,q,he,ce,Y,22,p[11]),ce=g(ce,ie,q,he,ae,7,p[12]),he=g(he,ce,ie,q,te,12,p[13]),q=g(q,he,ce,ie,be,17,p[14]),ie=g(ie,q,he,ce,j,22,p[15]),ce=x(ce,ie,q,he,L,5,p[16]),he=x(he,ce,ie,q,V,9,p[17]),q=x(q,he,ce,ie,Y,14,p[18]),ie=x(ie,q,he,ce,$,20,p[19]),ce=x(ce,ie,q,he,N,5,p[20]),he=x(he,ce,ie,q,le,9,p[21]),q=x(q,he,ce,ie,j,14,p[22]),ie=x(ie,q,he,ce,G,20,p[23]),ce=x(ce,ie,q,he,re,5,p[24]),he=x(he,ce,ie,q,be,9,p[25]),q=x(q,he,ce,ie,P,14,p[26]),ie=x(ie,q,he,ce,K,20,p[27]),ce=x(ce,ie,q,he,te,5,p[28]),he=x(he,ce,ie,q,U,9,p[29]),q=x(q,he,ce,ie,W,14,p[30]),ie=x(ie,q,he,ce,ae,20,p[31]),ce=S(ce,ie,q,he,N,4,p[32]),he=S(he,ce,ie,q,K,11,p[33]),q=S(q,he,ce,ie,Y,16,p[34]),ie=S(ie,q,he,ce,be,23,p[35]),ce=S(ce,ie,q,he,L,4,p[36]),he=S(he,ce,ie,q,G,11,p[37]),q=S(q,he,ce,ie,W,16,p[38]),ie=S(ie,q,he,ce,le,23,p[39]),ce=S(ce,ie,q,he,te,4,p[40]),he=S(he,ce,ie,q,$,11,p[41]),q=S(q,he,ce,ie,P,16,p[42]),ie=S(ie,q,he,ce,V,23,p[43]),ce=S(ce,ie,q,he,re,4,p[44]),he=S(he,ce,ie,q,ae,11,p[45]),q=S(q,he,ce,ie,j,16,p[46]),ie=S(ie,q,he,ce,U,23,p[47]),ce=w(ce,ie,q,he,$,6,p[48]),he=w(he,ce,ie,q,W,10,p[49]),q=w(q,he,ce,ie,be,15,p[50]),ie=w(ie,q,he,ce,N,21,p[51]),ce=w(ce,ie,q,he,ae,6,p[52]),he=w(he,ce,ie,q,P,10,p[53]),q=w(q,he,ce,ie,le,15,p[54]),ie=w(ie,q,he,ce,L,21,p[55]),ce=w(ce,ie,q,he,K,6,p[56]),he=w(he,ce,ie,q,j,10,p[57]),q=w(q,he,ce,ie,V,15,p[58]),ie=w(ie,q,he,ce,te,21,p[59]),ce=w(ce,ie,q,he,G,6,p[60]),he=w(he,ce,ie,q,Y,10,p[61]),q=w(q,he,ce,ie,U,15,p[62]),ie=w(ie,q,he,ce,re,21,p[63]),M[0]=M[0]+ce|0,M[1]=M[1]+ie|0,M[2]=M[2]+q|0,M[3]=M[3]+he|0},_doFinalize:function(){var A=this._data,E=A.words,k=this._nDataBytes*8,D=A.sigBytes*8;E[D>>>5]|=128<<24-D%32;var R=r.floor(k/4294967296),M=k;E[(D+64>>>9<<4)+15]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,E[(D+64>>>9<<4)+14]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,A.sigBytes=(E.length+1)*4,this._process();for(var $=this._hash,L=$.words,U=0;U<4;U++){var P=L[U];L[U]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}return $},clone:function(){var A=c.clone.call(this);return A._hash=this._hash.clone(),A}});function g(A,E,k,D,R,M,$){var L=A+(E&k|~E&D)+R+$;return(L<<M|L>>>32-M)+E}function x(A,E,k,D,R,M,$){var L=A+(E&D|k&~D)+R+$;return(L<<M|L>>>32-M)+E}function S(A,E,k,D,R,M,$){var L=A+(E^k^D)+R+$;return(L<<M|L>>>32-M)+E}function w(A,E,k,D,R,M,$){var L=A+(k^(E|~D))+R+$;return(L<<M|L>>>32-M)+E}i.MD5=c._createHelper(m),i.HmacMD5=c._createHmacHelper(m)}(Math),n.MD5})}(q2)),q2.exports}var V2={exports:{}},bbe=V2.exports,SG;function wG(){return SG||(SG=1,function(e,t){(function(n,r){e.exports=r($n())})(bbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=i.Hasher,c=r.algo,h=[],p=c.SHA1=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(m,g){for(var x=this._hash.words,S=x[0],w=x[1],A=x[2],E=x[3],k=x[4],D=0;D<80;D++){if(D<16)h[D]=m[g+D]|0;else{var R=h[D-3]^h[D-8]^h[D-14]^h[D-16];h[D]=R<<1|R>>>31}var M=(S<<5|S>>>27)+k+h[D];D<20?M+=(w&A|~w&E)+1518500249:D<40?M+=(w^A^E)+1859775393:D<60?M+=(w&A|w&E|A&E)-1894007588:M+=(w^A^E)-899497514,k=E,E=A,A=w<<30|w>>>2,w=S,S=M}x[0]=x[0]+S|0,x[1]=x[1]+w|0,x[2]=x[2]+A|0,x[3]=x[3]+E|0,x[4]=x[4]+k|0},_doFinalize:function(){var m=this._data,g=m.words,x=this._nDataBytes*8,S=m.sigBytes*8;return g[S>>>5]|=128<<24-S%32,g[(S+64>>>9<<4)+14]=Math.floor(x/4294967296),g[(S+64>>>9<<4)+15]=x,m.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});r.SHA1=l._createHelper(p),r.HmacSHA1=l._createHmacHelper(p)}(),n.SHA1})}(V2)),V2.exports}var G2={exports:{}},_be=G2.exports,CG;function I6(){return CG||(CG=1,function(e,t){(function(n,r){e.exports=r($n())})(_be,function(n){return function(r){var i=n,o=i.lib,l=o.WordArray,c=o.Hasher,h=i.algo,p=[],m=[];(function(){function S(k){for(var D=r.sqrt(k),R=2;R<=D;R++)if(!(k%R))return!1;return!0}function w(k){return(k-(k|0))*4294967296|0}for(var A=2,E=0;E<64;)S(A)&&(E<8&&(p[E]=w(r.pow(A,1/2))),m[E]=w(r.pow(A,1/3)),E++),A++})();var g=[],x=h.SHA256=c.extend({_doReset:function(){this._hash=new l.init(p.slice(0))},_doProcessBlock:function(S,w){for(var A=this._hash.words,E=A[0],k=A[1],D=A[2],R=A[3],M=A[4],$=A[5],L=A[6],U=A[7],P=0;P<64;P++){if(P<16)g[P]=S[w+P]|0;else{var G=g[P-15],N=(G<<25|G>>>7)^(G<<14|G>>>18)^G>>>3,V=g[P-2],W=(V<<15|V>>>17)^(V<<13|V>>>19)^V>>>10;g[P]=N+g[P-7]+W+g[P-16]}var K=M&$^~M&L,re=E&k^E&D^k&D,le=(E<<30|E>>>2)^(E<<19|E>>>13)^(E<<10|E>>>22),Y=(M<<26|M>>>6)^(M<<21|M>>>11)^(M<<7|M>>>25),ae=U+Y+K+m[P]+g[P],te=le+re;U=L,L=$,$=M,M=R+ae|0,R=D,D=k,k=E,E=ae+te|0}A[0]=A[0]+E|0,A[1]=A[1]+k|0,A[2]=A[2]+D|0,A[3]=A[3]+R|0,A[4]=A[4]+M|0,A[5]=A[5]+$|0,A[6]=A[6]+L|0,A[7]=A[7]+U|0},_doFinalize:function(){var S=this._data,w=S.words,A=this._nDataBytes*8,E=S.sigBytes*8;return w[E>>>5]|=128<<24-E%32,w[(E+64>>>9<<4)+14]=r.floor(A/4294967296),w[(E+64>>>9<<4)+15]=A,S.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var S=c.clone.call(this);return S._hash=this._hash.clone(),S}});i.SHA256=c._createHelper(x),i.HmacSHA256=c._createHmacHelper(x)}(Math),n.SHA256})}(G2)),G2.exports}var Y2={exports:{}},Sbe=Y2.exports,EG;function wbe(){return EG||(EG=1,function(e,t){(function(n,r,i){e.exports=r($n(),I6())})(Sbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.algo,c=l.SHA256,h=l.SHA224=c.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var p=c._doFinalize.call(this);return p.sigBytes-=4,p}});r.SHA224=c._createHelper(h),r.HmacSHA224=c._createHmacHelper(h)}(),n.SHA224})}(Y2)),Y2.exports}var Z2={exports:{}},Cbe=Z2.exports,AG;function TG(){return AG||(AG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2())})(Cbe,function(n){return function(){var r=n,i=r.lib,o=i.Hasher,l=r.x64,c=l.Word,h=l.WordArray,p=r.algo;function m(){return c.create.apply(c,arguments)}var g=[m(1116352408,3609767458),m(1899447441,602891725),m(3049323471,3964484399),m(3921009573,2173295548),m(961987163,4081628472),m(1508970993,3053834265),m(2453635748,2937671579),m(2870763221,3664609560),m(3624381080,2734883394),m(310598401,1164996542),m(607225278,1323610764),m(1426881987,3590304994),m(1925078388,4068182383),m(2162078206,991336113),m(2614888103,633803317),m(3248222580,3479774868),m(3835390401,2666613458),m(4022224774,944711139),m(264347078,2341262773),m(604807628,2007800933),m(770255983,1495990901),m(1249150122,1856431235),m(1555081692,3175218132),m(1996064986,2198950837),m(2554220882,3999719339),m(2821834349,766784016),m(2952996808,2566594879),m(3210313671,3203337956),m(3336571891,1034457026),m(3584528711,2466948901),m(113926993,3758326383),m(338241895,168717936),m(666307205,1188179964),m(773529912,1546045734),m(1294757372,1522805485),m(1396182291,2643833823),m(1695183700,2343527390),m(1986661051,1014477480),m(2177026350,1206759142),m(2456956037,344077627),m(2730485921,1290863460),m(2820302411,3158454273),m(3259730800,3505952657),m(3345764771,106217008),m(3516065817,3606008344),m(3600352804,1432725776),m(4094571909,1467031594),m(275423344,851169720),m(430227734,3100823752),m(506948616,1363258195),m(659060556,3750685593),m(883997877,3785050280),m(958139571,3318307427),m(1322822218,3812723403),m(1537002063,2003034995),m(1747873779,3602036899),m(1955562222,1575990012),m(2024104815,1125592928),m(2227730452,2716904306),m(2361852424,442776044),m(2428436474,593698344),m(2756734187,3733110249),m(3204031479,2999351573),m(3329325298,3815920427),m(3391569614,3928383900),m(3515267271,566280711),m(3940187606,3454069534),m(4118630271,4000239992),m(116418474,1914138554),m(174292421,2731055270),m(289380356,3203993006),m(460393269,320620315),m(685471733,587496836),m(852142971,1086792851),m(1017036298,365543100),m(1126000580,2618297676),m(1288033470,3409855158),m(1501505948,4234509866),m(1607167915,987167468),m(1816402316,1246189591)],x=[];(function(){for(var w=0;w<80;w++)x[w]=m()})();var S=p.SHA512=o.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(w,A){for(var E=this._hash.words,k=E[0],D=E[1],R=E[2],M=E[3],$=E[4],L=E[5],U=E[6],P=E[7],G=k.high,N=k.low,V=D.high,W=D.low,K=R.high,re=R.low,le=M.high,Y=M.low,ae=$.high,te=$.low,be=L.high,j=L.low,ce=U.high,ie=U.low,q=P.high,he=P.low,We=G,Me=N,lt=V,Ke=W,bt=K,kt=re,Lt=le,nt=Y,ut=ae,_t=te,ht=be,Tt=j,X=ce,ne=ie,ge=q,Oe=he,Be=0;Be<80;Be++){var Ie,it,ct=x[Be];if(Be<16)it=ct.high=w[A+Be*2]|0,Ie=ct.low=w[A+Be*2+1]|0;else{var St=x[Be-15],ye=St.high,Re=St.low,at=(ye>>>1|Re<<31)^(ye>>>8|Re<<24)^ye>>>7,ft=(Re>>>1|ye<<31)^(Re>>>8|ye<<24)^(Re>>>7|ye<<25),$t=x[Be-2],Jt=$t.high,Gt=$t.low,Qt=(Jt>>>19|Gt<<13)^(Jt<<3|Gt>>>29)^Jt>>>6,Ln=(Gt>>>19|Jt<<13)^(Gt<<3|Jt>>>29)^(Gt>>>6|Jt<<26),xt=x[Be-7],Vt=xt.high,mt=xt.low,Rt=x[Be-16],ar=Rt.high,Yr=Rt.low;Ie=ft+mt,it=at+Vt+(Ie>>>0<ft>>>0?1:0),Ie=Ie+Ln,it=it+Qt+(Ie>>>0<Ln>>>0?1:0),Ie=Ie+Yr,it=it+ar+(Ie>>>0<Yr>>>0?1:0),ct.high=it,ct.low=Ie}var or=ut&ht^~ut&X,vr=_t&Tt^~_t&ne,wi=We&lt^We&bt^lt&bt,oi=Me&Ke^Me&kt^Ke&kt,Ci=(We>>>28|Me<<4)^(We<<30|Me>>>2)^(We<<25|Me>>>7),Yn=(Me>>>28|We<<4)^(Me<<30|We>>>2)^(Me<<25|We>>>7),Zi=(ut>>>14|_t<<18)^(ut>>>18|_t<<14)^(ut<<23|_t>>>9),vo=(_t>>>14|ut<<18)^(_t>>>18|ut<<14)^(_t<<23|ut>>>9),hs=g[Be],Nn=hs.high,hr=hs.low,cn=Oe+vo,kr=ge+Zi+(cn>>>0<Oe>>>0?1:0),cn=cn+vr,kr=kr+or+(cn>>>0<vr>>>0?1:0),cn=cn+hr,kr=kr+Nn+(cn>>>0<hr>>>0?1:0),cn=cn+Ie,kr=kr+it+(cn>>>0<Ie>>>0?1:0),si=Yn+oi,Ks=Ci+wi+(si>>>0<Yn>>>0?1:0);ge=X,Oe=ne,X=ht,ne=Tt,ht=ut,Tt=_t,_t=nt+cn|0,ut=Lt+kr+(_t>>>0<nt>>>0?1:0)|0,Lt=bt,nt=kt,bt=lt,kt=Ke,lt=We,Ke=Me,Me=cn+si|0,We=kr+Ks+(Me>>>0<cn>>>0?1:0)|0}N=k.low=N+Me,k.high=G+We+(N>>>0<Me>>>0?1:0),W=D.low=W+Ke,D.high=V+lt+(W>>>0<Ke>>>0?1:0),re=R.low=re+kt,R.high=K+bt+(re>>>0<kt>>>0?1:0),Y=M.low=Y+nt,M.high=le+Lt+(Y>>>0<nt>>>0?1:0),te=$.low=te+_t,$.high=ae+ut+(te>>>0<_t>>>0?1:0),j=L.low=j+Tt,L.high=be+ht+(j>>>0<Tt>>>0?1:0),ie=U.low=ie+ne,U.high=ce+X+(ie>>>0<ne>>>0?1:0),he=P.low=he+Oe,P.high=q+ge+(he>>>0<Oe>>>0?1:0)},_doFinalize:function(){var w=this._data,A=w.words,E=this._nDataBytes*8,k=w.sigBytes*8;A[k>>>5]|=128<<24-k%32,A[(k+128>>>10<<5)+30]=Math.floor(E/4294967296),A[(k+128>>>10<<5)+31]=E,w.sigBytes=A.length*4,this._process();var D=this._hash.toX32();return D},clone:function(){var w=o.clone.call(this);return w._hash=this._hash.clone(),w},blockSize:1024/32});r.SHA512=o._createHelper(S),r.HmacSHA512=o._createHmacHelper(S)}(),n.SHA512})}(Z2)),Z2.exports}var K2={exports:{}},Ebe=K2.exports,kG;function Abe(){return kG||(kG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2(),TG())})(Ebe,function(n){return function(){var r=n,i=r.x64,o=i.Word,l=i.WordArray,c=r.algo,h=c.SHA512,p=c.SHA384=h.extend({_doReset:function(){this._hash=new l.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var m=h._doFinalize.call(this);return m.sigBytes-=16,m}});r.SHA384=h._createHelper(p),r.HmacSHA384=h._createHmacHelper(p)}(),n.SHA384})}(K2)),K2.exports}var Q2={exports:{}},Tbe=Q2.exports,DG;function kbe(){return DG||(DG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2())})(Tbe,function(n){return function(r){var i=n,o=i.lib,l=o.WordArray,c=o.Hasher,h=i.x64,p=h.Word,m=i.algo,g=[],x=[],S=[];(function(){for(var E=1,k=0,D=0;D<24;D++){g[E+5*k]=(D+1)*(D+2)/2%64;var R=k%5,M=(2*E+3*k)%5;E=R,k=M}for(var E=0;E<5;E++)for(var k=0;k<5;k++)x[E+5*k]=k+(2*E+3*k)%5*5;for(var $=1,L=0;L<24;L++){for(var U=0,P=0,G=0;G<7;G++){if($&1){var N=(1<<G)-1;N<32?P^=1<<N:U^=1<<N-32}$&128?$=$<<1^113:$<<=1}S[L]=p.create(U,P)}})();var w=[];(function(){for(var E=0;E<25;E++)w[E]=p.create()})();var A=m.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var E=this._state=[],k=0;k<25;k++)E[k]=new p.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(E,k){for(var D=this._state,R=this.blockSize/2,M=0;M<R;M++){var $=E[k+2*M],L=E[k+2*M+1];$=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360;var U=D[M];U.high^=L,U.low^=$}for(var P=0;P<24;P++){for(var G=0;G<5;G++){for(var N=0,V=0,W=0;W<5;W++){var U=D[G+5*W];N^=U.high,V^=U.low}var K=w[G];K.high=N,K.low=V}for(var G=0;G<5;G++)for(var re=w[(G+4)%5],le=w[(G+1)%5],Y=le.high,ae=le.low,N=re.high^(Y<<1|ae>>>31),V=re.low^(ae<<1|Y>>>31),W=0;W<5;W++){var U=D[G+5*W];U.high^=N,U.low^=V}for(var te=1;te<25;te++){var N,V,U=D[te],be=U.high,j=U.low,ce=g[te];ce<32?(N=be<<ce|j>>>32-ce,V=j<<ce|be>>>32-ce):(N=j<<ce-32|be>>>64-ce,V=be<<ce-32|j>>>64-ce);var ie=w[x[te]];ie.high=N,ie.low=V}var q=w[0],he=D[0];q.high=he.high,q.low=he.low;for(var G=0;G<5;G++)for(var W=0;W<5;W++){var te=G+5*W,U=D[te],We=w[te],Me=w[(G+1)%5+5*W],lt=w[(G+2)%5+5*W];U.high=We.high^~Me.high&lt.high,U.low=We.low^~Me.low&lt.low}var U=D[0],Ke=S[P];U.high^=Ke.high,U.low^=Ke.low}},_doFinalize:function(){var E=this._data,k=E.words;this._nDataBytes*8;var D=E.sigBytes*8,R=this.blockSize*32;k[D>>>5]|=1<<24-D%32,k[(r.ceil((D+1)/R)*R>>>5)-1]|=128,E.sigBytes=k.length*4,this._process();for(var M=this._state,$=this.cfg.outputLength/8,L=$/8,U=[],P=0;P<L;P++){var G=M[P],N=G.high,V=G.low;N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,V=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360,U.push(V),U.push(N)}return new l.init(U,$)},clone:function(){for(var E=c.clone.call(this),k=E._state=this._state.slice(0),D=0;D<25;D++)k[D]=k[D].clone();return E}});i.SHA3=c._createHelper(A),i.HmacSHA3=c._createHmacHelper(A)}(Math),n.SHA3})}(Q2)),Q2.exports}var W2={exports:{}},Dbe=W2.exports,OG;function Obe(){return OG||(OG=1,function(e,t){(function(n,r){e.exports=r($n())})(Dbe,function(n){/** @preserve
3796
+ root.render(<App />);`),s.unstable_strictMode===!0&&(f=!0),s.identifierPrefix!==void 0&&(y=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(C=s.onCaughtError),s.onRecoverableError!==void 0&&(B=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(z=s.unstable_transitionCallbacks)),s=Z_(a,1,!1,null,null,f,y,_,C,B,z,null),a[Ac]=s.current,O_(a),new py(s)},pb.hydrateRoot=function(a,s,f){if(!E(a))throw Error("Target container is not a DOM element.");fk(a),s===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var y=!1,_="",C=Xb,B=UT,z=_v,Q=null,J=null;return f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(_=f.identifierPrefix),f.onUncaughtError!==void 0&&(C=f.onUncaughtError),f.onCaughtError!==void 0&&(B=f.onCaughtError),f.onRecoverableError!==void 0&&(z=f.onRecoverableError),f.unstable_transitionCallbacks!==void 0&&(Q=f.unstable_transitionCallbacks),f.formState!==void 0&&(J=f.formState)),s=Z_(a,1,!0,s,f??null,y,_,C,B,z,Q,J),s.context=K_(null),f=s.current,y=to(f),y=Re(y),_=tl(y),_.callback=null,ws(f,_,y),f=y,s.current.lanes=f,it(s,f),Jo(s),a[Ac]=s.current,O_(a),new L0(s)},pb.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),pb}var dG;function nbe(){if(dG)return B2.exports;dG=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}return process.env.NODE_ENV==="production"?(e(),B2.exports=ebe()):B2.exports=tbe(),B2.exports}var rbe=nbe();const hG="debales-ai-assistant",pG="debales-chatbot-container",ibe=ee.forwardRef(({children:e,globalStyles:t="",containerStyles:n={},onReady:r},i)=>{const o=ee.useRef(null),[l,c]=ee.useState(null),h=ee.useRef(null),p=ee.useRef(null),m=ee.useRef({get shadowRoot(){return h.current},get container(){return l},querySelector:g=>{var x;return((x=h.current)==null?void 0:x.querySelector(g))||null},querySelectorAll:g=>{var x;return((x=h.current)==null?void 0:x.querySelectorAll(g))||null}});return ee.useImperativeHandle(i,()=>m.current,[]),ee.useEffect(()=>{const g=document.getElementById(hG);if(g?o.current=g:o.current&&(o.current.id=hG),o.current&&(o.current.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;"),o.current){if(o.current.shadowRoot){h.current=o.current.shadowRoot;const w=h.current.querySelector(`#${pG}`);w&&c(w);return}const x=o.current.attachShadow({mode:"open"});if(h.current=x,t){const w=document.createElement("style");w.textContent=t,x.appendChild(w)}const S=document.createElement("div");S.id=pG,S.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;",x.appendChild(S),c(S),r&&r(x,S)}},[t,r]),ee.useEffect(()=>(l&&!p.current&&(p.current=rbe.createRoot(l)),p.current&&l&&window.self===window.top&&p.current.render(I.jsx(oe.StyleSheetManager,{target:l,children:I.jsx(mP,{value:m.current,children:e})})),()=>{p.current&&p.current.unmount()}),[l,e]),I.jsx("div",{ref:o,style:n})});typeof window<"u"&&fi.init(Qse,{api_host:fs+"/ingest",ui_host:"https://us.posthog.com",defaults:"2025-11-30",debug:!0});class $2{isSupported(){return zd.detect()===this.platform}createSuccessResult(t,n){return{success:!0,data:t,message:n}}createErrorResult(t){return{success:!1,error:t}}}class abe extends $2{constructor(){super(...arguments);Br(this,"platform",di.DEFAULT)}async fetchCart(){return console.log("DefaultCartAdapter: fetchCart called"),this.createSuccessResult({items:[],total:0,itemCount:0,currency:"USD",token:"default-token"},"Default cart fetched")}async addToCart(n,r=1,i){return console.log("DefaultCartAdapter: addToCart called",{variantId:n,quantity:r,properties:i}),this.createSuccessResult({items:[],total:0,itemCount:0,currency:"USD",token:"default-token"},"Item added to cart (mock)")}async removeFromCart(n){return console.log("DefaultCartAdapter: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("DefaultCartAdapter: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("DefaultCartAdapter: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=n.replace(/^https?:\/\//,"");return console.log("DefaultCartAdapter: generateCartUrl called",{domain:n,sanitizedDomain:r}),`https://${r}/cart`}generateProductUrl(n,r){if(r.handle){const i=new URL(`https://${n}/products/${r.handle}`);return i.searchParams.append("variant",r.product_id),Yl(i.toString())}else return Yl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}class obe extends $2{constructor(){var n,r;super();Br(this,"platform",di.SHOPIFY);Br(this,"cartEndpoint");Br(this,"localCartKey","debales_track_cart");this.cartEndpoint=((r=(n=window.Shopify)==null?void 0:n.routes)==null?void 0:r.root)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:r.id,variant_id:r.variant_id,quantity:r.quantity,title:r.title,price:r.price,properties:r.properties})),total:n.total_price/100,itemCount:n.item_count,currency:n.currency,token:n.token.split("?")[0]}}generateProductUrl(n,r){const i=MR(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/products/${r.handle}`,i.url);return o.searchParams.append("variant",r.product_id),Yl(o.toString())}else return Yl(r.link)}updateTrackCart({cartToken:n,sessionId:r=Er()}){localStorage.setItem(this.localCartKey,JSON.stringify({sessionId:r,cartToken:n}))}async fetchCart(){try{const n=await fetch(`${this.cartEndpoint}cart.js`),r=await n.json();if(!n.ok){const o=r;return this.createErrorResult(o.description||`Failed to fetch cart: ${n.status}`)}const i=r;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1,i){try{const o=await fetch(`${this.cartEndpoint}cart/add.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:n,quantity:r,properties:i}],attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:Er(),dbls_method:"add_to_cart"}})}),l=await o.json();if(!o.ok){const c=l;return this.createErrorResult(c.description||`Failed to add item to cart: ${o.status}`)}return this.createSuccessResult({},`Successfully added ${r} item(s) to cart`)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return this.updateQuantity({id:n,quantity:0})}async updateQuantity(n){try{const r=await fetch(`${this.cartEndpoint}cart/change.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n.id,quantity:n.quantity})}),i=await r.json();if(!r.ok){const o=i;return this.createErrorResult(o.description||`Failed to update item quantity: ${r.status}`)}return this.fetchCart().then(o=>{o.success&&this.updateTrackCart({cartToken:o==null?void 0:o.data.token})}),this.createSuccessResult(void 0,n.quantity===0?"Item removed from cart":`Quantity updated to ${n.quantity}`)}catch(r){return this.createErrorResult(r instanceof Error?`Error updating quantity: ${r.message}`:"Unknown error occurred while updating quantity")}}async clearCart(){try{const n=await fetch(`${this.cartEndpoint}cart/clear.js`,{method:"POST"});if(!n.ok){const r=await n.json();return this.createErrorResult(r.description||`Failed to clear cart: ${n.status}`)}return this.createSuccessResult(void 0,"Cart cleared successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error clearing cart: ${n.message}`:"Unknown error occurred while clearing cart")}}async addCartAttributes(n={}){try{const r=await fetch(`${this.cartEndpoint}cart/update.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:Er(),...n}})});if(!r.ok){const i=await r.json();return this.createErrorResult(i.description||`Failed to update cart attributes: ${r.status}`)}return this.createSuccessResult(void 0,"Cart attributes updated successfully")}catch(r){return this.createErrorResult(r instanceof Error?`Error updating cart attributes: ${r.message}`:"Unknown error occurred while updating cart attributes")}}generateCartUrl(n){const r=MR(n);if(!r.isValid)return"";const i=new URL("/cart",r.url);return i.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),i.searchParams.append("attributes[from]","debales-ai-chatbot"),i.searchParams.append("attributes[through]","add-to-cart"),i.searchParams.append("attributes[dbls_session_id]",Er()),i.searchParams.append("timestamp",Date.now().toString()),Yl(i.toString())}}class sbe extends $2{constructor(){var n,r;super();Br(this,"platform",di.MAGENTO);Br(this,"checkoutEndpoint");Br(this,"baseUrl");this.checkoutEndpoint=((n=window.checkout)==null?void 0:n.checkoutUrl)||"/",this.baseUrl=((r=window.checkout)==null?void 0:r.baseUrl)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:parseInt(r.item_id),variant_id:parseInt(r.product_id),quantity:r.qty,title:r.product_name,price:r.product_price_value,properties:{name:r.product_name}})),total:parseFloat(n.subtotalAmount),itemCount:n.summary_count,currency:"USD",token:n.data_id.toString()}}async fetchCart(){try{const n=await fetch(`${this.baseUrl}customer/section/load/?sections=cart&update_section_id=false`),r=await n.json();if(!n.ok)return this.createErrorResult(`Failed to fetch cart: ${n.status}`);const i=r.cart;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1){var i;try{const o=(i=document.querySelector('input[name="form_key"]'))==null?void 0:i.value;if(!o)return this.createErrorResult("Form key not found");const l=await fetch(`${this.checkoutEndpoint}cart/add`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({product:n,qty:r.toString(),form_key:o})});if(!l.ok)return this.createErrorResult(`Failed to add item to cart: ${l.status}`);try{window.require(["Magento_Customer/js/customer-data"],c=>c.reload(["cart"],!0))}catch(c){console.warn("Failed to reload cart data:",c)}return this.createSuccessResult({},`Successfully added ${r} item(s) to cart`)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return console.log("MethodNotImplemented: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("MethodNotImplemented: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("MethodNotImplemented: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=new URL(`https://${n}/checkout/cart?ref=debales-ai-${new Date().toISOString()}&attributes[from]=debales-ai-chatbot&attributes[through]=add-to-cart`);return r.searchParams.append("timestamp",Date.now().toString()),r.toString()}generateProductUrl(n,r){const i=MR(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/${r.handle}.html`,i.url);return Yl(o.toString())}else return Yl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}var L2={exports:{}};function lbe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var N2={exports:{}};const ube=aK(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var cbe=N2.exports,mG;function $n(){return mG||(mG=1,function(e,t){(function(n,r){e.exports=r()})(cbe,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof o4<"u"&&o4.crypto&&(o=o4.crypto),!o&&typeof lbe=="function")try{o=ube}catch{}var l=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function D(){}return function(R){var M;return D.prototype=R,M=new D,D.prototype=null,M}}(),h={},p=h.lib={},m=p.Base=function(){return{extend:function(D){var R=c(this);return D&&R.mixIn(D),(!R.hasOwnProperty("init")||this.init===R.init)&&(R.init=function(){R.$super.init.apply(this,arguments)}),R.init.prototype=R,R.$super=this,R},create:function(){var D=this.extend();return D.init.apply(D,arguments),D},init:function(){},mixIn:function(D){for(var R in D)D.hasOwnProperty(R)&&(this[R]=D[R]);D.hasOwnProperty("toString")&&(this.toString=D.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=p.WordArray=m.extend({init:function(D,R){D=this.words=D||[],R!=i?this.sigBytes=R:this.sigBytes=D.length*4},toString:function(D){return(D||S).stringify(this)},concat:function(D){var R=this.words,M=D.words,$=this.sigBytes,L=D.sigBytes;if(this.clamp(),$%4)for(var U=0;U<L;U++){var P=M[U>>>2]>>>24-U%4*8&255;R[$+U>>>2]|=P<<24-($+U)%4*8}else for(var G=0;G<L;G+=4)R[$+G>>>2]=M[G>>>2];return this.sigBytes+=L,this},clamp:function(){var D=this.words,R=this.sigBytes;D[R>>>2]&=4294967295<<32-R%4*8,D.length=r.ceil(R/4)},clone:function(){var D=m.clone.call(this);return D.words=this.words.slice(0),D},random:function(D){for(var R=[],M=0;M<D;M+=4)R.push(l());return new g.init(R,D)}}),x=h.enc={},S=x.Hex={stringify:function(D){for(var R=D.words,M=D.sigBytes,$=[],L=0;L<M;L++){var U=R[L>>>2]>>>24-L%4*8&255;$.push((U>>>4).toString(16)),$.push((U&15).toString(16))}return $.join("")},parse:function(D){for(var R=D.length,M=[],$=0;$<R;$+=2)M[$>>>3]|=parseInt(D.substr($,2),16)<<24-$%8*4;return new g.init(M,R/2)}},w=x.Latin1={stringify:function(D){for(var R=D.words,M=D.sigBytes,$=[],L=0;L<M;L++){var U=R[L>>>2]>>>24-L%4*8&255;$.push(String.fromCharCode(U))}return $.join("")},parse:function(D){for(var R=D.length,M=[],$=0;$<R;$++)M[$>>>2]|=(D.charCodeAt($)&255)<<24-$%4*8;return new g.init(M,R)}},A=x.Utf8={stringify:function(D){try{return decodeURIComponent(escape(w.stringify(D)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(D){return w.parse(unescape(encodeURIComponent(D)))}},E=p.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(D){typeof D=="string"&&(D=A.parse(D)),this._data.concat(D),this._nDataBytes+=D.sigBytes},_process:function(D){var R,M=this._data,$=M.words,L=M.sigBytes,U=this.blockSize,P=U*4,G=L/P;D?G=r.ceil(G):G=r.max((G|0)-this._minBufferSize,0);var N=G*U,V=r.min(N*4,L);if(N){for(var W=0;W<N;W+=U)this._doProcessBlock($,W);R=$.splice(0,N),M.sigBytes-=V}return new g.init(R,V)},clone:function(){var D=m.clone.call(this);return D._data=this._data.clone(),D},_minBufferSize:0});p.Hasher=E.extend({cfg:m.extend(),init:function(D){this.cfg=this.cfg.extend(D),this.reset()},reset:function(){E.reset.call(this),this._doReset()},update:function(D){return this._append(D),this._process(),this},finalize:function(D){D&&this._append(D);var R=this._doFinalize();return R},blockSize:16,_createHelper:function(D){return function(R,M){return new D.init(M).finalize(R)}},_createHmacHelper:function(D){return function(R,M){return new k.HMAC.init(D,M).finalize(R)}}});var k=h.algo={};return h}(Math);return n})}(N2)),N2.exports}var z2={exports:{}},fbe=z2.exports,gG;function F2(){return gG||(gG=1,function(e,t){(function(n,r){e.exports=r($n())})(fbe,function(n){return function(r){var i=n,o=i.lib,l=o.Base,c=o.WordArray,h=i.x64={};h.Word=l.extend({init:function(p,m){this.high=p,this.low=m}}),h.WordArray=l.extend({init:function(p,m){p=this.words=p||[],m!=r?this.sigBytes=m:this.sigBytes=p.length*8},toX32:function(){for(var p=this.words,m=p.length,g=[],x=0;x<m;x++){var S=p[x];g.push(S.high),g.push(S.low)}return c.create(g,this.sigBytes)},clone:function(){for(var p=l.clone.call(this),m=p.words=this.words.slice(0),g=m.length,x=0;x<g;x++)m[x]=m[x].clone();return p}})}(),n})}(z2)),z2.exports}var U2={exports:{}},dbe=U2.exports,vG;function hbe(){return vG||(vG=1,function(e,t){(function(n,r){e.exports=r($n())})(dbe,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,o=i.WordArray,l=o.init,c=o.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var p=h.byteLength,m=[],g=0;g<p;g++)m[g>>>2]|=h[g]<<24-g%4*8;l.call(this,m,p)}else l.apply(this,arguments)};c.prototype=o}}(),n.lib.WordArray})}(U2)),U2.exports}var P2={exports:{}},pbe=P2.exports,yG;function mbe(){return yG||(yG=1,function(e,t){(function(n,r){e.exports=r($n())})(pbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.enc;l.Utf16=l.Utf16BE={stringify:function(h){for(var p=h.words,m=h.sigBytes,g=[],x=0;x<m;x+=2){var S=p[x>>>2]>>>16-x%4*8&65535;g.push(String.fromCharCode(S))}return g.join("")},parse:function(h){for(var p=h.length,m=[],g=0;g<p;g++)m[g>>>1]|=h.charCodeAt(g)<<16-g%2*16;return o.create(m,p*2)}},l.Utf16LE={stringify:function(h){for(var p=h.words,m=h.sigBytes,g=[],x=0;x<m;x+=2){var S=c(p[x>>>2]>>>16-x%4*8&65535);g.push(String.fromCharCode(S))}return g.join("")},parse:function(h){for(var p=h.length,m=[],g=0;g<p;g++)m[g>>>1]|=c(h.charCodeAt(g)<<16-g%2*16);return o.create(m,p*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),n.enc.Utf16})}(P2)),P2.exports}var H2={exports:{}},gbe=H2.exports,xG;function Mp(){return xG||(xG=1,function(e,t){(function(n,r){e.exports=r($n())})(gbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.enc;l.Base64={stringify:function(h){var p=h.words,m=h.sigBytes,g=this._map;h.clamp();for(var x=[],S=0;S<m;S+=3)for(var w=p[S>>>2]>>>24-S%4*8&255,A=p[S+1>>>2]>>>24-(S+1)%4*8&255,E=p[S+2>>>2]>>>24-(S+2)%4*8&255,k=w<<16|A<<8|E,D=0;D<4&&S+D*.75<m;D++)x.push(g.charAt(k>>>6*(3-D)&63));var R=g.charAt(64);if(R)for(;x.length%4;)x.push(R);return x.join("")},parse:function(h){var p=h.length,m=this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var x=0;x<m.length;x++)g[m.charCodeAt(x)]=x}var S=m.charAt(64);if(S){var w=h.indexOf(S);w!==-1&&(p=w)}return c(h,p,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,p,m){for(var g=[],x=0,S=0;S<p;S++)if(S%4){var w=m[h.charCodeAt(S-1)]<<S%4*2,A=m[h.charCodeAt(S)]>>>6-S%4*2,E=w|A;g[x>>>2]|=E<<24-x%4*8,x++}return o.create(g,x)}}(),n.enc.Base64})}(H2)),H2.exports}var j2={exports:{}},vbe=j2.exports,bG;function ybe(){return bG||(bG=1,function(e,t){(function(n,r){e.exports=r($n())})(vbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.enc;l.Base64url={stringify:function(h,p){p===void 0&&(p=!0);var m=h.words,g=h.sigBytes,x=p?this._safe_map:this._map;h.clamp();for(var S=[],w=0;w<g;w+=3)for(var A=m[w>>>2]>>>24-w%4*8&255,E=m[w+1>>>2]>>>24-(w+1)%4*8&255,k=m[w+2>>>2]>>>24-(w+2)%4*8&255,D=A<<16|E<<8|k,R=0;R<4&&w+R*.75<g;R++)S.push(x.charAt(D>>>6*(3-R)&63));var M=x.charAt(64);if(M)for(;S.length%4;)S.push(M);return S.join("")},parse:function(h,p){p===void 0&&(p=!0);var m=h.length,g=p?this._safe_map:this._map,x=this._reverseMap;if(!x){x=this._reverseMap=[];for(var S=0;S<g.length;S++)x[g.charCodeAt(S)]=S}var w=g.charAt(64);if(w){var A=h.indexOf(w);A!==-1&&(m=A)}return c(h,m,x)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,p,m){for(var g=[],x=0,S=0;S<p;S++)if(S%4){var w=m[h.charCodeAt(S-1)]<<S%4*2,A=m[h.charCodeAt(S)]>>>6-S%4*2,E=w|A;g[x>>>2]|=E<<24-x%4*8,x++}return o.create(g,x)}}(),n.enc.Base64url})}(j2)),j2.exports}var q2={exports:{}},xbe=q2.exports,_G;function Bp(){return _G||(_G=1,function(e,t){(function(n,r){e.exports=r($n())})(xbe,function(n){return function(r){var i=n,o=i.lib,l=o.WordArray,c=o.Hasher,h=i.algo,p=[];(function(){for(var A=0;A<64;A++)p[A]=r.abs(r.sin(A+1))*4294967296|0})();var m=h.MD5=c.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(A,E){for(var k=0;k<16;k++){var D=E+k,R=A[D];A[D]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}var M=this._hash.words,$=A[E+0],L=A[E+1],U=A[E+2],P=A[E+3],G=A[E+4],N=A[E+5],V=A[E+6],W=A[E+7],K=A[E+8],re=A[E+9],le=A[E+10],Y=A[E+11],ae=A[E+12],te=A[E+13],be=A[E+14],j=A[E+15],ce=M[0],ie=M[1],q=M[2],he=M[3];ce=g(ce,ie,q,he,$,7,p[0]),he=g(he,ce,ie,q,L,12,p[1]),q=g(q,he,ce,ie,U,17,p[2]),ie=g(ie,q,he,ce,P,22,p[3]),ce=g(ce,ie,q,he,G,7,p[4]),he=g(he,ce,ie,q,N,12,p[5]),q=g(q,he,ce,ie,V,17,p[6]),ie=g(ie,q,he,ce,W,22,p[7]),ce=g(ce,ie,q,he,K,7,p[8]),he=g(he,ce,ie,q,re,12,p[9]),q=g(q,he,ce,ie,le,17,p[10]),ie=g(ie,q,he,ce,Y,22,p[11]),ce=g(ce,ie,q,he,ae,7,p[12]),he=g(he,ce,ie,q,te,12,p[13]),q=g(q,he,ce,ie,be,17,p[14]),ie=g(ie,q,he,ce,j,22,p[15]),ce=x(ce,ie,q,he,L,5,p[16]),he=x(he,ce,ie,q,V,9,p[17]),q=x(q,he,ce,ie,Y,14,p[18]),ie=x(ie,q,he,ce,$,20,p[19]),ce=x(ce,ie,q,he,N,5,p[20]),he=x(he,ce,ie,q,le,9,p[21]),q=x(q,he,ce,ie,j,14,p[22]),ie=x(ie,q,he,ce,G,20,p[23]),ce=x(ce,ie,q,he,re,5,p[24]),he=x(he,ce,ie,q,be,9,p[25]),q=x(q,he,ce,ie,P,14,p[26]),ie=x(ie,q,he,ce,K,20,p[27]),ce=x(ce,ie,q,he,te,5,p[28]),he=x(he,ce,ie,q,U,9,p[29]),q=x(q,he,ce,ie,W,14,p[30]),ie=x(ie,q,he,ce,ae,20,p[31]),ce=S(ce,ie,q,he,N,4,p[32]),he=S(he,ce,ie,q,K,11,p[33]),q=S(q,he,ce,ie,Y,16,p[34]),ie=S(ie,q,he,ce,be,23,p[35]),ce=S(ce,ie,q,he,L,4,p[36]),he=S(he,ce,ie,q,G,11,p[37]),q=S(q,he,ce,ie,W,16,p[38]),ie=S(ie,q,he,ce,le,23,p[39]),ce=S(ce,ie,q,he,te,4,p[40]),he=S(he,ce,ie,q,$,11,p[41]),q=S(q,he,ce,ie,P,16,p[42]),ie=S(ie,q,he,ce,V,23,p[43]),ce=S(ce,ie,q,he,re,4,p[44]),he=S(he,ce,ie,q,ae,11,p[45]),q=S(q,he,ce,ie,j,16,p[46]),ie=S(ie,q,he,ce,U,23,p[47]),ce=w(ce,ie,q,he,$,6,p[48]),he=w(he,ce,ie,q,W,10,p[49]),q=w(q,he,ce,ie,be,15,p[50]),ie=w(ie,q,he,ce,N,21,p[51]),ce=w(ce,ie,q,he,ae,6,p[52]),he=w(he,ce,ie,q,P,10,p[53]),q=w(q,he,ce,ie,le,15,p[54]),ie=w(ie,q,he,ce,L,21,p[55]),ce=w(ce,ie,q,he,K,6,p[56]),he=w(he,ce,ie,q,j,10,p[57]),q=w(q,he,ce,ie,V,15,p[58]),ie=w(ie,q,he,ce,te,21,p[59]),ce=w(ce,ie,q,he,G,6,p[60]),he=w(he,ce,ie,q,Y,10,p[61]),q=w(q,he,ce,ie,U,15,p[62]),ie=w(ie,q,he,ce,re,21,p[63]),M[0]=M[0]+ce|0,M[1]=M[1]+ie|0,M[2]=M[2]+q|0,M[3]=M[3]+he|0},_doFinalize:function(){var A=this._data,E=A.words,k=this._nDataBytes*8,D=A.sigBytes*8;E[D>>>5]|=128<<24-D%32;var R=r.floor(k/4294967296),M=k;E[(D+64>>>9<<4)+15]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,E[(D+64>>>9<<4)+14]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,A.sigBytes=(E.length+1)*4,this._process();for(var $=this._hash,L=$.words,U=0;U<4;U++){var P=L[U];L[U]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}return $},clone:function(){var A=c.clone.call(this);return A._hash=this._hash.clone(),A}});function g(A,E,k,D,R,M,$){var L=A+(E&k|~E&D)+R+$;return(L<<M|L>>>32-M)+E}function x(A,E,k,D,R,M,$){var L=A+(E&D|k&~D)+R+$;return(L<<M|L>>>32-M)+E}function S(A,E,k,D,R,M,$){var L=A+(E^k^D)+R+$;return(L<<M|L>>>32-M)+E}function w(A,E,k,D,R,M,$){var L=A+(k^(E|~D))+R+$;return(L<<M|L>>>32-M)+E}i.MD5=c._createHelper(m),i.HmacMD5=c._createHmacHelper(m)}(Math),n.MD5})}(q2)),q2.exports}var V2={exports:{}},bbe=V2.exports,SG;function wG(){return SG||(SG=1,function(e,t){(function(n,r){e.exports=r($n())})(bbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=i.Hasher,c=r.algo,h=[],p=c.SHA1=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(m,g){for(var x=this._hash.words,S=x[0],w=x[1],A=x[2],E=x[3],k=x[4],D=0;D<80;D++){if(D<16)h[D]=m[g+D]|0;else{var R=h[D-3]^h[D-8]^h[D-14]^h[D-16];h[D]=R<<1|R>>>31}var M=(S<<5|S>>>27)+k+h[D];D<20?M+=(w&A|~w&E)+1518500249:D<40?M+=(w^A^E)+1859775393:D<60?M+=(w&A|w&E|A&E)-1894007588:M+=(w^A^E)-899497514,k=E,E=A,A=w<<30|w>>>2,w=S,S=M}x[0]=x[0]+S|0,x[1]=x[1]+w|0,x[2]=x[2]+A|0,x[3]=x[3]+E|0,x[4]=x[4]+k|0},_doFinalize:function(){var m=this._data,g=m.words,x=this._nDataBytes*8,S=m.sigBytes*8;return g[S>>>5]|=128<<24-S%32,g[(S+64>>>9<<4)+14]=Math.floor(x/4294967296),g[(S+64>>>9<<4)+15]=x,m.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});r.SHA1=l._createHelper(p),r.HmacSHA1=l._createHmacHelper(p)}(),n.SHA1})}(V2)),V2.exports}var G2={exports:{}},_be=G2.exports,CG;function I6(){return CG||(CG=1,function(e,t){(function(n,r){e.exports=r($n())})(_be,function(n){return function(r){var i=n,o=i.lib,l=o.WordArray,c=o.Hasher,h=i.algo,p=[],m=[];(function(){function S(k){for(var D=r.sqrt(k),R=2;R<=D;R++)if(!(k%R))return!1;return!0}function w(k){return(k-(k|0))*4294967296|0}for(var A=2,E=0;E<64;)S(A)&&(E<8&&(p[E]=w(r.pow(A,1/2))),m[E]=w(r.pow(A,1/3)),E++),A++})();var g=[],x=h.SHA256=c.extend({_doReset:function(){this._hash=new l.init(p.slice(0))},_doProcessBlock:function(S,w){for(var A=this._hash.words,E=A[0],k=A[1],D=A[2],R=A[3],M=A[4],$=A[5],L=A[6],U=A[7],P=0;P<64;P++){if(P<16)g[P]=S[w+P]|0;else{var G=g[P-15],N=(G<<25|G>>>7)^(G<<14|G>>>18)^G>>>3,V=g[P-2],W=(V<<15|V>>>17)^(V<<13|V>>>19)^V>>>10;g[P]=N+g[P-7]+W+g[P-16]}var K=M&$^~M&L,re=E&k^E&D^k&D,le=(E<<30|E>>>2)^(E<<19|E>>>13)^(E<<10|E>>>22),Y=(M<<26|M>>>6)^(M<<21|M>>>11)^(M<<7|M>>>25),ae=U+Y+K+m[P]+g[P],te=le+re;U=L,L=$,$=M,M=R+ae|0,R=D,D=k,k=E,E=ae+te|0}A[0]=A[0]+E|0,A[1]=A[1]+k|0,A[2]=A[2]+D|0,A[3]=A[3]+R|0,A[4]=A[4]+M|0,A[5]=A[5]+$|0,A[6]=A[6]+L|0,A[7]=A[7]+U|0},_doFinalize:function(){var S=this._data,w=S.words,A=this._nDataBytes*8,E=S.sigBytes*8;return w[E>>>5]|=128<<24-E%32,w[(E+64>>>9<<4)+14]=r.floor(A/4294967296),w[(E+64>>>9<<4)+15]=A,S.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var S=c.clone.call(this);return S._hash=this._hash.clone(),S}});i.SHA256=c._createHelper(x),i.HmacSHA256=c._createHmacHelper(x)}(Math),n.SHA256})}(G2)),G2.exports}var Y2={exports:{}},Sbe=Y2.exports,EG;function wbe(){return EG||(EG=1,function(e,t){(function(n,r,i){e.exports=r($n(),I6())})(Sbe,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=r.algo,c=l.SHA256,h=l.SHA224=c.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var p=c._doFinalize.call(this);return p.sigBytes-=4,p}});r.SHA224=c._createHelper(h),r.HmacSHA224=c._createHmacHelper(h)}(),n.SHA224})}(Y2)),Y2.exports}var Z2={exports:{}},Cbe=Z2.exports,AG;function TG(){return AG||(AG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2())})(Cbe,function(n){return function(){var r=n,i=r.lib,o=i.Hasher,l=r.x64,c=l.Word,h=l.WordArray,p=r.algo;function m(){return c.create.apply(c,arguments)}var g=[m(1116352408,3609767458),m(1899447441,602891725),m(3049323471,3964484399),m(3921009573,2173295548),m(961987163,4081628472),m(1508970993,3053834265),m(2453635748,2937671579),m(2870763221,3664609560),m(3624381080,2734883394),m(310598401,1164996542),m(607225278,1323610764),m(1426881987,3590304994),m(1925078388,4068182383),m(2162078206,991336113),m(2614888103,633803317),m(3248222580,3479774868),m(3835390401,2666613458),m(4022224774,944711139),m(264347078,2341262773),m(604807628,2007800933),m(770255983,1495990901),m(1249150122,1856431235),m(1555081692,3175218132),m(1996064986,2198950837),m(2554220882,3999719339),m(2821834349,766784016),m(2952996808,2566594879),m(3210313671,3203337956),m(3336571891,1034457026),m(3584528711,2466948901),m(113926993,3758326383),m(338241895,168717936),m(666307205,1188179964),m(773529912,1546045734),m(1294757372,1522805485),m(1396182291,2643833823),m(1695183700,2343527390),m(1986661051,1014477480),m(2177026350,1206759142),m(2456956037,344077627),m(2730485921,1290863460),m(2820302411,3158454273),m(3259730800,3505952657),m(3345764771,106217008),m(3516065817,3606008344),m(3600352804,1432725776),m(4094571909,1467031594),m(275423344,851169720),m(430227734,3100823752),m(506948616,1363258195),m(659060556,3750685593),m(883997877,3785050280),m(958139571,3318307427),m(1322822218,3812723403),m(1537002063,2003034995),m(1747873779,3602036899),m(1955562222,1575990012),m(2024104815,1125592928),m(2227730452,2716904306),m(2361852424,442776044),m(2428436474,593698344),m(2756734187,3733110249),m(3204031479,2999351573),m(3329325298,3815920427),m(3391569614,3928383900),m(3515267271,566280711),m(3940187606,3454069534),m(4118630271,4000239992),m(116418474,1914138554),m(174292421,2731055270),m(289380356,3203993006),m(460393269,320620315),m(685471733,587496836),m(852142971,1086792851),m(1017036298,365543100),m(1126000580,2618297676),m(1288033470,3409855158),m(1501505948,4234509866),m(1607167915,987167468),m(1816402316,1246189591)],x=[];(function(){for(var w=0;w<80;w++)x[w]=m()})();var S=p.SHA512=o.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(w,A){for(var E=this._hash.words,k=E[0],D=E[1],R=E[2],M=E[3],$=E[4],L=E[5],U=E[6],P=E[7],G=k.high,N=k.low,V=D.high,W=D.low,K=R.high,re=R.low,le=M.high,Y=M.low,ae=$.high,te=$.low,be=L.high,j=L.low,ce=U.high,ie=U.low,q=P.high,he=P.low,We=G,Me=N,lt=V,Ke=W,bt=K,kt=re,Lt=le,nt=Y,ut=ae,_t=te,ht=be,Tt=j,X=ce,ne=ie,ge=q,Oe=he,Be=0;Be<80;Be++){var Ie,it,ct=x[Be];if(Be<16)it=ct.high=w[A+Be*2]|0,Ie=ct.low=w[A+Be*2+1]|0;else{var St=x[Be-15],ye=St.high,Re=St.low,at=(ye>>>1|Re<<31)^(ye>>>8|Re<<24)^ye>>>7,ft=(Re>>>1|ye<<31)^(Re>>>8|ye<<24)^(Re>>>7|ye<<25),$t=x[Be-2],Jt=$t.high,Gt=$t.low,Qt=(Jt>>>19|Gt<<13)^(Jt<<3|Gt>>>29)^Jt>>>6,Ln=(Gt>>>19|Jt<<13)^(Gt<<3|Jt>>>29)^(Gt>>>6|Jt<<26),xt=x[Be-7],Vt=xt.high,mt=xt.low,Rt=x[Be-16],ar=Rt.high,Yr=Rt.low;Ie=ft+mt,it=at+Vt+(Ie>>>0<ft>>>0?1:0),Ie=Ie+Ln,it=it+Qt+(Ie>>>0<Ln>>>0?1:0),Ie=Ie+Yr,it=it+ar+(Ie>>>0<Yr>>>0?1:0),ct.high=it,ct.low=Ie}var or=ut&ht^~ut&X,vr=_t&Tt^~_t&ne,wi=We&lt^We&bt^lt&bt,oi=Me&Ke^Me&kt^Ke&kt,Ci=(We>>>28|Me<<4)^(We<<30|Me>>>2)^(We<<25|Me>>>7),Yn=(Me>>>28|We<<4)^(Me<<30|We>>>2)^(Me<<25|We>>>7),Zi=(ut>>>14|_t<<18)^(ut>>>18|_t<<14)^(ut<<23|_t>>>9),vo=(_t>>>14|ut<<18)^(_t>>>18|ut<<14)^(_t<<23|ut>>>9),hs=g[Be],Nn=hs.high,hr=hs.low,cn=Oe+vo,kr=ge+Zi+(cn>>>0<Oe>>>0?1:0),cn=cn+vr,kr=kr+or+(cn>>>0<vr>>>0?1:0),cn=cn+hr,kr=kr+Nn+(cn>>>0<hr>>>0?1:0),cn=cn+Ie,kr=kr+it+(cn>>>0<Ie>>>0?1:0),si=Yn+oi,Ks=Ci+wi+(si>>>0<Yn>>>0?1:0);ge=X,Oe=ne,X=ht,ne=Tt,ht=ut,Tt=_t,_t=nt+cn|0,ut=Lt+kr+(_t>>>0<nt>>>0?1:0)|0,Lt=bt,nt=kt,bt=lt,kt=Ke,lt=We,Ke=Me,Me=cn+si|0,We=kr+Ks+(Me>>>0<cn>>>0?1:0)|0}N=k.low=N+Me,k.high=G+We+(N>>>0<Me>>>0?1:0),W=D.low=W+Ke,D.high=V+lt+(W>>>0<Ke>>>0?1:0),re=R.low=re+kt,R.high=K+bt+(re>>>0<kt>>>0?1:0),Y=M.low=Y+nt,M.high=le+Lt+(Y>>>0<nt>>>0?1:0),te=$.low=te+_t,$.high=ae+ut+(te>>>0<_t>>>0?1:0),j=L.low=j+Tt,L.high=be+ht+(j>>>0<Tt>>>0?1:0),ie=U.low=ie+ne,U.high=ce+X+(ie>>>0<ne>>>0?1:0),he=P.low=he+Oe,P.high=q+ge+(he>>>0<Oe>>>0?1:0)},_doFinalize:function(){var w=this._data,A=w.words,E=this._nDataBytes*8,k=w.sigBytes*8;A[k>>>5]|=128<<24-k%32,A[(k+128>>>10<<5)+30]=Math.floor(E/4294967296),A[(k+128>>>10<<5)+31]=E,w.sigBytes=A.length*4,this._process();var D=this._hash.toX32();return D},clone:function(){var w=o.clone.call(this);return w._hash=this._hash.clone(),w},blockSize:1024/32});r.SHA512=o._createHelper(S),r.HmacSHA512=o._createHmacHelper(S)}(),n.SHA512})}(Z2)),Z2.exports}var K2={exports:{}},Ebe=K2.exports,kG;function Abe(){return kG||(kG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2(),TG())})(Ebe,function(n){return function(){var r=n,i=r.x64,o=i.Word,l=i.WordArray,c=r.algo,h=c.SHA512,p=c.SHA384=h.extend({_doReset:function(){this._hash=new l.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var m=h._doFinalize.call(this);return m.sigBytes-=16,m}});r.SHA384=h._createHelper(p),r.HmacSHA384=h._createHmacHelper(p)}(),n.SHA384})}(K2)),K2.exports}var Q2={exports:{}},Tbe=Q2.exports,DG;function kbe(){return DG||(DG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2())})(Tbe,function(n){return function(r){var i=n,o=i.lib,l=o.WordArray,c=o.Hasher,h=i.x64,p=h.Word,m=i.algo,g=[],x=[],S=[];(function(){for(var E=1,k=0,D=0;D<24;D++){g[E+5*k]=(D+1)*(D+2)/2%64;var R=k%5,M=(2*E+3*k)%5;E=R,k=M}for(var E=0;E<5;E++)for(var k=0;k<5;k++)x[E+5*k]=k+(2*E+3*k)%5*5;for(var $=1,L=0;L<24;L++){for(var U=0,P=0,G=0;G<7;G++){if($&1){var N=(1<<G)-1;N<32?P^=1<<N:U^=1<<N-32}$&128?$=$<<1^113:$<<=1}S[L]=p.create(U,P)}})();var w=[];(function(){for(var E=0;E<25;E++)w[E]=p.create()})();var A=m.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var E=this._state=[],k=0;k<25;k++)E[k]=new p.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(E,k){for(var D=this._state,R=this.blockSize/2,M=0;M<R;M++){var $=E[k+2*M],L=E[k+2*M+1];$=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360;var U=D[M];U.high^=L,U.low^=$}for(var P=0;P<24;P++){for(var G=0;G<5;G++){for(var N=0,V=0,W=0;W<5;W++){var U=D[G+5*W];N^=U.high,V^=U.low}var K=w[G];K.high=N,K.low=V}for(var G=0;G<5;G++)for(var re=w[(G+4)%5],le=w[(G+1)%5],Y=le.high,ae=le.low,N=re.high^(Y<<1|ae>>>31),V=re.low^(ae<<1|Y>>>31),W=0;W<5;W++){var U=D[G+5*W];U.high^=N,U.low^=V}for(var te=1;te<25;te++){var N,V,U=D[te],be=U.high,j=U.low,ce=g[te];ce<32?(N=be<<ce|j>>>32-ce,V=j<<ce|be>>>32-ce):(N=j<<ce-32|be>>>64-ce,V=be<<ce-32|j>>>64-ce);var ie=w[x[te]];ie.high=N,ie.low=V}var q=w[0],he=D[0];q.high=he.high,q.low=he.low;for(var G=0;G<5;G++)for(var W=0;W<5;W++){var te=G+5*W,U=D[te],We=w[te],Me=w[(G+1)%5+5*W],lt=w[(G+2)%5+5*W];U.high=We.high^~Me.high&lt.high,U.low=We.low^~Me.low&lt.low}var U=D[0],Ke=S[P];U.high^=Ke.high,U.low^=Ke.low}},_doFinalize:function(){var E=this._data,k=E.words;this._nDataBytes*8;var D=E.sigBytes*8,R=this.blockSize*32;k[D>>>5]|=1<<24-D%32,k[(r.ceil((D+1)/R)*R>>>5)-1]|=128,E.sigBytes=k.length*4,this._process();for(var M=this._state,$=this.cfg.outputLength/8,L=$/8,U=[],P=0;P<L;P++){var G=M[P],N=G.high,V=G.low;N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,V=(V<<8|V>>>24)&16711935|(V<<24|V>>>8)&4278255360,U.push(V),U.push(N)}return new l.init(U,$)},clone:function(){for(var E=c.clone.call(this),k=E._state=this._state.slice(0),D=0;D<25;D++)k[D]=k[D].clone();return E}});i.SHA3=c._createHelper(A),i.HmacSHA3=c._createHmacHelper(A)}(Math),n.SHA3})}(Q2)),Q2.exports}var W2={exports:{}},Dbe=W2.exports,OG;function Obe(){return OG||(OG=1,function(e,t){(function(n,r){e.exports=r($n())})(Dbe,function(n){/** @preserve
3797
3797
  (c) 2012 by Cédric Mesnil. All rights reserved.
3798
3798
 
3799
3799
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -3806,4 +3806,4 @@ You might need to use a local HTTP server (instead of file://): https://react.de
3806
3806
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
3807
3807
  * derived from CryptoJS.mode.CTR
3808
3808
  * Jan Hruby jhruby.web@gmail.com
3809
- */return n.mode.CTRGladman=function(){var r=n.lib.BlockCipherMode.extend();function i(c){if((c>>24&255)===255){var h=c>>16&255,p=c>>8&255,m=c&255;h===255?(h=0,p===255?(p=0,m===255?m=0:++m):++p):++h,c=0,c+=h<<16,c+=p<<8,c+=m}else c+=1<<24;return c}function o(c){return(c[0]=i(c[0]))===0&&(c[1]=i(c[1])),c}var l=r.Encryptor=r.extend({processBlock:function(c,h){var p=this._cipher,m=p.blockSize,g=this._iv,x=this._counter;g&&(x=this._counter=g.slice(0),this._iv=void 0),o(x);var S=x.slice(0);p.encryptBlock(S,0);for(var w=0;w<m;w++)c[h+w]^=S[w]}});return r.Decryptor=l,r}(),n.mode.CTRGladman})}(iT)),iT.exports}var aT={exports:{}},Hbe=aT.exports,zG;function jbe(){return zG||(zG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Hbe,function(n){return n.mode.OFB=function(){var r=n.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(o,l){var c=this._cipher,h=c.blockSize,p=this._iv,m=this._keystream;p&&(m=this._keystream=p.slice(0),this._iv=void 0),c.encryptBlock(m,0);for(var g=0;g<h;g++)o[l+g]^=m[g]}});return r.Decryptor=i,r}(),n.mode.OFB})}(aT)),aT.exports}var oT={exports:{}},qbe=oT.exports,FG;function Vbe(){return FG||(FG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(qbe,function(n){return n.mode.ECB=function(){var r=n.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(i,o){this._cipher.encryptBlock(i,o)}}),r.Decryptor=r.extend({processBlock:function(i,o){this._cipher.decryptBlock(i,o)}}),r}(),n.mode.ECB})}(oT)),oT.exports}var sT={exports:{}},Gbe=sT.exports,UG;function Ybe(){return UG||(UG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Gbe,function(n){return n.pad.AnsiX923={pad:function(r,i){var o=r.sigBytes,l=i*4,c=l-o%l,h=o+c-1;r.clamp(),r.words[h>>>2]|=c<<24-h%4*8,r.sigBytes+=c},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Ansix923})}(sT)),sT.exports}var lT={exports:{}},Zbe=lT.exports,PG;function Kbe(){return PG||(PG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Zbe,function(n){return n.pad.Iso10126={pad:function(r,i){var o=i*4,l=o-r.sigBytes%o;r.concat(n.lib.WordArray.random(l-1)).concat(n.lib.WordArray.create([l<<24],1))},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Iso10126})}(lT)),lT.exports}var uT={exports:{}},Qbe=uT.exports,HG;function Wbe(){return HG||(HG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Qbe,function(n){return n.pad.Iso97971={pad:function(r,i){r.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(r,i)},unpad:function(r){n.pad.ZeroPadding.unpad(r),r.sigBytes--}},n.pad.Iso97971})}(uT)),uT.exports}var cT={exports:{}},Xbe=cT.exports,jG;function Jbe(){return jG||(jG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Xbe,function(n){return n.pad.ZeroPadding={pad:function(r,i){var o=i*4;r.clamp(),r.sigBytes+=o-(r.sigBytes%o||o)},unpad:function(r){for(var i=r.words,o=r.sigBytes-1,o=r.sigBytes-1;o>=0;o--)if(i[o>>>2]>>>24-o%4*8&255){r.sigBytes=o+1;break}}},n.pad.ZeroPadding})}(cT)),cT.exports}var fT={exports:{}},e_e=fT.exports,qG;function t_e(){return qG||(qG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(e_e,function(n){return n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding})}(fT)),fT.exports}var dT={exports:{}},n_e=dT.exports,VG;function r_e(){return VG||(VG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(n_e,function(n){return function(r){var i=n,o=i.lib,l=o.CipherParams,c=i.enc,h=c.Hex,p=i.format;p.Hex={stringify:function(m){return m.ciphertext.toString(h)},parse:function(m){var g=h.parse(m);return l.create({ciphertext:g})}}}(),n.format.Hex})}(dT)),dT.exports}var hT={exports:{}},i_e=hT.exports,GG;function a_e(){return GG||(GG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(i_e,function(n){return function(){var r=n,i=r.lib,o=i.BlockCipher,l=r.algo,c=[],h=[],p=[],m=[],g=[],x=[],S=[],w=[],A=[],E=[];(function(){for(var R=[],M=0;M<256;M++)M<128?R[M]=M<<1:R[M]=M<<1^283;for(var $=0,L=0,M=0;M<256;M++){var U=L^L<<1^L<<2^L<<3^L<<4;U=U>>>8^U&255^99,c[$]=U,h[U]=$;var P=R[$],G=R[P],N=R[G],V=R[U]*257^U*16843008;p[$]=V<<24|V>>>8,m[$]=V<<16|V>>>16,g[$]=V<<8|V>>>24,x[$]=V;var V=N*16843009^G*65537^P*257^$*16843008;S[U]=V<<24|V>>>8,w[U]=V<<16|V>>>16,A[U]=V<<8|V>>>24,E[U]=V,$?($=P^R[R[R[N^P]]],L^=R[R[L]]):$=L=1}})();var k=[0,1,2,4,8,16,32,64,128,27,54],D=l.AES=o.extend({_doReset:function(){var R;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var M=this._keyPriorReset=this._key,$=M.words,L=M.sigBytes/4,U=this._nRounds=L+6,P=(U+1)*4,G=this._keySchedule=[],N=0;N<P;N++)N<L?G[N]=$[N]:(R=G[N-1],N%L?L>6&&N%L==4&&(R=c[R>>>24]<<24|c[R>>>16&255]<<16|c[R>>>8&255]<<8|c[R&255]):(R=R<<8|R>>>24,R=c[R>>>24]<<24|c[R>>>16&255]<<16|c[R>>>8&255]<<8|c[R&255],R^=k[N/L|0]<<24),G[N]=G[N-L]^R);for(var V=this._invKeySchedule=[],W=0;W<P;W++){var N=P-W;if(W%4)var R=G[N];else var R=G[N-4];W<4||N<=4?V[W]=R:V[W]=S[c[R>>>24]]^w[c[R>>>16&255]]^A[c[R>>>8&255]]^E[c[R&255]]}}},encryptBlock:function(R,M){this._doCryptBlock(R,M,this._keySchedule,p,m,g,x,c)},decryptBlock:function(R,M){var $=R[M+1];R[M+1]=R[M+3],R[M+3]=$,this._doCryptBlock(R,M,this._invKeySchedule,S,w,A,E,h);var $=R[M+1];R[M+1]=R[M+3],R[M+3]=$},_doCryptBlock:function(R,M,$,L,U,P,G,N){for(var V=this._nRounds,W=R[M]^$[0],K=R[M+1]^$[1],re=R[M+2]^$[2],le=R[M+3]^$[3],Y=4,ae=1;ae<V;ae++){var te=L[W>>>24]^U[K>>>16&255]^P[re>>>8&255]^G[le&255]^$[Y++],be=L[K>>>24]^U[re>>>16&255]^P[le>>>8&255]^G[W&255]^$[Y++],j=L[re>>>24]^U[le>>>16&255]^P[W>>>8&255]^G[K&255]^$[Y++],ce=L[le>>>24]^U[W>>>16&255]^P[K>>>8&255]^G[re&255]^$[Y++];W=te,K=be,re=j,le=ce}var te=(N[W>>>24]<<24|N[K>>>16&255]<<16|N[re>>>8&255]<<8|N[le&255])^$[Y++],be=(N[K>>>24]<<24|N[re>>>16&255]<<16|N[le>>>8&255]<<8|N[W&255])^$[Y++],j=(N[re>>>24]<<24|N[le>>>16&255]<<16|N[W>>>8&255]<<8|N[K&255])^$[Y++],ce=(N[le>>>24]<<24|N[W>>>16&255]<<16|N[K>>>8&255]<<8|N[re&255])^$[Y++];R[M]=te,R[M+1]=be,R[M+2]=j,R[M+3]=ce},keySize:256/32});r.AES=o._createHelper(D)}(),n.AES})}(hT)),hT.exports}var pT={exports:{}},o_e=pT.exports,YG;function s_e(){return YG||(YG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(o_e,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=i.BlockCipher,c=r.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],p=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],m=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],x=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],S=c.DES=l.extend({_doReset:function(){for(var k=this._key,D=k.words,R=[],M=0;M<56;M++){var $=h[M]-1;R[M]=D[$>>>5]>>>31-$%32&1}for(var L=this._subKeys=[],U=0;U<16;U++){for(var P=L[U]=[],G=m[U],M=0;M<24;M++)P[M/6|0]|=R[(p[M]-1+G)%28]<<31-M%6,P[4+(M/6|0)]|=R[28+(p[M+24]-1+G)%28]<<31-M%6;P[0]=P[0]<<1|P[0]>>>31;for(var M=1;M<7;M++)P[M]=P[M]>>>(M-1)*4+3;P[7]=P[7]<<5|P[7]>>>27}for(var N=this._invSubKeys=[],M=0;M<16;M++)N[M]=L[15-M]},encryptBlock:function(k,D){this._doCryptBlock(k,D,this._subKeys)},decryptBlock:function(k,D){this._doCryptBlock(k,D,this._invSubKeys)},_doCryptBlock:function(k,D,R){this._lBlock=k[D],this._rBlock=k[D+1],w.call(this,4,252645135),w.call(this,16,65535),A.call(this,2,858993459),A.call(this,8,16711935),w.call(this,1,1431655765);for(var M=0;M<16;M++){for(var $=R[M],L=this._lBlock,U=this._rBlock,P=0,G=0;G<8;G++)P|=g[G][((U^$[G])&x[G])>>>0];this._lBlock=U,this._rBlock=L^P}var N=this._lBlock;this._lBlock=this._rBlock,this._rBlock=N,w.call(this,1,1431655765),A.call(this,8,16711935),A.call(this,2,858993459),w.call(this,16,65535),w.call(this,4,252645135),k[D]=this._lBlock,k[D+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function w(k,D){var R=(this._lBlock>>>k^this._rBlock)&D;this._rBlock^=R,this._lBlock^=R<<k}function A(k,D){var R=(this._rBlock>>>k^this._lBlock)&D;this._lBlock^=R,this._rBlock^=R<<k}r.DES=l._createHelper(S);var E=c.TripleDES=l.extend({_doReset:function(){var k=this._key,D=k.words;if(D.length!==2&&D.length!==4&&D.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var R=D.slice(0,2),M=D.length<4?D.slice(0,2):D.slice(2,4),$=D.length<6?D.slice(0,2):D.slice(4,6);this._des1=S.createEncryptor(o.create(R)),this._des2=S.createEncryptor(o.create(M)),this._des3=S.createEncryptor(o.create($))},encryptBlock:function(k,D){this._des1.encryptBlock(k,D),this._des2.decryptBlock(k,D),this._des3.encryptBlock(k,D)},decryptBlock:function(k,D){this._des3.decryptBlock(k,D),this._des2.encryptBlock(k,D),this._des1.decryptBlock(k,D)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=l._createHelper(E)}(),n.TripleDES})}(pT)),pT.exports}var mT={exports:{}},l_e=mT.exports,ZG;function u_e(){return ZG||(ZG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(l_e,function(n){return function(){var r=n,i=r.lib,o=i.StreamCipher,l=r.algo,c=l.RC4=o.extend({_doReset:function(){for(var m=this._key,g=m.words,x=m.sigBytes,S=this._S=[],w=0;w<256;w++)S[w]=w;for(var w=0,A=0;w<256;w++){var E=w%x,k=g[E>>>2]>>>24-E%4*8&255;A=(A+S[w]+k)%256;var D=S[w];S[w]=S[A],S[A]=D}this._i=this._j=0},_doProcessBlock:function(m,g){m[g]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var m=this._S,g=this._i,x=this._j,S=0,w=0;w<4;w++){g=(g+1)%256,x=(x+m[g])%256;var A=m[g];m[g]=m[x],m[x]=A,S|=m[(m[g]+m[x])%256]<<24-w*8}return this._i=g,this._j=x,S}r.RC4=o._createHelper(c);var p=l.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var m=this.cfg.drop;m>0;m--)h.call(this)}});r.RC4Drop=o._createHelper(p)}(),n.RC4})}(mT)),mT.exports}var gT={exports:{}},c_e=gT.exports,KG;function f_e(){return KG||(KG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(c_e,function(n){return function(){var r=n,i=r.lib,o=i.StreamCipher,l=r.algo,c=[],h=[],p=[],m=l.Rabbit=o.extend({_doReset:function(){for(var x=this._key.words,S=this.cfg.iv,w=0;w<4;w++)x[w]=(x[w]<<8|x[w]>>>24)&16711935|(x[w]<<24|x[w]>>>8)&4278255360;var A=this._X=[x[0],x[3]<<16|x[2]>>>16,x[1],x[0]<<16|x[3]>>>16,x[2],x[1]<<16|x[0]>>>16,x[3],x[2]<<16|x[1]>>>16],E=this._C=[x[2]<<16|x[2]>>>16,x[0]&4294901760|x[1]&65535,x[3]<<16|x[3]>>>16,x[1]&4294901760|x[2]&65535,x[0]<<16|x[0]>>>16,x[2]&4294901760|x[3]&65535,x[1]<<16|x[1]>>>16,x[3]&4294901760|x[0]&65535];this._b=0;for(var w=0;w<4;w++)g.call(this);for(var w=0;w<8;w++)E[w]^=A[w+4&7];if(S){var k=S.words,D=k[0],R=k[1],M=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,$=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,L=M>>>16|$&4294901760,U=$<<16|M&65535;E[0]^=M,E[1]^=L,E[2]^=$,E[3]^=U,E[4]^=M,E[5]^=L,E[6]^=$,E[7]^=U;for(var w=0;w<4;w++)g.call(this)}},_doProcessBlock:function(x,S){var w=this._X;g.call(this),c[0]=w[0]^w[5]>>>16^w[3]<<16,c[1]=w[2]^w[7]>>>16^w[5]<<16,c[2]=w[4]^w[1]>>>16^w[7]<<16,c[3]=w[6]^w[3]>>>16^w[1]<<16;for(var A=0;A<4;A++)c[A]=(c[A]<<8|c[A]>>>24)&16711935|(c[A]<<24|c[A]>>>8)&4278255360,x[S+A]^=c[A]},blockSize:128/32,ivSize:64/32});function g(){for(var x=this._X,S=this._C,w=0;w<8;w++)h[w]=S[w];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0<h[0]>>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0<h[1]>>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0<h[2]>>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0<h[3]>>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0<h[4]>>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0<h[5]>>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0<h[6]>>>0?1:0)|0,this._b=S[7]>>>0<h[7]>>>0?1:0;for(var w=0;w<8;w++){var A=x[w]+S[w],E=A&65535,k=A>>>16,D=((E*E>>>17)+E*k>>>15)+k*k,R=((A&4294901760)*A|0)+((A&65535)*A|0);p[w]=D^R}x[0]=p[0]+(p[7]<<16|p[7]>>>16)+(p[6]<<16|p[6]>>>16)|0,x[1]=p[1]+(p[0]<<8|p[0]>>>24)+p[7]|0,x[2]=p[2]+(p[1]<<16|p[1]>>>16)+(p[0]<<16|p[0]>>>16)|0,x[3]=p[3]+(p[2]<<8|p[2]>>>24)+p[1]|0,x[4]=p[4]+(p[3]<<16|p[3]>>>16)+(p[2]<<16|p[2]>>>16)|0,x[5]=p[5]+(p[4]<<8|p[4]>>>24)+p[3]|0,x[6]=p[6]+(p[5]<<16|p[5]>>>16)+(p[4]<<16|p[4]>>>16)|0,x[7]=p[7]+(p[6]<<8|p[6]>>>24)+p[5]|0}r.Rabbit=o._createHelper(m)}(),n.Rabbit})}(gT)),gT.exports}var vT={exports:{}},d_e=vT.exports,QG;function h_e(){return QG||(QG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(d_e,function(n){return function(){var r=n,i=r.lib,o=i.StreamCipher,l=r.algo,c=[],h=[],p=[],m=l.RabbitLegacy=o.extend({_doReset:function(){var x=this._key.words,S=this.cfg.iv,w=this._X=[x[0],x[3]<<16|x[2]>>>16,x[1],x[0]<<16|x[3]>>>16,x[2],x[1]<<16|x[0]>>>16,x[3],x[2]<<16|x[1]>>>16],A=this._C=[x[2]<<16|x[2]>>>16,x[0]&4294901760|x[1]&65535,x[3]<<16|x[3]>>>16,x[1]&4294901760|x[2]&65535,x[0]<<16|x[0]>>>16,x[2]&4294901760|x[3]&65535,x[1]<<16|x[1]>>>16,x[3]&4294901760|x[0]&65535];this._b=0;for(var E=0;E<4;E++)g.call(this);for(var E=0;E<8;E++)A[E]^=w[E+4&7];if(S){var k=S.words,D=k[0],R=k[1],M=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,$=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,L=M>>>16|$&4294901760,U=$<<16|M&65535;A[0]^=M,A[1]^=L,A[2]^=$,A[3]^=U,A[4]^=M,A[5]^=L,A[6]^=$,A[7]^=U;for(var E=0;E<4;E++)g.call(this)}},_doProcessBlock:function(x,S){var w=this._X;g.call(this),c[0]=w[0]^w[5]>>>16^w[3]<<16,c[1]=w[2]^w[7]>>>16^w[5]<<16,c[2]=w[4]^w[1]>>>16^w[7]<<16,c[3]=w[6]^w[3]>>>16^w[1]<<16;for(var A=0;A<4;A++)c[A]=(c[A]<<8|c[A]>>>24)&16711935|(c[A]<<24|c[A]>>>8)&4278255360,x[S+A]^=c[A]},blockSize:128/32,ivSize:64/32});function g(){for(var x=this._X,S=this._C,w=0;w<8;w++)h[w]=S[w];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0<h[0]>>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0<h[1]>>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0<h[2]>>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0<h[3]>>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0<h[4]>>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0<h[5]>>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0<h[6]>>>0?1:0)|0,this._b=S[7]>>>0<h[7]>>>0?1:0;for(var w=0;w<8;w++){var A=x[w]+S[w],E=A&65535,k=A>>>16,D=((E*E>>>17)+E*k>>>15)+k*k,R=((A&4294901760)*A|0)+((A&65535)*A|0);p[w]=D^R}x[0]=p[0]+(p[7]<<16|p[7]>>>16)+(p[6]<<16|p[6]>>>16)|0,x[1]=p[1]+(p[0]<<8|p[0]>>>24)+p[7]|0,x[2]=p[2]+(p[1]<<16|p[1]>>>16)+(p[0]<<16|p[0]>>>16)|0,x[3]=p[3]+(p[2]<<8|p[2]>>>24)+p[1]|0,x[4]=p[4]+(p[3]<<16|p[3]>>>16)+(p[2]<<16|p[2]>>>16)|0,x[5]=p[5]+(p[4]<<8|p[4]>>>24)+p[3]|0,x[6]=p[6]+(p[5]<<16|p[5]>>>16)+(p[4]<<16|p[4]>>>16)|0,x[7]=p[7]+(p[6]<<8|p[6]>>>24)+p[5]|0}r.RabbitLegacy=o._createHelper(m)}(),n.RabbitLegacy})}(vT)),vT.exports}var yT={exports:{}},p_e=yT.exports,WG;function m_e(){return WG||(WG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(p_e,function(n){return function(){var r=n,i=r.lib,o=i.BlockCipher,l=r.algo;const c=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],p=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var m={pbox:[],sbox:[]};function g(E,k){let D=k>>24&255,R=k>>16&255,M=k>>8&255,$=k&255,L=E.sbox[0][D]+E.sbox[1][R];return L=L^E.sbox[2][M],L=L+E.sbox[3][$],L}function x(E,k,D){let R=k,M=D,$;for(let L=0;L<c;++L)R=R^E.pbox[L],M=g(E,R)^M,$=R,R=M,M=$;return $=R,R=M,M=$,M=M^E.pbox[c],R=R^E.pbox[c+1],{left:R,right:M}}function S(E,k,D){let R=k,M=D,$;for(let L=c+1;L>1;--L)R=R^E.pbox[L],M=g(E,R)^M,$=R,R=M,M=$;return $=R,R=M,M=$,M=M^E.pbox[1],R=R^E.pbox[0],{left:R,right:M}}function w(E,k,D){for(let U=0;U<4;U++){E.sbox[U]=[];for(let P=0;P<256;P++)E.sbox[U][P]=p[U][P]}let R=0;for(let U=0;U<c+2;U++)E.pbox[U]=h[U]^k[R],R++,R>=D&&(R=0);let M=0,$=0,L=0;for(let U=0;U<c+2;U+=2)L=x(E,M,$),M=L.left,$=L.right,E.pbox[U]=M,E.pbox[U+1]=$;for(let U=0;U<4;U++)for(let P=0;P<256;P+=2)L=x(E,M,$),M=L.left,$=L.right,E.sbox[U][P]=M,E.sbox[U][P+1]=$;return!0}var A=l.Blowfish=o.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var E=this._keyPriorReset=this._key,k=E.words,D=E.sigBytes/4;w(m,k,D)}},encryptBlock:function(E,k){var D=x(m,E[k],E[k+1]);E[k]=D.left,E[k+1]=D.right},decryptBlock:function(E,k){var D=S(m,E[k],E[k+1]);E[k]=D.left,E[k+1]=D.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=o._createHelper(A)}(),n.Blowfish})}(yT)),yT.exports}var g_e=L2.exports,XG;function v_e(){return XG||(XG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2(),hbe(),mbe(),Mp(),ybe(),Bp(),wG(),I6(),wbe(),TG(),Abe(),kbe(),Obe(),$6(),Bbe(),qd(),ua(),Nbe(),Fbe(),Pbe(),jbe(),Vbe(),Ybe(),Kbe(),Wbe(),Jbe(),t_e(),r_e(),a_e(),s_e(),u_e(),f_e(),h_e(),m_e())})(g_e,function(n){return n})}(L2)),L2.exports}var y_e=v_e();const x_e=s4(y_e);class b_e extends $2{constructor(){super(...arguments);Br(this,"platform",di.THE_COLLECTIVE);Br(this,"apiBaseURL",window.location.hostname==="test.thecollective.in"?"https://testapi.thecollective.in/":window.location.hostname==="uat.thecollective.in"?"https://uatapi.thecollective.in/":"https://api.thecollective.in/");Br(this,"defaultHeaders",{"Content-Type":"application/json",securekey:"8837130cc8d08aba14323fbd4714f4aa",authorization:`Bearer ${this.getCookie("DEVELOPMENT_B_TOKEN")}`,Version:"1"})}getCookie(n){var o;const i=`; ${document.cookie}`.split(`; ${n}=`);return i.length===2&&((o=i.pop())==null?void 0:o.split(";").shift())||null}getDeviceType(){const n=this.getCookie("DEVELOPMENT_SOURCE_DEVICE_TYPE");if(n)return n;const r=this.getCookie("DEVELOPMENT_DEVICE_TYPE");return r||"desktop"}generateHash(n){const r=JSON.parse(JSON.stringify(n));return delete r.hash,x_e.MD5(JSON.stringify(r)).toString()}async fetchCart(){try{const n={storeId:0,customerId:parseInt(this.getCookie("DEVELOPMENT_CUSTOMER_ID")||"0"),cartId:parseInt(this.getCookie("DEVELOPMENT_CART_ID")||"0"),page:"cartSummary",device:this.getDeviceType(),shopId:7,shopName:"The Collective",deviceId:this.getCookie("DEVELOPMENT_DEVICE_ID")||"",isS2SCall:!1,deviceType:this.getDeviceType(),brand:"The Collective",geoLocation:-1,fcmToken:-1,deviceToken:this.getCookie("DEVELOPMENT_DEVICE_TOKEN")||""},r=this.generateHash(n),i={...n,hash:r,validateHash:!0},o=await fetch(`${this.apiBaseURL}cart/getCart`,{method:"POST",headers:{...this.defaultHeaders},body:JSON.stringify(i)});if(!o.ok)return this.createErrorResult(`Failed to fetch cart: ${o.status}`);const l=await o.json();if(!l.results||l.results==="")return this.createSuccessResult({items:[],total:0,itemCount:0,currency:"INR",token:""});const c=l.results[0],h=c.products.map(p=>({id:p.id_cart_product,quantity:p.quantity,properties:{size:p.size,color:p.color,brand:p.brand,subbrand:p.subbrand},title:p.name,price:p.unitproductprice,variant_id:p.id_product_attribute}));return this.createSuccessResult({items:h,total:c.totalPrice,itemCount:h.reduce((p,m)=>p+m.quantity,0),currency:"INR",token:l.hash})}catch(n){return this.createErrorResult(n instanceof Error?n.message:"Unknown error")}}async addToCart(n,r=1,i){try{const o=parseInt(n),l=new URLSearchParams;l.append("dbls_order_source","direct_recommendation"),l.append("dbls_session_id",Er()),l.append("dbls_method","add_to_cart"),l.append("utm_source","debales_chatbot");const c={productId:parseInt((i==null?void 0:i.productId)||"0"),productAttributeId:o,size:o,customerId:parseInt(this.getCookie("DEVELOPMENT_CUSTOMER_ID")||"0"),cartId:parseInt(this.getCookie("DEVELOPMENT_CART_ID")||"0"),version:1.2,buyNow:0,quantity:r,oldAttributeId:0,wishlistDeleteFlag:0,cartOperation:"add",storeId:0,utmSource:l.toString(),sliderSource:"",page:"cartSummary",shopId:7,shopName:"The Collective",deviceId:this.getCookie("DEVELOPMENT_DEVICE_ID")||"",isS2SCall:!1,deviceType:this.getDeviceType(),brand:"The Collective",geoLocation:-1,fcmToken:-1,deviceToken:this.getCookie("DEVELOPMENT_DEVICE_TOKEN")||""},h=this.generateHash(c),p={...c,hash:h,validateHash:!0},m=await fetch(`${this.apiBaseURL}cart/addToCart`,{method:"POST",headers:{...this.defaultHeaders},body:JSON.stringify(p)});if(!m.ok)return this.createErrorResult(`Failed to add item to cart: ${m.status}`);const g=await this.fetchCart();return g.success?this.createSuccessResult(g.data,"Item added to cart successfully"):this.createErrorResult(g.error)}catch(o){return this.createErrorResult(o instanceof Error?o.message:"Unknown error")}}async removeFromCart(n){try{const r={customerId:parseInt(this.getCookie("DEVELOPMENT_CUSTOMER_ID")||"0"),cartId:parseInt(this.getCookie("DEVELOPMENT_CART_ID")||"0"),productId:n,storeId:0,productAttributeId:0,device:this.getDeviceType(),shopId:7,shopName:"The Collective",deviceId:this.getCookie("DEVELOPMENT_DEVICE_ID")||"",isS2SCall:!1,deviceType:this.getDeviceType(),brand:"The Collective",geoLocation:-1,fcmToken:-1,deviceToken:this.getCookie("DEVELOPMENT_DEVICE_TOKEN")||""},i=this.generateHash(r),o={...r,hash:i,validateHash:!0},l=await fetch(`${this.apiBaseURL}cart/deleteCartProduct`,{method:"POST",headers:{...this.defaultHeaders},body:JSON.stringify(o)});return l.ok?this.createSuccessResult(void 0,"Item removed from cart successfully"):this.createErrorResult(`Failed to remove item from cart: ${l.status}`)}catch(r){return this.createErrorResult(r instanceof Error?r.message:"Unknown error")}}async updateQuantity(n){try{return console.log("TheCollectiveCartAdapter: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}catch(r){return this.createErrorResult(r instanceof Error?r.message:"Unknown error")}}async clearCart(){try{return console.log("TheCollectiveCartAdapter: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}catch(n){return this.createErrorResult(n instanceof Error?n.message:"Unknown error")}}generateCartUrl(n){const r=F1(n);if(!r.isValid)return"";const i=new URL("/checkoutsummary",r.url);return i.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),i.searchParams.append("attributes[from]","debales-ai-chatbot"),i.searchParams.append("attributes[through]","add-to-cart"),i.searchParams.append("attributes[dbls_session_id]",Er()),i.searchParams.append("timestamp",Date.now().toString()),Yl(i.toString())}generateProductUrl(n,r){const i=new URL(r.link);return i.host=n,Yl(i.toString())}async addCartAttributes(n={}){try{return console.log("TheCollectiveCartAdapter: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}catch(r){return this.createErrorResult(r instanceof Error?r.message:"Unknown error")}}}const $p=class $p{constructor(){Br(this,"adapterCache");this.adapterCache=new Map}static getInstance(){return $p.instance||($p.instance=new $p),$p.instance}getAdapter(t){const n=t||zd.detect(),r=this.adapterCache.get(n);if(r)return r;let i;switch(n){case di.SHOPIFY:i=new obe;break;case di.MAGENTO:i=new sbe;break;case di.THE_COLLECTIVE:i=new b_e;break;default:console.warn(`No specific adapter found for platform ${n}, using default adapter`),i=new abe}return this.adapterCache.set(n,i),i}clearCache(){this.adapterCache.clear()}};Br($p,"instance");let L6=$p;function xT(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}const JG=(e,t)=>{const n=JSON.stringify(t);window.localStorage.setItem(e,n),xT(e,n)},__e=e=>{window.localStorage.removeItem(e),xT(e,null)},eY=e=>window.localStorage.getItem(e),S_e=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),w_e=()=>{throw Error("useLocalStorage is a client-only hook")};function C_e(e,t){const n=()=>eY(e),r=Nt.useSyncExternalStore(S_e,n,w_e),i=Nt.useCallback(o=>{try{const l=typeof o=="function"?o(JSON.parse(r)):o;l==null?__e(e):JG(e,l)}catch(l){console.warn(l)}},[e,r]);return Nt.useEffect(()=>{eY(e)===null&&typeof t<"u"&&JG(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const tY=(e,t)=>{const n=JSON.stringify(t);window.sessionStorage.setItem(e,n),xT(e,n)},E_e=e=>{window.sessionStorage.removeItem(e),xT(e,null)},nY=e=>window.sessionStorage.getItem(e),A_e=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),T_e=()=>{throw Error("useSessionStorage is a client-only hook")};function rY(e,t){const n=()=>nY(e),r=Nt.useSyncExternalStore(A_e,n,T_e),i=Nt.useCallback(o=>{try{const l=typeof o=="function"?o(JSON.parse(r)):o;l==null?E_e(e):tY(e,l)}catch(l){console.warn(l)}},[e,r]);return Nt.useEffect(()=>{nY(e)===null&&typeof t<"u"&&tY(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const k_e=({adapter:e,children:t,botId:n})=>{const[r,i]=ee.useState(!1),[o,l]=ee.useState(null),[c,h]=ee.useState(null),[p,m]=rY(Ir.SHOW_CART_SUMMARY,!He(n||"")),g=ee.useCallback(async()=>{try{i(!0),l(null);const M=await e.fetchCart();if(M.success)return h(M.data),M.data;l(M.error)}catch(M){l(M instanceof Error?M.message:"Failed to fetch cart")}finally{i(!1)}},[e]),x=async(M,$,L)=>{try{l(null);const U=await e.addToCart(M,$,L);if(U.success){const P=await e.fetchCart();return P.success?{success:!0,data:P.data,message:U.message}:{success:!1,error:P.error}}return U}catch(U){return{success:!1,error:U instanceof Error?U.message:"Failed to add item to cart"}}},S=async M=>{try{l(null);const $=await e.removeFromCart(M);return $.success&&await g(),$}catch($){return{success:!1,error:$ instanceof Error?$.message:"Failed to remove item from cart"}}},w=async M=>{try{l(null);const $=await e.updateQuantity(M);return $.success&&await g(),$}catch($){return{success:!1,error:$ instanceof Error?$.message:"Failed to update quantity"}}},A=async()=>{try{l(null);const M=await e.clearCart();return M.success&&await g(),M}catch(M){return{success:!1,error:M instanceof Error?M.message:"Failed to clear cart"}}},E=M=>e.generateCartUrl(M),k=(M,$)=>e.generateProductUrl(M,$),D=async M=>e.addCartAttributes(M);ee.useEffect(()=>{window.DebalesChat&&window.DebalesChat.onOpenChange(M=>{M&&g()})},[g]);const R={isLoading:r,showCartSummery:p,setShowCartSummery:m,error:o,cart:c,fetchCart:g,addToCart:x,removeFromCart:S,updateQuantity:w,clearCart:A,generateCartUrl:E,generateProductUrl:k,addCartAttributes:D};return I.jsx(YU.Provider,{value:R,children:t})},N6={API_ERROR:"api_error",WEBSOCKET_ERROR:"websocket_error",COMPONENT_ERROR:"component_error",STORAGE_ERROR:"storage_error"};function z6(e,t){var n;return{errorType:e,errorMessage:t.message||"Unknown error",errorStack:t.stack,widget_error:!0,botId:(n=window.DebalesChat)==null?void 0:n.projectId,sessionId:Er(),platform:zd.detect(),timestamp:new Date().toISOString(),userAgent:navigator.userAgent}}function D_e(e){if(!e)return;const t={...e};return["password","token","apiKey","secret","userInfo","email","phone","distinctId"].forEach(r=>{t[r]&&(t[r]="[REDACTED]")}),t}function iY(e,t){try{const r={...z6(N6.API_ERROR,e),endpoint:t.endpoint,method:t.method,nameSpace:t.nameSpace,requestPayload:D_e(t.requestPayload),responseStatus:t.responseStatus,responseData:t.responseData,messagesCount:t.messagesCount};fi.captureException(e,r)}catch(n){console.error("Failed to capture API error:",n)}}function O_e(e,t){try{const r={...z6(N6.WEBSOCKET_ERROR,e),socketEvent:t.socketEvent,socketConnected:t.socketConnected,socketData:t.socketData};fi.captureException(e,r)}catch(n){console.error("Failed to capture WebSocket error:",n)}}function R_e(e,t){try{const r={...z6(N6.STORAGE_ERROR,e),operation:t.operation,storageType:t.storageType,dataSize:t.dataSize};fi.captureException(e,r)}catch(n){console.error("Failed to capture storage error:",n)}}const Lp=class Lp{constructor(){Br(this,"socket",null);Br(this,"isConnected",!1);Br(this,"eventListeners",new Map)}static getInstance(){return Lp.instance||(Lp.instance=new Lp),Lp.instance}connect(t){return this.socket?this.socket:(this.socket=H1(`${rN}${t}`,{transports:["websocket"]}),this.socket.on("connect",()=>{this.isConnected=!0,this.emitEvent("connect")}),this.socket.on("disconnect",()=>{this.isConnected=!1,this.emitEvent("disconnect")}),this.socket)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null,this.isConnected=!1,this.eventListeners.clear())}getSocket(){return this.socket}getIsConnected(){return this.isConnected}on(t,n){var r,i;this.eventListeners.has(t)||this.eventListeners.set(t,[]),(r=this.eventListeners.get(t))==null||r.push(n),(i=this.socket)==null||i.on(t,n)}off(t,n){var i;const r=this.eventListeners.get(t);if(r){const o=r.indexOf(n);o>-1&&r.splice(o,1),(i=this.socket)==null||i.off(t,n)}}emit(t,...n){var r;(r=this.socket)==null||r.emit(t,...n)}emitEvent(t,...n){const r=this.eventListeners.get(t);r&&r.forEach(i=>i(...n))}};Br(Lp,"instance");let F6=Lp;const Yu=F6.getInstance(),M_e=e=>{window.DebalesChat||(window.DebalesChat={isOpen:!1,projectId:e,getSessionId:()=>Er(),getChatId:()=>Er()+"_"+e,getAnonId:()=>Nd.getAnonId(),isIdentified:()=>{if(fi._isIdentified())return!0;const t=jl();return!!(t&&t.email)},getIdentifiedUser:()=>jl(),getDistinctId:()=>fi.get_distinct_id(),getOldDistinctId:()=>Nd.getDistinctId(),debug:!1,identify:(t,n)=>{fi._isIdentified()||fi.identify(t,{...n,project:e}),Nd.identify(t,n),Xx({email:t,name:n==null?void 0:n.name,phone:n==null?void 0:n.phone})},track:(t,n)=>{Nd.track(t,{...n,sessionId:Er()}),console.log("posthog",fi),fi.capture(t,{...n}),Jse(t,{...n,sessionId:Er(),projectId:e})},onOpenChange:t=>{const n=r=>{t(r.detail.isOpen)};return window.addEventListener(qa.OPEN_STATE_CHANGE,n),()=>window.removeEventListener(qa.OPEN_STATE_CHANGE,n)},removeOpenChangeListener:t=>{const n=r=>{t(r.detail.isOpen)};window.removeEventListener(qa.OPEN_STATE_CHANGE,n)},open:()=>{window.DebalesChat.isOpen||window.dispatchEvent(new CustomEvent(qa.OPEN_STATE_CHANGE,{detail:{isOpen:!0,projectId:e}}))},close:()=>{window.DebalesChat.isOpen&&window.dispatchEvent(new CustomEvent(qa.OPEN_STATE_CHANGE,{detail:{isOpen:!1,projectId:e}}))},toggle:()=>{window.dispatchEvent(new CustomEvent(qa.OPEN_STATE_CHANGE,{detail:{isOpen:!window.DebalesChat.isOpen,projectId:e}}))}})},aY=()=>{const e=["Ah — I'm stuck on that one right now. Could you try rephrasing it, or ask something else?","Looks like I'm having a bit of trouble with that. Try wording it differently, or send a new question.","Oops, that didn't go through the way I expected. Can you reword it or try a different query?","I'm not able to pull that up at the moment. Want to try asking it another way, or ask a different question?"];return e[Math.floor(Math.random()*e.length)]},B_e=({children:e,nameSpace:t})=>{ee.useEffect(()=>{t&&M_e(t)},[t]);const{fetchCart:n,setShowCartSummery:r}=k1(),[i,o]=ee.useState(""),[l,c]=ee.useState([]),[h,p]=ee.useState(!1),[m,g]=ee.useState(!1),[x,S]=ee.useState([]),[w,A]=ee.useState(!1),[E,k]=ee.useState(!1),[D,R]=ee.useState([]),[M,$]=C_e(Vr(Ir.USER_INFO),null),[L,U]=rY(Vr(Ir.IS_FORM_CLOSED_BY_USER),!1),[P,G]=ee.useState(null),N=og("web-socket"),[V,W]=ee.useState([]),[K,re]=ee.useState(null),[le,Y]=ee.useState(!1),[ae,te]=ee.useState(sessionStorage.getItem(Vr(Ir.LAST_SHOWN_MESSAGE_ID,{botId:t}))),[be,j]=ee.useState(0),ce=ele(),ie=Er(),[q,he]=ee.useState(null),[We,Me]=ee.useState(null);ee.useEffect(()=>{if(N){const ht=Yu.connect("/api/v1/chat");re(ht);const Tt=()=>{console.debug("connected to websocket"),Y(!0)},X=()=>{console.debug("disconnected from websocket"),Y(!1)},ne=Oe=>{console.debug("response from websocket",Oe);const Be=Oe.conversationId??crypto.randomUUID().toString();te(Be),Oe.Variants_quantity&&R(it=>[...it,...Oe.Variants_quantity]);const Ie=[...l,{text:Oe.response,products:Oe.products,conversationId:Be,rating:"neutral",leading_queries:Oe.leading_queries,collections:Oe.collections,variants:Oe.variants,shop:Oe.shop,Variants_quantity:Oe.Variants_quantity,monthlyChatLimitReached:Oe.monthlyChatLimitReached,isBot:!0}];c(Ie),lt(Ie),S(it=>[...it,[l[l.length-1].text,Oe.response]]),g(!1)},ge=Oe=>{if(Oe.event==="error"){O_e(new Error(Oe.message||"WebSocket system error"),{socketEvent:"system_error",socketConnected:le,socketData:Oe});const Be={text:aY(),isBot:!0},Ie=[...l,Be];c(Ie),lt(Ie),g(!1)}};return Yu.on("connect",Tt),Yu.on("disconnect",X),Yu.on("response",ne),Yu.on("system",ge),()=>{Yu.off("connect",Tt),Yu.off("disconnect",X),Yu.off("response",ne),Yu.off("system",ge)}}},[N,l]);const lt=ht=>{try{sessionStorage.setItem(Vr(Ir.CHAT_HISTORY,{botId:window.DebalesChat.projectId}),JSON.stringify(ht))}catch(Tt){R_e(Tt,{operation:"saveConversation",storageType:"sessionStorage",dataSize:JSON.stringify(ht).length})}},Ke=()=>{const ht=sessionStorage.getItem(Vr(Ir.CHAT_HISTORY,{botId:window.DebalesChat.projectId}));return ht?JSON.parse(ht):[]},bt=ee.useCallback(async()=>{if(t)try{p(!0);const ht=await fetch(`${fs}/api/wordpress/UiData?value=${t}`),Tt=await ht.json();if(!ht.ok)throw new Error("failed to fetch data"+Tt.error);const X=document.getElementById("debales-ai-assistant");X&&(X.style.zIndex=String(Tt.zIndex??2031483602)),Me(Tt),Tt!=null&&Tt.shopifyShopDomain&&Che(Tt.shopifyShopDomain).then(ge=>{he(ge)}),W(Tt.suggestedQuestions);const ne=Ke();if(ne.length>0)c(ne);else{const ge={text:Tt.initialMessage||"Hi, I am an AI Assistant. How can I help you?",isBot:!0};c([ge])}}catch(ht){iY(ht,{endpoint:"/api/wordpress/UiData",method:"GET",nameSpace:t}),console.error(ht)}finally{p(!1)}},[t]);ee.useEffect(()=>{bt()},[bt]);const kt=ee.useMemo(()=>{var ht;return!!(!L&&((ht=We==null?void 0:We.pluginConfig)!=null&&ht.collectedUserInfo)&&(We.pluginConfig.collectedUserInfo.name||We.pluginConfig.collectedUserInfo.email||We.pluginConfig.collectedUserInfo.phone)&&!M)},[We,M,L]),Lt=ee.useCallback(async({message:ht,answer:Tt,products:X,fromKlaviyo:ne,leading_queries:ge,followUpQuestion:Oe,messType:Be="other"})=>{if(!ht||ht.trim()===""||m&&!X)return;let Ie=[...l];ne?ne&&l.length<=2?(A(!0),Ie=[]):A(!1):(Ie.push({text:ht,isBot:!1}),A(!1));const it=Er();g(!0);const ct=be+1;j(ct),ct>1&&r(!1);try{c(Ie),lt(Ie);const St=await n(),ye=await fetch(`${fs}/api/wordpress/ChatWithBot`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:it,userMessage:ht,nameSpace:t,chat_history:x,leading_queries:ge,answer:Tt,products:X,userInfo:JSON.stringify(M),anonymousUserId:ce,distinctId:Nd.getDistinctId(),timestamp:new Date().toISOString(),timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,followUpQuestion:Oe,messType:Be,cart:St})});if(!ye.ok)throw new Error("Network response was not ok");const Re=await ye.json(),at=Re.conversationId??crypto.randomUUID().toString();te(at),Re.Variants_quantity&&R($t=>[...$t,...Re.Variants_quantity]);const ft=[...Ie,{text:Re.response,products:Re.products,conversationId:at,rating:"neutral",leading_queries:Re.leading_queries,collections:Re.collections,variants:Re.variants,shop:Re.shop,Variants_quantity:Re.Variants_quantity,monthlyChatLimitReached:Re.monthlyChatLimitReached,isBot:!0}];c(ft),lt(ft),S($t=>[...$t,[ht,Re.response]])}catch(St){const ye=aY();iY(St,{endpoint:"/api/wordpress/ChatWithBot",method:"POST",requestPayload:{sessionId:it,nameSpace:t,errorMessage:ye},messagesCount:l.length}),console.error(St);const Re={text:ye,isBot:!0},at=[...Ie,Re];ne||(c(at),lt(at))}finally{g(!1)}},[l,m,x,t,ce,M,n,r,be]),nt=ee.useCallback(ht=>{We&&Me(Tt=>Tt?{...Tt,mobileDisplayMode:ht}:null)},[We]),ut=ee.useCallback(async({message:ht,answer:Tt,products:X,fromKlaviyo:ne,leading_queries:ge,followUpQuestion:Oe,messType:Be="other"})=>{if(!ht||ht.trim()===""||m&&!X)return;let Ie=[...l];ne?ne&&l.length<=2?(A(!0),Ie=[]):A(!1):(Ie.push({text:ht,isBot:!1}),A(!1)),g(!0),c(Ie),lt(Ie);const it=be+1;j(it),it>1&&r(!1);const ct=await n();if(K&&le){const St={type:pde.MESSAGE,role:mde.USER,query:ht,nameSpace:t,leadingQueries:ge,answer:Tt,products:X,userInfo:M,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),sessionId:ie,anonymousUserId:ce,distinctId:Nd.getDistinctId(),followUpQuestion:Oe,cart:ct};Yu.emit("chat",St)}else Lt({message:ht,answer:Tt,products:X,fromKlaviyo:ne,leading_queries:ge,followUpQuestion:Oe,messType:Be})},[l,m,t,ce,K,le,ie,Lt,M,n,r,be]),_t={nameSpace:t,sessionId:ie,messages:l,isLoading:h,isMessageLoading:m,isKlaviyoMessage:w,showUserInfoModel:E,pendingBulkItems:D,lastedBotmessageId:ae,uiData:We,storeMetaData:q,suggestedQuestions:V,isUserInfoNeeded:kt,input:i,pendingQuestion:P,userInfo:M,isFormClosedByUser:L,onSendMessage:N?ut:Lt,setMessages:c,setIsLoading:p,setIsMessageLoading:g,setIsKlaviyoMessage:A,setShowUserInfoModel:k,setPendingBulkItems:R,setLastedBotmessageId:te,fetchUiInfo:bt,changeDisplayModel:nt,saveConversation:lt,loadConversation:Ke,setSuggestedQuestions:W,setUserInfo:$,setInput:o,setPendingQuestion:G,setIsFormClosedByUser:U};return I.jsx(a5.Provider,{value:_t,children:e})};function I_e(e){const t=L6.getInstance().getAdapter();return ee.useEffect(()=>{fi.set_config({capture_pageview:e.botId!=="burgerbaeclothing",capture_pageleave:e.botId!=="burgerbaeclothing"}),fi.register({platform:zd.detect(),project:e.botId,sessionId:Er()}),fi.group("project",e.botId,{platform:zd.detect()});const n=jl();n!=null&&n.email&&!fi._isIdentified()&&fi.identify(n.email,{name:n.name,phone:n.phone,email:n.email,project:e.botId})},[e.botId]),I.jsx(vce,{client:fi,children:I.jsx(Sce,{additionalProperties:{widget_error:!0,botId:e.botId},children:I.jsx(k_e,{adapter:t,botId:e.botId,children:I.jsx(B_e,{nameSpace:e.botId,children:e.children})})})})}function $_e(e){return I.jsxs(I.Fragment,{children:[I.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),I.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),I.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap",rel:"stylesheet"}),I.jsx(ibe,{children:I.jsx(I_e,{botId:e.botId,children:I.jsx(W1e,{...e})})})]})}return $_e});
3809
+ */return n.mode.CTRGladman=function(){var r=n.lib.BlockCipherMode.extend();function i(c){if((c>>24&255)===255){var h=c>>16&255,p=c>>8&255,m=c&255;h===255?(h=0,p===255?(p=0,m===255?m=0:++m):++p):++h,c=0,c+=h<<16,c+=p<<8,c+=m}else c+=1<<24;return c}function o(c){return(c[0]=i(c[0]))===0&&(c[1]=i(c[1])),c}var l=r.Encryptor=r.extend({processBlock:function(c,h){var p=this._cipher,m=p.blockSize,g=this._iv,x=this._counter;g&&(x=this._counter=g.slice(0),this._iv=void 0),o(x);var S=x.slice(0);p.encryptBlock(S,0);for(var w=0;w<m;w++)c[h+w]^=S[w]}});return r.Decryptor=l,r}(),n.mode.CTRGladman})}(iT)),iT.exports}var aT={exports:{}},Hbe=aT.exports,zG;function jbe(){return zG||(zG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Hbe,function(n){return n.mode.OFB=function(){var r=n.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(o,l){var c=this._cipher,h=c.blockSize,p=this._iv,m=this._keystream;p&&(m=this._keystream=p.slice(0),this._iv=void 0),c.encryptBlock(m,0);for(var g=0;g<h;g++)o[l+g]^=m[g]}});return r.Decryptor=i,r}(),n.mode.OFB})}(aT)),aT.exports}var oT={exports:{}},qbe=oT.exports,FG;function Vbe(){return FG||(FG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(qbe,function(n){return n.mode.ECB=function(){var r=n.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(i,o){this._cipher.encryptBlock(i,o)}}),r.Decryptor=r.extend({processBlock:function(i,o){this._cipher.decryptBlock(i,o)}}),r}(),n.mode.ECB})}(oT)),oT.exports}var sT={exports:{}},Gbe=sT.exports,UG;function Ybe(){return UG||(UG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Gbe,function(n){return n.pad.AnsiX923={pad:function(r,i){var o=r.sigBytes,l=i*4,c=l-o%l,h=o+c-1;r.clamp(),r.words[h>>>2]|=c<<24-h%4*8,r.sigBytes+=c},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Ansix923})}(sT)),sT.exports}var lT={exports:{}},Zbe=lT.exports,PG;function Kbe(){return PG||(PG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Zbe,function(n){return n.pad.Iso10126={pad:function(r,i){var o=i*4,l=o-r.sigBytes%o;r.concat(n.lib.WordArray.random(l-1)).concat(n.lib.WordArray.create([l<<24],1))},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Iso10126})}(lT)),lT.exports}var uT={exports:{}},Qbe=uT.exports,HG;function Wbe(){return HG||(HG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Qbe,function(n){return n.pad.Iso97971={pad:function(r,i){r.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(r,i)},unpad:function(r){n.pad.ZeroPadding.unpad(r),r.sigBytes--}},n.pad.Iso97971})}(uT)),uT.exports}var cT={exports:{}},Xbe=cT.exports,jG;function Jbe(){return jG||(jG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(Xbe,function(n){return n.pad.ZeroPadding={pad:function(r,i){var o=i*4;r.clamp(),r.sigBytes+=o-(r.sigBytes%o||o)},unpad:function(r){for(var i=r.words,o=r.sigBytes-1,o=r.sigBytes-1;o>=0;o--)if(i[o>>>2]>>>24-o%4*8&255){r.sigBytes=o+1;break}}},n.pad.ZeroPadding})}(cT)),cT.exports}var fT={exports:{}},e_e=fT.exports,qG;function t_e(){return qG||(qG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(e_e,function(n){return n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding})}(fT)),fT.exports}var dT={exports:{}},n_e=dT.exports,VG;function r_e(){return VG||(VG=1,function(e,t){(function(n,r,i){e.exports=r($n(),ua())})(n_e,function(n){return function(r){var i=n,o=i.lib,l=o.CipherParams,c=i.enc,h=c.Hex,p=i.format;p.Hex={stringify:function(m){return m.ciphertext.toString(h)},parse:function(m){var g=h.parse(m);return l.create({ciphertext:g})}}}(),n.format.Hex})}(dT)),dT.exports}var hT={exports:{}},i_e=hT.exports,GG;function a_e(){return GG||(GG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(i_e,function(n){return function(){var r=n,i=r.lib,o=i.BlockCipher,l=r.algo,c=[],h=[],p=[],m=[],g=[],x=[],S=[],w=[],A=[],E=[];(function(){for(var R=[],M=0;M<256;M++)M<128?R[M]=M<<1:R[M]=M<<1^283;for(var $=0,L=0,M=0;M<256;M++){var U=L^L<<1^L<<2^L<<3^L<<4;U=U>>>8^U&255^99,c[$]=U,h[U]=$;var P=R[$],G=R[P],N=R[G],V=R[U]*257^U*16843008;p[$]=V<<24|V>>>8,m[$]=V<<16|V>>>16,g[$]=V<<8|V>>>24,x[$]=V;var V=N*16843009^G*65537^P*257^$*16843008;S[U]=V<<24|V>>>8,w[U]=V<<16|V>>>16,A[U]=V<<8|V>>>24,E[U]=V,$?($=P^R[R[R[N^P]]],L^=R[R[L]]):$=L=1}})();var k=[0,1,2,4,8,16,32,64,128,27,54],D=l.AES=o.extend({_doReset:function(){var R;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var M=this._keyPriorReset=this._key,$=M.words,L=M.sigBytes/4,U=this._nRounds=L+6,P=(U+1)*4,G=this._keySchedule=[],N=0;N<P;N++)N<L?G[N]=$[N]:(R=G[N-1],N%L?L>6&&N%L==4&&(R=c[R>>>24]<<24|c[R>>>16&255]<<16|c[R>>>8&255]<<8|c[R&255]):(R=R<<8|R>>>24,R=c[R>>>24]<<24|c[R>>>16&255]<<16|c[R>>>8&255]<<8|c[R&255],R^=k[N/L|0]<<24),G[N]=G[N-L]^R);for(var V=this._invKeySchedule=[],W=0;W<P;W++){var N=P-W;if(W%4)var R=G[N];else var R=G[N-4];W<4||N<=4?V[W]=R:V[W]=S[c[R>>>24]]^w[c[R>>>16&255]]^A[c[R>>>8&255]]^E[c[R&255]]}}},encryptBlock:function(R,M){this._doCryptBlock(R,M,this._keySchedule,p,m,g,x,c)},decryptBlock:function(R,M){var $=R[M+1];R[M+1]=R[M+3],R[M+3]=$,this._doCryptBlock(R,M,this._invKeySchedule,S,w,A,E,h);var $=R[M+1];R[M+1]=R[M+3],R[M+3]=$},_doCryptBlock:function(R,M,$,L,U,P,G,N){for(var V=this._nRounds,W=R[M]^$[0],K=R[M+1]^$[1],re=R[M+2]^$[2],le=R[M+3]^$[3],Y=4,ae=1;ae<V;ae++){var te=L[W>>>24]^U[K>>>16&255]^P[re>>>8&255]^G[le&255]^$[Y++],be=L[K>>>24]^U[re>>>16&255]^P[le>>>8&255]^G[W&255]^$[Y++],j=L[re>>>24]^U[le>>>16&255]^P[W>>>8&255]^G[K&255]^$[Y++],ce=L[le>>>24]^U[W>>>16&255]^P[K>>>8&255]^G[re&255]^$[Y++];W=te,K=be,re=j,le=ce}var te=(N[W>>>24]<<24|N[K>>>16&255]<<16|N[re>>>8&255]<<8|N[le&255])^$[Y++],be=(N[K>>>24]<<24|N[re>>>16&255]<<16|N[le>>>8&255]<<8|N[W&255])^$[Y++],j=(N[re>>>24]<<24|N[le>>>16&255]<<16|N[W>>>8&255]<<8|N[K&255])^$[Y++],ce=(N[le>>>24]<<24|N[W>>>16&255]<<16|N[K>>>8&255]<<8|N[re&255])^$[Y++];R[M]=te,R[M+1]=be,R[M+2]=j,R[M+3]=ce},keySize:256/32});r.AES=o._createHelper(D)}(),n.AES})}(hT)),hT.exports}var pT={exports:{}},o_e=pT.exports,YG;function s_e(){return YG||(YG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(o_e,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,l=i.BlockCipher,c=r.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],p=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],m=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],x=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],S=c.DES=l.extend({_doReset:function(){for(var k=this._key,D=k.words,R=[],M=0;M<56;M++){var $=h[M]-1;R[M]=D[$>>>5]>>>31-$%32&1}for(var L=this._subKeys=[],U=0;U<16;U++){for(var P=L[U]=[],G=m[U],M=0;M<24;M++)P[M/6|0]|=R[(p[M]-1+G)%28]<<31-M%6,P[4+(M/6|0)]|=R[28+(p[M+24]-1+G)%28]<<31-M%6;P[0]=P[0]<<1|P[0]>>>31;for(var M=1;M<7;M++)P[M]=P[M]>>>(M-1)*4+3;P[7]=P[7]<<5|P[7]>>>27}for(var N=this._invSubKeys=[],M=0;M<16;M++)N[M]=L[15-M]},encryptBlock:function(k,D){this._doCryptBlock(k,D,this._subKeys)},decryptBlock:function(k,D){this._doCryptBlock(k,D,this._invSubKeys)},_doCryptBlock:function(k,D,R){this._lBlock=k[D],this._rBlock=k[D+1],w.call(this,4,252645135),w.call(this,16,65535),A.call(this,2,858993459),A.call(this,8,16711935),w.call(this,1,1431655765);for(var M=0;M<16;M++){for(var $=R[M],L=this._lBlock,U=this._rBlock,P=0,G=0;G<8;G++)P|=g[G][((U^$[G])&x[G])>>>0];this._lBlock=U,this._rBlock=L^P}var N=this._lBlock;this._lBlock=this._rBlock,this._rBlock=N,w.call(this,1,1431655765),A.call(this,8,16711935),A.call(this,2,858993459),w.call(this,16,65535),w.call(this,4,252645135),k[D]=this._lBlock,k[D+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function w(k,D){var R=(this._lBlock>>>k^this._rBlock)&D;this._rBlock^=R,this._lBlock^=R<<k}function A(k,D){var R=(this._rBlock>>>k^this._lBlock)&D;this._lBlock^=R,this._rBlock^=R<<k}r.DES=l._createHelper(S);var E=c.TripleDES=l.extend({_doReset:function(){var k=this._key,D=k.words;if(D.length!==2&&D.length!==4&&D.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var R=D.slice(0,2),M=D.length<4?D.slice(0,2):D.slice(2,4),$=D.length<6?D.slice(0,2):D.slice(4,6);this._des1=S.createEncryptor(o.create(R)),this._des2=S.createEncryptor(o.create(M)),this._des3=S.createEncryptor(o.create($))},encryptBlock:function(k,D){this._des1.encryptBlock(k,D),this._des2.decryptBlock(k,D),this._des3.encryptBlock(k,D)},decryptBlock:function(k,D){this._des3.decryptBlock(k,D),this._des2.encryptBlock(k,D),this._des1.decryptBlock(k,D)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=l._createHelper(E)}(),n.TripleDES})}(pT)),pT.exports}var mT={exports:{}},l_e=mT.exports,ZG;function u_e(){return ZG||(ZG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(l_e,function(n){return function(){var r=n,i=r.lib,o=i.StreamCipher,l=r.algo,c=l.RC4=o.extend({_doReset:function(){for(var m=this._key,g=m.words,x=m.sigBytes,S=this._S=[],w=0;w<256;w++)S[w]=w;for(var w=0,A=0;w<256;w++){var E=w%x,k=g[E>>>2]>>>24-E%4*8&255;A=(A+S[w]+k)%256;var D=S[w];S[w]=S[A],S[A]=D}this._i=this._j=0},_doProcessBlock:function(m,g){m[g]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var m=this._S,g=this._i,x=this._j,S=0,w=0;w<4;w++){g=(g+1)%256,x=(x+m[g])%256;var A=m[g];m[g]=m[x],m[x]=A,S|=m[(m[g]+m[x])%256]<<24-w*8}return this._i=g,this._j=x,S}r.RC4=o._createHelper(c);var p=l.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var m=this.cfg.drop;m>0;m--)h.call(this)}});r.RC4Drop=o._createHelper(p)}(),n.RC4})}(mT)),mT.exports}var gT={exports:{}},c_e=gT.exports,KG;function f_e(){return KG||(KG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(c_e,function(n){return function(){var r=n,i=r.lib,o=i.StreamCipher,l=r.algo,c=[],h=[],p=[],m=l.Rabbit=o.extend({_doReset:function(){for(var x=this._key.words,S=this.cfg.iv,w=0;w<4;w++)x[w]=(x[w]<<8|x[w]>>>24)&16711935|(x[w]<<24|x[w]>>>8)&4278255360;var A=this._X=[x[0],x[3]<<16|x[2]>>>16,x[1],x[0]<<16|x[3]>>>16,x[2],x[1]<<16|x[0]>>>16,x[3],x[2]<<16|x[1]>>>16],E=this._C=[x[2]<<16|x[2]>>>16,x[0]&4294901760|x[1]&65535,x[3]<<16|x[3]>>>16,x[1]&4294901760|x[2]&65535,x[0]<<16|x[0]>>>16,x[2]&4294901760|x[3]&65535,x[1]<<16|x[1]>>>16,x[3]&4294901760|x[0]&65535];this._b=0;for(var w=0;w<4;w++)g.call(this);for(var w=0;w<8;w++)E[w]^=A[w+4&7];if(S){var k=S.words,D=k[0],R=k[1],M=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,$=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,L=M>>>16|$&4294901760,U=$<<16|M&65535;E[0]^=M,E[1]^=L,E[2]^=$,E[3]^=U,E[4]^=M,E[5]^=L,E[6]^=$,E[7]^=U;for(var w=0;w<4;w++)g.call(this)}},_doProcessBlock:function(x,S){var w=this._X;g.call(this),c[0]=w[0]^w[5]>>>16^w[3]<<16,c[1]=w[2]^w[7]>>>16^w[5]<<16,c[2]=w[4]^w[1]>>>16^w[7]<<16,c[3]=w[6]^w[3]>>>16^w[1]<<16;for(var A=0;A<4;A++)c[A]=(c[A]<<8|c[A]>>>24)&16711935|(c[A]<<24|c[A]>>>8)&4278255360,x[S+A]^=c[A]},blockSize:128/32,ivSize:64/32});function g(){for(var x=this._X,S=this._C,w=0;w<8;w++)h[w]=S[w];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0<h[0]>>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0<h[1]>>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0<h[2]>>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0<h[3]>>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0<h[4]>>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0<h[5]>>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0<h[6]>>>0?1:0)|0,this._b=S[7]>>>0<h[7]>>>0?1:0;for(var w=0;w<8;w++){var A=x[w]+S[w],E=A&65535,k=A>>>16,D=((E*E>>>17)+E*k>>>15)+k*k,R=((A&4294901760)*A|0)+((A&65535)*A|0);p[w]=D^R}x[0]=p[0]+(p[7]<<16|p[7]>>>16)+(p[6]<<16|p[6]>>>16)|0,x[1]=p[1]+(p[0]<<8|p[0]>>>24)+p[7]|0,x[2]=p[2]+(p[1]<<16|p[1]>>>16)+(p[0]<<16|p[0]>>>16)|0,x[3]=p[3]+(p[2]<<8|p[2]>>>24)+p[1]|0,x[4]=p[4]+(p[3]<<16|p[3]>>>16)+(p[2]<<16|p[2]>>>16)|0,x[5]=p[5]+(p[4]<<8|p[4]>>>24)+p[3]|0,x[6]=p[6]+(p[5]<<16|p[5]>>>16)+(p[4]<<16|p[4]>>>16)|0,x[7]=p[7]+(p[6]<<8|p[6]>>>24)+p[5]|0}r.Rabbit=o._createHelper(m)}(),n.Rabbit})}(gT)),gT.exports}var vT={exports:{}},d_e=vT.exports,QG;function h_e(){return QG||(QG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(d_e,function(n){return function(){var r=n,i=r.lib,o=i.StreamCipher,l=r.algo,c=[],h=[],p=[],m=l.RabbitLegacy=o.extend({_doReset:function(){var x=this._key.words,S=this.cfg.iv,w=this._X=[x[0],x[3]<<16|x[2]>>>16,x[1],x[0]<<16|x[3]>>>16,x[2],x[1]<<16|x[0]>>>16,x[3],x[2]<<16|x[1]>>>16],A=this._C=[x[2]<<16|x[2]>>>16,x[0]&4294901760|x[1]&65535,x[3]<<16|x[3]>>>16,x[1]&4294901760|x[2]&65535,x[0]<<16|x[0]>>>16,x[2]&4294901760|x[3]&65535,x[1]<<16|x[1]>>>16,x[3]&4294901760|x[0]&65535];this._b=0;for(var E=0;E<4;E++)g.call(this);for(var E=0;E<8;E++)A[E]^=w[E+4&7];if(S){var k=S.words,D=k[0],R=k[1],M=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,$=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,L=M>>>16|$&4294901760,U=$<<16|M&65535;A[0]^=M,A[1]^=L,A[2]^=$,A[3]^=U,A[4]^=M,A[5]^=L,A[6]^=$,A[7]^=U;for(var E=0;E<4;E++)g.call(this)}},_doProcessBlock:function(x,S){var w=this._X;g.call(this),c[0]=w[0]^w[5]>>>16^w[3]<<16,c[1]=w[2]^w[7]>>>16^w[5]<<16,c[2]=w[4]^w[1]>>>16^w[7]<<16,c[3]=w[6]^w[3]>>>16^w[1]<<16;for(var A=0;A<4;A++)c[A]=(c[A]<<8|c[A]>>>24)&16711935|(c[A]<<24|c[A]>>>8)&4278255360,x[S+A]^=c[A]},blockSize:128/32,ivSize:64/32});function g(){for(var x=this._X,S=this._C,w=0;w<8;w++)h[w]=S[w];S[0]=S[0]+1295307597+this._b|0,S[1]=S[1]+3545052371+(S[0]>>>0<h[0]>>>0?1:0)|0,S[2]=S[2]+886263092+(S[1]>>>0<h[1]>>>0?1:0)|0,S[3]=S[3]+1295307597+(S[2]>>>0<h[2]>>>0?1:0)|0,S[4]=S[4]+3545052371+(S[3]>>>0<h[3]>>>0?1:0)|0,S[5]=S[5]+886263092+(S[4]>>>0<h[4]>>>0?1:0)|0,S[6]=S[6]+1295307597+(S[5]>>>0<h[5]>>>0?1:0)|0,S[7]=S[7]+3545052371+(S[6]>>>0<h[6]>>>0?1:0)|0,this._b=S[7]>>>0<h[7]>>>0?1:0;for(var w=0;w<8;w++){var A=x[w]+S[w],E=A&65535,k=A>>>16,D=((E*E>>>17)+E*k>>>15)+k*k,R=((A&4294901760)*A|0)+((A&65535)*A|0);p[w]=D^R}x[0]=p[0]+(p[7]<<16|p[7]>>>16)+(p[6]<<16|p[6]>>>16)|0,x[1]=p[1]+(p[0]<<8|p[0]>>>24)+p[7]|0,x[2]=p[2]+(p[1]<<16|p[1]>>>16)+(p[0]<<16|p[0]>>>16)|0,x[3]=p[3]+(p[2]<<8|p[2]>>>24)+p[1]|0,x[4]=p[4]+(p[3]<<16|p[3]>>>16)+(p[2]<<16|p[2]>>>16)|0,x[5]=p[5]+(p[4]<<8|p[4]>>>24)+p[3]|0,x[6]=p[6]+(p[5]<<16|p[5]>>>16)+(p[4]<<16|p[4]>>>16)|0,x[7]=p[7]+(p[6]<<8|p[6]>>>24)+p[5]|0}r.RabbitLegacy=o._createHelper(m)}(),n.RabbitLegacy})}(vT)),vT.exports}var yT={exports:{}},p_e=yT.exports,WG;function m_e(){return WG||(WG=1,function(e,t){(function(n,r,i){e.exports=r($n(),Mp(),Bp(),qd(),ua())})(p_e,function(n){return function(){var r=n,i=r.lib,o=i.BlockCipher,l=r.algo;const c=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],p=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var m={pbox:[],sbox:[]};function g(E,k){let D=k>>24&255,R=k>>16&255,M=k>>8&255,$=k&255,L=E.sbox[0][D]+E.sbox[1][R];return L=L^E.sbox[2][M],L=L+E.sbox[3][$],L}function x(E,k,D){let R=k,M=D,$;for(let L=0;L<c;++L)R=R^E.pbox[L],M=g(E,R)^M,$=R,R=M,M=$;return $=R,R=M,M=$,M=M^E.pbox[c],R=R^E.pbox[c+1],{left:R,right:M}}function S(E,k,D){let R=k,M=D,$;for(let L=c+1;L>1;--L)R=R^E.pbox[L],M=g(E,R)^M,$=R,R=M,M=$;return $=R,R=M,M=$,M=M^E.pbox[1],R=R^E.pbox[0],{left:R,right:M}}function w(E,k,D){for(let U=0;U<4;U++){E.sbox[U]=[];for(let P=0;P<256;P++)E.sbox[U][P]=p[U][P]}let R=0;for(let U=0;U<c+2;U++)E.pbox[U]=h[U]^k[R],R++,R>=D&&(R=0);let M=0,$=0,L=0;for(let U=0;U<c+2;U+=2)L=x(E,M,$),M=L.left,$=L.right,E.pbox[U]=M,E.pbox[U+1]=$;for(let U=0;U<4;U++)for(let P=0;P<256;P+=2)L=x(E,M,$),M=L.left,$=L.right,E.sbox[U][P]=M,E.sbox[U][P+1]=$;return!0}var A=l.Blowfish=o.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var E=this._keyPriorReset=this._key,k=E.words,D=E.sigBytes/4;w(m,k,D)}},encryptBlock:function(E,k){var D=x(m,E[k],E[k+1]);E[k]=D.left,E[k+1]=D.right},decryptBlock:function(E,k){var D=S(m,E[k],E[k+1]);E[k]=D.left,E[k+1]=D.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=o._createHelper(A)}(),n.Blowfish})}(yT)),yT.exports}var g_e=L2.exports,XG;function v_e(){return XG||(XG=1,function(e,t){(function(n,r,i){e.exports=r($n(),F2(),hbe(),mbe(),Mp(),ybe(),Bp(),wG(),I6(),wbe(),TG(),Abe(),kbe(),Obe(),$6(),Bbe(),qd(),ua(),Nbe(),Fbe(),Pbe(),jbe(),Vbe(),Ybe(),Kbe(),Wbe(),Jbe(),t_e(),r_e(),a_e(),s_e(),u_e(),f_e(),h_e(),m_e())})(g_e,function(n){return n})}(L2)),L2.exports}var y_e=v_e();const x_e=s4(y_e);class b_e extends $2{constructor(){super(...arguments);Br(this,"platform",di.THE_COLLECTIVE);Br(this,"apiBaseURL",window.location.hostname==="test.thecollective.in"?"https://testapi.thecollective.in/":window.location.hostname==="uat.thecollective.in"?"https://uatapi.thecollective.in/":"https://api.thecollective.in/");Br(this,"defaultHeaders",{"Content-Type":"application/json",securekey:"8837130cc8d08aba14323fbd4714f4aa",authorization:`Bearer ${this.getCookie("DEVELOPMENT_B_TOKEN")}`,Version:"1"})}getCookie(n){var o;const i=`; ${document.cookie}`.split(`; ${n}=`);return i.length===2&&((o=i.pop())==null?void 0:o.split(";").shift())||null}getDeviceType(){const n=this.getCookie("DEVELOPMENT_SOURCE_DEVICE_TYPE");if(n)return n;const r=this.getCookie("DEVELOPMENT_DEVICE_TYPE");return r||"desktop"}generateHash(n){const r=JSON.parse(JSON.stringify(n));return delete r.hash,x_e.MD5(JSON.stringify(r)).toString()}async fetchCart(){try{const n={storeId:0,customerId:parseInt(this.getCookie("DEVELOPMENT_CUSTOMER_ID")||"0"),cartId:parseInt(this.getCookie("DEVELOPMENT_CART_ID")||"0"),page:"cartSummary",device:this.getDeviceType(),shopId:7,shopName:"The Collective",deviceId:this.getCookie("DEVELOPMENT_DEVICE_ID")||"",isS2SCall:!1,deviceType:this.getDeviceType(),brand:"The Collective",geoLocation:-1,fcmToken:-1,deviceToken:this.getCookie("DEVELOPMENT_DEVICE_TOKEN")||""},r=this.generateHash(n),i={...n,hash:r,validateHash:!0},o=await fetch(`${this.apiBaseURL}cart/getCart`,{method:"POST",headers:{...this.defaultHeaders},body:JSON.stringify(i)});if(!o.ok)return this.createErrorResult(`Failed to fetch cart: ${o.status}`);const l=await o.json();if(!l.results||l.results==="")return this.createSuccessResult({items:[],total:0,itemCount:0,currency:"INR",token:""});const c=l.results[0],h=c.products.map(p=>({id:p.id_cart_product,quantity:p.quantity,properties:{size:p.size,color:p.color,brand:p.brand,subbrand:p.subbrand},title:p.name,price:p.unitproductprice,variant_id:p.id_product_attribute}));return this.createSuccessResult({items:h,total:c.totalPrice,itemCount:h.reduce((p,m)=>p+m.quantity,0),currency:"INR",token:l.hash})}catch(n){return this.createErrorResult(n instanceof Error?n.message:"Unknown error")}}async addToCart(n,r=1,i){try{const o=parseInt(n),l=new URLSearchParams;l.append("dbls_order_source","direct_recommendation"),l.append("dbls_session_id",Er()),l.append("dbls_method","add_to_cart"),l.append("utm_source","debales_chatbot");const c={productId:parseInt((i==null?void 0:i.productId)||"0"),productAttributeId:o,size:o,customerId:parseInt(this.getCookie("DEVELOPMENT_CUSTOMER_ID")||"0"),cartId:parseInt(this.getCookie("DEVELOPMENT_CART_ID")||"0"),version:1.2,buyNow:0,quantity:r,oldAttributeId:0,wishlistDeleteFlag:0,cartOperation:"add",storeId:0,utmSource:l.toString(),sliderSource:"",page:"cartSummary",shopId:7,shopName:"The Collective",deviceId:this.getCookie("DEVELOPMENT_DEVICE_ID")||"",isS2SCall:!1,deviceType:this.getDeviceType(),brand:"The Collective",geoLocation:-1,fcmToken:-1,deviceToken:this.getCookie("DEVELOPMENT_DEVICE_TOKEN")||""},h=this.generateHash(c),p={...c,hash:h,validateHash:!0},m=await fetch(`${this.apiBaseURL}cart/addToCart`,{method:"POST",headers:{...this.defaultHeaders},body:JSON.stringify(p)});return m.ok?this.createSuccessResult({},"Item added to cart successfully"):this.createErrorResult(`Failed to add item to cart: ${m.status}`)}catch(o){return this.createErrorResult(o instanceof Error?o.message:"Unknown error")}}async removeFromCart(n){try{const r={customerId:parseInt(this.getCookie("DEVELOPMENT_CUSTOMER_ID")||"0"),cartId:parseInt(this.getCookie("DEVELOPMENT_CART_ID")||"0"),productId:n,storeId:0,productAttributeId:0,device:this.getDeviceType(),shopId:7,shopName:"The Collective",deviceId:this.getCookie("DEVELOPMENT_DEVICE_ID")||"",isS2SCall:!1,deviceType:this.getDeviceType(),brand:"The Collective",geoLocation:-1,fcmToken:-1,deviceToken:this.getCookie("DEVELOPMENT_DEVICE_TOKEN")||""},i=this.generateHash(r),o={...r,hash:i,validateHash:!0},l=await fetch(`${this.apiBaseURL}cart/deleteCartProduct`,{method:"POST",headers:{...this.defaultHeaders},body:JSON.stringify(o)});return l.ok?this.createSuccessResult(void 0,"Item removed from cart successfully"):this.createErrorResult(`Failed to remove item from cart: ${l.status}`)}catch(r){return this.createErrorResult(r instanceof Error?r.message:"Unknown error")}}async updateQuantity(n){try{return console.log("TheCollectiveCartAdapter: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}catch(r){return this.createErrorResult(r instanceof Error?r.message:"Unknown error")}}async clearCart(){try{return console.log("TheCollectiveCartAdapter: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}catch(n){return this.createErrorResult(n instanceof Error?n.message:"Unknown error")}}generateCartUrl(n){const r=F1(n);if(!r.isValid)return"";const i=new URL("/checkoutsummary",r.url);return i.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),i.searchParams.append("attributes[from]","debales-ai-chatbot"),i.searchParams.append("attributes[through]","add-to-cart"),i.searchParams.append("attributes[dbls_session_id]",Er()),i.searchParams.append("timestamp",Date.now().toString()),Yl(i.toString())}generateProductUrl(n,r){const i=new URL(r.link);return i.host=n,Yl(i.toString())}async addCartAttributes(n={}){try{return console.log("TheCollectiveCartAdapter: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}catch(r){return this.createErrorResult(r instanceof Error?r.message:"Unknown error")}}}const $p=class $p{constructor(){Br(this,"adapterCache");this.adapterCache=new Map}static getInstance(){return $p.instance||($p.instance=new $p),$p.instance}getAdapter(t){const n=t||zd.detect(),r=this.adapterCache.get(n);if(r)return r;let i;switch(n){case di.SHOPIFY:i=new obe;break;case di.MAGENTO:i=new sbe;break;case di.THE_COLLECTIVE:i=new b_e;break;default:console.warn(`No specific adapter found for platform ${n}, using default adapter`),i=new abe}return this.adapterCache.set(n,i),i}clearCache(){this.adapterCache.clear()}};Br($p,"instance");let L6=$p;function xT(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}const JG=(e,t)=>{const n=JSON.stringify(t);window.localStorage.setItem(e,n),xT(e,n)},__e=e=>{window.localStorage.removeItem(e),xT(e,null)},eY=e=>window.localStorage.getItem(e),S_e=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),w_e=()=>{throw Error("useLocalStorage is a client-only hook")};function C_e(e,t){const n=()=>eY(e),r=Nt.useSyncExternalStore(S_e,n,w_e),i=Nt.useCallback(o=>{try{const l=typeof o=="function"?o(JSON.parse(r)):o;l==null?__e(e):JG(e,l)}catch(l){console.warn(l)}},[e,r]);return Nt.useEffect(()=>{eY(e)===null&&typeof t<"u"&&JG(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const tY=(e,t)=>{const n=JSON.stringify(t);window.sessionStorage.setItem(e,n),xT(e,n)},E_e=e=>{window.sessionStorage.removeItem(e),xT(e,null)},nY=e=>window.sessionStorage.getItem(e),A_e=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),T_e=()=>{throw Error("useSessionStorage is a client-only hook")};function rY(e,t){const n=()=>nY(e),r=Nt.useSyncExternalStore(A_e,n,T_e),i=Nt.useCallback(o=>{try{const l=typeof o=="function"?o(JSON.parse(r)):o;l==null?E_e(e):tY(e,l)}catch(l){console.warn(l)}},[e,r]);return Nt.useEffect(()=>{nY(e)===null&&typeof t<"u"&&tY(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const k_e=({adapter:e,children:t,botId:n})=>{const[r,i]=ee.useState(!1),[o,l]=ee.useState(null),[c,h]=ee.useState(null),[p,m]=rY(Ir.SHOW_CART_SUMMARY,!He(n||"")),g=ee.useCallback(async()=>{try{i(!0),l(null);const M=await e.fetchCart();if(M.success)return h(M.data),M.data;l(M.error)}catch(M){l(M instanceof Error?M.message:"Failed to fetch cart")}finally{i(!1)}},[e]),x=async(M,$,L)=>{try{l(null);const U=await e.addToCart(M,$,L);if(U.success){const P=await g();return P?{success:!0,data:P,message:U.message}:{success:!1,error:"Failed to fetch updated cart"}}return U}catch(U){return{success:!1,error:U instanceof Error?U.message:"Failed to add item to cart"}}},S=async M=>{try{l(null);const $=await e.removeFromCart(M);return $.success&&await g(),$}catch($){return{success:!1,error:$ instanceof Error?$.message:"Failed to remove item from cart"}}},w=async M=>{try{l(null);const $=await e.updateQuantity(M);return $.success&&await g(),$}catch($){return{success:!1,error:$ instanceof Error?$.message:"Failed to update quantity"}}},A=async()=>{try{l(null);const M=await e.clearCart();return M.success&&await g(),M}catch(M){return{success:!1,error:M instanceof Error?M.message:"Failed to clear cart"}}},E=M=>e.generateCartUrl(M),k=(M,$)=>e.generateProductUrl(M,$),D=async M=>e.addCartAttributes(M);ee.useEffect(()=>{window.DebalesChat&&window.DebalesChat.onOpenChange(M=>{M&&g()})},[g]);const R={isLoading:r,showCartSummery:p,setShowCartSummery:m,error:o,cart:c,fetchCart:g,addToCart:x,removeFromCart:S,updateQuantity:w,clearCart:A,generateCartUrl:E,generateProductUrl:k,addCartAttributes:D};return I.jsx(YU.Provider,{value:R,children:t})},N6={API_ERROR:"api_error",WEBSOCKET_ERROR:"websocket_error",COMPONENT_ERROR:"component_error",STORAGE_ERROR:"storage_error"};function z6(e,t){var n;return{errorType:e,errorMessage:t.message||"Unknown error",errorStack:t.stack,widget_error:!0,botId:(n=window.DebalesChat)==null?void 0:n.projectId,sessionId:Er(),platform:zd.detect(),timestamp:new Date().toISOString(),userAgent:navigator.userAgent}}function D_e(e){if(!e)return;const t={...e};return["password","token","apiKey","secret","userInfo","email","phone","distinctId"].forEach(r=>{t[r]&&(t[r]="[REDACTED]")}),t}function iY(e,t){try{const r={...z6(N6.API_ERROR,e),endpoint:t.endpoint,method:t.method,nameSpace:t.nameSpace,requestPayload:D_e(t.requestPayload),responseStatus:t.responseStatus,responseData:t.responseData,messagesCount:t.messagesCount};fi.captureException(e,r)}catch(n){console.error("Failed to capture API error:",n)}}function O_e(e,t){try{const r={...z6(N6.WEBSOCKET_ERROR,e),socketEvent:t.socketEvent,socketConnected:t.socketConnected,socketData:t.socketData};fi.captureException(e,r)}catch(n){console.error("Failed to capture WebSocket error:",n)}}function R_e(e,t){try{const r={...z6(N6.STORAGE_ERROR,e),operation:t.operation,storageType:t.storageType,dataSize:t.dataSize};fi.captureException(e,r)}catch(n){console.error("Failed to capture storage error:",n)}}const Lp=class Lp{constructor(){Br(this,"socket",null);Br(this,"isConnected",!1);Br(this,"eventListeners",new Map)}static getInstance(){return Lp.instance||(Lp.instance=new Lp),Lp.instance}connect(t){return this.socket?this.socket:(this.socket=H1(`${rN}${t}`,{transports:["websocket"]}),this.socket.on("connect",()=>{this.isConnected=!0,this.emitEvent("connect")}),this.socket.on("disconnect",()=>{this.isConnected=!1,this.emitEvent("disconnect")}),this.socket)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null,this.isConnected=!1,this.eventListeners.clear())}getSocket(){return this.socket}getIsConnected(){return this.isConnected}on(t,n){var r,i;this.eventListeners.has(t)||this.eventListeners.set(t,[]),(r=this.eventListeners.get(t))==null||r.push(n),(i=this.socket)==null||i.on(t,n)}off(t,n){var i;const r=this.eventListeners.get(t);if(r){const o=r.indexOf(n);o>-1&&r.splice(o,1),(i=this.socket)==null||i.off(t,n)}}emit(t,...n){var r;(r=this.socket)==null||r.emit(t,...n)}emitEvent(t,...n){const r=this.eventListeners.get(t);r&&r.forEach(i=>i(...n))}};Br(Lp,"instance");let F6=Lp;const Yu=F6.getInstance(),M_e=e=>{window.DebalesChat||(window.DebalesChat={isOpen:!1,projectId:e,getSessionId:()=>Er(),getChatId:()=>Er()+"_"+e,getAnonId:()=>Nd.getAnonId(),isIdentified:()=>{if(fi._isIdentified())return!0;const t=jl();return!!(t&&t.email)},getIdentifiedUser:()=>jl(),getDistinctId:()=>fi.get_distinct_id(),getOldDistinctId:()=>Nd.getDistinctId(),debug:!1,identify:(t,n)=>{fi._isIdentified()||fi.identify(t,{...n,project:e}),Nd.identify(t,n),Xx({email:t,name:n==null?void 0:n.name,phone:n==null?void 0:n.phone})},track:(t,n)=>{Nd.track(t,{...n,sessionId:Er()}),console.log("posthog",fi),fi.capture(t,{...n}),Jse(t,{...n,sessionId:Er(),projectId:e})},onOpenChange:t=>{const n=r=>{t(r.detail.isOpen)};return window.addEventListener(qa.OPEN_STATE_CHANGE,n),()=>window.removeEventListener(qa.OPEN_STATE_CHANGE,n)},removeOpenChangeListener:t=>{const n=r=>{t(r.detail.isOpen)};window.removeEventListener(qa.OPEN_STATE_CHANGE,n)},open:()=>{window.DebalesChat.isOpen||window.dispatchEvent(new CustomEvent(qa.OPEN_STATE_CHANGE,{detail:{isOpen:!0,projectId:e}}))},close:()=>{window.DebalesChat.isOpen&&window.dispatchEvent(new CustomEvent(qa.OPEN_STATE_CHANGE,{detail:{isOpen:!1,projectId:e}}))},toggle:()=>{window.dispatchEvent(new CustomEvent(qa.OPEN_STATE_CHANGE,{detail:{isOpen:!window.DebalesChat.isOpen,projectId:e}}))}})},aY=()=>{const e=["Ah — I'm stuck on that one right now. Could you try rephrasing it, or ask something else?","Looks like I'm having a bit of trouble with that. Try wording it differently, or send a new question.","Oops, that didn't go through the way I expected. Can you reword it or try a different query?","I'm not able to pull that up at the moment. Want to try asking it another way, or ask a different question?"];return e[Math.floor(Math.random()*e.length)]},B_e=({children:e,nameSpace:t})=>{ee.useEffect(()=>{t&&M_e(t)},[t]);const{fetchCart:n,setShowCartSummery:r}=k1(),[i,o]=ee.useState(""),[l,c]=ee.useState([]),[h,p]=ee.useState(!1),[m,g]=ee.useState(!1),[x,S]=ee.useState([]),[w,A]=ee.useState(!1),[E,k]=ee.useState(!1),[D,R]=ee.useState([]),[M,$]=C_e(Vr(Ir.USER_INFO),null),[L,U]=rY(Vr(Ir.IS_FORM_CLOSED_BY_USER),!1),[P,G]=ee.useState(null),N=og("web-socket"),[V,W]=ee.useState([]),[K,re]=ee.useState(null),[le,Y]=ee.useState(!1),[ae,te]=ee.useState(sessionStorage.getItem(Vr(Ir.LAST_SHOWN_MESSAGE_ID,{botId:t}))),[be,j]=ee.useState(0),ce=ele(),ie=Er(),[q,he]=ee.useState(null),[We,Me]=ee.useState(null);ee.useEffect(()=>{if(N){const ht=Yu.connect("/api/v1/chat");re(ht);const Tt=()=>{console.debug("connected to websocket"),Y(!0)},X=()=>{console.debug("disconnected from websocket"),Y(!1)},ne=Oe=>{console.debug("response from websocket",Oe);const Be=Oe.conversationId??crypto.randomUUID().toString();te(Be),Oe.Variants_quantity&&R(it=>[...it,...Oe.Variants_quantity]);const Ie=[...l,{text:Oe.response,products:Oe.products,conversationId:Be,rating:"neutral",leading_queries:Oe.leading_queries,collections:Oe.collections,variants:Oe.variants,shop:Oe.shop,Variants_quantity:Oe.Variants_quantity,monthlyChatLimitReached:Oe.monthlyChatLimitReached,isBot:!0}];c(Ie),lt(Ie),S(it=>[...it,[l[l.length-1].text,Oe.response]]),g(!1)},ge=Oe=>{if(Oe.event==="error"){O_e(new Error(Oe.message||"WebSocket system error"),{socketEvent:"system_error",socketConnected:le,socketData:Oe});const Be={text:aY(),isBot:!0},Ie=[...l,Be];c(Ie),lt(Ie),g(!1)}};return Yu.on("connect",Tt),Yu.on("disconnect",X),Yu.on("response",ne),Yu.on("system",ge),()=>{Yu.off("connect",Tt),Yu.off("disconnect",X),Yu.off("response",ne),Yu.off("system",ge)}}},[N,l]);const lt=ht=>{try{sessionStorage.setItem(Vr(Ir.CHAT_HISTORY,{botId:window.DebalesChat.projectId}),JSON.stringify(ht))}catch(Tt){R_e(Tt,{operation:"saveConversation",storageType:"sessionStorage",dataSize:JSON.stringify(ht).length})}},Ke=()=>{const ht=sessionStorage.getItem(Vr(Ir.CHAT_HISTORY,{botId:window.DebalesChat.projectId}));return ht?JSON.parse(ht):[]},bt=ee.useCallback(async()=>{if(t)try{p(!0);const ht=await fetch(`${fs}/api/wordpress/UiData?value=${t}`),Tt=await ht.json();if(!ht.ok)throw new Error("failed to fetch data"+Tt.error);const X=document.getElementById("debales-ai-assistant");X&&(X.style.zIndex=String(Tt.zIndex??2031483602)),Me(Tt),Tt!=null&&Tt.shopifyShopDomain&&Che(Tt.shopifyShopDomain).then(ge=>{he(ge)}),W(Tt.suggestedQuestions);const ne=Ke();if(ne.length>0)c(ne);else{const ge={text:Tt.initialMessage||"Hi, I am an AI Assistant. How can I help you?",isBot:!0};c([ge])}}catch(ht){iY(ht,{endpoint:"/api/wordpress/UiData",method:"GET",nameSpace:t}),console.error(ht)}finally{p(!1)}},[t]);ee.useEffect(()=>{bt()},[bt]);const kt=ee.useMemo(()=>{var ht;return!!(!L&&((ht=We==null?void 0:We.pluginConfig)!=null&&ht.collectedUserInfo)&&(We.pluginConfig.collectedUserInfo.name||We.pluginConfig.collectedUserInfo.email||We.pluginConfig.collectedUserInfo.phone)&&!M)},[We,M,L]),Lt=ee.useCallback(async({message:ht,answer:Tt,products:X,fromKlaviyo:ne,leading_queries:ge,followUpQuestion:Oe,messType:Be="other"})=>{if(!ht||ht.trim()===""||m&&!X)return;let Ie=[...l];ne?ne&&l.length<=2?(A(!0),Ie=[]):A(!1):(Ie.push({text:ht,isBot:!1}),A(!1));const it=Er();g(!0);const ct=be+1;j(ct),ct>1&&r(!1);try{c(Ie),lt(Ie);const St=await n(),ye=await fetch(`${fs}/api/wordpress/ChatWithBot`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:it,userMessage:ht,nameSpace:t,chat_history:x,leading_queries:ge,answer:Tt,products:X,userInfo:JSON.stringify(M),anonymousUserId:ce,distinctId:Nd.getDistinctId(),timestamp:new Date().toISOString(),timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,followUpQuestion:Oe,messType:Be,cart:St})});if(!ye.ok)throw new Error("Network response was not ok");const Re=await ye.json(),at=Re.conversationId??crypto.randomUUID().toString();te(at),Re.Variants_quantity&&R($t=>[...$t,...Re.Variants_quantity]);const ft=[...Ie,{text:Re.response,products:Re.products,conversationId:at,rating:"neutral",leading_queries:Re.leading_queries,collections:Re.collections,variants:Re.variants,shop:Re.shop,Variants_quantity:Re.Variants_quantity,monthlyChatLimitReached:Re.monthlyChatLimitReached,isBot:!0}];c(ft),lt(ft),S($t=>[...$t,[ht,Re.response]])}catch(St){const ye=aY();iY(St,{endpoint:"/api/wordpress/ChatWithBot",method:"POST",requestPayload:{sessionId:it,nameSpace:t,errorMessage:ye},messagesCount:l.length}),console.error(St);const Re={text:ye,isBot:!0},at=[...Ie,Re];ne||(c(at),lt(at))}finally{g(!1)}},[l,m,x,t,ce,M,n,r,be]),nt=ee.useCallback(ht=>{We&&Me(Tt=>Tt?{...Tt,mobileDisplayMode:ht}:null)},[We]),ut=ee.useCallback(async({message:ht,answer:Tt,products:X,fromKlaviyo:ne,leading_queries:ge,followUpQuestion:Oe,messType:Be="other"})=>{if(!ht||ht.trim()===""||m&&!X)return;let Ie=[...l];ne?ne&&l.length<=2?(A(!0),Ie=[]):A(!1):(Ie.push({text:ht,isBot:!1}),A(!1)),g(!0),c(Ie),lt(Ie);const it=be+1;j(it),it>1&&r(!1);const ct=await n();if(K&&le){const St={type:pde.MESSAGE,role:mde.USER,query:ht,nameSpace:t,leadingQueries:ge,answer:Tt,products:X,userInfo:M,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),sessionId:ie,anonymousUserId:ce,distinctId:Nd.getDistinctId(),followUpQuestion:Oe,cart:ct};Yu.emit("chat",St)}else Lt({message:ht,answer:Tt,products:X,fromKlaviyo:ne,leading_queries:ge,followUpQuestion:Oe,messType:Be})},[l,m,t,ce,K,le,ie,Lt,M,n,r,be]),_t={nameSpace:t,sessionId:ie,messages:l,isLoading:h,isMessageLoading:m,isKlaviyoMessage:w,showUserInfoModel:E,pendingBulkItems:D,lastedBotmessageId:ae,uiData:We,storeMetaData:q,suggestedQuestions:V,isUserInfoNeeded:kt,input:i,pendingQuestion:P,userInfo:M,isFormClosedByUser:L,onSendMessage:N?ut:Lt,setMessages:c,setIsLoading:p,setIsMessageLoading:g,setIsKlaviyoMessage:A,setShowUserInfoModel:k,setPendingBulkItems:R,setLastedBotmessageId:te,fetchUiInfo:bt,changeDisplayModel:nt,saveConversation:lt,loadConversation:Ke,setSuggestedQuestions:W,setUserInfo:$,setInput:o,setPendingQuestion:G,setIsFormClosedByUser:U};return I.jsx(a5.Provider,{value:_t,children:e})};function I_e(e){const t=L6.getInstance().getAdapter();return ee.useEffect(()=>{fi.set_config({capture_pageview:e.botId!=="burgerbaeclothing",capture_pageleave:e.botId!=="burgerbaeclothing"}),fi.register({platform:zd.detect(),project:e.botId,sessionId:Er()}),fi.group("project",e.botId,{platform:zd.detect()});const n=jl();n!=null&&n.email&&!fi._isIdentified()&&fi.identify(n.email,{name:n.name,phone:n.phone,email:n.email,project:e.botId})},[e.botId]),I.jsx(vce,{client:fi,children:I.jsx(Sce,{additionalProperties:{widget_error:!0,botId:e.botId},children:I.jsx(k_e,{adapter:t,botId:e.botId,children:I.jsx(B_e,{nameSpace:e.botId,children:e.children})})})})}function $_e(e){return I.jsxs(I.Fragment,{children:[I.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),I.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),I.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap",rel:"stylesheet"}),I.jsx(ibe,{children:I.jsx(I_e,{botId:e.botId,children:I.jsx(W1e,{...e})})})]})}return $_e});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@debales/ai",
3
3
  "private": false,
4
4
  "access": "public",
5
- "version": "1.2.5",
5
+ "version": "1.2.6",
6
6
  "type": "module",
7
7
  "main": "./dist/module/ai.js",
8
8
  "types": "./dist/module/index.d.ts",
@@ -59,9 +59,9 @@
59
59
  "typescript-eslint": "^8.24.1",
60
60
  "vite": "^6.2.0",
61
61
  "vite-plugin-dts": "^4.5.3",
62
- "@debales/eslint-config": "0.0.0",
62
+ "@debales/typescript-config": "0.0.0",
63
63
  "@debales/shared": "0.0.1",
64
- "@debales/typescript-config": "0.0.0"
64
+ "@debales/eslint-config": "0.0.0"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "react": "^18.0.0 || ^19.0.0",