1import{u as j}from"./C2BCZato.js";import{z,o as J,I as N,p as Q}from"./DsvKFbFK.js";import{N as X}from"./BEqAxwcW.js";import{$ as ee,a0 as q,a1 as H,q as G,s as v,g as S,v as Z,c as w,o as _,a as i,z as A,h as d,A as c,t as C,F as M,r as p,w as V,B as te,i as ne,Z as ae,u as se,x as oe,y as ie,a2 as le}from"./DihDAdJ2.js";import{r as re}from"./Vaw1ghbW.js";import{u as K}from"./BBapef_b.js";import{u as ce}from"./CwB5O_YZ.js";import{u as de}from"./BaF3stCa.js";import{u as ue}from"./_S0JVQgH.js";import{f as we}from"./_QFVo8lI.js";import"./Dmiazl5n.js";import"./4ZukHta5.js";const _e=ee("newsProductItemStore",()=>{function T({filter:f,header:e}){return q.find(H.newsProduct,f,e)}function g({id:f,filter:e,header:h}){return q.load(H.newsProduct,f,e,h)}return{findNewsProductItem:T,loadNewsProductItem:g}}),me={class:"news-social"},ge={class:"news-social__links-wrapper"},ve={class:"news-social__link"},he={class:"news-social__link"},fe={class:"news-social__link"},Ie={class:"news-social__link"},Pe={key:0,class:"news-social__news-wrapper"},ke={class:"news-social__title"},De={class:"news-social__news-list"},ye={__name:"NewsSocial",props:{newsIndex:{type:Number,required:!0},newsData:{type:Object,required:!0},windowWidth:{type:Number,default:0}},async setup(T){let g,f;const e=T,h=G(),E=j(),W=_e(),$=ce(),b=v(0),P=v([]),U=v([]),D=S(()=>{let n="http://vkontakte.ru/share.php?";return n+="url="+encodeURIComponent(k()),e!=null&&e.newsData.Title&&(n+="&title="+encodeURIComponent(e==null?void 0:e.newsData.Title)),e!=null&&e.newsData.SeoMeta.Description&&(n+="&description="+encodeURIComponent(e==null?void 0:e.newsData.SeoMeta.Description)),e!=null&&e.newsData.PreviewImage.Url&&(n+="&image="+encodeURIComponent(e==null?void 0:e.newsData.PreviewImage.Url)),n+="&noparse=true",n});S(()=>{let n="";return n="http://www.facebook.com/sharer.php?s=100",e!=null&&e.newsData.Title&&(n+="&p[title]="+encodeURIComponent(e==null?void 0:e.newsData.Title)),n+="&p[url]="+encodeURIComponent(k()),e!=null&&e.newsData.PreviewImage.Url&&(n+="&p[images][0]="+encodeURIComponent(e==null?void 0:e.newsData.PreviewImage.Url)),n});const B=S(()=>{let n="http://twitter.com/share?";return e!=null&&e.newsData.Title&&(n+="text="+encodeURIComponent(e==null?void 0:e.newsData.Title)),n+="&url="+encodeURIComponent(k()),n}),x=S(()=>{let n="https://telegram.me/share/url?";return n+="url="+encodeURIComponent(k()),e!=null&&e.newsData.PreviewImage.Url&&(n+="&imageurl="+encodeURIComponent(e==null?void 0:e.newsData.PreviewImage.Url)),e!=null&&e.newsData.Title&&(n+="&text="+encodeURIComponent((e==null?void 0:e.newsData.Title)+` 2 3`+(e==null?void 0:e.newsData.SeoMeta.Description))),n}),{data:u}=([g,f]=Z(async()=>K(async()=>{var o;let n=[],l=[],a=0;const s=await F(),r=((o=s==null?void 0:s.List)==null?void 0:o.map(t=>t.ProductId))||[];if(r.length){const t=await R(r);n=(t==null?void 0:t.List)||[]}if((e==null?void 0:e.newsIndex)===0){const t=await m();l=(t==null?void 0:t.List)||[],a=(t==null?void 0:t.Total)||0}return{productsList:n,newsList:l,newsTotal:a}},"$tSF3Yq_KAb")),g=await g,f(),g);U.value=u.value.productsList,P.value=u.value.newsList,b.value=u.value.newsTotal;function y(n){window.open(n,"","toolbar=0,status=0,width=626,height=436")}function O(){window.open(`mailto:?body=${e==null?void 0:e.newsData.Title}: ${k()}`)}function k(){return location.href}async function m(){var n,l;try{const a={};return a.CurrentPage=1,a.PerPage=3,a.LanguageId=(n=h.currentLanguage)==null?void 0:n.id,a.RegionId=(l=h.region)==null?void 0:l.id,a.IsPreview=!0,a.IsPublished=!0,a.Order=["DatePublication"],a.OrderDirection=["Desc"],a.BaseBlogIds=[e==null?void 0:e.newsData.Blog.BaseBlogId],await E.findNewsItem({filter:a})}catch(a){console.error("Error in fetchNews:",a)}}async function F(){var n,l,a;try{const s={};return s.CurrentPage=1,s.PerPage=10,s.NewsId=(n=e==null?void 0:e.newsData)==null?void 0:n.Id,s.LanguageId=(l=h.currentLanguage)==null?void 0:l.id,s.RegionId=(a=h.region)==null?void 0:a.id,await W.findNewsProductItem({filter:s})}catch(s){console.error("Error in fetchNewsProduct:",s)}}async function R(n){var l,a;try{const s={};return s.CurrentPage=1,s.PerPage=10,s.Ids=n,s.RegionId=(l=h.region)==null?void 0:l.id,s.LanguageId=(a=h.currentLanguage)==null?void 0:a.id,s.Fields=["Id","Name","NameFull","DescriptionShort","UrlCode","Images","ImageLabel"],await $.findProduct({filter:s})}catch(s){console.error("Error in fetchProducts:",s)}}return(n,l)=>(_(),w("div",me,[i("div",ge,[i("div",ve,[i("div",{class:"news-social__link-svg",onClick:l[0]||(l[0]=a=>y(D.value))},[d(c(z),{name:"sw-social/vk-32"})])]),i("div",he,[i("div",{class:"news-social__link-svg",onClick:l[1]||(l[1]=a=>y(B.value))},[d(c(z),{name:"sw-social/twitter-32"})])]),i("div",fe,[i("div",{class:"news-social__link-svg",onClick:l[2]||(l[2]=a=>y(x.value))},[d(c(z),{name:"sw-social/telegram-32"})])]),i("div",Ie,[i("div",{class:"news-social__link-svg",onClick:l[3]||(l[3]=a=>O())},[d(c(z),{name:"sw-social/email-32"})])])]),P.value.length&&T.windowWidth>=1280?(_(),w("div",Pe,[i("span",ke,C(n.$t("CompanyNews.LastNews")),1),i("div",De,[(_(!0),w(M,null,p(P.value,a=>(_(),w("div",{key:a.Id},[d(c(X),{image:a.PreviewImage.Url,title:a.Title,url:a.SeoMeta.Chpu,class:"news-social__news-item"}
3,null,8,["image","title","url"])]))),128))]),d(c(ne),{url:c(re).news,class:"news-social__news-link"},{default:V(()=>[d(c(J),{mode:"border",class:"news-social__news-button"},{default:V(()=>[te(C(n.$t("CompanyNews.AllNews")),1)]),_:1})]),_:1},8,["url"])])):A("",!0)]))}},Le={class:"news-detail"},Ne={key:0,class:"news-detail__header-wrapper"},Se={key:1,class:"news-detail__content"},Ce={class:"news-detail__content-header"},Te={class:"news-detail__content-header-top"},$e={class:"news-detail__content-header-title"},be={class:"news-detail__content-header-data"},Ue={class:"news-detail__content-main"},Be=["innerHTML"],xe={key:0,class:"news-detail__skeleton"},Fe={class:"news-detail__skeleton-main"},Me={class:"news-detail__skeleton-right"},pe={class:"news-detail__skeleton-social"},Ee={class:"news-detail__skeleton-product"},Qe={__name:"[code]",async setup(T){let g,f;const e=G(),h=de(),E=j(),W=ue(),$=ae(),b=se(),P=v(0),U=v(!1),D=v(0),B=v(null),x=v([]),u=v(null),y=v(null);let O=v(null);const k=S(()=>"/"+e.getCurrentLanguage.code+"/news"),m=S(()=>{var r;return(r=F==null?void 0:F.value)==null?void 0:r.currentNews}),{data:F}=([g,f]=Z(async()=>K(async()=>{const r=b.locale.value==="en"&&!$.path.includes("/en/")?`/en${$.path}/`:$.path;try{const o={CurrentPage:1,PerPage:1,Chpu:decodeURI(r),LanguageId:e.currentLanguage.id},t=await W.findSeo({filter:o}),I=t!=null&&t.List&&t.List.length>0?t.List[0]:null;if(!I){const Y=`/${b.locale.value}/news`;return le(Y)}const L=await E.loadNewsItem({id:I.EntityId});return L!=null&&L.Model.Text.includes("script")&&console.log("NewsItem.Model.Text ÑодеÑÐ¶Ð¸Ñ Ñег script"),{currentNews:L==null?void 0:L.Model}}catch(o){console.error("Error in useAsyncData:",o)}},"$vZI9jLGz6p")),g=await g,f(),g);x.value.push(m.value),oe(()=>{l(),P.value=window.innerWidth,window.addEventListener("resize",R),h.toggleLoadingStatus(!1)}),ie(()=>{u==null||u.value.disconnect(),window.removeEventListener("resize",R)});function R(){clearTimeout(O.value),O.value=setTimeout(()=>{n()},100)}function n(){P.value=window.innerWidth}function l(){const r={rootMargin:"0px 0px 25% 0px",threshold:1};u.value=new IntersectionObserver(o=>{o.forEach(async t=>{t.isIntersecting&&await a()})},r),u==null||u.value.observe(y.value)}async function a(){var r;if(D.value=D.value+1,B.value!==null&&B.value<D.value){u==null||u.value.disconnect();return}U.value=!0;try{const o={};o.CurrentPage=D.value,o.PerPage=1,o.BaseBlogIds=[m==null?void 0:m.value.Blog.BaseBlogId],o.IsPublished=!0,o.Order=["DatePublication"],o.OrderDirection=["asc"],o.RegionId=e.region.id,o.LanguageId=e.currentLanguage.id,o.DateFrom=m==null?void 0:m.value.DatePublication,o.DateTo=new Date().toISOString(),o.ExceptIds=[m==null?void 0:m.value.Id];const t=await E.findNewsItem({filter:o});let I=((r=t==null?void 0:t.List)==null?void 0:r[0])||null;B.value=(t==null?void 0:t.Total)||0,I&&x.value.push(I),U.value=!1}catch(o){return console.error("in fetchNextNewsItem",o),[]}}function s(r){return we(r,b.locale.value)}return(r,o)=>(_(),w("div",null,[i("div",Le,[(_(!0),w(M,null,p(x.value,(t,I)=>(_(),w("div",{key:t.Id},[I===0&&t.Id?(_(),w("div",Ne,[d(c(Q),{list:[{url:"/",value:r.$t("HomePage"),icon:"sw-info/logo-16"},{url:k.value,value:r.$t("CompanyNews.Title")},{url:null,value:t.Title}],class:"news-detail__bread-crumbs blog-news-detail__bread-crumbs_main-news"},null,8,["list"])])):A("",!0),t&&t.Id?(_(),w("div",Se,[i("div",Ce,[i("div",Te,C(r.$t("CompanyNews.Title")),1),i("div",$e,C(t.Title),1)]),i("div",be,C(r.$t("BlogPageNewsDetail.Published"))+" "+C(s(t.DatePublication)),1),i("div",Ue,[i("div",{class:"news-detail__content-body",innerHTML:t.Text},null,8,Be)]),d(c(ye),{"news-index":I,"news-data":t,"window-width":P.value,class:"news-detail__content-left"},null,8,["news-index","news-data","window-width"])])):A("",!0)]))),128)),U.value?(_(),w("div",xe,[i("div",Fe,[d(c(N),{class:"news-detail__skeleton-top"}),(_(),w(M,null,p(3,t=>d(c(N),{key:t,class:"news-detail__skeleton-title"})),64)),d(c(N),{class:"news-detail__skeleton-date"})]),i("div",Me,[i("div",pe,[(_(),w(M,null,p(4,t=>d(c(N),{key:t,class:"news-detail__skeleton-social-item"})),64))]),i("div",Ee,[d(c(N),{class:"news-detail__skeleton-product-image"}),(_(),w(M,null,p(3,t=>d(c(N),{key:t,class:"news-detail__skeleton-product-description"})),64))])])])):A("",!0)]),i("div",{ref_key:"newsDetailObserver",ref:y},null,512)]))}};export{Qe 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.