tellform/public/dist/application.min.js
2016-10-07 08:30:09 -07:00

27 lines
395 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<<<<<<< HEAD
<<<<<<< HEAD
=======
"use strict";function removeDateFieldsFunc(o){function eachObject(v,k){"lastModified"!==k&&"created"!==k||delete clone[k]}for(var clone=_.clone(o),i=0;i<clone.length;i++)_.each(clone[i],eachObject);return clone}var ApplicationConfiguration=function(){var applicationModuleName="NodeForm",applicationModuleVendorDependencies=["duScroll","ui.select","cgBusy","ngSanitize","vButton","ngResource","NodeForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate","ng.deviceDetector"],registerModule=function(moduleName,dependencies){angular.module(moduleName,dependencies||[]),angular.module(applicationModuleName).requires.push(moduleName)};return{applicationModuleName:applicationModuleName,applicationModuleVendorDependencies:applicationModuleVendorDependencies,registerModule:registerModule}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function($locationProvider){$locationProvider.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("NodeForm.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("modules/core/views/header.client.view.html",'<section class="navbar navbar-fixed-top navbar-inverse" data-ng-controller=HeaderController ng-hide=hideNav><div class=container><div class=navbar-header><button class=navbar-toggle type=button data-ng-click=toggleCollapsibleMenu()><span class=sr-only>Toggle navigation</span> <span>{{ \'MENU_BTN\' | translate }}</span></button> <a href="https://www.tellform.com/#!/" class=navbar-brand><i class="fa fa-archive" style="padding-right: 0.3em"></i>Tell<span>Form</span></a></div><nav class="collapse navbar-collapse" collapse=!isCollapsed role=navigation><ul class="nav navbar-nav" data-ng-if=authentication.isAuthenticated()><li data-ng-repeat="item in menu.items | orderBy: \'position\'" data-ng-if=item.shouldRender(authentication.isAuthenticated()); ng-switch=item.menuItemType ui-route={{item.uiRoute}} class={{item.menuItemClass}} ng-class="{active: ($uiRoute)}" dropdown="item.menuItemType === \'dropdown\'"><a ng-switch-when=dropdown class=dropdown-toggle dropdown-toggle><span data-ng-bind=item.title></span> <b class=caret></b></a><ul ng-switch-when=dropdown class=dropdown-menu><li data-ng-repeat="subitem in item.items | orderBy: \'position\'" data-ng-if=subitem.shouldRender(authentication.isAuthenticated()); ui-route={{subitem.uiRoute}} ng-class="{active: $uiRoute}"><a href=/#!/{{subitem.link}} data-ng-bind=subitem.title></a></li></ul><a ng-switch-default href=/#!/{{item.link}} data-ng-bind=item.title></a></li></ul><ul class="nav navbar-nav navbar-right" data-ng-hide=authentication.isAuthenticated()><li ng-hide=$root.signupDisabled ui-route=/signup ng-class="{active: $uiRoute}"><a href=/#!/signup>{{ \'SIGNUP_TAB\' | translate }}</a></li><li class=divider-vertical></li><li ui-route=/signin ng-class="{active: $uiRoute}"><a href=/#!/signin>{{ \'SIGNIN_TAB\' | translate }}</a></li></ul><ul class="nav navbar-nav navbar-right" data-ng-show=authentication.isAuthenticated()><li class=dropdown uib-dropdown><a href=# class=dropdown-toggle data-toggle=dropdown dropdown-toggle><span>{{ \'MY_SETTINGS\' | translate }}</span> <b class=caret></b></a><ul class=dropdown-menu><li><a href=/#!/settings/profile>{{ \'EDIT_PROFILE\' | translate }}</a></li><li class=divider></li><li><a href=/#!/settings/password>{{ \'CHANGE_PASSWORD\' | translate }}</a></li></ul></li><li ng-click=signout()><a>{{ \'SIGNOUT_TAB\' | translate }}</a></li></ul></nav></div></section>'),$templateCache.put("modules/forms/admin/views/admin-form.client.view.html",'<div class=container cg-busy="{promise:updatePromise,templateUrl:\'modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html\',message:\'Updating form...\', backdrop:false, wrapperClass:\'.busy-updating-wrapper\'}"></div><section class="container admin-form"><script type=text/ng-template id=myModalContent.html><div class="modal-header">\n <h2 class="modal-title hidden-md hidden-lg">{{ \'ARE_YOU_SURE\' | translate }}</h2>\n <h3 class="modal-title hidden-xs hidden-sm">{{ \'ARE_YOU_SURE\' | translate }}</h3>\n </div>\n <div class="modal-body">\n \t<div class="modal-body-alert">\n\t\t\t\t{{ \'READ_WARNING\' | translate }}\n\t\t\t</div>\n \t\t<p class="hidden-xs hidden-sm">\n \t\t \t{{ \'DELETE_WARNING1\' | translate }}<strong>{{myform.title}}</strong> {{ \'DELETE_WARNING2\' | translate }}\n \t\t</p>\n <p>{{ \'DELETE_CONFIRM\' | translate }}</p>\n </div>\n <div class="modal-footer">\n\t <p>\n\t\t\t\t<input type="text" data-ng-model="deleteConfirm" class="input-block" autofocus required aria-label="Type in the name of the form to confirm that you want to delete this form.">\n\t\t\t</p>\n <button type="submit" ng-click="removeCurrentForm()" class="btn btn-block btn-danger" ng-disabled="myform.title != deleteConfirm">\n \t{{ \'I_UNDERSTAND\' | translate }}\n </button>\n </div></script><div class="page-header row-fluid" style="padding-bottom: 1em"><div class="col-xs-10 col-sm-8"><h1 class="hidden-sm hidden-xs" data-ng-bind=myform.title style="margin-bottom: 0px"></h1><h2 class="hidden-md hidden-lg" data-ng-bind=myform.title style="margin-bottom: 0px"></h2></div><div class="col-xs-1 col-sm-2"><small class=pull-right><button class="btn btn-danger" ng-click=openDeleteModal()><i class="fa fa-trash-o"></i> <span class="show-sm hidden-lg hidden-md hidden-xs">{{ \'DELETE_FORM_SM\' | translate}}</span> <span class="hidden-xs hidden-sm">{{ \'DELETE_FORM_MD\' | translate}}</span></button></small></div><div class="col-xs-1 col-sm-2"><small class=pull-right><a class="btn btn-default view-form-btn" href=//{{formURL}}/#!/forms/{{myform._id}}><span class="hidden-xs hidden-sm">{{ \'VIEW\' | translate }} <span ng-show=myform.isLive>{{ \'LIVE\' | translate }}</span> <span ng-hide=myform.isLive>{{ \'PREVIEW\' | translate }}</span> {{ \'FORM\' | translate }}</span> <span class="hidden-xs hidden-md hidden-lg">View <span ng-if=myform.isLive>{{ \'LIVE\' | translate }}</span> <span ng-if=!myform.isLive>{{ \'PREVIEW\' | translate }}</span></span> <i class="status-light status-light-on fa fa-dot-circle-o" ng-if=myform.isLive></i> <i class="status-light status-light-off fa fa-dot-circle-o" ng-if=!myform.isLive></i></a></small></div></div><div class=row-fluid><div class=col-xs-12><tabs data=tabData></tabs></div><div class=col-xs-12><ui-view></ui-view></div></div></section>'),$templateCache.put("modules/forms/admin/views/list-forms.client.view.html",'<section class=overlay ng-if=showCreateModal ng-click=closeCreateModal()></section><section data-ng-controller="ListFormsController as ctrl" data-ng-init=findAll() class=container><br><div class=row><div ng-click=openCreateModal() class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item create-new"><div class="title-row col-xs-12"><h4 class="fa fa-plus fa-6"></h4></div><div class="col-xs-12 details-row"><small class=list-group-item-text>{{ \'CREATE_A_NEW_FORM\' | translate }}</small></div></div><form name=forms.createForm class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item create-new new-form" ng-if=showCreateModal><div class="title-row row"><div class="col-xs-5 field-title text-left">Name</div><div class="col-xs-12 field-input"><input name=title required ng-model=formTitle ng-pattern=languageRegExp ng-minlength=4 style="color:black"></div></div><div class="details-row row"><div class="col-xs-5 field-title text-left">Language</div><div class="col-xs-12 field-input"><div class="button custom-select"><select style=color:black name=language required ng-model=formLanguage ng-init="formLanguage = user.language"><option ng-repeat="language in languages" value={{language}}>{{language}}</option></select></div></div></div><div class="details-row submit row"><div class="col-xs-12 field-title text-center"><button class="btn btn-primary" ng-disabled=forms.createForm.$invalid ng-click=createNewForm()>{{ \'CREATE_FORM\' | translate }}</button></div></div></form><div data-ng-repeat="form in myforms" ng-style="{ \'background-color\': form.design.colors.backgroundColor, \'color\': form.design.colors.answerColor }" class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item container"><div class=row><span class=pull-right><i style=cursor:pointer class="fa fa-trash-o" ng-click=removeForm($index)></i> <i style=cursor:pointer class="fa fa-files-o" ng-click=duplicateForm($index)></i></span></div><div class=row><a data-ng-href=#!/forms/{{form._id}}/admin/create ng-style="{ \'color\': form.design.colors.answerColor }" class="title-row col-xs-12"><h4 class=list-group-item-heading data-ng-bind=form.title></h4></a></div><div class="row footer"><div class="col-xs-12 details-row"><small class=list-group-item-text>{{ \'CREATED_ON\' | translate }} <span data-ng-bind="form.created | date:\'shortDate\'"></span></small></div></div></div></div></section>'),$templateCache.put("modules/forms/base/views/submit-form.client.view.html","<section class=public-form ng-style=\"{ 'background-color': myform.design.colors.backgroundColor }\"><submit-form-directive myform=myform></submit-form-directive></section><script ng-if=myform.analytics.gaCode>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n\tga('create', '{{myform.analytics.gaCode}}', 'auto');\n\tga('send', 'pageview');</script>"),$templateCache.put("modules/forms/admin/views/adminTabs/analyze.html","<edit-submissions-form-directive myform=myform user=user></edit-submissions-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/configure.html","<configure-form-directive myform=myform user=user></configure-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/create.html","<edit-form-directive myform=myform></edit-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/design.html",'<div class="config-form design container"><div class=row><div class="col-md-12 container"><div class=row><div class=col-sm-12><h2 class="hidden-sm hidden-xs">{{ \'DESIGN_HEADER\' | translate }}</h2><h3 class="hidden-lg hidden-md">{{ \'DESIGN_HEADER\' | translate }}</h3></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BACKGROUND_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.backgroundColor ng-style="{ \'background-color\': myform.design.colors.backgroundColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'QUESTION_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.questionColor ng-style="{ \'background-color\': myform.design.colors.questionColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'ANSWER_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.answerColor ng-style="{ \'background-color\': myform.design.colors.answerColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BTN_BACKGROUND_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.buttonColor ng-style="{ \'background-color\': myform.design.colors.buttonColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BTN_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.buttonTextColor ng-style="{ \'background-color\': myform.design.colors.buttonTextColor }"></div></div></div></div><div class=row><div class="col-sm-offset-4 col-sm-2"><button class="btn btn-primary btn-large" type=button ng-click="update(false, null)"><i class="icon-arrow-left icon-white"></i> Save Changes</button></div><div class=col-sm-1><button class="btn btn-default" type=button ng-click=resetForm()><i class="icon-eye-open icon-white"></i> Cancel</button></div></div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeA.html",'<div><div style="text-align:center;font-size:26px;position:absolute;top:100px;width:100%;text-shadow:1px 1px 2px white, -1px -1px 2px white,-4px 4px 4px white,-4px 4px 4px white">{{$message}}</div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html",'<div><div style="text-align: center; font-size: 20px;position: fixed; bottom: 0; right: 55px; background-color: gray; color: white; padding: 5px 15px 5px 10px; z-index: 10">{{$message}}</div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",'<div class="config-form container"><div class=row><div class="col-sm-12 container-fluid"><div class=row><div class=col-sm-12><h2 class="hidden-sm hidden-xs">{{ \'ADVANCED_SETTINGS\' | translate }}</h2><h3 class="hidden-lg hidden-md">{{ \'ADVANCED_SETTINGS\' | translate }}</h3></div></div><div class="row field"><div class="field-title col-sm-4"><h5>{{ \'FORM_NAME\' | translate }}</h5></div><div class=col-sm-8><input ng-model=myform.title value={{myform.title}} style="width: 100%" ng-minlength=4 ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class="row field"><div class="field-title col-sm-6"><h5>{{ \'FORM_STATUS\' | translate }}</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=true ng-model=myform.isLive ng-required=true style="background-color:#33CC00"> &nbsp;<span>{{ \'PUBLIC\' | translate }}</span></label><label><input type=radio data-ng-value=false ng-model=myform.isLive ng-required="true"> &nbsp;<span>{{ \'PRIVATE\' | translate }}</span></label></div></div><div class="row field"><div class="field-title col-sm-4"><h5>{{ \'GA_TRACKING_CODE\' | translate }}</h5></div><div class=col-sm-8><input ng-model=myform.analytics.gaCode value={{myform.analytics.gaCode}} style="width: 100%" ng-minlength=4 placeholder=UA-XXXXX-Y ng-pattern="/\\bUA-\\d{4,10}-\\d{1,4}\\b/"></div></div><div class="row field"><div class="col-xs-6 field-title">Language</div><div class="col-xs-4 field-input"><select ng-model=myform.language><option ng-repeat="language in languages" ng-selected="language == myform.language" value={{language}}>{{language}}</option></select><span class=required-error ng-show="field.required && !field.fieldValue">* required</span></div></div><div class="row field"><div class="field-title col-sm-6"><h5>{{ \'DISPLAY_FOOTER\' | translate }}</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=false ng-model=myform.hideFooter ng-required="true"> &nbsp;<span>{{ \'YES\' | translate }}</span></label><label><input type=radio data-ng-value=true ng-model=myform.hideFooter ng-required="true"> &nbsp;<span>{{ \'No\' | translate }}</span></label></div></div><div class="row field"><div class="field-title col-sm-6"><h5>Display Start Page?</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=true ng-model=myform.startPage.showStart ng-required=true style="background-color:#33CC00"> &nbsp;<span>{{ \'YES\' | translate }}</span></label><label><input type=radio data-ng-value=false ng-model=myform.startPage.showStart ng-required="true"> &nbsp;<span>{{ \'NO\' | translate }}</span></label></div></div></div></div><div class=row><div class="col-sm-offset-4 col-sm-2"><button class="btn btn-primary btn-large" type=button ng-click="update(false, null)"><i class="icon-arrow-left icon-white"></i>{{ \'SAVE_CHANGES\' | translate }}</button></div><div class=col-sm-1><button class="btn btn-default" type=button ng-click=resetForm()><i class="icon-eye-open icon-white"></i>{{ \'CANCEL\' | translate }}</button></div></div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",'<form class="row container" name=editForm auto-save-form auto-save-watch=myform auto-save-callback=update><div class="col-xs-2 col-sm-4 col-md-4 add-field"><div class="row add-field-title"><h3 class="col-md-12 hidden-sm hidden-xs">{{ \'ADD_FIELD_LG\' | translate }}</h3><h4 class="col-sm-12 hidden-xs hidden-md hidden-lg">{{ \'ADD_FIELD_MD\' | translate }}</h4><h5 class="col-xs-12 hidden-sm hidden-md hidden-lg">{{ \'ADD_FIELD_SM\' | translate }}</h5></div><div class="panel-group row" class=draggable ng-model=addField.types><div class="col-xs-12 col-sm-12 col-md-6" ng-repeat="type in addField.types" style=padding-top:7.5px><div class="panel panel-default" style=background-color:#f5f5f5><div class=panel-heading ng-click="addNewField(true, type.name)" style="cursor: pointer; font-size:12px; padding-left: 10px; padding-right: 10px"><span><field-icon-directive type-name={{type.name}}></field-icon-directive></span> <span class=hidden-xs style=padding-left:0.3em>{{type.value}}</span></div></div></div></div></div><div class="col-xs-10 col-sm-8 current-fields container"><div class=row><div class=col-sm-12><div class="panel panel-default startPage"><div class="panel-heading accordion-toggle collapsed" data-toggle=collapse data-target=#collapseStart><h4 class=text-center>{{ \'WELCOME_SCREEN\' | translate }} <span class=pull-right><i class="fa fa-chevron-right" ng-hide=startPage.isOpen></i> <i class="fa fa-chevron-down" ng-show=startPage.isOpen></i></span></h4></div><div id=collapseStart class="panel-collapse collapse"><div class=panel-body><div class="row hidden-sm hidden-xs"><div class=col-md-12><h4>{{ \'PREVIEW_START_PAGE\' | translate }}</h4></div><ul class="col-md-12 container" style="list-style:none; border:2px lightgray solid; padding-bottom: 2em"><div class="field row"><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1>{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left" style="overflow-wrap: break-word"><p style=color:#ddd>{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.startPage.buttons" class=text-center style=display:inline><button class="btn btn-info" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none; color: inherit">{{button.text}}</a></button></p></div><div class="row form-actions"><button class="btn btn-info btn btn-info col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3" type=button><span style="color:white; font-size: 1.6em; text-decoration: none">{{myform.startPage.introButtonText}}</span></button></div></ul></div><div class=row><div class=col-xs-12><h4>{{ \'EDIT_START_PAGE\' | translate }}</h4><br></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_TITLE\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=myform.startPage.introTitle name=introTitleStartPage value={{myform.startPage.introTitle}} required></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_PARAGRAPH\' | translate }}:</div><div class="col-md-8 col-sm-12"><textarea type=text ng-model=myform.startPage.introParagraph name=introParagraphStartPage></textarea></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_BTN\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=myform.startPage.introButtonText name=introButtonText value={{myform.startPage.introButtonText}} required></div></div><div class=row><br><br></div><div class="row options buttons"><div class="col-md-3 col-xs-12">Buttons:</div><div class="col-md-9 col-xs-12"><div ng-repeat="button in myform.startPage.buttons track by button._id" class=row style=padding-bottom:1em><div class=col-xs-5><span>{{ \'BUTTON_TEXT\' | translate }}</span> <input name={{button.text}}_buttonText_startPage ng-model=button.text value={{button.text}} placeholder="Button Text"></div><div class=col-xs-5><span>{{ \'BUTTON_LINK\' | translate }}</span> <input name={{button.url}}_url_startPage ng-model=button.url value={{button.url}} placeholder=http://aeouaou.com/aoeuoa></div><div class=col-xs-2><a class="btn btn-danger btn-mini right" type=button ng-click=deleteButton(button)><i class="fa fa-trash-o"></i></a></div></div><div class=row><br></div><div class=row><button class="btn btn-primary btn-small col-md-offset-6 col-md-6 col-sm-4 col-sm-offset-8 col-xs-4 col-xs-offset-8" type=button ng-click=addButton()><i class="icon-plus icon-white"></i> {{ \'ADD_BUTTON\' | translate }}</button></div></div></div></div></div></div></div></div><div class=row><div class=col-sm-12><hr></div></div><div class=row><div class="col-sm-12 col-md-10 dropzoneContainer"><accordion close-others=accordion.oneAtATime ui-sortable=sortableOptions ng-model=myform.form_fields class=dropzone><accordion-group ng-repeat="field in myform.form_fields track by field._id" is-open=accordion[$index].isOpen on-finish-render=editFormFields ng-if=!field.deletePreserved><accordion-heading><div class=handle><span class=col-xs-1 ng-switch=field.fieldType><field-icon-directive type-name={{field.fieldType}}></field-icon-directive></span> <span class=col-xs-10>{{field.title}} <span ng-show=field.required>*</span></span> <span class=pull-right><i class="fa fa-chevron-right" ng-hide=accordion[$index].isOpen></i> <i class="fa fa-chevron-down" ng-show=accordion[$index].isOpen></i></span></div></accordion-heading><div class="accordion-edit container"><div class="row hidden-sm hidden-xs"><div class=col-md-12><h4>{{ \'PREVIEW_FIELD\' | translate }}</h4></div><ul class="col-md-12 container" style="list-style:none;border:2px lightgray solid"><field-directive field=field validate=false></field-directive></ul><hr></div><div class=row><div class=col-xs-12><h4>{{ \'EDIT_FIELD\' | translate }}</h4><br></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'QUESTION_TITLE\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=field.title name=title{{field._id}} value={{field.title}} required></div></div><div class=row><br></div><div class="row description" ng-hide=showRatingOptions(field)><div class="col-md-4 col-sm-12">{{ \'QUESTION_DESCRIPTION\' | translate }}:</div><div class="col-md-8 col-sm-12"><textarea type=text ng-model=field.description name=description{{field._id}} value={{field.description}}></textarea></div></div><div class=row ng-show=showAddOptions(field)><br></div><div class="row options" ng-if=showAddOptions(field)><div class="col-md-4 col-xs-12">{{ \'OPTIONS\' | translate }}:</div><div class="col-md-8 col-xs-12"><div ng-repeat="option in field.fieldOptions track by option.option_id" class=row><input name={{option.option_value}}{{field._id}} ng-model=option.option_value class=col-xs-5> <a class="btn btn-danger btn-mini right" type=button ng-click="deleteOption($index, option)" class=col-xs-3><i class="fa fa-trash-o"></i></a></div><div class=row><button class="btn btn-primary btn-small col-md-offset-0 col-md-6 col-sm-4 col-sm-offset-4 col-xs-6 col-xs-offset-6" type=button ng-click=addOption($index)><i class="icon-plus icon-white"></i> {{ \'ADD_OPTION\' | translate }}</button></div></div></div><div class=row ng-show=showRatingOptions(field)><br></div><div class=row ng-if=showRatingOptions(field)><div class="col-md-9 col-sm-9">{{ \'NUM_OF_STEPS\' | translate }}</div><div class="col-md-3 col-sm-3"><input style=width:100% type=number min=1 max=10 ng-model=field.ratingOptions.steps name=ratingOptions_steps{{field._id}} ng-value={{field.ratingOptions.steps}} required></div><br><div class="col-md-5 col-sm-9">Shape:</div><div class="col-md-7 col-sm-3"><select style=width:100% ng-model=field.ratingOptions.shape value={{field.ratingOptions.steps}} name=ratingOptions_shape{{field._id}} required><option ng-repeat="shapeType in field.ratingOptions.validShapes" value={{shapeType}}>{{select2FA[shapeType]}}</option></select></div></div><div class=row><br></div><div class=row><div class="col-md-4 col-xs-12 field-title">Required:</div><div class="col-md-8 col-xs-12 field-input"><label class="btn col-xs-5"><input type=radio ng-value=true ng-model=field.required name="required{{field._id}}"> <span>&nbsp; {{ \'YES\' | translate }}</span></label><label class="btn col-xs-5 col-xs-offset-1"><input type=radio ng-value=false ng-model=field.required name="required{{field._id}}"> <span>&nbsp; {{ \'NO\' | translate }}</span></label></div></div><div class=row><div class="col-md-4 col-xs-12 field-input">{{ \'DISABLED\' | translate }}</div><div class="col-md-8 col-xs-12 field-input"><label class="btn col-xs-5"><input type=radio ng-value=true ng-model=field.disabled name="disabled{{field._id}}"> <span>&nbsp; {{ \'YES\' | translate }}</span></label><label class="btn col-xs-5 col-xs-offset-1"><input type=radio ng-value=false ng-model=field.disabled name="disabled{{field._id}}"> <span>&nbsp; {{ \'NO\' | translate }}</span></label></div></div><div class=row ng-if="myform.form_fields.length > 1 && myform.form_fields[$index].logicJump.fieldA"><h4>Logic Jump</h4></div><div class=row ng-if="myform.form_fields.length > 1 && myform.form_fields[$index].logicJump.fieldA"><div class="col-md-4 col-xs-12 field-input">{{ \'ADD_LOGIC_JUMP\' | translate }}</div><div class="col-md-8 col-xs-12 field-input"><label class="btn col-xs-5"><input type=radio ng-checked=!!myform.form_fields[$index].logicJump.fieldA name=logicJumpYes{{field._id}} ng-click="addNewLogicJump($index)"> <span>&nbsp; {{ \'YES\' | translate }}</span></label><label class="btn col-xs-5 col-xs-offset-1"><input type=radio ng-checked=!myform.form_fields[$index].logicJump.fieldA name=logicJumpNo{{field._id}} ng-click="removeLogicJump($index)"> <span>&nbsp; {{ \'NO\' | translate }}</span></label></div></div><div class="row question" ng-if="myform.form_fields.length > 1 && myform.form_fields[$index].logicJump.fieldA"><div class="col-md-4 col-sm-12"><b>If this field</b></div><div class="col-md-4 col-sm-12"><select style=width:100% ng-model=field.logicJump.expressionString value={{field.logicJump.expressionString}} name=logicjump_expressionString{{field._id}}><option value="a == b">is equal to</option><option value="a !== b">is not equal to</option></select></div><div class="col-md-4 col-sm-12"><input ng-model="field.logicJump.valueB"></div><div class="col-md-4 col-md-offset-2"><b>Jumps to</b></div><div class="col-md-6 col-sm-12"><select style=width:100% ng-model=field.logicJump.jumpTo value={{field.logicJump.jumpTo}} name=logicjump_jumpTo{{field._id}}><option ng-repeat="jump_field in myform.form_fields" value={{jump_field._id}}>{{jump_field.title}}</option></select></div></div></div></accordion-group><div class="panel panel-default" style="border-style: dashed; border-color: #a9a9a9"><div class=panel-heading><h4 class="panel-title text-center" style="color: #a9a9a9">{{ \'CLICK_FIELDS_FOOTER\' | translate }}</h4></div></div><hr></accordion></div><div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px"><div class="panel-group tool-panel text-center"><div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if=!field.deletePreserved><div class=panel-heading style="padding: 10px 10px; height: 37px" ng-click=deleteField($index)><span class=text-center><a href="" class="fa fa-trash-o"></a></span></div></div></div></div><div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px"><div class="panel-group tool-panel text-center"><div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if=!field.deletePreserved><div class=panel-heading style="padding: 10px 10px; height: 37px" ng-click=duplicateField($index)><span class=text-center><a href="" class="fa fa-files-o"></a></span></div></div></div></div></div></div></form>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html",'<div class="submissions-table row container"><div class="row text-center analytics"><div class="row col-xs-12 header-numbers">Overview Analytics</div><div class="row col-xs-12 header-title"><div class=col-xs-3>{{ \'TOTAL_VIEWS\' | translate }}</div><div class=col-xs-3>{{ \'RESPONSES\' | translate }}</div><div class=col-xs-3>{{ \'COMPLETION_RATE\' | translate }}</div><div class=col-xs-3>{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div></div><div class="row col-xs-12 header-numbers"><div class=col-xs-3>{{myform.analytics.views}}</div><div class=col-xs-3>{{myform.analytics.submissions}}</div><div class=col-xs-3>{{myform.analytics.conversionRate | number:0}}%</div><div class=col-xs-3>{{AverageTimeElapsed | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class="row col-xs-12 header-numbers">Device Analytics</div><div class="row col-xs-12 detailed-title"><div class=col-xs-3>{{ \'DESKTOP_AND_LAPTOP\' | translate }}</div><div class=col-xs-3>{{ \'TABLETS\' | translate }}</div><div class=col-xs-3>{{ \'PHONES\' | translate }}</div><div class=col-xs-3>{{ \'OTHER\' | translate }}</div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.other.visits}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.phone.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.other.responses}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.phone.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.other.completion}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.phone.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.other.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div></div><div class="row col-xs-12 text-center" style=font-size:5em>Field Analytics</div><div class="row col-xs-12 field-title-row"><div class=col-xs-3><strong>{{ \'FIELD_TITLE\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_VIEWS\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_RESPONSES\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_DROPOFF\' | translate }}</strong></div></div><div class="row col-xs-12 field-detailed-row" ng-repeat="fieldStats in myform.analytics.fields"><div class=col-xs-3>{{fieldStats.field.title}}</div><div class=col-xs-3>{{fieldStats.totalViews}}</div><div class=col-xs-3>{{fieldStats.responses}}</div><div class=col-xs-3>{{fieldStats.continueRate}}%</div></div></div><br><div class="row col-xs-12 header-numbers text-center" style=font-size:5em>Responses Table</div><div class="row table-tools"><div class=col-xs-2><button class="btn btn-danger" ng-click=deleteSelectedSubmissions() ng-disabled=!isAtLeastOneChecked();><i class="fa fa-trash-o"></i> {{ \'DELETE_SELECTED\' | translate }}</button></div><div class="col-xs-2 col-xs-offset-4 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'xml\')"><small>{{ \'EXPORT_TO_EXCEL\' | translate }}</small></button></div><div class="col-md-2 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'csv\')"><small>{{ \'EXPORT_TO_CSV\' | translate }}</small></button></div><div class="col-md-2 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'json\')"><small>{{ \'EXPORT_TO_JSON\' | translate }}</small></button></div></div><div class="row table-outer"><div class=col-xs-12><table id=table-submission-data class="table table-striped table-hover table-condensed"><thead><tr><th><input ng-model=table.masterChecker ng-change=toggleAllCheckers() type="checkbox"></th><th>#</th><th data-ng-repeat="(key, value) in myform.form_fields">{{value.title}}</th><th>{{ \'PERCENTAGE_COMPLETE\' | translate }}</th><th>{{ \'TIME_ELAPSED\' | translate }}</th><th>{{ \'DEVICE\' | translate }}</th><th>{{ \'LOCATION\' | translate }}</th><th>{{ \'IP_ADDRESS\' | translate }}</th><th>{{ \'DATE_SUBMITTED\' | translate }} (UTC)</th><th ng-if=myform.autofillPDFs>{{ \'GENERATED_PDF\' | translate }}</th></tr></thead><tbody><tr data-ng-repeat="row in table.rows" ng-click=rowClicked($index) ng-class="{selected: row.selected === true}"><td><input ng-model=row.selected type="checkbox"></td><th class=scope>{{$index+1}}</th><td data-ng-repeat="field in row.form_fields">{{field.fieldValue}}</td><td>{{row.percentageComplete}}%</td><td>{{row.timeElapsed | secondsToDateTime | date:\'mm:ss\'}}</td><td>{{row.device.name}}, {{row.device.type}}</td><td>{{row.geoLocation.city}}, {{row.geoLocation.country_name}}</td><td>{{row.ipAddr}}</td><td>{{row.created | date:\'yyyy-MM-dd HH:mm:ss\'}}</td><td ng-if=row.pdf><a href={{row.pdfFilePath}} download={{row.pdf.name}} target=_self>{{ \'GENERATED_PDF\' | translate }}</a></td></tr></tbody></table></div></div></div>'),
$templateCache.put("modules/forms/base/views/directiveViews/entryPage/startPage.html",'<div class="field row text-center"><div class="col-xs-12 text-center"><h1>{{pageData.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left"><p style=color:#ddd>{{pageData.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in pageData.buttons" class=text-center style=display:inline><button class="btn btn-info" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none; color: inherit">{{button.text}}</a></button></p></div><div class="row form-actions"><p class="col-xs-3 col-xs-offset-3 text-center"><button class="btn btn-info" type=button><a ng-click=exitpageData() style="color:white; font-size: 1.6em; text-decoration: none">{{ \'CONTINUE_FORM\' | translate }}</a></button></p></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/date.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show="!field.required && !field.fieldValue">{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div class="control-group input-append"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" ng-class="{ \'no-border\': !!field.fieldValue }" ui-date=dateOptions ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled placeholder=MM/DD/YYYY ng-focus="setActiveField(field._id, index, true)" on-tab-key=nextField() on-tab-and-shift-key=prevField() ng-change=$root.nextField()></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/dropdown.html",'<div class="field row dropdown" ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><ui-select ng-model=field.fieldValue theme=selectize search-enabled=true search-by=option_value set-search-to-answer=true ng-required=field.required ng-disabled=field.disabled on-tab-and-shift-key=prevField() on-tab-key=nextField() ng-change=$root.nextField()><ui-select-match placeholder="Type or select an option"></ui-select-match><ui-select-choices repeat="option in field.fieldOptions | filter: $select.search" ng-class="{\'active\': option.option_value === field.fieldValue }"><span ng-bind-html="option.option_value | highlight: $select.search"></span></ui-select-choices></ui-select></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/file.html",'<div class="field row" ng-if=form.autofillPDFs ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3></div><div class="col-sm-8 field-input"><div class=input-group><div tabindex=-1 class="form-control file-caption"><span class=file-caption-ellipsis ng-if=!form.pdf>…</span><div class=file-caption-name ng-if=form.pdf>{{field.file.originalname}}</div></div><div class=input-group-btn><button type=button ng-if=field.file ng-click=removeFile(field); title="Clear selected files" class="btn btn-danger fileinput-remove fileinput-remove-button"><i class="glyphicon glyphicon-trash"></i> {{ \'DELETE\' | translate }}</button> <button type=button ng-if=field.fileLoading title="Abort ongoing upload" class="btn btn-default" ng-click=cancelFileUpload(field)><i class="glyphicon glyphicon-ban-circle"></i> {{ \'CANCEL\' | translate }}</button><div class="btn btn-success btn-file" ngf-select ngf-change=uploadPDF($files) ng-if=!field.file><i class="glyphicon glyphicon-upload"></i> {{ UPLOAD_FILE | translate }}</div></div></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/hidden.html",'<input ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=hidden ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value={{field.fieldValue}} ng-disabled=field.disabled>'),$templateCache.put("modules/forms/base/views/directiveViews/field/legal.html",'<div class="field row radio legal" on-enter-or-tab-key=nextField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><br><p class=col-xs-12>{{field.description}}</p></div><div class="col-xs-12 field-input container"><div class=row-fluid on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField()><label class="btn col-md-5 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'true\'}"><input class=focusOn ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=true ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"><div class=letter style=float:left>Y</div><span>{{ \'LEGAL_ACCEPT\' | translate }}</span></label><label class="btn col-md-5 col-md-offset-1 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'false\'}"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=false ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"><div class=letter style=float:left>N</div><span>{{ \'LEGAL_NO_ACCEPT\' | translate }}</span></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/radio.html",'<div class="field row radio" on-enter-or-tab-key=nextField() key-to-option field=field ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div ng-repeat="option in field.fieldOptions" class=row-fluid><label class="btn col-md-4 col-xs-12 col-sm-12" style="margin: 0.5em; padding-left:30px" ng-class="{activeBtn: field.fieldValue == field.fieldOptions[$index].option_value}"><div class=letter style=float:left>{{$index+1}}</div><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" style=visibility:hidden type=radio class=focusOn ng-focus="setActiveField(field._id, index, true)" value={{option.option_value}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"> <span ng-bind=option.option_value style="white-space: normal"></span></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/rating.html",'<div class="textfield field row" on-enter-or-tab-key=nextField()><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input-stars max={{field.ratingOptions.steps}} ng-init="field.fieldValue = 1" on-star-click=$root.nextField() icon-full={{field.ratingOptions.shape}} icon-base="fa fa-3x" icon-empty={{field.ratingOptions.shape}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)" class="angular-input-stars focusOn"></input-stars></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/statement.html",'<div class="statement field row" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)"><div class="row field-title field-title"><div class=col-xs-1><i class="fa fa-quote-left fa-1"></i></div><h2 class="text-left col-xs-9">{{field.title}}</h2><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="row field-title field-input"><p class=col-xs-12 ng-if=field.description.length>{{field.description}}</p><br><div class="col-xs-offset-1 col-xs-11"><button class="btn focusOn" ng-style="{\'font-size\': \'1.3em\', \'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-focused="setActiveField(field._id, index, true)" ng-click=$root.nextField()>{{ \'CONTINUE\' | translate }}</button></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/textarea.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><small>{{ \'NEWLINE\' | translate }}</small><p><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><small style=font-size:0.6em>Press SHIFT+ENTER to add a newline</small><textarea class="textarea focusOn" type=text ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-class="{ \'no-border\': !!field.fieldValue }" value={{field.fieldValue}} ng-required=field.required ng-disabled=field.disabled ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() style="border: none; border-left: lightgrey dashed 2px">\n\t\t</textarea></div></div><div><div class="btn btn-lg btn-default hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=$root.nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-sm-3 col-xs-6" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/textfield.html",'<div class="textfield field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title row-fluid" ng-style="{\'color\': design.colors.questionColor}"><h3 class=col-xs-12><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>({{ \'OPTIONAL\' | translate }})</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" name={{field.fieldType}}{{index}} type={{field.input_type}} ng-pattern=field.validateRegex placeholder={{field.placeholder}} ng-class="{ \'no-border\': !!field.fieldValue }" class="focusOn text-field-input" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value=field.fieldValue ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-required=field.required ng-disabled=field.disabled aria-describedby=inputError2Status></div><div class=col-xs-12><div ng-show="forms.myForm.{{field.fieldType}}{{index}}.$invalid && !!forms.myForm.{{field.fieldType}}{{index}}.$viewValue " class="alert alert-danger" role=alert><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>Error:</span> <span ng-if="field.fieldType == \'email\'">{{ \'ERROR_EMAIL_INVALID\' | translate }}</span> <span ng-if=field.validateRegex>{{ \'ERROR_NOT_A_NUMBER\' | translate }}</span> <span ng-if="field.fieldType == \'link\'">{{ \'ERROR_URL_INVALID\' | translate }}</span></div></div></div><div><div class="btn btn-lg btn-default hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=$root.nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-xs-6 col-sm-3" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/yes_no.html",'<div class="field row radio" ng-click="setActiveField(field._id, index, true)" on-tab-and-shift-key=prevField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3 class=row><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=row>{{field.description}}</p></div><div class="col-xs-12 field-input"><div class="row col-xs-12"><label class="btn btn-default" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=true class=focusOn style="opacity: 0; margin-left: 0px" ng-model=field.fieldValue ng-focus="setActiveField(field._id, index, true)" ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled="field.disabled"><div class=letter>{{ \'Y\' | translate }}</div><span>{{ \'YES\' | translate }}</span> <i ng-show="field.fieldValue === \'true\'" class="fa fa-check" aria-hidden=true></i></label></div><div class="row col-xs-12" style="margin-top: 10px"><label class="btn btn-default" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=false style="opacity:0; margin-left:0px" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled="field.disabled"><div class=letter>{{ \'N\' | translate }}</div><span>{{ \'NO\' | translate }}</span> <i ng-show="field.fieldValue === \'false\'" class="fa fa-check" aria-hidden=true></i></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'<section class="overlay submitform" ng-if="loading || (!myform.submitted && !myform.startPage.showStart)"></section><div ng-show="!myform.submitted && myform.startPage.showStart" class=form-submitted style="padding-top: 35vh"><div class=row><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1 style="font-weight: 400; nont-size: 25px">{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-center" style="overflow-wrap: break-word"><p style="color: grey; font-weight: 100; font-size: 16px">{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions text-center" style="padding: 5px 25px 5px 25px"><button ng-click=exitStartPage() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{myform.startPage.introButtonText}}</span></button></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.startPage.buttons" class=text-center style=display:inline><button class=btn style="background-color:rgb(156, 226, 235)" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none" ng-style="{\'color\':button.color}">{{button.text}}</a></button></p></div></div><div class=form-fields ng-show="!myform.submitted && !myform.startPage.showStart" ng-style="{ \'border-color\': myform.design.colors.buttonTextColor }"><div class=row><form name=forms.myForm novalidate class="submission-form col-sm-12 col-md-offset-1 col-md-10"><div ng-repeat="field in myform.form_fields" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} ng-class="{activeField: selected._id == field._id }" class="row field-directive"><field-directive field=field design=myform.design index=$index forms=forms></field-directive></div></form></div><div class="row form-actions" id=submit_field ng-class="{activeField: selected._id == \'submit_field\' }" ng-style="{ \'background-color\':myform.design.colors.buttonColor}" style="border-top: 1px solid #ddd; margin-right: -13%; margin-left: -13%; margin-top: 30vh; height: 100vh"><div class="col-xs-12 text-left" style="background-color:#990000; color:white" ng-if=forms.myForm.$invalid>{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}</div><button ng-if=!forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" v-busy=loading v-busy-label="Please wait" v-pressable ng-disabled="loading || forms.myForm.$invalid" ng-click=submitForm() on-enter-key=submitForm() on-enter-key-disabled="loading || forms.myForm.$invalid" ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" style="font-size: 1.6em; margin-left: 1em; margin-top: 1em">{{ \'SUBMIT\' | translate }}</button> <button ng-if=forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" ng-click=goToInvalid() on-enter-key=goToInvalid() on-enter-key-disabled=!forms.myForm.$invalid style="font-size: 1.6em; margin-left: 1em; margin-top: 1em; background-color:#990000; color:white">{{ \'REVIEW\' | translate }}</button><div class="col-sm-2 hidden-xs" style="font-size: 75%; margin-top:3.25em"><small>{{ \'ENTER\' | translate }}</small></div></div><section ng-if=!myform.hideFooter class="navbar navbar-fixed-bottom" ng-style="{ \'background-color\':myform.design.colors.buttonColor, \'padding-top\': \'15px\', \'border-top\': \'2px \'+ myform.design.colors.buttonTextColor +\' solid\', \'color\':myform.design.colors.buttonTextColor}"><div class=container-fluid><div class=row><div class="col-sm-5 col-md-6 col-xs-5" ng-show=!myform.submitted><p class=lead>{{ \'ADVANCEMENT\' | translate:translateAdvancementData }}</p></div><div class="col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row"><div class="col-md-4 col-md-offset-2 hidden-sm hidden-xs" ng-if=!authentication.isAuthenticated()><a href=/#!/forms class=btn ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}">{{ \'CREATE_FORM\' | translate }}</a></div><div class="col-md-4 col-md-offset-2 hidden-sm hidden-xs" ng-if=authentication.isAuthenticated()><a href=/#!/forms/{{myform._id}}/admin/create ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" class=btn>{{ \'EDIT_FORM\' | translate }}</a></div><div class="col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12 row"><button class="btn btn-lg col-xs-6" id=focusDownButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=nextField() ng-disabled="selected.index > myform.form_fields.length-1"><i class="fa fa-chevron-down"></i></button> <button class="btn btn-lg col-xs-6" id=focusUpButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=prevField() ng-disabled="selected.index == 0"><i class="fa fa-chevron-up"></i></button></div></div></div></div></section></div><div ng-if="myform.submitted && !loading" class=form-submitted ng-style="{\'color\':myform.design.colors.buttonTextColor}" style="padding-top: 5vh"><div class="field row text-center"><div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3 text-center">{{ \'FORM_SUCCESS\' | translate }}</div></div><div class="row form-actions"><p class=text-center><button ng-click=reloadForm() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{ \'BACK_TO_FORM\' | translate }}</span></button></p></div></div>'),$templateCache.put("modules/users/views/authentication/access-denied.client.view.html","<section class=\"row text-center auth\"><h3 class=col-md-12>{{ 'ACCESS_DENIED_TEXT' | translate }}</h3><a href=/#!/sigin class=col-md-12>{{ 'SIGNIN_BTN' | translate }}</a></section>"),$templateCache.put("modules/users/views/authentication/signin.client.view.html","<section class=\"row auth\" data-ng-controller=AuthenticationController><h3 class=\"col-md-12 text-center\">{{ 'SIGNIN_HEADER_TEXT' | translate }}</h3><div class=\"col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6\"><form class=\"signin form-horizontal\" autocomplete=off><fieldset><div data-ng-show=error class=\"text-center text-danger\">Error: <strong data-ng-bind=error></strong></div><div class=form-group><label for=username>{{ 'USERNAME_LABEL' | translate }}</label><input id=username name=username class=form-control data-ng-model=credentials.username placeholder=\"{{ 'USERNAME_LABEL' | translate }}\" ng-pattern=languageRegExp ng-minlength=4></div><div class=form-group><label for=password>{{ 'PASSWORD_LABEL' | translate }}</label><input type=password id=password name=password class=form-control data-ng-model=credentials.password placeholder=\"{{ 'PASSWORD_LABEL' | translate }}\"></div><div class=forgot-password><a ui-sref=forgot>{{ 'FORGOT_PASSWORD_LINK' | translate }}</a><br><a ui-sref=verify>{{ 'REVERIFY_ACCOUNT_LINK' | translate }}</a></div><div class=\"text-center form-group\"><button class=\"btn btn-primary\" ng-click=signin()>{{ 'SIGNIN_BTN' | translate }}</button> <span ng-hide=$root.signupDisabled>&nbsp; or&nbsp; <a ui-sref=signup>{{ 'SIGNUP_BTN' | translate }}</a></span></div></fieldset></form></div></section>"),$templateCache.put("modules/users/views/authentication/signup-success.client.view.html",'<section class="row auth signup-view success" data-ng-controller=AuthenticationController><h3 class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6 text-center">{{ \'SUCCESS_HEADER\' | translate }}</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><h2>{{ \'SUCCESS_TEXT\' | translate }}<br><br>{{ \'NOT_ACTIVATED_YET\' | translate }}</h2><br><br><p><strong>{{ \'BEFORE_YOU_CONTINUE\' | translate }}</strong> <a href=mail:polydaic@gmail.com>polydaic@gmail.com</a></p><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary"><a href="/#!/" style="color: white; text-decoration: none">Continue</a></button></div></div></section>'),$templateCache.put("modules/users/views/authentication/signup.client.view.html",'<section class="row auth signup-view" data-ng-controller=AuthenticationController><h3 class="col-md-12 text-center">{{ \'SIGNUP_HEADER_TEXT\' | translate }}</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form name=userForm data-ng-submit=signup() class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=error id=signup_errors class="text-center text-danger">{{\'SIGNUP_ERROR_TEXT\' | translate}}:<br><strong data-ng-bind=error></strong></div><div class=form-group><label for=firstName>{{ \'FIRST_NAME_LABEL\' | translate }}</label><input ng-pattern="/^[a-zA-Z0-9 \\-.]*$/" required id=firstName name=firstName class=form-control ng-model=credentials.firstName placeholder="First Name"></div><div class=form-group><label for=lastName>{{ \'LAST_NAME_LABEL\' | translate }}</label><input ng-pattern="/^[a-zA-Z0-9 \\-.]*$/" required id=lastName name=lastName class=form-control ng-model=credentials.lastName placeholder="Last Name"></div><div class="row form-group"><div class=field-title><b>{{ \'LANGUAGE_LABEL\' | translate }}</b></div><div class=field-input><select ng-model=user.language required><option ng-repeat="language in languages" ng-selected="language == user.language" value={{language}}>{{language}}</option></select></div></div><hr><div class=form-group><label for=username>{{ \'USERNAME_LABEL\' | translate }}</label><input id=username name=username class=form-control ng-pattern=languageRegExp ng-minlength=4 ng-model=credentials.username placeholder=Username></div><div class=form-group><label for=email>{{ \'EMAIL_LABEL\' | translate }}</label><input type=email id=email name=email class=form-control ng-model=credentials.email placeholder=Email></div><div class=form-group><label for=password>{{ \'PASSWORD_LABEL\' | translate }}</label><input type=password id=password name=password class=form-control ng-model=credentials.password placeholder=Password></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">{{ \'SIGNUP_BTN\' | translate }}</button></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/password/forgot-password.client.view.html",'<section class="auth row" data-ng-controller=PasswordController><h3 class="col-md-12 text-center">{{ \'PASSWORD_RESTORE_HEADER\' | translate }}</h3><p class="small text-center">{{ \'ENTER_YOUR_EMAIL\' | translate }}</p><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=askForPasswordReset() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><input id=username name=username class=form-control data-ng-model=credentials.username placeholder="{{ \'USERNAME_LABEL\' | translate }}"></div><div class="text-center form-group"><button type=submit class="btn btn-primary">{{ \'UPDATE_PASSWORD_LABEL\' | translate }}</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/password/reset-password-invalid.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_INVALID' | translate }}</h3><a href=/#!/password/forgot class=col-md-12>{{ 'ASK_FOR_NEW_PASSWORD' | translate }}</a></section>"),$templateCache.put("modules/users/views/password/reset-password-success.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_SUCCESS' | translate }}</h3><a href=\"/#!/\" class=col-md-12>{{ 'CONTINUE_TO_LOGIN' | translate }}</a></section>"),$templateCache.put("modules/users/views/password/reset-password.client.view.html",'<section class="row auth" data-ng-controller=PasswordController><h3 class="col-md-12 text-center">Reset your password</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resetUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="New Password"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="Verify Password"></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">Update Password</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/settings/change-password.client.view.html",'<section class="row auth" data-ng-controller=SettingsController><h3 class="col-md-12 text-center">Change your password</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=changeUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=currentPassword>Current Password</label><input type=password id=currentPassword name=currentPassword class=form-control data-ng-model=passwordDetails.currentPassword placeholder="Current Password"></div><hr><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="New Password"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="Verify Password"></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">{{ \'SAVE_PASSWORD_BTN\' | translate }}</button></div><div data-ng-show=success class="text-center text-success"><strong>{{ \'PASSWORD_CHANGE_SUCCESS\' | translate }}</strong></div><div data-ng-show=error class="text-center text-danger"><strong data-ng-bind=error></strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/settings/edit-profile.client.view.html",'1<section class="row auth" data-ng-controller=SettingsController><h3 class="col-xs-offset-1 col-xs-10 text-center">Edit your profile</h3><div class="col-xs-offset-3 col-xs-6"><form name=userForm data-ng-submit=updateUserProfile(userForm.$valid) class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=success class="text-center text-success"><strong>{{ \'PROFILE_SAVE_SUCCESS\' | translate }}</strong></div><div data-ng-show=error class="text-center text-danger">{{ \'PROFILE_SAVE_ERROR\' | translate }}<br><strong data-ng-bind=error></strong></div><div class="form-group row"><div class="col-xs-7 field-title"><b>{{ \'FIRST_NAME_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><input id=firstName name=firstName class=form-control data-ng-model=user.firstName placeholder="First Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class="form-group row"><div class="col-xs-7 field-title"><b>Last Name</b></div><div class="col-xs-12 field-input"><input id=lastName name=lastName class=form-control data-ng-model=user.lastName placeholder="Last Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class=row><hr></div><div class="row form-group"><div class="col-xs-7 field-title"><b>{{ \'LANGUAGE_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><select ng-model=user.language required><option ng-repeat="language in languages" ng-selected="language == user.language" value={{language}}>{{language}}</option></select></div></div><div class="row form-group"><div class="col-xs-7 field-title"><b>Username</b></div><div class="col-xs-12 field-input"><input id=username name=username class=form-control data-ng-model=user.username placeholder=Username></div></div><div class="row form-group"><div class="col-xs-7 field-title"><b>{{ \'EMAIL_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><input type=email id=email name=email class=form-control data-ng-model=user.email placeholder=Email></div></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary" style=font-size:1.6em>{{ \'SUBMIT_BTN\' | translate }}</button></div></fieldset></form></div></section>'),
$templateCache.put("modules/users/views/settings/social-accounts.client.view.html",'<section class="row auth" data-ng-controller=SettingsController><h3 class="col-md-12 text-center" data-ng-show=hasConnectedAdditionalSocialAccounts()>Connected social accounts:</h3><div class="col-md-12 text-center"><div data-ng-repeat="(providerName, providerData) in user.additionalProvidersData" class=remove-account-container><img ng-src=/modules/users/img/buttons/{{providerName}}.png> <a class="btn btn-danger btn-remove-account" data-ng-click=removeUserSocialAccount(providerName)><i class="glyphicon glyphicon-trash"></i></a></div></div><h3 class="col-md-12 text-center">Connect other social accounts:</h3><div class="col-md-12 text-center"><a href=/auth/facebook data-ng-hide="isConnectedSocialAccount(\'facebook\')" class=undecorated-link><img src=/modules/users/img/buttons/facebook.png></a> <a href=/auth/twitter data-ng-hide="isConnectedSocialAccount(\'twitter\')" class=undecorated-link><img src=/modules/users/img/buttons/twitter.png></a> <a href=/auth/google data-ng-hide="isConnectedSocialAccount(\'google\')" class=undecorated-link><img src=/modules/users/img/buttons/google.png></a> <a href=/auth/linkedin data-ng-hide="isConnectedSocialAccount(\'linkedin\')" class=undecorated-link><img src=/modules/users/img/buttons/linkedin.png></a> <a href=/auth/github data-ng-hide="isConnectedSocialAccount(\'github\')" class=undecorated-link><img src=/modules/users/img/buttons/github.png></a></div></section>'),$templateCache.put("modules/users/views/verify/resend-verify-email.client.view.html",'<section class="auth row" data-ng-controller=VerifyController><section ng-if=!isResetSent><h3 class="col-md-12 text-center">Resend your account verification email</h3><p class="small text-center">Enter your account email.</p><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resendVerifyEmail() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><input id=email name=email class=form-control data-ng-model=credentials.email placeholder=bob@example.com></div><div class="text-center form-group"><button type=submit class="btn btn-primary" ng-click=resendVerifyEmail()>{{ \'SUBMIT_BTN\' | translate }}</button></div></fieldset></form></div></section><section ng-if=isResetSent><h3 class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6 text-center">Verification Email has been Sent</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><h2>{{ \'VERIFICATION_EMAIL_SENT\' | translate }} {{username}}.<br>{{ \'NOT_ACTIVATED_YET\' | translate }}</h2><p>{{ \'CHECK_YOUR_EMAIL\' | translate }} <a href=mail:polydaic@gmail.com>polydaic@gmail.com</a></p><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary"><a href="/#!/" style=color:white>Continue</a></button></div></div></section></section>'),$templateCache.put("modules/users/views/verify/verify-account.client.view.html","<section style=margin-top:50px class=\"row text-center\" data-ng-controller=VerifyController ng-init=validateVerifyToken()><section class=\"row text-center\" ng-if=isResetSent><h3 class=col-md-12></h3><a href=/#!/signin class=col-md-12>{{ 'CONTINUE_TO_LOGIN' | translate }}</a></section><section class=\"row text-center\" ng-if=!isResetSent><h3 class=col-md-12>{{ 'VERIFY_ERROR' | translate }}</h3><a href=/#!/verify class=col-md-6>{{ 'REVERIFY_ACCOUNT_LINK' | translate }}</a> <a href=/#!/signin class=col-md-6>{{ 'SIGNIN_BTN' | translate }}</a></section></section>")}]),ApplicationConfiguration.registerModule("core",["users"]),ApplicationConfiguration.registerModule("forms",["ngFileUpload","ui.router.tabs","ui.date","ui.sortable","angular-input-stars","users"]),ApplicationConfiguration.registerModule("users"),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{PDF_GENERATION_EMR:"PDF Generation/EMR",SAVE_PDF_SUBMISSIONS:"Save Submissions as PDFs?",UPLOAD_YOUR_PDF:"Upload Your PDF Template",ADVANCED_SETTINGS:"Advanced Settings",FORM_NAME:"Form Name",FORM_STATUS:"Form Status",PUBLIC:"Public",PRIVATE:"Private",GA_TRACKING_CODE:"Google Analytics Tracking Code",DISPLAY_FOOTER:"Display Form Footer?",SAVE_CHANGES:"Save Changes",CANCEL:"Cancel",CREATE_A_NEW_FORM:"Create a new form",CREATE_FORM:"Create form",CREATED_ON:"Created on",ARE_YOU_SURE:"Are you ABSOLUTELY sure?",READ_WARNING:"Unexpected bad things will happen if you dont read this!",DELETE_WARNING1:"This action CANNOT be undone.This will permanently delete the",DELETE_WARNING2:"form, form submissions and remove all associated pdfs.",DELETE_CONFIRM:"Please type in the name of the form to confirm",I_UNDERSTAND:"I understand the consequences, delete this form",DELETE_FORM_SM:"Delete",DELETE_FORM_MD:"Delete Form",DELETE:"Delete",FORM:"Form",VIEW:"View",LIVE:"Live",PREVIEW:"Preview",DISABLED:"Disabled:",YES:"YES",NO:"NO",ADD_LOGIC_JUMP:"Add Logic Jump",ADD_FIELD_LG:"Click to Add New Field",ADD_FIELD_MD:"Add New Field",ADD_FIELD_SM:"Add Field",PREVIEW_START_PAGE:"Preview Welcome Screen",EDIT_START_PAGE:"Edit Welcome Screen",WELCOME_SCREEN:"Welcome Screen",INTRO_TITLE:"Intro Title",INTRO_PARAGRAPH:"Intro Paragraph",INTRO_BTN:"Intro Button",BUTTONS:"Buttons",BUTTON_TEXT:"Text",BUTTON_LINK:"Link",ADD_BUTTON:"Add Button",PREVIEW_FIELD:"Preview Field",EDIT_FIELD:"Edit Field",QUESTION_TITLE:"Question Title",QUESTION_DESCRIPTION:"Question Description",OPTIONS:"Options",ADD_OPTION:"Add Option",NUM_OF_STEPS:"Number of Steps",CLICK_FIELDS_FOOTER:"Click on fields to add them here",TOTAL_VIEWS:"total unique visits",RESPONSES:"responses",COMPLETION_RATE:"completion rate",AVERAGE_TIME_TO_COMPLETE:"avg. completion time",DESKTOP_AND_LAPTOP:"Desktops",TABLETS:"Tablets",PHONES:"Phones",OTHER:"Other",UNIQUE_VISITS:"Unique Visits",FIELD_TITLE:"Field Title",FIELD_VIEWS:"Field Views",FIELD_DROPOFF:"Field Completion",FIELD_RESPONSES:"Field Responses",DELETE_SELECTED:"Delete Selected",EXPORT_TO_EXCEL:"Export to Excel",EXPORT_TO_CSV:"Export to CSV",EXPORT_TO_JSON:"Export to JSON",PERCENTAGE_COMPLETE:"Percentage Complete",TIME_ELAPSED:"Time Elapsed",DEVICE:"Device",LOCATION:"Location",IP_ADDRESS:"IP Address",DATE_SUBMITTED:"Date Submitted",GENERATED_PDF:"Generated PDF",BACKGROUND_COLOR:"Background Color",DESIGN_HEADER:"Change how your Form Looks",QUESTION_TEXT_COLOR:"Question Text Color",ANSWER_TEXT_COLOR:"Answer Text Color",BTN_BACKGROUND_COLOR:"Button Background Color",BTN_TEXT_COLOR:"Button Text Color",CREATE_TAB:"Create",DESIGN_TAB:"Design",CONFIGURE_TAB:"Configure",ANALYZE_TAB:"Analyze"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{FORM_SUCCESS:"Form entry successfully submitted!",REVIEW:"Review",BACK_TO_FORM:"Go back to Form",EDIT_FORM:"Edit this TellForm",CREATE_FORM:"Create this TellForm",ADVANCEMENT:"{{done}} out of {{total}} answered",CONTINUE_FORM:"Continue to Form",REQUIRED:"required",COMPLETING_NEEDED:"{{answers_not_completed}} answer(s) need completing",OPTIONAL:"optional",ERROR_EMAIL_INVALID:"Please enter a valid email address",ERROR_NOT_A_NUMBER:"Please enter valid numbers only",ERROR_URL_INVALID:"Please a valid url",OK:"OK",ENTER:"press ENTER",YES:"Yes",NO:"No",NEWLINE:"press SHIFT+ENTER to create a newline",CONTINUE:"Continue",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I dont accept",DELETE:"Delete",CANCEL:"Cancel",SUBMIT:"Submit",UPLOAD_FILE:"Upload your File"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{FORM_SUCCESS:"Votre formulaire a été enregistré!",REVIEW:"Incomplet",BACK_TO_FORM:"Retourner au formulaire",EDIT_FORM:"Éditer le Tellform",CREATE_FORM:"Créer un TellForm",ADVANCEMENT:"{{done}} complétés sur {{total}}",CONTINUE_FORM:"Aller au formulaire",REQUIRED:"obligatoire",COMPLETING_NEEDED:"{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)",OPTIONAL:"facultatif",ERROR_EMAIL_INVALID:"Merci de rentrer une adresse mail valide",ERROR_NOT_A_NUMBER:"Merce de ne rentrer que des nombres",ERROR_URL_INVALID:"Merci de rentrer une url valide",OK:"OK",ENTER:"presser ENTRÉE",YES:"Oui",NO:"Non",NEWLINE:"presser SHIFT+ENTER pour créer une nouvelle ligne",CONTINUE:"Continuer",LEGAL_ACCEPT:"Jaccepte",LEGAL_NO_ACCEPT:"Je naccepte pas",DELETE:"Supprimer",CANCEL:"Réinitialiser",SUBMIT:"Enregistrer",UPLOAD_FILE:"Envoyer un fichier",Y:"O",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("de",{FORM_SUCCESS:"Ihre Angaben wurden gespeichert.",REVIEW:"Unvollständig",BACK_TO_FORM:"Zurück zum Formular",EDIT_FORM:"Bearbeiten Sie diese TellForm",CREATE_FORM:"Erstellen Sie eine TellForm",ADVANCEMENT:"{{done}} von {{total}} beantwortet",CONTINUE_FORM:"Zum Formular",REQUIRED:"verpflichtend",COMPLETING_NEEDED:"Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)",OPTIONAL:"fakultativ",ERROR_EMAIL_INVALID:"Bitte gültige Mailadresse eingeben",ERROR_NOT_A_NUMBER:"Bitte nur Zahlen eingeben",ERROR_URL_INVALID:"Bitte eine gültige URL eingeben",OK:"Okay",ENTER:"Eingabetaste drücken",YES:"Ja",NO:"Nein",NEWLINE:"Für eine neue Zeile SHIFT+ENTER drücken",CONTINUE:"Weiter",LEGAL_ACCEPT:"Ich akzeptiere",LEGAL_NO_ACCEPT:"Ich akzeptiere nicht",DELETE:"Entfernen",CANCEL:"Canceln",SUBMIT:"Speichern",UPLOAD_FILE:"Datei versenden",Y:"J",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("it",{FORM_SUCCESS:"Il formulario è stato inviato con successo!",REVIEW:"Incompleto",BACK_TO_FORM:"Ritorna al formulario",EDIT_FORM:"Modifica questo Tellform",CREATE_FORM:"Creare un TellForm",ADVANCEMENT:"{{done}} su {{total}} completate",CONTINUE_FORM:"Vai al formulario",REQUIRED:"obbligatorio",COMPLETING_NEEDED:"{{answers_not_completed}} risposta/e deve/ono essere completata/e",OPTIONAL:"opzionale",ERROR_EMAIL_INVALID:"Si prega di inserire un indirizzo email valido",ERROR_NOT_A_NUMBER:"Si prega di inserire solo numeri",ERROR_URL_INVALID:"Grazie per inserire un URL valido",OK:"OK",ENTER:"premere INVIO",YES:"Sì",NO:"No",NEWLINE:"premere SHIFT+INVIO per creare una nuova linea",CONTINUE:"Continua",LEGAL_ACCEPT:"Accetto",LEGAL_NO_ACCEPT:"Non accetto",DELETE:"Cancella",CANCEL:"Reset",SUBMIT:"Registra",UPLOAD_FILE:"Invia un file",Y:"S",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("es",{FORM_SUCCESS:"¡El formulario ha sido enviado con éxito!",REVIEW:"Revisar",BACK_TO_FORM:"Regresar al formulario",EDIT_FORM:"Crear un TellForm",CREATE_FORM:"Editar este TellForm",ADVANCEMENT:"{{done}} de {{total}} contestadas",CONTINUE_FORM:"Continuar al formulario",REQUIRED:"Información requerida",COMPLETING_NEEDED:"{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)",OPTIONAL:"Opcional",ERROR_EMAIL_INVALID:"Favor de proporcionar un correo electrónico válido",ERROR_NOT_A_NUMBER:"Por favor, introduzca sólo números válidos",ERROR_URL_INVALID:"Favor de proporcionar un url válido",OK:"OK",ENTER:"pulse INTRO",YES:"Si",NO:"No",NEWLINE:"presione SHIFT+INTRO para crear una nueva línea",CONTINUE:"Continuar",LEGAL_ACCEPT:"Acepto",LEGAL_NO_ACCEPT:"No acepto",DELETE:"Eliminar",CANCEL:"Cancelar",SUBMIT:"Registrar",UPLOAD_FILE:"Cargar el archivo",Y:"S",N:"N"})}]),angular.module("core").config(["$stateProvider","$urlRouterProvider",function($stateProvider,$urlRouterProvider,Authorization){$urlRouterProvider.otherwise("/forms")}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","$state","$stateParams",function($rootScope,Auth,$state,$stateParams){$rootScope.$state=$state,$rootScope.$stateParams=$stateParams,$rootScope.$on("$stateChangeSuccess",function(event,toState,toParams,fromState){$state.previous=fromState;var statesToIgnore=["home","signin","resendVerifyEmail","verify","signup","signup-success","forgot","reset-invalid","reset","reset-success"];statesToIgnore.indexOf(toState.name)>0?Auth.isAuthenticated()&&(event.preventDefault(),$state.go("listForms")):"access_denied"===toState.name||Auth.isAuthenticated()||"submitForm"===toState.name||(console.log("go to signup"),event.preventDefault(),$state.go("listForms"))})}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","User","Authorizer","$state","$stateParams",function($rootScope,Auth,User,Authorizer,$state,$stateParams){$rootScope.$on("$stateChangeStart",function(event,next){var authenticator,permissions,user;permissions=next&&next.data&&next.data.permissions?next.data.permissions:null,Auth.ensureHasCurrentUser(User),user=Auth.currentUser,user&&(authenticator=new Authorizer(user),null!==permissions&&(authenticator.canAccess(permissions)||(event.preventDefault(),$state.go("access_denied"))))})}]),angular.module("core").controller("HeaderController",["$rootScope","$scope","Menus","$state","Auth","User","$window","$translate","$locale",function($rootScope,$scope,Menus,$state,Auth,User,$window,$translate,$locale){$rootScope.signupDisabled=$window.signupDisabled,$scope.user=$rootScope.user=Auth.ensureHasCurrentUser(User),$scope.authentication=$rootScope.authentication=Auth,$rootScope.languages=$scope.languages=["en","fr","es","it","de"],console.log($locale.id),$scope.authentication.isAuthenticated()?$rootScope.language=$scope.user.language:$rootScope.language=$locale.id.substring(0,2),$translate.use($rootScope.language),$scope.isCollapsed=!1,$rootScope.hideNav=!1,$scope.menu=Menus.getMenu("topbar"),$scope.signout=function(){var promise=User.logout();promise.then(function(){Auth.logout(),Auth.ensureHasCurrentUser(User),$scope.user=$rootScope.user=null,$state.go("listForms")},function(reason){console.log("Logout Failed: "+reason)})},$scope.toggleCollapsibleMenu=function(){$scope.isCollapsed=!$scope.isCollapsed},$scope.$on("$stateChangeSuccess",function(event,toState,toParams,fromState,fromParams){$scope.isCollapsed=!1,$rootScope.hideNav=!1,angular.isDefined(toState.data)&&angular.isDefined(toState.data.hideNav)&&($rootScope.hideNav=toState.data.hideNav)})}]),angular.module("core").service("Menus",[function(){this.defaultRoles=["*"],this.menus={};var shouldRender=function(user){if(!user)return this.isPublic;if(~this.roles.indexOf("*"))return!0;for(var userRoleIndex in user.roles)for(var roleIndex in this.roles)if(console.log(this.roles[roleIndex]),console.log(this.roles[roleIndex]===user.roles[userRoleIndex]),this.roles[roleIndex]===user.roles[userRoleIndex])return!0;return!1};this.validateMenuExistance=function(menuId){if(menuId&&menuId.length){if(this.menus[menuId])return!0;throw new Error("Menu does not exists")}throw new Error("MenuId was not provided")},this.getMenu=function(menuId){return this.validateMenuExistance(menuId),this.menus[menuId]},this.addMenu=function(menuId,isPublic,roles){return this.menus[menuId]={isPublic:isPublic||!1,roles:roles||this.defaultRoles,items:[],shouldRender:shouldRender},this.menus[menuId]},this.removeMenu=function(menuId){this.validateMenuExistance(menuId),delete this.menus[menuId]},this.addMenuItem=function(menuId,menuItemTitle,menuItemURL,menuItemType,menuItemUIRoute,isPublic,roles,position){return this.validateMenuExistance(menuId),this.menus[menuId].items.push({title:menuItemTitle,link:menuItemURL,menuItemType:menuItemType||"item",menuItemClass:menuItemType,uiRoute:menuItemUIRoute||"/"+menuItemURL,isPublic:null===isPublic||"undefined"==typeof isPublic?this.menus[menuId].isPublic:isPublic,roles:null===roles||"undefined"==typeof roles?this.menus[menuId].roles:roles,position:position||0,items:[],shouldRender:shouldRender}),this.menus[menuId]},this.addSubMenuItem=function(menuId,rootMenuItemURL,menuItemTitle,menuItemURL,menuItemUIRoute,isPublic,roles,position){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===rootMenuItemURL&&this.menus[menuId].items[itemIndex].items.push({title:menuItemTitle,link:menuItemURL,uiRoute:menuItemUIRoute||"/"+menuItemURL,isPublic:null===isPublic||"undefined"==typeof isPublic?this.menus[menuId].items[itemIndex].isPublic:isPublic,roles:null===roles||"undefined"==typeof roles?this.menus[menuId].items[itemIndex].roles:roles,position:position||0,shouldRender:shouldRender});return this.menus[menuId]},this.removeMenuItem=function(menuId,menuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===menuItemURL&&this.menus[menuId].items.splice(itemIndex,1);return this.menus[menuId]},this.removeSubMenuItem=function(menuId,submenuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)for(var subitemIndex in this.menus[menuId].items[itemIndex].items)this.menus[menuId].items[itemIndex].items[subitemIndex].link===submenuItemURL&&this.menus[menuId].items[itemIndex].items.splice(subitemIndex,1);return this.menus[menuId]},this.addMenu("topbar",!1,["*"]),this.addMenu("bottombar",!1,["*"])}]),function(){function Socket($timeout,$window){function connect(url){service.socket=io(url,{transports:["websocket","polling"]})}function emit(eventName,data){service.socket&&service.socket.emit(eventName,data)}function on(eventName,callback){service.socket&&service.socket.on(eventName,function(data){$timeout(function(){callback(data)})})}function removeListener(eventName){service.socket&&service.socket.removeListener(eventName)}var service={connect:connect,emit:emit,on:on,removeListener:removeListener,socket:null};return connect(window.location.protocol+"//"+window.location.hostname+":"+$window.socketPort),service}angular.module("core").factory("Socket",Socket),Socket.$inject=["$timeout","$window"]}(),angular.module("core").factory("subdomain",["$location",function($location){var host=$location.host();return host.indexOf(".")<0?null:host.split(".")[0]}]),angular.module("forms").run(["Menus",function(Menus){Menus.addMenuItem("topbar","My Forms","forms","","/forms",!1)}]).filter("secondsToDateTime",[function(){return function(seconds){return new Date(1970,0,1).setSeconds(seconds)}}]).filter("formValidity",function(){return function(formObj){if(formObj&&formObj.form_fields&&formObj.visible_form_fields){var formKeys=Object.keys(formObj),fields=(formKeys.filter(function(key){return"$"!==key[0]}),formObj.form_fields),valid_count=fields.filter(function(field){if("object"==typeof field&&"statement"!==field.fieldType&&"rating"!==field.fieldType)return!!field.fieldValue}).length;return valid_count-(formObj.form_fields.length-formObj.visible_form_fields.length)}return 0}}).config(["$provide",function($provide){$provide.decorator("accordionDirective",["$delegate",function($delegate){var directive=$delegate[0];return directive.replace=!0,$delegate}])}]),angular.module("forms").config(["$stateProvider",function($stateProvider){$stateProvider.state("listForms",{url:"/forms",templateUrl:"modules/forms/admin/views/list-forms.client.view.html"}).state("submitForm",{url:"/forms/:formId",templateUrl:"modules/forms/base/views/submit-form.client.view.html",data:{hideNav:!0},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(Forms,$stateParams){return Forms.get({formId:$stateParams.formId}).$promise}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("viewForm",{url:"/forms/:formId/admin",templateUrl:"modules/forms/admin/views/admin-form.client.view.html",data:{permissions:["editForm"]},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(Forms,$stateParams){return Forms.get({formId:$stateParams.formId}).$promise}]},controller:"AdminFormController"}).state("viewForm.configure",{url:"/configure",templateUrl:"modules/forms/admin/views/adminTabs/configure.html"}).state("viewForm.design",{url:"/design",templateUrl:"modules/forms/admin/views/adminTabs/design.html"}).state("viewForm.analyze",{url:"/analyze",templateUrl:"modules/forms/admin/views/adminTabs/analyze.html"}).state("viewForm.create",{url:"/create",templateUrl:"modules/forms/admin/views/adminTabs/create.html"})}]),function(){function SendVisitorData(Socket,$state,$http,deviceDetector){function send(form,lastActiveIndex,timeElapsed){var visitorData={referrer:document.referrer,isSubmitted:form.submitted,formId:form._id,lastActiveField:form.form_fields[lastActiveIndex]._id,timeElapsed:timeElapsed,language:window.navigator.userLanguage||window.navigator.language,ipAddr:"",deviceType:""};$http.get("https://jsonip.com/").success(function(response){visitorData.ipAddr=response.ip+""}).error(function(error){console.error("Could not get users's ip")}).then(function(){visitorData.userAgent=deviceDetector.raw,deviceDetector.isTablet()?visitorData.deviceType="tablet":deviceDetector.isMobile()?visitorData.deviceType="phone":visitorData.deviceType="desktop",console.log(visitorData.deviceType),Socket.emit("form-visitor-data",visitorData)})}function init(){Socket.socket||Socket.connect()}var service={send:send};return init(),service}angular.module("forms").factory("SendVisitorData",SendVisitorData),SendVisitorData.$inject=["Socket","$state","$http","deviceDetector"]}(),angular.module("forms").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function($scope,$element,$attrs,$select){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,index=parseInt(String.fromCharCode(keyCode))-1;index<$scope.field.fieldOptions.length&&(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue=$scope.field.fieldOptions[index].option_value}))})}}}),angular.module("forms").directive("keyToTruthy",["$rootScope",function($rootScope){return{restrict:"A",scope:{field:"="},link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,truthyKeyCode=$attrs.keyCharTruthy.charCodeAt(0)-32,falseyKeyCode=$attrs.keyCharFalsey.charCodeAt(0)-32;keyCode===truthyKeyCode?(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue="true"})):keyCode===falseyKeyCode&&(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue="false"}))})}}}]),angular.module("users").config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(["$q","$location",function($q,$location){return{responseError:function(response){return"/users/me"!==$location.path()&&response.config&&"/users/me"!==response.config.url&&(console.log("intercepted rejection of ",response.config.url,response.status),401===response.status?(console.log($location.path()),$location.nextAfterLogin=$location.path(),$location.path("/signin")):403===response.status&&$location.path("/access_denied")),$q.reject(response)}}}])}]),angular.module("users").config(["$stateProvider",function($stateProvider){var checkLoggedin=function($q,$timeout,$state,User,Auth){var deferred=$q.defer();return Auth.currentUser&&Auth.currentUser.email?$timeout(deferred.resolve):Auth.currentUser=User.getCurrent(function(){Auth.login(),$timeout(deferred.resolve())},function(){Auth.logout(),$timeout(deferred.reject()),$state.go("signin",{reload:!0})}),deferred.promise};checkLoggedin.$inject=["$q","$timeout","$state","User","Auth"];var checkSignupDisabled=function($window,$timeout,$q){var deferred=$q.defer();return $timeout($window.signupDisabled?deferred.reject():deferred.resolve()),deferred.promise};checkSignupDisabled.$inject=["$window","$timeout","$q"],$stateProvider.state("profile",{resolve:{loggedin:checkLoggedin},url:"/settings/profile",templateUrl:"modules/users/views/settings/edit-profile.client.view.html"}).state("password",{resolve:{loggedin:checkLoggedin},url:"/settings/password",templateUrl:"modules/users/views/settings/change-password.client.view.html"}).state("accounts",{resolve:{loggedin:checkLoggedin},url:"/settings/accounts",templateUrl:"modules/users/views/settings/social-accounts.client.view.html"}).state("signup",{resolve:{isDisabled:checkSignupDisabled},url:"/signup",templateUrl:"modules/users/views/authentication/signup.client.view.html"}).state("signup-success",{resolve:{isDisabled:checkSignupDisabled},url:"/signup-success",templateUrl:"modules/users/views/authentication/signup-success.client.view.html"}).state("signin",{url:"/signin",templateUrl:"modules/users/views/authentication/signin.client.view.html"}).state("access_denied",{url:"/access_denied",templateUrl:"modules/users/views/authentication/access-denied.client.view.html"}).state("verify",{resolve:{isDisabled:checkSignupDisabled},url:"/verify/:token",templateUrl:"modules/users/views/verify/verify-account.client.view.html"}).state("resendVerifyEmail",{resolve:{isDisabled:checkSignupDisabled},url:"/verify",templateUrl:"modules/users/views/verify/resend-verify-email.client.view.html"}).state("forgot",{url:"/password/forgot",templateUrl:"modules/users/views/password/forgot-password.client.view.html"}).state("reset-invalid",{url:"/password/reset/invalid",templateUrl:"modules/users/views/password/reset-password-invalid.client.view.html"}).state("reset-success",{url:"/password/reset/success",templateUrl:"modules/users/views/password/reset-password-success.client.view.html"}).state("reset",{url:"/password/reset/:token",templateUrl:"modules/users/views/password/reset-password.client.view.html"})}]),angular.module("users").controller("AuthenticationController",["$scope","$location","$state","$rootScope","User","Auth",function($scope,$location,$state,$rootScope,User,Auth){$scope=$rootScope,$scope.credentials={},$scope.error="",$scope.signin=function(){User.login($scope.credentials).then(function(response){Auth.login(response),$scope.user=$rootScope.user=Auth.ensureHasCurrentUser(User),"home"!==$state.previous.name&&"verify"!==$state.previous.name&&""!==$state.previous.name?$state.go($state.previous.name):$state.go("listForms")},function(error){$rootScope.user=Auth.ensureHasCurrentUser(User),$scope.user=$rootScope.user,$scope.error=error,console.log("loginError: "+error)})},$scope.signup=function(){console.log($scope.credentials),User.signup($scope.credentials).then(function(response){console.log("signup-success"),$state.go("signup-success")},function(error){console.log("Error: "),console.log(error),error?($scope.error=error,console.log(error)):console.log("No response received")})}}]),angular.module("users").controller("PasswordController",["$scope","$stateParams","$state","User",function($scope,$stateParams,$state,User){$scope.error="",$scope.askForPasswordReset=function(){User.askForPasswordReset($scope.credentials).then(function(response){$scope.success=response.message,$scope.credentials=null},function(error){$scope.error=error,$scope.credentials=null})},$scope.resetUserPassword=function(){$scope.success=$scope.error=null,User.resetPassword($scope.passwordDetails,$stateParams.token).then(function(response){$scope.success=response.message,$scope.passwordDetails=null,$state.go("reset-success")},function(error){$scope.error=error.message||error,$scope.passwordDetails=null})}}]),angular.module("users").controller("SettingsController",["$scope","$rootScope","$http","$state","Users",function($scope,$rootScope,$http,$state,Users){$scope.user=$rootScope.user,$scope.hasConnectedAdditionalSocialAccounts=function(provider){for(var i in $scope.user.additionalProvidersData)return!0;return!1},$scope.isConnectedSocialAccount=function(provider){return $scope.user.provider===provider||$scope.user.additionalProvidersData&&$scope.user.additionalProvidersData[provider]},$scope.removeUserSocialAccount=function(provider){$scope.success=$scope.error=null,$http["delete"]("/users/accounts",{params:{provider:provider}}).success(function(response){$scope.success=!0,$scope.user=response}).error(function(response){$scope.error=response.message})},$scope.updateUserProfile=function(isValid){if(isValid){$scope.success=$scope.error=null;var user=new Users($scope.user);user.$update(function(response){$scope.success=!0,$scope.user=response},function(response){$scope.error=response.data.message})}else $scope.submitted=!0},$scope.changeUserPassword=function(){$scope.success=$scope.error=null,$http.post("/users/password",$scope.passwordDetails).success(function(response){$scope.success=!0,$scope.passwordDetails=null}).error(function(response){$scope.error=response.message})}}]),angular.module("users").controller("VerifyController",["$scope","$state","$rootScope","User","Auth","$stateParams",function($scope,$state,$rootScope,User,Auth,$stateParams){$scope.isResetSent=!1,$scope.credentials={},$scope.error="",$scope.resendVerifyEmail=function(){User.resendVerifyEmail($scope.credentials.email).then(function(response){console.log(response),$scope.success=response.message,$scope.credentials=null,$scope.isResetSent=!0},function(error){$scope.error=error,$scope.credentials.email=null,$scope.isResetSent=!1})},$scope.validateVerifyToken=function(){$stateParams.token&&(console.log($stateParams.token),User.validateVerifyToken($stateParams.token).then(function(response){console.log("Success: "+response.message),$scope.success=response.message,$scope.isResetSent=!0,$scope.credentials.email=null},function(error){console.log("Error: "+error.message),$scope.isResetSent=!1,$scope.error=error,$scope.credentials.email=null}))}}]),angular.module("users").factory("Auth",["$window",function($window){var userState={isLoggedIn:!1},service={_currentUser:null,get currentUser(){return this._currentUser},ensureHasCurrentUser:function(User){return service._currentUser&&service._currentUser.username?service._currentUser:$window.user?(service._currentUser=$window.user,service._currentUser):void User.getCurrent().then(function(user){return service._currentUser=user,userState.isLoggedIn=!0,$window.user=service._currentUser,service._currentUser},function(response){return userState.isLoggedIn=!1,service._currentUser=null,$window.user=null,console.log("User.getCurrent() err",response),null})},isAuthenticated:function(){return!!service._currentUser},getUserState:function(){return userState},login:function(new_user){userState.isLoggedIn=!0,service._currentUser=new_user},logout:function(){$window.user=null,userState.isLoggedIn=!1,service._currentUser=null}};return service}]),angular.module("users").service("Authorizer",["APP_PERMISSIONS","USER_ROLES",function(APP_PERMISSIONS,USER_ROLES){return function(user){return{canAccess:function(permissions){var i,len,permission;for(angular.isArray(permissions)||(permissions=[permissions]),i=0,len=permissions.length;i<len;i++){if(permission=permissions[i],null===APP_PERMISSIONS[permission])throw"Bad permission value";if(!user||!user.roles)return!1;switch(permission){case APP_PERMISSIONS.viewAdminSettings:case APP_PERMISSIONS.editAdminSettings:return user.roles.indexOf(USER_ROLES.admin)>-1;case APP_PERMISSIONS.viewPrivateForm:case APP_PERMISSIONS.editForm:return user.roles.indexOf(USER_ROLES.admin)>-1||user.roles.indexOf(USER_ROLES.normal)>-1}}return!1}}}}]),angular.module("users").factory("User",["$window","$q","$timeout","$http","$state",function($window,$q,$timeout,$http,$state){var userService={getCurrent:function(){var deferred=$q.defer();return $http.get("/users/me").success(function(response){deferred.resolve(response)}).error(function(){deferred.reject("User's session has expired")}),deferred.promise},login:function(credentials){var deferred=$q.defer();return $http.post("/auth/signin",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},logout:function(){var deferred=$q.defer();return $http.get("/auth/signout").success(function(response){deferred.resolve(null)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},signup:function(credentials){var deferred=$q.defer();return $http.post("/auth/signup",credentials).success(function(response){deferred.resolve(response);
}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},resendVerifyEmail:function(_email){var deferred=$q.defer();return $http.post("/auth/verify",{email:_email}).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},validateVerifyToken:function(token){var validTokenRe=/^([A-Za-z0-9]{48})$/g;if(!validTokenRe.test(token))throw new Error("Error token: "+token+" is not a valid verification token");var deferred=$q.defer();return $http.get("/auth/verify/"+token).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error)}),deferred.promise},resetPassword:function(passwordDetails,token){var deferred=$q.defer();return $http.get("/auth/password/"+token,passwordDetails).success(function(response){deferred.resolve()}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},askForPasswordReset:function(credentials){var deferred=$q.defer();return $http.post("/auth/forgot",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise}};return userService}]),angular.module("users").factory("Users",["$resource",function($resource){return $resource("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{MENU:"MENU",SIGNUP_TAB:"Sign Up",SIGNIN_TAB:"Sign In",SIGNOUT_TAB:"Signout",EDIT_PROFILE:"Edit Profile",MY_FORMS:"My Forms",MY_SETTINGS:"My Settings",CHANGE_PASSWORD:"Change Password"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{MENU:"MENU",SIGNUP_TAB:"Créer un Compte",SIGNIN_TAB:"Connexion",SIGNOUT_TAB:"Créer un compte",EDIT_PROFILE:"Modifier Mon Profil",MY_FORMS:"Mes Formulaires",MY_SETTINGS:"Mes Paramètres",CHANGE_PASSWORD:"Changer mon Mot de Pass"})}]),angular.module("forms").controller("AdminFormController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter",function($rootScope,$scope,$stateParams,$state,Forms,CurrentForm,$http,$uibModal,myForm,$filter){$scope=$rootScope,$scope.animationsEnabled=!0,$scope.myform=myForm,$rootScope.saveInProgress=!1,CurrentForm.setForm($scope.myform),$scope.formURL=$scope.myform.admin.username+".tellform.com",$scope.tabData=[{heading:$filter("translate")("CREATE_TAB"),route:"viewForm.create"},{heading:$filter("translate")("DESIGN_TAB"),route:"viewForm.design"},{heading:$filter("translate")("CONFIGURE_TAB"),route:"viewForm.configure"},{heading:$filter("translate")("ANALYZE_TAB"),route:"viewForm.analyze"}],$scope.setForm=function(form){$scope.myform=form},$rootScope.resetForm=function(){$scope.myform=Forms.get({formId:$stateParams.formId})},$scope.openDeleteModal=function(){$scope.deleteModal=$uibModal.open({animation:$scope.animationsEnabled,templateUrl:"myModalContent.html",controller:"AdminFormController",resolve:{myForm:function(){return $scope.myform}}}),$scope.deleteModal.result.then(function(selectedItem){$scope.selected=selectedItem},function(){console.log("Modal dismissed at: "+new Date)})},$scope.cancelDeleteModal=function(){$scope.deleteModal&&$scope.deleteModal.dismiss("cancel")},$scope.removeCurrentForm=function(){if($scope.deleteModal&&$scope.deleteModal.opened){$scope.deleteModal.close();var form_id=$scope.myform._id;if(!form_id)throw new Error("Error - removeCurrentForm(): $scope.myform._id does not exist");$http["delete"]("/forms/"+form_id).success(function(data,status,headers){console.log("form deleted successfully"),$state.go("listForms",{},{reload:!0})}).error(function(error){console.log("ERROR: Form could not be deleted."),console.error(error)})}},$scope.update=$rootScope.update=function(updateImmediately,cb){var continueUpdate=!0;if(updateImmediately||(continueUpdate=!$rootScope.saveInProgress),continueUpdate){var err=null;updateImmediately||($rootScope.saveInProgress=!0),$scope.updatePromise=$http.put("/forms/"+$scope.myform._id,{form:$scope.myform}).then(function(response){$rootScope.myform=$scope.myform=response.data})["catch"](function(response){console.log("Error occured during form UPDATE.\n"),err=response.data})["finally"](function(){if(updateImmediately||($rootScope.saveInProgress=!1),"function"==typeof cb)return cb(err)})}}}]),angular.module("forms").controller("ListFormsController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http",function($rootScope,$scope,$stateParams,$state,Forms,CurrentForm,$http){$scope=$rootScope,$scope.forms={},$scope.showCreateModal=!1,$rootScope.languageRegExp={regExp:/[@!#$%^&*()\-+={}\[\]|\\/'";:`.,~№?<>]+/i,test:function(val){return!this.regExp.test(val)}},$scope.findAll=function(){Forms.query(function(_forms){$scope.myforms=_forms})},$scope.openCreateModal=function(){$scope.showCreateModal||($scope.showCreateModal=!0)},$scope.closeCreateModal=function(){$scope.showCreateModal&&($scope.showCreateModal=!1)},$scope.setForm=function(form){$scope.myform=form},$scope.goToWithId=function(route,id){$state.go(route,{formId:id},{reload:!0})},$scope.duplicateForm=function(form_index){var form=_.cloneDeep($scope.myforms[form_index]);delete form._id,$http.post("/forms",{form:form}).success(function(data,status,headers){$scope.myforms.splice(form_index+1,0,data)}).error(function(errorResponse){console.error(errorResponse),null===errorResponse&&($scope.error=errorResponse.data.message)})},$scope.createNewForm=function(){var form={};form.title=$scope.forms.createForm.title.$modelValue,form.language=$scope.forms.createForm.language.$modelValue,$scope.forms.createForm.$valid&&$scope.forms.createForm.$dirty&&$http.post("/forms",{form:form}).success(function(data,status,headers){$scope.goToWithId("viewForm.create",data._id+"")}).error(function(errorResponse){console.error(errorResponse),$scope.error=errorResponse.data.message})},$scope.removeForm=function(form_index){if(form_index>=$scope.myforms.length||form_index<0)throw new Error("Error: form_index in removeForm() must be between 0 and "+$scope.myforms.length-1);$http["delete"]("/forms/"+$scope.myforms[form_index]._id).success(function(data,status,headers){$scope.myforms.splice(form_index,1)}).error(function(error){console.error(error)})}}]),_.mixin({removeDateFields:removeDateFieldsFunc}),angular.module("forms").directive("autoSaveForm",["$rootScope","$timeout",function($rootScope,$timeout){return{require:["^form"],restrict:"AE",link:function($scope,$element,$attrs,$ctrls){angular.element(document).ready(function(){var $formCtrl=$ctrls[0],savePromise=null;$rootScope.finishedRender=!1,$scope.$on("editFormFields Started",function(ngRepeatFinishedEvent){$rootScope.finishedRender=!1}),$scope.$on("editFormFields Finished",function(ngRepeatFinishedEvent){$rootScope.finishedRender=!0}),$scope.anyDirtyAndTouched=function(form){var propCount=0;for(var prop in form)if(form.hasOwnProperty(prop)&&"$"!==prop[0]&&(propCount++,form[prop].$touched&&form[prop].$dirty))return!0;return!1};var debounceSave=function(){$rootScope.saveInProgress=!0,$rootScope[$attrs.autoSaveCallback](!0,function(err){err?(console.error("Error form data NOT persisted"),console.error(err)):($formCtrl.$setPristine(),$formCtrl.$setUntouched())})};$scope.$watch(function(newValue,oldValue){$rootScope.finishedRender&&$scope.anyDirtyAndTouched($scope.editForm)&&!$rootScope.saveInProgress&&debounceSave()}),$scope.$watch($attrs.autoSaveWatch,function(newValue,oldValue){newValue=angular.copy(newValue),oldValue=angular.copy(oldValue),newValue.form_fields=_.removeDateFields(newValue.form_fields),oldValue.form_fields=_.removeDateFields(oldValue.form_fields);var changedFields=!_.isEqual(oldValue.form_fields,newValue.form_fields)||!_.isEqual(oldValue.startPage,newValue.startPage),changedFieldMap=!1;oldValue.hasOwnProperty("plugins.oscarhost.settings.fieldMap")&&(changedFieldMap=!!oldValue.plugins.oscarhost.settings.fieldMap&&!_.isEqual(oldValue.plugins.oscarhost.settings.fieldMap,newValue.plugins.oscarhost.settings.fieldMap)),(newValue||oldValue)&&oldValue&&(0===oldValue.form_fields.length&&($rootScope.finishedRender=!0),$rootScope.finishedRender&&(changedFields&&!$formCtrl.$dirty||changedFieldMap)&&!$rootScope.saveInProgress?(savePromise&&($timeout.cancel(savePromise),savePromise=null),savePromise=$timeout(function(){debounceSave()})):$rootScope.finishedRender&&$rootScope.saveInProgress&&($rootScope.saveInProgress=!1))},!0)})}}}]),angular.module("forms").directive("configureFormDirective",["$rootScope","$http","Upload","CurrentForm",function($rootScope,$http,Upload,CurrentForm){return{templateUrl:"modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",restrict:"E",scope:{myform:"=",user:"=",pdfFields:"@",formFields:"@"},controller:["$scope",function($scope){console.log($scope.myform),CurrentForm.getForm().plugins?CurrentForm.getForm().plugins.oscarhost.baseUrl&&($scope.oscarhostAPI=!0):$scope.oscarhostAPI=!1,$scope.log="",$scope.pdfLoading=!1,$scope.languages=$rootScope.languages,this._current_upload=null,$scope.resetForm=$rootScope.resetForm,$scope.update=$rootScope.update,this._unbindedPdfFields=$scope.pdfFields,$scope.cancelUpload=function(){this._current_upload.abort(),$scope.pdfLoading=!1,$scope.removePDF()},$scope.removePDF=function(){$scope.myform.pdf=null,$scope.myform.isGenerated=!1,$scope.myform.autofillPDFs=!1,console.log("form.pdf: "+$scope.myform.pdf+" REMOVED")},$scope.uploadPDF=function(file){file&&(console.log(file),Upload.upload({url:"/upload/pdf",data:{user:$scope.user,file:file}}).then(function(resp){var data=resp.data;$scope.log="file "+data.originalname+" uploaded as "+data.filename+". JSON: "+JSON.stringify(data)+"\n"+$scope.log,$scope.myform.pdf=angular.fromJson(angular.toJson(data)),$scope.pdfLoading=!1,console.log($scope.log),$scope.$$phase||$scope.$digest||$scope.$apply()},function(resp){$scope.pdfLoading=!1,console.log("Error occured during upload.\n"),console.log(resp.status)},function(evt){var progressPercentage=parseInt(100*evt.loaded/evt.total,10);$scope.log="progress: "+progressPercentage+"% "+evt.config.data.file.name+"\n"+$scope.log,console.log($scope.log),$scope.pdfLoading=!0}))}}]}}]),angular.module("forms").directive("editFormDirective",["$rootScope","FormFields",function($rootScope,FormFields){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$scope",function($scope){for(var field_ids=_($scope.myform.form_fields).pluck("_id"),i=0;i<field_ids.length;i++)$scope.myform.plugins.oscarhost.settings.fieldMap[field_ids[i]]=null;$scope.sortableOptions={appendTo:".dropzone",forceHelperSize:!0,forcePlaceholderSize:!0},$scope.select2FA={Heart:"Heart",Star:"Star","thumbs-up":"Thumbs Up","thumbs-down":"Thumbs Down",Circle:"Circle",Square:"Square","Check Circle":"Checkmark","Smile Outlined":"Smile",Hourglass:"Hourglass",bell:"Bell","Paper Plane":"Paper Plane",Comment:"Chat Bubble",Trash:"Trash Can"},$scope.addField={},$scope.addField.types=FormFields.types,$scope.addField.types.forEach(function(type){return type.lastAddedID=1,type}),$scope.lastButtonID=0,$scope.accordion={},$scope.accordion.oneAtATime=!0,$scope.update=$rootScope.update,$scope.removeLogicJump=function(field_index){var currField=$scope.myform.form_fields[field_index];currField.logicJump={}},$scope.addNewLogicJump=function(field_index){var form_fields=$scope.myform.form_fields,currField=form_fields[field_index];if(console.log(currField),form_fields.length>1&&currField._id){var newLogicJump={fieldA:currField._id};currField.logicJump=newLogicJump}},$scope.dropzone={handle:".handle",containment:".dropzoneContainer",cursor:"grabbing"},$scope.addNewField=function(modifyForm,fieldType){$scope.addField.lastAddedID++;for(var fieldTitle,i=0;i<$scope.addField.types.length;i++)if($scope.addField.types[i].name===fieldType){$scope.addField.types[i].lastAddedID++,fieldTitle=$scope.addField.types[i].value+$scope.addField.types[i].lastAddedID;break}var newField={title:fieldTitle,fieldType:fieldType,fieldValue:"",required:!0,disabled:!1,deletePreserved:!1,logicJump:{}};return $scope.showAddOptions(newField)&&(newField.fieldOptions=[],newField.fieldOptions.push({option_id:Math.floor(1e5*Math.random()),option_title:"Option 0",option_value:"Option 0"})),modifyForm&&$scope.myform.form_fields.push(newField),newField},$scope.deleteField=function(field_index){var currFieldId=$scope.myform.form_fields[field_index]._id;$scope.myform.hasOwnProperty("plugins.oscarhost.baseUrl")&&delete $scope.myform.plugins.oscarhost.settings.fieldMap[currFieldId],$scope.myform.form_fields.splice(field_index,1)},$scope.duplicateField=function(field_index){var currField=_.cloneDeep($scope.myform.form_fields[field_index]);currField._id="cloned"+_.uniqueId(),currField.title+=" copy",$scope.myform.form_fields.splice(field_index+1,0,currField)},$scope.addButton=function(){var newButton={};newButton.bgColor="#ddd",newButton.color="#ffffff",newButton.text="Button",newButton._id=Math.floor(1e5*Math.random()),$scope.myform.startPage.buttons.push(newButton)},$scope.deleteButton=function(button){for(var currID,i=0;i<$scope.myform.startPage.buttons.length;i++)if(currID=$scope.myform.startPage.buttons[i]._id,console.log(currID),currID===button._id){$scope.myform.startPage.buttons.splice(i,1);break}},$scope.addOption=function(field_index){var currField=$scope.myform.form_fields[field_index];if("checkbox"===currField.fieldType||"dropdown"===currField.fieldType||"radio"===currField.fieldType){currField.fieldOptions||($scope.myform.form_fields[field_index].fieldOptions=[]);var lastOptionID=$scope.myform.form_fields[field_index].fieldOptions.length+1,newOption={option_id:Math.floor(1e5*Math.random()),option_title:"Option "+lastOptionID,option_value:"Option "+lastOptionID};$scope.myform.form_fields[field_index].fieldOptions.push(newOption)}},$scope.deleteOption=function(field_index,option){var currField=$scope.myform.form_fields[field_index];if("checkbox"===currField.fieldType||"dropdown"===currField.fieldType||"radio"===currField.fieldType)for(var i=0;i<currField.fieldOptions.length;i++)if(currField.fieldOptions[i].option_id===option.option_id){$scope.myform.form_fields[field_index].fieldOptions.splice(i,1);break}},$scope.showAddOptions=function(field){return"dropdown"===field.fieldType||"checkbox"===field.fieldType||"radio"===field.fieldType},$scope.showRatingOptions=function(field){return"rating"===field.fieldType}}]}}]),angular.module("forms").directive("editSubmissionsFormDirective",["$rootScope","$http",function($rootScope,$http){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html",restrict:"E",scope:{myform:"=",user:"="},controller:["$scope",function($scope){$scope.table={masterChecker:!1,rows:[]},function(){for(var defaultFormFields=_.cloneDeep($scope.myform.form_fields),submissions=_.cloneDeep($scope.myform.submissions),i=0;i<submissions.length;i++){for(var x=0;x<submissions[i].form_fields;x++){var oldValue=submissions[i].form_fields[x].fieldValue||"";submissions[i].form_fields[x]=_.merge(defaultFormFields,submissions[i].form_fields),submissions[i].form_fields[x].fieldValue=oldValue}submissions[i].selected=!1}$scope.table.rows=submissions}(),$scope.AverageTimeElapsed=function(){for(var totalTime=0,numSubmissions=$scope.table.rows.length,i=0;i<$scope.table.rows.length;i++)totalTime+=$scope.table.rows[i].timeElapsed;return console.log(totalTime/numSubmissions),totalTime/numSubmissions}(),$scope.DeviceStatistics=function(){var newStatItem=function(){return{visits:0,responses:0,completion:0,average_time:0,total_time:0}},stats={desktop:newStatItem(),tablet:newStatItem(),phone:newStatItem(),other:newStatItem()},visitors=$scope.myform.analytics.visitors;console.log(visitors);for(var i=0;i<visitors.length;i++){var visitor=visitors[i],deviceType=visitor.deviceType;stats[deviceType].visits++,stats[deviceType].total_time=+visitor.timeElapsed,stats[deviceType].average_time=stats[deviceType].total_time/stats[deviceType].visits||0,visitor.isSubmitted&&stats[deviceType].responses++,stats[deviceType].completion=stats[deviceType].response/stats[deviceType].visits||0}return console.log(stats),stats}(),$scope.isAtLeastOneChecked=function(){for(var i=0;i<$scope.table.rows.length;i++)if($scope.table.rows[i].selected)return!0;return!1},$scope.toggleAllCheckers=function(){for(var i=0;i<$scope.table.rows.length;i++)$scope.table.rows[i].selected=$scope.table.masterChecker},$scope.toggleObjSelection=function($event,description){$event.stopPropagation()},$scope.rowClicked=function(row_index){$scope.table.rows[row_index].selected=!$scope.table.rows[row_index].selected},$scope.deleteSelectedSubmissions=function(){var delete_ids=_.chain($scope.table.rows).filter(function(row){return!!row.selected}).pluck("_id").value();$http({url:"/forms/"+$scope.myform._id+"/submissions",method:"DELETE",data:{deleted_submissions:delete_ids},headers:{"Content-Type":"application/json;charset=utf-8"}}).success(function(data,status,headers){for(var tmpArray=[],i=0;i<$scope.table.rows.length;i++)$scope.table.rows[i].selected||tmpArray.push($scope.table.rows[i]);$scope.table.rows=tmpArray}).error(function(err){console.log("Could not delete form submissions.\nError: "),console.log(err),console.error=err})},$scope.exportSubmissions=function(type){console.log($scope.table.rows),angular.element("#table-submission-data").tableExport({type:type,escape:!1})}}]}}]),angular.module("forms").service("FormFields",[function(){this.types=[{name:"textfield",value:"Short Text"},{name:"email",value:"Email"},{name:"radio",value:"Multiple Choice"},{name:"dropdown",value:"Dropdown"},{name:"date",value:"Date"},{name:"textarea",value:"Paragraph Text"},{name:"yes_no",value:"Yes/No"},{name:"legal",value:"Legal"},{name:"rating",value:"Rating"},{name:"link",value:"Link"},{name:"number",value:"Numbers"},{name:"statement",value:"Statement"}]}]),angular.module("forms").factory("Submissions",["$resource",function($resource){return $resource("forms/:formID/submissions/:submissionId",{submissionId:"@_id",formId:"@_id"},{query:{method:"GET",isArray:!0},update:{method:"PUT"},save:{method:"POST"}})}]),angular.module("forms").value("supportedFields",["textfield","textarea","date","dropdown","hidden","password","radio","legal","statement","rating","yes_no","number","natural"]),angular.module("forms").controller("SubmitFormController",["$scope","$rootScope","$state","$translate","myForm","Auth",function($scope,$rootScope,$state,$translate,myForm,Auth){$scope.authentication=Auth,$scope.myform=myForm,$translate.use(myForm.language),$scope.myform.isLive?$scope.hideNav=$rootScope.hideNav=!0:$scope.authentication.isAuthenticated()?$scope.hideNav=$rootScope.hideNav=!1:($scope.hideNav=$rootScope.hideNav=!0,$state.go("access_denied"))}]),angular.module("forms").directive("fieldIconDirective",function(){return{template:'<i class="{{typeIcon}}"></i>',restrict:"E",scope:{typeName:"@"},controller:["$scope",function($scope){var iconTypeMap={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};$scope.typeIcon=iconTypeMap[$scope.typeName]}]}});var __indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++)if(i in this&&this[i]===item)return i;return-1};angular.module("forms").directive("fieldDirective",["$http","$compile","$rootScope","$templateCache","supportedFields",function($http,$compile,$rootScope,$templateCache,supportedFields){var getTemplateUrl=function(fieldType){var type=fieldType,templateUrl="modules/forms/base/views/directiveViews/field/";return __indexOf.call(supportedFields,type)>=0&&(templateUrl=templateUrl+type+".html"),$templateCache.get(templateUrl)};return{template:"<div>{{field.title}}</div>",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(scope,element){$rootScope.chooseDefaultOption=scope.chooseDefaultOption=function(type){"yes_no"===type?scope.field.fieldValue="true":"rating"===type?scope.field.fieldValue=0:"radio"===scope.field.fieldType?(console.log(scope.field),scope.field.fieldValue=scope.field.fieldOptions[0].option_value,console.log(scope.field.fieldValue)):"legal"===type&&(scope.field.fieldValue="true",$rootScope.nextField())},scope.setActiveField=$rootScope.setActiveField,"date"===scope.field.fieldType&&(scope.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var fieldType=scope.field.fieldType;if("number"===scope.field.fieldType||"textfield"===scope.field.fieldType||"email"===scope.field.fieldType||"link"===scope.field.fieldType){switch(scope.field.fieldType){case"textfield":scope.field.input_type="text";break;case"email":scope.field.input_type="email",scope.field.placeholder="joesmith@example.com";break;case"number":scope.field.input_type="text",scope.field.validateRegex=/^-?\d+$/;break;default:scope.field.input_type="url",scope.field.placeholder="http://example.com"}fieldType="textfield"}var template=getTemplateUrl(fieldType);element.html(template).show();$compile(element.contents())(scope)}}}]),angular.module("forms").directive("onEnterKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,onEnterKeyDisabled=!1;null!==$attrs.onEnterKeyDisabled&&(onEnterKeyDisabled=$attrs.onEnterKeyDisabled),13!==keyCode||event.shiftKey||onEnterKeyDisabled||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;9!==keyCode||event.shiftKey||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;13!==keyCode&&9!==keyCode||event.shiftKey||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;9===keyCode&&event.shiftKey&&(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onTabAndShiftKey)}))})}}}]),angular.module("forms").directive("onFinishRender",["$rootScope","$timeout",function($rootScope,$timeout){return{restrict:"A",link:function(scope,element,attrs){if(element.attr("ng-repeat")||element.attr("data-ng-repeat")){var broadcastMessage=attrs.onFinishRender||"ngRepeat";scope.$first&&!scope.$last?scope.$evalAsync(function(){$rootScope.$broadcast(broadcastMessage+" Started")}):scope.$last&&scope.$evalAsync(function(){$rootScope.$broadcast(broadcastMessage+" Finished")})}}}}]),angular.module("forms").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","Auth","SendVisitorData",function($http,TimeCounter,$filter,$rootScope,Auth,SendVisitorData){return{templateUrl:"modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$document","$window","$scope",function($document,$window,$scope){$scope.authentication=$rootScope.authentication,$scope.noscroll=!1,$scope.forms={};var form_fields_count=$scope.myform.visible_form_fields.filter(function(field){return"statement"!==field.fieldType&&"rating"!==field.fieldType}).length,nb_valid=$filter("formValidity")($scope.myform);$scope.translateAdvancementData={done:nb_valid,total:form_fields_count,answers_not_completed:form_fields_count-nb_valid},$scope.reloadForm=function(){$scope.myform.submitted=!1,$scope.myform.form_fields=_.chain($scope.myform.visible_form_fields).map(function(field){return field.fieldValue="",field}).value(),$scope.loading=!1,$scope.error="",$scope.selected={_id:"",index:0},$scope.setActiveField($scope.myform.visible_form_fields[0]._id,0,!1),TimeCounter.restartClock()},$window.onscroll=function(){$scope.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var elemBox=document.getElementsByClassName("activeField")[0].getBoundingClientRect();$scope.fieldTop=elemBox.top,$scope.fieldBottom=elemBox.bottom;var field_id,field_index;$scope.noscroll||($scope.selected.index===$scope.myform.visible_form_fields.length-1&&$scope.fieldBottom<200?(field_index=$scope.selected.index+1,field_id="submit_field",$scope.setActiveField(field_id,field_index,!1)):$scope.selected.index===$scope.myform.visible_form_fields.length?$scope.fieldTop>200&&(field_index=$scope.selected.index-1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)):$scope.fieldBottom<0?(field_index=$scope.selected.index+1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)):0!==$scope.selected.index&&$scope.fieldTop>0&&(field_index=$scope.selected.index-1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)),$scope.$apply())};var getActiveField=function(){if(null===$scope.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===$scope.selected._id?$scope.myform.form_fields.length-1:$scope.selected.index};$scope.setActiveField=$rootScope.setActiveField=function(field_id,field_index,animateScroll){if(null!==$scope.selected&&$scope.selected._id!==field_id){$scope.selected._id=field_id,$scope.selected.index=field_index;var nb_valid=$filter("formValidity")($scope.myform);$scope.translateAdvancementData={done:nb_valid,total:form_fields_count,answers_not_completed:form_fields_count-nb_valid},animateScroll?($scope.noscroll=!0,setTimeout(function(){$document.scrollToElement(angular.element(".activeField"),-10,200).then(function(){$scope.noscroll=!1,setTimeout(function(){document.querySelectorAll(".activeField .focusOn").length?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input").length?document.querySelectorAll(".activeField input")[0].focus():document.querySelectorAll(".activeField .selectize-input")[0].focus()})})})):setTimeout(function(){document.querySelectorAll(".activeField .focusOn")[0]?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input")[0].focus()}),SendVisitorData.send($scope.myform,getActiveField(),TimeCounter.getTimeElapsed())}},$rootScope.nextField=$scope.nextField=function(){var selected_index,selected_id;$scope.selected.index<$scope.myform.visible_form_fields.length-1?(selected_index=$scope.selected.index+1,selected_id=$scope.myform.visible_form_fields[selected_index]._id,$rootScope.setActiveField(selected_id,selected_index,!0)):$scope.selected.index===$scope.myform.visible_form_fields.length-1&&(selected_index=$scope.selected.index+1,selected_id="submit_field",$rootScope.setActiveField(selected_id,selected_index,!0))},$rootScope.prevField=$scope.prevField=function(){if($scope.selected.index>0){var selected_index=$scope.selected.index-1,selected_id=$scope.myform.visible_form_fields[selected_index]._id;$scope.setActiveField(selected_id,selected_index,!0)}},$scope.exitStartPage=function(){$scope.myform.startPage.showStart=!1,$scope.myform.visible_form_fields.length>0&&($scope.selected._id=$scope.myform.visible_form_fields[0]._id)},$rootScope.goToInvalid=$scope.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()},$rootScope.submitForm=$scope.submitForm=function(){var _timeElapsed=TimeCounter.stopClock();$scope.loading=!0;var form=_.cloneDeep($scope.myform);form.timeElapsed=_timeElapsed,form.percentageComplete=$filter("formValidity")($scope.myform)/$scope.myform.visible_form_fields.length*100,delete form.visible_form_fields;for(var i=0;i<$scope.myform.form_fields.length;i++)"dropdown"!==$scope.myform.form_fields[i].fieldType||$scope.myform.form_fields[i].deletePreserved||($scope.myform.form_fields[i].fieldValue=$scope.myform.form_fields[i].fieldValue.option_value);setTimeout(function(){$scope.submitPromise=$http.post("/forms/"+$scope.myform._id,form).success(function(data,status,headers){console.log($scope.myform.form_fields[0]),$scope.myform.submitted=!0,$scope.loading=!1,SendVisitorData.send($scope.myform,getActiveField(),_timeElapsed)}).error(function(error){$scope.loading=!1,console.error(error),$scope.error=error.message})},500)},$scope.reloadForm()}]}}]),angular.module("forms").service("CurrentForm",function(){var _form={};this.getForm=function(){return _form},this.setForm=function(form){_form=form}}),angular.module("forms").factory("Forms",["$resource","FORM_URL",function($resource,FORM_URL){return $resource(FORM_URL,{formId:"@_id"},{query:{method:"GET",isArray:!0},get:{method:"GET",transformResponse:function(data,header){var form=angular.fromJson(data);return form.visible_form_fields=_.filter(form.form_fields,function(field){return field.deletePreserved===!1}),form}},update:{method:"PUT"},save:{method:"POST"}})}]),angular.module("forms").service("TimeCounter",[function(){var _startTime,_endTime=null;this.timeSpent=0,this.restartClock=function(){_startTime=Date.now(),_endTime=null},this.getTimeElapsed=function(){if(_startTime)return Math.abs(Date.now().valueOf()-_startTime.valueOf())/1e3},this.stopClock=function(){return _startTime&&null===_endTime?(_endTime=Date.now(),this.timeSpent=Math.abs(_endTime.valueOf()-_startTime.valueOf())/1e3,this._startTime=this._endTime=null,this.timeSpent):new Error("Clock has not been started")},this.clockStarted=function(){return!!this._startTime}}]),angular.module("users").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{ACCESS_DENIED_TEXT:"You need to be logged in to access this page",USERNAME_LABEL:"Username",PASSWORD_LABEL:"Password",CURRENT_PASSWORD_LABEL:"Current Password",NEW_PASSWORD_LABEL:"New Password",VERIFY_PASSWORD_LABEL:"Verify Password",UPDATE_PASSWORD_LABEL:"Update Password",FIRST_NAME_LABEL:"First Name",LAST_NAME_LABEL:"Last Name",LANGUAGE_LABEL:"Language",EMAIL_LABEL:"Email",SIGNUP_HEADER_TEXT:"Sign up with your email",SIGNIN_HEADER_TEXT:"Sign in with your email or username",SIGNUP_ERROR_TEXT:"Couldn't complete registration due to errors",UPDATE_PROFILE_BTN:"Update Profile",PROFILE_SAVE_SUCCESS:"Profile saved successfully",PROFILE_SAVE_ERROR:"Could't Save Your Profile.",FORGOT_PASSWORD_LINK:"Forgot your password?",REVERIFY_ACCOUNT_LINK:"Resend your verification email",SIGNIN_BTN:"Sign in",SIGNUP_BTN:"Sign up",SAVE_PASSWORD_BTN:"Save Password",SUCCESS_HEADER:"Signup Successful",SUCCESS_TEXT:"Youve successfully registered an account at TellForm.",VERIFICATION_EMAIL_SENT:"A verification email has been sent to",NOT_ACTIVATED_YET:"But your account is not activated yet",BEFORE_YOU_CONTINUE:"Before you continue, make sure to check your email for our verification. If you dont receive it within 24h drop us a line at ",CHECK_YOUR_EMAIL:"Check your email and click on the activation link to activate your account. If you have any questions drop us a line at",PASSWORD_RESTORE_HEADER:"Restore your password",
ENTER_YOUR_EMAIL:"Enter your account email.",SUBMIT_BTN:"Submit",ASK_FOR_NEW_PASSWORD:"Ask for new password reset",PASSWORD_RESET_INVALID:"Password reset is invalid",PASSWORD_RESET_SUCCESS:"Passport successfully reset",PASSWORD_CHANGE_SUCCESS:"Passport successfully changed",CONTINUE_TO_LOGIN:"Continue to login page",VERIFY_SUCCESS:"Account successfully activated",VERIFY_ERROR:"Verification link is invalid or has expired"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("users").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{ACCESS_DENIED_TEXT:"Vouz nêtes pas autorisé à accéder à cette page.",USERNAME_LABEL:"Nom dutilisateur",PASSWORD_LABEL:"Mot de Passe",CURRENT_PASSWORD_LABEL:"Mot de passe actuel",NEW_PASSWORD_LABEL:"Nouveau Mot de Passe",VERIFY_PASSWORD_LABEL:"Vérifier le mot de passe",UPDATE_PASSWORD_LABEL:"Mettre à jour le mot de passe",FIRST_NAME_LABEL:"Prénom",LAST_NAME_LABEL:"Nom",LANGUAGE_LABEL:"Langue",EMAIL_LABEL:"Email",UPDATE_PROFILE_BTN:"Modifier le Profil",PROFILE_SAVE_SUCCESS:"Profil enregistré avec succès",PROFILE_SAVE_ERROR:"Erreur: impossible denregistrer votre Profile.",FORGOT_PASSWORD_LINK:"Mot de passe oublié ?",REVERIFY_ACCOUNT_LINK:"Re-envoyez un email de vérification",SIGNIN_BTN:"Connexion",SIGNUP_BTN:"Créer un compte",SAVE_PASSWORD_BTN:"Enregistrer votre nouveau Mot de Passe",SUCCESS_HEADER:"Votre Compte a été enregistré !",SUCCESS_TEXT:"Votre compte Tellform a été crée avec succès.",VERIFICATION_EMAIL_SENT:"Un email de verification a été envoyer à",NOT_ACTIVATED_YET:"Mais votre compte n'est pas activé",BEFORE_YOU_CONTINUE:"Avant de continuer, vous devez valider votre adresse mail. Merci de vérifier votre boite mail. Si vous ne lavez pas reçu dans les prochaines 24h, contactez-nous a ",CHECK_YOUR_EMAIL:"Vérifiez vos emails, et cliquez sur le lien de validation pour activer votre compte. Si vous avez une question contactez-nous à",PASSWORD_RESTORE_HEADER:"Mot de passe perdu",ENTER_YOUR_EMAIL:"Entrer votre email",SUBMIT_BTN:"Enregistrer",ASK_FOR_NEW_PASSWORD:"Demander un nouveau mot de pass ",PASSWORD_RESET_INVALID:"Le nouveau mot de passe est invalid",PASSWORD_RESET_SUCCESS:"Mot de passe réinitialisé avec succès",PASSWORD_CHANGE_SUCCESS:"Mot de passe enregistré avec succès",CONTINUE_TO_LOGIN:"Allez à la page de connexion",VERIFY_SUCCESS:"Votre compte est activé !",VERIFY_ERROR:"Le lien de vérification est invalide ou à expiré"})}]);
=======
>>>>>>> logic_jump
"use strict";function removeDateFieldsFunc(o){function eachObject(v,k){"lastModified"!==k&&"created"!==k||delete clone[k]}for(var clone=_.clone(o),i=0;i<clone.length;i++)_.each(clone[i],eachObject);return clone}var ApplicationConfiguration=function(){var applicationModuleName="NodeForm",applicationModuleVendorDependencies=["duScroll","ui.select","cgBusy","ngSanitize","vButton","ngResource","NodeForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate","ng.deviceDetector"],registerModule=function(moduleName,dependencies){angular.module(moduleName,dependencies||[]),angular.module(applicationModuleName).requires.push(moduleName)};return{applicationModuleName:applicationModuleName,applicationModuleVendorDependencies:applicationModuleVendorDependencies,registerModule:registerModule}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function($locationProvider){$locationProvider.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("NodeForm.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("modules/core/views/header.client.view.html",'<section class="navbar navbar-inverse" data-ng-controller=HeaderController ng-hide=hideNav><div class=container><div class=navbar-header><button class=navbar-toggle type=button data-ng-click=toggleCollapsibleMenu()><span class=sr-only>Toggle navigation</span> <span>{{ \'MENU_BTN\' | translate }}</span></button> <a href="https://www.tellform.com/#!/" class=navbar-brand><img src=/static/modules/core/img/logo_white.svg height=100%></a></div><nav class="collapse navbar-collapse" collapse=!isCollapsed role=navigation><ul class="nav navbar-nav" data-ng-if=authentication.isAuthenticated()><li data-ng-repeat="item in menu.items | orderBy: \'position\'" data-ng-if=item.shouldRender(authentication.isAuthenticated()); ng-switch=item.menuItemType ui-route={{item.uiRoute}} class={{item.menuItemClass}} ng-class="{active: ($uiRoute)}" dropdown="item.menuItemType === \'dropdown\'"><a ng-switch-when=dropdown class=dropdown-toggle dropdown-toggle><span data-ng-bind=item.title></span> <b class=caret></b></a><ul ng-switch-when=dropdown class=dropdown-menu><li data-ng-repeat="subitem in item.items | orderBy: \'position\'" data-ng-if=subitem.shouldRender(authentication.isAuthenticated()); ui-route={{subitem.uiRoute}} ng-class="{active: $uiRoute}"><a href=/#!/{{subitem.link}} data-ng-bind=subitem.title></a></li></ul><a ng-switch-default href=/#!/{{item.link}} data-ng-bind=item.title></a></li></ul><ul class="nav navbar-nav navbar-right" data-ng-hide=authentication.isAuthenticated()><li ng-hide=$root.signupDisabled ui-route=/signup ng-class="{active: $uiRoute}"><a href=/#!/signup>{{ \'SIGNUP_TAB\' | translate }}</a></li><li class=divider-vertical></li><li ui-route=/signin ng-class="{active: $uiRoute}"><a href=/#!/signin>{{ \'SIGNIN_TAB\' | translate }}</a></li></ul><ul class="nav navbar-nav navbar-right" data-ng-show=authentication.isAuthenticated()><li class=dropdown uib-dropdown><a href=# class=dropdown-toggle data-toggle=dropdown dropdown-toggle><span>{{ \'MY_SETTINGS\' | translate }}</span> <b class=caret></b></a><ul class=dropdown-menu><li><a href=/#!/settings/profile>{{ \'EDIT_PROFILE\' | translate }}</a></li><li class=divider></li><li><a href=/#!/settings/password>{{ \'CHANGE_PASSWORD\' | translate }}</a></li></ul></li><li><a href="/" ng-click=signout()>{{ \'SIGNOUT_TAB\' | translate }}</a></li></ul></nav></div></section>'),$templateCache.put("modules/forms/admin/views/admin-form.client.view.html",'<header data-ng-include="\'/static/modules/core/views/header.client.view.html\'"></header><div class=container cg-busy="{promise:updatePromise,templateUrl:\'modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html\',message:\'Updating form...\', backdrop:false, wrapperClass:\'.busy-updating-wrapper\'}"></div><section class="container admin-form"><script type=text/ng-template id=myModalContent.html><div class="modal-header">\n <h2 class="modal-title hidden-md hidden-lg">{{ \'ARE_YOU_SURE\' | translate }}</h2>\n <h3 class="modal-title hidden-xs hidden-sm">{{ \'ARE_YOU_SURE\' | translate }}</h3>\n </div>\n <div class="modal-body">\n \t<div class="modal-body-alert">\n\t\t\t\t{{ \'READ_WARNING\' | translate }}\n\t\t\t</div>\n \t\t<p class="hidden-xs hidden-sm">\n \t\t \t{{ \'DELETE_WARNING1\' | translate }}<strong>{{myform.title}}</strong> {{ \'DELETE_WARNING2\' | translate }}\n \t\t</p>\n <p>{{ \'DELETE_CONFIRM\' | translate }}</p>\n </div>\n <div class="modal-footer">\n\t <p>\n\t\t\t\t<input type="text" data-ng-model="deleteConfirm" class="input-block" autofocus required aria-label="Type in the name of the form to confirm that you want to delete this form.">\n\t\t\t</p>\n <button type="submit" ng-click="removeCurrentForm()" class="btn btn-block btn-danger" ng-disabled="myform.title != deleteConfirm">\n \t{{ \'I_UNDERSTAND\' | translate }}\n </button>\n </div></script><div class="page-header row-fluid" style="padding-bottom: 1em"><div class="col-xs-10 col-sm-8"><h1 class="hidden-sm hidden-xs" data-ng-bind=myform.title style="margin-bottom: 0px"></h1><h2 class="hidden-md hidden-lg" data-ng-bind=myform.title style="margin-bottom: 0px"></h2></div><div class="col-xs-1 col-sm-2"><small class=pull-right><button class="btn btn-danger" ng-click=openDeleteModal()><i class="fa fa-trash-o"></i> <span class="show-sm hidden-lg hidden-md hidden-xs">{{ \'DELETE_FORM_SM\' | translate}}</span> <span class="hidden-xs hidden-sm">{{ \'DELETE_FORM_MD\' | translate}}</span></button></small></div><div class="col-xs-1 col-sm-2"><small class=pull-right><a class="btn btn-default view-form-btn" href=//{{formURL}}/#!/forms/{{myform._id}}><span class="hidden-xs hidden-sm">{{ \'VIEW\' | translate }} <span ng-show=myform.isLive>{{ \'LIVE\' | translate }}</span> <span ng-hide=myform.isLive>{{ \'PREVIEW\' | translate }}</span> {{ \'FORM\' | translate }}</span> <span class="hidden-xs hidden-md hidden-lg">View <span ng-if=myform.isLive>{{ \'LIVE\' | translate }}</span> <span ng-if=!myform.isLive>{{ \'PREVIEW\' | translate }}</span></span> <i class="status-light status-light-on fa fa-dot-circle-o" ng-if=myform.isLive></i> <i class="status-light status-light-off fa fa-dot-circle-o" ng-if=!myform.isLive></i></a></small></div></div><div class=row-fluid><div class=col-xs-12><tabs data=tabData></tabs></div><div class=col-xs-12><ui-view></ui-view></div></div></section>'),$templateCache.put("modules/forms/admin/views/list-forms.client.view.html",'<header data-ng-include="\'/static/modules/core/views/header.client.view.html\'"></header><section class=overlay ng-if=showCreateModal ng-click=closeCreateModal()></section><section data-ng-controller="ListFormsController as ctrl" data-ng-init=findAll() class=container><br><div class=row><div ng-click=openCreateModal() class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item create-new"><div class="title-row col-xs-12"><h4 class="fa fa-plus fa-6"></h4></div><div class="col-xs-12 details-row"><small class=list-group-item-text>{{ \'CREATE_A_NEW_FORM\' | translate }}</small></div></div><form name=forms.createForm class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item create-new new-form" ng-if=showCreateModal><div class="title-row row"><div class="col-xs-5 field-title text-left">Name</div><div class="col-xs-12 field-input"><input name=title required ng-model=formTitle ng-pattern=languageRegExp ng-minlength=4 style="color:black"></div></div><div class="details-row row"><div class="col-xs-5 field-title text-left">Language</div><div class="col-xs-12 field-input"><div class="button custom-select"><select style=color:black name=language required ng-model=formLanguage ng-init="formLanguage = user.language"><option ng-repeat="language in languages" value={{language}}>{{language}}</option></select></div></div></div><div class="details-row submit row"><div class="col-xs-12 field-title text-center"><button class="btn btn-primary" ng-disabled=forms.createForm.$invalid ng-click=createNewForm()>{{ \'CREATE_FORM\' | translate }}</button></div></div></form><div data-ng-repeat="form in myforms" ng-style="{ \'background-color\': form.design.colors.backgroundColor, \'color\': form.design.colors.answerColor }" class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item container"><div class=row><span class=pull-right><i style=cursor:pointer class="fa fa-trash-o" ng-click=removeForm($index)></i> <i style=cursor:pointer class="fa fa-files-o" ng-click=duplicateForm($index)></i></span></div><div class=row><a data-ng-href=#!/forms/{{form._id}}/admin/create ng-style="{ \'color\': form.design.colors.answerColor }" class="title-row col-xs-12"><h4 class=list-group-item-heading data-ng-bind=form.title></h4></a></div><div class="row footer"><div class="col-xs-12 details-row"><small class=list-group-item-text>{{ \'CREATED_ON\' | translate }} <span data-ng-bind="form.created | date:\'shortDate\'"></span></small></div></div></div></div></section>'),$templateCache.put("modules/forms/base/views/submit-form.client.view.html","<section class=public-form ng-style=\"{ 'background-color': myform.design.colors.backgroundColor }\"><submit-form-directive myform=myform></submit-form-directive></section><script ng-if=myform.analytics.gaCode>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n\tga('create', '{{myform.analytics.gaCode}}', 'auto');\n\tga('send', 'pageview');</script>"),$templateCache.put("modules/forms/admin/views/adminTabs/analyze.html","<edit-submissions-form-directive myform=myform user=user></edit-submissions-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/configure.html","<configure-form-directive myform=myform user=user></configure-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/create.html","<edit-form-directive myform=myform></edit-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/design.html",'<div class="config-form design container"><div class=row><div class="col-md-12 container"><div class=row><div class=col-sm-12><h2 class="hidden-sm hidden-xs">{{ \'DESIGN_HEADER\' | translate }}</h2><h3 class="hidden-lg hidden-md">{{ \'DESIGN_HEADER\' | translate }}</h3></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BACKGROUND_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.backgroundColor ng-style="{ \'background-color\': myform.design.colors.backgroundColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'QUESTION_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.questionColor ng-style="{ \'background-color\': myform.design.colors.questionColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'ANSWER_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.answerColor ng-style="{ \'background-color\': myform.design.colors.answerColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BTN_BACKGROUND_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.buttonColor ng-style="{ \'background-color\': myform.design.colors.buttonColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BTN_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.buttonTextColor ng-style="{ \'background-color\': myform.design.colors.buttonTextColor }"></div></div></div></div><div class=row><div class="col-sm-offset-4 col-sm-2"><button class="btn btn-primary btn-large" type=button ng-click="update(false, null)"><i class="icon-arrow-left icon-white"></i> Save Changes</button></div><div class=col-sm-1><button class="btn btn-default" type=button ng-click=resetForm()><i class="icon-eye-open icon-white"></i> Cancel</button></div></div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeA.html",'<div><div style="text-align:center;font-size:26px;position:absolute;top:100px;width:100%;text-shadow:1px 1px 2px white, -1px -1px 2px white,-4px 4px 4px white,-4px 4px 4px white">{{$message}}</div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html",'<div><div style="text-align: center; font-size: 20px;position: fixed; bottom: 0; right: 55px; background-color: gray; color: white; padding: 5px 15px 5px 10px; z-index: 10">{{$message}}</div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",'<div class="config-form container"><div class=row><div class="col-sm-12 container-fluid"><div class=row><div class=col-sm-12><h2 class="hidden-sm hidden-xs">{{ \'ADVANCED_SETTINGS\' | translate }}</h2><h3 class="hidden-lg hidden-md">{{ \'ADVANCED_SETTINGS\' | translate }}</h3></div></div><div class="row field"><div class="field-title col-sm-4"><h5>{{ \'FORM_NAME\' | translate }}</h5></div><div class=col-sm-8><input ng-model=myform.title value={{myform.title}} style="width: 100%" ng-minlength=4 ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class="row field"><div class="field-title col-sm-6"><h5>{{ \'FORM_STATUS\' | translate }}</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=true ng-model=myform.isLive ng-required=true style="background-color:#33CC00"> &nbsp;<span>{{ \'PUBLIC\' | translate }}</span></label><label><input type=radio data-ng-value=false ng-model=myform.isLive ng-required="true"> &nbsp;<span>{{ \'PRIVATE\' | translate }}</span></label></div></div><div class="row field"><div class="field-title col-sm-4"><h5>{{ \'GA_TRACKING_CODE\' | translate }}</h5></div><div class=col-sm-8><input ng-model=myform.analytics.gaCode value={{myform.analytics.gaCode}} style="width: 100%" ng-minlength=4 placeholder=UA-XXXXX-Y ng-pattern="/\\bUA-\\d{4,10}-\\d{1,4}\\b/"></div></div><div class="row field"><div class="col-xs-6 field-title">Language</div><div class="col-xs-4 field-input"><select ng-model=myform.language><option ng-repeat="language in languages" ng-selected="language == myform.language" value={{language}}>{{language}}</option></select><span class=required-error ng-show="field.required && !field.fieldValue">* required</span></div></div><div class="row field"><div class="field-title col-sm-6"><h5>{{ \'DISPLAY_FOOTER\' | translate }}</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=false ng-model=myform.hideFooter ng-required="true"> &nbsp;<span>{{ \'YES\' | translate }}</span></label><label><input type=radio data-ng-value=true ng-model=myform.hideFooter ng-required="true"> &nbsp;<span>{{ \'No\' | translate }}</span></label></div></div><div class="row field"><div class="field-title col-sm-6"><h5>Display Start Page?</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=true ng-model=myform.startPage.showStart ng-required=true style="background-color:#33CC00"> &nbsp;<span>{{ \'YES\' | translate }}</span></label><label><input type=radio data-ng-value=false ng-model=myform.startPage.showStart ng-required="true"> &nbsp;<span>{{ \'NO\' | translate }}</span></label></div></div></div></div><div class=row><div class="col-sm-offset-4 col-sm-2"><button class="btn btn-primary btn-large" type=button ng-click="update(false, null)"><i class="icon-arrow-left icon-white"></i>{{ \'SAVE_CHANGES\' | translate }}</button></div><div class=col-sm-1><button class="btn btn-default" type=button ng-click=resetForm()><i class="icon-eye-open icon-white"></i>{{ \'CANCEL\' | translate }}</button></div></div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",'<form class="row container" name=editForm auto-save-form auto-save-watch=myform auto-save-callback=update><div class="col-xs-2 col-sm-4 col-md-4 add-field"><div class="row add-field-title"><h3 class="col-md-12 hidden-sm hidden-xs">{{ \'ADD_FIELD_LG\' | translate }}</h3><h4 class="col-sm-12 hidden-xs hidden-md hidden-lg">{{ \'ADD_FIELD_MD\' | translate }}</h4><h5 class="col-xs-12 hidden-sm hidden-md hidden-lg">{{ \'ADD_FIELD_SM\' | translate }}</h5></div><div class="panel-group row" class=draggable ng-model=addField.types><div class="col-xs-12 col-sm-12 col-md-6" ng-repeat="type in addField.types" style=padding-top:7.5px><div class="panel panel-default" style=background-color:#f5f5f5><div class=panel-heading ng-click="addNewField(true, type.name)" style="cursor: pointer; font-size:12px; padding-left: 10px; padding-right: 10px"><span><field-icon-directive type-name={{type.name}}></field-icon-directive></span> <span class=hidden-xs style=padding-left:0.3em>{{type.value}}</span></div></div></div></div></div><div class="col-xs-10 col-sm-8 current-fields container"><div class=row><div class=col-sm-12><div class="panel panel-default startPage"><div class="panel-heading accordion-toggle collapsed" data-toggle=collapse data-target=#collapseStart><h4 class=text-center>{{ \'WELCOME_SCREEN\' | translate }} <span class=pull-right><i class="fa fa-chevron-right" ng-hide=startPage.isOpen></i> <i class="fa fa-chevron-down" ng-show=startPage.isOpen></i></span></h4></div><div id=collapseStart class="panel-collapse collapse"><div class=panel-body><div class="row hidden-sm hidden-xs"><div class=col-md-12><h4>{{ \'PREVIEW_START_PAGE\' | translate }}</h4></div><ul class="col-md-12 container" style="list-style:none; border:2px lightgray solid; padding-bottom: 2em"><div class="field row"><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1>{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left" style="overflow-wrap: break-word"><p style=color:#ddd>{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.startPage.buttons" class=text-center style=display:inline><button class="btn btn-info" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none; color: inherit">{{button.text}}</a></button></p></div><div class="row form-actions"><button class="btn btn-info btn btn-info col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3" type=button><span style="color:white; font-size: 1.6em; text-decoration: none">{{myform.startPage.introButtonText}}</span></button></div></ul></div><div class=row><div class=col-xs-12><h4>{{ \'EDIT_START_PAGE\' | translate }}</h4><br></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_TITLE\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=myform.startPage.introTitle name=introTitleStartPage value={{myform.startPage.introTitle}} required></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_PARAGRAPH\' | translate }}:</div><div class="col-md-8 col-sm-12"><textarea type=text ng-model=myform.startPage.introParagraph name=introParagraphStartPage></textarea></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_BTN\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=myform.startPage.introButtonText name=introButtonText value={{myform.startPage.introButtonText}} required></div></div><div class=row><br><br></div><div class="row options buttons"><div class="col-md-3 col-xs-12">Buttons:</div><div class="col-md-9 col-xs-12"><div ng-repeat="button in myform.startPage.buttons track by button._id" class=row style=padding-bottom:1em><div class=col-xs-5><span>{{ \'BUTTON_TEXT\' | translate }}</span> <input name={{button.text}}_buttonText_startPage ng-model=button.text value={{button.text}} placeholder="Button Text"></div><div class=col-xs-5><span>{{ \'BUTTON_LINK\' | translate }}</span> <input name={{button.url}}_url_startPage ng-model=button.url value={{button.url}} placeholder=http://aeouaou.com/aoeuoa></div><div class=col-xs-2><a class="btn btn-danger btn-mini right" type=button ng-click=deleteButton(button)><i class="fa fa-trash-o"></i></a></div></div><div class=row><br></div><div class=row><button class="btn btn-primary btn-small col-md-offset-6 col-md-6 col-sm-4 col-sm-offset-8 col-xs-4 col-xs-offset-8" type=button ng-click=addButton()><i class="icon-plus icon-white"></i> {{ \'ADD_BUTTON\' | translate }}</button></div></div></div></div></div></div></div></div><div class=row><div class=col-sm-12><hr></div></div><div class=row><div class="col-sm-12 col-md-10 dropzoneContainer"><accordion close-others=accordion.oneAtATime ui-sortable=sortableOptions ng-model=myform.form_fields class=dropzone><accordion-group ng-repeat="field in myform.form_fields track by field._id" is-open=accordion[$index].isOpen on-finish-render=editFormFields ng-if=!field.deletePreserved><accordion-heading><div class=handle><span class=col-xs-1 ng-switch=field.fieldType><field-icon-directive type-name={{field.fieldType}}></field-icon-directive></span> <span class=col-xs-10>{{field.title}} <span ng-show=field.required>*</span></span> <span class=pull-right><i class="fa fa-chevron-right" ng-hide=accordion[$index].isOpen></i> <i class="fa fa-chevron-down" ng-show=accordion[$index].isOpen></i></span></div></accordion-heading><div class="accordion-edit container"><div class="row hidden-sm hidden-xs"><div class=col-md-12><h4>{{ \'PREVIEW_FIELD\' | translate }}</h4></div><ul class="col-md-12 container" style="list-style:none;border:2px lightgray solid"><field-directive field=field validate=false></field-directive></ul><hr></div><div class=row><div class=col-xs-12><h4>{{ \'EDIT_FIELD\' | translate }}</h4><br></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'QUESTION_TITLE\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=field.title name=title{{field._id}} value={{field.title}} required></div></div><div class=row><br></div><div class="row description" ng-hide=showRatingOptions(field)><div class="col-md-4 col-sm-12">{{ \'QUESTION_DESCRIPTION\' | translate }}:</div><div class="col-md-8 col-sm-12"><textarea type=text ng-model=field.description name=description{{field._id}} value={{field.description}}></textarea></div></div><div class=row ng-show=showAddOptions(field)><br></div><div class="row options" ng-if=showAddOptions(field)><div class="col-md-4 col-xs-12">{{ \'OPTIONS\' | translate }}:</div><div class="col-md-8 col-xs-12"><div ng-repeat="option in field.fieldOptions track by option.option_id" class=row><input name={{option.option_value}}{{field._id}} ng-model=option.option_value class=col-xs-5> <a class="btn btn-danger btn-mini right" type=button ng-click="deleteOption($index, option)" class=col-xs-3><i class="fa fa-trash-o"></i></a></div><div class=row><button class="btn btn-primary btn-small col-md-offset-0 col-md-6 col-sm-4 col-sm-offset-4 col-xs-6 col-xs-offset-6" type=button ng-click=addOption($index)><i class="icon-plus icon-white"></i> {{ \'ADD_OPTION\' | translate }}</button></div></div></div><div class=row ng-show=showRatingOptions(field)><br></div><div class=row ng-if=showRatingOptions(field)><div class="col-md-9 col-sm-9">{{ \'NUM_OF_STEPS\' | translate }}</div><div class="col-md-3 col-sm-3"><input style=width:100% type=number min=1 max=10 ng-model=field.ratingOptions.steps name=ratingOptions_steps{{field._id}} ng-value={{field.ratingOptions.steps}} required></div><br><div class="col-md-5 col-sm-9">Shape:</div><div class="col-md-7 col-sm-3"><select style=width:100% ng-model=field.ratingOptions.shape value={{field.ratingOptions.steps}} name=ratingOptions_shape{{field._id}} required><option ng-repeat="shapeType in field.ratingOptions.validShapes" value={{shapeType}}>{{select2FA[shapeType]}}</option></select></div></div><div class=row><br></div><div class=row><div class="col-md-4 col-xs-12 field-title">Required:</div><div class="col-md-8 col-xs-12 field-input"><label class="btn col-xs-5"><input type=radio ng-value=true ng-model=field.required name="required{{field._id}}"> <span>&nbsp; {{ \'YES\' | translate }}</span></label><label class="btn col-xs-5 col-xs-offset-1"><input type=radio ng-value=false ng-model=field.required name="required{{field._id}}"> <span>&nbsp; {{ \'NO\' | translate }}</span></label></div></div><div class=row><div class="col-md-4 col-xs-12 field-input">Disabled:</div><div class="col-md-8 col-xs-12 field-input"><label class="btn col-xs-5"><input type=radio ng-value=true ng-model=field.disabled name="disabled{{field._id}}"> <span>&nbsp; {{ \'YES\' | translate }}</span></label><label class="btn col-xs-5 col-xs-offset-1"><input type=radio ng-value=false ng-model=field.disabled name="disabled{{field._id}}"> <span>&nbsp; {{ \'NO\' | translate }}</span></label></div></div></div></accordion-group><div class="panel panel-default" style="border-style: dashed; border-color: #a9a9a9"><div class=panel-heading><h4 class="panel-title text-center" style="color: #a9a9a9">{{ \'CLICK_FIELDS_FOOTER\' | translate }}</h4></div></div><hr></accordion></div><div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px"><div class="panel-group tool-panel text-center"><div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if=!field.deletePreserved><div class=panel-heading style="padding: 10px 10px; height: 37px" ng-click=deleteField($index)><span class=text-center><a href="" class="fa fa-trash-o"></a></span></div></div></div></div><div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px"><div class="panel-group tool-panel text-center"><div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if=!field.deletePreserved><div class=panel-heading style="padding: 10px 10px; height: 37px" ng-click=duplicateField($index)><span class=text-center><a href="" class="fa fa-files-o"></a></span></div></div></div></div></div></div></form>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html",'<div class="submissions-table row container"><div class="row text-center analytics"><div class="row col-xs-12 header-numbers">Overview Analytics</div><div class="row col-xs-12 header-title"><div class=col-xs-3>{{ \'TOTAL_VIEWS\' | translate }}</div><div class=col-xs-3>{{ \'RESPONSES\' | translate }}</div><div class=col-xs-3>{{ \'COMPLETION_RATE\' | translate }}</div><div class=col-xs-3>{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div></div><div class="row col-xs-12 header-numbers"><div class=col-xs-3>{{myform.analytics.views}}</div><div class=col-xs-3>{{myform.analytics.submissions}}</div><div class=col-xs-3>{{myform.analytics.conversionRate | number:0}}%</div><div class=col-xs-3>{{AverageTimeElapsed | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class="row col-xs-12 header-numbers">Device Analytics</div><div class="row col-xs-12 detailed-title"><div class=col-xs-3>{{ \'DESKTOP_AND_LAPTOP\' | translate }}</div><div class=col-xs-3>{{ \'TABLETS\' | translate }}</div><div class=col-xs-3>{{ \'PHONES\' | translate }}</div><div class=col-xs-3>{{ \'OTHER\' | translate }}</div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.other.visits}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.phone.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.other.responses}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.phone.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.other.completion}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.phone.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.other.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div></div><div class="row col-xs-12 text-center" style=font-size:5em>Field Analytics</div><div class="row col-xs-12 field-title-row"><div class=col-xs-3><strong>{{ \'FIELD_TITLE\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_VIEWS\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_RESPONSES\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_DROPOFF\' | translate }}</strong></div></div><div class="row col-xs-12 field-detailed-row" ng-repeat="fieldStats in myform.analytics.fields"><div class=col-xs-3>{{fieldStats.field.title}}</div><div class=col-xs-3>{{fieldStats.totalViews}}</div><div class=col-xs-3>{{fieldStats.responses}}</div><div class=col-xs-3>{{fieldStats.continueRate}}%</div></div></div><br><div class="row col-xs-12 header-numbers text-center" style=font-size:5em>Responses Table</div><div class="row table-tools"><div class=col-xs-2><button class="btn btn-danger" ng-click=deleteSelectedSubmissions() ng-disabled=!isAtLeastOneChecked();><i class="fa fa-trash-o"></i> {{ \'DELETE_SELECTED\' | translate }}</button></div><div class="col-xs-2 col-xs-offset-4 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'xml\')"><small>{{ \'EXPORT_TO_EXCEL\' | translate }}</small></button></div><div class="col-md-2 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'csv\')"><small>{{ \'EXPORT_TO_CSV\' | translate }}</small></button></div><div class="col-md-2 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'json\')"><small>{{ \'EXPORT_TO_JSON\' | translate }}</small></button></div></div><div class="row table-outer"><div class=col-xs-12><table id=table-submission-data class="table table-striped table-hover table-condensed"><thead><tr><th><input ng-model=table.masterChecker ng-change=toggleAllCheckers() type="checkbox"></th><th>#</th><th data-ng-repeat="(key, value) in myform.form_fields">{{value.title}}</th><th>{{ \'PERCENTAGE_COMPLETE\' | translate }}</th><th>{{ \'TIME_ELAPSED\' | translate }}</th><th>{{ \'DEVICE\' | translate }}</th><th>{{ \'LOCATION\' | translate }}</th><th>{{ \'IP_ADDRESS\' | translate }}</th><th>{{ \'DATE_SUBMITTED\' | translate }} (UTC)</th><th ng-if=myform.autofillPDFs>{{ \'GENERATED_PDF\' | translate }}</th></tr></thead><tbody><tr data-ng-repeat="row in table.rows" ng-click=rowClicked($index) ng-class="{selected: row.selected === true}"><td><input ng-model=row.selected type="checkbox"></td><th class=scope>{{$index+1}}</th><td data-ng-repeat="field in row.form_fields">{{field.fieldValue}}</td><td>{{row.percentageComplete}}%</td><td>{{row.timeElapsed | secondsToDateTime | date:\'mm:ss\'}}</td><td>{{row.device.name}}, {{row.device.type}}</td><td>{{row.geoLocation.city}}, {{row.geoLocation.country_name}}</td><td>{{row.ipAddr}}</td><td>{{row.created | date:\'yyyy-MM-dd HH:mm:ss\'}}</td><td ng-if=row.pdf><a href={{row.pdfFilePath}} download={{row.pdf.name}} target=_self>{{ \'GENERATED_PDF\' | translate }}</a></td></tr></tbody></table></div></div></div>'),
$templateCache.put("modules/forms/base/views/directiveViews/entryPage/startPage.html",'<div class="field row text-center"><div class="col-xs-12 text-center"><h1>{{pageData.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left"><p style=color:#ddd>{{pageData.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in pageData.buttons" class=text-center style=display:inline><button class="btn btn-info" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none; color: inherit">{{button.text}}</a></button></p></div><div class="row form-actions"><p class="col-xs-3 col-xs-offset-3 text-center"><button class="btn btn-info" type=button><a ng-click=exitpageData() style="color:white; font-size: 1.6em; text-decoration: none">{{ \'CONTINUE_FORM\' | translate }}</a></button></p></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/date.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show="!field.required && !field.fieldValue">{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div class="control-group input-append"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" ng-class="{ \'no-border\': !!field.fieldValue }" ui-date=dateOptions ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled placeholder=MM/DD/YYYY ng-focus="setActiveField(field._id, index, true)" on-tab-key=nextField() on-tab-and-shift-key=prevField() ng-change=$root.nextField()></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/dropdown.html",'<div class="field row dropdown" ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><ui-select ng-model=field.fieldValue theme=selectize search-enabled=true search-by=option_value set-search-to-answer=true ng-required=field.required ng-disabled=field.disabled on-tab-and-shift-key=prevField() on-tab-key=nextField() ng-change=$root.nextField()><ui-select-match placeholder="Type or select an option"></ui-select-match><ui-select-choices repeat="option in field.fieldOptions | filter: $select.search" ng-class="{\'active\': option.option_value === field.fieldValue }"><span ng-bind-html="option.option_value | highlight: $select.search"></span></ui-select-choices></ui-select></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/file.html",'<div class="field row" ng-if=form.autofillPDFs ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3></div><div class="col-sm-8 field-input"><div class=input-group><div tabindex=-1 class="form-control file-caption"><span class=file-caption-ellipsis ng-if=!form.pdf>…</span><div class=file-caption-name ng-if=form.pdf>{{field.file.originalname}}</div></div><div class=input-group-btn><button type=button ng-if=field.file ng-click=removeFile(field); title="Clear selected files" class="btn btn-danger fileinput-remove fileinput-remove-button"><i class="glyphicon glyphicon-trash"></i> {{ \'DELETE\' | translate }}</button> <button type=button ng-if=field.fileLoading title="Abort ongoing upload" class="btn btn-default" ng-click=cancelFileUpload(field)><i class="glyphicon glyphicon-ban-circle"></i> {{ \'CANCEL\' | translate }}</button><div class="btn btn-success btn-file" ngf-select ngf-change=uploadPDF($files) ng-if=!field.file><i class="glyphicon glyphicon-upload"></i> {{ UPLOAD_FILE | translate }}</div></div></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/hidden.html",'<input ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=hidden ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value={{field.fieldValue}} ng-disabled=field.disabled>'),$templateCache.put("modules/forms/base/views/directiveViews/field/legal.html",'<div class="field row radio legal" on-enter-or-tab-key=nextField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><br><p class=col-xs-12>{{field.description}}</p></div><div class="col-xs-12 field-input container"><div class=row-fluid on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField()><label class="btn col-md-5 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'true\'}"><input class=focusOn ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=true ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"><div class=letter style=float:left>Y</div><span>{{ \'LEGAL_ACCEPT\' | translate }}</span></label><label class="btn col-md-5 col-md-offset-1 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'false\'}"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=false ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"><div class=letter style=float:left>N</div><span>{{ \'LEGAL_NO_ACCEPT\' | translate }}</span></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/radio.html",'<div class="field row radio" on-enter-or-tab-key=nextField() key-to-option field=field ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div ng-repeat="option in field.fieldOptions" class=row-fluid><label class="btn col-md-4 col-xs-12 col-sm-12" style="margin: 0.5em; padding-left:30px" ng-class="{activeBtn: field.fieldValue == field.fieldOptions[$index].option_value}"><div class=letter style=float:left>{{$index+1}}</div><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" style=visibility:hidden type=radio class=focusOn ng-focus="setActiveField(field._id, index, true)" value={{option.option_value}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"> <span ng-bind=option.option_value style="white-space: normal"></span></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/rating.html",'<div class="textfield field row" on-enter-or-tab-key=nextField()><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input-stars max={{field.ratingOptions.steps}} ng-init="field.fieldValue = 1" on-star-click=$root.nextField() icon-full={{field.ratingOptions.shape}} icon-base="fa fa-3x" icon-empty={{field.ratingOptions.shape}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)" class="angular-input-stars focusOn"></input-stars></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/statement.html",'<div class="statement field row" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)"><div class="row field-title field-title"><div class=col-xs-1><i class="fa fa-quote-left fa-1"></i></div><h2 class="text-left col-xs-9">{{field.title}}</h2><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="row field-title field-input"><p class=col-xs-12 ng-if=field.description.length>{{field.description}}</p><br><div class="col-xs-offset-1 col-xs-11"><button class="btn focusOn" ng-style="{\'font-size\': \'1.3em\', \'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-focused="setActiveField(field._id, index, true)" ng-click=$root.nextField()>{{ \'CONTINUE\' | translate }}</button></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/textarea.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><small>{{ \'NEWLINE\' | translate }}</small><p><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><small style=font-size:0.6em>Press SHIFT+ENTER to add a newline</small><textarea class="textarea focusOn" type=text ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-class="{ \'no-border\': !!field.fieldValue }" value={{field.fieldValue}} ng-required=field.required ng-disabled=field.disabled ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() style="border: none; border-left: lightgrey dashed 2px">\n\t\t</textarea></div></div><div><div class="btn btn-lg btn-default hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=$root.nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-sm-3 col-xs-6" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/textfield.html",'<div class="textfield field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title row-fluid" ng-style="{\'color\': design.colors.questionColor}"><h3 class=col-xs-12><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>({{ \'OPTIONAL\' | translate }})</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" name={{field.fieldType}}{{index}} type={{field.input_type}} ng-pattern=field.validateRegex placeholder={{field.placeholder}} ng-class="{ \'no-border\': !!field.fieldValue }" class="focusOn text-field-input" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value=field.fieldValue ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-required=field.required ng-disabled=field.disabled aria-describedby=inputError2Status></div><div class=col-xs-12><div ng-show="forms.myForm.{{field.fieldType}}{{index}}.$invalid && !!forms.myForm.{{field.fieldType}}{{index}}.$viewValue " class="alert alert-danger" role=alert><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>Error:</span> <span ng-if="field.fieldType == \'email\'">{{ \'ERROR_EMAIL_INVALID\' | translate }}</span> <span ng-if=field.validateRegex>{{ \'ERROR_NOT_A_NUMBER\' | translate }}</span> <span ng-if="field.fieldType == \'link\'">{{ \'ERROR_URL_INVALID\' | translate }}</span></div></div></div><div><div class="btn btn-lg btn-default hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=$root.nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-xs-6 col-sm-3" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/yes_no.html",'<div class="field row radio" ng-click="setActiveField(field._id, index, true)" on-tab-and-shift-key=prevField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3 class=row><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=row>{{field.description}}</p></div><div class="col-xs-12 field-input"><div class="row col-xs-12"><label class="btn btn-default" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=true class=focusOn style="opacity: 0; margin-left: 0px" ng-model=field.fieldValue ng-focus="setActiveField(field._id, index, true)" ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled="field.disabled"><div class=letter>{{ \'Y\' | translate }}</div><span>{{ \'YES\' | translate }}</span> <i ng-show="field.fieldValue === \'true\'" class="fa fa-check" aria-hidden=true></i></label></div><div class="row col-xs-12" style="margin-top: 10px"><label class="btn btn-default" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=false style="opacity:0; margin-left:0px" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled="field.disabled"><div class=letter>{{ \'N\' | translate }}</div><span>{{ \'NO\' | translate }}</span> <i ng-show="field.fieldValue === \'false\'" class="fa fa-check" aria-hidden=true></i></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'<section class="overlay submitform" ng-if="loading || (!myform.submitted && !myform.startPage.showStart)"></section><div ng-show="!myform.submitted && myform.startPage.showStart" class=form-submitted style="padding-top: 35vh"><div class=row><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1 style="font-weight: 400; nont-size: 25px">{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-center" style="overflow-wrap: break-word"><p style="color: grey; font-weight: 100; font-size: 16px">{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions text-center" style="padding: 5px 25px 5px 25px"><button ng-click=exitStartPage() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{myform.startPage.introButtonText}}</span></button></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.startPage.buttons" class=text-center style=display:inline><button class=btn style="background-color:rgb(156, 226, 235)" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none" ng-style="{\'color\':button.color}">{{button.text}}</a></button></p></div></div><div class=form-fields ng-show="!myform.submitted && !myform.startPage.showStart" ng-style="{ \'border-color\': myform.design.colors.buttonTextColor }"><div class=row><form name=forms.myForm novalidate class="submission-form col-sm-12 col-md-offset-1 col-md-10"><div ng-repeat="field in myform.form_fields" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} ng-class="{activeField: selected._id == field._id }" class="row field-directive"><field-directive field=field design=myform.design index=$index forms=forms></field-directive></div></form></div><div class="row form-actions" id=submit_field ng-class="{activeField: selected._id == \'submit_field\' }" ng-style="{ \'background-color\':myform.design.colors.buttonColor}" style="border-top: 1px solid #ddd; margin-right: -13%; margin-left: -13%; margin-top: 30vh; height: 100vh"><div class="col-xs-12 text-left" style="background-color:#990000; color:white" ng-if=forms.myForm.$invalid>{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}</div><button ng-if=!forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" v-busy=loading v-busy-label="Please wait" v-pressable ng-disabled="loading || forms.myForm.$invalid" ng-click=submitForm() on-enter-key=submitForm() on-enter-key-disabled="loading || forms.myForm.$invalid" ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" style="font-size: 1.6em; margin-left: 1em; margin-top: 1em">{{ \'SUBMIT\' | translate }}</button> <button ng-if=forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" ng-click=goToInvalid() on-enter-key=goToInvalid() on-enter-key-disabled=!forms.myForm.$invalid style="font-size: 1.6em; margin-left: 1em; margin-top: 1em; background-color:#990000; color:white">{{ \'REVIEW\' | translate }}</button><div class="col-sm-2 hidden-xs" style="font-size: 75%; margin-top:3.25em"><small>{{ \'ENTER\' | translate }}</small></div></div><section ng-if=!myform.hideFooter class="navbar navbar-fixed-bottom" ng-style="{ \'background-color\':myform.design.colors.buttonColor, \'padding-top\': \'15px\', \'border-top\': \'2px \'+ myform.design.colors.buttonTextColor +\' solid\', \'color\':myform.design.colors.buttonTextColor}"><div class=container-fluid><div class=row><div class="col-sm-5 col-md-6 col-xs-5" ng-show=!myform.submitted><p class=lead>{{ \'ADVANCEMENT\' | translate:translateAdvancementData }}</p></div><div class="col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row"><div class="col-md-4 col-md-offset-2 hidden-sm hidden-xs" ng-if=!authentication.isAuthenticated()><a href=/#!/forms class=btn ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}">{{ \'CREATE_FORM\' | translate }}</a></div><div class="col-md-4 col-md-offset-2 hidden-sm hidden-xs" ng-if=authentication.isAuthenticated()><a href=/#!/forms/{{myform._id}}/admin/create ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" class=btn>{{ \'EDIT_FORM\' | translate }}</a></div><div class="col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12 row"><button class="btn btn-lg col-xs-6" id=focusDownButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=nextField() ng-disabled="selected.index > myform.form_fields.length-1"><i class="fa fa-chevron-down"></i></button> <button class="btn btn-lg col-xs-6" id=focusUpButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=prevField() ng-disabled="selected.index == 0"><i class="fa fa-chevron-up"></i></button></div></div></div></div></section></div><div ng-if="myform.submitted && !loading" class=form-submitted ng-style="{\'color\':myform.design.colors.buttonTextColor}" style="padding-top: 5vh"><div class="field row text-center"><div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3 text-center">{{ \'FORM_SUCCESS\' | translate }}</div></div><div class="row form-actions"><p class=text-center><button ng-click=reloadForm() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{ \'BACK_TO_FORM\' | translate }}</span></button></p></div></div>'),$templateCache.put("modules/users/views/authentication/access-denied.client.view.html","<section class=\"text-center auth\"><h3 class=col-md-12>{{ 'ACCESS_DENIED_TEXT' | translate }}</h3><a href=/#!/sigin class=col-md-12>{{ 'SIGNIN_BTN' | translate }}</a></section>"),$templateCache.put("modules/users/views/authentication/signin.client.view.html",'<section class="auth sigin-view valign-wrapper" data-ng-controller=AuthenticationController><div class="row valign"><div class="col-md-4 col-md-offset-4"><div class="col-md-12 text-center" style="padding-bottom: 50px"><img src=/static/modules/core/img/logo_white.svg height=100px></div><div class=col-md-12><form class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=error class="text-center text-danger">Error: <strong data-ng-bind=error></strong></div><div class=form-group><input id=username name=username class=form-control data-ng-model=credentials.username placeholder="{{ \'USERNAME_LABEL\' | translate }}" ng-minlength=4></div><div class=form-group><input type=password id=password name=password class=form-control data-ng-model=credentials.password placeholder="{{ \'PASSWORD_LABEL\' | translate }}" ng-minlength=4></div><div class=form-group><button class="btn btn-signup" ng-click=signin()>{{ \'SIGNIN_BTN\' | translate }}</button></div><div class="text-center forgot-password"><a ui-sref=forgot>{{ \'FORGOT_PASSWORD_LINK\' | translate }}</a></div></fieldset></form></div></div><div class="text-center forgot-password col-md-12"><a ui-sref=signup>{{ \'SIGNUP_ACCOUNT_LINK\' | translate }}</a></div></div></section>'),$templateCache.put("modules/users/views/authentication/signup-success.client.view.html",'<section class="auth signup-view success" data-ng-controller=AuthenticationController><h3 class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6 text-center">{{ \'SUCCESS_HEADER\' | translate }}</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><h2>{{ \'SUCCESS_TEXT\' | translate }}<br><br>{{ \'NOT_ACTIVATED_YET\' | translate }}</h2><br><br><p><strong>{{ \'BEFORE_YOU_CONTINUE\' | translate }}</strong> <a href=mail:polydaic@gmail.com>polydaic@gmail.com</a></p><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary"><a href="/#!/" style="color: white; text-decoration: none">Continue</a></button></div></div></section>'),$templateCache.put("modules/users/views/authentication/signup.client.view.html",'<section class="auth signup-view valign-wrapper" data-ng-controller=AuthenticationController><div class="row valign"><div class="col-md-12 text-center vcenter" style="padding-bottom: 50px"><img src=/static/modules/core/img/logo_white.svg height=100px></div><div class="col-xs-offset-3 col-xs-6 col-sm-offset-4 col-sm-4"><form name=userForm data-ng-submit=signup() class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=error id=signup_errors class="text-center text-danger">{{\'SIGNUP_ERROR_TEXT\' | translate}}:<br><strong data-ng-bind=error></strong></div><div class=form-group><input id=username name=username class=form-control ng-pattern=languageRegExp ng-minlength=4 ng-model=credentials.username placeholder="{{ \'USERNAME_LABEL\' | translate }}" ng-minlength=4></div><div class=form-group><input type=email id=email name=email class=form-control ng-model=credentials.email placeholder="{{ \'EMAIL_LABEL\' | translate }}"></div><div class=form-group><input type=password id=password name=password class=form-control ng-model=credentials.password placeholder="{{ \'PASSWORD_LABEL\' | translate }}" ng-minlength=4></div><div class="text-center form-group"><button type=submit class="btn btn-signup">{{ \'SIGNUP_BTN\' | translate }}</button></div></fieldset></form><div class="text-center forgot-password"><a ui-sref=signin>{{ \'SIGN_IN_ACCOUNT_LINK\' | translate }}</a></div></div></div></section>'),$templateCache.put("modules/users/views/password/forgot-password.client.view.html",'<section class="auth row" data-ng-controller=PasswordController><h3 class="col-md-12 text-center">{{ \'PASSWORD_RESTORE_HEADER\' | translate }}</h3><p class="small text-center">{{ \'ENTER_YOUR_EMAIL\' | translate }}</p><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=askForPasswordReset() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><input id=username name=username class=form-control data-ng-model=credentials.username placeholder="{{ \'USERNAME_LABEL\' | translate }}"></div><div class="text-center form-group"><button type=submit class="btn btn-primary">{{ \'UPDATE_PASSWORD_LABEL\' | translate }}</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/password/reset-password-invalid.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_INVALID' | translate }}</h3><a href=/#!/password/forgot class=col-md-12>{{ 'ASK_FOR_NEW_PASSWORD' | translate }}</a></section>"),$templateCache.put("modules/users/views/password/reset-password-success.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_SUCCESS' | translate }}</h3><a href=\"/#!/\" class=col-md-12>{{ 'CONTINUE_TO_LOGIN' | translate }}</a></section>"),$templateCache.put("modules/users/views/password/reset-password.client.view.html",'<section class="row auth" data-ng-controller=PasswordController><h3 class="col-md-12 text-center">Reset your password</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resetUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="New Password"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="Verify Password"></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">Update Password</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/settings/change-password.client.view.html",'<header data-ng-include="\'/static/modules/core/views/header.client.view.html\'"></header><section class=row data-ng-controller=SettingsController><h3 class="col-md-12 text-center">Change your password</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=changeUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=currentPassword>Current Password</label><input type=password id=currentPassword name=currentPassword class=form-control data-ng-model=passwordDetails.currentPassword placeholder="Current Password"></div><hr><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="New Password"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="Verify Password"></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">{{ \'SAVE_PASSWORD_BTN\' | translate }}</button></div><div data-ng-show=success class="text-center text-success"><strong>{{ \'PASSWORD_CHANGE_SUCCESS\' | translate }}</strong></div><div data-ng-show=error class="text-center text-danger"><strong data-ng-bind=error></strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/settings/edit-profile.client.view.html",'<header data-ng-include="\'/static/modules/core/views/header.client.view.html\'"></header><section class=row data-ng-controller=SettingsController><h3 class="col-xs-offset-1 col-xs-10 text-center">Edit your profile</h3><div class="col-xs-offset-3 col-xs-6"><form name=userForm data-ng-submit=updateUserProfile(userForm.$valid) class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=success class="text-center text-success"><strong>{{ \'PROFILE_SAVE_SUCCESS\' | translate }}</strong></div><div data-ng-show=error class="text-center text-danger">{{ \'PROFILE_SAVE_ERROR\' | translate }}<br><strong data-ng-bind=error></strong></div><div class="form-group row"><div class="col-xs-7 field-title"><b>{{ \'FIRST_NAME_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><input id=firstName name=firstName class=form-control data-ng-model=user.firstName placeholder="First Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class="form-group row"><div class="col-xs-7 field-title"><b>Last Name</b></div><div class="col-xs-12 field-input"><input id=lastName name=lastName class=form-control data-ng-model=user.lastName placeholder="Last Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class=row><hr></div><div class="row form-group"><div class="col-xs-7 field-title"><b>{{ \'LANGUAGE_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><select ng-model=user.language required><option ng-repeat="language in languages" ng-selected="language == user.language" value={{language}}>{{language}}</option></select></div></div><div class="row form-group"><div class="col-xs-7 field-title"><b>Username</b></div><div class="col-xs-12 field-input"><input id=username name=username class=form-control data-ng-model=user.username placeholder=Username></div></div><div class="row form-group"><div class="col-xs-7 field-title"><b>{{ \'EMAIL_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><input type=email id=email name=email class=form-control data-ng-model=user.email placeholder=Email></div></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary" style=font-size:1.6em>{{ \'SUBMIT_BTN\' | translate }}</button></div></fieldset></form></div></section>'),
$templateCache.put("modules/users/views/settings/social-accounts.client.view.html",'<header data-ng-include="\'/static/modules/core/views/header.client.view.html\'"></header><section class=row data-ng-controller=SettingsController><h3 class="col-md-12 text-center" data-ng-show=hasConnectedAdditionalSocialAccounts()>Connected social accounts:</h3><div class="col-md-12 text-center"><div data-ng-repeat="(providerName, providerData) in user.additionalProvidersData" class=remove-account-container><img ng-src=/modules/users/img/buttons/{{providerName}}.png> <a class="btn btn-danger btn-remove-account" data-ng-click=removeUserSocialAccount(providerName)><i class="glyphicon glyphicon-trash"></i></a></div></div><h3 class="col-md-12 text-center">Connect other social accounts:</h3><div class="col-md-12 text-center"><a href=/auth/facebook data-ng-hide="isConnectedSocialAccount(\'facebook\')" class=undecorated-link><img src=/modules/users/img/buttons/facebook.png></a> <a href=/auth/twitter data-ng-hide="isConnectedSocialAccount(\'twitter\')" class=undecorated-link><img src=/modules/users/img/buttons/twitter.png></a> <a href=/auth/google data-ng-hide="isConnectedSocialAccount(\'google\')" class=undecorated-link><img src=/modules/users/img/buttons/google.png></a> <a href=/auth/linkedin data-ng-hide="isConnectedSocialAccount(\'linkedin\')" class=undecorated-link><img src=/modules/users/img/buttons/linkedin.png></a> <a href=/auth/github data-ng-hide="isConnectedSocialAccount(\'github\')" class=undecorated-link><img src=/modules/users/img/buttons/github.png></a></div></section>'),$templateCache.put("modules/users/views/verify/resend-verify-email.client.view.html",'<section class=auth data-ng-controller=VerifyController><section ng-if=!isResetSent><h3 class="col-md-12 text-center">Resend your account verification email</h3><p class="small text-center">Enter your account email.</p><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resendVerifyEmail() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><input id=email name=email class=form-control data-ng-model=credentials.email placeholder=bob@example.com></div><div class="text-center form-group"><button type=submit class="btn btn-primary" ng-click=resendVerifyEmail()>{{ \'SUBMIT_BTN\' | translate }}</button></div></fieldset></form></div></section><section ng-if=isResetSent><h3 class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6 text-center">Verification Email has been Sent</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><h2>{{ \'VERIFICATION_EMAIL_SENT\' | translate }} {{username}}.<br>{{ \'NOT_ACTIVATED_YET\' | translate }}</h2><p>{{ \'CHECK_YOUR_EMAIL\' | translate }} <a href=mail:polydaic@gmail.com>polydaic@gmail.com</a></p><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary"><a href="/#!/" style=color:white>Continue</a></button></div></div></section></section>'),$templateCache.put("modules/users/views/verify/verify-account.client.view.html","<section class=auth data-ng-controller=VerifyController ng-init=validateVerifyToken()><section class=\"row text-center\" ng-if=isResetSent><h3 class=col-md-12></h3><a href=/#!/signin class=col-md-12>{{ 'CONTINUE_TO_LOGIN' | translate }}</a></section><section class=\"row text-center\" ng-if=!isResetSent><h3 class=col-md-12>{{ 'VERIFY_ERROR' | translate }}</h3><a href=/#!/verify class=col-md-6>{{ 'REVERIFY_ACCOUNT_LINK' | translate }}</a> <a href=/#!/signin class=col-md-6>{{ 'SIGNIN_BTN' | translate }}</a></section></section>")}]),ApplicationConfiguration.registerModule("core",["users"]),ApplicationConfiguration.registerModule("forms",["ngFileUpload","ui.router.tabs","ui.date","ui.sortable","angular-input-stars","users"]),ApplicationConfiguration.registerModule("users"),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{PDF_GENERATION_EMR:"PDF Generation/EMR",SAVE_PDF_SUBMISSIONS:"Save Submissions as PDFs?",UPLOAD_YOUR_PDF:"Upload Your PDF Template",ADVANCED_SETTINGS:"Advanced Settings",FORM_NAME:"Form Name",FORM_STATUS:"Form Status",PUBLIC:"Public",PRIVATE:"Private",GA_TRACKING_CODE:"Google Analytics Tracking Code",DISPLAY_FOOTER:"Display Form Footer?",SAVE_CHANGES:"Save Changes",CANCEL:"Cancel",CREATE_A_NEW_FORM:"Create a new form",CREATE_FORM:"Create form",CREATED_ON:"Created on",ARE_YOU_SURE:"Are you ABSOLUTELY sure?",READ_WARNING:"Unexpected bad things will happen if you dont read this!",DELETE_WARNING1:"This action CANNOT be undone.This will permanently delete the",DELETE_WARNING2:"form, form submissions and remove all associated pdfs.",DELETE_CONFIRM:"Please type in the name of the form to confirm",I_UNDERSTAND:"I understand the consequences, delete this form",DELETE_FORM_SM:"Delete",DELETE_FORM_MD:"Delete Form",DELETE:"Delete",FORM:"Form",VIEW:"View",LIVE:"Live",PREVIEW:"Preview",ADD_FIELD_LG:"Click to Add New Field",ADD_FIELD_MD:"Add New Field",ADD_FIELD_SM:"Add Field",PREVIEW_START_PAGE:"Preview Welcome Screen",EDIT_START_PAGE:"Edit Welcome Screen",WELCOME_SCREEN:"Welcome Screen",INTRO_TITLE:"Intro Title",INTRO_PARAGRAPH:"Intro Paragraph",INTRO_BTN:"Intro Button",BUTTONS:"Buttons",BUTTON_TEXT:"Text",BUTTON_LINK:"Link",ADD_BUTTON:"Add Button",PREVIEW_FIELD:"Preview Field",EDIT_FIELD:"Edit Field",QUESTION_TITLE:"Question Title",QUESTION_DESCRIPTION:"Question Description",OPTIONS:"Options",ADD_OPTION:"Add Option",NUM_OF_STEPS:"Number of Steps",CLICK_FIELDS_FOOTER:"Click on fields to add them here",TOTAL_VIEWS:"total unique visits",RESPONSES:"responses",COMPLETION_RATE:"completion rate",AVERAGE_TIME_TO_COMPLETE:"avg. completion time",DESKTOP_AND_LAPTOP:"Desktops",TABLETS:"Tablets",PHONES:"Phones",OTHER:"Other",UNIQUE_VISITS:"Unique Visits",FIELD_TITLE:"Field Title",FIELD_VIEWS:"Field Views",FIELD_DROPOFF:"Field Completion",FIELD_RESPONSES:"Field Responses",DELETE_SELECTED:"Delete Selected",EXPORT_TO_EXCEL:"Export to Excel",EXPORT_TO_CSV:"Export to CSV",EXPORT_TO_JSON:"Export to JSON",PERCENTAGE_COMPLETE:"Percentage Complete",TIME_ELAPSED:"Time Elapsed",DEVICE:"Device",LOCATION:"Location",IP_ADDRESS:"IP Address",DATE_SUBMITTED:"Date Submitted",GENERATED_PDF:"Generated PDF",BACKGROUND_COLOR:"Background Color",DESIGN_HEADER:"Change how your Form Looks",QUESTION_TEXT_COLOR:"Question Text Color",ANSWER_TEXT_COLOR:"Answer Text Color",BTN_BACKGROUND_COLOR:"Button Background Color",BTN_TEXT_COLOR:"Button Text Color",CREATE_TAB:"Create",DESIGN_TAB:"Design",CONFIGURE_TAB:"Configure",ANALYZE_TAB:"Analyze"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{FORM_SUCCESS:"Form entry successfully submitted!",REVIEW:"Review",BACK_TO_FORM:"Go back to Form",EDIT_FORM:"Edit this TellForm",CREATE_FORM:"Create this TellForm",ADVANCEMENT:"{{done}} out of {{total}} answered",CONTINUE_FORM:"Continue to Form",REQUIRED:"required",COMPLETING_NEEDED:"{{answers_not_completed}} answer(s) need completing",OPTIONAL:"optional",ERROR_EMAIL_INVALID:"Please enter a valid email address",ERROR_NOT_A_NUMBER:"Please enter valid numbers only",ERROR_URL_INVALID:"Please a valid url",OK:"OK",ENTER:"press ENTER",YES:"Yes",NO:"No",NEWLINE:"press SHIFT+ENTER to create a newline",CONTINUE:"Continue",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I dont accept",DELETE:"Delete",CANCEL:"Cancel",SUBMIT:"Submit",UPLOAD_FILE:"Upload your File"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{FORM_SUCCESS:"Votre formulaire a été enregistré!",REVIEW:"Incomplet",BACK_TO_FORM:"Retourner au formulaire",EDIT_FORM:"Éditer le Tellform",CREATE_FORM:"Créer un TellForm",ADVANCEMENT:"{{done}} complétés sur {{total}}",CONTINUE_FORM:"Aller au formulaire",REQUIRED:"obligatoire",COMPLETING_NEEDED:"{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)",OPTIONAL:"facultatif",ERROR_EMAIL_INVALID:"Merci de rentrer une adresse mail valide",ERROR_NOT_A_NUMBER:"Merce de ne rentrer que des nombres",ERROR_URL_INVALID:"Merci de rentrer une url valide",OK:"OK",ENTER:"presser ENTRÉE",YES:"Oui",NO:"Non",NEWLINE:"presser SHIFT+ENTER pour créer une nouvelle ligne",CONTINUE:"Continuer",LEGAL_ACCEPT:"Jaccepte",LEGAL_NO_ACCEPT:"Je naccepte pas",DELETE:"Supprimer",CANCEL:"Réinitialiser",SUBMIT:"Enregistrer",UPLOAD_FILE:"Envoyer un fichier",Y:"O",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("de",{FORM_SUCCESS:"Ihre Angaben wurden gespeichert.",REVIEW:"Unvollständig",BACK_TO_FORM:"Zurück zum Formular",EDIT_FORM:"Bearbeiten Sie diese TellForm",CREATE_FORM:"Erstellen Sie eine TellForm",ADVANCEMENT:"{{done}} von {{total}} beantwortet",CONTINUE_FORM:"Zum Formular",REQUIRED:"verpflichtend",COMPLETING_NEEDED:"Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)",OPTIONAL:"fakultativ",ERROR_EMAIL_INVALID:"Bitte gültige Mailadresse eingeben",ERROR_NOT_A_NUMBER:"Bitte nur Zahlen eingeben",ERROR_URL_INVALID:"Bitte eine gültige URL eingeben",OK:"Okay",ENTER:"Eingabetaste drücken",YES:"Ja",NO:"Nein",NEWLINE:"Für eine neue Zeile SHIFT+ENTER drücken",CONTINUE:"Weiter",LEGAL_ACCEPT:"Ich akzeptiere",LEGAL_NO_ACCEPT:"Ich akzeptiere nicht",DELETE:"Entfernen",CANCEL:"Canceln",SUBMIT:"Speichern",UPLOAD_FILE:"Datei versenden",Y:"J",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("it",{FORM_SUCCESS:"Il formulario è stato inviato con successo!",REVIEW:"Incompleto",BACK_TO_FORM:"Ritorna al formulario",EDIT_FORM:"Modifica questo Tellform",CREATE_FORM:"Creare un TellForm",ADVANCEMENT:"{{done}} su {{total}} completate",CONTINUE_FORM:"Vai al formulario",REQUIRED:"obbligatorio",COMPLETING_NEEDED:"{{answers_not_completed}} risposta/e deve/ono essere completata/e",OPTIONAL:"opzionale",ERROR_EMAIL_INVALID:"Si prega di inserire un indirizzo email valido",ERROR_NOT_A_NUMBER:"Si prega di inserire solo numeri",ERROR_URL_INVALID:"Grazie per inserire un URL valido",OK:"OK",ENTER:"premere INVIO",YES:"Sì",NO:"No",NEWLINE:"premere SHIFT+INVIO per creare una nuova linea",CONTINUE:"Continua",LEGAL_ACCEPT:"Accetto",LEGAL_NO_ACCEPT:"Non accetto",DELETE:"Cancella",CANCEL:"Reset",SUBMIT:"Registra",UPLOAD_FILE:"Invia un file",Y:"S",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("es",{FORM_SUCCESS:"¡El formulario ha sido enviado con éxito!",REVIEW:"Revisar",BACK_TO_FORM:"Regresar al formulario",EDIT_FORM:"Crear un TellForm",CREATE_FORM:"Editar este TellForm",ADVANCEMENT:"{{done}} de {{total}} contestadas",CONTINUE_FORM:"Continuar al formulario",REQUIRED:"Información requerida",COMPLETING_NEEDED:"{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)",OPTIONAL:"Opcional",ERROR_EMAIL_INVALID:"Favor de proporcionar un correo electrónico válido",ERROR_NOT_A_NUMBER:"Por favor, introduzca sólo números válidos",ERROR_URL_INVALID:"Favor de proporcionar un url válido",OK:"OK",ENTER:"pulse INTRO",YES:"Si",NO:"No",NEWLINE:"presione SHIFT+INTRO para crear una nueva línea",CONTINUE:"Continuar",LEGAL_ACCEPT:"Acepto",LEGAL_NO_ACCEPT:"No acepto",DELETE:"Eliminar",CANCEL:"Cancelar",SUBMIT:"Registrar",UPLOAD_FILE:"Cargar el archivo",Y:"S",N:"N"})}]),angular.module("core").config(["$stateProvider","$urlRouterProvider",function($stateProvider,$urlRouterProvider,Authorization){$urlRouterProvider.otherwise("/forms")}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","$state","$stateParams",function($rootScope,Auth,$state,$stateParams){$rootScope.$state=$state,$rootScope.$stateParams=$stateParams,$rootScope.$on("$stateChangeSuccess",function(event,toState,toParams,fromState){$state.previous=fromState;var statesToIgnore=["home","signin","resendVerifyEmail","verify","signup","signup-success","forgot","reset-invalid","reset","reset-success"];statesToIgnore.indexOf(toState.name)>0?Auth.isAuthenticated()&&(event.preventDefault(),$state.go("listForms")):"access_denied"===toState.name||Auth.isAuthenticated()||"submitForm"===toState.name||(console.log("go to signup"),event.preventDefault(),$state.go("listForms"))})}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","User","Authorizer","$state","$stateParams",function($rootScope,Auth,User,Authorizer,$state,$stateParams){$rootScope.$on("$stateChangeStart",function(event,next){var authenticator,permissions,user;permissions=next&&next.data&&next.data.permissions?next.data.permissions:null,Auth.ensureHasCurrentUser(User),user=Auth.currentUser,user&&(authenticator=new Authorizer(user),null!==permissions&&(authenticator.canAccess(permissions)||(event.preventDefault(),$state.go("access_denied"))))})}]),angular.module("core").controller("HeaderController",["$rootScope","$scope","Menus","$state","Auth","User","$window","$translate","$locale",function($rootScope,$scope,Menus,$state,Auth,User,$window,$translate,$locale){$rootScope.signupDisabled=$window.signupDisabled,$scope.user=$rootScope.user=Auth.ensureHasCurrentUser(User),$scope.authentication=$rootScope.authentication=Auth,$rootScope.languages=$scope.languages=["en","fr","es","it","de"],console.log($locale.id),$scope.authentication.isAuthenticated()?$rootScope.language=$scope.user.language:$rootScope.language=$locale.id.substring(0,2),$translate.use($rootScope.language),$scope.isCollapsed=!1,$rootScope.hideNav=!1,$scope.menu=Menus.getMenu("topbar"),$scope.signout=function(){var promise=User.logout();promise.then(function(){Auth.logout(),Auth.ensureHasCurrentUser(User),$scope.user=$rootScope.user=null,$state.go("listForms"),$state.reload()},function(reason){console.error("Logout Failed: "+reason)})},$scope.toggleCollapsibleMenu=function(){$scope.isCollapsed=!$scope.isCollapsed},$scope.$on("$stateChangeSuccess",function(event,toState,toParams,fromState,fromParams){$scope.isCollapsed=!1,$rootScope.hideNav=!1,angular.isDefined(toState.data)&&angular.isDefined(toState.data.hideNav)&&($rootScope.hideNav=toState.data.hideNav)})}]),angular.module("core").service("Menus",[function(){this.defaultRoles=["*"],this.menus={};var shouldRender=function(user){if(!user)return this.isPublic;if(~this.roles.indexOf("*"))return!0;for(var userRoleIndex in user.roles)for(var roleIndex in this.roles)if(console.log(this.roles[roleIndex]),console.log(this.roles[roleIndex]===user.roles[userRoleIndex]),this.roles[roleIndex]===user.roles[userRoleIndex])return!0;return!1};this.validateMenuExistance=function(menuId){if(menuId&&menuId.length){if(this.menus[menuId])return!0;throw new Error("Menu does not exists")}throw new Error("MenuId was not provided")},this.getMenu=function(menuId){return this.validateMenuExistance(menuId),this.menus[menuId]},this.addMenu=function(menuId,isPublic,roles){return this.menus[menuId]={isPublic:isPublic||!1,roles:roles||this.defaultRoles,items:[],shouldRender:shouldRender},this.menus[menuId]},this.removeMenu=function(menuId){this.validateMenuExistance(menuId),delete this.menus[menuId]},this.addMenuItem=function(menuId,menuItemTitle,menuItemURL,menuItemType,menuItemUIRoute,isPublic,roles,position){return this.validateMenuExistance(menuId),this.menus[menuId].items.push({title:menuItemTitle,link:menuItemURL,menuItemType:menuItemType||"item",menuItemClass:menuItemType,uiRoute:menuItemUIRoute||"/"+menuItemURL,isPublic:null===isPublic||"undefined"==typeof isPublic?this.menus[menuId].isPublic:isPublic,roles:null===roles||"undefined"==typeof roles?this.menus[menuId].roles:roles,position:position||0,items:[],shouldRender:shouldRender}),this.menus[menuId]},this.addSubMenuItem=function(menuId,rootMenuItemURL,menuItemTitle,menuItemURL,menuItemUIRoute,isPublic,roles,position){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===rootMenuItemURL&&this.menus[menuId].items[itemIndex].items.push({title:menuItemTitle,link:menuItemURL,uiRoute:menuItemUIRoute||"/"+menuItemURL,isPublic:null===isPublic||"undefined"==typeof isPublic?this.menus[menuId].items[itemIndex].isPublic:isPublic,roles:null===roles||"undefined"==typeof roles?this.menus[menuId].items[itemIndex].roles:roles,position:position||0,shouldRender:shouldRender});return this.menus[menuId]},this.removeMenuItem=function(menuId,menuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===menuItemURL&&this.menus[menuId].items.splice(itemIndex,1);return this.menus[menuId]},this.removeSubMenuItem=function(menuId,submenuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)for(var subitemIndex in this.menus[menuId].items[itemIndex].items)this.menus[menuId].items[itemIndex].items[subitemIndex].link===submenuItemURL&&this.menus[menuId].items[itemIndex].items.splice(subitemIndex,1);return this.menus[menuId]},this.addMenu("topbar",!1,["*"]),this.addMenu("bottombar",!1,["*"])}]),function(){function Socket($timeout,$window){function connect(url){service.socket=io(url,{transports:["websocket","polling"]})}function emit(eventName,data){service.socket&&service.socket.emit(eventName,data)}function on(eventName,callback){service.socket&&service.socket.on(eventName,function(data){$timeout(function(){callback(data)})})}function removeListener(eventName){service.socket&&service.socket.removeListener(eventName)}var service={connect:connect,emit:emit,on:on,removeListener:removeListener,socket:null};return connect(window.location.protocol+"//"+window.location.hostname+":"+$window.socketPort),service}angular.module("core").factory("Socket",Socket),Socket.$inject=["$timeout","$window"]}(),angular.module("core").factory("subdomain",["$location",function($location){var host=$location.host();return host.indexOf(".")<0?null:host.split(".")[0]}]),angular.module("forms").run(["Menus",function(Menus){Menus.addMenuItem("topbar","My Forms","forms","","/forms",!1)}]).filter("secondsToDateTime",[function(){return function(seconds){return new Date(1970,0,1).setSeconds(seconds)}}]).filter("formValidity",function(){return function(formObj){if(formObj&&formObj.form_fields&&formObj.visible_form_fields){var formKeys=Object.keys(formObj),fields=(formKeys.filter(function(key){return"$"!==key[0]}),formObj.form_fields),valid_count=fields.filter(function(field){if("object"==typeof field&&"statement"!==field.fieldType&&"rating"!==field.fieldType)return!!field.fieldValue}).length;return valid_count-(formObj.form_fields.length-formObj.visible_form_fields.length)}return 0}}).config(["$provide",function($provide){$provide.decorator("accordionDirective",["$delegate",function($delegate){var directive=$delegate[0];return directive.replace=!0,$delegate}])}]),angular.module("forms").config(["$stateProvider",function($stateProvider){$stateProvider.state("listForms",{url:"/forms",templateUrl:"modules/forms/admin/views/list-forms.client.view.html"}).state("submitForm",{url:"/forms/:formId",templateUrl:"modules/forms/base/views/submit-form.client.view.html",data:{hideNav:!0},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(Forms,$stateParams){return Forms.get({formId:$stateParams.formId}).$promise}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("viewForm",{url:"/forms/:formId/admin",templateUrl:"modules/forms/admin/views/admin-form.client.view.html",data:{permissions:["editForm"]},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(Forms,$stateParams){return Forms.get({formId:$stateParams.formId}).$promise}]},controller:"AdminFormController"}).state("viewForm.configure",{url:"/configure",templateUrl:"modules/forms/admin/views/adminTabs/configure.html"}).state("viewForm.design",{url:"/design",templateUrl:"modules/forms/admin/views/adminTabs/design.html"}).state("viewForm.analyze",{url:"/analyze",templateUrl:"modules/forms/admin/views/adminTabs/analyze.html"}).state("viewForm.create",{url:"/create",templateUrl:"modules/forms/admin/views/adminTabs/create.html"})}]),function(){function SendVisitorData(Socket,$state,$http,deviceDetector){function send(form,lastActiveIndex,timeElapsed){var visitorData={referrer:document.referrer,isSubmitted:form.submitted,formId:form._id,lastActiveField:form.form_fields[lastActiveIndex]._id,timeElapsed:timeElapsed,language:window.navigator.userLanguage||window.navigator.language,ipAddr:"",deviceType:""};$http.get("https://jsonip.com/").success(function(response){visitorData.ipAddr=response.ip+""}).error(function(error){console.error("Could not get users's ip")}).then(function(){visitorData.userAgent=deviceDetector.raw,deviceDetector.isTablet()?visitorData.deviceType="tablet":deviceDetector.isMobile()?visitorData.deviceType="phone":visitorData.deviceType="desktop",console.log(visitorData.deviceType),Socket.emit("form-visitor-data",visitorData)})}function init(){Socket.socket||Socket.connect()}var service={send:send};return init(),service}angular.module("forms").factory("SendVisitorData",SendVisitorData),SendVisitorData.$inject=["Socket","$state","$http","deviceDetector"]}(),angular.module("forms").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function($scope,$element,$attrs,$select){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,index=parseInt(String.fromCharCode(keyCode))-1;index<$scope.field.fieldOptions.length&&(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue=$scope.field.fieldOptions[index].option_value}))})}}}),angular.module("forms").directive("keyToTruthy",["$rootScope",function($rootScope){return{restrict:"A",scope:{field:"="},link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,truthyKeyCode=$attrs.keyCharTruthy.charCodeAt(0)-32,falseyKeyCode=$attrs.keyCharFalsey.charCodeAt(0)-32;keyCode===truthyKeyCode?(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue="true"})):keyCode===falseyKeyCode&&(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue="false"}))})}}}]),angular.module("users").config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(["$q","$location",function($q,$location){return{responseError:function(response){return"/users/me"!==$location.path()&&response.config&&"/users/me"!==response.config.url&&(console.log("intercepted rejection of ",response.config.url,response.status),401===response.status?(console.log($location.path()),$location.nextAfterLogin=$location.path(),$location.path("/signin")):403===response.status&&$location.path("/access_denied")),$q.reject(response)}}}])}]),angular.module("users").config(["$stateProvider",function($stateProvider){var checkLoggedin=function($q,$timeout,$state,User,Auth){var deferred=$q.defer();return Auth.currentUser&&Auth.currentUser.email?$timeout(deferred.resolve):Auth.currentUser=User.getCurrent(function(){Auth.login(),$timeout(deferred.resolve())},function(){Auth.logout(),$timeout(deferred.reject()),$state.go("signin",{reload:!0})}),deferred.promise};checkLoggedin.$inject=["$q","$timeout","$state","User","Auth"];var checkSignupDisabled=function($window,$timeout,$q){var deferred=$q.defer();return $timeout($window.signupDisabled?deferred.reject():deferred.resolve()),deferred.promise};checkSignupDisabled.$inject=["$window","$timeout","$q"],$stateProvider.state("profile",{resolve:{loggedin:checkLoggedin},url:"/settings/profile",templateUrl:"modules/users/views/settings/edit-profile.client.view.html"}).state("password",{resolve:{loggedin:checkLoggedin},url:"/settings/password",templateUrl:"modules/users/views/settings/change-password.client.view.html"}).state("accounts",{resolve:{loggedin:checkLoggedin},url:"/settings/accounts",templateUrl:"modules/users/views/settings/social-accounts.client.view.html"}).state("signup",{resolve:{isDisabled:checkSignupDisabled},url:"/signup",templateUrl:"modules/users/views/authentication/signup.client.view.html"}).state("signup-success",{resolve:{isDisabled:checkSignupDisabled},url:"/signup-success",templateUrl:"modules/users/views/authentication/signup-success.client.view.html"}).state("signin",{url:"/signin",templateUrl:"modules/users/views/authentication/signin.client.view.html"}).state("access_denied",{url:"/access_denied",templateUrl:"modules/users/views/authentication/access-denied.client.view.html"}).state("verify",{resolve:{isDisabled:checkSignupDisabled},url:"/verify/:token",templateUrl:"modules/users/views/verify/verify-account.client.view.html"}).state("resendVerifyEmail",{resolve:{isDisabled:checkSignupDisabled},url:"/verify",templateUrl:"modules/users/views/verify/resend-verify-email.client.view.html"}).state("forgot",{url:"/password/forgot",templateUrl:"modules/users/views/password/forgot-password.client.view.html"}).state("reset-invalid",{url:"/password/reset/invalid",templateUrl:"modules/users/views/password/reset-password-invalid.client.view.html"}).state("reset-success",{url:"/password/reset/success",templateUrl:"modules/users/views/password/reset-password-success.client.view.html"}).state("reset",{url:"/password/reset/:token",templateUrl:"modules/users/views/password/reset-password.client.view.html"})}]),angular.module("users").controller("AuthenticationController",["$scope","$location","$state","$rootScope","User","Auth",function($scope,$location,$state,$rootScope,User,Auth){$scope=$rootScope,$scope.credentials={},$scope.error="",$scope.signin=function(){User.login($scope.credentials).then(function(response){Auth.login(response),$scope.user=$rootScope.user=Auth.ensureHasCurrentUser(User),"home"!==$state.previous.name&&"verify"!==$state.previous.name&&""!==$state.previous.name?$state.go($state.previous.name):$state.go("listForms")},function(error){$rootScope.user=Auth.ensureHasCurrentUser(User),$scope.user=$rootScope.user,$scope.error=error,console.log("loginError: "+error)})},$scope.signup=function(){console.log($scope.credentials),User.signup($scope.credentials).then(function(response){console.log("signup-success"),$state.go("signup-success")},function(error){console.log("Error: "),console.log(error),error?($scope.error=error,console.log(error)):console.log("No response received")})}}]),angular.module("users").controller("PasswordController",["$scope","$stateParams","$state","User",function($scope,$stateParams,$state,User){$scope.error="",$scope.askForPasswordReset=function(){User.askForPasswordReset($scope.credentials).then(function(response){$scope.success=response.message,$scope.credentials=null},function(error){$scope.error=error,$scope.credentials=null})},$scope.resetUserPassword=function(){$scope.success=$scope.error=null,User.resetPassword($scope.passwordDetails,$stateParams.token).then(function(response){$scope.success=response.message,$scope.passwordDetails=null,$state.go("reset-success")},function(error){$scope.error=error.message||error,$scope.passwordDetails=null})}}]),angular.module("users").controller("SettingsController",["$scope","$rootScope","$http","$state","Users",function($scope,$rootScope,$http,$state,Users){$scope.user=$rootScope.user,$scope.hasConnectedAdditionalSocialAccounts=function(provider){for(var i in $scope.user.additionalProvidersData)return!0;return!1},$scope.isConnectedSocialAccount=function(provider){return $scope.user.provider===provider||$scope.user.additionalProvidersData&&$scope.user.additionalProvidersData[provider]},$scope.removeUserSocialAccount=function(provider){$scope.success=$scope.error=null,$http["delete"]("/users/accounts",{params:{provider:provider}}).success(function(response){$scope.success=!0,$scope.user=response}).error(function(response){$scope.error=response.message})},$scope.updateUserProfile=function(isValid){if(isValid){$scope.success=$scope.error=null;var user=new Users($scope.user);user.$update(function(response){$scope.success=!0,$scope.user=response},function(response){$scope.error=response.data.message})}else $scope.submitted=!0},$scope.changeUserPassword=function(){$scope.success=$scope.error=null,$http.post("/users/password",$scope.passwordDetails).success(function(response){$scope.success=!0,$scope.passwordDetails=null}).error(function(response){$scope.error=response.message})}}]),angular.module("users").controller("VerifyController",["$scope","$state","$rootScope","User","Auth","$stateParams",function($scope,$state,$rootScope,User,Auth,$stateParams){$scope.isResetSent=!1,$scope.credentials={},$scope.error="",$scope.resendVerifyEmail=function(){User.resendVerifyEmail($scope.credentials.email).then(function(response){console.log(response),$scope.success=response.message,$scope.credentials=null,$scope.isResetSent=!0},function(error){$scope.error=error,$scope.credentials.email=null,$scope.isResetSent=!1})},$scope.validateVerifyToken=function(){$stateParams.token&&(console.log($stateParams.token),User.validateVerifyToken($stateParams.token).then(function(response){console.log("Success: "+response.message),$scope.success=response.message,$scope.isResetSent=!0,$scope.credentials.email=null},function(error){console.log("Error: "+error.message),$scope.isResetSent=!1,$scope.error=error,$scope.credentials.email=null}))}}]),angular.module("users").factory("Auth",["$window",function($window){var userState={isLoggedIn:!1},service={_currentUser:null,get currentUser(){return this._currentUser},ensureHasCurrentUser:function(User){return service._currentUser&&service._currentUser.username?service._currentUser:$window.user?(service._currentUser=$window.user,service._currentUser):void User.getCurrent().then(function(user){return service._currentUser=user,userState.isLoggedIn=!0,$window.user=service._currentUser,service._currentUser},function(response){return userState.isLoggedIn=!1,service._currentUser=null,$window.user=null,console.log("User.getCurrent() err",response),null})},isAuthenticated:function(){return!!service._currentUser},getUserState:function(){return userState},login:function(new_user){userState.isLoggedIn=!0,service._currentUser=new_user},logout:function(){$window.user=null,userState.isLoggedIn=!1,service._currentUser=null}};return service}]),angular.module("users").service("Authorizer",["APP_PERMISSIONS","USER_ROLES",function(APP_PERMISSIONS,USER_ROLES){return function(user){return{canAccess:function(permissions){var i,len,permission;for(angular.isArray(permissions)||(permissions=[permissions]),i=0,len=permissions.length;i<len;i++){if(permission=permissions[i],null===APP_PERMISSIONS[permission])throw"Bad permission value";if(!user||!user.roles)return!1;switch(permission){case APP_PERMISSIONS.viewAdminSettings:case APP_PERMISSIONS.editAdminSettings:return user.roles.indexOf(USER_ROLES.admin)>-1;case APP_PERMISSIONS.viewPrivateForm:case APP_PERMISSIONS.editForm:return user.roles.indexOf(USER_ROLES.admin)>-1||user.roles.indexOf(USER_ROLES.normal)>-1}}return!1}}}}]),angular.module("users").factory("User",["$window","$q","$timeout","$http","$state",function($window,$q,$timeout,$http,$state){var userService={getCurrent:function(){var deferred=$q.defer();return $http.get("/users/me").success(function(response){deferred.resolve(response)}).error(function(){deferred.reject("User's session has expired")}),deferred.promise},login:function(credentials){var deferred=$q.defer();return $http.post("/auth/signin",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},logout:function(){var deferred=$q.defer();return $http.get("/auth/signout").success(function(response){deferred.resolve(null)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},signup:function(credentials){var deferred=$q.defer();return $http.post("/auth/signup",credentials).success(function(response){deferred.resolve(response);
}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},resendVerifyEmail:function(_email){var deferred=$q.defer();return $http.post("/auth/verify",{email:_email}).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},validateVerifyToken:function(token){var validTokenRe=/^([A-Za-z0-9]{48})$/g;if(!validTokenRe.test(token))throw new Error("Error token: "+token+" is not a valid verification token");var deferred=$q.defer();return $http.get("/auth/verify/"+token).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error)}),deferred.promise},resetPassword:function(passwordDetails,token){var deferred=$q.defer();return $http.get("/auth/password/"+token,passwordDetails).success(function(response){deferred.resolve()}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},askForPasswordReset:function(credentials){var deferred=$q.defer();return $http.post("/auth/forgot",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise}};return userService}]),angular.module("users").factory("Users",["$resource",function($resource){return $resource("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{MENU:"MENU",SIGNUP_TAB:"Sign Up",SIGNIN_TAB:"Sign In",SIGNOUT_TAB:"Signout",EDIT_PROFILE:"Edit Profile",MY_FORMS:"My Forms",MY_SETTINGS:"My Settings",CHANGE_PASSWORD:"Change Password"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{MENU:"MENU",SIGNUP_TAB:"Créer un Compte",SIGNIN_TAB:"Connexion",SIGNOUT_TAB:"Créer un compte",EDIT_PROFILE:"Modifier Mon Profil",MY_FORMS:"Mes Formulaires",MY_SETTINGS:"Mes Paramètres",CHANGE_PASSWORD:"Changer mon Mot de Pass"})}]),angular.module("forms").controller("AdminFormController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter",function($rootScope,$scope,$stateParams,$state,Forms,CurrentForm,$http,$uibModal,myForm,$filter){$scope=$rootScope,$scope.animationsEnabled=!0,$scope.myform=myForm,$rootScope.saveInProgress=!1,CurrentForm.setForm($scope.myform),$scope.formURL=$scope.myform.admin.username+".tellform.com",$scope.tabData=[{heading:$filter("translate")("CREATE_TAB"),route:"viewForm.create"},{heading:$filter("translate")("DESIGN_TAB"),route:"viewForm.design"},{heading:$filter("translate")("CONFIGURE_TAB"),route:"viewForm.configure"},{heading:$filter("translate")("ANALYZE_TAB"),route:"viewForm.analyze"}],$scope.setForm=function(form){$scope.myform=form},$rootScope.resetForm=function(){$scope.myform=Forms.get({formId:$stateParams.formId})},$scope.openDeleteModal=function(){$scope.deleteModal=$uibModal.open({animation:$scope.animationsEnabled,templateUrl:"myModalContent.html",controller:"AdminFormController",resolve:{myForm:function(){return $scope.myform}}}),$scope.deleteModal.result.then(function(selectedItem){$scope.selected=selectedItem},function(){console.log("Modal dismissed at: "+new Date)})},$scope.cancelDeleteModal=function(){$scope.deleteModal&&$scope.deleteModal.dismiss("cancel")},$scope.removeCurrentForm=function(){if($scope.deleteModal&&$scope.deleteModal.opened){$scope.deleteModal.close();var form_id=$scope.myform._id;if(!form_id)throw new Error("Error - removeCurrentForm(): $scope.myform._id does not exist");$http["delete"]("/forms/"+form_id).success(function(data,status,headers){console.log("form deleted successfully"),$state.go("listForms",{},{reload:!0})}).error(function(error){console.log("ERROR: Form could not be deleted."),console.error(error)})}},$scope.update=$rootScope.update=function(updateImmediately,cb){var continueUpdate=!0;if(updateImmediately||(continueUpdate=!$rootScope.saveInProgress),continueUpdate){var err=null;updateImmediately||($rootScope.saveInProgress=!0),$scope.updatePromise=$http.put("/forms/"+$scope.myform._id,{form:$scope.myform}).then(function(response){$rootScope.myform=$scope.myform=response.data})["catch"](function(response){console.log("Error occured during form UPDATE.\n"),err=response.data})["finally"](function(){if(updateImmediately||($rootScope.saveInProgress=!1),"function"==typeof cb)return cb(err)})}}}]),angular.module("forms").controller("ListFormsController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http",function($rootScope,$scope,$stateParams,$state,Forms,CurrentForm,$http){$scope=$rootScope,$scope.forms={},$scope.showCreateModal=!1,$rootScope.languageRegExp={regExp:/[@!#$%^&*()\-+={}\[\]|\\/'";:`.,~№?<>]+/i,test:function(val){return!this.regExp.test(val)}},$scope.findAll=function(){Forms.query(function(_forms){$scope.myforms=_forms})},$scope.openCreateModal=function(){$scope.showCreateModal||($scope.showCreateModal=!0)},$scope.closeCreateModal=function(){$scope.showCreateModal&&($scope.showCreateModal=!1)},$scope.setForm=function(form){$scope.myform=form},$scope.goToWithId=function(route,id){$state.go(route,{formId:id},{reload:!0})},$scope.duplicateForm=function(form_index){var form=_.cloneDeep($scope.myforms[form_index]);delete form._id,$http.post("/forms",{form:form}).success(function(data,status,headers){$scope.myforms.splice(form_index+1,0,data)}).error(function(errorResponse){console.error(errorResponse),null===errorResponse&&($scope.error=errorResponse.data.message)})},$scope.createNewForm=function(){var form={};form.title=$scope.forms.createForm.title.$modelValue,form.language=$scope.forms.createForm.language.$modelValue,$scope.forms.createForm.$valid&&$scope.forms.createForm.$dirty&&$http.post("/forms",{form:form}).success(function(data,status,headers){$scope.goToWithId("viewForm.create",data._id+"")}).error(function(errorResponse){console.error(errorResponse),$scope.error=errorResponse.data.message})},$scope.removeForm=function(form_index){if(form_index>=$scope.myforms.length||form_index<0)throw new Error("Error: form_index in removeForm() must be between 0 and "+$scope.myforms.length-1);$http["delete"]("/forms/"+$scope.myforms[form_index]._id).success(function(data,status,headers){$scope.myforms.splice(form_index,1)}).error(function(error){console.error(error)})}}]),_.mixin({removeDateFields:removeDateFieldsFunc}),angular.module("forms").directive("autoSaveForm",["$rootScope","$timeout",function($rootScope,$timeout){return{require:["^form"],restrict:"AE",link:function($scope,$element,$attrs,$ctrls){angular.element(document).ready(function(){var $formCtrl=$ctrls[0],savePromise=null;$rootScope.finishedRender=!1,$scope.$on("editFormFields Started",function(ngRepeatFinishedEvent){$rootScope.finishedRender=!1}),$scope.$on("editFormFields Finished",function(ngRepeatFinishedEvent){$rootScope.finishedRender=!0}),$scope.anyDirtyAndTouched=function(form){var propCount=0;for(var prop in form)if(form.hasOwnProperty(prop)&&"$"!==prop[0]&&(propCount++,form[prop].$touched&&form[prop].$dirty))return!0;return!1};var debounceSave=function(){$rootScope.saveInProgress=!0,$rootScope[$attrs.autoSaveCallback](!0,function(err){err?(console.error("Error form data NOT persisted"),console.error(err)):($formCtrl.$setPristine(),$formCtrl.$setUntouched())})};$scope.$watch(function(newValue,oldValue){$rootScope.finishedRender&&$scope.anyDirtyAndTouched($scope.editForm)&&!$rootScope.saveInProgress&&debounceSave()}),$scope.$watch($attrs.autoSaveWatch,function(newValue,oldValue){newValue=angular.copy(newValue),oldValue=angular.copy(oldValue),newValue.form_fields=_.removeDateFields(newValue.form_fields),oldValue.form_fields=_.removeDateFields(oldValue.form_fields);var changedFields=!_.isEqual(oldValue.form_fields,newValue.form_fields)||!_.isEqual(oldValue.startPage,newValue.startPage),changedFieldMap=!1;oldValue.hasOwnProperty("plugins.oscarhost.settings.fieldMap")&&(changedFieldMap=!!oldValue.plugins.oscarhost.settings.fieldMap&&!_.isEqual(oldValue.plugins.oscarhost.settings.fieldMap,newValue.plugins.oscarhost.settings.fieldMap)),(newValue||oldValue)&&oldValue&&(0===oldValue.form_fields.length&&($rootScope.finishedRender=!0),$rootScope.finishedRender&&(changedFields&&!$formCtrl.$dirty||changedFieldMap)&&!$rootScope.saveInProgress?(savePromise&&($timeout.cancel(savePromise),savePromise=null),savePromise=$timeout(function(){debounceSave()})):$rootScope.finishedRender&&$rootScope.saveInProgress&&($rootScope.saveInProgress=!1))},!0)})}}}]),angular.module("forms").directive("configureFormDirective",["$rootScope","$http","Upload","CurrentForm",function($rootScope,$http,Upload,CurrentForm){return{templateUrl:"modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",restrict:"E",scope:{myform:"=",user:"=",pdfFields:"@",formFields:"@"},controller:["$scope",function($scope){console.log($scope.myform),CurrentForm.getForm().plugins?CurrentForm.getForm().plugins.oscarhost.baseUrl&&($scope.oscarhostAPI=!0):$scope.oscarhostAPI=!1,$scope.log="",$scope.pdfLoading=!1,$scope.languages=$rootScope.languages,this._current_upload=null,$scope.resetForm=$rootScope.resetForm,$scope.update=$rootScope.update,this._unbindedPdfFields=$scope.pdfFields,$scope.cancelUpload=function(){this._current_upload.abort(),$scope.pdfLoading=!1,$scope.removePDF()},$scope.removePDF=function(){$scope.myform.pdf=null,$scope.myform.isGenerated=!1,$scope.myform.autofillPDFs=!1,console.log("form.pdf: "+$scope.myform.pdf+" REMOVED")},$scope.uploadPDF=function(file){file&&(console.log(file),Upload.upload({url:"/upload/pdf",data:{user:$scope.user,file:file}}).then(function(resp){var data=resp.data;$scope.log="file "+data.originalname+" uploaded as "+data.filename+". JSON: "+JSON.stringify(data)+"\n"+$scope.log,$scope.myform.pdf=angular.fromJson(angular.toJson(data)),$scope.pdfLoading=!1,console.log($scope.log),$scope.$$phase||$scope.$digest||$scope.$apply()},function(resp){$scope.pdfLoading=!1,console.log("Error occured during upload.\n"),console.log(resp.status)},function(evt){var progressPercentage=parseInt(100*evt.loaded/evt.total,10);$scope.log="progress: "+progressPercentage+"% "+evt.config.data.file.name+"\n"+$scope.log,console.log($scope.log),$scope.pdfLoading=!0}))}}]}}]),angular.module("forms").directive("editFormDirective",["$rootScope","FormFields",function($rootScope,FormFields){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$scope",function($scope){console.log($scope.myform);for(var field_ids=_($scope.myform.form_fields).pluck("_id"),i=0;i<field_ids.length;i++)$scope.myform.plugins.oscarhost.settings.fieldMap[field_ids[i]]=null;$scope.sortableOptions={appendTo:".dropzone",forceHelperSize:!0,forcePlaceholderSize:!0},$scope.select2FA={Heart:"Heart",Star:"Star","thumbs-up":"Thumbs Up","thumbs-down":"Thumbs Down",Circle:"Circle",Square:"Square","Check Circle":"Checkmark","Smile Outlined":"Smile",Hourglass:"Hourglass",bell:"Bell","Paper Plane":"Paper Plane",Comment:"Chat Bubble",Trash:"Trash Can"},$scope.addField={},$scope.addField.types=FormFields.types,$scope.addField.types.forEach(function(type){return type.lastAddedID=1,type}),$scope.lastButtonID=0,$scope.accordion={},$scope.accordion.oneAtATime=!0,$scope.update=$rootScope.update,$scope.oscarFieldsLeft=function(field_id){if($scope.myform&&$scope.myform.plugins.oscarhost.settings.validFields.length>0){$scope.myform.plugins.oscarhost.settings.fieldMap||($scope.myform.plugins.oscarhost.settings.fieldMap={});var oscarhostFields=$scope.myform.plugins.oscarhost.settings.validFields,currentFields=_($scope.myform.plugins.oscarhost.settings.fieldMap).invert().keys().value();return $scope.myform.plugins.oscarhost.settings.fieldMap.hasOwnProperty(field_id)&&(currentFields=_(currentFields).difference($scope.myform.plugins.oscarhost.settings.fieldMap[field_id])),_(oscarhostFields).difference(currentFields).value()}return[]},$scope.dropzone={handle:".handle",containment:".dropzoneContainer",cursor:"grabbing"},$scope.addNewField=function(modifyForm,fieldType){$scope.addField.lastAddedID++;for(var fieldTitle,i=0;i<$scope.addField.types.length;i++)if($scope.addField.types[i].name===fieldType){$scope.addField.types[i].lastAddedID++,fieldTitle=$scope.addField.types[i].value+$scope.addField.types[i].lastAddedID;break}var newField={title:fieldTitle,fieldType:fieldType,fieldValue:"",required:!0,disabled:!1,deletePreserved:!1};return $scope.showAddOptions(newField)&&(newField.fieldOptions=[],newField.fieldOptions.push({option_id:Math.floor(1e5*Math.random()),option_title:"Option 0",option_value:"Option 0"})),modifyForm&&$scope.myform.form_fields.push(newField),newField},$scope.deleteField=function(field_index){var currFieldId=$scope.myform.form_fields[field_index]._id;$scope.myform.hasOwnProperty("plugins.oscarhost.baseUrl")&&delete $scope.myform.plugins.oscarhost.settings.fieldMap[currFieldId],$scope.myform.form_fields.splice(field_index,1)},$scope.duplicateField=function(field_index){var currField=_.cloneDeep($scope.myform.form_fields[field_index]);currField._id="cloned"+_.uniqueId(),currField.title+=" copy",$scope.myform.form_fields.splice(field_index+1,0,currField)},$scope.addButton=function(){var newButton={};newButton.bgColor="#ddd",newButton.color="#ffffff",newButton.text="Button",newButton._id=Math.floor(1e5*Math.random()),$scope.myform.startPage.buttons.push(newButton)},$scope.deleteButton=function(button){for(var currID,i=0;i<$scope.myform.startPage.buttons.length;i++)if(currID=$scope.myform.startPage.buttons[i]._id,console.log(currID),currID===button._id){$scope.myform.startPage.buttons.splice(i,1);break}},$scope.addOption=function(field_index){var currField=$scope.myform.form_fields[field_index];if("checkbox"===currField.fieldType||"dropdown"===currField.fieldType||"radio"===currField.fieldType){currField.fieldOptions||($scope.myform.form_fields[field_index].fieldOptions=[]);var lastOptionID=$scope.myform.form_fields[field_index].fieldOptions.length+1,newOption={option_id:Math.floor(1e5*Math.random()),option_title:"Option "+lastOptionID,option_value:"Option "+lastOptionID};$scope.myform.form_fields[field_index].fieldOptions.push(newOption)}},$scope.deleteOption=function(field_index,option){var currField=$scope.myform.form_fields[field_index];if("checkbox"===currField.fieldType||"dropdown"===currField.fieldType||"radio"===currField.fieldType)for(var i=0;i<currField.fieldOptions.length;i++)if(currField.fieldOptions[i].option_id===option.option_id){$scope.myform.form_fields[field_index].fieldOptions.splice(i,1);break}},$scope.showAddOptions=function(field){return"dropdown"===field.fieldType||"checkbox"===field.fieldType||"radio"===field.fieldType},$scope.showRatingOptions=function(field){return"rating"===field.fieldType}}]}}]),angular.module("forms").directive("editSubmissionsFormDirective",["$rootScope","$http",function($rootScope,$http){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html",restrict:"E",scope:{myform:"=",user:"="},controller:["$scope",function($scope){$scope.table={masterChecker:!1,rows:[]},function(){for(var defaultFormFields=_.cloneDeep($scope.myform.form_fields),submissions=_.cloneDeep($scope.myform.submissions),i=0;i<submissions.length;i++){for(var x=0;x<submissions[i].form_fields;x++){var oldValue=submissions[i].form_fields[x].fieldValue||"";submissions[i].form_fields[x]=_.merge(defaultFormFields,submissions[i].form_fields),submissions[i].form_fields[x].fieldValue=oldValue}submissions[i].selected=!1}$scope.table.rows=submissions}(),$scope.AverageTimeElapsed=function(){for(var totalTime=0,numSubmissions=$scope.table.rows.length,i=0;i<$scope.table.rows.length;i++)totalTime+=$scope.table.rows[i].timeElapsed;return console.log(totalTime/numSubmissions),totalTime/numSubmissions}(),$scope.DeviceStatistics=function(){var newStatItem=function(){return{visits:0,responses:0,completion:0,average_time:0,total_time:0}},stats={desktop:newStatItem(),tablet:newStatItem(),phone:newStatItem(),other:newStatItem()},visitors=$scope.myform.analytics.visitors;console.log(visitors);for(var i=0;i<visitors.length;i++){var visitor=visitors[i],deviceType=visitor.deviceType;stats[deviceType].visits++,stats[deviceType].total_time=+visitor.timeElapsed,stats[deviceType].average_time=stats[deviceType].total_time/stats[deviceType].visits||0,visitor.isSubmitted&&stats[deviceType].responses++,stats[deviceType].completion=stats[deviceType].response/stats[deviceType].visits||0}return console.log(stats),stats}(),$scope.isAtLeastOneChecked=function(){for(var i=0;i<$scope.table.rows.length;i++)if($scope.table.rows[i].selected)return!0;return!1},$scope.toggleAllCheckers=function(){for(var i=0;i<$scope.table.rows.length;i++)$scope.table.rows[i].selected=$scope.table.masterChecker},$scope.toggleObjSelection=function($event,description){$event.stopPropagation()},$scope.rowClicked=function(row_index){$scope.table.rows[row_index].selected=!$scope.table.rows[row_index].selected},$scope.deleteSelectedSubmissions=function(){var delete_ids=_.chain($scope.table.rows).filter(function(row){return!!row.selected}).pluck("_id").value();$http({url:"/forms/"+$scope.myform._id+"/submissions",method:"DELETE",data:{deleted_submissions:delete_ids},headers:{"Content-Type":"application/json;charset=utf-8"}}).success(function(data,status,headers){for(var tmpArray=[],i=0;i<$scope.table.rows.length;i++)$scope.table.rows[i].selected||tmpArray.push($scope.table.rows[i]);$scope.table.rows=tmpArray}).error(function(err){console.log("Could not delete form submissions.\nError: "),console.log(err),console.error=err})},$scope.exportSubmissions=function(type){console.log($scope.table.rows),angular.element("#table-submission-data").tableExport({type:type,escape:!1})}}]}}]),angular.module("forms").service("FormFields",[function(){this.types=[{name:"textfield",value:"Short Text"},{name:"email",value:"Email"},{name:"radio",value:"Multiple Choice"},{name:"dropdown",value:"Dropdown"},{name:"date",value:"Date"},{name:"textarea",value:"Paragraph Text"},{name:"yes_no",value:"Yes/No"},{name:"legal",value:"Legal"},{name:"rating",value:"Rating"},{name:"link",value:"Link"},{name:"number",value:"Numbers"},{name:"statement",value:"Statement"}]}]),angular.module("forms").factory("Submissions",["$resource",function($resource){return $resource("forms/:formID/submissions/:submissionId",{submissionId:"@_id",formId:"@_id"},{query:{method:"GET",isArray:!0},update:{method:"PUT"},save:{method:"POST"}})}]),angular.module("forms").value("supportedFields",["textfield","textarea","date","dropdown","hidden","password","radio","legal","statement","rating","yes_no","number","natural"]),angular.module("forms").controller("SubmitFormController",["$scope","$rootScope","$state","$translate","myForm","Auth",function($scope,$rootScope,$state,$translate,myForm,Auth){$scope.authentication=Auth,$scope.myform=myForm,$translate.use(myForm.language),$scope.myform.isLive?$scope.hideNav=$rootScope.hideNav=!0:$scope.authentication.isAuthenticated()?$scope.hideNav=$rootScope.hideNav=!1:($scope.hideNav=$rootScope.hideNav=!0,$state.go("access_denied"))}]),angular.module("forms").directive("fieldIconDirective",function(){return{template:'<i class="{{typeIcon}}"></i>',restrict:"E",scope:{typeName:"@"},controller:["$scope",function($scope){var iconTypeMap={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};$scope.typeIcon=iconTypeMap[$scope.typeName]}]}});var __indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++)if(i in this&&this[i]===item)return i;return-1};angular.module("forms").directive("fieldDirective",["$http","$compile","$rootScope","$templateCache","supportedFields",function($http,$compile,$rootScope,$templateCache,supportedFields){var getTemplateUrl=function(fieldType){var type=fieldType,templateUrl="modules/forms/base/views/directiveViews/field/";return __indexOf.call(supportedFields,type)>=0&&(templateUrl=templateUrl+type+".html"),$templateCache.get(templateUrl)};return{template:"<div>{{field.title}}</div>",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(scope,element){$rootScope.chooseDefaultOption=scope.chooseDefaultOption=function(type){"yes_no"===type?scope.field.fieldValue="true":"rating"===type?scope.field.fieldValue=0:"radio"===scope.field.fieldType?(console.log(scope.field),scope.field.fieldValue=scope.field.fieldOptions[0].option_value,console.log(scope.field.fieldValue)):"legal"===type&&(scope.field.fieldValue="true",$rootScope.nextField())},scope.setActiveField=$rootScope.setActiveField,"date"===scope.field.fieldType&&(scope.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var fieldType=scope.field.fieldType;if("number"===scope.field.fieldType||"textfield"===scope.field.fieldType||"email"===scope.field.fieldType||"link"===scope.field.fieldType){switch(scope.field.fieldType){case"textfield":scope.field.input_type="text";break;case"email":scope.field.input_type="email",scope.field.placeholder="joesmith@example.com";break;case"number":scope.field.input_type="text",scope.field.validateRegex=/^-?\d+$/;break;default:scope.field.input_type="url",scope.field.placeholder="http://example.com"}fieldType="textfield"}var template=getTemplateUrl(fieldType);element.html(template).show();$compile(element.contents())(scope)}}}]),angular.module("forms").directive("onEnterKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,onEnterKeyDisabled=!1;null!==$attrs.onEnterKeyDisabled&&(onEnterKeyDisabled=$attrs.onEnterKeyDisabled),13!==keyCode||event.shiftKey||onEnterKeyDisabled||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;9!==keyCode||event.shiftKey||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;13!==keyCode&&9!==keyCode||event.shiftKey||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;9===keyCode&&event.shiftKey&&(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onTabAndShiftKey)}))})}}}]),angular.module("forms").directive("onFinishRender",["$rootScope","$timeout",function($rootScope,$timeout){return{restrict:"A",link:function(scope,element,attrs){if(element.attr("ng-repeat")||element.attr("data-ng-repeat")){var broadcastMessage=attrs.onFinishRender||"ngRepeat";scope.$first&&!scope.$last?scope.$evalAsync(function(){$rootScope.$broadcast(broadcastMessage+" Started")}):scope.$last&&scope.$evalAsync(function(){$rootScope.$broadcast(broadcastMessage+" Finished")})}}}}]),angular.module("forms").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","Auth","SendVisitorData",function($http,TimeCounter,$filter,$rootScope,Auth,SendVisitorData){return{templateUrl:"modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$document","$window","$scope",function($document,$window,$scope){$scope.authentication=$rootScope.authentication,$scope.noscroll=!1,$scope.forms={};var form_fields_count=$scope.myform.visible_form_fields.filter(function(field){return"statement"!==field.fieldType&&"rating"!==field.fieldType}).length,nb_valid=$filter("formValidity")($scope.myform);$scope.translateAdvancementData={done:nb_valid,total:form_fields_count,answers_not_completed:form_fields_count-nb_valid},$scope.reloadForm=function(){$scope.myform.submitted=!1,$scope.myform.form_fields=_.chain($scope.myform.visible_form_fields).map(function(field){return field.fieldValue="",field}).value(),$scope.loading=!1,$scope.error="",$scope.selected={_id:"",index:0},$scope.setActiveField($scope.myform.visible_form_fields[0]._id,0,!1),TimeCounter.restartClock()},$window.onscroll=function(){$scope.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var elemBox=document.getElementsByClassName("activeField")[0].getBoundingClientRect();$scope.fieldTop=elemBox.top,$scope.fieldBottom=elemBox.bottom;var field_id,field_index;$scope.noscroll||($scope.selected.index===$scope.myform.visible_form_fields.length-1&&$scope.fieldBottom<200?(field_index=$scope.selected.index+1,field_id="submit_field",$scope.setActiveField(field_id,field_index,!1)):$scope.selected.index===$scope.myform.visible_form_fields.length?$scope.fieldTop>200&&(field_index=$scope.selected.index-1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)):$scope.fieldBottom<0?(field_index=$scope.selected.index+1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)):0!==$scope.selected.index&&$scope.fieldTop>0&&(field_index=$scope.selected.index-1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)),$scope.$apply())};var getActiveField=function(){if(null===$scope.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===$scope.selected._id?$scope.myform.form_fields.length-1:$scope.selected.index};$scope.setActiveField=$rootScope.setActiveField=function(field_id,field_index,animateScroll){if(null!==$scope.selected&&$scope.selected._id!==field_id){$scope.selected._id=field_id,$scope.selected.index=field_index;var nb_valid=$filter("formValidity")($scope.myform);$scope.translateAdvancementData={done:nb_valid,total:form_fields_count,answers_not_completed:form_fields_count-nb_valid},animateScroll?($scope.noscroll=!0,setTimeout(function(){$document.scrollToElement(angular.element(".activeField"),-10,200).then(function(){$scope.noscroll=!1,setTimeout(function(){document.querySelectorAll(".activeField .focusOn").length?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input").length?document.querySelectorAll(".activeField input")[0].focus():document.querySelectorAll(".activeField .selectize-input")[0].focus()})})})):setTimeout(function(){document.querySelectorAll(".activeField .focusOn")[0]?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input")[0].focus()}),SendVisitorData.send($scope.myform,getActiveField(),TimeCounter.getTimeElapsed())}},$rootScope.nextField=$scope.nextField=function(){var selected_index,selected_id;$scope.selected.index<$scope.myform.visible_form_fields.length-1?(selected_index=$scope.selected.index+1,selected_id=$scope.myform.visible_form_fields[selected_index]._id,$rootScope.setActiveField(selected_id,selected_index,!0)):$scope.selected.index===$scope.myform.visible_form_fields.length-1&&(selected_index=$scope.selected.index+1,selected_id="submit_field",$rootScope.setActiveField(selected_id,selected_index,!0))},$rootScope.prevField=$scope.prevField=function(){if($scope.selected.index>0){var selected_index=$scope.selected.index-1,selected_id=$scope.myform.visible_form_fields[selected_index]._id;$scope.setActiveField(selected_id,selected_index,!0)}},$scope.exitStartPage=function(){$scope.myform.startPage.showStart=!1,$scope.myform.visible_form_fields.length>0&&($scope.selected._id=$scope.myform.visible_form_fields[0]._id)},$rootScope.goToInvalid=$scope.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()},$rootScope.submitForm=$scope.submitForm=function(){var _timeElapsed=TimeCounter.stopClock();$scope.loading=!0;var form=_.cloneDeep($scope.myform);form.timeElapsed=_timeElapsed,form.percentageComplete=$filter("formValidity")($scope.myform)/$scope.myform.visible_form_fields.length*100,delete form.visible_form_fields;for(var i=0;i<$scope.myform.form_fields.length;i++)"dropdown"!==$scope.myform.form_fields[i].fieldType||$scope.myform.form_fields[i].deletePreserved||($scope.myform.form_fields[i].fieldValue=$scope.myform.form_fields[i].fieldValue.option_value);setTimeout(function(){$scope.submitPromise=$http.post("/forms/"+$scope.myform._id,form).success(function(data,status,headers){console.log($scope.myform.form_fields[0]),$scope.myform.submitted=!0,$scope.loading=!1,SendVisitorData.send($scope.myform,getActiveField(),_timeElapsed)}).error(function(error){$scope.loading=!1,console.error(error),$scope.error=error.message})},500)},$scope.reloadForm()}]}}]),angular.module("forms").service("CurrentForm",function(){var _form={};this.getForm=function(){return _form},this.setForm=function(form){_form=form}}),angular.module("forms").factory("Forms",["$resource","FORM_URL",function($resource,FORM_URL){return $resource(FORM_URL,{formId:"@_id"},{query:{method:"GET",isArray:!0},get:{method:"GET",transformResponse:function(data,header){var form=angular.fromJson(data);return form.visible_form_fields=_.filter(form.form_fields,function(field){return field.deletePreserved===!1}),form}},update:{method:"PUT"},save:{method:"POST"}})}]),angular.module("forms").service("TimeCounter",[function(){var _startTime,_endTime=null;this.timeSpent=0,this.restartClock=function(){_startTime=Date.now(),_endTime=null},this.getTimeElapsed=function(){if(_startTime)return Math.abs(Date.now().valueOf()-_startTime.valueOf())/1e3},this.stopClock=function(){return _startTime&&null===_endTime?(_endTime=Date.now(),this.timeSpent=Math.abs(_endTime.valueOf()-_startTime.valueOf())/1e3,this._startTime=this._endTime=null,this.timeSpent):new Error("Clock has not been started")},this.clockStarted=function(){return!!this._startTime}}]),angular.module("users").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{ACCESS_DENIED_TEXT:"You need to be logged in to access this page",USERNAME_LABEL:"Username or Email",PASSWORD_LABEL:"Password",CURRENT_PASSWORD_LABEL:"Current Password",NEW_PASSWORD_LABEL:"New Password",VERIFY_PASSWORD_LABEL:"Verify Password",UPDATE_PASSWORD_LABEL:"Update Password",FIRST_NAME_LABEL:"First Name",LAST_NAME_LABEL:"Last Name",LANGUAGE_LABEL:"Language",EMAIL_LABEL:"Email",SIGNUP_ACCOUNT_LINK:"Don't have an account? Sign up here",SIGN_IN_ACCOUNT_LINK:"Already have an account? Sign in here",SIGNUP_HEADER_TEXT:"Sign up",SIGNIN_HEADER_TEXT:"Sign in",SIGNUP_ERROR_TEXT:"Couldn't complete registration due to errors",UPDATE_PROFILE_BTN:"Update Profile",PROFILE_SAVE_SUCCESS:"Profile saved successfully",PROFILE_SAVE_ERROR:"Could't Save Your Profile.",FORGOT_PASSWORD_LINK:"Forgot your password?",REVERIFY_ACCOUNT_LINK:"Resend your verification email",SIGNIN_BTN:"Sign in",SIGNUP_BTN:"Sign up",SAVE_PASSWORD_BTN:"Save Password",SUCCESS_HEADER:"Signup Successful",SUCCESS_TEXT:"Youve successfully registered an account at TellForm.",VERIFICATION_EMAIL_SENT:"A verification email has been sent to",NOT_ACTIVATED_YET:"But your account is not activated yet",
BEFORE_YOU_CONTINUE:"Before you continue, make sure to check your email for our verification. If you dont receive it within 24h drop us a line at ",CHECK_YOUR_EMAIL:"Check your email and click on the activation link to activate your account. If you have any questions drop us a line at",PASSWORD_RESTORE_HEADER:"Restore your password",ENTER_YOUR_EMAIL:"Enter your account email.",SUBMIT_BTN:"Submit",ASK_FOR_NEW_PASSWORD:"Ask for new password reset",PASSWORD_RESET_INVALID:"Password reset is invalid",PASSWORD_RESET_SUCCESS:"Passport successfully reset",PASSWORD_CHANGE_SUCCESS:"Passport successfully changed",CONTINUE_TO_LOGIN:"Continue to login page",VERIFY_SUCCESS:"Account successfully activated",VERIFY_ERROR:"Verification link is invalid or has expired"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("users").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{ACCESS_DENIED_TEXT:"Vouz nêtes pas autorisé à accéder à cette page.",USERNAME_LABEL:"Nom dutilisateur",PASSWORD_LABEL:"Mot de Passe",CURRENT_PASSWORD_LABEL:"Mot de passe actuel",NEW_PASSWORD_LABEL:"Nouveau Mot de Passe",VERIFY_PASSWORD_LABEL:"Vérifier le mot de passe",UPDATE_PASSWORD_LABEL:"Mettre à jour le mot de passe",FIRST_NAME_LABEL:"Prénom",LAST_NAME_LABEL:"Nom",LANGUAGE_LABEL:"Langue",EMAIL_LABEL:"Email",UPDATE_PROFILE_BTN:"Modifier le Profil",PROFILE_SAVE_SUCCESS:"Profil enregistré avec succès",PROFILE_SAVE_ERROR:"Erreur: impossible denregistrer votre Profile.",FORGOT_PASSWORD_LINK:"Mot de passe oublié ?",REVERIFY_ACCOUNT_LINK:"Re-envoyez un email de vérification",SIGNIN_BTN:"Connexion",SIGNUP_BTN:"Créer un compte",SAVE_PASSWORD_BTN:"Enregistrer votre nouveau Mot de Passe",SUCCESS_HEADER:"Votre Compte a été enregistré !",SUCCESS_TEXT:"Votre compte Tellform a été crée avec succès.",VERIFICATION_EMAIL_SENT:"Un email de verification a été envoyer à",NOT_ACTIVATED_YET:"Mais votre compte n'est pas activé",BEFORE_YOU_CONTINUE:"Avant de continuer, vous devez valider votre adresse mail. Merci de vérifier votre boite mail. Si vous ne lavez pas reçu dans les prochaines 24h, contactez-nous a ",CHECK_YOUR_EMAIL:"Vérifiez vos emails, et cliquez sur le lien de validation pour activer votre compte. Si vous avez une question contactez-nous à",PASSWORD_RESTORE_HEADER:"Mot de passe perdu",ENTER_YOUR_EMAIL:"Entrer votre email",SUBMIT_BTN:"Enregistrer",ASK_FOR_NEW_PASSWORD:"Demander un nouveau mot de pass ",PASSWORD_RESET_INVALID:"Le nouveau mot de passe est invalid",PASSWORD_RESET_SUCCESS:"Mot de passe réinitialisé avec succès",PASSWORD_CHANGE_SUCCESS:"Mot de passe enregistré avec succès",CONTINUE_TO_LOGIN:"Allez à la page de connexion",VERIFY_SUCCESS:"Votre compte est activé !",VERIFY_ERROR:"Le lien de vérification est invalide ou à expiré"})}]);
<<<<<<< HEAD
=======
"use strict";function removeDateFieldsFunc(o){function eachObject(v,k){"lastModified"!==k&&"created"!==k||delete clone[k]}for(var clone=_.clone(o),i=0;i<clone.length;i++)_.each(clone[i],eachObject);return clone}var ApplicationConfiguration=function(){var applicationModuleName="NodeForm",applicationModuleVendorDependencies=["duScroll","ui.select","cgBusy","ngSanitize","vButton","ngResource","NodeForm.templates","ui.router","ui.bootstrap","ui.utils","pascalprecht.translate","ng.deviceDetector"],registerModule=function(moduleName,dependencies){angular.module(moduleName,dependencies||[]),angular.module(applicationModuleName).requires.push(moduleName)};return{applicationModuleName:applicationModuleName,applicationModuleVendorDependencies:applicationModuleVendorDependencies,registerModule:registerModule}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function($locationProvider){$locationProvider.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("NodeForm.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("modules/core/views/header.client.view.html",'<section class="navbar navbar-fixed-top navbar-inverse" data-ng-controller=HeaderController ng-hide=hideNav><div class=container><div class=navbar-header><button class=navbar-toggle type=button data-ng-click=toggleCollapsibleMenu()><span class=sr-only>Toggle navigation</span> <span>{{ \'MENU_BTN\' | translate }}</span></button> <a href="https://www.tellform.com/#!/" class=navbar-brand><i class="fa fa-archive" style="padding-right: 0.3em"></i>Tell<span>Form</span></a></div><nav class="collapse navbar-collapse" collapse=!isCollapsed role=navigation><ul class="nav navbar-nav" data-ng-if=authentication.isAuthenticated()><li data-ng-repeat="item in menu.items | orderBy: \'position\'" data-ng-if=item.shouldRender(authentication.isAuthenticated()); ng-switch=item.menuItemType ui-route={{item.uiRoute}} class={{item.menuItemClass}} ng-class="{active: ($uiRoute)}" dropdown="item.menuItemType === \'dropdown\'"><a ng-switch-when=dropdown class=dropdown-toggle dropdown-toggle><span data-ng-bind=item.title></span> <b class=caret></b></a><ul ng-switch-when=dropdown class=dropdown-menu><li data-ng-repeat="subitem in item.items | orderBy: \'position\'" data-ng-if=subitem.shouldRender(authentication.isAuthenticated()); ui-route={{subitem.uiRoute}} ng-class="{active: $uiRoute}"><a href=/#!/{{subitem.link}} data-ng-bind=subitem.title></a></li></ul><a ng-switch-default href=/#!/{{item.link}} data-ng-bind=item.title></a></li></ul><ul class="nav navbar-nav navbar-right" data-ng-hide=authentication.isAuthenticated()><li ng-hide=$root.signupDisabled ui-route=/signup ng-class="{active: $uiRoute}"><a href=/#!/signup>{{ \'SIGNUP_TAB\' | translate }}</a></li><li class=divider-vertical></li><li ui-route=/signin ng-class="{active: $uiRoute}"><a href=/#!/signin>{{ \'SIGNIN_TAB\' | translate }}</a></li></ul><ul class="nav navbar-nav navbar-right" data-ng-show=authentication.isAuthenticated()><li class=dropdown uib-dropdown><a href=# class=dropdown-toggle data-toggle=dropdown dropdown-toggle><span>{{ \'MY_SETTINGS\' | translate }}</span> <b class=caret></b></a><ul class=dropdown-menu><li><a href=/#!/settings/profile>{{ \'EDIT_PROFILE\' | translate }}</a></li><li class=divider></li><li><a href=/#!/settings/password>{{ \'CHANGE_PASSWORD\' | translate }}</a></li></ul></li><li ng-click=signout()><a>{{ \'SIGNOUT_TAB\' | translate }}</a></li></ul></nav></div></section>'),$templateCache.put("modules/forms/admin/views/admin-form.client.view.html",'<div class=container cg-busy="{promise:updatePromise,templateUrl:\'modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html\',message:\'Updating form...\', backdrop:false, wrapperClass:\'.busy-updating-wrapper\'}"></div><section class="container admin-form"><script type=text/ng-template id=myModalContent.html><div class="modal-header">\n <h2 class="modal-title hidden-md hidden-lg">{{ \'ARE_YOU_SURE\' | translate }}</h2>\n <h3 class="modal-title hidden-xs hidden-sm">{{ \'ARE_YOU_SURE\' | translate }}</h3>\n </div>\n <div class="modal-body">\n <div class="modal-body-alert">\n {{ \'READ_WARNING\' | translate }}\n </div>\n <p class="hidden-xs hidden-sm">\n {{ \'DELETE_WARNING1\' | translate }}<strong>{{myform.title}}</strong> {{ \'DELETE_WARNING2\' | translate }}\n </p>\n <p>{{ \'DELETE_CONFIRM\' | translate }}</p>\n </div>\n <div class="modal-footer">\n <p>\n <input type="text" data-ng-model="deleteConfirm" class="input-block" autofocus required aria-label="Type in the name of the form to confirm that you want to delete this form.">\n </p>\n <button type="submit" ng-click="removeCurrentForm()" class="btn btn-block btn-danger" ng-disabled="myform.title != deleteConfirm">\n {{ \'I_UNDERSTAND\' | translate }}\n </button>\n </div></script><div class="page-header row-fluid" style="padding-bottom: 1em"><div class="col-xs-10 col-sm-8"><h1 class="hidden-sm hidden-xs" data-ng-bind=myform.title style="margin-bottom: 0px"></h1><h2 class="hidden-md hidden-lg" data-ng-bind=myform.title style="margin-bottom: 0px"></h2></div><div class="col-xs-1 col-sm-2"><small class=pull-right><button class="btn btn-danger" ng-click=openDeleteModal()><i class="fa fa-trash-o"></i> <span class="show-sm hidden-lg hidden-md hidden-xs">{{ \'DELETE_FORM_SM\' | translate}}</span> <span class="hidden-xs hidden-sm">{{ \'DELETE_FORM_MD\' | translate}}</span></button></small></div><div class="col-xs-1 col-sm-2"><small class=pull-right><a class="btn btn-default view-form-btn" href=//{{formURL}}/#!/forms/{{myform._id}}><span class="hidden-xs hidden-sm">{{ \'VIEW\' | translate }} <span ng-show=myform.isLive>{{ \'LIVE\' | translate }}</span> <span ng-hide=myform.isLive>{{ \'PREVIEW\' | translate }}</span> {{ \'FORM\' | translate }}</span> <span class="hidden-xs hidden-md hidden-lg">View <span ng-if=myform.isLive>{{ \'LIVE\' | translate }}</span> <span ng-if=!myform.isLive>{{ \'PREVIEW\' | translate }}</span></span> <i class="status-light status-light-on fa fa-dot-circle-o" ng-if=myform.isLive></i> <i class="status-light status-light-off fa fa-dot-circle-o" ng-if=!myform.isLive></i></a></small></div></div><div class=row-fluid><div class=col-xs-12><tabs data=tabData></tabs></div><div class=col-xs-12><ui-view></ui-view></div></div></section>'),$templateCache.put("modules/forms/admin/views/list-forms.client.view.html",'<section class=overlay ng-if=showCreateModal ng-click=closeCreateModal()></section><section data-ng-controller="ListFormsController as ctrl" data-ng-init=findAll() class=container><br><div class=row><div ng-click=openCreateModal() class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item create-new"><div class="title-row col-xs-12"><h4 class="fa fa-plus fa-6"></h4></div><div class="col-xs-12 details-row"><small class=list-group-item-text>{{ \'CREATE_A_NEW_FORM\' | translate }}</small></div></div><form name=forms.createForm class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item create-new new-form" ng-if=showCreateModal><div class="title-row row"><div class="col-xs-5 field-title text-left">Name</div><div class="col-xs-12 field-input"><input name=title required ng-model=formTitle ng-pattern=languageRegExp ng-minlength=4 style="color:black"></div></div><div class="details-row row"><div class="col-xs-5 field-title text-left">Language</div><div class="col-xs-12 field-input"><div class="button custom-select"><select style=color:black name=language required ng-model=formLanguage ng-init="formLanguage = user.language"><option ng-repeat="language in languages" value={{language}}>{{language}}</option></select></div></div></div><div class="details-row submit row"><div class="col-xs-12 field-title text-center"><button class="btn btn-primary" ng-disabled=forms.createForm.$invalid ng-click=createNewForm()>{{ \'CREATE_FORM\' | translate }}</button></div></div></form><div data-ng-repeat="form in myforms" ng-style="{ \'background-color\': form.design.colors.backgroundColor, \'color\': form.design.colors.answerColor }" class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-1 col-md-3 col-md-offset-1 form-item container"><div class=row><span class=pull-right><i style=cursor:pointer class="fa fa-trash-o" ng-click=removeForm($index)></i> <i style=cursor:pointer class="fa fa-files-o" ng-click=duplicateForm($index)></i></span></div><div class=row><a data-ng-href=#!/forms/{{form._id}}/admin/create ng-style="{ \'color\': form.design.colors.answerColor }" class="title-row col-xs-12"><h4 class=list-group-item-heading data-ng-bind=form.title></h4></a></div><div class="row footer"><div class="col-xs-12 details-row"><small class=list-group-item-text>{{ \'CREATED_ON\' | translate }} <span data-ng-bind="form.created | date:\'shortDate\'"></span></small></div></div></div></div></section>'),$templateCache.put("modules/forms/base/views/submit-form.client.view.html","<section class=public-form ng-style=\"{ 'background-color': myform.design.colors.backgroundColor }\"><submit-form-directive myform=myform></submit-form-directive></section><script ng-if=myform.analytics.gaCode>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', '{{myform.analytics.gaCode}}', 'auto');\n ga('send', 'pageview');</script>"),$templateCache.put("modules/forms/admin/views/adminTabs/analyze.html","<edit-submissions-form-directive myform=myform user=user></edit-submissions-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/configure.html","<configure-form-directive myform=myform user=user></configure-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/create.html","<edit-form-directive myform=myform></edit-form-directive>"),$templateCache.put("modules/forms/admin/views/adminTabs/design.html",'<div class="config-form design container"><div class=row><div class="col-md-12 container"><div class=row><div class=col-sm-12><h2 class="hidden-sm hidden-xs">{{ \'DESIGN_HEADER\' | translate }}</h2><h3 class="hidden-lg hidden-md">{{ \'DESIGN_HEADER\' | translate }}</h3></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BACKGROUND_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.backgroundColor ng-style="{ \'background-color\': myform.design.colors.backgroundColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'QUESTION_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.questionColor ng-style="{ \'background-color\': myform.design.colors.questionColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'ANSWER_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.answerColor ng-style="{ \'background-color\': myform.design.colors.answerColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BTN_BACKGROUND_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.buttonColor ng-style="{ \'background-color\': myform.design.colors.buttonColor }"></div></div><div class="row field"><div class="field-title col-sm-3"><h5>{{ \'BTN_TEXT_COLOR\' | translate }}</h5></div><div class="field-input col-sm-9"><input colorpicker=hex ng-model=myform.design.colors.buttonTextColor ng-style="{ \'background-color\': myform.design.colors.buttonTextColor }"></div></div></div></div><div class=row><div class="col-sm-offset-4 col-sm-2"><button class="btn btn-primary btn-large" type=button ng-click="update(false, null)"><i class="icon-arrow-left icon-white"></i> Save Changes</button></div><div class=col-sm-1><button class="btn btn-default" type=button ng-click=resetForm()><i class="icon-eye-open icon-white"></i> Cancel</button></div></div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeA.html",'<div><div style="text-align:center;font-size:26px;position:absolute;top:100px;width:100%;text-shadow:1px 1px 2px white, -1px -1px 2px white,-4px 4px 4px white,-4px 4px 4px white">{{$message}}</div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html",'<div><div style="text-align: center; font-size: 20px;position: fixed; bottom: 0; right: 55px; background-color: gray; color: white; padding: 5px 15px 5px 10px; z-index: 10">{{$message}}</div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",'<div class="config-form container"><div class=row><div class="col-sm-12 container-fluid"><div class=row><div class=col-sm-12><h2 class="hidden-sm hidden-xs">{{ \'ADVANCED_SETTINGS\' | translate }}</h2><h3 class="hidden-lg hidden-md">{{ \'ADVANCED_SETTINGS\' | translate }}</h3></div></div><div class="row field"><div class="field-title col-sm-4"><h5>{{ \'FORM_NAME\' | translate }}</h5></div><div class=col-sm-8><input ng-model=myform.title value={{myform.title}} style="width: 100%" ng-minlength=4 ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class="row field"><div class="field-title col-sm-6"><h5>{{ \'FORM_STATUS\' | translate }}</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=true ng-model=myform.isLive ng-required=true style="background-color:#33CC00"> &nbsp;<span>{{ \'PUBLIC\' | translate }}</span></label><label><input type=radio data-ng-value=false ng-model=myform.isLive ng-required="true"> &nbsp;<span>{{ \'PRIVATE\' | translate }}</span></label></div></div><div class="row field"><div class="field-title col-sm-4"><h5>{{ \'GA_TRACKING_CODE\' | translate }}</h5></div><div class=col-sm-8><input ng-model=myform.analytics.gaCode value={{myform.analytics.gaCode}} style="width: 100%" ng-minlength=4 placeholder=UA-XXXXX-Y ng-pattern="/\\bUA-\\d{4,10}-\\d{1,4}\\b/"></div></div><div class="row field"><div class="col-xs-6 field-title">Language</div><div class="col-xs-4 field-input"><select ng-model=myform.language><option ng-repeat="language in languages" ng-selected="language == myform.language" value={{language}}>{{language}}</option></select><span class=required-error ng-show="field.required && !field.fieldValue">* required</span></div></div><div class="row field"><div class="field-title col-sm-6"><h5>{{ \'DISPLAY_FOOTER\' | translate }}</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=false ng-model=myform.hideFooter ng-required="true"> &nbsp;<span>{{ \'YES\' | translate }}</span></label><label><input type=radio data-ng-value=true ng-model=myform.hideFooter ng-required="true"> &nbsp;<span>{{ \'No\' | translate }}</span></label></div></div><div class="row field"><div class="field-title col-sm-6"><h5>Display Start Page?</h5></div><div class="field-input col-sm-6"><label><input type=radio data-ng-value=true ng-model=myform.startPage.showStart ng-required=true style="background-color:#33CC00"> &nbsp;<span>{{ \'YES\' | translate }}</span></label><label><input type=radio data-ng-value=false ng-model=myform.startPage.showStart ng-required="true"> &nbsp;<span>{{ \'NO\' | translate }}</span></label></div></div></div></div><div class=row><div class="col-sm-offset-4 col-sm-2"><button class="btn btn-primary btn-large" type=button ng-click="update(false, null)"><i class="icon-arrow-left icon-white"></i>{{ \'SAVE_CHANGES\' | translate }}</button></div><div class=col-sm-1><button class="btn btn-default" type=button ng-click=resetForm()><i class="icon-eye-open icon-white"></i>{{ \'CANCEL\' | translate }}</button></div></div></div>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",'<form class="row container" name=editForm auto-save-form auto-save-watch=myform auto-save-callback=update><div class="col-xs-2 col-sm-4 col-md-4 add-field"><div class="row add-field-title"><h3 class="col-md-12 hidden-sm hidden-xs">{{ \'ADD_FIELD_LG\' | translate }}</h3><h4 class="col-sm-12 hidden-xs hidden-md hidden-lg">{{ \'ADD_FIELD_MD\' | translate }}</h4><h5 class="col-xs-12 hidden-sm hidden-md hidden-lg">{{ \'ADD_FIELD_SM\' | translate }}</h5></div><div class="panel-group row" class=draggable ng-model=addField.types><div class="col-xs-12 col-sm-12 col-md-6" ng-repeat="type in addField.types" style=padding-top:7.5px><div class="panel panel-default" style=background-color:#f5f5f5><div class=panel-heading ng-click="addNewField(true, type.name)" style="cursor: pointer; font-size:12px; padding-left: 10px; padding-right: 10px"><span><field-icon-directive type-name={{type.name}}></field-icon-directive></span> <span class=hidden-xs style=padding-left:0.3em>{{type.value}}</span></div></div></div></div></div><div class="col-xs-10 col-sm-8 current-fields container"><div class=row><div class=col-sm-12><div class="panel panel-default startPage"><div class="panel-heading accordion-toggle collapsed" data-toggle=collapse data-target=#collapseStart><h4 class=text-center>{{ \'WELCOME_SCREEN\' | translate }} <span class=pull-right><i class="fa fa-chevron-right" ng-hide=startPage.isOpen></i> <i class="fa fa-chevron-down" ng-show=startPage.isOpen></i></span></h4></div><div id=collapseStart class="panel-collapse collapse"><div class=panel-body><div class="row hidden-sm hidden-xs"><div class=col-md-12><h4>{{ \'PREVIEW_START_PAGE\' | translate }}</h4></div><ul class="col-md-12 container" style="list-style:none; border:2px lightgray solid; padding-bottom: 2em"><div class="field row"><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1>{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left" style="overflow-wrap: break-word"><p style=color:#ddd>{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.startPage.buttons" class=text-center style=display:inline><button class="btn btn-info" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none; color: inherit">{{button.text}}</a></button></p></div><div class="row form-actions"><button class="btn btn-info btn btn-info col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3" type=button><span style="color:white; font-size: 1.6em; text-decoration: none">{{myform.startPage.introButtonText}}</span></button></div></ul></div><div class=row><div class=col-xs-12><h4>{{ \'EDIT_START_PAGE\' | translate }}</h4><br></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_TITLE\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=myform.startPage.introTitle name=introTitleStartPage value={{myform.startPage.introTitle}} required></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_PARAGRAPH\' | translate }}:</div><div class="col-md-8 col-sm-12"><textarea type=text ng-model=myform.startPage.introParagraph name=introParagraphStartPage></textarea></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'INTRO_BTN\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=myform.startPage.introButtonText name=introButtonText value={{myform.startPage.introButtonText}} required></div></div><div class=row><br><br></div><div class="row options buttons"><div class="col-md-3 col-xs-12">Buttons:</div><div class="col-md-9 col-xs-12"><div ng-repeat="button in myform.startPage.buttons track by button._id" class=row style=padding-bottom:1em><div class=col-xs-5><span>{{ \'BUTTON_TEXT\' | translate }}</span> <input name={{button.text}}_buttonText_startPage ng-model=button.text value={{button.text}} placeholder="Button Text"></div><div class=col-xs-5><span>{{ \'BUTTON_LINK\' | translate }}</span> <input name={{button.url}}_url_startPage ng-model=button.url value={{button.url}} placeholder=http://aeouaou.com/aoeuoa></div><div class=col-xs-2><a class="btn btn-danger btn-mini right" type=button ng-click=deleteButton(button)><i class="fa fa-trash-o"></i></a></div></div><div class=row><br></div><div class=row><button class="btn btn-primary btn-small col-md-offset-6 col-md-6 col-sm-4 col-sm-offset-8 col-xs-4 col-xs-offset-8" type=button ng-click=addButton()><i class="icon-plus icon-white"></i> {{ \'ADD_BUTTON\' | translate }}</button></div></div></div></div></div></div></div></div><div class=row><div class=col-sm-12><hr></div></div><div class=row><div class="col-sm-12 col-md-10 dropzoneContainer"><accordion close-others=accordion.oneAtATime ui-sortable=sortableOptions ng-model=myform.form_fields class=dropzone><accordion-group ng-repeat="field in myform.form_fields track by field._id" is-open=accordion[$index].isOpen on-finish-render=editFormFields ng-if=!field.deletePreserved><accordion-heading><div class=handle><span class=col-xs-1 ng-switch=field.fieldType><field-icon-directive type-name={{field.fieldType}}></field-icon-directive></span> <span class=col-xs-10>{{field.title}} <span ng-show=field.required>*</span></span> <span class=pull-right><i class="fa fa-chevron-right" ng-hide=accordion[$index].isOpen></i> <i class="fa fa-chevron-down" ng-show=accordion[$index].isOpen></i></span></div></accordion-heading><div class="accordion-edit container"><div class="row hidden-sm hidden-xs"><div class=col-md-12><h4>{{ \'PREVIEW_FIELD\' | translate }}</h4></div><ul class="col-md-12 container" style="list-style:none;border:2px lightgray solid"><field-directive field=field validate=false></field-directive></ul><hr></div><div class=row><div class=col-xs-12><h4>{{ \'EDIT_FIELD\' | translate }}</h4><br></div></div><div class="row question"><div class="col-md-4 col-sm-12">{{ \'QUESTION_TITLE\' | translate }}:</div><div class="col-md-8 col-sm-12"><input ng-model=field.title name=title{{field._id}} value={{field.title}} required></div></div><div class=row><br></div><div class="row description" ng-hide=showRatingOptions(field)><div class="col-md-4 col-sm-12">{{ \'QUESTION_DESCRIPTION\' | translate }}:</div><div class="col-md-8 col-sm-12"><textarea type=text ng-model=field.description name=description{{field._id}} value={{field.description}}></textarea></div></div><div class=row ng-show=showAddOptions(field)><br></div><div class="row options" ng-if=showAddOptions(field)><div class="col-md-4 col-xs-12">{{ \'OPTIONS\' | translate }}:</div><div class="col-md-8 col-xs-12"><div ng-repeat="option in field.fieldOptions track by option.option_id" class=row><input name={{option.option_value}}{{field._id}} ng-model=option.option_value class=col-xs-5> <a class="btn btn-danger btn-mini right" type=button ng-click="deleteOption($index, option)" class=col-xs-3><i class="fa fa-trash-o"></i></a></div><div class=row><button class="btn btn-primary btn-small col-md-offset-0 col-md-6 col-sm-4 col-sm-offset-4 col-xs-6 col-xs-offset-6" type=button ng-click=addOption($index)><i class="icon-plus icon-white"></i> {{ \'ADD_OPTION\' | translate }}</button></div></div></div><div class=row ng-show=showRatingOptions(field)><br></div><div class=row ng-if=showRatingOptions(field)><div class="col-md-9 col-sm-9">{{ \'NUM_OF_STEPS\' | translate }}</div><div class="col-md-3 col-sm-3"><input style=width:100% type=number min=1 max=10 ng-model=field.ratingOptions.steps name=ratingOptions_steps{{field._id}} ng-value={{field.ratingOptions.steps}} required></div><br><div class="col-md-5 col-sm-9">Shape:</div><div class="col-md-7 col-sm-3"><select style=width:100% ng-model=field.ratingOptions.shape value={{field.ratingOptions.steps}} name=ratingOptions_shape{{field._id}} required><option ng-repeat="shapeType in field.ratingOptions.validShapes" value={{shapeType}}>{{select2FA[shapeType]}}</option></select></div></div><div class=row><br></div><div class=row><div class="col-md-4 col-xs-12 field-title">Required:</div><div class="col-md-8 col-xs-12 field-input"><label class="btn col-xs-5"><input type=radio ng-value=true ng-model=field.required name="required{{field._id}}"> <span>&nbsp; {{ \'YES\' | translate }}</span></label><label class="btn col-xs-5 col-xs-offset-1"><input type=radio ng-value=false ng-model=field.required name="required{{field._id}}"> <span>&nbsp; {{ \'NO\' | translate }}</span></label></div></div><div class=row><div class="col-md-4 col-xs-12 field-input">Disabled:</div><div class="col-md-8 col-xs-12 field-input"><label class="btn col-xs-5"><input type=radio ng-value=true ng-model=field.disabled name="disabled{{field._id}}"> <span>&nbsp; {{ \'YES\' | translate }}</span></label><label class="btn col-xs-5 col-xs-offset-1"><input type=radio ng-value=false ng-model=field.disabled name="disabled{{field._id}}"> <span>&nbsp; {{ \'NO\' | translate }}</span></label></div></div></div></accordion-group><div class="panel panel-default" style="border-style: dashed; border-color: #a9a9a9"><div class=panel-heading><h4 class="panel-title text-center" style="color: #a9a9a9">{{ \'CLICK_FIELDS_FOOTER\' | translate }}</h4></div></div><hr></accordion></div><div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px"><div class="panel-group tool-panel text-center"><div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if=!field.deletePreserved><div class=panel-heading style="padding: 10px 10px; height: 37px" ng-click=deleteField($index)><span class=text-center><a href="" class="fa fa-trash-o"></a></span></div></div></div></div><div class="col-md-1 hidden-xs hidden-sm" style="padding:0 5px"><div class="panel-group tool-panel text-center"><div class="panel panel-default" ng-repeat="field in myform.form_fields track by field._id" ng-if=!field.deletePreserved><div class=panel-heading style="padding: 10px 10px; height: 37px" ng-click=duplicateField($index)><span class=text-center><a href="" class="fa fa-files-o"></a></span></div></div></div></div></div></div></form>'),$templateCache.put("modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html",'<div class="submissions-table row container"><div class="row text-center analytics"><div class="row col-xs-12 header-numbers">Overview Analytics</div><div class="row col-xs-12 header-title"><div class=col-xs-3>{{ \'TOTAL_VIEWS\' | translate }}</div><div class=col-xs-3>{{ \'RESPONSES\' | translate }}</div><div class=col-xs-3>{{ \'COMPLETION_RATE\' | translate }}</div><div class=col-xs-3>{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div></div><div class="row col-xs-12 header-numbers"><div class=col-xs-3>{{myform.analytics.views}}</div><div class=col-xs-3>{{myform.analytics.submissions}}</div><div class=col-xs-3>{{myform.analytics.conversionRate | number:0}}%</div><div class=col-xs-3>{{AverageTimeElapsed | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class="row col-xs-12 header-numbers">Device Analytics</div><div class="row col-xs-12 detailed-title"><div class=col-xs-3>{{ \'DESKTOP_AND_LAPTOP\' | translate }}</div><div class=col-xs-3>{{ \'TABLETS\' | translate }}</div><div class=col-xs-3>{{ \'PHONES\' | translate }}</div><div class=col-xs-3>{{ \'OTHER\' | translate }}</div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.visits}}</div></div><div class=col-xs-3><div class="row header">{{ \'UNIQUE_VISITS\' | translate }}</div><div class=row>{{DeviceStatistics.other.visits}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.phone.responses}}</div></div><div class=col-xs-3><div class="row header">{{ \'RESPONSES\' | translate }}</div><div class=row>{{DeviceStatistics.other.responses}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.phone.completion}}</div></div><div class=col-xs-3><div class="row header">{{ \'COMPLETION_RATE\' | translate }}</div><div class=row>{{DeviceStatistics.other.completion}}</div></div></div><div class="row col-xs-12 detailed-row"><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.desktop.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.tablet.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.phone.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div><div class=col-xs-3><div class="row header">{{ \'AVERAGE_TIME_TO_COMPLETE\' | translate }}</div><div class=row>{{DeviceStatistics.other.average_time | secondsToDateTime | date:\'mm:ss\'}}</div></div></div><div class="row col-xs-12 text-center" style=font-size:5em>Field Analytics</div><div class="row col-xs-12 field-title-row"><div class=col-xs-3><strong>{{ \'FIELD_TITLE\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_VIEWS\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_RESPONSES\' | translate }}</strong></div><div class=col-xs-3><strong>{{ \'FIELD_DROPOFF\' | translate }}</strong></div></div><div class="row col-xs-12 field-detailed-row" ng-repeat="fieldStats in myform.analytics.fields"><div class=col-xs-3>{{fieldStats.field.title}}</div><div class=col-xs-3>{{fieldStats.totalViews}}</div><div class=col-xs-3>{{fieldStats.responses}}</div><div class=col-xs-3>{{fieldStats.continueRate}}%</div></div></div><br><div class="row col-xs-12 header-numbers text-center" style=font-size:5em>Responses Table</div><div class="row table-tools"><div class=col-xs-2><button class="btn btn-danger" ng-click=deleteSelectedSubmissions() ng-disabled=!isAtLeastOneChecked();><i class="fa fa-trash-o"></i> {{ \'DELETE_SELECTED\' | translate }}</button></div><div class="col-xs-2 col-xs-offset-4 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'xml\')"><small>{{ \'EXPORT_TO_EXCEL\' | translate }}</small></button></div><div class="col-md-2 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'csv\')"><small>{{ \'EXPORT_TO_CSV\' | translate }}</small></button></div><div class="col-md-2 text-right"><button class="btn btn-default" ng-click="exportSubmissions(\'json\')"><small>{{ \'EXPORT_TO_JSON\' | translate }}</small></button></div></div><div class="row table-outer"><div class=col-xs-12><table id=table-submission-data class="table table-striped table-hover table-condensed"><thead><tr><th><input ng-model=table.masterChecker ng-change=toggleAllCheckers() type="checkbox"></th><th>#</th><th data-ng-repeat="(key, value) in myform.form_fields">{{value.title}}</th><th>{{ \'PERCENTAGE_COMPLETE\' | translate }}</th><th>{{ \'TIME_ELAPSED\' | translate }}</th><th>{{ \'DEVICE\' | translate }}</th><th>{{ \'LOCATION\' | translate }}</th><th>{{ \'IP_ADDRESS\' | translate }}</th><th>{{ \'DATE_SUBMITTED\' | translate }} (UTC)</th><th ng-if=myform.autofillPDFs>{{ \'GENERATED_PDF\' | translate }}</th></tr></thead><tbody><tr data-ng-repeat="row in table.rows" ng-click=rowClicked($index) ng-class="{selected: row.selected === true}"><td><input ng-model=row.selected type="checkbox"></td><th class=scope>{{$index+1}}</th><td data-ng-repeat="field in row.form_fields">{{field.fieldValue}}</td><td>{{row.percentageComplete}}%</td><td>{{row.timeElapsed | secondsToDateTime | date:\'mm:ss\'}}</td><td>{{row.device.name}}, {{row.device.type}}</td><td>{{row.geoLocation.city}}, {{row.geoLocation.country_name}}</td><td>{{row.ipAddr}}</td><td>{{row.created | date:\'yyyy-MM-dd HH:mm:ss\'}}</td><td ng-if=row.pdf><a href={{row.pdfFilePath}} download={{row.pdf.name}} target=_self>{{ \'GENERATED_PDF\' | translate }}</a></td></tr></tbody></table></div></div></div>'),
$templateCache.put("modules/forms/base/views/directiveViews/entryPage/startPage.html",'<div class="field row text-center"><div class="col-xs-12 text-center"><h1>{{pageData.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-left"><p style=color:#ddd>{{pageData.introParagraph}}</p></div></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in pageData.buttons" class=text-center style=display:inline><button class="btn btn-info" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none; color: inherit">{{button.text}}</a></button></p></div><div class="row form-actions"><p class="col-xs-3 col-xs-offset-3 text-center"><button class="btn btn-info" type=button><a ng-click=exitpageData() style="color:white; font-size: 1.6em; text-decoration: none">{{ \'CONTINUE_FORM\' | translate }}</a></button></p></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/date.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show="!field.required && !field.fieldValue">{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div class="control-group input-append"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" ng-class="{ \'no-border\': !!field.fieldValue }" ui-date=dateOptions ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled placeholder=MM/DD/YYYY ng-focus="setActiveField(field._id, index, true)" on-tab-key=nextField() on-tab-and-shift-key=prevField() ng-change=$root.nextField()></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/dropdown.html",'<div class="field row dropdown" ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><ui-select ng-model=field.fieldValue theme=selectize search-enabled=true search-by=option_value set-search-to-answer=true ng-required=field.required ng-disabled=field.disabled on-tab-and-shift-key=prevField() on-tab-key=nextField() ng-change=$root.nextField()><ui-select-match placeholder="Type or select an option"></ui-select-match><ui-select-choices repeat="option in field.fieldOptions | filter: $select.search" ng-class="{\'active\': option.option_value === field.fieldValue }"><span ng-bind-html="option.option_value | highlight: $select.search"></span></ui-select-choices></ui-select></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/file.html",'<div class="field row" ng-if=form.autofillPDFs ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3></div><div class="col-sm-8 field-input"><div class=input-group><div tabindex=-1 class="form-control file-caption"><span class=file-caption-ellipsis ng-if=!form.pdf>…</span><div class=file-caption-name ng-if=form.pdf>{{field.file.originalname}}</div></div><div class=input-group-btn><button type=button ng-if=field.file ng-click=removeFile(field); title="Clear selected files" class="btn btn-danger fileinput-remove fileinput-remove-button"><i class="glyphicon glyphicon-trash"></i> {{ \'DELETE\' | translate }}</button> <button type=button ng-if=field.fileLoading title="Abort ongoing upload" class="btn btn-default" ng-click=cancelFileUpload(field)><i class="glyphicon glyphicon-ban-circle"></i> {{ \'CANCEL\' | translate }}</button><div class="btn btn-success btn-file" ngf-select ngf-change=uploadPDF($files) ng-if=!field.file><i class="glyphicon glyphicon-upload"></i> {{ UPLOAD_FILE | translate }}</div></div></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/hidden.html",'<input ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=hidden ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value={{field.fieldValue}} ng-disabled=field.disabled>'),$templateCache.put("modules/forms/base/views/directiveViews/field/legal.html",'<div class="field row radio legal" on-enter-or-tab-key=nextField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><br><p class=col-xs-12>{{field.description}}</p></div><div class="col-xs-12 field-input container"><div class=row-fluid on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField()><label class="btn col-md-5 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'true\'}"><input class=focusOn ng-focus="setActiveField(field._id, index, true)" ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=true ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"><div class=letter style=float:left>Y</div><span>{{ \'LEGAL_ACCEPT\' | translate }}</span></label><label class="btn col-md-5 col-md-offset-1 col-xs-12" ng-class="{activeBtn: field.fieldValue == \'false\'}"><input class=focusOn ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" type=radio value=false ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"><div class=letter style=float:left>N</div><span>{{ \'LEGAL_NO_ACCEPT\' | translate }}</span></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/radio.html",'<div class="field row radio" on-enter-or-tab-key=nextField() key-to-option field=field ng-if="field.fieldOptions.length > 0"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><div ng-repeat="option in field.fieldOptions" class=row-fluid><label class="btn col-md-4 col-xs-12 col-sm-12" style="margin: 0.5em; padding-left:30px" ng-class="{activeBtn: field.fieldValue == field.fieldOptions[$index].option_value}"><div class=letter style=float:left>{{$index+1}}</div><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" style=visibility:hidden type=radio class=focusOn ng-focus="setActiveField(field._id, index, true)" value={{option.option_value}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled ng-change="$root.nextField()"> <span ng-bind=option.option_value style="white-space: normal"></span></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/field/rating.html",'<div class="textfield field row" on-enter-or-tab-key=nextField()><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input-stars max={{field.ratingOptions.steps}} ng-init="field.fieldValue = 1" on-star-click=$root.nextField() icon-full={{field.ratingOptions.shape}} icon-base="fa fa-3x" icon-empty={{field.ratingOptions.shape}} ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-disabled=field.disabled on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)" class="angular-input-stars focusOn"></input-stars></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/statement.html",'<div class="statement field row" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-focus="setActiveField(field._id, index, true)"><div class="row field-title field-title"><div class=col-xs-1><i class="fa fa-quote-left fa-1"></i></div><h2 class="text-left col-xs-9">{{field.title}}</h2><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="row field-title field-input"><p class=col-xs-12 ng-if=field.description.length>{{field.description}}</p><br><div class="col-xs-offset-1 col-xs-11"><button class="btn focusOn" ng-style="{\'font-size\': \'1.3em\', \'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-focused="setActiveField(field._id, index, true)" ng-click=$root.nextField()>{{ \'CONTINUE\' | translate }}</button></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/textarea.html",'<div class="field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><small>{{ \'NEWLINE\' | translate }}</small><p><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><small style=font-size:0.6em>Press SHIFT+ENTER to add a newline</small><textarea class="textarea focusOn" type=text ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-class="{ \'no-border\': !!field.fieldValue }" value={{field.fieldValue}} ng-required=field.required ng-disabled=field.disabled ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() style="border: none; border-left: lightgrey dashed 2px">\n </textarea></div></div><div><div class="btn btn-lg btn-default hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=$root.nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-sm-3 col-xs-6" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/textfield.html",'<div class="textfield field row" ng-click="setActiveField(field._id, index, true)"><div class="col-xs-12 field-title row-fluid" ng-style="{\'color\': design.colors.questionColor}"><h3 class=col-xs-12><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>({{ \'OPTIONAL\' | translate }})</span></h3><p class=col-xs-12><small>{{field.description}}</small></p></div><div class="col-xs-12 field-input"><input ng-style="{\'color\': design.colors.answerColor, \'border-color\': design.colors.answerColor}" name={{field.fieldType}}{{index}} type={{field.input_type}} ng-pattern=field.validateRegex placeholder={{field.placeholder}} ng-class="{ \'no-border\': !!field.fieldValue }" class="focusOn text-field-input" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" value=field.fieldValue ng-focus="setActiveField(field._id, index, true)" on-enter-or-tab-key=nextField() on-tab-and-shift-key=prevField() ng-required=field.required ng-disabled=field.disabled aria-describedby=inputError2Status></div><div class=col-xs-12><div ng-show="forms.myForm.{{field.fieldType}}{{index}}.$invalid && !!forms.myForm.{{field.fieldType}}{{index}}.$viewValue " class="alert alert-danger" role=alert><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>Error:</span> <span ng-if="field.fieldType == \'email\'">{{ \'ERROR_EMAIL_INVALID\' | translate }}</span> <span ng-if=field.validateRegex>{{ \'ERROR_NOT_A_NUMBER\' | translate }}</span> <span ng-if="field.fieldType == \'link\'">{{ \'ERROR_URL_INVALID\' | translate }}</span></div></div></div><div><div class="btn btn-lg btn-default hidden-xs" style="padding: 4px; margin-top:8px; background: rgba(255,255,255,0.5)"><button ng-disabled="!field.fieldValue || forms.myForm.{{field.fieldType}}{{$index}}.$invalid" ng-style="{\'background-color\':design.colors.buttonColor, \'color\':design.colors.buttonTextColor}" ng-click=$root.nextField() class="btn col-sm-5 col-xs-5">{{ \'OK\' | translate }} <i class="fa fa-check"></i></button><div class="col-xs-6 col-sm-3" style=margin-top:0.2em><small style="color:#ddd; font-size:70%">{{ \'ENTER\' | translate }}</small></div></div></div>'),$templateCache.put("modules/forms/base/views/directiveViews/field/yes_no.html",'<div class="field row radio" ng-click="setActiveField(field._id, index, true)" on-tab-and-shift-key=prevField() key-to-truthy key-char-truthy=y key-char-falsey=n field=field><div class="col-xs-12 field-title" ng-style="{\'color\': design.colors.questionColor}"><h3 class=row><small class=field-number>{{index+1}} <i class="fa fa-angle-double-right" aria-hidden=true></i></small> {{field.title}} <span class=required-error ng-show=!field.required>{{ \'OPTIONAL\' | translate }}</span></h3><p class=row>{{field.description}}</p></div><div class="col-xs-12 field-input"><div class="row col-xs-12"><label class="btn btn-default" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=true class=focusOn style="opacity: 0; margin-left: 0px" ng-model=field.fieldValue ng-focus="setActiveField(field._id, index, true)" ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled="field.disabled"><div class=letter>{{ \'Y\' | translate }}</div><span>{{ \'YES\' | translate }}</span> <i ng-show="field.fieldValue === \'true\'" class="fa fa-check" aria-hidden=true></i></label></div><div class="row col-xs-12" style="margin-top: 10px"><label class="btn btn-default" style="background: rgba(0,0,0,0.1); text-align:left"><input type=radio value=false style="opacity:0; margin-left:0px" ng-model=field.fieldValue ng-model-options="{ debounce: 250 }" ng-required=field.required ng-change=$root.nextField() ng-disabled="field.disabled"><div class=letter>{{ \'N\' | translate }}</div><span>{{ \'NO\' | translate }}</span> <i ng-show="field.fieldValue === \'false\'" class="fa fa-check" aria-hidden=true></i></label></div></div></div><br>'),$templateCache.put("modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'<section class="overlay submitform" ng-if="loading || (!myform.submitted && !myform.startPage.showStart)"></section><div ng-show="!myform.submitted && myform.startPage.showStart" class=form-submitted style="padding-top: 35vh"><div class=row><div class="col-xs-12 text-center" style="overflow-wrap: break-word"><h1 style="font-weight: 400; nont-size: 25px">{{myform.startPage.introTitle}}</h1></div><div class="col-xs-10 col-xs-offset-1 text-center" style="overflow-wrap: break-word"><p style="color: grey; font-weight: 100; font-size: 16px">{{myform.startPage.introParagraph}}</p></div></div><div class="row form-actions text-center" style="padding: 5px 25px 5px 25px"><button ng-click=exitStartPage() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{myform.startPage.introButtonText}}</span></button></div><div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em"><p ng-repeat="button in myform.startPage.buttons" class=text-center style=display:inline><button class=btn style="background-color:rgb(156, 226, 235)" type=button ng-style="{\'background-color\':button.bgColor, \'color\':button.color}"><a href={{button.url}} style="font-size: 1.6em; text-decoration: none" ng-style="{\'color\':button.color}">{{button.text}}</a></button></p></div></div><div class=form-fields ng-show="!myform.submitted && !myform.startPage.showStart" ng-style="{ \'border-color\': myform.design.colors.buttonTextColor }"><div class=row><form name=forms.myForm novalidate class="submission-form col-sm-12 col-md-offset-1 col-md-10"><div ng-repeat="field in myform.form_fields" ng-if=!field.deletePreserved data-index={{$index}} data-id={{field._id}} ng-class="{activeField: selected._id == field._id }" class="row field-directive"><field-directive field=field design=myform.design index=$index forms=forms></field-directive></div></form></div><div class="row form-actions" id=submit_field ng-class="{activeField: selected._id == \'submit_field\' }" ng-style="{ \'background-color\':myform.design.colors.buttonColor}" style="border-top: 1px solid #ddd; margin-right: -13%; margin-left: -13%; margin-top: 30vh; height: 100vh"><div class="col-xs-12 text-left" style="background-color:#990000; color:white" ng-if=forms.myForm.$invalid>{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}</div><button ng-if=!forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" v-busy=loading v-busy-label="Please wait" v-pressable ng-disabled="loading || forms.myForm.$invalid" ng-click=submitForm() on-enter-key=submitForm() on-enter-key-disabled="loading || forms.myForm.$invalid" ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" style="font-size: 1.6em; margin-left: 1em; margin-top: 1em">{{ \'SUBMIT\' | translate }}</button> <button ng-if=forms.myForm.$invalid class="Button btn col-sm-2 col-xs-8 focusOn" ng-click=goToInvalid() on-enter-key=goToInvalid() on-enter-key-disabled=!forms.myForm.$invalid style="font-size: 1.6em; margin-left: 1em; margin-top: 1em; background-color:#990000; color:white">{{ \'REVIEW\' | translate }}</button><div class="col-sm-2 hidden-xs" style="font-size: 75%; margin-top:3.25em"><small>{{ \'ENTER\' | translate }}</small></div></div><section ng-if=!myform.hideFooter class="navbar navbar-fixed-bottom" ng-style="{ \'background-color\':myform.design.colors.buttonColor, \'padding-top\': \'15px\', \'border-top\': \'2px \'+ myform.design.colors.buttonTextColor +\' solid\', \'color\':myform.design.colors.buttonTextColor}"><div class=container-fluid><div class=row><div class="col-sm-5 col-md-6 col-xs-5" ng-show=!myform.submitted><p class=lead>{{ \'ADVANCEMENT\' | translate:translateAdvancementData }}</p></div><div class="col-md-6 col-md-offset-0 col-sm-offset-2 col-sm-3 col-xs-offset-1 col-xs-6 row"><div class="col-md-4 col-md-offset-2 hidden-sm hidden-xs" ng-if=!authentication.isAuthenticated()><a href=/#!/forms class=btn ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}">{{ \'CREATE_FORM\' | translate }}</a></div><div class="col-md-4 col-md-offset-2 hidden-sm hidden-xs" ng-if=authentication.isAuthenticated()><a href=/#!/forms/{{myform._id}}/admin/create ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" class=btn>{{ \'EDIT_FORM\' | translate }}</a></div><div class="col-md-4 col-sm-10 col-md-offset-0 col-sm-offset-2 col-xs-12 row"><button class="btn btn-lg col-xs-6" id=focusDownButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=nextField() ng-disabled="selected.index > myform.form_fields.length-1"><i class="fa fa-chevron-down"></i></button> <button class="btn btn-lg col-xs-6" id=focusUpButton ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}" ng-click=prevField() ng-disabled="selected.index == 0"><i class="fa fa-chevron-up"></i></button></div></div></div></div></section></div><div ng-if="myform.submitted && !loading" class=form-submitted ng-style="{\'color\':myform.design.colors.buttonTextColor}" style="padding-top: 5vh"><div class="field row text-center"><div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3 text-center">{{ \'FORM_SUCCESS\' | translate }}</div></div><div class="row form-actions"><p class=text-center><button ng-click=reloadForm() class=btn type=button ng-style="{\'background-color\':myform.design.colors.buttonColor, \'color\':myform.design.colors.buttonTextColor}"><span style="font-size: 1.6em">{{ \'BACK_TO_FORM\' | translate }}</span></button></p></div></div>'),$templateCache.put("modules/users/views/authentication/access-denied.client.view.html","<section class=\"row text-center auth\"><h3 class=col-md-12>{{ 'ACCESS_DENIED_TEXT' | translate }}</h3><a href=/#!/sigin class=col-md-12>{{ 'SIGNIN_BTN' | translate }}</a></section>"),$templateCache.put("modules/users/views/authentication/signin.client.view.html","<section class=\"row auth\" data-ng-controller=AuthenticationController><h3 class=\"col-md-12 text-center\">{{ 'SIGNIN_HEADER_TEXT' | translate }}</h3><div class=\"col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6\"><form class=\"signin form-horizontal\" autocomplete=off><fieldset><div data-ng-show=error class=\"text-center text-danger\">Error: <strong data-ng-bind=error></strong></div><div class=form-group><label for=username>{{ 'USERNAME_LABEL' | translate }}</label><input id=username name=username class=form-control data-ng-model=credentials.username placeholder=\"{{ 'USERNAME_LABEL' | translate }}\" ng-pattern=languageRegExp ng-minlength=4></div><div class=form-group><label for=password>{{ 'PASSWORD_LABEL' | translate }}</label><input type=password id=password name=password class=form-control data-ng-model=credentials.password placeholder=\"{{ 'PASSWORD_LABEL' | translate }}\"></div><div class=forgot-password><a ui-sref=forgot>{{ 'FORGOT_PASSWORD_LINK' | translate }}</a><br><a ui-sref=verify>{{ 'REVERIFY_ACCOUNT_LINK' | translate }}</a></div><div class=\"text-center form-group\"><button class=\"btn btn-primary\" ng-click=signin()>{{ 'SIGNIN_BTN' | translate }}</button> <span ng-hide=$root.signupDisabled>&nbsp; or&nbsp; <a ui-sref=signup>{{ 'SIGNUP_BTN' | translate }}</a></span></div></fieldset></form></div></section>"),$templateCache.put("modules/users/views/authentication/signup-success.client.view.html",'<section class="row auth signup-view success" data-ng-controller=AuthenticationController><h3 class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6 text-center">{{ \'SUCCESS_HEADER\' | translate }}</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><h2>{{ \'SUCCESS_TEXT\' | translate }}<br><br>{{ \'NOT_ACTIVATED_YET\' | translate }}</h2><br><br><p><strong>{{ \'BEFORE_YOU_CONTINUE\' | translate }}</strong> <a href=mail:polydaic@gmail.com>polydaic@gmail.com</a></p><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary"><a href="/#!/" style="color: white; text-decoration: none">Continue</a></button></div></div></section>'),$templateCache.put("modules/users/views/authentication/signup.client.view.html",'<section class="row auth signup-view" data-ng-controller=AuthenticationController><h3 class="col-md-12 text-center">{{ \'SIGNUP_HEADER_TEXT\' | translate }}</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form name=userForm data-ng-submit=signup() class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=error id=signup_errors class="text-center text-danger">{{\'SIGNUP_ERROR_TEXT\' | translate}}:<br><strong data-ng-bind=error></strong></div><div class=form-group><label for=firstName>{{ \'FIRST_NAME_LABEL\' | translate }}</label><input ng-pattern="/^[a-zA-Z0-9 \\-.]*$/" required id=firstName name=firstName class=form-control ng-model=credentials.firstName placeholder="First Name"></div><div class=form-group><label for=lastName>{{ \'LAST_NAME_LABEL\' | translate }}</label><input ng-pattern="/^[a-zA-Z0-9 \\-.]*$/" required id=lastName name=lastName class=form-control ng-model=credentials.lastName placeholder="Last Name"></div><div class="row form-group"><div class=field-title><b>{{ \'LANGUAGE_LABEL\' | translate }}</b></div><div class=field-input><select ng-model=user.language required><option ng-repeat="language in languages" ng-selected="language == user.language" value={{language}}>{{language}}</option></select></div></div><hr><div class=form-group><label for=username>{{ \'USERNAME_LABEL\' | translate }}</label><input id=username name=username class=form-control ng-pattern=languageRegExp ng-minlength=4 ng-model=credentials.username placeholder=Username></div><div class=form-group><label for=email>{{ \'EMAIL_LABEL\' | translate }}</label><input type=email id=email name=email class=form-control ng-model=credentials.email placeholder=Email></div><div class=form-group><label for=password>{{ \'PASSWORD_LABEL\' | translate }}</label><input type=password id=password name=password class=form-control ng-model=credentials.password placeholder=Password></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">{{ \'SIGNUP_BTN\' | translate }}</button></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/password/forgot-password.client.view.html",'<section class="auth row" data-ng-controller=PasswordController><h3 class="col-md-12 text-center">{{ \'PASSWORD_RESTORE_HEADER\' | translate }}</h3><p class="small text-center">{{ \'ENTER_YOUR_EMAIL\' | translate }}</p><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=askForPasswordReset() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><input id=username name=username class=form-control data-ng-model=credentials.username placeholder="{{ \'USERNAME_LABEL\' | translate }}"></div><div class="text-center form-group"><button type=submit class="btn btn-primary">{{ \'UPDATE_PASSWORD_LABEL\' | translate }}</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/password/reset-password-invalid.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_INVALID' | translate }}</h3><a href=/#!/password/forgot class=col-md-12>{{ 'ASK_FOR_NEW_PASSWORD' | translate }}</a></section>"),$templateCache.put("modules/users/views/password/reset-password-success.client.view.html","<section class=\"row text-center\"><h3 class=col-md-12>{{ 'PASSWORD_RESET_SUCCESS' | translate }}</h3><a href=\"/#!/\" class=col-md-12>{{ 'CONTINUE_TO_LOGIN' | translate }}</a></section>"),$templateCache.put("modules/users/views/password/reset-password.client.view.html",'<section class="row auth" data-ng-controller=PasswordController><h3 class="col-md-12 text-center">Reset your password</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resetUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="New Password"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="Verify Password"></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">Update Password</button></div><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div data-ng-show=success class="text-center text-success"><strong>{{success}}</strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/settings/change-password.client.view.html",'<section class="row auth" data-ng-controller=SettingsController><h3 class="col-md-12 text-center">Change your password</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=changeUserPassword() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><label for=currentPassword>Current Password</label><input type=password id=currentPassword name=currentPassword class=form-control data-ng-model=passwordDetails.currentPassword placeholder="Current Password"></div><hr><div class=form-group><label for=newPassword>{{ \'NEW_PASSWORD_LABEL\' | translate }}</label><input type=password id=newPassword name=newPassword class=form-control data-ng-model=passwordDetails.newPassword placeholder="New Password"></div><div class=form-group><label for=verifyPassword>{{ \'VERIFY_PASSWORD_LABEL\' | translate }}</label><input type=password id=verifyPassword name=verifyPassword class=form-control data-ng-model=passwordDetails.verifyPassword placeholder="Verify Password"></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary">{{ \'SAVE_PASSWORD_BTN\' | translate }}</button></div><div data-ng-show=success class="text-center text-success"><strong>{{ \'PASSWORD_CHANGE_SUCCESS\' | translate }}</strong></div><div data-ng-show=error class="text-center text-danger"><strong data-ng-bind=error></strong></div></fieldset></form></div></section>'),$templateCache.put("modules/users/views/settings/edit-profile.client.view.html",'1<section class="row auth" data-ng-controller=SettingsController><h3 class="col-xs-offset-1 col-xs-10 text-center">Edit your profile</h3><div class="col-xs-offset-3 col-xs-6"><form name=userForm data-ng-submit=updateUserProfile(userForm.$valid) class="signin form-horizontal" autocomplete=off><fieldset><div data-ng-show=success class="text-center text-success"><strong>{{ \'PROFILE_SAVE_SUCCESS\' | translate }}</strong></div><div data-ng-show=error class="text-center text-danger">{{ \'PROFILE_SAVE_ERROR\' | translate }}<br><strong data-ng-bind=error></strong></div><div class="form-group row"><div class="col-xs-7 field-title"><b>{{ \'FIRST_NAME_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><input id=firstName name=firstName class=form-control data-ng-model=user.firstName placeholder="First Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class="form-group row"><div class="col-xs-7 field-title"><b>Last Name</b></div><div class="col-xs-12 field-input"><input id=lastName name=lastName class=form-control data-ng-model=user.lastName placeholder="Last Name" ng-pattern="/^[a-zA-Z0-9 \\-.]*$/"></div></div><div class=row><hr></div><div class="row form-group"><div class="col-xs-7 field-title"><b>{{ \'LANGUAGE_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><select ng-model=user.language required><option ng-repeat="language in languages" ng-selected="language == user.language" value={{language}}>{{language}}</option></select></div></div><div class="row form-group"><div class="col-xs-7 field-title"><b>Username</b></div><div class="col-xs-12 field-input"><input id=username name=username class=form-control data-ng-model=user.username placeholder=Username></div></div><div class="row form-group"><div class="col-xs-7 field-title"><b>{{ \'EMAIL_LABEL\' | translate }}</b></div><div class="col-xs-12 field-input"><input type=email id=email name=email class=form-control data-ng-model=user.email placeholder=Email></div></div><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary" style=font-size:1.6em>{{ \'SUBMIT_BTN\' | translate }}</button></div></fieldset></form></div></section>'),
$templateCache.put("modules/users/views/settings/social-accounts.client.view.html",'<section class="row auth" data-ng-controller=SettingsController><h3 class="col-md-12 text-center" data-ng-show=hasConnectedAdditionalSocialAccounts()>Connected social accounts:</h3><div class="col-md-12 text-center"><div data-ng-repeat="(providerName, providerData) in user.additionalProvidersData" class=remove-account-container><img ng-src=/modules/users/img/buttons/{{providerName}}.png> <a class="btn btn-danger btn-remove-account" data-ng-click=removeUserSocialAccount(providerName)><i class="glyphicon glyphicon-trash"></i></a></div></div><h3 class="col-md-12 text-center">Connect other social accounts:</h3><div class="col-md-12 text-center"><a href=/auth/facebook data-ng-hide="isConnectedSocialAccount(\'facebook\')" class=undecorated-link><img src=/modules/users/img/buttons/facebook.png></a> <a href=/auth/twitter data-ng-hide="isConnectedSocialAccount(\'twitter\')" class=undecorated-link><img src=/modules/users/img/buttons/twitter.png></a> <a href=/auth/google data-ng-hide="isConnectedSocialAccount(\'google\')" class=undecorated-link><img src=/modules/users/img/buttons/google.png></a> <a href=/auth/linkedin data-ng-hide="isConnectedSocialAccount(\'linkedin\')" class=undecorated-link><img src=/modules/users/img/buttons/linkedin.png></a> <a href=/auth/github data-ng-hide="isConnectedSocialAccount(\'github\')" class=undecorated-link><img src=/modules/users/img/buttons/github.png></a></div></section>'),$templateCache.put("modules/users/views/verify/resend-verify-email.client.view.html",'<section class="auth row" data-ng-controller=VerifyController><section ng-if=!isResetSent><h3 class="col-md-12 text-center">Resend your account verification email</h3><p class="small text-center">Enter your account email.</p><div data-ng-show=error class="text-center text-danger"><strong>{{error}}</strong></div><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><form data-ng-submit=resendVerifyEmail() class="signin form-horizontal" autocomplete=off><fieldset><div class=form-group><input id=email name=email class=form-control data-ng-model=credentials.email placeholder=bob@example.com></div><div class="text-center form-group"><button type=submit class="btn btn-primary" ng-click=resendVerifyEmail()>{{ \'SUBMIT_BTN\' | translate }}</button></div></fieldset></form></div></section><section ng-if=isResetSent><h3 class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6 text-center">Verification Email has been Sent</h3><div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6"><h2>{{ \'VERIFICATION_EMAIL_SENT\' | translate }} {{username}}.<br>{{ \'NOT_ACTIVATED_YET\' | translate }}</h2><p>{{ \'CHECK_YOUR_EMAIL\' | translate }} <a href=mail:polydaic@gmail.com>polydaic@gmail.com</a></p><div class="text-center form-group"><button type=submit class="btn btn-large btn-primary"><a href="/#!/" style=color:white>Continue</a></button></div></div></section></section>'),$templateCache.put("modules/users/views/verify/verify-account.client.view.html","<section style=margin-top:50px class=\"row text-center\" data-ng-controller=VerifyController ng-init=validateVerifyToken()><section class=\"row text-center\" ng-if=isResetSent><h3 class=col-md-12></h3><a href=/#!/signin class=col-md-12>{{ 'CONTINUE_TO_LOGIN' | translate }}</a></section><section class=\"row text-center\" ng-if=!isResetSent><h3 class=col-md-12>{{ 'VERIFY_ERROR' | translate }}</h3><a href=/#!/verify class=col-md-6>{{ 'REVERIFY_ACCOUNT_LINK' | translate }}</a> <a href=/#!/signin class=col-md-6>{{ 'SIGNIN_BTN' | translate }}</a></section></section>")}]),ApplicationConfiguration.registerModule("core",["users"]),ApplicationConfiguration.registerModule("forms",["ngFileUpload","ui.router.tabs","ui.date","ui.sortable","angular-input-stars","users"]),ApplicationConfiguration.registerModule("users"),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{PDF_GENERATION_EMR:"PDF Generation/EMR",SAVE_PDF_SUBMISSIONS:"Save Submissions as PDFs?",UPLOAD_YOUR_PDF:"Upload Your PDF Template",ADVANCED_SETTINGS:"Advanced Settings",FORM_NAME:"Form Name",FORM_STATUS:"Form Status",PUBLIC:"Public",PRIVATE:"Private",GA_TRACKING_CODE:"Google Analytics Tracking Code",DISPLAY_FOOTER:"Display Form Footer?",SAVE_CHANGES:"Save Changes",CANCEL:"Cancel",CREATE_A_NEW_FORM:"Create a new form",CREATE_FORM:"Create form",CREATED_ON:"Created on",ARE_YOU_SURE:"Are you ABSOLUTELY sure?",READ_WARNING:"Unexpected bad things will happen if you dont read this!",DELETE_WARNING1:"This action CANNOT be undone.This will permanently delete the",DELETE_WARNING2:"form, form submissions and remove all associated pdfs.",DELETE_CONFIRM:"Please type in the name of the form to confirm",I_UNDERSTAND:"I understand the consequences, delete this form",DELETE_FORM_SM:"Delete",DELETE_FORM_MD:"Delete Form",DELETE:"Delete",FORM:"Form",VIEW:"View",LIVE:"Live",PREVIEW:"Preview",ADD_FIELD_LG:"Click to Add New Field",ADD_FIELD_MD:"Add New Field",ADD_FIELD_SM:"Add Field",PREVIEW_START_PAGE:"Preview Welcome Screen",EDIT_START_PAGE:"Edit Welcome Screen",WELCOME_SCREEN:"Welcome Screen",INTRO_TITLE:"Intro Title",INTRO_PARAGRAPH:"Intro Paragraph",INTRO_BTN:"Intro Button",BUTTONS:"Buttons",BUTTON_TEXT:"Text",BUTTON_LINK:"Link",ADD_BUTTON:"Add Button",PREVIEW_FIELD:"Preview Field",EDIT_FIELD:"Edit Field",QUESTION_TITLE:"Question Title",QUESTION_DESCRIPTION:"Question Description",OPTIONS:"Options",ADD_OPTION:"Add Option",NUM_OF_STEPS:"Number of Steps",CLICK_FIELDS_FOOTER:"Click on fields to add them here",TOTAL_VIEWS:"total unique visits",RESPONSES:"responses",COMPLETION_RATE:"completion rate",AVERAGE_TIME_TO_COMPLETE:"avg. completion time",DESKTOP_AND_LAPTOP:"Desktops",TABLETS:"Tablets",PHONES:"Phones",OTHER:"Other",UNIQUE_VISITS:"Unique Visits",FIELD_TITLE:"Field Title",FIELD_VIEWS:"Field Views",FIELD_DROPOFF:"Field Completion",FIELD_RESPONSES:"Field Responses",DELETE_SELECTED:"Delete Selected",EXPORT_TO_EXCEL:"Export to Excel",EXPORT_TO_CSV:"Export to CSV",EXPORT_TO_JSON:"Export to JSON",PERCENTAGE_COMPLETE:"Percentage Complete",TIME_ELAPSED:"Time Elapsed",DEVICE:"Device",LOCATION:"Location",IP_ADDRESS:"IP Address",DATE_SUBMITTED:"Date Submitted",GENERATED_PDF:"Generated PDF",BACKGROUND_COLOR:"Background Color",DESIGN_HEADER:"Change how your Form Looks",QUESTION_TEXT_COLOR:"Question Text Color",ANSWER_TEXT_COLOR:"Answer Text Color",BTN_BACKGROUND_COLOR:"Button Background Color",BTN_TEXT_COLOR:"Button Text Color",CREATE_TAB:"Create",DESIGN_TAB:"Design",CONFIGURE_TAB:"Configure",ANALYZE_TAB:"Analyze"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{FORM_SUCCESS:"Form entry successfully submitted!",REVIEW:"Review",BACK_TO_FORM:"Go back to Form",EDIT_FORM:"Edit this TellForm",CREATE_FORM:"Create this TellForm",ADVANCEMENT:"{{done}} out of {{total}} answered",CONTINUE_FORM:"Continue to Form",REQUIRED:"required",COMPLETING_NEEDED:"{{answers_not_completed}} answer(s) need completing",OPTIONAL:"optional",ERROR_EMAIL_INVALID:"Please enter a valid email address",ERROR_NOT_A_NUMBER:"Please enter valid numbers only",ERROR_URL_INVALID:"Please a valid url",OK:"OK",ENTER:"press ENTER",YES:"Yes",NO:"No",NEWLINE:"press SHIFT+ENTER to create a newline",CONTINUE:"Continue",LEGAL_ACCEPT:"I accept",LEGAL_NO_ACCEPT:"I dont accept",DELETE:"Delete",CANCEL:"Cancel",SUBMIT:"Submit",UPLOAD_FILE:"Upload your File"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{FORM_SUCCESS:"Votre formulaire a été enregistré!",REVIEW:"Incomplet",BACK_TO_FORM:"Retourner au formulaire",EDIT_FORM:"Éditer le Tellform",CREATE_FORM:"Créer un TellForm",ADVANCEMENT:"{{done}} complétés sur {{total}}",CONTINUE_FORM:"Aller au formulaire",REQUIRED:"obligatoire",COMPLETING_NEEDED:"{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)",OPTIONAL:"facultatif",ERROR_EMAIL_INVALID:"Merci de rentrer une adresse mail valide",ERROR_NOT_A_NUMBER:"Merce de ne rentrer que des nombres",ERROR_URL_INVALID:"Merci de rentrer une url valide",OK:"OK",ENTER:"presser ENTRÉE",YES:"Oui",NO:"Non",NEWLINE:"presser SHIFT+ENTER pour créer une nouvelle ligne",CONTINUE:"Continuer",LEGAL_ACCEPT:"Jaccepte",LEGAL_NO_ACCEPT:"Je naccepte pas",DELETE:"Supprimer",CANCEL:"Réinitialiser",SUBMIT:"Enregistrer",UPLOAD_FILE:"Envoyer un fichier",Y:"O",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("de",{FORM_SUCCESS:"Ihre Angaben wurden gespeichert.",REVIEW:"Unvollständig",BACK_TO_FORM:"Zurück zum Formular",EDIT_FORM:"Bearbeiten Sie diese TellForm",CREATE_FORM:"Erstellen Sie eine TellForm",ADVANCEMENT:"{{done}} von {{total}} beantwortet",CONTINUE_FORM:"Zum Formular",REQUIRED:"verpflichtend",COMPLETING_NEEDED:"Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)",OPTIONAL:"fakultativ",ERROR_EMAIL_INVALID:"Bitte gültige Mailadresse eingeben",ERROR_NOT_A_NUMBER:"Bitte nur Zahlen eingeben",ERROR_URL_INVALID:"Bitte eine gültige URL eingeben",OK:"Okay",ENTER:"Eingabetaste drücken",YES:"Ja",NO:"Nein",NEWLINE:"Für eine neue Zeile SHIFT+ENTER drücken",CONTINUE:"Weiter",LEGAL_ACCEPT:"Ich akzeptiere",LEGAL_NO_ACCEPT:"Ich akzeptiere nicht",DELETE:"Entfernen",CANCEL:"Canceln",SUBMIT:"Speichern",UPLOAD_FILE:"Datei versenden",Y:"J",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("it",{FORM_SUCCESS:"Il formulario è stato inviato con successo!",REVIEW:"Incompleto",BACK_TO_FORM:"Ritorna al formulario",EDIT_FORM:"Modifica questo Tellform",CREATE_FORM:"Creare un TellForm",ADVANCEMENT:"{{done}} su {{total}} completate",CONTINUE_FORM:"Vai al formulario",REQUIRED:"obbligatorio",COMPLETING_NEEDED:"{{answers_not_completed}} risposta/e deve/ono essere completata/e",OPTIONAL:"opzionale",ERROR_EMAIL_INVALID:"Si prega di inserire un indirizzo email valido",ERROR_NOT_A_NUMBER:"Si prega di inserire solo numeri",ERROR_URL_INVALID:"Grazie per inserire un URL valido",OK:"OK",ENTER:"premere INVIO",YES:"Sì",NO:"No",NEWLINE:"premere SHIFT+INVIO per creare una nuova linea",CONTINUE:"Continua",LEGAL_ACCEPT:"Accetto",LEGAL_NO_ACCEPT:"Non accetto",DELETE:"Cancella",CANCEL:"Reset",SUBMIT:"Registra",UPLOAD_FILE:"Invia un file",Y:"S",N:"N"})}]),angular.module("forms").config(["$translateProvider",function($translateProvider){$translateProvider.translations("es",{FORM_SUCCESS:"¡El formulario ha sido enviado con éxito!",REVIEW:"Revisar",BACK_TO_FORM:"Regresar al formulario",EDIT_FORM:"Crear un TellForm",CREATE_FORM:"Editar este TellForm",ADVANCEMENT:"{{done}} de {{total}} contestadas",CONTINUE_FORM:"Continuar al formulario",REQUIRED:"Información requerida",COMPLETING_NEEDED:"{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)",OPTIONAL:"Opcional",ERROR_EMAIL_INVALID:"Favor de proporcionar un correo electrónico válido",ERROR_NOT_A_NUMBER:"Por favor, introduzca sólo números válidos",ERROR_URL_INVALID:"Favor de proporcionar un url válido",OK:"OK",ENTER:"pulse INTRO",YES:"Si",NO:"No",NEWLINE:"presione SHIFT+INTRO para crear una nueva línea",CONTINUE:"Continuar",LEGAL_ACCEPT:"Acepto",LEGAL_NO_ACCEPT:"No acepto",DELETE:"Eliminar",CANCEL:"Cancelar",SUBMIT:"Registrar",UPLOAD_FILE:"Cargar el archivo",Y:"S",N:"N"})}]),angular.module("core").config(["$stateProvider","$urlRouterProvider",function($stateProvider,$urlRouterProvider,Authorization){$urlRouterProvider.otherwise("/forms")}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","$state","$stateParams",function($rootScope,Auth,$state,$stateParams){$rootScope.$state=$state,$rootScope.$stateParams=$stateParams,$rootScope.$on("$stateChangeSuccess",function(event,toState,toParams,fromState){$state.previous=fromState;var statesToIgnore=["home","signin","resendVerifyEmail","verify","signup","signup-success","forgot","reset-invalid","reset","reset-success"];statesToIgnore.indexOf(toState.name)>0?Auth.isAuthenticated()&&(event.preventDefault(),$state.go("listForms")):"access_denied"===toState.name||Auth.isAuthenticated()||"submitForm"===toState.name||(console.log("go to signup"),event.preventDefault(),$state.go("listForms"))})}]),angular.module(ApplicationConfiguration.applicationModuleName).run(["$rootScope","Auth","User","Authorizer","$state","$stateParams",function($rootScope,Auth,User,Authorizer,$state,$stateParams){$rootScope.$on("$stateChangeStart",function(event,next){var authenticator,permissions,user;permissions=next&&next.data&&next.data.permissions?next.data.permissions:null,Auth.ensureHasCurrentUser(User),user=Auth.currentUser,user&&(authenticator=new Authorizer(user),null!==permissions&&(authenticator.canAccess(permissions)||(event.preventDefault(),$state.go("access_denied"))))})}]),angular.module("core").controller("HeaderController",["$rootScope","$scope","Menus","$state","Auth","User","$window","$translate","$locale",function($rootScope,$scope,Menus,$state,Auth,User,$window,$translate,$locale){$rootScope.signupDisabled=$window.signupDisabled,$scope.user=$rootScope.user=Auth.ensureHasCurrentUser(User),$scope.authentication=$rootScope.authentication=Auth,$rootScope.languages=$scope.languages=["en","fr","es","it","de"],console.log($locale.id),$scope.authentication.isAuthenticated()?$rootScope.language=$scope.user.language:$rootScope.language=$locale.id.substring(0,2),$translate.use($rootScope.language),$scope.isCollapsed=!1,$rootScope.hideNav=!1,$scope.menu=Menus.getMenu("topbar"),$scope.signout=function(){var promise=User.logout();promise.then(function(){Auth.logout(),Auth.ensureHasCurrentUser(User),$scope.user=$rootScope.user=null,$state.go("listForms")},function(reason){console.log("Logout Failed: "+reason)})},$scope.toggleCollapsibleMenu=function(){$scope.isCollapsed=!$scope.isCollapsed},$scope.$on("$stateChangeSuccess",function(event,toState,toParams,fromState,fromParams){$scope.isCollapsed=!1,$rootScope.hideNav=!1,angular.isDefined(toState.data)&&angular.isDefined(toState.data.hideNav)&&($rootScope.hideNav=toState.data.hideNav)})}]),angular.module("core").service("Menus",[function(){this.defaultRoles=["*"],this.menus={};var shouldRender=function(user){if(!user)return this.isPublic;if(~this.roles.indexOf("*"))return!0;for(var userRoleIndex in user.roles)for(var roleIndex in this.roles)if(console.log(this.roles[roleIndex]),console.log(this.roles[roleIndex]===user.roles[userRoleIndex]),this.roles[roleIndex]===user.roles[userRoleIndex])return!0;return!1};this.validateMenuExistance=function(menuId){if(menuId&&menuId.length){if(this.menus[menuId])return!0;throw new Error("Menu does not exists")}throw new Error("MenuId was not provided")},this.getMenu=function(menuId){return this.validateMenuExistance(menuId),this.menus[menuId]},this.addMenu=function(menuId,isPublic,roles){return this.menus[menuId]={isPublic:isPublic||!1,roles:roles||this.defaultRoles,items:[],shouldRender:shouldRender},this.menus[menuId]},this.removeMenu=function(menuId){this.validateMenuExistance(menuId),delete this.menus[menuId]},this.addMenuItem=function(menuId,menuItemTitle,menuItemURL,menuItemType,menuItemUIRoute,isPublic,roles,position){return this.validateMenuExistance(menuId),this.menus[menuId].items.push({title:menuItemTitle,link:menuItemURL,menuItemType:menuItemType||"item",menuItemClass:menuItemType,uiRoute:menuItemUIRoute||"/"+menuItemURL,isPublic:null===isPublic||"undefined"==typeof isPublic?this.menus[menuId].isPublic:isPublic,roles:null===roles||"undefined"==typeof roles?this.menus[menuId].roles:roles,position:position||0,items:[],shouldRender:shouldRender}),this.menus[menuId]},this.addSubMenuItem=function(menuId,rootMenuItemURL,menuItemTitle,menuItemURL,menuItemUIRoute,isPublic,roles,position){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===rootMenuItemURL&&this.menus[menuId].items[itemIndex].items.push({title:menuItemTitle,link:menuItemURL,uiRoute:menuItemUIRoute||"/"+menuItemURL,isPublic:null===isPublic||"undefined"==typeof isPublic?this.menus[menuId].items[itemIndex].isPublic:isPublic,roles:null===roles||"undefined"==typeof roles?this.menus[menuId].items[itemIndex].roles:roles,position:position||0,shouldRender:shouldRender});return this.menus[menuId]},this.removeMenuItem=function(menuId,menuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)this.menus[menuId].items[itemIndex].link===menuItemURL&&this.menus[menuId].items.splice(itemIndex,1);return this.menus[menuId]},this.removeSubMenuItem=function(menuId,submenuItemURL){this.validateMenuExistance(menuId);for(var itemIndex in this.menus[menuId].items)for(var subitemIndex in this.menus[menuId].items[itemIndex].items)this.menus[menuId].items[itemIndex].items[subitemIndex].link===submenuItemURL&&this.menus[menuId].items[itemIndex].items.splice(subitemIndex,1);return this.menus[menuId]},this.addMenu("topbar",!1,["*"]),this.addMenu("bottombar",!1,["*"])}]),function(){function Socket($timeout,$window){function connect(url){service.socket=io(url,{transports:["websocket","polling"]})}function emit(eventName,data){service.socket&&service.socket.emit(eventName,data)}function on(eventName,callback){service.socket&&service.socket.on(eventName,function(data){$timeout(function(){callback(data)})})}function removeListener(eventName){service.socket&&service.socket.removeListener(eventName)}var service={connect:connect,emit:emit,on:on,removeListener:removeListener,socket:null};return connect(window.location.protocol+"//"+window.location.hostname+":"+$window.socketPort),service}angular.module("core").factory("Socket",Socket),Socket.$inject=["$timeout","$window"]}(),angular.module("core").factory("subdomain",["$location",function($location){var host=$location.host();return host.indexOf(".")<0?null:host.split(".")[0]}]),angular.module("forms").run(["Menus",function(Menus){Menus.addMenuItem("topbar","My Forms","forms","","/forms",!1)}]).filter("secondsToDateTime",[function(){return function(seconds){return new Date(1970,0,1).setSeconds(seconds)}}]).filter("formValidity",function(){return function(formObj){if(formObj&&formObj.form_fields&&formObj.visible_form_fields){var formKeys=Object.keys(formObj),fields=(formKeys.filter(function(key){return"$"!==key[0]}),formObj.form_fields),valid_count=fields.filter(function(field){return"object"==typeof field&&"statement"!==field.fieldType&&"rating"!==field.fieldType?!!field.fieldValue:void 0}).length;return valid_count-(formObj.form_fields.length-formObj.visible_form_fields.length)}return 0}}).config(["$provide",function($provide){$provide.decorator("accordionDirective",["$delegate",function($delegate){var directive=$delegate[0];return directive.replace=!0,$delegate}])}]),angular.module("forms").config(["$stateProvider",function($stateProvider){$stateProvider.state("listForms",{url:"/forms",templateUrl:"modules/forms/admin/views/list-forms.client.view.html"}).state("submitForm",{url:"/forms/:formId",templateUrl:"modules/forms/base/views/submit-form.client.view.html",data:{hideNav:!0},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(Forms,$stateParams){return Forms.get({formId:$stateParams.formId}).$promise}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("viewForm",{url:"/forms/:formId/admin",templateUrl:"modules/forms/admin/views/admin-form.client.view.html",data:{permissions:["editForm"]},resolve:{Forms:"Forms",myForm:["Forms","$stateParams",function(Forms,$stateParams){return Forms.get({formId:$stateParams.formId}).$promise}]},controller:"AdminFormController"}).state("viewForm.configure",{url:"/configure",templateUrl:"modules/forms/admin/views/adminTabs/configure.html"}).state("viewForm.design",{url:"/design",templateUrl:"modules/forms/admin/views/adminTabs/design.html"}).state("viewForm.analyze",{url:"/analyze",templateUrl:"modules/forms/admin/views/adminTabs/analyze.html"}).state("viewForm.create",{url:"/create",templateUrl:"modules/forms/admin/views/adminTabs/create.html"})}]),function(){function SendVisitorData(Socket,$state,$http,deviceDetector){function send(form,lastActiveIndex,timeElapsed){var visitorData={referrer:document.referrer,isSubmitted:form.submitted,formId:form._id,lastActiveField:form.form_fields[lastActiveIndex]._id,timeElapsed:timeElapsed,language:window.navigator.userLanguage||window.navigator.language,ipAddr:"",deviceType:""};$http.get("https://jsonip.com/").success(function(response){visitorData.ipAddr=response.ip+""}).error(function(error){console.error("Could not get users's ip")}).then(function(){visitorData.userAgent=deviceDetector.raw,deviceDetector.isTablet()?visitorData.deviceType="tablet":deviceDetector.isMobile()?visitorData.deviceType="phone":visitorData.deviceType="desktop",console.log(visitorData.deviceType),Socket.emit("form-visitor-data",visitorData)})}function init(){Socket.socket||Socket.connect()}var service={send:send};return init(),service}angular.module("forms").factory("SendVisitorData",SendVisitorData),SendVisitorData.$inject=["Socket","$state","$http","deviceDetector"]}(),angular.module("forms").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function($scope,$element,$attrs,$select){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,index=parseInt(String.fromCharCode(keyCode))-1;index<$scope.field.fieldOptions.length&&(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue=$scope.field.fieldOptions[index].option_value}))})}}}),angular.module("forms").directive("keyToTruthy",["$rootScope",function($rootScope){return{restrict:"A",scope:{field:"="},link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,truthyKeyCode=$attrs.keyCharTruthy.charCodeAt(0)-32,falseyKeyCode=$attrs.keyCharFalsey.charCodeAt(0)-32;keyCode===truthyKeyCode?(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue="true"})):keyCode===falseyKeyCode&&(event.preventDefault(),$scope.$apply(function(){$scope.field.fieldValue="false"}))})}}}]),angular.module("users").config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(["$q","$location",function($q,$location){return{responseError:function(response){return"/users/me"!==$location.path()&&response.config&&"/users/me"!==response.config.url&&(console.log("intercepted rejection of ",response.config.url,response.status),401===response.status?(console.log($location.path()),$location.nextAfterLogin=$location.path(),$location.path("/signin")):403===response.status&&$location.path("/access_denied")),$q.reject(response)}}}])}]),angular.module("users").config(["$stateProvider",function($stateProvider){var checkLoggedin=function($q,$timeout,$state,User,Auth){var deferred=$q.defer();return Auth.currentUser&&Auth.currentUser.email?$timeout(deferred.resolve):Auth.currentUser=User.getCurrent(function(){Auth.login(),$timeout(deferred.resolve())},function(){Auth.logout(),$timeout(deferred.reject()),$state.go("signin",{reload:!0})}),deferred.promise};checkLoggedin.$inject=["$q","$timeout","$state","User","Auth"];var checkSignupDisabled=function($window,$timeout,$q){var deferred=$q.defer();return $timeout($window.signupDisabled?deferred.reject():deferred.resolve()),deferred.promise};checkSignupDisabled.$inject=["$window","$timeout","$q"],$stateProvider.state("profile",{resolve:{loggedin:checkLoggedin},url:"/settings/profile",templateUrl:"modules/users/views/settings/edit-profile.client.view.html"}).state("password",{resolve:{loggedin:checkLoggedin},url:"/settings/password",templateUrl:"modules/users/views/settings/change-password.client.view.html"}).state("accounts",{resolve:{loggedin:checkLoggedin},url:"/settings/accounts",templateUrl:"modules/users/views/settings/social-accounts.client.view.html"}).state("signup",{resolve:{isDisabled:checkSignupDisabled},url:"/signup",templateUrl:"modules/users/views/authentication/signup.client.view.html"}).state("signup-success",{resolve:{isDisabled:checkSignupDisabled},url:"/signup-success",templateUrl:"modules/users/views/authentication/signup-success.client.view.html"}).state("signin",{url:"/signin",templateUrl:"modules/users/views/authentication/signin.client.view.html"}).state("access_denied",{url:"/access_denied",templateUrl:"modules/users/views/authentication/access-denied.client.view.html"}).state("verify",{resolve:{isDisabled:checkSignupDisabled},url:"/verify/:token",templateUrl:"modules/users/views/verify/verify-account.client.view.html"}).state("resendVerifyEmail",{resolve:{isDisabled:checkSignupDisabled},url:"/verify",templateUrl:"modules/users/views/verify/resend-verify-email.client.view.html"}).state("forgot",{url:"/password/forgot",templateUrl:"modules/users/views/password/forgot-password.client.view.html"}).state("reset-invalid",{url:"/password/reset/invalid",templateUrl:"modules/users/views/password/reset-password-invalid.client.view.html"}).state("reset-success",{url:"/password/reset/success",templateUrl:"modules/users/views/password/reset-password-success.client.view.html"}).state("reset",{url:"/password/reset/:token",templateUrl:"modules/users/views/password/reset-password.client.view.html"})}]),angular.module("users").controller("AuthenticationController",["$scope","$location","$state","$rootScope","User","Auth",function($scope,$location,$state,$rootScope,User,Auth){$scope=$rootScope,$scope.credentials={},$scope.error="",$scope.signin=function(){User.login($scope.credentials).then(function(response){Auth.login(response),$scope.user=$rootScope.user=Auth.ensureHasCurrentUser(User),"home"!==$state.previous.name&&"verify"!==$state.previous.name&&""!==$state.previous.name?$state.go($state.previous.name):$state.go("listForms")},function(error){$rootScope.user=Auth.ensureHasCurrentUser(User),$scope.user=$rootScope.user,$scope.error=error,console.log("loginError: "+error)})},$scope.signup=function(){console.log($scope.credentials),User.signup($scope.credentials).then(function(response){console.log("signup-success"),$state.go("signup-success")},function(error){console.log("Error: "),console.log(error),error?($scope.error=error,console.log(error)):console.log("No response received")})}}]),angular.module("users").controller("PasswordController",["$scope","$stateParams","$state","User",function($scope,$stateParams,$state,User){$scope.error="",$scope.askForPasswordReset=function(){User.askForPasswordReset($scope.credentials).then(function(response){$scope.success=response.message,$scope.credentials=null},function(error){$scope.error=error,$scope.credentials=null})},$scope.resetUserPassword=function(){$scope.success=$scope.error=null,User.resetPassword($scope.passwordDetails,$stateParams.token).then(function(response){$scope.success=response.message,$scope.passwordDetails=null,$state.go("reset-success")},function(error){$scope.error=error.message||error,$scope.passwordDetails=null})}}]),angular.module("users").controller("SettingsController",["$scope","$rootScope","$http","$state","Users",function($scope,$rootScope,$http,$state,Users){$scope.user=$rootScope.user,$scope.hasConnectedAdditionalSocialAccounts=function(provider){for(var i in $scope.user.additionalProvidersData)return!0;return!1},$scope.isConnectedSocialAccount=function(provider){return $scope.user.provider===provider||$scope.user.additionalProvidersData&&$scope.user.additionalProvidersData[provider]},$scope.removeUserSocialAccount=function(provider){$scope.success=$scope.error=null,$http["delete"]("/users/accounts",{params:{provider:provider}}).success(function(response){$scope.success=!0,$scope.user=response}).error(function(response){$scope.error=response.message})},$scope.updateUserProfile=function(isValid){if(isValid){$scope.success=$scope.error=null;var user=new Users($scope.user);user.$update(function(response){$scope.success=!0,$scope.user=response},function(response){$scope.error=response.data.message})}else $scope.submitted=!0},$scope.changeUserPassword=function(){$scope.success=$scope.error=null,$http.post("/users/password",$scope.passwordDetails).success(function(response){$scope.success=!0,$scope.passwordDetails=null}).error(function(response){$scope.error=response.message})}}]),angular.module("users").controller("VerifyController",["$scope","$state","$rootScope","User","Auth","$stateParams",function($scope,$state,$rootScope,User,Auth,$stateParams){$scope.isResetSent=!1,$scope.credentials={},$scope.error="",$scope.resendVerifyEmail=function(){User.resendVerifyEmail($scope.credentials.email).then(function(response){console.log(response),$scope.success=response.message,$scope.credentials=null,$scope.isResetSent=!0},function(error){$scope.error=error,$scope.credentials.email=null,$scope.isResetSent=!1})},$scope.validateVerifyToken=function(){$stateParams.token&&(console.log($stateParams.token),User.validateVerifyToken($stateParams.token).then(function(response){console.log("Success: "+response.message),$scope.success=response.message,$scope.isResetSent=!0,$scope.credentials.email=null},function(error){console.log("Error: "+error.message),$scope.isResetSent=!1,$scope.error=error,$scope.credentials.email=null}))}}]),angular.module("users").factory("Auth",["$window",function($window){var userState={isLoggedIn:!1},service={_currentUser:null,get currentUser(){return this._currentUser},ensureHasCurrentUser:function(User){return service._currentUser&&service._currentUser.username?service._currentUser:$window.user?(service._currentUser=$window.user,service._currentUser):void User.getCurrent().then(function(user){return service._currentUser=user,userState.isLoggedIn=!0,$window.user=service._currentUser,service._currentUser},function(response){return userState.isLoggedIn=!1,service._currentUser=null,$window.user=null,console.log("User.getCurrent() err",response),null})},isAuthenticated:function(){return!!service._currentUser},getUserState:function(){return userState},login:function(new_user){userState.isLoggedIn=!0,service._currentUser=new_user},logout:function(){$window.user=null,userState.isLoggedIn=!1,service._currentUser=null}};return service}]),angular.module("users").service("Authorizer",["APP_PERMISSIONS","USER_ROLES",function(APP_PERMISSIONS,USER_ROLES){return function(user){return{canAccess:function(permissions){var i,len,permission;for(angular.isArray(permissions)||(permissions=[permissions]),i=0,len=permissions.length;len>i;i++){if(permission=permissions[i],null===APP_PERMISSIONS[permission])throw"Bad permission value";if(!user||!user.roles)return!1;switch(permission){case APP_PERMISSIONS.viewAdminSettings:case APP_PERMISSIONS.editAdminSettings:return user.roles.indexOf(USER_ROLES.admin)>-1;case APP_PERMISSIONS.viewPrivateForm:case APP_PERMISSIONS.editForm:return user.roles.indexOf(USER_ROLES.admin)>-1||user.roles.indexOf(USER_ROLES.normal)>-1}}return!1}}}}]),angular.module("users").factory("User",["$window","$q","$timeout","$http","$state",function($window,$q,$timeout,$http,$state){var userService={getCurrent:function(){var deferred=$q.defer();return $http.get("/users/me").success(function(response){deferred.resolve(response)}).error(function(){deferred.reject("User's session has expired")}),deferred.promise},login:function(credentials){var deferred=$q.defer();return $http.post("/auth/signin",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},logout:function(){var deferred=$q.defer();return $http.get("/auth/signout").success(function(response){deferred.resolve(null)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},signup:function(credentials){var deferred=$q.defer();return $http.post("/auth/signup",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error);
}),deferred.promise},resendVerifyEmail:function(_email){var deferred=$q.defer();return $http.post("/auth/verify",{email:_email}).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},validateVerifyToken:function(token){var validTokenRe=/^([A-Za-z0-9]{48})$/g;if(!validTokenRe.test(token))throw new Error("Error token: "+token+" is not a valid verification token");var deferred=$q.defer();return $http.get("/auth/verify/"+token).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error)}),deferred.promise},resetPassword:function(passwordDetails,token){var deferred=$q.defer();return $http.get("/auth/password/"+token,passwordDetails).success(function(response){deferred.resolve()}).error(function(error){deferred.reject(error.message||error)}),deferred.promise},askForPasswordReset:function(credentials){var deferred=$q.defer();return $http.post("/auth/forgot",credentials).success(function(response){deferred.resolve(response)}).error(function(error){deferred.reject(error.message||error)}),deferred.promise}};return userService}]),angular.module("users").factory("Users",["$resource",function($resource){return $resource("users",{},{update:{method:"PUT"}})}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{MENU:"MENU",SIGNUP_TAB:"Sign Up",SIGNIN_TAB:"Sign In",SIGNOUT_TAB:"Signout",EDIT_PROFILE:"Edit Profile",MY_FORMS:"My Forms",MY_SETTINGS:"My Settings",CHANGE_PASSWORD:"Change Password"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("core").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{MENU:"MENU",SIGNUP_TAB:"Créer un Compte",SIGNIN_TAB:"Connexion",SIGNOUT_TAB:"Créer un compte",EDIT_PROFILE:"Modifier Mon Profil",MY_FORMS:"Mes Formulaires",MY_SETTINGS:"Mes Paramètres",CHANGE_PASSWORD:"Changer mon Mot de Pass"})}]),angular.module("forms").controller("AdminFormController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http","$uibModal","myForm","$filter",function($rootScope,$scope,$stateParams,$state,Forms,CurrentForm,$http,$uibModal,myForm,$filter){$scope=$rootScope,$scope.animationsEnabled=!0,$scope.myform=myForm,$rootScope.saveInProgress=!1,CurrentForm.setForm($scope.myform),$scope.formURL=$scope.myform.admin.username+".tellform.com",$scope.tabData=[{heading:$filter("translate")("CREATE_TAB"),route:"viewForm.create"},{heading:$filter("translate")("DESIGN_TAB"),route:"viewForm.design"},{heading:$filter("translate")("CONFIGURE_TAB"),route:"viewForm.configure"},{heading:$filter("translate")("ANALYZE_TAB"),route:"viewForm.analyze"}],$scope.setForm=function(form){$scope.myform=form},$rootScope.resetForm=function(){$scope.myform=Forms.get({formId:$stateParams.formId})},$scope.openDeleteModal=function(){$scope.deleteModal=$uibModal.open({animation:$scope.animationsEnabled,templateUrl:"myModalContent.html",controller:"AdminFormController",resolve:{myForm:function(){return $scope.myform}}}),$scope.deleteModal.result.then(function(selectedItem){$scope.selected=selectedItem},function(){console.log("Modal dismissed at: "+new Date)})},$scope.cancelDeleteModal=function(){$scope.deleteModal&&$scope.deleteModal.dismiss("cancel")},$scope.removeCurrentForm=function(){if($scope.deleteModal&&$scope.deleteModal.opened){$scope.deleteModal.close();var form_id=$scope.myform._id;if(!form_id)throw new Error("Error - removeCurrentForm(): $scope.myform._id does not exist");$http["delete"]("/forms/"+form_id).success(function(data,status,headers){console.log("form deleted successfully"),$state.go("listForms",{},{reload:!0})}).error(function(error){console.log("ERROR: Form could not be deleted."),console.error(error)})}},$scope.update=$rootScope.update=function(updateImmediately,diffChanges,cb){var continueUpdate=!0;if(updateImmediately||(continueUpdate=!$rootScope.saveInProgress),continueUpdate){var err=null;updateImmediately||($rootScope.saveInProgress=!0),console.log(diffChanges),$scope.updatePromise=$http.put("/forms/"+$scope.myform._id,{form:$scope.myform,changes:diffChanges}).then(function(response){$rootScope.myform=$scope.myform=response.data})["catch"](function(response){console.log("Error occured during form UPDATE.\n"),err=response.data})["finally"](function(){return updateImmediately||($rootScope.saveInProgress=!1),"function"==typeof cb?cb(err):void 0})}}}]),angular.module("forms").controller("ListFormsController",["$rootScope","$scope","$stateParams","$state","Forms","CurrentForm","$http",function($rootScope,$scope,$stateParams,$state,Forms,CurrentForm,$http){$scope=$rootScope,$scope.forms={},$scope.showCreateModal=!1,$rootScope.languageRegExp={regExp:/[@!#$%^&*()\-+={}\[\]|\\/'";:`.,~№?<>]+/i,test:function(val){return!this.regExp.test(val)}},$scope.findAll=function(){Forms.query(function(_forms){$scope.myforms=_forms})},$scope.openCreateModal=function(){$scope.showCreateModal||($scope.showCreateModal=!0)},$scope.closeCreateModal=function(){$scope.showCreateModal&&($scope.showCreateModal=!1)},$scope.setForm=function(form){$scope.myform=form},$scope.goToWithId=function(route,id){$state.go(route,{formId:id},{reload:!0})},$scope.duplicateForm=function(form_index){var form=_.cloneDeep($scope.myforms[form_index]);delete form._id,$http.post("/forms",{form:form}).success(function(data,status,headers){$scope.myforms.splice(form_index+1,0,data)}).error(function(errorResponse){console.error(errorResponse),null===errorResponse&&($scope.error=errorResponse.data.message)})},$scope.createNewForm=function(){var form={};form.title=$scope.forms.createForm.title.$modelValue,form.language=$scope.forms.createForm.language.$modelValue,$scope.forms.createForm.$valid&&$scope.forms.createForm.$dirty&&$http.post("/forms",{form:form}).success(function(data,status,headers){$scope.goToWithId("viewForm.create",data._id+"")}).error(function(errorResponse){console.error(errorResponse),$scope.error=errorResponse.data.message})},$scope.removeForm=function(form_index){if(form_index>=$scope.myforms.length||0>form_index)throw new Error("Error: form_index in removeForm() must be between 0 and "+$scope.myforms.length-1);$http["delete"]("/forms/"+$scope.myforms[form_index]._id).success(function(data,status,headers){$scope.myforms.splice(form_index,1)}).error(function(error){console.error(error)})}}]),_.mixin({removeDateFields:removeDateFieldsFunc}),angular.module("forms").directive("autoSaveForm",["$rootScope","$timeout",function($rootScope,$timeout){return{require:["^form"],restrict:"AE",link:function($scope,$element,$attrs,$ctrls){angular.element(document).ready(function(){var $formCtrl=$ctrls[0],savePromise=null;$rootScope.finishedRender=!1,$scope.$on("editFormFields Started",function(ngRepeatFinishedEvent){$rootScope.finishedRender=!1}),$scope.$on("editFormFields Finished",function(ngRepeatFinishedEvent){$rootScope.finishedRender=!0}),$scope.anyDirtyAndTouched=function(form){var propCount=0;for(var prop in form)if(form.hasOwnProperty(prop)&&"$"!==prop[0]&&(propCount++,form[prop].$touched&&form[prop].$dirty))return!0;return!1};var debounceSave=function(diffChanges){$rootScope[$attrs.autoSaveCallback](!0,diffChanges,function(err){err?(console.error("Error form data NOT persisted"),console.error(err)):($formCtrl.$setPristine(),$formCtrl.$setUntouched())})};$scope.$watch(function(newValue,oldValue){$rootScope.finishedRender&&$scope.anyDirtyAndTouched($scope.editForm)&&!$rootScope.saveInProgress&&(delete newValue.visible_form_fields,debounceSave(DeepDiff.diff(oldValue,newValue)))}),$scope.$watch($attrs.autoSaveWatch,function(newValue,oldValue){newValue=angular.copy(newValue),oldValue=angular.copy(oldValue),newValue.form_fields=_.removeDateFields(newValue.form_fields),oldValue.form_fields=_.removeDateFields(oldValue.form_fields);var changedFields=!_.isEqual(oldValue.form_fields,newValue.form_fields)||!_.isEqual(oldValue.startPage,newValue.startPage);oldValue.hasOwnProperty("plugins.oscarhost.settings.fieldMap")&&(changedFieldMap=!!oldValue.plugins.oscarhost.settings.fieldMap&&!_.isEqual(oldValue.plugins.oscarhost.settings.fieldMap,newValue.plugins.oscarhost.settings.fieldMap)),(newValue||oldValue)&&oldValue&&(0===oldValue.form_fields.length&&($rootScope.finishedRender=!0),$rootScope.finishedRender&&changedFields&&!$formCtrl.$dirty&&!$rootScope.saveInProgress?(savePromise&&($timeout.cancel(savePromise),savePromise=null),savePromise=$timeout(function(){$rootScope.saveInProgress=!0,console.log(newValue),console.log(oldValue),delete newValue.visible_form_fields,delete newValue.visible_form_fields;var _diff=DeepDiff.diff(oldValue,newValue);debounceSave(_diff)})):$rootScope.finishedRender&&$rootScope.saveInProgress&&($rootScope.saveInProgress=!1))},!0)})}}}]),angular.module("forms").directive("configureFormDirective",["$rootScope","$http","Upload","CurrentForm",function($rootScope,$http,Upload,CurrentForm){return{templateUrl:"modules/forms/admin/views/directiveViews/form/configure-form.client.view.html",restrict:"E",scope:{myform:"=",user:"=",pdfFields:"@",formFields:"@"},controller:["$scope",function($scope){console.log($scope.myform),CurrentForm.getForm().plugins?CurrentForm.getForm().plugins.oscarhost.baseUrl&&($scope.oscarhostAPI=!0):$scope.oscarhostAPI=!1,$scope.log="",$scope.pdfLoading=!1,$scope.languages=$rootScope.languages,this._current_upload=null,$scope.resetForm=$rootScope.resetForm,$scope.update=$rootScope.update,this._unbindedPdfFields=$scope.pdfFields,$scope.cancelUpload=function(){this._current_upload.abort(),$scope.pdfLoading=!1,$scope.removePDF()},$scope.removePDF=function(){$scope.myform.pdf=null,$scope.myform.isGenerated=!1,$scope.myform.autofillPDFs=!1,console.log("form.pdf: "+$scope.myform.pdf+" REMOVED")},$scope.uploadPDF=function(file){file&&(console.log(file),Upload.upload({url:"/upload/pdf",data:{user:$scope.user,file:file}}).then(function(resp){var data=resp.data;$scope.log="file "+data.originalname+" uploaded as "+data.filename+". JSON: "+JSON.stringify(data)+"\n"+$scope.log,$scope.myform.pdf=angular.fromJson(angular.toJson(data)),$scope.pdfLoading=!1,console.log($scope.log),$scope.$$phase||$scope.$digest||$scope.$apply()},function(resp){$scope.pdfLoading=!1,console.log("Error occured during upload.\n"),console.log(resp.status)},function(evt){var progressPercentage=parseInt(100*evt.loaded/evt.total,10);$scope.log="progress: "+progressPercentage+"% "+evt.config.data.file.name+"\n"+$scope.log,console.log($scope.log),$scope.pdfLoading=!0}))}}]}}]),angular.module("forms").directive("editFormDirective",["$rootScope","FormFields",function($rootScope,FormFields){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$scope",function($scope){for(var field_ids=_($scope.myform.form_fields).pluck("_id"),i=0;i<field_ids.length;i++)$scope.myform.plugins.oscarhost.settings.fieldMap[field_ids[i]]=null;$scope.sortableOptions={appendTo:".dropzone",forceHelperSize:!0,forcePlaceholderSize:!0},$scope.select2FA={Heart:"Heart",Star:"Star","thumbs-up":"Thumbs Up","thumbs-down":"Thumbs Down",Circle:"Circle",Square:"Square","Check Circle":"Checkmark","Smile Outlined":"Smile",Hourglass:"Hourglass",bell:"Bell","Paper Plane":"Paper Plane",Comment:"Chat Bubble",Trash:"Trash Can"},$scope.addField={},$scope.addField.types=FormFields.types,$scope.addField.types.forEach(function(type){return type.lastAddedID=1,type}),$scope.lastButtonID=0,$scope.accordion={},$scope.accordion.oneAtATime=!0,$scope.update=$rootScope.update,$scope.oscarFieldsLeft=function(field_id){if($scope.myform&&$scope.myform.plugins.oscarhost.settings.validFields.length>0){$scope.myform.plugins.oscarhost.settings.fieldMap||($scope.myform.plugins.oscarhost.settings.fieldMap={});var oscarhostFields=$scope.myform.plugins.oscarhost.settings.validFields,currentFields=_($scope.myform.plugins.oscarhost.settings.fieldMap).invert().keys().value();return $scope.myform.plugins.oscarhost.settings.fieldMap.hasOwnProperty(field_id)&&(currentFields=_(currentFields).difference($scope.myform.plugins.oscarhost.settings.fieldMap[field_id])),_(oscarhostFields).difference(currentFields).value()}return[]},$scope.dropzone={handle:".handle",containment:".dropzoneContainer",cursor:"grabbing"},$scope.addNewField=function(modifyForm,fieldType){$scope.addField.lastAddedID++;for(var fieldTitle,i=0;i<$scope.addField.types.length;i++)if($scope.addField.types[i].name===fieldType){$scope.addField.types[i].lastAddedID++,fieldTitle=$scope.addField.types[i].value+$scope.addField.types[i].lastAddedID;break}var newField={title:fieldTitle+" "+$scope.myform.form_fields.length+1,fieldType:fieldType,fieldValue:"",required:!0,disabled:!1,deletePreserved:!1};return $scope.showAddOptions(newField)&&(newField.fieldOptions=[],newField.fieldOptions.push({option_id:Math.floor(1e5*Math.random()),option_title:"Option 0",option_value:"Option 0"})),modifyForm&&$scope.myform.form_fields.push(newField),newField},$scope.deleteField=function(field_index){var currFieldId=$scope.myform.form_fields[field_index]._id;$scope.myform.hasOwnProperty("plugins.oscarhost.baseUrl")&&delete $scope.myform.plugins.oscarhost.settings.fieldMap[currFieldId],$scope.myform.form_fields.splice(field_index,1)},$scope.duplicateField=function(field_index){var currField=_.cloneDeep($scope.myform.form_fields[field_index]);currField._id="cloned"+_.uniqueId(),currField.title+=" copy",$scope.myform.form_fields.splice(field_index+1,0,currField)},$scope.addButton=function(){var newButton={};newButton.bgColor="#ddd",newButton.color="#ffffff",newButton.text="Button",newButton._id=Math.floor(1e5*Math.random()),$scope.myform.startPage.buttons.push(newButton)},$scope.deleteButton=function(button){for(var currID,i=0;i<$scope.myform.startPage.buttons.length;i++)if(currID=$scope.myform.startPage.buttons[i]._id,console.log(currID),currID===button._id){$scope.myform.startPage.buttons.splice(i,1);break}},$scope.addOption=function(field_index){var currField=$scope.myform.form_fields[field_index];if("checkbox"===currField.fieldType||"dropdown"===currField.fieldType||"radio"===currField.fieldType){currField.fieldOptions||($scope.myform.form_fields[field_index].fieldOptions=[]);var lastOptionID=$scope.myform.form_fields[field_index].fieldOptions.length+1,newOption={option_id:Math.floor(1e5*Math.random()),option_title:"Option "+lastOptionID,option_value:"Option "+lastOptionID};$scope.myform.form_fields[field_index].fieldOptions.push(newOption)}},$scope.deleteOption=function(field_index,option){var currField=$scope.myform.form_fields[field_index];if("checkbox"===currField.fieldType||"dropdown"===currField.fieldType||"radio"===currField.fieldType)for(var i=0;i<currField.fieldOptions.length;i++)if(currField.fieldOptions[i].option_id===option.option_id){$scope.myform.form_fields[field_index].fieldOptions.splice(i,1);break}},$scope.showAddOptions=function(field){return"dropdown"===field.fieldType||"checkbox"===field.fieldType||"radio"===field.fieldType},$scope.showRatingOptions=function(field){return"rating"===field.fieldType}}]}}]),angular.module("forms").directive("editSubmissionsFormDirective",["$rootScope","$http",function($rootScope,$http){return{templateUrl:"modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html",restrict:"E",scope:{myform:"=",user:"="},controller:["$scope",function($scope){$scope.table={masterChecker:!1,rows:[]},function(){for(var defaultFormFields=_.cloneDeep($scope.myform.form_fields),submissions=_.cloneDeep($scope.myform.submissions),i=0;i<submissions.length;i++){for(var x=0;x<submissions[i].form_fields;x++){var oldValue=submissions[i].form_fields[x].fieldValue||"";submissions[i].form_fields[x]=_.merge(defaultFormFields,submissions[i].form_fields),submissions[i].form_fields[x].fieldValue=oldValue}submissions[i].selected=!1}$scope.table.rows=submissions}(),$scope.AverageTimeElapsed=function(){for(var totalTime=0,numSubmissions=$scope.table.rows.length,i=0;i<$scope.table.rows.length;i++)totalTime+=$scope.table.rows[i].timeElapsed;return console.log(totalTime/numSubmissions),totalTime/numSubmissions}(),$scope.DeviceStatistics=function(){var newStatItem=function(){return{visits:0,responses:0,completion:0,average_time:0,total_time:0}},stats={desktop:newStatItem(),tablet:newStatItem(),phone:newStatItem(),other:newStatItem()},visitors=$scope.myform.analytics.visitors;console.log(visitors);for(var i=0;i<visitors.length;i++){var visitor=visitors[i],deviceType=visitor.deviceType;stats[deviceType].visits++,stats[deviceType].total_time=+visitor.timeElapsed,stats[deviceType].average_time=stats[deviceType].total_time/stats[deviceType].visits||0,visitor.isSubmitted&&stats[deviceType].responses++,stats[deviceType].completion=stats[deviceType].response/stats[deviceType].visits||0}return console.log(stats),stats}(),$scope.isAtLeastOneChecked=function(){for(var i=0;i<$scope.table.rows.length;i++)if($scope.table.rows[i].selected)return!0;return!1},$scope.toggleAllCheckers=function(){for(var i=0;i<$scope.table.rows.length;i++)$scope.table.rows[i].selected=$scope.table.masterChecker},$scope.toggleObjSelection=function($event,description){$event.stopPropagation()},$scope.rowClicked=function(row_index){$scope.table.rows[row_index].selected=!$scope.table.rows[row_index].selected},$scope.deleteSelectedSubmissions=function(){var delete_ids=_.chain($scope.table.rows).filter(function(row){return!!row.selected}).pluck("_id").value();$http({url:"/forms/"+$scope.myform._id+"/submissions",method:"DELETE",data:{deleted_submissions:delete_ids},headers:{"Content-Type":"application/json;charset=utf-8"}}).success(function(data,status,headers){for(var tmpArray=[],i=0;i<$scope.table.rows.length;i++)$scope.table.rows[i].selected||tmpArray.push($scope.table.rows[i]);$scope.table.rows=tmpArray}).error(function(err){console.log("Could not delete form submissions.\nError: "),console.log(err),console.error=err})},$scope.exportSubmissions=function(type){console.log($scope.table.rows),angular.element("#table-submission-data").tableExport({type:type,escape:!1})}}]}}]),angular.module("forms").service("FormFields",[function(){this.types=[{name:"textfield",value:"Short Text"},{name:"email",value:"Email"},{name:"radio",value:"Multiple Choice"},{name:"dropdown",value:"Dropdown"},{name:"date",value:"Date"},{name:"textarea",value:"Paragraph Text"},{name:"yes_no",value:"Yes/No"},{name:"legal",value:"Legal"},{name:"rating",value:"Rating"},{name:"link",value:"Link"},{name:"number",value:"Numbers"},{name:"statement",value:"Statement"}]}]),angular.module("forms").factory("Submissions",["$resource",function($resource){return $resource("forms/:formID/submissions/:submissionId",{submissionId:"@_id",formId:"@_id"},{query:{method:"GET",isArray:!0},update:{method:"PUT"},save:{method:"POST"}})}]),angular.module("forms").value("supportedFields",["textfield","textarea","date","dropdown","hidden","password","radio","legal","statement","rating","yes_no","number","natural"]),angular.module("forms").controller("SubmitFormController",["$scope","$rootScope","$state","$translate","myForm","Auth",function($scope,$rootScope,$state,$translate,myForm,Auth){$scope.authentication=Auth,$scope.myform=myForm,$translate.use(myForm.language),$scope.myform.isLive?$scope.hideNav=$rootScope.hideNav=!0:$scope.authentication.isAuthenticated()?$scope.hideNav=$rootScope.hideNav=!1:($scope.hideNav=$rootScope.hideNav=!0,$state.go("access_denied"))}]),angular.module("forms").directive("fieldIconDirective",function(){return{template:'<i class="{{typeIcon}}"></i>',restrict:"E",scope:{typeName:"@"},controller:["$scope",function($scope){var iconTypeMap={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};$scope.typeIcon=iconTypeMap[$scope.typeName]}]}});var __indexOf=[].indexOf||function(item){for(var i=0,l=this.length;l>i;i++)if(i in this&&this[i]===item)return i;return-1};angular.module("forms").directive("fieldDirective",["$http","$compile","$rootScope","$templateCache","supportedFields",function($http,$compile,$rootScope,$templateCache,supportedFields){var getTemplateUrl=function(fieldType){var type=fieldType,templateUrl="modules/forms/base/views/directiveViews/field/";return __indexOf.call(supportedFields,type)>=0&&(templateUrl=templateUrl+type+".html"),$templateCache.get(templateUrl)};return{template:"<div>{{field.title}}</div>",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(scope,element){$rootScope.chooseDefaultOption=scope.chooseDefaultOption=function(type){"yes_no"===type?scope.field.fieldValue="true":"rating"===type?scope.field.fieldValue=0:"radio"===scope.field.fieldType?(console.log(scope.field),scope.field.fieldValue=scope.field.fieldOptions[0].option_value,console.log(scope.field.fieldValue)):"legal"===type&&(scope.field.fieldValue="true",$rootScope.nextField())},scope.setActiveField=$rootScope.setActiveField,"date"===scope.field.fieldType&&(scope.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var fieldType=scope.field.fieldType;if("number"===scope.field.fieldType||"textfield"===scope.field.fieldType||"email"===scope.field.fieldType||"link"===scope.field.fieldType){switch(scope.field.fieldType){case"textfield":scope.input_type="text";break;case"email":scope.input_type="email",scope.placeholder="joesmith@example.com";break;case"number":scope.input_type="text",scope.validateRegex=/^-?\d+$/;break;default:scope.input_type="url",scope.placeholder="http://example.com"}fieldType="textfield"}console.log(scope.input_type);var template=getTemplateUrl(fieldType);element.html(template).show();$compile(element.contents())(scope)}}}]),angular.module("forms").directive("onEnterKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode,onEnterKeyDisabled=!1;null!==$attrs.onEnterKeyDisabled&&(onEnterKeyDisabled=$attrs.onEnterKeyDisabled),13!==keyCode||event.shiftKey||onEnterKeyDisabled||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;9!==keyCode||event.shiftKey||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;13!==keyCode&&9!==keyCode||event.shiftKey||(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function($rootScope){return{restrict:"A",link:function($scope,$element,$attrs){$element.bind("keydown keypress",function(event){var keyCode=event.which||event.keyCode;9===keyCode&&event.shiftKey&&(event.preventDefault(),$rootScope.$apply(function(){$rootScope.$eval($attrs.onTabAndShiftKey)}))})}}}]),angular.module("forms").directive("onFinishRender",["$rootScope","$timeout",function($rootScope,$timeout){return{restrict:"A",link:function(scope,element,attrs){if(element.attr("ng-repeat")||element.attr("data-ng-repeat")){var broadcastMessage=attrs.onFinishRender||"ngRepeat";scope.$first&&!scope.$last?scope.$evalAsync(function(){$rootScope.$broadcast(broadcastMessage+" Started")}):scope.$last&&scope.$evalAsync(function(){$rootScope.$broadcast(broadcastMessage+" Finished")})}}}}]),angular.module("forms").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","Auth","SendVisitorData",function($http,TimeCounter,$filter,$rootScope,Auth,SendVisitorData){return{templateUrl:"modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"="},controller:["$document","$window","$scope",function($document,$window,$scope){$scope.authentication=$rootScope.authentication,$scope.noscroll=!1,$scope.forms={};var form_fields_count=$scope.myform.visible_form_fields.filter(function(field){return"statement"!==field.fieldType&&"rating"!==field.fieldType}).length,nb_valid=$filter("formValidity")($scope.myform);$scope.translateAdvancementData={done:nb_valid,total:form_fields_count,answers_not_completed:form_fields_count-nb_valid},$scope.reloadForm=function(){$scope.myform.submitted=!1,$scope.myform.form_fields=_.chain($scope.myform.visible_form_fields).map(function(field){return field.fieldValue="",field}).value(),$scope.loading=!1,$scope.error="",$scope.selected={_id:"",index:0},$scope.setActiveField($scope.myform.visible_form_fields[0]._id,0,!1),TimeCounter.restartClock()},$window.onscroll=function(){$scope.scrollPos=document.body.scrollTop||document.documentElement.scrollTop||0;var elemBox=document.getElementsByClassName("activeField")[0].getBoundingClientRect();$scope.fieldTop=elemBox.top,$scope.fieldBottom=elemBox.bottom;var field_id,field_index;$scope.noscroll||($scope.selected.index===$scope.myform.visible_form_fields.length-1&&$scope.fieldBottom<200?(field_index=$scope.selected.index+1,field_id="submit_field",$scope.setActiveField(field_id,field_index,!1)):$scope.selected.index===$scope.myform.visible_form_fields.length?$scope.fieldTop>200&&(field_index=$scope.selected.index-1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)):$scope.fieldBottom<0?(field_index=$scope.selected.index+1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)):0!==$scope.selected.index&&$scope.fieldTop>0&&(field_index=$scope.selected.index-1,field_id=$scope.myform.visible_form_fields[field_index]._id,$scope.setActiveField(field_id,field_index,!1)),$scope.$apply())};var getActiveField=function(){if(null===$scope.selected)throw console.error("current active field is null"),new Error("current active field is null");return"submit_field"===$scope.selected._id?$scope.myform.form_fields.length-1:$scope.selected.index};$scope.setActiveField=$rootScope.setActiveField=function(field_id,field_index,animateScroll){if(null!==$scope.selected&&$scope.selected._id!==field_id){$scope.selected._id=field_id,$scope.selected.index=field_index;var nb_valid=$filter("formValidity")($scope.myform);$scope.translateAdvancementData={done:nb_valid,total:form_fields_count,answers_not_completed:form_fields_count-nb_valid},animateScroll?($scope.noscroll=!0,setTimeout(function(){$document.scrollToElement(angular.element(".activeField"),-10,200).then(function(){$scope.noscroll=!1,setTimeout(function(){document.querySelectorAll(".activeField .focusOn").length?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input").length?document.querySelectorAll(".activeField input")[0].focus():document.querySelectorAll(".activeField .selectize-input")[0].focus()})})})):setTimeout(function(){document.querySelectorAll(".activeField .focusOn")[0]?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input")[0].focus()}),SendVisitorData.send($scope.myform,getActiveField(),TimeCounter.getTimeElapsed())}},$rootScope.nextField=$scope.nextField=function(){var selected_index,selected_id;$scope.selected.index<$scope.myform.visible_form_fields.length-1?(selected_index=$scope.selected.index+1,selected_id=$scope.myform.visible_form_fields[selected_index]._id,$rootScope.setActiveField(selected_id,selected_index,!0)):$scope.selected.index===$scope.myform.visible_form_fields.length-1&&(selected_index=$scope.selected.index+1,selected_id="submit_field",$rootScope.setActiveField(selected_id,selected_index,!0))},$rootScope.prevField=$scope.prevField=function(){if($scope.selected.index>0){var selected_index=$scope.selected.index-1,selected_id=$scope.myform.visible_form_fields[selected_index]._id;$scope.setActiveField(selected_id,selected_index,!0)}},$scope.exitStartPage=function(){$scope.myform.startPage.showStart=!1,$scope.myform.visible_form_fields.length>0&&($scope.selected._id=$scope.myform.visible_form_fields[0]._id)},$rootScope.goToInvalid=$scope.goToInvalid=function(){document.querySelectorAll(".ng-invalid.focusOn")[0].focus()},$rootScope.submitForm=$scope.submitForm=function(){var _timeElapsed=TimeCounter.stopClock();$scope.loading=!0;var form=_.cloneDeep($scope.myform);form.timeElapsed=_timeElapsed,form.percentageComplete=$filter("formValidity")($scope.myform)/$scope.myform.visible_form_fields.length*100,delete form.visible_form_fields;for(var i=0;i<$scope.myform.form_fields.length;i++)"dropdown"!==$scope.myform.form_fields[i].fieldType||$scope.myform.form_fields[i].deletePreserved||($scope.myform.form_fields[i].fieldValue=$scope.myform.form_fields[i].fieldValue.option_value);setTimeout(function(){$scope.submitPromise=$http.post("/forms/"+$scope.myform._id,form).success(function(data,status,headers){console.log($scope.myform.form_fields[0]),$scope.myform.submitted=!0,$scope.loading=!1,SendVisitorData.send($scope.myform,getActiveField(),_timeElapsed)}).error(function(error){$scope.loading=!1,console.error(error),$scope.error=error.message})},500)},$scope.reloadForm()}]}}]),angular.module("forms").service("CurrentForm",function(){var _form={};this.getForm=function(){return _form},this.setForm=function(form){_form=form}}),angular.module("forms").factory("Forms",["$resource","FORM_URL",function($resource,FORM_URL){return $resource(FORM_URL,{formId:"@_id"},{query:{method:"GET",isArray:!0},get:{method:"GET",transformResponse:function(data,header){var form=angular.fromJson(data);return form.visible_form_fields=_.filter(form.form_fields,function(field){return field.deletePreserved===!1}),form}},update:{method:"PUT"},save:{method:"POST"}})}]),angular.module("forms").service("TimeCounter",[function(){var _startTime,_endTime=null;this.timeSpent=0,this.restartClock=function(){_startTime=Date.now(),_endTime=null},this.getTimeElapsed=function(){return _startTime?Math.abs(Date.now().valueOf()-_startTime.valueOf())/1e3:void 0},this.stopClock=function(){return _startTime&&null===_endTime?(_endTime=Date.now(),this.timeSpent=Math.abs(_endTime.valueOf()-_startTime.valueOf())/1e3,this._startTime=this._endTime=null,this.timeSpent):new Error("Clock has not been started")},this.clockStarted=function(){return!!this._startTime}}]),angular.module("users").config(["$translateProvider",function($translateProvider){$translateProvider.translations("en",{ACCESS_DENIED_TEXT:"You need to be logged in to access this page",USERNAME_LABEL:"Username",PASSWORD_LABEL:"Password",CURRENT_PASSWORD_LABEL:"Current Password",NEW_PASSWORD_LABEL:"New Password",VERIFY_PASSWORD_LABEL:"Verify Password",UPDATE_PASSWORD_LABEL:"Update Password",FIRST_NAME_LABEL:"First Name",LAST_NAME_LABEL:"Last Name",LANGUAGE_LABEL:"Language",EMAIL_LABEL:"Email",SIGNUP_HEADER_TEXT:"Sign up with your email",SIGNIN_HEADER_TEXT:"Signup in with your email",SIGNUP_ERROR_TEXT:"Couldn't complete registration due to errors",UPDATE_PROFILE_BTN:"Update Profile",PROFILE_SAVE_SUCCESS:"Profile saved successfully",PROFILE_SAVE_ERROR:"Could't Save Your Profile.",FORGOT_PASSWORD_LINK:"Forgot your password?",REVERIFY_ACCOUNT_LINK:"Resend your verification email",SIGNIN_BTN:"Sign in",SIGNUP_BTN:"Sign up",SAVE_PASSWORD_BTN:"Save Password",SUCCESS_HEADER:"Signup Successful",SUCCESS_TEXT:"Youve successfully registered an account at TellForm.",
VERIFICATION_EMAIL_SENT:"A verification email has been sent to",NOT_ACTIVATED_YET:"But your account is not activated yet",BEFORE_YOU_CONTINUE:"Before you continue, make sure to check your email for our verification. If you dont receive it within 24h drop us a line at ",CHECK_YOUR_EMAIL:"Check your email and click on the activation link to activate your account. If you have any questions drop us a line at",PASSWORD_RESTORE_HEADER:"Restore your password",ENTER_YOUR_EMAIL:"Enter your account email.",SUBMIT_BTN:"Submit",ASK_FOR_NEW_PASSWORD:"Ask for new password reset",PASSWORD_RESET_INVALID:"Password reset is invalid",PASSWORD_RESET_SUCCESS:"Passport successfully reset",PASSWORD_CHANGE_SUCCESS:"Passport successfully changed",CONTINUE_TO_LOGIN:"Continue to login page",VERIFY_SUCCESS:"Account successfully activated",VERIFY_ERROR:"Verification link is invalid or has expired"}),$translateProvider.preferredLanguage("en").fallbackLanguage("en").useSanitizeValueStrategy("escape")}]),angular.module("users").config(["$translateProvider",function($translateProvider){$translateProvider.translations("fr",{ACCESS_DENIED_TEXT:"Vouz nêtes pas autorisé à accéder à cette page.",USERNAME_LABEL:"Nom dutilisateur",PASSWORD_LABEL:"Mot de Passe",CURRENT_PASSWORD_LABEL:"Mot de passe actuel",NEW_PASSWORD_LABEL:"Nouveau Mot de Passe",VERIFY_PASSWORD_LABEL:"Vérifier le mot de passe",UPDATE_PASSWORD_LABEL:"Mettre à jour le mot de passe",FIRST_NAME_LABEL:"Prénom",LAST_NAME_LABEL:"Nom",LANGUAGE_LABEL:"Langue",EMAIL_LABEL:"Email",UPDATE_PROFILE_BTN:"Modifier le Profil",PROFILE_SAVE_SUCCESS:"Profil enregistré avec succès",PROFILE_SAVE_ERROR:"Erreur: impossible denregistrer votre Profile.",FORGOT_PASSWORD_LINK:"Mot de passe oublié ?",REVERIFY_ACCOUNT_LINK:"Re-envoyez un email de vérification",SIGNIN_BTN:"Connexion",SIGNUP_BTN:"Créer un compte",SAVE_PASSWORD_BTN:"Enregistrer votre nouveau Mot de Passe",SUCCESS_HEADER:"Votre Compte a été enregistré !",SUCCESS_TEXT:"Votre compte Tellform a été crée avec succès.",VERIFICATION_EMAIL_SENT:"Un email de verification a été envoyer à",NOT_ACTIVATED_YET:"Mais votre compte n'est pas activé",BEFORE_YOU_CONTINUE:"Avant de continuer, vous devez valider votre adresse mail. Merci de vérifier votre boite mail. Si vous ne lavez pas reçu dans les prochaines 24h, contactez-nous a ",CHECK_YOUR_EMAIL:"Vérifiez vos emails, et cliquez sur le lien de validation pour activer votre compte. Si vous avez une question contactez-nous à",PASSWORD_RESTORE_HEADER:"Mot de passe perdu",ENTER_YOUR_EMAIL:"Entrer votre email",SUBMIT_BTN:"Enregistrer",ASK_FOR_NEW_PASSWORD:"Demander un nouveau mot de pass ",PASSWORD_RESET_INVALID:"Le nouveau mot de passe est invalid",PASSWORD_RESET_SUCCESS:"Mot de passe réinitialisé avec succès",PASSWORD_CHANGE_SUCCESS:"Mot de passe enregistré avec succès",CONTINUE_TO_LOGIN:"Allez à la page de connexion",VERIFY_SUCCESS:"Votre compte est activé !",VERIFY_ERROR:"Le lien de vérification est invalide ou à expiré"})}]);
>>>>>>> diff
=======
>>>>>>> stage
>>>>>>> logic_jump