<form class="flexcol {{cssClass}}" autocomplete="off" style="min-width: 605px; min-width: fit-content;">
    {{> "systems/shadowrun-de/templates/item/item-sheet-header.hbs" }}
    
    {{!-- Sheet Body --}}
    <section class="sheet-body">
        <div class="section">
            <table>
                <tr>
                    <!--Typ, Subtyp, Verfügbarkeit, Preis-->
                    <th>{{localize 'shadowrun6.item.type'}}</th>
                    <th>{{localize 'shadowrun6.item.subtype'}}</th>
                    <th>{{localize 'shadowrun6.label.column.rating'}}</th>
                    <th>{{localize 'shadowrun6.label.column.count'}}</th>
                    <th>{{localize 'shadowrun6.item.availability'}}</th>
                    <th>{{localize 'shadowrun6.item.price'}}</th>
                </tr>
                <tr>
                    <td style="text-align: center">
                        <select name="system.type" data-field="system.type" data-field="system.type" class="typeselect">
                            {{selectOptions config.GEAR_TYPES selected=item.system.type localize=true}}
                        </select>
                    </td>
                    <td style="text-align: center">
                        <select name="system.subtype" data-field="system.subtype" data-field="system.subtype" class="subtypeselect">
                            {{selectOptions config.subtypeList selected=item.system.subtype localize=true blank=(localize "shadowrun6.label.none") }}
                        </select></td>

                    <td style="text-align: center"><input name="system.needsRating" style="vertical-align: middle;" type="checkbox" {{checked item.system.needsRating}}
                            data-field="system.needsRating" /></td>
                    <td style="text-align: center"><input name="system.countable" style="vertical-align: middle;" type="checkbox" {{checked item.system.countable}}
                            data-field="system.countable" /></td>

                    <td style="text-align: center"><input name="system.availDef" type="text" value="{{item.system.availDef}}" data-field="system.availDef" class="box centered"
                            style="width: 2em" /></td>
                    <td style="text-align: center"><span class="input-symbol-nuyen"><input name="system.priceDef" type="text" value="{{item.system.priceDef}}" data-field="system.priceDef" class="box centered"
                            style="width: 5em" /></span></td>
                </tr>
            </table>
            <!-- ********** WAFFEN ********** -->
            {{#if (or
            (eq item.system.type "WEAPON_FIREARMS")
            (eq item.system.type "WEAPON_RANGED")
            (eq item.system.type "WEAPON_CLOSE_COMBAT")
            (eq item.system.type "WEAPON_SPECIAL"))}}
            <table>
                <tr>
                    <!--SCHADEN MODUS ANGRIFFSWERTE MUNITION-->
                    <th colspan="2">{{localize 'shadowrun6.item.damage'}}</th>
                    {{#if (or (or (eq item.system.type "WEAPON_FIREARMS")(eq item.system.type "WEAPON_RANGED"))(eq item.system.type "WEAPON_SPECIAL"))}}
                    <th colspan="4">{{localize 'shadowrun6.item.mode'}}</th>
                    {{/if}}
                    <th colspan="5">{{localize 'shadowrun6.item.attackvalues'}}</th>
                    <!-- <th>{{localize 'shadowrun6.item.ammunition'}}</th> -->
                </tr>
                {{log "shadowrun6-gear-sheet.html item=" item}}
                <tr>
                    <td style="text-align: right">
                        <input name="system.dmg" type="number" value="{{item._source.system.dmg}}" data-field="system.dmg" class="box centered" style="width: 2.5em;" />
                    </td>
                    <td style="text-align: left">
                        <select name="system.stun" data-field="system.stun">
                            {{selectOptions config.WEAPON_STUN_OPTION selected=item._source.system.stun localize=true}}
                        </select>
                    </td>
                    {{#if (or (or (eq item.system.type "WEAPON_FIREARMS")(eq item.system.type "WEAPON_RANGED"))(eq item.system.type "WEAPON_SPECIAL"))}}
					<td style="width: 4em; text-align: center">
                        <span style="vertical-align: middle;">{{localize 'shadowrun6.item.mode_ss'}}</span>
                        <input name="system.modes.SS" style="vertical-align: middle;" type="checkbox" {{checked item.system.modes.SS}} data-field="system.modes.SS" />
                    </td>
                    <td style="width: 4em; text-align: center">
                        <span style="vertical-align: middle;">{{localize 'shadowrun6.item.mode_sa'}}</span>
                        <input name="system.modes.SA" style="vertical-align: middle;" type="checkbox" {{checked item.system.modes.SA}} data-field="system.modes.SA" />
                    </td>
                    <td style="width: 4em; text-align: center">
                        <span style="vertical-align: middle;">{{localize 'shadowrun6.item.mode_bf'}}</span>
                        <input name="system.modes.BF" style="vertical-align: middle;" type="checkbox" {{checked item.system.modes.BF}} data-field="system.modes.BF" />
                    </td>
                    <td style="width: 4em; text-align: center">
                        <span style="vertical-align: middle;">{{localize 'shadowrun6.item.mode_fa'}}</span>
                        <input name="system.modes.FA" style="vertical-align: middle;" type="checkbox" {{checked item.system.modes.FA}} data-field="system.modes.FA" />
                    </td>
                    {{/if}}

                    {{#each item._source.system.attackRating as |arating id|}}
                    <td style="text-align: center" data-array="system.attackRating">
                        <input name="attackRating{{id}}" type="number" value="{{arating}}" data-array-field data-index="{{id}}" style="width:2em" class="centered box" title="{{localize (concat "shadowrun6.roll.ar_" id "_hint")}}"/>
                    </td>
                    {{/each}}
                </tr>
            </table>
            <table>
                <tr>
                    <th>{{localize 'shadowrun6.item.skill'}}</th>
                    <th>{{localize 'shadowrun6.item.skillspec'}}</th>

                    <th>
                        {{#if (or (eq item.system.skill "close_combat") (eq item.system.skillSpec "brawling")) }}
                        {{#if rollStrengthCombat}}
                            {{localize 'shadowrun6.item.strWeapon'}}
                        {{/if}}
                        {{/if}}
                        {{#if (or (or (eq item.system.type "WEAPON_FIREARMS")(eq item.system.type "WEAPON_RANGED"))(eq item.system.type "WEAPON_SPECIAL"))}}
                            {{localize 'shadowrun6.weapon.ammo_cap_short'}}
                        {{/if}}
                    </th>
                    {{#if (or (or (eq item.system.type "WEAPON_FIREARMS")(eq item.system.type "WEAPON_RANGED"))(eq item.system.type "WEAPON_SPECIAL"))}}
                    <th>
                        {{localize 'shadowrun6.weapon.ammo_loaded'}}
                    </th>
                    {{/if}}
                    {{#if highStrengthReducesRecoil}}
                    <th>
                        {{localize 'shadowrun6.label.dual_hand'}}
                    </th>
                    {{/if}}
                </tr>
                <tr>
                    <td style="text-align: center">
                        <select name="system.skill" data-field="system.skill">
                            {{selectOptions config.SKILLS_WEAPON selected=item.system.skill localize=true blank=(localize "shadowrun6.label.none")}}
                        </select>
                    </td>
                    <td style="text-align: center">
                        {{#if item.system.skill}}
        	   			<select name="system.skillSpec" data-field="system.skillSpec">
                            {{selectOptions (lookup config.skill_special item.system.skill) selected=item.system.skillSpec localize=true}}
         				</select>
                         {{/if}}
                    </td>
                    <td style="text-align: center">
                        {{#if (or (eq item.system.skill "close_combat") (eq item.system.skillSpec "brawling")) }}
                        {{#if rollStrengthCombat}}
                            <input name="system.strWeapon" style="vertical-align: middle;" type="checkbox" {{checked item.system.strWeapon}} data-field="system.strWeapon" />
                        {{/if}}
                        {{/if}}
                        {{#if (or (or (eq item.system.type "WEAPON_FIREARMS")(eq item.system.type "WEAPON_RANGED"))(eq item.system.type "WEAPON_SPECIAL"))}}
                            <input name="system.ammocap" type="number" value="{{item._source.system.ammocap}}" data-field="system.ammocap" class="box centered" style="width: 3.4em" />
                        {{/if}}
                    </td>
                    {{#if (or (or (eq item.system.type "WEAPON_FIREARMS")(eq item.system.type "WEAPON_RANGED"))(eq item.system.type "WEAPON_SPECIAL"))}}
                    <td style="text-align: center">
                        <select name="system.ammoLoaded" data-field="system.ammoLoaded">
                            {{selectOptions config.AMMO_TYPES selected=item.system.ammoLoaded localize=true}}
                        </select>
                    </td>
                    {{/if}}
                    {{#if highStrengthReducesRecoil}}
                    <td style="text-align: center">
                        <input name="system.dualHand" style="vertical-align: middle;" type="checkbox" {{checked item.system.dualHand}} data-field="system.dualHand" />
                    </td>
                    {{/if}}
                </tr>
            </table>
            {{/if}}
            <!-- ********** Rüstung ********** -->
            {{#if (eq item.system.type "ARMOR")}}
            <table>
                <tr>
                    <th>{{localize 'shadowrun6.item.defencerating'}}</th>
                    <th>{{localize 'shadowrun6.item.capacity'}}</th>
                    <th>{{localize 'shadowrun6.item.social'}}</th>
                    <th>{{localize 'shadowrun6.item.natural'}}</th>
                </tr>
                <tr>
                    <td class="centered">
                        <input name="system.defense" type="number" value="{{item._source.system.defense}}" data-field="system.defense" class="box centered" style="width: 3em" />
                    </td>
                    <td class="centered">
                        <input name="system.capacity" type="number" value="{{item.system.capacity}}" data-field="system.capacity" class="box centered" style="width: 3em" />
                    </td>
                    <td class="centered">
                        <input name="system.social" type="number" value="{{item._source.system.social}}" data-field="system.social" class="box centered" style="width: 3em" />
                    </td>
                    <td class="centered">
                        <input name="system.natural" type="checkbox" {{checked item.system.natural}} data-field="system.natural" />
                    </td>
                </tr>
            </table>
            {{/if}}
            <!-- ********** BIOWARE / NANOWARE ********** -->
            {{#if (or (or
                (eq item.system.type "BIOWARE")
                (eq item.system.type "NANOWARE")
            ) (eq item.system.type "GENETICS") )
            }}
            <table>
                <tr>
                    <th>{{localize 'shadowrun6.item.essence'}}</th>
                </tr>
                <tr>
                    <td>
                        <input name="system.essence" type="number" value="{{item.system.essence}}" data-field="system.essence" id="ware_essence" class="box centered" />
                    </td>
                </tr>
            </table>
            {{/if}}
            <!-- ********** CYBERWARE ********** -->
            {{#if (eq item.system.type "CYBERWARE")}}
            <table>
                <tr>
                    <th>{{localize 'shadowrun6.item.essence'}}</th>
                    <th>{{localize 'shadowrun6.item.capacity'}}</th>
                </tr>
                <tr>
                    <td> <input name="system.essence" type="number" value="{{item.system.essence}}" data-field="system.essence" id="ware_essence"
                            class="box centered" /></td>
                    <td> <input name="system.capacity" type="number" value="{{item.system.capacity}}" data-field="system.capacity" id="ware_cap"
                            class="box centered" /></td>
                </tr>
            </table>
            {{/if}}
            <!-- ********** COMLINK ********** -->
            {{#if (or
                (eq item.system.subtype "COMMLINK")
                (eq item.system.subtype "RIGGER_CONSOLE")
                (eq item.system.subtype "CYBERJACK")
                (eq item.system.subtype "DATATERM")
            )}}
            <table>
                <tr>
                    <th>{{localize 'shadowrun6.label.matrixMonitor'}}</th>
                    <th>{{localize 'shadowrun6.label.devRating'}}</th>
                    <th>{{localize 'shadowrun6.label.progSlots'}}</th>
                    <th>{{localize 'shadowrun6.label.dataproc.short'}}</th>
                    <th>{{localize 'shadowrun6.label.firewall.short'}}</th>
                </tr>
                <tr>
                    <td class="box centered">
                        <input name="system.dmg" type="number" value="{{item.system.dmg}}" data-field="system.dmg" class="box centered" style="width:2em" title="{{localize "shadowrun6.item.damage"}}"/>
                         /
                        <input type="number" value="{{item.maxtrixMonitor}}" class="box centered" style="width:2em" title="{{localize "shadowrun6.numerical.max"}}" disabled>
                    </td>
                    <td class="box centered">
                        <input name="system.devRating" type="number" value="{{item.system.devRating}}" data-field="system.devRating" class="box centered" style="width:2em" />
                    </td>
                    <td class="box centered">
                        <input name="system.progSlots" type="number" value="{{item.system.progSlots}}" data-field="system.progSlots" class="box centered" style="width:2em" />
                    </td>
                    <td class="box centered">
                        <input name="system.d" type="number" value="{{item.system.d}}" data-field="system.d" class="box centered" style="width:2em" />
                    </td>
                    <td class="box centered">
                        <input name="system.f" type="number" value="{{item.system.f}}" data-field="system.f" class="box centered" style="width:2em" />
                    </td>
                </tr>
            </table>
            {{/if}}
            <!-- ********** CYBERDECK ********** -->
            {{#if (eq item.system.subtype "CYBERDECK")}}
            <table>
                <tr>
                    <th>{{localize 'shadowrun6.label.matrixMonitor'}}</th>
                    <th>{{localize 'shadowrun6.label.devRating'}}</th>
                    <th>{{localize 'shadowrun6.label.progSlots'}}</th>
                    <th>{{localize 'shadowrun6.label.attack.short'}}</th>
                    <th>{{localize 'shadowrun6.label.sleaze.short'}}</th>
                </tr>
                <tr>
                    <td class="box centered">
                        <input name="system.dmg" type="number" value="{{item.system.dmg}}" data-field="system.dmg" class="box centered" style="width:2em" title="{{localize "shadowrun6.item.damage"}}"/>
                         /
                        <input type="number" value="{{item.maxtrixMonitor}}" class="box centered" style="width:2em" title="{{localize "shadowrun6.numerical.max"}}" disabled>
                    </td>
                    <td class="box centered"> <input name="system.devRating" type="number" value="{{item.system.devRating}}"
                            data-field="system.devRating" class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.progSlots" type="number" value="{{item.system.progSlots}}"
                            data-field="system.progSlots" class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.a" type="number" value="{{item.system.a}}" data-field="system.a"
                            class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.s" type="number" value="{{item.system.s}}" data-field="system.s"
                            class="box centered" style="width:2em" /></td>
                </tr>
            </table>
            {{/if}}
            <!-- ********** CYBERTERM ********** -->
            {{#if (eq item.system.subtype "CYBERTERM")}}
            <table>
                <tr>
                    <th>{{localize 'shadowrun6.label.matrixMonitor'}}</th>
                    <th>{{localize 'shadowrun6.label.devRating'}}</th>
                    <th>{{localize 'shadowrun6.label.progSlots'}}</th>
                    <th>{{localize 'shadowrun6.label.attack.short'}}</th>
                    <th>{{localize 'shadowrun6.label.sleaze.short'}}</th>
                    <th>{{localize 'shadowrun6.label.dataproc.short'}}</th>
                    <th>{{localize 'shadowrun6.label.firewall.short'}}</th>
                </tr>
                <tr>
                    <td class="box centered">
                        <input name="system.dmg" type="number" value="{{item.system.dmg}}" data-field="system.dmg" class="box centered" style="width:2em" title="{{localize "shadowrun6.item.damage"}}"/>
                         /
                        <input type="number" value="{{item.maxtrixMonitor}}" class="box centered" style="width:2em" title="{{localize "shadowrun6.numerical.max"}}" disabled>
                    </td>
                    <td class="box centered"> <input name="system.devRating" type="number" value="{{item.system.devRating}}"
                            data-field="system.devRating" class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.progSlots" type="number" value="{{item.system.progSlots}}"
                            data-field="system.progSlots" class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.a" type="number" value="{{item.system.a}}" data-field="system.a"
                            class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.s" type="number" value="{{item.system.s}}" data-field="system.s"
                            class="box centered" style="width:2em" /></td>
                    <td class="box centered">
                        <input name="system.d" type="number" value="{{item.system.d}}" data-field="system.d" class="box centered" style="width:2em" />
                    </td>
                    <td class="box centered">
                        <input name="system.f" type="number" value="{{item.system.f}}" data-field="system.f" class="box centered" style="width:2em" />
                    </td>
                </tr>
            </table>
            {{/if}}
            <!-- ********** VEHICLES / DRONES ********** -->
            {{#if (or
            (eq item.system.type "VEHICLES")
            (eq (subString item.system.type 0 6) "DRONE_")
            )}}
            <table>
                <tr>
                    <th colspan="2">{{ localize 'shadowrun6.section.vehicles.column.handling' }}</th>
                    <th>{{ localize 'shadowrun6.section.vehicles.column.acc' }}</th>
                    <th>{{ localize 'shadowrun6.section.vehicles.column.spdi' }}</th>
                    <th>{{ localize 'shadowrun6.section.vehicles.column.tspd' }}</th>
                    <th colspan="2">{{ localize 'shadowrun6.section.vehicles.column.vtype' }}</th>
                </tr>
                <tr>
                    <td class="box centered" colspan="2"> <input name="system.handlOn" type="number" value="{{item.system.handlOn}}"
                            data-field="system.handlOn" class="box centered" style="width:2em" /> / <input name="" type="number"
                            value="{{item.system.handlOff}}" data-field="system.handlOff" class="box centered"
                            style="width:2em" /></td>
                    <td class="box centered"> <input name="system.accOn" type="number" value="{{item.system.accOn}}" data-field="system.accOn"
                            class="box centered" style="width:2em" /> / <input name="accOff" type="number" value="{{item.system.accOff}}" data-field="system.accOff"
                            class="box centered" style="width:2em" /> </td>
                    <td class="box centered"> <input name="system.spdiOn" type="number" value="{{item.system.spdiOn}}" data-field="system.spdiOn"
                            class="box centered" style="width:2em" /> / <input name="spdiOff" type="number" value="{{item.system.spdiOff}}" data-field="system.spdiOff"
                            class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.tspd" type="number" value="{{item.system.tspd}}" data-field="system.tspd"
                            class="box centered" style="width:3em" /></td>
                    <td colspan="2" class="centered"> <select name="system.vtype" data-field="system.vtype" data-field="system.vtype" class="typeselect">
                            {{selectOptions config.VEHICLE_TYPE selected=item.system.vtype localize=true}}
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>{{ localize 'shadowrun6.section.vehicles.column.bod' }}</th>
                    <th>{{ localize 'shadowrun6.section.vehicles.column.arm' }}</th>
                    <th>{{ localize 'shadowrun6.section.vehicles.column.pil' }}</th>
                    <th>{{ localize 'shadowrun6.section.vehicles.column.sen' }}</th>
                    {{#if (eq item.system.type "VEHICLES")}}
                    <th>{{ localize 'shadowrun6.section.vehicles.column.sea' }}</th>
                    {{else}}
                    <th></th>
                    {{/if}}
                    <th>{{localize 'shadowrun6.label.matrixMonitor'}}</th>
                </tr>
                <tr>
                    <td class="box centered"> <input name="system.bod" type="number" value="{{item.system.bod}}" data-field="system.bod"
                            class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.arm" type="number" value="{{item.system.arm}}" data-field="system.arm"
                            class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.pil" type="number" value="{{item.system.pil}}" data-field="system.pil"
                            class="box centered" style="width:2em" /></td>
                    <td class="box centered"> <input name="system.sen" type="number" value="{{item.system.sen}}" data-field="system.sen"
                            class="box centered" style="width:2em" /></td>
                    {{#if (eq item.system.type "VEHICLES")}}
                    <td class="box centered"> <input name="system.sea" type="number" value="{{item.system.sea}}" data-field="system.sea"
                            class="box centered" style="width:2em" /></td>
                    {{else}}
                    <td></td>
                    {{/if}}
                    <td class="box centered">
                        <input name="system.dmg" type="number" value="{{item.system.dmg}}" data-field="system.dmg" class="box centered" style="width:2em" title="{{localize "shadowrun6.item.damage"}}"/>
                         /
                        <input type="number" value="{{item.maxtrixMonitor}}" class="box centered" style="width:2em" title="{{localize "shadowrun6.numerical.max"}}" disabled>
                    </td>

                </tr>
            </table>
            {{/if}}
            {{#if (ne item.system.type "MAGICAL")}}
            <h3>{{localize 'shadowrun6.item.accessories'}}</h3>
            {{editor item.enriched.accessories target="system.accessories" button=true owner=owner fieldName=item.system.accessories editable=editable engine="prosemirror"}}
            {{/if}}
            <h3>{{localize 'shadowrun6.item.description'}}</h3>
            {{editor item.enriched.description target="system.description" button=true owner=owner fieldName=item.system.description editable=editable engine="prosemirror"}}
    </section>
</form>

{{#if (ne item.system.type "MAGICAL")}}
{{> "systems/shadowrun-de/templates/item/item-mods.hbs" }}
{{/if}}
{{> "systems/shadowrun-de/templates/item/item-effects.hbs" }}