1import{_ as me,u as pe,a as ye,r as x,N as Ve,X as ze,o as ve,c8 as Se,a6 as fe,a7 as Te,g as t,i as l,j as c,w as n,e as g,F as M,E as ge,G as de,p,ac as ee,v as w,f as r,t as k,A as K,x as $,q as T,s as h,C as he,h as V,ad as we,ae as Ee,O as te,K as ae,d as Le,Q as Me,z as Ae,T as se,V as Be,ag as Ne,k as ue,cv as Re,y as G,B as He,n as Ue,an as Pe,H as Qe,am as Ge,cw as Je,cx as Oe,cy as Fe,cz as Ze,ak as je}from"./Bd7sooHk.js";import{J as qe}from"./jO0xkfkq.js";import{T as Ke}from"./BpzJ_Ra5.js";import{M as We}from"./XmIJRr0j.js";import{V as Xe}from"./DvQduk6a.js";import{_ as Ye}from"./CmEvoZGa.js";const et=["innerHTML"],tt={class:"text-center"},at={class:"on-secondary-container"},ce=5,st={__name:"OdysseyContentsView",props:{syncDriveId:{type:String,required:!0,default:""},entryIds:{type:Array,required:!0,default:[]}},setup(le){const{$auth:J,$axios:O,$router:q,$store:H}=pe(),{t:y,locale:W}=ye(),A=x(Ve()),F=le,{entryIds:_,syncDriveId:v}=ze(F),u=x({}),B=x(!1),i=V(()=>B.value?_.value:_.value.slice(0,ce));ve(async()=>{await J.refreshIdTokenIfExpired();const d=["activity","address","favourite","location","previewText","sentiment","timezone","files.ext","files.variants.small","type","weather"];for(const I of _.value){const a=await Se(O,v.value,I,d);if(a?.id){let z;a.type!=="html"?z=fe(a.previewText):z=a.previewText;const b=a.location?Te(a.location.lat,a.location.lng,null):"",X={externalFileId:a.id,version:a.version,id:a.id,favourite:a.favourite,content:z,img:a.files?.map(S=>({name:`${S.id}${S.variants?.small?.ext??S.ext}`,thumbnailLink:S.variants?.small?.path??"",encrypted:!!S.variants?.small?.encrypted,encryption:S.variants?.small?.encryption}))??[],sentiment:a.sentiment,activity:a.activity,address:a.address||b,weatherIcon:a.weather?.icon||"",temperature:a.weather?.degreeC||null,dateOfJournal:a.dateOfJournal,timezone:a.timezone,latLng:a.location?{lat:a.location.lat,lng:a.location.lng}:null};a.id,u.value,u.value[a.id]=X}}});const Z=d=>{q.push(`/app/timeline/sync-${v.value}/${d.externalFileId}?version=${d.version||-1}`)},U=d=>Ee(d).replace(/<script[^>]*>(?:(?!<\/script>)[^])*<\/script>/g,"").replace(/<a([^>]* )href=\"([^\"]+)\"/g,(I,a,z)=>'<a href="javascript:void(0)"'),E=d=>d.img.length,P=d=>E(d)?{"margin-right":A.value?.smAndDown?"0":"72px","padding-right":"12px"}:{},N=(d,I)=>we(W.value,d,{tz:I});return(d,I)=>t(_).length&&t(u)?(l(),c(he,{key:0,class:"insetList mx-auto rounded-lg bg-surface3",density:"compact","bg-color":"transparent"},{default:n(()=>[(l(!0),g(M,null,ge(t(i),(a,z)=>(l(),g(M,null,[a in t(u)?(l(),c(de,{class:"insetListItem contentItem rounded-0 py-3",key:t(u)[a].id,onClick:b=>Z(t(u)[a]),lines:"three"},{append:n(()=>[E(t(u)[a])?(l(),c(t(Ke),{key:0,images:t(u)[a].img,encryptionInfo:null},null,8,["images"])):k("",!0)]),default:n(()=>[p("div",{class:"text-title-small text-primary font-weight-bold",style:ee(P(t(u)[a]))},w(N(t(u)[a].dateOfJournal,t(u)[a].timezone)),5),p("div",{class:"markdownLite content text-medium-emphasis mt-2",style:ee(P(t(u)[a])),innerHTML:U(t(u)[a].content)},null,12,et),r(We,{entry:t(u)[a],style:ee(P(t(u)[a])),fallbackShape:""},null,8,["entry","style"])]),_:2},1032,["onClick"])):(l(),c(Xe,{key:0,class:"rounded-0",type:"list-item-three-line",color:"surface3",height:"108"})),z!==t(u).length-1?(l(),c(K,{key:2})):k("",!0)],64))),256)),!t(B)&&t(_).length>ce?(l(),c(de,{key:0},{default:n(()=>[p("div",tt,[r($,{class:"load-more-pill text-capitalize",color:"secondaryContainer",rounded:"pill",size:"small",flat:"",onClick:I[0]||(I[0]=a=>B.value=!0)},{default:n(()=>[r(T,{class:"me-2",size:"small",color:"onSecondaryContainer"},{default:n(()=>[...I[1]||(I[1]=[h("mdi-chevron-down-circle",-1)])]),_:1}),p("span",at,w(d.$t("button.loadMore")),1)]),_:1})])]),_:1})):k("",!0)]),_:1})):k("",!0)}},lt=me(st,[["__scopeId","data-v-b67c8837"]]),nt={key:0,class:"mx-auto text-center my-4"},ot={class:"mb-4"},rt=["id"],it=["innerHTML"],dt={key:3,class:"rounded-lg bordered mt-4",width:"480",height:"270",src:"https://www.youtube-nocookie.com/embed/LZualkZif1g?playlist=LZualkZif1g&rel=0&autoplay=0&cc_load_policy=1&mute=1&loop=1",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:""},ut={key:1,class:"d-flex flex-column ga-2 w-100"},ct={class:"text-body-small text-medium-emphasis mt-2"},mt=["id"],pt={class:"ms-4"},yt=["innerHTML"],vt={class:"align-end"},ft={class:"text-body-small text-end text-medium-emphasis mt-2"},gt={key:0,class:"text-center opacity-70"},ht={key:0,class:"mx-auto"},wt={class:"text-error"},xt={class:"mx-auto"},kt={class:"text-error"},_t={class:"chatBox"},$t={class:"inner"},bt={class:"d-flex align-center"},It={__name:"index",setup(le){const{$axios:J,$bus:O,$config:q,$store:H}=pe(),{t:y,locale:W}=ye(),A=x(!1),F=x(""),_=x(""),v=x(!1),u=x(!1),B=x({}),i=x([]),Z=x({}),U=x(null),E=x(null),P=x(!1),N=x("vanilla"),d=V(()=>H?.user),I=V(()=>
1{if(d.value){if(d.value?.providerData){const o=d.value.providerData.map(e=>e.displayName).filter(e=>!!e);return d.value?.displayName||o[o.length-1]||""}return d.value?.displayName||""}return""}),a=V(()=>{if(d.value){if(d.value?.providerData){const o=d.value.providerData.map(e=>e.photoURL).filter(e=>!!e);return d.value?.photoURL||o[o.length-1]||""}return d.value?.photoURL||""}return""}),z=V(()=>H?.userClouds??[]),b=V(()=>z.value?.find(o=>o.linkedAccountId===H?.userCloudId)||z.value[0]),X=V(()=>b.value?.src),S=V(()=>H?.userInfo),xe=V(()=>H?.passcodeVerified),ne=V(()=>i.value.length>=10),oe=()=>`<p>${y("odyssey.hello")} ${y("odyssey.getStarted")}</p> 2<ul> 3<li>${y("odyssey.getStarted1")}</li> 4<li>${y("odyssey.getStarted2")}</li> 5<li>${y("odyssey.getStarted5")}</li> 6<li>${y("odyssey.getStarted4")}</li> 7</ul>`,R=o=>{je(()=>{setTimeout(()=>{document.getElementById(o)?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},100)})},re=o=>we(W.value,o,{style:{timeStyle:"short"}}),ke=o=>fe(o),j=()=>{F.value="",_.value="",v.value=!1,u.value=!1,U.value=null,E.value=null,Z.value={},B.value={},i.value=[{id:"intro",role:"client",message:oe(),loading:!1,action:{name:"learn"},timestamp:new Date}]},_e=async o=>{const e=b.value?.id;v.value=!0,u.value=!0;let L=!1;try{L=await Oe(J,e)}catch(s){const C=s?.response?.data?.status;if(C==="invalid_sync_drive_account"){const m=`c-${new Date().getTime()}`;i.value.push({id:m,role:"client",message:`<p>${y("odyssey.errorInvalidSyncDriveAccount")}</p>`,loading:!1,timestamp:new Date}),R(m)}else if(C==="sync_drive_encrypted"){const m=`c-${new Date().getTime()}`;i.value.push({id:m,role:"client",message:`<p>${y("odyssey.errorSyncDriveEncrypted")}</p>`,loading:!1,timestamp:new Date}),R(m)}}v.value=!1,u.value=!1,B.value[o]=!0,L&&await ie(F.value)},$e=async()=>{const o=b.value?.id;v.value=!0;try{await Fe(J,o,U.value,E.value)}catch{}v.value=!1,j()},ie=async(o="")=>{const e=b.value?.id,L=_.value||o;if(F.value=L,_.value="",d.value){if(X.value!=="sync"){const m=`u-${new Date().getTime()}`;i.value.push({id:m,role:"client",message:`<p>${y("odyssey.errorUnsupportedDrive")}</p>`,loading:!1,action:{name:"linkedAccount"},timestamp:new Date}),R(m);return}}else{const m=`u-${new Date().getTime()}`;i.value.push({id:m,role:"client",message:`<p>${y("odyssey.errorSignIn")}</p>`,loading:!1,action:{name:"signIn"},timestamp:new Date}),R(m);return}const s=`u-${new Date().getTime()}`;i.value.push({id:s,role:"user",message:L,loading:!1,timestamp:new Date}),R(s),v.value=!0;const C=`c-${new Date().getTime()}`;i.value.push({id:C,role:"client",message:"",loading:!0,timestamp:new Date}),R(C);try{const m=await Ze(J,N.value,e,L,U.value,E.value);if(e!==b.value?.id)return;const D=i.value.findIndex(f=>f.id===C);if(D<0){v.value=!1;return}if(m?.answer){if(i.value[D].message=ke(m.answer??""),m.citedEntryIds){const f=Array.from(new Set(m.citedEntryIds.filter(Q=>!(Q in Z.value)))),Y=f.some(Q=>Q==="none");if(f.length&&!Y){const Q=`c-${new Date().getTime()}`;i.value.push({id:Q,role:"client",message:`<p>${y("odyssey.mentionedEntries")}</p>`,loading:!1,entryIds:f,timestamp:new Date}),f.forEach(De=>Z.value[De]=!0),R(Q)}}}else i.value[D].message=`<p>${y("odyssey.errorGeneric")}</p>`;U.value=m.encryptedPastQueries,E.value=m.pastQueriesHash,i.value[D].loading=!1,i.value[D].timestamp=new Date}catch(m){if(e!==b.value?.id)return;const D=m?.response?.data?.status,f=i.value.findIndex(Y=>Y.id===C);if(f<0){v.value=!1;return}D==="agreement_not_done"?(i.value[f].message=`<p>${y("odyssey.errorTnC")}</p>`,i.value[f].action={name:"agreement"}):D==="sync_drive_not_found"?i.value[f].message=`<p>${y("odyssey.errorInvalidSyncDriveAccount")}</p>`:D==="gpt_count_limit_exceeded"?(i.value[f].message=`<p>${y("odyssey.errorLimit")}</p>`,i.value[f].action={name:"upgrade"}):D==="sync_drive_encrypted"?(errorSyncDriveEncrypted,i.value[f].message=`<p>${y("odyssey.errorSyncDriveEncrypted")}</p>`):i.value[f].message=`<p>${y("odyssey.errorGeneric")}</p>`,i.value[f].loading=!1,i.value[f].timestamp=new Date}v.value=!1},be=()=>{O.$emit(ae.BUY_REMINDER)},Ie=()=>{O.$emit(ae.SIGN_IN)};te(d,o=>{o&&j()}),te(b,o=>
7{j(),A.value=!1}),te(N,()=>{j()}),ve(()=>{d.value&&S.value&&S.value.passcode&&!xe.value&&O.$emit(ae.PASSCODE),(b.value||d.value)&&(i.value=[{id:"intro",role:"client",message:oe(),action:{name:"learn"},loading:!1,timestamp:new Date}])});const Ce=()=>Je(q.public.pwdKey)===q.public.pwd;return Le({title:y("odyssey.title")}),(o,e)=>{const L=Me;return l(),c(L,null,{default:n(()=>[Ce()?(l(),g("div",nt,[r(Ae,{class:"rounded-xl bg-surface2 buttonScroller",modelValue:t(N),"onUpdate:modelValue":e[0]||(e[0]=s=>se(N)?N.value=s:null),variant:"text",color:"tertiary"},{default:n(()=>[r($,{class:"rounded-xl px-4",size:"small",value:"vanilla"},{default:n(()=>[...e[10]||(e[10]=[p("div",{class:"text-capitalize font-weight-bold text-tertiary"},"vanilla",-1)])]),_:1}),r($,{class:"rounded-xl px-4",size:"small",value:"vanilla:gpt-4o"},{default:n(()=>[...e[11]||(e[11]=[p("div",{class:"text-capitalize font-weight-bold text-tertiary"},"Vanilla 4o",-1)])]),_:1}),r($,{class:"rounded-xl px-4",size:"small",value:"vanilla:gpt-4-turbo"},{default:n(()=>[...e[12]||(e[12]=[p("div",{class:"text-capitalize font-weight-bold text-tertiary"},"Vanilla 4-turbo",-1)])]),_:1})]),_:1},8,["modelValue"])])):k("",!0),r(Be,{style:{"max-width":"640px"}},{default:n(()=>[r(he,{class:"list pt-0",density:"compact","bg-color":"transparent"},{default:n(()=>[(l(!0),g(M,null,ge(t(i),s=>(l(),g("div",ot,[s.role==="client"?(l(),g("div",{key:0,class:"d-flex flex-row",id:s.id},[r(Ye,{id:s.id,loading:s.loading},null,8,["id","loading"]),p("div",{class:Ne(["ms-4",s.entryIds?.length?"flex-grow-1":""])},[r(ue,{color:"surface4",elevation:"0",rounded:"lg",width:"100%"},Re({text:n(()=>[s.loading?(l(),c(G,{key:0,indeterminate:"",color:"onSurface",size:"16"})):(l(),g("div",{key:1,class:"html",innerHTML:s.message,dir:"auto"},null,8,it)),s.action?.name==="agreement"?(l(),c($,{key:2,class:"mt-2",variant:"tonal",size:"small",href:"/gptTerms",target:"_blank"},{default:n(()=>[r(T,{class:"me-2"},{default:n(()=>[...e[13]||(e[13]=[h("mdi-book-open-blank-variant",-1)])]),_:1}),h(w(o.$t("odyssey.terms")),1)]),_:1})):s.action?.name==="linkedAccount"?(l(),g("iframe",dt)):s.entryIds?.length?(l(),c(lt,{key:4,class:"mt-2",syncDriveId:t(b)?.id??"",entryIds:s.entryIds??[]},null,8,["syncDriveId","entryIds"])):k("",!0)]),default:n(()=>[s.action&&s.action.name!=="learn"?(l(),c(K,{key:0})):k("",!0)]),_:2},[s.action?{name:"actions",fn:n(()=>[s.action.name==="agreement"?(l(),g(M,{key:0},[t(u)?(l(),c(G,{key:0,class:"mx-auto",color:"primary",indeterminate:"",size:"16"})):(l(),c($,{key:1,width:"100%",size:"small",disabled:t(v)||t(B)[s.id],onClick:C=>_e(s.id)},{default:n(()=>[r(T,{class:"me-2"},{default:n(()=>[...e[14]||(e[14]=[h("mdi-check",-1)])]),_:1}),h(w(o.$t("button.readAndUnderstood")),1)]),_:1},8,["disabled","onClick"]))],64)):k("",!0),s.action.name==="upgrade"?(l(),g(M,{key:1},[t(u)?(l(),c(G,{key:0,class:"mx-auto",color:"primary",indeterminate:"",size:"16"})):(l(),c($,{key:1,width:"100%",size:"small",onClick:e[1]||(e[1]=C=>be())},{default:n(()=>[h(w(o.$t("button.learnMore")),1)]),_:1}))],64)):k("",!0),s.action.name==="linkedAccount"?(l(),g(M,{key:2},[t(u)?(l(),c(G,{key:0,class:"mx-auto",color:"primary",indeterminate:"",size:"16"})):(l(),c($,{key:1,width:"100%",size:"small",onClick:e[2]||(e[2]=C=>A.value=!0)},{default:n(()=>[h(w(o.$t("button.learnMore")),1)]),_:1}))],64)):k("",!0),s.action.name==="signIn"?(l(),g(M,{key:3},[t(u)?(l(),c(G,{key:0,class:"mx-auto",color:"primary",indeterminate:"",size:"16"})):(l(),c($,{key:1,width:"100%",size:"small",onClick:Ie},{default:n(()=>[h(w(o.$t("profile.signIn")),1)]),_:1}))],64)):k("",!0),s.action.name==="learn"?(l(),g(M,{key:4},[t(u)?(l(),c(G,{key:0,class:"mx-auto",color:"primary",indeterminate:"",size:"16"})):(l(),g("div",ut,[r(K),r($,{width:"100%",size:"small",href:"https://wa.me/6589716522?text=Hi%2C%20I%20would%20like%20to%20use%20Journey%20on%20WhatsApp.",target:"_blank",rel:"noopener noreferrer"},{default:n(()=>[r(T,{class:"me-2"},{default:n(()=>[...e[15]||(e[15]=[h("mdi-whatsapp",-1)])]),_:1}),h(w(o.$t("homepage.odysseyWhatsappButton")),1)]),_:1}),r(K),r($,{width:"100%",size:"small",href:"https://blog.journey.cloud/introducing-journey-odyssey-ai-deepening-your-self-understanding-through-ai-journal-based-responses/",target:"_blank",rel:"noopener noreferrer"},{default:n(()=>[h(w(o.$t("button.learnMore")),1)]),_:1})]))],64)):k("",!0)]),key:"0"}:void 0]),1024),p("div",ct,w(o.$t("odyssey.title"))+" · "+w(re(s.timestamp)),1)],2)],8,rt)):s.role==="user"?(l(),g("div",{key:1,class:"d-flex flex-row-reverse",id:s.id},[p("div",pt,[r(He,{color:"secondaryContainer",rounded:"lg",size:"64"},{default:n(()=>[t(a)&&!t(P)?(l(),c(Ue,{key:0,src:t(a),onError:e[3]||(e[3]=C=>P.value=!0)},null,8,["src"])):(l(),c(T,{key:1,color:"onSecondaryContainer"},{default:n(()=>[...e[16]||(e[16]=[h("mdi-account",-1)])]),_:1}))]),_:1})]),p("div",null,[r(ue,{color:"surface4",elevation:"0",rounded:"lg",width:"100%"},{text:n(()=>[p("div",{class:"html",innerHTML:s.message,dir:"auto"},null,8,yt)]),_:2},1024),p("div",vt,[p("div",ft,w(t(I)||o.$t("profile.user"))+" · "+w(re(s.timestamp)),1)])])],8,mt)):k("",!0)]))),256)),t(i).length>1?(l(),g("div",gt,[t(E)?(l(),g("div",ht,[r($,{class:"text-medium-emphasis",variant:"text",size:"x-small",onClick:e[4]||(e[4]=s=>$e()),disabled:t(v)||t(u)},{default:n(()=>[r(T,{class:"me-2",color:"error"},{default:n(()=>[...e[17]||(e[17]=[h("mdi-alert-octagon-outline",-1)])]),_:1}),p("div",wt,w(o.$t("odyssey.reportInappropriateReply")),1)]),_:1},8,["disabled"])])):k("",!0),p("div",xt,[r($,{class:"text-medium-emphasis",variant:"text",size:"x-small",onClick:e[5]||(e[5]=s=>j()),disabled:t(v)||t(u)},{default:n(()=>[r(T,{class:"me-2",color:"error"},{default:n(()=>[...e[18]||(e[18]=[h("mdi-trash-can-outline",-1)])]),_:1}),p("div",kt,w(o.$t("odyssey.resetSession")),1)]),_:1},8,["disabled"])])])):k("",!0)]),_:1}),p("div",_t,[p("div",$t,[r(Pe,{onSubmit:e[8]||(e[8]=Qe(s=>ie(),["prevent"]))},{default:n(()=>[p("div",bt,[r(Ge,{class:"ma-1",modelValue:t(_),"onUpdate:modelValue":e[7]||
7(e[7]=s=>se(_)?_.value=s:null),placeholder:o.$t("odyssey.ask"),density:"compact",rounded:"lg",disabled:t(v)||t(ne),"single-line":"","hide-details":"",autofocus:"",clearable:"",flat:"","bg-color":"surface5",variant:"solo"},{clear:n(()=>[r(T,{class:"mt-1",size:"x-small",onClick:e[6]||(e[6]=s=>_.value="")},{default:n(()=>[...e[19]||(e[19]=[h("mdi-close-circle",-1)])]),_:1})]),_:1},8,["modelValue","placeholder","disabled"]),r($,{class:"rounded-lg ms-3",disabled:!t(_)?.length||t(v)||t(ne),flat:"",icon:"",color:"surface3",size:"small",type:"submit"},{default:n(()=>[r(T,null,{default:n(()=>[...e[20]||(e[20]=[h("mdi-send",-1)])]),_:1})]),_:1},8,["disabled"])])]),_:1})])])]),_:1}),r(qe,{modelValue:t(A),"onUpdate:modelValue":e[9]||(e[9]=s=>se(A)?A.value=s:null),videoId:"LZualkZif1g",closable:""},null,8,["modelValue"])]),_:1})}}},Et=me(It,[["__scopeId","data-v-509e9f2d"]]);export{Et as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.