@pickaxeproject/react 6.0.1-9 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/common/utils.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
- package/dist/cjs/components/Pickaxe/index.js +1 -1
- package/dist/cjs/src/common/utils.d.ts +0 -2
- package/dist/cjs/src/components/Pickaxe/Provider.d.ts +2 -5
- package/dist/cjs/src/components/Pickaxe/ResponseProvider.d.ts +3 -6
- package/dist/cjs/src/components/Pickaxe/common/PickaxeUpgradeCard.d.ts +1 -1
- package/dist/cjs/src/hooks/pickaxe/usePickaxeContext.d.ts +0 -1
- package/dist/cjs/src/types/response.d.ts +0 -8
- package/dist/esm/common/utils.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/index.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
- package/dist/esm/components/Pickaxe/index.js +1 -1
- package/dist/esm/src/common/utils.d.ts +0 -2
- package/dist/esm/src/components/Pickaxe/Provider.d.ts +2 -5
- package/dist/esm/src/components/Pickaxe/ResponseProvider.d.ts +3 -6
- package/dist/esm/src/components/Pickaxe/common/PickaxeUpgradeCard.d.ts +1 -1
- package/dist/esm/src/hooks/pickaxe/usePickaxeContext.d.ts +0 -1
- package/dist/esm/src/types/response.d.ts +0 -8
- package/package.json +203 -206
- package/dist/cjs/components/Icons/pencil.svg.js +0 -1
- package/dist/cjs/components/Pickaxe/common/AccessGroupCardPreview.js +0 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeAvatar.js +0 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeCommon.js +0 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeCurrency.js +0 -1
- package/dist/cjs/src/components/Pickaxe/common/AccessGroupCardPreview.d.ts +0 -9
- package/dist/cjs/src/components/Pickaxe/common/PickaxeAvatar.d.ts +0 -16
- package/dist/cjs/src/components/Pickaxe/common/PickaxeCommon.d.ts +0 -2
- package/dist/cjs/src/components/Pickaxe/common/PickaxeCurrency.d.ts +0 -7
- package/dist/esm/components/Icons/pencil.svg.js +0 -1
- package/dist/esm/components/Pickaxe/common/AccessGroupCardPreview.js +0 -1
- package/dist/esm/components/Pickaxe/common/PickaxeAvatar.js +0 -1
- package/dist/esm/components/Pickaxe/common/PickaxeCommon.js +0 -1
- package/dist/esm/components/Pickaxe/common/PickaxeCurrency.js +0 -1
- package/dist/esm/src/components/Pickaxe/common/AccessGroupCardPreview.d.ts +0 -9
- package/dist/esm/src/components/Pickaxe/common/PickaxeAvatar.d.ts +0 -16
- package/dist/esm/src/components/Pickaxe/common/PickaxeCommon.d.ts +0 -2
- package/dist/esm/src/components/Pickaxe/common/PickaxeCurrency.d.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e,__awaiter as t}from"../../../_virtual/_tslib.js";import{jsx as n,jsxs as s,Fragment as o}from"react/jsx-runtime";import{forwardRef as i,useState as r,useRef as a,useMemo as l,useImperativeHandle as c,useEffect as d}from"react";import"../../../node_modules/.pnpm/regenerator-runtime@0.14.1/node_modules/regenerator-runtime/runtime.js";import u,{useSpeechRecognition as m}from"react-speech-recognition";import{usePickaxeContext as p}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as f}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as h}from"../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as g}from"../../../hooks/studio/useStyleFontSize.js";import{useConversation as v}from"../../../hooks/pickaxe/useConversation.js";import{useDimensionContext as b}from"../../../hooks/pickaxe/useDimensionContext.js";import{useAuthContext as y}from"../Addons/Auth/hooks/useAuthContext.js";import{useDocument as j}from"../Addons/Document/hooks/useDocument.js";import{useScroll as x}from"../Addons/Scroll/hooks/useScroll.js";import{useArtifactContext as w}from"../Addons/Artifact/hooks/useArtifactContext.js";import{useHover as O}from"../../../hooks/core/useHover.js";import{useMediaQuery as k}from"../../../hooks/core/useMediaQuery.js";import{allowedFileMimeTypes as S,allowedImageMimeTypes as N,additionalAllowedFileExtensions as I}from"../../../common/documents.js";import{createParser as C}from"eventsource-parser";import E from"../../Icons/attach-vertical.svg.js";import _ from"../../Icons/arrow-right.svg.js";import A from"../../Icons/microphone.svg.js";import T from"../../Icons/stop.svg.js";import D from"../Addons/Document/List.js";import P from"../../Core/Textarea.js";import R from"../../Core/ErrorAlert.js";import L from"../../../common/error.js";import $ from"../../../common/cn.js";import{initializeEmbedUserId as W}from"../../../common/utils.js";const B=i((({resubmitPrompt:i,onFocus:B,onBlur:H,onInputHeightChange:F,initSmitheryAuthData:J},U)=>{var M,V,K;const{origin:X,pickaxeId:z,sessionId:q,sender:G,senderType:Q,portalId:Y,deploymentId:Z,deploymentType:ee,pickaxe:te,styles:ne,colors:se,locale:oe,forceMobile:ie,isNewChat:re,isRtl:ae,isEmailLogin:le,isShowFeedbackMessage:ce,setIsNewChat:de,setIsShowIceBreaker:ue,onGenerateComplete:me}=p(),{token:pe,isLoggedOut:fe,isSent:he}=y(),{messages:ge,isGenerating:ve,setMessages:be,setStatus:ye,setLimitData:je,setError:xe}=f(),{documents:we,isUploading:Oe,documentError:ke,onFileUpload:Se,setDocuments:Ne,setDocumentError:Ie}=j(),{scrollStartSession:Ce,scrollEndSession:Ee,scrollToBottom:_e}=x({auto:!0}),{artifacts:Ae,currentPopupType:Te,setArtifacts:De,setCurrentArtifact:Pe}=w(),{height:Re}=b(),Le=v(),[$e,We]=r(""),[Be,He]=r(!1),[Fe,Je]=r(!1),Ue=a(null),Me=a(""),Ve=a(null),Ke=a(null),Xe=a(null),ze=a(null),qe=a(null),Ge=Math.max(.4*Re,100),{transcript:Qe,listening:Ye,resetTranscript:Ze,browserSupportsSpeechRecognition:et}=m(),[tt]=k("(max-width: 480px)"),nt=O(),{isHover:st}=nt,ot=e(nt,["isHover"]),it=O(),{isHover:rt}=it,at=e(it,["isHover"]),lt=O(),{isHover:ct}=lt,dt=e(lt,["isHover"]),ut=g(),mt=h(),pt="undefined"!=typeof window?window.location.hostname:"",ft="undefined"!=typeof window?window.location.href:"",ht="undefined"!=typeof window&&window.self!==window.top,gt=pt.includes("pickaxe.co")&&!ft.includes("https://studio.pickaxe.co/_embed")&&!ht,vt=null===(M=null==te?void 0:te.documentuploadtype)||void 0===M?void 0:M.startsWith("enduserupload"),bt=et&&(null==te?void 0:te.enablevoicetotext),yt="chat-input"===ee&&re&&!he,jt="chat-input"===ee&&le&&fe&&he,xt=null!==(V=null==te?void 0:te.placeholdertext)&&void 0!==V?V:ae?"بماذا تريد أن تتحدث؟":"What do you want to talk about?",wt=Be||Fe,Ot=l((()=>{var e,t,n;return!!re&&(!!te&&(!Le.isLoading&&(!((null!==(t=null===(e=Le.data)||void 0===e?void 0:e.messages.length)&&void 0!==t?t:0)>1)&&(!!(null===(n=te.icebreakers)||void 0===n?void 0:n.length)&&(!ce&&!yt)))))}),[te,re,ce,yt,Le.data,Le.isLoading]),kt=l((()=>{if(ve||Oe)return!1;const e=we.length>0&&we.every((e=>"finished"===e.status));return!(!$e.trim()&&!e)&&we.every((e=>"finished"===e.status||e.isInsertedAsRaw))}),[ve,Oe,$e,we]);c(U,(()=>({onSubmit:St}))),d((()=>{ue(Ot)}),[Ot]),d((()=>{var e;if(i){const t=Array.from(ge),n=null===(e=t[t.length-2].parts.find((e=>"text"===e.type)))||void 0===e?void 0:e.content;St(n,!0)}}),[i]),d((()=>{if(!ze.current||!F)return;const e=new ResizeObserver((e=>{for(const t of e)F(t.contentRect.height)}));return e.observe(ze.current),()=>{e.disconnect()}}),[F]),d((()=>{if(!Ye)return;const e=Me.current?`${Me.current} `:"";We(`${e}${Qe}`)}),[Qe,Ye]),d((()=>{if(!Ke.current)return;(()=>{if(!Ke.current)return;let e=Ke.current.scrollHeight>52;$e.includes("\n")||we.length?e=!0:$e.trim()||(e=!1),He(e)})()}),[$e,we]),d((()=>{const e=Ke.current,t=Xe.current;if(!e||!t||Be||$e.includes("\n"))return void Je(!1);const n=window.getComputedStyle(e),s=`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${n.fontSize} / ${n.lineHeight} ${n.fontFamily}`,o=document.createElement("span");Object.assign(o.style,{font:s,letterSpacing:n.letterSpacing,position:"absolute",visibility:"hidden",whiteSpace:"nowrap",top:"0",left:"0"}),o.textContent=$e||xt,document.body.appendChild(o);const i=o.offsetWidth;o.remove();const r=parseFloat(n.paddingLeft)||0,a=parseFloat(n.paddingRight)||0,l=e.clientWidth-r-a-t.offsetWidth;Je(i>l)}),[$e,Be,xt]);const St=(e,n=!1)=>t(void 0,void 0,void 0,(function*(){var t,s,o;try{if(ve||Oe)return;const i=we.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),r=i.map((e=>e.documentId)).filter(Boolean),a=i.filter((e=>"image"===e.type)).map((e=>{const t=e.name.split(".").pop()||"";return{documentId:e.documentId,extension:t}})),l=r.length>0,c=null!=e?e:$e;if(!c&&!l)return;xe(""),Ie(""),je(null),We(""),de(!1),ye("fetching"),Ce(),_e();const d=null!==(s=null===(t=null==te?void 0:te.documentuploadtype)||void 0===t?void 0:t.startsWith("enduserupload"))&&void 0!==s&&s&&r.length>0,u=[...n?Array.from(ge.slice(0,ge.length-1)):Array.from(ge),...n?[]:[{id:ge.length+1,role:"user",parts:[{type:"text",content:c,isVisible:!0}],documentIds:d?r:[]}],{id:ge.length+(n?0:2),role:"assistant",parts:[],documentIds:[]}];be(u),_e(),d&&Ne([]);const m=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/submit`,Object.assign(Object.assign({method:"POST",body:JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({origin:X,pickaxeId:z,sessionId:q,senderType:Q,value:c},d&&{documentIds:r}),G&&{sender:G}),pe&&{studioSessionToken:pe}),!pe&&!G&&{sender:W()}),Y&&{portalId:Y}),Z&&{deploymentId:Z}),a.length>0&&{uploadedModelImages:a}))},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),gt&&{credentials:"include"})),p=yield m.json();if(!p.success){const e=new Error(p.error||"Failed to start generation");throw p.limitData&&(e.limitData=p.limitData),e}const f=p.submissionId;ye("streaming"),qe.current=new AbortController;const h=u.length-1,g=[];let v=[...null!=Ae?Ae:[]],b=0,y=!1,j="";for(;!y;)try{const e=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/stream/${f}?index=${b}`,{signal:null===(o=qe.current)||void 0===o?void 0:o.signal,headers:{"Cache-Control":"no-cache",Connection:"keep-alive"}});if(!e.body)throw new Error("No response body");const t=e.body.getReader();Ve.current=t;const n=new TextDecoder,s=C({onEvent:e=>{var t,n;if(e.event&&"ping"!==e.event&&b++,"stop"!==e.event){if("error"===e.event){const t=JSON.parse(e.data).error||"Something went wrong.";return xe(t),void(y=!0)}if("delta"===e.event){const s=JSON.parse(e.data);if("data-error"===s.type&&J){const e=s.data.error;if("string"==typeof e){if(/['"]type['"]\s*:\s*['"]unauthorized_smithery['"]/.test(e)){const t=e.match(/['"]qualifiedName['"]\s*:\s*['"]([^'"]+)['"]/),n=e.match(/['"]serverId['"]\s*:\s*['"]([^'"]+)['"]/),s=e.match(/['"]name['"]\s*:\s*['"]([^'"]+)['"]/);if(t&&t[1]&&n&&n[1]&&s&&s[1])throw y=!0,J({smitheryId:t[1],serverId:n[1],name:s[1]}),new Error("STOP_STREAM")}}else if("object"==typeof e&&null!==e){const t=e;if("unauthorized_smithery"===t.type&&t.qualifiedName&&t.serverId&&t.name)throw y=!0,J({smitheryId:t.qualifiedName,serverId:t.serverId,name:t.name}),new Error("STOP_STREAM")}}else if("text-start"===s.type)j="",g.push({type:"text",content:"",isVisible:null===(t=s.isVisible)||void 0===t||t});else if("text-delta"===s.type)j+=s.delta,g[g.length-1].content=j;else if("text-end"===s.type)j="";else if("reasoning-start"===s.type)j="",g.push({type:"reasoning",content:"",isVisible:null===(n=s.isVisible)||void 0===n||n});else if("reasoning-delta"===s.type)j+=s.delta,g[g.length-1].content=j;else if("reasoning-end"===s.type)j="";else if(s.type.startsWith("data-")){const e=s;g.push({type:e.type,content:JSON.stringify(e.data),isVisible:!0})}be([...u.slice(0,h),Object.assign(Object.assign({},u[u.length-1]),{id:ge.length+1,role:"assistant",parts:g})])}else if("artifact_created"===e.event){const t=JSON.parse(e.data);v=v.filter((e=>!(e.id===t.id&&e.version===t.version))),v.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),De([...v]),Te.startsWith("inline")||Pe({id:t.id,version:t.version})}else if("artifact_updated"===e.event){const t=JSON.parse(e.data);v=v.filter((e=>!(e.id===t.id&&e.version===t.version))),v.push(Object.assign(Object.assign({},t),{content:"",status:"updating"})),De(v),Te.startsWith("inline")||Pe({id:t.id,version:t.version})}else if("artifact_rewrite"===e.event){const t=JSON.parse(e.data);v=v.filter((e=>!(e.id===t.id&&e.version===t.version))),v.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),De(v),Te.startsWith("inline")||Pe({id:t.id,version:t.version})}else if("artifact_content"===e.event){const t=JSON.parse(e.data),n=t.token.replace(/\u200B/g,"");v=v.map((e=>e.id===t.id&&e.version===t.version?Object.assign(Object.assign({},e),{content:e.content+n,status:"streaming"}):e)),De(v)}else if("artifact_finished"===e.event){const t=JSON.parse(e.data);De(v.map((e=>e.id===t.id?Object.assign(Object.assign({},e),{status:"finished"}):e)))}else if("error"===e.event){const t=JSON.parse(e.data);xe(t.error||"Something went wrong, please try again.")}else"stop"===e.event&&(y=!0)}else y=!0}});for(;;){const{value:e,done:o}=yield t.read();if(o)break;s.feed(n.decode(e))}y||(yield new Promise((e=>setTimeout(e,1e3))))}catch(e){if("STOP_STREAM"===e.message||"AbortError"===e.name)return void(y=!0);console.warn("Stream connection lost, retrying...",e),yield new Promise((e=>setTimeout(e,1e3)))}null==me||me(q)}catch(e){if(e.limitData)je(e.limitData),xe("");else{let t=L(e)||"";t&&!t.includes("Unexpected token 'A',")||(t="Oops! We're experiencing high traffic at the moment. Please try again later."),xe(t)}}finally{_e(),ye("idle"),Ee(),Ve.current=null}}));return jt?null:n("div",Object.assign({className:$("flex w-full flex-shrink-0 flex-col items-center",!yt&&"px-4 pb-8"),dir:ae?"rtl":"ltr"},{children:s("div",Object.assign({className:"flex w-full max-w-[800px] flex-col"},{children:[s("div",Object.assign({ref:ze,className:$("relative flex flex-col w-full justify-end gap-y-3 py-[3px]","block"===ne.formFieldStyle&&"shadow"),style:Object.assign(Object.assign({},mt),{maxHeight:`${Ge}px`,overflowY:"auto"})},{children:[Ye&&s("div",Object.assign({className:"absolute left-4 top-1/2 flex -translate-y-1/2 select-none items-center gap-x-2"},{children:[n("span",{className:"h-2 w-2 animate-pulse rounded-full bg-c-secondary",style:{backgroundColor:null!==(K=se.accent)&&void 0!==K?K:"#ff0000"}}),n("span",Object.assign({className:"text-sm text-c-secondary font-semilight",style:{color:se.text+"90"}},{children:"Listening..."}))]})),!ve&&we.length>0&&n(D,{className:"p-4 pb-0",isDisabled:ve}),n(P,Object.assign({ref:Ke,className:$(ut.i1,"py-3.5 max-h-60 px-4 w-full border-transparent bg-transparent",!$e.trim()&&!$e.includes("\n")&&"overflow-hidden text-ellipsis whitespace-nowrap placeholder:whitespace-normal placeholder:overflow-visible",ae?"text-right":"text-left",wt&&"mb-12",Ye&&"text-transparent"),value:$e,placeholder:xt,onChange:e=>{if(We(e),F){const t=(e.match(/\n/g)||[]).length+1;if(!e)return void F(0);if(t>=11)return;let n=0;t>1&&(n=50),F(24*(t-1)+n)}},onKeyDown:e=>{ie||tt||"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),Oe||ve||St()))},onPaste:e=>t(void 0,void 0,void 0,(function*(){const t=Array.from(e.clipboardData.files||[]);t.length>0&&(e.preventDefault(),de(!1),yield Se(t))}))},B&&{onFocus:B},H&&{onBlur:H},{dir:ae?"rtl":"ltr"})),n("div",Object.assign({ref:Xe,className:$("flex items-center gap-2 absolute right-0 z-2 transition-all duration-200 ease-in-out",wt?"mb-2.5":"top-1/2 -translate-y-1/2"),style:Object.assign(Object.assign({},!wt&&mt.backgroundColor&&{backgroundColor:mt.backgroundColor}),{borderTopRightRadius:ne.cornerRadius+"px",borderBottomRightRadius:ne.cornerRadius+"px"})},{children:ve?n("button",Object.assign({className:"flex h-8 w-8 items-center mr-2 justify-center rounded-full outline-none transition-colors duration-200 ease-in-out",onClick:()=>{qe.current&&(qe.current.abort(),qe.current=null),Ve.current&&(Ve.current.cancel(),Ve.current=null),ye("idle")},style:{backgroundColor:se.accent,color:se.accentText}},{children:n(T,{className:"h-4 w-4 shrink-0"})})):Ye?n("button",Object.assign({className:"flex h-8 w-8 items-center mr-2 justify-center rounded-full outline-none transition-colors duration-200 ease-in-out",onClick:u.stopListening,style:{backgroundColor:se.accent,color:se.accentText}},{children:n(T,{className:"h-4 w-4 shrink-0"})})):s(o,{children:[vt&&s("button",Object.assign({className:"flex h-8 w-8 items-center justify-center rounded-full outline-none transition-colors duration-200 ease-in-out disabled:cursor-default",style:{backgroundColor:rt?se.accent+"10":void 0,color:rt?se.accent:se.accent+"80"},disabled:Oe||ve,onClick:()=>{var e;return null===(e=Ue.current)||void 0===e?void 0:e.click()}},at,{children:[n("input",{id:"file-upload",ref:Ue,type:"file",accept:[...S,...N,...I].join(", "),multiple:!0,hidden:!0,className:"hidden",onChange:e=>t(void 0,void 0,void 0,(function*(){de(!1),yield Se(Array.from(e.target.files||[])),e.target.value=""}))}),n(E,{className:"h-6 w-6 shrink-0"})]})),bt&&n("button",Object.assign({className:"disabled:cursor-default flex h-8 w-8 items-center justify-center rounded-full outline-none transition-colors duration-200 ease-in-out",style:{backgroundColor:Ye?se.accent:ct?se.accent+"10":void 0,color:Ye?se.accentText:ct?se.accent:se.accent+"80"},disabled:Oe||ve,onClick:()=>{Ye?u.stopListening():(Me.current=$e,Ze(),u.startListening({continuous:!0,interimResults:!0,language:oe||"en-US"}))}},dt,{children:n(A,{className:"h-5 w-5 shrink-0"})})),n("button",Object.assign({className:"flex h-8 w-8 items-center mr-2 justify-center rounded-full outline-none transition-colors duration-200 ease-in-out disabled:cursor-default",style:{backgroundColor:st||kt?se.accent:se.accent+"10",color:st||kt?se.accentText:se.accent+"80"},disabled:!kt,onClick:()=>St()},ot,{children:n(_,{className:$("h-6 w-6 shrink-0",ae&&"scale-x-[-1] transform")})}))]})}))]})),ke&&n(R,{error:ke,className:"mt-3"})]}))}))}));B.displayName="Input";export{B as default};
|
|
1
|
+
import{__rest as e,__awaiter as t}from"../../../_virtual/_tslib.js";import{jsx as n,jsxs as s,Fragment as o}from"react/jsx-runtime";import{forwardRef as i,useState as r,useRef as a,useMemo as l,useImperativeHandle as c,useEffect as d}from"react";import"../../../node_modules/.pnpm/regenerator-runtime@0.14.1/node_modules/regenerator-runtime/runtime.js";import u,{useSpeechRecognition as m}from"react-speech-recognition";import{usePickaxeContext as p}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as f}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as h}from"../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as g}from"../../../hooks/studio/useStyleFontSize.js";import{useConversation as v}from"../../../hooks/pickaxe/useConversation.js";import{useDimensionContext as b}from"../../../hooks/pickaxe/useDimensionContext.js";import{useAuthContext as y}from"../Addons/Auth/hooks/useAuthContext.js";import{useDocument as x}from"../Addons/Document/hooks/useDocument.js";import{useScroll as j}from"../Addons/Scroll/hooks/useScroll.js";import{useArtifactContext as w}from"../Addons/Artifact/hooks/useArtifactContext.js";import{useHover as O}from"../../../hooks/core/useHover.js";import{useMediaQuery as k}from"../../../hooks/core/useMediaQuery.js";import{allowedFileMimeTypes as S,allowedImageMimeTypes as N,additionalAllowedFileExtensions as I}from"../../../common/documents.js";import{createParser as C}from"eventsource-parser";import E from"../../Icons/attach-vertical.svg.js";import _ from"../../Icons/arrow-right.svg.js";import A from"../../Icons/microphone.svg.js";import T from"../../Icons/stop.svg.js";import P from"../Addons/Document/List.js";import R from"../../Core/Textarea.js";import D from"../../Core/ErrorAlert.js";import L from"../../../common/error.js";import $ from"../../../common/cn.js";const W=i((({resubmitPrompt:i,onFocus:W,onBlur:B,onInputHeightChange:H,initSmitheryAuthData:F},J)=>{var U,M,V;const{origin:K,pickaxeId:X,sessionId:z,sender:q,senderType:G,deploymentId:Q,deploymentType:Y,pickaxe:Z,styles:ee,colors:te,locale:ne,forceMobile:se,isNewChat:oe,isRtl:ie,isEmailLogin:re,isShowFeedbackMessage:ae,setIsNewChat:le,setIsShowIceBreaker:ce,onGenerateComplete:de}=p(),{token:ue,isLoggedOut:me,isSent:pe}=y(),{messages:fe,limits:he,isGenerating:ge,setMessages:ve,setStatus:be,setLimitData:ye,setError:xe}=f(),{documents:je,isUploading:we,documentError:Oe,onFileUpload:ke,setDocuments:Se,setDocumentError:Ne}=x(),{scrollStartSession:Ie,scrollEndSession:Ce,scrollToBottom:Ee}=j({auto:!0}),{artifacts:_e,currentPopupType:Ae,setArtifacts:Te,setCurrentArtifact:Pe}=w(),{height:Re}=b(),De=v(),[Le,$e]=r(""),[We,Be]=r(!1),[He,Fe]=r(!1),Je=a(null),Ue=a(""),Me=a(null),Ve=a(null),Ke=a(null),Xe=a(null),ze=a(null),qe=Math.max(.4*Re,100),{transcript:Ge,listening:Qe,resetTranscript:Ye,browserSupportsSpeechRecognition:Ze}=m(),[et]=k("(max-width: 480px)"),tt=O(),{isHover:nt}=tt,st=e(tt,["isHover"]),ot=O(),{isHover:it}=ot,rt=e(ot,["isHover"]),at=O(),{isHover:lt}=at,ct=e(at,["isHover"]),dt=g(),ut=h(),mt="undefined"!=typeof window?window.location.hostname:"",pt="undefined"!=typeof window?window.location.href:"",ft="undefined"!=typeof window&&window.self!==window.top,ht=mt.includes("pickaxe.co")&&!pt.includes("https://studio.pickaxe.co/_embed")&&!ft,gt=null===(U=null==Z?void 0:Z.documentuploadtype)||void 0===U?void 0:U.startsWith("enduserupload"),vt=Ze&&(null==Z?void 0:Z.enablevoicetotext),bt="chat-input"===Y&&oe&&!pe,yt="chat-input"===Y&&re&&me&&pe,xt=null!==(M=null==Z?void 0:Z.placeholdertext)&&void 0!==M?M:ie?"بماذا تريد أن تتحدث؟":"What do you want to talk about?",jt=We||He,wt=l((()=>{var e,t,n;return!!oe&&(!!Z&&(!De.isLoading&&(!((null!==(t=null===(e=De.data)||void 0===e?void 0:e.messages.length)&&void 0!==t?t:0)>1)&&(!!(null===(n=Z.icebreakers)||void 0===n?void 0:n.length)&&(!ae&&!bt)))))}),[Z,oe,ae,bt,De.data,De.isLoading]),Ot=l((()=>{if(ge||we)return!1;const e=je.length>0&&je.every((e=>"finished"===e.status));return!(!Le.trim()&&!e)&&je.every((e=>"finished"===e.status||e.isInsertedAsRaw))}),[ge,we,Le,je]);c(J,(()=>({onSubmit:kt}))),d((()=>{ce(wt)}),[wt]),d((()=>{var e;if(i){const t=Array.from(fe),n=null===(e=t[t.length-2].parts.find((e=>"text"===e.type)))||void 0===e?void 0:e.content;kt(n,!0)}}),[i]),d((()=>{if(!Xe.current||!H)return;const e=new ResizeObserver((e=>{for(const t of e)H(t.contentRect.height)}));return e.observe(Xe.current),()=>{e.disconnect()}}),[H]),d((()=>{if(!Qe)return;const e=Ue.current?`${Ue.current} `:"";$e(`${e}${Ge}`)}),[Ge,Qe]),d((()=>{if(!Ve.current)return;(()=>{if(!Ve.current)return;let e=Ve.current.scrollHeight>52;Le.includes("\n")||je.length?e=!0:Le.trim()||(e=!1),Be(e)})()}),[Le,je]),d((()=>{const e=Ve.current,t=Ke.current;if(!e||!t||We||Le.includes("\n"))return void Fe(!1);const n=window.getComputedStyle(e),s=`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${n.fontSize} / ${n.lineHeight} ${n.fontFamily}`,o=document.createElement("span");Object.assign(o.style,{font:s,letterSpacing:n.letterSpacing,position:"absolute",visibility:"hidden",whiteSpace:"nowrap",top:"0",left:"0"}),o.textContent=Le||xt,document.body.appendChild(o);const i=o.offsetWidth;o.remove();const r=parseFloat(n.paddingLeft)||0,a=parseFloat(n.paddingRight)||0,l=e.clientWidth-r-a-t.offsetWidth;Fe(i>l)}),[Le,We,xt]);const kt=(e,n=!1)=>t(void 0,void 0,void 0,(function*(){var t,s,o;try{if(ge||we)return;const i=je.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),r=i.map((e=>e.documentId)).filter(Boolean),a=i.filter((e=>"image"===e.type)).map((e=>{const t=e.name.split(".").pop()||"";return{documentId:e.documentId,extension:t}})),l=r.length>0,c=null!=e?e:Le;if(!c&&!l)return;xe(""),Ne(""),ye(null),$e(""),le(!1),be("fetching"),Ie(),Ee();const d=null!==(s=null===(t=null==Z?void 0:Z.documentuploadtype)||void 0===t?void 0:t.startsWith("enduserupload"))&&void 0!==s&&s&&r.length>0,u=[...n?Array.from(fe.slice(0,fe.length-1)):Array.from(fe),...n?[]:[{id:fe.length+1,role:"user",parts:[{type:"text",content:c,isVisible:!0}],documentIds:d?r:[]}],{id:fe.length+(n?0:2),role:"assistant",parts:[],documentIds:[]}];ve(u),Ee(),d&&Se([]);const m=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/submit`,Object.assign({method:"POST",body:JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({origin:K,pickaxeId:X,sessionId:z,senderType:G,value:c},d&&{documentIds:r}),q&&{sender:q}),ue&&{studioSessionToken:ue}),Q&&{deploymentId:Q}),a.length>0&&{uploadedModelImages:a})),headers:Object.assign(Object.assign({},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN})),{"x-request-sent-at":(new Date).toISOString()})},ht&&{credentials:"include"})),p=yield m.json();if(!p.success)throw new Error(p.error||"Failed to start generation");const f=p.submissionId;be("streaming"),ze.current=new AbortController;const h=u.length-1,g=[];let v=[...null!=_e?_e:[]],b=0,y=!1,x="";for(;!y;)try{const e=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/stream/${f}?index=${b}`,{signal:null===(o=ze.current)||void 0===o?void 0:o.signal,headers:{"Cache-Control":"no-cache",Connection:"keep-alive"}});if(!e.body)throw new Error("No response body");const t=e.body.getReader();Me.current=t;const n=new TextDecoder,s=C({onEvent:e=>{var t,n;if(e.event&&"ping"!==e.event&&b++,"stop"!==e.event){if("error"===e.event){const t=JSON.parse(e.data).error||"Something went wrong.";return xe(t),void(y=!0)}if("delta"===e.event){const s=JSON.parse(e.data);if("data-error"===s.type&&F){const e=s.data.error;if("string"==typeof e){if(/['"]type['"]\s*:\s*['"]unauthorized_smithery['"]/.test(e)){const t=e.match(/['"]qualifiedName['"]\s*:\s*['"]([^'"]+)['"]/),n=e.match(/['"]serverId['"]\s*:\s*['"]([^'"]+)['"]/),s=e.match(/['"]name['"]\s*:\s*['"]([^'"]+)['"]/);if(t&&t[1]&&n&&n[1]&&s&&s[1])throw y=!0,F({smitheryId:t[1],serverId:n[1],name:s[1]}),new Error("STOP_STREAM")}}else if("object"==typeof e&&null!==e){const t=e;if("unauthorized_smithery"===t.type&&t.qualifiedName&&t.serverId&&t.name)throw y=!0,F({smitheryId:t.qualifiedName,serverId:t.serverId,name:t.name}),new Error("STOP_STREAM")}}else if("text-start"===s.type)x="",g.push({type:"text",content:"",isVisible:null===(t=s.isVisible)||void 0===t||t});else if("text-delta"===s.type)x+=s.delta,g[g.length-1].content=x;else if("text-end"===s.type)x="";else if("reasoning-start"===s.type)x="",g.push({type:"reasoning",content:"",isVisible:null===(n=s.isVisible)||void 0===n||n});else if("reasoning-delta"===s.type)x+=s.delta,g[g.length-1].content=x;else if("reasoning-end"===s.type)x="";else if(s.type.startsWith("data-")){const e=s;g.push({type:e.type,content:JSON.stringify(e.data),isVisible:!0})}ve([...u.slice(0,h),Object.assign(Object.assign({},u[u.length-1]),{id:fe.length+1,role:"assistant",parts:g})])}else if("artifact_created"===e.event){const t=JSON.parse(e.data);v=v.filter((e=>!(e.id===t.id&&e.version===t.version))),v.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),Te([...v]),Ae.startsWith("inline")||Pe({id:t.id,version:t.version})}else if("artifact_updated"===e.event){const t=JSON.parse(e.data);v=v.filter((e=>!(e.id===t.id&&e.version===t.version))),v.push(Object.assign(Object.assign({},t),{content:"",status:"updating"})),Te(v),Ae.startsWith("inline")||Pe({id:t.id,version:t.version})}else if("artifact_rewrite"===e.event){const t=JSON.parse(e.data);v=v.filter((e=>!(e.id===t.id&&e.version===t.version))),v.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),Te(v),Ae.startsWith("inline")||Pe({id:t.id,version:t.version})}else if("artifact_content"===e.event){const t=JSON.parse(e.data),n=t.token.replace(/\u200B/g,"");v=v.map((e=>e.id===t.id&&e.version===t.version?Object.assign(Object.assign({},e),{content:e.content+n,status:"streaming"}):e)),Te(v)}else if("artifact_finished"===e.event){const t=JSON.parse(e.data);Te(v.map((e=>e.id===t.id?Object.assign(Object.assign({},e),{status:"finished"}):e)))}else if("error"===e.event){const t=JSON.parse(e.data);xe(t.error||"Something went wrong, please try again.")}else"stop"===e.event&&(y=!0)}else y=!0}});for(;;){const{value:e,done:o}=yield t.read();if(o)break;s.feed(n.decode(e))}y||(yield new Promise((e=>setTimeout(e,1e3))))}catch(e){if("STOP_STREAM"===e.message||"AbortError"===e.name)return void(y=!0);console.warn("Stream connection lost, retrying...",e),yield new Promise((e=>setTimeout(e,1e3)))}null==de||de(z)}catch(e){let t=L(e)||"";t&&!t.includes("Unexpected token 'A',")||(t="Oops! We're experiencing high traffic at the moment. Please try again later.");const n=Object.entries(he).find((([e])=>t.includes(e)));n?ye(n[1]):xe(t)}finally{Ee(),be("idle"),Ce(),Me.current=null}}));return yt?null:n("div",Object.assign({className:$("flex w-full flex-shrink-0 flex-col items-center",!bt&&"px-4 pb-8"),dir:ie?"rtl":"ltr"},{children:s("div",Object.assign({className:"flex w-full max-w-[800px] flex-col"},{children:[s("div",Object.assign({ref:Xe,className:$("relative flex flex-col w-full justify-end gap-y-3 py-[3px]","block"===ee.formFieldStyle&&"shadow"),style:Object.assign(Object.assign({},ut),{maxHeight:`${qe}px`,overflowY:"auto"})},{children:[Qe&&s("div",Object.assign({className:"absolute left-4 top-1/2 flex -translate-y-1/2 select-none items-center gap-x-2"},{children:[n("span",{className:"h-2 w-2 animate-pulse rounded-full bg-c-secondary",style:{backgroundColor:null!==(V=te.accent)&&void 0!==V?V:"#ff0000"}}),n("span",Object.assign({className:"text-sm text-c-secondary font-semilight",style:{color:te.text+"90"}},{children:"Listening..."}))]})),!ge&&je.length>0&&n(P,{className:"p-4 pb-0",isDisabled:ge}),n(R,Object.assign({ref:Ve,className:$(dt.i1,"py-3.5 max-h-60 px-4 w-full border-transparent bg-transparent",!Le.trim()&&!Le.includes("\n")&&"overflow-hidden text-ellipsis whitespace-nowrap placeholder:whitespace-normal placeholder:overflow-visible",ie?"text-right":"text-left",jt&&"mb-12",Qe&&"text-transparent"),value:Le,placeholder:xt,onChange:e=>{if($e(e),H){const t=(e.match(/\n/g)||[]).length+1;if(!e)return void H(0);if(t>=11)return;let n=0;t>1&&(n=50),H(24*(t-1)+n)}},onKeyDown:e=>{se||et||"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),we||ge||kt()))},onPaste:e=>t(void 0,void 0,void 0,(function*(){const t=Array.from(e.clipboardData.files||[]);t.length>0&&(e.preventDefault(),le(!1),yield ke(t))}))},W&&{onFocus:W},B&&{onBlur:B},{dir:ie?"rtl":"ltr"})),n("div",Object.assign({ref:Ke,className:$("flex items-center gap-2 absolute right-0 z-2 transition-all duration-200 ease-in-out",jt?"mb-2.5":"top-1/2 -translate-y-1/2"),style:Object.assign(Object.assign({},!jt&&ut.backgroundColor&&{backgroundColor:ut.backgroundColor}),{borderTopRightRadius:ee.cornerRadius+"px",borderBottomRightRadius:ee.cornerRadius+"px"})},{children:ge?n("button",Object.assign({className:"flex h-8 w-8 items-center mr-2 justify-center rounded-full outline-none transition-colors duration-200 ease-in-out",onClick:()=>{ze.current&&(ze.current.abort(),ze.current=null),Me.current&&(Me.current.cancel(),Me.current=null),be("idle")},style:{backgroundColor:te.accent,color:te.accentText}},{children:n(T,{className:"h-4 w-4 shrink-0"})})):Qe?n("button",Object.assign({className:"flex h-8 w-8 items-center mr-2 justify-center rounded-full outline-none transition-colors duration-200 ease-in-out",onClick:u.stopListening,style:{backgroundColor:te.accent,color:te.accentText}},{children:n(T,{className:"h-4 w-4 shrink-0"})})):s(o,{children:[gt&&s("button",Object.assign({className:"flex h-8 w-8 items-center justify-center rounded-full outline-none transition-colors duration-200 ease-in-out disabled:cursor-default",style:{backgroundColor:it?te.accent+"10":void 0,color:it?te.accent:te.accent+"80"},disabled:we||ge,onClick:()=>{var e;return null===(e=Je.current)||void 0===e?void 0:e.click()}},rt,{children:[n("input",{id:"file-upload",ref:Je,type:"file",accept:[...S,...N,...I].join(", "),multiple:!0,hidden:!0,className:"hidden",onChange:e=>t(void 0,void 0,void 0,(function*(){le(!1),yield ke(Array.from(e.target.files||[])),e.target.value=""}))}),n(E,{className:"h-6 w-6 shrink-0"})]})),vt&&n("button",Object.assign({className:"disabled:cursor-default flex h-8 w-8 items-center justify-center rounded-full outline-none transition-colors duration-200 ease-in-out",style:{backgroundColor:Qe?te.accent:lt?te.accent+"10":void 0,color:Qe?te.accentText:lt?te.accent:te.accent+"80"},disabled:we||ge,onClick:()=>{Qe?u.stopListening():(Ue.current=Le,Ye(),u.startListening({continuous:!0,interimResults:!0,language:ne||"en-US"}))}},ct,{children:n(A,{className:"h-5 w-5 shrink-0"})})),n("button",Object.assign({className:"flex h-8 w-8 items-center mr-2 justify-center rounded-full outline-none transition-colors duration-200 ease-in-out disabled:cursor-default",style:{backgroundColor:nt||Ot?te.accent:te.accent+"10",color:nt||Ot?te.accentText:te.accent+"80"},disabled:!Ot,onClick:()=>kt()},st,{children:n(_,{className:$("h-6 w-6 shrink-0",ie&&"scale-x-[-1] transform")})}))]})}))]})),Oe&&n(D,{error:Oe,className:"mt-3"})]}))}))}));W.displayName="Input";export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as t}from"../../../_virtual/_tslib.js";import{jsxs as e,jsx as o,Fragment as r}from"react/jsx-runtime";import{useState as n,useRef as i,useEffect as s}from"react";import{usePickaxeContext as a}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as c}from"../Addons/Auth/hooks/useAuthContext.js";import{useDimensionContext as l}from"../../../hooks/pickaxe/useDimensionContext.js";import{useDocument as u}from"../Addons/Document/hooks/useDocument.js";import{useStyleFontSize as m}from"../../../hooks/studio/useStyleFontSize.js";import d from"./History/index.js";import p from"./Input.js";import f from"../../Icons/attach-vertical.svg.js";import h from"../../../common/cn.js";const g=()=>{const{deploymentType:g,isNewChat:b,setIsNewChat:v}=a(),{isSent:x}=c(),{width:j,height:D,setDimension:y}=l(),{setDocuments:k,onFileUpload:w}=u(),A=m(),[I,N]=n(0),[F,O]=n(!1),[P,S]=n(!1),C=i(null),H=i(null),T=i(0),[z,R]=n(null),[_,B]=n(!1),E="chat-input"===g&&b&&!x;s((()=>()=>{k([])}),[]),s((()=>{if(!C.current)return;const t=new ResizeObserver((t=>{for(const e of t){const{width:t,height:o}=e.contentRect;y(parseInt(t.toFixed(0)),parseInt(o.toFixed(0)))}}));return t.observe(C.current),()=>{t.disconnect()}}),[C.current]);return e("div",Object.assign({ref:C,className:"relative flex h-full w-full flex-col items-center",onDragEnter:t=>{t.preventDefault(),t.stopPropagation(),T.current+=1,t.dataTransfer.items&&t.dataTransfer.items.length>0&&S(!0)},onDragLeave:t=>{t.preventDefault(),t.stopPropagation(),T.current-=1,0===T.current&&S(!1)},onDragOver:t=>{t.preventDefault(),t.stopPropagation()},onDrop:e=>t(void 0,void 0,void 0,(function*(){e.preventDefault(),e.stopPropagation(),S(!1),T.current=0;const t=Array.from(e.dataTransfer.files||[]);t.length>0&&(v(!1),yield w(t))}))},{children:[P&&e("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(f,{className:"h-10 w-10"})})),o("h3",Object.assign({className:h(A.h3,"mt-6 font-semibold text-c-primary text-black")},{children:"Drop files to upload"})),o("p",Object.assign({className:h(A.b2,"mt-2 opacity-60 text-black")},{children:"Add anything to the conversation"}))]})),E?o(p,{}):e(r,{children:[o(d,{additionalScrollHeight:I,isForceHideInfo:D<=545||j<=350||F,isInputFocused:F,onSubmit:e=>t(void 0,void 0,void 0,(function*(){H.current&&H.current.onSubmit(e)})),smitheryAuthData:z,resubmitPrompt:()=>{R(null),B(!0)}}),o(p,{ref:H,onFocus:()=>O(!0),onBlur:()=>O(!1),onInputHeightChange:N,initSmitheryAuthData:t=>R(t),resubmitPrompt:_})]})]}))};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";import{useState as n,useRef as i,useMemo as o}from"react";import{usePickaxeContext as r}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as a}from"../../Addons/Auth/hooks/useAuthContext.js";import{useResponseContext as l}from"../../../../hooks/pickaxe/useResponseContext.js";import{useDocument as d}from"../../Addons/Document/hooks/useDocument.js";import{useScroll as c}from"../../Addons/Scroll/hooks/useScroll.js";import{useArtifactContext as p}from"../../Addons/Artifact/hooks/useArtifactContext.js";import{extractUrlsFromText as u
|
|
1
|
+
import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";import{useState as n,useRef as i,useMemo as o}from"react";import{usePickaxeContext as r}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as a}from"../../Addons/Auth/hooks/useAuthContext.js";import{useResponseContext as l}from"../../../../hooks/pickaxe/useResponseContext.js";import{useDocument as d}from"../../Addons/Document/hooks/useDocument.js";import{useScroll as c}from"../../Addons/Scroll/hooks/useScroll.js";import{useArtifactContext as p}from"../../Addons/Artifact/hooks/useArtifactContext.js";import{extractUrlsFromText as u}from"../../../../common/utils.js";import{encode as m}from"@nem035/gpt-3-encoder";import{createParser as f}from"eventsource-parser";import g from"../../common/PickaxeBranding.js";import h from"../../common/PickaxeButton.js";import v from"../../../../common/error.js";const b=({questions:b,resetQuestions:y})=>{var j;const{origin:O,pickaxeId:x,sender:w,senderType:S,deploymentId:k,pickaxe:C,misc:I,translations:N,isRtl:P,setSessionId:_,setIsNewChat:A,onGenerateComplete:E}=r(),{token:T}=a(),{limits:L,isGenerating:U,setResponse:D,setMessages:q,setStatus:J,setLimitData:B,setError:K,setIsSwitchedToChat:R}=l(),{documents:W,websiteLink:X,isUploading:V,onWebsiteUpload:$,setDocuments:G,setDocumentError:M}=d(),{scrollStartSession:F,scrollEndSession:Q,scrollToTarget:Y}=c({auto:!(null==C?void 0:C.enablechatresponses)}),{artifacts:z,currentPopupType:H,setArtifacts:Z,setCurrentArtifact:ee}=p(),[te,se]=n(!1),ne=i(null),ie=o((()=>b.some((e=>("Short Answer"===e.type||"Long Answer"===e.type||"long"===e.type||"short"===e.type||"Checkbox"===e.type||"Knowledge Upload"===e.type||e.id.includes("documentupload"))&&e.input.length>0))),[b]);return t("div",Object.assign({className:"mt-4 flex flex-wrap justify-between gap-4 items-center",dir:P?"rtl":"ltr"},{children:[t("div",Object.assign({className:"flex items-center flex-grow flex-wrap gap-2"},{children:[s(h,Object.assign({className:"px-5 min-h-[42px]",isDisabled:V||U||te,onClick:()=>e(void 0,void 0,void 0,(function*(){var e,t,s;try{if(U||V||te)return;K(""),M(""),B(null),D(null);const n=["Multiple Choice","Checkbox"];for(const e of b){if(m(e.input).length>e.maxLength&&!n.includes(e.type))throw new Error("One or more of your responses is too long!");if(e.isRequired&&!e.input.trim()&&"userinput:documentupload"!==e.id)throw new Error("You must fill out all required fields.")}const i=W.filter((e=>"finished"===e.status)),o=W.map((e=>e.name)),r=null!==(t=null===(e=null==C?void 0:C.documentuploadtype)||void 0===e?void 0:e.startsWith("enduserupload"))&&void 0!==t&&t,a=b.some((e=>"userinput:documentupload"===e.id&&e.isRequired)),l=u(X).filter((e=>!o.includes(e)));if(l.length){const e=l[l.length-1];se(!0);const t=yield $(e);t&&(i.push(t),yield new Promise((e=>setTimeout(e,5e3)))),se(!1)}else if(a&&r&&!i.length)return void M("Please paste a valid website/video link or drag a file to add to the knowledge base.");const d=i.map((e=>e.documentId||"")).filter(Boolean),c=r&&d.length>0,p={};b.forEach((e=>{p[e.id]="Knowledge Upload"===e.type||e.id.includes("documentupload")?i.map((e=>e.name)).join(",")||"":e.input})),J("fetching"),F(),Y();const g=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/submit`,{method:"POST",headers:Object.assign(Object.assign({"Content-Type":"application/json"},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}),{"x-request-sent-at":(new Date).toISOString()}),body:JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign({origin:O,pickaxeId:x,senderType:S,valueObj:p},c&&{documentIds:d}),w&&{sender:w}),T&&{studioSessionToken:T}),k&&{deploymentId:k}))}),h=yield g.json();if(!h.success)throw new Error(h.error||"Failed to start generation");const v=h.submissionId,y=h.sessionId,j={sessionId:y,documentIds:c?d:[],question:{inputs:b.map((e=>({id:e.id,question:e.main,answer:e.input}))),responseParts:[]},messageCount:0,sentAt:new Date};D(j),(null==C?void 0:C.enablechatresponses)&&(_(y),A(!1),R(!0),q([{id:0,role:"assistant",parts:[],documentIds:[]}])),c&&G([]),J("streaming"),ne.current=new AbortController;const I=[];let N=[...null!=z?z:[]],P=0,L=!1,Q="";for(;!L;)try{const e=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/stream/${v}?index=${P}`,{signal:null===(s=ne.current)||void 0===s?void 0:s.signal,headers:{"Cache-Control":"no-cache",Connection:"keep-alive"}});if(!e.body)throw new Error("No response body");const t=e.body.getReader(),n=new TextDecoder,i=f({onEvent:e=>{var t,s;if(e.event&&"ping"!==e.event&&P++,"stop"!==e.event){if("error"===e.event){const t=JSON.parse(e.data).error||"Something went wrong.";return K(t),void(L=!0)}if("delta"===e.event){const n=JSON.parse(e.data);if("text-start"===n.type)Q="",I.push({type:"text",content:"",isVisible:null===(t=n.isVisible)||void 0===t||t});else if("text-delta"===n.type)Q+=n.delta,I[I.length-1].content=Q;else if("text-end"===n.type)Q="";else if("reasoning-start"===n.type)Q="",I.push({type:"reasoning",content:"",isVisible:null===(s=n.isVisible)||void 0===s||s});else if("reasoning-delta"===n.type)Q+=n.delta,I[I.length-1].content=Q;else if("reasoning-end"===n.type)Q="";else if(n.type.startsWith("data-")){const e=n;I.push({type:e.type,content:JSON.stringify(e.data),isVisible:!0})}const i=Object.assign(Object.assign({},j),{question:Object.assign(Object.assign({},j.question),{responseParts:[...I]})});D(i),(null==C?void 0:C.enablechatresponses)&&q([{id:0,role:"assistant",parts:[...I],documentIds:[]}])}else if("artifact_created"===e.event){const t=JSON.parse(e.data);N=N.filter((e=>!(e.id===t.id&&e.version===t.version))),N.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),Z([...N]),H.startsWith("inline")||ee({id:t.id,version:t.version})}else if("artifact_updated"===e.event){const t=JSON.parse(e.data);N=N.filter((e=>!(e.id===t.id&&e.version===t.version))),N.push(Object.assign(Object.assign({},t),{content:"",status:"updating"})),Z([...N]),H.startsWith("inline")||ee({id:t.id,version:t.version})}else if("artifact_rewrite"===e.event){const t=JSON.parse(e.data);N=N.filter((e=>!(e.id===t.id&&e.version===t.version))),N.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),Z([...N]),H.startsWith("inline")||ee({id:t.id,version:t.version})}else if("artifact_content"===e.event){const t=JSON.parse(e.data),s=t.token.replace(/\u200B/g,"");N=N.map((e=>e.id===t.id&&e.version===t.version?Object.assign(Object.assign({},e),{content:e.content+s,status:"streaming"}):e)),Z([...N])}else if("artifact_finished"===e.event){const t=JSON.parse(e.data);Z(N.map((e=>e.id===t.id?Object.assign(Object.assign({},e),{status:"finished"}):e)))}}else L=!0}});for(;;){const{value:e,done:s}=yield t.read();if(s)break;i.feed(n.decode(e))}L||(yield new Promise((e=>setTimeout(e,1e3))))}catch(e){if("AbortError"===e.name)return void(L=!0);console.warn("Stream connection lost, retrying...",e),yield new Promise((e=>setTimeout(e,1e3)))}null==E||E(y)}catch(e){let t=v(e)||"";t&&!t.includes("Unexpected token 'A',")||(t="Oops! We're experiencing high traffic at the moment. Please try again later.");const s=Object.entries(L).find((([e])=>t.includes(e)));s?B(s[1]):K(t),Y()}finally{J("idle"),se(!1),Q()}}))},{children:te?(null==N?void 0:N.processing)||"Processing...":V?(null==N?void 0:N.uploading)||"Uploading...":U?(null==N?void 0:N.loading)||"Loading...":null!==(j=null==C?void 0:C.submittext)&&void 0!==j?j:"Submit"})),ie&&s(h,Object.assign({variant:"transparent-text",className:"min-h-[42px] px-5",isDisabled:V||U||te,onClick:y},{children:(null==N?void 0:N["clear-form"])||"Clear form"}))]})),!I.isWhiteLabel&&s(g,{containerClassName:"justify-end"})]}))};export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{createContext as i,useState as t,useEffect as s}from"react";import{ArtifactProvider as n}from"./Addons/Artifact/Provider.js";import r from"./DimensionProvider.js";import a from"./ResponseProvider.js";import l from"./Addons/Document/Provider.js";import d from"./Addons/Auth/Provider.js";const c=i({}),m=({children:i,origin:m,sender:p,senderType:y,
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{createContext as i,useState as t,useEffect as s}from"react";import{ArtifactProvider as n}from"./Addons/Artifact/Provider.js";import r from"./DimensionProvider.js";import a from"./ResponseProvider.js";import l from"./Addons/Document/Provider.js";import d from"./Addons/Auth/Provider.js";const c=i({}),m=({children:i,origin:m,sender:p,senderType:y,deploymentId:h,deploymentType:f,deploymentDimensions:u,deploymentMisc:b,styles:g,colors:v,limits:F={},misc:w={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:x,artifact:S={popupType:"auto"},responsiveBy:I="viewport",locale:k="en",opacity:P=1,forceMobile:j=!1,disableHtml:C=!1,disableJs:T=!1,disableCss:D=!1,loadFont:H=!0,isRtl:L=!1,isEmbed:O=!1,isDropShadow:R=!1,isEmailLogin:E=!1,allowGuestUsage:A=!0,onGenerateComplete:M})=>{const[B,G]=t(""),[N,U]=t(""),[W,J]=t(""),[_,z]=t(""),[Y,q]=t(p),[K,Q]=t(y),[V,X]=t(null),[Z,$]=t(!1),[ee,oe]=t(!0),[ie,te]=t(!0),[se,ne]=t(!1);return s((()=>{$(!1)}),[null==g?void 0:g.font]),s((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&H&&!Z&&(null==g?void 0:g.font)&&"Real Head Pro"!==g.font)try{(yield import("webfontloader")).default.load({google:{families:[g.font]},active:()=>{$(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),$(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),$(!0)}}))}),[H,Z,null==g?void 0:g.font]),s((()=>{q(p)}),[p]),o(c.Provider,Object.assign({value:Object.assign({origin:m,contextId:B,pickaxeId:N,sessionId:W,lastSessionId:_,sender:Y,senderType:K,deploymentId:h,deploymentType:f,deploymentDimensions:u,deploymentMisc:b,pickaxe:V,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},g),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},v),misc:w,translations:Object.assign({"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.",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...","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","log-out":"Log Out","clear-form":"Clear form"},x),artifact:S,responsiveBy:I,locale:k,opacity:P,forceMobile:j,loadFont:H,disableHtml:C,disableJs:T,disableCss:D,isFontLoaded:Z,isNewChat:ee,isShowIceBreaker:ie,isShowFeedbackMessage:se,isRtl:L,isEmbed:O,isDropShadow:R,isEmailLogin:E,allowGuestUsage:A,setContextId:G,setPickaxeId:U,setSessionId:J,setLastSessionId:z,setSender:q,setSenderType:Q,setPickaxe:X,setIsFontLoaded:$,setIsNewChat:oe,setIsShowIceBreaker:te,setIsShowFeedbackMessage:ne},M&&{onGenerateComplete:M})},{children:o(d,{children:o(r,{children:o(a,Object.assign({limits:F},{children:o(l,{children:o(n,Object.assign({},S,{children:i}))})}))})})}))};export{c as PickaxeContext,m as PickaxeProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{AnimatePresence as s}from"framer-motion";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as i}from"../../../hooks/studio/useStyleFontSize.js";import{isInIframe as m}from"../../../common/utils.js";import a from"../../Icons/circle-exclamation.svg.js";import c from"../../Core/SpringTransition.js";import n from"../../Core/HtmlRenderer.js";import l from"./PickaxeButton.js";import p from"../../../common/cn.js";const f=({className:f,iconClassName:h,htmlClassName:x})=>{const{colors:j}=t(),{limitData:d}=r(),g=i(),u=window.location.href.includes("_embed");return e(s,{children:!!d&&o(c,Object.assign({className:p("flex gap-3",f)},{children:[e(a,{className:p("h-5 w-5 shrink-0",h),style:{color:j.accent}}),o("div",Object.assign({className:"flex flex-col gap-4"},{children:[e(n,{className:p(g.b2,"font-semibold",x),style:{color:j.text},html:d.html}),!!d.cta&&e("a",Object.assign({href:d.ctaLink,target:m()&&!u?"_self":"_top",rel:"noreferrer"},{children:e(l,Object.assign({variant:"primary",className:"min-h-[38px]",style:{minHeight:"38px"}},{children:d.cta}))}))]}))]}))})};export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as t,Fragment as e,jsxs as o}from"react/jsx-runtime";import{usePickaxe as s}from"../../hooks/pickaxe/usePickaxe.js";import{useState as r,useEffect as a,useMemo as i}from"react";import{usePickaxeContext as n}from"../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as l}from"./Addons/Auth/hooks/useAuthContext.js";import{useResponseContext as m}from"../../hooks/pickaxe/useResponseContext.js";import{useDocumentContext as c}from"./Addons/Document/hooks/useDocumentContext.js";import{useArtifactContext as p}from"./Addons/Artifact/hooks/useArtifactContext.js";import{v4 as x}from"uuid";import{ScrollProvider as d}from"./Addons/Scroll/Provider.js";import f from"./common/PickaxeSkeleton.js";import u from"./Chat/index.js";import h from"./Form/index.js";import k from"./Addons/Auth/index.js";import j from"../../common/cn.js";const w=({pickaxeId:w,className:g})=>{const{sessionId:y,styles:A,colors:C,responsiveBy:N,deploymentType:b,isNewChat:v,isEmailLogin:P,opacity:S,setContextId:I,setPickaxeId:O,setSessionId:D,setPickaxe:L}=n(),{isLoggedOut:E,isSent:R}=l(),{setMessages:F,setResponse:M,setError:T,setLimitData:$,setIsSwitchedToChat:B}=m(),{setDocumentError:H}=c(),{setCurrentArtifact:W}=p(),[q,z]=r(!1),G=s(),J="chat-input"===b&&v&&!R,K="chat-input"!==b||!R;a((()=>{O(w)}),[w]),a((()=>{if(!G.data)return;const t=G.data.chatflag;D(t?x():""),I(x()),t?F([]):M(null),T(""),H(""),$(null),W(null),B(!1),L(G.data),z(!0)}),[G.data]),a((()=>{T(""),H(""),$(null),F([]),M(null),W(null)}),[y]);const Q=i((()=>{const t=null!=S?S:1;if(!C.primary||!C.primary.startsWith("#")||t<0||t>1)return C.primary;const e=Math.round(255*t).toString(16).padStart(2,"0");return`${C.primary}${e}`}),[C.primary,S]);return G.data?t("div",Object.assign({className:j("relative @container/pickaxe-root flex flex-col flex-grow w-full h-full","dark"===A.theme&&"dark",g),style:Object.assign({backgroundColor:J?"transparent":Q,color:C.text},A.font&&"Real Head Pro"!==A.font&&{fontFamily:A.font})},{children:P&&E&&K?t(k,{}):t(e,{children:G.isLoading||!q?t("div",Object.assign({className:j("flex items-center flex-col w-full pt-12 px-4 pb-10","viewport"===N?"min-[767px]:pb-40":"@[767px]/pickaxe-root:pb-40")},{children:o("div",Object.assign({className:"flex w-full items-center max-w-[700px] flex-col"},{children:[t(f,{className:"w-[72px] h-[72px]"}),t(f,{className:"h-[20px] mt-6 w-full"}),t(f,{className:"h-[20px] mt-2 w-full"}),t(f,{className:"h-[20px] mt-2 w-full max-w-[400px]"}),t("div",Object.assign({className:"flex flex-col gap-y-8 w-full mt-6"},{children:t(f,{className:j("w-full min-h-[48px]","viewport"===N?"min-[767px]:max-w-[176px]":"@[767px]/pickaxe-root:max-w-[176px]")})}))]}))})):t(e,{children:t(d,y?{children:t(u,{})}:{children:t(h,{})})})})})):null};export{w as Pickaxe};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { Ref } from "react";
|
|
2
|
-
export declare const COOKIE_USER_ID = "PXE-uid";
|
|
3
2
|
export declare const generateId: (length: number, prefix?: string, suffix?: string) => string;
|
|
4
3
|
export declare const randomStr: (len: number, charOnly?: boolean) => string;
|
|
5
4
|
export declare const extractUrlsFromText: (text: string) => string[];
|
|
6
5
|
export declare const formatBytes: (bytes: number, decimals?: number) => string;
|
|
7
6
|
export declare const getCookie: (name: string) => string | null;
|
|
8
7
|
export declare const deleteCookie: (name: string) => void;
|
|
9
|
-
export declare const initializeEmbedUserId: () => string;
|
|
10
8
|
export declare const getAuthToken: (studioId: string) => string | null;
|
|
11
9
|
export declare const setAuthToken: (name: string, token: string) => void;
|
|
12
10
|
export declare const deleteAuthToken: (name: string) => void;
|
|
@@ -10,7 +10,6 @@ export type PickaxeTranslations = {
|
|
|
10
10
|
};
|
|
11
11
|
export type PickaxeProviderStyles = {
|
|
12
12
|
theme: "light" | "dark";
|
|
13
|
-
portalTheme?: "light" | "dark";
|
|
14
13
|
font: string;
|
|
15
14
|
fontSize: StudioFontSize;
|
|
16
15
|
formFieldStyle: StudioFormFieldStyle;
|
|
@@ -36,7 +35,7 @@ export type PickaxeMisc = {
|
|
|
36
35
|
isDescription: boolean;
|
|
37
36
|
isHistory?: boolean;
|
|
38
37
|
};
|
|
39
|
-
export type PickaxeDeploymentEmbedType = "inline" | "fab" | "popup" | "chat-input"
|
|
38
|
+
export type PickaxeDeploymentEmbedType = "inline" | "fab" | "popup" | "chat-input";
|
|
40
39
|
export type PickaxeDeploymentDimensions = {
|
|
41
40
|
width: {
|
|
42
41
|
value: number;
|
|
@@ -66,7 +65,6 @@ type PickaxeContextType = {
|
|
|
66
65
|
deploymentType?: PickaxeDeploymentEmbedType;
|
|
67
66
|
deploymentDimensions?: PickaxeDeploymentDimensions;
|
|
68
67
|
deploymentMisc?: PickaxeDeploymentMisc;
|
|
69
|
-
portalId?: string;
|
|
70
68
|
pickaxe: LimitedPickaxe | null;
|
|
71
69
|
styles: PickaxeProviderStyles;
|
|
72
70
|
colors: PickaxeProviderColors;
|
|
@@ -109,7 +107,6 @@ export interface IPickaxeProviderProps {
|
|
|
109
107
|
sender?: string;
|
|
110
108
|
senderType: PickaxeHistorySenderType;
|
|
111
109
|
deploymentId?: string;
|
|
112
|
-
portalId?: string;
|
|
113
110
|
deploymentType?: PickaxeDeploymentEmbedType;
|
|
114
111
|
deploymentDimensions?: PickaxeDeploymentDimensions;
|
|
115
112
|
deploymentMisc?: PickaxeDeploymentMisc;
|
|
@@ -135,5 +132,5 @@ export interface IPickaxeProviderProps {
|
|
|
135
132
|
onGenerateComplete?: (responseId: string) => void;
|
|
136
133
|
}
|
|
137
134
|
export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
|
|
138
|
-
export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType,
|
|
135
|
+
export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType, deploymentId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, isDropShadow, isEmailLogin, allowGuestUsage, onGenerateComplete, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
139
136
|
export {};
|
|
@@ -3,12 +3,9 @@ import type { MemoryStoredChatMessage, MemoryStoredFormResponse } from "../../ty
|
|
|
3
3
|
import { type ReactNode } from "react";
|
|
4
4
|
export type ResponseStatus = "fetching" | "streaming" | "idle";
|
|
5
5
|
export type PickaxeLimitData = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
limitLink?: string;
|
|
10
|
-
limitCTA: string;
|
|
11
|
-
accessGroupId: string;
|
|
6
|
+
html: string;
|
|
7
|
+
cta: string;
|
|
8
|
+
ctaLink: string;
|
|
12
9
|
};
|
|
13
10
|
type ResponseContextType = {
|
|
14
11
|
messages: MemoryStoredChatMessage[];
|
|
@@ -3,5 +3,5 @@ interface PickaxeUpgradeCardProps {
|
|
|
3
3
|
iconClassName?: string;
|
|
4
4
|
htmlClassName?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const PickaxeUpgradeCard: ({ className, iconClassName, htmlClassName, }: PickaxeUpgradeCardProps) => import("react/jsx-runtime").JSX.Element
|
|
6
|
+
declare const PickaxeUpgradeCard: ({ className, iconClassName, htmlClassName, }: PickaxeUpgradeCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default PickaxeUpgradeCard;
|
|
@@ -10,7 +10,6 @@ export declare const usePickaxeContext: () => {
|
|
|
10
10
|
deploymentType?: import("../../components/Pickaxe/Provider").PickaxeDeploymentEmbedType | undefined;
|
|
11
11
|
deploymentDimensions?: import("../../components/Pickaxe/Provider").PickaxeDeploymentDimensions | undefined;
|
|
12
12
|
deploymentMisc?: import("../../components/Pickaxe/Provider").PickaxeDeploymentMisc | undefined;
|
|
13
|
-
portalId?: string | undefined;
|
|
14
13
|
pickaxe: import("../../types/pickaxe").LimitedPickaxe | null;
|
|
15
14
|
styles: import("../../components/Pickaxe/Provider").PickaxeProviderStyles;
|
|
16
15
|
colors: import("../../components/Pickaxe/Provider").PickaxeProviderColors;
|
|
@@ -9,11 +9,3 @@ export type MemoryStoredFormResponse = {
|
|
|
9
9
|
messageCount: number;
|
|
10
10
|
sentAt: Date;
|
|
11
11
|
};
|
|
12
|
-
export interface LimitData {
|
|
13
|
-
limitMessage: string;
|
|
14
|
-
buyUses?: any[];
|
|
15
|
-
upgradeGroups?: any[];
|
|
16
|
-
limitLink?: string;
|
|
17
|
-
accessGroupId?: string;
|
|
18
|
-
limitCTA?: string;
|
|
19
|
-
}
|