'use strict';

var spriteGeneratorCore = require('./spriteGeneratorCore.js');

/**
 * characterGeneratorPresets.ts — Extensive library of character parts
 * for the sprite generator. Provides heads, hair, torsos, arms, legs,
 * faces, and equipment in multiple styles at 16×16 and 32×32 sizes.
 *
 * Each part has directional pixel data (S, E, N with mirroring for W, etc.)
 */
/* ════════════════════════════════════════════════════════════════
   COLOR PALETTES
   ════════════════════════════════════════════════════════════════ */
const SKIN_PALETTES = {
    light: ['#ffecd2', '#f5c6a0', '#e0a070', '#c07848', '#8b5e3c'],
    medium: ['#e8c090', '#d4a06c', '#b88050', '#946038', '#6b4423'],
    dark: ['#c08050', '#a06838', '#805028', '#603818', '#402010'],
    fantasy1: ['#d0f0d0', '#a8d8a0', '#78b868', '#508030', '#304818'],
    fantasy2: ['#d0d8f0', '#a8b0d8', '#7888b8', '#506090', '#303860'],
};
const HAIR_PALETTES = {
    black: ['#1a1a2e', '#101020', '#080810'],
    brown: ['#8b6914', '#6b4e0a', '#4a3508'],
    blonde: ['#f0d060', '#d0b040', '#b09028'],
    red: ['#d03020', '#a02018', '#781810'],
    white: ['#f0f0f0', '#d0d0d0', '#a0a0a0'],
    blue: ['#4080e0', '#3060b0', '#204080'],
    green: ['#40c040', '#309030', '#206020'],
    pink: ['#f080b0', '#d06090', '#a04070'],
    purple: ['#a040e0', '#8030b0', '#602080'],
};
const CLOTHING_PALETTES = {
    leather: ['#b08060', '#906840', '#705028'],
    iron: ['#c0c0c8', '#909098', '#606068'],
    gold: ['#f0d060', '#d0b040', '#a08020'],
    cloth_r: ['#d04040', '#b02020', '#801010'],
    cloth_b: ['#4060d0', '#3040b0', '#202880'],
    cloth_g: ['#40b040', '#208020', '#105010'],
    cloth_w: ['#f0f0f0', '#d0d0d0', '#b0b0b0'],
    cloth_k: ['#404040', '#282828', '#181818'],
    royal: ['#8020a0', '#601080', '#400860'],
};
/* ════════════════════════════════════════════════════════════════
   16×16 CHARACTER PARTS — HEADS
   ════════════════════════════════════════════════════════════════ */
