<aside class="character-sidebar-sheet">
    <div class="portrait {{#if isDeath}}death-roll{{/if}}">
        <img src="{{document.img}}" alt="{{document.name}}" data-action='editImage' data-edit="img">
        {{#if document.system.class.subclass.system.spellcastingTrait}}
            <div class="icons-list">
                <span class="spellcast-icon {{#if isDeath}}no-label{{/if}}">
                    <span class="spellcast-label">
                        {{localize "DAGGERHEART.ITEMS.Subclass.spellcastingTrait"}}: 
                        {{localize (concat 'DAGGERHEART.CONFIG.Traits.' document.system.class.subclass.system.spellcastingTrait '.short')}}
                    </span>
                    <i class="fa-solid fa-wand-sparkles"></i>
                </span>
            </div>
        {{/if}}
        <a class="death-roll-btn" data-tooltip="DAGGERHEART.UI.Tooltip.makeDeathMove" {{#if
            isDeath}}data-action="makeDeathMove" {{/if}}><i class="fas fa-skull death-save"></i></a>
    </div>
    <div class="info-section">
        <div class="resources-section">
            <div class="status-bar">
                <div class='status-value'>
                    <p><input class="bar-input" name="system.resources.hitPoints.value" min="0" max='{{document.system.resources.hitPoints.max}}'
                            value="{{document.system.resources.hitPoints.value}}" type="number"></p>
                    <p>/</p>
                    <p class="bar-label">{{document.system.resources.hitPoints.max}}</p>
                </div>
                <progress
                    class='progress-bar'
                    max='{{document.system.resources.hitPoints.max}}'
                    value='{{document.system.resources.hitPoints.value}}'
                ></progress>
                <div class="status-label">
                    <h4>{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</h4>
                </div>

            </div>
            <div class="status-bar">
                <div class='status-value'>
                    <p><input class="bar-input" name="system.resources.stress.value" min="0" max='{{document.system.resources.stress.max}}'
                            value="{{document.system.resources.stress.value}}" type="number"></p>
                    <p>/</p>
                    <p class="bar-label">{{document.system.resources.stress.max}}</p>
                </div>
                <progress
                    class='progress-bar stress-color'
                    value='{{document.system.resources.stress.value}}'
                    min="0"
                    max='{{document.system.resources.stress.max}}'
                ></progress>
                <div class="status-label">
                    <h4>{{localize "DAGGERHEART.GENERAL.stress"}}</h4>
                </div>
            </div>
        </div>
        <div class="status-section">
            <div class="status-number">
                <div class='status-value'>
                    <p>{{document.system.proficiency}}</p>
                </div>
                <div class="status-label">
                    <h4>{{localize "DAGGERHEART.GENERAL.proficiency"}}</h4>
                </div>
            </div>

            {{#if document.system.armor.system.marks}}
                <div class="status-bar armor-slots">
                    <div class='status-value'>
                        <p><input class="bar-input armor-marks-input" value="{{document.system.armor.system.marks.value}}" type="number"></p>
                        <p>/</p>
                        <p class="bar-label">{{document.system.armorScore}}</p>
                    </div>
                    <progress
                        class='progress-bar stress-color'
                        value='{{document.system.armor.system.marks.value}}'
                        max='{{document.system.armorScore}}'
                    ></progress>
                    <div class="status-label">
                        <h4>{{localize "DAGGERHEART.GENERAL.armorSlots"}}</h4>
                    </div>
                </div>
            {{else}}
                <div class="status-number armor-slots">
                    <div class='status-value'>
                        <p>-</p>
                    </div>
                    <div class="status-label">
                        <h4>{{localize "DAGGERHEART.GENERAL.armorSlots"}}</h4>
                    </div>
                </div>
            {{/if}}

            <div class="status-number">
                <div class='status-value'>
                    <p>{{document.system.evasion}}</p>
                </div>
                <div class="status-label">
                    <h4>{{localize "DAGGERHEART.GENERAL.evasion"}}</h4>
                </div>
            </div>
        </div>
        <div class="threshold-section">
            <h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.minor"}}</h4>
            <h4 class="threshold-value">{{document.system.damageThresholds.major}}</h4>
            <h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.major"}}</h4>
            <h4 class="threshold-value">{{document.system.damageThresholds.severe}}</h4>
            <h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.severe"}}</h4>
        </div>
    </div>

    <div class="shortcut-items-section">
        <div class="equipment-section">
            <div class="title">
                <side-line-div class="invert"></side-line-div>
                <h3>{{localize "DAGGERHEART.GENERAL.equipment"}}</h3>
                <side-line-div></side-line-div>
            </div>
            <ul class="items-sidebar-list">
                {{#if document.system.usedUnarmed}}
                    {{> 'daggerheart.inventory-item' item=document.system.usedUnarmed type='attack' isSidebar=true}}
                {{/if}}
                {{#each document.items as |item|}}
                {{#if item.system.equipped}}
                {{> 'daggerheart.inventory-item'
                item=item
                type=item.type
                hideTags=true
                hideDescription=true
                hideResources=true
                noExtensible=true
                }}
                {{/if}}
                {{/each}}
            </ul>
        </div>
        <div class="loadout-section">
            <div class="title">
                <side-line-div class="invert"></side-line-div>
                <h3>{{localize "DAGGERHEART.GENERAL.loadout"}}</h3>
                <side-line-div></side-line-div>
            </div>
            <ul class="items-sidebar-list">
                {{#each document.system.domainCards.loadout as |card|}}
                {{> 'daggerheart.inventory-item'
                    item=card
                    type='domainCard'
                    hideTags=true
                    hideDescription=true
                    hideResources=true
                    noExtensible=true
                }}

                {{/each}}
            </ul>
        </div>
        <div class="experience-section">
            <div class="title">
                <side-line-div class="invert"></side-line-div>
                <h3>{{localize "DAGGERHEART.GENERAL.experience.single"}}</h3>
                <side-line-div></side-line-div>
            </div>
            <div class="experience-list">
                {{#each document.system.experiences as |experience id|}}
                    <div class="experience-row" data-tooltip-text="{{experience.description}}">
                        <div class="experience-value">
                            +{{experience.value}}
                        </div>
                        <span>{{experience.name}}</span>
                        <div class="controls">
                            <a data-action="sendExpToChat" data-type="experience" data-id="{{id}}">
                                <i class="fa-regular fa-message"></i>
                            </a>
                        </div>
                    </div>
                {{/each}}
            </div>
        </div>
    </div>
</aside>