Spaces:
Running
Running
File size: 23,255 Bytes
df532c0 | 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 | <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Unavailable</title>
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" crossorigin="anonymous"
onload="renderMathInElement(document.body,{delimiters:[{left:'$$',right:'$$',display:true},{left:'$',right:'$',display:false}],throwOnError:false});"></script>
<link rel="stylesheet" href="../style.css">
</head>
<body><script src="../script.js" defer></script>
<div class="background"></div>
<main class="article">
<a class="back" href="../index.html">← Back</a>
<div class="meta">Not found · Seton Labs</div>
<h1>Oops, the content is not ready yet, come back later.</h1>
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-150.5345 -78.8671 168.0317 208.9257" width="168.032px" height="208.926px">
<path d="M 4333.27 2094.63 C 4331.27 2092.63 4309.27 2087.63 4285.27 2083.63 C 4165.27 2065.63 4038.28 2000.63 3941.28 1905.63 C 3859.28 1825.63 3827.28 1781.63 3789.28 1694.63 C 3729.28 1557.63 3719.28 1359.63 3767.28 1241.63 C 3781.28 1207.63 3789.28 1177.63 3786.28 1174.63 C 3783.28 1171.63 3786.28 1168.63 3792.28 1168.63 C 3799.28 1168.63 3804.28 1161.63 3804.28 1152.63 C 3804.28 1144.63 3810.28 1131.63 3817.28 1124.63 C 3823.28 1116.63 3836.28 1100.63 3844.28 1087.63 C 3870.28 1046.63 4159.27 769.633 4185.27 760.633 C 4190.27 758.633 4191.27 751.633 4188.27 746.633 C 4184.27 740.633 4185.27 737.633 4190.27 740.633 C 4195.27 742.633 4212.27 732.633 4229.27 716.633 L 4259.27 688.633 L 4126.27 687.633 C 4054.28 686.633 3985.28 686.633 3974.28 686.633 C 3938.28 686.633 3933.28 688.633 3940.28 701.633 C 3944.28 707.633 3944.28 710.633 3940.28 706.633 C 3936.28 703.633 3921.28 709.633 3907.28 721.633 C 3873.28 751.633 3845.28 757.633 3806.28 741.633 C 3763.28 723.633 3732.28 673.633 3739.28 632.633 C 3744.28 605.633 3738.28 594.633 3706.28 559.633 C 3674.28 524.633 3662.28 518.633 3628.28 518.633 C 3529.28 518.633 3484.28 379.633 3567.28 327.633 C 3608.28 301.633 3667.28 307.633 3695.28 339.633 C 3710.28 357.633 3729.28 364.633 3773.28 368.633 C 3848.28 375.633 3880.28 366.633 3925.28 326.633 C 4042.28 220.633 4102.27 186.633 4224.27 158.633 C 4316.27 138.633 4385.27 141.633 4486.27 173.633 C 4699.27 239.633 4845.27 431.633 4845.27 647.633 C 4845.27 737.633 4837.27 789.633 4818.27 827.633 C 4810.27 841.633 4804.27 856.633 4804.27 860.633 C 4804.27 864.633 4793.27 884.633 4779.27 904.633 C 4765.27 924.633 4750.27 958.633 4744.27 978.633 C 4728.27 1039.63 4699.27 1068.63 4654.27 1068.63 C 4621.27 1068.63 4611.27 1062.63 4583.27 1026.63 C 4565.27 1002.63 4554.27 986.633 4558.27 990.633 C 4563.27 994.633 4576.27 980.633 4586.27 958.633 C 4600.27 930.633 4614.27 916.633 4633.27 912.633 C 4678.27 903.633 4688.27 893.633 4721.27 830.633 C 4859.27 561.633 4642.27 228.633 4329.27 228.633 C 4223.27 228.633 4141.27 257.633 4050.28 325.633 C 4008.28 356.633 3977.28 385.633 3981.28 391.633 C 3984.28 397.633 3982.28 398.633 3976.28 394.633 C 3969.28 390.633 3964.28 391.633 3964.28 397.633 C 3964.28 402.633 3948.28 416.633 3928.28 429.633 C 3899.28 447.633 3876.28 451.633 3808.28 452.633 C 3762.28 452.633 3724.28 454.633 3724.28 456.633 C 3724.28 458.633 3739.28 478.633 3758.28 500.633 C 3789.28 536.633 3798.28 540.633 3843.28 542.633 C 3903.28 544.633 3887.28 554.633 4074.28 389.633 C 4110.27 357.633 4185.27 317.633 4243.27 299.633 C 4312.27 277.633 4434.27 291.633 4510.27 331.633 C 4642.27 399.633 4723.27 569.633 4694.27 718.633 C 4675.27 820.633 4652.27 851.633 4479.27 1004.63 C 4419.27 1058.63 4364.27 1107.63 4358.27 1113.63 C 4352.27 1118.63 4305.27 1161.63 4255.27 1207.63 C 4135.27 1316.63 4110.27 1363.63 4116.27 1463.63 C 4123.27 1573.63 4173.27 1646.63 4272.27 1695.63 C 4373.27 1745.63 4499.27 1727.63 4577.27 1653.63 C 4589.27 1642.63 4622.27 1615.63 4649.27 1593.63 C 4677.27 1572.63 4712.27 1541.63 4728.27 1526.63 L 4758.27 1498.63 L 4612.27 1498.63 C 4480.27 1498.63 4465.27 1500.63 4449.27 1518.63 C 4439.27 1529.63 4417.27 1546.63 4399.27 1556.63 C 4368.27 1575.63 4367.27 1575.63 4325.27 1555.63 C 4211.27 1502.63 4249.27 1349.63 4375.27 1348.63 C 4414.27 1347.63 4425.27 1341.63 4474.27 1297.63 C 4504.27 1269.63 4574.27 1205.63 4629.27 1155.63 C 4683.27 1104.63 4743.27 1047.63 4762.27 1028.63 C 4806.27 984.633 4854.27 909.633 4854.27 887.633 C 4854.27 877.633 4858.27 868.633 4864.27 866.633 C 4881.27 860.633 4904.27 745.633 4904.27 663.633 C 4903.27 504.633 4854.27 388.633 4735.27 268.633 C 4632.27 163.633 4517.27 107.633 4381.27 93.633 C 4294.27 85.633 4264.27 59.633 4300.27 24.633 C 4319.27 4.633 4350.27 4.633 4435.27 22.633 C 4568.27 50.633 4622.27 72.633 4714.27 139.633 C 4902.27 275.633 5005.27 484.633 4991.27 700.633 C 4983.27 830.633 4962.27 894.633 4895.27 998.633 C 4856.27 1056.63 4854.27 1059.63 4708.27 1193.63 C 4654.27 1243.63 4586.27 1306.63 4557.27 1335.63 C 4528.27 1363.63 4498.27 1388.63 4491.27 1391.63 C 4460.27 1402.63 4502.27 1408.63 4632.27 1410.63 C 4773.27 1412.63 4774.27 1412.63 4802.27 1385.63 C 4819.27 1369.63 4845.27 1356.63 4869.27 1353.63 C 4903.27 1349.63 4911.27 1353.63 4941.27 1383.63 C 4968.27 1411.63 4974.27 1425.63 4974.27 1460.63 C 4975.27 1497.63 4981.27 1509.63 5019.27 1547.63 C 5058.27 1587.63 5067.27 1592.63 5103.27 1590.63 C 5140.27 1587.63 5146.27 1591.63 5174.27 1629.63 C 5190.27 1652.63 5204.27 1678.63 5204.27 1685.63 C 5204.27 1715.63 5173.27 1764.63 5144.27 1782.63 C 5118.27 1797.63 5108.27 1798.63 5077.27 1787.63 C 5056.27 1780.63 5031.27 1764.63 5021.27 1752.63 C 5004.27 1730.63 4997.27 1728.63 4916.27 1732.63 C 4843.27 1735.63 4827.27 1739.63 4813.27 1757.63 C 4803.27 1768.63 4793.27 1778.63 4790.27 1778.63 C 4788.27 1778.63 4769.27 1793.63 4748.27 1812.63 C 4728.27 1830.63 4679.27 1863.63 4640.27 1885.63 C 4404.27 2017.63 4116.27 1946.63 3963.28 1718.63 C 3910.28 1640.63 3891.28 1573.63 3886.28 1452.63 C 3882.28 1349.63 3884.28 1337.63 3908.28 1284.63 C 3922.28 1253.63 3934.28 1225.63 3934.28 1223.63 C 3934.28 1220.63 3945.28 1200.63 3959.28 1178.63 C 3973.28 1156.63 3984.28 1127.63 3984.28 1114.63 C 3984.28 1091.63 4033.28 1038.63 4055.28 1038.63 C 4076.28 1038.63 4122.27 1068.63 4138.27 1092.63 C 4154.27 1117.63 4153.27 1120.63 4130.27 1156.63 C 4113.27 1183.63 4095.28 1198.63 4066.28 1206.63 C 4031.28 1217.63 4024.28 1225.63 4000.28 1277.63 C 3910.28 1478.63 4005.28 1726.63 4209.27 1823.63 C 4344.27 1887.63 4462.27 1886.63 4590.27 1818.63 C 4663.27 1780.63 4680.27 1767.63 4743.27 1710.63 C 4806.27 1652.63 4813.27 1649.63 4912.27 1647.63 L 5005.27 1645.63 L 4959.27 1600.63 C 4919.27 1561.63 4908.27 1555.63 4866.27 1554.63 C 4820.27 1553.63 4801.27 1562.63 4755.27 1609.63 C 4711.27 1655.63 4585.27 1752.63 4545.27 1773.63 C 4463.27 1814.63 4358.27 1820.63 4269.27 1789.63 C 4096.27 1728.63 3990.28 1532.63 4038.28 1364.63 C 4062.28 1284.63 4098.27 1232.63 4182.27 1158.63 C 4252.27 1097.63 4297.27 1056.63 4487.27 884.633 C 4583.27 797.633 4614.27 743.633 4614.27 660.633 C 4614.27 541.633 4559.27 452.633 4452.27 399.633 C 4407.27 376.633 4377.27 368.633 4338.27 368.633 C 4284.27 368.633 4181.27 399.633 4154.27 424.633 C 4146.27 432.633 4119.27 456.633 4094.28 477.633 C 3994.28 564.633 3963.28 596.633 3976.28 600.633 C 3983.28 603.633 4050.28 604.633 4124.27 603.633 L 4259.27 602.633 L 4291.27 570.633 C 4365.27 496.633 4483.27 560.633 4467.27 666.633 C 4459.27 713.633 4399.27 757.633 4347.27 753.633 C 4306.27 751.633 4314.27 745.633 4165.27 883.633 C 4123.27 922.633 4060.28 981.633 4024.28 1013.63 C 3988.28 1046.63 3958.28 1076.63 3956.28 1080.63 C 3954.28 1083.63 3942.28 1099.63 3928.28 1115.63 C 3892.28 1155.63 3856.28 1228.63 3839.28 1295.63 C 3824.28 1352.63 3817.28 1508.63 3828.28 1526.63 C 3831.28 1531.63 3836.28 1553.63 3840.28 1574.63 C 3867.28 1744.63 4074.28 1954.63 4254.27 1994.63 C 4303.27 2005.63 4303.27 2005.63 4357.27 2006.63 C 4396.27 2008.63 4406.27 2012.63 4415.27 2032.63 C 4432.27 2068.63 4412.27 2098.63 4370.27 2098.63 C 4352.27 2098.63 4335.27 2096.63 4333.27 2094.63 Z M 4403.27 2042.63 C 4396.27 2033.63 4372.27 2028.63 4342.27 2028.63 C 4280.27 2028.63 4157.27 1987.63 4084.28 1943.63 C 4013.28 1899.63 3925.28 1809.63 3879.28 1733.63 C 3771.28 1553.63 3772.28 1311.63 3882.28 1143.63 C 3921.28 1083.63 3972.28 1031.63 4196.27 825.633 C 4302.27 727.633 4315.27 718.633 4334.27 728.633 C 4381.27 753.633 4454.27 702.633 4454.27 646.633 C 4454.27 604.633 4406.27 558.633 4362.27 558.633 C 4325.27 559.633 4303.27 572.633 4285.27 605.633 C 4274.27 628.633 4270.27 628.633 4099.27 628.633 C 3973.28 628.633 3925.28 625.633 3922.28 616.633 C 3916.28 600.633 4125.27 417.633 4189.27 381.633 C 4234.27 356.633 4249.27 353.633 4329.27 353.633 C 4407.27 353.633 4426.27 357.633 4469.27 380.633 C 4628.27 464.633 4690.27 662.633 4600.27 799.633 C 4587.27 818.633 4484.27 917.633 4373.27 1017.63 C 4130.27 1236.63 4109.27 1257.63 4077.28 1326.63 C 4049.28 1387.63 4043.28 1481.63 4065.28 1546.63 C 4083.28 1601.63 4137.27 1682.63 4176.27 1711.63 C 4251.27 1768.63 4294.27 1782.63 4384.27 1783.63 C 4461.27 1783.63 4476.27 1780.63 4534.27 1751.63 C 4572.27 1732.63 4643.27 1679.63 4704.27 1626.63 L 4809.27 1533.63 L 4867.27 1534.63 C 4923.27 1535.63 4927.27 1536.63 4979.27 1588.63 C 5009.27 1618.63 5030.27 1646.63 5027.27 1654.63 C 5023.27 1665.63 4997.27 1668.63 4924.27 1668.63 L 4826.27 1668.63 L 4743.27 1739.63 C 4658.27 1811.63 4614.27 1838.63 4540.27 1865.63 C 4251.27 1969.63 3944.28 1752.63 3944.28 1443.63 C 3944.28 1358.63 3963.28 1290.63 4004.28 1225.63 C 4028.28 1187.63 4038.28 1178.63 4054.28 1183.63 C 4067.28 1187.63 4082.28 1181.63 4099.27 1164.63 C 4128.27 1135.63 4130.27 1121.63 4108.27 1090.63 C 4078.28 1046.63 4004.28 1070.63 4004.28 1125.63 C 4004.28 1138.63 3988.28 1177.63 3968.28 1210.63 C 3919.28 1295.63 3900.28 1374.63 3907.28 1473.63 C 3923.28 1724.63 4138.27 1928.63 4388.27 1928.63 C 4528.27 1928.63 4626.27 1888.63 4755.27 1776.63 L 4834.27 1708.63 L 4927.27 1708.63 C 5018.27 1708.63 5021.27 1709.63 5032.27 1733.63 C 5055.27 1784.63 5127.27 1788.63 5164.27 1741.63 C 5192.27 1705.63 5190.27 1663.63 5158.27 1632.63 C 5138.27 1611.63 5126.27 1607.63 5096.27 1611.63 C 5062.27 1615.63 5054.27 1611.63 5003.27 1561.63 C 4949.27 1508.63 4947.27 1505.63 4952.27 1463.63 C 4956.27 1426.63 4953.27 1416.63 4931.27 1394.63 C 4915.27 1378.63 4894.27 1368.63 4876.27 1368.63 C 4843.27 1368.63 4794.27 1402.63 4794.27 1424.63 C 4794.27 1443.63 4449.27 1445.63 4441.27 1425.63 C 4439.27 1418.63 4517.27 1339.63 4622.27 1243.63 C 4866.27 1019.63 4904.27 970.633 4946.27 828.633 C 4970.27 746.633 4972.27 597.633 4950.27 515.633 C 4902.27 339.633 4770.27 177.633 4609.27 98.633 C 4491.27 40.633 4314.27 13.633 4306.27 51.633 C 4303.27 65.633 4310.27 68.633 4341.27 68.633 C 4409.27 68.633 4517.27 97.633 4594.27 134.633 C 4700.27 186.633 4820.27 307.633 4869.27 409.633 C 4939.27 557.633 4950.27 706.633 4900.27 849.633 C 4864.27 953.633 4816.27 1014.63 4643.27 1173.63 C 4408.27 1390.63 4410.27 1388.63 4399.27 1377.63 C 4364.27 1342.63 4274.27 1399.63 4274.27 1456.63 C 4274.27 1494.63 4323.27 1548.63 4356.27 1548.63 C 4387.27 1547.63 4424.27 1526.63 4438.27 1499.63 C 4449.27 1479.63 4459.27 1477.63 4623.27 1472.63 C 4785.27 1466.63 4796.27 1467.63 4792.27 1484.63 C 4791.27 1494.63 4735.27 1548.63 4669.27 1605.63 C 4528.27 1727.63 4476.27 1752.63 4374.27 1746.63 C 4231.27 1738.63 4115.27 1633.63 4089.28 1487.63 C 4080.28 1435.63 4100.27 1347.63 4132.27 1300.63 C 4147.27 1279.63 4238.27 1190.63 4334.27 1103.63 C 4599.27 865.633 4625.27 838.633 4651.27 780.633 C 4685.27 707.633 4682.27 578.633 4644.27 504.633 C 4571.27 359.633 4408.27 282.633 4253.27 318.633 C 4178.27 335.633 4136.27 362.633 4004.28 477.633 C 3917.28 553.633 3887.28 574.633 3877.28 566.633 C 3870.28 560.633 3848.28 558.633 3826.28 561.633 C 3791.28 567.633 3787.28 565.633 3742.28 513.633 C 3675.28 438.633 3681.28 428.633 3801.28 428.633 L 3895.28 428.633 L 3977.28 357.633 C 4027.28 313.633 4089.28 271.633 4134.27 249.633 C 4207.27 214.633 4212.27 213.633 4329.27 213.633 C 4448.27 213.633 4451.27 213.633 4524.27 250.633 C 4621.27 298.633 4694.27 371.633 4742.27 467.633 C 4774.27 532.633 4779.27 551.633 4782.27 633.633 C 4785.27 698.633 4782.27 741.633 4770.27 780.633 C 4750.27 849.633 4694.27 933.633 4668.27 933.633 C 4608.27 934.633 4579.27 979.633 4609.27 1024.63 C 4639.27 1071.63 4720.27 1042.63 4713.27 986.633 C 4711.27 972.633 4723.27 945.633 4742.27 919.633 C 4871.27 743.633 4844.27 480.633 4680.27 315.633 C 4576.27 210.633 4446.27 161.633 4293.27 170.633 C 4160.27 178.633 4072.28 219.633 3948.28 332.633 L 3888.28 386.633 L 3796.28 390.633 C 3745.28 392.633 3704.28 389.633 3704.28 385.633 C 3704.28 381.633 3693.28 366.633 3679.28 353.633 C 3649.28 322.633 3606.28 321.633 3570.28 349.633 C 3549.28 365.633 3544.28 378.633 3544.28 413.633 C 3544.28 470.633 3580.28 502.633 3636.28 495.633 C 3671.28 490.633 3676.28 493.633 3717.28 541.633 C 3755.28 586.633 3760.28 598.633 3756.28 629.633 C 3754.28 649.633 3757.28 676.633 3764.28 688.633 C 3778.28 714.633 3836.28 740.633 3861.28 731.633 C 3885.28 723.633 3924.28 687.633 3924.28 674.633 C 3924.28 657.633 4278.27 664.633 4282.27 680.633 C 4283.27 687.633 4218.27 754.633 4137.27 828.633 C 3861.28 1080.63 3823.28 1127.63 3780.28 1277.63 C 3759.28 1348.63 3759.28 1515.63 3779.28 1592.63 C 3847.28 1854.63 4078.28 2044.63 4359.27 2071.63 C 4398.27 2074.63 4419.27 2061.63 4403.27 2042.63 Z" style="fill: rgb(255, 255, 255);" transform="matrix(0.10000000149011612, 0, 0, -0.10000000149011612, -502.9297790527344, 130.99588012695315)"/>
</svg>
<script> /* ========================================================== SYNTAX HIGHLIGHTING ========================================================== */ const PY_KW = new Set([ 'def','class','return','if','elif','else','for','while','import','from','as', 'try','except','finally','with','yield','lambda','pass','break','continue', 'raise','and','or','not','in','is','global','nonlocal','assert','del', 'async','await' ]); const JS_KW = new Set([ 'const','let','var','function','return','if','else','for','while','do', 'switch','case','break','continue','new','class','extends','import','export', 'from','default','try','catch','finally','throw','typeof','instanceof', 'in','of','async','await','yield','void','delete','with' ]); const PY_BI = new Set([ 'print','len','range','int','str','float','list','dict','set','tuple','bool', 'type','isinstance','input','open','map','filter','zip','enumerate','sorted', 'reversed','sum','min','max','abs','round','any','all','super','property', 'staticmethod','classmethod','True','False','None','Exception','ValueError', 'TypeError','KeyError','IndexError','AttributeError','NotImplementedError', 'RuntimeError','StopIteration','FileNotFoundError','object' ]); const JS_BI = new Set([ 'console','Math','Array','Object','String','Number','Boolean','Date','RegExp', 'Error','TypeError','RangeError','SyntaxError','JSON','Promise','Map','Set', 'Symbol','Proxy','Reflect','parseInt','parseFloat','isNaN','isFinite', 'undefined','null','true','false','NaN','Infinity' ]); function escapeHtml(s) { return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); } function detectLang(code) { let py = 0, js = 0; const pyP = /\b(def |class |import |from \w+ import|elif |print\(|True|False|None|self[\.\[])\b/g; const jsP = /\b(const |let |var |function |=>|console\.|undefined|null|async |await )\b/g; let m; while ((m = pyP.exec(code)) !== null) py++; while ((m = jsP.exec(code)) !== null) js++; if (py > js) return 'python'; if (js > 0) return 'javascript'; return 'text'; } function highlight(code) { const lang = detectLang(code); const kw = lang === 'python' ? PY_KW : lang === 'javascript' ? JS_KW : new Set(); const bi = lang === 'python' ? PY_BI : lang === 'javascript' ? JS_BI : new Set(); const tokens = []; let i = 0; const len = code.length; while (i < len) { if (lang === 'python') { const t3 = code.slice(i, i + 3); if (t3 === '"""' || t3 === "'''") { const end = code.indexOf(t3, i + 3); const span = end !== -1 ? code.slice(i, end + 3) : code.slice(i); tokens.push({ type: 'string', text: span }); i += span.length; continue; } } { const pm = code.slice(i).match(/^[frbFRB]{0,3}/); if (pm) { const pLen = pm[0].length; const nc = code[i + pLen]; if (nc === '"' || nc === "'") { const q = nc; const isF = pm[0].toLowerCase().includes('f'); let depth = 0, k = i + pLen + 1; let found = false; while (k < len) { const ch = code[k]; if (ch === '\\') { k += 2; continue; } if (isF) { if (ch === '{') { depth++; k++; continue; } if (ch === '}') { depth = Math.max(0, depth - 1); k++; continue; } } if (ch === q && depth === 0) { found = true; break; } k++; } if (found) { tokens.push({ type: 'string', text: code.slice(i, k + 1) }); i = k + 1; continue; } } } } if (lang === 'python' && code[i] === '#') { let end = code.indexOf('\n', i); if (end === -1) end = len; tokens.push({ type: 'comment', text: code.slice(i, end) }); i = end; continue; } if (lang === 'javascript' && code.slice(i, i + 2) === '//') { let end = code.indexOf('\n', i); if (end === -1) end = len; tokens.push({ type: 'comment', text: code.slice(i, end) }); i = end; continue; } if (lang === 'javascript' && code.slice(i, i + 2) === '/*') { let end = code.indexOf('*/', i + 2); if (end === -1) end = len; else end += 2; tokens.push({ type: 'comment', text: code.slice(i, end) }); i = end; continue; } { const m = code.slice(i).match( /^(0x[0-9a-fA-F_]+|0b[01_]+|0o[0-7_]+|\d[\d_]*\.?\d*(?:e[+-]?\d+)?)/ ); if (m) { tokens.push({ type: 'number', text: m[0] }); i += m[0].length; continue; } } if (lang === 'python' && code[i] === '@') { const m = code.slice(i).match(/^@[\w.]+/); if (m) { tokens.push({ type: 'decorator', text: m[0] }); i += m[0].length; continue; } } { const m = code.slice(i).match(/^\w+/); if (m) { const w = m[0]; let type = 'plain'; if (kw.has(w)) type = 'keyword'; else if (bi.has(w)) type = 'builtin'; else if (w === 'self' || w === 'cls' || w === 'this') type = 'self'; else { let j = i + w.length; while (j < len && code[j] === ' ') j++; if (code[j] === '(') type = 'function'; } tokens.push({ type, text: w }); i += w.length; continue; } } { const m = code.slice(i).match(/^[+\-*/%=<>!&|^~:]+/); if (m) { tokens.push({ type: 'operator', text: m[0] }); i += m[0].length; continue; } } if ('(){}[],;.'.includes(code[i])) { tokens.push({ type: 'punctuation', text: code[i] }); i++; continue; } { const m = code.slice(i).match(/^\s+/); if (m) { tokens.push({ type: 'plain', text: m[0] }); i += m[0].length; } else { tokens.push({ type: 'plain', text: code[i] }); i++; } } } return tokens.map(t => { const esc = escapeHtml(t.text); return t.type === 'plain' ? esc : <span class="tok-${t.type}">${esc}</span>; }).join(''); } document.querySelectorAll('pre code').forEach(block => { block.innerHTML = highlight(block.textContent); }); /* ========================================================== LIGHTBOX ========================================================== */ class Lightbox { constructor() { this.images = []; this.currentIndex = 0; this.isOpen = false; this._build(); this._bindImages(); this._bindKeys(); this._bindSwipe(); } _build() { this.el = document.createElement('div'); this.el.className = 'lightbox-overlay'; this.el.setAttribute('role', 'dialog'); this.el.setAttribute('aria-modal', 'true'); this.el.setAttribute('aria-label', 'Image viewer'); this.el.innerHTML = <button class="lightbox-btn lightbox-close" aria-label="Close"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"> <line x1="18" y1="6" x2="6" y2="18"/> <line x1="6" y1="6" x2="18" y2="18"/> </svg> </button> <button class="lightbox-btn lightbox-arrow lightbox-prev" aria-label="Previous image"> <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <polyline points="15 18 9 12 15 6"/> </svg> </button> <button class="lightbox-btn lightbox-arrow lightbox-next" aria-label="Next image"> <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <polyline points="9 6 15 12 9 18"/> </svg> </button> <img class="lightbox-img" src="" alt=""> <div class="lightbox-counter"></div> ; document.body.appendChild(this.el); this.imgEl = this.el.querySelector('.lightbox-img'); this.counterEl = this.el.querySelector('.lightbox-counter'); this.prevBtn = this.el.querySelector('.lightbox-prev'); this.nextBtn = this.el.querySelector('.lightbox-next'); this.closeBtn = this.el.querySelector('.lightbox-close'); this.closeBtn.addEventListener('click', () => this.close()); this.prevBtn.addEventListener('click', (e) => { e.stopPropagation(); this.prev(); }); this.nextBtn.addEventListener('click', (e) => { e.stopPropagation(); this.next(); }); this.el.addEventListener('click', (e) => { if (e.target === this.el) this.close(); }); } _bindImages() { this.images = Array.from(document.querySelectorAll('.article img')); this.images.forEach((img, idx) => { img.addEventListener('click', () => this.open(idx)); }); } _bindKeys() { document.addEventListener('keydown', (e) => { if (!this.isOpen) return; if (e.key === 'Escape') this.close(); if (e.key === 'ArrowLeft') this.prev(); if (e.key === 'ArrowRight') this.next(); }); } _bindSwipe() { let startX = 0; this.el.addEventListener('touchstart', (e) => { startX = e.changedTouches[0].clientX; }, { passive: true }); this.el.addEventListener('touchend', (e) => { const dx = startX - e.changedTouches[0].clientX; if (Math.abs(dx) > 60) { dx > 0 ? this.next() : this.prev(); } }, { passive: true }); } open(idx) { this.currentIndex = idx; this.isOpen = true; this._update(); requestAnimationFrame(() => { this.el.classList.add('active'); }); document.body.style.overflow = 'hidden'; this.closeBtn.focus(); } close() { this.isOpen = false; this.el.classList.remove('active'); document.body.style.overflow = ''; this.images[this.currentIndex]?.focus(); } prev() { this.currentIndex = (this.currentIndex - 1 + this.images.length) % this.images.length; this._update(); } next() { this.currentIndex = (this.currentIndex + 1) % this.images.length; this._update(); } _update() { const srcImg = this.images[this.currentIndex]; this.imgEl.style.opacity = '0'; this.imgEl.style.transform = 'scale(0.96)'; setTimeout(() => { this.imgEl.src = srcImg.src; this.imgEl.alt = srcImg.alt; this.imgEl.removeAttribute('loading'); this.imgEl.style.opacity = '1'; this.imgEl.style.transform = 'scale(1)'; }, 120); const total = this.images.length; if (total > 1) { this.counterEl.textContent = ${this.currentIndex + 1} / ${total}; this.prevBtn.style.display = ''; this.nextBtn.style.display = ''; } else { this.counterEl.textContent = ''; this.prevBtn.style.display = 'none'; this.nextBtn.style.display = 'none'; } } } new Lightbox(); </script>
</body>
</html> |