@pickaxeproject/react 6.22.0 → 6.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),o=require("react"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),i=require("../Addons/Auth/hooks/useAuthContext.js"),n=require("../../../hooks/pickaxe/useDimensionContext.js"),r=require("../Addons/Document/hooks/useDocument.js"),a=require("../Addons/Scroll/hooks/useScrollContext.js"),l=require("../../../hooks/studio/useStyleFontSize.js"),u=require("../../../hooks/core/useScrollToBottomVisibility.js"),c=require("./History/index.js"),d=require("./Input.js"),f=require("../../Icons/attach-vertical.svg.js"),h=require("../../../common/cn.js"),m=require("../../../common/api/pickaxe.js"),p=require("uuid"),x=require("../../Core/StudioTip.js"),v=require("../common/ScrollToBottomButton.js"),j=require("../common/PickaxeMCPButton.js"),g=require("../../../hooks/pickaxe/useResponseContext.js"),b=require("../Addons/Navbar/NavPill.js"),k=require("../../Icons/history.svg.js");exports.default=()=>{var y,S;const{deploymentType:w,isNewChat:C,setIsNewChat:q,sessionId:I,setSessionId:D,setLastSessionId:N,pickaxeId:P,sender:A,pickaxe:T,styles:_,isEmbed:F,mcpEnabled:O,translations:E}=s.usePickaxeContext(),{isSent:R,isLoggedIn:H}=i.useAuthContext(),{width:z,height:B,setDimension:L}=n.useDimensionContext(),{setDocuments:M,onFileUpload:G}=r.useDocument(),{scrollContainerRef:V,hasScrolledRef:U,isLocked:W,setIsLocked:J}=a.useScrollContext(),{isGenerating:K,messages:Q}=g.useResponseContext(),X=l.useStyleFontSize(),[Y,Z]=o.useState(0),[$,ee]=o.useState(!1),[te,oe]=o.useState(!1),se=o.useRef(null),ie=o.useRef(null),ne=o.useRef(0),[re,ae]=o.useState(null),[le,ue]=o.useState(!1),ce=(null==E?void 0:E["new-chat"])||"New chat",de="chat-input"===w&&C&&!R,fe=null!==(S=null===(y=null==T?void 0:T.documentuploadtype)||void 0===y?void 0:y.startsWith("enduserupload"))&&void 0!==S&&S,{hasScrollableContent:he,isNearBottom:me}=u.default(V);o.useEffect((()=>()=>{M([])}),[]);const pe=o.useCallback((()=>{if(!P||!A)return;const t=(o=0)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield m.pickaxeApi2.post("/conversation/title",{sessionId:I,userId:A});if(t.data&&t.data.success){const e=t.data.title;if(e&&"Conversation Title"!==e)return void ve(e)}else console.error("Failed to load conversation:",null===(e=t.data)||void 0===e?void 0:e.error)}catch(e){console.error("Error fetching conversation:",e)}o<20&&setTimeout((()=>t(o+1)),3e3)}));t()}),[P,A,I]);o.useEffect((()=>{K||C||!I||pe()}),[K,C,I,pe]),o.useEffect((()=>{if(!se.current)return;const e=new ResizeObserver((e=>{for(const t of e){const{width:e,height:o}=t.contentRect;L(parseInt(e.toFixed(0)),parseInt(o.toFixed(0)))}}));return e.observe(se.current),()=>{e.disconnect()}}),[L]);const[xe,ve]=o.useState(ce),je=(null==T?void 0:T.formtitle)||"Pickaxe",ge=(null==T?void 0:T.coverphoto)||void 0,[be,ke]=o.useState(!1);o.useEffect((()=>{const e=!de&&!F&&_.portalTheme&&(Q.filter((e=>"user"===e.role)).length>0||$||!C);ke(null!=e&&e)}),[de,F,$,C,Q,_.portalTheme]);const ye=o.useCallback((()=>{U.current=!1,J(!0),requestAnimationFrame((()=>{const e=V.current;e&&e.scrollTo({top:Math.max(0,e.scrollHeight-e.clientHeight),behavior:"smooth"})}))}),[U,V,J]);return t.jsxs("div",Object.assign({ref:se,className:"relative flex h-full w-full flex-col items-center overflow-hidden",onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),fe&&(ne.current+=1,e.dataTransfer.items&&e.dataTransfer.items.length>0&&oe(!0))},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),fe&&(ne.current-=1,0===ne.current&&oe(!1))},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t.preventDefault(),t.stopPropagation(),oe(!1),ne.current=0,!fe)return;const e=Array.from(t.dataTransfer.files||[]);e.length>0&&(q(!1),yield G(e))}))},{children:[te&&t.jsxs("div",Object.assign({className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-lg bg-white/80 backdrop-blur-sm transition-all duration-300"},{children:[t.jsx("div",Object.assign({className:"flex h-24 w-24 items-center justify-center rounded-full bg-white shadow-lg animate-bounce text-black"},{children:t.jsx(f.default,{className:"h-10 w-10"})})),t.jsx("h3",Object.assign({className:h.default(X.h3,"mt-6 font-semibold text-c-primary text-black")},{children:(null==E?void 0:E["drop-files-to-upload"])||"Drop files to upload"})),t.jsx("p",Object.assign({className:h.default(X.b2,"mt-2 opacity-60 text-black")},{children:(null==E?void 0:E["add-anything-to-the-conversation"])||"Add anything to the conversation"}))]})),!F&&O&&H?t.jsx("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[800px] -translate-x-1/2 justify-end px-4"},{children:t.jsx("div",Object.assign({className:"pointer-events-auto"},{children:t.jsx(j.default,{})}))})):null,de?t.jsx(d.default,{}):t.jsxs(t.Fragment,{children:[be&&t.jsxs("div",Object.assign({className:h.default("direct-link"===w?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===_.portalTheme?"glass-dark ":"")},{children:[t.jsx(b.NavPill,{text:je,icon:ge}),C||xe===ce?t.jsx(b.NavPill,{text:xe}):t.jsx(b.EditableNavPill,{text:xe,sessionId:I,onRename:t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(I)try{yield m.pickaxeApi2.patch("/conversation/title",{sessionId:I,name:t,userId:A}),ve(t)}catch(e){console.error("Error renaming chat:",e),alert((null==E?void 0:E["failed-rename-chat"])||"Failed to rename chat.")}})),onDelete:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(I&&window.confirm((null==E?void 0:E["delete-confirm"])||"Are you sure you want to delete this conversation?"))try{yield m.pickaxeApi2.delete("/conversation",{data:{sessionId:I,userId:A}}),q(!0),D(p.v4()),ve(ce)}catch(e){console.error("Error deleting chat:",e),alert((null==E?void 0:E["failed-delete-chat"])||"Failed to delete chat.")}})),isDarkGlass:"dark"===_.portalTheme}),t.jsx(x.StudioTip,Object.assign({content:E["chat-history"]||"Chat History",align:"bottom",containerClassName:"inline-flex shrink-0"},{children:t.jsx(b.HistoryPill,{icon:t.jsx(k.default,{}),onClick:()=>{D(""),N(I)}})}))]})),t.jsx(c.default,{additionalScrollHeight:Y,isForceHideInfo:B<=545||z<=350||$,isInputFocused:$,onSubmit:t=>e.__awaiter(void 0,void 0,void 0,(function*(){ie.current&&ie.current.onSubmit(t)})),smitheryAuthData:re,resubmitPrompt:()=>{ae(null),ue(!0)}}),t.jsx(v.default,{isVisible:he&&!W&&!me,bottom:Y+65,onClick:ye}),t.jsx(d.default,{ref:ie,onFocus:()=>ee(!0),onBlur:()=>ee(!1),onInputHeightChange:Z,initSmitheryAuthData:e=>ae(e),resubmitPrompt:le})]})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),o=require("react"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),i=require("../Addons/Auth/hooks/useAuthContext.js"),n=require("../../../hooks/pickaxe/useDimensionContext.js"),r=require("../Addons/Document/hooks/useDocument.js"),a=require("../Addons/Scroll/hooks/useScrollContext.js"),l=require("../../../hooks/studio/useStyleFontSize.js"),u=require("../../../hooks/core/useScrollToBottomVisibility.js"),c=require("./History/index.js"),d=require("./Input.js"),f=require("../../Icons/attach-vertical.svg.js"),h=require("../../../common/cn.js"),m=require("../../../common/api/pickaxe.js"),p=require("uuid"),x=require("../../Core/StudioTip.js"),v=require("../common/ScrollToBottomButton.js"),j=require("../common/PickaxeMCPButton.js"),g=require("../../../hooks/pickaxe/useResponseContext.js"),b=require("../Addons/Navbar/NavPill.js"),k=require("../../Icons/history.svg.js");exports.default=()=>{var y,S;const{deploymentType:w,isNewChat:C,setIsNewChat:q,sessionId:I,setSessionId:D,setLastSessionId:N,pickaxeId:P,sender:A,pickaxe:T,styles:_,isEmbed:F,mcpEnabled:O,translations:E}=s.usePickaxeContext(),{isSent:R}=i.useAuthContext(),{width:H,height:z,setDimension:B}=n.useDimensionContext(),{setDocuments:L,onFileUpload:M}=r.useDocument(),{scrollContainerRef:G,hasScrolledRef:V,isLocked:U,setIsLocked:W}=a.useScrollContext(),{isGenerating:J,messages:K}=g.useResponseContext(),Q=l.useStyleFontSize(),[X,Y]=o.useState(0),[Z,$]=o.useState(!1),[ee,te]=o.useState(!1),oe=o.useRef(null),se=o.useRef(null),ie=o.useRef(0),[ne,re]=o.useState(null),[ae,le]=o.useState(!1),ue=(null==E?void 0:E["new-chat"])||"New chat",ce="chat-input"===w&&C&&!R,de=null!==(S=null===(y=null==T?void 0:T.documentuploadtype)||void 0===y?void 0:y.startsWith("enduserupload"))&&void 0!==S&&S,{hasScrollableContent:fe,isNearBottom:he}=u.default(G);o.useEffect((()=>()=>{L([])}),[]);const me=o.useCallback((()=>{if(!P||!A)return;const t=(o=0)=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{const t=yield m.pickaxeApi2.post("/conversation/title",{sessionId:I,userId:A});if(t.data&&t.data.success){const e=t.data.title;if(e&&"Conversation Title"!==e)return void xe(e)}else console.error("Failed to load conversation:",null===(e=t.data)||void 0===e?void 0:e.error)}catch(e){console.error("Error fetching conversation:",e)}o<20&&setTimeout((()=>t(o+1)),3e3)}));t()}),[P,A,I]);o.useEffect((()=>{J||C||!I||me()}),[J,C,I,me]),o.useEffect((()=>{if(!oe.current)return;const e=new ResizeObserver((e=>{for(const t of e){const{width:e,height:o}=t.contentRect;B(parseInt(e.toFixed(0)),parseInt(o.toFixed(0)))}}));return e.observe(oe.current),()=>{e.disconnect()}}),[B]);const[pe,xe]=o.useState(ue),ve=(null==T?void 0:T.formtitle)||"Pickaxe",je=(null==T?void 0:T.coverphoto)||void 0,[ge,be]=o.useState(!1);o.useEffect((()=>{const e=!ce&&!F&&_.portalTheme&&(K.filter((e=>"user"===e.role)).length>0||Z||!C);be(null!=e&&e)}),[ce,F,Z,C,K,_.portalTheme]);const ke=o.useCallback((()=>{V.current=!1,W(!0),requestAnimationFrame((()=>{const e=G.current;e&&e.scrollTo({top:Math.max(0,e.scrollHeight-e.clientHeight),behavior:"smooth"})}))}),[V,G,W]);return t.jsxs("div",Object.assign({ref:oe,className:"relative flex h-full w-full flex-col items-center overflow-hidden",onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),de&&(ie.current+=1,e.dataTransfer.items&&e.dataTransfer.items.length>0&&te(!0))},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),de&&(ie.current-=1,0===ie.current&&te(!1))},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(t.preventDefault(),t.stopPropagation(),te(!1),ie.current=0,!de)return;const e=Array.from(t.dataTransfer.files||[]);e.length>0&&(q(!1),yield M(e))}))},{children:[ee&&t.jsxs("div",Object.assign({className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-lg bg-white/80 backdrop-blur-sm transition-all duration-300"},{children:[t.jsx("div",Object.assign({className:"flex h-24 w-24 items-center justify-center rounded-full bg-white shadow-lg animate-bounce text-black"},{children:t.jsx(f.default,{className:"h-10 w-10"})})),t.jsx("h3",Object.assign({className:h.default(Q.h3,"mt-6 font-semibold text-c-primary text-black")},{children:(null==E?void 0:E["drop-files-to-upload"])||"Drop files to upload"})),t.jsx("p",Object.assign({className:h.default(Q.b2,"mt-2 opacity-60 text-black")},{children:(null==E?void 0:E["add-anything-to-the-conversation"])||"Add anything to the conversation"}))]})),!F&&O?t.jsx("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[800px] -translate-x-1/2 justify-end px-4"},{children:t.jsx("div",Object.assign({className:"pointer-events-auto"},{children:t.jsx(j.default,{})}))})):null,ce?t.jsx(d.default,{}):t.jsxs(t.Fragment,{children:[ge&&t.jsxs("div",Object.assign({className:h.default("direct-link"===w?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===_.portalTheme?"glass-dark ":"")},{children:[t.jsx(b.NavPill,{text:ve,icon:je}),C||pe===ue?t.jsx(b.NavPill,{text:pe}):t.jsx(b.EditableNavPill,{text:pe,sessionId:I,onRename:t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(I)try{yield m.pickaxeApi2.patch("/conversation/title",{sessionId:I,name:t,userId:A}),xe(t)}catch(e){console.error("Error renaming chat:",e),alert((null==E?void 0:E["failed-rename-chat"])||"Failed to rename chat.")}})),onDelete:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(I&&window.confirm((null==E?void 0:E["delete-confirm"])||"Are you sure you want to delete this conversation?"))try{yield m.pickaxeApi2.delete("/conversation",{data:{sessionId:I,userId:A}}),q(!0),D(p.v4()),xe(ue)}catch(e){console.error("Error deleting chat:",e),alert((null==E?void 0:E["failed-delete-chat"])||"Failed to delete chat.")}})),isDarkGlass:"dark"===_.portalTheme}),t.jsx(x.StudioTip,Object.assign({content:E["chat-history"]||"Chat History",align:"bottom",containerClassName:"inline-flex shrink-0"},{children:t.jsx(b.HistoryPill,{icon:t.jsx(k.default,{}),onClick:()=>{D(""),N(I)}})}))]})),t.jsx(c.default,{additionalScrollHeight:X,isForceHideInfo:z<=545||H<=350||Z,isInputFocused:Z,onSubmit:t=>e.__awaiter(void 0,void 0,void 0,(function*(){se.current&&se.current.onSubmit(t)})),smitheryAuthData:ne,resubmitPrompt:()=>{re(null),le(!0)}}),t.jsx(v.default,{isVisible:fe&&!U&&!he,bottom:X+65,onClick:ke}),t.jsx(d.default,{ref:se,onFocus:()=>$(!0),onBlur:()=>$(!1),onInputHeightChange:Y,initSmitheryAuthData:e=>re(e),resubmitPrompt:ae})]})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),l=require("../Addons/Auth/hooks/useAuthContext.js"),i=require("../../../hooks/core/useScrollToBottomVisibility.js"),n=require("../../../hooks/studio/useStyleFontSize.js"),o=require("../common/PickaxeHead.js"),r=require("../common/PickaxeEmbedHead.js"),a=require("../common/PickaxeMCPButton.js"),c=require("../common/ScrollToBottomButton.js"),u=require("./History/index.js"),d=require("./NewChat.js"),x=require("./Questions/index.js"),f=require("../../../common/cn.js"),m=require("../Addons/Navbar/NavPill.js");exports.default=()=>{const{lastSessionId:j,pickaxe:v,responsiveBy:p,translations:h,isEmbed:b,mcpEnabled:g,deploymentType:w,styles:k,setLastSessionId:y,setSessionId:N}=s.usePickaxeContext(),{isLoggedIn:O}=l.useAuthContext(),C=(null==v?void 0:v.formtitle)||"Pickaxe",E=(null==v?void 0:v.coverphoto)||void 0,q=n.useStyleFontSize(),L=t.useRef(null),S=t.useRef(null),[P,B]=t.useState(!0),H=b&&(null==v?void 0:v.chatflag),{hasScrollableContent:M,isNearBottom:T}=i.default(L,{targetRef:S,activeOffset:48},[Boolean(null==v?void 0:v.chatflag)]);t.useEffect((()=>{T&&B(!0)}),[T]),t.useEffect((()=>{const e=L.current;if(!e)return;const t=()=>{B(!1)};return e.addEventListener("mousedown",t),e.addEventListener("touchmove",t,{passive:!0}),e.addEventListener("wheel",t,{passive:!0}),e.addEventListener("DOMMouseScroll",t),e.addEventListener("mousewheel",t),()=>{e.removeEventListener("mousedown",t),e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t),e.removeEventListener("DOMMouseScroll",t),e.removeEventListener("mousewheel",t)}}),[]);const z=t.useCallback((()=>{if(!L.current||!S.current)return;const e=L.current.getBoundingClientRect(),t=S.current.getBoundingClientRect().bottom-e.top+L.current.scrollTop;B(!0),L.current.scrollTo({top:Math.max(0,t-L.current.clientHeight),behavior:"smooth"})}),[]),A=t.useCallback((()=>{B(!1)}),[]);return e.jsxs("div",Object.assign({className:f.default("relative flex h-full w-full flex-col items-center overflow-hidden")},{children:[e.jsxs("div",Object.assign({ref:L,className:f.default("flex h-full w-full flex-col items-center overflow-y-auto","pt-0","viewport"===p?"min-[767px]:pb-10":"@[767px]/pickaxe-root:pb-10")},{children:[!b&&e.jsx("div",Object.assign({className:f.default("direct-link"===w?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===k.portalTheme?"glass-dark ":"")},{children:e.jsx(m.NavPill,{text:C,icon:E,onClick:()=>{N(j),y("")}})})),!b&&g&&O?e.jsx("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[700px] -translate-x-1/2 justify-end"},{children:e.jsx("div",Object.assign({className:"pointer-events-auto"},{children:e.jsx(a.default,{})}))})):null,H?e.jsxs(e.Fragment,{children:[e.jsx(r.default,{className:"sticky top-0 z-10 w-full",historyBtnTip:(null==h?void 0:h["exit-chat-history"])||"Exit Chat History",onHistoryClick:()=>N(j)}),e.jsx("div",Object.assign({className:"relative flex min-h-[56px] w-full justify-end rounded-tl-lg rounded-tr-lg border-y p-4"},{children:e.jsx("p",Object.assign({className:f.default(q.b1,"absolute left-1/2 -translate-x-1/2 select-none text-center")},{children:(null==h?void 0:h["chat-history"])||"Chat History"}))}))]}):e.jsxs("div",Object.assign({className:"flex w-full max-w-[700px] flex-col"},{children:[b&&g&&O?e.jsx("div",Object.assign({className:"flex w-full justify-end"},{children:e.jsx("div",Object.assign({className:f.default("mr-3 flex","popup"===w&&"pr-10")},{children:e.jsx(a.default,{})}))})):null,e.jsx(o.default,{})]})),e.jsx("div",Object.assign({className:f.default("flex w-full min-h-0 flex-col items-center",H?"px-4":"px-6")},{children:e.jsx("div",Object.assign({className:"flex h-full w-full max-w-[700px] flex-col"},{children:e.jsxs("div",Object.assign({className:f.default("flex h-full flex-col gap-y-8","viewport"===p?"min-[767px]:mt-4":"@[767px]/pickaxe-root:mt-4")},{children:[e.jsx("div",Object.assign({ref:S,className:"flex flex-col"},{children:(null==v?void 0:v.chatflag)?e.jsx(d.default,{}):e.jsx(x.default,{onLongInputPaste:A})})),e.jsx(u.default,{})]}))}))}))]})),e.jsx(c.default,{bottom:30,isVisible:M&&!P&&!T,onClick:z})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),l=require("../../../hooks/core/useScrollToBottomVisibility.js"),i=require("../../../hooks/studio/useStyleFontSize.js"),n=require("../common/PickaxeHead.js"),o=require("../common/PickaxeEmbedHead.js"),a=require("../common/PickaxeMCPButton.js"),r=require("../common/ScrollToBottomButton.js"),c=require("./History/index.js"),u=require("./NewChat.js"),d=require("./Questions/index.js"),x=require("../../../common/cn.js"),f=require("../Addons/Navbar/NavPill.js");exports.default=()=>{const{lastSessionId:m,pickaxe:v,responsiveBy:j,translations:p,isEmbed:h,mcpEnabled:b,deploymentType:g,styles:w,setLastSessionId:y,setSessionId:k}=s.usePickaxeContext(),N=(null==v?void 0:v.formtitle)||"Pickaxe",O=(null==v?void 0:v.coverphoto)||void 0,E=i.useStyleFontSize(),q=t.useRef(null),C=t.useRef(null),[S,L]=t.useState(!0),P=h&&(null==v?void 0:v.chatflag),{hasScrollableContent:B,isNearBottom:H}=l.default(q,{targetRef:C,activeOffset:48},[Boolean(null==v?void 0:v.chatflag)]);t.useEffect((()=>{H&&L(!0)}),[H]),t.useEffect((()=>{const e=q.current;if(!e)return;const t=()=>{L(!1)};return e.addEventListener("mousedown",t),e.addEventListener("touchmove",t,{passive:!0}),e.addEventListener("wheel",t,{passive:!0}),e.addEventListener("DOMMouseScroll",t),e.addEventListener("mousewheel",t),()=>{e.removeEventListener("mousedown",t),e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t),e.removeEventListener("DOMMouseScroll",t),e.removeEventListener("mousewheel",t)}}),[]);const M=t.useCallback((()=>{if(!q.current||!C.current)return;const e=q.current.getBoundingClientRect(),t=C.current.getBoundingClientRect().bottom-e.top+q.current.scrollTop;L(!0),q.current.scrollTo({top:Math.max(0,t-q.current.clientHeight),behavior:"smooth"})}),[]),T=t.useCallback((()=>{L(!1)}),[]);return e.jsxs("div",Object.assign({className:x.default("relative flex h-full w-full flex-col items-center overflow-hidden")},{children:[e.jsxs("div",Object.assign({ref:q,className:x.default("flex h-full w-full flex-col items-center overflow-y-auto","pt-0","viewport"===j?"min-[767px]:pb-10":"@[767px]/pickaxe-root:pb-10")},{children:[!h&&e.jsx("div",Object.assign({className:x.default("direct-link"===g?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===w.portalTheme?"glass-dark ":"")},{children:e.jsx(f.NavPill,{text:N,icon:O,onClick:()=>{k(m),y("")}})})),!h&&b?e.jsx("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[700px] -translate-x-1/2 justify-end"},{children:e.jsx("div",Object.assign({className:"pointer-events-auto"},{children:e.jsx(a.default,{})}))})):null,P?e.jsxs(e.Fragment,{children:[e.jsx(o.default,{className:"sticky top-0 z-10 w-full",historyBtnTip:(null==p?void 0:p["exit-chat-history"])||"Exit Chat History",onHistoryClick:()=>k(m)}),e.jsx("div",Object.assign({className:"relative flex min-h-[56px] w-full justify-end rounded-tl-lg rounded-tr-lg border-y p-4"},{children:e.jsx("p",Object.assign({className:x.default(E.b1,"absolute left-1/2 -translate-x-1/2 select-none text-center")},{children:(null==p?void 0:p["chat-history"])||"Chat History"}))}))]}):e.jsxs("div",Object.assign({className:"flex w-full max-w-[700px] flex-col"},{children:[h&&b?e.jsx("div",Object.assign({className:"flex w-full justify-end"},{children:e.jsx("div",Object.assign({className:x.default("mr-3 flex","popup"===g&&"pr-10")},{children:e.jsx(a.default,{})}))})):null,e.jsx(n.default,{})]})),e.jsx("div",Object.assign({className:x.default("flex w-full min-h-0 flex-col items-center",P?"px-4":"px-6")},{children:e.jsx("div",Object.assign({className:"flex h-full w-full max-w-[700px] flex-col"},{children:e.jsxs("div",Object.assign({className:x.default("flex h-full flex-col gap-y-8","viewport"===j?"min-[767px]:mt-4":"@[767px]/pickaxe-root:mt-4")},{children:[e.jsx("div",Object.assign({ref:C,className:"flex flex-col"},{children:(null==v?void 0:v.chatflag)?e.jsx(u.default,{}):e.jsx(d.default,{onLongInputPaste:T})})),e.jsx(c.default,{})]}))}))}))]})),e.jsx(r.default,{bottom:30,isVisible:B&&!S&&!H,onClick:M})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),o=require("./Addons/Artifact/Provider.js"),n=require("./DimensionProvider.js"),a=require("./ResponseProvider.js"),s=require("./Addons/Document/Provider.js"),r=require("./Addons/Auth/Provider.js");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}const d=i.createContext({});exports.PickaxeContext=d,exports.PickaxeProvider=({children:c,origin:u,sender:p,senderType:f,deploymentId:g,portalId:h,deploymentType:m,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:S={},misc:k={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:P,artifact:C={popupType:"auto"},responsiveBy:x="viewport",locale:I="en",opacity:F=1,forceMobile:A=!1,disableHtml:q=!1,disableJs:T=!1,disableCss:j=!1,loadFont:D=!0,isRtl:O=!1,isEmbed:U=!1,mcpEnabled:E=!1,studioSessionToken:M,isDropShadow:R=!1,allowGuestUsage:L=!0,persistActiveConversation:G=!1,preventInitialSessionId:H=!1,onUpgrade:W,onGenerateComplete:_,onSessionIdChange:B})=>{const[N,V]=i.useState(""),[Y,X]=i.useState(""),[z,J]=i.useState(""),[Q,K]=i.useState(""),[Z,$]=i.useState(p),[ee,te]=i.useState(null),[ie,oe]=i.useState(f),[ne,ae]=i.useState("loading"),[se,re]=i.useState([]),[le,de]=i.useState(null),[ce,ue]=i.useState(null),[pe,fe]=i.useState(null),[ge,he]=i.useState(null),[me,ye]=i.useState("");i.useEffect((()=>ye("")),[Y]);const[ve,be]=i.useState(!1),[we,Se]=i.useState(!0),[ke,Pe]=i.useState(!0),[Ce,xe]=i.useState(!1);return i.useEffect((()=>{be(!1)}),[null==b?void 0:b.font]),i.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&D&&!ve&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield Promise.resolve().then((function(){return l(require("webfontloader"))}))).default.load({google:{families:[b.font]},active:()=>{be(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),be(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),be(!0)}}))}),[D,ve,null==b?void 0:b.font]),i.useEffect((()=>{$(p)}),[p]),t.jsx(d.Provider,Object.assign({value:Object.assign(Object.assign({origin:u,contextId:N,pickaxeId:Y,sessionId:z,lastSessionId:Q,sender:Z,senderType:ie,portalId:h,deploymentId:g,deploymentType:m,validationStatus:ne,validationUpgradeGroups:se,validationUpgradeUrl:le,deploymentDimensions:y,deploymentMisc:v,accessGroup:ee,pickaxe:ge,selectedModel:me,setSelectedModel:ye,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:k,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},P),artifact:C,responsiveBy:x,locale:I,opacity:F,forceMobile:A,loadFont:D,disableHtml:q,disableJs:T,disableCss:j,isFontLoaded:ve,isNewChat:we,isShowIceBreaker:ke,isShowFeedbackMessage:Ce,isRtl:O,isEmbed:U,mcpEnabled:E,isDropShadow:R,allowGuestUsage:L,persistActiveConversation:G,clientSecret:pe,stripeAccountId:ce,preventInitialSessionId:H,setClientSecret:fe,setStripeAccountId:ue,setContextId:V,setValidationStatus:ae,setValidationUpgradeGroups:re,setValidationUpgradeUrl:de,setPickaxeId:X,setSessionId:e=>{J((t=>{const i="function"==typeof e?e(t):e;return null==B||B(i),i}))},setLastSessionId:K,setSender:$,setSenderType:oe,setAccessGroup:te,setPickaxe:he,setIsFontLoaded:be,setIsNewChat:Se,setIsShowIceBreaker:Pe,setIsShowFeedbackMessage:xe},W&&{onUpgrade:W}),_&&{onGenerateComplete:_})},{children:t.jsx(r.default,Object.assign({initialToken:M},{children:t.jsx(n.default,{children:t.jsx(a.default,Object.assign({limits:S},{children:t.jsx(s.default,{children:t.jsx(o.ArtifactProvider,Object.assign({},C,{children:c}))})}))})}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),o=require("./Addons/Artifact/Provider.js"),n=require("./DimensionProvider.js"),a=require("./ResponseProvider.js"),s=require("./Addons/Document/Provider.js"),r=require("./Addons/Auth/Provider.js");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}const d=i.createContext({});exports.PickaxeContext=d,exports.PickaxeProvider=({children:c,origin:u,sender:p,senderType:f,deploymentId:g,portalId:m,deploymentType:h,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:S={},misc:k={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:P,artifact:C={popupType:"auto"},responsiveBy:x="viewport",locale:I="en",opacity:F=1,forceMobile:A=!1,disableHtml:q=!1,disableJs:T=!1,disableCss:j=!1,loadFont:D=!0,isRtl:O=!1,isEmbed:U=!1,mcpEnabled:E=!1,mcpGuestId:M,studioSessionToken:R,isDropShadow:L=!1,allowGuestUsage:G=!0,persistActiveConversation:H=!1,preventInitialSessionId:W=!1,onUpgrade:_,onGenerateComplete:B,onSessionIdChange:N})=>{const[V,Y]=i.useState(""),[X,z]=i.useState(""),[J,Q]=i.useState(""),[K,Z]=i.useState(""),[$,ee]=i.useState(p),[te,ie]=i.useState(null),[oe,ne]=i.useState(f),[ae,se]=i.useState("loading"),[re,le]=i.useState([]),[de,ce]=i.useState(null),[ue,pe]=i.useState(null),[fe,ge]=i.useState(null),[me,he]=i.useState(null),[ye,ve]=i.useState("");i.useEffect((()=>ve("")),[X]);const[be,we]=i.useState(!1),[Se,ke]=i.useState(!0),[Pe,Ce]=i.useState(!0),[xe,Ie]=i.useState(!1);return i.useEffect((()=>{we(!1)}),[null==b?void 0:b.font]),i.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&D&&!be&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield Promise.resolve().then((function(){return l(require("webfontloader"))}))).default.load({google:{families:[b.font]},active:()=>{we(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),we(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),we(!0)}}))}),[D,be,null==b?void 0:b.font]),i.useEffect((()=>{ee(p)}),[p]),t.jsx(d.Provider,Object.assign({value:Object.assign(Object.assign({origin:u,contextId:V,pickaxeId:X,sessionId:J,lastSessionId:K,sender:$,senderType:oe,portalId:m,deploymentId:g,deploymentType:h,validationStatus:ae,validationUpgradeGroups:re,validationUpgradeUrl:de,deploymentDimensions:y,deploymentMisc:v,accessGroup:te,pickaxe:me,selectedModel:ye,setSelectedModel:ve,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:k,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},P),artifact:C,responsiveBy:x,locale:I,opacity:F,forceMobile:A,loadFont:D,disableHtml:q,disableJs:T,disableCss:j,isFontLoaded:be,isNewChat:Se,isShowIceBreaker:Pe,isShowFeedbackMessage:xe,isRtl:O,isEmbed:U,mcpEnabled:E,mcpGuestId:M,isDropShadow:L,allowGuestUsage:G,persistActiveConversation:H,clientSecret:fe,stripeAccountId:ue,preventInitialSessionId:W,setClientSecret:ge,setStripeAccountId:pe,setContextId:Y,setValidationStatus:se,setValidationUpgradeGroups:le,setValidationUpgradeUrl:ce,setPickaxeId:z,setSessionId:e=>{Q((t=>{const i="function"==typeof e?e(t):e;return null==N||N(i),i}))},setLastSessionId:Z,setSender:ee,setSenderType:ne,setAccessGroup:ie,setPickaxe:he,setIsFontLoaded:we,setIsNewChat:ke,setIsShowIceBreaker:Ce,setIsShowFeedbackMessage:Ie},_&&{onUpgrade:_}),B&&{onGenerateComplete:B})},{children:t.jsx(r.default,Object.assign({initialToken:R},{children:t.jsx(n.default,{children:t.jsx(a.default,Object.assign({limits:S},{children:t.jsx(s.default,{children:t.jsx(o.ArtifactProvider,Object.assign({},C,{children:c}))})}))})}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../hooks/pickaxe/usePickaxeContext.js"),i=require("../Addons/Auth/hooks/useAuthContext.js"),o=require("../../../hooks/studio/useStyleFontSize.js"),l=require("./PickaxeIcon.js"),r=require("./PickaxeHistoryButton.js"),n=require("./PickaxeLogoutButton.js"),u=require("./PickaxeMCPButton.js"),c=require("../../../common/cn.js");exports.default=({className:a,iconClassName:d,historyBtnTip:x,onIconClick:p,onHistoryClick:j})=>{const{deploymentType:m,pickaxe:f,misc:h,colors:k,translations:g,mcpEnabled:y}=t.usePickaxeContext(),{isLoggedIn:b}=i.useAuthContext(),v=y&&b,C=o.useStyleFontSize(),P=s.useMemo((()=>({title:(null==f?void 0:f.formtitle)||"",description:(null==f?void 0:f.formdescription)||""})),[f]);return h.isTitle||h.isDescription||!h.isWhiteLabel||v?e.jsxs("div",Object.assign({className:c.default("flex min-h-[56px] items-center justify-between gap-4 px-4",a),style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-4"},{children:[h.isProfileImage&&e.jsx(l.default,Object.assign({src:null==f?void 0:f.coverphoto,alt:`${null==f?void 0:f.formtitle}'s Profile Picture`,width:32,height:32,className:c.default("h-[32px] w-[32px] shrink-0 rounded-full",d,!!p&&"cursor-pointer")},p&&{onClick:p})),h.isTitle&&e.jsx("p",Object.assign({className:c.default(C.b1)},{children:P.title}))]})),j||v?e.jsxs("div",Object.assign({className:c.default("popup"===m&&"pr-10","flex items-center gap-1")},{children:[v?e.jsx(u.default,{}):null,j?e.jsx(r.default,{tip:x,onClick:j}):null,b&&j&&e.jsx(n.default,{tip:(null==g?void 0:g["log-out"])||"Log Out"})]})):null]})):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../hooks/pickaxe/usePickaxeContext.js"),i=require("../Addons/Auth/hooks/useAuthContext.js"),o=require("../../../hooks/studio/useStyleFontSize.js"),l=require("./PickaxeIcon.js"),r=require("./PickaxeHistoryButton.js"),n=require("./PickaxeLogoutButton.js"),u=require("./PickaxeMCPButton.js"),c=require("../../../common/cn.js");exports.default=({className:a,iconClassName:d,historyBtnTip:x,onIconClick:p,onHistoryClick:j})=>{const{deploymentType:m,pickaxe:f,misc:h,colors:k,translations:g,mcpEnabled:y}=t.usePickaxeContext(),{isLoggedIn:b}=i.useAuthContext(),v=y,C=o.useStyleFontSize(),P=s.useMemo((()=>({title:(null==f?void 0:f.formtitle)||"",description:(null==f?void 0:f.formdescription)||""})),[f]);return h.isTitle||h.isDescription||!h.isWhiteLabel||v?e.jsxs("div",Object.assign({className:c.default("flex min-h-[56px] items-center justify-between gap-4 px-4",a),style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-4"},{children:[h.isProfileImage&&e.jsx(l.default,Object.assign({src:null==f?void 0:f.coverphoto,alt:`${null==f?void 0:f.formtitle}'s Profile Picture`,width:32,height:32,className:c.default("h-[32px] w-[32px] shrink-0 rounded-full",d,!!p&&"cursor-pointer")},p&&{onClick:p})),h.isTitle&&e.jsx("p",Object.assign({className:c.default(C.b1)},{children:P.title}))]})),j||v?e.jsxs("div",Object.assign({className:c.default("popup"===m&&"pr-10","flex items-center gap-1")},{children:[v?e.jsx(u.default,{}):null,j?e.jsx(r.default,{tip:x,onClick:j}):null,b&&j&&e.jsx(n.default,{tip:(null==g?void 0:g["log-out"])||"Log Out"})]})):null]})):null};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("copy-to-clipboard"),a=require("framer-motion"),r=require("../../Icons/terminal.svg.js"),o=require("../../Icons/copy.svg.js"),n=require("../../Icons/check.svg.js"),i=require("../../Icons/chevron-down.svg.js"),c=require("../../Core/Modal/index.js"),l=require("../../Core/Modal/Body.js"),u=require("../../Core/Modal/CloseButton.js"),d=require("../../../hooks/pickaxe/usePickaxeContext.js"),p=require("../../../hooks/studio/useStyleFontSize.js"),h=require("../Addons/Auth/hooks/useAuthContext.js"),m=require("./PickaxeSimpleButton.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var j=x(t);const b={codex:"Codex",claude:"Claude Code",cursor:"Cursor",vscode:"VS Code",other:"Other"};exports.default=()=>{const{colors:t,styles:x,deploymentId:g,mcpEnabled:y,translations:f}=d.usePickaxeContext(),{token:v}=h.useAuthContext(),C=p.useStyleFontSize(),[O,w]=s.useState(!1),[k,N]=s.useState(!1),[S,q]=s.useState(!1),[$,A]=s.useState("codex"),I=(e,s)=>{var t;return null!==(t=null==f?void 0:f[e])&&void 0!==t?t:s},R=s.useMemo((()=>{if(!g)return"";const e=process.env.NEXT_PUBLIC_API_MCP_URL||"https://mcp.pickaxe.co",s=new URL(e),t=s.pathname.replace(/\/+$/,"");return s.pathname=t.endsWith("/deployment")?t:`${t}/deployment`,s.searchParams.set("id",g),s.toString()}),[g]),P=s.useMemo((()=>{const e=`Bearer ${null!=v?v:"YOUR_STUDIO_SESSION_TOKEN"}`;return"codex"===$?`[mcp_servers.pickaxe]\nurl = "${R}"\nhttp_headers = { Authorization = "${e}" }`:"claude"===$?`claude mcp add --transport http --scope user pickaxe "${R}" --header "Authorization: ${e}"`:"vscode"===$?JSON.stringify({servers:{pickaxe:{type:"http",url:R,headers:{Authorization:e}}}},null,2):"cursor"===$?JSON.stringify({mcpServers:{pickaxe:{url:R,headers:{Authorization:e}}}},null,2):`URL: ${R}\nAuthorization: ${e}`}),[$,R,v]);if(!y||!g||!v)return null;return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"relative"},{children:[e.jsxs(m.default,Object.assign({className:"h-8 w-8 shrink-0 justify-center rounded-full",color:t.accent,onClick:()=>w(!0),onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1)},{children:[e.jsx(r.default,{className:"h-5 w-5"}),e.jsx("span",Object.assign({className:"sr-only"},{children:I("mcp-use-with-ai-app","Use with an AI app")}))]})),e.jsx(a.AnimatePresence,{children:k?e.jsx(a.motion.div,Object.assign({className:"absolute right-0 top-10 z-20 w-max rounded px-3 py-2 text-xs font-medium",style:{background:t.accent,color:t.accentText},initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}},{children:I("mcp-use-with-ai-app","Use with an AI app")})):null})]})),e.jsx(c.default,Object.assign({isOpen:O,onChange:w},{children:e.jsx(l.default,Object.assign({portalClassName:"dark"===x.theme?"dark":void 0,wrapperClassName:"mx-4 w-[min(92vw,560px)]",className:"w-full overflow-hidden p-0",style:Object.assign({backgroundColor:t.secondary,borderColor:`${t.accent}40`,borderRadius:x.cornerRadius,color:t.secondaryText},"Real Head Pro"!==x.font&&{fontFamily:x.font})},{children:e.jsxs("div",Object.assign({className:"flex flex-col gap-5 p-6"},{children:[e.jsxs("div",Object.assign({className:"flex items-start justify-between gap-4"},{children:[e.jsxs("div",{children:[e.jsx("h2",Object.assign({className:`${C.h4} font-semibold`},{children:I("mcp-use-agent-in-ai-app","Use this agent in your AI app")})),e.jsx("p",Object.assign({className:`${C.b3} mt-1 opacity-70`},{children:I("mcp-connect-description","Connect through MCP. Requests will be sent as your signed-in Studio user.")}))]}),e.jsx(u.default,{className:"shrink-0"})]})),e.jsxs("label",Object.assign({className:`${C.l2} flex flex-col gap-2 font-medium`},{children:[I("mcp-ai-app","AI app"),e.jsxs("div",Object.assign({className:"relative"},{children:[e.jsx("select",Object.assign({className:"w-full appearance-none border py-2 pl-3 pr-10 outline-none",style:{backgroundColor:t.primary,borderColor:`${t.accent}40`,borderRadius:x.cornerRadius,color:t.text},value:$,onChange:e=>A(e.target.value)},{children:Object.entries(b).map((([s,t])=>e.jsx("option",Object.assign({value:s},{children:"other"===s?I("other","Other"):t}),s)))})),e.jsx(i.default,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:t.text}})]}))]})),e.jsxs("div",Object.assign({className:"relative min-w-0"},{children:[e.jsx("pre",Object.assign({className:"max-h-64 w-full overflow-auto whitespace-pre-wrap break-all border p-4 pr-12 text-xs",style:{backgroundColor:t.primary,borderColor:`${t.accent}40`,borderRadius:x.cornerRadius,color:t.text}},{children:P})),e.jsx("button",Object.assign({type:"button",className:"absolute right-3 top-3 border p-2 transition-opacity hover:opacity-70",style:{backgroundColor:t.accent,borderColor:t.accent,borderRadius:x.cornerRadius,color:t.accentText},"aria-label":I("mcp-copy-configuration","Copy MCP configuration"),onClick:()=>{j.default(P),q(!0),window.setTimeout((()=>q(!1)),1800)}},{children:S?e.jsx(n.default,{className:"h-4 w-4"}):e.jsx(o.default,{className:"h-4 w-4"})}))]})),e.jsx("p",Object.assign({className:`${C.b4} opacity-60`},{children:I("mcp-private-configuration-note","Keep this configuration private. It contains your Studio session token and stops working when that session expires.")}))]}))}))}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),r=require("copy-to-clipboard"),a=require("framer-motion"),o=require("../../Icons/terminal.svg.js"),n=require("../../Icons/copy.svg.js"),i=require("../../Icons/check.svg.js"),c=require("../../Icons/chevron-down.svg.js"),l=require("../../../common/api/utils.js"),u=require("../../../common/utils.js"),d=require("../../Core/Modal/index.js"),p=require("../../Core/Modal/Body.js"),h=require("../../Core/Modal/CloseButton.js"),m=require("../../../hooks/pickaxe/usePickaxeContext.js"),x=require("../../../hooks/studio/useStyleFontSize.js"),j=require("../Addons/Auth/hooks/useAuthContext.js"),b=require("./PickaxeSimpleButton.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=g(r);const f={codex:"Codex",claude:"Claude Code",cursor:"Cursor",vscode:"VS Code",other:"Other"};exports.default=()=>{const{colors:r,styles:g,deploymentId:v,mcpEnabled:C,mcpGuestId:w,sender:k,translations:N}=m.usePickaxeContext(),{token:O}=j.useAuthContext(),q=x.useStyleFontSize(),[S,$]=t.useState(!1),[R,I]=t.useState(!1),[P,A]=t.useState(!1),[M,_]=t.useState(null),[z,U]=t.useState(!1),[T,B]=t.useState(!1),[E,L]=t.useState("codex"),F=(e,s)=>{var t;return null!==(t=null==N?void 0:N[e])&&void 0!==t?t:s},G=t.useMemo((()=>{if(!v)return"";const e=process.env.NEXT_PUBLIC_API_MCP_URL||"https://mcp.pickaxe.co",s=new URL(e),t=s.pathname.replace(/\/+$/,"");return s.pathname=t.endsWith("/deployment")?t:`${t}/deployment`,s.searchParams.set("id",v),s.toString()}),[v]),J=O||M,H=t.useMemo((()=>{if(!J)return"";const e=`Bearer ${J}`;return"codex"===E?`[mcp_servers.pickaxe]\nurl = "${G}"\nhttp_headers = { Authorization = "${e}" }`:"claude"===E?`claude mcp add --transport http --scope user pickaxe "${G}" --header "Authorization: ${e}"`:"vscode"===E?JSON.stringify({servers:{pickaxe:{type:"http",url:G,headers:{Authorization:e}}}},null,2):"cursor"===E?JSON.stringify({mcpServers:{pickaxe:{url:G,headers:{Authorization:e}}}},null,2):`URL: ${G}\nAuthorization: ${e}`}),[E,G,J]);if(!C||!v)return null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",Object.assign({className:"relative"},{children:[s.jsxs(b.default,Object.assign({className:"h-8 w-8 shrink-0 justify-center rounded-full",color:r.accent,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if($(!0),!J&&!z){U(!0),B(!1);try{const e=w||k||u.initializeEmbedUserId(),s=yield l.default.post("/pickaxe/mcp-session",{deploymentId:v,guestId:e});if(!s.data.success||!s.data.token)throw new Error("Guest MCP session was not created");_(s.data.token)}catch(e){console.error("[pxe] failed to prepare MCP configuration",e),B(!0)}finally{U(!1)}}})),onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1)},{children:[s.jsx(o.default,{className:"h-5 w-5"}),s.jsx("span",Object.assign({className:"sr-only"},{children:F("mcp-use-with-ai-app","Use with an AI app")}))]})),s.jsx(a.AnimatePresence,{children:R?s.jsx(a.motion.div,Object.assign({className:"absolute right-0 top-10 z-20 w-max rounded px-3 py-2 text-xs font-medium",style:{background:r.accent,color:r.accentText},initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}},{children:F("mcp-use-with-ai-app","Use with an AI app")})):null})]})),s.jsx(d.default,Object.assign({isOpen:S,onChange:$},{children:s.jsx(p.default,Object.assign({portalClassName:"dark"===g.theme?"dark":void 0,wrapperClassName:"mx-4 w-[min(92vw,560px)]",className:"w-full overflow-hidden p-0",style:Object.assign({backgroundColor:r.secondary,borderColor:`${r.accent}40`,borderRadius:g.cornerRadius,color:r.secondaryText},"Real Head Pro"!==g.font&&{fontFamily:g.font})},{children:s.jsxs("div",Object.assign({className:"flex flex-col gap-5 p-6"},{children:[s.jsxs("div",Object.assign({className:"flex items-start justify-between gap-4"},{children:[s.jsxs("div",{children:[s.jsx("h2",Object.assign({className:`${q.h4} font-semibold`},{children:F("mcp-use-agent-in-ai-app","Use this agent in your AI app")})),s.jsx("p",Object.assign({className:`${q.b3} mt-1 opacity-70`},{children:F(O?"mcp-connect-description":"mcp-connect-description-guest",O?"Connect through MCP. Requests will be sent as your signed-in Studio user.":"Connect through MCP. Requests will be sent as this visitor.")}))]}),s.jsx(h.default,{className:"shrink-0"})]})),s.jsxs("label",Object.assign({className:`${q.l2} flex flex-col gap-2 font-medium`},{children:[F("mcp-ai-app","AI app"),s.jsxs("div",Object.assign({className:"relative"},{children:[s.jsx("select",Object.assign({className:"w-full appearance-none border py-2 pl-3 pr-10 outline-none",style:{backgroundColor:r.primary,borderColor:`${r.accent}40`,borderRadius:g.cornerRadius,color:r.text},value:E,onChange:e=>L(e.target.value)},{children:Object.entries(f).map((([e,t])=>s.jsx("option",Object.assign({value:e},{children:"other"===e?F("other","Other"):t}),e)))})),s.jsx(c.default,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:r.text}})]}))]})),z?s.jsx("div",Object.assign({className:"min-h-24 animate-pulse border p-4",role:"status",style:{backgroundColor:r.primary,borderColor:`${r.accent}40`,borderRadius:g.cornerRadius}},{children:s.jsx("span",Object.assign({className:"sr-only"},{children:F("mcp-preparing-configuration","Preparing your private configuration…")}))})):T?s.jsx("p",Object.assign({className:`${q.b3} border p-4`,style:{backgroundColor:r.primary,borderColor:`${r.accent}40`,borderRadius:g.cornerRadius,color:r.text}},{children:F("mcp-configuration-unavailable","This private configuration is unavailable. Close and try again.")})):H?s.jsxs("div",Object.assign({className:"relative min-w-0"},{children:[s.jsx("pre",Object.assign({className:"max-h-64 w-full overflow-auto whitespace-pre-wrap break-all border p-4 pr-12 text-xs",style:{backgroundColor:r.primary,borderColor:`${r.accent}40`,borderRadius:g.cornerRadius,color:r.text}},{children:H})),s.jsx("button",Object.assign({type:"button",className:"absolute right-3 top-3 border p-2 transition-opacity hover:opacity-70",style:{backgroundColor:r.accent,borderColor:r.accent,borderRadius:g.cornerRadius,color:r.accentText},"aria-label":F("mcp-copy-configuration","Copy MCP configuration"),onClick:()=>{H&&(y.default(H),A(!0),window.setTimeout((()=>A(!1)),1800))}},{children:P?s.jsx(i.default,{className:"h-4 w-4"}):s.jsx(n.default,{className:"h-4 w-4"})}))]})):null,s.jsx("p",Object.assign({className:`${q.b4} opacity-60`},{children:F("mcp-private-configuration-note","Keep this configuration private. It contains your Studio session token and stops working when that session expires.")}))]}))}))}))]})};
@@ -111,6 +111,7 @@ type PickaxeContextType = {
111
111
  isRtl: boolean;
112
112
  isEmbed: boolean;
113
113
  mcpEnabled: boolean;
114
+ mcpGuestId?: string;
114
115
  isDropShadow: boolean;
115
116
  allowGuestUsage: boolean;
116
117
  persistActiveConversation: boolean;
@@ -164,6 +165,7 @@ export interface IPickaxeProviderProps {
164
165
  isRtl?: boolean;
165
166
  isEmbed?: boolean;
166
167
  mcpEnabled?: boolean;
168
+ mcpGuestId?: string;
167
169
  studioSessionToken?: string | null;
168
170
  isDropShadow?: boolean;
169
171
  allowGuestUsage?: boolean;
@@ -174,5 +176,5 @@ export interface IPickaxeProviderProps {
174
176
  onSessionIdChange?: (sessionId: string) => void;
175
177
  }
176
178
  export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
177
- export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
179
+ export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
178
180
  export {};
@@ -38,6 +38,7 @@ export declare const usePickaxeContext: () => {
38
38
  isRtl: boolean;
39
39
  isEmbed: boolean;
40
40
  mcpEnabled: boolean;
41
+ mcpGuestId?: string | undefined;
41
42
  isDropShadow: boolean;
42
43
  allowGuestUsage: boolean;
43
44
  persistActiveConversation: boolean;
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as o,Fragment as i}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as s,useCallback as a}from"react";import{usePickaxeContext as l}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as c}from"../Addons/Auth/hooks/useAuthContext.js";import{useDimensionContext as d}from"../../../hooks/pickaxe/useDimensionContext.js";import{useDocument as m}from"../Addons/Document/hooks/useDocument.js";import{useScrollContext as u}from"../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as p}from"../../../hooks/studio/useStyleFontSize.js";import f from"../../../hooks/core/useScrollToBottomVisibility.js";import h from"./History/index.js";import v from"./Input.js";import g from"../../Icons/attach-vertical.svg.js";import x from"../../../common/cn.js";import{pickaxeApi2 as b}from"../../../common/api/pickaxe.js";import{v4 as j}from"uuid";import{StudioTip as k}from"../../Core/StudioTip.js";import y from"../common/ScrollToBottomButton.js";import I from"../common/PickaxeMCPButton.js";import{useResponseContext as w}from"../../../hooks/pickaxe/useResponseContext.js";import{NavPill as D,EditableNavPill as C,HistoryPill as N}from"../Addons/Navbar/NavPill.js";import S from"../../Icons/history.svg.js";const T=()=>{var T,A;const{deploymentType:F,isNewChat:O,setIsNewChat:P,sessionId:H,setSessionId:z,setLastSessionId:B,pickaxeId:E,sender:R,pickaxe:L,styles:G,isEmbed:M,mcpEnabled:V,translations:_}=l(),{isSent:q,isLoggedIn:U}=c(),{width:W,height:J,setDimension:K}=d(),{setDocuments:Q,onFileUpload:X}=m(),{scrollContainerRef:Y,hasScrolledRef:Z,isLocked:$,setIsLocked:ee}=u(),{isGenerating:te,messages:oe}=w(),ie=p(),[ne,re]=n(0),[se,ae]=n(!1),[le,ce]=n(!1),de=r(null),me=r(null),ue=r(0),[pe,fe]=n(null),[he,ve]=n(!1),ge=(null==_?void 0:_["new-chat"])||"New chat",xe="chat-input"===F&&O&&!q,be=null!==(A=null===(T=null==L?void 0:L.documentuploadtype)||void 0===T?void 0:T.startsWith("enduserupload"))&&void 0!==A&&A,{hasScrollableContent:je,isNearBottom:ke}=f(Y);s((()=>()=>{Q([])}),[]);const ye=a((()=>{if(!E||!R)return;const t=(o=0)=>e(void 0,void 0,void 0,(function*(){var e;try{const t=yield b.post("/conversation/title",{sessionId:H,userId:R});if(t.data&&t.data.success){const e=t.data.title;if(e&&"Conversation Title"!==e)return void we(e)}else console.error("Failed to load conversation:",null===(e=t.data)||void 0===e?void 0:e.error)}catch(e){console.error("Error fetching conversation:",e)}o<20&&setTimeout((()=>t(o+1)),3e3)}));t()}),[E,R,H]);s((()=>{te||O||!H||ye()}),[te,O,H,ye]),s((()=>{if(!de.current)return;const e=new ResizeObserver((e=>{for(const t of e){const{width:e,height:o}=t.contentRect;K(parseInt(e.toFixed(0)),parseInt(o.toFixed(0)))}}));return e.observe(de.current),()=>{e.disconnect()}}),[K]);const[Ie,we]=n(ge),De=(null==L?void 0:L.formtitle)||"Pickaxe",Ce=(null==L?void 0:L.coverphoto)||void 0,[Ne,Se]=n(!1);s((()=>{const e=!xe&&!M&&G.portalTheme&&(oe.filter((e=>"user"===e.role)).length>0||se||!O);Se(null!=e&&e)}),[xe,M,se,O,oe,G.portalTheme]);const Te=a((()=>{Z.current=!1,ee(!0),requestAnimationFrame((()=>{const e=Y.current;e&&e.scrollTo({top:Math.max(0,e.scrollHeight-e.clientHeight),behavior:"smooth"})}))}),[Z,Y,ee]);return t("div",Object.assign({ref:de,className:"relative flex h-full w-full flex-col items-center overflow-hidden",onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),be&&(ue.current+=1,e.dataTransfer.items&&e.dataTransfer.items.length>0&&ce(!0))},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),be&&(ue.current-=1,0===ue.current&&ce(!1))},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:t=>e(void 0,void 0,void 0,(function*(){if(t.preventDefault(),t.stopPropagation(),ce(!1),ue.current=0,!be)return;const e=Array.from(t.dataTransfer.files||[]);e.length>0&&(P(!1),yield X(e))}))},{children:[le&&t("div",Object.assign({className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-lg bg-white/80 backdrop-blur-sm transition-all duration-300"},{children:[o("div",Object.assign({className:"flex h-24 w-24 items-center justify-center rounded-full bg-white shadow-lg animate-bounce text-black"},{children:o(g,{className:"h-10 w-10"})})),o("h3",Object.assign({className:x(ie.h3,"mt-6 font-semibold text-c-primary text-black")},{children:(null==_?void 0:_["drop-files-to-upload"])||"Drop files to upload"})),o("p",Object.assign({className:x(ie.b2,"mt-2 opacity-60 text-black")},{children:(null==_?void 0:_["add-anything-to-the-conversation"])||"Add anything to the conversation"}))]})),!M&&V&&U?o("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[800px] -translate-x-1/2 justify-end px-4"},{children:o("div",Object.assign({className:"pointer-events-auto"},{children:o(I,{})}))})):null,xe?o(v,{}):t(i,{children:[Ne&&t("div",Object.assign({className:x("direct-link"===F?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===G.portalTheme?"glass-dark ":"")},{children:[o(D,{text:De,icon:Ce}),O||Ie===ge?o(D,{text:Ie}):o(C,{text:Ie,sessionId:H,onRename:t=>e(void 0,void 0,void 0,(function*(){if(H)try{yield b.patch("/conversation/title",{sessionId:H,name:t,userId:R}),we(t)}catch(e){console.error("Error renaming chat:",e),alert((null==_?void 0:_["failed-rename-chat"])||"Failed to rename chat.")}})),onDelete:()=>e(void 0,void 0,void 0,(function*(){if(H&&window.confirm((null==_?void 0:_["delete-confirm"])||"Are you sure you want to delete this conversation?"))try{yield b.delete("/conversation",{data:{sessionId:H,userId:R}}),P(!0),z(j()),we(ge)}catch(e){console.error("Error deleting chat:",e),alert((null==_?void 0:_["failed-delete-chat"])||"Failed to delete chat.")}})),isDarkGlass:"dark"===G.portalTheme}),o(k,Object.assign({content:_["chat-history"]||"Chat History",align:"bottom",containerClassName:"inline-flex shrink-0"},{children:o(N,{icon:o(S,{}),onClick:()=>{z(""),B(H)}})}))]})),o(h,{additionalScrollHeight:ne,isForceHideInfo:J<=545||W<=350||se,isInputFocused:se,onSubmit:t=>e(void 0,void 0,void 0,(function*(){me.current&&me.current.onSubmit(t)})),smitheryAuthData:pe,resubmitPrompt:()=>{fe(null),ve(!0)}}),o(y,{isVisible:je&&!$&&!ke,bottom:ne+65,onClick:Te}),o(v,{ref:me,onFocus:()=>ae(!0),onBlur:()=>ae(!1),onInputHeightChange:re,initSmitheryAuthData:e=>fe(e),resubmitPrompt:he})]})]}))};export{T as default};
1
+ import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as o,Fragment as i}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as s,useCallback as a}from"react";import{usePickaxeContext as l}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as c}from"../Addons/Auth/hooks/useAuthContext.js";import{useDimensionContext as d}from"../../../hooks/pickaxe/useDimensionContext.js";import{useDocument as m}from"../Addons/Document/hooks/useDocument.js";import{useScrollContext as u}from"../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as p}from"../../../hooks/studio/useStyleFontSize.js";import f from"../../../hooks/core/useScrollToBottomVisibility.js";import h from"./History/index.js";import v from"./Input.js";import x from"../../Icons/attach-vertical.svg.js";import g from"../../../common/cn.js";import{pickaxeApi2 as b}from"../../../common/api/pickaxe.js";import{v4 as j}from"uuid";import{StudioTip as k}from"../../Core/StudioTip.js";import y from"../common/ScrollToBottomButton.js";import w from"../common/PickaxeMCPButton.js";import{useResponseContext as I}from"../../../hooks/pickaxe/useResponseContext.js";import{NavPill as D,EditableNavPill as C,HistoryPill as N}from"../Addons/Navbar/NavPill.js";import S from"../../Icons/history.svg.js";const T=()=>{var T,A;const{deploymentType:F,isNewChat:O,setIsNewChat:P,sessionId:H,setSessionId:z,setLastSessionId:B,pickaxeId:E,sender:R,pickaxe:L,styles:G,isEmbed:M,mcpEnabled:V,translations:_}=l(),{isSent:q}=c(),{width:U,height:W,setDimension:J}=d(),{setDocuments:K,onFileUpload:Q}=m(),{scrollContainerRef:X,hasScrolledRef:Y,isLocked:Z,setIsLocked:$}=u(),{isGenerating:ee,messages:te}=I(),oe=p(),[ie,ne]=n(0),[re,se]=n(!1),[ae,le]=n(!1),ce=r(null),de=r(null),me=r(0),[ue,pe]=n(null),[fe,he]=n(!1),ve=(null==_?void 0:_["new-chat"])||"New chat",xe="chat-input"===F&&O&&!q,ge=null!==(A=null===(T=null==L?void 0:L.documentuploadtype)||void 0===T?void 0:T.startsWith("enduserupload"))&&void 0!==A&&A,{hasScrollableContent:be,isNearBottom:je}=f(X);s((()=>()=>{K([])}),[]);const ke=a((()=>{if(!E||!R)return;const t=(o=0)=>e(void 0,void 0,void 0,(function*(){var e;try{const t=yield b.post("/conversation/title",{sessionId:H,userId:R});if(t.data&&t.data.success){const e=t.data.title;if(e&&"Conversation Title"!==e)return void we(e)}else console.error("Failed to load conversation:",null===(e=t.data)||void 0===e?void 0:e.error)}catch(e){console.error("Error fetching conversation:",e)}o<20&&setTimeout((()=>t(o+1)),3e3)}));t()}),[E,R,H]);s((()=>{ee||O||!H||ke()}),[ee,O,H,ke]),s((()=>{if(!ce.current)return;const e=new ResizeObserver((e=>{for(const t of e){const{width:e,height:o}=t.contentRect;J(parseInt(e.toFixed(0)),parseInt(o.toFixed(0)))}}));return e.observe(ce.current),()=>{e.disconnect()}}),[J]);const[ye,we]=n(ve),Ie=(null==L?void 0:L.formtitle)||"Pickaxe",De=(null==L?void 0:L.coverphoto)||void 0,[Ce,Ne]=n(!1);s((()=>{const e=!xe&&!M&&G.portalTheme&&(te.filter((e=>"user"===e.role)).length>0||re||!O);Ne(null!=e&&e)}),[xe,M,re,O,te,G.portalTheme]);const Se=a((()=>{Y.current=!1,$(!0),requestAnimationFrame((()=>{const e=X.current;e&&e.scrollTo({top:Math.max(0,e.scrollHeight-e.clientHeight),behavior:"smooth"})}))}),[Y,X,$]);return t("div",Object.assign({ref:ce,className:"relative flex h-full w-full flex-col items-center overflow-hidden",onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),ge&&(me.current+=1,e.dataTransfer.items&&e.dataTransfer.items.length>0&&le(!0))},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),ge&&(me.current-=1,0===me.current&&le(!1))},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:t=>e(void 0,void 0,void 0,(function*(){if(t.preventDefault(),t.stopPropagation(),le(!1),me.current=0,!ge)return;const e=Array.from(t.dataTransfer.files||[]);e.length>0&&(P(!1),yield Q(e))}))},{children:[ae&&t("div",Object.assign({className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-lg bg-white/80 backdrop-blur-sm transition-all duration-300"},{children:[o("div",Object.assign({className:"flex h-24 w-24 items-center justify-center rounded-full bg-white shadow-lg animate-bounce text-black"},{children:o(x,{className:"h-10 w-10"})})),o("h3",Object.assign({className:g(oe.h3,"mt-6 font-semibold text-c-primary text-black")},{children:(null==_?void 0:_["drop-files-to-upload"])||"Drop files to upload"})),o("p",Object.assign({className:g(oe.b2,"mt-2 opacity-60 text-black")},{children:(null==_?void 0:_["add-anything-to-the-conversation"])||"Add anything to the conversation"}))]})),!M&&V?o("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[800px] -translate-x-1/2 justify-end px-4"},{children:o("div",Object.assign({className:"pointer-events-auto"},{children:o(w,{})}))})):null,xe?o(v,{}):t(i,{children:[Ce&&t("div",Object.assign({className:g("direct-link"===F?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===G.portalTheme?"glass-dark ":"")},{children:[o(D,{text:Ie,icon:De}),O||ye===ve?o(D,{text:ye}):o(C,{text:ye,sessionId:H,onRename:t=>e(void 0,void 0,void 0,(function*(){if(H)try{yield b.patch("/conversation/title",{sessionId:H,name:t,userId:R}),we(t)}catch(e){console.error("Error renaming chat:",e),alert((null==_?void 0:_["failed-rename-chat"])||"Failed to rename chat.")}})),onDelete:()=>e(void 0,void 0,void 0,(function*(){if(H&&window.confirm((null==_?void 0:_["delete-confirm"])||"Are you sure you want to delete this conversation?"))try{yield b.delete("/conversation",{data:{sessionId:H,userId:R}}),P(!0),z(j()),we(ve)}catch(e){console.error("Error deleting chat:",e),alert((null==_?void 0:_["failed-delete-chat"])||"Failed to delete chat.")}})),isDarkGlass:"dark"===G.portalTheme}),o(k,Object.assign({content:_["chat-history"]||"Chat History",align:"bottom",containerClassName:"inline-flex shrink-0"},{children:o(N,{icon:o(S,{}),onClick:()=>{z(""),B(H)}})}))]})),o(h,{additionalScrollHeight:ie,isForceHideInfo:W<=545||U<=350||re,isInputFocused:re,onSubmit:t=>e(void 0,void 0,void 0,(function*(){de.current&&de.current.onSubmit(t)})),smitheryAuthData:ue,resubmitPrompt:()=>{pe(null),he(!0)}}),o(y,{isVisible:be&&!Z&&!je,bottom:ie+65,onClick:Se}),o(v,{ref:de,onFocus:()=>se(!0),onBlur:()=>se(!1),onInputHeightChange:ne,initSmitheryAuthData:e=>pe(e),resubmitPrompt:fe})]})]}))};export{T as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useRef as l,useState as s,useEffect as i,useCallback as n}from"react";import{usePickaxeContext as r}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as a}from"../Addons/Auth/hooks/useAuthContext.js";import c from"../../../hooks/core/useScrollToBottomVisibility.js";import{useStyleFontSize as m}from"../../../hooks/studio/useStyleFontSize.js";import d from"../common/PickaxeHead.js";import f from"../common/PickaxeEmbedHead.js";import u from"../common/PickaxeMCPButton.js";import p from"../common/ScrollToBottomButton.js";import x from"./History/index.js";import v from"./NewChat.js";import h from"./Questions/index.js";import b from"../../../common/cn.js";import{NavPill as g}from"../Addons/Navbar/NavPill.js";const j=()=>{const{lastSessionId:j,pickaxe:w,responsiveBy:y,translations:k,isEmbed:N,mcpEnabled:O,deploymentType:E,styles:L,setLastSessionId:C,setSessionId:B}=r(),{isLoggedIn:S}=a(),P=(null==w?void 0:w.formtitle)||"Pickaxe",H=(null==w?void 0:w.coverphoto)||void 0,T=m(),M=l(null),z=l(null),[I,A]=s(!0),R=N&&(null==w?void 0:w.chatflag),{hasScrollableContent:D,isNearBottom:V}=c(M,{targetRef:z,activeOffset:48},[Boolean(null==w?void 0:w.chatflag)]);i((()=>{V&&A(!0)}),[V]),i((()=>{const e=M.current;if(!e)return;const t=()=>{A(!1)};return e.addEventListener("mousedown",t),e.addEventListener("touchmove",t,{passive:!0}),e.addEventListener("wheel",t,{passive:!0}),e.addEventListener("DOMMouseScroll",t),e.addEventListener("mousewheel",t),()=>{e.removeEventListener("mousedown",t),e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t),e.removeEventListener("DOMMouseScroll",t),e.removeEventListener("mousewheel",t)}}),[]);const F=n((()=>{if(!M.current||!z.current)return;const e=M.current.getBoundingClientRect(),t=z.current.getBoundingClientRect().bottom-e.top+M.current.scrollTop;A(!0),M.current.scrollTo({top:Math.max(0,t-M.current.clientHeight),behavior:"smooth"})}),[]),Q=n((()=>{A(!1)}),[]);return e("div",Object.assign({className:b("relative flex h-full w-full flex-col items-center overflow-hidden")},{children:[e("div",Object.assign({ref:M,className:b("flex h-full w-full flex-col items-center overflow-y-auto","pt-0","viewport"===y?"min-[767px]:pb-10":"@[767px]/pickaxe-root:pb-10")},{children:[!N&&t("div",Object.assign({className:b("direct-link"===E?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===L.portalTheme?"glass-dark ":"")},{children:t(g,{text:P,icon:H,onClick:()=>{B(j),C("")}})})),!N&&O&&S?t("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[700px] -translate-x-1/2 justify-end"},{children:t("div",Object.assign({className:"pointer-events-auto"},{children:t(u,{})}))})):null,R?e(o,{children:[t(f,{className:"sticky top-0 z-10 w-full",historyBtnTip:(null==k?void 0:k["exit-chat-history"])||"Exit Chat History",onHistoryClick:()=>B(j)}),t("div",Object.assign({className:"relative flex min-h-[56px] w-full justify-end rounded-tl-lg rounded-tr-lg border-y p-4"},{children:t("p",Object.assign({className:b(T.b1,"absolute left-1/2 -translate-x-1/2 select-none text-center")},{children:(null==k?void 0:k["chat-history"])||"Chat History"}))}))]}):e("div",Object.assign({className:"flex w-full max-w-[700px] flex-col"},{children:[N&&O&&S?t("div",Object.assign({className:"flex w-full justify-end"},{children:t("div",Object.assign({className:b("mr-3 flex","popup"===E&&"pr-10")},{children:t(u,{})}))})):null,t(d,{})]})),t("div",Object.assign({className:b("flex w-full min-h-0 flex-col items-center",R?"px-4":"px-6")},{children:t("div",Object.assign({className:"flex h-full w-full max-w-[700px] flex-col"},{children:e("div",Object.assign({className:b("flex h-full flex-col gap-y-8","viewport"===y?"min-[767px]:mt-4":"@[767px]/pickaxe-root:mt-4")},{children:[t("div",Object.assign({ref:z,className:"flex flex-col"},{children:(null==w?void 0:w.chatflag)?t(v,{}):t(h,{onLongInputPaste:Q})})),t(x,{})]}))}))}))]})),t(p,{bottom:30,isVisible:D&&!I&&!V,onClick:F})]}))};export{j as default};
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useRef as l,useState as i,useEffect as s,useCallback as n}from"react";import{usePickaxeContext as r}from"../../../hooks/pickaxe/usePickaxeContext.js";import a from"../../../hooks/core/useScrollToBottomVisibility.js";import{useStyleFontSize as c}from"../../../hooks/studio/useStyleFontSize.js";import m from"../common/PickaxeHead.js";import d from"../common/PickaxeEmbedHead.js";import f from"../common/PickaxeMCPButton.js";import u from"../common/ScrollToBottomButton.js";import p from"./History/index.js";import x from"./NewChat.js";import v from"./Questions/index.js";import h from"../../../common/cn.js";import{NavPill as b}from"../Addons/Navbar/NavPill.js";const j=()=>{const{lastSessionId:j,pickaxe:g,responsiveBy:w,translations:y,isEmbed:k,mcpEnabled:N,deploymentType:O,styles:E,setLastSessionId:L,setSessionId:C}=r(),B=(null==g?void 0:g.formtitle)||"Pickaxe",S=(null==g?void 0:g.coverphoto)||void 0,P=c(),H=l(null),T=l(null),[M,z]=i(!0),I=k&&(null==g?void 0:g.chatflag),{hasScrollableContent:R,isNearBottom:D}=a(H,{targetRef:T,activeOffset:48},[Boolean(null==g?void 0:g.chatflag)]);s((()=>{D&&z(!0)}),[D]),s((()=>{const e=H.current;if(!e)return;const t=()=>{z(!1)};return e.addEventListener("mousedown",t),e.addEventListener("touchmove",t,{passive:!0}),e.addEventListener("wheel",t,{passive:!0}),e.addEventListener("DOMMouseScroll",t),e.addEventListener("mousewheel",t),()=>{e.removeEventListener("mousedown",t),e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t),e.removeEventListener("DOMMouseScroll",t),e.removeEventListener("mousewheel",t)}}),[]);const V=n((()=>{if(!H.current||!T.current)return;const e=H.current.getBoundingClientRect(),t=T.current.getBoundingClientRect().bottom-e.top+H.current.scrollTop;z(!0),H.current.scrollTo({top:Math.max(0,t-H.current.clientHeight),behavior:"smooth"})}),[]),A=n((()=>{z(!1)}),[]);return e("div",Object.assign({className:h("relative flex h-full w-full flex-col items-center overflow-hidden")},{children:[e("div",Object.assign({ref:H,className:h("flex h-full w-full flex-col items-center overflow-y-auto","pt-0","viewport"===w?"min-[767px]:pb-10":"@[767px]/pickaxe-root:pb-10")},{children:[!k&&t("div",Object.assign({className:h("direct-link"===O?"absolute top-4 left-4 md:top-6 md:left-6 z-40 flex items-center gap-2 animate-in fade-in slide-in-from-top-4 duration-500":"w-full max-w-3xl mt-6 px-4 md:px-0 flex justify-start z-30 mb-4 animate-in fade-in slide-in-from-top-4 duration-500 gap-2","dark"===E.portalTheme?"glass-dark ":"")},{children:t(b,{text:B,icon:S,onClick:()=>{C(j),L("")}})})),!k&&N?t("div",Object.assign({className:"pointer-events-none absolute left-1/2 top-4 z-40 flex w-full max-w-[700px] -translate-x-1/2 justify-end"},{children:t("div",Object.assign({className:"pointer-events-auto"},{children:t(f,{})}))})):null,I?e(o,{children:[t(d,{className:"sticky top-0 z-10 w-full",historyBtnTip:(null==y?void 0:y["exit-chat-history"])||"Exit Chat History",onHistoryClick:()=>C(j)}),t("div",Object.assign({className:"relative flex min-h-[56px] w-full justify-end rounded-tl-lg rounded-tr-lg border-y p-4"},{children:t("p",Object.assign({className:h(P.b1,"absolute left-1/2 -translate-x-1/2 select-none text-center")},{children:(null==y?void 0:y["chat-history"])||"Chat History"}))}))]}):e("div",Object.assign({className:"flex w-full max-w-[700px] flex-col"},{children:[k&&N?t("div",Object.assign({className:"flex w-full justify-end"},{children:t("div",Object.assign({className:h("mr-3 flex","popup"===O&&"pr-10")},{children:t(f,{})}))})):null,t(m,{})]})),t("div",Object.assign({className:h("flex w-full min-h-0 flex-col items-center",I?"px-4":"px-6")},{children:t("div",Object.assign({className:"flex h-full w-full max-w-[700px] flex-col"},{children:e("div",Object.assign({className:h("flex h-full flex-col gap-y-8","viewport"===w?"min-[767px]:mt-4":"@[767px]/pickaxe-root:mt-4")},{children:[t("div",Object.assign({ref:T,className:"flex flex-col"},{children:(null==g?void 0:g.chatflag)?t(x,{}):t(v,{onLongInputPaste:A})})),t(p,{})]}))}))}))]})),t(u,{bottom:30,isVisible:R&&!M&&!D,onClick:V})]}))};export{j as default};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useState as o,useEffect as n}from"react";import{ArtifactProvider as a}from"./Addons/Artifact/Provider.js";import s from"./DimensionProvider.js";import r from"./ResponseProvider.js";import l from"./Addons/Document/Provider.js";import d from"./Addons/Auth/Provider.js";const c=i({}),p=({children:i,origin:p,sender:u,senderType:m,deploymentId:g,portalId:f,deploymentType:h,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:k={},misc:S={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:C,artifact:I={popupType:"auto"},responsiveBy:P="viewport",locale:F="en",opacity:A=1,forceMobile:x=!1,disableHtml:T=!1,disableJs:D=!1,disableCss:U=!1,loadFont:q=!0,isRtl:R=!1,isEmbed:O=!1,mcpEnabled:M=!1,studioSessionToken:j,isDropShadow:E=!1,allowGuestUsage:L=!0,persistActiveConversation:G=!1,preventInitialSessionId:H=!1,onUpgrade:W,onGenerateComplete:B,onSessionIdChange:N})=>{const[V,Y]=o(""),[X,J]=o(""),[_,z]=o(""),[Q,K]=o(""),[Z,$]=o(u),[ee,te]=o(null),[ie,oe]=o(m),[ne,ae]=o("loading"),[se,re]=o([]),[le,de]=o(null),[ce,pe]=o(null),[ue,me]=o(null),[ge,fe]=o(null),[he,ye]=o("");n((()=>ye("")),[X]);const[ve,be]=o(!1),[we,ke]=o(!0),[Se,Ce]=o(!0),[Ie,Pe]=o(!1);return n((()=>{be(!1)}),[null==b?void 0:b.font]),n((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&q&&!ve&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield import("webfontloader")).default.load({google:{families:[b.font]},active:()=>{be(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),be(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),be(!0)}}))}),[q,ve,null==b?void 0:b.font]),n((()=>{$(u)}),[u]),t(c.Provider,Object.assign({value:Object.assign(Object.assign({origin:p,contextId:V,pickaxeId:X,sessionId:_,lastSessionId:Q,sender:Z,senderType:ie,portalId:f,deploymentId:g,deploymentType:h,validationStatus:ne,validationUpgradeGroups:se,validationUpgradeUrl:le,deploymentDimensions:y,deploymentMisc:v,accessGroup:ee,pickaxe:ge,selectedModel:he,setSelectedModel:ye,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:S,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},C),artifact:I,responsiveBy:P,locale:F,opacity:A,forceMobile:x,loadFont:q,disableHtml:T,disableJs:D,disableCss:U,isFontLoaded:ve,isNewChat:we,isShowIceBreaker:Se,isShowFeedbackMessage:Ie,isRtl:R,isEmbed:O,mcpEnabled:M,isDropShadow:E,allowGuestUsage:L,persistActiveConversation:G,clientSecret:ue,stripeAccountId:ce,preventInitialSessionId:H,setClientSecret:me,setStripeAccountId:pe,setContextId:Y,setValidationStatus:ae,setValidationUpgradeGroups:re,setValidationUpgradeUrl:de,setPickaxeId:J,setSessionId:e=>{z((t=>{const i="function"==typeof e?e(t):e;return null==N||N(i),i}))},setLastSessionId:K,setSender:$,setSenderType:oe,setAccessGroup:te,setPickaxe:fe,setIsFontLoaded:be,setIsNewChat:ke,setIsShowIceBreaker:Ce,setIsShowFeedbackMessage:Pe},W&&{onUpgrade:W}),B&&{onGenerateComplete:B})},{children:t(d,Object.assign({initialToken:j},{children:t(s,{children:t(r,Object.assign({limits:k},{children:t(l,{children:t(a,Object.assign({},I,{children:i}))})}))})}))}))};export{c as PickaxeContext,p as PickaxeProvider};
1
+ import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useState as o,useEffect as n}from"react";import{ArtifactProvider as a}from"./Addons/Artifact/Provider.js";import s from"./DimensionProvider.js";import r from"./ResponseProvider.js";import l from"./Addons/Document/Provider.js";import d from"./Addons/Auth/Provider.js";const c=i({}),p=({children:i,origin:p,sender:u,senderType:m,deploymentId:g,portalId:f,deploymentType:h,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:k={},misc:S={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:C,artifact:I={popupType:"auto"},responsiveBy:P="viewport",locale:F="en",opacity:A=1,forceMobile:x=!1,disableHtml:T=!1,disableJs:D=!1,disableCss:U=!1,loadFont:q=!0,isRtl:R=!1,isEmbed:O=!1,mcpEnabled:M=!1,mcpGuestId:j,studioSessionToken:E,isDropShadow:L=!1,allowGuestUsage:G=!0,persistActiveConversation:H=!1,preventInitialSessionId:W=!1,onUpgrade:B,onGenerateComplete:N,onSessionIdChange:V})=>{const[Y,X]=o(""),[J,_]=o(""),[z,Q]=o(""),[K,Z]=o(""),[$,ee]=o(u),[te,ie]=o(null),[oe,ne]=o(m),[ae,se]=o("loading"),[re,le]=o([]),[de,ce]=o(null),[pe,ue]=o(null),[me,ge]=o(null),[fe,he]=o(null),[ye,ve]=o("");n((()=>ve("")),[J]);const[be,we]=o(!1),[ke,Se]=o(!0),[Ce,Ie]=o(!0),[Pe,Fe]=o(!1);return n((()=>{we(!1)}),[null==b?void 0:b.font]),n((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&q&&!be&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield import("webfontloader")).default.load({google:{families:[b.font]},active:()=>{we(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),we(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),we(!0)}}))}),[q,be,null==b?void 0:b.font]),n((()=>{ee(u)}),[u]),t(c.Provider,Object.assign({value:Object.assign(Object.assign({origin:p,contextId:Y,pickaxeId:J,sessionId:z,lastSessionId:K,sender:$,senderType:oe,portalId:f,deploymentId:g,deploymentType:h,validationStatus:ae,validationUpgradeGroups:re,validationUpgradeUrl:de,deploymentDimensions:y,deploymentMisc:v,accessGroup:te,pickaxe:fe,selectedModel:ye,setSelectedModel:ve,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:S,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, GIF, or M4A files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},C),artifact:I,responsiveBy:P,locale:F,opacity:A,forceMobile:x,loadFont:q,disableHtml:T,disableJs:D,disableCss:U,isFontLoaded:be,isNewChat:ke,isShowIceBreaker:Ce,isShowFeedbackMessage:Pe,isRtl:R,isEmbed:O,mcpEnabled:M,mcpGuestId:j,isDropShadow:L,allowGuestUsage:G,persistActiveConversation:H,clientSecret:me,stripeAccountId:pe,preventInitialSessionId:W,setClientSecret:ge,setStripeAccountId:ue,setContextId:X,setValidationStatus:se,setValidationUpgradeGroups:le,setValidationUpgradeUrl:ce,setPickaxeId:_,setSessionId:e=>{Q((t=>{const i="function"==typeof e?e(t):e;return null==V||V(i),i}))},setLastSessionId:Z,setSender:ee,setSenderType:ne,setAccessGroup:ie,setPickaxe:he,setIsFontLoaded:we,setIsNewChat:Se,setIsShowIceBreaker:Ie,setIsShowFeedbackMessage:Fe},B&&{onUpgrade:B}),N&&{onGenerateComplete:N})},{children:t(d,Object.assign({initialToken:E},{children:t(s,{children:t(r,Object.assign({limits:k},{children:t(l,{children:t(a,Object.assign({},I,{children:i}))})}))})}))}))};export{c as PickaxeContext,p as PickaxeProvider};
@@ -1 +1 @@
1
- import{jsxs as o,jsx as i}from"react/jsx-runtime";import{useMemo as t}from"react";import{usePickaxeContext as e}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as s}from"../Addons/Auth/hooks/useAuthContext.js";import{useStyleFontSize as r}from"../../../hooks/studio/useStyleFontSize.js";import l from"./PickaxeIcon.js";import n from"./PickaxeHistoryButton.js";import c from"./PickaxeLogoutButton.js";import a from"./PickaxeMCPButton.js";import m from"../../../common/cn.js";const p=({className:p,iconClassName:u,historyBtnTip:d,onIconClick:f,onHistoryClick:x})=>{const{deploymentType:h,pickaxe:g,misc:k,colors:j,translations:b,mcpEnabled:y}=e(),{isLoggedIn:v}=s(),C=y&&v,P=r(),N=t((()=>({title:(null==g?void 0:g.formtitle)||"",description:(null==g?void 0:g.formdescription)||""})),[g]);return k.isTitle||k.isDescription||!k.isWhiteLabel||C?o("div",Object.assign({className:m("flex min-h-[56px] items-center justify-between gap-4 px-4",p),style:{backgroundColor:j.secondary,color:j.secondaryText}},{children:[o("div",Object.assign({className:"flex items-center gap-4"},{children:[k.isProfileImage&&i(l,Object.assign({src:null==g?void 0:g.coverphoto,alt:`${null==g?void 0:g.formtitle}'s Profile Picture`,width:32,height:32,className:m("h-[32px] w-[32px] shrink-0 rounded-full",u,!!f&&"cursor-pointer")},f&&{onClick:f})),k.isTitle&&i("p",Object.assign({className:m(P.b1)},{children:N.title}))]})),x||C?o("div",Object.assign({className:m("popup"===h&&"pr-10","flex items-center gap-1")},{children:[C?i(a,{}):null,x?i(n,{tip:d,onClick:x}):null,v&&x&&i(c,{tip:(null==b?void 0:b["log-out"])||"Log Out"})]})):null]})):null};export{p as default};
1
+ import{jsxs as o,jsx as i}from"react/jsx-runtime";import{useMemo as t}from"react";import{usePickaxeContext as e}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as s}from"../Addons/Auth/hooks/useAuthContext.js";import{useStyleFontSize as r}from"../../../hooks/studio/useStyleFontSize.js";import l from"./PickaxeIcon.js";import n from"./PickaxeHistoryButton.js";import c from"./PickaxeLogoutButton.js";import a from"./PickaxeMCPButton.js";import m from"../../../common/cn.js";const p=({className:p,iconClassName:u,historyBtnTip:d,onIconClick:f,onHistoryClick:x})=>{const{deploymentType:h,pickaxe:g,misc:k,colors:j,translations:b,mcpEnabled:y}=e(),{isLoggedIn:v}=s(),C=y,P=r(),N=t((()=>({title:(null==g?void 0:g.formtitle)||"",description:(null==g?void 0:g.formdescription)||""})),[g]);return k.isTitle||k.isDescription||!k.isWhiteLabel||C?o("div",Object.assign({className:m("flex min-h-[56px] items-center justify-between gap-4 px-4",p),style:{backgroundColor:j.secondary,color:j.secondaryText}},{children:[o("div",Object.assign({className:"flex items-center gap-4"},{children:[k.isProfileImage&&i(l,Object.assign({src:null==g?void 0:g.coverphoto,alt:`${null==g?void 0:g.formtitle}'s Profile Picture`,width:32,height:32,className:m("h-[32px] w-[32px] shrink-0 rounded-full",u,!!f&&"cursor-pointer")},f&&{onClick:f})),k.isTitle&&i("p",Object.assign({className:m(P.b1)},{children:N.title}))]})),x||C?o("div",Object.assign({className:m("popup"===h&&"pr-10","flex items-center gap-1")},{children:[C?i(a,{}):null,x?i(n,{tip:d,onClick:x}):null,v&&x&&i(c,{tip:(null==b?void 0:b["log-out"])||"Log Out"})]})):null]})):null};export{p as default};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useState as t,useMemo as a}from"react";import s from"copy-to-clipboard";import{AnimatePresence as n,motion as i}from"framer-motion";import c from"../../Icons/terminal.svg.js";import l from"../../Icons/copy.svg.js";import p from"../../Icons/check.svg.js";import d from"../../Icons/chevron-down.svg.js";import m from"../../Core/Modal/index.js";import u from"../../Core/Modal/Body.js";import h from"../../Core/Modal/CloseButton.js";import{usePickaxeContext as b}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as g}from"../../../hooks/studio/useStyleFontSize.js";import{useAuthContext as f}from"../Addons/Auth/hooks/useAuthContext.js";import y from"./PickaxeSimpleButton.js";const x={codex:"Codex",claude:"Claude Code",cursor:"Cursor",vscode:"VS Code",other:"Other"},v=()=>{const{colors:v,styles:j,deploymentId:C,mcpEnabled:O,translations:w}=b(),{token:k}=f(),N=g(),[$,I]=t(!1),[R,S]=t(!1),[A,P]=t(!1),[U,_]=t("codex"),M=(e,o)=>{var r;return null!==(r=null==w?void 0:w[e])&&void 0!==r?r:o},z=a((()=>{if(!C)return"";const e=process.env.NEXT_PUBLIC_API_MCP_URL||"https://mcp.pickaxe.co",o=new URL(e),r=o.pathname.replace(/\/+$/,"");return o.pathname=r.endsWith("/deployment")?r:`${r}/deployment`,o.searchParams.set("id",C),o.toString()}),[C]),T=a((()=>{const e=`Bearer ${null!=k?k:"YOUR_STUDIO_SESSION_TOKEN"}`;return"codex"===U?`[mcp_servers.pickaxe]\nurl = "${z}"\nhttp_headers = { Authorization = "${e}" }`:"claude"===U?`claude mcp add --transport http --scope user pickaxe "${z}" --header "Authorization: ${e}"`:"vscode"===U?JSON.stringify({servers:{pickaxe:{type:"http",url:z,headers:{Authorization:e}}}},null,2):"cursor"===U?JSON.stringify({mcpServers:{pickaxe:{url:z,headers:{Authorization:e}}}},null,2):`URL: ${z}\nAuthorization: ${e}`}),[U,z,k]);if(!O||!C||!k)return null;return e(o,{children:[e("div",Object.assign({className:"relative"},{children:[e(y,Object.assign({className:"h-8 w-8 shrink-0 justify-center rounded-full",color:v.accent,onClick:()=>I(!0),onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1)},{children:[r(c,{className:"h-5 w-5"}),r("span",Object.assign({className:"sr-only"},{children:M("mcp-use-with-ai-app","Use with an AI app")}))]})),r(n,{children:R?r(i.div,Object.assign({className:"absolute right-0 top-10 z-20 w-max rounded px-3 py-2 text-xs font-medium",style:{background:v.accent,color:v.accentText},initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}},{children:M("mcp-use-with-ai-app","Use with an AI app")})):null})]})),r(m,Object.assign({isOpen:$,onChange:I},{children:r(u,Object.assign({portalClassName:"dark"===j.theme?"dark":void 0,wrapperClassName:"mx-4 w-[min(92vw,560px)]",className:"w-full overflow-hidden p-0",style:Object.assign({backgroundColor:v.secondary,borderColor:`${v.accent}40`,borderRadius:j.cornerRadius,color:v.secondaryText},"Real Head Pro"!==j.font&&{fontFamily:j.font})},{children:e("div",Object.assign({className:"flex flex-col gap-5 p-6"},{children:[e("div",Object.assign({className:"flex items-start justify-between gap-4"},{children:[e("div",{children:[r("h2",Object.assign({className:`${N.h4} font-semibold`},{children:M("mcp-use-agent-in-ai-app","Use this agent in your AI app")})),r("p",Object.assign({className:`${N.b3} mt-1 opacity-70`},{children:M("mcp-connect-description","Connect through MCP. Requests will be sent as your signed-in Studio user.")}))]}),r(h,{className:"shrink-0"})]})),e("label",Object.assign({className:`${N.l2} flex flex-col gap-2 font-medium`},{children:[M("mcp-ai-app","AI app"),e("div",Object.assign({className:"relative"},{children:[r("select",Object.assign({className:"w-full appearance-none border py-2 pl-3 pr-10 outline-none",style:{backgroundColor:v.primary,borderColor:`${v.accent}40`,borderRadius:j.cornerRadius,color:v.text},value:U,onChange:e=>_(e.target.value)},{children:Object.entries(x).map((([e,o])=>r("option",Object.assign({value:e},{children:"other"===e?M("other","Other"):o}),e)))})),r(d,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:v.text}})]}))]})),e("div",Object.assign({className:"relative min-w-0"},{children:[r("pre",Object.assign({className:"max-h-64 w-full overflow-auto whitespace-pre-wrap break-all border p-4 pr-12 text-xs",style:{backgroundColor:v.primary,borderColor:`${v.accent}40`,borderRadius:j.cornerRadius,color:v.text}},{children:T})),r("button",Object.assign({type:"button",className:"absolute right-3 top-3 border p-2 transition-opacity hover:opacity-70",style:{backgroundColor:v.accent,borderColor:v.accent,borderRadius:j.cornerRadius,color:v.accentText},"aria-label":M("mcp-copy-configuration","Copy MCP configuration"),onClick:()=>{s(T),P(!0),window.setTimeout((()=>P(!1)),1800)}},{children:r(A?p:l,{className:"h-4 w-4"})}))]})),r("p",Object.assign({className:`${N.b4} opacity-60`},{children:M("mcp-private-configuration-note","Keep this configuration private. It contains your Studio session token and stops working when that session expires.")}))]}))}))}))]})};export{v as default};
1
+ import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as a,useMemo as s}from"react";import n from"copy-to-clipboard";import{AnimatePresence as i,motion as c}from"framer-motion";import l from"../../Icons/terminal.svg.js";import p from"../../Icons/copy.svg.js";import d from"../../Icons/check.svg.js";import u from"../../Icons/chevron-down.svg.js";import m from"../../../common/api/utils.js";import{initializeEmbedUserId as h}from"../../../common/utils.js";import b from"../../Core/Modal/index.js";import g from"../../Core/Modal/Body.js";import f from"../../Core/Modal/CloseButton.js";import{usePickaxeContext as y}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as v}from"../../../hooks/studio/useStyleFontSize.js";import{useAuthContext as x}from"../Addons/Auth/hooks/useAuthContext.js";import j from"./PickaxeSimpleButton.js";const C={codex:"Codex",claude:"Claude Code",cursor:"Cursor",vscode:"VS Code",other:"Other"},k=()=>{const{colors:k,styles:w,deploymentId:N,mcpEnabled:O,mcpGuestId:$,sender:R,translations:I}=y(),{token:A}=x(),P=v(),[M,S]=a(!1),[_,z]=a(!1),[U,T]=a(!1),[B,L]=a(null),[E,q]=a(!1),[F,G]=a(!1),[J,H]=a("codex"),K=(e,o)=>{var r;return null!==(r=null==I?void 0:I[e])&&void 0!==r?r:o},V=s((()=>{if(!N)return"";const e=process.env.NEXT_PUBLIC_API_MCP_URL||"https://mcp.pickaxe.co",o=new URL(e),r=o.pathname.replace(/\/+$/,"");return o.pathname=r.endsWith("/deployment")?r:`${r}/deployment`,o.searchParams.set("id",N),o.toString()}),[N]),W=A||B,X=s((()=>{if(!W)return"";const e=`Bearer ${W}`;return"codex"===J?`[mcp_servers.pickaxe]\nurl = "${V}"\nhttp_headers = { Authorization = "${e}" }`:"claude"===J?`claude mcp add --transport http --scope user pickaxe "${V}" --header "Authorization: ${e}"`:"vscode"===J?JSON.stringify({servers:{pickaxe:{type:"http",url:V,headers:{Authorization:e}}}},null,2):"cursor"===J?JSON.stringify({mcpServers:{pickaxe:{url:V,headers:{Authorization:e}}}},null,2):`URL: ${V}\nAuthorization: ${e}`}),[J,V,W]);if(!O||!N)return null;return o(r,{children:[o("div",Object.assign({className:"relative"},{children:[o(j,Object.assign({className:"h-8 w-8 shrink-0 justify-center rounded-full",color:k.accent,onClick:()=>e(void 0,void 0,void 0,(function*(){if(S(!0),!W&&!E){q(!0),G(!1);try{const e=$||R||h(),o=yield m.post("/pickaxe/mcp-session",{deploymentId:N,guestId:e});if(!o.data.success||!o.data.token)throw new Error("Guest MCP session was not created");L(o.data.token)}catch(e){console.error("[pxe] failed to prepare MCP configuration",e),G(!0)}finally{q(!1)}}})),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1)},{children:[t(l,{className:"h-5 w-5"}),t("span",Object.assign({className:"sr-only"},{children:K("mcp-use-with-ai-app","Use with an AI app")}))]})),t(i,{children:_?t(c.div,Object.assign({className:"absolute right-0 top-10 z-20 w-max rounded px-3 py-2 text-xs font-medium",style:{background:k.accent,color:k.accentText},initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}},{children:K("mcp-use-with-ai-app","Use with an AI app")})):null})]})),t(b,Object.assign({isOpen:M,onChange:S},{children:t(g,Object.assign({portalClassName:"dark"===w.theme?"dark":void 0,wrapperClassName:"mx-4 w-[min(92vw,560px)]",className:"w-full overflow-hidden p-0",style:Object.assign({backgroundColor:k.secondary,borderColor:`${k.accent}40`,borderRadius:w.cornerRadius,color:k.secondaryText},"Real Head Pro"!==w.font&&{fontFamily:w.font})},{children:o("div",Object.assign({className:"flex flex-col gap-5 p-6"},{children:[o("div",Object.assign({className:"flex items-start justify-between gap-4"},{children:[o("div",{children:[t("h2",Object.assign({className:`${P.h4} font-semibold`},{children:K("mcp-use-agent-in-ai-app","Use this agent in your AI app")})),t("p",Object.assign({className:`${P.b3} mt-1 opacity-70`},{children:K(A?"mcp-connect-description":"mcp-connect-description-guest",A?"Connect through MCP. Requests will be sent as your signed-in Studio user.":"Connect through MCP. Requests will be sent as this visitor.")}))]}),t(f,{className:"shrink-0"})]})),o("label",Object.assign({className:`${P.l2} flex flex-col gap-2 font-medium`},{children:[K("mcp-ai-app","AI app"),o("div",Object.assign({className:"relative"},{children:[t("select",Object.assign({className:"w-full appearance-none border py-2 pl-3 pr-10 outline-none",style:{backgroundColor:k.primary,borderColor:`${k.accent}40`,borderRadius:w.cornerRadius,color:k.text},value:J,onChange:e=>H(e.target.value)},{children:Object.entries(C).map((([e,o])=>t("option",Object.assign({value:e},{children:"other"===e?K("other","Other"):o}),e)))})),t(u,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2",style:{color:k.text}})]}))]})),E?t("div",Object.assign({className:"min-h-24 animate-pulse border p-4",role:"status",style:{backgroundColor:k.primary,borderColor:`${k.accent}40`,borderRadius:w.cornerRadius}},{children:t("span",Object.assign({className:"sr-only"},{children:K("mcp-preparing-configuration","Preparing your private configuration…")}))})):F?t("p",Object.assign({className:`${P.b3} border p-4`,style:{backgroundColor:k.primary,borderColor:`${k.accent}40`,borderRadius:w.cornerRadius,color:k.text}},{children:K("mcp-configuration-unavailable","This private configuration is unavailable. Close and try again.")})):X?o("div",Object.assign({className:"relative min-w-0"},{children:[t("pre",Object.assign({className:"max-h-64 w-full overflow-auto whitespace-pre-wrap break-all border p-4 pr-12 text-xs",style:{backgroundColor:k.primary,borderColor:`${k.accent}40`,borderRadius:w.cornerRadius,color:k.text}},{children:X})),t("button",Object.assign({type:"button",className:"absolute right-3 top-3 border p-2 transition-opacity hover:opacity-70",style:{backgroundColor:k.accent,borderColor:k.accent,borderRadius:w.cornerRadius,color:k.accentText},"aria-label":K("mcp-copy-configuration","Copy MCP configuration"),onClick:()=>{X&&(n(X),T(!0),window.setTimeout((()=>T(!1)),1800))}},{children:t(U?d:p,{className:"h-4 w-4"})}))]})):null,t("p",Object.assign({className:`${P.b4} opacity-60`},{children:K("mcp-private-configuration-note","Keep this configuration private. It contains your Studio session token and stops working when that session expires.")}))]}))}))}))]})};export{k as default};
@@ -111,6 +111,7 @@ type PickaxeContextType = {
111
111
  isRtl: boolean;
112
112
  isEmbed: boolean;
113
113
  mcpEnabled: boolean;
114
+ mcpGuestId?: string;
114
115
  isDropShadow: boolean;
115
116
  allowGuestUsage: boolean;
116
117
  persistActiveConversation: boolean;
@@ -164,6 +165,7 @@ export interface IPickaxeProviderProps {
164
165
  isRtl?: boolean;
165
166
  isEmbed?: boolean;
166
167
  mcpEnabled?: boolean;
168
+ mcpGuestId?: string;
167
169
  studioSessionToken?: string | null;
168
170
  isDropShadow?: boolean;
169
171
  allowGuestUsage?: boolean;
@@ -174,5 +176,5 @@ export interface IPickaxeProviderProps {
174
176
  onSessionIdChange?: (sessionId: string) => void;
175
177
  }
176
178
  export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
177
- export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
179
+ export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, mcpEnabled, mcpGuestId, studioSessionToken, isDropShadow, allowGuestUsage, persistActiveConversation, preventInitialSessionId, onUpgrade, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
178
180
  export {};
@@ -38,6 +38,7 @@ export declare const usePickaxeContext: () => {
38
38
  isRtl: boolean;
39
39
  isEmbed: boolean;
40
40
  mcpEnabled: boolean;
41
+ mcpGuestId?: string | undefined;
41
42
  isDropShadow: boolean;
42
43
  allowGuestUsage: boolean;
43
44
  persistActiveConversation: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "6.22.0",
3
+ "version": "6.22.1",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",