<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://endergokcimen.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://endergokcimen.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://endergokcimen.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://endergokcimen.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://endergokcimen.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
<script>
/* MPVA inline fallback (DEV) */
window.mpva = {"endpoint":"\/wp-json\/mpva\/v1\/hit","post_id":null,"is_product":0,"track":true};
(function(){
  if (!window.mpva || mpva.track === false) return;
  var ep = (mpva.endpoint && mpva.endpoint.charAt(0) === '/') ? (location.origin + mpva.endpoint) : mpva.endpoint;
  // basit visitor id
  var vid = localStorage.getItem('mpva_vid');
  if (!vid) { vid = (Math.random().toString(16).slice(2) + '-' + Date.now()); localStorage.setItem('mpva_vid', vid); }
  function device(){ var ua = navigator.userAgent||''; if (/tablet|ipad/i.test(ua)) return 'tablet'; if (/mobi|android/i.test(ua)) return 'mobile'; return 'desktop'; }
  var payload = { url: location.pathname + location.search, post_id: mpva.post_id || null, ref: document.referrer||'', visitor: vid, device: device(), is_product: !!mpva.is_product, status: 200 };
  try {
    var blob = new Blob([JSON.stringify(payload)], {type:'application/json'});
    if (navigator.sendBeacon) { navigator.sendBeacon(ep, blob); }
    else { fetch(ep, {method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify(payload)}); }
  } catch(e){}
})();
</script><script>
/* MPVA Live Sessions - ayrı modül */
(function(){
  if (window.MPVA_LIVE_INIT) return;
  window.MPVA_LIVE_INIT = true;
  const cfg = {"endpoint":"https:\/\/endergokcimen.com\/wp-json\/mpva\/v1\/live\/touch","post_id":0,"timeout_minutes":30,"ping_seconds":60};
  if (!cfg || !cfg.endpoint) return;

  const now = Date.now();
  const rand = () => (window.crypto && crypto.randomUUID) ? crypto.randomUUID() : (Math.random().toString(36).slice(2) + '-' + Date.now());
  let visitor = localStorage.getItem('mpva_vid');
  if (!visitor) { visitor = rand(); localStorage.setItem('mpva_vid', visitor); }

  const timeoutMs = Math.max(5, Number(cfg.timeout_minutes || 30)) * 60 * 1000;
  let sid = localStorage.getItem('mpva_live_sid');
  function ensureSession(allowCreate = true){
    const ts = Date.now();
    const storedSid = localStorage.getItem('mpva_live_sid');
    const storedTs  = parseInt(localStorage.getItem('mpva_live_sid_ts') || '0', 10);
    let created = false;
    if (storedSid && storedTs && (ts - storedTs) <= timeoutMs) {
      sid = storedSid; // başka sekmede güncel bir oturum başladıysa ona katıl
    } else {
      if (!allowCreate) return {valid:false, created:false};
      sid = rand();
      created = true;
      localStorage.setItem('mpva_live_sid', sid);
    }
    localStorage.setItem('mpva_live_sid_ts', String(ts));
    return {valid:true, created};
  }
  ensureSession(true);

  let tab = sessionStorage.getItem('mpva_live_tab');
  if (!tab) { tab = rand(); sessionStorage.setItem('mpva_live_tab', tab); }

  function payload(eventName){
    return {
      visitor: visitor,
      session: sid,
      tab: tab,
      event: eventName || 'ping',
      url: location.pathname + location.search,
      post_id: cfg.post_id || 0,
      ref: document.referrer || ''
    };
  }
  function send(eventName, preferBeacon){
    const state = ensureSession(eventName !== 'leave');
    if (!state.valid) return;
    if (state.created && eventName === 'ping') eventName = 'pageview';
    const body = JSON.stringify(payload(eventName));
    try {
      if (preferBeacon && navigator.sendBeacon) {
        return navigator.sendBeacon(cfg.endpoint, new Blob([body], {type:'application/json'}));
      }
      fetch(cfg.endpoint, {method:'POST', headers:{'Content-Type':'application/json'}, body, credentials:'same-origin', keepalive:true, cache:'no-store'}).catch(()=>{});
    } catch(e) {}
  }

  send('pageview', false);
  const t = setInterval(()=>{
    if (document.visibilityState !== 'hidden') send('ping', false);
  }, Math.max(30, Number(cfg.ping_seconds || 60)) * 1000);

  document.addEventListener('visibilitychange', ()=>{
    if (document.visibilityState === 'visible') send('ping', false);
  });
  window.addEventListener('pagehide', ()=>{ send('leave', true); clearInterval(t); }, {once:true});
})();
</script>