<script src="{{asset('assets/js/app.js')}}"></script>
<script>
$('[data-bs-toggle="popover"]').popover({
    container: 'body'
});
</script>
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg">
    <div class="modal-content">
      <form id="frm-group" method="post" action="{{route('tracking_domains.update', $tracking_domain->id)}}" class="needs-validation" novalidate>
        @csrf
        @method('PUT')
        <div class="modal-header">
          <h6 class="modal-title">{{__('app.edit_tracking_domain')}}</h6>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{__('app.close')}}"></button>
        </div>
        <div class="modal-body">
          <div class="box-body">
            <div class="row">
            <div class="col-md-3">
              <label class="form-label">{{__('app.protocol')}}</label>
              <select name="protocol" class="form-select form-select-lg">
                 <option value="https://" {{ $tracking_domain->protocol == 'https://' ? 'selected' : '' }}>https://</option>
                 <option value="http://" {{ $tracking_domain->protocol == 'http://' ? 'selected' : '' }}>http://</option>
              </select>
            </div>
            <div class="col-md-9">
              <label class="form-label">{{__('app.domain')}}</label>
              <input type="text" class="form-control" placeholder="{{__('app.domain')}}" value="{{$tracking_domain->domain}}" name="domain" required>
            </div>
          </div>
          <div class="row mt-3">
            <div class="col-md-4 mt-3">
              <label class="form-label">{{__('app.active')}}</label>
              <select name="is_active" class="form-select form-select-lg">
                 <option value="1" {{ $tracking_domain->is_active ? 'selected' : '' }}>{{ __('app.yes')}}</option>
                 <option value="0" {{ $tracking_domain->is_active ? '' : 'selected' }}>{{ __('app.no') }}</option>
              </select>
            </div>
            <div class="col-md-4 mt-3">
              <label class="form-label">{{__('app.verified')}}
              <a tabindex="-1" role="button"
              data-bs-toggle="popover" data-bs-trigger="focus" data-bs-placement="right" title="{{__('app.verified')}}"
              data-bs-content="{{__('app.domain_verified_help')}}" data-bs-custom-class="header-primary"><i class="bi bi-question-square text-primary"></i>
              </a>
              </label>
              <select name="is_verified" class="form-select form-select-lg">
                 <option value="0" {{ $tracking_domain->is_verified ? '' : 'selected' }}>{{ __('app.no')}}</option>
                 <option value="1" {{ $tracking_domain->is_verified ? 'selected' : '' }}>{{ __('app.yes') }}</option>
              </select>
            </div>
            <div class="col-md-4 mt-3">
              <label class="form-label">{{__('app.auto_verification')}}
              <a tabindex="-1" role="button"
              data-bs-toggle="popover" data-bs-trigger="focus" data-bs-placement="right" title="{{__('app.auto_verification')}}"
              data-bs-content="{{__('app.domain_auto_verfication_help')}}" data-bs-custom-class="header-primary"><i class="bi bi-question-square text-primary"></i>
              </a>
              </label>
              <select name="auto_verification" class="form-select form-select-lg">
                 <option value="0" {{ $tracking_domain->auto_verification ? '' : 'selected' }}>{{ __('app.no')}}</option>
                 <option value="1" {{ $tracking_domain->auto_verification ? 'selected' : '' }}>{{ __('app.yes') }}</option>
              </select>
            </div>
          </div>
          <div class="col-md-12 mt-4">
            <h6>{{__('app.dns_entry')}}</h6>
          </div>
          <div class="col-md-12">
            <lable>
              {!! str_replace('[domain-name]', $tracking_domain->domain , __('app.help_dns_entries_trackging_domains')) !!}
            </lable>
          </div>
          <div class="row mt-3">
            <div class="col-md-4 fw-bold mx-1">{{__('app.type')}}</div>
            <div class="col-md-4 fw-bold">{{__('app.host')}}</div>
            <div class="col-md-3 fw-bold">{{__('app.value')}}</div>
          </div>
          <div class="row mt-3">
            <div class="col-md-4 mx-1">TXT</div>
            <div class="col-md-4">{{$tracking_domain->domain}}</div>
            <div class="col-md-3">{{\App\Http\Helper\Helper::getAppURL(true)}}</div>
          </div>
          <div class="row mt-3">
            <div class="col-md-12 fw-bold link-success mx-1">OR</div>
          </div>
          <div class="row mt-3">
            <div class="col-md-4 mx-1">A</div>
            <div class="col-md-4">{{$tracking_domain->domain}}</div>
            <div class="col-md-3">{{$_SERVER['SERVER_ADDR']}}</div>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger" data-bs-dismiss="modal">{{__('app.close')}}</button>
        <button type="submit" class="btn btn-primary btn-loading"><i class=""></i> {{__('app.update')}}</button>
      </div>
    </form>
  </div>
</div>