PageSourceSearch

https://operativmm.az/build/assets/app-Bz_rffHi.js

js operativmm.az collected 2026-09-24 21:00:41 UTC 38,566 bytes, 7 lines download raw bytes

1import{m as y,a as ze}from"./alpine-DxVFBXNS.js";import{a as $,m as Be}from"./api-CWifBM5m.js";import{i as je}from"./amplitude-BM6IY-y6.js";import{g as Ne}from"./_commonjsHelpers-Cpj98o6Y.js";import"./preload-helper-I4rgV-VL.js";const Oe=()=>document.querySelector('meta[name="csrf-token"]')?.content||"",He=[{name:"search_operativmm_news",description:"Search news articles on operativmm.az. Best for specific event, person, or topic queries. Azerbaijani query terms give best recall.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query — prefer Azerbaijani spellings"},locale:{type:"string",enum:["az","en","ru"],default:"az"}},required:["query"]},execute:async({query:t,locale:e="az"})=>{const s=`/${e}/search?q=${encodeURIComponent(t)}`;return{message:"Search results are returned as an HTML page. Fetch this URL for results.",url:new URL(s,window.location.origin).href}}},{name:"get_latest_headlines",description:"Get the most recent news headlines from operativmm.az as a paginated JSON wrapper: {posts: [...], hasMore: bool, total: int}. Fixed 20 posts per page.",inputSchema:{type:"object",properties:{page:{type:"integer",minimum:1,default:1,description:"Page number (1-based). 20 posts per page."},exclude:{type:"integer",minimum:0,description:"Optional post id to exclude from the response."}}},execute:async({page:t=1,exclude:e}={})=>{const s=Math.max(1,parseInt(t,10)||1),n=new URLSearchParams({page:String(s)});return e&&Number.isFinite(+e)&&+e>0&&n.set("exclude",String(+e)),await(await $(`/api/feed-posts?${n.toString()}`)).json()}},{name:"list_azerbaijan_regions",description:"List all 69 Azerbaijani regions supported by the weather API, with slugs and localized names. Call this first to discover valid region slugs.",inputSchema:{type:"object",properties:{}},execute:async()=>await(await $("/api/weather/regions")).json()},{name:"get_azerbaijan_weather",description:"Get current weather conditions and forecast for an Azerbaijani region. Use list_azerbaijan_regions first to find valid slugs.",inputSchema:{type:"object",properties:{region:{type:"string",description:'Region slug (e.g. "baki" for Baku, "gence" for Ganja, "naxcivan" for Nakhchivan)'}},required:["region"]},execute:async({region:t})=>{if(!t||typeof t!="string")throw new Error("region slug is required");const e=encodeURIComponent(t.trim().toLowerCase());return await(await $(`/api/weather/${e}`)).json()}},{name:"ask_operativmm_chatbot",description:"Ask the operativmm.az AI chatbot a natural-language question about Azerbaijani news, politics, or current events. Supports Azerbaijani, English, and Russian. Returns an answer with source citations.",inputSchema:{type:"object",properties:{message:{type:"string",description:"Natural-language question"}},required:["message"]},execute:async({message:t})=>{if(!t||typeof t!="string")throw new Error("message is required");return await(await $("/api/ai/chatbot/chat",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":Oe()},body:JSON.stringify({message:t.trim()})})).json()}}],ke=()=>{if(!(typeof navigator>"u"||!("modelContext"in navigator)))try{navigator.modelContext.provideContext({tools:He})}catch(t){console.warn("[WebMCP] provideContext failed:",t?.message||t)}};typeof window<"u"&&("requestIdleCallback"in window?window.requestIdleCallback(ke,{timeout:2e3}):window.setTimeout(ke,800));const F=(t,e={})=>{typeof window.gtag=="function"&&window.gtag("event",t,e)},Ce=new Set,Ee=t=>{if(t=parseInt(t,10),!t||Ce.has(t))return;Ce.add(t);const e=`/api/view/${t}`;navigator.sendBeacon&&navigator.sendBeacon(e)||fetch(e,{method:"POST",keepalive:!0}).catch(()=>{})},q=t=>String(t??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]),U=t=>typeof t!="string"?"#":(t=t.trim(),/^(https?:\/\/|\/(?!\/))/.test(t)?t:"#"),Pe=(t,e)=>t&&t.getBoundingClientRect().top<window.innerHeight+e,le=(t,e,s)=>{let n=!1;const a=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1,Pe(t,e)&&s()}))};return window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),a(),a};y.data("feedMore",(t={})=>({start:t.start??0,limit:t.limit??5,loading:!1,done:!1,failed:!1,_loads:0,autoMax:t.autoMax??4,get auto(){return this._loads<this.autoMax},init(){le(this.$refs.sentinel,600,()=>{this.auto&&!this.loading&&!this.done&&!this.failed&&this.load()})},async load(){if(!(this.loading||this.done)){this.loading=!0,this.failed=!1;try{const e=t.param??"start",s=t.url.includes("?")?"&":"?",n=await fetch(`${t.url}${s}${e}=${this.start}&limit=${this.limit}`,{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!n.ok)throw new Error(n.status);const a=(await n.text()).trim();if(!a){this.done=!0;return}const u=document.createElement("template");u.innerHTML=a;const d=new Set([...document.querySelectorAll("[data-post-id]")].map(m=>m.dataset.postId));let h=0;u.content.querySelectorAll("[data-post-id]").forEach(m=>{if(d.has(m.dataset.postId)){m.remove();return}m.classList.add("fade-in"),h++});const g=Math.max(h,this.limit);this.$refs.more.appendChild(u.content),this.start+=g,this._loads++,F("feed_load_more",{event_category:"engagement",page:this._loads,added:h}),h===0&&this._loads>3&&(this.done=!0)}catch{this.failed=!0}finally{this.loading=!1}}}}));y.data("categoryFeed",(t={})=>({page:1,hasMore:!!t.hasMore,loading:!1,error:!1,loaded:new Set(t.loaded??[]),_sinceMostRead:0,_mostReadDone:!1,_sinceRelated:0,_relatedCount:0,init(){le(this.$refs.sentinel,700,()=>{this.hasMore&&!this.loading&&!this.error&&this.load()})},async load(){if(!(this.loading||!this.hasMore)){this.loading=!0,this.error=!1;try{const e=await fetch(`/api/category/${t.categoryId}/posts?page=${this.page+1}`);
1if(!e.ok)throw new Error(e.status);const s=await e.json(),n=(s.posts||[]).filter(a=>!this.loaded.has(a.id));n.forEach(a=>{this.loaded.add(a.id),this.$refs.more.insertAdjacentHTML("beforeend",this.row(a))}),this.page++,this.hasMore=!!s.has_more,this._sinceMostRead+=n.length,this._sinceRelated+=n.length,window.innerWidth<1024&&!this._mostReadDone&&this._sinceMostRead>=8&&(this._mostReadDone=!0,this.mostRead()),this._sinceRelated>=15&&(this._sinceRelated=0,this.related())}catch{this.error=!0}finally{this.loading=!1}}},row(e){const s=e.media_type==2?'<span aria-hidden="true">·</span><span>Video</span>':"";return`<article class="story-row group relative fade-in" data-post-id="${e.id}">
2            <div class="frame"><img src="${q(U(e.image_url))}" alt="" width="280" height="210" loading="lazy" decoding="async"></div>
3            <div class="body">
4                <h3 class="text-ink"><a href="${q(U(e.url))}" class="hover-underline card-link">${q(e.title)}</a></h3>
5                <div class="meta"><time>${q(e.time_ago)}</time>${s}</div>
6            </div></article>`},async mostRead(){try{const e=await fetch(`/api/category/${t.categoryId}/most-read`);if(!e.ok)return;const s=await e.json();if(!s.posts?.length)return;const n=s.posts.map(a=>`<li><a href="${q(U(a.url))}" class="line-clamp-2">${q(a.title)}</a></li>`).join("");this.$refs.more.insertAdjacentHTML("beforeend",`<div class="py-5 border-b border-rule"><span class="kicker-muted block mb-1">${q(s.label)}</span><ol class="ranked">${n}</ol></div>`)}catch{}},async related(){const e=["popular","selected","random"],s=e[this._relatedCount%e.length],n=["Bənzər xəbərlər","Sizi maraqlandıra bilər","Digər xəbərlər"];try{const a=[...this.loaded].slice(-100).join(","),u=await fetch(`/api/category/${t.categoryId}/related?strategy=${s}&exclude=${a}&limit=4`);if(!u.ok)return;const d=await u.json();if(!d.posts||d.posts.length<2)return;const h=d.posts.map(g=>(this.loaded.add(g.id),`<a href="${q(U(g.url))}" class="news-tile group"><div class="frame"><img src="${q(U(g.image_url))}" alt="" loading="lazy" decoding="async"></div><h4 class="text-ink line-clamp-3 hover-underline">${q(g.title)}</h4></a>`)).join("");this.$refs.more.insertAdjacentHTML("beforeend",`<div class="py-5 border-b border-rule"><span class="kicker-muted block mb-3">${n[this._relatedCount%n.length]}</span><div class="carousel bleed scrollbar-hide">${h}</div></div>`)}catch{}finally{this._relatedCount++}}}));y.data("nextArticle",(t={})=>({n:0,loading:!1,done:!1,failed:!1,_max:1/0,_current:null,init(){if(Ee(this.$el.dataset.postId),!("IntersectionObserver"in window)){this.done=!0;return}this._current={url:t.url,title:t.title},le(this.$refs.sentinel,900,()=>{!this.loading&&!this.done&&!this.failed&&this.load()}),this._watch=new IntersectionObserver(e=>{e.forEach(s=>{if(!s.isIntersecting)return;const n=s.target.dataset.url||t.url,a=s.target.dataset.title||t.title;n!==this._current.url&&(this._current={url:n,title:a},history.replaceState(null,"",n),document.title=a+(document.title.includes(" | ")?document.title.slice(document.title.indexOf(" | ")):""),F("article_view",{event_category:"content",article_url:n,via:"auto_next"}),Ee(s.target.dataset.postId))})},{rootMargin:"-20% 0px -70% 0px"}),this._watch.observe(this.$el)},async load(){if(!(this.loading||this.done)){if(this.n>=this._max){this.done=!0;return}this.loading=!0,this.failed=!1;try{const e=t.url.includes("?")?"&":"?",s=await fetch(`${t.url}${e}start=${this.n}`,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/html"}});if(s.status===404){this.done=!0;return}if(!s.ok)throw new Error(s.status);const n=(await s.text()).trim();if(!n){this.done=!0;return}const a=document.createElement("template");a.innerHTML=n;const u=new Set([this.$el.dataset.postId,...[...this.$refs.next.querySelectorAll(".next-story")].map(h=>h.dataset.postId)]);let d=0;if(a.content.querySelectorAll(".next-story").forEach(h=>{if(u.has(h.dataset.postId)){h.remove();return}h.classList.add("fade-in"),this._watch.observe(h),d++}),this.$refs.next.appendChild(a.content),this.n++,d===0)return this.loading=!1,this.load();F("next_article_loaded",{event_category:"recirculation",index:this.n})}catch{this.failed=!0}finally{this.loading=!1}}}}));y.data("shareBar",(t={})=>({copied:!1,async share(){if(navigator.share){try{await navigator.share({title:t.title,url:t.url}),F("share",{event_category:"social",method:"native",item_id:t.url})}catch{}return}this.copy()},async copy(){try{await navigator.clipboard.writeText(t.url),this.copied=!0,F("share",{event_category:"social",method:"copy_link",item_id:t.url}),setTimeout(()=>{this.copied=!1},1800)}catch{window.prompt("URL",t.url)}}}));(function(){const t=document.querySelector("[data-latest-refresh]");if(!t)return;const e=t.querySelector("ol.ticker");if(!e)return;const s=()=>[...e.querySelectorAll("a[href]")].map(a=>(a.getAttribute("href").match(/\/(\d+)$/)||[])[1]).join(",");async function n(){try{const a=t.dataset.latestRefresh||"az",u=await fetch(`/api/latest?locale=${encodeURIComponent(a)}&limit=6`,{headers:{Accept:"application/json"}});if(!u.ok)return;const{posts:d}=await u.json();if(!Array.isArray(d)||d.length===0||d.map(g=>String(g.id)).join(",")===s())return;const h=document.createDocumentFragment();d.forEach(g=>
6{const m=document.createElement("li"),o=document.createElement("time");o.dateTime=g.datetime,o.textContent=g.time;const R=document.createElement("a");R.href=g.url,R.className="hover-underline line-clamp-2"+(g.urgent?" is-urgent":""),R.textContent=g.title,m.append(o,R),h.appendChild(m)}),e.replaceChildren(h)}catch{}}document.readyState==="complete"?n():window.addEventListener("load",n,{once:!0})})();var J={exports:{}};var De=J.exports,qe;function Ue(){return qe||(qe=1,(function(t,e){(function(s,n){t.exports=n()})(De,function(){var s,n,a,u,d,h='<svg width="44" height="60"><polyline points="30 10 10 30 30 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"stroke-linecap="butt" fill="none" stroke-linejoin="round"/></svg>',g='<svg width="44" height="60"><polyline points="14 10 34 30 14 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"stroke-linecap="butt" fill="none" stroke-linejoin="round"/></svg>',m='<svg width="30" height="30"><g stroke="rgb(160,160,160)" stroke-width="4"><line x1="5" y1="5" x2="25" y2="25"/><line x1="5" y1="25" x2="25" y2="5"/></g></svg>',o={},R={captions:!0,buttons:"auto",fullScreen:!1,noScrollbars:!1,bodyClass:"baguetteBox-open",titleTag:!1,async:!1,preload:2,animation:"slideIn",afterShow:null,afterHide:null,onChange:null,overlayBackgroundColor:"rgba(0,0,0,.8)",closeX:m,leftArrow:h,rightArrow:g},_={},L=[],v=0,K=!1,b={},X=!1,ce=/.+\.(gif|jpe?g|png|webp|avif)/i,z={},B=[],Z=null,de=function(i){i.target.id.indexOf("baguette-img")!==-1&&O()},ue=function(i){i.stopPropagation?i.stopPropagation():i.cancelBubble=!0,Y()},he=function(i){i.stopPropagation?i.stopPropagation():i.cancelBubble=!0,W()},ge=function(i){i.stopPropagation?i.stopPropagation():i.cancelBubble=!0,O()},pe=function(i){b.count++,1<b.count&&(b.multitouch=!0),b.startX=i.changedTouches[0].pageX,b.startY=i.changedTouches[0].pageY},fe=function(i){if(!X&&!b.multitouch){i.preventDefault?i.preventDefault():i.returnValue=!1;var r=i.touches[0]||i.changedTouches[0];40<r.pageX-b.startX?(X=!0,Y()):r.pageX-b.startX<-40?(X=!0,W()):100<b.startY-r.pageY&&O()}},ee=function(){b.count--,b.count<=0&&(b.multitouch=!1),X=!1},me=function(){ee()},we=function(i){s.style.display==="block"&&s.contains&&!s.contains(i.target)&&(i.stopPropagation(),_e())};function ye(i){if(z.hasOwnProperty(i)){var r=z[i].galleries;[].forEach.call(r,function(l){[].forEach.call(l,function(p){S(p.imageElement,"click",p.eventHandler)}),L===l&&(L=[])}),delete z[i]}}function te(i){switch(i.keyCode){case 37:Y();break;case 39:W();break;case 27:O();break;case 36:(function(l){return l&&l.preventDefault(),H(0)})(i);break;case 35:(function(l){return l&&l.preventDefault(),H(L.length-1)})(i)}}function ve(i,r){if(L!==i){for(L=i,(function(E){E=E||{};for(var w in R)o[w]=R[w],typeof E[w]<"u"&&(o[w]=E[w]);n.style.transition=n.style.webkitTransition=o.animation==="fadeIn"?"opacity .4s ease":o.animation==="slideIn"?"":"none",o.buttons==="auto"&&("ontouchstart"in window||L.length===1)&&(o.buttons=!1),a.style.display=u.style.display=o.buttons?"":"none",d.innerHTML=o.closeX,o.buttons&&(a.innerHTML=o.leftArrow,u.innerHTML=o.rightArrow);try{s.style.backgroundColor=o.overlayBackgroundColor}catch{}})(r);n.firstChild;)n.removeChild(n.firstChild);for(var l,p=[],c=[],f=B.length=0;f<i.length;f++)(l=k("div")).className="full-image",l.id="baguette-img-"+f,B.push(l),p.push("baguetteBox-figure-"+f),c.push("baguetteBox-figcaption-"+f),n.appendChild(B[f]);s.setAttribute("aria-labelledby",p.join(" ")),s.setAttribute("aria-describedby",c.join(" "))}}function be(i){o.noScrollbars&&(document.documentElement.style.overflowY="hidden",document.body.style.overflowY="scroll"),s.style.display!=="block"&&(x(document,"keydown",te),b={count:0,startX:null,startY:null},Q(v=i,function(){se(v),ne(v)}),xe(),s.style.display="block",o.fullScreen&&(function(){s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.mozRequestFullScreen&&s.mozRequestFullScreen()})(),setTimeout(function(){s.className="visible",o.bodyClass&&document.body.classList&&document.body.classList.add(o.bodyClass),o.afterShow&&o.afterShow()},50),o.onChange&&o.onChange(v,B.length),Z=document.activeElement,_e(),K=!0)}function _e(){o.buttons?a.focus():d.focus()}function O(){o.noScrollbars&&(document.documentElement.style.overflowY="auto",document.body.style.overflowY="auto"),s.style.display!=="none"&&(S(document,"keydown",te),s.className="",setTimeout(function(){s.style.display="none",document.fullscreen&&(function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()})(),o.bodyClass&&document.body.classList&&document.body.classList.remove(o.bodyClass),o.afterHide&&o.afterHide(),Z&&Z.focus(),K=!1},500))}function Q(i,r){var l=B[i],p=L[i];if(l!==void 0&&p!==void 0)if(l.getElementsByTagName("img")[0])r&&r();else{var c=p.imageElement,f=c.getElementsByTagName("img")[0],C=typeof o.captions=="function"?o.captions.call(L,c):c.getAttribute("data-caption")||c.title,E=(function(j){var N=j.href;if(j.dataset){var D=[];for(var M in j.dataset)M.substring(0,3)!=="at-"||isNaN(M.substring(3))||(D[M.replace("at-","")]=j.dataset[M]);for(var ie=Object.keys(D).sort(function($e,Re){return parseInt($e,10)<parseInt(Re,10)?-1:1}),Me=window.innerWidth*window.devicePixelRatio,G=0;G<ie.length-1&&ie[G]<Me;)G++;N=D[ie[G]]||N}return N})(c),w=k("figure");
6if(w.id="baguetteBox-figure-"+i,w.innerHTML='<div class="baguetteBox-spinner"><div class="baguetteBox-double-bounce1"></div><div class="baguetteBox-double-bounce2"></div></div>',o.captions&&C){var A=k("figcaption");A.id="baguetteBox-figcaption-"+i,A.innerHTML=C,w.appendChild(A)}l.appendChild(w);var T=k("img");T.onload=function(){var I=document.querySelector("#baguette-img-"+i+" .baguetteBox-spinner");w.removeChild(I),!o.async&&r&&r()},T.setAttribute("src",E),T.alt=f&&f.alt||"",o.titleTag&&C&&(T.title=C),w.appendChild(T),o.async&&r&&r()}}function W(){return H(v+1)}function Y(){return H(v-1)}function H(i,r){return!K&&0<=i&&i<r.length?(ve(r,o),be(i),!0):i<0?(o.animation&&Se("left"),!1):i>=B.length?(o.animation&&Se("right"),!1):(Q(v=i,function(){se(v),ne(v)}),xe(),o.onChange&&o.onChange(v,B.length),!0)}function Se(i){n.className="bounce-from-"+i,setTimeout(function(){n.className=""},400)}function xe(){var i=document.querySelectorAll("html")[0].getAttribute("dir")==="rtl",r=-v*(i?-100:100)+"%";o.animation==="fadeIn"?(n.style.opacity=0,setTimeout(function(){_.transforms?n.style.transform=n.style.webkitTransform="translate3d("+r+",0,0)":n.style.left=r,n.style.opacity=1},400)):_.transforms?n.style.transform=n.style.webkitTransform="translate3d("+r+",0,0)":n.style.left=r}function se(i){i-v>=o.preload||Q(i+1,function(){se(i+1)})}function ne(i){v-i>=o.preload||Q(i-1,function(){ne(i-1)})}function x(i,r,l,p){i.addEventListener?i.addEventListener(r,l,p):i.attachEvent("on"+r,function(c){(c=c||window.event).target=c.target||c.srcElement,l(c)})}function S(i,r,l,p){i.removeEventListener?i.removeEventListener(r,l,p):i.detachEvent("on"+r,l)}function P(i){return document.getElementById(i)}function k(i){return document.createElement(i)}return[].forEach||(Array.prototype.forEach=function(i,r){for(var l=0;l<this.length;l++)i.call(r,this[l],l,this)}),[].filter||(Array.prototype.filter=function(i,r,l,p,c){for(l=this,p=[],c=0;c<l.length;c++)i.call(r,l[c],c,l)&&p.push(l[c]);return p}),{run:function(r,l){return _.transforms=(function(){var c=k("div");return typeof c.style.perspective<"u"||typeof c.style.webkitPerspective<"u"})(),_.svg=(function(){var c=k("div");return c.innerHTML="<svg/>",(c.firstChild&&c.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),_.passiveEvents=(function(){var c=!1;try{var f=Object.defineProperty({},"passive",{get:function(){c=!0}});window.addEventListener("test",null,f)}catch{}return c})(),(function(){if(s=P("baguetteBox-overlay"))return n=P("baguetteBox-slider"),a=P("previous-button"),u=P("next-button"),void(d=P("close-button"));(s=k("div")).setAttribute("role","dialog"),s.id="baguetteBox-overlay",document.getElementsByTagName("body")[0].appendChild(s),(n=k("div")).id="baguetteBox-slider",s.appendChild(n),(a=k("button")).setAttribute("type","button"),a.id="previous-button",a.setAttribute("aria-label","Previous"),a.innerHTML=_.svg?h:"&lt;",s.appendChild(a),(u=k("button")).setAttribute("type","button"),u.id="next-button",u.setAttribute("aria-label","Next"),u.innerHTML=_.svg?g:"&gt;",s.appendChild(u),(d=k("button")).setAttribute("type","button"),d.id="close-button",d.setAttribute("aria-label","Close"),d.innerHTML=_.svg?m:"&times;",s.appendChild(d),a.className=u.className=d.className="baguetteBox-button",(function(){var f=_.passiveEvents?{passive:!1}:null,C=_.passiveEvents?{passive:!0}:null;x(s,"click",de),x(a,"click",ue),x(u,"click",he),x(d,"click",ge),x(n,"contextmenu",me),x(s,"touchstart",pe,C),x(s,"touchmove",fe,f),x(s,"touchend",ee),x(document,"focus",we,!0)})()})(),ye(r),(function(c,f){var C=document.querySelectorAll(c),E={galleries:[],nodeList:C};return z[c]=E,[].forEach.call(C,function(w){f&&f.filter&&(ce=f.filter);var A=[];if(A=w.tagName==="A"?[w]:w.getElementsByTagName("a"),(A=[].filter.call(A,function(I){if(I.className.indexOf(f&&f.ignoreClass)===-1)return ce.test(I.href)})).length!==0){var T=[];[].forEach.call(A,function(I,j){var N=function(M){M.preventDefault?M.preventDefault():M.returnValue=!1,ve(T,f),be(j)},D={eventHandler:N,imageElement:I};x(I,"click",N),T.push(D)}),E.galleries.push(T)}}),E.galleries})(r,l)},show:H,showNext:W,showPrevious:Y,hide:O,destroy:function(){(function(){var l=_.passiveEvents?{passive:!1}:null,p=_.passiveEvents?{passive:!0}:null;S(s,"click",de),S(a,"click",ue),S(u,"click",he),S(d,"click",ge),S(n,"contextmenu",me),S(s,"touchstart",pe,p),S(s,"touchmove",fe,l),S(s,"touchend",ee),S(document,"focus",we,!0)})(),(function(){for(var l in z)z.hasOwnProperty(l)&&ye(l)})(),S(document,"keydown",te),document.getElementsByTagName("body")[0].removeChild(document.getElementById("baguetteBox-overlay")),z={},L=[],v=0}}})})(J)),J.exports}var Fe=Ue();const V=Ne(Fe),Xe="/build/assets/baguetteBox.min-CGEAgw38.css";je();y.plugin(ze);y.plugin(Be);window.Alpine=y;let Le=!1;const Qe=()=>{if(Le)return;Le=!0;const t=document.createElement("link");t.rel="stylesheet",t.href=Xe,document.head.appendChild(t)},We=V.run.bind(V);V.run=(t,e)=>{if(document.querySelector(t))return Qe(),We(t,e)};window.baguetteBox=V;const re=t=>{try{return localStorage.getItem(t)}catch{return null}},Ie=(t,e)=>{try{localStorage.setItem(t,e)}catch(s){console.warn("localStorage unavailable:",s.message)}},Ye=t=>{try{return sessionStorage.getItem(t)}catch{return null}},Ge=(t,e)=>{try{sessionStorage.setItem(t,e)}catch(s){console.warn("sessionStorage unavailable:",s.message)}},Ae=t=>{try{sessionStorage.removeItem(t)}catch(e){console.warn("sessionStorage unavailable:",e.message)}},Je=t=>{if(!t)return!1;try{const e=new URL(t,window.location.origin);return["http:","https:"].includes(e.protocol)}catch{return!1}};y.store("darkMode",{on:re("darkMode")==="true"||!re("darkMode")&&window.matchMedia("(prefers-color-scheme: dark)").matches,toggle(){this.on=!this.on,Ie("darkMode",this.on),this.apply()},apply(){this.on?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},init(){this.apply()}});y.store("reader",{sizes:["base","lg","xl"],size:re("readerSize")||"base",apply(){const t=document.documentElement;t.classList.remove("reader-lg","reader-xl"),this.size!=="base"&&t.classList.add("reader-"+this.size)},step(t){const e=this.sizes.indexOf(this.size),s=Math.min(this.sizes.length-1,Math.max(0,e+t));this.size=this.sizes[s],Ie("readerSize",this.size),this.apply()},canGrow(){return this.size!=="xl"},canShrink(){return this.size!=="base"},init(){this.apply()}});y.data("liveStatus",(t={})=>({postId:t.postId,since:t.latestId||0,active:!!t.isLive,newCount:0,timer:null,init(){!this.active||!this.postId||(this.timer=setInterval(()=>this.check(),6e4),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.check()}))},async check(){if(document.visibilityState==="visible")try{const e=await fetch(`/api/live/${this.postId}/status?since=${this.since}`,{headers:{Accept:"application/json"}});if(!e.ok)return;const s=await e.json();this.newCount=s.new_count||0,s.is_live||(this.active=!1,clearInterval(this.timer))}catch{}},reload(){const e=new URL(window.location.href);e.hash="live-blog-section",window.location.href=e.toString(),window.location.reload()}}));y.data("aiAssistant",(t={})=>({mode:t.mode||"widget",activeTab:"news",isOpen:t.mode!=="sheet",sheetLoaded:t.mode!=="sheet",newsQuestion:"",newsMessages:[],newsLoading:!1,sessionId:null,welcomeMessage:"",quickActions:[],eventSource:null,_configLoaded:!1,pageContext:t.pageContext||{type:"home",postId:null,postTitle:"",categoryId:null,categoryName:""},contextSuggestions:[],showContextTooltip:!1,spellingWord:"",spellingResult:null,spellingError:null,spellingLoading:!1,legalQuestion:"",legalAnswer:null,legalError:null,legalLoading:!1,legalExpanded:!1,trackEvent(e,s={}){typeof window.gtag<"u"&&window.gtag("event",e,{event_category:"ai_assistant",...s})},init(){if(this.generateContextSuggestions(),this.trackEvent("ai_widget_init",{mode:this.mode,page_context:this.pageContext?.type||"unknown"}),this.mode==="widget"){const e=()=>this.ensureConfigLoaded();"requestIdleCallback"in window?window.requestIdleCallback(e,{timeout:3e3}):setTimeout(e,2e3)}this.mode==="sheet"&&(window._openSheetHandler&&window.removeEventListener("open-ai-sheet",window._openSheetHandler),window._openSheetHandler=()=>{this.sheetLoaded=!0,this.$nextTick(()=>{this.isOpen=!0}),document.body.style.overflow="hidden",this.trackEvent("ai_sheet_open",{trigger:"mobile_button"}),this.ensureConfigLoaded()},window.addEventListener("open-ai-sheet",window._openSheetHandler),this.$watch("isOpen",e=>{if(document.body.style.overflow=e?"hidden":"",!e&&this.eventSource){try{this.eventSource.close()}catch{}this.eventSource=null,this.newsLoading=!1;const s=this.newsMessages.find(n=>n.isStreaming);
6s&&(s.isStreaming=!1)}})),this.$watch("activeTab",(e,s)=>{e==="news"&&this.ensureConfigLoaded(),s&&this.trackEvent("ai_tab_switch",{tab_from:s,tab_to:e}),this.persistSessionState()}),this.restoreSessionState(),this.$watch("sessionId",()=>this.persistSessionState()),this.$watch("newsMessages",()=>this.persistSessionState())},ensureConfigLoaded(){this._configLoaded||(this._configLoaded=!0,this.loadChatbotConfig())},restoreSessionState(){try{const e=Ye("aiAssistant_state");if(!e)return;const s=JSON.parse(e);if(s.timestamp&&Date.now()-s.timestamp>1800*1e3){Ae("aiAssistant_state");return}s.sessionId&&(this.sessionId=s.sessionId),s.activeTab&&(this.activeTab=s.activeTab),Array.isArray(s.newsMessages)&&s.newsMessages.length>0&&(this.newsMessages=s.newsMessages.filter(n=>!n.isStreaming).map(n=>({role:n.role,content:n.content,fromCache:n.fromCache||!1,fromSimple:n.fromSimple||!1,isStreaming:!1})))}catch{Ae("aiAssistant_state")}},persistSessionState(){this.mode==="sheet"&&document.querySelector('[x-data*="widget"]')||Ge("aiAssistant_state",JSON.stringify({sessionId:this.sessionId,activeTab:this.activeTab,newsMessages:this.newsMessages.filter(e=>!e.isStreaming).slice(-20),timestamp:Date.now()}))},generateContextSuggestions(){if(this.pageContext?.type==="post"&&this.pageContext?.postId){let e=this.pageContext.postTitle;if(!e){const s=document.querySelector("article h1, .post-title, h1.text-2xl"),n=document.querySelector('meta[property="og:title"]');e=s?.textContent?.trim()||n?.content||""}if(e){const s=this.pageContext.postId;this.contextSuggestions=[{label:window.__translations?.short_summary||"Qısa xülasə",query:`[SUMMARIZE:${s}] "${e}" xəbərinin qısa xülasəsi`},{label:window.__translations?.similar_news||"Oxşar xəbərlər",query:`[RELATED:${s}] "${e}" ilə bağlı digər xəbərlər`}],setTimeout(()=>{this.isOpen||(this.showContextTooltip=!0)},5e3)}}else this.pageContext?.type==="category"&&this.pageContext?.categoryName&&(this.contextSuggestions=[{label:window.__translations?.latest_news||"Son xəbərlər",query:`${this.pageContext.categoryName} kateqoriyasında son xəbərlər`}])},copyToClipboard(e){const s=e.replace(/<br\s*\/?>/gi,`
7`).replace(/<[^>]*>/g,"");navigator.clipboard.writeText(s).then(()=>{const n=document.createElement("div");n.className="fixed bottom-24 right-4 px-3 py-1.5 bg-slate-800 dark:bg-slate-200 text-white dark:text-slate-800 text-xs rounded-lg shadow-lg z-[70] transition-opacity duration-300",n.textContent=window.__translations?.copied||"Kopyalandı",document.body.appendChild(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>document.body.removeChild(n),300)},1500)}).catch(n=>{console.error("Copy failed:",n)})},async loadChatbotConfig(){try{if(window.__chatbotConfig){this.welcomeMessage=window.__chatbotConfig.welcome||"",this.quickActions=window.__chatbotConfig.quick_actions||[];return}window._chatbotConfigPromise||(window._chatbotConfigPromise=$("/api/ai/chatbot/config").then(s=>s.json()).catch(s=>(console.error("Failed to load chatbot config:",s),null)));const e=await window._chatbotConfigPromise;e&&(this.welcomeMessage=e.welcome||"",this.quickActions=e.quick_actions||[])}catch(e){console.error("Failed to load chatbot config:",e)}},sendQuickAction(e){this.newsQuestion=e,this.trackEvent("ai_quick_action",{assistant_type:"chatbot",action_label:e.substring(0,50)}),this.sendNewsMessage()},escapeHtml(e){const s=document.createElement("div");return s.textContent=e,s.innerHTML},isValidUrl(e){try{const s=new URL(e,window.location.origin);return["http:","https:"].includes(s.protocol)}catch{return!1}},formatMessage(e){return e?(e=this.escapeHtml(e),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(s,n,a)=>this.isValidUrl(a)?`<a href="${this.escapeHtml(a)}" target="_blank" rel="noopener noreferrer" class="text-emerald-600 dark:text-emerald-400 hover:underline">${n}</a>`:n),e=e.replace(/\n/g,"<br>"),e):""},scrollToBottom(){this.$nextTick(()=>{const e=this.$refs.newsMessages;e&&(e.scrollTop=e.scrollHeight)})},normalizeAzChars(e){return e?e.toLowerCase().replace(/ə/g,"e").replace(/ü/g,"u").replace(/ö/g,"o").replace(/ş/g,"s").replace(/ç/g,"c").replace(/ğ/g,"g").replace(/ı/g,"i"):""}
7,async sendNewsMessage(){if(!this.newsQuestion.trim()||this.newsLoading)return;let e=this.newsQuestion.trim();if(this.newsQuestion="",this.trackEvent("chatbot_message_sent",{assistant_type:"chatbot",message_length:e.length,page_context:this.pageContext?.type||"unknown"}),this.pageContext?.type==="post"&&this.pageContext?.postId){const a=["xulase","qisa","ozet","nedir","haqqinda","summarize","summary","umumillesdir","umumilasdir","umumilesdirmek","umulesdir"],u=this.normalizeAzChars(e),d=a.some(h=>u.includes(h));if(console.log("[AI Widget] Summarize check:",{pageContext:this.pageContext,original:e,normalized:u,isSummarizeIntent:d}),d&&!e.includes("[SUMMARIZE:")&&!e.includes("[RELATED:")){let h=this.pageContext.postTitle;if(!h){const g=document.querySelector("article h1, .post-title, h1.text-2xl, h1.font-bold"),m=document.querySelector('meta[property="og:title"]');h=g?.textContent?.trim()||m?.content||""}e=h?`[SUMMARIZE:${this.pageContext.postId}] "${h}" - ${e}`:`[SUMMARIZE:${this.pageContext.postId}] ${e}`}}const s=e.replace(/\[SUMMARIZE:\d+\]\s*"[^"]*"\s*-\s*/,"").replace(/\[RELATED:\d+\]\s*"[^"]*"\s*-\s*/,"");this.newsMessages.push({role:"user",content:s}),this.scrollToBottom(),this.newsLoading=!0,this.showContextTooltip=!1;const n=this.newsMessages.length;this.newsMessages.push({role:"assistant",content:"",fromCache:!1,fromSimple:!1,isStreaming:!0});try{const a=new URLSearchParams({message:e,session_id:this.sessionId||""}),u=Date.now();if(this.eventSource){try{this.eventSource.close()}catch{}this.eventSource=null}this.eventSource=new EventSource(`/api/ai/chatbot/chat-stream?${a.toString()}`);let d="";this.eventSource.onmessage=h=>{if(h.data==="[DONE]"){this.eventSource.close(),this.eventSource=null,this.newsMessages[n].isStreaming=!1,this.newsLoading=!1,this.trackEvent("ai_response_completed",{assistant_type:"chatbot",response_time_ms:Date.now()-u,response_length:d.length,message_length:e.length,page_context:this.pageContext?.type||"unknown",from_cache:!!this.newsMessages[n].fromCache,from_simple:!!this.newsMessages[n].fromSimple}),this.scrollToBottom();return}try{const g=JSON.parse(h.data);if(g.error){this.newsMessages[n].content=g.message||window.__translations?.error_occurred||"Xəta baş verdi",this.newsMessages[n].isStreaming=!1,this.eventSource.close(),this.eventSource=null,this.newsLoading=!1,this.trackEvent("ai_response_error",{assistant_type:"chatbot",response_time_ms:Date.now()-u,message_length:e.length,page_context:this.pageContext?.type||"unknown",error_type:"stream_payload_error"});return}g.chunk&&(d+=g.chunk,this.newsMessages[n].content=d,this.scrollToBottom()),g.session_id&&(this.sessionId=g.session_id)}catch(g){const m=h.data?.slice(0,50);m&&/^[\s]*[\{\[]/.test(m)&&console.warn("[aiAssistant] EventSource JSON parse failed:",g.message,m)}},this.eventSource.onerror=()=>{if(this.eventSource){try{this.eventSource.close()}catch{}this.eventSource=null}d||(this.newsMessages[n].content=window.__translations?.service_unavailable||"Xidmət müvəqqəti əlçatmazdır",this.trackEvent("ai_response_error",{assistant_type:"chatbot",response_time_ms:Date.now()-u,message_length:e.length,page_context:this.pageContext?.type||"unknown",error_type:"stream_connection_error"})),this.newsMessages[n].isStreaming=!1,this.newsLoading=!1,this.scrollToBottom()}}catch{this.newsMessages[n].content=window.__translations?.service_unavailable||"Xidmət müvəqqəti əlçatmazdır",this.newsMessages[n].isStreaming=!1,this.newsLoading=!1,this.trackEvent("ai_response_error",{assistant_type:"chatbot",message_length:e.length,page_context:this.pageContext?.type||"unknown",error_type:"request_setup_error"}),this.scrollToBottom()}},async checkSpelling(){if(!(!this.spellingWord.trim()||this.spellingLoading)){this.trackEvent("mirza_spelling_check",{assistant_type:"spelling",word_length:this.spellingWord.trim().length}),this.spellingLoading=!0,this.spellingResult=null,this.spellingError=null;try{const s=await(await $("/api/ai/spelling/check",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content||""},body:JSON.stringify({word:this.spellingWord.trim()})})).json();s.success?this.spellingResult=s:this.spellingError=s.error||window.__translations?.error_occurred||"Xəta baş verdi"}catch{this.spellingError=window.__translations?.service_unavailable||"Xidmət müvəqqəti əlçatmazdır"}finally{this.spellingLoading=!1}}},async submitLegalQuery(){if(this.legalQuestion.trim().length<5||this.legalLoading)return;const e=this.legalQuestion.trim();this.trackEvent("eqanun_legal_query",{assistant_type:"legal",query_length:e.length}),this.legalQuestion="",this.legalLoading=!0,this.legalAnswer=null,this.legalError=null,this.legalExpanded=!1;try{const n=await(await $("/api/ai/legal/query",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content||""},body:JSON.stringify({question:e})})).json();n.success&&n.answer?this.legalAnswer=n.answer:this.legalError=n.error||window.__translations?.no_answer||"Cavab tapılmadı. Zəhmət olmasa sualı dəqiqləşdirin."}catch{this.legalError=window.__translations?.service_unavailable||"Xidmət müvəqqəti əlçatmazdır"}finally{this.legalLoading=!1}}}));y.data("searchSuggest",()=>({query:"",results:[],active:-1,open:!1,_timer:null,_seq:0,onInput(t){const e=t&&t.target||this.$refs.input;if(this.query=(e&&e.value||"").trim(),this.active=-1,clearTimeout(this._timer),this.query.length<2){this.results=[],this.open=!1;return}this._timer=setTimeout(()=>this.fetch(),150)},onFocus(){this.results.length&&(this.open=!0)},async fetch(){const t=++this._seq;try{const e=document.documentElement.lang||"az",n=await(await $("/api/search/suggest?q="+encodeURIComponent(this.query)+"&locale="+encodeURIComponent(e))).json();if(t!==this._seq)return;this.results=Array.isArray(n.posts)?n.posts:[],this.open=this.results.length>0}catch{this.results=[],this.open=!1}},onKey(t){!this.open||!this.results.length||(t.key==="ArrowDown"?(t.preventDefault(),this.active=(this.active+1)%this.results.length):t.key==="ArrowUp"?(t.preventDefault(),this.active=(this.active-1+this.results.length)%this.results.length):t.key==="Enter"&&this.active>=0?(t.preventDefault(),this.go(this.results[this.active])):t.key==="Escape"&&this.close())},go(t){!t||!Je(t.url)||(typeof window.gtag<"u"&&window.gtag("event","search_suggest_click",{event_category:"engagement",search_term:this.query}),window.location.href=t.url)},close(){this.open=!1,this.active=-1},activeId(t){return this.active>=0?t+"-"+this.active:null}}));y.start();document.addEventListener("DOMContentLoaded",()=>{y.store("darkMode").init(),y.store("reader").init(),Ve()});
7"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(()=>{})});function ae(t,e={}){typeof window.gtag>"u"||window.gtag("event",t,e)}function oe(t){const s=t.closest("section")?.querySelector("h1, h2, h3")?.textContent?.trim()||"",n=Array.from(document.querySelectorAll('[data-analytics-card="article"]')).indexOf(t);return{event_category:"content_discovery",post_id:t.dataset.postId||"",article_title:t.dataset.articleTitle||"",category_name:t.dataset.categoryName||"",publish_date:t.dataset.publishDate||"",article_age_bucket:t.dataset.articleAgeBucket||"unknown",content_type:t.dataset.contentType||"article",source_type:t.dataset.sourceType||"unknown",is_breaking:t.dataset.isBreaking==="1",is_live:t.dataset.isLive==="1",feed_section:s.substring(0,80),feed_position:n>=0?n+1:null,card_variant:t.dataset.cardVariant||"",page_path:window.location.pathname}}function Ve(){const t=Array.from(document.querySelectorAll('[data-analytics-card="article"]'));if(t.length>0&&"IntersectionObserver"in window){const e=new WeakSet,s=new IntersectionObserver(n=>{n.forEach(a=>{!a.isIntersecting||a.intersectionRatio<.5||e.has(a.target)||(e.add(a.target),ae("feed_card_impression",oe(a.target)),s.unobserve(a.target))})},{threshold:[.5]});t.forEach(n=>s.observe(n))}document.addEventListener("click",e=>{const s=e.target.closest('[data-analytics-card="article"] a[href]');if(!s)return;const n=s.closest('[data-analytics-card="article"]');ae("feed_card_click",{...oe(n),link_url:s.href}),window.location.pathname.includes("/search")&&ae("search_result_click",{...oe(n),event_category:"search",search_term:new URLSearchParams(window.location.search).get("search")||new URLSearchParams(window.location.search).get("q")||"",link_url:s.href})},{capture:!0})}const Ke=()=>{if(!("connection"in navigator))return!0;const t=navigator.connection;return!(t.saveData||t.effectiveType&&t.effectiveType.includes("2g"))},Te=()=>{if(!Ke())return;const t=document.querySelector('link[rel="next"], a[rel="next"]');if(!t)return;const e=t.getAttribute("href");if(!e)return;const s=new URL(e,window.location.origin);if(s.origin!==window.location.origin||document.querySelector(`link[rel="prefetch"][href="${s.href}"]`))return;const n=document.createElement("link");n.rel="prefetch",n.as="document",n.href=s.href,document.head.appendChild(n)};"requestIdleCallback"in window?window.requestIdleCallback(Te,{timeout:2e3}):window.setTimeout(Te,1500);

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.