<section>

    {{#if hasTokens}}
    <fieldset>

        <legend>Ziel auswählen</legend>

        <ul>
            {{#each tokenDistances}}
                <li class="target token {{#if isSelected}}selected{{/if}}" data-action="selectTarget"
                    data-target-id="{{this.id}}"><img src="{{this.token.texture.src}}"
                                                      style="width: 32px; height: 32px"/><span>{{this.actor.name}}</span><span>({{this.d}} {{../distanceUnit}}
                    )</span></li>
            {{/each}}
        </ul>

    </fieldset>
    {{/if}}
    <fieldset>
        <legend>Waffe auswählen</legend>
        <ul>
            {{#each weapons}}
                <li class="weapon {{#if isSelected}}selected{{/if}}" data-action="selectWeaponAndSkill"
                    data-weapon-id="{{this.weaponId}}" data-skill-id="{{this.skillId}}"><img src="{{this.img}}"
                                                                                             style="width: 32px; height: 32px"/><span>{{this.name}}
                    ({{this.skillName}})</span><span>{{#if this.combatStatistics}}
                    (AT: {{this.combatStatistics.at}} PA: {{this.combatStatistics.pa}}){{/if}}</span></li>
            {{/each}}
        </ul>
    </fieldset>

    <fieldset>
        <legend>Manöver auswählen</legend>
        <ul>
            {{#each maneuver}}
                <li class="maneuver {{#if isSelected}}selected{{/if}} name-only" data-action="selectManeuver"
                    data-maneuver-id="{{this.id}}" class="{{this.source}}">{{this.name}}</li>
            {{/each}}
        </ul>
    </fieldset>

    <fieldset class="modding">
        <legend>Erschwernisse und Ansagen</legend>
        <div class="malus-and-mod">
            <label><span>Umstände</span>
                <input name="circumstance" type="number">
            </label>
            <label><span>Ansage</span>
                <input name="mod" type="number" {{disabled (not canMod)}}>
            </label>
            <label><span>Erschwernis</span>
                <input name="penalty" type="number" {{disabled true}}>
            </label>
        </div>
        <output class="modResult"></output>
    </fieldset>


    <div class="actions">
        <button type="button" data-action="attack" {{#if ready}}class="ready" {{else}}data-tooltip="{{notReadyReason}}"{{/if}}><i
                class="fa-solid fa-swords"></i>Angreifen <span
                class="value"></span></button>
    </div>

</section>