Spaces:
Running
Running
File size: 20,103 Bytes
4f02e2e e6a1cba 78d83a2 4f02e2e 70d9328 78d83a2 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 78d83a2 2eaffbc 70d9328 78d83a2 2eaffbc 70d9328 78d83a2 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 78d83a2 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 78d83a2 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 78d83a2 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 78d83a2 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 49c8491 2eaffbc 70d9328 49c8491 2eaffbc e6a1cba 78d83a2 2eaffbc 3ffb85a 49c8491 2eaffbc 3ffb85a 78d83a2 2eaffbc 3ffb85a 49c8491 2eaffbc 3ffb85a 78d83a2 2eaffbc e6a1cba 78d83a2 2eaffbc 4f02e2e 49c8491 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 49c8491 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 4f02e2e 78d83a2 2eaffbc 9595de1 78d83a2 2eaffbc 78d83a2 3ffb85a 77bbeba 3ffb85a e6a1cba 3ffb85a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | // بيانات الروابط (تم توليدها من ملف Excel)
const DATA = [
{
"name": "حسن عبدالله بن مهدي",
"url": "https://stat2025-map.static.hf.space/EQ/01.html"
},
{
"name": "منيره سعود بن عبدالعزيز القوز",
"url": "https://stat2025-map.static.hf.space/EQ/02.html"
},
{
"name": "نايف علي ال قحيصان",
"url": "https://stat2025-map.static.hf.space/EQ/03.html"
},
{
"name": "غلا عبدالعزيز بن هندي الفلاحي",
"url": "https://stat2025-map.static.hf.space/EQ/04.html"
},
{
"name": "مصطفى علي ال عباس",
"url": "https://stat2025-map.static.hf.space/EQ/05.html"
},
{
"name": "جمانه عزيز بن مساعد",
"url": "https://stat2025-map.static.hf.space/EQ/06.html"
},
{
"name": "ابتسام سعيد محمد الشهراني",
"url": "https://stat2025-map.static.hf.space/EQ/07.html"
},
{
"name": "وضحى هادي بن صريع",
"url": "https://stat2025-map.static.hf.space/EQ/08.html"
},
{
"name": "تهاني خالد بن عبدالله",
"url": "https://stat2025-map.static.hf.space/EQ/09.html"
},
{
"name": "محمد يعقوب السبع",
"url": "https://stat2025-map.static.hf.space/EQ/10.html"
},
{
"name": "رنا صقر بن قاسم",
"url": "https://stat2025-map.static.hf.space/EQ/11.html"
},
{
"name": "نور عيد علي الثاني",
"url": "https://stat2025-map.static.hf.space/EQ/12.html"
},
{
"name": "أشواق عبدالكريم بن محمد الحنطي",
"url": "https://stat2025-map.static.hf.space/EQ/13.html"
},
{
"name": "ياسمين عيسى المطوع",
"url": "https://stat2025-map.static.hf.space/EQ/14.html"
},
{
"name": "أميره أحمد علي علوي",
"url": "https://stat2025-map.static.hf.space/EQ/15.html"
},
{
"name": "عبدالله سالم عبدالله الهاجري",
"url": "https://stat2025-map.static.hf.space/EQ/16.html"
},
{
"name": "ابرار تركي بن محمد",
"url": "https://stat2025-map.static.hf.space/EQ/17.html"
},
{
"name": "منال أحمد بن مريع",
"url": "https://stat2025-map.static.hf.space/EQ/18.html"
},
{
"name": "دانه احمد عبده دريب",
"url": "https://stat2025-map.static.hf.space/EQ/19.html"
},
{
"name": "نور عبدالرحمن عبدالوهاب الدخيل",
"url": "https://stat2025-map.static.hf.space/EQ/20.html"
},
{
"name": "عالية محمد علي الربيع",
"url": "https://stat2025-map.static.hf.space/EQ/21.html"
},
{
"name": "خديجه حسين بن علي هنبوبه",
"url": "https://stat2025-map.static.hf.space/EQ/22.html"
},
{
"name": "أبرار ناصر ابن ثامر",
"url": "https://stat2025-map.static.hf.space/EQ/23.html"
},
{
"name": "محاسن سلطان عبدالله الأحمد",
"url": "https://stat2025-map.static.hf.space/EQ/24.html"
},
{
"name": "سارة صالح ناصر القحطاني",
"url": "https://stat2025-map.static.hf.space/EQ/25.html"
},
{
"name": "بيان سعود بن مرشد الرحيلي",
"url": "https://stat2025-map.static.hf.space/EQ/26.html"
},
{
"name": "ملاك خليفة تركي الحيمود",
"url": "https://stat2025-map.static.hf.space/EQ/27.html"
},
{
"name": "محمد صالح بن عبدالله الخضير",
"url": "https://stat2025-map.static.hf.space/EQ/28.html"
},
{
"name": "عادل صالح عواد المويس",
"url": "https://stat2025-map.static.hf.space/EQ/29.html"
},
{
"name": "أمل احمد محمد مجرشي",
"url": "https://stat2025-map.static.hf.space/EQ/30.html"
},
{
"name": "حصة عبداللطيف سعد الدوسري",
"url": "https://stat2025-map.static.hf.space/EQ/31.html"
},
{
"name": "نوف سعود بن سالم الخثعمي",
"url": "https://stat2025-map.static.hf.space/EQ/32.html"
},
{
"name": "ريم بنت محمد بن عبدالعزيز الملحم",
"url": "https://stat2025-map.static.hf.space/EQ/33.html"
},
{
"name": "أريج صالح بن عبدالله",
"url": "https://stat2025-map.static.hf.space/EQ/34.html"
},
{
"name": "بخيته عادل احمد الدوسري",
"url": "https://stat2025-map.static.hf.space/EQ/35.html"
},
{
"name": "منيرة سعد محمد القرني",
"url": "https://stat2025-map.static.hf.space/EQ/36.html"
},
{
"name": "جواهر عبدالله عامر القرني",
"url": "https://stat2025-map.static.hf.space/EQ/37.html"
},
{
"name": "قنوت محمد بن عبدالله آل حماد",
"url": "https://stat2025-map.static.hf.space/EQ/38.html"
},
{
"name": "هبه عبدالعزيز",
"url": "https://stat2025-map.static.hf.space/EQ/39.html"
},
{
"name": "عبدالهادي عون القحطاني",
"url": "https://stat2025-map.static.hf.space/EQ/40.html"
},
{
"name": "حنان حمد بن صالح المهناء",
"url": "https://stat2025-map.static.hf.space/EQ/41.html"
},
{
"name": "فاطمه حسين بن ابراهيم",
"url": "https://stat2025-map.static.hf.space/EQ/42.html"
},
{
"name": "أمل صالح بن احمد آل مزعل",
"url": "https://stat2025-map.static.hf.space/EQ/43.html"
},
{
"name": "ندى ابراهيم بن علي المنصور",
"url": "https://stat2025-map.static.hf.space/EQ/44.html"
},
{
"name": "طيبه فالح بن عبدالله الرويشد",
"url": "https://stat2025-map.static.hf.space/EQ/45.html"
},
{
"name": "نبأ عادل بن عبدالكريم",
"url": "https://stat2025-map.static.hf.space/EQ/46.html"
},
{
"name": "نجود عبدالعزيز بن عقيل العمري",
"url": "https://stat2025-map.static.hf.space/EQ/47.html"
},
{
"name": "غشمه محمد بن سعد",
"url": "https://stat2025-map.static.hf.space/EQ/48.html"
},
{
"name": "لطيفه علي بن حسين",
"url": "https://stat2025-map.static.hf.space/EQ/49.html"
},
{
"name": "غادة سعد عبدالرحمن الراحله",
"url": "https://stat2025-map.static.hf.space/EQ/50.html"
},
{
"name": "أمل جعفر بن علي آل حماد",
"url": "https://stat2025-map.static.hf.space/EQ/51.html"
},
{
"name": "بثينه بنت عبدالله بن",
"url": "https://stat2025-map.static.hf.space/EQ/52.html"
},
{
"name": "دلال بنت احمد بن حسن المدني",
"url": "https://stat2025-map.static.hf.space/EQ/53.html"
},
{
"name": "زهره علي بن حسن",
"url": "https://stat2025-map.static.hf.space/EQ/54.html"
},
{
"name": "حسين علي بن صالح الربيعه",
"url": "https://stat2025-map.static.hf.space/EQ/55.html"
},
{
"name": "ساره خالد سليمان المحيسن",
"url": "https://stat2025-map.static.hf.space/EQ/56.html"
},
{
"name": "زهراء بنت عايش بن علي الصاهود",
"url": "https://stat2025-map.static.hf.space/EQ/57.html"
},
{
"name": "فايزه محمد مسعود الحازمي",
"url": "https://stat2025-map.static.hf.space/EQ/58.html"
},
{
"name": "ايمان عبدالعزيز بن صالح",
"url": "https://stat2025-map.static.hf.space/EQ/59.html"
},
{
"name": "ساره حسين بن عبدالهادي بوخمسين",
"url": "https://stat2025-map.static.hf.space/EQ/60.html"
},
{
"name": "فيصل تركي فيصل القحطاني",
"url": "https://stat2025-map.static.hf.space/EQ/61.html"
},
{
"name": "عبدالاله عبدالله بن عبدالله العيسى",
"url": "https://stat2025-map.static.hf.space/EQ/62.html"
},
{
"name": "خليفه عباس بن عبدالله الفرج",
"url": "https://stat2025-map.static.hf.space/EQ/63.html"
},
{
"name": "عبدالعزيز بن ناصر بن",
"url": "https://stat2025-map.static.hf.space/EQ/64.html"
},
{
"name": "أحمد ابن عبود بن",
"url": "https://stat2025-map.static.hf.space/EQ/65.html"
},
{
"name": "حنين محمد مبارك آل مبارك",
"url": "https://stat2025-map.static.hf.space/EQ/66.html"
},
{
"name": "الجازي معيض هادي ال دعلان",
"url": "https://stat2025-map.static.hf.space/EQ/67.html"
},
{
"name": "شريفه ابراهيم بن عبدالله العقيل",
"url": "https://stat2025-map.static.hf.space/EQ/68.html"
},
{
"name": "أروى سعيد بن عبدالله",
"url": "https://stat2025-map.static.hf.space/EQ/69.html"
},
{
"name": "لطيفه صالح العبدالقادر",
"url": "https://stat2025-map.static.hf.space/EQ/70.html"
},
{
"name": "لين أحمد بن عبدالعزيز القصير",
"url": "https://stat2025-map.static.hf.space/EQ/71.html"
},
{
"name": "لولوه بدر بن حمد الصياح",
"url": "https://stat2025-map.static.hf.space/EQ/72.html"
},
{
"name": "شيماء عبدالرحمن بن دحباش سودي",
"url": "https://stat2025-map.static.hf.space/EQ/73.html"
},
{
"name": "عمر عبدالله عبدالرحمن القاسم",
"url": "https://stat2025-map.static.hf.space/EQ/74.html"
},
{
"name": "سلافه عباس محمد العلوي",
"url": "https://stat2025-map.static.hf.space/EQ/75.html"
},
{
"name": "نيللي حسين عبدالله الجعص",
"url": "https://stat2025-map.static.hf.space/EQ/76.html"
},
{
"name": "اسعد بن ماجد بن",
"url": "https://stat2025-map.static.hf.space/EQ/77.html"
},
{
"name": "مرتضى عبدالجليل بن عيسى",
"url": "https://stat2025-map.static.hf.space/EQ/78.html"
},
{
"name": "غفران احمد بن علي",
"url": "https://stat2025-map.static.hf.space/EQ/79.html"
},
{
"name": "حوراء زكي بن احمد آل عباس",
"url": "https://stat2025-map.static.hf.space/EQ/80.html"
},
{
"name": "ابرار بنت يوسف بن علي آل حماد",
"url": "https://stat2025-map.static.hf.space/EQ/81.html"
},
{
"name": "زكي بن عيسى بن",
"url": "https://stat2025-map.static.hf.space/EQ/82.html"
},
{
"name": "يحي علي بن يحي المسين",
"url": "https://stat2025-map.static.hf.space/EQ/83.html"
},
{
"name": "أماني مصطفى عبدالله الطيب",
"url": "https://stat2025-map.static.hf.space/EQ/84.html"
},
{
"name": "احلام صالح معيوض العصيمي",
"url": "https://stat2025-map.static.hf.space/EQ/85.html"
},
{
"name": "مهنا فهيد مساعد القثامي",
"url": "https://stat2025-map.static.hf.space/EQ/86.html"
},
{
"name": "جواهر فرحان بن فضي",
"url": "https://stat2025-map.static.hf.space/EQ/87.html"
},
{
"name": "فاطمه حسين محمد معشي",
"url": "https://stat2025-map.static.hf.space/EQ/88.html"
},
{
"name": "احمد علي بن عايض",
"url": "https://stat2025-map.static.hf.space/EQ/89.html"
},
{
"name": "يعقوب حمد هادي مشول",
"url": "https://stat2025-map.static.hf.space/EQ/90.html"
},
{
"name": "روان سعود مرشد الرحيلي",
"url": "https://stat2025-map.static.hf.space/EQ/91.html"
},
{
"name": "عائشه سليمان بن نايف الحربي",
"url": "https://stat2025-map.static.hf.space/EQ/92.html"
},
{
"name": "أديب خالد بن شباب السبيعي",
"url": "https://stat2025-map.static.hf.space/EQ/93.html"
},
{
"name": "حسين جاسم بن علي الهزيم",
"url": "https://stat2025-map.static.hf.space/EQ/94.html"
},
{
"name": "ماجد سعد ناصر السبيعي",
"url": "https://stat2025-map.static.hf.space/EQ/95.html"
},
{
"name": "ماجد فايز العبدالعظيم العبدالعظيم",
"url": "https://stat2025-map.static.hf.space/EQ/96.html"
},
{
"name": "حسن عادل بن حسين",
"url": "https://stat2025-map.static.hf.space/EQ/97.html"
},
{
"name": "باقر عبدالله هاشم الهاشم",
"url": "https://stat2025-map.static.hf.space/EQ/98.html"
},
{
"name": "خالد احمد بن عبدالله",
"url": "https://stat2025-map.static.hf.space/EQ/99.html"
},
{
"name": "هيا عبدالله عبدالعزيز اليحيا",
"url": "https://stat2025-map.static.hf.space/EQ/100.html"
},
{
"name": "محمد عبدالمنعم محمد عبدالقادر",
"url": "https://stat2025-map.static.hf.space/EQ/101.html"
},
{
"name": "هشام جمال الملاء",
"url": "https://stat2025-map.static.hf.space/EQ/102.html"
},
{
"name": "سالم عبدالله بن عبدالرحمن",
"url": "https://stat2025-map.static.hf.space/EQ/103.html"
},
{
"name": "سره محمد بن خالد",
"url": "https://stat2025-map.static.hf.space/EQ/104.html"
},
{
"name": "أمل بنت علي بن",
"url": "https://stat2025-map.static.hf.space/EQ/105.html"
},
{
"name": "نورة عبدالله مانع الخالدي",
"url": "https://stat2025-map.static.hf.space/EQ/106.html"
},
{
"name": "مصطفى احمد بن جمعه الرمضان",
"url": "https://stat2025-map.static.hf.space/EQ/107.html"
},
{
"name": "ساره عبدالحميد بن حسين",
"url": "https://stat2025-map.static.hf.space/EQ/108.html"
},
{
"name": "نوف صالح بن محمد",
"url": "https://stat2025-map.static.hf.space/EQ/109.html"
},
{
"name": "منيره سعد بن احمد الجديدي",
"url": "https://stat2025-map.static.hf.space/EQ/110.html"
},
{
"name": "عقيله محمدحسين بن علي",
"url": "https://stat2025-map.static.hf.space/EQ/111.html"
},
{
"name": "تركي وحيد بن عيسى المحيفيظ",
"url": "https://stat2025-map.static.hf.space/EQ/112.html"
},
{
"name": "سميه سامى بن احمد",
"url": "https://stat2025-map.static.hf.space/EQ/113.html"
},
{
"name": "صالح دلي بن عقلاء",
"url": "https://stat2025-map.static.hf.space/EQ/114.html"
},
{
"name": "عبدالمجيد مشعل محمد الحربي",
"url": "https://stat2025-map.static.hf.space/EQ/115.html"
},
{
"name": "فوز عائد نومان المطيري",
"url": "https://stat2025-map.static.hf.space/EQ/116.html"
},
{
"name": "اسامه عمر عبده حمدي",
"url": "https://stat2025-map.static.hf.space/EQ/117.html"
},
{
"name": "محمد فهد محمد الحربي",
"url": "https://stat2025-map.static.hf.space/EQ/118.html"
},
{
"name": "ناصر عبدالله بن ناصر",
"url": "https://stat2025-map.static.hf.space/EQ/119.html"
},
{
"name": "احمد متعب بن عوض",
"url": "https://stat2025-map.static.hf.space/EQ/120.html"
}
]
function normalizeArabic(s) {
if (!s) return "";
return String(s)
.trim()
.toLowerCase()
.replace(/[\u064B-\u065F\u0670\u06D6-\u06ED]/g, "")
.replace(/\u0640/g, "")
.replace(/[إأآٱ]/g, "ا")
.replace(/ى/g, "ي")
.replace(/ة/g, "ه")
.replace(/^ال\s+/g, "")
.replace(/\s+/g, " ");
}
function escapeHtml(str) {
return String(str)
.replaceAll("&", "&")
.replaceAll("<", "<")
.replaceAll(">", ">")
.replaceAll('"', """)
.replaceAll("'", "'");
}
function highlightMatch(name, rawQuery) {
if (!rawQuery) return escapeHtml(name);
const tokens = rawQuery.trim().split(/\s+/).filter(Boolean);
if (!tokens.length) return escapeHtml(name);
const t = tokens[0];
const idx = name.indexOf(t);
if (idx === -1) return escapeHtml(name);
const before = escapeHtml(name.slice(0, idx));
const mid = escapeHtml(name.slice(idx, idx + t.length));
const after = escapeHtml(name.slice(idx + t.length));
return `${before}<mark>${mid}</mark>${after}`;
}
const elQ = document.getElementById("q");
const elResults = document.getElementById("results");
const elCount = document.getElementById("countPill");
const elTotal = document.getElementById("totalChip");
const toast = document.getElementById("toast");
const toastText = document.getElementById("toastText");
elTotal.innerHTML = `إجمالي: <b>${DATA.length}</b>`;
function showToast(msg = "تم نسخ الرابط") {
toastText.textContent = msg;
toast.classList.add("show");
clearTimeout(window.__toastT);
window.__toastT = setTimeout(() => toast.classList.remove("show"), 1200);
}
async function copyLink(url) {
try {
await navigator.clipboard.writeText(url);
showToast();
} catch (e) {
const ta = document.createElement("textarea");
ta.value = url;
document.body.appendChild(ta);
ta.select();
document.execCommand("copy");
document.body.removeChild(ta);
showToast();
}
}
function renderResults(list, rawQuery) {
elResults.innerHTML = "";
if (!list.length) {
elCount.textContent = "النتائج: 0";
elResults.innerHTML = `<div class="empty">لا توجد نتائج</div>`;
return;
}
elCount.textContent = `النتائج: ${list.length}`;
const frag = document.createDocumentFragment();
list.forEach(item => {
const row = document.createElement("div");
row.className = "result";
const nm = document.createElement("div");
nm.className = "name";
nm.innerHTML = highlightMatch(item.name, rawQuery);
const actions = document.createElement("div");
actions.className = "actions";
const open = document.createElement("a");
open.className = "openBtn";
open.href = item.url;
open.target = "_blank";
open.rel = "noopener";
open.innerHTML = `فتح <span aria-hidden="true">↗</span>`;
const copy = document.createElement("button");
copy.className = "copyBtn";
copy.type = "button";
copy.innerHTML = `نسخ <span aria-hidden="true">⧉</span>`;
copy.addEventListener("click", () => copyLink(item.url));
actions.appendChild(open);
actions.appendChild(copy);
row.appendChild(nm);
row.appendChild(actions);
frag.appendChild(row);
});
elResults.appendChild(frag);
}
function doSearch() {
const raw = (elQ.value || "").trim();
const q = normalizeArabic(raw);
if (!q) {
elCount.textContent = "النتائج: 0";
elResults.innerHTML = "";
return;
}
const tokens = q.split(" ").filter(Boolean);
const matched = DATA.filter(d => {
const nameNorm = normalizeArabic(d.name);
return tokens.every(t => nameNorm.includes(t));
});
matched.sort((a, b) => {
const al = (a.name || "").length;
const bl = (b.name || "").length;
if (al !== bl) return al - bl;
return (a.name || "").localeCompare(b.name || "", "ar");
});
renderResults(matched, raw);
}
document.getElementById("btnSearch").addEventListener("click", doSearch);
document.getElementById("btnClear").addEventListener("click", () => {
elQ.value = "";
elQ.focus();
elResults.innerHTML = "";
elCount.textContent = "النتائج: 0";
});
let t = null;
elQ.addEventListener("input", () => {
clearTimeout(t);
t = setTimeout(doSearch, 140);
});
elQ.addEventListener("keydown", (e) => {
if (e.key === "Enter") doSearch();
});
// حفظ آخر بحث
try {
const last = localStorage.getItem("maps_last_query");
if (last) {
elQ.value = last;
doSearch();
}
elQ.addEventListener("input", () => {
localStorage.setItem("maps_last_query", elQ.value || "");
});
} catch(_){}
elCount.textContent = "النتائج: 0";
|