<div>
      <form wire:submit.prevent="onUtmBuilder">

        <div>
            <!-- Session Status -->
            <x-auth-session-status class="mb-4" :status="session('status')" />
                                        
            <!-- Validation Errors -->
            <x-auth-validation-errors class="mb-4" :errors="$errors" />
        </div>

            <div class="form-group mb-3">
                <label class="form-label required">{{ __('Website URL') }}</label>
                <input type="text" class="form-control" wire:model.defer="link" required>
            </div>

            <div class="form-group mb-3">
                <label class="form-label required">{{ __('UTM Source') }}</label>
                <input type="text" class="form-control" wire:model.defer="utm_source" required>
            </div>

            <div class="form-group mb-3">
                <label class="form-label required">{{ __('UTM Medium') }}</label>
                <input type="text" class="form-control" wire:model.defer="utm_medium" required>
            </div>

            <div class="form-group mb-3">
                <label class="form-label required">{{ __('UTM Campaign') }}</label>
                <input type="text" class="form-control" wire:model.defer="utm_campaign" required>
            </div>

            <div class="form-group mb-3">
                <label class="form-label required">{{ __('UTM Content') }}</label>
                <input type="text" class="form-control" wire:model.defer="utm_content" required>
            </div>

            <div class="form-group mb-3">
                <label class="form-label required">{{ __('UTM Term') }}</label>
                <input type="text" class="form-control" wire:model.defer="utm_term" required>
            </div>

            @if ($generalSettings->captcha_status && ($generalSettings->captcha_for_registered || !auth()->check()))
              <x-public.recaptcha />
            @endif

            <div class="form-group text-center mb-0">
                <button class="btn bg-gradient-info mb-0" wire:loading.attr="disabled">
                    <span>
                        <div wire:loading.inline wire:target="onUtmBuilder">
                            <x-loading />
                        </div>
                        <span>{{ __('Generate') }}</span>
                    </span>
                </button>

                <button class="btn bg-gradient-success mb-0" wire:click.prevent="onSample" wire:loading.attr="disabled">
                  <span>
                    <div wire:loading.inline wire:target="onSample">
                      <x-loading />
                    </div>
                    <span>{{ __('Sample') }}</span>
                  </span>
                </button>

                <button class="btn bg-gradient-warning mb-0" wire:click.prevent="onReset" wire:loading.attr="disabled">
                  <span>
                    <div wire:loading.inline wire:target="onReset">
                      <x-loading />
                    </div>
                    <span>{{ __('Reset') }}</span>
                  </span>
                </button>
            </div>

            @if ( !empty($data) )
              <div class="form-group position-relative mt-3 mb-0">
                  <textarea id="result" class="form-control" rows="10">{{ $data['text'] }}</textarea>
                  <a onclick="copyToClipboard()" class="btn btn-icon-only btn-success cursor-pointer position-absolute top-0 end-0 m-2" title="{{ __('Copy') }}" data-bs-toggle="tooltip" data-bs-original-title="{{ __('Copy') }}">
                      <i class="fas fa-copy"></i>
                  </a>
              </div>
            @endif

      </form>

    <script>
      function copyToClipboard() {
        document.getElementById("result").select();
        document.execCommand('copy');
      }
    </script>
</div>