<section>
  <header class="sheet-header">
    <div class="sheet-header-row">
      <img class="profile-img" src="{{item.img}}" data-edit="img" data-action="editImage" data-tooltip="{{item.name}}" />
      <div class="header-fields">
        <h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
        <span>
          {{#if options.isOwned}}
          <a class="item-potion-consommer" data-tooltip="Consommer cette potion et appliquer ses effets"><i class="fa-solid fa-vial"></i> Consommer</a>
          {{/if}}
          {{#if (and isEnchantementPossible (not system.magique))}}
          <a class="item-enchanter" data-tooltip="Enchanter cette potion"><i class="fa-solid fa-sparkles"></i> Enchanter</a>
          {{/if}}
        </span>
      </div>
    </div>
  </header>
  <div class="sheet-body">
    <div class="form-group">
      <label>Fréquence</label>
      <div class="form-fields">
        <select name="system.rarete" data-dtype="String">
          {{#select system.rarete}}
          <option value=""></option>
          {{> "systems/foundryvtt-reve-de-dragon/templates/enum-rarete.hbs"}}
          {{/select}}
        </select>
      </div>
    </div>
    <div class="form-group">
      <label>Catégorie</label>
      <div class="form-fields">
        <select name="system.categorie" data-dtype="String">
          {{#select system.categorie}}
          {{> "systems/foundryvtt-reve-de-dragon/templates/item/enum-categorie-alchimie.hbs"}}
          {{/select}}
        </select>
      </div>
    </div>
    <div class="form-group">
      <label>État / consistance</label>
      <div class="form-fields">
        <select name="system.etat" data-dtype="String">
          {{#select system.etat}}
          {{> "systems/foundryvtt-reve-de-dragon/templates/item/enum-etat-alchimie.hbs"}}
          {{/select}}
        </select>
      </div>
    </div>
    {{#if (or isSoins isRepos)}}
    <div class="form-group">
      <label>Herbe</label>
      <div class="form-fields">
        <input type="text" value="{{system.herbe}} ({{system.herbebrins}} brins, bonus {{system.herbebonus}}){{#if isRepos}}{{#if system.reposalchimique}} — Repos alchimique{{/if}}{{/if}}" disabled />
      </div>
    </div>
    {{/if}}
    <fieldset>
      <legend>Enchantement</legend>
      <div class="form-group">
        <label>Statut</label>
        <div class="form-fields">
          {{#if system.magique}}
          <span><i class="fa-solid fa-sparkles"></i> Enchantée (PR {{system.pr}})</span>
          {{else if isEnchantementPossible}}
          <span><i class="fa-regular fa-sparkle"></i> Non enchantée</span>
          {{else}}
          <span>Non enchantable</span>
          {{/if}}
        </div>
      </div>
      {{#if system.magique}}
      <div class="form-group">
        <label>Points de rêve</label>
        <div class="form-fields">
          <input name="system.pr" type="number" value="{{system.pr}}" min="0" />
        </div>
      </div>
      <div class="form-group">
        <label>Purifiée</label>
        <div class="form-fields">
          <input name="system.purifie" type="checkbox" {{#if system.purifie}}checked{{/if}} />
        </div>
      </div>
      <div class="form-group">
        <label>Permanente</label>
        <div class="form-fields">
          <input name="system.prpermanent" type="checkbox" {{#if system.prpermanent}}checked{{/if}} />
        </div>
      </div>
      <div class="form-group">
        <label>Date d'enchantement</label>
        <div class="form-fields">
          <input name="enchantement.jour" class="date-enchantement" type="number" value="{{enchantement.jour}}" min="1" max="28" />
          <select name="enchantement.mois" class="date-enchantement" data-dtype="String">
            {{#select enchantement.mois}}
            {{> "systems/foundryvtt-reve-de-dragon/templates/enum-heures.hbs"}}
            {{/select}}
          </select>
        </div>
      </div>
      <div class="form-group">
        {{#if isSoins}}
        <label>Points de guérison</label>
        {{else if isRepos}}
        <label>Points de repos</label>
        {{else}}
        <label>Puissance</label>
        {{/if}}
        <div class="form-fields">
          <input type="number" value="{{system.puissance}}" disabled />
        </div>
      </div>
      {{/if}}
      {{#if (and isEnchantementPossible (not system.magique))}}
      <div class="form-group">
        <label></label>
        <div class="form-fields">
          <a class="item-enchanter"><i class="fa-solid fa-sparkles"></i> Enchanter</a>
        </div>
      </div>
      {{/if}}
    </fieldset>
  {{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-inventaire.hbs"}}
  {{>"systems/foundryvtt-reve-de-dragon/templates/sheets/item/common/template-description.hbs"}}
  </div>
</section>
