<div class="tab flexrow" data-group="primary" data-tab="description">

{{#if editingDescriptionTarget}}
    {{editor enriched.editing target=editingDescriptionTarget button=false editable=editable
             engine="prosemirror" collaborate=true}}
{{else}}
    <div class="item-properties">
        {{#if isPhysical}}
          {{#unless (eq item.type "container")}}
              <div class="form-group">
                  <label>{{ localize "DND5E.Quantity" }}</label>
                  {{numberInput system.quantity name="system.quantity"}}
              </div>
          {{/unless}}

        <div class="form-group">
            <label>{{ localize "DND5E.Weight" }}</label>
            {{ numberInput system.weight.value name="system.weight.value" }}
            <select name="system.weight.units">
                {{ selectOptions config.weightUnits selected=system.weight.units labelAttr="abbreviation" }}
            </select>
        </div>

        <div class="form-group">
            <label>{{ localize "DND5E.Price" }}</label>
            {{#if concealDetails}}
            <input type="text" value="{{localize 'DND5E.Unidentified.Value'}}" disabled>
            {{else}}
            {{numberInput system.price.value name="system.price.value"}}
            <select name="system.price.denomination">
                {{selectOptions config.currencies selected=system.price.denomination labelAttr="abbreviation"}}
            </select>
            {{/if}}
        </div>
        {{/if}}

        {{#if (or labels.toHit labels.derivedDamage)}}
        <h4 class="properties-header">{{localize "DND5E.Attack"}}/{{localize "DND5E.Damage"}}</h4>
        <ol class="properties-list" {{~#if concealDetails}} inert{{/if}}>
            {{#if labels.save}}
            <li>
                {{labels.save}}
            </li>
            {{/if}}

            {{#if labels.toHit}}
            <li>
                {{labels.toHit}} {{localize "DND5E.ToHit"}}
            </li>
            {{/if}}

            {{#each labels.derivedDamage}}
            <li>
                {{label}}
            </li>
            {{/each}}
        </ol>
        {{/if}}

        {{#if itemProperties.length}}
        <h4 class="properties-header">{{localize "DND5E.Properties"}}</h4>
        <ol class="properties-list" {{~#if concealDetails}} inert{{/if}}>
            {{#each itemProperties}}
            <li>{{this}}</li>
            {{/each}}
        </ol>
        {{/if}}
    </div>

    <div class="item-description">
    {{#if (or isIdentified user.isGM)}}

    {{#if (or editable system.description.value)}}
        {{#if editable}}
        <h3 class="description-header">
            <i class="accordion-indicator fa-solid fa-chevron-down"></i>
            {{localize "DND5E.Description"}}
            <a class="description-edit" data-target="system.description.value">
                <i class="fa-solid fa-edit"></i>
            </a>
        </h3>
        {{/if}}
        {{editor enriched.description target="system.description.value" editable=false engine="prosemirror"}}
    {{/if}}

    {{#if (and (or editable system.unidentified.description) isIdentifiable user.isGM)}}
        <h3 class="description-header">
            <i class="accordion-indicator fa-solid fa-chevron-down"></i>
            {{localize "DND5E.DescriptionUnidentified"}}
            {{#if editable}}
            <a class="description-edit" data-target="system.unidentified.description">
                <i class="fa-solid fa-edit"></i>
            </a>
            {{/if}}
        </h3>
        {{editor enriched.unidentified target="system.unidentified.description" editable=false engine="prosemirror"}}
    {{/if}}

    {{#if (or editable system.description.chat)}}
        <h3 class="description-header">
            <i class="accordion-indicator fa-solid fa-chevron-down"></i>
            {{localize "DND5E.DescriptionChat"}}
            {{#if editable}}
            <a class="description-edit" data-target="system.description.chat">
                <i class="fa-solid fa-edit"></i>
            </a>
            {{/if}}
        </h3>
        {{editor enriched.chat target="system.description.chat" editable=false engine="prosemirror"}}
    {{/if}}

    {{else}}

    {{#if (or editable system.unidentified.description)}}
        {{editor enriched.unidentified target="system.unidentified.description" button=true editable=true
                 engine="prosemirror"}}
    {{/if}}

    {{/if}}
    </div>
{{/if}}
</div>
