@debales/ai 1.1.53 → 1.1.54
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/browser/ai-browser.js +16 -16
- package/dist/module/ai.js +2 -2
- package/dist/module/ai.umd.js +2 -2
- package/package.json +1 -1
package/dist/module/ai.js
CHANGED
|
@@ -42110,7 +42110,7 @@ const xde = oe.button`
|
|
|
42110
42110
|
]);
|
|
42111
42111
|
const Wr = () => {
|
|
42112
42112
|
const we = window.location.href;
|
|
42113
|
-
return !!(we.includes("letsgo.catch.org") && we.includes("/courses"));
|
|
42113
|
+
return !!((we.includes("letsgo.catch.org") || we.includes("inventive-s-school.thinkific.com")) && we.includes("/courses"));
|
|
42114
42114
|
};
|
|
42115
42115
|
return !t || t.show_bot === !1 || o || Wr() ? null : /* @__PURE__ */ M.jsxs(xk, { theme: Yk(t, e), children: [
|
|
42116
42116
|
/* @__PURE__ */ M.jsx("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }),
|
|
@@ -75094,7 +75094,7 @@ const fN = "debales-ai-assistant", dN = "debales-chatbot-container", Upe = xG(
|
|
|
75094
75094
|
const S = document.createElement("div");
|
|
75095
75095
|
S.id = dN, S.style.cssText = "position: absolute; top: 0; left: 0; width: 0; height: 0;", x.appendChild(S), d(S), r && r(x, S);
|
|
75096
75096
|
}
|
|
75097
|
-
}, [t, r]), en(() => (l && !p.current && (p.current = Fpe.createRoot(l)), p.current && l && p.current.render(
|
|
75097
|
+
}, [t, r]), en(() => (l && !p.current && (p.current = Fpe.createRoot(l)), p.current && l && window.self === window.top && p.current.render(
|
|
75098
75098
|
/* @__PURE__ */ M.jsx(SG, { target: l, children: /* @__PURE__ */ M.jsx(Sq, { value: v.current, children: e }) })
|
|
75099
75099
|
), () => {
|
|
75100
75100
|
p.current && p.current.unmount();
|
package/dist/module/ai.umd.js
CHANGED
|
@@ -2509,7 +2509,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2509
2509
|
|
|
2510
2510
|
`+se+`
|
|
2511
2511
|
|
|
2512
|
-
=> User Action: Klaviyo form closed`}return""},Ee=j=>{j instanceof CustomEvent&&Ce(j)};return window.addEventListener("klaviyoForms",Ee),()=>{window.removeEventListener("klaviyoForms",Ee)}},[Oe,t,r]);const[na,ya]=ee.useState(!1),Jr=re==="Highest"?"120px":re==="Higher"?"60px":"15px",fr=async()=>{if(Re){console.warn("Support request called while already in support mode");return}try{const Ce=await fetch(`${ea}/api/wordpress/support`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({chatid:Kn()+e,nameSpace:e,userName:xt.name,userEmail:xt.email,userMessage:xt.message,tag:"support"})});if(Ce.ok){const oe=await Ce.json(),{contactId:Ee,ticketId:j}=oe;if(Ee&&j){const se=gp.connect(`${_7}/api/v1/live-agent`);if(!se){console.error("Failed to create support socket connection"),y(yn=>[...yn,{text:"Sorry, we couldn't establish a connection to support. Please try again.",isBot:!0,conversationId:`support-error-${Date.now()}`}]);return}se.emit("join_ticket_conversation",{ticketID:j,role:"contact",contactID:Ee,nameSpace:e});const me=yn=>{console.log("Joined support conversation:",yn),y(Gt=>[...Gt,{text:"You are now connected to live support. A support agent will join shortly.",isBot:!0,conversationId:`support-live-${Date.now()}`}])},xe=yn=>{console.log("Received conversation history:",yn.length,"messages")},Ve=yn=>{console.log("Support agent joined:",yn),y(Gt=>[...Gt,{text:"A support agent has joined the conversation. You can now chat directly with them.",isBot:!0,conversationId:`agent-joined-${Date.now()}`}])},Et=yn=>{console.log("New support message:",yn),y(Gt=>[...Gt,{text:yn.text||yn.content,isBot:!0,conversationId:`support-msg-${Date.now()}`}])},en=()=>{console.log("Support connection disconnected"),y(yn=>[...yn,{text:"Support connection has ended. You can continue chatting with me or request support again.",isBot:!0,conversationId:`support-end-${Date.now()}`}]),nt(!1)};se.on("joined_ticket_conversation",me),se.on("conversation_history",xe),se.on("participant_joined",Ve),se.on("message",Et),se.on("disconnect",en),ke(se),nt(!0);const Kt=()=>{se.off("joined_ticket_conversation",me),se.off("conversation_history",xe),se.off("participant_joined",Ve),se.off("new_message",Et),se.off("disconnect",en)};se.cleanupHandlers=Kt}const Q=`support-confirm-${Date.now()}`;y(se=>[...se,{text:"Thanks for reaching out! Our support team has received your request and will get back to you within 24 hours.<br>In the meantime, feel free to continue chatting with me - I'll do my best to help!",isBot:!0,leading_queries:Dt,conversationId:Q}]),d(Q),ve(se=>({...se,leadingQueries:!0})),te([]),console.log("Connected to support with existing user info:",Da())}else{const oe=await Ce.json();console.error("Failed to connect to support:",oe),y(Ee=>[...Ee,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}}catch{y(oe=>[...oe,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}},wi=()=>{if(we(e)){const j=pp("https://test.thecollective.in/content/customersupport");j.isValid&&(t!=null&&t.shopifyShopDomain&&(j.url.hostname=t==null?void 0:t.shopifyShopDomain),window.open(ms(j.url.toString()),"_blank"));return}if(Re){console.warn("Already in support mode");return}const Ce=Da();let oe=[];const Ee=h[h.length-1];Ee!=null&&Ee.leading_queries&&Ee.leading_queries.length>0?oe=Ee.leading_queries:h.length<=1&&(oe=St.flatMap(j=>Array.isArray(j)?j.map(Q=>Q.question):[j.question]).slice(0,4)),te(oe),Ce&&Ce.name&&Ce.email&&mt({name:Ce==null?void 0:Ce.name,email:Ce==null?void 0:Ce.email,message:""}),y(j=>[...j,{text:"Please provide your name, email and message to connect with support.",isBot:!0}]),_t(!0)},Nr=async Ce=>{Ce.preventDefault();const oe={name:"",email:"",message:""};let Ee=!0;const j=xt.name.trim(),Q=xt.message.trim();j||(oe.name="Name cannot be empty or just whitespace.",Ee=!1),(!xt.email||!rm.isEmail(xt.email))&&(oe.email="Please enter a valid email address.",Ee=!1),Q||(oe.message="Message cannot be empty or just whitespace.",Ee=!1),Se(oe),Ee&&(qc({name:j,email:xt.email}),_t(!1),y(se=>se.slice(0,-1)),await fr())};st.useEffect(()=>{if(h.length===1&&h[0].isBot){ot(oe=>({...oe,leadingQueries:!0}));const Ce=setTimeout(()=>{ot(oe=>({...oe,leadingQueries:!1}))},2e3);return()=>clearTimeout(Ce)}},[h]),st.useEffect(()=>()=>{Ie&&(Ie.cleanupHandlers&&Ie.cleanupHandlers(),gp.disconnect(),ke(null),nt(!1))},[Ie]);const Er=()=>{gp.emit("send_message",{content:"The Contact has left the conversation.",type:"text",timestamp:new Date().toISOString()}),gp.emit("leave_conversation",{role:"contact"}),Ie&&(Ie.cleanupHandlers&&Ie.cleanupHandlers(),gp.disconnect(),ke(null),nt(!1),y(Ce=>[...Ce,{text:"You have exited live support mode. You can continue chatting with me or request support again.",isBot:!0,conversationId:`support-exit-${Date.now()}`}]))},qi=Ce=>{if(!Re){console.warn("Attempted to send support message when not in support mode");return}if(!gp.getIsConnected()){console.error("Support socket is not connected"),y(oe=>[...oe,{text:"Connection lost. Please wait while we reconnect you to support.",isBot:!0,conversationId:`support-error-${Date.now()}`}]);return}gp.emit("send_message",{content:Ce,type:"text",timestamp:new Date().toISOString()}),y(oe=>[...oe,{text:Ce,isBot:!1,conversationId:`support-user-${Date.now()}`}])};ee.useEffect(()=>{console.log(I,l,h,vt.cartSummary,K)},[I,l,vt.cartSummary,K,h]);const ei=()=>{const Ce=window.location.href;return!!(Ce.includes("letsgo.catch.org")&&Ce.includes("/courses"))};return!t||t.show_bot===!1||o||ei()?null:R.jsxs(J.ThemeProvider,{theme:uC(t,e),children:[R.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),R.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),R.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"}),R.jsx(sfe,{}),!ge&&(Jn==null?void 0:Jn.length)!==0&&R.jsx(ofe,{className:Je?"visible":"",$botId:e,$iconSize:z,$removeLogoBackground:t.removeLogoBackground,topOffset:Jr,style:{right:W?"auto":"24px",left:W?"24px":"auto",display:"flex",flexDirection:"column",alignItems:W?"flex-start":"flex-end"},children:Fe.suggestions?R.jsx(Mi,{isBot:!0,children:R.jsx(vs,{loading:Fe.suggestions})}):Jn.map((Ce,oe)=>{if(Array.isArray(Ce)){const Ee=Ce.map(j=>({question:j.question,isHighlighted:j.isHighlighted??!1})).filter(j=>!Qe.has(j.question));return R.jsx(LU,{$index:oe,$totalCount:Jn.length,children:R.jsx(Due,{messages:Ee,botId:e,uiData:t,onClick:j=>{const Q=Ce.find(se=>se.question===j);Ye(!0,"suggested_question_clicked"),Le(se=>{const me=new Set(se);return me.add(j),me}),window.DebalesChat.track(Zt.SUGGESTED_QUESTION_CLICKED,{suggested_question:Q}),!D&&Q?(Ut(!1),Ht(!0),r({message:Q.Follow_up_Question??Q.question,answer:Q==null?void 0:Q.answer,products:Q==null?void 0:Q.products,fromKlaviyo:!1,leading_queries:Q==null?void 0:Q.leading_queries,followUpQuestion:Q==null?void 0:Q.Follow_up_Question,messType:"suggested_question"})):(Ut(!1),Ht(!0),T(!0),O(Q))}})},oe)}else return R.jsx(LU,{$index:oe,$totalCount:Jn.length,children:R.jsx(Tue,{value:`${Ce.question}`,index:oe,botId:e,uiData:t,onClose:()=>{Le(Ee=>{const j=new Set(Ee);return j.add(Ce.question),j})},onClick:()=>{Ye(!0,"suggested_question_clicked"),Le(Ee=>{const j=new Set(Ee);return j.add(Ce.question),j}),window.DebalesChat.track(Zt.SUGGESTED_QUESTION_CLICKED,{suggested_question:Ce}),D?(Ut(!1),Ht(!0),T(!0),O(Ce)):(Ut(!1),Ht(!0),r({message:Ce.question,answer:Ce.answer,products:Ce.products,leading_queries:Ce.leading_queries,followUpQuestion:Ce.Follow_up_Question,messType:"suggested_question"}))},isHighlighted:Ce.isHighlighted??!1})},oe)})}),R.jsxs(Gce,{$topOffset:Jr,$removeLogoBackground:t.removeLogoBackground,style:{display:ge?"none":"inline-flex",right:W?"auto":"24px",left:W?"24px":"auto"},children:[R.jsx(Vce,{$showAnimation:t.enableChatButtonBackgroundAnimation??!1,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",$backgroundColor:t.backgroundColor||"#fff",$removeLogoBackground:t.removeLogoBackground,$topOffset:Jr,$iconSize:z}),R.jsx(Yce,{$backgroundColor:t.removeLogoBackground?"transparent":t.backgroundColor||"#fff",$botId:e,$iconSize:z,$removeLogoBackground:t.removeLogoBackground,topOffset:Jr,$showAnimation:t.enableChatButtonBackgroundAnimation,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",id:"debales-chat-button","data-testid":"debales-chat-button",onClick:()=>{if(window.DebalesChat.track(Zt.CHAT_BUTTON_CLICKED),Ye(!ge,"chat_button_clicked"),!ge){const Ce=S();Ce.length>0?(y(Ce),Ut(!1),Ht(!0)):(Ut(!0),Ht(!1),ot(oe=>({...oe,initialMessage:!0,leadingQueries:!0})),ve({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1}),setTimeout(()=>{Ut(!1),Ht(!0),ot(Ee=>({...Ee,initialMessage:!1}));const oe={text:(t==null?void 0:t.initialMessage)||"Hi, I am an AI chatbot, how can I help you today?",isBot:!0};y([oe]),ot(Ee=>({...Ee,leadingQueries:!0})),setTimeout(()=>{ve(Ee=>({...Ee,leadingQueries:!0}))},Pn)},Pn))}},"aria-label":"Chat",style:{display:ge?"none":"inline-flex",right:W?"auto":"24px",left:W?"24px":"auto"},children:R.jsx(Zce,{$botId:e,$removeLogoBackground:t.removeLogoBackground,"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"})})]}),ge&&pa.createPortal(R.jsx(R.Fragment,{children:R.jsxs(Xce,{$backgroundColor:t.backgroundColor||"#fff",$fullScreenOnMobile:t.fullScreenOnMobile,$headerFontColor:t.headerFontColor||"#1C1C1C",$isLeft:W,$topOffset:Jr,$mobileDisplayMode:t.mobileDisplayMode,$isVisible:fe,"data-testid":"debales-chat-container",children:[R.jsxs(efe,{$backgroundColor:we(e)?t.backgroundColor:t.botBackgroundColor||"#fff",style:{color:t.headerFontColor},children:[R.jsx("div",{style:{flexGrow:.1,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",marginRight:"8px",gap:"10px"},children:we(e)?R.jsxs(R.Fragment,{children:[R.jsx(MU,{"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"}),we(e)?R.jsx("div",{children:R.jsx("img",{src:gA,alt:"Chat Bot Icon",style:{height:"36px"}})}):R.jsxs(Qce,{$botNameColor:t.headerFontColor,children:[R.jsxs("div",{style:{fontWeight:"700",wordBreak:"break-word"},children:[t.chatbotName,e==="catch-org-ai"&&R.jsx(EA,{children:"Beta"})]}),R.jsx(Kce,{})]})]}):R.jsx(Wce,{children:R.jsxs(Jce,{children:[R.jsx(MU,{src:t.bot_logo,alt:"Chat Bot Icon"}),R.jsx("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",maxWidth:"22ch"},children:t.chatbotName})]})})}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginLeft:"auto",flexShrink:0},children:[Re&&R.jsxs("div",{style:{background:"#4CAF50",color:"white",padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500",display:"flex",alignItems:"center",gap:"4px"},children:[R.jsx("span",{style:{fontSize:"8px"},children:"●"}),"Live Support",R.jsx("button",{onClick:Er,style:{background:"none",border:"none",color:"white",cursor:"pointer",fontSize:"12px",marginLeft:"4px",padding:"2px 4px",borderRadius:"4px"},title:"Exit Support",children:"✕"})]}),R.jsx(AA,{handleSupportClick:wi,isSupportMode:Re}),R.jsx(a1,{onClick:()=>{bt?Gn(!0):Ye(!1,"close_button_clicked")},id:"debales-minimize-button","data-testid":"debales-minimize-button","aria-label":"Minimize",children:R.jsx(hm,{botNameColor:t.headerFontColor})})]}),R.jsx(pfe,{$backgroundColor:t.botBackgroundColor||"#fff",style:{opacity:ct?1:0}})]}),R.jsxs(rfe,{$backgroundColor:t.botBackgroundColor||"#fff",$mobileDisplayMode:t.mobileDisplayMode,children:[na&&((ti=(et=t.pluginConfig)==null?void 0:et.collectedUserInfo)==null?void 0:ti.discount)&&R.jsx(LA,{discount:t.pluginConfig.collectedUserInfo.discount,uiData:t,onClose:()=>{ya(!1),window.DebalesChat.track(Zt.DISCOUNT_VIEWED,{discount:t.pluginConfig.collectedUserInfo.discount})}}),R.jsx(CA,{}),R.jsx(jA,{uidata:t,product:qt,showModel:Cr,setShowModel:ta,onVariantSelect:Ce=>{console.debug("VariantSelectionModel : Adding item to cart:",Ce),N(Ce.id,1,{productId:(qt==null?void 0:qt.productId)||""}),G(!0),window.DebalesChat.track(Zt.ADD_TO_CART_CLICKED,{product:Ce.title,price:Number(Ce.price),link:`https://${t.shopifyShopDomain}/variants/${Ce.id}`,message:l,chatId:Kn()+e})},botId:e}),an&&R.jsx(NA,{setShowExitModal:Gn,handleCloseChatbot:Vn,chatId:Kn()+e}),R.jsxs(tfe,{id:"debales-conversation-group",$botBackgroundColor:t.botBackgroundColor||"#fff",ref:F,$mobileDisplayMode:t.mobileDisplayMode,"data-testid":"debales-conversation-group",children:[R.jsx(dfe,{$backgroundColor:t.botBackgroundColor||"#fff",style:{opacity:ct?1:0}}),R.jsxs(nfe,{children:[Mt&&h.map((Ce,oe)=>{const Ee=Ce.isBot,j=up(Ce.text);return Ce.hideConfirmation?null:R.jsxs(st.Fragment,{children:[Ee&&R.jsxs(RU,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff","data-testid":"debales-ai-message-container",children:[R.jsx("img",{src:Ee?t.bot_logo:t.userMessage_logo,alt:"Chat User Icon",style:{marginLeft:"8px"}}),R.jsxs($U,{children:[j.map(Q=>R.jsx("div",{children:R.jsx(Mi,{isBot:Ee,children:R.jsx(ud,{components:{a:({href:se,children:me})=>{const xe=()=>{se!=null&&se.startsWith("https://shop.catch.org/")&&window.DebalesChat.track(Zt.SHOPIFY_LINK_CLICKED)};return R.jsx("a",{href:se,target:"_blank",onClick:xe,children:me})}},remarkPlugins:[QS,dC],children:Q})})})),Ce.collections&&(we(e)?l===Ce.conversationId?vt.collections:!0:l===Ce.conversationId&&vt.collections)&&R.jsx(IA,{message:Ce,botId:e,uidata:t,onSendMessage:r,loading:p}),Ce.products&&(we(e)?l===Ce.conversationId?vt.products:!0:l===Ce.conversationId&&vt.products)&&R.jsx(FA,{message:Ce,botId:e,uidata:t,onSendMessage:r,loading:p,storeMetaData:n,platform:Y,setShowVariantModel:ta,setSelectedProduct:Lr}),a&&R.jsx(S6,{children:R.jsx(t1,{onClick:()=>{window._klOnsite&&(window._klOnsite.push(["openForm",he]),Ye(!1,"klaviyo_grab_deal_button"))},children:"🚀 Grab Deal Now!"})}),I&&I.itemCount>0&&l===Ce.conversationId&&vt.cartSummary&&K&&R.jsx(OA,{onCheckout:Go,onKeepShopping:()=>{G(!1)}}),gt&>.length>0&&l===Ce.conversationId&&vt.bulkItems&&R.jsx(hA,{onClick:()=>Ka(Ce.conversationId),children:"Add Bulk Items to Cart"}),A&&h.indexOf(Ce)===h.length-1&&R.jsx(R.Fragment,{children:R.jsx(UA,{setShowModel:Q=>{var me,xe;const se=typeof Q=="function"?Q(A):Q;T(se),!se&&((xe=(me=t.pluginConfig)==null?void 0:me.collectedUserInfo)!=null&&xe.discount)&&ya(!0)},inChat:!0,showFormInstructions:!1})}),at&&h.indexOf(Ce)===h.length-1&&R.jsxs(lfe,{onSubmit:Nr,noValidate:!0,"data-testid":"debales-support-form",children:[we(e)?R.jsxs(R.Fragment,{children:[R.jsx(Gl,{label:"Name",name:"name",type:"text",value:xt.name,onChange:Q=>mt(se=>({...se,name:Q.target.value})),required:!0,error:ie.name,isCollectiveBot:!0}),R.jsx(Gl,{label:"Email",name:"email",type:"email",value:xt.email,onChange:Q=>mt(se=>({...se,email:Q.target.value})),required:!0,error:ie.email,isCollectiveBot:!0}),R.jsx(zA,{label:"Message",name:"message",value:xt.message,onChange:Q=>mt(se=>({...se,message:Q.target.value})),required:!0,error:ie.message,rows:4,isCollectiveBot:!0})]}):R.jsxs(R.Fragment,{children:[R.jsxs(w6,{children:[R.jsxs(C6,{children:["Name",R.jsx("span",{children:"*"})]}),R.jsx(NU,{type:"text",required:!0,value:xt.name,onChange:Q=>mt(se=>({...se,name:Q.target.value})),placeholder:"John"}),ie.name&&R.jsx("p",{style:{color:"red",fontSize:"12px",margin:"4px 0 0"},children:ie.name})]}),R.jsxs(w6,{children:[R.jsxs(C6,{children:["Email",R.jsx("span",{children:"*"})]}),R.jsx(NU,{type:"email",required:!0,value:xt.email,onChange:Q=>mt(se=>({...se,email:Q.target.value})),placeholder:"olivia@untitledui.com"}),ie.email&&R.jsx("p",{style:{color:"red",fontSize:"12px",margin:"4px 0 0"},children:ie.email})]}),R.jsxs(w6,{children:[R.jsxs(C6,{children:["Message",R.jsx("span",{children:"*"})]}),R.jsx(ufe,{required:!0,value:xt.message,onChange:Q=>mt(se=>({...se,message:Q.target.value})),placeholder:"I need help with..."}),ie.message&&R.jsx("p",{style:{color:"red",fontSize:"12px",margin:"4px 0 0"},children:ie.message})]})]}),R.jsx(ffe,{children:R.jsx(cfe,{type:"submit",children:"Submit"})})]}),dt&&!p&&l===Ce.conversationId&&R.jsx(Mi,{isBot:Ee,children:R.jsx(vs,{loading:dt})})]})]}),!Ee&&R.jsx(ife,{$fontColor:t.userFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:R.jsx(Mi,{isBot:!!Ee,children:R.jsx(ud,{children:Ce.text})})}),h.length==1&&oe==0&&!A&&R.jsx(S6,{children:Fe.leadingQueries?R.jsx(Mi,{isBot:Ee??!0,children:R.jsx(vs,{loading:Fe.leadingQueries})}):St.map(Q=>Array.isArray(Q)?Q[0]:Q).map((Q,se)=>R.jsxs(BU,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor},onClick:()=>{D?(T(!0),O({question:Q.question,answer:Q.answer,products:Q.products,path:"/",nameSpace:window.DebalesChat.projectId})):(Ut(!1),Ht(!0),r({message:Q.question,answer:Q.answer,products:Q.products,leading_queries:Q.leading_queries,followUpQuestion:Q.Follow_up_Question,messType:"leading_query"})),Le(me=>{const xe=new Set(me);return xe.add(Q.question),xe}),window.DebalesChat.track(Zt.INITIAL_LEADING_QUERY_SUGGESTED_QUESTION_CLICKED,{question:Q.question})},disabled:p,$disabled:p,children:[Q.question,R.jsx(IU,{color:t.callToActionFontColor})]},se))}),Ce.leading_queries&&Ce.leading_queries.length>0&&l===Ce.conversationId&&vt.leadingQueries&&!a&&!A&&R.jsx(S6,{children:Ce.leading_queries.map((Q,se)=>R.jsxs(BU,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor},onClick:()=>{D?(T(!0),O({question:Q,path:"/",nameSpace:window.DebalesChat.projectId})):r({message:Q,messType:"leading_query"}),window.DebalesChat.track(Zt.LEADING_QUERY_CLICKED,{query:Q})},disabled:p,$disabled:p,children:[Q,R.jsx(IU,{color:t.callToActionFontColor})]},se))})]},oe)}),(p||rn)&&!Re&&R.jsxs(RU,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:[R.jsx("img",{src:t.bot_logo,alt:"Chat User Icon"}),R.jsx($U,{children:R.jsx(Mi,{isBot:!0,children:R.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px",animation:"fadeIn 0.3s ease-in-out"},children:R.jsx(vs,{loading:p||rn})})})})]})]}),R.jsx(hfe,{$backgroundColor:t.botBackgroundColor||"#fff",style:{opacity:gr?1:0}})]}),R.jsxs("div",{className:"debales-footer-container",style:{width:"calc(100%-24px)",backgroundColor:t.botBackgroundColor||"#fff",color:t.fontColor||"#000"},children:[R.jsx($A,{}),R.jsx("div",{children:R.jsx(HA,{disabled:p,inputState:!1,isInSupportMode:Re,onSupportMessage:qi})}),R.jsx(BA,{})]})]})]})}),ae.shadowRoot)]})},gfe=J.p`
|
|
2512
|
+
=> User Action: Klaviyo form closed`}return""},Ee=j=>{j instanceof CustomEvent&&Ce(j)};return window.addEventListener("klaviyoForms",Ee),()=>{window.removeEventListener("klaviyoForms",Ee)}},[Oe,t,r]);const[na,ya]=ee.useState(!1),Jr=re==="Highest"?"120px":re==="Higher"?"60px":"15px",fr=async()=>{if(Re){console.warn("Support request called while already in support mode");return}try{const Ce=await fetch(`${ea}/api/wordpress/support`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({chatid:Kn()+e,nameSpace:e,userName:xt.name,userEmail:xt.email,userMessage:xt.message,tag:"support"})});if(Ce.ok){const oe=await Ce.json(),{contactId:Ee,ticketId:j}=oe;if(Ee&&j){const se=gp.connect(`${_7}/api/v1/live-agent`);if(!se){console.error("Failed to create support socket connection"),y(yn=>[...yn,{text:"Sorry, we couldn't establish a connection to support. Please try again.",isBot:!0,conversationId:`support-error-${Date.now()}`}]);return}se.emit("join_ticket_conversation",{ticketID:j,role:"contact",contactID:Ee,nameSpace:e});const me=yn=>{console.log("Joined support conversation:",yn),y(Gt=>[...Gt,{text:"You are now connected to live support. A support agent will join shortly.",isBot:!0,conversationId:`support-live-${Date.now()}`}])},xe=yn=>{console.log("Received conversation history:",yn.length,"messages")},Ve=yn=>{console.log("Support agent joined:",yn),y(Gt=>[...Gt,{text:"A support agent has joined the conversation. You can now chat directly with them.",isBot:!0,conversationId:`agent-joined-${Date.now()}`}])},Et=yn=>{console.log("New support message:",yn),y(Gt=>[...Gt,{text:yn.text||yn.content,isBot:!0,conversationId:`support-msg-${Date.now()}`}])},en=()=>{console.log("Support connection disconnected"),y(yn=>[...yn,{text:"Support connection has ended. You can continue chatting with me or request support again.",isBot:!0,conversationId:`support-end-${Date.now()}`}]),nt(!1)};se.on("joined_ticket_conversation",me),se.on("conversation_history",xe),se.on("participant_joined",Ve),se.on("message",Et),se.on("disconnect",en),ke(se),nt(!0);const Kt=()=>{se.off("joined_ticket_conversation",me),se.off("conversation_history",xe),se.off("participant_joined",Ve),se.off("new_message",Et),se.off("disconnect",en)};se.cleanupHandlers=Kt}const Q=`support-confirm-${Date.now()}`;y(se=>[...se,{text:"Thanks for reaching out! Our support team has received your request and will get back to you within 24 hours.<br>In the meantime, feel free to continue chatting with me - I'll do my best to help!",isBot:!0,leading_queries:Dt,conversationId:Q}]),d(Q),ve(se=>({...se,leadingQueries:!0})),te([]),console.log("Connected to support with existing user info:",Da())}else{const oe=await Ce.json();console.error("Failed to connect to support:",oe),y(Ee=>[...Ee,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}}catch{y(oe=>[...oe,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}},wi=()=>{if(we(e)){const j=pp("https://test.thecollective.in/content/customersupport");j.isValid&&(t!=null&&t.shopifyShopDomain&&(j.url.hostname=t==null?void 0:t.shopifyShopDomain),window.open(ms(j.url.toString()),"_blank"));return}if(Re){console.warn("Already in support mode");return}const Ce=Da();let oe=[];const Ee=h[h.length-1];Ee!=null&&Ee.leading_queries&&Ee.leading_queries.length>0?oe=Ee.leading_queries:h.length<=1&&(oe=St.flatMap(j=>Array.isArray(j)?j.map(Q=>Q.question):[j.question]).slice(0,4)),te(oe),Ce&&Ce.name&&Ce.email&&mt({name:Ce==null?void 0:Ce.name,email:Ce==null?void 0:Ce.email,message:""}),y(j=>[...j,{text:"Please provide your name, email and message to connect with support.",isBot:!0}]),_t(!0)},Nr=async Ce=>{Ce.preventDefault();const oe={name:"",email:"",message:""};let Ee=!0;const j=xt.name.trim(),Q=xt.message.trim();j||(oe.name="Name cannot be empty or just whitespace.",Ee=!1),(!xt.email||!rm.isEmail(xt.email))&&(oe.email="Please enter a valid email address.",Ee=!1),Q||(oe.message="Message cannot be empty or just whitespace.",Ee=!1),Se(oe),Ee&&(qc({name:j,email:xt.email}),_t(!1),y(se=>se.slice(0,-1)),await fr())};st.useEffect(()=>{if(h.length===1&&h[0].isBot){ot(oe=>({...oe,leadingQueries:!0}));const Ce=setTimeout(()=>{ot(oe=>({...oe,leadingQueries:!1}))},2e3);return()=>clearTimeout(Ce)}},[h]),st.useEffect(()=>()=>{Ie&&(Ie.cleanupHandlers&&Ie.cleanupHandlers(),gp.disconnect(),ke(null),nt(!1))},[Ie]);const Er=()=>{gp.emit("send_message",{content:"The Contact has left the conversation.",type:"text",timestamp:new Date().toISOString()}),gp.emit("leave_conversation",{role:"contact"}),Ie&&(Ie.cleanupHandlers&&Ie.cleanupHandlers(),gp.disconnect(),ke(null),nt(!1),y(Ce=>[...Ce,{text:"You have exited live support mode. You can continue chatting with me or request support again.",isBot:!0,conversationId:`support-exit-${Date.now()}`}]))},qi=Ce=>{if(!Re){console.warn("Attempted to send support message when not in support mode");return}if(!gp.getIsConnected()){console.error("Support socket is not connected"),y(oe=>[...oe,{text:"Connection lost. Please wait while we reconnect you to support.",isBot:!0,conversationId:`support-error-${Date.now()}`}]);return}gp.emit("send_message",{content:Ce,type:"text",timestamp:new Date().toISOString()}),y(oe=>[...oe,{text:Ce,isBot:!1,conversationId:`support-user-${Date.now()}`}])};ee.useEffect(()=>{console.log(I,l,h,vt.cartSummary,K)},[I,l,vt.cartSummary,K,h]);const ei=()=>{const Ce=window.location.href;return!!((Ce.includes("letsgo.catch.org")||Ce.includes("inventive-s-school.thinkific.com"))&&Ce.includes("/courses"))};return!t||t.show_bot===!1||o||ei()?null:R.jsxs(J.ThemeProvider,{theme:uC(t,e),children:[R.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),R.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),R.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"}),R.jsx(sfe,{}),!ge&&(Jn==null?void 0:Jn.length)!==0&&R.jsx(ofe,{className:Je?"visible":"",$botId:e,$iconSize:z,$removeLogoBackground:t.removeLogoBackground,topOffset:Jr,style:{right:W?"auto":"24px",left:W?"24px":"auto",display:"flex",flexDirection:"column",alignItems:W?"flex-start":"flex-end"},children:Fe.suggestions?R.jsx(Mi,{isBot:!0,children:R.jsx(vs,{loading:Fe.suggestions})}):Jn.map((Ce,oe)=>{if(Array.isArray(Ce)){const Ee=Ce.map(j=>({question:j.question,isHighlighted:j.isHighlighted??!1})).filter(j=>!Qe.has(j.question));return R.jsx(LU,{$index:oe,$totalCount:Jn.length,children:R.jsx(Due,{messages:Ee,botId:e,uiData:t,onClick:j=>{const Q=Ce.find(se=>se.question===j);Ye(!0,"suggested_question_clicked"),Le(se=>{const me=new Set(se);return me.add(j),me}),window.DebalesChat.track(Zt.SUGGESTED_QUESTION_CLICKED,{suggested_question:Q}),!D&&Q?(Ut(!1),Ht(!0),r({message:Q.Follow_up_Question??Q.question,answer:Q==null?void 0:Q.answer,products:Q==null?void 0:Q.products,fromKlaviyo:!1,leading_queries:Q==null?void 0:Q.leading_queries,followUpQuestion:Q==null?void 0:Q.Follow_up_Question,messType:"suggested_question"})):(Ut(!1),Ht(!0),T(!0),O(Q))}})},oe)}else return R.jsx(LU,{$index:oe,$totalCount:Jn.length,children:R.jsx(Tue,{value:`${Ce.question}`,index:oe,botId:e,uiData:t,onClose:()=>{Le(Ee=>{const j=new Set(Ee);return j.add(Ce.question),j})},onClick:()=>{Ye(!0,"suggested_question_clicked"),Le(Ee=>{const j=new Set(Ee);return j.add(Ce.question),j}),window.DebalesChat.track(Zt.SUGGESTED_QUESTION_CLICKED,{suggested_question:Ce}),D?(Ut(!1),Ht(!0),T(!0),O(Ce)):(Ut(!1),Ht(!0),r({message:Ce.question,answer:Ce.answer,products:Ce.products,leading_queries:Ce.leading_queries,followUpQuestion:Ce.Follow_up_Question,messType:"suggested_question"}))},isHighlighted:Ce.isHighlighted??!1})},oe)})}),R.jsxs(Gce,{$topOffset:Jr,$removeLogoBackground:t.removeLogoBackground,style:{display:ge?"none":"inline-flex",right:W?"auto":"24px",left:W?"24px":"auto"},children:[R.jsx(Vce,{$showAnimation:t.enableChatButtonBackgroundAnimation??!1,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",$backgroundColor:t.backgroundColor||"#fff",$removeLogoBackground:t.removeLogoBackground,$topOffset:Jr,$iconSize:z}),R.jsx(Yce,{$backgroundColor:t.removeLogoBackground?"transparent":t.backgroundColor||"#fff",$botId:e,$iconSize:z,$removeLogoBackground:t.removeLogoBackground,topOffset:Jr,$showAnimation:t.enableChatButtonBackgroundAnimation,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",id:"debales-chat-button","data-testid":"debales-chat-button",onClick:()=>{if(window.DebalesChat.track(Zt.CHAT_BUTTON_CLICKED),Ye(!ge,"chat_button_clicked"),!ge){const Ce=S();Ce.length>0?(y(Ce),Ut(!1),Ht(!0)):(Ut(!0),Ht(!1),ot(oe=>({...oe,initialMessage:!0,leadingQueries:!0})),ve({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1}),setTimeout(()=>{Ut(!1),Ht(!0),ot(Ee=>({...Ee,initialMessage:!1}));const oe={text:(t==null?void 0:t.initialMessage)||"Hi, I am an AI chatbot, how can I help you today?",isBot:!0};y([oe]),ot(Ee=>({...Ee,leadingQueries:!0})),setTimeout(()=>{ve(Ee=>({...Ee,leadingQueries:!0}))},Pn)},Pn))}},"aria-label":"Chat",style:{display:ge?"none":"inline-flex",right:W?"auto":"24px",left:W?"24px":"auto"},children:R.jsx(Zce,{$botId:e,$removeLogoBackground:t.removeLogoBackground,"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"})})]}),ge&&pa.createPortal(R.jsx(R.Fragment,{children:R.jsxs(Xce,{$backgroundColor:t.backgroundColor||"#fff",$fullScreenOnMobile:t.fullScreenOnMobile,$headerFontColor:t.headerFontColor||"#1C1C1C",$isLeft:W,$topOffset:Jr,$mobileDisplayMode:t.mobileDisplayMode,$isVisible:fe,"data-testid":"debales-chat-container",children:[R.jsxs(efe,{$backgroundColor:we(e)?t.backgroundColor:t.botBackgroundColor||"#fff",style:{color:t.headerFontColor},children:[R.jsx("div",{style:{flexGrow:.1,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",marginRight:"8px",gap:"10px"},children:we(e)?R.jsxs(R.Fragment,{children:[R.jsx(MU,{"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"}),we(e)?R.jsx("div",{children:R.jsx("img",{src:gA,alt:"Chat Bot Icon",style:{height:"36px"}})}):R.jsxs(Qce,{$botNameColor:t.headerFontColor,children:[R.jsxs("div",{style:{fontWeight:"700",wordBreak:"break-word"},children:[t.chatbotName,e==="catch-org-ai"&&R.jsx(EA,{children:"Beta"})]}),R.jsx(Kce,{})]})]}):R.jsx(Wce,{children:R.jsxs(Jce,{children:[R.jsx(MU,{src:t.bot_logo,alt:"Chat Bot Icon"}),R.jsx("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",maxWidth:"22ch"},children:t.chatbotName})]})})}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginLeft:"auto",flexShrink:0},children:[Re&&R.jsxs("div",{style:{background:"#4CAF50",color:"white",padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500",display:"flex",alignItems:"center",gap:"4px"},children:[R.jsx("span",{style:{fontSize:"8px"},children:"●"}),"Live Support",R.jsx("button",{onClick:Er,style:{background:"none",border:"none",color:"white",cursor:"pointer",fontSize:"12px",marginLeft:"4px",padding:"2px 4px",borderRadius:"4px"},title:"Exit Support",children:"✕"})]}),R.jsx(AA,{handleSupportClick:wi,isSupportMode:Re}),R.jsx(a1,{onClick:()=>{bt?Gn(!0):Ye(!1,"close_button_clicked")},id:"debales-minimize-button","data-testid":"debales-minimize-button","aria-label":"Minimize",children:R.jsx(hm,{botNameColor:t.headerFontColor})})]}),R.jsx(pfe,{$backgroundColor:t.botBackgroundColor||"#fff",style:{opacity:ct?1:0}})]}),R.jsxs(rfe,{$backgroundColor:t.botBackgroundColor||"#fff",$mobileDisplayMode:t.mobileDisplayMode,children:[na&&((ti=(et=t.pluginConfig)==null?void 0:et.collectedUserInfo)==null?void 0:ti.discount)&&R.jsx(LA,{discount:t.pluginConfig.collectedUserInfo.discount,uiData:t,onClose:()=>{ya(!1),window.DebalesChat.track(Zt.DISCOUNT_VIEWED,{discount:t.pluginConfig.collectedUserInfo.discount})}}),R.jsx(CA,{}),R.jsx(jA,{uidata:t,product:qt,showModel:Cr,setShowModel:ta,onVariantSelect:Ce=>{console.debug("VariantSelectionModel : Adding item to cart:",Ce),N(Ce.id,1,{productId:(qt==null?void 0:qt.productId)||""}),G(!0),window.DebalesChat.track(Zt.ADD_TO_CART_CLICKED,{product:Ce.title,price:Number(Ce.price),link:`https://${t.shopifyShopDomain}/variants/${Ce.id}`,message:l,chatId:Kn()+e})},botId:e}),an&&R.jsx(NA,{setShowExitModal:Gn,handleCloseChatbot:Vn,chatId:Kn()+e}),R.jsxs(tfe,{id:"debales-conversation-group",$botBackgroundColor:t.botBackgroundColor||"#fff",ref:F,$mobileDisplayMode:t.mobileDisplayMode,"data-testid":"debales-conversation-group",children:[R.jsx(dfe,{$backgroundColor:t.botBackgroundColor||"#fff",style:{opacity:ct?1:0}}),R.jsxs(nfe,{children:[Mt&&h.map((Ce,oe)=>{const Ee=Ce.isBot,j=up(Ce.text);return Ce.hideConfirmation?null:R.jsxs(st.Fragment,{children:[Ee&&R.jsxs(RU,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff","data-testid":"debales-ai-message-container",children:[R.jsx("img",{src:Ee?t.bot_logo:t.userMessage_logo,alt:"Chat User Icon",style:{marginLeft:"8px"}}),R.jsxs($U,{children:[j.map(Q=>R.jsx("div",{children:R.jsx(Mi,{isBot:Ee,children:R.jsx(ud,{components:{a:({href:se,children:me})=>{const xe=()=>{se!=null&&se.startsWith("https://shop.catch.org/")&&window.DebalesChat.track(Zt.SHOPIFY_LINK_CLICKED)};return R.jsx("a",{href:se,target:"_blank",onClick:xe,children:me})}},remarkPlugins:[QS,dC],children:Q})})})),Ce.collections&&(we(e)?l===Ce.conversationId?vt.collections:!0:l===Ce.conversationId&&vt.collections)&&R.jsx(IA,{message:Ce,botId:e,uidata:t,onSendMessage:r,loading:p}),Ce.products&&(we(e)?l===Ce.conversationId?vt.products:!0:l===Ce.conversationId&&vt.products)&&R.jsx(FA,{message:Ce,botId:e,uidata:t,onSendMessage:r,loading:p,storeMetaData:n,platform:Y,setShowVariantModel:ta,setSelectedProduct:Lr}),a&&R.jsx(S6,{children:R.jsx(t1,{onClick:()=>{window._klOnsite&&(window._klOnsite.push(["openForm",he]),Ye(!1,"klaviyo_grab_deal_button"))},children:"🚀 Grab Deal Now!"})}),I&&I.itemCount>0&&l===Ce.conversationId&&vt.cartSummary&&K&&R.jsx(OA,{onCheckout:Go,onKeepShopping:()=>{G(!1)}}),gt&>.length>0&&l===Ce.conversationId&&vt.bulkItems&&R.jsx(hA,{onClick:()=>Ka(Ce.conversationId),children:"Add Bulk Items to Cart"}),A&&h.indexOf(Ce)===h.length-1&&R.jsx(R.Fragment,{children:R.jsx(UA,{setShowModel:Q=>{var me,xe;const se=typeof Q=="function"?Q(A):Q;T(se),!se&&((xe=(me=t.pluginConfig)==null?void 0:me.collectedUserInfo)!=null&&xe.discount)&&ya(!0)},inChat:!0,showFormInstructions:!1})}),at&&h.indexOf(Ce)===h.length-1&&R.jsxs(lfe,{onSubmit:Nr,noValidate:!0,"data-testid":"debales-support-form",children:[we(e)?R.jsxs(R.Fragment,{children:[R.jsx(Gl,{label:"Name",name:"name",type:"text",value:xt.name,onChange:Q=>mt(se=>({...se,name:Q.target.value})),required:!0,error:ie.name,isCollectiveBot:!0}),R.jsx(Gl,{label:"Email",name:"email",type:"email",value:xt.email,onChange:Q=>mt(se=>({...se,email:Q.target.value})),required:!0,error:ie.email,isCollectiveBot:!0}),R.jsx(zA,{label:"Message",name:"message",value:xt.message,onChange:Q=>mt(se=>({...se,message:Q.target.value})),required:!0,error:ie.message,rows:4,isCollectiveBot:!0})]}):R.jsxs(R.Fragment,{children:[R.jsxs(w6,{children:[R.jsxs(C6,{children:["Name",R.jsx("span",{children:"*"})]}),R.jsx(NU,{type:"text",required:!0,value:xt.name,onChange:Q=>mt(se=>({...se,name:Q.target.value})),placeholder:"John"}),ie.name&&R.jsx("p",{style:{color:"red",fontSize:"12px",margin:"4px 0 0"},children:ie.name})]}),R.jsxs(w6,{children:[R.jsxs(C6,{children:["Email",R.jsx("span",{children:"*"})]}),R.jsx(NU,{type:"email",required:!0,value:xt.email,onChange:Q=>mt(se=>({...se,email:Q.target.value})),placeholder:"olivia@untitledui.com"}),ie.email&&R.jsx("p",{style:{color:"red",fontSize:"12px",margin:"4px 0 0"},children:ie.email})]}),R.jsxs(w6,{children:[R.jsxs(C6,{children:["Message",R.jsx("span",{children:"*"})]}),R.jsx(ufe,{required:!0,value:xt.message,onChange:Q=>mt(se=>({...se,message:Q.target.value})),placeholder:"I need help with..."}),ie.message&&R.jsx("p",{style:{color:"red",fontSize:"12px",margin:"4px 0 0"},children:ie.message})]})]}),R.jsx(ffe,{children:R.jsx(cfe,{type:"submit",children:"Submit"})})]}),dt&&!p&&l===Ce.conversationId&&R.jsx(Mi,{isBot:Ee,children:R.jsx(vs,{loading:dt})})]})]}),!Ee&&R.jsx(ife,{$fontColor:t.userFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:R.jsx(Mi,{isBot:!!Ee,children:R.jsx(ud,{children:Ce.text})})}),h.length==1&&oe==0&&!A&&R.jsx(S6,{children:Fe.leadingQueries?R.jsx(Mi,{isBot:Ee??!0,children:R.jsx(vs,{loading:Fe.leadingQueries})}):St.map(Q=>Array.isArray(Q)?Q[0]:Q).map((Q,se)=>R.jsxs(BU,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor},onClick:()=>{D?(T(!0),O({question:Q.question,answer:Q.answer,products:Q.products,path:"/",nameSpace:window.DebalesChat.projectId})):(Ut(!1),Ht(!0),r({message:Q.question,answer:Q.answer,products:Q.products,leading_queries:Q.leading_queries,followUpQuestion:Q.Follow_up_Question,messType:"leading_query"})),Le(me=>{const xe=new Set(me);return xe.add(Q.question),xe}),window.DebalesChat.track(Zt.INITIAL_LEADING_QUERY_SUGGESTED_QUESTION_CLICKED,{question:Q.question})},disabled:p,$disabled:p,children:[Q.question,R.jsx(IU,{color:t.callToActionFontColor})]},se))}),Ce.leading_queries&&Ce.leading_queries.length>0&&l===Ce.conversationId&&vt.leadingQueries&&!a&&!A&&R.jsx(S6,{children:Ce.leading_queries.map((Q,se)=>R.jsxs(BU,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor},onClick:()=>{D?(T(!0),O({question:Q,path:"/",nameSpace:window.DebalesChat.projectId})):r({message:Q,messType:"leading_query"}),window.DebalesChat.track(Zt.LEADING_QUERY_CLICKED,{query:Q})},disabled:p,$disabled:p,children:[Q,R.jsx(IU,{color:t.callToActionFontColor})]},se))})]},oe)}),(p||rn)&&!Re&&R.jsxs(RU,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:[R.jsx("img",{src:t.bot_logo,alt:"Chat User Icon"}),R.jsx($U,{children:R.jsx(Mi,{isBot:!0,children:R.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px",animation:"fadeIn 0.3s ease-in-out"},children:R.jsx(vs,{loading:p||rn})})})})]})]}),R.jsx(hfe,{$backgroundColor:t.botBackgroundColor||"#fff",style:{opacity:gr?1:0}})]}),R.jsxs("div",{className:"debales-footer-container",style:{width:"calc(100%-24px)",backgroundColor:t.botBackgroundColor||"#fff",color:t.fontColor||"#000"},children:[R.jsx($A,{}),R.jsx("div",{children:R.jsx(HA,{disabled:p,inputState:!1,isInSupportMode:Re,onSupportMessage:qi})}),R.jsx(BA,{})]})]})]})}),ae.shadowRoot)]})},gfe=J.p`
|
|
2513
2513
|
margin: 0;
|
|
2514
2514
|
font-size: ${e=>e.theme.typography.fontSizes.lg};
|
|
2515
2515
|
text-align: left;
|
|
@@ -4712,7 +4712,7 @@ Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map=="funct
|
|
|
4712
4712
|
You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}g1.createRoot=function(i,s){if(!A(i))throw Error("Target container is not a DOM element.");_k(i);var c=!1,m="",_=J1,w=K2,B=Gm,L=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===mc&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
|
|
4713
4713
|
|
|
4714
4714
|
let root = createRoot(domContainer);
|
|
4715
|
-
root.render(<App />);`),s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(B=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(L=s.unstable_transitionCallbacks)),s=Qb(i,1,!1,null,null,c,m,_,w,B,L,null),i[_c]=s.current,Mb(i),new zv(s)},g1.hydrateRoot=function(i,s,c){if(!A(i))throw Error("Target container is not a DOM element.");_k(i),s===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var m=!1,_="",w=J1,B=K2,L=Gm,X=null,ne=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(B=c.onCaughtError),c.onRecoverableError!==void 0&&(L=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(X=c.unstable_transitionCallbacks),c.formState!==void 0&&(ne=c.formState)),s=Qb(i,1,!0,s,c??null,m,_,w,B,L,X,ne),s.context=Kb(null),c=s.current,m=io(c),m=Fe(m),_=Js(m),_.callback=null,ws(c,_,m),c=m,s.current.lanes=c,nt(s,c),ns(s),i[_c]=s.current,Mb(i),new b0(s)},g1.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),g1}var fj;function lhe(){if(fj)return qA.exports;fj=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(),qA.exports=ohe()):qA.exports=she(),qA.exports}var uhe=lhe();const dj="debales-ai-assistant",hj="debales-chatbot-container",che=ee.forwardRef(({children:e,globalStyles:t="",containerStyles:n={},onReady:r},a)=>{const o=ee.useRef(null),[l,d]=ee.useState(null),h=ee.useRef(null),p=ee.useRef(null),v=ee.useRef({get shadowRoot(){return h.current},get container(){return l},querySelector:y=>{var x;return((x=h.current)==null?void 0:x.querySelector(y))||null},querySelectorAll:y=>{var x;return((x=h.current)==null?void 0:x.querySelectorAll(y))||null}});return ee.useImperativeHandle(a,()=>v.current,[]),ee.useEffect(()=>{const y=document.getElementById(dj);if(y?o.current=y:o.current&&(o.current.id=dj),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 C=h.current.querySelector(`#${hj}`);C&&d(C);return}const x=o.current.attachShadow({mode:"open"});if(h.current=x,t){const C=document.createElement("style");C.textContent=t,x.appendChild(C)}const S=document.createElement("div");S.id=hj,S.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;",x.appendChild(S),d(S),r&&r(x,S)}},[t,r]),ee.useEffect(()=>(l&&!p.current&&(p.current=uhe.createRoot(l)),p.current&&l&&p.current.render(R.jsx(J.StyleSheetManager,{target:l,children:R.jsx(gF,{value:v.current,children:e})})),()=>{p.current&&p.current.unmount()}),[l,e]),R.jsx("div",{ref:o,style:n})});class GA{isSupported(){return Zc.detect()===this.platform}createSuccessResult(t,n){return{success:!0,data:t,message:n}}createErrorResult(t){return{success:!1,error:t}}}class fhe extends GA{constructor(){super(...arguments);Yr(this,"platform",Si.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,a){return console.log("DefaultCartAdapter: addToCart called",{variantId:n,quantity:r,properties:a}),this.createSuccessResult(void 0,"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 a=new URL(`https://${n}/products/${r.handle}`);return a.searchParams.append("variant",r.product_id),ms(a.toString())}else return ms(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}class dhe extends GA{constructor(){var n,r;super();Yr(this,"platform",Si.SHOPIFY);Yr(this,"cartEndpoint");Yr(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 a=ZD(n);if(!a.isValid)return"";if(r.handle){const o=new URL(`/products/${r.handle}`,a.url);return o.searchParams.append("variant",r.product_id),ms(o.toString())}else return ms(r.link)}updateTrackCart({cartToken:n,sessionId:r=Kn()}){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 a=r;return this.createSuccessResult(this.normalizeCartData(a),"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,a){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:a}],attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:Kn(),dbls_method:"add_to_cart"}})}),l=await o.json();if(!o.ok){const d=l;return this.createErrorResult(d.description||`Failed to add item to cart: ${o.status}`)}return this.fetchCart().then(d=>{d.success&&this.updateTrackCart({cartToken:d==null?void 0:d.data.token})}),this.createSuccessResult(void 0,`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})}),a=await r.json();if(!r.ok){const o=a;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:Kn(),...n}})});if(!r.ok){const a=await r.json();return this.createErrorResult(a.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=ZD(n);if(!r.isValid)return"";const a=new URL("/cart",r.url);return a.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),a.searchParams.append("attributes[from]","debales-ai-chatbot"),a.searchParams.append("attributes[through]","add-to-cart"),a.searchParams.append("attributes[dbls_session_id]",Kn()),a.searchParams.append("timestamp",Date.now().toString()),ms(a.toString())}}class hhe extends GA{constructor(){var n,r;super();Yr(this,"platform",Si.MAGENTO);Yr(this,"checkoutEndpoint");Yr(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 a=r.cart;return this.createSuccessResult(this.normalizeCartData(a),"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 a;try{const o=(a=document.querySelector('input[name="form_key"]'))==null?void 0:a.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"],d=>d.reload(["cart"],!0))}catch(d){console.warn("Failed to reload cart data:",d)}return this.createSuccessResult(void 0,`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 a=ZD(n);if(!a.isValid)return"";if(r.handle){const o=new URL(`/${r.handle}.html`,a.url);return ms(o.toString())}else return ms(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}var VA={exports:{}};function phe(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 YA={exports:{}};const ghe=nP(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var mhe=YA.exports,pj;function qn(){return pj||(pj=1,function(e,t){(function(n,r){e.exports=r()})(mhe,function(){var n=n||function(r,a){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 m4<"u"&&m4.crypto&&(o=m4.crypto),!o&&typeof phe=="function")try{o=ghe}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.")},d=Object.create||function(){function D(){}return function(O){var I;return D.prototype=O,I=new D,D.prototype=null,I}}(),h={},p=h.lib={},v=p.Base=function(){return{extend:function(D){var O=d(this);return D&&O.mixIn(D),(!O.hasOwnProperty("init")||this.init===O.init)&&(O.init=function(){O.$super.init.apply(this,arguments)}),O.init.prototype=O,O.$super=this,O},create:function(){var D=this.extend();return D.init.apply(D,arguments),D},init:function(){},mixIn:function(D){for(var O in D)D.hasOwnProperty(O)&&(this[O]=D[O]);D.hasOwnProperty("toString")&&(this.toString=D.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),y=p.WordArray=v.extend({init:function(D,O){D=this.words=D||[],O!=a?this.sigBytes=O:this.sigBytes=D.length*4},toString:function(D){return(D||S).stringify(this)},concat:function(D){var O=this.words,I=D.words,N=this.sigBytes,$=D.sigBytes;if(this.clamp(),N%4)for(var P=0;P<$;P++){var G=I[P>>>2]>>>24-P%4*8&255;O[N+P>>>2]|=G<<24-(N+P)%4*8}else for(var K=0;K<$;K+=4)O[N+K>>>2]=I[K>>>2];return this.sigBytes+=$,this},clamp:function(){var D=this.words,O=this.sigBytes;D[O>>>2]&=4294967295<<32-O%4*8,D.length=r.ceil(O/4)},clone:function(){var D=v.clone.call(this);return D.words=this.words.slice(0),D},random:function(D){for(var O=[],I=0;I<D;I+=4)O.push(l());return new y.init(O,D)}}),x=h.enc={},S=x.Hex={stringify:function(D){for(var O=D.words,I=D.sigBytes,N=[],$=0;$<I;$++){var P=O[$>>>2]>>>24-$%4*8&255;N.push((P>>>4).toString(16)),N.push((P&15).toString(16))}return N.join("")},parse:function(D){for(var O=D.length,I=[],N=0;N<O;N+=2)I[N>>>3]|=parseInt(D.substr(N,2),16)<<24-N%8*4;return new y.init(I,O/2)}},C=x.Latin1={stringify:function(D){for(var O=D.words,I=D.sigBytes,N=[],$=0;$<I;$++){var P=O[$>>>2]>>>24-$%4*8&255;N.push(String.fromCharCode(P))}return N.join("")},parse:function(D){for(var O=D.length,I=[],N=0;N<O;N++)I[N>>>2]|=(D.charCodeAt(N)&255)<<24-N%4*8;return new y.init(I,O)}},k=x.Utf8={stringify:function(D){try{return decodeURIComponent(escape(C.stringify(D)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(D){return C.parse(unescape(encodeURIComponent(D)))}},A=p.BufferedBlockAlgorithm=v.extend({reset:function(){this._data=new y.init,this._nDataBytes=0},_append:function(D){typeof D=="string"&&(D=k.parse(D)),this._data.concat(D),this._nDataBytes+=D.sigBytes},_process:function(D){var O,I=this._data,N=I.words,$=I.sigBytes,P=this.blockSize,G=P*4,K=$/G;D?K=r.ceil(K):K=r.max((K|0)-this._minBufferSize,0);var z=K*P,Y=r.min(z*4,$);if(z){for(var W=0;W<z;W+=P)this._doProcessBlock(N,W);O=N.splice(0,z),I.sigBytes-=Y}return new y.init(O,Y)},clone:function(){var D=v.clone.call(this);return D._data=this._data.clone(),D},_minBufferSize:0});p.Hasher=A.extend({cfg:v.extend(),init:function(D){this.cfg=this.cfg.extend(D),this.reset()},reset:function(){A.reset.call(this),this._doReset()},update:function(D){return this._append(D),this._process(),this},finalize:function(D){D&&this._append(D);var O=this._doFinalize();return O},blockSize:16,_createHelper:function(D){return function(O,I){return new D.init(I).finalize(O)}},_createHmacHelper:function(D){return function(O,I){return new T.HMAC.init(D,I).finalize(O)}}});var T=h.algo={};return h}(Math);return n})}(YA)),YA.exports}var ZA={exports:{}},vhe=ZA.exports,gj;function QA(){return gj||(gj=1,function(e,t){(function(n,r){e.exports=r(qn())})(vhe,function(n){return function(r){var a=n,o=a.lib,l=o.Base,d=o.WordArray,h=a.x64={};h.Word=l.extend({init:function(p,v){this.high=p,this.low=v}}),h.WordArray=l.extend({init:function(p,v){p=this.words=p||[],v!=r?this.sigBytes=v:this.sigBytes=p.length*8},toX32:function(){for(var p=this.words,v=p.length,y=[],x=0;x<v;x++){var S=p[x];y.push(S.high),y.push(S.low)}return d.create(y,this.sigBytes)},clone:function(){for(var p=l.clone.call(this),v=p.words=this.words.slice(0),y=v.length,x=0;x<y;x++)v[x]=v[x].clone();return p}})}(),n})}(ZA)),ZA.exports}var KA={exports:{}},yhe=KA.exports,mj;function xhe(){return mj||(mj=1,function(e,t){(function(n,r){e.exports=r(qn())})(yhe,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,a=r.lib,o=a.WordArray,l=o.init,d=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,v=[],y=0;y<p;y++)v[y>>>2]|=h[y]<<24-y%4*8;l.call(this,v,p)}else l.apply(this,arguments)};d.prototype=o}}(),n.lib.WordArray})}(KA)),KA.exports}var XA={exports:{}},bhe=XA.exports,vj;function _he(){return vj||(vj=1,function(e,t){(function(n,r){e.exports=r(qn())})(bhe,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.enc;l.Utf16=l.Utf16BE={stringify:function(h){for(var p=h.words,v=h.sigBytes,y=[],x=0;x<v;x+=2){var S=p[x>>>2]>>>16-x%4*8&65535;y.push(String.fromCharCode(S))}return y.join("")},parse:function(h){for(var p=h.length,v=[],y=0;y<p;y++)v[y>>>1]|=h.charCodeAt(y)<<16-y%2*16;return o.create(v,p*2)}},l.Utf16LE={stringify:function(h){for(var p=h.words,v=h.sigBytes,y=[],x=0;x<v;x+=2){var S=d(p[x>>>2]>>>16-x%4*8&65535);y.push(String.fromCharCode(S))}return y.join("")},parse:function(h){for(var p=h.length,v=[],y=0;y<p;y++)v[y>>>1]|=d(h.charCodeAt(y)<<16-y%2*16);return o.create(v,p*2)}};function d(h){return h<<8&4278255360|h>>>8&16711935}}(),n.enc.Utf16})}(XA)),XA.exports}var WA={exports:{}},She=WA.exports,yj;function vp(){return yj||(yj=1,function(e,t){(function(n,r){e.exports=r(qn())})(She,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.enc;l.Base64={stringify:function(h){var p=h.words,v=h.sigBytes,y=this._map;h.clamp();for(var x=[],S=0;S<v;S+=3)for(var C=p[S>>>2]>>>24-S%4*8&255,k=p[S+1>>>2]>>>24-(S+1)%4*8&255,A=p[S+2>>>2]>>>24-(S+2)%4*8&255,T=C<<16|k<<8|A,D=0;D<4&&S+D*.75<v;D++)x.push(y.charAt(T>>>6*(3-D)&63));var O=y.charAt(64);if(O)for(;x.length%4;)x.push(O);return x.join("")},parse:function(h){var p=h.length,v=this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var x=0;x<v.length;x++)y[v.charCodeAt(x)]=x}var S=v.charAt(64);if(S){var C=h.indexOf(S);C!==-1&&(p=C)}return d(h,p,y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function d(h,p,v){for(var y=[],x=0,S=0;S<p;S++)if(S%4){var C=v[h.charCodeAt(S-1)]<<S%4*2,k=v[h.charCodeAt(S)]>>>6-S%4*2,A=C|k;y[x>>>2]|=A<<24-x%4*8,x++}return o.create(y,x)}}(),n.enc.Base64})}(WA)),WA.exports}var JA={exports:{}},whe=JA.exports,xj;function Che(){return xj||(xj=1,function(e,t){(function(n,r){e.exports=r(qn())})(whe,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.enc;l.Base64url={stringify:function(h,p){p===void 0&&(p=!0);var v=h.words,y=h.sigBytes,x=p?this._safe_map:this._map;h.clamp();for(var S=[],C=0;C<y;C+=3)for(var k=v[C>>>2]>>>24-C%4*8&255,A=v[C+1>>>2]>>>24-(C+1)%4*8&255,T=v[C+2>>>2]>>>24-(C+2)%4*8&255,D=k<<16|A<<8|T,O=0;O<4&&C+O*.75<y;O++)S.push(x.charAt(D>>>6*(3-O)&63));var I=x.charAt(64);if(I)for(;S.length%4;)S.push(I);return S.join("")},parse:function(h,p){p===void 0&&(p=!0);var v=h.length,y=p?this._safe_map:this._map,x=this._reverseMap;if(!x){x=this._reverseMap=[];for(var S=0;S<y.length;S++)x[y.charCodeAt(S)]=S}var C=y.charAt(64);if(C){var k=h.indexOf(C);k!==-1&&(v=k)}return d(h,v,x)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function d(h,p,v){for(var y=[],x=0,S=0;S<p;S++)if(S%4){var C=v[h.charCodeAt(S-1)]<<S%4*2,k=v[h.charCodeAt(S)]>>>6-S%4*2,A=C|k;y[x>>>2]|=A<<24-x%4*8,x++}return o.create(y,x)}}(),n.enc.Base64url})}(JA)),JA.exports}var e2={exports:{}},Ehe=e2.exports,bj;function yp(){return bj||(bj=1,function(e,t){(function(n,r){e.exports=r(qn())})(Ehe,function(n){return function(r){var a=n,o=a.lib,l=o.WordArray,d=o.Hasher,h=a.algo,p=[];(function(){for(var k=0;k<64;k++)p[k]=r.abs(r.sin(k+1))*4294967296|0})();var v=h.MD5=d.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(k,A){for(var T=0;T<16;T++){var D=A+T,O=k[D];k[D]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var I=this._hash.words,N=k[A+0],$=k[A+1],P=k[A+2],G=k[A+3],K=k[A+4],z=k[A+5],Y=k[A+6],W=k[A+7],ae=k[A+8],re=k[A+9],ge=k[A+10],V=k[A+11],fe=k[A+12],de=k[A+13],Oe=k[A+14],q=k[A+15],he=I[0],ue=I[1],F=I[2],ye=I[3];he=y(he,ue,F,ye,N,7,p[0]),ye=y(ye,he,ue,F,$,12,p[1]),F=y(F,ye,he,ue,P,17,p[2]),ue=y(ue,F,ye,he,G,22,p[3]),he=y(he,ue,F,ye,K,7,p[4]),ye=y(ye,he,ue,F,z,12,p[5]),F=y(F,ye,he,ue,Y,17,p[6]),ue=y(ue,F,ye,he,W,22,p[7]),he=y(he,ue,F,ye,ae,7,p[8]),ye=y(ye,he,ue,F,re,12,p[9]),F=y(F,ye,he,ue,ge,17,p[10]),ue=y(ue,F,ye,he,V,22,p[11]),he=y(he,ue,F,ye,fe,7,p[12]),ye=y(ye,he,ue,F,de,12,p[13]),F=y(F,ye,he,ue,Oe,17,p[14]),ue=y(ue,F,ye,he,q,22,p[15]),he=x(he,ue,F,ye,$,5,p[16]),ye=x(ye,he,ue,F,Y,9,p[17]),F=x(F,ye,he,ue,V,14,p[18]),ue=x(ue,F,ye,he,N,20,p[19]),he=x(he,ue,F,ye,z,5,p[20]),ye=x(ye,he,ue,F,ge,9,p[21]),F=x(F,ye,he,ue,q,14,p[22]),ue=x(ue,F,ye,he,K,20,p[23]),he=x(he,ue,F,ye,re,5,p[24]),ye=x(ye,he,ue,F,Oe,9,p[25]),F=x(F,ye,he,ue,G,14,p[26]),ue=x(ue,F,ye,he,ae,20,p[27]),he=x(he,ue,F,ye,de,5,p[28]),ye=x(ye,he,ue,F,P,9,p[29]),F=x(F,ye,he,ue,W,14,p[30]),ue=x(ue,F,ye,he,fe,20,p[31]),he=S(he,ue,F,ye,z,4,p[32]),ye=S(ye,he,ue,F,ae,11,p[33]),F=S(F,ye,he,ue,V,16,p[34]),ue=S(ue,F,ye,he,Oe,23,p[35]),he=S(he,ue,F,ye,$,4,p[36]),ye=S(ye,he,ue,F,K,11,p[37]),F=S(F,ye,he,ue,W,16,p[38]),ue=S(ue,F,ye,he,ge,23,p[39]),he=S(he,ue,F,ye,de,4,p[40]),ye=S(ye,he,ue,F,N,11,p[41]),F=S(F,ye,he,ue,G,16,p[42]),ue=S(ue,F,ye,he,Y,23,p[43]),he=S(he,ue,F,ye,re,4,p[44]),ye=S(ye,he,ue,F,fe,11,p[45]),F=S(F,ye,he,ue,q,16,p[46]),ue=S(ue,F,ye,he,P,23,p[47]),he=C(he,ue,F,ye,N,6,p[48]),ye=C(ye,he,ue,F,W,10,p[49]),F=C(F,ye,he,ue,Oe,15,p[50]),ue=C(ue,F,ye,he,z,21,p[51]),he=C(he,ue,F,ye,fe,6,p[52]),ye=C(ye,he,ue,F,G,10,p[53]),F=C(F,ye,he,ue,ge,15,p[54]),ue=C(ue,F,ye,he,$,21,p[55]),he=C(he,ue,F,ye,ae,6,p[56]),ye=C(ye,he,ue,F,q,10,p[57]),F=C(F,ye,he,ue,Y,15,p[58]),ue=C(ue,F,ye,he,de,21,p[59]),he=C(he,ue,F,ye,K,6,p[60]),ye=C(ye,he,ue,F,V,10,p[61]),F=C(F,ye,he,ue,P,15,p[62]),ue=C(ue,F,ye,he,re,21,p[63]),I[0]=I[0]+he|0,I[1]=I[1]+ue|0,I[2]=I[2]+F|0,I[3]=I[3]+ye|0},_doFinalize:function(){var k=this._data,A=k.words,T=this._nDataBytes*8,D=k.sigBytes*8;A[D>>>5]|=128<<24-D%32;var O=r.floor(T/4294967296),I=T;A[(D+64>>>9<<4)+15]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,A[(D+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,k.sigBytes=(A.length+1)*4,this._process();for(var N=this._hash,$=N.words,P=0;P<4;P++){var G=$[P];$[P]=(G<<8|G>>>24)&16711935|(G<<24|G>>>8)&4278255360}return N},clone:function(){var k=d.clone.call(this);return k._hash=this._hash.clone(),k}});function y(k,A,T,D,O,I,N){var $=k+(A&T|~A&D)+O+N;return($<<I|$>>>32-I)+A}function x(k,A,T,D,O,I,N){var $=k+(A&D|T&~D)+O+N;return($<<I|$>>>32-I)+A}function S(k,A,T,D,O,I,N){var $=k+(A^T^D)+O+N;return($<<I|$>>>32-I)+A}function C(k,A,T,D,O,I,N){var $=k+(T^(A|~D))+O+N;return($<<I|$>>>32-I)+A}a.MD5=d._createHelper(v),a.HmacMD5=d._createHmacHelper(v)}(Math),n.MD5})}(e2)),e2.exports}var t2={exports:{}},Ahe=t2.exports,_j;function Sj(){return _j||(_j=1,function(e,t){(function(n,r){e.exports=r(qn())})(Ahe,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=a.Hasher,d=r.algo,h=[],p=d.SHA1=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,y){for(var x=this._hash.words,S=x[0],C=x[1],k=x[2],A=x[3],T=x[4],D=0;D<80;D++){if(D<16)h[D]=v[y+D]|0;else{var O=h[D-3]^h[D-8]^h[D-14]^h[D-16];h[D]=O<<1|O>>>31}var I=(S<<5|S>>>27)+T+h[D];D<20?I+=(C&k|~C&A)+1518500249:D<40?I+=(C^k^A)+1859775393:D<60?I+=(C&k|C&A|k&A)-1894007588:I+=(C^k^A)-899497514,T=A,A=k,k=C<<30|C>>>2,C=S,S=I}x[0]=x[0]+S|0,x[1]=x[1]+C|0,x[2]=x[2]+k|0,x[3]=x[3]+A|0,x[4]=x[4]+T|0},_doFinalize:function(){var v=this._data,y=v.words,x=this._nDataBytes*8,S=v.sigBytes*8;return y[S>>>5]|=128<<24-S%32,y[(S+64>>>9<<4)+14]=Math.floor(x/4294967296),y[(S+64>>>9<<4)+15]=x,v.sigBytes=y.length*4,this._process(),this._hash},clone:function(){var v=l.clone.call(this);return v._hash=this._hash.clone(),v}});r.SHA1=l._createHelper(p),r.HmacSHA1=l._createHmacHelper(p)}(),n.SHA1})}(t2)),t2.exports}var n2={exports:{}},khe=n2.exports,wj;function U6(){return wj||(wj=1,function(e,t){(function(n,r){e.exports=r(qn())})(khe,function(n){return function(r){var a=n,o=a.lib,l=o.WordArray,d=o.Hasher,h=a.algo,p=[],v=[];(function(){function S(T){for(var D=r.sqrt(T),O=2;O<=D;O++)if(!(T%O))return!1;return!0}function C(T){return(T-(T|0))*4294967296|0}for(var k=2,A=0;A<64;)S(k)&&(A<8&&(p[A]=C(r.pow(k,1/2))),v[A]=C(r.pow(k,1/3)),A++),k++})();var y=[],x=h.SHA256=d.extend({_doReset:function(){this._hash=new l.init(p.slice(0))},_doProcessBlock:function(S,C){for(var k=this._hash.words,A=k[0],T=k[1],D=k[2],O=k[3],I=k[4],N=k[5],$=k[6],P=k[7],G=0;G<64;G++){if(G<16)y[G]=S[C+G]|0;else{var K=y[G-15],z=(K<<25|K>>>7)^(K<<14|K>>>18)^K>>>3,Y=y[G-2],W=(Y<<15|Y>>>17)^(Y<<13|Y>>>19)^Y>>>10;y[G]=z+y[G-7]+W+y[G-16]}var ae=I&N^~I&$,re=A&T^A&D^T&D,ge=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),V=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),fe=P+V+ae+v[G]+y[G],de=ge+re;P=$,$=N,N=I,I=O+fe|0,O=D,D=T,T=A,A=fe+de|0}k[0]=k[0]+A|0,k[1]=k[1]+T|0,k[2]=k[2]+D|0,k[3]=k[3]+O|0,k[4]=k[4]+I|0,k[5]=k[5]+N|0,k[6]=k[6]+$|0,k[7]=k[7]+P|0},_doFinalize:function(){var S=this._data,C=S.words,k=this._nDataBytes*8,A=S.sigBytes*8;return C[A>>>5]|=128<<24-A%32,C[(A+64>>>9<<4)+14]=r.floor(k/4294967296),C[(A+64>>>9<<4)+15]=k,S.sigBytes=C.length*4,this._process(),this._hash},clone:function(){var S=d.clone.call(this);return S._hash=this._hash.clone(),S}});a.SHA256=d._createHelper(x),a.HmacSHA256=d._createHmacHelper(x)}(Math),n.SHA256})}(n2)),n2.exports}var r2={exports:{}},The=r2.exports,Cj;function Ohe(){return Cj||(Cj=1,function(e,t){(function(n,r,a){e.exports=r(qn(),U6())})(The,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.algo,d=l.SHA256,h=l.SHA224=d.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var p=d._doFinalize.call(this);return p.sigBytes-=4,p}});r.SHA224=d._createHelper(h),r.HmacSHA224=d._createHmacHelper(h)}(),n.SHA224})}(r2)),r2.exports}var i2={exports:{}},Dhe=i2.exports,Ej;function Aj(){return Ej||(Ej=1,function(e,t){(function(n,r,a){e.exports=r(qn(),QA())})(Dhe,function(n){return function(){var r=n,a=r.lib,o=a.Hasher,l=r.x64,d=l.Word,h=l.WordArray,p=r.algo;function v(){return d.create.apply(d,arguments)}var y=[v(1116352408,3609767458),v(1899447441,602891725),v(3049323471,3964484399),v(3921009573,2173295548),v(961987163,4081628472),v(1508970993,3053834265),v(2453635748,2937671579),v(2870763221,3664609560),v(3624381080,2734883394),v(310598401,1164996542),v(607225278,1323610764),v(1426881987,3590304994),v(1925078388,4068182383),v(2162078206,991336113),v(2614888103,633803317),v(3248222580,3479774868),v(3835390401,2666613458),v(4022224774,944711139),v(264347078,2341262773),v(604807628,2007800933),v(770255983,1495990901),v(1249150122,1856431235),v(1555081692,3175218132),v(1996064986,2198950837),v(2554220882,3999719339),v(2821834349,766784016),v(2952996808,2566594879),v(3210313671,3203337956),v(3336571891,1034457026),v(3584528711,2466948901),v(113926993,3758326383),v(338241895,168717936),v(666307205,1188179964),v(773529912,1546045734),v(1294757372,1522805485),v(1396182291,2643833823),v(1695183700,2343527390),v(1986661051,1014477480),v(2177026350,1206759142),v(2456956037,344077627),v(2730485921,1290863460),v(2820302411,3158454273),v(3259730800,3505952657),v(3345764771,106217008),v(3516065817,3606008344),v(3600352804,1432725776),v(4094571909,1467031594),v(275423344,851169720),v(430227734,3100823752),v(506948616,1363258195),v(659060556,3750685593),v(883997877,3785050280),v(958139571,3318307427),v(1322822218,3812723403),v(1537002063,2003034995),v(1747873779,3602036899),v(1955562222,1575990012),v(2024104815,1125592928),v(2227730452,2716904306),v(2361852424,442776044),v(2428436474,593698344),v(2756734187,3733110249),v(3204031479,2999351573),v(3329325298,3815920427),v(3391569614,3928383900),v(3515267271,566280711),v(3940187606,3454069534),v(4118630271,4000239992),v(116418474,1914138554),v(174292421,2731055270),v(289380356,3203993006),v(460393269,320620315),v(685471733,587496836),v(852142971,1086792851),v(1017036298,365543100),v(1126000580,2618297676),v(1288033470,3409855158),v(1501505948,4234509866),v(1607167915,987167468),v(1816402316,1246189591)],x=[];(function(){for(var C=0;C<80;C++)x[C]=v()})();var S=p.SHA512=o.extend({_doReset:function(){this._hash=new h.init([new d.init(1779033703,4089235720),new d.init(3144134277,2227873595),new d.init(1013904242,4271175723),new d.init(2773480762,1595750129),new d.init(1359893119,2917565137),new d.init(2600822924,725511199),new d.init(528734635,4215389547),new d.init(1541459225,327033209)])},_doProcessBlock:function(C,k){for(var A=this._hash.words,T=A[0],D=A[1],O=A[2],I=A[3],N=A[4],$=A[5],P=A[6],G=A[7],K=T.high,z=T.low,Y=D.high,W=D.low,ae=O.high,re=O.low,ge=I.high,V=I.low,fe=N.high,de=N.low,Oe=$.high,q=$.low,he=P.high,ue=P.low,F=G.high,ye=G.low,Qe=K,Le=z,Ye=Y,Je=W,$t=ae,gt=re,ht=ge,at=V,_t=fe,xt=de,mt=Oe,Dt=q,te=he,ie=ue,Se=F,Ie=ye,ke=0;ke<80;ke++){var Re,nt,bt=x[ke];if(ke<16)nt=bt.high=C[k+ke*2]|0,Re=bt.low=C[k+ke*2+1]|0;else{var vt=x[ke-15],ve=vt.high,Fe=vt.low,ot=(ve>>>1|Fe<<31)^(ve>>>8|Fe<<24)^ve>>>7,dt=(Fe>>>1|ve<<31)^(Fe>>>8|ve<<24)^(Fe>>>7|ve<<25),pt=x[ke-2],jt=pt.high,Qt=pt.low,rn=(jt>>>19|Qt<<13)^(jt<<3|Qt>>>29)^jt>>>6,Ut=(Qt>>>19|jt<<13)^(Qt<<3|jt>>>29)^(Qt>>>6|jt<<26),Mt=x[ke-7],Ht=Mt.high,ct=Mt.low,Ct=x[ke-16],gr=Ct.high,Xn=Ct.low;Re=dt+ct,nt=ot+Ht+(Re>>>0<dt>>>0?1:0),Re=Re+Ut,nt=nt+rn+(Re>>>0<Ut>>>0?1:0),Re=Re+Xn,nt=nt+gr+(Re>>>0<Xn>>>0?1:0),bt.high=nt,bt.low=Re}var Pn=_t&mt^~_t&te,An=xt&Dt^~xt&ie,$r=Qe&Ye^Qe&$t^Ye&$t,Wn=Le&Je^Le>^Je>,wr=(Qe>>>28|Le<<4)^(Qe<<30|Le>>>2)^(Qe<<25|Le>>>7),fn=(Le>>>28|Qe<<4)^(Le<<30|Qe>>>2)^(Le<<25|Qe>>>7),Or=(_t>>>14|xt<<18)^(_t>>>18|xt<<14)^(_t<<23|xt>>>9),Cr=(xt>>>14|_t<<18)^(xt>>>18|_t<<14)^(xt<<23|_t>>>9),ta=y[ke],an=ta.high,Gn=ta.low,qt=Ie+Cr,Lr=Se+Or+(qt>>>0<Ie>>>0?1:0),qt=qt+An,Lr=Lr+Pn+(qt>>>0<An>>>0?1:0),qt=qt+Gn,Lr=Lr+an+(qt>>>0<Gn>>>0?1:0),qt=qt+Re,Lr=Lr+nt+(qt>>>0<Re>>>0?1:0),Vn=fn+Wn,Ka=wr+$r+(Vn>>>0<fn>>>0?1:0);Se=te,Ie=ie,te=mt,ie=Dt,mt=_t,Dt=xt,xt=at+qt|0,_t=ht+Lr+(xt>>>0<at>>>0?1:0)|0,ht=$t,at=gt,$t=Ye,gt=Je,Ye=Qe,Je=Le,Le=qt+Vn|0,Qe=Lr+Ka+(Le>>>0<qt>>>0?1:0)|0}z=T.low=z+Le,T.high=K+Qe+(z>>>0<Le>>>0?1:0),W=D.low=W+Je,D.high=Y+Ye+(W>>>0<Je>>>0?1:0),re=O.low=re+gt,O.high=ae+$t+(re>>>0<gt>>>0?1:0),V=I.low=V+at,I.high=ge+ht+(V>>>0<at>>>0?1:0),de=N.low=de+xt,N.high=fe+_t+(de>>>0<xt>>>0?1:0),q=$.low=q+Dt,$.high=Oe+mt+(q>>>0<Dt>>>0?1:0),ue=P.low=ue+ie,P.high=he+te+(ue>>>0<ie>>>0?1:0),ye=G.low=ye+Ie,G.high=F+Se+(ye>>>0<Ie>>>0?1:0)},_doFinalize:function(){var C=this._data,k=C.words,A=this._nDataBytes*8,T=C.sigBytes*8;k[T>>>5]|=128<<24-T%32,k[(T+128>>>10<<5)+30]=Math.floor(A/4294967296),k[(T+128>>>10<<5)+31]=A,C.sigBytes=k.length*4,this._process();var D=this._hash.toX32();return D},clone:function(){var C=o.clone.call(this);return C._hash=this._hash.clone(),C},blockSize:1024/32});r.SHA512=o._createHelper(S),r.HmacSHA512=o._createHmacHelper(S)}(),n.SHA512})}(i2)),i2.exports}var a2={exports:{}},Mhe=a2.exports,kj;function Rhe(){return kj||(kj=1,function(e,t){(function(n,r,a){e.exports=r(qn(),QA(),Aj())})(Mhe,function(n){return function(){var r=n,a=r.x64,o=a.Word,l=a.WordArray,d=r.algo,h=d.SHA512,p=d.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 v=h._doFinalize.call(this);return v.sigBytes-=16,v}});r.SHA384=h._createHelper(p),r.HmacSHA384=h._createHmacHelper(p)}(),n.SHA384})}(a2)),a2.exports}var o2={exports:{}},Ihe=o2.exports,Tj;function Bhe(){return Tj||(Tj=1,function(e,t){(function(n,r,a){e.exports=r(qn(),QA())})(Ihe,function(n){return function(r){var a=n,o=a.lib,l=o.WordArray,d=o.Hasher,h=a.x64,p=h.Word,v=a.algo,y=[],x=[],S=[];(function(){for(var A=1,T=0,D=0;D<24;D++){y[A+5*T]=(D+1)*(D+2)/2%64;var O=T%5,I=(2*A+3*T)%5;A=O,T=I}for(var A=0;A<5;A++)for(var T=0;T<5;T++)x[A+5*T]=T+(2*A+3*T)%5*5;for(var N=1,$=0;$<24;$++){for(var P=0,G=0,K=0;K<7;K++){if(N&1){var z=(1<<K)-1;z<32?G^=1<<z:P^=1<<z-32}N&128?N=N<<1^113:N<<=1}S[$]=p.create(P,G)}})();var C=[];(function(){for(var A=0;A<25;A++)C[A]=p.create()})();var k=v.SHA3=d.extend({cfg:d.cfg.extend({outputLength:512}),_doReset:function(){for(var A=this._state=[],T=0;T<25;T++)A[T]=new p.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(A,T){for(var D=this._state,O=this.blockSize/2,I=0;I<O;I++){var N=A[T+2*I],$=A[T+2*I+1];N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,$=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360;var P=D[I];P.high^=$,P.low^=N}for(var G=0;G<24;G++){for(var K=0;K<5;K++){for(var z=0,Y=0,W=0;W<5;W++){var P=D[K+5*W];z^=P.high,Y^=P.low}var ae=C[K];ae.high=z,ae.low=Y}for(var K=0;K<5;K++)for(var re=C[(K+4)%5],ge=C[(K+1)%5],V=ge.high,fe=ge.low,z=re.high^(V<<1|fe>>>31),Y=re.low^(fe<<1|V>>>31),W=0;W<5;W++){var P=D[K+5*W];P.high^=z,P.low^=Y}for(var de=1;de<25;de++){var z,Y,P=D[de],Oe=P.high,q=P.low,he=y[de];he<32?(z=Oe<<he|q>>>32-he,Y=q<<he|Oe>>>32-he):(z=q<<he-32|Oe>>>64-he,Y=Oe<<he-32|q>>>64-he);var ue=C[x[de]];ue.high=z,ue.low=Y}var F=C[0],ye=D[0];F.high=ye.high,F.low=ye.low;for(var K=0;K<5;K++)for(var W=0;W<5;W++){var de=K+5*W,P=D[de],Qe=C[de],Le=C[(K+1)%5+5*W],Ye=C[(K+2)%5+5*W];P.high=Qe.high^~Le.high&Ye.high,P.low=Qe.low^~Le.low&Ye.low}var P=D[0],Je=S[G];P.high^=Je.high,P.low^=Je.low}},_doFinalize:function(){var A=this._data,T=A.words;this._nDataBytes*8;var D=A.sigBytes*8,O=this.blockSize*32;T[D>>>5]|=1<<24-D%32,T[(r.ceil((D+1)/O)*O>>>5)-1]|=128,A.sigBytes=T.length*4,this._process();for(var I=this._state,N=this.cfg.outputLength/8,$=N/8,P=[],G=0;G<$;G++){var K=I[G],z=K.high,Y=K.low;z=(z<<8|z>>>24)&16711935|(z<<24|z>>>8)&4278255360,Y=(Y<<8|Y>>>24)&16711935|(Y<<24|Y>>>8)&4278255360,P.push(Y),P.push(z)}return new l.init(P,N)},clone:function(){for(var A=d.clone.call(this),T=A._state=this._state.slice(0),D=0;D<25;D++)T[D]=T[D].clone();return A}});a.SHA3=d._createHelper(k),a.HmacSHA3=d._createHmacHelper(k)}(Math),n.SHA3})}(o2)),o2.exports}var s2={exports:{}},$he=s2.exports,Oj;function Lhe(){return Oj||(Oj=1,function(e,t){(function(n,r){e.exports=r(qn())})($he,function(n){/** @preserve
|
|
4715
|
+
root.render(<App />);`),s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(B=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(L=s.unstable_transitionCallbacks)),s=Qb(i,1,!1,null,null,c,m,_,w,B,L,null),i[_c]=s.current,Mb(i),new zv(s)},g1.hydrateRoot=function(i,s,c){if(!A(i))throw Error("Target container is not a DOM element.");_k(i),s===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var m=!1,_="",w=J1,B=K2,L=Gm,X=null,ne=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(B=c.onCaughtError),c.onRecoverableError!==void 0&&(L=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(X=c.unstable_transitionCallbacks),c.formState!==void 0&&(ne=c.formState)),s=Qb(i,1,!0,s,c??null,m,_,w,B,L,X,ne),s.context=Kb(null),c=s.current,m=io(c),m=Fe(m),_=Js(m),_.callback=null,ws(c,_,m),c=m,s.current.lanes=c,nt(s,c),ns(s),i[_c]=s.current,Mb(i),new b0(s)},g1.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),g1}var fj;function lhe(){if(fj)return qA.exports;fj=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(),qA.exports=ohe()):qA.exports=she(),qA.exports}var uhe=lhe();const dj="debales-ai-assistant",hj="debales-chatbot-container",che=ee.forwardRef(({children:e,globalStyles:t="",containerStyles:n={},onReady:r},a)=>{const o=ee.useRef(null),[l,d]=ee.useState(null),h=ee.useRef(null),p=ee.useRef(null),v=ee.useRef({get shadowRoot(){return h.current},get container(){return l},querySelector:y=>{var x;return((x=h.current)==null?void 0:x.querySelector(y))||null},querySelectorAll:y=>{var x;return((x=h.current)==null?void 0:x.querySelectorAll(y))||null}});return ee.useImperativeHandle(a,()=>v.current,[]),ee.useEffect(()=>{const y=document.getElementById(dj);if(y?o.current=y:o.current&&(o.current.id=dj),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 C=h.current.querySelector(`#${hj}`);C&&d(C);return}const x=o.current.attachShadow({mode:"open"});if(h.current=x,t){const C=document.createElement("style");C.textContent=t,x.appendChild(C)}const S=document.createElement("div");S.id=hj,S.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;",x.appendChild(S),d(S),r&&r(x,S)}},[t,r]),ee.useEffect(()=>(l&&!p.current&&(p.current=uhe.createRoot(l)),p.current&&l&&window.self===window.top&&p.current.render(R.jsx(J.StyleSheetManager,{target:l,children:R.jsx(gF,{value:v.current,children:e})})),()=>{p.current&&p.current.unmount()}),[l,e]),R.jsx("div",{ref:o,style:n})});class GA{isSupported(){return Zc.detect()===this.platform}createSuccessResult(t,n){return{success:!0,data:t,message:n}}createErrorResult(t){return{success:!1,error:t}}}class fhe extends GA{constructor(){super(...arguments);Yr(this,"platform",Si.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,a){return console.log("DefaultCartAdapter: addToCart called",{variantId:n,quantity:r,properties:a}),this.createSuccessResult(void 0,"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 a=new URL(`https://${n}/products/${r.handle}`);return a.searchParams.append("variant",r.product_id),ms(a.toString())}else return ms(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}class dhe extends GA{constructor(){var n,r;super();Yr(this,"platform",Si.SHOPIFY);Yr(this,"cartEndpoint");Yr(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 a=ZD(n);if(!a.isValid)return"";if(r.handle){const o=new URL(`/products/${r.handle}`,a.url);return o.searchParams.append("variant",r.product_id),ms(o.toString())}else return ms(r.link)}updateTrackCart({cartToken:n,sessionId:r=Kn()}){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 a=r;return this.createSuccessResult(this.normalizeCartData(a),"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,a){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:a}],attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:Kn(),dbls_method:"add_to_cart"}})}),l=await o.json();if(!o.ok){const d=l;return this.createErrorResult(d.description||`Failed to add item to cart: ${o.status}`)}return this.fetchCart().then(d=>{d.success&&this.updateTrackCart({cartToken:d==null?void 0:d.data.token})}),this.createSuccessResult(void 0,`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})}),a=await r.json();if(!r.ok){const o=a;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:Kn(),...n}})});if(!r.ok){const a=await r.json();return this.createErrorResult(a.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=ZD(n);if(!r.isValid)return"";const a=new URL("/cart",r.url);return a.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),a.searchParams.append("attributes[from]","debales-ai-chatbot"),a.searchParams.append("attributes[through]","add-to-cart"),a.searchParams.append("attributes[dbls_session_id]",Kn()),a.searchParams.append("timestamp",Date.now().toString()),ms(a.toString())}}class hhe extends GA{constructor(){var n,r;super();Yr(this,"platform",Si.MAGENTO);Yr(this,"checkoutEndpoint");Yr(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 a=r.cart;return this.createSuccessResult(this.normalizeCartData(a),"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 a;try{const o=(a=document.querySelector('input[name="form_key"]'))==null?void 0:a.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"],d=>d.reload(["cart"],!0))}catch(d){console.warn("Failed to reload cart data:",d)}return this.createSuccessResult(void 0,`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 a=ZD(n);if(!a.isValid)return"";if(r.handle){const o=new URL(`/${r.handle}.html`,a.url);return ms(o.toString())}else return ms(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}var VA={exports:{}};function phe(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 YA={exports:{}};const ghe=nP(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var mhe=YA.exports,pj;function qn(){return pj||(pj=1,function(e,t){(function(n,r){e.exports=r()})(mhe,function(){var n=n||function(r,a){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 m4<"u"&&m4.crypto&&(o=m4.crypto),!o&&typeof phe=="function")try{o=ghe}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.")},d=Object.create||function(){function D(){}return function(O){var I;return D.prototype=O,I=new D,D.prototype=null,I}}(),h={},p=h.lib={},v=p.Base=function(){return{extend:function(D){var O=d(this);return D&&O.mixIn(D),(!O.hasOwnProperty("init")||this.init===O.init)&&(O.init=function(){O.$super.init.apply(this,arguments)}),O.init.prototype=O,O.$super=this,O},create:function(){var D=this.extend();return D.init.apply(D,arguments),D},init:function(){},mixIn:function(D){for(var O in D)D.hasOwnProperty(O)&&(this[O]=D[O]);D.hasOwnProperty("toString")&&(this.toString=D.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),y=p.WordArray=v.extend({init:function(D,O){D=this.words=D||[],O!=a?this.sigBytes=O:this.sigBytes=D.length*4},toString:function(D){return(D||S).stringify(this)},concat:function(D){var O=this.words,I=D.words,N=this.sigBytes,$=D.sigBytes;if(this.clamp(),N%4)for(var P=0;P<$;P++){var G=I[P>>>2]>>>24-P%4*8&255;O[N+P>>>2]|=G<<24-(N+P)%4*8}else for(var K=0;K<$;K+=4)O[N+K>>>2]=I[K>>>2];return this.sigBytes+=$,this},clamp:function(){var D=this.words,O=this.sigBytes;D[O>>>2]&=4294967295<<32-O%4*8,D.length=r.ceil(O/4)},clone:function(){var D=v.clone.call(this);return D.words=this.words.slice(0),D},random:function(D){for(var O=[],I=0;I<D;I+=4)O.push(l());return new y.init(O,D)}}),x=h.enc={},S=x.Hex={stringify:function(D){for(var O=D.words,I=D.sigBytes,N=[],$=0;$<I;$++){var P=O[$>>>2]>>>24-$%4*8&255;N.push((P>>>4).toString(16)),N.push((P&15).toString(16))}return N.join("")},parse:function(D){for(var O=D.length,I=[],N=0;N<O;N+=2)I[N>>>3]|=parseInt(D.substr(N,2),16)<<24-N%8*4;return new y.init(I,O/2)}},C=x.Latin1={stringify:function(D){for(var O=D.words,I=D.sigBytes,N=[],$=0;$<I;$++){var P=O[$>>>2]>>>24-$%4*8&255;N.push(String.fromCharCode(P))}return N.join("")},parse:function(D){for(var O=D.length,I=[],N=0;N<O;N++)I[N>>>2]|=(D.charCodeAt(N)&255)<<24-N%4*8;return new y.init(I,O)}},k=x.Utf8={stringify:function(D){try{return decodeURIComponent(escape(C.stringify(D)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(D){return C.parse(unescape(encodeURIComponent(D)))}},A=p.BufferedBlockAlgorithm=v.extend({reset:function(){this._data=new y.init,this._nDataBytes=0},_append:function(D){typeof D=="string"&&(D=k.parse(D)),this._data.concat(D),this._nDataBytes+=D.sigBytes},_process:function(D){var O,I=this._data,N=I.words,$=I.sigBytes,P=this.blockSize,G=P*4,K=$/G;D?K=r.ceil(K):K=r.max((K|0)-this._minBufferSize,0);var z=K*P,Y=r.min(z*4,$);if(z){for(var W=0;W<z;W+=P)this._doProcessBlock(N,W);O=N.splice(0,z),I.sigBytes-=Y}return new y.init(O,Y)},clone:function(){var D=v.clone.call(this);return D._data=this._data.clone(),D},_minBufferSize:0});p.Hasher=A.extend({cfg:v.extend(),init:function(D){this.cfg=this.cfg.extend(D),this.reset()},reset:function(){A.reset.call(this),this._doReset()},update:function(D){return this._append(D),this._process(),this},finalize:function(D){D&&this._append(D);var O=this._doFinalize();return O},blockSize:16,_createHelper:function(D){return function(O,I){return new D.init(I).finalize(O)}},_createHmacHelper:function(D){return function(O,I){return new T.HMAC.init(D,I).finalize(O)}}});var T=h.algo={};return h}(Math);return n})}(YA)),YA.exports}var ZA={exports:{}},vhe=ZA.exports,gj;function QA(){return gj||(gj=1,function(e,t){(function(n,r){e.exports=r(qn())})(vhe,function(n){return function(r){var a=n,o=a.lib,l=o.Base,d=o.WordArray,h=a.x64={};h.Word=l.extend({init:function(p,v){this.high=p,this.low=v}}),h.WordArray=l.extend({init:function(p,v){p=this.words=p||[],v!=r?this.sigBytes=v:this.sigBytes=p.length*8},toX32:function(){for(var p=this.words,v=p.length,y=[],x=0;x<v;x++){var S=p[x];y.push(S.high),y.push(S.low)}return d.create(y,this.sigBytes)},clone:function(){for(var p=l.clone.call(this),v=p.words=this.words.slice(0),y=v.length,x=0;x<y;x++)v[x]=v[x].clone();return p}})}(),n})}(ZA)),ZA.exports}var KA={exports:{}},yhe=KA.exports,mj;function xhe(){return mj||(mj=1,function(e,t){(function(n,r){e.exports=r(qn())})(yhe,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,a=r.lib,o=a.WordArray,l=o.init,d=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,v=[],y=0;y<p;y++)v[y>>>2]|=h[y]<<24-y%4*8;l.call(this,v,p)}else l.apply(this,arguments)};d.prototype=o}}(),n.lib.WordArray})}(KA)),KA.exports}var XA={exports:{}},bhe=XA.exports,vj;function _he(){return vj||(vj=1,function(e,t){(function(n,r){e.exports=r(qn())})(bhe,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.enc;l.Utf16=l.Utf16BE={stringify:function(h){for(var p=h.words,v=h.sigBytes,y=[],x=0;x<v;x+=2){var S=p[x>>>2]>>>16-x%4*8&65535;y.push(String.fromCharCode(S))}return y.join("")},parse:function(h){for(var p=h.length,v=[],y=0;y<p;y++)v[y>>>1]|=h.charCodeAt(y)<<16-y%2*16;return o.create(v,p*2)}},l.Utf16LE={stringify:function(h){for(var p=h.words,v=h.sigBytes,y=[],x=0;x<v;x+=2){var S=d(p[x>>>2]>>>16-x%4*8&65535);y.push(String.fromCharCode(S))}return y.join("")},parse:function(h){for(var p=h.length,v=[],y=0;y<p;y++)v[y>>>1]|=d(h.charCodeAt(y)<<16-y%2*16);return o.create(v,p*2)}};function d(h){return h<<8&4278255360|h>>>8&16711935}}(),n.enc.Utf16})}(XA)),XA.exports}var WA={exports:{}},She=WA.exports,yj;function vp(){return yj||(yj=1,function(e,t){(function(n,r){e.exports=r(qn())})(She,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.enc;l.Base64={stringify:function(h){var p=h.words,v=h.sigBytes,y=this._map;h.clamp();for(var x=[],S=0;S<v;S+=3)for(var C=p[S>>>2]>>>24-S%4*8&255,k=p[S+1>>>2]>>>24-(S+1)%4*8&255,A=p[S+2>>>2]>>>24-(S+2)%4*8&255,T=C<<16|k<<8|A,D=0;D<4&&S+D*.75<v;D++)x.push(y.charAt(T>>>6*(3-D)&63));var O=y.charAt(64);if(O)for(;x.length%4;)x.push(O);return x.join("")},parse:function(h){var p=h.length,v=this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var x=0;x<v.length;x++)y[v.charCodeAt(x)]=x}var S=v.charAt(64);if(S){var C=h.indexOf(S);C!==-1&&(p=C)}return d(h,p,y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function d(h,p,v){for(var y=[],x=0,S=0;S<p;S++)if(S%4){var C=v[h.charCodeAt(S-1)]<<S%4*2,k=v[h.charCodeAt(S)]>>>6-S%4*2,A=C|k;y[x>>>2]|=A<<24-x%4*8,x++}return o.create(y,x)}}(),n.enc.Base64})}(WA)),WA.exports}var JA={exports:{}},whe=JA.exports,xj;function Che(){return xj||(xj=1,function(e,t){(function(n,r){e.exports=r(qn())})(whe,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.enc;l.Base64url={stringify:function(h,p){p===void 0&&(p=!0);var v=h.words,y=h.sigBytes,x=p?this._safe_map:this._map;h.clamp();for(var S=[],C=0;C<y;C+=3)for(var k=v[C>>>2]>>>24-C%4*8&255,A=v[C+1>>>2]>>>24-(C+1)%4*8&255,T=v[C+2>>>2]>>>24-(C+2)%4*8&255,D=k<<16|A<<8|T,O=0;O<4&&C+O*.75<y;O++)S.push(x.charAt(D>>>6*(3-O)&63));var I=x.charAt(64);if(I)for(;S.length%4;)S.push(I);return S.join("")},parse:function(h,p){p===void 0&&(p=!0);var v=h.length,y=p?this._safe_map:this._map,x=this._reverseMap;if(!x){x=this._reverseMap=[];for(var S=0;S<y.length;S++)x[y.charCodeAt(S)]=S}var C=y.charAt(64);if(C){var k=h.indexOf(C);k!==-1&&(v=k)}return d(h,v,x)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function d(h,p,v){for(var y=[],x=0,S=0;S<p;S++)if(S%4){var C=v[h.charCodeAt(S-1)]<<S%4*2,k=v[h.charCodeAt(S)]>>>6-S%4*2,A=C|k;y[x>>>2]|=A<<24-x%4*8,x++}return o.create(y,x)}}(),n.enc.Base64url})}(JA)),JA.exports}var e2={exports:{}},Ehe=e2.exports,bj;function yp(){return bj||(bj=1,function(e,t){(function(n,r){e.exports=r(qn())})(Ehe,function(n){return function(r){var a=n,o=a.lib,l=o.WordArray,d=o.Hasher,h=a.algo,p=[];(function(){for(var k=0;k<64;k++)p[k]=r.abs(r.sin(k+1))*4294967296|0})();var v=h.MD5=d.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(k,A){for(var T=0;T<16;T++){var D=A+T,O=k[D];k[D]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var I=this._hash.words,N=k[A+0],$=k[A+1],P=k[A+2],G=k[A+3],K=k[A+4],z=k[A+5],Y=k[A+6],W=k[A+7],ae=k[A+8],re=k[A+9],ge=k[A+10],V=k[A+11],fe=k[A+12],de=k[A+13],Oe=k[A+14],q=k[A+15],he=I[0],ue=I[1],F=I[2],ye=I[3];he=y(he,ue,F,ye,N,7,p[0]),ye=y(ye,he,ue,F,$,12,p[1]),F=y(F,ye,he,ue,P,17,p[2]),ue=y(ue,F,ye,he,G,22,p[3]),he=y(he,ue,F,ye,K,7,p[4]),ye=y(ye,he,ue,F,z,12,p[5]),F=y(F,ye,he,ue,Y,17,p[6]),ue=y(ue,F,ye,he,W,22,p[7]),he=y(he,ue,F,ye,ae,7,p[8]),ye=y(ye,he,ue,F,re,12,p[9]),F=y(F,ye,he,ue,ge,17,p[10]),ue=y(ue,F,ye,he,V,22,p[11]),he=y(he,ue,F,ye,fe,7,p[12]),ye=y(ye,he,ue,F,de,12,p[13]),F=y(F,ye,he,ue,Oe,17,p[14]),ue=y(ue,F,ye,he,q,22,p[15]),he=x(he,ue,F,ye,$,5,p[16]),ye=x(ye,he,ue,F,Y,9,p[17]),F=x(F,ye,he,ue,V,14,p[18]),ue=x(ue,F,ye,he,N,20,p[19]),he=x(he,ue,F,ye,z,5,p[20]),ye=x(ye,he,ue,F,ge,9,p[21]),F=x(F,ye,he,ue,q,14,p[22]),ue=x(ue,F,ye,he,K,20,p[23]),he=x(he,ue,F,ye,re,5,p[24]),ye=x(ye,he,ue,F,Oe,9,p[25]),F=x(F,ye,he,ue,G,14,p[26]),ue=x(ue,F,ye,he,ae,20,p[27]),he=x(he,ue,F,ye,de,5,p[28]),ye=x(ye,he,ue,F,P,9,p[29]),F=x(F,ye,he,ue,W,14,p[30]),ue=x(ue,F,ye,he,fe,20,p[31]),he=S(he,ue,F,ye,z,4,p[32]),ye=S(ye,he,ue,F,ae,11,p[33]),F=S(F,ye,he,ue,V,16,p[34]),ue=S(ue,F,ye,he,Oe,23,p[35]),he=S(he,ue,F,ye,$,4,p[36]),ye=S(ye,he,ue,F,K,11,p[37]),F=S(F,ye,he,ue,W,16,p[38]),ue=S(ue,F,ye,he,ge,23,p[39]),he=S(he,ue,F,ye,de,4,p[40]),ye=S(ye,he,ue,F,N,11,p[41]),F=S(F,ye,he,ue,G,16,p[42]),ue=S(ue,F,ye,he,Y,23,p[43]),he=S(he,ue,F,ye,re,4,p[44]),ye=S(ye,he,ue,F,fe,11,p[45]),F=S(F,ye,he,ue,q,16,p[46]),ue=S(ue,F,ye,he,P,23,p[47]),he=C(he,ue,F,ye,N,6,p[48]),ye=C(ye,he,ue,F,W,10,p[49]),F=C(F,ye,he,ue,Oe,15,p[50]),ue=C(ue,F,ye,he,z,21,p[51]),he=C(he,ue,F,ye,fe,6,p[52]),ye=C(ye,he,ue,F,G,10,p[53]),F=C(F,ye,he,ue,ge,15,p[54]),ue=C(ue,F,ye,he,$,21,p[55]),he=C(he,ue,F,ye,ae,6,p[56]),ye=C(ye,he,ue,F,q,10,p[57]),F=C(F,ye,he,ue,Y,15,p[58]),ue=C(ue,F,ye,he,de,21,p[59]),he=C(he,ue,F,ye,K,6,p[60]),ye=C(ye,he,ue,F,V,10,p[61]),F=C(F,ye,he,ue,P,15,p[62]),ue=C(ue,F,ye,he,re,21,p[63]),I[0]=I[0]+he|0,I[1]=I[1]+ue|0,I[2]=I[2]+F|0,I[3]=I[3]+ye|0},_doFinalize:function(){var k=this._data,A=k.words,T=this._nDataBytes*8,D=k.sigBytes*8;A[D>>>5]|=128<<24-D%32;var O=r.floor(T/4294967296),I=T;A[(D+64>>>9<<4)+15]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,A[(D+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,k.sigBytes=(A.length+1)*4,this._process();for(var N=this._hash,$=N.words,P=0;P<4;P++){var G=$[P];$[P]=(G<<8|G>>>24)&16711935|(G<<24|G>>>8)&4278255360}return N},clone:function(){var k=d.clone.call(this);return k._hash=this._hash.clone(),k}});function y(k,A,T,D,O,I,N){var $=k+(A&T|~A&D)+O+N;return($<<I|$>>>32-I)+A}function x(k,A,T,D,O,I,N){var $=k+(A&D|T&~D)+O+N;return($<<I|$>>>32-I)+A}function S(k,A,T,D,O,I,N){var $=k+(A^T^D)+O+N;return($<<I|$>>>32-I)+A}function C(k,A,T,D,O,I,N){var $=k+(T^(A|~D))+O+N;return($<<I|$>>>32-I)+A}a.MD5=d._createHelper(v),a.HmacMD5=d._createHmacHelper(v)}(Math),n.MD5})}(e2)),e2.exports}var t2={exports:{}},Ahe=t2.exports,_j;function Sj(){return _j||(_j=1,function(e,t){(function(n,r){e.exports=r(qn())})(Ahe,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=a.Hasher,d=r.algo,h=[],p=d.SHA1=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,y){for(var x=this._hash.words,S=x[0],C=x[1],k=x[2],A=x[3],T=x[4],D=0;D<80;D++){if(D<16)h[D]=v[y+D]|0;else{var O=h[D-3]^h[D-8]^h[D-14]^h[D-16];h[D]=O<<1|O>>>31}var I=(S<<5|S>>>27)+T+h[D];D<20?I+=(C&k|~C&A)+1518500249:D<40?I+=(C^k^A)+1859775393:D<60?I+=(C&k|C&A|k&A)-1894007588:I+=(C^k^A)-899497514,T=A,A=k,k=C<<30|C>>>2,C=S,S=I}x[0]=x[0]+S|0,x[1]=x[1]+C|0,x[2]=x[2]+k|0,x[3]=x[3]+A|0,x[4]=x[4]+T|0},_doFinalize:function(){var v=this._data,y=v.words,x=this._nDataBytes*8,S=v.sigBytes*8;return y[S>>>5]|=128<<24-S%32,y[(S+64>>>9<<4)+14]=Math.floor(x/4294967296),y[(S+64>>>9<<4)+15]=x,v.sigBytes=y.length*4,this._process(),this._hash},clone:function(){var v=l.clone.call(this);return v._hash=this._hash.clone(),v}});r.SHA1=l._createHelper(p),r.HmacSHA1=l._createHmacHelper(p)}(),n.SHA1})}(t2)),t2.exports}var n2={exports:{}},khe=n2.exports,wj;function U6(){return wj||(wj=1,function(e,t){(function(n,r){e.exports=r(qn())})(khe,function(n){return function(r){var a=n,o=a.lib,l=o.WordArray,d=o.Hasher,h=a.algo,p=[],v=[];(function(){function S(T){for(var D=r.sqrt(T),O=2;O<=D;O++)if(!(T%O))return!1;return!0}function C(T){return(T-(T|0))*4294967296|0}for(var k=2,A=0;A<64;)S(k)&&(A<8&&(p[A]=C(r.pow(k,1/2))),v[A]=C(r.pow(k,1/3)),A++),k++})();var y=[],x=h.SHA256=d.extend({_doReset:function(){this._hash=new l.init(p.slice(0))},_doProcessBlock:function(S,C){for(var k=this._hash.words,A=k[0],T=k[1],D=k[2],O=k[3],I=k[4],N=k[5],$=k[6],P=k[7],G=0;G<64;G++){if(G<16)y[G]=S[C+G]|0;else{var K=y[G-15],z=(K<<25|K>>>7)^(K<<14|K>>>18)^K>>>3,Y=y[G-2],W=(Y<<15|Y>>>17)^(Y<<13|Y>>>19)^Y>>>10;y[G]=z+y[G-7]+W+y[G-16]}var ae=I&N^~I&$,re=A&T^A&D^T&D,ge=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),V=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),fe=P+V+ae+v[G]+y[G],de=ge+re;P=$,$=N,N=I,I=O+fe|0,O=D,D=T,T=A,A=fe+de|0}k[0]=k[0]+A|0,k[1]=k[1]+T|0,k[2]=k[2]+D|0,k[3]=k[3]+O|0,k[4]=k[4]+I|0,k[5]=k[5]+N|0,k[6]=k[6]+$|0,k[7]=k[7]+P|0},_doFinalize:function(){var S=this._data,C=S.words,k=this._nDataBytes*8,A=S.sigBytes*8;return C[A>>>5]|=128<<24-A%32,C[(A+64>>>9<<4)+14]=r.floor(k/4294967296),C[(A+64>>>9<<4)+15]=k,S.sigBytes=C.length*4,this._process(),this._hash},clone:function(){var S=d.clone.call(this);return S._hash=this._hash.clone(),S}});a.SHA256=d._createHelper(x),a.HmacSHA256=d._createHmacHelper(x)}(Math),n.SHA256})}(n2)),n2.exports}var r2={exports:{}},The=r2.exports,Cj;function Ohe(){return Cj||(Cj=1,function(e,t){(function(n,r,a){e.exports=r(qn(),U6())})(The,function(n){return function(){var r=n,a=r.lib,o=a.WordArray,l=r.algo,d=l.SHA256,h=l.SHA224=d.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var p=d._doFinalize.call(this);return p.sigBytes-=4,p}});r.SHA224=d._createHelper(h),r.HmacSHA224=d._createHmacHelper(h)}(),n.SHA224})}(r2)),r2.exports}var i2={exports:{}},Dhe=i2.exports,Ej;function Aj(){return Ej||(Ej=1,function(e,t){(function(n,r,a){e.exports=r(qn(),QA())})(Dhe,function(n){return function(){var r=n,a=r.lib,o=a.Hasher,l=r.x64,d=l.Word,h=l.WordArray,p=r.algo;function v(){return d.create.apply(d,arguments)}var y=[v(1116352408,3609767458),v(1899447441,602891725),v(3049323471,3964484399),v(3921009573,2173295548),v(961987163,4081628472),v(1508970993,3053834265),v(2453635748,2937671579),v(2870763221,3664609560),v(3624381080,2734883394),v(310598401,1164996542),v(607225278,1323610764),v(1426881987,3590304994),v(1925078388,4068182383),v(2162078206,991336113),v(2614888103,633803317),v(3248222580,3479774868),v(3835390401,2666613458),v(4022224774,944711139),v(264347078,2341262773),v(604807628,2007800933),v(770255983,1495990901),v(1249150122,1856431235),v(1555081692,3175218132),v(1996064986,2198950837),v(2554220882,3999719339),v(2821834349,766784016),v(2952996808,2566594879),v(3210313671,3203337956),v(3336571891,1034457026),v(3584528711,2466948901),v(113926993,3758326383),v(338241895,168717936),v(666307205,1188179964),v(773529912,1546045734),v(1294757372,1522805485),v(1396182291,2643833823),v(1695183700,2343527390),v(1986661051,1014477480),v(2177026350,1206759142),v(2456956037,344077627),v(2730485921,1290863460),v(2820302411,3158454273),v(3259730800,3505952657),v(3345764771,106217008),v(3516065817,3606008344),v(3600352804,1432725776),v(4094571909,1467031594),v(275423344,851169720),v(430227734,3100823752),v(506948616,1363258195),v(659060556,3750685593),v(883997877,3785050280),v(958139571,3318307427),v(1322822218,3812723403),v(1537002063,2003034995),v(1747873779,3602036899),v(1955562222,1575990012),v(2024104815,1125592928),v(2227730452,2716904306),v(2361852424,442776044),v(2428436474,593698344),v(2756734187,3733110249),v(3204031479,2999351573),v(3329325298,3815920427),v(3391569614,3928383900),v(3515267271,566280711),v(3940187606,3454069534),v(4118630271,4000239992),v(116418474,1914138554),v(174292421,2731055270),v(289380356,3203993006),v(460393269,320620315),v(685471733,587496836),v(852142971,1086792851),v(1017036298,365543100),v(1126000580,2618297676),v(1288033470,3409855158),v(1501505948,4234509866),v(1607167915,987167468),v(1816402316,1246189591)],x=[];(function(){for(var C=0;C<80;C++)x[C]=v()})();var S=p.SHA512=o.extend({_doReset:function(){this._hash=new h.init([new d.init(1779033703,4089235720),new d.init(3144134277,2227873595),new d.init(1013904242,4271175723),new d.init(2773480762,1595750129),new d.init(1359893119,2917565137),new d.init(2600822924,725511199),new d.init(528734635,4215389547),new d.init(1541459225,327033209)])},_doProcessBlock:function(C,k){for(var A=this._hash.words,T=A[0],D=A[1],O=A[2],I=A[3],N=A[4],$=A[5],P=A[6],G=A[7],K=T.high,z=T.low,Y=D.high,W=D.low,ae=O.high,re=O.low,ge=I.high,V=I.low,fe=N.high,de=N.low,Oe=$.high,q=$.low,he=P.high,ue=P.low,F=G.high,ye=G.low,Qe=K,Le=z,Ye=Y,Je=W,$t=ae,gt=re,ht=ge,at=V,_t=fe,xt=de,mt=Oe,Dt=q,te=he,ie=ue,Se=F,Ie=ye,ke=0;ke<80;ke++){var Re,nt,bt=x[ke];if(ke<16)nt=bt.high=C[k+ke*2]|0,Re=bt.low=C[k+ke*2+1]|0;else{var vt=x[ke-15],ve=vt.high,Fe=vt.low,ot=(ve>>>1|Fe<<31)^(ve>>>8|Fe<<24)^ve>>>7,dt=(Fe>>>1|ve<<31)^(Fe>>>8|ve<<24)^(Fe>>>7|ve<<25),pt=x[ke-2],jt=pt.high,Qt=pt.low,rn=(jt>>>19|Qt<<13)^(jt<<3|Qt>>>29)^jt>>>6,Ut=(Qt>>>19|jt<<13)^(Qt<<3|jt>>>29)^(Qt>>>6|jt<<26),Mt=x[ke-7],Ht=Mt.high,ct=Mt.low,Ct=x[ke-16],gr=Ct.high,Xn=Ct.low;Re=dt+ct,nt=ot+Ht+(Re>>>0<dt>>>0?1:0),Re=Re+Ut,nt=nt+rn+(Re>>>0<Ut>>>0?1:0),Re=Re+Xn,nt=nt+gr+(Re>>>0<Xn>>>0?1:0),bt.high=nt,bt.low=Re}var Pn=_t&mt^~_t&te,An=xt&Dt^~xt&ie,$r=Qe&Ye^Qe&$t^Ye&$t,Wn=Le&Je^Le>^Je>,wr=(Qe>>>28|Le<<4)^(Qe<<30|Le>>>2)^(Qe<<25|Le>>>7),fn=(Le>>>28|Qe<<4)^(Le<<30|Qe>>>2)^(Le<<25|Qe>>>7),Or=(_t>>>14|xt<<18)^(_t>>>18|xt<<14)^(_t<<23|xt>>>9),Cr=(xt>>>14|_t<<18)^(xt>>>18|_t<<14)^(xt<<23|_t>>>9),ta=y[ke],an=ta.high,Gn=ta.low,qt=Ie+Cr,Lr=Se+Or+(qt>>>0<Ie>>>0?1:0),qt=qt+An,Lr=Lr+Pn+(qt>>>0<An>>>0?1:0),qt=qt+Gn,Lr=Lr+an+(qt>>>0<Gn>>>0?1:0),qt=qt+Re,Lr=Lr+nt+(qt>>>0<Re>>>0?1:0),Vn=fn+Wn,Ka=wr+$r+(Vn>>>0<fn>>>0?1:0);Se=te,Ie=ie,te=mt,ie=Dt,mt=_t,Dt=xt,xt=at+qt|0,_t=ht+Lr+(xt>>>0<at>>>0?1:0)|0,ht=$t,at=gt,$t=Ye,gt=Je,Ye=Qe,Je=Le,Le=qt+Vn|0,Qe=Lr+Ka+(Le>>>0<qt>>>0?1:0)|0}z=T.low=z+Le,T.high=K+Qe+(z>>>0<Le>>>0?1:0),W=D.low=W+Je,D.high=Y+Ye+(W>>>0<Je>>>0?1:0),re=O.low=re+gt,O.high=ae+$t+(re>>>0<gt>>>0?1:0),V=I.low=V+at,I.high=ge+ht+(V>>>0<at>>>0?1:0),de=N.low=de+xt,N.high=fe+_t+(de>>>0<xt>>>0?1:0),q=$.low=q+Dt,$.high=Oe+mt+(q>>>0<Dt>>>0?1:0),ue=P.low=ue+ie,P.high=he+te+(ue>>>0<ie>>>0?1:0),ye=G.low=ye+Ie,G.high=F+Se+(ye>>>0<Ie>>>0?1:0)},_doFinalize:function(){var C=this._data,k=C.words,A=this._nDataBytes*8,T=C.sigBytes*8;k[T>>>5]|=128<<24-T%32,k[(T+128>>>10<<5)+30]=Math.floor(A/4294967296),k[(T+128>>>10<<5)+31]=A,C.sigBytes=k.length*4,this._process();var D=this._hash.toX32();return D},clone:function(){var C=o.clone.call(this);return C._hash=this._hash.clone(),C},blockSize:1024/32});r.SHA512=o._createHelper(S),r.HmacSHA512=o._createHmacHelper(S)}(),n.SHA512})}(i2)),i2.exports}var a2={exports:{}},Mhe=a2.exports,kj;function Rhe(){return kj||(kj=1,function(e,t){(function(n,r,a){e.exports=r(qn(),QA(),Aj())})(Mhe,function(n){return function(){var r=n,a=r.x64,o=a.Word,l=a.WordArray,d=r.algo,h=d.SHA512,p=d.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 v=h._doFinalize.call(this);return v.sigBytes-=16,v}});r.SHA384=h._createHelper(p),r.HmacSHA384=h._createHmacHelper(p)}(),n.SHA384})}(a2)),a2.exports}var o2={exports:{}},Ihe=o2.exports,Tj;function Bhe(){return Tj||(Tj=1,function(e,t){(function(n,r,a){e.exports=r(qn(),QA())})(Ihe,function(n){return function(r){var a=n,o=a.lib,l=o.WordArray,d=o.Hasher,h=a.x64,p=h.Word,v=a.algo,y=[],x=[],S=[];(function(){for(var A=1,T=0,D=0;D<24;D++){y[A+5*T]=(D+1)*(D+2)/2%64;var O=T%5,I=(2*A+3*T)%5;A=O,T=I}for(var A=0;A<5;A++)for(var T=0;T<5;T++)x[A+5*T]=T+(2*A+3*T)%5*5;for(var N=1,$=0;$<24;$++){for(var P=0,G=0,K=0;K<7;K++){if(N&1){var z=(1<<K)-1;z<32?G^=1<<z:P^=1<<z-32}N&128?N=N<<1^113:N<<=1}S[$]=p.create(P,G)}})();var C=[];(function(){for(var A=0;A<25;A++)C[A]=p.create()})();var k=v.SHA3=d.extend({cfg:d.cfg.extend({outputLength:512}),_doReset:function(){for(var A=this._state=[],T=0;T<25;T++)A[T]=new p.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(A,T){for(var D=this._state,O=this.blockSize/2,I=0;I<O;I++){var N=A[T+2*I],$=A[T+2*I+1];N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,$=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360;var P=D[I];P.high^=$,P.low^=N}for(var G=0;G<24;G++){for(var K=0;K<5;K++){for(var z=0,Y=0,W=0;W<5;W++){var P=D[K+5*W];z^=P.high,Y^=P.low}var ae=C[K];ae.high=z,ae.low=Y}for(var K=0;K<5;K++)for(var re=C[(K+4)%5],ge=C[(K+1)%5],V=ge.high,fe=ge.low,z=re.high^(V<<1|fe>>>31),Y=re.low^(fe<<1|V>>>31),W=0;W<5;W++){var P=D[K+5*W];P.high^=z,P.low^=Y}for(var de=1;de<25;de++){var z,Y,P=D[de],Oe=P.high,q=P.low,he=y[de];he<32?(z=Oe<<he|q>>>32-he,Y=q<<he|Oe>>>32-he):(z=q<<he-32|Oe>>>64-he,Y=Oe<<he-32|q>>>64-he);var ue=C[x[de]];ue.high=z,ue.low=Y}var F=C[0],ye=D[0];F.high=ye.high,F.low=ye.low;for(var K=0;K<5;K++)for(var W=0;W<5;W++){var de=K+5*W,P=D[de],Qe=C[de],Le=C[(K+1)%5+5*W],Ye=C[(K+2)%5+5*W];P.high=Qe.high^~Le.high&Ye.high,P.low=Qe.low^~Le.low&Ye.low}var P=D[0],Je=S[G];P.high^=Je.high,P.low^=Je.low}},_doFinalize:function(){var A=this._data,T=A.words;this._nDataBytes*8;var D=A.sigBytes*8,O=this.blockSize*32;T[D>>>5]|=1<<24-D%32,T[(r.ceil((D+1)/O)*O>>>5)-1]|=128,A.sigBytes=T.length*4,this._process();for(var I=this._state,N=this.cfg.outputLength/8,$=N/8,P=[],G=0;G<$;G++){var K=I[G],z=K.high,Y=K.low;z=(z<<8|z>>>24)&16711935|(z<<24|z>>>8)&4278255360,Y=(Y<<8|Y>>>24)&16711935|(Y<<24|Y>>>8)&4278255360,P.push(Y),P.push(z)}return new l.init(P,N)},clone:function(){for(var A=d.clone.call(this),T=A._state=this._state.slice(0),D=0;D<25;D++)T[D]=T[D].clone();return A}});a.SHA3=d._createHelper(k),a.HmacSHA3=d._createHmacHelper(k)}(Math),n.SHA3})}(o2)),o2.exports}var s2={exports:{}},$he=s2.exports,Oj;function Lhe(){return Oj||(Oj=1,function(e,t){(function(n,r){e.exports=r(qn())})($he,function(n){/** @preserve
|
|
4716
4716
|
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
4717
4717
|
|
|
4718
4718
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|