PageSourceSearch

https://voisley.com/js/FlipCard-D5LkIYe5.js

js voisley.com collected 2026-10-09 22:05:54 UTC 4,734 bytes, 1 lines download raw bytes

1import{o as y}from"./rolldown-runtime-CfSZB2vO.js";import{m as _,p as h}from"./animation-vendor-BHEWoM6B.js";import{O as j,S as c}from"./react-vendor-B37_Z89T.js";import{r as b}from"./client-CS5Ru5b-.js";import{t as m}from"./i18n-2TW9_b1p.js";import{n as g}from"./AuthContext-CpYbxwSg.js";import{n as N}from"./query-vendor-C2iJDoEE.js";import{r as v}from"./LanguageContext-BiyPULt-.js";import{c as w}from"./useHeaderBackButtonStore-B0cmi5h_.js";import{i as q}from"./dist-BKOp-qNp.js";import{t as p}from"./card-Cxszs37N.js";import{r as S,t as F}from"./xssProtection-Dsj-aPGq.js";import{t as C}from"./SEOHead-Bc0BtiXj.js";import{t as l}from"./StandardHeader-8KTTYJor.js";var T=y(_(),1),H=t=>null,L=H,e=h(),K=()=>{const{t}=v(),{responseId:s}=j(),{user:a}=g(),{bannerVisible:n,isHomePage:o}=w(),{data:r,isLoading:u,error:f}=N({queryKey:["flipcard",s],queryFn:async()=>{if(!s||!a?.id)throw new Error("Response ID and user authentication required");for(const i of[{name:"self_reflection_responses",type:"reflection"},{name:"habit_responses",type:"habit"},{name:"shadow_work_responses",type:"shadow"}])try{const{data:d,error:x}=await b.from(i.name).select("*").eq("id",s).eq("user_id",a.id).maybeSingle();if(d&&!x)return{...d,table_name:i.name,entry_type:i.type}}catch{continue}throw new Error("Flipcard not found or access denied")},enabled:!!s&&!!a?.id,retry:!1});return a?s?u?(0,e.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,e.jsx)(C,{title:m.t("localizedUi.pages_flipcard.flip_card_b1c4bc0b",{defaultValue:"Flip Card"}),description:m.t("localizedUi.pages_flipcard.view_and_reflect_on_your_flip_card_response_5b4d91ba",{defaultValue:"View and reflect on your flip card response."}),noIndex:!0}),(0,e.jsx)(l,{}),(0,e.jsx)("div",{className:`flex-1 flex items-center justify-center transition-all duration-300 ${o&&n?"mt-24":"mt-12"}`,children:(0,e.jsx)(q,{className:"h-8 w-8 animate-spin"})})]}):f||!r?(0,e.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,e.jsx)(l,{}),(0,e.jsx)("div",{className:`flex-1 flex items-center justify-center transition-all duration-300 ${o&&n?"mt-24":"mt-12"}`,children:(0,e.jsxs)(p,{className:"p-8 text-center max-w-md",children:[(0,e.jsx)("h2",{className:"text-xl font-semibold mb-2",children:t("flipcard.notFound")}),(0,e.jsx)("p",{className:"text-muted-foreground",children:t("flipcard.notFoundDescription")})]})})]}):(0,e.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,e.jsx)(l,{}),(0,e.jsx)("div",{className:`container mx-auto px-4 py-6 transition-all duration-300 ${o&&n?"mt-24":"mt-12"}`,children:(0,e.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,e.jsxs)("div",{className:"mb-6 flex justify-between items-center",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-2xl font-bold mb-2",children:t("flipcard.myFlipcard")}),(0,e.jsxs)("p",{className:"text-muted-foreground",children:[r.entry_type&&r.entry_type.charAt(0).toUpperCase()+r.entry_type.slice(1)," ",t("flipcard.response")]})]}),(0,e.jsx)(L,{contentType:"flipcard",contentId:r.id,contentData:{original_response:{question:r.question,response:r.response,response_type:r.audio_url?"voice":"text",audio_url:r.audio_url,is_public:!1,category:r.category},source_response_id:r.id},size:"md",variant:r.entry_type==="habit"?"orange":r.entry_type==="gratitude"?"green":r.entry_type==="love"?"pink":r.entry_type==="shadow"?"gray":r.entry_type==="mood"?"yellow":r.entry_type==="sleep"?"indigo":r.entry_type==="travel"?"cyan":r.entry_type==="self"?"blue":"purple"})]}),(0,e.jsxs)(p,{className:"p-6 shadow-lg",children:[r.question&&(0,e.jsxs)("div",{className:"mb-4 p-4 bg-muted/50 rounded-lg",children:[(0,e.jsx)("h3",{className:"font-medium text-sm text-muted-foreground mb-2",children:t("flipcard.question")}),(0,e.jsx)("p",{className:"text-foreground",children:r.question})]}),(0,e.jsxs)("div",{className:"mb-4",children:[(0,e.jsx)("h3",{className:"font-medium text-sm text-muted-foreground mb-2",children:t("flipcard.responseLabel")}),(0,e.jsx)("div",{className:"prose max-w-none",dangerouslySetInnerHTML:F(S(r.response))})]}),r.audio_url&&(0,e.jsxs)("div",{className:"mt-4 pt-4 border-t border-border/20",children:[(0,e.jsx)("h3",{className:"font-medium text-sm text-muted-foreground mb-2",children:t("flipcard.audioResponse")}),(0,e.jsxs)("audio",{controls:!0,className:"w-full",children:[(0,e.jsx)("source",{src:r.audio_url,type:"audio/mpeg"}),t("flipcard.audioNotSupported")]})]}),(0,e.jsxs)("div",{className:"mt-4 pt-4 border-t border-border/20 text-xs text-muted-foreground",children:[t("flipcard.createdOn")," ",new Date(r.created_at).toLocaleDateString()]})]})]})})]}):(0,e.jsx)(c,{to:"/",replace:!0}):(0,e.jsx)(c,{to:"/auth",replace:!0})};export{K 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.