import{$u as e,Bu as t,Iv as n,Pu as r,nu as i}from"./dist-DgOpDpsw.js";import{Button_default as ee,Fragment as a,computed as o,createBaseVNode as s,createCommentVNode as c,createElementBlock as l,createTextVNode as u,createVNode as d,defineComponent as f,normalizeClass as p,openBlock as m,ref as h,renderList as g,storeToRefs as te,toDisplayString as _,unref as v,useAiriCardStore as ne,useI18n as re,withCtx as y}from"./index-mqNYF2M0.js";import{DeleteCardDialog_default as b}from"./DeleteCardDialog-PHEDlSYT.js";const ie={key:0,class:`w-full flex flex-col gap-5`},ae={flex:`~ col`,"gap-3":``},oe={flex:`~ row`,"items-center":``,"justify-between":``},se={flex:`~ row`,"items-center":``,"gap-2":``},ce={key:0,class:`flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400`},le={"mt-1":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ue={"font-medium":``},de={flex:`~ row`,"gap-2":``},fe={class:`mt-4`},pe={class:`border-b border-neutral-200 dark:border-neutral-700`},me={class:`flex justify-center -mb-px sm:justify-start space-x-1`},he=[`onClick`],ge={class:`flex items-center gap-1`},x={key:0},S=[`innerHTML`],C={key:1},w=[`innerHTML`],T={key:2},E={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},D={key:0,flex:`~ col`,"gap-2":``},O={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},k=[`innerHTML`],A={key:3},j={grid:`~ cols-1 sm:cols-3`,"gap-4":``},M={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-1":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},N={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},P={truncate:``,"font-medium":``},F={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},I={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},L={truncate:``,"font-medium":``},_e={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ve={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ye={truncate:``,"font-medium":``},be={key:1,bg:`neutral-50/50 dark:neutral-900/50`,"rounded-xl":``,"p-8":``,"text-center":``,border:`~ neutral-200/50 dark:neutral-700/30`,shadow:`sm`};var R=f({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:{}},emits:[`update:modelValue`],setup(f,{emit:R}){let z=f,B=R,{t:V}=re(),H=ne(),{removeCard:xe}=H,{activeCardId:U}=te(H),W=o(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=o(()=>{var e,t,n,r;if(!W.value||!(!((e=W.value.extensions)==null||(e=e.airi)==null)&&e.modules))return{consciousness:``,speech:``,voice:``};let i=W.value.extensions.airi.modules;return{consciousness:(t=i.consciousness)?.model||``,speech:(n=i.speech)?.model||``,voice:(r=i.speech)?.voice_id||``}}),K=o(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=o(()=>z.cardId===U.value),J=h(!1);function Se(){J.value=!0,setTimeout(()=>{U.value=z.cardId,J.value=!1},300)}function Y(e){return e?.replace(/\{\{(.*?)\}\}/g,`<span class="bg-primary-500/20 inline-block">{{ $1 }}</span>`).trim()}let X=h(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=h(``),Q=o(()=>{var e,t;let n=[];return(e=W.value)?.description&&n.push({id:`description`,label:V(`settings.pages.card.description_label`),icon:`i-solar:document-text-linear`}),(t=W.value)?.notes&&n.push({id:`notes`,label:V(`settings.pages.card.creator_notes`),icon:`i-solar:notes-linear`}),Object.values(K.value).some(e=>!!e)&&n.push({id:`character`,label:V(`settings.pages.card.character`),icon:`i-solar:user-rounded-linear`}),n.push({id:`modules`,label:V(`settings.pages.card.modules`),icon:`i-solar:tuning-square-linear`}),n}),$=o({get:()=>{var e;return Q.value.find(e=>e.id===Z.value)?Z.value:(e=Q.value[0])?.id||``},set:e=>{Z.value=e}});return(o,f)=>{var h;return m(),l(a,null,[d(v(i),{open:o.modelValue,"onUpdate:open":f[0]||=e=>B(`update:modelValue`,e)},{default:y(()=>[d(v(n),null,{default:y(()=>[d(v(e),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),d(v(r),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:y(()=>[W.value?(m(),l(`div`,ie,[s(`div`,ae,[s(`div`,oe,[s(`div`,null,[s(`div`,se,[d(v(t),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:y(()=>[u(_(W.value.name),1)]),_:1}),q.value?(m(),l(`div`,ce,[f[3]||=s(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),u(` `+_(v(V)(`settings.pages.card.active_badge`)),1)])):c(``,!0)]),s(`div`,le,[u(` v`+_(W.value.version)+` `,1),W.value.creator?(m(),l(a,{key:0},[u(` · `+_(v(V)(`settings.pages.card.created_by`))+` `,1),s(`span`,ue,_(W.value.creator),1)],64)):c(``,!0)])]),s(`div`,de,[d(v(ee),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?v(V)(`settings.pages.card.active`):v(V)(`settings.pages.card.activate`),disabled:q.value,class:p({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),s(`div`,fe,[s(`div`,pe,[s(`div`,me,[(m(!0),l(a,null,g(Q.value,e=>(m(),l(`button`,{key:e.id,class:p([`px-4 py-2 text-sm font-medium`,[$.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>$.value=e.id},[s(`div`,ge,[s(`div`,{class:p(e.icon)},null,2),u(` `+_(e.label),1)])],10,he))),128))])])]),$.value===`notes`&&W.value.notes?(m(),l(`div`,x,[s(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"text-neutral-700":``,"sm:max-h-80":``,"dark:text-neutral-300":``,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,innerHTML:Y(W.value.notes)},null,8,S)])):c(``,!0),$.value===`description`&&W.value.description?(m(),l(`div`,C,[s(`div`,{bg:`white/60 dark:black/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"sm:max-h-80":``,text:`neutral-600 dark:neutral-300`,border:`~ neutral-200/50 dark:neutral-700/30`,innerHTML:Y(W.value.description)},null,8,w)])):c(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(m(),l(`div`,T,[s(`div`,E,[(m(!0),l(a,null,g(K.value,(e,t)=>(m(),l(a,{key:t},[e?(m(),l(`div`,D,[s(`h2`,O,_(v(V)(`settings.pages.card.${t.toLowerCase()}`)),1),s(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,"max-h-none":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-3":``,"text-neutral-700":``,"dark:text-neutral-300":``,innerHTML:Y(e)},null,8,k)])):c(``,!0)],64))),128))])])):c(``,!0),$.value===`modules`?(m(),l(`div`,A,[s(`div`,j,[s(`div`,M,[s(`span`,N,[f[4]||=s(`div`,{"i-lucide:ghost":``},null,-1),u(` `+_(v(V)(`settings.pages.card.consciousness.model`)),1)]),s(`div`,P,_(G.value.consciousness??`default`),1)]),s(`div`,F,[s(`span`,I,[f[5]||=s(`div`,{"i-lucide:mic":``},null,-1),u(` `+_(v(V)(`settings.pages.card.speech.model`)),1)]),s(`div`,L,_(G.value.speech??`default`),1)]),s(`div`,_e,[s(`span`,ve,[f[6]||=s(`div`,{"i-lucide:music":``},null,-1),u(` `+_(v(V)(`settings.pages.card.speech.voice`)),1)]),s(`div`,ye,_(G.value.voice??`default`),1)])])])):c(``,!0)])])):(m(),l(`div`,be,[f[7]||=s(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),u(` `+_(v(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),d(b,{modelValue:X.value,"onUpdate:modelValue":f[1]||=e=>X.value=e,"card-name":(h=W.value)?.name,onConfirm:Ce,onCancel:f[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64)}}}),z=R;export{z as CardDetailDialog_default}; |