<div class="table-header">
	<span class="title">{{localize 'dc20rpg.sheet.condImm.title'}}</span>
	<div class="menu">
		<div class="buttons">
			<div class="letter-circle-icon clickable small" title="{{localize 'dc20rpg.sheet.condImm.showEmptyConditions'}}">
				{{{show-hide-toggle flags.dc20rpg.showEmptyConditions "flags.dc20rpg.showEmptyConditions"}}}
			</div>
			<div class="letter-circle-icon clickable small" title="{{localize 'dc20rpg.sheet.condImm.showOnelinerModeCI'}}">
				{{{show-hide-toggle flags.dc20rpg.onelinerModeCI "flags.dc20rpg.onelinerModeCI" "true"}}}
			</div>
		</div>
	</div>
</div>

<div class="table-row condition-row condition-sub-header">
	<div class="column"><i></i></div>
	<div class="column"><i></i></div>
	<div class="column" title="{{localize 'dc20rpg.sheet.condImm.vulnerability'}}"><i class="fa-lg fa-solid fa-heart-crack"></i></div>
	<div class="column" title="{{localize 'dc20rpg.sheet.condImm.resistance'}}"><i class="fa-lg fa-solid fa-shield-halved"></i></div>
	<div class="column" title="{{localize 'dc20rpg.sheet.condImm.immunity'}}"><i class="fa-lg fa-solid fa-shield"></i></div>
</div>

{{#each system.statusResistances as |condition key|}}
{{#ifCond condition.notEmpty '||' @root.flags.dc20rpg.showEmptyConditions}}
<div class="table-row condition-row" title="{{condition.label}}">
	<div class="column icon">
		<img src="systems/dc20rpg/images/statuses/{{key}}.svg"/>
	</div>
	<input disabled class="column name" type="text" name="system.skills.{{key}}.label" value="{{condition.label}}">
	<div class="column" title="{{condition.label}} {{localize 'dc20rpg.sheet.condImm.vulnerability'}}"><input class="change-actor-numeric-value" {{#ifCond @root.isNPC '||' @root.editMode}}{{else}}disabled{{/ifCond}} type="number" data-path="system.statusResistances.{{key}}.vulnerability" value="{{condition.vulnerability}}"/></div>
	<div class="column" title="{{condition.label}} {{localize 'dc20rpg.sheet.condImm.resistance'}}"><input class="change-actor-numeric-value" {{#ifCond @root.isNPC '||' @root.editMode}}{{else}}disabled{{/ifCond}} type="number" data-path="system.statusResistances.{{key}}.resistance" value="{{condition.resistance}}"/></div>
  <div class="column" title="{{condition.label}} {{localize 'dc20rpg.sheet.condImm.immunity'}}">
		{{#ifCond @root.isNPC '||' @root.editMode}}
    <a class="activable fa-lg {{#if condition.immunity}}fa-solid fa-square-check{{else}}fa-regular fa-square{{/if}}" data-path="system.statusResistances.{{key}}.immunity"></a>
    {{else}}
    <i class="fa-lg {{#if condition.immunity}}fa-solid fa-square-check{{else}}fa-regular fa-square{{/if}}"></i>
		{{/ifCond}}
	</div>
</div>
{{/ifCond}}
{{/each}}

<div class="table-row custom-condition-row" title="{{localize 'dc20rpg.sheet.condImm.custom'}}">
  <div class="column custom">
    <span>Custom:</span>
    <textarea type="text" name="system.customCondition">{{system.customCondition}}</textarea>
  </div>
</div>
