<inserisci-utente>
    <section class="content">
        <div class="row">
            <div class="col-md-6">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">Informazioni generali</h3>
                    </div>
                    <form role="form" class="form-horizontal form_user">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="tipologia" class="col-sm-2 control-label">Tipologia utente</label>
                                <div class="col-sm-10">
                                    <select class="form-control no-populate" name="tipo_utente" onchange="{
                                                tipoUtenteChanged
                                            }">      
                                        <option value="azienda" selected="{ object && object.get('tipo_utente') == 'azienda' }">Azienda</option>
                                        <option value="privato" selected="{ object && object.get('tipo_utente') == 'privato' }">Privato</option>
                                    </select>
                                </div>
                            </div>
                            <div if="{ tipo_utente == 'privato' }" class="form-group">
                                <label for="nome" class="col-sm-2 control-label">Nome</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Nome" name="nome" required value="{ object ? object.get('nome') : '' }">
                                </div>
                            </div>
                            <div if="{ tipo_utente == 'privato' }" class="form-group">
                                <label for="cognome" class="col-sm-2 control-label">Cognome</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Cognome" name="cognome" required value="{ object ? object.get('cognome') : '' }">
                                </div>
                            </div>
                            <div if="{ tipo_utente == 'azienda' }" class="form-group">
                                <label for="ragionesociale" class="col-sm-2 control-label">Ragione sociale</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Ragione sociale" name="ragionesociale" required value="{ object ? object.get('ragionesociale') : '' }">
                                </div>
                            </div>
                            <div if="{ tipo_utente == 'azienda' }" class="form-group">
                                <label for="piva" class="col-sm-2 control-label">P. IVA</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="P. IVA" name="piva" required value="{ object ? object.get('piva') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cf" class="col-sm-2 control-label">CF</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="CF" name="cf" required value="{ object ? object.get('cf') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="stato" class="col-sm-2 control-label">Stato</label>
                                <div class="col-sm-10">
                                    <select class="form-control" name="stato" onchange="{
                                                statoChanged
                                            }">
                                        <option value='Afghanistan' selected="{ object && object.get('stato') == 'Afghanistan' }">Afghanistan</option>
                                        <option value='Albania' selected="{ object && object.get('stato') == 'Albania' }">Albania</option>
                                        <option value='Algeria' selected="{ object && object.get('stato') == 'Algeria' }">Algeria</option>
                                        <option value='Andorra' selected="{ object && object.get('stato') == 'Andorra' }">Andorra</option>
                                        <option value='Angola' selected="{ object && object.get('stato') == 'Angola' }">Angola</option>
                                        <option value='Antigua and Barbuda' selected="{ object && object.get('stato') == 'Antigua and Barbuda' }">Antigua and Barbuda</option>
                                        <option value='Argentina' selected="{ object && object.get('stato') == 'Argentina' }">Argentina</option>
                                        <option value='Armenia' selected="{ object && object.get('stato') == 'Armenia' }">Armenia</option>
                                        <option value='Australia' selected="{ object && object.get('stato') == 'Australia' }">Australia</option>
                                        <option value='Austria' selected="{ object && object.get('stato') == 'Austria' }">Austria</option>
                                        <option value='Azerbaijan' selected="{ object && object.get('stato') == 'Azerbaijan' }">Azerbaijan</option>
                                        <option value='Bahamas' selected="{ object && object.get('stato') == 'Bahamas' }">Bahamas</option>
                                        <option value='Bahrain' selected="{ object && object.get('stato') == 'Bahrain' }">Bahrain</option>
                                        <option value='Bangladesh' selected="{ object && object.get('stato') == 'Bangladesh' }">Bangladesh</option>
                                        <option value='Barbados' selected="{ object && object.get('stato') == 'Barbados' }">Barbados</option>
                                        <option value='Belarus' selected="{ object && object.get('stato') == 'Belarus' }">Belarus</option>
                                        <option value='Belgium' selected="{ object && object.get('stato') == 'Belgium' }">Belgium</option>
                                        <option value='Belize' selected="{ object && object.get('stato') == 'Belize' }">Belize</option>
                                        <option value='Benin' selected="{ object && object.get('stato') == 'Benin' }">Benin</option>
                                        <option value='Bhutan' selected="{ object && object.get('stato') == 'Bhutan' }">Bhutan</option>
                                        <option value='Bolivia' selected="{ object && object.get('stato') == 'Bolivia' }">Bolivia</option>
                                        <option value='Bosnia and Herzegovina' selected="{ object && object.get('stato') == 'Bosnia and Herzegovina' }">Bosnia and Herzegovina</option>
                                        <option value='Botswana' selected="{ object && object.get('stato') == 'Botswana' }">Botswana</option>
                                        <option value='Brazil' selected="{ object && object.get('stato') == 'Brazil' }">Brazil</option>
                                        <option value='Brunei ' selected="{ object && object.get('stato') == 'Brunei' }">Brunei </option>
                                        <option value='Bulgaria' selected="{ object && object.get('stato') == 'Bulgaria' }">Bulgaria</option>
                                        <option value='Burkina Faso' selected="{ object && object.get('stato') == 'Burkina Faso' }">Burkina Faso</option>
                                        <option value='Burundi' selected="{ object && object.get('stato') == 'Burundi' }">Burundi</option>
                                        <option value='Cote d Ivoire' selected="{ object && object.get('stato') == 'Cote d Ivoire' }">C&ocirc;te d'Ivoire</option>
                                        <option value='Cabo Verde' selected="{ object && object.get('stato') == 'Cabo Verde' }">Cabo Verde</option>
                                        <option value='Cambodia' selected="{ object && object.get('stato') == 'Cambodia' }">Cambodia</option>
                                        <option value='Cameroon' selected="{ object && object.get('stato') == 'Cameroon' }">Cameroon</option>
                                        <option value='Canada' selected="{ object && object.get('stato') == 'Canada' }">Canada</option>
                                        <option value='Central African Republic' selected="{ object && object.get('stato') == 'Central African Republic' }">Central African Republic</option>
                                        <option value='Chad' selected="{ object && object.get('stato') == 'Chad' }">Chad</option>
                                        <option value='Chile' selected="{ object && object.get('stato') == 'Chile' }">Chile</option>
                                        <option value='China' selected="{ object && object.get('stato') == 'China' }">China</option>
                                        <option value='Colombia' selected="{ object && object.get('stato') == 'Colombia' }">Colombia</option>
                                        <option value='Comoros' selected="{ object && object.get('stato') == 'Comoros' }">Comoros</option>
                                        <option value='Congo (Congo-Brazzaville)' selected="{ object && object.get('stato') == 'Congo (Congo-Brazzaville)' }">Congo (Congo-Brazzaville)</option>
                                        <option value='Costa Rica' selected="{ object && object.get('stato') == 'Costa Rica' }">Costa Rica</option>
                                        <option value='Croatia' selected="{ object && object.get('stato') == 'Croatia' }">Croatia</option>
                                        <option value='Cuba' selected="{ object && object.get('stato') == 'Cuba' }">Cuba</option>
                                        <option value='Cyprus' selected="{ object && object.get('stato') == 'Cyprus' }">Cyprus</option>
                                        <option value='Czech Republic' selected="{ object && object.get('stato') == 'Czech Republic' }">Czech Republic</option>
                                        <option value='Democratic Republic of the Congo' selected="{ object && object.get('stato') == 'Democratic Republic of the Congo' }">Democratic Republic of the Congo</option>
                                        <option value='Denmark' selected="{ object && object.get('stato') == 'Denmark' }">Denmark</option>
                                        <option value='Djibouti' selected="{ object && object.get('stato') == 'Djibouti' }">Djibouti</option>
                                        <option value='Dominica' selected="{ object && object.get('stato') == 'Dominica' }">Dominica</option>
                                        <option value='Dominican Republic' selected="{ object && object.get('stato') == 'Dominican Republic' }">Dominican Republic</option>
                                        <option value='Ecuador' selected="{ object && object.get('stato') == 'Ecuador' }">Ecuador</option>
                                        <option value='Egypt' selected="{ object && object.get('stato') == 'Egypt' }">Egypt</option>
                                        <option value='El Salvador' selected="{ object && object.get('stato') == 'El Salvador' }">El Salvador</option>
                                        <option value='Equatorial Guinea' selected="{ object && object.get('stato') == 'Equatorial Guinea' }">Equatorial Guinea</option>
                                        <option value='Eritrea' selected="{ object && object.get('stato') == 'Eritrea' }">Eritrea</option>
                                        <option value='Estonia' selected="{ object && object.get('stato') == 'Estonia' }">Estonia</option>
                                        <option value='Ethiopia' selected="{ object && object.get('stato') == 'Ethiopia' }">Ethiopia</option>
                                        <option value='Fiji' selected="{ object && object.get('stato') == 'Fiji' }">Fiji</option>
                                        <option value='Finland' selected="{ object && object.get('stato') == 'Finland' }">Finland</option>
                                        <option value='France' selected="{ object && object.get('stato') == 'France' }">France</option>
                                        <option value='Gabon' selected="{ object && object.get('stato') == 'Gabon' }">Gabon</option>
                                        <option value='Gambia' selected="{ object && object.get('stato') == 'Gambia' }">Gambia</option>
                                        <option value='Georgia' selected="{ object && object.get('stato') == 'Georgia' }">Georgia</option>
                                        <option value='Germany' selected="{ object && object.get('stato') == 'Germany' }">Germany</option>
                                        <option value='Ghana' selected="{ object && object.get('stato') == 'Ghana' }">Ghana</option>
                                        <option value='Greece' selected="{ object && object.get('stato') == 'Greece' }">Greece</option>
                                        <option value='Grenada' selected="{ object && object.get('stato') == 'Grenada' }">Grenada</option>
                                        <option value='Guatemala' selected="{ object && object.get('stato') == 'Guatemala' }">Guatemala</option>
                                        <option value='Guinea' selected="{ object && object.get('stato') == 'Guinea' }">Guinea</option>
                                        <option value='Guinea-Bissau' selected="{ object && object.get('stato') == 'Guinea-Bissau' }">Guinea-Bissau</option>
                                        <option value='Guyana' selected="{ object && object.get('stato') == 'Guyana' }">Guyana</option>
                                        <option value='Haiti' selected="{ object && object.get('stato') == 'Haiti' }">Haiti</option>
                                        <option value='Holy See' selected="{ object && object.get('stato') == 'Holy See' }">Holy See</option>
                                        <option value='Honduras' selected="{ object && object.get('stato') == 'Honduras' }">Honduras</option>
                                        <option value='Hungary' selected="{ object && object.get('stato') == 'Hungary' }">Hungary</option>
                                        <option value='Iceland' selected="{ object && object.get('stato') == 'Iceland' }">Iceland</option>
                                        <option value='India' selected="{ object && object.get('stato') == 'India' }">India</option>
                                        <option value='Indonesia' selected="{ object && object.get('stato') == 'Indonesia' }">Indonesia</option>
                                        <option value='Iran' selected="{ object && object.get('stato') == 'Iran' }">Iran</option>
                                        <option value='Iraq' selected="{ object && object.get('stato') == 'Iraq' }">Iraq</option>
                                        <option value='Ireland' selected="{ object && object.get('stato') == 'Ireland' }">Ireland</option>
                                        <option value='Israel' selected="{ object && object.get('stato') == 'Israel' }">Israel</option>
                                        <option value='Italy' selected="{ object && object.get('stato') == 'Italy' }">Italy</option>
                                        <option value='Jamaica' selected="{ object && object.get('stato') == 'Jamaica' }">Jamaica</option>
                                        <option value='Japan' selected="{ object && object.get('stato') == 'Japan' }">Japan</option>
                                        <option value='Jordan' selected="{ object && object.get('stato') == 'Jordan' }">Jordan</option>
                                        <option value='Kazakhstan' selected="{ object && object.get('stato') == 'Kazakhstan' }">Kazakhstan</option>
                                        <option value='Kenya' selected="{ object && object.get('stato') == 'Kenya' }">Kenya</option>
                                        <option value='Kiribati' selected="{ object && object.get('stato') == 'Kiribati' }">Kiribati</option>
                                        <option value='Kuwait' selected="{ object && object.get('stato') == 'Kuwait' }">Kuwait</option>
                                        <option value='Kyrgyzstan' selected="{ object && object.get('stato') == 'Kyrgyzstan' }">Kyrgyzstan</option>
                                        <option value='Laos' selected="{ object && object.get('stato') == 'Laos' }">Laos</option>
                                        <option value='Latvia' selected="{ object && object.get('stato') == 'Latvia' }">Latvia</option>
                                        <option value='Lebanon' selected="{ object && object.get('stato') == 'Lebanon' }">Lebanon</option>
                                        <option value='Lesotho' selected="{ object && object.get('stato') == 'Lesotho' }">Lesotho</option>
                                        <option value='Liberia' selected="{ object && object.get('stato') == 'Liberia' }">Liberia</option>
                                        <option value='Libya' selected="{ object && object.get('stato') == 'Libya' }">Libya</option>
                                        <option value='Liechtenstein' selected="{ object && object.get('stato') == 'Liechtenstein' }">Liechtenstein</option>
                                        <option value='Lithuania' selected="{ object && object.get('stato') == 'Lithuania' }">Lithuania</option>
                                        <option value='Luxembourg' selected="{ object && object.get('stato') == 'Luxembourg' }">Luxembourg</option>
                                        <option value='Macedonia (FYROM)' selected="{ object && object.get('stato') == 'Macedonia' }">Macedonia (FYROM)</option>
                                        <option value='Madagascar' selected="{ object && object.get('stato') == 'Madagascar' }">Madagascar</option>
                                        <option value='Malawi' selected="{ object && object.get('stato') == 'Malawi' }">Malawi</option>
                                        <option value='Malaysia' selected="{ object && object.get('stato') == 'Malaysia' }">Malaysia</option>
                                        <option value='Maldives' selected="{ object && object.get('stato') == 'Maldives' }">Maldives</option>
                                        <option value='Mali' selected="{ object && object.get('stato') == 'Mali' }">Mali</option>
                                        <option value='Malta' selected="{ object && object.get('stato') == 'Malta' }">Malta</option>
                                        <option value='Marshall Islands' selected="{ object && object.get('stato') == 'Marshall Islands' }">Marshall Islands</option>
                                        <option value='Mauritania' selected="{ object && object.get('stato') == 'Mauritania' }">Mauritania</option>
                                        <option value='Mauritius' selected="{ object && object.get('stato') == 'Mauritius' }">Mauritius</option>
                                        <option value='Mexico' selected="{ object && object.get('stato') == 'Mexico' }">Mexico</option>
                                        <option value='Micronesia' selected="{ object && object.get('stato') == 'Micronesia' }">Micronesia</option>
                                        <option value='Moldova' selected="{ object && object.get('stato') == 'Moldova' }">Moldova</option>
                                        <option value='Monaco' selected="{ object && object.get('stato') == 'Monaco' }">Monaco</option>
                                        <option value='Mongolia' selected="{ object && object.get('stato') == 'Mongolia' }">Mongolia</option>
                                        <option value='Montenegro' selected="{ object && object.get('stato') == 'Montenegro' }">Montenegro</option>
                                        <option value='Morocco' selected="{ object && object.get('stato') == 'Morocco' }">Morocco</option>
                                        <option value='Mozambique' selected="{ object && object.get('stato') == 'Mozambique' }">Mozambique</option>
                                        <option value='Myanmar (formerly Burma)' selected="{ object && object.get('stato') == 'Myanmar (formerly Burma)' }">Myanmar (formerly Burma)</option>
                                        <option value='Namibia' selected="{ object && object.get('stato') == 'Namibia' }">Namibia</option>
                                        <option value='Nauru' selected="{ object && object.get('stato') == 'Nauru' }">Nauru</option>
                                        <option value='Nepal' selected="{ object && object.get('stato') == 'Nepal' }">Nepal</option>
                                        <option value='Netherlands' selected="{ object && object.get('stato') == 'Netherlands' }">Netherlands</option>
                                        <option value='New Zealand' selected="{ object && object.get('stato') == 'New Zealand' }">New Zealand</option>
                                        <option value='Nicaragua' selected="{ object && object.get('stato') == 'Nicaragua' }">Nicaragua</option>
                                        <option value='Niger' selected="{ object && object.get('stato') == 'Niger' }">Niger</option>
                                        <option value='Nigeria' selected="{ object && object.get('stato') == 'Nigeria' }">Nigeria</option>
                                        <option value='North Korea' selected="{ object && object.get('stato') == 'North Korea' }">North Korea</option>
                                        <option value='Norway' selected="{ object && object.get('stato') == 'Norway' }">Norway</option>
                                        <option value='Oman' selected="{ object && object.get('stato') == 'Oman' }">Oman</option>
                                        <option value='Pakistan' selected="{ object && object.get('stato') == 'Pakistan' }">Pakistan</option>
                                        <option value='Palau' selected="{ object && object.get('stato') == 'Palau' }">Palau</option>
                                        <option value='Palestine State' selected="{ object && object.get('stato') == 'Palestine State' }">Palestine State</option>
                                        <option value='Panama' selected="{ object && object.get('stato') == 'Panama' }">Panama</option>
                                        <option value='Papua New Guinea' selected="{ object && object.get('stato') == 'Papua New Guinea' }">Papua New Guinea</option>
                                        <option value='Paraguay' selected="{ object && object.get('stato') == 'Paraguay' }">Paraguay</option>
                                        <option value='Peru' selected="{ object && object.get('stato') == 'Peru' }">Peru</option>
                                        <option value='Philippines' selected="{ object && object.get('stato') == 'Philippines' }">Philippines</option>
                                        <option value='Poland' selected="{ object && object.get('stato') == 'Poland' }">Poland</option>
                                        <option value='Portugal' selected="{ object && object.get('stato') == 'Portugal' }">Portugal</option>
                                        <option value='Qatar' selected="{ object && object.get('stato') == 'Qatar' }">Qatar</option>
                                        <option value='Romania' selected="{ object && object.get('stato') == 'Romania' }">Romania</option>
                                        <option value='Russia' selected="{ object && object.get('stato') == 'Russia' }">Russia</option>
                                        <option value='Rwanda' selected="{ object && object.get('stato') == 'Rwanda' }">Rwanda</option>
                                        <option value='Saint Kitts and Nevis' selected="{ object && object.get('stato') == 'Saint Kitts and Nevis' }">Saint Kitts and Nevis</option>
                                        <option value='Saint Lucia' selected="{ object && object.get('stato') == 'Saint Lucia' }">Saint Lucia</option>
                                        <option value='Saint Vincent and the Grenadines' selected="{ object && object.get('stato') == 'Saint Vincent and the Grenadines' }">Saint Vincent and the Grenadines</option>
                                        <option value='Samoa' selected="{ object && object.get('stato') == 'Samoa' }">Samoa</option>
                                        <option value='San Marino' selected="{ object && object.get('stato') == 'San Marino' }">San Marino</option>
                                        <option value='Sao Tome and Principe' selected="{ object && object.get('stato') == 'Sao Tome and Principe' }">Sao Tome and Principe</option>
                                        <option value='Saudi Arabia' selected="{ object && object.get('stato') == 'Saudi Arabia' }">Saudi Arabia</option>
                                        <option value='Senegal' selected="{ object && object.get('stato') == 'Senegal' }">Senegal</option>
                                        <option value='Serbia' selected="{ object && object.get('stato') == 'Serbia' }">Serbia</option>
                                        <option value='Seychelles' selected="{ object && object.get('stato') == 'Seychelles' }">Seychelles</option>
                                        <option value='Sierra Leone' selected="{ object && object.get('stato') == 'Sierra Leone' }">Sierra Leone</option>
                                        <option value='Singapore' selected="{ object && object.get('stato') == 'Singapore' }">Singapore</option>
                                        <option value='Slovakia' selected="{ object && object.get('stato') == 'Slovakia' }">Slovakia</option>
                                        <option value='Slovenia' selected="{ object && object.get('stato') == 'Slovenia' }">Slovenia</option>
                                        <option value='Solomon Islands' selected="{ object && object.get('stato') == 'Solomon Islands' }">Solomon Islands</option>
                                        <option value='Somalia' selected="{ object && object.get('stato') == 'Somalia' }">Somalia</option>
                                        <option value='South Africa' selected="{ object && object.get('stato') == 'South Africa' }">South Africa</option>
                                        <option value='South Korea' selected="{ object && object.get('stato') == 'South Korea' }">South Korea</option>
                                        <option value='South Sudan' selected="{ object && object.get('stato') == 'South Sudan' }">South Sudan</option>
                                        <option value='Spain' selected="{ object && object.get('stato') == 'Spain' }">Spain</option>
                                        <option value='Sri Lanka' selected="{ object && object.get('stato') == 'Sri Lanka' }">Sri Lanka</option>
                                        <option value='Sudan' selected="{ object && object.get('stato') == 'Sudan' }">Sudan</option>
                                        <option value='Suriname' selected="{ object && object.get('stato') == 'Suriname' }">Suriname</option>
                                        <option value='Swaziland' selected="{ object && object.get('stato') == 'Swaziland' }">Swaziland</option>
                                        <option value='Sweden' selected="{ object && object.get('stato') == 'Sweden' }">Sweden</option>
                                        <option value='Switzerland' selected="{ object && object.get('stato') == 'Switzerland' }">Switzerland</option>
                                        <option value='Syria' selected="{ object && object.get('stato') == 'Syria' }">Syria</option>
                                        <option value='Tajikistan' selected="{ object && object.get('stato') == 'Tajikistan' }">Tajikistan</option>
                                        <option value='Tanzania' selected="{ object && object.get('stato') == 'Tanzania' }">Tanzania</option>
                                        <option value='Thailand' selected="{ object && object.get('stato') == 'Thailand' }">Thailand</option>
                                        <option value='Timor-Leste' selected="{ object && object.get('stato') == 'Timor-Leste' }">Timor-Leste</option>
                                        <option value='Togo' selected="{ object && object.get('stato') == 'Togo' }">Togo</option>
                                        <option value='Tonga' selected="{ object && object.get('stato') == 'Tonga' }">Tonga</option>
                                        <option value='Trinidad and Tobago' selected="{ object && object.get('stato') == 'Trinidad and Tobago' }">Trinidad and Tobago</option>
                                        <option value='Tunisia' selected="{ object && object.get('stato') == 'Tunisia' }">Tunisia</option>
                                        <option value='Turkey' selected="{ object && object.get('stato') == 'Turkey' }">Turkey</option>
                                        <option value='Turkmenistan' selected="{ object && object.get('stato') == 'Turkmenistan' }">Turkmenistan</option>
                                        <option value='Tuvalu' selected="{ object && object.get('stato') == 'Tuvalu' }">Tuvalu</option>
                                        <option value='Uganda' selected="{ object && object.get('stato') == 'Uganda' }">Uganda</option>
                                        <option value='Ukraine' selected="{ object && object.get('stato') == 'Ukraine' }">Ukraine</option>
                                        <option value='United Arab Emirates' selected="{ object && object.get('stato') == 'United Arab Emirates' }">United Arab Emirates</option>
                                        <option value='United Kingdom' selected="{ object && object.get('stato') == 'United Kingdom' }">United Kingdom</option>
                                        <option value='United States of America' selected="{ object && object.get('stato') == 'United States of America' }">United States of America</option>
                                        <option value='Uruguay' selected="{ object && object.get('stato') == 'Uruguay' }">Uruguay</option>
                                        <option value='Uzbekistan' selected="{ object && object.get('stato') == 'Uzbekistan' }">Uzbekistan</option>
                                        <option value='Vanuatu' selected="{ object && object.get('stato') == 'Vanuatu' }">Vanuatu</option>
                                        <option value='Venezuela' selected="{ object && object.get('stato') == 'Venezuela' }">Venezuela</option>
                                        <option value='Viet Nam' selected="{ object && object.get('stato') == 'Viet Nam' }">Viet Nam</option>
                                        <option value='Yemen' selected="{ object && object.get('stato') == 'Yemen' }">Yemen</option>
                                        <option value='Zambia' selected="{ object && object.get('stato') == 'Zambia' }">Zambia</option>
                                        <option value='Zimbabwe' selected="{ object && object.get('stato') == 'Zimbabwe' }">Zimbabwe</option>
                                    </select>
                                </div>
                            </div>
                            <div if="{ tipo_utente == 'azienda' && stato == 'Italy' }" class="form-group">
                                <label for="sdi" class="col-sm-2 control-label">Codice SDI</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Codice SDI" name="sdi" required value="{ object ? object.get('sdi') : '' }">
                                </div>
                            </div>
                            <div if="{ tipo_utente == 'azienda' && stato == 'Italy' }" class="form-group">
                                <label for="pec" class="col-sm-2 control-label">PEC</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="email" placeholder="PEC" name="pec" required value="{ object ? object.get('pec') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="indirizzo" class="col-sm-2 control-label">Indirizzo</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Indirizzo" name="indirizzo" required value="{ object ? object.get('indirizzo') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="citta" class="col-sm-2 control-label">Citt&agrave;</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Città" name="citta" required value="{ object ? object.get('citta') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="provincia" class="col-sm-2 control-label">Provincia</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Provincia" name="provincia" required value="{ object ? object.get('provincia') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cap" class="col-sm-2 control-label">CAP</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="CAP" name="cap" required value="{ object ? object.get('cap') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="rivenditore" class="col-sm-2 control-label">Rivenditore</label>
                                <div class="checkbox col-sm-4 col-sm-offset-2">
                                    <input type="checkbox" checked="{ object ? object.get('rivenditore') == '1' : '' }" disabled> Richiesto status VENDITORE
                                </div>
                                <div class="checkbox col-sm-4">
                                    <input type="checkbox" id="isRivenditore" checked="{ object ? object.get('isRivenditore') : '' }"> RIVENDITORE
                                </div>
                            </div>
                            <input type="hidden" name="id" value="{ object ? object.id : '' }">
                        </div>
                    </form>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-primary btn-flat pull-right" disabled="{ !object }" onclick="{
                                    save
                                }"><i class='fa fa-save'></i> Salva</button>
                    </div>
                </div>
                <!-- /.box -->
            </div>
            <div class="col-md-6">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">Indirizzi di spedizione</h3>
                    </div>
                    <form role="form" class="form-horizontal form_address">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="indirizzo" class="col-sm-2 control-label">Indirizzo di spedizione</label>
                                <div class="col-sm-10">
                                    <select class="form-control no-populate" onchange="{
                                                indirizzoChanged
                                            }">
                                        <option value="">Seleziona l'indirizzo...</option>
                                        <option each="{ ind in indirizzi }" value="{ ind.id }">{ ind.get('co') } - { ind.get('indirizzo') } ({ ind.get('provincia') })</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="co" class="col-sm-2 control-label">C/O</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="C/O" name="co" required value="{ indirizzo ? indirizzo.get('co') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="stato" class="col-sm-2 control-label">Stato</label>
                                <div class="col-sm-10">
                                    <select class="form-control" name="stato">
                                        <option value='Afghanistan' selected="{ indirizzo && indirizzo.get('stato') == 'Afghanistan' }">Afghanistan</option>
                                        <option value='Albania' selected="{ indirizzo && indirizzo.get('stato') == 'Albania' }">Albania</option>
                                        <option value='Algeria' selected="{ indirizzo && indirizzo.get('stato') == 'Algeria' }">Algeria</option>
                                        <option value='Andorra' selected="{ indirizzo && indirizzo.get('stato') == 'Andorra' }">Andorra</option>
                                        <option value='Angola' selected="{ indirizzo && indirizzo.get('stato') == 'Angola' }">Angola</option>
                                        <option value='Antigua and Barbuda' selected="{ indirizzo && indirizzo.get('stato') == 'Antigua and Barbuda' }">Antigua and Barbuda</option>
                                        <option value='Argentina' selected="{ indirizzo && indirizzo.get('stato') == 'Argentina' }">Argentina</option>
                                        <option value='Armenia' selected="{ indirizzo && indirizzo.get('stato') == 'Armenia' }">Armenia</option>
                                        <option value='Australia' selected="{ indirizzo && indirizzo.get('stato') == 'Australia' }">Australia</option>
                                        <option value='Austria' selected="{ indirizzo && indirizzo.get('stato') == 'Austria' }">Austria</option>
                                        <option value='Azerbaijan' selected="{ indirizzo && indirizzo.get('stato') == 'Azerbaijan' }">Azerbaijan</option>
                                        <option value='Bahamas' selected="{ indirizzo && indirizzo.get('stato') == 'Bahamas' }">Bahamas</option>
                                        <option value='Bahrain' selected="{ indirizzo && indirizzo.get('stato') == 'Bahrain' }">Bahrain</option>
                                        <option value='Bangladesh' selected="{ indirizzo && indirizzo.get('stato') == 'Bangladesh' }">Bangladesh</option>
                                        <option value='Barbados' selected="{ indirizzo && indirizzo.get('stato') == 'Barbados' }">Barbados</option>
                                        <option value='Belarus' selected="{ indirizzo && indirizzo.get('stato') == 'Belarus' }">Belarus</option>
                                        <option value='Belgium' selected="{ indirizzo && indirizzo.get('stato') == 'Belgium' }">Belgium</option>
                                        <option value='Belize' selected="{ indirizzo && indirizzo.get('stato') == 'Belize' }">Belize</option>
                                        <option value='Benin' selected="{ indirizzo && indirizzo.get('stato') == 'Benin' }">Benin</option>
                                        <option value='Bhutan' selected="{ indirizzo && indirizzo.get('stato') == 'Bhutan' }">Bhutan</option>
                                        <option value='Bolivia' selected="{ indirizzo && indirizzo.get('stato') == 'Bolivia' }">Bolivia</option>
                                        <option value='Bosnia and Herzegovina' selected="{ indirizzo && indirizzo.get('stato') == 'Bosnia and Herzegovina' }">Bosnia and Herzegovina</option>
                                        <option value='Botswana' selected="{ indirizzo && indirizzo.get('stato') == 'Botswana' }">Botswana</option>
                                        <option value='Brazil' selected="{ indirizzo && indirizzo.get('stato') == 'Brazil' }">Brazil</option>
                                        <option value='Brunei ' selected="{ indirizzo && indirizzo.get('stato') == 'Brunei' }">Brunei </option>
                                        <option value='Bulgaria' selected="{ indirizzo && indirizzo.get('stato') == 'Bulgaria' }">Bulgaria</option>
                                        <option value='Burkina Faso' selected="{ indirizzo && indirizzo.get('stato') == 'Burkina Faso' }">Burkina Faso</option>
                                        <option value='Burundi' selected="{ indirizzo && indirizzo.get('stato') == 'Burundi' }">Burundi</option>
                                        <option value='Cote d Ivoire' selected="{ indirizzo && indirizzo.get('stato') == 'Cote d Ivoire' }">C&ocirc;te d'Ivoire</option>
                                        <option value='Cabo Verde' selected="{ indirizzo && indirizzo.get('stato') == 'Cabo Verde' }">Cabo Verde</option>
                                        <option value='Cambodia' selected="{ indirizzo && indirizzo.get('stato') == 'Cambodia' }">Cambodia</option>
                                        <option value='Cameroon' selected="{ indirizzo && indirizzo.get('stato') == 'Cameroon' }">Cameroon</option>
                                        <option value='Canada' selected="{ indirizzo && indirizzo.get('stato') == 'Canada' }">Canada</option>
                                        <option value='Central African Republic' selected="{ indirizzo && indirizzo.get('stato') == 'Central African Republic' }">Central African Republic</option>
                                        <option value='Chad' selected="{ indirizzo && indirizzo.get('stato') == 'Chad' }">Chad</option>
                                        <option value='Chile' selected="{ indirizzo && indirizzo.get('stato') == 'Chile' }">Chile</option>
                                        <option value='China' selected="{ indirizzo && indirizzo.get('stato') == 'China' }">China</option>
                                        <option value='Colombia' selected="{ indirizzo && indirizzo.get('stato') == 'Colombia' }">Colombia</option>
                                        <option value='Comoros' selected="{ indirizzo && indirizzo.get('stato') == 'Comoros' }">Comoros</option>
                                        <option value='Congo (Congo-Brazzaville)' selected="{ indirizzo && indirizzo.get('stato') == 'Congo (Congo-Brazzaville)' }">Congo (Congo-Brazzaville)</option>
                                        <option value='Costa Rica' selected="{ indirizzo && indirizzo.get('stato') == 'Costa Rica' }">Costa Rica</option>
                                        <option value='Croatia' selected="{ indirizzo && indirizzo.get('stato') == 'Croatia' }">Croatia</option>
                                        <option value='Cuba' selected="{ indirizzo && indirizzo.get('stato') == 'Cuba' }">Cuba</option>
                                        <option value='Cyprus' selected="{ indirizzo && indirizzo.get('stato') == 'Cyprus' }">Cyprus</option>
                                        <option value='Czech Republic' selected="{ indirizzo && indirizzo.get('stato') == 'Czech Republic' }">Czech Republic</option>
                                        <option value='Democratic Republic of the Congo' selected="{ indirizzo && indirizzo.get('stato') == 'Democratic Republic of the Congo' }">Democratic Republic of the Congo</option>
                                        <option value='Denmark' selected="{ indirizzo && indirizzo.get('stato') == 'Denmark' }">Denmark</option>
                                        <option value='Djibouti' selected="{ indirizzo && indirizzo.get('stato') == 'Djibouti' }">Djibouti</option>
                                        <option value='Dominica' selected="{ indirizzo && indirizzo.get('stato') == 'Dominica' }">Dominica</option>
                                        <option value='Dominican Republic' selected="{ indirizzo && indirizzo.get('stato') == 'Dominican Republic' }">Dominican Republic</option>
                                        <option value='Ecuador' selected="{ indirizzo && indirizzo.get('stato') == 'Ecuador' }">Ecuador</option>
                                        <option value='Egypt' selected="{ indirizzo && indirizzo.get('stato') == 'Egypt' }">Egypt</option>
                                        <option value='El Salvador' selected="{ indirizzo && indirizzo.get('stato') == 'El Salvador' }">El Salvador</option>
                                        <option value='Equatorial Guinea' selected="{ indirizzo && indirizzo.get('stato') == 'Equatorial Guinea' }">Equatorial Guinea</option>
                                        <option value='Eritrea' selected="{ indirizzo && indirizzo.get('stato') == 'Eritrea' }">Eritrea</option>
                                        <option value='Estonia' selected="{ indirizzo && indirizzo.get('stato') == 'Estonia' }">Estonia</option>
                                        <option value='Ethiopia' selected="{ indirizzo && indirizzo.get('stato') == 'Ethiopia' }">Ethiopia</option>
                                        <option value='Fiji' selected="{ indirizzo && indirizzo.get('stato') == 'Fiji' }">Fiji</option>
                                        <option value='Finland' selected="{ indirizzo && indirizzo.get('stato') == 'Finland' }">Finland</option>
                                        <option value='France' selected="{ indirizzo && indirizzo.get('stato') == 'France' }">France</option>
                                        <option value='Gabon' selected="{ indirizzo && indirizzo.get('stato') == 'Gabon' }">Gabon</option>
                                        <option value='Gambia' selected="{ indirizzo && indirizzo.get('stato') == 'Gambia' }">Gambia</option>
                                        <option value='Georgia' selected="{ indirizzo && indirizzo.get('stato') == 'Georgia' }">Georgia</option>
                                        <option value='Germany' selected="{ indirizzo && indirizzo.get('stato') == 'Germany' }">Germany</option>
                                        <option value='Ghana' selected="{ indirizzo && indirizzo.get('stato') == 'Ghana' }">Ghana</option>
                                        <option value='Greece' selected="{ indirizzo && indirizzo.get('stato') == 'Greece' }">Greece</option>
                                        <option value='Grenada' selected="{ indirizzo && indirizzo.get('stato') == 'Grenada' }">Grenada</option>
                                        <option value='Guatemala' selected="{ indirizzo && indirizzo.get('stato') == 'Guatemala' }">Guatemala</option>
                                        <option value='Guinea' selected="{ indirizzo && indirizzo.get('stato') == 'Guinea' }">Guinea</option>
                                        <option value='Guinea-Bissau' selected="{ indirizzo && indirizzo.get('stato') == 'Guinea-Bissau' }">Guinea-Bissau</option>
                                        <option value='Guyana' selected="{ indirizzo && indirizzo.get('stato') == 'Guyana' }">Guyana</option>
                                        <option value='Haiti' selected="{ indirizzo && indirizzo.get('stato') == 'Haiti' }">Haiti</option>
                                        <option value='Holy See' selected="{ indirizzo && indirizzo.get('stato') == 'Holy See' }">Holy See</option>
                                        <option value='Honduras' selected="{ indirizzo && indirizzo.get('stato') == 'Honduras' }">Honduras</option>
                                        <option value='Hungary' selected="{ indirizzo && indirizzo.get('stato') == 'Hungary' }">Hungary</option>
                                        <option value='Iceland' selected="{ indirizzo && indirizzo.get('stato') == 'Iceland' }">Iceland</option>
                                        <option value='India' selected="{ indirizzo && indirizzo.get('stato') == 'India' }">India</option>
                                        <option value='Indonesia' selected="{ indirizzo && indirizzo.get('stato') == 'Indonesia' }">Indonesia</option>
                                        <option value='Iran' selected="{ indirizzo && indirizzo.get('stato') == 'Iran' }">Iran</option>
                                        <option value='Iraq' selected="{ indirizzo && indirizzo.get('stato') == 'Iraq' }">Iraq</option>
                                        <option value='Ireland' selected="{ indirizzo && indirizzo.get('stato') == 'Ireland' }">Ireland</option>
                                        <option value='Israel' selected="{ indirizzo && indirizzo.get('stato') == 'Israel' }">Israel</option>
                                        <option value='Italy' selected="{ indirizzo && indirizzo.get('stato') == 'Italy' }">Italy</option>
                                        <option value='Jamaica' selected="{ indirizzo && indirizzo.get('stato') == 'Jamaica' }">Jamaica</option>
                                        <option value='Japan' selected="{ indirizzo && indirizzo.get('stato') == 'Japan' }">Japan</option>
                                        <option value='Jordan' selected="{ indirizzo && indirizzo.get('stato') == 'Jordan' }">Jordan</option>
                                        <option value='Kazakhstan' selected="{ indirizzo && indirizzo.get('stato') == 'Kazakhstan' }">Kazakhstan</option>
                                        <option value='Kenya' selected="{ indirizzo && indirizzo.get('stato') == 'Kenya' }">Kenya</option>
                                        <option value='Kiribati' selected="{ indirizzo && indirizzo.get('stato') == 'Kiribati' }">Kiribati</option>
                                        <option value='Kuwait' selected="{ indirizzo && indirizzo.get('stato') == 'Kuwait' }">Kuwait</option>
                                        <option value='Kyrgyzstan' selected="{ indirizzo && indirizzo.get('stato') == 'Kyrgyzstan' }">Kyrgyzstan</option>
                                        <option value='Laos' selected="{ indirizzo && indirizzo.get('stato') == 'Laos' }">Laos</option>
                                        <option value='Latvia' selected="{ indirizzo && indirizzo.get('stato') == 'Latvia' }">Latvia</option>
                                        <option value='Lebanon' selected="{ indirizzo && indirizzo.get('stato') == 'Lebanon' }">Lebanon</option>
                                        <option value='Lesotho' selected="{ indirizzo && indirizzo.get('stato') == 'Lesotho' }">Lesotho</option>
                                        <option value='Liberia' selected="{ indirizzo && indirizzo.get('stato') == 'Liberia' }">Liberia</option>
                                        <option value='Libya' selected="{ indirizzo && indirizzo.get('stato') == 'Libya' }">Libya</option>
                                        <option value='Liechtenstein' selected="{ indirizzo && indirizzo.get('stato') == 'Liechtenstein' }">Liechtenstein</option>
                                        <option value='Lithuania' selected="{ indirizzo && indirizzo.get('stato') == 'Lithuania' }">Lithuania</option>
                                        <option value='Luxembourg' selected="{ indirizzo && indirizzo.get('stato') == 'Luxembourg' }">Luxembourg</option>
                                        <option value='Macedonia (FYROM)' selected="{ indirizzo && indirizzo.get('stato') == 'Macedonia' }">Macedonia (FYROM)</option>
                                        <option value='Madagascar' selected="{ indirizzo && indirizzo.get('stato') == 'Madagascar' }">Madagascar</option>
                                        <option value='Malawi' selected="{ indirizzo && indirizzo.get('stato') == 'Malawi' }">Malawi</option>
                                        <option value='Malaysia' selected="{ indirizzo && indirizzo.get('stato') == 'Malaysia' }">Malaysia</option>
                                        <option value='Maldives' selected="{ indirizzo && indirizzo.get('stato') == 'Maldives' }">Maldives</option>
                                        <option value='Mali' selected="{ indirizzo && indirizzo.get('stato') == 'Mali' }">Mali</option>
                                        <option value='Malta' selected="{ indirizzo && indirizzo.get('stato') == 'Malta' }">Malta</option>
                                        <option value='Marshall Islands' selected="{ indirizzo && indirizzo.get('stato') == 'Marshall Islands' }">Marshall Islands</option>
                                        <option value='Mauritania' selected="{ indirizzo && indirizzo.get('stato') == 'Mauritania' }">Mauritania</option>
                                        <option value='Mauritius' selected="{ indirizzo && indirizzo.get('stato') == 'Mauritius' }">Mauritius</option>
                                        <option value='Mexico' selected="{ indirizzo && indirizzo.get('stato') == 'Mexico' }">Mexico</option>
                                        <option value='Micronesia' selected="{ indirizzo && indirizzo.get('stato') == 'Micronesia' }">Micronesia</option>
                                        <option value='Moldova' selected="{ indirizzo && indirizzo.get('stato') == 'Moldova' }">Moldova</option>
                                        <option value='Monaco' selected="{ indirizzo && indirizzo.get('stato') == 'Monaco' }">Monaco</option>
                                        <option value='Mongolia' selected="{ indirizzo && indirizzo.get('stato') == 'Mongolia' }">Mongolia</option>
                                        <option value='Montenegro' selected="{ indirizzo && indirizzo.get('stato') == 'Montenegro' }">Montenegro</option>
                                        <option value='Morocco' selected="{ indirizzo && indirizzo.get('stato') == 'Morocco' }">Morocco</option>
                                        <option value='Mozambique' selected="{ indirizzo && indirizzo.get('stato') == 'Mozambique' }">Mozambique</option>
                                        <option value='Myanmar (formerly Burma)' selected="{ indirizzo && indirizzo.get('stato') == 'Myanmar (formerly Burma)' }">Myanmar (formerly Burma)</option>
                                        <option value='Namibia' selected="{ indirizzo && indirizzo.get('stato') == 'Namibia' }">Namibia</option>
                                        <option value='Nauru' selected="{ indirizzo && indirizzo.get('stato') == 'Nauru' }">Nauru</option>
                                        <option value='Nepal' selected="{ indirizzo && indirizzo.get('stato') == 'Nepal' }">Nepal</option>
                                        <option value='Netherlands' selected="{ indirizzo && indirizzo.get('stato') == 'Netherlands' }">Netherlands</option>
                                        <option value='New Zealand' selected="{ indirizzo && indirizzo.get('stato') == 'New Zealand' }">New Zealand</option>
                                        <option value='Nicaragua' selected="{ indirizzo && indirizzo.get('stato') == 'Nicaragua' }">Nicaragua</option>
                                        <option value='Niger' selected="{ indirizzo && indirizzo.get('stato') == 'Niger' }">Niger</option>
                                        <option value='Nigeria' selected="{ indirizzo && indirizzo.get('stato') == 'Nigeria' }">Nigeria</option>
                                        <option value='North Korea' selected="{ indirizzo && indirizzo.get('stato') == 'North Korea' }">North Korea</option>
                                        <option value='Norway' selected="{ indirizzo && indirizzo.get('stato') == 'Norway' }">Norway</option>
                                        <option value='Oman' selected="{ indirizzo && indirizzo.get('stato') == 'Oman' }">Oman</option>
                                        <option value='Pakistan' selected="{ indirizzo && indirizzo.get('stato') == 'Pakistan' }">Pakistan</option>
                                        <option value='Palau' selected="{ indirizzo && indirizzo.get('stato') == 'Palau' }">Palau</option>
                                        <option value='Palestine State' selected="{ indirizzo && indirizzo.get('stato') == 'Palestine State' }">Palestine State</option>
                                        <option value='Panama' selected="{ indirizzo && indirizzo.get('stato') == 'Panama' }">Panama</option>
                                        <option value='Papua New Guinea' selected="{ indirizzo && indirizzo.get('stato') == 'Papua New Guinea' }">Papua New Guinea</option>
                                        <option value='Paraguay' selected="{ indirizzo && indirizzo.get('stato') == 'Paraguay' }">Paraguay</option>
                                        <option value='Peru' selected="{ indirizzo && indirizzo.get('stato') == 'Peru' }">Peru</option>
                                        <option value='Philippines' selected="{ indirizzo && indirizzo.get('stato') == 'Philippines' }">Philippines</option>
                                        <option value='Poland' selected="{ indirizzo && indirizzo.get('stato') == 'Poland' }">Poland</option>
                                        <option value='Portugal' selected="{ indirizzo && indirizzo.get('stato') == 'Portugal' }">Portugal</option>
                                        <option value='Qatar' selected="{ indirizzo && indirizzo.get('stato') == 'Qatar' }">Qatar</option>
                                        <option value='Romania' selected="{ indirizzo && indirizzo.get('stato') == 'Romania' }">Romania</option>
                                        <option value='Russia' selected="{ indirizzo && indirizzo.get('stato') == 'Russia' }">Russia</option>
                                        <option value='Rwanda' selected="{ indirizzo && indirizzo.get('stato') == 'Rwanda' }">Rwanda</option>
                                        <option value='Saint Kitts and Nevis' selected="{ indirizzo && indirizzo.get('stato') == 'Saint Kitts and Nevis' }">Saint Kitts and Nevis</option>
                                        <option value='Saint Lucia' selected="{ indirizzo && indirizzo.get('stato') == 'Saint Lucia' }">Saint Lucia</option>
                                        <option value='Saint Vincent and the Grenadines' selected="{ indirizzo && indirizzo.get('stato') == 'Saint Vincent and the Grenadines' }">Saint Vincent and the Grenadines</option>
                                        <option value='Samoa' selected="{ indirizzo && indirizzo.get('stato') == 'Samoa' }">Samoa</option>
                                        <option value='San Marino' selected="{ indirizzo && indirizzo.get('stato') == 'San Marino' }">San Marino</option>
                                        <option value='Sao Tome and Principe' selected="{ indirizzo && indirizzo.get('stato') == 'Sao Tome and Principe' }">Sao Tome and Principe</option>
                                        <option value='Saudi Arabia' selected="{ indirizzo && indirizzo.get('stato') == 'Saudi Arabia' }">Saudi Arabia</option>
                                        <option value='Senegal' selected="{ indirizzo && indirizzo.get('stato') == 'Senegal' }">Senegal</option>
                                        <option value='Serbia' selected="{ indirizzo && indirizzo.get('stato') == 'Serbia' }">Serbia</option>
                                        <option value='Seychelles' selected="{ indirizzo && indirizzo.get('stato') == 'Seychelles' }">Seychelles</option>
                                        <option value='Sierra Leone' selected="{ indirizzo && indirizzo.get('stato') == 'Sierra Leone' }">Sierra Leone</option>
                                        <option value='Singapore' selected="{ indirizzo && indirizzo.get('stato') == 'Singapore' }">Singapore</option>
                                        <option value='Slovakia' selected="{ indirizzo && indirizzo.get('stato') == 'Slovakia' }">Slovakia</option>
                                        <option value='Slovenia' selected="{ indirizzo && indirizzo.get('stato') == 'Slovenia' }">Slovenia</option>
                                        <option value='Solomon Islands' selected="{ indirizzo && indirizzo.get('stato') == 'Solomon Islands' }">Solomon Islands</option>
                                        <option value='Somalia' selected="{ indirizzo && indirizzo.get('stato') == 'Somalia' }">Somalia</option>
                                        <option value='South Africa' selected="{ indirizzo && indirizzo.get('stato') == 'South Africa' }">South Africa</option>
                                        <option value='South Korea' selected="{ indirizzo && indirizzo.get('stato') == 'South Korea' }">South Korea</option>
                                        <option value='South Sudan' selected="{ indirizzo && indirizzo.get('stato') == 'South Sudan' }">South Sudan</option>
                                        <option value='Spain' selected="{ indirizzo && indirizzo.get('stato') == 'Spain' }">Spain</option>
                                        <option value='Sri Lanka' selected="{ indirizzo && indirizzo.get('stato') == 'Sri Lanka' }">Sri Lanka</option>
                                        <option value='Sudan' selected="{ indirizzo && indirizzo.get('stato') == 'Sudan' }">Sudan</option>
                                        <option value='Suriname' selected="{ indirizzo && indirizzo.get('stato') == 'Suriname' }">Suriname</option>
                                        <option value='Swaziland' selected="{ indirizzo && indirizzo.get('stato') == 'Swaziland' }">Swaziland</option>
                                        <option value='Sweden' selected="{ indirizzo && indirizzo.get('stato') == 'Sweden' }">Sweden</option>
                                        <option value='Switzerland' selected="{ indirizzo && indirizzo.get('stato') == 'Switzerland' }">Switzerland</option>
                                        <option value='Syria' selected="{ indirizzo && indirizzo.get('stato') == 'Syria' }">Syria</option>
                                        <option value='Tajikistan' selected="{ indirizzo && indirizzo.get('stato') == 'Tajikistan' }">Tajikistan</option>
                                        <option value='Tanzania' selected="{ indirizzo && indirizzo.get('stato') == 'Tanzania' }">Tanzania</option>
                                        <option value='Thailand' selected="{ indirizzo && indirizzo.get('stato') == 'Thailand' }">Thailand</option>
                                        <option value='Timor-Leste' selected="{ indirizzo && indirizzo.get('stato') == 'Timor-Leste' }">Timor-Leste</option>
                                        <option value='Togo' selected="{ indirizzo && indirizzo.get('stato') == 'Togo' }">Togo</option>
                                        <option value='Tonga' selected="{ indirizzo && indirizzo.get('stato') == 'Tonga' }">Tonga</option>
                                        <option value='Trinidad and Tobago' selected="{ indirizzo && indirizzo.get('stato') == 'Trinidad and Tobago' }">Trinidad and Tobago</option>
                                        <option value='Tunisia' selected="{ indirizzo && indirizzo.get('stato') == 'Tunisia' }">Tunisia</option>
                                        <option value='Turkey' selected="{ indirizzo && indirizzo.get('stato') == 'Turkey' }">Turkey</option>
                                        <option value='Turkmenistan' selected="{ indirizzo && indirizzo.get('stato') == 'Turkmenistan' }">Turkmenistan</option>
                                        <option value='Tuvalu' selected="{ indirizzo && indirizzo.get('stato') == 'Tuvalu' }">Tuvalu</option>
                                        <option value='Uganda' selected="{ indirizzo && indirizzo.get('stato') == 'Uganda' }">Uganda</option>
                                        <option value='Ukraine' selected="{ indirizzo && indirizzo.get('stato') == 'Ukraine' }">Ukraine</option>
                                        <option value='United Arab Emirates' selected="{ indirizzo && indirizzo.get('stato') == 'United Arab Emirates' }">United Arab Emirates</option>
                                        <option value='United Kingdom' selected="{ indirizzo && indirizzo.get('stato') == 'United Kingdom' }">United Kingdom</option>
                                        <option value='United States of America' selected="{ indirizzo && indirizzo.get('stato') == 'United States of America' }">United States of America</option>
                                        <option value='Uruguay' selected="{ indirizzo && indirizzo.get('stato') == 'Uruguay' }">Uruguay</option>
                                        <option value='Uzbekistan' selected="{ indirizzo && indirizzo.get('stato') == 'Uzbekistan' }">Uzbekistan</option>
                                        <option value='Vanuatu' selected="{ indirizzo && indirizzo.get('stato') == 'Vanuatu' }">Vanuatu</option>
                                        <option value='Venezuela' selected="{ indirizzo && indirizzo.get('stato') == 'Venezuela' }">Venezuela</option>
                                        <option value='Viet Nam' selected="{ indirizzo && indirizzo.get('stato') == 'Viet Nam' }">Viet Nam</option>
                                        <option value='Yemen' selected="{ indirizzo && indirizzo.get('stato') == 'Yemen' }">Yemen</option>
                                        <option value='Zambia' selected="{ indirizzo && indirizzo.get('stato') == 'Zambia' }">Zambia</option>
                                        <option value='Zimbabwe' selected="{ indirizzo && indirizzo.get('stato') == 'Zimbabwe' }">Zimbabwe</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="indirizzo" class="col-sm-2 control-label">Indirizzo</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Indirizzo" name="indirizzo" required value="{ indirizzo ? indirizzo.get('indirizzo') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="citta" class="col-sm-2 control-label">Citt&agrave;</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Città" name="citta" required value="{ indirizzo ? indirizzo.get('citta') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="provincia" class="col-sm-2 control-label">Provincia</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="Provincia" name="provincia" required value="{ indirizzo ? indirizzo.get('provincia') : '' }">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cap" class="col-sm-2 control-label">CAP</label>
                                <div class="col-sm-10">
                                    <input class="form-control " type="text" placeholder="CAP" name="cap" required value="{ indirizzo ? indirizzo.get('cap') : '' }">
                                </div>
                            </div>
                            <input type="hidden" name="id" value="{ indirizzo ? indirizzo.id : '' }">
                        </div>
                    </form>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-primary btn-flat pull-right" disabled="{ !indirizzo }" onclick="{
                                    saveIndirizzo
                                }"><i class='fa fa-save'></i> Salva</button>
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>
    </section>

    <style>
    </style>

    <script>
        var tag = this;
        tag.object = null;
        tag.tipo_utente = null;
        tag.stato = null;
        tag.indirizzi = [];
        tag.indirizzo = null;

        tag.on('mount', function () {
            RiotBus.getInstance().on('users::got', tag.userFound);
            RiotBus.getInstance().on('users::saved', tag.userSaved);
            RiotBus.getInstance().on('addresses::found', tag.addressesFound);
            RiotBus.getInstance().on('addresses::saved', tag.addressesSaved);
            RiotBus.getInstance().trigger('users::get', opts.id_object);
            RiotBus.getInstance().trigger('addresses::search', opts.id_object);
        });

        tag.on('unmount', function () {
            RiotBus.getInstance().off('users::got', tag.userFound);
            RiotBus.getInstance().off('users::saved', tag.userSaved);
            RiotBus.getInstance().off('addresses::found', tag.addressesFound);
            RiotBus.getInstance().off('addresses::saved', tag.addressesSaved);
        });

        tag.save = function (e) {
            var data = {};
            $('.form_user [name]').each(function () {
                data[this.name] = this.value;
            });
            data.isRivenditore = $("#isRivenditore").is(":checked");
            RiotBus.getInstance().trigger('users::save', data);
        };

        tag.saveIndirizzo = function (e) {
            var data = {};
            $('.form_address [name]').each(function () {
                data[this.name] = this.value;
            });
            RiotBus.getInstance().trigger('addresses::save', data);
        };

        tag.userFound = function (o) {
            tag.object = o;
            tag.tipo_utente = tag.object.get("tipo_utente");
            tag.stato = tag.object.get("stato");
            tag.update();
        };

        tag.userSaved = function (o) {
            tag.object = o;
            tag.update();
        };

        tag.tipoUtenteChanged = function (e) {
            tag.tipo_utente = e.target.value;
            tag.update();
        };

        tag.statoChanged = function (e) {
            tag.stato = e.target.value;
            tag.update();
        };

        tag.addressesFound = function (a) {
            tag.indirizzi = a;
            tag.update();
        };

        tag.indirizzoChanged = function (e) {
            var id = e.target.value;
            if (id) {
                for (var i = 0; i < tag.indirizzi.length; i++) {
                    if (tag.indirizzi[i].id === id) {
                        tag.indirizzo = tag.indirizzi[i];
                        tag.update();
                        break;
                    }
                }
            } else {
                tag.indirizzo = null;
                tag.update();
            }
        };

        tag.addressesSaved = function (o) {
            tag.indirizzo = null;
            tag.update();
            RiotBus.getInstance().trigger('addresses::search', opts.id_object);
        };

    </script>
</inserisci-utente>
