PageSourceSearch

https://bogoslov.ru/_nuxt/BTIphvdr.js

js bogoslov.ru collected 2026-10-02 05:02:51 UTC 2,469 bytes, 1 lines download raw bytes

1import{u as g,ae as w,c as y,R as F,ah as p,ac as B,r as b,j as z,g as m,H as C,o as h,d as k,a as q,e as E,t as S,a5 as M,n as T,_ as $}from"./CM9RFNJZ.js";import{_ as j}from"./GuSy-mLk.js";const D=()=>{const r=g(),i=w(),t=y(()=>!1);return{addToFavorites:async(n,c)=>{if(!await i.requireAuth("favorites"))throw new Error("User is not authenticated");try{return await r.$queryApi("?type=favorites&action=create",{data:{uuid_object:n,type:c}},{ssr:t.value})}catch(s){throw console.error("Error adding to favorites:",s),s}},removeFromFavorites:async n=>{if(!await i.requireAuth("favorites"))throw new Error("User is not authenticated");try{return await r.$queryApi(`?type=favorites&action=delete&id=${n}`,{},{ssr:t.value})}catch(a){throw console.error("Error removing from favorites:",a),a}}}},N={key:0,class:"button-text"},I=F({__name:"ButtonFav",props:p({nativeSize:{type:Boolean,default:!1},size:{default:"sm"},label:{default:"Избранное"},theme:{default:"grand"},rounded:{type:Boolean,default:!1},type:{default:"secondary"},uuid:{},entity:{}},{isActive:{type:Boolean,default:!1},isActiveModifiers:{}}),emits:p(["change"],["update:isActive"]),setup(r,{emit:i}){const t=r,u=B(r,"isActive"),f=i,{addToFavorites:n,removeFromFavorites:c}=D(),a=b(!1),s=y(()=>!!u.value),A=async e=>{var v,l;if(e.stopPropagation(),e.preventDefault(),!t.uuid||!t.entity){console.warn("ButtonFav: uuid and entity are required for favorites functionality");return}a.value=!0;try{if(s.value){const o=t.uuid;if(o)await c(o),u.value=!1,f("change",{isActive:!1});else{console.warn("ButtonFav: uuid is required for removing from favorites");return}}else{const o=await n(t.uuid,t.entity);if(o.status===200&&((v=o.data)!=null&&v.success)){u.value=!0;const d=(l=o.data)==null?void 0:l.content,_=d&&typeof d=="object"&&"uuid"in d?String(d.uuid):t.uuid;f("change",{isActive:!0,uuid:_})}}}catch(o){console.error("Error toggling favorites:",o)}finally{a.value=!1}};return(e,v)=>{const l=C;return h(),z(l,null,{default:m(()=>[k(j,{class:T(["button-fav",{active:s.value,[`--${e.size}`]:e.size==="sm"||e.size==="md"||e.nativeSize}]),theme:e.theme,type:e.type,rounded:e.rounded,iconAppend:s.value?"favorites-active":"favorites",disabled:a.value,onClick:M(A,["stop"])},{default:m(()=>[(e.size==="lg"||e.size==="md")&&e.label?(h(),q("span",N,S(e.label),1)):E("",!0)]),_:1},8,["class","theme","type","rounded","iconAppend","disabled"])]),_:1})}}}),H=$(I,[["__scopeId","data-v-3449beff"]]);export{H as _};

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.