Files
ntspi-app/public/build/assets/PageTabBuilder-CRT8Vrz4.js
T
2024-10-04 12:48:19 +05:00

2 lines
11 KiB
JavaScript

import{o as r,c as a,b as t,t as d,r as h,a as b,F as m,d as p,g as x,j as v,i as w,h as y,e as k,w as $,k as B}from"./app-C722ecVx.js";import{s as f,B as P}from"./SearchModal-72Hbiqqz.js";import{_ as g}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{C as j}from"./ClientImageSlider-DIxDD91b.js";import{F as _}from"./v3-918lQ39M.js";const L={name:"HeadingBlock",methods:{generateSlug:function(e){return f(e,{lower:!0,strict:!0,locale:"ru"})}},props:{block:{type:Object}}},S=["id"];function C(e,o,s,u,l,c){return r(),a("div",null,[t("h2",{id:c.generateSlug(s.block.data.content),class:"font-bold text-xl"},d(s.block.data.content),9,S)])}const F=g(L,[["render",C]]),z={name:"ParagraphBlock",methods:{wrapTables(e){if(e.type==="paragraph"&&e.data&&e.data.content){const o=e.data.content.replace(/<table([^>]*)>([\s\S]*?)<\/table>/g,(s,u,l)=>`<div class="div-table"><table${u}>${l}</table></div>`);return{...e,data:{...e.data,content:o}}}return e}},props:{block:{type:Object}}},I=["innerHTML"];function T(e,o,s,u,l,c){return r(),a("div",{class:"text-sm text-gray-600 leading-6 md:text-[16px] md:text-[#374151] md:leading-8 md:font-light paragraph-container",innerHTML:c.wrapTables(s.block).data.content},null,8,I)}const O=g(z,[["render",T]]),H={name:"ImageBlock",components:{FsLightbox:_},data(){return{toggler:!1,domainPath:null}},methods:{generateSlug:function(e){return f(e,{lower:!0,strict:!0,locale:"ru"})}},mounted(){this.domainPath=window.location.origin},props:{block:{type:Object}}},V=["src"];function M(e,o,s,u,l,c){const i=h("FsLightbox");return r(),a(m,null,[t("div",null,[t("img",{onClick:o[0]||(o[0]=n=>l.toggler=!l.toggler),loading:"lazy",class:"mx-auto object-cover rounded-md hover:opacity-95 hover:duration-200 transition",src:"/storage/"+s.block.data.url,alt:""},null,8,V)]),b(i,{class:"",toggler:l.toggler,sources:[l.domainPath+"/storage/"+s.block.data.url]},null,8,["toggler","sources"])],64)}const N=g(H,[["render",M]]),A={name:"FileBlock",components:{BaseIcon:P,FsLightbox:_},data(){return{toggler:!1,domainPath:null}},methods:{generateSlug:function(e){return f(e,{lower:!0,strict:!0,locale:"ru"})},textLimit(e,o){if(e.length>o){let s;return s=e.substring(0,o),s+"..."}return e}},mounted(){this.domainPath=window.location.origin},props:{block:{type:Object}}},D={class:"mb-4"},E=["href"],Y={class:"flex border rounded-lg px-4 py-2 items-center justify-between duration-300 hover:bg-gray-100"},q={class:"flex items-center justify-between"},G={class:"min-w-[30px] min-h-[30px] bg-[#303030] flex justify-center items-center rounded-md mr-2"},J={class:"text-sm text-gray-400"};function K(e,o,s,u,l,c){const i=h("BaseIcon");return r(!0),a(m,null,p(s.block.data.file,n=>(r(),a("div",D,[t("a",{class:"",href:"/storage/"+n.path,download:"",type:"button"},[t("div",Y,[t("div",q,[t("div",G,[b(i,{name:n.expansion,class:"w-5 h-5 flex-shrink-0"},null,8,["name"])]),t("div",null,d(c.textLimit(n.title,70)),1)]),t("span",J,d(n.size),1)])],8,E)]))),256)}const Q=g(A,[["render",K]]),R={name:"PersonBlock",components:{FsLightbox:_},data(){return{toggler:!1,domainPath:null}},methods:{generateSlug:function(e){return f(e,{lower:!0,strict:!0,locale:"ru"})}},mounted(){this.domainPath=window.location.origin},props:{block:{type:Object}}},U={class:"w-full rounded-xl mb-4 p-4 md:p-6 bg-white border border-gray-200"},W={class:"flex items-center gap-x-4 text-nowrap"},X=["src"],Z={class:"grow overflow-x-auto"},ee={class:"font-medium text-gray-800 hover:text-gray-500"},te={class:"text-xs text-gray-500 mt-2"};function oe(e,o,s,u,l,c){const i=h("FsLightbox");return r(),a(m,null,[t("div",U,[t("div",W,[t("img",{onClick:o[0]||(o[0]=n=>l.toggler=!l.toggler),loading:"lazy",class:"rounded-xl w-[150px]",src:"/storage/"+s.block.data.photo,alt:"Image Description"},null,8,X),t("div",Z,[t("p",ee,d(s.block.data.name),1),(r(!0),a(m,null,p(s.block.data.info,n=>(r(),a("p",te,d(n.column)+": "+d(n.content),1))),256))])])]),b(i,{class:"",toggler:l.toggler,sources:[l.domainPath+"/storage/"+s.block.data.photo]},null,8,["toggler","sources"])],64)}const se=g(R,[["render",oe],["__scopeId","data-v-73502669"]]),le={name:"StepperBlock",components:{FsLightbox:_},data(){return{toggler:!1,domainPath:null}},methods:{generateSlug:function(e){return f(e,{lower:!0,strict:!0,locale:"ru"})}},mounted(){this.domainPath=window.location.origin},props:{block:{type:Object}}},ne={class:"flex gap-x-3"},re={class:"w-16 text-end min-w-[4rem]"},ae={class:"text-xs text-gray-500"},ie={class:"grow max-w-[70%] pt-0.5 pb-8 overflow-wrap break-words"},ce={class:"flex gap-x-1.5 font-semibold text-gray-800"},de=["innerHTML"];function ue(e,o,s,u,l,c){return r(),a("div",null,[(r(!0),a(m,null,p(s.block.data.steps,(i,n)=>(r(),a("div",ne,[t("div",re,[t("span",ae,d(s.block.data.step_name)+" "+d(n+1),1)]),o[0]||(o[0]=t("div",{class:"relative last:after:hidden after:absolute after:top-7 after:bottom-0 after:start-3.5 after:w-px after:-translate-x-[0.5px] after:bg-gray-200"},[t("div",{class:"relative z-10 size-7 flex justify-center items-center"},[t("div",{class:"size-2 rounded-full bg-primaryBlue"})])],-1)),t("div",ie,[t("h3",ce,d(i.title),1),t("p",{class:"mt-1 text-sm text-gray-600 step-content",innerHTML:i.content},null,8,de)])]))),256))])}const ge=g(le,[["render",ue]]),me={name:"VideoBlock",data(){return{toggler:!1,domainPath:null}},methods:{},mounted(){this.domainPath=window.location.origin},props:{block:{type:Object}}},pe={class:"h-full w-full rounded-lg",controls:""},fe=["src","type"],he={class:"mt-3 text-sm text-center text-gray-500 dark:text-neutral-500"};function _e(e,o,s,u,l,c){return r(),a(m,null,[t("video",pe,[t("source",{src:l.domainPath+"/storage/"+s.block.data.path,type:s.block.data.mime},null,8,fe),o[0]||(o[0]=x(" Your browser does not support the video tag. "))]),t("figcaption",he,d(s.block.data.title),1)],64)}const xe=g(me,[["render",_e]]),be={name:"PostListBlock",components:{axios:v,Link:w},data(){return{posts:null,loading:!0}},methods:{getPosts(){v.get(route("client.widget.post.index"),{params:{count:this.block.data.count,category:this.block.data.category}}).then(e=>{this.posts=e.data,this.loading=!1}).catch(e=>{console.error("Ошибка:",e),this.loading=!1})}},mounted(){this.getPosts()},props:{block:{type:Object}}},ve={class:"w-full px-4 py-5 sm:px-6 lg:px-8 lg:py-7 mx-auto"},we={key:0,class:"flex flex-col space-y-4"},ke={key:1,class:"grid lg:grid-cols-1 lg:gap-y-16 gap-10"},ye={class:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-5"},$e={class:"shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44"},Be=["src"],Pe={class:"grow"},je={class:"text-xl font-semibold text-gray-800 group-hover:text-gray-600"},Le={class:"flex justify-center"},Se=["href"];function Ce(e,o,s,u,l,c){const i=h("Link");return r(),a("div",ve,[l.loading?(r(),a("div",we,o[0]||(o[0]=[y('<div class="flex animate-pulse"><div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44"><div class="bg-gray-200 group-focus:scale-105 transition-transform duration-500 ease-in-out size-full absolute top-0 start-0 object-cover rounded-xl"></div></div><div class="ms-4 mt-2 w-full"><p class="h-4 bg-gray-200 rounded-full" style="width:40%;"></p><ul class="mt-5 space-y-3 flex flex-col"><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-20 h-4 bg-gray-200 rounded-full"></li></ul></div></div><div class="flex animate-pulse"><div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44"><div class="bg-gray-200 group-focus:scale-105 transition-transform duration-500 ease-in-out size-full absolute top-0 start-0 object-cover rounded-xl"></div></div><div class="ms-4 mt-2 w-full"><p class="h-4 bg-gray-200 rounded-full" style="width:40%;"></p><ul class="mt-5 space-y-3 flex flex-col"><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-20 h-4 bg-gray-200 rounded-full"></li></ul></div></div><div class="flex animate-pulse"><div class="shrink-0 relative rounded-xl overflow-hidden w-full sm:w-56 h-44"><div class="bg-gray-200 group-focus:scale-105 transition-transform duration-500 ease-in-out size-full absolute top-0 start-0 object-cover rounded-xl"></div></div><div class="ms-4 mt-2 w-full"><p class="h-4 bg-gray-200 rounded-full" style="width:40%;"></p><ul class="mt-5 space-y-3 flex flex-col"><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-full h-4 bg-gray-200 rounded-full"></li><li class="w-20 h-4 bg-gray-200 rounded-full"></li></ul></div></div>',3)]))):(r(),a("div",ke,[(r(!0),a(m,null,p(l.posts.data,n=>(r(),k(i,{key:n.id,class:"group block rounded-xl overflow-hidden focus:outline-none",href:e.route("client.post.show",n.slug)},{default:$(()=>[t("div",ye,[t("div",$e,[t("img",{class:"group-hover:scale-105 group-focus:scale-105 transition-transform duration-500 ease-in-out size-full absolute top-0 start-0 object-cover rounded-xl",src:n.preview?"storage/images/"+n.preview:"/img/thumbnail-1.png"},null,8,Be)]),t("div",Pe,[t("h3",je,d(n.title),1),o[1]||(o[1]=t("p",{class:"mt-3 text-gray-600"}," Produce professional, reliable streams easily leveraging Preline's innovative broadcast studio ",-1)),o[2]||(o[2]=t("p",{class:"mt-4 inline-flex items-center gap-x-1 text-sm text-primaryBlue decoration-2 group-hover:underline group-focus:underline font-medium"},[x(" Читать далее "),t("svg",{class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"m9 18 6-6-6-6"})])],-1))])])]),_:2},1032,["href"]))),128)),t("div",Le,[t("a",{href:e.route("client.post.index",{category:s.block.data.category}),class:"group inline-flex items-center gap-x-1 text-sm font-semibold text-[#1A5AAF]"},o[3]||(o[3]=[x(" Все новости "),t("svg",{class:"flex-shrink-0 size-4 transition ease-in-out group-hover:translate-x-1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"m9 18 6-6-6-6"})],-1)]),8,Se)])]))])}const Fe=g(be,[["render",Ce]]),ze={name:"PageTabBuilder",components:{FileBlock:Q,ImageBlock:N,ClientImageSlider:j,ParagraphBlock:O,HeadingBlock:F,Link:w,PersonBlock:se,StepperBlock:ge,VideoBlock:xe,PostListBlock:Fe},methods:{getComponent(e){return{heading:"HeadingBlock",paragraph:"ParagraphBlock",images:"ClientImageSlider",image:"ImageBlock",files:"FileBlock",person:"PersonBlock",stepper:"StepperBlock",video:"VideoBlock",postsList:"PostListBlock"}[e]||null}},props:{blocks:{type:Object}}};function Ie(e,o,s,u,l,c){return r(!0),a(m,null,p(s.blocks,(i,n)=>(r(),k(B(c.getComponent(i.type)),{key:n,block:i},null,8,["block"]))),128)}const Ne=g(ze,[["render",Ie]]);export{Q as F,F as H,N as I,Ne as P,ge as S,xe as V,O as a,se as b,Fe as c};