1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jspdf.es.min-Dv1_yVTl.js","assets/index-BotW_F4D.js","assets/vendor-ui-Dew8CZxq.js","assets/vendor-supabase-BOCL3uOH.js","assets/vendor-charts-Da-j9H4-.js","assets/vendor-editor-Ct-iNwJc.js","assets/vendor-query-Cjd1QUxP.js","assets/vendor-router-DljXtjbj.js","assets/index-CzveX8rT.css"])))=>i.map(i=>d[i]); 2import{j as e,r as N}from"./vendor-ui-Dew8CZxq.js";import{c as ke,d as oe,bp as V,U as Je,bx as he,bC as O,ag as Ze,b1 as q,b2 as T,e as Ne,a as M,aU as ve,be as ae,bf as te,ao as be,ap as fe,aq as ye,B as U,r as Xe,ac as ea,s as b,aA as aa,ar as _e,aO as le,bD as je,bE as ta,bw as ra,c8 as sa,b8 as na,o as ia,N as la,O as oa,Q as Z,V as X,a$ as xe,aP as ca,bv as da,a2 as ma,a3 as ua,W as xa,aR as ga}from"./index-BotW_F4D.js";import{a as F,u as pa}from"./vendor-query-Cjd1QUxP.js";import{F as $e}from"./flame-CEt1bfac.js";import{T as ha}from"./trending-up-34neRlqp.js";import{C as Le}from"./crown-DRetnf1X.js";import{G as ba}from"./graduation-cap-BJxAyOAC.js";import{g as fa}from"./pageSeoTranslations-Cxu-TCQd.js";import{S as ya}from"./ServiceLinksAndFaq-yKoJLApq.js";import{S as ja}from"./SidebarLayout-BtOnFKiL.js";import{Z as we}from"./zap-ORJ-40tj.js";import"./vendor-supabase-BOCL3uOH.js";import"./vendor-charts-Da-j9H4-.js";import"./vendor-editor-Ct-iNwJc.js";import"./vendor-router-DljXtjbj.js";import"./link-vi_mW7Cb.js";import"./external-link-DtpSMSIO.js";/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const Be=ke("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/** 8 * @license lucide-react v0.462.0 - ISC 9 * 10 * This source code is licensed under the ISC license. 11 * See the LICENSE file in the root directory of this source tree. 12 */const wa=ke("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 13 * @license lucide-react v0.462.0 - ISC 14 * 15 * This source code is licensed under the ISC license. 16 * See the LICENSE file in the root directory of this source tree. 17 */const ze=ke("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),Re={en:{sectionTitle:"Circassian Knowledge Challenge",sectionSubtitle:"Test and deepen your knowledge of Circassian history, culture, and heritage through competitive quizzes designed by historians and researchers",card1Title:"How It Works",card1Desc:"Each challenge presents 15 advanced questions from verified historical and cultural sources. Answer within the time limit, and your score is recorded on the global leaderboard. You have 2 attempts per month â make each one count!",card2Title:"Questions from Trusted Sources",card2Desc:'Every question is crafted from peer-reviewed research, published books like "The Circassian Genocide" by Walter Richmond, Ottoman and Russian archives, and academic studies on Circassian history, tribes, language, and diaspora.',card3Title:"Impact Among Circassians",card3Desc:"This challenge connects Circassians worldwide through shared knowledge. Whether in Turkey, Jordan, Syria, Israel, the USA, Europe, Asia, or the homeland â competing together strengthens our collective identity and keeps our heritage alive for future generations.",card4Title:"Monthly Competition Cycle",card4Desc:"Each month brings fresh competition. With 2 attempts per month, participants can improve their scores while new questions keep the challenge engaging. Top scorers earn recognition on the global leaderboard visible to the entire community.",card5Title:"Earn Badges & Recognition",card5Desc:'Achieve milestones and earn exclusive badges: "Perfect Score" for 100% accuracy, "Speed Demon" for fast completion, "First Victory" for your first passing score, and "Weekly Champion" for topping the leaderboard.',card6Title:"Learn While Competing",card6Desc:"After each answer, you receive detailed explanations with historical context and source citations. Even incorrect answers become learning opportunities â transforming competition into education about the Russo-Circassian War, tribal genealogy, and cultural traditions."},ar:{sectionTitle:"ØªØØ¯Ù اÙÙ Ø¹Ø±ÙØ© Ø§ÙØ´Ø±ÙØ³ÙØ©",sectionSubtitle:"اختبر ÙØ¹Ù ÙÙ Ù Ø¹Ø±ÙØªÙ Ø¨Ø§ÙØªØ§Ø±ÙØ® ÙØ§ÙØ«ÙØ§ÙØ© ÙØ§Ùتراث Ø§ÙØ´Ø±ÙØ³Ù Ù Ù Ø®ÙØ§Ù Ù Ø³Ø§Ø¨ÙØ§Øª ØªÙØ§ÙØ³ÙØ© ØµÙ Ù ÙØ§ ٠ؤرخÙÙ ÙØ¨Ø§ØØ«ÙÙ",card1Title:"ÙÙÙ ÙØ¹Ù Ù Ø§ÙØªØØ¯Ù",card1Desc:"ÙÙØ¯Ù ÙÙ ØªØØ¯Ù 15 Ø³Ø¤Ø§ÙØ§Ù Ù ØªÙØ¯Ù ا٠٠٠٠صادر ØªØ§Ø±ÙØ®ÙØ© ÙØ«ÙاÙÙØ© Ù ÙØ«ÙÙØ©. أجب Ø®ÙØ§Ù اÙÙÙØª اÙÙ ØØ¯Ø¯ ÙØ³ÙÙØ³Ø¬Ù ÙØªÙجت٠ÙÙ ÙÙØØ© اÙ٠تصدرÙÙ Ø§ÙØ¹Ø§ÙÙ ÙØ©. ÙØ¯ÙÙ Ù ØØ§ÙÙØªØ§Ù Ø´ÙØ±ÙØ§Ù â Ø§Ø¬Ø¹Ù ÙÙ ÙØ§ØØ¯Ø© ØªØØ³Ø¨!",card2Title:"Ø£Ø³Ø¦ÙØ© ٠٠٠صادر Ù ÙØ«ÙÙØ©",card2Desc:'Ù٠سؤا٠٠صاغ Ù Ù Ø£Ø¨ØØ§Ø« Ù ØÙÙÙ Ø© ÙÙØªØ¨ Ù ÙØ´Ùرة ٠ث٠"Ø§ÙØ¥Ø¨Ø§Ø¯Ø© Ø§ÙØ´Ø±ÙØ³ÙØ©" ÙÙØ§Ùتر Ø±ÙØªØ´Ù ÙÙØ¯Ø ÙØ§ÙأرشÙÙØ§Øª Ø§ÙØ¹Ø«Ù اÙÙØ© ÙØ§ÙØ±ÙØ³ÙØ©Ø ÙØ¯Ø±Ø§Ø³Ø§Øª Ø£ÙØ§Ø¯ÙÙ ÙØ© Ø¹Ù Ø§ÙØªØ§Ø±ÙØ® ÙØ§ÙÙØ¨Ø§Ø¦Ù ÙØ§ÙÙØºØ© ÙØ§ÙÙ ÙØ¬Ø± Ø§ÙØ´Ø±ÙسÙ.',card3Title:"Ø§ÙØ£Ø«Ø± بÙÙ Ø§ÙØ´Ø±Ùس",card3Desc:"ÙØ±Ø¨Ø· Ù
17ذا Ø§ÙØªØØ¯Ù Ø§ÙØ´Ø±Ùس ØÙÙ Ø§ÙØ¹Ø§ÙÙ
Ù
Ù Ø®ÙØ§Ù اÙÙ
Ø¹Ø±ÙØ© اÙÙ
Ø´ØªØ±ÙØ©. Ø³ÙØ§Ø¡ ÙÙØª Ù٠ترÙÙØ§ Ø£Ù Ø§ÙØ£Ø±Ø¯Ù Ø£Ù Ø³ÙØ±Ùا أ٠إسرائÙ٠أ٠أÙ
رÙÙØ§ Ø£Ù Ø£ÙØ±Ùبا Ø£Ù Ø¢Ø³ÙØ§ أ٠اÙÙØ·Ù â Ø§ÙØªÙØ§Ùس Ù
عا٠ÙÙÙÙÙ ÙÙÙØªÙا Ø§ÙØ¬Ù
Ø§Ø¹ÙØ© ÙÙØØ§ÙØ¸ عÙÙ ØªØ±Ø§Ø«ÙØ§ ÙÙØ£Ø¬Ùا٠اÙÙØ§Ø¯Ù
Ø©.",card4Title:"Ø¯ÙØ±Ø© اÙÙ
Ø³Ø§Ø¨ÙØ© Ø§ÙØ´ÙØ±ÙØ©",card4Desc:"ÙÙ Ø´ÙØ± ÙØ£ØªÙ بÙ
ÙØ§Ùسة Ø¬Ø¯ÙØ¯Ø©. Ù
ع Ù
ØØ§ÙÙØªÙÙ Ø´ÙØ±ÙØ§ÙØ ÙÙ
ÙÙ ÙÙÙ
شارÙÙÙ ØªØØ³ÙÙ ÙØªØ§Ø¦Ø¬ÙÙ
بÙÙÙ
ا تبÙÙ Ø§ÙØ£Ø³Ø¦ÙØ© Ø§ÙØ¬Ø¯Ùدة Ø§ÙØªØØ¯Ù Ø´ÙÙØ§Ù. ÙØØµÙ Ø£ÙØ¶Ù اÙÙ
تسابÙÙ٠عÙÙ ØªÙØ¯Ùر ÙÙ ÙÙØØ© اÙÙ
تصدرÙÙ Ø§ÙØ¹Ø§ÙÙ
ÙØ©.",card5Title:"Ø§ÙØ³Ø¨ شارات ÙØªÙØ¯ÙØ±",card5Desc:'ØÙÙ Ø¥ÙØ¬Ø§Ø²Ø§Øª ÙØ§Ùسب شارات ØØµØ±ÙØ©: "ÙØªÙجة ÙØ§Ù
ÙØ©" ÙØ¯ÙØ© 100%Ø "Ø³Ø±ÙØ¹ Ø§ÙØ¨Ø±Ù" ÙÙØ¥Ùجاز Ø§ÙØ³Ø±ÙØ¹Ø "Ø£ÙÙ Ø§ÙØªØµØ§Ø±" ÙØ£ÙÙ ÙØ¬Ø§ØØ Ù"Ø¨Ø·Ù Ø§ÙØ£Ø³Ø¨Ùع" ÙØªØµØ¯Ø± ÙÙØØ© اÙÙ
تصدرÙÙ.',card6Title:"تعÙÙÙ
Ø£Ø«ÙØ§Ø¡ اÙÙ
ÙØ§Ùسة",card6Desc:"بعد ÙÙ Ø¥Ø¬Ø§Ø¨Ø©Ø ØªØªÙÙÙ Ø´Ø±ØØ§Ù Ù
ÙØµÙا٠Ù
ع Ø³ÙØ§Ù ØªØ§Ø±ÙØ®Ù ÙØ§Ø³ØªØ´Ùادات باÙÙ
صادر. ØØªÙ Ø§ÙØ¥Ø¬Ø§Ø¨Ø§Øª Ø§ÙØ®Ø§Ø·Ø¦Ø© ØªØµØ¨Ø ÙØ±ØµØ§Ù ÙÙØªØ¹ÙÙ
â Ù
ØÙÙØ©Ù اÙÙ
ÙØ§Ùسة Ø¥Ù٠تثÙÙÙ ØÙÙ Ø§ÙØØ±Ø¨ Ø§ÙØ±ÙØ³ÙØ© Ø§ÙØ´Ø±ÙØ³ÙØ© ÙØ£Ùساب اÙÙØ¨Ø§Ø¦Ù ÙØ§ÙØªÙØ§ÙÙØ¯ Ø§ÙØ«ÙاÙÙØ©."},tr:{sectionTitle:"Ãerkes Bilgi YarıÅması",sectionSubtitle:"Tarihçiler ve araÅtırmacılar tarafından tasarlanan yarıÅmalarla Ãerkes tarihi, kültürü ve mirası bilginizi test edin ve derinleÅtirin",card1Title:"Nasıl ÃalıÅır",card1Desc:"Her yarıÅma doÄrulanmıŠtarihi ve kültürel kaynaklardan 15 ileri düzey soru sunar. Süre içinde cevaplayın ve puanınız küresel sıralamaya kaydedilsin. Ayda 2 deneme hakkınız var â her birini deÄerlendirin!",card2Title:"Güvenilir Kaynaklardan Sorular",card2Desc:`Her soru hakemli araÅtırmalardan, Walter Richmond'ın "Ãerkes Soykırımı" gibi yayınlanmıŠkitaplardan, Osmanlı ve Rus arÅivlerinden ve Ãerkes tarihi üzerine akademik çalıÅmalardan hazırlanmıÅtır.`,card3Title:"Ãerkesler Arasında Etkisi",card3Desc:"Bu yarıÅma dünya genelindeki Ãerkesleri ortak bilgi aracılıÄıyla birbirine baÄlar. Türkiye, Ãrdün, Suriye, İsrail, ABD, Avrupa, Asya ya da anavatan â birlikte yarıÅmak kolektif kimliÄimizi güçlendirir.",card4Title:"Aylık YarıÅma Döngüsü",card4Desc:"Her ay yeni yarıÅma getirir. Ayda 2 denemeyle katılımcılar puanlarını iyileÅtirebilir. En iyi puanlılar tüm topluluk tarafından görülebilen küresel sıralamada tanınır.",card5Title:"Rozetler ve Tanınma Kazanın",card5Desc:'Kilometre taÅlarına ulaÅın ve özel rozetler kazanın: %100 doÄruluk için "Mükemmel Puan", hızlı tamamlama için "Hız Åeytanı", ilk geçme puanı için "İlk Zafer".',card6Title:"YarıÅırken ÃÄrenin",card6Desc:"Her cevaptan sonra tarihi baÄlam ve kaynak alıntılarıyla ayrıntılı açıklamalar alırsınız. YanlıŠcevaplar bile öÄrenme fırsatlarına dönüÅür â yarıÅmayı eÄitime dönüÅtürür."},ru:{sectionTitle:"ЧеÑкеÑÑкий инÑеллекÑÑалÑнÑй вÑзов",sectionSubtitle:"ÐÑовеÑÑÑе и ÑглÑбиÑе Ð·Ð½Ð°Ð½Ð¸Ñ ÑеÑкеÑÑкой иÑÑоÑии, кÑлÑÑÑÑÑ Ð¸ наÑÐ»ÐµÐ´Ð¸Ñ ÑеÑез конкÑÑÑнÑе викÑоÑинÑ, ÑазÑабоÑаннÑе иÑÑоÑиками",card1Title:"Ðак ÑÑо ÑабоÑаеÑ",card1Desc:"ÐаждÑй вÑзов ÑодеÑÐ¶Ð¸Ñ 15 пÑодвинÑÑÑÑ
вопÑоÑов из пÑовеÑеннÑÑ
иÑÑоÑиÑеÑкиÑ
и кÑлÑÑÑÑнÑÑ
иÑÑоÑников. ÐÑвеÑайÑе в оÑведÑнное вÑÐµÐ¼Ñ â Ð²Ð°Ñ ÑезÑлÑÑÐ°Ñ Ð¿Ð¾Ð¿Ð°Ð´ÑÑ Ð² глобалÑнÑй ÑейÑинг. У Ð²Ð°Ñ 2 попÑÑки в меÑÑÑ â иÑполÑзÑйÑе каждÑÑ!",card2Title:"ÐопÑоÑÑ Ð¸Ð· надÑжнÑÑ
иÑÑоÑников",card2Desc:"ÐаждÑй вопÑÐ¾Ñ ÑоÑÑавлен на оÑнове ÑеÑензиÑÑемÑÑ
иÑÑледований, книг вÑоде «ЧеÑкеÑÑкий геноÑид» УолÑеÑа РиÑмонда, оÑманÑкиÑ
и ÑоÑÑийÑкиÑ
аÑÑ
ивов и академиÑеÑкиÑ
ÑÐ°Ð±Ð¾Ñ Ð¿Ð¾ иÑÑоÑии ÑеÑкеÑов.",card3Title:"ÐлиÑние ÑÑеди ÑеÑкеÑов",card3Desc:"ÐÑÐ¾Ñ Ð²Ñзов обÑединÑÐµÑ ÑеÑкеÑов по вÑÐµÐ¼Ñ Ð¼Ð¸ÑÑ ÑеÑез обÑие знаниÑ. ÐÑÐ´Ñ Ñо в ТÑÑÑии, ÐоÑдании, СиÑии, ÐзÑаиле, СШÐ, ÐвÑопе, Ðзии или на Ñодине â ÑовмеÑÑное ÑоÑевнование ÑкÑеплÑÐµÑ Ð½Ð°ÑÑ ÐºÐ¾Ð»Ð»ÐµÐºÑивнÑÑ ÑамобÑÑноÑÑÑ.",card4Title:"ÐжемеÑÑÑнÑй Ñикл",card4Desc:"ÐаждÑй меÑÑÑ â новое ÑоÑевнование. С 2 попÑÑками ÑÑаÑÑники могÑÑ ÑлÑÑÑиÑÑ Ñвои ÑезÑлÑÑаÑÑ. ÐÑÑÑие попадаÑÑ Ð² глобаÐ
17»ÑнÑй ÑейÑинг, видимÑй вÑÐµÐ¼Ñ ÑообÑеÑÑвÑ.",card5Title:"ÐнаÑки и пÑизнание",card5Desc:"ÐоÑÑигайÑе веÑ
и полÑÑайÑе ÑкÑклÑзивнÑе знаÑки: «ÐдеалÑнÑй ÑезÑлÑÑаÑ» за 100% ÑоÑноÑÑÑ, «ÐолниеноÑнÑй» за бÑÑÑÑое пÑоÑ
ождение, «ÐеÑÐ²Ð°Ñ Ð¿Ð¾Ð±ÐµÐ´Ð°Â» за пеÑвÑй пÑоÑ
одной балл.",card6Title:"УÑиÑеÑÑ ÑоÑевнÑÑÑÑ",card6Desc:"ÐоÑле каждого оÑвеÑа Ð²Ñ Ð¿Ð¾Ð»ÑÑаеÑе подÑобнÑе поÑÑÐ½ÐµÐ½Ð¸Ñ Ñ Ð¸ÑÑоÑиÑеÑким конÑекÑÑом и ÑÑÑлками на иÑÑоÑники. Ðаже непÑавилÑнÑе оÑвеÑÑ ÑÑановÑÑÑÑ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑÑ Ð´Ð»Ñ Ð¾Ð±ÑÑениÑ."},he:{sectionTitle:"×ת×ר ××××¢ ×צ'רקס×",sectionSubtitle:"×××§× ×××¢×××§× ×ת ××××¢ ש××× ×××ס××ר××, תר××ת ×××רשת צ'רקס×ת ××¨× ××××× ×× ×ª×ר×ת××× ×©×¢×צ×× ×¢× ××× ××ס××ר××× ××",card1Title:"××× ×× ×¢×××",card1Desc:"×× ×ת×ר ×צ×× 15 ש×××ת ×תק×××ת ×××§×ר×ת ××××ת××. ×¢× × ×ª×× ××××ת ×××× ××צ××× ×©××× ×××¨×©× ××××ת ××××××××. ×ש ××× 2 × ×ס××× ×ת ××××ש â × ×¦×× ×× ×××!",card2Title:"ש×××ת ×××§×ר×ת ×××× ××",card2Desc:`×× ×©××× × ××¦×¨× ×××קר×× ×©×¤××××, ספר×× ××× "×¨×¦× ××¢× ×צ'רקס×" ××ת ××××ר ר×צ'××× ×, ×ר×××× ×× ×¢×ת'××× ××× ×ר×ס××× ×××קר×× ××§×××××.`,card3Title:"×××©×¤×¢× ××§×¨× ×צ'רקס××",card3Desc:`××ת×ר ×××ר צ'רקס×× ×ר××× ××¢××× ×××צע×ת ×××¢ ×ש×תף. ××× ×× ×××רק××, ×ר××, ס×ר××, ×שר××, ×ר×"×, ××ר×פ×, ×ס×× ×× ×××××ת â ת×ר×ת ×ש×תפת ×××קת ×ת ××××ת ××§×××§××××ת.`,card4Title:"××××ר ת×ר×ת ×××ש×",card4Desc:"×× ×××ש ×××× ×ª×ר×ת ××ש×. ×¢× 2 × ×ס××× ×ת ××××ש, ×שתתפ×× ×××××× ×שפר ×ת ×צ××× ××. ×××××××× ××§×××× ×××¨× ××××ת ×××××××× ×××××××ת.",card5Title:"צ××¨× ×ª××× ×××ר×",card5Desc:'×ש××× ××× × ××¨× ×צ××¨× ×ª×××: "צ××× ××ש××" ×-100% ××××§, "×©× ×××ר×ת" ××ש××× ×××ר×, "× ×צ××× ×¨×ש××" ×צ××× ×¢××ר ר×ש××.',card6Title:"×××× ×ª×× ××× ×ª×ר×ת",card6Desc:"×××¨× ×× ×ª×©××× ××§×××× ×ס×ר×× ×פ×ר××× ×¢× ×קשר ××ס×××¨× ×צ××××× ××§×ר×ת. ×× ×ª×©×××ת ש××××ת ××פ××ת ×××××× ×××ת ×××××."},ady:{sectionTitle:"ÐдÑÐ³Ñ ÑIÑнÑгÑÑ Ð·ÑнÑкÑокÑÑ",sectionSubtitle:"ТаÑиÑ
ÑлÑжÑÑ
Ñм ÑкIи кÑÑÑ
ÑÑакIоÑ
Ñм зÑÑ
агÑÑÑÑÑагÑÑ Ð·ÑнÑкÑокÑÑÑ
ÑмкIÑ Ð°Ð´ÑÐ³Ñ ÑаÑиÑ
ÑÑм, кÑлÑÑÑÑÑм ÑкIи Ñ
абзÑм ÑÑIÑнÑгÑÑ ÑегÑÑÑнÑÑÑ",card1Title:"ÐÑÑÑлажÑÑÑÑÑ",card1Desc:"ÐÑнÑкÑокÑÑ Ð¿ÑпÑÑ ÑпÑIÑ 15 Ñ
ÑÐ»Ñ ÑаÑиÑ
Ñ ÑкIи кÑлÑÑÑÑÑ ÐºÑÑкIÑапIÑ ÑÑÑпкÑÑÑ
Ñм аÑ
ÑÑ
ÑгÑÑÑ. УаÑ
ÑÑÑм диÑÑÑÑ Ð´Ð¶ÑÑап ÑкIи ÑинÑкÑокÑÑгÑÑ Ð´Ñнаим ÑаÑÑ
Ñ. ÐазÑм ÑIо ÑÑиÑÑнÑÐ³Ñ â пÑпÑÑ ÐºÑагÑÑÑед!",card2Title:"ÐÑÑкIÑапIÑ ÑÑÑпкÑÑÑ
Ñм ÑÑпÑIÑÑ
ÑÑ",card2Desc:"УпÑIÑ Ð¿ÑпÑÑ Ð°ÐºÐ°Ð´ÐµÐ¼Ð¸ÑеÑÐºÑ ÐºÑÑÑ
ÑÑÑнÑгÑÑÑ
Ñм, УолÑÐµÑ Ð Ð¸Ñмонд иÑÑ
ÑлÑÑÑ Â«ÐдÑÐ³Ñ Ð³ÐµÐ½Ð¾ÑидÑÑ», ÐÑмÑн ÑкIи УÑÑÑ Ð°ÑÑ
ивÑ
Ñм аÑ
ÑÑ
ÑгÑÑÑ Ð·ÑÑ
агÑÑÑÑÑагÑ.",card3Title:"ÐдÑгÑÑ
Ñм азÑÑÐ°Ð³Ñ Ð·ÑÑилÑÑÑ",card3Desc:"ÐÑ Ð·ÑнÑкÑокÑÑм дÑнаим ÑÑпÑÑÑÑÑ Ð°Ð´ÑгÑÑ
ÑÑ ÑIÑнÑгÑÑ Ð·ÑÑ
ÑÑÑмкIÑ Ð·ÑÑепÑ
ÑÑ
. ТÑÑкÑеми, ÐоÑданиеми, СиÑиеми, ÐзÑаилми, ÐмеÑикÑми, ÐвÑопÑми, Ðзиеми, Ñ
ÑкÑми â зÑгÑÑÑÑÑ ÑзÑнÑкÑокÑÑнÑÑ ÑилÑÑÐ¿ÐºÑ Ð·ÑÑ
ÑÑIÑкIÑнÑгÑÑ ÐµÐ³ÑÑпÑÑÑ.",card4Title:"ÐÐ°Ð·Ñ Ð·ÑнÑкÑокÑÑ Ñикл",card4Desc:"ÐÐ°Ð·Ñ Ð¿ÑпÑÑ Ð·ÑнÑкÑокÑÑкIÑ ÐºÑеÑ
ÑÑ. ÐазÑм ÑIо ÑÑиÑÑнÑгÑÑкIÑ Ñ
ÑлажÑÑÑ
ÑÑÑм ÑинÑкÑокÑÑгÑÑ Ð½Ð°Ñ
ÑÑÑIÑ Ð°ÑIÑн алÑÑкIÑÑÑ.",card5Title:"ТамÑгÑÑÑ
ÑÑ ÑкIи ÑIÑÑÑIонÑгÑÑ",card5Desc:"ÐÑÑÑ
ÑагÑÑÑ
ÑмкIÑ ÑамÑгÑÑ ÑÑÑ
ÑаÑÑ
ÑÑ ÐºÑагÑаÑ
ÑÑÑ
: «ÐÑкÑокÑÑгÑÑ Ð´ÑгÑÑ Ð´Ñд» пÑоÑÐµÐ½Ñ 100-м пае, «ÐÑÑнкIÑ» â пÑÑнкIÑÑ Ð·ÑÑIоÑ
ÑгÑÑм пае.",card6Title:"УзÑнÑкÑокÑÑÐ·Ñ Ð·ÑгÑаÑIÑ",card6Desc:"ÐжÑÑап пÑпÑÑ ÑÑж ÑаÑиÑ
Ñ ÐºÑÑIоÑÑнÑгÑÑ ÑкIи кÑÑкIÑапIÑ Ð³ÑÑнÑÑагÑÑÑ
ÑÑ ÐºÑÑпÑÑÑаÑÑжÑÑÑ
. ÐжÑÑап мÑÑÑÑÑзÑ
ÑÑи зÑгÑÑÑIÑÐ
17½ÑгÑÑ Ð°Ð¼Ð°Ð»ÑÑ Ð¼ÑÑ
ÑÑ."}},G=[wa,V,Je,he,O,Ze],ka=()=>{const{language:c,isRTL:t}=oe(),n=Re[c]||Re.en,r=[{icon:G[0],title:n.card1Title,desc:n.card1Desc},{icon:G[1],title:n.card2Title,desc:n.card2Desc},{icon:G[2],title:n.card3Title,desc:n.card3Desc},{icon:G[3],title:n.card4Title,desc:n.card4Desc},{icon:G[4],title:n.card5Title,desc:n.card5Desc},{icon:G[5],title:n.card6Title,desc:n.card6Desc}];return e.jsxs("div",{className:"mb-10 pt-6",dir:t?"rtl":"ltr",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-8 mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(V,{className:"w-7 h-7 text-primary"}),e.jsx("h2",{className:"font-serif text-2xl md:text-4xl font-bold text-foreground",children:n.sectionTitle})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl text-sm sm:text-base",children:n.sectionSubtitle})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-5 max-w-7xl mx-auto px-4 sm:px-8",children:r.map((j,f)=>{const R=j.icon;return e.jsx(q,{className:"border-border/50 bg-gradient-to-br from-card to-muted/30 hover:border-primary/30 transition-all duration-300",children:e.jsx(T,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 rounded-xl bg-primary/10 text-primary shrink-0",children:e.jsx(R,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground text-base mb-1.5",children:j.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j.desc})]})]})})},f)})})]})},ee={bronze:{label:"Bronze",labelAr:"برÙÙØ²Ù",icon:"ð¥",color:"text-orange-700",bg:"bg-orange-100 dark:bg-orange-900/30"},silver:{label:"Silver",labelAr:"ÙØ¶Ù",icon:"ð¥",color:"text-gray-500",bg:"bg-gray-100 dark:bg-gray-800/50"},gold:{label:"Gold",labelAr:"Ø°ÙØ¨Ù",icon:"ð¥",color:"text-yellow-600",bg:"bg-yellow-100 dark:bg-yellow-900/30"},diamond:{label:"Diamond",labelAr:"Ù
اسÙ",icon:"ð",color:"text-cyan-500",bg:"bg-cyan-100 dark:bg-cyan-900/30"}},Na=()=>{const{user:c}=Ne(),{language:t}=oe(),n=t==="ar"||t==="he",{data:r}=F({queryKey:["my-competition-stats",c?.id],queryFn:async()=>{if(!c)return null;const{data:i}=await b.from("user_competition_stats").select("*").eq("user_id",c.id).maybeSingle();return i},enabled:!!c}),{data:j}=F({queryKey:["my-earned-badges",c?.id],queryFn:async()=>{if(!c)return[];const{data:i}=await b.from("user_earned_badges").select("*, badge:competition_badges(*)").eq("user_id",c.id).order("earned_at",{ascending:!1});return i||[]},enabled:!!c}),{data:f}=F({queryKey:["all-competition-badges"],queryFn:async()=>{const{data:i}=await b.from("competition_badges").select("*").order("rank_order",{ascending:!0});return i||[]}}),{data:R}=F({queryKey:["weekly-winners"],queryFn:async()=>{const{data:i}=await b.from("competition_weekly_winners").select("*").order("created_at",{ascending:!1}).limit(9);if(!i||i.length===0)return[];const g=[...new Set(i.map(w=>w.user_id))],{data:x}=await b.from("profiles_public").select("user_id, full_name, avatar_url, tribe").in("user_id",g),D=new Map((x||[]).map(w=>[w.user_id,w]));return i.map(w=>({...w,profile:D.get(w.user_id)}))}}),{data:C}=F({queryKey:["monthly-leaderboard"],queryFn:async()=>{const{data:i}=await b.from("user_competition_stats").select("*").order("total_points",{ascending:!1}).limit(10);if(!i||i.length===0)return[];const g=i.map(w=>w.user_id),{data:x}=await b.from("profiles_public").select("user_id, full_name, avatar_url, tribe").in("user_id",g),D=new Map((x||[]).map(w=>[w.user_id,w]));return i.map(w=>({...w,profile:D.get(w.user_id)}))}});new Set((j||[]).map(i=>i.badge_id));const v=r&&ee[r.rank_tier]||ee.bronze,S=["ð¥","ð¥","ð¥"],Q=(R||[]).reduce((i,g)=>(i[g.week_label]||(i[g.week_label]=[]),i[g.week_label].push(g),i),{});return e.jsxs("div",{className:"space-y-6",children:[c&&r&&e.jsx(q,{className:"border-primary/20 bg-gradient-to-br from-primary/5 to-transparent",children:e.jsxs(T,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsx("div",{className:M("p-3 rounded-xl",v.bg),children:e.jsx("span",{className:"text-3xl",children:v.icon})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:M("font-bold text-lg",v.color),children:n?v.labelAr:v.label}),e.jsxs(ve,{variant:"secondary",className:"text-xs",children:[r.total_points," ",n?"ÙÙØ·Ø©":"pts"]})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:n?`Ø£ÙØ¶Ù ÙØªÙجة: ${r.best_score}%`:`Best: ${r.best_score}%`})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-center",children:[e.jsxs("div",{className:"p-2 rounded-lg bg-background/60",children:[e.jsx($e,{className:"w-5 h-5 mx-auto mb-1 text-orange-500"}),e.jsx("div",{className:"text-lg font-bold",children:r.current_streak}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n?"Ø³ÙØ³ÙØ©":"Streak"})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-background/60",children:[e.jsx(V,{className:"w-5 h-5 mx-auto mb-1 text-primary"}),e.jsx("div",{className:"text-lg font-bold",children:r.total_entries}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n?"Ù
Ø´Ø§Ø±ÙØ§Øª":"Entries"})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-background/60",children:[e.jsx(ha,{className:"w-5 h-5 mx-auto mb-1 text-green-500"}),e.jsx("div",{className:"text-lg font-bold",children:r.longest_streak}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n?"أطÙÙ Ø³ÙØ³ÙØ©":"Best Streak"})]})]}),r.current_streak>=2&&e.jsxs("div",{className:"mt-3 p-2 rounded-lg bg-orange-100 dar
17k:bg-orange-900/20 text-center text-sm",children:["ð¥ ",n?`Ø£ÙØª ÙÙ Ø³ÙØ³ÙØ© ${r.current_streak} Ø£Ø³Ø§Ø¨ÙØ¹ Ù
تتاÙÙØ©! ÙØ§ØµÙ!`:`You're on a ${r.current_streak}-week streak! Keep going!`]})]})}),e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2 text-lg",children:[e.jsx(O,{className:"w-5 h-5 text-primary"}),n?"Ø§ÙØ´Ø§Ø±Ø§Øª ÙØ§ÙØ¥ÙØ¬Ø§Ø²Ø§Øª":"Badges & Achievements"]})}),e.jsx(T,{children:(j||[]).length===0?e.jsxs("div",{className:"text-center py-8 space-y-3",children:[e.jsx(O,{className:"w-12 h-12 mx-auto text-muted-foreground/20"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n?"شار٠Ù٠اÙÙ
Ø³Ø§Ø¨ÙØ§Øª ÙÙØ³Ø¨ شارات ÙØ¥Ùجازات!":"Participate in competitions to earn badges!"})]}):e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-3",children:(j||[]).map(i=>{const g=i.badge;return g?e.jsxs("div",{className:"p-3 rounded-xl text-center border border-primary/30 bg-primary/5 shadow-sm",children:[e.jsx("span",{className:"text-2xl block mb-1",children:g.icon}),e.jsx("div",{className:"text-xs font-medium leading-tight",children:n?g.name_ar:g.name}),e.jsx("div",{className:"text-[10px] text-primary mt-1",children:"â"})]},g.id):null})})})]}),e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Le,{className:"w-5 h-5 text-yellow-500"}),n?"ÙÙØØ© Ø§ÙØ´Ø±Ù":"Hall of Fame"]})}),e.jsx(T,{className:"space-y-2",children:(C||[]).length===0?e.jsx("p",{className:"text-center text-muted-foreground py-6",children:n?"ÙØ§ ØªÙØ¬Ø¯ Ø¨ÙØ§Ùات بعد":"No data yet"}):(C||[]).map((i,g)=>{const x=ee[i.rank_tier]||ee.bronze;return e.jsxs("div",{className:M("flex items-center gap-3 p-3 rounded-lg border",g<3?"bg-primary/5 border-primary/20":""),children:[e.jsx("div",{className:M("w-8 h-8 rounded-full flex items-center justify-center font-bold text-sm",g===0&&"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50",g===1&&"bg-gray-200 text-gray-700 dark:bg-gray-700",g===2&&"bg-orange-100 text-orange-700 dark:bg-orange-900/50",g>2&&"bg-muted text-muted-foreground"),children:g+1}),e.jsxs(be,{className:"w-8 h-8",children:[e.jsx(fe,{src:i.profile?.avatar_url||""}),e.jsx(ye,{children:(i.profile?.full_name||"?")[0]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:i.profile?.full_name||"â"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:i.profile?.tribe})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"font-bold text-sm",children:[i.total_points," ",n?"ÙÙØ·Ø©":"pts"]}),e.jsxs("div",{className:"text-xs",children:[x.icon," ",n?x.labelAr:x.label]})]})]},i.id)})})]}),Object.keys(Q).length>0&&e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2 text-lg",children:[e.jsx(V,{className:"w-5 h-5 text-primary"}),n?"ÙØ§Ø¦Ø²Ù Ø§ÙØ£Ø³Ø§Ø¨Ùع Ø§ÙØ³Ø§Ø¨ÙØ©":"Past Winners"]})}),e.jsx(T,{className:"space-y-4",children:Object.entries(Q).map(([i,g])=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:i}),g.sort((x,D)=>x.rank-D.rank).map(x=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-muted/50",children:[e.jsx("span",{className:"text-lg",children:S[x.rank-1]||""}),e.jsxs(be,{className:"w-7 h-7",children:[e.jsx(fe,{src:x.profile?.avatar_url||""}),e.jsx(ye,{children:(x.profile?.full_name||"?")[0]})]}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:x.profile?.full_name||"â"}),e.jsxs("span",{className:"text-sm font-bold text-primary",children:[x.score,"%"]})]},x.id))]},i))})]}),c&&r&&(r.best_score>=90||r.total_entries>=10)&&e.jsx(q,{className:"border-primary/20",children:e.jsxs(T,{className:"p-6 text-center space-y-3",children:[e.jsx(O,{className:"w-12 h-12 mx-auto text-primary"}),e.jsx("h3",{className:"font-bold text-lg",children:n?"ð Ø´ÙØ§Ø¯Ø© ØªÙØ¯Ùر":"ð Certificate of Achievement"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n?"ÙÙØ¯ ØÙÙØª Ø¥ÙØ¬Ø§Ø²Ø§Ù Ù
Ù
ÙØ²Ø§Ù! ÙÙ
ÙÙ٠تØÙ
ÙÙ Ø´ÙØ§Ø¯ØªÙ Ø§ÙØ±ÙÙ
ÙØ©.":"You've achieved a remarkable milestone! Download your digital certificate."}),e.jsxs(U,{onClick:()=>va(c.id,r),className:"gap-2",children:[e.jsx(Xe,{className:"w-4 h-4"}),n?"تØÙ
ÙÙ Ø§ÙØ´Ùادة":"Download Certificate"]})]})})]})};async function va(c,t){const{jsPDF:n}=await ea(async()=>{const{jsPDF:C}=await import("./jspdf.es.min-Dv1_yVTl.js").then(v=>v.j);return{jsPDF:C}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])),r=new n({orientation:"landscape",unit:"mm",format:"a4"}),{data:j}=await b.from("profiles_public").select("full_name").eq("user_id",c).maybeSingle(),f=j?.full_name||"Participant",R=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});r.setFillColor(26,54,93),r.rect(0,0,297,210,"F"),r.setFillColor(255,255,255),r.roundedRect(15,15,267,180,5,5,"F"),r.setDrawColor(184,134,11),r.setLineWidth(2),r.roundedRect(20,20,257,170,3,3,"S"),r.setTextColor(26,54,93),r.setFontSize(36),r.text("Certificate of Achievement",148.5,55,{align:"center"}),r.setDrawColor(184,134,11),r.setLineWidth(1),r.line(80,62,217,62),r.setFontSize(14),r.setTextColor(100,100,100),r.text("Circassian Knowledge Challenge",148.5,75,{align:"center"}),r.setFontSize(28),r.setTextColor(26,54,93),r.text(f,148.5,100,{align:"center"}),r.setFontSize(12),r.setTextColor(80,80,80),r.text(`Best Score: ${t.best_score}% | Total Entries: ${t.total_entries} | Rank: ${t.rank_tier.toUpperCase()}`,148.5,120,{align:"center"}),r.setFontSize(11),r.text("For outstanding performance in the Weekly Circassian Knowledge Competition",148.5,135,{align:"center"}),r.setFontSize(24),r.text("ð",148.5,155,{align:"center"}),r.setFontSize(10),r.setTextColor(120,120,120),r.text(R,148.5,175,{align:"center"}),r.save(`Circassian_Challenge_Certificate_${f.replace(/\s+/g,"_")}.pdf`)}const Me={ar:{title:"Ù
راجعة إجاباتÙ",subtitle:"راجع Ø§ÙØ£Ø³Ø¦ÙØ© Ø§ÙØªÙ أجبت عÙÙÙØ§ ÙØªØ¹ÙÙÙ
Ù
Ù Ø§ÙØ¥Ø¬Ø§Ø¨Ø§Øª Ø§ÙØµØÙØØ© ÙØ§ÙØ´Ø±ÙØØ§Øª",correctAnswer:"Ø§ÙØ¥Ø¬Ø§Ø¨Ø© Ø§ÙØµØÙØØ©",yourAnswer:"إجابتÙ",explanation:"Ø§ÙØ´Ø±Ø",source:"اÙÙ
صدر",showMore:"عرض اÙÙ
Ø²ÙØ¯",noAnswers:"ÙÙ
تشار٠Ù٠أ٠Ù
Ø³Ø§Ø¨ÙØ© بعد. شار٠ÙÙ Ø§ÙØªØØ¯Ù ÙØªØ±Ù إجابات٠ÙÙØ§!",loginRequired:"Ø³Ø¬Ù Ø§ÙØ¯Ø®ÙÙ ÙÙ
راجعة Ø¥Ø¬Ø§Ø¨Ø§ØªÙ Ø§ÙØ³Ø§Ø¨ÙØ©",attempt:"اÙÙ
ØØ§ÙÙØ©",score:"اÙÙØªÙجة",history:"Ø§ÙØªØ§Ø±ÙØ®",culture:"Ø§ÙØ«ÙØ§ÙØ©",geography:"Ø§ÙØ¬ØºØ±Ø§ÙÙØ§",language:"اÙÙØºØ©",tribes:"اÙÙØ¨Ø§Ø¦Ù"},en:{title:"Review Your Answers",subtitle:"Review questions you answered and learn from correct answers with explanations",correctAnswer:"Correct Answer",yourAnswer:"Your Answer",explanation:"Explanation",source:"Source",showMore:"Show More",noAnswers:"You haven't participated in any competition yet. Take the challenge to see your answers here!",loginRequired:"Log in to review your past answers",attempt:"Attempt",score:"Score",history:"History",culture:"Culture",geography:"Geography",language:"Language",tribes:"Tribes"},tr:{title:"Cevaplarınızı İnceleyin",subtitle:"CevapladıÄınız soruları gözden geçirin ve doÄru cevaplardan öÄrenin",correctAnswer:"DoÄru Cevap",yourAnswer:"Cevabınız",explanation:"Açıklama",source:"Kaynak",showMore:"Daha Fazla",noAnswers:"Henüz bir yarıÅmaya katılmadınız. Cevaplarınızı burada görmek için yarıÅmaya katılın!",loginRequired:"GeçmiÅ cevaplarınızı inceleme
17k için giriÅ yapın",attempt:"Deneme",score:"Puan",history:"Tarih",culture:"Kültür",geography:"CoÄrafya",language:"Dil",tribes:"Kabileler"},ru:{title:"ÐÑоÑмоÑÑ Ð²Ð°ÑиÑ
оÑвеÑов",subtitle:"ÐÑоÑмоÑÑиÑе вопÑоÑÑ, на коÑоÑÑе Ð²Ñ Ð¾ÑвеÑили, и ÑÑиÑеÑÑ Ð½Ð° пÑавилÑнÑÑ
оÑвеÑаÑ
",correctAnswer:"ÐÑавилÑнÑй оÑвеÑ",yourAnswer:"ÐÐ°Ñ Ð¾ÑвеÑ",explanation:"ÐбÑÑÑнение",source:"ÐÑÑоÑник",showMore:"ÐоказаÑÑ ÐµÑÑ",noAnswers:"ÐÑ ÐµÑÑ Ð½Ðµ ÑÑаÑÑвовали. ÐÑимиÑе ÑÑаÑÑие в викÑоÑине, ÑÑÐ¾Ð±Ñ ÑвидеÑÑ Ñвои оÑвеÑÑ!",loginRequired:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿ÑоÑмоÑÑеÑÑ Ð¿ÑоÑлÑе оÑвеÑÑ",attempt:"ÐопÑÑка",score:"Ðалл",history:"ÐÑÑоÑиÑ",culture:"ÐÑлÑÑÑÑа",geography:"ÐеогÑаÑиÑ",language:"ЯзÑк",tribes:"Ðлемена"},he:{title:"×¡×§×¨× ×ת תש×××ת×××",subtitle:"×¢××× × ×ש×××ת ×©×¢× ×ª× ×¢×××× ××××× ××תש×××ת ×× ××× ×ת",correctAnswer:"תש××× × ××× ×",yourAnswer:"תש××ת×",explanation:"×ס×ר",source:"××§×ר",showMore:"××¦× ×¢××",noAnswers:"×¢×××× ×× ×שתתפת×. ××©×ª×ª×¤× ××ת×ר ××× ×ר××ת ×ת תש×××ת××× ×××!",loginRequired:"×ת×××¨× ××× ×צפ×ת ×תש×××ת ×§××××ת",attempt:"× ×ס×××",score:"צ×××",history:"××ס××ר××",culture:"תר××ת",geography:"××××רפ××",language:"שפ×",tribes:"ש××××"},kbd:{title:"УиджÑÑапÑ
ÑÑ Ð·ÑгÑÑплÑÑжÑ",subtitle:"ÐжÑÑап зÑÑÑгÑÑ ÑпÑIÑÑ
ÑÑ ÑкIи джÑÑап ÑÑÑÑзÑ
ÑÑ Ð·ÑгÑаÑIÑÑ
",correctAnswer:"ÐжÑÑап ÑÑÑÑз",yourAnswer:"УиджÑÑап",explanation:"ÐÑÑнÑÑÑгÑÑкIÑ",source:"ÐÑÑкIÑапI",showMore:"ÐаÑ
ÑÑбÑкIÑ",noAnswers:"ÐжÑÑи зÑнÑкÑокÑÑм ÑÑ
ÑлÑжÑагÑÑп. УиджÑÑапÑ
ÑÑ Ð¼ÑÑ ÑÑплÑÑгÑÑнÑ
Ñм пае зÑнÑкÑокÑÑм Ñ
ÑлажÑ!",loginRequired:"УиджÑÑапÑ
ÑÑ Ð¿Ð»ÑÑгÑÑнÑ
Ñм пае Ñ
ÑÑ
ÑажÑ",attempt:"УÑÑÑÑнÑгÑ",score:"ÐнÑкÑокÑÑгÑ",history:"ТаÑиÑ
Ñ",culture:"ÐÑлÑÑÑÑÑ",geography:"ÐеогÑаÑие",language:"ÐзÑ",tribes:"ÐÑÑпкÑÑ
ÑÑ"}},Qe=N.forwardRef((c,t)=>{const{language:n,isRTL:r}=oe(),{user:j}=Ne(),f=Me[n]||Me.en,[R,C]=N.useState(new Set),{data:v,isLoading:S}=F({queryKey:["my-competition-entries",j?.id],queryFn:async()=>{if(!j)return[];const{data:l,error:_}=await b.from("competition_entries").select("id, score, correct_count, total_questions, time_taken_seconds, answers, created_at").eq("user_id",j.id).order("created_at",{ascending:!1});if(_)throw _;return l||[]},enabled:!!j}),Q=v?.flatMap(l=>l.answers?.map(y=>y.questionId)||[])||[],i=[...new Set(Q)],{data:g}=F({queryKey:["answered-questions",i.join(","),n],queryFn:async()=>{if(i.length===0)return[];const{data:l,error:_}=await b.from("competition_questions_safe").select("*").in("id",i);if(_)throw _;let y=l||[];if(n!=="ar"&&y.length>0)try{const{data:L}=await b.functions.invoke("translate-competition-questions",{body:{question_ids:y.map(z=>z.id),target_language:n}});if(L?.translations?.length){const z=new Map(L.translations.map(A=>[A.question_id,A]));y=y.map(A=>{const p=z.get(A.id);return p?{...A,question:p.question,options:Array.isArray(p.options)?p.options:JSON.parse(p.options),correct_answer:p.correct_answer,explanation:p.explanation||A.explanation}:A})}}catch(L){console.error("Translation failed for review:",L)}return y},enabled:i.length>0}),x=new Map((g||[]).map(l=>[l.id,l])),D=l=>{C(_=>{const y=new Set(_);return y.has(l)?y.delete(l):y.add(l),y})},w=l=>({history:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",culture:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",geography:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",language:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",tribes:"bg-rose-100 text-rose-800 dark:bg-rose-900/30 dark:text-rose-300"})[l]||"bg-muted text-muted-foreground",re=l=>{const _=Math.floor(l/60),y=l%60;return`${_}:${y.toString().padStart(2,"0")}`};return j?e.jsxs("div",{ref:t,className:"space-y-6",dir:r?"rtl":"ltr",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center mx-auto",children:e.jsx(ba,{className:"w-8 h-8 text-primary"})}),e.jsx("h2",{className:"text-xl font-bold",children:f.title}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:f.subtitle})]}),S?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(l=>e.jsx("div",{className:"h-20 rounded-xl bg-muted animate-pulse"},l))}):!v||v.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(_e,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-sm",children:f.noAnswers})]}):e.jsx("div",{className:"space-y-8",children:v.map((l,_)=>{const y=l.answers||[],L=new Date(l.created_at).toLocaleDateString(r?"ar":"en",{year:"numeric",month:"short",day:"numeric"});return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-muted/50 border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:M("w-10 h-10 rounded-lg flex items-center justify-center font-bold text-sm",l.score>=70?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300"),children:[l.score,"%"]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-medium",children:[f.attempt," ",v.length-_]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:L})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.correct_count,"/",l.total_questions," ⢠",l.time_taken_seconds?re(l.time_taken_seconds):"--"]})]}),e.jsx("div",{className:"space-y-2",children:y.map((z,A)=>{const p=x.get(z.questionId);if(!p)return null;const K=R.has(`${l.id}-${A}`),J=Array.isArray(p.options)?p.options:JSON.parse(p.options);return e.jsx(q,{className:M("border-border/50 cursor-pointer hover:border-primary/30",K&&"border-primary/20 shadow-sm"),onClick:()=>D(`${l.id}-${A}`),children:e.jsxs(T,{className:"p-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:M("w-7 h-7 rounded-lg flex items-center justify-center shrink-0",z.correct?"bg-green-100 dark:bg-green-900/30":"bg-red-100 dark:bg-red-900/30"),children:z.correct?e.jsx(le,{className:"w-4 h-4 text-green-600"}):e.jsx(je,{className:"w-4 h-4 text-red-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx(ve,{className:M("text-[10px]",w(p.category)),variant:"secondary",children:f[p.category]||p.category})}),e.jsx("p",{className:"text-sm leading-relaxed",children:p.question})]}),e.jsx("div",{className:"shrink-0 text-muted-foreground",children:K?e.jsx(ta,{className:"w-4 h-4"}):e.jsx(ra,{className:"w-4 h-4"})})]}),K&&e.jsxs("div",{className:"mt-3 space-y-2 border-t pt-3",onClick:I=>I.stopPropagation(),children:[e.jsx("div",{className:"space-y-1.5",children:J.map((I,H)=>{const E=I===p.correct_answer,P=I===z.answer,Y=P&&!z.correct;return e.jsxs("div",{className:M("flex items-center gap-2 p-2.5 rounded-lg text-sm",E?"bg-green-50 border border-green-200 dark:bg-green-900/20 dark:border-green-800":Y?"bg-red-50 border border-red-200 dark:bg-red-900/20 dark:border-red-800":"bg-muted/30"),children:[E&&e.jsx(le,{className:"w-4 h-4 text-green-600 shrink-0"}),Y&&e.jsx(je,{className:"w-4 h-4 text-red-500 shrink-0"}),e.jsx("span",{className:M("flex-1",E&&"font-medium text-green-700 dark:text-green-300",Y&&"text-red-600 dark:text-red-400 line-through"),children:I}),P&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["â ",f.yourAnswer]})]},H)})}),p.explanation&&e.jsxs("div",{className:"p-3 rounded-lg bg-amber-50 dark:bg-amber-900/10 border border-amber-200 dark:border-amber-800/30",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(sa,{className:"w-4 h-4 text-amber-600"}),e.jsx("span",{className:"text-xs font-semibold text-amber-700 dark:text-amber-400",children:f.explanation})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:p.explanation})]}),p.source&&e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["ð ",f.source,": ",p.source]})]})]})},`${l.id}-${A}`)})})]},l.id)})})]}):e.jsxs("div",{className:"text-center py-16 space-y-4",children:[e.jsx(aa,{className:"w-12 h-12 mx-auto text-muted-foreground
17/30"}),e.jsx("p",{className:"text-muted-foreground",children:f.loginRequired})]})});Qe.displayName="LastWeekReview";const Fe={en:{linksTitle:"Explore More Heritage Services",faqTitle:"Frequently Asked Questions â Knowledge Challenge",faqs:[{q:"What is the Knowledge Challenge?",a:"A weekly quiz competition testing your knowledge of Circassian history, culture, geography, and traditions. Compete with community members and earn badges."},{q:"How often are new quizzes available?",a:"New competition rounds are launched weekly. Each round features carefully curated questions across multiple difficulty levels."},{q:"Are questions available in my language?",a:"Yes â questions are available in English, Arabic, Turkish, Russian, Hebrew, and Adyghe. You play in your selected interface language."},{q:"How is the scoring system calculated?",a:"Scores are based on correct answers and speed. Bonus points are awarded for streaks and perfect rounds. Top performers appear on the weekly leaderboard."},{q:"Can I review my past quiz results?",a:"Yes, the Results tab shows your complete competition history including scores, correct answers, time taken, and any badges earned."}]},ar:{linksTitle:"Ø§ÙØªØ´Ù اÙÙ
Ø²ÙØ¯ Ù
٠خدÙ
ات Ø§ÙØªØ±Ø§Ø«",faqTitle:"Ø§ÙØ£Ø³Ø¦ÙØ© Ø§ÙØ´Ø§Ø¦Ø¹Ø© â ØªØØ¯Ù اÙÙ
Ø¹Ø±ÙØ©",faqs:[{q:"Ù
ا ÙÙ ØªØØ¯Ù اÙÙ
Ø¹Ø±ÙØ©Ø",a:"Ù
Ø³Ø§Ø¨ÙØ© Ø£Ø³Ø¨ÙØ¹ÙØ© تختبر Ù
Ø¹Ø±ÙØªÙ Ø¨Ø§ÙØªØ§Ø±ÙØ® ÙØ§ÙØ«ÙØ§ÙØ© ÙØ§ÙجغراÙÙØ§ ÙØ§ÙØªÙØ§ÙÙØ¯ Ø§ÙØ´Ø±ÙØ³ÙØ©. ØªÙØ§Ùس Ù
ع أعضاء اÙÙ
جتÙ
ع ÙØ§ØØµÙ عÙ٠شارات."},{q:"ÙÙ
Ù
رة تتÙÙØ± Ù
Ø³Ø§Ø¨ÙØ§Øª Ø¬Ø¯ÙØ¯Ø©Ø",a:"ØªÙØ·Ù٠جÙÙØ§Øª Ø¬Ø¯ÙØ¯Ø© Ø£Ø³Ø¨ÙØ¹ÙÙØ§ Ù
ع Ø£Ø³Ø¦ÙØ© Ù
ÙØªÙاة Ø¨Ø¹ÙØ§ÙØ© عبر Ù
ستÙÙØ§Øª ØµØ¹ÙØ¨Ø© Ù
تعددة."},{q:"ÙÙ Ø§ÙØ£Ø³Ø¦ÙØ© Ù
تÙÙØ±Ø© Ø¨ÙØºØªÙØ",a:"ÙØ¹Ù
â Ø§ÙØ£Ø³Ø¦ÙØ© Ù
تÙÙØ±Ø© Ø¨Ø§ÙØ¥ÙجÙÙØ²ÙØ© ÙØ§ÙØ¹Ø±Ø¨ÙØ© ÙØ§ÙترÙÙØ© ÙØ§ÙØ±ÙØ³ÙØ© ÙØ§ÙØ¹Ø¨Ø±ÙØ© ÙØ§ÙØ£Ø¯ÙØºÙØ©."},{q:"ÙÙÙ ÙÙØØ³Ø¨ ÙØ¸Ø§Ù
اÙÙÙØ§Ø·Ø",a:"تعتÙ
د اÙÙÙØ§Ø· عÙÙ Ø§ÙØ¥Ø¬Ø§Ø¨Ø§Øª Ø§ÙØµØÙØØ© ÙØ§Ùسرعة Ù
ع ÙÙØ§Ø· إضاÙÙØ© ÙÙØ³ÙØ§Ø³Ù ÙØ§ÙجÙÙØ§Øª اÙÙ
ثاÙÙØ©."},{q:"ÙÙ ÙÙ
ÙÙÙÙ Ù
راجعة ÙØªØ§Ø¦Ø¬Ù Ø§ÙØ³Ø§Ø¨ÙØ©Ø",a:"ÙØ¹Ù
Ø ØªØ¨ÙÙØ¨ اÙÙØªØ§Ø¦Ø¬ ÙØ¹Ø±Ø¶ سجÙ٠اÙÙØ§Ù
٠بÙ
ا Ù٠ذÙ٠اÙÙÙØ§Ø· ÙØ§Ùإجابات Ø§ÙØµØÙØØ© ÙØ§ÙÙÙØª ÙØ§Ùشارات."}]},tr:{linksTitle:"Daha Fazla Miras Hizmeti",faqTitle:"Sıkça Sorulan Sorular â Bilgi YarıÅması",faqs:[{q:"Bilgi YarıÅması nedir?",a:"Ãerkes tarihi, kültürü, coÄrafyası ve gelenekleri hakkındaki bilginizi test eden haftalık bir yarıÅma. Topluluk üyeleriyle yarıÅın ve rozetler kazanın."},{q:"Yeni yarıÅmalar ne sıklıkla yayınlanıyor?",a:"Her hafta yeni yarıÅma turları baÅlatılır. Her tur birden fazla zorluk seviyesinde dikkatle hazırlanmıŠsorular içerir."},{q:"Sorular benim dilimde mevcut mu?",a:"Evet â sorular İngilizce, Arapça, Türkçe, Rusça, İbranice ve AdıÄece olarak mevcuttur."},{q:"Puanlama nasıl hesaplanır?",a:"Puanlar doÄru cevaplara ve hıza dayanır. Seriler ve mükemmel turlar için bonus puanlar verilir."},{q:"GeçmiÅ sonuçlarımı görebilir miyim?",a:"Evet, Sonuçlar sekmesi puanlar, doÄru cevaplar, süre ve kazanılan rozetler dahil tam yarıÅma geçmiÅinizi gösterir."}]},ru:{linksTitle:"ÐÑÑгие ÑеÑвиÑÑ Ð½Ð°ÑледиÑ",faqTitle:"ЧаÑÑо задаваемÑе вопÑоÑÑ â ÐикÑоÑина знаний",faqs:[{q:"ЧÑо Ñакое «ÐикÑоÑина знаний»?",a:"ÐженеделÑÐ½Ð°Ñ Ð²Ð¸ÐºÑоÑина, пÑовеÑÑÑÑÐ°Ñ Ð·Ð½Ð°Ð½Ð¸Ñ ÑеÑкеÑÑкой иÑÑоÑии, кÑлÑÑÑÑÑ, геогÑаÑии и ÑÑадиÑий. СоÑевнÑйÑеÑÑ Ð¸ заÑабаÑÑвайÑе знаÑки."},{q:"Ðак ÑаÑÑо поÑвлÑÑÑÑÑ Ð½Ð¾Ð²Ñе викÑоÑинÑ?",a:"ÐовÑе ÑаÑÐ½Ð´Ñ Ð·Ð°Ð¿ÑÑкаÑÑÑÑ ÐµÐ¶ÐµÐ½ÐµÐ´ÐµÐ»Ñно Ñ ÑÑаÑелÑно подобÑаннÑми вопÑоÑами Ñазной ÑложноÑÑи."},{q:"ÐоÑÑÑÐ¿Ð½Ñ Ð»Ð¸ вопÑоÑÑ Ð½Ð° моÑм ÑзÑке?",a:"Ðа â вопÑоÑÑ Ð´Ð¾ÑÑÑÐ¿Ð½Ñ Ð½Ð° английÑком, аÑабÑком, ÑÑÑеÑком, ÑÑÑÑком, ивÑиÑе и адÑгейÑком."},{q:"Ðак ÑÑиÑаÑÑÑÑ Ð±Ð°Ð»Ð»Ñ?",a:"ÐÐ°Ð»Ð»Ñ Ð¾ÑÐ½Ð¾Ð²Ð°Ð½Ñ Ð½Ð° пÑавилÑнÑÑ
оÑвеÑаÑ
и ÑкоÑоÑÑи. Ðон
17ÑÑнÑе Ð±Ð°Ð»Ð»Ñ Ð·Ð° ÑеÑии и идеалÑнÑе ÑаÑндÑ."},{q:"ÐÐ¾Ð³Ñ Ð»Ð¸ Ñ Ð¿ÑоÑмоÑÑеÑÑ Ð¿ÑоÑлÑе ÑезÑлÑÑаÑÑ?",a:"Ðа, вкладка ÑезÑлÑÑаÑов показÑÐ²Ð°ÐµÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸ÑÑоÑÐ¸Ñ ÑоÑевнований, вклÑÑÐ°Ñ Ð±Ð°Ð»Ð»Ñ, оÑвеÑÑ, вÑÐµÐ¼Ñ Ð¸ знаÑки."}]},he:{linksTitle:"ש×ר××ª× ××רשת × ×ספ××",faqTitle:"ש×××ת × ×¤×צ×ת â ×ת×ר ××××¢",faqs:[{q:"××× ×ת×ר ××××¢?",a:"ת×ר×ת ××××× ×©×××¢×ת ××××× ×ª ×ת ××××¢ ש××× ×××ס××ר××, תר××ת, ×××××רפ×× ××ס×ר×ת צ'רקס××ת. ×ת××¨× ×צ××¨× ×ª×××."},{q:"××× ×¤×¢××× ×תפרס××× ××××× ×× ××ש××?",a:"ס×××× ××ש×× ××שק×× ××× ×©×××¢ ×¢× ×©×××ת ×ר××ת ×§××©× ××××× ×ת."},{q:"××× ×ש×××ת ×××× ×ת ××©×¤× ×©××?",a:"×× â ש×××ת ×××× ×ת ××× ×××ת, ער××ת, ××רק×ת, ר×ס×ת, ×¢×ר×ת ××××××ת."},{q:"××× ××××©× ×× ××§××?",a:"×× ××§×× ×××סס ×¢× ×ª×©×××ת × ××× ×ת ××××ר×ת. ××× ×ס×× × ××ª× ×× ×¢× ×¨×¦×¤×× ×ס×××× ××ש××××."},{q:"××× × ××ª× ×צפ×ת ×ת×צ××ת ×§××××ת?",a:"××, ×ש×× ×ת ×ת×צ××ת ×צ××× ×ת ×××ס××ר×× ××××× ×××× × ××§××, תש×××ת, ××× ×ת×××."}]},ady:{linksTitle:"ÐÑмÑкl Ñ
ÑкÑм и лÑÑÑжÑÑ
ÑÑ",faqTitle:"УпÑlÑ Ð½ÑÑ
ÑÑбÑÑÑ ÐºÑаÑÑ
ÑÑ â ЩlÑнÑгÑÑ Ð·ÑпеÑÑ",faqs:[{q:"ЩlÑнÑгÑÑ Ð·ÑпеÑÑÑ ÑÑÑ?",a:"ТÑ
ÑÑмаÑ
ÑÑ ÐºÑÑÑ ÐµÐºlÑÑкl зÑпеÑÑÑ Ð°Ð´ÑÐ³Ñ ÑÑ
ÑдÑм, ÑÑнÑ
абзÑм, ÑlÑпlÑÑ
Ñм, Ñ
абзÑÑ
Ñм ÑеÑÑ
Ñа ÑlÑнÑгÑÑÑ ÑÑпÑlÑÑ."},{q:"ÐÑпеÑÑÑlÑÑ
ÑÑ Ð´Ð°Ð¿ÑÑÑÑ ÐºÑÑдокl?",a:"ТÑ
ÑÑмаÑ
ÑÑ ÐºÑÑÑ Ð·ÑпеÑÑÑlÑÑ
ÑÑ ÐºÑÑдокl гÑгÑÑагÑÑ Ð·ÑÑ
ÑÑмÑдÑÑ
ÑмкlÑ ÑпÑlÑ ÐºÑÑÑ
ÑÑ
аÑ
ÑÑ ÑlÑÑ."},{q:"УпÑlÑÑ
ÑÑ Ñи бзÑкlÑ ÑÑlÑ?",a:"ÐÑlÑ â инджÑлÑзÑбзÑ, Ñ
ÑÑÑÑпÑбзÑ, ÑÑÑкÑбзÑ, ÑÑÑÑÑбзÑ, жÑÑÑÑбзÑ, адÑгÑбзÑкlÑ ÑÑlÑÑ."},{q:"ÐÑкоÑ
ÑÑ Ð´Ð°ÑÑ Ñбж?",a:"ÐÑкоÑ
ÑÑ Ð¶ÑÑап пÑжÑ
ÑмÑÑ Ð¿ÑÑнÑlагÑÑмÑÑ ÐµÐ»ÑÑÑаÑ. ÐонÑÑ Ð¾ÑкоÑ
ÑÑ ÑеÑие, ÑаÑнд пÑжÑ
Ñм ÑÑ
ÑÑкlÑ ÑÑ."},{q:"Си кlÑÑÑ
Ñ
ÑÑаÑ
ÑÑ ÑлÑагÑÑÑÑн?",a:"ÐÑlÑ, ÐlÑÑÑ
ÑÑ ÑабÑм зÑпеÑÑ ÑÑ
ÑÐ´Ñ Ð¿ÑоÑи â оÑко, жÑÑап, зÑман, бÑдж â кÑегÑÑлÑагÑÑÑ."}]}},_a=[{label:"Circassian Language Learning",href:"/language"},{label:"Circassian History Timeline",href:"/history"},{label:"Circassian Families Database",href:"/families"},{label:"DNA Heritage Explorer",href:"/dna"},{label:"Tamga â Tribal Crests",href:"/tamga"}],qa=[{label:"Twelve Adyghe Tribes (Wikipedia)",href:"https://en.wikipedia.org/wiki/Twelve_Adyghe_tribes",external:!0},{label:"Nart Sagas â Epic Mythology",href:"https://en.wikipedia.org/wiki/Nart_sagas",external:!0},{label:"Sporcle â World Quizzes",href:"https://www.sporcle.com/games/category/geography",external:!0}],Ta=({language:c,isRTL:t})=>{const n=Fe[c]?c:"en",r=Fe[n];return e.jsx(ya,{isRTL:t,internalLinks:_a,externalLinks:qa,faqs:r.faqs,linksTitle:r.linksTitle,faqTitle:r.faqTitle})},ge={weekly_champion:{icon:Le,color:"text-yellow-500",bg:"bg-yellow-100 dark:bg-yellow-900/30"},perfect_score:{icon:ca,color:"text-purple-500",bg:"bg-purple-100 dark:bg-purple-900/30"},fire_streak:{icon:$e,color:"text-orange-500",bg:"bg-orange-100 dark:bg-orange-900/30"},knowledge_master:{icon:_e,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30"},first_win:{icon:Be,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"},speed_demon:{icon:we,color:"text-cyan-500",bg:"bg-cyan-100 dark:bg-cyan-900/30"}},Ee=15,pe=70,Aa=2,Ha=()=>{const{user:c}=Ne(),{t,language:n}=oe(),r=fa("competitions",n);na({ogImage:"https://circassianweb.com/competition-hero.jpg",title:r.title,de
17scription:r.description,keywords:r.keywords,jsonLd:{"@context":"https://schema.org","@type":"Quiz",name:"Circassian Heritage Quiz",description:"Weekly trivia competitions about Circassian history, culture, and traditions.",url:"https://circassianweb.com/competitions",educationalAlignment:{"@type":"AlignmentObject",alignmentType:"educationalSubject",targetName:"Circassian Heritage & Culture"}}});const{toast:j}=ia(),f=pa(),R=n==="ar"||n==="he",[C,v]=N.useState(!1),[S,Q]=N.useState([]),[i,g]=N.useState(0),[x,D]=N.useState(""),[w,re]=N.useState([]),[l,_]=N.useState(null),[y,L]=N.useState(0),[z,A]=N.useState(0),p=N.useRef(),K=N.useRef([]),J=N.useRef(null),[I,H]=N.useState(!1),[E,P]=N.useState(null),{data:Y}=F({queryKey:["competition-leaderboard"],queryFn:async()=>{const{data:a,error:s}=await b.from("competition_entries").select("user_id, score, correct_count, total_questions, time_taken_seconds, created_at").order("score",{ascending:!1}).order("time_taken_seconds",{ascending:!0}).limit(20);if(s)throw s;const d=[...new Set((a||[]).map(u=>u.user_id))];if(d.length===0)return[];const{data:m}=await b.from("profiles_public").select("user_id, full_name, avatar_url, tribe").in("user_id",d),o=new Map((m||[]).map(u=>[u.user_id,u]));return(a||[]).map(u=>({...u,profile:o.get(u.user_id)}))}}),{data:ce}=F({queryKey:["user-badges",c?.id],queryFn:async()=>{if(!c)return[];const{data:a,error:s}=await b.from("user_badges").select("*").eq("user_id",c.id).order("earned_at",{ascending:!1});if(s)throw s;return a||[]},enabled:!!c}),{data:B}=F({queryKey:["my-best-score",c?.id],queryFn:async()=>{if(!c)return null;const{data:a}=await b.from("competition_entries").select("score, correct_count, total_questions, time_taken_seconds").eq("user_id",c.id).order("score",{ascending:!1}).limit(1).maybeSingle();return a},enabled:!!c}),{data:de}=F({queryKey:["monthly-attempts",c?.id],queryFn:async()=>{if(!c)return{count:0,lastAttemptDate:null};const a=new Date,s=new Date(a.getFullYear(),a.getMonth(),1).toISOString(),{count:d,error:m}=await b.from("competition_entries").select("*",{count:"exact",head:!0}).eq("user_id",c.id).gte("created_at",s);if(m)throw m;const{data:o}=await b.from("competition_entries").select("created_at").eq("user_id",c.id).order("created_at",{ascending:!1}).limit(1).maybeSingle();return{count:d||0,lastAttemptDate:o?.created_at||null}},enabled:!!c}),qe=de?.count||0,me=Aa-qe,se=de?.lastAttemptDate?new Date(de.lastAttemptDate):null,Te=new Date,Ae=7*24*60*60*1e3,Ce=!se||Te.getTime()-se.getTime()>=Ae,ne=se?Math.max(0,Math.ceil((se.getTime()+Ae-Te.getTime())/(24*60*60*1e3))):0,Ke=me>0&&(qe===0||Ce);N.useEffect(()=>(C&&!l&&(p.current=setInterval(()=>{A(Math.floor((Date.now()-y)/1e3))},1e3)),()=>{p.current&&clearInterval(p.current)}),[C,l,y]);const Pe=(a,s)=>{if(Array.isArray(a))return a.map(String);if(typeof a=="string")try{const d=JSON.parse(a);if(Array.isArray(d))return d.map(String)}catch{return s}if(a&&typeof a=="object"){const m=Object.values(a);if(m.length&&m.every(o=>typeof o=="string"||typeof o=="number"))return m.map(String)}return s},ue=(a,s=[])=>{const d=s.map(o=>({...o,question_id:o?.question_id??o?.id})).filter(o=>!!o?.question_id),m=new Map(d.map(o=>[o.question_id,o]));return a.map(o=>{const u=m.get(o.id);return u?{...o,question:typeof u.question=="string"&&u.question.trim()?u.question:o.question,options:Pe(u.options,o.options),correct_answer:typeof u.correct_answer=="string"&&u.correct_answer.trim()?u.correct_answer:o.correct_answer,explanation:u.explanation??o.explanation}:o})},Se=async(a,s)=>{const{data:d,error:m}=await b.from("competition_question_translations_safe").select("question_id, question, options, explanation").in("question_id",a).eq("language_code",s);return{translations:d||[],error:m}},We=async(a,s)=>{const{data:d,error:m}=await b.functions.invoke("translate-competition-questions",{body:{question_ids:a,target_language:s}});return{translations:Array.isArray(d?.translations)?d.translations:[],error:m,status:m?.context?.status}},De=async(a,s)=>{try{const d=a.map(h=>h.id);let m=a;const o=await Se(d,s);o.error?console.error("Primary cache fetch failed:",o.error):m=ue(m,o.translations);let u=new Set(o.translations.map(h=>
17h?.question_id??h?.id).filter(Boolean)),k=d.filter(h=>!u.has(h));if(k.length>0){const h=await We(k,s);h.error&&h.status!==402&&h.status!==429&&console.error("Translation invoke failed:",h.error),m=ue(m,h.translations),u=new Set(h.translations.map(W=>W?.question_id??W?.id).filter(Boolean)),k=k.filter(W=>!u.has(W))}if(k.length>0&&s!=="en"&&s!=="ar"){const h=await Se(k,"en");h.error?console.error("English fallback cache fetch failed:",h.error):m=ue(m,h.translations)}return m}catch(d){return console.error("Translation failed, using original:",d),a}},Ie=async()=>{try{const{data:a,error:s}=await b.from("competition_questions_safe").select("*").eq("is_active",!0);if(s)throw s;if(!a||a.length===0){j({title:t("comp.noQuestions"),variant:"destructive"});return}const m=a.sort(()=>Math.random()-.5).slice(0,Ee).map(u=>{const k=Array.isArray(u.options)?[...u.options]:JSON.parse(u.options);for(let h=k.length-1;h>0;h--){const W=Math.floor(Math.random()*(h+1));[k[h],k[W]]=[k[W],k[h]]}return{...u,options:k}}),o=await De(m,n);K.current=m.map(u=>({...u,options:[...u.options]})),J.current=n,Q(o),g(0),D(""),re([]),_(null),H(!1),P(null),L(Date.now()),A(0),v(!0)}catch{j({title:t("comp.errorLoading"),variant:"destructive"})}};N.useEffect(()=>{if(!C||l||J.current===n||!K.current.length)return;let a=!1;return(async()=>{const d=await De(K.current,n);a||(Q(d),D(""),H(!1),P(null),J.current=n)})(),()=>{a=!0}},[n,C,l]);const Oe=async()=>{if(!x)return;const a=S[i],{data:s}=await b.rpc("check_competition_answer",{_question_id:a.id,_answer:x});P(!!s),H(!0)},He=async()=>{const a=S[i],{data:s}=await b.rpc("check_competition_answer",{_question_id:a.id,_answer:x}),d=[...w,{questionId:a.id,answer:x,correct:!!s}];if(re(d),H(!1),P(null),D(""),i<S.length-1)g(m=>m+1);else{const m=d.filter(h=>h.correct).length,o=Math.round(m/S.length*100),u=o>=pe,k=Math.floor((Date.now()-y)/1e3);p.current&&clearInterval(p.current),_({score:o,correctCount:m,passed:u}),Ye(d,o,m,k)}},Ye=async(a,s,d,m)=>{if(c)try{await b.rpc("submit_competition_entry",{_competition_id:null,_answers:a,_time_taken_seconds:m});const o=[];s===100&&o.push({badge_type:"perfect_score",badge_name:t("comp.badge.perfectScore"),badge_description:t("comp.badge.perfectScoreDesc")}),s>=pe&&(!B||B.score<pe)&&o.push({badge_type:"first_win",badge_name:t("comp.badge.firstWin"),badge_description:t("comp.badge.firstWinDesc")}),m<60&&s>=80&&o.push({badge_type:"speed_demon",badge_name:t("comp.badge.speedDemon"),badge_description:t("comp.badge.speedDemonDesc")});for(const u of o){const{data:k}=await b.rpc("award_competition_badge",{_user_id:c.id,_badge_type:u.badge_type,_badge_name:u.badge_name,_badge_description:u.badge_description,_metadata:{score:s,time:m}});k&&j({title:`ð ${u.badge_name}`,description:u.badge_description})}f.invalidateQueries({queryKey:["competition-leaderboard"]}),f.invalidateQueries({queryKey:["user-badges"]}),f.invalidateQueries({queryKey:["my-best-score"]}),f.invalidateQueries({queryKey:["monthly-attempts"]})}catch(o){console.error("Error saving:",o)}},ie=a=>{const s=Math.floor(a/60),d=a%60;return`${s}:${d.toString().padStart(2,"0")}`},Ge=a=>({history:t("comp.cat.history"),culture:t("comp.cat.culture"),geography:t("comp.cat.geography"),language:t("comp.cat.language"),tribes:t("comp.cat.tribes")})[a]||a,Ue=a=>{switch(a){case"medium":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300";case"hard":return"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300";case"expert":return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300";default:return"bg-muted text-muted-foreground"}},$=S[i],Ve=C?(i+(l?1:0))/S.length*100:0;return e.jsxs(ja,{children:[c&&e.jsx(ka,{}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-8 py-6",children:C?l?e.jsx(q,{children:e.jsxs(T,{className:"p-8 text-center space-y-6",children:[e.jsx("div",{className:`w-24 h-24 rounded-full flex items-center justify-center mx-auto ${l.passed?"bg-green-100 dark:bg-green-900/30":"bg-amber-100 dark:bg-amber-900/30"}`,children:l.passed?e.jsx(V,{className:"w-12 h-12 text-green-600"}):e.jsx(xe,{className:"w-12 h-12 text-amber-600"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-4xl font-bold",children:[l.score,"%"]}),e.jsxs("p",{className:"text-muted-foreground mt-1",children:[l.correctCount,"/",S.length," ",t("comp.correctAnswers")]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.jsx(he,{className:"w-4 h-4 inline mr-1"}),ie(z)]})]}),e.jsx("p",{className:"text-muted-foreground",children:l.passed?t("comp.passedMsg"):t("comp.failedMsg")}),e.jsxs("div",{className:"flex justify-center gap-3",children:[e.jsxs(U,{variant:"outline",onClick:Ie,className:"gap-2",children:[e.jsx(xe,{className:"w-4 h-4"}),t("comp.tryAgain")]}),e.jsx(U,{onClick:()=>v(!1),children:t("comp.backToMenu")})]})]})}):$?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground mb-1",children:[e.jsxs("span",{children:[i+1,"/",S.length]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:Ue($.difficulty),variant:"secondary",children:t(`comp.diff.${$.difficulty}`)}),e.jsx("span",{children:Ge($.category)})]})]}),e.jsx(da,{value:Ve,className:"h-2"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm font-mono bg-muted px-3 py-1 rounded-md",children:[e.jsx(ze,{className:"w-4 h-4"}),ie(z)]})]}),e.jsx(q,{children:e.jsxs(T,{className:"p-6 space-y-6",children:[e.jsx("h2",{className:"text-xl font-semibold leading-relaxed",children:$.question}),$.source&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["ð ",$.source]}),e.jsx(ma,{value:x,onValueChange:D,disabled:I,children:e.jsx("div",{className:"space-y-3",children:$.options.map((a,s)=>{let d="border-border hover:border-primary/50";return I?a===x&&E?d="border-green-500 bg-green-50 dark:bg-green-900/20":a===x&&!E&&(d="border-red-500 bg-red-50 dark:bg-red-900/20"):x===a&&(d="border-primary bg-primary/5"),e.jsxs("div",{className:`flex items-center gap-3 p-4 rounded-lg border cursor-pointer transition-colors ${d}`,onClick:()=>!I&&D(a),children:[e.jsx(ua,{value:a,id:`opt-${s}`,className:"shrink-0"}),e.jsx(xa,{htmlFor:`opt-${s}`,className:"cursor-pointer flex-1 leading-relaxed",children:a}),I&&a===x&&E&&e.jsx(le,{className:"w-5 h-5 text-green-500 shrink-0"}),I&&a===x&&!E&&e.jsx(je,{className:"w-5 h-5 text-red-500 shrink-0"})]},s)})})}),I&&$.explanation&&e.jsxs("div",{className:`p-4 rounded-lg border ${E?"bg-green-50 border-green-200 dark:bg-green-900/20 dark:border-green-800":"bg-amber-50 border-amber-200 dark:bg-amber-900/20 dark:border-amber-800"}`,children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:E?`â
${t("comp.correctAnswer")}`:`â ${t("comp.wrongAnswer")}`}),e.jsx("p",{className:"text-sm text-muted-foreground",children:$.explanation})]}),e.jsx("div",{className:"flex justify-end pt-2",children:I?e.jsx(U,{onClick:He,className:"gap-2",children:i<S.length-1?e.jsxs(e.Fragment,{children:[t("comp.nextQuestion")," ",e.jsx(ga,{className:"w-4 h-4"})]}):t("comp.finishQuiz")}):e.jsx(U,{onClick:Oe,disabled:!x,className:"gap-2",children:t("comp.checkAnswer")})})]})})]}):null:e.jsx(e.Fragment,{children:e.jsxs(la,{defaultValue:"play",className:"space-y-6",children:[e.jsxs(oa,{
17className:"grid grid-cols-5 w-full",children:[e.jsx(Z,{value:"learn",children:t("comp.tab.learn")}),e.jsx(Z,{value:"play",children:t("comp.tab.play")}),e.jsx(Z,{value:"leaderboard",children:t("comp.tab.leaderboard")}),e.jsx(Z,{value:"achievements",children:t("comp.tab.achievements")}),e.jsx(Z,{value:"badges",children:t("comp.tab.badges")})]}),e.jsx(X,{value:"learn",children:e.jsx(Qe,{})}),e.jsxs(X,{value:"play",className:"space-y-6",children:[c&&B&&e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(q,{children:e.jsxs(T,{className:"p-4 text-center",children:[e.jsx(V,{className:"w-6 h-6 mx-auto mb-1 text-primary"}),e.jsxs("div",{className:"text-2xl font-bold",children:[B.score,"%"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("comp.bestScore")})]})}),e.jsx(q,{children:e.jsxs(T,{className:"p-4 text-center",children:[e.jsx(le,{className:"w-6 h-6 mx-auto mb-1 text-green-500"}),e.jsxs("div",{className:"text-2xl font-bold",children:[B.correct_count,"/",B.total_questions]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("comp.correct")})]})}),e.jsx(q,{children:e.jsxs(T,{className:"p-4 text-center",children:[e.jsx(he,{className:"w-6 h-6 mx-auto mb-1 text-blue-500"}),e.jsx("div",{className:"text-2xl font-bold",children:B.time_taken_seconds?ie(B.time_taken_seconds):"--"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("comp.bestTime")})]})})]}),e.jsx(q,{className:"border-primary/20",children:e.jsxs(T,{className:"p-8 text-center space-y-6",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(we,{className:"w-10 h-10 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:t("comp.startTitle")}),e.jsx("p",{className:"text-muted-foreground",children:t("comp.startDesc")})]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_e,{className:"w-4 h-4"})," ",Ee," ",t("comp.questions")]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"w-4 h-4"})," ",t("comp.timed")]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-4 h-4"})," ",t("comp.earnBadges")]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(xe,{className:"w-4 h-4"})," ",t("comp.monthlyLimit")]})]}),c?Ke?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[me," ",t("comp.attemptsLeft")]}),e.jsxs(U,{size:"lg",onClick:Ie,className:"gap-2 text-lg px-8",children:[e.jsx(we,{className:"w-5 h-5"}),t("comp.startQuiz")]})]}):me>0&&!Ce?e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-amber-600 dark:text-amber-400 font-medium",children:R?`â³ ÙÙ
ÙÙ٠اÙÙ
ØØ§ÙÙØ© Ù
رة أخر٠بعد ${ne} ${ne===1?"ÙÙÙ
":"Ø£ÙØ§Ù
"}`:`â³ Next attempt available in ${ne} day${ne!==1?"s":""}`})}):e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-destructive font-medium",children:t("comp.noAttemptsLeft")})}):e.jsx("p",{className:"text-muted-foreground",children:t("comp.loginRequired")})]})})]}),e.jsx(X,{value:"leaderboard",children:e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"w-5 h-5 text-primary"}),t("comp.leaderboardTitle")]})}),e.jsx(T,{className:"space-y-3",children:(Y||[]).length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:t("comp.noEntries")}):(Y||[]).map((a,s)=>e.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${s<3?"bg-primary/5 border-primary/20":""}`,children:[e.jsx("div",{className:M("w-8 h-8 rounded-full flex items-center justify-center font-bold text-sm",s===0&&"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",s===1&&"bg-gray-200 text-gray-700 dark:bg-gray-700 dark:text-gray-300",s===2&&"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",s>2&&"bg-muted text-muted-foreground"),children:s+1}),e.jsxs(be,{className:"w-8 h-8",children:[e.jsx(fe,{src:a.profile?.avatar_url||""}),e.jsx(ye,{children:(a.profile?.full_name||"?")[0]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium truncate",children:a.profile?.full_name||t("comp.anonymous")}),a.profile?.tribe&&e.jsx("div",{className:"text-xs text-muted-foreground",children:a.profile.tribe})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"font-bold text-primary",children:[a.score,"%"]}
17),e.jsx("div",{className:"text-[10px] text-muted-foreground/60 uppercase tracking-wide",children:R?"اÙÙØªÙجة":"Score"}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["ð ",a.time_taken_seconds?ie(a.time_taken_seconds):"--"]})]})]},s))})]})}),e.jsx(X,{value:"achievements",children:e.jsx(Na,{})}),e.jsx(X,{value:"badges",children:e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-5 h-5 text-primary"}),t("comp.badgesTitle")]})}),e.jsxs(T,{children:[c?(ce||[]).length===0?e.jsxs("div",{className:"text-center py-8 space-y-3",children:[e.jsx(O,{className:"w-12 h-12 mx-auto text-muted-foreground/30"}),e.jsx("p",{className:"text-muted-foreground",children:t("comp.noBadges")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("comp.noBadgesDesc")})]}):e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:(ce||[]).map(a=>{const s=ge[a.badge_type]||ge.first_win,d=s.icon;return e.jsxs("div",{className:`p-4 rounded-lg text-center ${s.bg}`,children:[e.jsx(d,{className:`w-8 h-8 mx-auto mb-2 ${s.color}`}),e.jsx("div",{className:"font-medium text-sm",children:a.badge_name}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a.badge_description})]},a.id)})}):e.jsx("p",{className:"text-center text-muted-foreground py-8",children:t("comp.loginRequired")}),e.jsxs("div",{className:"mt-8 pt-6 border-t",children:[e.jsx("h3",{className:"font-medium mb-4 text-sm text-muted-foreground",children:t("comp.allBadges")}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:Object.entries(ge).map(([a,s])=>{const d=s.icon,m=(ce||[]).some(o=>o.badge_type===a);return e.jsxs("div",{className:`p-3 rounded-lg text-center border ${m?s.bg:"opacity-40 grayscale"}`,children:[e.jsx(d,{className:`w-6 h-6 mx-auto mb-1 ${m?s.color:"text-muted-foreground"}`}),e.jsx("div",{className:"text-xs font-medium",children:t(`comp.badge.${a}`)})]},a)})})]})]})]})})]})})}),e.jsx(Ta,{language:n,isRTL:R})]})};export{Ha 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.