@extends('layouts.base')
@section('titulo', 'Perfil do Cliente')
@section('content')
    <div class="content d-flex flex-column flex-column-fluid" id="kt_content">
        <div class="toolbar" id="kt_toolbar">
            <div id="kt_toolbar_container" class="container-fluid d-flex flex-stack">
                <div data-kt-swapper="true" data-kt-swapper-mode="prepend"
                    data-kt-swapper-parent="{default: '#kt_content_container', 'lg': '#kt_toolbar_container'}"
                    class="page-title d-flex align-items-center flex-wrap me-3 mb-5 mb-lg-0">
                    <h1 class="d-flex align-items-center text-dark fw-bolder fs-3 my-1">Meus dados</h1>
                    <span class="h-20px border-gray-200 border-start mx-4"></span>
                    <ul class="breadcrumb breadcrumb-separatorless fw-bold fs-7 my-1">
                        <li class="breadcrumb-item text-muted">
                            <a href="{{ route('home') }}" class="text-muted text-hover-primary">Home</a>
                        </li>
                        <li class="breadcrumb-item"><span class="bullet bg-gray-200 w-5px h-2px"></span></li>
                        <li class="breadcrumb-item text-dark">{{ $usuario->name }}</li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="post d-flex flex-column-fluid" id="kt_post">
            <div id="kt_content_container" class="container-xxl">
                @if (session('message'))
                    <div class="alert alert-danger d-flex align-items-center p-5 mb-10">
                        <span class="svg-icon svg-icon-2hx svg-icon-danger me-4">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
                                <path opacity="0.3"
                                    d="M20.5543 4.37824L12.1798 2.02473C12.0626 1.99176 11.9376 1.99176 11.8203 2.02473L3.44572 4.37824C3.18118 4.45258 3 4.6807 3 4.93945V13.569C3 14.6914 3.48509 15.8404 4.4417 16.984C5.17231 17.8575 6.18314 18.7345 7.446 19.5909C9.56752 21.0295 11.6566 21.912 11.7445 21.9488C11.8258 21.9829 11.9129 22 12.0001 22C12.0872 22 12.1744 21.983 12.2557 21.9488C12.3435 21.912 14.4326 21.0295 16.5541 19.5909C17.8169 18.7345 18.8277 17.8575 19.5584 16.984C20.515 15.8404 21 14.6914 21 13.569V4.93945C21 4.6807 20.8189 4.45258 20.5543 4.37824Z"
                                    fill="black"></path>
                                <path
                                    d="M10.5606 11.3042L9.57283 10.3018C9.28174 10.0065 8.80522 10.0065 8.51412 10.3018C8.22897 10.5912 8.22897 11.0559 8.51412 11.3452L10.4182 13.2773C10.8099 13.6747 11.451 13.6747 11.8427 13.2773L15.4859 9.58051C15.771 9.29117 15.771 8.82648 15.4859 8.53714C15.1948 8.24176 14.7183 8.24176 14.4272 8.53714L11.7002 11.3042C11.3869 11.6221 10.874 11.6221 10.5606 11.3042Z"
                                    fill="black"></path>
                            </svg>
                        </span>
                        <div class="d-flex flex-column">
                            <h4 class="mb-1 text-danger">{{ session('message') }}</h4>
                        </div>
                    </div>
                @endif
                @if (session('success'))
                    <div class="alert alert-success d-flex align-items-center p-5 mb-10">
                        <span class="svg-icon svg-icon-2hx svg-icon-success me-4">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
                                <path opacity="0.3"
                                    d="M20.5543 4.37824L12.1798 2.02473C12.0626 1.99176 11.9376 1.99176 11.8203 2.02473L3.44572 4.37824C3.18118 4.45258 3 4.6807 3 4.93945V13.569C3 14.6914 3.48509 15.8404 4.4417 16.984C5.17231 17.8575 6.18314 18.7345 7.446 19.5909C9.56752 21.0295 11.6566 21.912 11.7445 21.9488C11.8258 21.9829 11.9129 22 12.0001 22C12.0872 22 12.1744 21.983 12.2557 21.9488C12.3435 21.912 14.4326 21.0295 16.5541 19.5909C17.8169 18.7345 18.8277 17.8575 19.5584 16.984C20.515 15.8404 21 14.6914 21 13.569V4.93945C21 4.6807 20.8189 4.45258 20.5543 4.37824Z"
                                    fill="black"></path>
                                <path
                                    d="M10.5606 11.3042L9.57283 10.3018C9.28174 10.0065 8.80522 10.0065 8.51412 10.3018C8.22897 10.5912 8.22897 11.0559 8.51412 11.3452L10.4182 13.2773C10.8099 13.6747 11.451 13.6747 11.8427 13.2773L15.4859 9.58051C15.771 9.29117 15.771 8.82648 15.4859 8.53714C15.1948 8.24176 14.7183 8.24176 14.4272 8.53714L11.7002 11.3042C11.3869 11.6221 10.874 11.6221 10.5606 11.3042Z"
                                    fill="black"></path>
                            </svg>
                        </span>
                        <div class="d-flex flex-column">
                            <h4 class="mb-1 text-success">{{ session('success') }}</h4>
                        </div>
                    </div>
                @endif

                @include('admin.perfil.base')

                <!--begin::CONTEÚDO DINÂMICO-->
                <div class="card">
                    <div class="card-header">
                        <div class="card-title fs-3 fw-bolder">Meus dados</div>
                    </div>
                    <form enctype="multipart/form-data" action="{{ route('update.dados.usuario',$usuario->id) }}" method="post" id="UpdatePerfil" name="personForm">
                        @csrf
                        <input value="{{ $usuario->empresa_id }}" name="empresa_id" type="hidden">
                        <div class="card-body border-top p-9">
                            @if (Auth::user()->cliente == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar Clientes</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input {{$usuario->cliente == 1 ? 'checked="checked"' : ''}} class="form-check-input" type="checkbox" value="1" id="cliente"  name="cliente">
                                            <label class="form-check-label fw-bold text-gray-400 ms-3" for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->atendimento_veterinario == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Atendimentos
                                        Veterinários</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1"
                                                id="atendimento_veterinario" name="atendimento_veterinario"
                                                {{$usuario->atendimento_veterinario == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->atendimento_adestramento == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Atendimentos
                                        Adestramentos</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1"
                                                id="atendimento_adestramento" name="atendimento_adestramento"
                                                {{$usuario->atendimento_adestramento == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->atendimento_refeicoes == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Atendimentos
                                        Refeições</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1"
                                                id="atendimento_refeicoes" name="atendimento_refeicoes"  {{$usuario->atendimento_refeicoes == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->animais == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar Animais</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="animais"
                                                name="animais"  {{$usuario->animais == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->pdv == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar Ponto de
                                        Venda</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="pdv" name="pdv"
                                            {{$usuario->pdv == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->financeiro == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar
                                        Financeiro</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="financeiro"
                                                name="financeiro"  {{$usuario->financeiro == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->relatorios == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar
                                        Relatórios</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="relatorios"
                                                name="relatorios"  {{$usuario->relatorios == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->agenda == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar
                                        Agendamentos</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="agenda"
                                                name="agenda"  {{$usuario->agenda == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->usuario == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar Usuários</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="usuario"
                                                name="usuario"  {{$usuario->usuario == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->controle == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar Setores de
                                        Cotroles</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="controle"
                                                name="controle"  {{$usuario->controle == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                            @if (Auth::user()->produto == 1)
                                <div class="row mb-6">
                                    <label class="col-lg-4 col-form-label required fw-bold fs-6">Gerenciar Produtos</label>
                                    <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                        <div class="form-check form-switch form-check-custom form-check-solid">
                                            <input class="form-check-input" type="checkbox" value="1" id="produto"
                                                name="produto"  {{$usuario->produto == 1 ? 'checked="checked"' : ''}}>
                                            <label class="form-check-label fw-bold text-gray-400 ms-3"
                                                for="status">Sim</label>
                                        </div>
                                    </div>
                                </div>
                            @endif
                        <div class="card-body border-top p-9">
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Nome</label>
                                <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                    <input type="text" name="name" id="name"
                                        class="form-control form-control-lg form-control-solid" placeholder="Nome"
                                        value="{{ $usuario->name }}">
                                    <div class="fv-plugins-message-container invalid-feedback"></div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Tratamento</label>
                                <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                    <select name="sexo" class="form-control form-control-lg form-control-solid">
                                        <option value="Dr" {{ $usuario->sexo == 'Dr' ? 'selected' : '' }}>Dr</option>
                                        <option value="Drª" {{ $usuario->sexo == 'Drª' ? 'selected' : '' }}>Drª</option>
                                    </select>
                                    <div class="fv-plugins-message-container invalid-feedback"></div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">CRMV</label>
                                <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                    <input type="text" name="crmv" id="crmv" value="{{$usuario->crmv}}" class="form-control form-control-lg form-control-solid">
                                    <div class="fv-plugins-message-container invalid-feedback"></div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">E-mail</label>
                                <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                    <input type="email" name="email" id="email" value="{{ $usuario->email }}"
                                        placeholder="E-mail" class="form-control form-control-lg form-control-solid">
                                    <div class="fv-plugins-message-container invalid-feedback"></div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Documentos</label>
                                <div class="col-lg-8">
                                    <div class="row">
                                        <div class="col-lg-6 fv-row fv-plugins-icon-container">
                                            <input type="tel" name="cpf" id="cpf" value="{{ $usuario->cpf }}"
                                                placeholder="CPF" class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                        <div class="col-lg-6 fv-row fv-plugins-icon-container">
                                            <input type="tel" name="rg" id="rg" value="{{ $usuario->rg }}"
                                                placeholder="RG" class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Contatos</label>
                                <div class="col-lg-8">
                                    <div class="row">
                                        <div class="col-lg-6 fv-row fv-plugins-icon-container">
                                            <input type="tel" name="celular" id="celular"
                                                value="{{ $usuario->celular }}" placeholder="Celular"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Nascimento</label>
                                <div class="col-lg-8">
                                    <div class="row">
                                        <div class="col-lg-6 fv-row fv-plugins-icon-container">
                                            <input type="tel" name="aniv" id="aniv" value="{{ $usuario->aniv }}"
                                                placeholder="Nascimento"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Endereço</label>
                                <div class="col-lg-8">
                                    <div class="row">
                                        <div class="col-lg-4 fv-row fv-plugins-icon-container">
                                            <input type="tel" name="cep" id="cep" value="{{ $usuario->cep }}"
                                                placeholder="CEP" class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                        <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                            <input type="text" name="endereco" id="endereco"
                                                value="{{ $usuario->endereco }}" placeholder="Endereço"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-lg-4 fv-row fv-plugins-icon-container">
                                            <input type="tel" name="numero" id="numero"
                                                value="{{ $usuario->numero }}" placeholder="Nº"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                        <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                            <input type="text" name="complemento" id="complemento"
                                                value="{{ $usuario->complemento }}" placeholder="Complemento"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-lg-4 fv-row fv-plugins-icon-container">
                                            <input type="tel" name="bairro" id="bairro"
                                                value="{{ $usuario->bairro }}" placeholder="Bairro"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                        <div class="col-lg-4 fv-row fv-plugins-icon-container">
                                            <input type="text" name="cidade" id="cidade"
                                                value="{{ $usuario->cidade }}" placeholder="Cidade"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                        <div class="col-lg-4 fv-row fv-plugins-icon-container">
                                            <input type="text" name="estado" id="estado"
                                                value="{{ $usuario->estado }}" placeholder="Estado"
                                                class="form-control form-control-lg form-control-solid">
                                            <div class="fv-plugins-message-container invalid-feedback"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Senha</label>
                                <div class="col-lg-8">
                                    <div class="row">
                                        <div class="col-lg-6 fv-row fv-plugins-icon-container" data-kt-password-meter="true">
                                            <input autocomplete="off" type="password" name="senha" id="senha"
                                                placeholder="Senha" value=""
                                                class="form-control form-control-lg form-control-solid">
                                                <span class="btn btn-sm btn-icon position-absolute translate-middle top-50 end-0 me-n2" data-kt-password-meter-control="visibility">
                                                    <i class="fa fa-eye fs-2 d-none"></i>
                                                    <i class="fa fa-eye-slash fs-2"></i>
                                                </span>
                                        </div>
                                        <div class="col-lg-6 fv-row fv-plugins-icon-container"  data-kt-password-meter="true">
                                            <input autocomplete="off" type="password" name="senha2" id="senha2"
                                                placeholder="Confirme a Senha" value=""
                                                class="form-control form-control-lg form-control-solid">
                                                <span class="btn btn-sm btn-icon position-absolute translate-middle top-50 end-0 me-n2" data-kt-password-meter-control="visibility">
                                                    <i class="fa fa-eye fs-2 d-none"></i>
                                                    <i class="fa fa-eye-slash fs-2"></i>
                                                </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row mb-6" data-kt-password-meter="true">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Matricula</label>
                                <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                    <input type="password" name="matricula" id="matricula" value="{{$usuario->matricula}}" class="form-control form-control-lg form-control-solid" autocomplete="off">
                                    <span class="btn btn-sm btn-icon position-absolute translate-middle top-50 end-0 me-n2" data-kt-password-meter-control="visibility">
                                        <i class="fa fa-eye fs-2 d-none"></i>
                                        <i class="fa fa-eye-slash fs-2"></i>
                                    </span>
                                </div>
                            </div>
                            <div class="row mb-6" data-kt-password-meter="true">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Senha Financeira</label>
                                <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                    <input type="password" name="senha_financeira" id="senha_financeira" value="{{$usuario->senha_financeira}}" class="form-control form-control-lg form-control-solid" autocomplete="off">
                                    <span class="btn btn-sm btn-icon position-absolute translate-middle top-50 end-0 me-n2" data-kt-password-meter-control="visibility">
                                        <i class="fa fa-eye fs-2 d-none"></i>
                                        <i class="fa fa-eye-slash fs-2"></i>
                                    </span>
                                </div>
                            </div>
                            <div class="row mb-6">
                                <label class="col-lg-4 col-form-label required fw-bold fs-6">Assinatura</label>
                                <div class="col-lg-8 fv-row fv-plugins-icon-container">
                                    <input type="file" name="assinatura" class="form-control form-control-lg form-control-solid">
                                    <div class="fv-plugins-message-container invalid-feedback"></div>
                                    <img
                                    src="{{ !empty($usuario->assinatura) ? url("storage/".$usuario->assinatura."") : url('admin/assets/images/assinatura.png')}}"
                                    width="{{ !empty($usuario->assinatura) ? "300" : "75"}}"
                                    />
                                </div>
                            </div>
                        </div>
                        <div class="card-footer d-flex justify-content-end py-6 px-9">
                            <button type="button" id="sendUpdate" class="btn btn-primary">Atualizar</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
@section('css')
    <link rel="shortcut icon" href="{{ url('adm') }}/assets/media/logos/favicon.ico" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" />
    <link href="{{ url('adm') }}/assets/plugins/custom/datatables/datatables.bundle.css" rel="stylesheet"
        type="text/css" />
    <link href="{{ url('adm') }}/assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
    <link href="{{ url('adm') }}/assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
@endsection

@section('js')
    <script src="{{ url('adm') }}/assets/plugins/global/plugins.bundle.js"></script>
    <script src="{{ url('adm') }}/assets/js/scripts.bundle.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/account/settings/deactivate-account.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/modals/two-factor-authentication.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/widgets.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/apps/chat/chat.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/modals/create-app.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/modals/upgrade-plan.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/intro.js"></script>
    <script src="{{ url('adm') }}/assets/js/custom/authentication/password-reset/new-password.js"></script>

    <script>
        Inputmask({
            "mask": "[9][9][9][9][9]-[A][A]"
        }).mask("#crmv");
        Inputmask({
            "mask": "999.999.999-99"
        }).mask("#cpf");
        Inputmask({
            "mask": "99/99"
        }).mask("#aniv");
        Inputmask({
            "mask": "(99) 99999-9999"
        }).mask("#celular");
        Inputmask({
            "mask": "99999-999"
        }).mask("#cep");
        Inputmask({
            "mask": "[9][.][9][.][9][.][9][9][9]KG"
        }).mask("#peso");
        Inputmask({
            "mask": "99/99/9999"
        }).mask("#nascimento");
    </script>

    <script>
        $(document).ready(function() {

            document.getElementById('senha').value = '';

            $("#sendUpdate").on("click", function() {
                if ($("#senha").val() != "") {
                    if ($("#senha").val() != $("#senha2").val()) {
                        Swal.fire({
                            title: "ATENÇÃO",
                            text: "As senhas precisam ser iguais",
                            icon: "error",
                            buttonsStyling: false,
                            confirmButtonText: "Corrigir",
                            customClass: {
                                confirmButton: "btn btn-danger"
                            }
                        });
                    } else {
                        document.getElementById("UpdatePerfil").submit();
                    }
                }else{
                    document.getElementById("UpdatePerfil").submit();
                }
            });

            $("#cep").on("blur", function() {
                var numCep = $("#cep").val();
                var url = "https://viacep.com.br/ws/" + numCep + "/json";
                $.ajax({
                    url: url,
                    type: "get",
                    dataType: "json",
                    success: function(dados) {
                        console.log(dados);
                        $("#cep").val(dados.cep);
                        $("#endereco").val(dados.logradouro);
                        $("#bairro").val(dados.bairro);
                        $("#cidade").val(dados.localidade);
                        $("#estado").val(dados.uf);
                    }
                })
            });
            $("#self").on("change", function() {
                document.getElementById("formSelf").submit();
            });
            $("#especie").change(function() {
                const url = $("#personForm").attr("data-especie-url");
                especie = $(this).val();
                $.ajax({
                    url: url,
                    data: {
                        'especie': especie
                    },
                    success: function(data) {
                        $("#raca").html(data);
                    }
                });
            });
        });
    </script>
@endsection