const _ = -1; // transparent shorthand
const HEAD_ROUND_S = spriteGeneratorCore.createPartData(8, 8, [
    [_, _, 1, 1, 1, 1, _, _],
    [_, 1, 0, 0, 0, 0, 1, _],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 3, 0, 0, 3, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 2, 2, 0, 0, 1],
    [_, 1, 0, 0, 0, 0, 1, _],
    [_, _, 1, 1, 1, 1, _, _],
], ['#ffecd2', '#c07848', '#e05050', '#2a2a4e']);
const HEAD_ROUND_E = spriteGeneratorCore.createPartData(7, 8, [
    [_, _, 1, 1, 1, _, _],
    [_, 1, 0, 0, 0, 1, _],
    [1, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 3, 0, 1],
    [1, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 2, 0, 1],
    [_, 1, 0, 0, 0, 1, _],
    [_, _, 1, 1, 1, _, _],
], ['#ffecd2', '#c07848', '#e05050', '#2a2a4e']);
const HEAD_ROUND_N = spriteGeneratorCore.createPartData(8, 8, [
    [_, _, 1, 1, 1, 1, _, _],
    [_, 1, 0, 0, 0, 0, 1, _],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [_, 1, 0, 0, 0, 0, 1, _],
    [_, _, 1, 1, 1, 1, _, _],
], ['#ffecd2', '#c07848', '#e05050', '#2a2a4e']);
const HEAD_SQUARE_S = spriteGeneratorCore.createPartData(8, 7, [
    [_, 1, 1, 1, 1, 1, 1, _],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 3, 0, 0, 3, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 2, 2, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [_, 1, 1, 1, 1, 1, 1, _],
], ['#ffecd2', '#c07848', '#e05050', '#2a2a4e']);
const HEAD_CHIBI_S = spriteGeneratorCore.createPartData(10, 10, [
    [_, _, _, 1, 1, 1, 1, _, _, _],
    [_, _, 1, 0, 0, 0, 0, 1, _, _],
    [_, 1, 0, 0, 0, 0, 0, 0, 1, _],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 3, 0, 0, 3, 0, 0, 1],
    [1, 0, 0, 3, 0, 0, 3, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 2, 2, 0, 0, 0, 1],
    [_, 1, 0, 0, 0, 0, 0, 0, 1, _],
    [_, _, 1, 1, 1, 1, 1, 1, _, _],
], ['#ffecd2', '#c07848', '#e05050', '#2a2a4e']);
/* ── HAIR ── */
const HAIR_SHORT_S = spriteGeneratorCore.createPartData(8, 4, [
    [_, _, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 1, 1, 1, 1, 0, 0],
    [0, 1, _, _, _, _, 1, 0],
], ['#4a3508', '#6b4e0a']);
const HAIR_LONG_S = spriteGeneratorCore.createPartData(10, 10, [
    [_, _, _, 0, 0, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 1, 1, 1, 1, 0, 0, _],
    [0, 0, 1, _, _, _, _, 1, 0, 0],
    [0, 1, _, _, _, _, _, _, 1, 0],
    [0, 1, _, _, _, _, _, _, 1, 0],
    [0, 1, _, _, _, _, _, _, 1, 0],
    [0, 0, _, _, _, _, _, _, 0, 0],
    [_, 0, _, _, _, _, _, _, 0, _],
    [_, 0, 0, _, _, _, _, 0, 0, _],
], ['#4a3508', '#6b4e0a']);
const HAIR_MOHAWK_S = spriteGeneratorCore.createPartData(8, 6, [
    [_, _, _, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, _, 0, 1, 1, 0, _, _],
    [_, 0, 1, _, _, 1, 0, _],
    [0, 1, _, _, _, _, 1, 0],
], ['#d03020', '#a02018']);
const HAIR_PONYTAIL_S = spriteGeneratorCore.createPartData(10, 8, [
    [_, _, _, 0, 0, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 1, 1, 1, 1, 0, 0, _],
    [0, 0, 1, _, _, _, _, 1, 0, 0],
    [_, _, _, _, _, _, _, _, 0, 0],
    [_, _, _, _, _, _, _, _, _, 0],
    [_, _, _, _, _, _, _, _, _, 0],
    [_, _, _, _, _, _, _, _, 0, _],
], ['#f0d060', '#d0b040']);
const HAIR_SPIKY_S = spriteGeneratorCore.createPartData(10, 6, [
    [_, 0, _, _, 0, _, 0, _, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, _, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 1, 1, 1, 1, 1, 1, 0, 0],
    [0, 1, _, _, _, _, _, _, 1, 0],
    [_, _, _, _, _, _, _, _, _, _],
], ['#1a1a2e', '#101020']);
/* ── TORSOS ── */
const TORSO_BASIC_S = spriteGeneratorCore.createPartData(8, 6, [
    [_, _, 1, 1, 1, 1, _, _],
    [_, 1, 0, 0, 0, 0, 1, _],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 1],
    [_, 1, 0, 0, 0, 0, 1, _],
    [_, _, 1, 1, 1, 1, _, _],
], ['#4060d0', '#3040b0']);
const TORSO_ARMOR_S = spriteGeneratorCore.createPartData(10, 7, [
    [_, _, _, 1, 1, 1, 1, _, _, _],
    [_, _, 1, 0, 2, 2, 0, 1, _, _],
    [_, 1, 0, 0, 2, 2, 0, 0, 1, _],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [_, 1, 0, 0, 0, 0, 0, 0, 1, _],
    [_, _, 1, 1, 1, 1, 1, 1, _, _],
], ['#c0c0c8', '#909098', '#f0d060']);
const TORSO_ROBE_S = spriteGeneratorCore.createPartData(10, 10, [
    [_, _, _, 1, 1, 1, 1, _, _, _],
    [_, _, 1, 0, 0, 0, 0, 1, _, _],
    [_, 1, 0, 0, 2, 2, 0, 0, 1, _],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
    [_, 1, 0, 0, 0, 0, 0, 0, 1, _],
    [_, _, 1, 0, 0, 0, 0, 1, _, _],
    [_, _, _, 1, 1, 1, 1, _, _, _],
], ['#8020a0', '#601080', '#f0d060']);
/* ── ARMS ── */
const ARM_BASIC_S = spriteGeneratorCore.createPartData(3, 5, [
    [_, 0, _],
    [0, 0, 1],
    [0, 0, 1],
    [0, 0, 1],
    [_, 0, _],
], ['#ffecd2', '#c07848']);
const ARM_ARMORED_S = spriteGeneratorCore.createPartData(4, 5, [
    [_, 0, 1, _],
    [0, 0, 0, 1],
    [0, 0, 0, 1],
    [0, 0, 0, 1],
    [_, 0, 1, _],
], ['#c0c0c8', '#909098']);
/* ── LEGS ── */
const LEG_BASIC_S = spriteGeneratorCore.createPartData(3, 5, [
    [_, 0, _],
    [0, 0, 1],
    [0, 0, 1],
    [0, 0, 1],
    [0, 1, 1],
], ['#4060d0', '#3040b0']);
const LEG_BOOT_S = spriteGeneratorCore.createPartData(4, 5, [
    [_, 0, 0, _],
    [_, 0, 0, _],
    [_, 0, 0, _],
    [0, 0, 0, 1],
    [0, 0, 0, 1],
], ['#b08060', '#906840']);
/* ── HATS ── */
const HAT_WIZARD_S = spriteGeneratorCore.createPartData(10, 8, [
    [_, _, _, _, 0, _, _, _, _, _],
    [_, _, _, 0, 0, 0, _, _, _, _],
    [_, _, 0, 0, 0, 0, 0, _, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 2, 0, 0, 0, _, _],
    [0, 0, 0, 0, 2, 0, 0, 0, 0, _],
    [0, 1, 1, 1, 1, 1, 1, 1, 0, _],
    [_, _, _, _, _, _, _, _, _, _],
], ['#8020a0', '#601080', '#f0d060']);
const HAT_KNIGHT_S = spriteGeneratorCore.createPartData(10, 6, [
    [_, _, _, 0, 0, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 2, 2, 2, 2, 2, 2, 0, 0],
    [_, _, _, 1, 1, 1, 1, _, _, _],
], ['#c0c0c8', '#606068', '#f0d060']);
const HAT_CROWN_S = spriteGeneratorCore.createPartData(10, 5, [
    [_, 2, _, _, 2, _, _, 2, _, _],
    [_, 0, 2, _, 0, _, 2, 0, _, _],
    [_, 0, 0, 2, 0, 2, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, _, _],
    [_, 1, 1, 1, 1, 1, 1, 1, _, _],
], ['#f0d060', '#d0b040', '#ff4040']);
const HAT_CAP_S = spriteGeneratorCore.createPartData(9, 5, [
    [_, _, _, 0, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [_, _, 1, 1, 1, 1, 1, _, _],
], ['#d04040', '#b02020']);
/* ── WEAPONS ── */
const WEAPON_SWORD_S = spriteGeneratorCore.createPartData(3, 10, [
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [1, 1, 1],
    [_, 2, _],
    [_, 2, _],
], ['#c0c0c8', '#f0d060', '#8b5e3c']);
const WEAPON_STAFF_S = spriteGeneratorCore.createPartData(3, 12, [
    [_, 1, _],
    [1, 1, 1],
    [_, 1, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
    [_, 0, _],
], ['#8b5e3c', '#4080e0']);
const WEAPON_BOW_S = spriteGeneratorCore.createPartData(5, 10, [
    [_, _, _, 0, _],
    [_, _, 0, _, 1],
    [_, 0, _, _, 1],
    [0, _, _, _, 1],
    [0, _, _, _, 1],
    [0, _, _, _, 1],
    [0, _, _, _, 1],
    [_, 0, _, _, 1],
    [_, _, 0, _, 1],
    [_, _, _, 0, _],
], ['#8b5e3c', '#c0c0c8']);
const SHIELD_ROUND_S = spriteGeneratorCore.createPartData(6, 7, [
    [_, _, 1, 1, _, _],
    [_, 1, 0, 0, 1, _],
    [1, 0, 0, 2, 0, 1],
    [1, 0, 2, 2, 0, 1],
    [1, 0, 0, 2, 0, 1],
    [_, 1, 0, 0, 1, _],
    [_, _, 1, 1, _, _],
], ['#c0c0c8', '#909098', '#f0d060']);
/* ════════════════════════════════════════════════════════════════
   REGISTER ALL CHARACTER PARTS
   ════════════════════════════════════════════════════════════════ */
const CHARACTER_PARTS = [
    // ── Heads ──
    {
        id: 'head-round', name: 'Round Head', category: 'head', slot: 'head',
        anchorX: 4, anchorY: 7, zOrder: 10, tags: ['basic', 'round'],
        pixels: spriteGeneratorCore.generateMirroredDirections({ S: HEAD_ROUND_S, E: HEAD_ROUND_E, N: HEAD_ROUND_N }),
    },
    {
        id: 'head-square', name: 'Square Head', category: 'head', slot: 'head',
        anchorX: 4, anchorY: 6, zOrder: 10, tags: ['basic', 'angular'],
        pixels: { S: HEAD_SQUARE_S },
    },
    {
        id: 'head-chibi', name: 'Chibi Head', category: 'head', slot: 'head',
        anchorX: 5, anchorY: 9, zOrder: 10, tags: ['cute', 'chibi', 'large'],
        pixels: { S: HEAD_CHIBI_S },
    },
    // ── Hair ──
    {
        id: 'hair-short', name: 'Short Hair', category: 'hair', slot: 'head',
        anchorX: 4, anchorY: 3, zOrder: 11, tags: ['basic', 'short'],
        pixels: { S: HAIR_SHORT_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'hair-long', name: 'Long Hair', category: 'hair', slot: 'head',
        anchorX: 5, anchorY: 3, zOrder: 11, tags: ['long', 'flowing'],
        pixels: { S: HAIR_LONG_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'hair-mohawk', name: 'Mohawk', category: 'hair', slot: 'head',
        anchorX: 4, anchorY: 5, zOrder: 12, tags: ['punk', 'mohawk'],
        pixels: { S: HAIR_MOHAWK_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'hair-ponytail', name: 'Ponytail', category: 'hair', slot: 'head',
        anchorX: 5, anchorY: 3, zOrder: 11, tags: ['long', 'ponytail'],
        pixels: { S: HAIR_PONYTAIL_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'hair-spiky', name: 'Spiky Hair', category: 'hair', slot: 'head',
        anchorX: 5, anchorY: 5, zOrder: 12, tags: ['spiky', 'anime'],
        pixels: { S: HAIR_SPIKY_S },
        recolorableIndices: [0, 1],
    },
    // ── Torsos ──
    {
        id: 'torso-basic', name: 'Basic Torso', category: 'torso', slot: 'torso',
        anchorX: 4, anchorY: 0, zOrder: 5, tags: ['basic', 'shirt'],
        pixels: { S: TORSO_BASIC_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'torso-armor', name: 'Armor Torso', category: 'torso', slot: 'torso',
        anchorX: 5, anchorY: 0, zOrder: 5, tags: ['armor', 'knight'],
        pixels: { S: TORSO_ARMOR_S },
        recolorableIndices: [0, 1, 2],
    },
    {
        id: 'torso-robe', name: 'Robe Torso', category: 'torso', slot: 'torso',
        anchorX: 5, anchorY: 0, zOrder: 5, tags: ['robe', 'wizard', 'long'],
        pixels: { S: TORSO_ROBE_S },
        recolorableIndices: [0, 1, 2],
    },
    // ── Arms ──
    {
        id: 'arm-basic', name: 'Basic Arm', category: 'arm', slot: 'leftArm',
        anchorX: 1, anchorY: 0, zOrder: 6, tags: ['basic', 'bare'],
        pixels: { S: ARM_BASIC_S },
    },
    {
        id: 'arm-armored', name: 'Armored Arm', category: 'arm', slot: 'leftArm',
        anchorX: 2, anchorY: 0, zOrder: 6, tags: ['armor', 'knight'],
        pixels: { S: ARM_ARMORED_S },
        recolorableIndices: [0, 1],
    },
    // ── Legs ──
    {
        id: 'leg-basic', name: 'Basic Leg', category: 'leg', slot: 'leftLeg',
        anchorX: 1, anchorY: 0, zOrder: 3, tags: ['basic', 'pants'],
        pixels: { S: LEG_BASIC_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'leg-boot', name: 'Boot Leg', category: 'leg', slot: 'leftLeg',
        anchorX: 2, anchorY: 0, zOrder: 3, tags: ['boot', 'heavy'],
        pixels: { S: LEG_BOOT_S },
        recolorableIndices: [0, 1],
    },
    // ── Hats ──
    {
        id: 'hat-wizard', name: 'Wizard Hat', category: 'hat', slot: 'head',
        anchorX: 5, anchorY: 7, zOrder: 13, tags: ['wizard', 'magic'],
        pixels: { S: HAT_WIZARD_S },
        recolorableIndices: [0, 1, 2],
    },
    {
        id: 'hat-knight', name: 'Knight Helmet', category: 'helmet', slot: 'head',
        anchorX: 5, anchorY: 5, zOrder: 13, tags: ['knight', 'armor'],
        pixels: { S: HAT_KNIGHT_S },
        recolorableIndices: [0, 1, 2],
    },
    {
        id: 'hat-crown', name: 'Crown', category: 'hat', slot: 'head',
        anchorX: 5, anchorY: 4, zOrder: 14, tags: ['royal', 'king'],
        pixels: { S: HAT_CROWN_S },
        recolorableIndices: [0, 1, 2],
    },
    {
        id: 'hat-cap', name: 'Cap', category: 'hat', slot: 'head',
        anchorX: 4, anchorY: 4, zOrder: 13, tags: ['casual', 'cap'],
        pixels: { S: HAT_CAP_S },
        recolorableIndices: [0, 1],
    },
    // ── Weapons ──
    {
        id: 'weapon-sword', name: 'Sword', category: 'weapon', slot: 'rightHand',
        anchorX: 1, anchorY: 7, zOrder: 15, tags: ['sword', 'melee'],
        pixels: { S: WEAPON_SWORD_S },
    },
    {
        id: 'weapon-staff', name: 'Staff', category: 'weapon', slot: 'rightHand',
        anchorX: 1, anchorY: 2, zOrder: 15, tags: ['staff', 'magic'],
        pixels: { S: WEAPON_STAFF_S },
    },
    {
        id: 'weapon-bow', name: 'Bow', category: 'weapon', slot: 'rightHand',
        anchorX: 0, anchorY: 5, zOrder: 15, tags: ['bow', 'ranged'],
        pixels: { S: WEAPON_BOW_S },
    },
    // ── Shields ──
    {
        id: 'shield-round', name: 'Round Shield', category: 'shield', slot: 'leftHand',
        anchorX: 3, anchorY: 3, zOrder: 7, tags: ['shield', 'defense'],
        pixels: { S: SHIELD_ROUND_S },
        recolorableIndices: [0, 1, 2],
    },
];
function charAssembly(name, parts, w = 32, h = 32) {
    return {
        id: `char-${name.toLowerCase().replace(/\s+/g, '-')}`,
        name,
        parts,
        skeletonId: 'basic-humanoid',
        canvasWidth: w,
        canvasHeight: h,
        projection: 'sideView',
    };
}
const CHARACTER_PRESETS = [
    {
        id: 'preset-warrior', name: 'Warrior', description: 'Knight with armor and sword',
        tags: ['knight', 'armor', 'melee'],
        assembly: charAssembly('Warrior', [
            { partId: 'leg-boot', offsetX: 10, offsetY: 24 },
            { partId: 'leg-boot', offsetX: 18, offsetY: 24, flipH: true },
            { partId: 'torso-armor', offsetX: 11, offsetY: 16 },
            { partId: 'arm-armored', offsetX: 7, offsetY: 17 },
            { partId: 'arm-armored', offsetX: 21, offsetY: 17, flipH: true },
            { partId: 'head-round', offsetX: 12, offsetY: 8 },
            { partId: 'hat-knight', offsetX: 11, offsetY: 3 },
            { partId: 'weapon-sword', offsetX: 24, offsetY: 12 },
            { partId: 'shield-round', offsetX: 3, offsetY: 16 },
        ]),
    },
    {
        id: 'preset-mage', name: 'Mage', description: 'Wizard with robe and staff',
        tags: ['wizard', 'magic', 'ranged'],
        assembly: charAssembly('Mage', [
            { partId: 'leg-basic', offsetX: 11, offsetY: 24 },
            { partId: 'leg-basic', offsetX: 18, offsetY: 24, flipH: true },
            { partId: 'torso-robe', offsetX: 11, offsetY: 14 },
            { partId: 'arm-basic', offsetX: 8, offsetY: 15 },
            { partId: 'arm-basic', offsetX: 22, offsetY: 15, flipH: true },
            { partId: 'head-round', offsetX: 12, offsetY: 6 },
            { partId: 'hat-wizard', offsetX: 11, offsetY: -2 },
            { partId: 'weapon-staff', offsetX: 24, offsetY: 6 },
        ]),
    },
    {
        id: 'preset-archer', name: 'Archer', description: 'Ranger with bow',
        tags: ['ranger', 'bow', 'ranged'],
        assembly: charAssembly('Archer', [
            { partId: 'leg-boot', offsetX: 10, offsetY: 24 },
            { partId: 'leg-boot', offsetX: 18, offsetY: 24, flipH: true },
            { partId: 'torso-basic', offsetX: 12, offsetY: 17 },
            { partId: 'arm-basic', offsetX: 9, offsetY: 18 },
            { partId: 'arm-basic', offsetX: 21, offsetY: 18, flipH: true },
            { partId: 'head-round', offsetX: 12, offsetY: 9 },
            { partId: 'hair-short', offsetX: 12, offsetY: 6 },
            { partId: 'weapon-bow', offsetX: 23, offsetY: 14 },
        ]),
    },
    {
        id: 'preset-king', name: 'King', description: 'Royal with crown and robe',
        tags: ['royal', 'king', 'npc'],
        assembly: charAssembly('King', [
            { partId: 'leg-basic', offsetX: 11, offsetY: 24 },
            { partId: 'leg-basic', offsetX: 18, offsetY: 24, flipH: true },
            { partId: 'torso-robe', offsetX: 11, offsetY: 14 },
            { partId: 'arm-basic', offsetX: 8, offsetY: 15 },
            { partId: 'arm-basic', offsetX: 22, offsetY: 15, flipH: true },
            { partId: 'head-round', offsetX: 12, offsetY: 6 },
            { partId: 'hat-crown', offsetX: 11, offsetY: 2 },
        ]),
    },
    {
        id: 'preset-villager', name: 'Villager', description: 'Simple villager NPC',
        tags: ['npc', 'villager', 'simple'],
        assembly: charAssembly('Villager', [
            { partId: 'leg-basic', offsetX: 11, offsetY: 24 },
            { partId: 'leg-basic', offsetX: 18, offsetY: 24, flipH: true },
            { partId: 'torso-basic', offsetX: 12, offsetY: 17 },
            { partId: 'arm-basic', offsetX: 9, offsetY: 18 },
            { partId: 'arm-basic', offsetX: 21, offsetY: 18, flipH: true },
            { partId: 'head-round', offsetX: 12, offsetY: 9 },
            { partId: 'hair-short', offsetX: 12, offsetY: 6 },
        ]),
    },
    {
        id: 'preset-punk', name: 'Punk', description: 'Edgy character with mohawk',
        tags: ['punk', 'rebellious'],
        assembly: charAssembly('Punk', [
            { partId: 'leg-boot', offsetX: 10, offsetY: 24 },
            { partId: 'leg-boot', offsetX: 18, offsetY: 24, flipH: true },
            { partId: 'torso-basic', offsetX: 12, offsetY: 17 },
            { partId: 'arm-basic', offsetX: 9, offsetY: 18 },
            { partId: 'arm-basic', offsetX: 21, offsetY: 18, flipH: true },
            { partId: 'head-round', offsetX: 12, offsetY: 9 },
            { partId: 'hair-mohawk', offsetX: 12, offsetY: 4 },
        ]),
    },
    {
        id: 'preset-chibi-hero', name: 'Chibi Hero', description: 'Cute chibi character',
        tags: ['chibi', 'cute', 'hero'],
        assembly: charAssembly('Chibi Hero', [
            { partId: 'leg-basic', offsetX: 11, offsetY: 26 },
            { partId: 'leg-basic', offsetX: 18, offsetY: 26, flipH: true },
            { partId: 'torso-basic', offsetX: 12, offsetY: 19 },
            { partId: 'arm-basic', offsetX: 9, offsetY: 20 },
            { partId: 'arm-basic', offsetX: 21, offsetY: 20, flipH: true },
            { partId: 'head-chibi', offsetX: 11, offsetY: 9 },
            { partId: 'hair-spiky', offsetX: 11, offsetY: 4 },
            { partId: 'weapon-sword', offsetX: 24, offsetY: 14 },
        ]),
    },
    {
        id: 'preset-princess', name: 'Princess', description: 'Royal princess with crown and long hair',
        tags: ['royal', 'princess', 'npc'],
        assembly: charAssembly('Princess', [
            { partId: 'leg-basic', offsetX: 11, offsetY: 24 },
            { partId: 'leg-basic', offsetX: 18, offsetY: 24, flipH: true },
            { partId: 'torso-robe', offsetX: 11, offsetY: 14 },
            { partId: 'arm-basic', offsetX: 8, offsetY: 15 },
            { partId: 'arm-basic', offsetX: 22, offsetY: 15, flipH: true },
            { partId: 'head-round', offsetX: 12, offsetY: 6 },
            { partId: 'hair-long', offsetX: 11, offsetY: 3 },
            { partId: 'hat-crown', offsetX: 11, offsetY: 2 },
        ]),
    },
];
/** Initialize: register all character parts */
function initCharacterParts() {
    spriteGeneratorCore.registerParts(CHARACTER_PARTS);
}

exports.CHARACTER_PARTS = CHARACTER_PARTS;
exports.CHARACTER_PRESETS = CHARACTER_PRESETS;
exports.CLOTHING_PALETTES = CLOTHING_PALETTES;
exports.HAIR_PALETTES = HAIR_PALETTES;
exports.SKIN_PALETTES = SKIN_PALETTES;
exports.initCharacterParts = initCharacterParts;
//# sourceMappingURL=characterGeneratorPresets.js.map
