# ── Generated by Nexa Transpiler ──────────────────────────────
# This file was auto-generated from a .nexa source file.
# Do not edit directly — regenerate with: nexa compile <file>
# ─────────────────────────────────────────────────────────────
from __future__ import annotations
import asyncio, math, json, os, random, functools, time as _time

# ── Nexa runtime stubs ───────────────────────────────────────
_nexa_modules = {}

print('=== Nexa v8 Showcase ===\n')
print('--- 1. Lambdas & Higher-Order List Methods ---')
numbers = [1, 2, 3, 4, 5]
doubled = list(map(lambda x: (x * 2), numbers))
evens = list(filter(lambda x: ((x % 2) == 0), numbers))
sum = functools.reduce(lambda acc, x: (acc + x), numbers, 0)
print(f"Original: {numbers}")
print(f"Doubled:  {doubled}")
print(f"Evens:    {evens}")
print(f"Sum:      {sum}")
print('\n--- 2. Crypto Module ---')
my_uuid = crypto.uuid4()
secret = 'nexa_rocks_2026'
my_hash = crypto.sha256(secret)
print(f"UUID: {my_uuid}")
print(f"SHA-256 for '{secret}': {my_hash}")
print('\n--- 3. Base64 Module ---')
raw_text = 'Hello, Nexa World! This is some data.'
b64_encoded = base64.encode(raw_text)
decoded_text = base64.decode(b64_encoded)
print(f"Raw String:      {raw_text}")
print(f"Base64 Encoded:  {b64_encoded}")
print(f"Base64 Decoded:  {decoded_text}")
assert raw_text == decoded_text
print('\n--- 4. Datetime Module ---')
now_str = datetime.now()
print(f"Current localized ISO: {now_str}")
formatted = datetime.format(now_str, '%B %d, %Y - %H:%M:%S')
print(f"Formatted DateTime: {formatted}")
parsed = datetime.parse('2026-03-14 10:30:00', '%Y-%m-%d %H:%M:%S')
print(f"Parsed DateTime ISO: {parsed}")
print('\n✅ All Nexa v8 features successfully verified!')
