1webview.api=function(){const services={"public":webview.contextPath+"api/public/services/","private":webview.contextPath+"api/private/services/","protected":webview.contextPath+"api/protected/services/"},getPublicServiceUrl=function(onr){return onr||(onr=webview.onr),services["public"]+onr},getPrivateServiceUrl=function(onr){return onr||(onr=webview.onr),services["private"]+onr},getProtectedServiceUrl=function(onr){return onr||(onr=webview.onr),services["protected"]+onr},executeAsyncDirective=function(config){if(config?.url&&config?.element){const $element=jQuery(config.element);webview.util.ajax(config.url,{type:config.method||"POST",data:config.data||{},success:function(data){$element.html(data)},error:function(xhr,status,error){$element.html('<span class="iodav-webview-async-directive-error">'+(config.errorMessage||"")+"</span>")}},!0)}};return{getPublicServiceUrl:getPublicServiceUrl,getPrivateServiceUrl:getPrivateServiceUrl,getProtectedServiceUrl:getProtectedServiceUrl,executeAsyncDirective:executeAsyncDirective}}(),webview.util=function(){var ajax=function(url,options,csrf=!1){let ajaxOpts={url:url};jQuery.extend(!0,ajaxOpts,!0===csrf?webview.csrf.addCsrfToAjax(options):options),jQuery.ajax(ajaxOpts)},escapeSelector=function(selector){return"string"==typeof selector?selector.replace(/(\.)|(\[)|(\])/g,"\\$1$2$3"):selector};return{ajax:ajax,escapeSelector:escapeSelector}}(),webview.form=function(){var copySelectedFieldText=function(selectFieldName,targetFieldName,emptyValue){if(selectFieldName=':input[name="'+selectFieldName+'"] > option:selected',targetFieldName=':input[name="'+targetFieldName+'"]',emptyValue=emptyValue||"",jQuery(selectFieldName).val()!=emptyValue){var targetFieldValue="";jQuery(selectFieldName).each(function(index){targetFieldValue=targetFieldValue+jQuery(this).text()+"<br/>"}),jQuery(targetFieldName).val(targetFieldValue.substr(0,targetFieldValue.lastIndexOf("<br/>")))}else jQuery(targetFieldName).val("")},setOptionSelected=function(fieldName,fieldValue){fieldName='select[name="'+fieldName+'"]',""!=fieldName&&""!=fieldValue&&(fieldName+=">option",jQuery(fieldName).each(function(index){jQuery(this).val()!=fieldValue||jQuery(this).attr("selected","selected")}))},buildOrderItems=function(itemsSelector,targetFieldNameMail,targetFieldNameScreen){var orderItemsMail="",orderItemsScreen="";jQuery(itemsSelector+" input:checked").each(function(){orderItemsMail=orderItemsMail+jQuery(this).val()+"[[NL]]",orderItemsScreen=orderItemsScreen+jQuery(this).val()+" / "}),jQuery('input[name="'+targetFieldNameMail+'"]').val(orderItemsMail),jQuery('input[name="'+targetFieldNameScreen+'"]').val(orderItemsScreen)},conditionalRequired=function(trigger,dependent){jQuery(document).ready(function(){jQuery(trigger).is(":checked")?jQuery(dependent).attr("data-parsley-required","true"):jQuery(dependent).attr("data-parsley-required","false")})},checkCheckboxes=function(trigger,target){jQuery(trigger).is(":checked")?jQuery(target).find(":checkbox").prop("checked",!0):jQuery(target).find(":checkbox").prop("checked",!1)},setFieldValue=function(targetFieldName,targetFieldValue){targetFieldName=':input[name="'+targetFieldName+'"]',jQuery(targetFieldName).val(targetFieldValue)},copyCheckboxValue=function(idFrom,idTo){1==jQuery(idFrom).prop("checked")?jQuery(idTo).val(jQuery(idFrom).val()):jQuery(idTo).val("")},recommendPage=function(){document.location.href="mailto:?subject=Seitenempfehlung&body=Schau%20dir%20doch%20mal%20folgenden%20Link%20
1an:%0A"+window.location.href};return{copySelectedFieldText:copySelectedFieldText,setOptionSelected:setOptionSelected,checkCheckboxes:checkCheckboxes,setFieldValue:setFieldValue,copyCheckboxValue:copyCheckboxValue,recommendPage:recommendPage}}(),webview.menu=function(){var menuOptions={highlightClass:"active",selector:"#main-menu, .header-menu, #nav-level-3"},select=function(options){jQuery.extend(!0,menuOptions,options);var $menu=jQuery(menuOptions.selector),meiId=webview.mnr;"0"==meiId&&(meiId=guessMnrForPnr($menu)),highlight($menu,meiId)},highlight=function($menu,meiId){if(0!=meiId){var $item=$menu.find('li[data-id="'+meiId+'"]');$item.length>0&&($menu.find("li").removeClass(menuOptions.highlightClass),$item.addClass(menuOptions.highlightClass).parents("li[data-level]").addClass(menuOptions.highlightClass),$item.is("[data-parent]")&&$menu.find('li[data-id="'+$item.data("parent")+'"]').addClass(menuOptions.highlightClass).parents("li[data-level]").addClass(menuOptions.highlightClass))}},guessMnrForPnr=function($menu){var hasQueryString=""!=location.search,testString=","+webview.pnr+".html"+(hasQueryString?location.search:""),meiId=0;return $menu.find("li a").each(function(){var $item=jQuery(this),href=$item.attr("href");if(href&&-1!=href.indexOf(testString))return meiId=$item.parent("li").data("id"),!1}),meiId};return{select:select}}(),webview.ui=function(){let uiFramework="";const passStrength=function(elementToHandle,options){jQuery(elementToHandle).pwstrength(options)},getAutocompleteLimit=function(options){return options&&options.limit?options.limit:1/0},getPostalCodeServiceUrl=function(options,paramName){return webview.contextPath+"api/public/services/"+webview.onr+"/v1/geo/postalcodecity/search?"+paramName+"="},getPostalCodeSuggestionTemplate=function(postalCode){return"<p>"+postalCode.postalCode+" "+postalCode.placeName+"</p>"},autocompleteZip=function(options){const zipOptions={};zipOptions.zipSelector=webview.util.escapeSelector(options.zipSelector),options.citySelector&&(zipOptions.citySelector=webview.util.escapeSelector(options.citySelector));const engine=new Bloodhound({name:"zip",remote:{url:getPostalCodeServiceUrl(zipOptions,"q"),transform:function(parsedResponse){return engine.sorter(parsedResponse.postalCodes)},replace:function(url,query){return url+=query,options.countrySelector&&(url+="&country="+jQuery(options.countrySelector).val()),url}},datumTokenizer:function(datum){return Bloodhound.tokenizers.whitespace(datum.postalCode)},queryTokenizer:Bloodhound.tokenizers.whitespace,limit:getAutocompleteLimit(zipOptions),sorter:function(a,b){const postalCodeA=a.postalCode,postalCodeB=b.postalCode;return postalCodeA<postalCodeB?-1:postalCodeA>postalCodeB?1:0}});jQuery(zipOptions.zipSelector).typeahead({highlight:!0},{name:"zip",limit:getAutocompleteLimit(zipOptions)-1,displayKey:function(postalCode){return postalCode.postalCode},templates:{suggestion:getPostalCodeSuggestionTemplate},source:engine}).on("typeahead:selected",function($e,datum){zipOptions.citySelector&&jQuery(zipOptions.citySelector).typeahead("val",datum.placeName).trigger("keyup"),jQuery($e.currentTarget).trigger("keyup")})},autocompleteCity=function(options){const cityOptions={};cityOptions.citySelector=webview.util.escapeSelector(options.citySelector),options.zipSelector&&(cityOptions.zipSelector=webview.util.escapeSelector(options.zipSelector));const engine=new Bloodhound({name:"city",remote:{url:getPostalCodeServiceUrl(cityOptions,"q"),transform:function(parsedResponse){return engine.sorter(parsedResponse.postalCodes)},replace:function(url,query){return url+=query,options.countrySelector&&(url+="&country="+jQuery(options.countrySelector).val()),url}},datumTokenizer:function(datum){return Bloodhound.tokenizers.whitespace(datum.placeName)},queryTokenizer:Bloodhound.tokenizers.whitespace,limit:getAutocompleteLimit(cityOptions),sorter:function(a,b){const placeNameA=a.placeName.toLowerCase(),placeNameB=b.placeName.toLowerCase();return placeNameA<placeNameB?-1:placeNameA>placeNameB?1:0}});jQuery(cityOptions.citySelector).typeahead({highlight:!0},{name:"city",displayKey:function(postalCode){return postalCode.placeName},templates:{suggestion:getPostalCodeSuggestionTemplate},limit:getAutocompleteLimit(cityOptions)-1,source:engine}).on("typeahead:selected",function($e,datum){cityOptions.zipSelector&&jQuery(cityOptions.zipSelector).typeahead("val",datum.postalCode).trigger("keyup"),jQuery($e.currentTarget).trigger("keyup")})},autocompleteZipAndCity=function(options){autocompleteZip(options),autocompleteCity(options)},getZipCodeServiceUrl=function(){return webview.contextPath+webview.onr+",0,lvformzipcode.html"},autocompleteZipDistrict=function(options){const zipOptions={};zipOptions.zipSelector=webview.util.escapeSelector(options.zipSelector),options.citySelector&&(zipOptions.citySelector=webview.util.escapeSelector(options.citySelector));const engine=new Bloodhound({name:"zip",remote:{url:getZipCodeServiceUrl(),transform:function(parsedResponse){return engine.sorter(parsedResponse)},replace:function(url,query){let param="";return options.zipSelector&&(param="zip="+jQuery(options.zipSelector).val()),options.citySelector&&(param.length>0&&(param+="&"),param+="city="+jQuery(options.citySelector).val()),url+="?"+param,url}},datumTokenizer:function(datum){return Bloodhound.tokenizers.whitespace(datum.postalCode)},queryTokenizer:Bloodhound.tokenizers.whitespace,limit:getAutocompleteLimit(zipOptions),sorter:function(a,b){const postalCodeA=a.postalCode,postalCodeB=b.postalCode;return postalCodeA<postalCodeB?-1:postalCodeA>postalCodeB?1:0}});jQuery(zipOptions.zipSelector).typeahead({highlight:!0},{name:"zip",limit:getAutocompleteLimit(zipOptions)-1,displayKey:function(postalCode){return postalCode.postalCode},templates:{suggestion:getPostalCodeSuggestionTemplate},source:engine}).on("typeahead:selected",function($e,datum){zipOptions.citySelector&&jQuery(zipOptions.citySelector).typeahead("val",datum.placeName).trigger("keyup"),jQuery($e.currentTarget).trigger("keyup")})},autocompleteCityDistrict=function(options){const cityOptions={};cityOptions.citySelector=webview.util.escapeSelector(options.citySelector),options.zipSelector&&(cityOptions.zipSelector=webview.util.escapeSelector(options.zipSelector));const engine=new Bloodhound({name:"city",remote:{url:getZipCodeServiceUrl(),transform:function(parsedResponse){return engine.sorter(parsedResponse)},replace:function(url,query){let param="";return options.zipSelector&&(param="zip="+jQuery(options.zipSelector).val()),options.citySelector&&(param.length>0&&(param+="&"),param+="city="+jQuery(options.citySelector).val()),url+="?"+param,url}},datumTokenizer:function(datum){return Bloodhound.tokenizers.whitespace(datum.placeName)}
1,queryTokenizer:Bloodhound.tokenizers.whitespace,limit:getAutocompleteLimit(cityOptions),sorter:function(a,b){const placeNameA=a.placeName.toLowerCase(),placeNameB=b.placeName.toLowerCase();return placeNameA<placeNameB?-1:placeNameA>placeNameB?1:0}});jQuery(cityOptions.citySelector).typeahead({highlight:!0},{name:"city",displayKey:function(postalCode){return postalCode.placeName},templates:{suggestion:getPostalCodeSuggestionTemplate},limit:getAutocompleteLimit(cityOptions)-1,source:engine}).on("typeahead:selected",function($e,datum){cityOptions.zipSelector&&jQuery(cityOptions.zipSelector).typeahead("val",datum.postalCode).trigger("keyup"),jQuery($e.currentTarget).trigger("keyup")})},autocompleteZipCityDistrict=function(options){autocompleteZipDistrict(options),autocompleteCityDistrict(options)},handleDynamicFields=function(options){let counter=1;jQuery(document).on("click",'[data-role="dynamic-fields"] > .dynamic-form-group [data-role="remove"]',function(e){e.preventDefault(),counter<=options.max&&(jQuery(this).closest(".dynamic-form-group").remove(),counter-=1)}),jQuery(document).on("click",'[data-role="dynamic-fields"] > .form-group [data-role="add"]',function(e){e.preventDefault();const container=jQuery(this).closest('[data-role="dynamic-fields"]'),new_field_group=container.children().filter(".form-group:first-child").clone();new_field_group.find("input").each(function(){jQuery(this).val("")}
1),counter<options.max&&(container.append(new_field_group),counter+=1)})},configureDatePicker=function(){jQuery.fn.datepicker&&(jQuery.fn.datepicker.defaults.language=webview.language,jQuery.fn.datepicker.defaults.autoclose=!0,jQuery.fn.datepicker.defaults.todayHighlight=!0,jQuery.fn.datepicker.defaults.todayBtn="linked")},configureParsley=function(){const $form=jQuery("form[data-parsley-validate]");$form.length>0&&("bs5"===uiFramework?configureParsleyBs5($form):configureParsleyOld($form))},configureParsleyBs5=function($form){$form.parsley({errorsContainer:function(field){return field.$element.closest(".o-form-group")},errorClass:"is-invalid",successClass:"is-valid",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :disabled, .tt-hint, :hidden",classHandler:function(field){return field.$element},errorsWrapper:'<ul class="parsley-errors-list list-unstyled mt-1 mb-0"></ul>',errorTemplate:'<li class="invalid-feedback d-block"></li>'}).on("field:validated",function(field){const $formGroup=field.$element.closest(".o-form-group"),hasErrors=field.$element.hasClass("is-invalid");$formGroup.toggleClass("has-validation-error",hasErrors)})},configureParsleyOld=function($form){$form.parsley({errorsContainer:function(field){return field.$element.closest(".form-group")},errorClass:"has-error",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :disabled, .tt-hint",classHandler:function(field){return field.$element.closest(".form-group")},errorsWrapper:'<span class="help-block"></span>',errorTemplate:'<div class="parsley-error-item"></div>'}).on("field:validated",function(field){const $formGroup=field.$element.closest(".form-group"),errorCount=$formGroup.find(".parsley-error-item").length;0===errorCount?$formGroup.removeClass("has-error"):$formGroup.addClass("has-error")})},configureFileinput=function(){jQuery("form .form-fileinput").on("change",".btn-file :file",function(){const $input=jQuery(this),numFiles=1,label=$input.val().replace(/\\/g,"/").replace(/.*\//,"");$input.trigger("fileselect",[1,label])}),jQuery(".btn-file :file").on("fileselect",function(event,numFiles,label){const input=jQuery(this).parents(".input-group").find(".form-fileinput-filename"),log=label;input.length?input.val(log):log&&alert(log)})},configureMenu=function(options){webview.menu&&webview.menu.select(options?options.menu:{})},setTime=function($element,format){const time=moment().format(format);$element.text(time)},configureDigitalClock=function(){jQuery('[data-toggle="odav-digital-clock"]').each(function(){const $this=jQuery(this),format=$this.data("format")?$this.data("format"):"HH:mm",interval=$this.data("interval")?$this.data("interval"):1e3;setInterval(function(){setTime($this,format)},interval)})},configure=function(options){options&&options.uiFramework&&(uiFramework=options.uiFramework),configureDatePicker(),configureFileinput(),configureParsley(),configureMenu(),configureDigitalClock()},pageable=function(uuid,url,param,noResultMessage,data){const bodySelector=".odav-pageable-container-body",paginationSelector=".pagination a",directiveData=data||{},click=function($element,html){const href=$element.attr("href");return href&&"#"!==href&&(showSpinner(),webview.util.ajax(href,{method:"POST",success:function(html){jQuery("#"+uuid).html(html)},data:directiveData,contentType:"application/x-www-form-urlencoded; charset=UTF-8"},!0)),!1},showResult=function(html){const $element=jQuery("#"+uuid);$element.html(html),$element.on("click",".pagination a",function(){return click(jQuery(this),html)})},noResult=function(html){jQuery("#"+uuid).html(html),jQuery("#"+uuid+" "+bodySelector).html(noResultMessage)},showSpinner=function(){jQuery("#"+uuid+" "+bodySelector).html('<div class="spinner"></div>')};param||(param={}),jQuery(document).ready(function(){webview.util.ajax(url,{success:function(html){showResult(html)},method:"POST",statusCode:{206:function(html){noResult(html)}},data:jQuery.extend({},directiveData,param),contentType:"application/x-www-form-urlencoded; charset=UTF-8"},!0)})},charCounter=function(id,opts){const element=document.getElementById(id),counterElement=document.getElementById(id+"-charcounter");if(element&&counterElement){const options={i18n:{"de":{"chars":"Zeichen"}},overflowClassName:"odav-charcounter-overflow"};Object.assign(options,opts);const maxLength=element.getAttribute("data-charcounter-maxlength"),charsAttr=element.getAttribute("data-charcounter-i18n-chars"),text=charsAttr||options.i18n[webview.language].chars,count=()=>{const currentLength=element.value.length;maxLength?(maxLength<currentLength?counterElement.classList.contains(options.overflowClassName)||counterElement.classList.add(options.overflowClassName):counterElement.classList.remove(options.overflowClassName),counterElement.innerHTML=`${currentLength}/${maxLength} ${text}`):counterElement.innerHTML=`${currentLength} ${text}`};element.addEventListener("input",count),count()}};return{passStrength:passStrength,autocompleteZip:autocompleteZip,autocompleteCity:autocompleteCity,autocompleteZipAndCity:autocompleteZipAndCity,autocompleteZipDistrict:autocompleteZipDistrict,autocompleteCityDistrict:autocompleteCityDistrict,autocompleteZipCityDistrict:autocompleteZipCityDistrict,handleDynamicFields:handleDynamicFields,configure:configure,pageable:pageable,charCounter:charCounter}}(),webview.search=function(){const tabResultCount=function(url,engine,form){const data={},$form=jQuery(form);jQuery.each($form.serializeArray(),function(_,kv){data.hasOwnProperty(kv.name)?(data[kv.name]=jQuery.makeArray(data[kv.name]),data[kv.name].push(kv.value)):data[kv.name]=kv.value}),data["search-filter-engine"]="ALL"===engine?"":engine,webview.util.ajax(url,{contentType:"application/json; charset=UTF-8",accepts:{"json":"application/json"},success:function(d,textStatus,jqXHR){if(jQuery('a[data-filter="'+engine+'"] .counter').text(d.total),engine===jQuery("ul#search-tabs > li.active > a[data-filter]").attr("data-filter")&&"undefined"!=typeof _paq){let searchCategory=jQuery('a[data-filter="'+engine+'"] > span').text();_paq.push(["trackSiteSearch",data["search-searchterm"],searchCategory,d.total])}initSwipe()},data:data,cache:!1,traditional:!0})},tabsResultCount=function(url,engines,form){for(const element of engines)tabResultCount(url,element,form)},initSwipe=function(){"function"==typeof listenSwipeHorizontal&&listenSwipeHorizontal()},initTabs=function(url,form){const $tablist=jQuery(".search-filter-tabs");$tablist.find('a[data-toggle="tab"]').on("show.bs.tab",function(e){const filter=jQuery(e.target).data("filter");"ALL"===filter?jQuery(form).find("input[name=search-filter-engine]").val(""):jQuery(form).find("input[name=search-filter-engine]").val(filter),form.submit()});const searchEngines=[];$tablist.find("a[data-filter]").each(function(index){const $this=jQuery(this);searchEngines.push($this.data("filter"))}),tabsResultCount(url,searchEngines,form)},clearFilter=function(){jQuery('input[data-search-filter-clear="true"]').val("")}
1,preventSubmit=function(options){const $f=jQuery('form[name="'+options.formName+'"]');$f.length>0&&$f.parsley().on("form:validate",function(formInstance){let valid=!1;const $form=jQuery(formInstance.$element);if(options.dropTextCheck||jQuery.each($form.find('input:text[data-parsley-group="'+options.searchGroup+'"]'),function(i,el){if(jQuery.trim(el.value).length>0)return valid=!0,!1}),options.dropSelectCheck||valid||jQuery.each($form.find('select[data-parsley-group="'+options.searchGroup+'"]'),function(i,el){let emptyVal=jQuery(el).attr("data-parsley-block-value");if(emptyVal||(emptyVal=""),jQuery(el).val()!=emptyVal)return valid=!0,!1}),!options.dropCheckboxCheck&&!valid){const checkedBoxes=$form.find('input:checked[data-parsley-group="'+options.searchGroup+'"]');checkedBoxes&&checkedBoxes.length>0&&(valid=!0)}valid||formInstance.submitEvent.preventDefault()})};return{initTabs:initTabs,preventSubmit:preventSubmit,clearFilter:clearFilter}}(),webview.cookie=function(){const createCookie=function(name,value,expires,path,domain){let cookie=name+"="+escape(value)+";";expires&&expires>=0&&(expires instanceof Date?isNaN(expires.getTime())&&(expires=new Date):expires=new Date((new Date).getTime()+1e3*parseInt(expires)*60*60*24),cookie+="expires="+expires.toGMTString()+";"),path&&(cookie+="path="+path+";"),domain&&(cookie+="domain="+domain+";"),document.cookie=cookie},getCookie=function(name){const regexp=new RegExp("(?:^"+name+"|;\\s*"+name+")=(.*?)(?:;|$)","g"),result=regexp.exec(document.cookie);return null===result?null:result[1]},deleteCookie=function(name,path,domain){getCookie(name)&&createCookie(name,"",-1,path,domain)},autoConfirmConsents=function(){"object"==typeof window.CCM&&"function"==typeof window.CCM.denyAllPrivileges&&(CCM.fullConsentGiven&&!CCM.requiresConsentUpdate&&CCM.embeddings.length==CCM.acceptedEmbeddings.length||CCM.grantAllPrivileges())},manageConsents=function(){return"object"==typeof window.CCM&&(CCM.openControlPanel(),!0)},hasConsent=function(name){return"object"!=typeof window.CCM||CCM.acceptedEmbeddings.some(embedding=>embedding.name===name)};return{createCookie:createCookie,getCookie:getCookie,deleteCookie:deleteCookie,autoConfirmConsents:autoConfirmConsents,manageConsents:manageConsents,hasConsent:hasConsent}}(),webview.csrf=function(){const getToken=function(){const metaToken=document.querySelector('meta[name="_csrf"]');return metaToken?metaToken.getAttribute("content"):null},getHeaderName=function(){const metaHeader=document.querySelector('meta[name="_csrf_header"]');return metaHeader?metaHeader.getAttribute("content"):"X-CSRF-TOKEN"},addCsrfToForm=function(form){const token=getToken();if(token&&form){let csrfInput=form.querySelector('input[name="_csrf"]');csrfInput||(csrfInput=document.createElement("input"),csrfInput.type="hidden",csrfInput.name="_csrf",form.appendChild(csrfInput)),csrfInput.value=token}},addCsrfToAjax=function(options){const token=getToken(),headerName=getHeaderName();return token&&options&&(options.headers||(options.headers={}),options.headers[headerName]=token),options};return{getToken:getToken,getHeaderName:getHeaderName,addCsrfToForm:addCsrfToForm,addCsrfToAjax:addCsrfToAjax}}(),webview.hwr=(jQuery(function(){jQuery("label.hwr-checkbox-label").on("click",function(){let countSelectedJobs=jQuery("input[name=jobs]:checked").length;1===countSelectedJobs?jQuery("#countjobs").text("("+countSelectedJobs+" "+jQuery("#jobslist-singular")[0].textContent+")"):countSelectedJobs>=2?jQuery("#countjobs").text("("+countSelectedJobs+" "+jQuery("#jobslist-plural")[0].textContent+")"):jQuery("#countjobs").text("")}),jQuery("a[id^='hwrlistmap-markerref']").on("click",function(){let resultId=jQuery(this).data("resultid");jQuery("#hwrresultlist").toggleClass("hidden",!0),jQuery("#detail_"+resultId).toggleClass("hidden",!1),jQuery("#btnbackhwr").toggleClass("hidden",!1)}),jQuery("#btnbackhwr").on("click",function(){jQuery("#hwrresultlist").toggleClass("hidden",!1),jQuery(".hwrdetail").toggleClass("hidden",!0),jQuery("#btnbackhwr").toggleClass("hidden",!0)}),setTimeout(function(){jQuery("#map-addresses-renderer-hwrlistmap div.gm-style").on("click","a[data-id]",function(){jQuery("#hwrresultlist").toggleClass("hidden",!0),jQuery("div.hwrdetail").toggleClass("hidden",!0),jQuery("#detail_"+this.dataset.id).toggleClass("hidden",!1),jQuery("#btnbackhwr").toggleClass("hidden",!1)})},2e3)}),{}),webview.image=(carousel=function(carouselSelector,thumbSelector){var $thumbSelector=jQuery(thumbSelector),$thumbs=$thumbSelector.find("li > a"),$carouselSelector=jQuery(carouselSelector);$thumbSelector.find("li > a").click(function(){var $this=jQuery(this);return $carouselSelector.carousel($this.data("slide")),!1}),$carouselSelector.on("slid.bs.carousel",function(e){var id=jQuery(".item.active").data("slide-to");return $thumbs.removeClass("selected"),$thumbSelector.find("li >
1 a[data-slide="+id+"]").addClass("selected"),!1})},lightbox=function(selector,options){options||(options={}),jQuery(function(){if(jQuery.fn.simpleLightbox){var defaultOptions={"captionSelector":"self","captionsData":"subtitle","captionType":"data","history":!1,"animationSlide":!0,"animationSpeed":100,closeText:"x"},opts=jQuery.extend({},defaultOptions,options);jQuery(selector).simpleLightbox(opts)}})},initCarouselSwipe=function(selector){jQuery(function(){jQuery(selector).on("touchstart",function(event){var xClick=event.originalEvent.touches[0].pageX,$this=jQuery(this);$this.one("touchmove",function(event){var xMove=event.originalEvent.touches[0].pageX;Math.floor(xClick-xMove)>5?$this.carousel("next"):Math.floor(xClick-xMove)<-5&&$this.carousel("prev")}),$this.on("touchend",function(){$this.off("touchmove")})})})},initCarouselPlayStopButtons=function(carouselSelector,buttonSelector){jQuery(function(){var $carouselSelector=jQuery(carouselSelector),$buttonSelector=jQuery(buttonSelector),paused=0;$buttonSelector.find(".sr-only").text("Karussell-Element anhalten"),$buttonSelector.on("click",function(e){var $this=jQuery(this),state=paused?"cycle":"pause";$carouselSelector.carousel(state),$this.toggleClass("carousel-pause-button carousel-play-button"),paused=paused?0:1,paused?$this.find(".sr-only").text("Karussell-Element abspielen"):$this.find(".sr-only").text("Karussell-Element anhalten")})})},refreshUrl=function(uuid,source,timer){jQuery(document).ready(function(){timer<1&&(timer=1),setInterval(function(){if(source=jQuery("#"+uuid).attr("src"),-1==source.indexOf("?")){var new_source=source+"?timestamp="+(new Date).getTime();jQuery("#"+uuid).attr("src",new_source)}else if(-1==source.indexOf("?timestamp=")){source=source.split("×tamp=",1);var new_source=source+"×tamp="+(new Date).getTime();jQuery("#"+uuid).attr("src",new_source)}else{source=source.split("?timestamp=",1);var new_source=source+"?timestamp="+(new Date).getTime();jQuery("#"+uuid).attr("src",new_source)}},6e4*timer)})},{carousel:carousel,refreshUrl:refreshUrl,lightbox:lightbox,initCarouselSwipe:initCarouselSwipe,initCarouselPlayStopButtons:initCarouselPlayStopButtons}),webview.lsr=(setupJobSearch=function setupJobSearch(options){const jobSelector=webview.util.escapeSelector(options.jobSelector),dataSourceJobs=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("name"),queryTokenizer:Bloodhound.tokenizers.whitespace,prefetch:{url:webview.contextPath+"api/public/services/5100/lsr/jobs",cache:!1,prepare:function(settings){return settings.type="GET",settings}}});function removeGenderPostfix(name){return name.replace(/\s*\([mwd/]+\)\s*$/i,"").trim()}function calculateRelevance(query,jobname){let query_original=query.toLowerCase().trim(),query_clean=removeGenderPostfix(query).toLowerCase(),name_original=jobname.toLowerCase().trim(),name_clean=removeGenderPostfix(jobname).toLowerCase(),score;if(name_clean===query_clean)score=1e3;else if(name_clean.startsWith(query_clean))score=900;else{let words=name_clean.split(/\s+/);if(words.includes(query_clean))score=800;else if(name_clean.includes(query_clean))score=700;else{let common=0;for(;common<query_clean.length&&query_clean[common]===name_clean[common];)common++;score=10*common}}if(query_original===name_original&&(score+=200),name_original!==name_clean){let postfixMatch=name_original.match(/\([^)]*\)$/);if(postfixMatch){let postfix=postfixMatch[0].toLowerCase(),queryPostfixStart=query_original.indexOf("(");if(-1!==queryPostfixStart){let queryPostfixPart=query_original.substring(queryPostfixStart).toLowerCase(),commonPostfix=0,maxlen=Math.min(queryPostfixPart.length,queryPostfixPart.length);for(;commonPostfix<maxlen&&queryPostfixPart[commonPostfix]===postfix[commonPostfix];)commonPostfix++;score=10*commonPostfix}}}return score}function jobSource(query,syncResults){query&&0!==query.length||syncResults([]);let alreadySelectedJobs=[];jQuery("#jobList > input").each(function(){let value=jQuery(this).val();value&&value>0&&alreadySelectedJobs.push(value)}),dataSourceJobs.search(query,function(matches){let filteredMatches=matches.filter(function(item){return!alreadySelectedJobs.includes(item.berZdh.toString())}),sortHit=filteredMatches.sort(function(a,b){const scoreA=calculateRelevance(query,a.name),scoreB=calculateRelevance(query,b.n
1ame);return scoreA!==scoreB?scoreB-scoreA:removeGenderPostfix(a.name).length-removeGenderPostfix(b.name).length});syncResults(sortHit)})}function appendToSelect(label,value){let append=!0;const currentLength=$("#jobList > option").length;currentLength<3&&(currentLength<1&&jQuery("#jobinfotext").removeClass("hidden"),jQuery("#jobList input:checked").each(function(){$(this).val()===value&&(append=!1)}),append&&(jQuery("#jobList").append(`<input name="search-jobs" id="checkboxes-${value}" value="${value}" type="checkbox" class="check" checked />`),jQuery("#jobDlWrapper").removeClass("hidden"),jQuery("#jobDl").append(jQuery(`<dt class=${value}></dt>`).append(jQuery(`<abbr>${label}</abbr>`).prop("title",label))),jQuery("#jobDl").append(jQuery(`<dd class=${value}></dd>`).append(jQuery("<a class='remove-job' href='#'>X</a>")))),jQuery("#jobList > input").length>=3&&jQuery("#jobs").attr({disabled:"disabled"}))}jQuery(jobSelector).typeahead({highlight:!0,hint:!1},{name:"dataSourceJobs",source:jobSource,display:item=>item.name,limit:10}).on("typeahead:select",function(e,item){appendToSelect(item.name,item.berZdh),jQuery(jobSelector).typeahead("val","")}),jQuery("#jobDl").on("click","dd > a.remove-job",function(){const id=jQuery(this).parent().attr("class");jQuery("."+id).remove(),jQuery(`#jobList input[value='${id}']`).remove();const attr=jQuery(jobSelector).prop("disabled");return"undefined"!=typeof attr&&!1!==attr&&jQuery(jobSelector).removeAttr("disabled"),0===jQuery("#jobList > input").length&&(jQuery("#jobinfotext").addClass("hidden"),jQuery("#jobDlWrapper").addClass("hidden")),!1})},jQuery(function(){jQuery("label.lsr-checkbox-label").on("click",function(){let countSelectedJobs=jQuery("input[name=search-jobs]:checked").length;1===countSelectedJobs?jQuery("#countjobs").text("("+countSelectedJobs+" "+jQuery("#jobslist-singular")[0].textContent+")"):countSelectedJobs>=2?jQuery("#countjobs").text("("+countSelectedJobs+" "+jQuery("#jobslist-plural")[0].textContent+")"):jQuery("#countjobs").text("")}),jQuery("a[id^='lsrlistmap-markerref']").on("click",function(){let resultId=jQuery(this).data("resultid");jQuery("#lsrresultlist").toggleClass("hidden",!0),jQuery("#detail_"+resultId).toggleClass("hidden",!1),jQuery("#btnbacklsr").toggleClass("hidden",!1)}),jQuery("#btnbacklsr").on("click",function(){jQuery("#lsrresultlist").toggleClass("hidden",!1),jQuery(".lsrdetail").toggleClass("hidden",!0),jQuery("#btnbacklsr").toggleClass("hidden",!0)}),setTimeout(function(){jQuery("#map-addresses-renderer-lsrlistmap div.gm-style").on("click","a[data-id]",function(){jQuery("#lsrresultlist").toggleClass("hidden",!0),jQuery("div.lsrdetail").toggleClass("hidden",!0),jQuery("#detail_"+this.dataset.id).toggleClass("hidden",!1),jQuery("#btnbacklsr").toggleClass("hidden",!1)})},2e3),jQuery("a.switchtypefilter").on("click",function(){return jQuery("#switchtype").val(jQuery(this).data("filtertype")),jQuery("#page").val("1"),jQuery("#resultSearch").submit(),!1}),jQuery("a.paging").on("click",function(){var page=jQuery(this).data("page");return void 0!==page&&(jQuery("#page").val(page),jQuery("#resultSearch").submit()),!1});let $img=jQuery("#check_partner_img");void 0!==$img[0]&&$img[0].complete&&0===$img[0].naturalHeight&&$img.parent().parent().hide()}),{setupJobSearch:setupJobSearch}),webview.bookmark=function(){var SERVICEURL=webview.api.getProtectedServiceUrl()+"/v1/bookmark/",add=function(selector){var $this=jQuery(selector),param={};param.refId=$this.data("ref-id"),param.bmtId=$this.data("bmt-id"),param.bmaName=$this.data("bma-name"),param.bmaPage=$this.data("bma-page"),param.bmaLink=$this.data("bma-link"),param.bmaParam=$this.data("bma-param"),param.bmaComment="",webview.util.ajax(SERVICEURL+"add/"+param.bmtId+"/"+param.refId,{type:"POST",data:param,success:function(){$this.attr("onclick","webview.bookmark.remove(this);return false;").removeClass("add-bookmark").addClass("remove-bookmark").attr("title",$this.data("title-remove")).find("span.glyphicon").removeClass("glyphicon-star-empty").addClass("glyphicon-star")}},!0)},remove=function(selector){var $this=jQuery(selector),bmaId=$this.data("bma-id");if(bmaId)webview.util.ajax(SERVICEURL+bmaId,{type:"DELETE",success:function(){$this.remove()}},!0);else{var refId=$this.data("ref-id"),bmtId=$this.data("bmt-id");webview.util.ajax(SERVICEURL+"remove/"+bmtId+"/"+refId,{type:"DELETE",success:function(){$this.attr("onclick","webview.bookmark.add(this);return false;").removeClass("remove-bookmark").addClass("add-bookmark").attr("title",$this.data("title-add")).find("span.glyphicon").removeClass("glyphicon-star").addClass("glyphicon-star-empty")}},!0)}};return{add:add,remove:remove}}(),webview.statistic=function(){const google={}
1,matomo=function(){const isMatomoDefined=function(){return"undefined"!=typeof _paq},trackEvent=function(category,action,name="",value=""){isMatomoDefined()&&"undefined"!==matomo.analyticsConfig&&matomo.analyticsConfig.customTracking&&_paq.push(["trackEvent",category,action,name,value])},configureEyeAbleAssistEventTracking=function(){"undefined"!==matomo.analyticsConfig&&matomo.analyticsConfig.customTracking&&matomo.analyticsConfig.eyeAbleAssistTracking&&document.addEventListener("eyeable:event",function(e){e.detail&&matomo.trackEvent(matomo.analyticsConfig.eyeAbleAssistMatomoEvent.category,matomo.analyticsConfig.eyeAbleAssistMatomoEvent.action,e.detail)})};return{trackEvent:trackEvent,configureEyeAbleAssistEventTracking:configureEyeAbleAssistEventTracking}}(),configure=function(analyticsConfig){"undefined"!==analyticsConfig&&(matomo.analyticsConfig=analyticsConfig,matomo.configureEyeAbleAssistEventTracking())};return{google:google,matomo:matomo,configure:configure}}(),webview.statistic.google.ga=function(){const options={cookieName:"ga-disable-",optOutButtonSelector:".odav-ga-opt-out"},toggleButtonText=function(id,opts={}){const buttons=document.querySelectorAll(options.optOutButtonSelector);if(buttons)for(let button of buttons)isOptOutEnabled(id)?button.textContent=opts.activatedText:button.textContent=opts.inactivatedText},isOptOutEnabled=function(id){return!!id&&-1!==document.cookie.indexOf(getCookieName(id)+"=true")},getCookieName=function(id){return options.cookieName+id},optOut=function(id,options){if(id){const cookieName=getCookieName(id);toggleState(id,cookieName),toggleButtonText(id,options)}},toggleState=function(id,cookieName){const newState=!isOptOutEnabled(id);document.cookie=cookieName+"="+newState+"; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/; SameSite=Strict",window[cookieName]=newState};return{toggleButtonText:toggleButtonText,isOptOutEnabled:isOptOutEnabled,optOut:optOut}}(),webview.statistic.google.tm=function(){const options={cookieName:"google-tagmanager-disable"},optOut=function(containerId){if(containerId){const name=options.cookieName+"-"+containerId;setOptOut(name)}},setOptOut=function(cookieName){document.cookie=cookieName+"=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/; SameSite=Strict",window[cookieName]="true"};return{optOut:optOut,cookieName:options.cookieName}}(),webview.kao=function(){var saveCheckBoxValue=function(from,to){to.value=1==from.checked?"1":"0"},checkRecAddress=function(control){0==control.checked&&webview.kao.deleteRecAddress()},checkAnmeldezahl=function(){var anmeldezahl=document.courseregistration.numberOfRegistrations.value;parseInt(anmeldezahl,10)>1&&0==document.courseregistration.registrationType[1].checked&&(document.courseregistration.registrationType[0].checked=!1,document.courseregistration.registrationType[1].checked=!0)},setAnmeldezahl=function(radio,text){"fremd"==radio[1].value&&(parseInt(text.value,10)<=0||1==isNaN(parseInt(text.value,10)))&&(text.value="1")},checkRadio=function(){parseInt(document.courseregistration.numberOfRegistrations.value,10)>1&&(document.courseregistration.numberOfRegistrations.value="")},calculateFees=function(options){var totalCourseFee=0,totalExaminationFee=0,checkedAll=!0;if(jQuery(options.checkboxElement).each(function(index){if(jQuery(this).prop("checked")){var fees=jQuery(this).val().split(";");parseFloat(totalCourseFee+=parseFloat(fees[1])),parseFloat(totalExaminationFee+=parseFloat(fees[2]))}else checkedAll=!1}),0==checkedAll)totalCourseFee>0?jQuery(options.courseFeeElement).html(toCurrencyString(options.currencySymbol,totalCourseFee)):jQuery(options.courseFeeElement).html(""),totalExaminationFee>0?jQuery(options.examinationFeeElement).html(toCurrencyString(options.currencySymbol,totalExaminationFee)):jQuery(options.examinationFeeElement).html(""),summe=parseFloat(totalExaminationFee)+parseFloat(totalCourseFee),jQuery(options.sumFeesElement).html(toCurrencyString(options.currencySymbol,parseFloat(summe)));else{var c=0,e=0;""!=jQuery(options.totalCourseFeeElement).val()?(jQuery(options.courseFeeElement).html(toCurrencyString(options.currencySymbol,parseFloat(jQuery(options.totalCourseFeeElement).val()))),c=jQuery(options.totalCourseFeeElement).val()):totalCourseFee>0?(jQuery(options.courseFeeElement).html(toCurrencyString(options.currencySymbol,parseFloat(totalCourseFee))),c=totalCourseFee):jQuery(options.courseFeeElement).html(""),jQuery(options.totalExaminationFeeElement).val()?(jQuery(options.examinationFeeElement).html(toCurrencyString(options.currencySymbol,parseFloat(jQuery(options.totalExaminationFeeElement).val()))),e=jQuery(options.totalExaminationFeeElement).val()):totalExaminationFee>0?(jQuery(options.examinationFeeElement).html(toCurrencyString(options.currencySymbol,parseFloat(totalExaminationFee))),e=totalExaminationFee):jQuery(options.examinationFeeElement).html(""),summe=parseFloat(c)+parseFloat(e),jQuery(options.sumFeesElement).html(toCurrencyString(options.currencySymbol,parseFloat(summe)))}},toCurrencyString=function(symbol,amount){var num=amount.toFixed(2).replace(".",",").replace(/(\d)(?=(\d{3})+\b)/g,"$1.");return symbol?num+" "+symbol:num},deleteRecAddress=function(){jQuery("input[name^='rec_']").prop("value",""),jQuery("select[name^='rec_']").prop("selectedIndex",0)},showBankAccountFields=function(target,targetValue,targetFieldValue,targetDependedInputValidate){jQuery('select[name="'+targetValue+'"]').val()==targetFieldValue?(jQuery(target).show(),jQuery(target+" input").attr("required","required")):(jQuery(target).hide(),jQuery(target+" input").removeAttr("required"))},survey=function(options){options.surveyTextSelector&&(jQuery(options.surveyText).attr("readonly",!0),jQuery(options.checkedSelector).val()==options.surveyTextVal&&jQuery(options.surveyTextSelector).removeAttr("readonly"),jQuery(options.radioSelector).click(function(){jQuery(this).val()==options.surveyTextVal?jQuery(options.surveyTextSelector).removeAttr("readonly"):jQuery(options.surveyTextSelector).attr("readonly",!0).val("")}
1)),-1==options.surveyValue&&jQuery(options.radioSelector).last().attr("checked",!0)};return{saveCheckBoxValue:saveCheckBoxValue,checkRecAddress:checkRecAddress,checkAnmeldezahl:checkAnmeldezahl,setAnmeldezahl:setAnmeldezahl,checkRadio:checkRadio,calculateFees:calculateFees,survey:survey,showBankAccountFields:showBankAccountFields}}(),webview.bsv=(showTemplates=function(index){const templateDialog=document.getElementById("templateDialog"),confirmBtn=templateDialog.querySelector("#confirmBtn");var checks=templateDialog.querySelectorAll(".chk");jQuery("#templateDialog").modal("show"),confirmBtn.addEventListener("click",function handler(){checks.forEach((check,checkindex)=>{if(check.checked){const selcr=document.getElementsByName("selcr");$("textarea").eq(index).val(selcr[checkindex].innerHTML)}}),jQuery("#templateDialog").modal("hide"),this.removeEventListener("click",handler)})},{showTemplates:showTemplates}),webview.voucher=function(){var url=webview.api.getProtectedServiceUrl()+"/v1/voucher",assign=function(voucherType,options){webview.util.ajax(url,{type:"POST",method:"POST",dataType:"json",data:{"voucherType":voucherType},success:function(voucher,textStatus,jqXHR){if(voucher){var $voucherCode=jQuery(".iodav-voucher-code.iodav-voucher-type-"+voucher.voucherCode.type);if($voucherCode.find(".iodav-voucher-code-link").remove(),voucher.notLoggedIn)$voucherCode.html(options.notLoggedIn);else if(voucher.noMoreCodes)$voucherCode.html(options.notMoreCodes);else{var html='<span class="iodav-voucher-code-text">'+options.codeText+voucher.voucherCode.code+"</span>";html+=options.afterCode,$voucherCode.html(html)}}}},!0)};return{assign:assign}}(),webview.page=function(){var markAsRead=function(element){var $element=jQuery(element),pag_id=$element.data("pag-id");webview.util.ajax(webview.api.getProtectedServiceUrl()+"/v1/currentuser/pages/"+pag_id+"/markAsRead",{type:"POST",success:function(){$element.hide()}},!0)};return{markAsRead:markAsRead}}(),function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global="undefined"!=typeof globalThis?globalThis:global||self,global.i18next=factory())}(this,function(){"use strict";function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?Object(arguments[i]):{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_defineProperty(target,key,source[key])})}return target}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _possibleConstructorReturn(self,call){return!call||"object"!==_typeof(call)&&"function"!=typeof call?_assertThisInitialized(self):call}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o
1){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(o)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o},_setPrototypeOf(o,p)}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}var consoleLogger={type:"logger",log:function log(args){this.output("log",args)},warn:function warn(args){this.output("warn",args)},error:function error(args){this.output("error",args)},output:function output(type,args){console&&console[type]&&console[type].apply(console,args)}},Logger=function(){function Logger(concreteLogger){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,Logger),this.init(concreteLogger,options)}return _createClass(Logger,[{key:"init",value:function init(concreteLogger){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=options.prefix||"i18next:",this.logger=concreteLogger||consoleLogger,this.options=options,this.debug=options.debug}},{key:"setDebug",value:function setDebug(bool){this.debug=bool}},{key:"log",value:function log(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return this.forward(args,"log","",!0)}},{key:"warn",value:function warn(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return this.forward(args,"warn","",!0)}},{key:"error",value:function error(){for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++)args[_key3]=arguments[_key3];return this.forward(args,"error","")}},{key:"deprecate",value:function deprecate(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++)args[_key4]=arguments[_key4];return this.forward(args,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function forward(args,lvl,prefix,debugOnly){return debugOnly&&!this.debug?null:("string"==typeof args[0]&&(args[0]="".concat(prefix).concat(this.prefix," ").concat(args[0])),this.logger[lvl](args))}},{key:"create",value:function create(moduleName){return new Logger(this.logger,_objectSpread({},{prefix:"".concat(this.prefix,":").concat(moduleName,":")},this.options))}}]),Logger}(),baseLogger=new Logger,EventEmitter=function(){function EventEmitter(){_classCallCheck(this,EventEmitter),this.observers={}}return _createClass(EventEmitter,[{key:"on",value:function on(events,listener){var _this=this;return events.split(" ").forEach(function(event){_this.observers[event]=_this.observers[event]||[],_this.observers[event].push(listener)}),this}},{key:"off",value:function off(event,listener){this.observers[event]&&(listener?this.observers[event]=this.observers[event].filter(function(l){return l!==listener}):delete this.observers[event])}},{key:"emit",value:function emit(event){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];if(this.observers[event]){var cloned=[].concat(this.observers[event]);cloned.forEach(function(observer){observer.apply(void 0,args)})}if(this.observers["*"]){var _cloned=[].concat(this.observers["*"]);_cloned.forEach(function(observer){observer.apply(observer,[event].concat(args))})}}}]),EventEmitter}();function defer(){var res,rej,promise=new Promise(function(resolve,reject){res=resolve,rej=reject});return promise.resolve=res,promise.reject=rej,promise}function makeString(object){return null==object?"":""+object}function copy(a,s,t){a.forEach(function(m){s[m]&&(t[m]=s[m])})}function getLastOfPath(object,path,Empty){function cleanKey(key){return key&&key.indexOf("###")>-1?key.replace(/###/g,"."):key}function canNotTraverseDeeper(){return!object||"string"==typeof object}for(var stack="string"!=typeof path?[].concat(path):path.split(".");stack.length>1;){if(canNotTraverseDeeper())return{};var key=cleanKey(stack.shift());!object[key]&&Empty&&(object[key]=new Empty),object=Object.prototype.hasOwnProperty.call(object,key)?object[key]:{}}return canNotTraverseDeeper()?{}:{obj:object,k:cleanKey(stack.shift())}}function setPath(object,path,newValue){var _getLastOfPath=getLastOfPath(object,path,Object),obj=_getLastOfPath.obj,k=_getLastOfPath.k;obj[k]=newValue}function pushPath(object,path,newValue,concat){var _getLastOfPath2=getLastOfPath(object,path,Object),obj=_getLastOfPath2.obj,k=_getLastOfPath2.k;obj[k]=obj[k]||[],concat&&(obj[k]=obj[k].concat(newValue)),concat||obj[k].push(newValue)}function getPath(object,path){var _getLastOfPath3=getLastOfPath(object,path),obj=_getLastOfPath3.obj,k=_getLastOfPath3.k;if(obj)return obj[k]}function getPathWithDefaults(data,defaultData,key){var value=getPath(data,key);return void 0!==value?value:getPath(defaultData,key)}function deepExtend(target,source,overwrite){for(var prop in source)"__proto__"!==prop&&"constructor"!==prop&&(prop in target?"string"==typeof target[prop]||target[prop]instanceof String||"string"==typeof source[prop]||source[prop]instanceof String?overwrite&&(target[prop]=source[prop]):deepExtend(target[prop],source[prop],overwrite):target[prop]=source[prop]);return target}function regexEscape(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape(data){return"string"==typeof data?data.replace(/[&<>
1"'\/]/g,function(s){return _entityMap[s]}):data}var isIE10="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;function deepFind(obj,path){var keySeparator=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(obj){if(obj[path])return obj[path];for(var paths=path.split(keySeparator),current=obj,i=0;i<paths.length;++i){if("string"==typeof current[paths[i]]&&i+1<paths.length)return;if(void 0===current[paths[i]]){for(var j=2,p=paths.slice(i,i+j).join(keySeparator),mix=current[p];void 0===mix&&paths.length>i+j;)j++,p=paths.slice(i,i+j).join(keySeparator),mix=current[p];if(void 0===mix)return;if("string"==typeof mix)return mix;if(p&&"string"==typeof mix[p])return mix[p];var joinedPath=paths.slice(i+j).join(keySeparator);return joinedPath?deepFind(mix,joinedPath,keySeparator):void 0}current=current[paths[i]]}return current}}var ResourceStore=function(_EventEmitter){function ResourceStore(data){var _this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _classCallCheck(this,ResourceStore),_this=_possibleConstructorReturn(this,_getPrototypeOf(ResourceStore).call(this)),isIE10&&EventEmitter.call(_assertThisInitialized(_this)),_this.data=data||{},_this.options=options,void 0===_this.options.keySeparator&&(_this.options.keySeparator="."),void 0===_this.options.ignoreJSONStructure&&(_this.options.ignoreJSONStructure=!0),_this}return _inherits(ResourceStore,_EventEmitter),_createClass(ResourceStore,[{key:"addNamespaces",value:function addNamespaces(ns){this.options.ns.indexOf(ns)<0&&this.options.ns.push(ns)}},{key:"removeNamespaces",value:function removeNamespaces(ns){var index=this.options.ns.indexOf(ns);index>-1&&this.options.ns.splice(index,1)}},{key:"getResource",value:function getResource(lng,ns,key){var options=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},keySeparator=void 0!==options.keySeparator?options.keySeparator:this.options.keySeparator,ignoreJSONStructure=void 0!==options.ignoreJSONStructure?options.ignoreJSONStructure:this.options.ignoreJSONStructure,path=[lng,ns];key&&"string"!=typeof key&&(path=path.concat(key)),key&&"string"==typeof key&&(path=path.concat(keySeparator?key.split(keySeparator):key)),lng.indexOf(".")>-1&&(path=lng.split("."));var result=getPath(this.data,path);return result||!ignoreJSONStructure||"string"!=typeof key?result:deepFind(this.data&&this.data[lng]&&this.data[lng][ns],key,keySeparator)}},{key:"addResource",value:function addResource(lng,ns,key,value){var options=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},keySeparator=this.options.keySeparator;void 0===keySeparator&&(keySeparator=".");var path=[lng,ns];key&&(path=path.concat(keySeparator?key.split(keySeparator):key)),lng.indexOf(".")>-1&&(path=lng.split("."),value=ns,ns=path[1]),this.addNamespaces(ns),setPath(this.data,path,value),options.silent||this.emit("added",lng,ns,key,value)}},{key:"addResources",value:function addResources(lng,ns,resources){var options=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var m in resources)"string"!=typeof resources[m]&&"[object Array]"!==Object.prototype.toString.apply(resources[m])||this.addResource(lng,ns,m,resources[m],{silent:!0});options.silent||this.emit("added",lng,ns,resources)}},{key:"addResourceBundle",value:function addResourceBundle(lng,ns,resources,deep,overwrite){var options=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},path=[lng,ns];lng.indexOf(".")>-1&&(path=lng.split("."),deep=resources,resources=ns,ns=path[1]),this.addNamespaces(ns);var pack=getPath(this.data,path)||{};deep?deepExtend(pack,resources,overwrite):pack=_objectSpread({},pack,resources),setPath(this.data,path,pack),options.silent||this.emit("added",lng,ns,resources)}},{key:"removeResourceBundle",value:function removeResourceBundle(lng,ns){this.hasResourceBundle(lng,ns)&&delete this.data[lng][ns],this.removeNamespaces(ns),this.emit("removed",lng,ns)}},{key:"hasResourceBundle",value:function hasResourceBundle(lng,ns){return void 0!==this.getResource(lng,ns)}},{key:"getResourceBundle",value:function getResourceBundle(lng,ns){return ns||(ns=this.options.defaultNS),"v1"===this.options.compatibilityAPI?_objectSpread({},{},this.getResource(lng,ns)):this.getResource(lng,ns)}},{key:"getDataByLanguage",value:function getDataByLanguage(lng){return this.data[lng]}},{key:"toJSON",value:function toJSON(){return this.data}}]),ResourceStore}(EventEmitter),postProcessor={processors:{},addPostProcessor:function addPostProcessor(module){this.processors[module.name]=module},handle:function handle(processors,value,key,options,translator){var _this=this;
vendor: 4,747 bytes, line 1
1return processors.forEach(function(processor){_this.processors[processor]&&(value=_this.processors[processor].process(value,key,options,translator))}),value}},checkedLoadedFor={},Translator=function(_EventEmitter){function Translator(services){var _this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,Translator),_this=_possibleConstructorReturn(this,_getPrototypeOf(Translator).call(this)),isIE10&&EventEmitter.call(_assertThisInitialized(_this)),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],services,_assertThisInitialized(_this)),_this.options=options,void 0===_this.options.keySeparator&&(_this.options.keySeparator="."),_this.logger=baseLogger.create("translator"),_this}return _inherits(Translator,_EventEmitter),_createClass(Translator,[{key:"changeLanguage",value:function changeLanguage(lng){lng&&(this.language=lng)}},{key:"exists",value:function exists(key){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},resolved=this.resolve(key,options);return resolved&&void 0!==resolved.res}},{key:"extractFromKey",value:function extractFromKey(key,options){var nsSeparator=void 0!==options.nsSeparator?options.nsSeparator:this.options.nsSeparator;void 0===nsSeparator&&(nsSeparator=":");var keySeparator=void 0!==options.keySeparator?options.keySeparator:this.options.keySeparator,namespaces=options.ns||this.options.defaultNS;if(nsSeparator&&key.indexOf(nsSeparator)>-1){var m=key.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:key,namespaces:namespaces};var parts=key.split(nsSeparator);(nsSeparator!==keySeparator||nsSeparator===keySeparator&&this.options.ns.indexOf(parts[0])>-1)&&(namespaces=parts.shift()),key=parts.join(keySeparator)}return"string"==typeof namespaces&&(namespaces=[namespaces]),{key:key,namespaces:namespaces}}},{key:"translate",value:function translate(keys,options,lastKey){var _this2=this;if("object"!==_typeof(options)&&this.options.overloadTranslationOptionHandler&&(options=this.options.overloadTranslationOptionHandler(arguments)),options||(options={}),null==keys)return"";Array.isArray(keys)||(keys=[String(keys)]);var keySeparator=void 0!==options.keySeparator?options.keySeparator:this.options.keySeparator,_this$extractFromKey=this.extractFromKey(keys[keys.length-1],options),key=_this$extractFromKey.key,namespaces=_this$extractFromKey.namespaces,namespace=namespaces[namespaces.length-1],lng=options.lng||this.language,appendNamespaceToCIMode=options.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(lng&&"cimode"===lng.toLowerCase()){if(appendNamespaceToCIMode){var nsSeparator=options.nsSeparator||this.options.nsSeparator;return namespace+nsSeparator+key}return key}var resolved=this.resolve(keys,options),res=resolved&&resolved.res,resUsedKey=resolved&&resolved.usedKey||key,resExactUsedKey=resolved&&resolved.exactUsedKey||key,resType=Object.prototype.toString.apply(res),noObject=["[object Number]","[object Function]","[object RegExp]"],joinArrays=void 0!==options.joinArrays?options.joinArrays:this.options.joinArrays,handleAsObjectInI18nFormat=!this.i18nFormat||this.i18nFormat.handleAsObject,handleAsObject="string"!=typeof res&&"boolean"!=typeof res&&"number"!=typeof res;if(handleAsObjectInI18nFormat&&res&&handleAsObject&&noObject.indexOf(resType)<0&&("string"!=typeof joinArrays||"[object Array]"!==resType)){if(!options.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(resUsedKey,res,_objectSpread({},options,{ns:namespaces})):"key '".concat(key," (").concat(this.language,")' returned an object instead of string.");if(keySeparator){var resTypeIsArray="[object Array]"===resType,copy=resTypeIsArray?[]:{},newKeyToUse=resTypeIsArray?resExactUsedKey:resUsedKey;for(var m in res)if(Object.prototype.hasOwnProperty.call(res,m)){var deepKey="".concat(newKeyToUse).concat(keySeparator).concat(m);copy[m]=this.translate(deepKey,_objectSpread({},options,{joinArrays:!1,ns:namespaces})),copy[m]===deepKey&&(copy[m]=res[m])}res=copy}}else if(handleAsObjectInI18nFormat&&"string"==typeof joinArrays&&"[object Array]"===resType)res=res.join(joinArrays),res&&(res=this.extendTranslation(res,keys,options,lastKey));else{var usedDefault=!1,usedKey=!1,needsPluralHandling=void 0!==options.count&&"string"!=typeof options.count,hasDefaultValue=Translator.hasDefaultValue(options),defaultValueSuffix=needsPluralHandling?this.pluralResolver.getSuffix(lng,options.count):"",defaultValue=options["defaultValue".concat(defaultValueSuffix
1)]||options.defaultValue;!this.isValidLookup(res)&&hasDefaultValue&&(usedDefault=!0,res=defaultValue),this.isValidLookup(res)||(usedKey=!0,res=key);var updateMissing=hasDefaultValue&&defaultValue!==res&&this.options.updateMissing;if(usedKey||usedDefault||updateMissing){if(this.logger.log(updateMissing?"updateKey":"missingKey",lng,namespace,key,updateMissing?defaultValue:res),keySeparator){var fk=this.resolve(key,_objectSpread({},options,{keySeparator:!1}));fk&&fk.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var lngs=[],fallbackLngs=this.languageUtils.getFallbackCodes(this.options.fallbackLng,options.lng||this.language);if("fallback"===this.options.saveMissingTo&&fallbackLngs&&fallbackLngs[0])for(var i=0;i<fallbackLngs.length;i++)lngs.push(fallbackLngs[i]);else"all"===this.options.saveMissingTo?lngs=this.languageUtils.toResolveHierarchy(options.lng||this.language):lngs.push(options.lng||this.language);var send=function send(l,k,fallbackValue){_this2.options.missingKeyHandler?_this2.options.missingKeyHandler(l,namespace,k,updateMissing?fallbackValue:res,updateMissing,options):_this2.backendConnector&&_this2.backendConnector.saveMissing&&_this2.backendConnector.saveMissing(l,namespace,k,updateMissing?fallbackValue:res,updateMissing,options),_this2.emit("missingKey",l,namespace,k,res)};this.options.saveMissing&&(this.options.saveMissingPlurals&&needsPluralHandling?lngs.forEach(function(language){_this2.pluralResolver.getSuffixes(language).forEach(function(suffix){send([language],key+suffix,options["defaultValue".concat(suffix)]||defaultValue)})}):send(lngs,key,defaultValue))}res=this.extendTranslation(res,keys,options,resolved,lastKey),usedKey&&res===key&&this.options.appendNamespaceToMissingKey&&(res="".concat(namespace,":").concat(key)),usedKey&&this.options.parseMissingKeyHandler&&(res=this.options.parseMissingKeyHandler(res))}return res}},{key:"extendTranslation",value:function extendTranslation(res,key,options,resolved,lastKey){var _this3=this;if(this.i18nFormat&&this.i18nFormat.parse)res=this.i18nFormat.parse(res,options,resolved.usedLng,resolved.usedNS,resolved.usedKey,{resolved:resolved});else if(!options.skipInterpolation){options.interpolation&&this.interpolator.init(_objectSpread({},options,{interpolation:_objectSpread({},this.options.interpolation,options.interpolation)}));var skipOnVariables=options.interpolation&&options.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,nestBef;if(skipOnVariables){var nb=res.match(this.interpolator.nestingRegexp);nestBef=nb&&nb.length}var data=options.replace&&"string"!=typeof options.replace?options.replace:options;if(this.options.interpolation.defaultVariables&&(data=_objectSpread({},this.options.interpolation.defaultVariables,data)),res=this.interpolator.interpolate(res,data,options.lng||this.language,options),skipOnVariables){var na=res.match(this.interpolator.nestingRegexp),nestAft=na&&na.length;nestBef<nestAft&&(options.nest=!1)}!1!==options.nest&&(res=this.interpolator.nest(res,function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return lastKey&&lastKey[0]===args[0]&&!options.context?(_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0]," in key: ").concat(key[0])),null):_this3.translate.apply(_this3,args.concat([key]))},options)),options.interpolation&&this.interpolator.reset()}var postProcess=options.postProcess||this.options.postProcess,postProcessorNames="string"==typeof postProcess?[postProcess]:postProcess;return null!=res&&postProcessorNames&&postProcessorNames.length&&!1!==options.applyPostProcessor&&(res=postProcessor.handle(postProcessorNames,res,key,this.options&&this.options.postProcessPassResolved?_objectSpread({i18nResolved:resolved},options):options,this)),res}},{key:"resolve",value:function resolve(keys){var _this4=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},found,usedKey,exactUsedKey,usedLng,usedNS;return"string"==typeof keys&&(keys=[keys]),keys.forEach(function(k){if(!_this4.isValidLookup(found)){var extracted=_this4.extractFromKey(k,options),key=extracted.key;usedKey=key;var namespaces=extracted.namespaces;_this4.options.fallbackNS&&(namespaces=namespaces.concat(_this4.options.fallbackNS));var needsPluralHandling=void 0!==options.count&&"string"!=typeof options.count,needsContextHandling=void 0!==options.context&&"string"==typeof options.context&&""!==options.context,codes=options.lngs?options.lngs:_this4.languageUtils.toResolveHierarchy(options.lng||_this4.language,options.fallbackLng);
1namespaces.forEach(function(ns){_this4.isValidLookup(found)||(usedNS=ns,!checkedLoadedFor["".concat(codes[0],"-").concat(ns)]&&_this4.utils&&_this4.utils.hasLoadedNamespace&&!_this4.utils.hasLoadedNamespace(usedNS)&&(checkedLoadedFor["".concat(codes[0],"-").concat(ns)]=!0,_this4.logger.warn('key "'.concat(usedKey,'" for languages "').concat(codes.join(", "),'" won\'t get resolved as namespace "').concat(usedNS,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),codes.forEach(function(code){if(!_this4.isValidLookup(found)){usedLng=code;var finalKey=key,finalKeys=[finalKey],pluralSuffix,possibleKey;if(_this4.i18nFormat&&_this4.i18nFormat.addLookupKeys)_this4.i18nFormat.addLookupKeys(finalKeys,key,code,ns,options);else needsPluralHandling&&(pluralSuffix=_this4.pluralResolver.getSuffix(code,options.count)),needsPluralHandling&&needsContextHandling&&finalKeys.push(finalKey+pluralSuffix),needsContextHandling&&finalKeys.push(finalKey+="".concat(_this4.options.contextSeparator).concat(options.context)),needsPluralHandling&&finalKeys.push(finalKey+=pluralSuffix);for(;possibleKey=finalKeys.pop();)_this4.isValidLookup(found)||(exactUsedKey=possibleKey,found=_this4.getResource(code,ns,possibleKey,options))}}))})}}),{res:found,usedKey:usedKey,exactUsedKey:exactUsedKey,usedLng:usedLng,usedNS:usedNS}}},{key:"isValidLookup",value:function isValidLookup(res){return!(void 0===res||!this.options.returnNull&&null===res||!this.options.returnEmptyString&&""===res)}},{key:"getResource",value:function getResource(code,ns,key){var options=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(code,ns,key,options):this.resourceStore.getResource(code,ns,key,options)}}],[{key:"hasDefaultValue",value:function hasDefaultValue(options){var prefix="defaultValue";for(var option in options)if(Object.prototype.hasOwnProperty.call(options,option)&&prefix===option.substring(0,12)&&void 0!==options[option])return!0;return!1}}]),Translator}(EventEmitter);function capitalize(string){return string.charAt(0).toUpperCase()+string.slice(1)}var LanguageUtil=function(){function LanguageUtil(options){_classCallCheck(this,LanguageUtil),this.options=options,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}return _createClass(LanguageUtil,[{key:"getScriptPartFromCode",value:function getScriptPartFromCode(code){if(!code||code.indexOf("-")<0)return null;var p=code.split("-");return 2===p.length?null:(p.pop(),"x"===p[p.length-1].toLowerCase()?null:this.formatLanguageCode(p.join("-")))}},{key:"getLanguagePartFromCode",value:function getLanguagePartFromCode(code){if(!code||code.indexOf("-")<0)return code;var p=code.split("-");return this.formatLanguageCode(p[0])}},{key:"formatLanguageCode",value:function formatLanguageCode(code){if("string"==typeof code&&code.indexOf("-")>-1){var specialCases=["hans","hant","latn","cyrl","cans","mong","arab"],p=code.split("-");return this.options.lowerCaseLng?p=p.map(function(part){return part.toLowerCase()}):2===p.length?(p[0]=p[0].toLowerCase(),p[1]=p[1].toUpperCase(),specialCases.indexOf(p[1].toLowerCase())>-1&&(p[1]=capitalize(p[1].toLowerCase()))):3===p.length&&(p[0]=p[0].toLowerCase(),2===p[1].length&&(p[1]=p[1].toUpperCase()),"sgn"!==p[0]&&2===p[2].length&&(p[2]=p[2].toUpperCase()),specialCases.indexOf(p[1].toLowerCase())>-1&&(p[1]=capitalize(p[1].toLowerCase())),specialCases.indexOf(p[2].toLowerCase())>-1&&(p[2]=capitalize(p[2].toLowerCase()))),p.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?code.toLowerCase():code}},{key:"isWhitelisted",value:function isWhitelisted(code){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(code)}},{key:"isSupportedCode",value:function isSupportedCode(code){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(code=this.getLanguagePartFromCode(code)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(code)>-1}},{key:"getBestMatchFromCodes",value:function getBestMatchFromCodes(codes){var _this=this,found;
1return codes?(codes.forEach(function(code){if(!found){var cleanedLng=_this.formatLanguageCode(code);_this.options.supportedLngs&&!_this.isSupportedCode(cleanedLng)||(found=cleanedLng)}}),!found&&this.options.supportedLngs&&codes.forEach(function(code){if(!found){var lngOnly=_this.getLanguagePartFromCode(code);if(_this.isSupportedCode(lngOnly))return found=lngOnly;found=_this.options.supportedLngs.find(function(supportedLng){if(0===supportedLng.indexOf(lngOnly))return supportedLng})}}),found||(found=this.getFallbackCodes(this.options.fallbackLng)[0]),found):null}},{key:"getFallbackCodes",value:function getFallbackCodes(fallbacks,code){if(!fallbacks)return[];if("function"==typeof fallbacks&&(fallbacks=fallbacks(code)),"string"==typeof fallbacks&&(fallbacks=[fallbacks]),"[object Array]"===Object.prototype.toString.apply(fallbacks))return fallbacks;if(!code)return fallbacks["default"]||[];var found=fallbacks[code];return found||(found=fallbacks[this.getScriptPartFromCode(code)]),found||(found=fallbacks[this.formatLanguageCode(code)]),found||(found=fallbacks[this.getLanguagePartFromCode(code)]),found||(found=fallbacks["default"]),found||[]}},{key:"toResolveHierarchy",value:function toResolveHierarchy(code,fallbackCode){var _this2=this,fallbackCodes=this.getFallbackCodes(fallbackCode||this.options.fallbackLng||[],code),codes=[],addCode=function addCode(c){c&&(_this2.isSupportedCode(c)?codes.push(c):_this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return"string"==typeof code&&code.indexOf("-")>-1?("languageOnly"!==this.options.load&&addCode(this.formatLanguageCode(code)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&addCode(this.getScriptPartFromCode(code)),"currentOnly"!==this.options.load&&addCode(this.getLanguagePartFromCode(code))):"string"==typeof code&&addCode(this.formatLanguageCode(code)),fallbackCodes.forEach(function(fc){codes.indexOf(fc)<0&&addCode(_this2.formatLanguageCode(fc))}),codes}}]),LanguageUtil}(),sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function _(n){return Number(n>1)},2:function _(n){return Number(1!=n)},3:function _(n){return 0},4:function _(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},5:function _(n){return Number(0==n?0:1==n?1:2==n?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5)},6:function _(n){return Number(1==n?0:n>=2&&n<=4?1:2)},7:function _(n){return Number(1==n?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},8:function _(n){return Number(1==n?0:2==n?1:8!=n&&11!=n?2:3)},9:function _(n){return Number(n>=2)},10:function _(n){return Number(1==n?0:2==n?1:n<7?2:n<11?3:4)},11:function _(n){return Number(1==n||11==n?0:2==n||12==n?1:n>2&&n<20?2:3)},12:function _(n){return Number(n%10!=1||n%100==11)},13:function _(n){return Number(0!==n)},14:function _(n){return Number(1==n?0:2==n?1:3==n?2:3)},15:function _(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2)},16:function _(n){return Number(n%10==1&&n%100!=11?0:0!==n?1:2)},17:function _(n){return Number(1==n||n%10==1&&n%100!=11?0:1)},18:function _(n){return Number(0==n?0:1==n?1:2)},19:function _(n){return Number(1==n?0:0==n||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3)},20:function _(n){return Number(1==n?0:0==n||n%100>0&&n%100<20?1:2)},21:function _(n){return Number(n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0)},22:function _(n){return Number(1==n?0:2==n?1:(n<0||n>10)&&n%10==0?2:3)}};function createRules(){var rules={};
1return sets.forEach(function(set){set.lngs.forEach(function(l){rules[l]={numbers:set.nr,plurals:_rulesPluralsTypes[set.fc]}})}),rules}var PluralResolver=function(){function PluralResolver(languageUtils){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,PluralResolver),this.languageUtils=languageUtils,this.options=options,this.logger=baseLogger.create("pluralResolver"),this.rules=createRules()}return _createClass(PluralResolver,[{key:"addRule",value:function addRule(lng,obj){this.rules[lng]=obj}},{key:"getRule",value:function getRule(code){return this.rules[code]||this.rules[this.languageUtils.getLanguagePartFromCode(code)]}},{key:"needsPlural",value:function needsPlural(code){var rule=this.getRule(code);return rule&&rule.numbers.length>1}},{key:"getPluralFormsOfKey",value:function getPluralFormsOfKey(code,key){return this.getSuffixes(code).map(function(suffix){return key+suffix})}},{key:"getSuffixes",value:function getSuffixes(code){var _this=this,rule=this.getRule(code);return rule?rule.numbers.map(function(number){return _this.getSuffix(code,number)}):[]}},{key:"getSuffix",value:function getSuffix(code,count){var _this2=this,rule=this.getRule(code);if(rule){var idx=rule.noAbs?rule.plurals(count):rule.plurals(Math.abs(count)),suffix=rule.numbers[idx];this.options.simplifyPluralSuffix&&2===rule.numbers.length&&1===rule.numbers[0]&&(2===suffix?suffix="plural":1===suffix&&(suffix=""));var returnSuffix=function returnSuffix(){return _this2.options.prepend&&suffix.toString()?_this2.options.prepend+suffix.toString():suffix.toString()};return"v1"===this.options.compatibilityJSON?1===suffix?"":"number"==typeof suffix?"_plural_".concat(suffix.toString()):returnSuffix():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===rule.numbers.length&&1===rule.numbers[0]?returnSuffix():this.options.prepend&&idx.toString()?this.options.prepend+idx.toString():idx.toString()}return this.logger.warn("no plural rule found for: ".concat(code)),""}}]),PluralResolver}(),Interpolator=function(){function Interpolator(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,Interpolator),this.logger=baseLogger.create("interpolator"),this.options=options,this.format=options.interpolation&&options.interpolation.format||function(value){return value},this.init(options)}return _createClass(Interpolator,[{key:"init",value:function init(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};options.interpolation||(options.interpolation={escapeValue:!0});var iOpts=options.interpolation;this.escape=void 0!==iOpts.escape?iOpts.escape:escape,this.escapeValue=void 0===iOpts.escapeValue||iOpts.escapeValue,this.useRawValueToEscape=void 0!==iOpts.useRawValueToEscape&&iOpts.useRawValueToEscape,this.prefix=iOpts.prefix?regexEscape(iOpts.prefix):iOpts.prefixEscaped||"{{",this.suffix=iOpts.suffix?regexEscape(iOpts.suffix):iOpts.suffixEscaped||"}}",this.formatSeparator=iOpts.formatSeparator?iOpts.formatSeparator:iOpts.formatSeparator||",",this.unescapePrefix=iOpts.unescapeSuffix?"":iOpts.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":iOpts.unescapeSuffix||"",this.nestingPrefix=iOpts.nestingPrefix?regexEscape(iOpts.nestingPrefix):iOpts.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=iOpts.nestingSuffix?regexEscape(iOpts.nestingSuffix):iOpts.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=iOpts.nestingOptionsSeparator?iOpts.nestingOptionsSeparator:iOpts.nestingOptionsSeparator||",",this.maxReplaces=iOpts.maxReplaces?iOpts.maxReplaces:1e3,this.alwaysFormat=void 0!==iOpts.alwaysFormat&&iOpts.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function reset(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function resetRegExp(){var regexpStr="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(regexpStr,"g");var regexpUnescapeStr="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(regexpUnescapeStr,"g");var nestingRegexpStr="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix
1);this.nestingRegexp=new RegExp(nestingRegexpStr,"g")}},{key:"interpolate",value:function interpolate(str,data,lng,options){var _this=this,match,value,replaces,defaultData=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function regexSafe(val){return val.replace(/\$/g,"$$$$")}var handleFormat=function handleFormat(key){if(key.indexOf(_this.formatSeparator)<0){var path=getPathWithDefaults(data,defaultData,key);return _this.alwaysFormat?_this.format(path,void 0,lng,_objectSpread({},options,data,{interpolationkey:key})):path}var p=key.split(_this.formatSeparator),k=p.shift().trim(),f=p.join(_this.formatSeparator).trim();return _this.format(getPathWithDefaults(data,defaultData,k),f,lng,_objectSpread({},options,data,{interpolationkey:k}))};this.resetRegExp();var missingInterpolationHandler=options&&options.missingInterpolationHandler||this.options.missingInterpolationHandler,skipOnVariables=options&&options.interpolation&&options.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,todos=[{regex:this.regexpUnescape,safeValue:function safeValue(val){return regexSafe(val)}},{regex:this.regexp,safeValue:function safeValue(val){return _this.escapeValue?regexSafe(_this.escape(val)):regexSafe(val)}}];return todos.forEach(function(todo){for(replaces=0;match=todo.regex.exec(str);){if(value=handleFormat(match[1].trim()),void 0===value)if("function"==typeof missingInterpolationHandler){var temp=missingInterpolationHandler(str,match,options);value="string"==typeof temp?temp:""}else{if(skipOnVariables){value=match[0];continue}_this.logger.warn("missed to pass in variable ".concat(match[1]," for interpolating ").concat(str)),value=""}else"string"==typeof value||_this.useRawValueToEscape||(value=makeString(value));var safeValue=todo.safeValue(value);if(str=str.replace(match[0],safeValue),skipOnVariables?(todo.regex.lastIndex+=safeValue.length,todo.regex.lastIndex-=match[0].length):todo.regex.lastIndex=0,replaces++,replaces>=_this.maxReplaces)break}}),str}},{key:"nest",value:function nest(str,fc){var _this2=this,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},match,value,clonedOptions=_objectSpread({},options);function handleHasOptions(key,inheritedOptions){var sep=this.nestingOptionsSeparator;if(key.indexOf(sep)<0)return key;var c=key.split(new RegExp("".concat(sep,"[ ]*{"))),optionsString="{".concat(c[1]);key=c[0],optionsString=this.interpolate(optionsString,clonedOptions),optionsString=optionsString.replace(/'/g,'"');try{clonedOptions=JSON.parse(optionsString),inheritedOptions&&(clonedOptions=_objectSpread({},inheritedOptions,clonedOptions))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(key),e),"".concat(key).concat(sep).concat(optionsString)}return delete clonedOptions.defaultValue,key}for(clonedOptions.applyPostProcessor=!1,delete clonedOptions.defaultValue;match=this.nestingRegexp.exec(str);){var formatters=[],doReduce=!1;if(-1!==match[0].indexOf(this.formatSeparator)&&!/{.*}/.test(match[1])){var r=match[1].split(this.formatSeparator).map(function(elem){return elem.trim()});match[1]=r.shift(),formatters=r,doReduce=!0}if(value=fc(handleHasOptions.call(this,match[1].trim(),clonedOptions),clonedOptions),value&&match[0]===str&&"string"!=typeof value)return value;"string"!=typeof value&&(value=makeString(value)),value||(this.logger.warn("missed to resolve ".concat(match[1]," for nesting ").concat(str)),value=""),doReduce&&(value=formatters.reduce(function(v,f){return _this2.format(v,f,options.lng,_objectSpread({},options,{interpolationkey:match[1].trim()}))},value.trim())),str=str.replace(match[0],value),this.regexp.lastIndex=0}return str}}]),Interpolator}();function remove(arr,what){for(var found=arr.indexOf(what);-1!==found;)arr.splice(found,1),found=arr.indexOf(what)}var Connector=function(_EventEmitter){function Connector(backend,store,services){var _this,options=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return _classCallCheck(this,Connector),_this=_possibleConstructorReturn(this,_getPrototypeOf(Connector).call(this)),isIE10&&EventEmitter.call(_assertThisInitialized(_this)),_this.backend=backend,_this.store=store,_this.services=services,_this.languageUtils=services.languageUtils,_this.options=options,_this.logger=baseLogger.create("backendConnector"),_this.state={},_this.queue=[],_this.backend&&_this.backend.init&&_this.backend.init(services,options.backend,options),_this}return _inherits(Connector,_EventEmitter),_createClass(Connector,[{key:"queueLoad",value:function queueLoad(languages,namespaces,options,callback){var _this2=this,toLoad=[],pending=[],toLoadLanguages=[],toLoadNamespaces=[];
1return languages.forEach(function(lng){var hasAllNamespaces=!0;namespaces.forEach(function(ns){var name="".concat(lng,"|").concat(ns);!options.reload&&_this2.store.hasResourceBundle(lng,ns)?_this2.state[name]=2:_this2.state[name]<0||(1===_this2.state[name]?pending.indexOf(name)<0&&pending.push(name):(_this2.state[name]=1,hasAllNamespaces=!1,pending.indexOf(name)<0&&pending.push(name),toLoad.indexOf(name)<0&&toLoad.push(name),toLoadNamespaces.indexOf(ns)<0&&toLoadNamespaces.push(ns)))}),hasAllNamespaces||toLoadLanguages.push(lng)}),(toLoad.length||pending.length)&&this.queue.push({pending:pending,loaded:{},errors:[],callback:callback}),{toLoad:toLoad,pending:pending,toLoadLanguages:toLoadLanguages,toLoadNamespaces:toLoadNamespaces}}},{key:"loaded",value:function loaded(name,err,data){var s=name.split("|"),lng=s[0],ns=s[1];err&&this.emit("failedLoading",lng,ns,err),data&&this.store.addResourceBundle(lng,ns,data),this.state[name]=err?-1:2;var loaded={};this.queue.forEach(function(q){pushPath(q.loaded,[lng],ns),remove(q.pending,name),err&&q.errors.push(err),0!==q.pending.length||q.done||(Object.keys(q.loaded).forEach(function(l){loaded[l]||(loaded[l]=[]),q.loaded[l].length&&q.loaded[l].forEach(function(ns){loaded[l].indexOf(ns)<0&&loaded[l].push(ns)})}),q.done=!0,q.errors.length?q.callback(q.errors):q.callback())}),this.emit("loaded",loaded),this.queue=this.queue.filter(function(q){return!q.done})}},{key:"read",value:function read(lng,ns,fcName){var _this3=this,tried=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,wait=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,callback=arguments.length>5?arguments[5]:void 0;return lng.length?this.backend[fcName](lng,ns,function(err,data){err&&data&&tried<5?setTimeout(function(){_this3.read.call(_this3,lng,ns,fcName,tried+1,2*wait,callback)},wait):callback(err,data)}):callback(null,{})}},{key:"prepareLoading",value:function prepareLoading(languages,namespaces){var _this4=this,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},callback=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),callback&&callback();"string"==typeof languages&&(languages=this.languageUtils.toResolveHierarchy(languages)),"string"==typeof namespaces&&(namespaces=[namespaces]);var toLoad=this.queueLoad(languages,namespaces,options,callback);if(!toLoad.toLoad.length)return toLoad.pending.length||callback(),null;toLoad.toLoad.forEach(function(name){_this4.loadOne(name)})}},{key:"load",value:function load(languages,namespaces,callback){this.prepareLoading(languages,namespaces,{},callback)}},{key:"reload",value:function reload(languages,namespaces,callback){this.prepareLoading(languages,namespaces,{reload:!0},callback)}},{key:"loadOne",value:function loadOne(name){var _this5=this,prefix=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=name.split("|"),lng=s[0],ns=s[1];this.read(lng,ns,"read",void 0,void 0,function(err,data){err&&_this5.logger.warn("".concat(prefix,"loading namespace ").concat(ns," for language ").concat(lng," failed"),err),!err&&data&&_this5.logger.log("".concat(prefix,"loaded namespace ").concat(ns," for language ").concat(lng),data),_this5.loaded(name,err,data)})}},{key:"saveMissing",value:function saveMissing(languages,namespace,key,fallbackValue,isUpdate){var options=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(namespace)?this.logger.warn('did not save key "'.concat(key,'" as the namespace "').concat(namespace,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=key&&""!==key&&(this.backend&&this.backend.create&&this.backend.create(languages,namespace,key,fallbackValue,null,_objectSpread({},options,{isUpdate:isUpdate})),languages&&languages[0]&&this.store.addResource(languages[0],namespace,key,fallbackValue))}}]),Connector}(EventEmitter);function get(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function handle(args){var ret={};if("object"===_typeof(args[1])&&(ret=args[1]),"string"==typeof args[1]&&(ret.defaultValue=args[1]),"string"==typeof args[2]&&(ret.tDescription=args[2]),"object"===_typeof(args[2])||"object"===_typeof(args[3])){var options=args[3]||args[2];
1Object.keys(options).forEach(function(key){ret[key]=options[key]})}return ret},interpolation:{escapeValue:!0,format:function format(value,_format,lng,options){return value},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function transformOptions(options){return"string"==typeof options.ns&&(options.ns=[options.ns]),"string"==typeof options.fallbackLng&&(options.fallbackLng=[options.fallbackLng]),"string"==typeof options.fallbackNS&&(options.fallbackNS=[options.fallbackNS]),options.whitelist&&(options.whitelist&&options.whitelist.indexOf("cimode")<0&&(options.whitelist=options.whitelist.concat(["cimode"])),options.supportedLngs=options.whitelist),options.nonExplicitWhitelist&&(options.nonExplicitSupportedLngs=options.nonExplicitWhitelist),options.supportedLngs&&options.supportedLngs.indexOf("cimode")<0&&(options.supportedLngs=options.supportedLngs.concat(["cimode"])),options}function noop(){}var I18n=function(_EventEmitter){function I18n(){var _this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},callback=arguments.length>1?arguments[1]:void 0;if(_classCallCheck(this,I18n),_this=_possibleConstructorReturn(this,_getPrototypeOf(I18n).call(this)),isIE10&&EventEmitter.call(_assertThisInitialized(_this)),_this.options=transformOptions(options),_this.services={},_this.logger=baseLogger,_this.modules={external:[]},callback&&!_this.isInitialized&&!options.isClone){if(!_this.options.initImmediate)return _this.init(options,callback),_possibleConstructorReturn(_this,_assertThisInitialized(_this));setTimeout(function(){_this.init(options,callback)},0)}return _this}return _inherits(I18n,_EventEmitter),_createClass(I18n,[{key:"init",value:function init(){var _this2=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},callback=arguments.length>1?arguments[1]:void 0;function createClassOnDemand(ClassOrObject){return ClassOrObject?"function"==typeof ClassOrObject?new ClassOrObject:ClassOrObject:null}if("function"==typeof options&&(callback=options,options={}),options.whitelist&&!options.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),options.nonExplicitWhitelist&&!options.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=_objectSpread({},get(),this.options,transformOptions(options)),this.format=this.options.interpolation.format,callback||(callback=noop),!this.options.isClone){this.modules.logger?baseLogger.init(createClassOnDemand(this.modules.logger),this.options):baseLogger.init(null,this.options);var lu=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);var s=this.services;s.logger=baseLogger,s.resourceStore=this.store,s.languageUtils=lu,s.pluralResolver=new PluralResolver(lu,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new Interpolator(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Connector(createClassOnDemand(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",function(event){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];_this2.emit.apply(_this2,[event].concat(args))}),this.modules.languageDetector&&(s.languageDetector=createClassOnDemand(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=createClassOnDemand(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(event){for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];_this2.emit.apply(_this2,[event].concat(args))}),this.modules.external.forEach(function(m){m.init&&m.init(_this2)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var codes=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);codes.length>0&&"dev"!==codes[0]&&(this.options.lng=codes[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var storeApi=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];storeApi.forEach(function(fcName){_this2[fcName]=function(){var _this2$store;return(_this2$store=_this2.store)[fcName].apply(_this2$store,arguments)}});var storeApiChained=["addResource","addResources","addResourceBundle","removeResourceBundle"];storeApiChained.forEach(function(fcName){_this2[fcName]=function(){var _this2$store2;return(_this2$store2=_this2.store)[fcName].apply(_this2$store2,arguments),_this2}});var deferred=defer(),load=function load(){var finish=function finish(err,t){_this2.isInitialized&&_this2.logger.warn("init: i18next is already initialized. You should call init just once!"),_this2.isInitialized=!0,_this2.options.isClone||_this2.logger.log("initialized",_this2.options),_this2.emit("initialized",_this2.options),deferred.resolve(t),callback(err,t)};if(_this2.languages&&"v1"!==_this2.options.compatibilityAPI&&!_this2.isInitialized)return finish(null,_this2.t.b
1ind(_this2));_this2.changeLanguage(_this2.options.lng,finish)};return this.options.resources||!this.options.initImmediate?load():setTimeout(load,0),deferred}},{key:"loadResources",value:function loadResources(language){var _this3=this,callback=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,usedCallback=callback,usedLng="string"==typeof language?language:this.language;if("function"==typeof language&&(usedCallback=language),!this.options.resources||this.options.partialBundledLanguages){if(usedLng&&"cimode"===usedLng.toLowerCase())return usedCallback();var toLoad=[],append=function append(lng){if(lng){var lngs=_this3.services.languageUtils.toResolveHierarchy(lng);lngs.forEach(function(l){toLoad.indexOf(l)<0&&toLoad.push(l)})}};if(usedLng)append(usedLng);else{var fallbacks=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);fallbacks.forEach(function(l){return append(l)})}this.options.preload&&this.options.preload.forEach(function(l){return append(l)}),this.services.backendConnector.load(toLoad,this.options.ns,usedCallback)}else usedCallback(null)}},{key:"reloadResources",value:function reloadResources(lngs,ns,callback){var deferred=defer();return lngs||(lngs=this.languages),ns||(ns=this.options.ns),callback||(callback=noop),this.services.backendConnector.reload(lngs,ns,function(err){deferred.resolve(),callback(err)}),deferred}},{key:"use",value:function use(module){if(!module)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!module.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===module.type&&(this.modules.backend=module),("logger"===module.type||module.log&&module.warn&&module.error)&&(this.modules.logger=module),"languageDetector"===module.type&&(this.modules.languageDetector=module),"i18nFormat"===module.type&&(this.modules.i18nFormat=module),"postProcessor"===module.type&&postProcessor.addPostProcessor(module),"3rdParty"===module.type&&this.modules.external.push(module),this}},{key:"changeLanguage",value:function changeLanguage(lng,callback){var _this4=this;this.isLanguageChangingTo=lng;var deferred=defer();this.emit("languageChanging",lng);var done=function done(err,l){l?(_this4.language=l,_this4.languages=_this4.services.languageUtils.toResolveHierarchy(l),_this4.translator.changeLanguage(l),_this4.isLanguageChangingTo=void 0,_this4.emit("languageChanged",l),_this4.logger.log("languageChanged",l)):_this4.isLanguageChangingTo=void 0,deferred.resolve(function(){return _this4.t.apply(_this4,arguments)}),callback&&callback(err,function(){return _this4.t.apply(_this4,arguments)})},setLng=function setLng(lngs){lng||lngs||!_this4.services.languageDetector||(lngs=[]);var l="string"==typeof lngs?lngs:_this4.services.languageUtils.getBestMatchFromCodes(lngs);l&&(_this4.language||(_this4.language=l,_this4.languages=_this4.services.languageUtils.toResolveHierarchy(l)),_this4.translator.language||_this4.translator.changeLanguage(l),_this4.services.languageDetector&&_this4.services.languageDetector.cacheUserLanguage(l)),_this4.loadResources(l,function(err){done(err,l)})};return lng||!this.services.languageDetector||this.services.languageDetector.async?!lng&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(setLng):setLng(lng):setLng(this.services.languageDetector.detect()),deferred}},{key:"getFixedT",value:function getFixedT(lng,ns){var _this5=this,fixedT=function fixedT(key,opts){var options;if("object"!==_typeof(opts)){for(var _len3=arguments.length,rest=new Array(_len3>2?_len3-2:0),_key3=2;_key3<_len3;_key3++)rest[_key3-2]=arguments[_key3];options=_this5.options.overloadTranslationOptionHandler([key,opts].concat(rest))}else options=_objectSpread({},opts);return options.lng=options.lng||fixedT.lng,options.lngs=options.lngs||fixedT.lngs,options.ns=options.ns||fixedT.ns,_this5.t(key,options)};return"string"==typeof lng?fixedT.lng=lng:fixedT.lngs=lng,fixedT.ns=ns,fixedT}},{key:"t",value:function t(){var _this$translator;return this.translator&&(_this$translator=this.translator).translate.apply(_this$translator,arguments)}},{key:"exists",value:function exists(){var _this$translator2;return this.translator&&(_this$translator2=this.translator).exists.apply(_this$translator2,arguments)}},{key:"setDefaultNamespace",value:function setDefaultNamespace(ns){this.options.defaultNS=ns}},{key:"hasLoadedNamespace",value:function hasLoadedNamespace(ns){var _this6=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
1if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var lng=this.languages[0],fallbackLng=!!this.options&&this.options.fallbackLng,lastLng=this.languages[this.languages.length-1];if("cimode"===lng.toLowerCase())return!0;var loadNotPending=function loadNotPending(l,n){var loadState=_this6.services.backendConnector.state["".concat(l,"|").concat(n)];return-1===loadState||2===loadState};if(options.precheck){var preResult=options.precheck(this,loadNotPending);if(void 0!==preResult)return preResult}return!!this.hasResourceBundle(lng,ns)||(!this.services.backendConnector.backend||!(!loadNotPending(lng,ns)||fallbackLng&&!loadNotPending(lastLng,ns)))}},{key:"loadNamespaces",value:function loadNamespaces(ns,callback){var _this7=this,deferred=defer();return this.options.ns?("string"==typeof ns&&(ns=[ns]),ns.forEach(function(n){_this7.options.ns.indexOf(n)<0&&_this7.options.ns.push(n)}),this.loadResources(function(err){deferred.resolve(),callback&&callback(err)}),deferred):(callback&&callback(),Promise.resolve())}},{key:"loadLanguages",value:function loadLanguages(lngs,callback){var deferred=defer();"string"==typeof lngs&&(lngs=[lngs]);var preloaded=this.options.preload||[],newLngs=lngs.filter(function(lng){return preloaded.indexOf(lng)<0});return newLngs.length?(this.options.preload=preloaded.concat(newLngs),this.loadResources(function(err){deferred.resolve(),callback&&callback(err)}),deferred):(callback&&callback(),Promise.resolve())}},{key:"dir",value:function dir(lng){if(lng||(lng=this.languages&&this.languages.length>0?this.languages[0]:this.language),!lng)return"rtl";var rtlLngs=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"];return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng))>=0?"rtl":"ltr"}},{key:"createInstance",value:function createInstance(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},callback=arguments.length>1?arguments[1]:void 0;return new I18n(options,callback)}},{key:"cloneInstance",value:function cloneInstance(){var _this8=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},callback=arguments.length>1&&void 0!==arguments[1]?arguments[1]:noop,mergedOptions=_objectSpread({},this.options,options,{isClone:!0}),clone=new I18n(mergedOptions),membersToCopy=["store","services","language"];return membersToCopy.forEach(function(m){clone[m]=_this8[m]}),clone.services=_objectSpread({},this.services),clone.services.utils={hasLoadedNamespace:clone.hasLoadedNamespace.bind(clone)},clone.translator=new Translator(clone.services,clone.options),clone.translator.on("*",function(event){for(var _len4=arguments.length,args=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++)args[_key4-1]=arguments[_key4];clone.emit.apply(clone,[event].concat(args))}),clone.init(mergedOptions,callback),clone.translator.options=clone.options,clone.translator.backendConnector.services.utils={hasLoadedNamespace:clone.hasLoadedNamespace.bind(clone)},clone}},{key:"toJSON",value:function toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages}}}]),I18n}(EventEmitter),i18next=new I18n;return i18next}), 2/*! 3* jQuery Password Strength plugin for Twitter Bootstrap 4* Version: 3.1.0 5* 6* Copyright (c) 2008-2013 Tane Piper 7* Copyright (c) 2013 Alejandro Blanco 8* Dual licensed under the MIT and GPL licenses. 9*/ 10function(jQuery){var i18n={};!function(i18next){"use strict";i18n.fallback={wordMinLength:"Your password is too short",wordMaxLength:"Your password is too long",wordInvalidChar:"Your password contains an invalid character",wordNotEmail:"Do not use your email as your password",wordSimilarToUsername:"Your password cannot contain your username",wordTwoCharacterClasses:"Use different character classes",wordRepetitions:"Too many repetitions",wordSequences:"Your password contains sequences",errorList:"Errors:",veryWeak:"Very Weak",weak:"Weak",normal:"Normal",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},i18n.t=function(key){var result="";
10return result=i18next?i18next.t(key):i18n.fallback[key],result===key?"":result}}(window.i18next);var rulesEngine={};try{if(!jQuery&&module&&module.exports){var jQuery=require("jquery"),jsdom=require("jsdom").jsdom;jQuery=jQuery(jsdom().defaultView)}}catch(ignore){}!function($){"use strict";var validation={};rulesEngine.forbiddenSequences=["0123456789","abcdefghijklmnopqrstuvwxyz","qwertyuiop","asdfghjkl","zxcvbnm","!@#$%^&*()_+"],validation.wordNotEmail=function(options,word,score){return word.match(/^([\w!#$%&'*+\-/=?^`{|}~]+\.)*[\w!#$%&'*+\-/=?^`{|}~]+@((((([a-z0-9]{1}[a-z0-9-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(:\d{1,5})?)$/i)?score:0},validation.wordMinLength=function(options,word,score){var wordlen=word.length,lenScore=Math.pow(wordlen,options.rules.raisePower);return wordlen<options.common.minChar&&(lenScore+=score),lenScore},validation.wordMaxLength=function(options,word,score){var wordlen=word.length,lenScore=Math.pow(wordlen,options.rules.raisePower);return wordlen>options.common.maxChar?score:lenScore},validation.wordInvalidChar=function(options,word,score){return options.common.invalidCharsRegExp.test(word)?score:0},validation.wordMinLengthStaticScore=function(options,word,score){return word.length<options.common.minChar?0:score},validation.wordMaxLengthStaticScore=function(options,word,score){return word.length>options.common.maxChar?0:score},validation.wordSimilarToUsername=function(options,word,score){var username=$(options.common.usernameField).val();return username&&word.toLowerCase().match(username.replace(/[-[\]/{}()*+=?:.\\^$|!,]/g,"\\$&").toLowerCase())?score:0},validation.wordTwoCharacterClasses=function(options,word,score){var specialCharRE=new RegExp("(."+options.rules.specialCharClass+")");return word.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)||word.match(/([a-zA-Z])/)&&word.match(/([0-9])/)||word.match(specialCharRE)&&word.match(/[a-zA-Z0-9_]/)?score:0},validation.wordRepetitions=function(options,word,score){return word.match(/(.)\1\1/)?score:0},validation.wordSequences=function(options,word,score){var found=!1,j;return word.length>2&&($.each(rulesEngine.forbiddenSequences,function(idx,seq){var sequences;found||(sequences=[seq,seq.split("").reverse().join("")],$.each(sequences,function(ignore,sequence){for(j=0;j<word.length-2;j+=1)sequence.indexOf(word.toLowerCase().substring(j,j+3))>-1&&(found=!0)}))}),found)?score:0},validation.wordLowercase=function(options,word,score){return word.match(/[a-z]/)&&score},validation.wordUppercase=function(options,word,score){return word.match(/[A-Z]/)&&score},validation.wordOneNumber=function(options,word,score){return word.match(/\d+/)&&score},validation.wordThreeNumbers=function(options,word,score){return word.match(/(.*[0-9].*[0-9].*[0-9])/)&&score},validation.wordOneSpecialChar=function(options,word,score){var specialCharRE=new RegExp(options.rules.specialCharClass);return word.match(specialCharRE)&&score},validation.wordTwoSpecialChar=function(options,word,score){var twoSpecialCharRE=new RegExp("(.*"+options.rules.specialCharClass+".*"+options.rules.specialCharClass+")");return word.match(twoSpecialCharRE)&&score},validation.wordUpperLowerCombo=function(options,word,score){return word.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&score},validation.wordLetterNumberCombo=function(options,word,score){return word.match(/([a-zA-Z])/)&&word.match(/([0-9])/)&&score},validation.wordLetterNumberCharCombo=function(options,word,score){var letterNumberCharComboRE=new RegExp("([a-zA-Z0-9].*"+options.rules.specialCharClass+")|("+options.rules.specialCharClass+".*[a-zA-Z0-9])");return word.match(letterNumberCharComboRE)&&score},validation.wordIsACommonPassword=function(options,word,score){return $.inArray(word,options.rules.commonPasswords)>=0?score:0},rulesEngine.validation=validation,rulesEngine.executeRules=function(options,word){var totalScore=0;return $.each(options.rules.activated,function(rule,active){var score,funct,result,errorMessage;active&&(score=options.rules.scores[rule],funct=rulesEngine.validation[rule],"function"!=typeof funct&&(funct=options.rules.extra[rule]),"function"==typeof funct&&(result=funct(options,word,score),result&&(totalScore+=result),
10(result<0||!$.isNumeric(result)&&!result)&&(errorMessage=options.ui.spanError(options,rule),errorMessage.length>0&&options.instances.errors.push(errorMessage))))}),totalScore}}(jQuery);try{module&&module.exports&&(module.exports=rulesEngine)}catch(ignore){}var defaultOptions={common:{}};defaultOptions.common.minChar=6,defaultOptions.common.maxChar=20,defaultOptions.common.usernameField="#username",defaultOptions.common.invalidCharsRegExp=new RegExp(/[\s,'"]/),defaultOptions.common.userInputs=[],defaultOptions.common.onLoad=void 0,defaultOptions.common.onKeyUp=void 0,defaultOptions.common.onScore=void 0,defaultOptions.common.zxcvbn=!1,defaultOptions.common.zxcvbnTerms=[],defaultOptions.common.events=["keyup","change","paste"],defaultOptions.common.debug=!1,defaultOptions.rules={},defaultOptions.rules.extra={},defaultOptions.rules.scores={wordNotEmail:-100,wordMinLength:-50,wordMaxLength:-50,wordInvalidChar:-100,wordSimilarToUsername:-100,wordSequences:-20,wordTwoCharacterClasses:2,wordRepetitions:-25,wordLowercase:1,wordUppercase:3,wordOneNumber:3,wordThreeNumbers:5,wordOneSpecialChar:3,wordTwoSpecialChar:5,wordUpperLowerCombo:2,wordLetterNumberCombo:2,wordLetterNumberCharCombo:2,wordIsACommonPassword:-100},defaultOptions.rules.activated={wordNotEmail:!0,wordMinLength:!0,wordMaxLength:!1,wordInvalidChar:!1,wordSimilarToUsername:!0,wordSequences:!0,wordTwoCharacterClasses:!0,wordRepetitions:!0,wordLowercase:!0,wordUppercase:!0,wordOneNumber:!0,wordThreeNumbers:!0,wordOneSpecialChar:!0,wordTwoSpecialChar:!0,wordUpperLowerCombo:!0,wordLetterNumberCombo:!0,wordLetterNumberCharCombo:!0,wordIsACommonPassword:!0},defaultOptions.rules.raisePower=1.4,defaultOptions.rules.specialCharClass="[!,@,#,$,%,^,&,*,?,_,~]",defaultOptions.rules.commonPasswords=["123456","password","12345678","qwerty","123456789","12345","1234","111111","1234567","dragon","123123","baseball","abc123","football","monkey","letmein","696969","shadow","master","666666","qwertyuiop","123321","mustang","1234567890","michael","654321","pussy","superman","1qaz2wsx","7777777","fuckyou","121212","000000","qazwsx","123qwe","killer","trustno1","jordan","jennifer","zxcvbnm","asdfgh","hunter","buster","soccer","harley","batman","andrew","tigger","sunshine","iloveyou","fuckme","2000","charlie","robert","thomas","hockey","ranger","daniel","starwars","klaster","112233","george","asshole","computer","michelle","jessica","pepper","1111","zxcvbn","555555","11111111","131313","freedom","777777","pass","fuck","maggie","159753","aaaaaa","ginger","princess","joshua","cheese","amanda","summer","love","ashley","6969","nicole","chelsea","biteme","matthew","access","yankees","987654321","dallas","austin","thunder","taylor","matrix"],defaultOptions.ui={},defaultOptions.ui.bootstrap2=!1,defaultOptions.ui.bootstrap3=!1,defaultOptions.ui.colorClasses=["danger","danger","danger","warning","warning","success"],defaultOptions.ui.showProgressBar=!0,defaultOptions.ui.progressBarEmptyPercentage=1,defaultOptions.ui.progressBarMinWidth=1,defaultOptions.ui.progressBarMinPercentage=1,defaultOptions.ui.progressExtraCssClasses="",defaultOptions.ui.progressBarExtraCssClasses="",defaultOptions.ui.showPopover=!1,defaultOptions.ui.popoverPlacement="bottom",defaultOptions.ui.showStatus=!1,defaultOptions.ui.spanError=function(options,key){"use strict";var text=options.i18n.t(key);return text?'<span style="color: #d52929">'+text+"</span>":""},defaultOptions.ui.popoverError=function(options){"use strict";var errors=options.instances.errors,errorsTitle=options.i18n.t("errorList"),message="<div>"+errorsTitle+'<ul class="error-list" style="margin-bottom: 0;">';return jQuery.each(errors,function(idx,err){message+="<li>"+err+"</li>"}),message+="</ul></div>",message},defaultOptions.ui.showVerdicts=!0,defaultOptions.ui.showVerdictsInsideProgressBar=!1,defaultOptions.ui.useVerdictCssClass=!1,defaultOptions.ui.showErrors=!1,defaultOptions.ui.showScore=!1,defaultOptions.ui.container=void 0,defaultOptions.ui.viewports={progress:void 0,verdict:void 0,errors:void 0,score:void 0},defaultOptions.ui.scores=[0,14,26,38,50],defaultOptions.i18n={},defaultOptions.i18n.t=i18n.t;var ui={};!function($){"use strict";var statusClasses=["error","warning","success"],verdictKeys=["veryWeak","weak","normal","medium","strong","veryStrong"];ui.getContainer=function(options,$el){var $container;return $container=$(options.ui.container),$container&&1===$container.length||($
10container=$el.parent()),$container},ui.findElement=function($container,viewport,cssSelector){return viewport?$container.find(viewport).find(cssSelector):$container.find(cssSelector)},ui.getUIElements=function(options,$el){var $container,result;return options.instances.viewports?options.instances.viewports:($container=ui.getContainer(options,$el),result={},result.$progressbar=ui.findElement($container,options.ui.viewports.progress,"div.progress"),options.ui.showVerdictsInsideProgressBar&&(result.$verdict=result.$progressbar.find("span.password-verdict")),options.ui.showPopover||(options.ui.showVerdictsInsideProgressBar||(result.$verdict=ui.findElement($container,options.ui.viewports.verdict,"span.password-verdict")),result.$errors=ui.findElement($container,options.ui.viewports.errors,"ul.error-list")),result.$score=ui.findElement($container,options.ui.viewports.score,"span.password-score"),options.instances.viewports=result,result)},ui.initHelper=function(options,$el,html,viewport){var $container=ui.getContainer(options,$el);viewport?$container.find(viewport).append(html):$(html).insertAfter($el)},ui.initVerdict=function(options,$el){ui.initHelper(options,$el,'<span class="password-verdict"></span>',options.ui.viewports.verdict)},ui.initErrorList=function(options,$el){ui.initHelper(options,$el,'<ul class="error-list"></ul>',options.ui.viewports.errors)},ui.initScore=function(options,$el){ui.initHelper(options,$el,'<span class="password-score"></span>',options.ui.viewports.score)},ui.initUI=function(options,$el){options.ui.showPopover?ui.initPopover(options,$el):(options.ui.showErrors&&ui.initErrorList(options,$el),options.ui.showVerdicts&&!options.ui.showVerdictsInsideProgressBar&&ui.initVerdict(options,$el)),options.ui.showProgressBar&&ui.initProgressBar(options,$el),options.ui.showScore&&ui.initScore(options,$el)},ui.updateVerdict=function(options,$el,cssClass,text){var $verdict=ui.getUIElements(options,$el).$verdict;$verdict.removeClass(options.ui.colorClasses.join(" ")),cssClass>-1&&$verdict.addClass(options.ui.colorClasses[cssClass]),options.ui.showVerdictsInsideProgressBar&&$verdict.css("white-space","nowrap"),$verdict.html(text)},ui.updateErrors=function(options,$el,remove){var $errors=ui.getUIElements(options,$el).$errors,html="";remove||$.each(options.instances.errors,function(idx,err){html+="<li>"+err+"</li>"}),$errors.html(html)},ui.updateScore=function(options,$el,score,remove){var $score=ui.getUIElements(options,$el).$score,html="";remove||(html=score.toFixed(2)),$score.html(html)},ui.updateFieldStatus=function(options,$el,cssClass,remove){var $target=$el;options.ui.bootstrap2?$target=$el.parents(".control-group").first():options.ui.bootstrap3&&($target=$el.parents(".form-group").first()),$.each(statusClasses,function(idx,css){css=ui.cssClassesForBS(options,css),$target.removeClass(css)}),remove||(cssClass=statusClasses[Math.floor(cssClass/2)],cssClass=ui.cssClassesForBS(options,cssClass),$target.addClass(cssClass))}
10,ui.cssClassesForBS=function(options,css){return options.ui.bootstrap3?css="has-"+css:options.ui.bootstrap2||("error"===css&&(css="danger"),css="border-"+css),css},ui.getVerdictAndCssClass=function(options,score){var level,verdict;return void 0===score?["",0]:(level=score<=options.ui.scores[0]?0:score<options.ui.scores[1]?1:score<options.ui.scores[2]?2:score<options.ui.scores[3]?3:score<options.ui.scores[4]?4:5,verdict=verdictKeys[level],[options.i18n.t(verdict),level])},ui.updateUI=function(options,$el,score){var cssClass,verdictText,verdictCssClass;cssClass=ui.getVerdictAndCssClass(options,score),verdictText=0===score?"":cssClass[0],cssClass=cssClass[1],verdictCssClass=options.ui.useVerdictCssClass?cssClass:-1,options.ui.showProgressBar&&ui.showProgressBar(options,$el,score,cssClass,verdictCssClass,verdictText),options.ui.showStatus&&ui.updateFieldStatus(options,$el,cssClass,void 0===score),options.ui.showPopover?ui.updatePopover(options,$el,verdictText,void 0===score):(options.ui.showVerdicts&&!options.ui.showVerdictsInsideProgressBar&&ui.updateVerdict(options,$el,verdictCssClass,verdictText),options.ui.showErrors&&ui.updateErrors(options,$el,void 0===score)),options.ui.showScore&&ui.updateScore(options,$el,score,void 0===score)}}(jQuery),function($){"use strict";ui.percentage=function(options,score,maximun){var result=Math.floor(100*score/maximun),min=options.ui.progressBarMinPercentage;return result=result<=min?min:result,result=result>100?100:result,result},ui.initProgressBar=function(options,$el){var $container=ui.getContainer(options,$el),progressbar='<div class="progress ';options.ui.bootstrap2?progressbar+=options.ui.progressBarExtraCssClasses+'"><div class="':progressbar+=options.ui.progressExtraCssClasses+'"><div class="'+options.ui.progressBarExtraCssClasses+" progress-",progressbar+='bar">',options.ui.showVerdictsInsideProgressBar&&(progressbar+='<span class="password-verdict"></span>'),progressbar+="</div></div>",options.ui.viewports.progress?$container.find(options.ui.viewports.progress).append(progressbar):$(progressbar).insertAfter($el)},ui.showProgressBar=function(options,$el,score,cssClass,verdictCssClass,verdictText){var barPercentage;barPercentage=void 0===score?options.ui.progressBarEmptyPercentage:ui.percentage(options,score,options.ui.scores[4]),ui.updateProgressBar(options,$el,cssClass,barPercentage),options.ui.showVerdictsInsideProgressBar&&ui.updateVerdict(options,$el,verdictCssClass,verdictText)},ui.updateProgressBar=function(options,$el,cssClass,percentage){var $progressbar=ui.getUIElements(options,$el).$progressbar,$bar=$progressbar.find(".progress-bar"),cssPrefix="progress-";options.ui.bootstrap2&&($bar=$progressbar.find(".bar"),cssPrefix=""),$.each(options.ui.colorClasses,function(idx,value){options.ui.bootstrap2||options.ui.bootstrap3?$bar.removeClass(cssPrefix+"bar-"+value):$bar.removeClass("bg-"+value)}),options.ui.bootstrap2||options.ui.bootstrap3?$bar.addClass(cssPrefix+"bar-"+options.ui.colorClasses[cssClass]):$bar.addClass("bg-"+options.ui.colorClasses[cssClass]),percentage>0?$bar.css("min-width",options.ui.progressBarMinWidth+"px"):$bar.css("min-width",""),$bar.css("width",percentage+"%")}}(jQuery),function(){"use strict";ui.initPopover=function(options,$el){try{$el.popover("destroy")}catch(error){$el.popover("dispose")}$el.popover({html:!0,placement:options.ui.popoverPlacement,trigger:"manual",content:" "})},ui.updatePopover=function(options,$el,verdictText,remove){var popover=$el.data("bs.popover"),html="",hide=!0,bootstrap5=!1,itsVisible=!1;options.ui.showVerdicts&&!options.ui.showVerdictsInsideProgressBar&&verdictText.length>0&&(html='<h5><span class="password-verdict">'+verdictText+"</span></h5>",hide=!1),options.ui.showErrors&&(options.instances.errors.length>0&&(hide=!1),html+=options.ui.popoverError(options)),hide||remove?$el.popover("hide"):(options.ui.bootstrap2?popover=$el.data("popover"):popover||(popover=bootstrap.Popover.getInstance($el[0]),bootstrap5=!0),itsVisible=bootstrap5?$(popover.tip).is(":visible"):popover.$arrow&&popover.$arrow.parents("body").length>0,itsVisible?bootstrap5?$(popover.tip).find(".popover-body").html(html):$el.find("+ .popover .popover-content").html(html):(options.ui.bootstrap2||options.ui.bootstrap3?popover.options.content=html:bootstrap5?popover._config.content=html:popover.config.content=html,$el.popover("show")))}}();var methods={};!function($){"use strict";var onKeyUp,onPaste,applyToAll;onKeyUp=function(event){var $el=$(event.target),options=$el.data("pwstrength-bootstrap"),word=$el.val(),userInputs,verdictText,verdictLevel,score;void 0!==options&&(options.instances.errors=[],0===word.length?score=void 0:(options.common.zxcvbn?(userInputs=[],$.each(options.common.userInputs.concat([options.common.usernameField]),function(idx,selector){var value=$(selector).val();value&&userInputs.push(value)}),userInputs=userInputs.concat(options.common.zxcvbnTerms),score=zxcvbn(word,userInputs).guesses,score=Math.log(score)*Math.LOG2E):score=rulesEngine.executeRules(options,word),"function"==typeof options.common.onScore&&(score=options.common.onScore(options,word,score))),ui.updateUI(options,$el,score),verdictText=ui.getVerdictAndCssClass(options,score),verdictLevel=verdictText[1],verdictText=verdictText[0],options.common.debug&&console.log(score+" - "+verdictText),"function"==typeof options.common.onKeyUp&&options.common.onKeyUp(event,{score:score,verdictText:verdictText,verdictLevel:verdictLevel}))},onPaste=function(event){var $el=$(event.target),word=$el.val(),tries=0,callback;callback=function(){var newWord=$el.val();newWord!==word?onKeyUp(event):tries<3&&(tries+=1,setTimeout(callback,100))},setTimeout(callback,100)},methods.init=function(settings){return this.each(function(idx,el){var clonedDefaults=$.extend(!0,{},defaultOptions),localOptions=$.extend(!0,clonedDefaults,settings),$el=$(el);localOptions.instances={},$el.data("pwstrength-bootstrap",localOptions),$.each(localOptions.common.events,function(ignore,eventName){var handler="paste"===eventName?onPaste:onKeyUp;$el.on(eventName,handler)}),ui.initUI(localOptions,$el),$el.trigger("keyup"),"function"==typeof localOptions.common.onLoad&&localOptions.common.onLoad()}),this},methods.destroy=function(){return this.each(function(idx,el){var $el=$(el),options=$el.data("pwstrength-bootstrap"),elements=ui.getUIElements(options,$el);elements.$progressbar.remove(),elements.$verdict.remove(),elements.$errors.remove(),$el.removeData("pwstrength-bootstrap")}),this},methods.forceUpdate=function(){return this.each(function(idx,el){var event={target:el};onKeyUp(event)}),this},methods.addRule=function(name,method,score,active){return this.each(function(idx,el){var options=$(el).data("pwstrength-bootstrap");options.rules.activated[name]=active,options.rules.scores[name]=score,options.rules.extra[name]=method}),this},applyToAll=function(rule,prop,value){this.each(function(idx,el){$(el).data("pwstrength-bootstrap").rules[prop][rule]=value})},methods.changeScore=function(rule,score){return applyToAll.call(this,rule,"scores",score),this},methods.ruleActive=function(rule,active){return applyToAll.call(this,rule,"activated",active),this},methods.ruleIsMet=function(rule){var rulesMetCnt=0;return"wordMinLength"===rule?rule="wordMinLengthStaticScore":"wordMaxLength"===rule&&(rule="wordMaxLengthStaticScore"),this.each(function(idx,el){var options=$(el).data("pwstrength-bootstrap"),ruleFunction=rulesEngine.validation[rule],result;"function"!=typeof ruleFunction&&(ruleFunction=options.rules.extra[rule]),"function"==typeof ruleFunction&&(result=ruleFunction(options,$(el).val(),1),$.isNumeric(result)&&(rulesMetCnt+=result))}),rulesMetCnt===this.length},$.fn.pwstrength=function(method){var result;return methods[method]?result=methods[method].apply(this,Array.prototype.slice.call(arguments,1
vendor: 5,159 bytes, lines 10-16
10)):"object"!=typeof method&&method?$.error("Method "+method+" does not exist on jQuery.pwstrength-bootstrap"):result=methods.init.apply(this,arguments),result}}(jQuery)}(jQuery), 11/*! 12 * typeahead.js 0.11.1 13 * https://github.com/twitter/typeahead.js 14 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT 15 */ 16function(root,factory){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(a0){return root["Bloodhound"]=factory(a0)}):"object"==typeof exports?module.exports=factory(require("jquery")):root["Bloodhound"]=factory(jQuery)}(this,function($){var _=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(obj){return"string"==typeof obj},isNumber:function(obj){return"number"==typeof obj},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return"undefined"==typeof obj},isElement:function(obj){return!(!obj||1!==obj.nodeType)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||null===s?"":s+""},bind:$.proxy,each:function(collection,cb){function reverseArgs(index,value){return cb(value,index)}$.each(collection,reverseArgs)},map:$.map,filter:$.grep,every:function(obj,test){var result=!0;return obj?($.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj)))return!1}),!!result):result},some:function(obj,test){var result=!1;return obj?($.each(obj,function(key,val){if(result=test.call(null,val,key,obj))return!1}),!!result):result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(!0,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;return later=function(){timeout=null,immediate||(result=func.apply(context,args))},callNow=immediate&&!timeout,clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&(result=func.apply(context,args)),result}},throttle:function(func,wait){var context,args,timeout,result,previous,later;return previous=0,later=function(){previous=new Date,timeout=null,result=func.apply(context,args)},function(){var now=new Date,remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0?(clearTimeout(timeout),timeout=null,previous=now,result=func.apply(context,args)):timeout||(timeout=setTimeout(later,remaining)),result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}(),VERSION="0.11.1",tokenizers=function(){"use strict";return{nonword:nonword,whitespace:whitespace,obj:{nonword:getObjTokenizer(nonword),whitespace:getObjTokenizer(whitespace)}};function whitespace(str){return str=_.toStr(str),str?str.split(/\s+/):[]}function nonword(str){return str=_.toStr(str),str?str.split(/\W+/):[]}function getObjTokenizer(tokenizer){return function setKey(keys){return keys=_.isArray(keys)?keys:[].slice.call(arguments,0),function tokenize(o){var tokens=[];return _.each(keys,function(k){tokens=tokens.concat(tokenizer(_.toStr(o[k])))}),tokens}}}}(),LruCache=function(){"use strict";function LruCache(maxSize){this.maxSize=_.isNumber(maxSize)?maxSize:100,this.reset(),this.maxSize<=0&&(this.set=this.get=$.noop)}function List(){this.head=this.tail=null}function Node(key,val){this.key=key,this.val=val,this.prev=this.next=null}return _.mixin(LruCache.prototype,{set:function set(key,val){var tailItem=this.list.tail,node;this.size>=this.maxSize&&(this.list.remove(tailItem),delete this.hash[tailItem.key],this.size--),(node=this.hash[key])?(node.val=val,this.list.moveToFront(node)):(node=new Node(key,val),this.list.add(node),this.hash[key]=node,this.size++)},get:function get(key){var node=this.hash[key];if(node)return this.list.moveToFront(node),node.val},reset:function reset(){this.size=0,this.hash={},this.list=new List}}),_.mixin(List.prototype,{add:function add(node){this.head&&(node.next=this.head,this.head.prev=node),this.head=node,this.tail=this.tail||node},remove:function remove(node){node.prev?node.prev.next=node.next:this.head=node.next,node.next?node.next.prev=node.prev:this.tail=node.prev},moveToFront:function(node){this.remove(node),this.add(node)}}),LruCache}(),PersistentStorage=function(){"use strict";var LOCAL_STORAGE;try{LOCAL_STORAGE=window.localStorage,LOCAL_STORAGE.setItem("~~~","!"),LOCAL_STORAGE.removeItem("~~~")}catch(err){LOCAL_STORAGE=null}function PersistentStorage(namespace,override){this.prefix=["__",namespace,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+_.escapeRegExChars(this.prefix)),this.ls=override||LOCAL_STORAGE,!this.ls&&this._noop()}return _.mixin(PersistentStorage.prototype,{_prefix:function(key){return this.prefix+key}
16,_ttlKey:function(key){return this._prefix(key)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=_.noop},_safeSet:function(key,val){try{this.ls.setItem(key,val)}catch(err){"QuotaExceededError"===err.name&&(this.clear(),this._noop())}},get:function(key){return this.isExpired(key)&&this.remove(key),decode(this.ls.getItem(this._prefix(key)))},set:function(key,val,ttl){return _.isNumber(ttl)?this._safeSet(this._ttlKey(key),encode(now()+ttl)):this.ls.removeItem(this._ttlKey(key)),this._safeSet(this._prefix(key),encode(val))},remove:function(key){return this.ls.removeItem(this._ttlKey(key)),this.ls.removeItem(this._prefix(key)),this},clear:function(){var i,keys=gatherMatchingKeys(this.keyMatcher);for(i=keys.length;i--;)this.remove(keys[i]);return this},isExpired:function(key){var ttl=decode(this.ls.getItem(this._ttlKey(key)));return!!(_.isNumber(ttl)&&now()>ttl)}}),PersistentStorage;function now(){return(new Date).getTime()}function encode(val){return JSON.stringify(_.isUndefined(val)?null:val)}function decode(val){return $.parseJSON(val)}function gatherMatchingKeys(keyMatcher){var i,key,keys=[],len=LOCAL_STORAGE.length;for(i=0;i<len;i++)(key=LOCAL_STORAGE.key(i)).match(keyMatcher)&&keys.push(key.replace(keyMatcher,""));return keys}}(),Transport=function(){"use strict";var pendingRequestsCount=0,pendingRequests={},maxPendingRequests=6,sharedCache=new LruCache(10);function Transport(o){o=o||{},this.cancelled=!1,this.lastReq=null,this._send=o.transport,this._get=o.limiter?o.limiter(this._get):this._get,this._cache=!1===o.cache?new LruCache(0):sharedCache}return Transport.setMaxPendingRequests=function setMaxPendingRequests(num){maxPendingRequests=num},Transport.resetCache=function resetCache(){sharedCache.reset()},_.mixin(Transport.prototype,{_fingerprint:function fingerprint(o){return o=o||{},o.url+o.type+$.param(o.data||{})},_get:function(o,cb){var that=this,fingerprint,jqXhr;function done(resp){cb(null,resp),that._cache.set(fingerprint,resp)}function fail(){cb(!0)}function always(){pendingRequestsCount--,delete pendingRequests[fingerprint],that.onDeckRequestArgs&&(that._get.apply(that,that.onDeckRequestArgs),that.onDeckRequestArgs=null)}fingerprint=this._fingerprint(o),this.cancelled||fingerprint!==this.lastReq||((jqXhr=pendingRequests[fingerprint])?jqXhr.done(done).fail(fail):pendingRequestsCount<maxPendingRequests?(pendingRequestsCount++,pendingRequests[fingerprint]=this._send(o).done(done).fail(fail).always(always)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(o,cb){var resp,fingerprint;cb=cb||$.noop,o=_.isString(o)?{url:o}:o||{},fingerprint=this._fingerprint(o),this.cancelled=!1,this.lastReq=fingerprint,(resp=this._cache.get(fingerprint))?cb(null,resp):this._get(o,cb)},cancel:function(){this.cancelled=!0}}),Transport}(),SearchIndex=window.SearchIndex=function(){"use strict";var CHILDREN="c",IDS="i";function SearchIndex(o){o=o||{},o.datumTokenizer&&o.queryTokenizer||$.error("datumTokenizer and queryTokenizer are both required"),this.identify=o.identify||_.stringify,this.datumTokenizer=o.datumTokenizer,this.queryTokenizer=o.queryTokenizer,this.reset()}return _.mixin(SearchIndex.prototype,{bootstrap:function bootstrap(o){this.datums=o.datums,this.trie=o.trie},add:function(data){var that=this;data=_.isArray(data)?data:[data],_.each(data,function(datum){var id,tokens;that.datums[id=that.identify(datum)]=datum,tokens=normalizeTokens(that.datumTokenizer(datum)),_.each(tokens,function(token){var node,chars,ch;for(node=that.trie,chars=token.split("");ch=chars.shift();)node=node["c"][ch]||(node["c"][ch]=newNode()),node["i"].push(id)})})},get:function get(ids){var that=this;return _.map(ids,function(id){return that.datums[id]})},search:function search(query){var that=this,tokens,matches;return tokens=normalizeTokens(this.queryTokenizer(query)),_.each(tokens,function(token){var node,chars,ch,ids;if(matches&&0===matches.length)return!1;for(node=that.trie,chars=token.split("");node&&(ch=chars.shift());)node=node["c"][ch];if(!node||0!==chars.length)return matches=[],!1;ids=node["i"].slice(0),matches=matches?getIntersection(matches,ids):ids}),matches?_.map(unique(matches),function(id){return that.datums[id]}):[]},all:function all(){var values=[];for(var key in this.datums)values.push(this.datums[key]);return values},reset:function reset(){this.datums={},this.trie=newNode()},serialize:function serialize(){return{datums:this.datums,trie:this.trie}}}),SearchIndex;function normalizeTokens(tokens){return tokens=_.filter(tokens,function(token){return!!token}),tokens=_.map(tokens,function(token){return token.toLowerCase()}),tokens}function newNode(){var node={i:[],c:{}};return node}function unique(array){for(var seen={},uniques=[],i=0,len=array.length;i<len;i++)seen[array[i]]||(seen[array[i]]=!0,uniques.push(array[i]));return uniques}function getIntersection(arrayA,arrayB){var ai=0,bi=0,intersection=[];arrayA=arrayA.sort(),arrayB=arrayB.sort();for(var lenArrayA=arrayA.length,lenArrayB=arrayB.length;ai<lenArrayA&&bi<lenArrayB;)arrayA[ai]<arrayB[bi]?ai++:(arrayA[ai]>arrayB[bi]||(intersection.push(arrayA[ai]),ai++),bi++);return intersection}}(),Prefetch=function(){"use strict";var keys;function Prefetch(o){this.url=o.url,this.ttl=o.ttl,this.cache=o.cache,this.prepare=o.prepare,this.transform=o.transform,this.transport=o.transport,this.thumbprint=o.thumbprint,this.storage=new PersistentStorage(o.cacheKey)}return keys={data:"data",protocol:"protocol",thumbprint:"thumbprint"},_.mixin(Prefetch.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},store:function store(data){this.cache&&(this.storage.set(keys.data,data,this.ttl),this.storage.set(keys.protocol,location.protocol,this.ttl),this.storage.set(keys.thumbprint,this.thumbprint,this.ttl))},fromCache:function fromCache(){var stored={},isExpired;return this.cache?(stored.data=this.storage.get(keys.data),stored.protocol=this.storage.get(keys.protocol),stored.thumbprint=this.storage.get(keys.thumbprint),isExpired=stored.thumbprint!==this.thumbprint||stored.protocol!==location.protocol,stored.data&&!isExpired?stored.data:null):null},fromNetwork:function(cb){var that=this,settings;function onError(){cb(!0)}function onResponse(resp){cb(null,that.transform(resp))}cb&&(settings=this.prepare(this._settings()),this.transport(settings).fail(onError).done(onResponse))},clear:function clear(){return this.storage.clear(),this}}),Prefetch}(),Remote=function(){"use strict";function Remote(o){this.url=o.url,this.prepare=o.prepare,this.transform=o.transform,this.transport=new Transport({cache:o.cache,limiter:o.limiter,transport:o.transport})}return _.mixin(Remote.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},get:function get(query,cb){var that=this,settings;if(cb)return query=query||"",settings=this.prepare(query,this._settings()),this.transport.get(settings,onResponse);function onResponse(err,resp){cb(err?[]:that.transform(resp))}},cancelLastRequest:function cancelLastRequest(){this.transport.cancel()}}),Remote}(),oParser=function(){"use strict";return function parse(o){var defaults,sorter;return defaults={initialize:!0,identify:_.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},o=_.mixin(defaults,o||{}),!o.datumTokenizer&&$.error("datumTokenizer is required"),!o.queryTokenizer&&$.error("queryTokenizer is required"),sorter=o.sorter,o.sorter=sorter?function(x){return x.sort(sorter)}:_.identity,o.local=_.isFunction(o.local)?o.local():o.local,o.prefetch=parsePrefetch(o.prefetch),o.remote=parseRemote(o.remote),o};function parsePrefetch(o){var defaults;return o?(defaults={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:_.identity,transform:_.identity,transport:null},o=_.isString(o)?{url:o}:o,o=_.mixin(defaults,o),!o.url&&$.error("prefetch requires url to be set"),o.transform=o.filter||o.transform,o.cacheKey=o.cacheKey||o.url,o.thumbprint=VERSION+o.thumbprint,o.transport=o.transport?callbackToDeferred(o.transport):$.ajax,o):null}function parseRemote(o){var defaults;if(o)return defaults={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:_.identity,transport:null},o=_.isString(o)?{url:o}:o,o=_.mixin(defaults,o),!o.url&&$.error("remote requires url to be set"),o.transform=o.filter||o.transform,o.prepare=toRemotePrepare(
16o),o.limiter=toLimiter(o),o.transport=o.transport?callbackToDeferred(o.transport):$.ajax,delete o.replace,delete o.wildcard,delete o.rateLimitBy,delete o.rateLimitWait,o}function toRemotePrepare(o){var prepare,replace,wildcard;return prepare=o.prepare,replace=o.replace,wildcard=o.wildcard,prepare||(prepare=replace?prepareByReplace:o.wildcard?prepareByWildcard:idenityPrepare,prepare);function prepareByReplace(query,settings){return settings.url=replace(settings.url,query),settings}function prepareByWildcard(query,settings){return settings.url=settings.url.replace(wildcard,encodeURIComponent(query)),settings}function idenityPrepare(query,settings){return settings}}function toLimiter(o){var limiter,method,wait;return limiter=o.limiter,method=o.rateLimitBy,wait=o.rateLimitWait,limiter||(limiter=/^throttle$/i.test(method)?throttle(wait):debounce(wait)),limiter;function debounce(wait){return function debounce(fn){return _.debounce(fn,wait)}}function throttle(wait){return function throttle(fn){return _.throttle(fn,wait)}}}function callbackToDeferred(fn){return function wrapper(o){var deferred=$.Deferred();return fn(o,onSuccess,onError),deferred;function onSuccess(resp){_.defer(function(){deferred.resolve(resp)})}function onError(err){_.defer(function(){deferred.reject(err)})}}}}(),Bloodhound=function(){"use strict";var old;function Bloodhound(o){o=oParser(o),this.sorter=o.sorter,this.identify=o.identify,this.sufficient=o.sufficient,this.local=o.local,this.remote=o.remote?new Remote(o.remote):null,this.prefetch=o.prefetch?new Prefetch(o.prefetch):null,this.index=new SearchIndex({identify:this.identify,datumTokenizer:o.datumTokenizer,queryTokenizer:o.queryTokenizer}),!1!==o.initialize&&this.initialize()}return old=window&&window.Bloodhound,Bloodhound.noConflict=function noConflict(){return window&&(window.Bloodhound=old),Bloodhound},Bloodhound.tokenizers=tokenizers,_.mixin(Bloodhound.prototype,{__ttAdapter
16:function ttAdapter(){var that=this;return this.remote?withAsync:withoutAsync;function withAsync(query,sync,async){return that.search(query,sync,async)}function withoutAsync(query,sync){return that.search(query,sync)}},_loadPrefetch:function loadPrefetch(){var that=this,deferred,serialized;return deferred=$.Deferred(),this.prefetch?(serialized=this.prefetch.fromCache())?(this.index.bootstrap(serialized),deferred.resolve()):this.prefetch.fromNetwork(done):deferred.resolve(),deferred.promise();function done(err,data){if(err)return deferred.reject();that.add(data),that.prefetch.store(that.index.serialize()),deferred.resolve()}},_initialize:function initialize(){var that=this,deferred;return this.clear(),(this.initPromise=this._loadPrefetch()).done(addLocalToIndex),this.initPromise;function addLocalToIndex(){that.add(that.local)}},initialize:function initialize(force){return!this.initPromise||force?this._initialize():this.initPromise},add:function add(data){return this.index.add(data),this},get:function get(ids){return ids=_.isArray(ids)?ids:[].slice.call(arguments),this.index.get(ids)},search:function search(query,sync,async){var that=this,local;return local=this.sorter(this.index.search(query)),sync(this.remote?local.slice():local),this.remote&&local.length<this.sufficient?this.remote.get(query,processRemote):this.remote&&this.remote.cancelLastRequest(),this;function processRemote(remote){var nonDuplicates=[];_.each(remote,function(r){!_.some(local,function(l){return that.identify(r)===that.identify(l)})&&nonDuplicates.push(r)}),async&&async(nonDuplicates)}},all:function all(){return this.index.all()},clear:function clear(){return this.index.reset(),this},clearPrefetchCache:function clearPrefetchCache(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function clearRemoteCache(){return Transport.resetCache(),this},ttAdapter:function ttAdapter(){return this.__ttAdapter()}}),Bloodhound}();return Bloodhound}),function(root,factory){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a0){return factory(a0)}):"object"==typeof exports?module.exports=factory(require("jquery")):factory(jQuery)}(this,function($){var _=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(obj){return"string"==typeof obj},isNumber:function(obj){return"number"==typeof obj},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return"undefined"==typeof obj},isElement:function(obj){return!(!obj||1!==obj.nodeType)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||null===s?"":s+""},bind:$.proxy,each:function(collection,cb){function reverseArgs(index,value){return cb(value,index)}$.each(collection,reverseArgs)},map:$.map,filter:$.grep,every:function(obj,test){var result=!0;return obj?($.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj)))return!1}),!!result):result},some:function(obj,test){var result=!1;return obj?($.each(obj,function(key,val){if(result=test.call(null,val,key,obj))return!1}),!!result):result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(!0,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;return later=function(){timeout=null,immediate||(result=func.apply(context,args))},callNow=immediate&&!timeout,clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&(result=func.apply(context,args)),result}},throttle:function(func,wait){var context,args,timeout,result,previous,later;return previous=0,later=function(){previous=new Date,timeout=null,result=func.apply(context,args)},function(){var now=new Date,remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0?(clearTimeout(timeout),timeout=null,previous=now,result=func.apply(context,args)):timeout||(timeout=setTimeout(later,remaining)),result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}(),WWW=function(){"use strict";var defaultClassNames={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-
16open",cursor:"tt-cursor",highlight:"tt-highlight"};return build;function build(o){var www,classes;return classes=_.mixin({},defaultClassNames,o),www={css:buildCss(),classes:classes,html:buildHtml(classes),selectors:buildSelectors(classes)},{css:www.css,html:www.html,classes:www.classes,selectors:www.selectors,mixin:function(o){_.mixin(o,www)}}}function buildHtml(c){return{wrapper:'<span class="'+c.wrapper+'"></span>',menu:'<div class="'+c.menu+'"></div>'}}function buildSelectors(classes){var selectors={};return _.each(classes,function(v,k){selectors[k]="."+v}),selectors}function buildCss(){var css={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return _.isMsie()&&_.mixin(css.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),css}}(),EventBus=function(){"use strict";var namespace,deprecationMap;function EventBus(o){o&&o.el||$.error("EventBus initialized without el"),this.$el=$(o.el)}return namespace="typeahead:",deprecationMap={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},_.mixin(EventBus.prototype,{_trigger:function(type,args){var $e;return $e=$.Event(namespace+type),(args=args||[]).unshift($e),this.$el.trigger.apply(this.$el,args),$e},before:function(type){var args,$e;return args=[].slice.call(arguments,1),$e=this._trigger("before"+type,args),$e.isDefaultPrevented()},trigger:function(type){var deprecatedType;this._trigger(type,[].slice.call(arguments,1)),(deprecatedType=deprecationMap[type])&&this._trigger(deprecatedType,[].slice.call(arguments,1))}}),EventBus}(),EventEmitter=function(){"use strict";var splitter=/\s+/,nextTick=getNextTick();return{onSync:onSync,onAsync:onAsync,off:off,trigger:trigger};function on(method,types,cb,context){var type;if(!cb)return this;for(types=types.split(splitter),cb=context?bindContext(cb,context):cb,this._callbacks=this._callbacks||{};type=types.shift();)this._callbacks[type]=this._callbacks[type]||{sync:[],async:[]},this._callbacks[type][method].push(cb);return this}function onAsync(types,cb,context){return on.call(this,"async",types,cb,context)}function onSync(types,cb,context){return on.call(this,"sync",types,cb,context)}function off(types){var type;if(!this._callbacks)return this;for(types=types.split(splitter);type=types.shift();)delete this._callbacks[type];return this}function trigger(types){var type,callbacks,args,syncFlush,asyncFlush;if(!this._callbacks)return this;for(types=types.split(splitter),args=[].slice.call(arguments,1);(type=types.shift())&&(callbacks=this._callbacks[type]);)syncFlush=getFlush(callbacks.sync,this,[type].concat(args)),asyncFlush=getFlush(callbacks.async,this,[type].concat(args)),syncFlush()&&nextTick(asyncFlush);return this}function getFlush(callbacks,context,args){return flush;function flush(){for(var cancelled,i=0,len=callbacks.length;!cancelled&&i<len;i+=1)cancelled=!1===callbacks[i].apply(context,args);return!cancelled}}function getNextTick(){var nextTickFn;return nextTickFn=window.setImmediate?function nextTickSetImmediate(fn){setImmediate(function(){fn()})}:function nextTickSetTimeout(fn){setTimeout(function(){fn()},0)},nextTickFn}function bindContext(fn,context){return fn.bind?fn.bind(context):function(){fn.apply(context,[].slice.call(arguments,0))}}}(),highlight=function(doc){"use strict";var defaults={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function hightlight(o){var regex;function hightlightTextNode(textNode){var match,patternNode,wrapperNode;return(match=regex.exec(textNode.data))&&(wrapperNode=doc.createElement(o.tagName),o.className&&(wrapperNode.className=o.className),patternNode=textNode.splitText(match.index),patternNode.splitText(match[0].length),wrapperNode.appendChild(patternNode.cloneNode(!0)),textNode.parentNode.replaceChild(wrapperNode,patternNode)),!!match}function traverse(el,hightlightTextNode){for(var childNode,TEXT_NODE_TYPE=3,i=0;i<el.childNodes.length;i++)childNode=el.childNodes[i],3===childNode.nodeType?i+=hightlightTextNode(childNode)?1:0:traverse(childNode,hightlightTextNode)}o=_.mixin({},defaults,o),o.node&&o.pattern&&(o.pattern=_.isArray(o.pattern)?o.pattern:[o.pattern],regex=getRegex(o.pattern,o.caseSensitive,o.wordsOnly),traverse(o.node,hightlightTextNode))};function getRegex(patterns,caseSensitive,wordsOnly){for(var escapedPatterns=[],regexStr,i=0,len=patterns.length;i<len;i++)escapedPatterns.push(_.escapeRegExChars(patterns[i]));return regexStr=wordsOnly?"\\b("+escapedPatterns.join("|")+")\\b":"("+escapedPatterns.join("|")+")",caseSensitive?new RegExp(regexStr):new RegExp(regexStr,"i")}}(window.document),Input=function(){"use strict";var specialKeyCodeMap;function Input(o,www){o=o||{},o.input||$.error("input is missing"),www.mixin(this),this.$hint=$(o.hint),this.$input
16=$(o.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=buildOverflowHelper(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=_.noop)}return specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},Input.normalizeQuery=function(str){return _.toStr(str).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},_.mixin(Input.prototype,EventEmitter,{_onBlur:function onBlur(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function onFocus(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function onKeydown($e){var keyName=specialKeyCodeMap[$e.which||$e.keyCode];this._managePreventDefault(keyName,$e),keyName&&this._shouldTrigger(keyName,$e)&&this.trigger(keyName+"Keyed",$e)},_onInput:function onInput(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function managePreventDefault(keyName,$e){var preventDefault;switch(keyName){case"up":case"down":preventDefault=!withModifier($e);break;default:preventDefault=!1}preventDefault&&$e.preventDefault()},_shouldTrigger:function shouldTrigger(keyName,$e){var trigger;switch(keyName){case"tab":trigger=!withModifier($e);break;default:trigger=!0}return trigger},_checkLanguageDirection:function checkLanguageDirection(){var dir=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==dir&&(this.dir=dir,this.$hint.attr("dir",dir),this.trigger("langDirChanged",dir))},_setQuery:function setQuery(val,silent){var areEquivalent,hasDifferentWhitespace;areEquivalent=areQueriesEquivalent(val,this.query),hasDifferentWhitespace=!!areEquivalent&&this.query.length!==val.length,this.query=val,silent||areEquivalent?!silent&&hasDifferentWhitespace&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var that=this,onBlur,onFocus,onKeydown,onInput;return onBlur=_.bind(this._onBlur,this),onFocus=_.bind(this._onFocus,this),onKeydown=_.bind(this._onKeydown,this),onInput=_.bind(this._onInput,this),this.$input.on("blur.tt",onBlur).on("focus.tt",onFocus).on("keydown.tt",onKeydown),!_.isMsie()||_.isMsie()>9?this.$input.on("input.tt",onInput):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function($e){specialKeyCodeMap[$e.which||$e.keyCode]||_.defer(_.bind(that._onInput,that,$e))}),this},focus:function focus(){this.$input.focus()},blur:function blur(){this.$input.blur()},getLangDir:function getLangDir(){return this.dir},getQuery:function getQuery(){return this.query||""},setQuery:function setQuery(val,silent){this.setInputValue(val),this._setQuery(val,silent)},hasQueryChangedSinceLastFocus:function hasQueryChangedSinceLastFocus(){return this.query!==this.queryWhenFocused},getInputValue:function getInputValue(){return this.$input.val()},setInputValue:function setInputValue(value){this.$input.val(value),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function resetInputValue(){this.setInputValue(this.query)},getHint:function getHint(){return this.$hint.val()},setHint:function setHint(value){this.$hint.val(value)},clearHint:function clearHint(){this.setHint("")},clearHintIfInvalid:function clearHintIfInvalid(){var val,hint,valIsPrefixOfHint,isValid;val=this.getInputValue(),hint=this.getHint(),valIsPrefixOfHint=val!==hint&&0===hint.indexOf(val),isValid=""!==val&&valIsPrefixOfHint&&!this.hasOverflow(),!isValid&&this.clearHint()},hasFocus:function hasFocus(){return this.$input.is(":focus")},hasOverflow:function hasOverflow(){var constraint=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=constraint},isCursorAtEnd:function(){var valueLength,selectionStart,range;return valueLength=this.$input.val().length,selectionStart=this.$input[0].selectionStart,_.isNumber(selectionStart)?selectionStart===valueLength:!document.selection||(range=document.selection.createRange(),range.moveStart("character",-valueLength),valueLength===range.text.length)},destroy:function destroy(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input
16=this.$overflowHelper=$("<div>")}}),Input;function buildOverflowHelper($input){return $('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:$input.css("font-family"),fontSize:$input.css("font-size"),fontStyle:$input.css("font-style"),fontVariant:$input.css("font-variant"),fontWeight:$input.css("font-weight"),wordSpacing:$input.css("word-spacing"),letterSpacing:$input.css("letter-spacing"),textIndent:$input.css("text-indent"),textRendering:$input.css("text-rendering"),textTransform:$input.css("text-transform")}).insertAfter($input)}function areQueriesEquivalent(a,b){return Input.normalizeQuery(a)===Input.normalizeQuery(b)}function withModifier($e){return $e.altKey||$e.ctrlKey||$e.metaKey||$e.shiftKey}}(),Dataset=function(){"use strict";var keys,nameGenerator;function Dataset(o,www){o=o||{},o.templates=o.templates||{},o.templates.notFound=o.templates.notFound||o.templates.empty,o.source||$.error("missing source"),o.node||$.error("missing node"),o.name&&!isValidName(o.name)&&$.error("invalid dataset name: "+o.name),www.mixin(this),this.highlight=!!o.highlight,this.name=o.name||nameGenerator(),this.limit=o.limit||5,this.displayFn=getDisplayFn(o.display||o.displayKey),this.templates=getTemplates(o.templates,this.displayFn),this.source=o.source.__ttAdapter?o.source.__ttAdapter():o.source,this.async=_.isUndefined(o.async)?this.source.length>2:!!o.async,this._resetLastSuggestion(),this.$el=$(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return keys={val:"tt-selectable-display",obj:"tt-selectable-object"},nameGenerator=_.getIdGenerator(),Dataset.extractData=function extractData(el){var $el=$(el);return $el.data(keys.obj)?{val:$el.data(keys.val)||"",obj:$el.data(keys.obj)||null}:null},_.mixin(Dataset.prototype,EventEmitter,{_overwrite:function overwrite(query,suggestions){suggestions=suggestions||[],suggestions.length?this._renderSuggestions(query,suggestions):this.async&&this.templates.pending?this._renderPending(query):!this.async&&this.templates.notFound?this._renderNotFound(query):this._empty(),this.trigger("rendered",this.name,suggestions,!1)},_append:function append(query,suggestions){suggestions=suggestions||[],suggestions.length&&this.$lastSuggestion.length?this._appendSuggestions(query,suggestions):suggestions.length?this._renderSuggestions(query,suggestions):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(query),this.trigger("rendered",this.name,suggestions,!0)}
16,_renderSuggestions:function renderSuggestions(query,suggestions){var $fragment;$fragment=this._getSuggestionsFragment(query,suggestions),this.$lastSuggestion=$fragment.children().last(),this.$el.html($fragment).prepend(this._getHeader(query,suggestions)).append(this._getFooter(query,suggestions))},_appendSuggestions:function appendSuggestions(query,suggestions){var $fragment,$lastSuggestion;$fragment=this._getSuggestionsFragment(query,suggestions),$lastSuggestion=$fragment.children().last(),this.$lastSuggestion.after($fragment),this.$lastSuggestion=$lastSuggestion},_renderPending:function renderPending(query){var template=this.templates.pending;this._resetLastSuggestion(),template&&this.$el.html(template({query:query,dataset:this.name}))},_renderNotFound:function renderNotFound(query){var template=this.templates.notFound;this._resetLastSuggestion(),template&&this.$el.html(template({query:query,dataset:this.name}))},_empty:function empty(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function getSuggestionsFragment(query,suggestions){var that=this,fragment;return fragment=document.createDocumentFragment(),_.each(suggestions,function getSuggestionNode(suggestion){var $el,context;context=that._injectQuery(query,suggestion),$el=$(that.templates.suggestion(context)).data(keys.obj,suggestion).data(keys.val,that.displayFn(suggestion)).addClass(that.classes.suggestion+" "+that.classes.selectable),fragment.appendChild($el[0])}),this.highlight&&highlight({className:this.classes.highlight,node:fragment,pattern:query}),$(fragment)},_getFooter:function getFooter(query,suggestions){return this.templates.footer?this.templates.footer({query:query,suggestions:suggestions,dataset:this.name}):null},_getHeader:function getHeader(query,suggestions){return this.templates.header?this.templates.header({query:query,suggestions:suggestions,dataset:this.name}):null},_resetLastSuggestion:function resetLastSuggestion(){this.$lastSuggestion=$()},_injectQuery:function injectQuery(query,obj){return _.isObject(obj)?_.mixin({_query:query},obj):obj},update:function update(query){var that=this,canceled=!1,syncCalled=!1,rendered=0;function sync(suggestions){syncCalled||(syncCalled=!0,suggestions=(suggestions||[]).slice(0,that.limit),rendered=suggestions.length,that._overwrite(query,suggestions),rendered<that.limit&&that.async&&that.trigger("asyncRequested",query))}function async(suggestions){suggestions=suggestions||[],!canceled&&rendered<that.limit&&(that.cancel=$.noop,rendered+=suggestions.length,that._append(query,suggestions.slice(0,that.limit-rendered)),that.async&&that.trigger("asyncReceived",query))}this.cancel(),this.cancel=function cancel(){canceled=!0,that.cancel=$.noop,that.async&&that.trigger("asyncCanceled",query)},this.source(query,sync,async),!syncCalled&&sync([])},cancel:$.noop,clear:function clear(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function isEmpty(){return this.$el.is(":empty")},destroy:function destroy(){this.$el=$("<div>")}}),Dataset;function getDisplayFn(display){return display=display||_.stringify,_.isFunction(display)?display:displayFn;function displayFn(obj){return obj[display]}}function getTemplates(templates,displayFn){return{notFound:templates.notFound&&_.templatify(templates.notFound),pending:templates.pending&&_.templatify(templates.pending),header:templates.header&&_.templatify(templates.header),footer:templates.footer&&_.templatify(templates.footer),suggestion:templates.suggestion||suggestionTemplate};function suggestionTemplate(context){return $("<div>").text(displayFn(context))}}function isValidName(str){return/^[_a-zA-Z0-9-]+$/.test(str)}}(),Menu=function(){"use strict";function Menu(o,www){var that=this;function initializeDataset(oDataset){var node=that.$node.find(oDataset.node).first();return oDataset.node=node.length?node:$("<div>").appendTo(that.$node),new Dataset(oDataset,www)}o=o||{},o.node||$.error("node is required"),www.mixin(this),this.$node=$(o.node),this.query=null,this.datasets=_.map(o.datasets,initializeDataset)}return _.mixin(Menu.prototype,EventEmitter,{_onSelectableClick:function onSelectableClick($e){this.trigger("selectableClicked",$($e.currentTarget))},_onRendered:function onRendered(type,dataset,suggestions,async){this.$n
16ode.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",dataset,suggestions,async)},_onCleared:function onCleared(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function propagate(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function allDatasetsEmpty(){return _.every(this.datasets,isDatasetEmpty);function isDatasetEmpty(dataset){return dataset.isEmpty()}},_getSelectables:function getSelectables(){return this.$node.find(this.selectors.selectable)},_removeCursor:function _removeCursor(){var $selectable=this.getActiveSelectable();$selectable&&$selectable.removeClass(this.classes.cursor)},_ensureVisible:function ensureVisible($el){var elTop,elBottom,nodeScrollTop,nodeHeight;elTop=$el.position().top,elBottom=elTop+$el.outerHeight(!0),nodeScrollTop=this.$node.scrollTop(),nodeHeight=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),elTop<0?this.$node.scrollTop(nodeScrollTop+elTop):nodeHeight<elBottom&&this.$node.scrollTop(nodeScrollTop+(elBottom-nodeHeight))},bind:function(){var that=this,onSelectableClick;return onSelectableClick=_.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,onSelectableClick),_.each(this.datasets,function(dataset){dataset.onSync("asyncRequested",that._propagate,that).onSync("asyncCanceled",that._propagate,that).onSync("asyncReceived",that._propagate,that).onSync("rendered",that._onRendered,that).onSync("cleared",that._onCleared,that)}),this},isOpen:function isOpen(){return this.$node.hasClass(this.classes.open)},open:function open(){this.$node.addClass(this.classes.open)},close:function close(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function setLanguageDirection(dir){this.$node.attr("dir",dir)},selectableRelativeToCursor:function selectableRelativeToCursor(delta){var $selectables,$oldCursor,oldIndex,newIndex;return $oldCursor=this.getActiveSelectable(),$selectables=this._getSelectables(),oldIndex=$oldCursor?$selectables.index($oldCursor):-1,newIndex=oldIndex+delta,newIndex=(newIndex+1)%($selectables.length+1)-1,newIndex=newIndex<-1?$selectables.length-1:newIndex,-1===newIndex?null:$selectables.eq(newIndex)},setCursor:function setCursor($selectable){this._removeCursor(),($selectable=$selectable&&$selectable.first())&&($selectable.addClass(this.classes.cursor),this._ensureVisible($selectable))},getSelectableData:function getSelectableData($el){return $el&&$el.length?Dataset.extractData($el):null},getActiveSelectable:function getActiveSelectable(){var $selectable=this._getSelectables().filter(this.selectors.cursor).first();return $selectable.length?$selectable:null},getTopSelectable:function getTopSelectable(){var $selectable=this._getSelectables().first();return $selectable.length?$selectable:null},update:function update(query){var isValidUpdate=query!==this.query;return isValidUpdate&&(this.query=query,_.each(this.datasets,updateDataset)),isValidUpdate;function updateDataset(dataset){dataset.update(query)}},empty:function empty(){function clearDataset(dataset){dataset.clear()}_.each(this.datasets,clearDataset),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function destroy(){function destroyDataset(dataset){dataset.destroy()}this.$node.off(".tt"),this.$node=$("<div>"),_.each(this.datasets,destroyDataset)}}),Menu}(),DefaultMenu=function(){"use strict";var s=Menu.prototype;function DefaultMenu(){Menu.apply(this,[].slice.call(arguments,0))}return _.mixin(DefaultMenu.prototype,Menu.prototype,{open:function open(){return!this._allDatasetsEmpty()&&this._show(),s.open.apply(this,[].slice.call(arguments,0))},close:function close(){return this._hide(),s.close.apply(this,[].slice.call(arguments,0))},_onRendered:function onRendered(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),s._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function onCleared(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),s._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function setLanguageDirection(dir){return this.$n
16ode.css("ltr"===dir?this.css.ltr:this.css.rtl),s.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function hide(){this.$node.hide()},_show:function show(){this.$node.css("display","block")}}),DefaultMenu}(),Typeahead=function(){"use strict";function Typeahead(o,www){var onFocused,onBlurred,onEnterKeyed,onTabKeyed,onEscKeyed,onUpKeyed,onDownKeyed,onLeftKeyed,onRightKeyed,onQueryChanged,onWhitespaceChanged;o=o||{},o.input||$.error("missing input"),o.menu||$.error("missing menu"),o.eventBus||$.error("missing event bus"),www.mixin(this),this.eventBus=o.eventBus,this.minLength=_.isNumber(o.minLength)?o.minLength:1,this.input=o.input,this.menu=o.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),onFocused=c(this,"activate","open","_onFocused"),onBlurred=c(this,"deactivate","_onBlurred"),onEnterKeyed=c(this,"isActive","isOpen","_onEnterKeyed"),onTabKeyed=c(this,"isActive","isOpen","_onTabKeyed"),onEscKeyed=c(this,"isActive","_onEscKeyed"),onUpKeyed=c(this,"isActive","open","_onUpKeyed"),onDownKeyed=c(this,"isActive","open","_onDownKeyed"),onLeftKeyed=c(this,"isActive","isOpen","_onLeftKeyed"),onRightKeyed=c(this,"isActive","isOpen","_onRightKeyed"),onQueryChanged=c(this,"_openIfActive","_onQueryChanged"),onWhitespaceChanged=c(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",onFocused,this).onSync("blurred",onBlurred,this).onSync("enterKeyed",onEnterKeyed,this).onSync("tabKeyed",onTabKeyed,this).onSync("escKeyed",onEscKeyed,this).onSync("upKeyed",onUpKeyed,this).onSync("downKeyed",onDownKeyed,this).onSync("leftKeyed",onLeftKeyed,this).onSync("rightKeyed",onRightKeyed,this).onSync("queryChanged",onQueryChanged,this).onSync("whitespaceChanged",onWhitespaceChanged,this).onSync("langDirChanged",this._onLangDirChanged,this)}return _.mixin(Typeahead.prototype,{_hacks:function hacks(){var $input,$menu;$input=this.input.$input||$("<div>"),$menu=this.menu.$node||$("<div>"),$input.on("blur.tt",function($e){var active,isActive,hasActive;active=document.activeElement,isActive=$menu.is(active),hasActive=$menu.has(active).length>0,_.isMsie()&&(isActive||hasActive)&&($e.preventDefault(),$e.stopImmediatePropagation(),_.defer(function(){$input.focus()}))}),$menu.on("mousedown.tt",function($e){$e.preventDefault()})},_onSelectableClicked:function onSelectableClicked(type,$el){this.select($el)},_onDatasetCleared:function onDatasetCleared(){this._updateHint()},_onDatasetRendered:function onDatasetRendered(type,dataset,suggestions,async){this._updateHint(),this.eventBus.trigger("render",suggestions,async,dataset)},_onAsyncRequested:function onAsyncRequested(type,dataset,query){this.eventBus.trigger("asyncrequest",query,dataset)},_onAsyncCanceled:function onAsyncCanceled(type,dataset,query){this.eventBus.trigger("asynccancel",query,dataset)},_onAsyncReceived:function onAsyncReceived(type,dataset,query){this.eventBus.trigger("asyncreceive",query,dataset)},_onFocused:function onFocused(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function onBlurred(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function onEnterKeyed(type,$e){var $selectable;($selectable=this.menu.getActiveSelectable())&&this.select($selectable)&&$e.preventDefault()},_onTabKeyed:function onTabKeyed(type,$e){var $selectable;($selectable=this.menu.getActiveSelectable())?this.select($selectable)&&$e.preventDefault():($selectable=this.menu.getTopSelectable())&&this.autocomplete($selectable)&&$e.preventDefault()},_onEscKeyed:function onEscKeyed(){this.close()},_onUpKeyed:function onUpKeyed(){this.moveCursor(-1)},_onDownKeyed:function onDownKeyed(){this.moveCursor(1)},_onLeftKeyed:function onLeftKeyed(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function onRightKeyed(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function onQueryChanged(e,query){this._minLengthMet(query)?this.menu.update(query):this.menu.empty()},_onWhitespaceChanged:function onWhitespaceChanged(){this._updateHint()},_onLangDirChanged:function onLangDirChanged(e,dir){this.dir!==dir&&(this.dir=dir,this.menu.setLanguageDirection(dir))},_openIfActive:function openIfActive(){this.isActive()&&this.open()},_minLengthMet:function minLengthMet(query){return query=_.isString(query)?query:this.input.getQuery()||"",query.length>=this.minLength},_updateHint:function updateHint(){var $selectable,data,val,query,escapedQuery,frontMatchRegEx,match;$selectable=this.menu.getTopSelectable(),data=this.menu.getSelectableData($selectable),val=this.input.getInputValue(),!data||_.isBlankString(val)||this.input.hasOverflow()?this.input.clearHint():(query=Input.normalizeQuery(val),escapedQuery=_.escapeRegExChars(query),frontMatchRegEx=new RegExp("^(?:"+escapedQuery+")(.+$)","i"),match=frontMatchRegEx.exec(data.val),match&&this.input.setHint(val+match[1]))},isEnabled:function isEnabled(){return this.enabled},enable:function enable(){this.enabled=!0},disable:function disable(){this.enabled=!1},isActive:function isActive(){return this.active},activate:function activate(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function deactivate(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function isOpen(){return this.menu.isOpen()},open:function open(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function close(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function setVal(val){this.input.setQuery(_.toStr(val))},getVal:function getVal(){return this.input.getQuery()},select:function select($selectable){var data=this.menu.getSelectableData($selectable);return!(!data||this.eventBus.before("select",data.obj))&&(this.input.setQuery(data.val,!0),this.eventBus.trigger("select",data.obj),this.close(),!0)},autocomplete:function autocomplete($selectable){var query,data,isValid;return query=this.input.getQuery(),data=this.menu.getSelectableData($selectable),isValid=data&&query!==data.val,!(!isValid||this.eventBus.before("autocomplete",data.obj))&&(this.input.setQuery(data.val),this.eventBus.trigger("autocomplete",data.obj),!0)},moveCursor:function moveCursor(delta){var query,$candidate,data,payload,cancelMove;return query=this.input.getQuery(),$candidate=this.menu.selectableRelativeToCursor(delta),data=this.menu.getSelectableData($candidate),payload=data?data.obj:null,cancelMove=this._minLengthMet()&&this.menu.update(query),!cancelMove&&!this.eventBus.before("cursorchange",payload)&&(this.menu.setCursor($candidate),data?this.input.setInputValue(data.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",payload),!0)},destroy:function destroy(){this.input.destroy(),this.menu.destroy()}}),Typeahead;
16function c(ctx){var methods=[].slice.call(arguments,1);return function(){var args=[].slice.call(arguments);_.each(methods,function(method){return ctx[method].apply(ctx,args)})}}}();!function(){"use strict";var old,keys,methods;function ttEach($els,fn){$els.each(function(){var $input=$(this),typeahead;(typeahead=$input.data(keys.typeahead))&&fn(typeahead,$input)})}function buildHintFromInput($input,www){return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly",!0).attr("aria-hidden",!0).removeAttr("id name placeholder required title").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function prepInput($input,www){$input.data(keys.attrs,{dir:$input.attr("dir"),autocomplete:$input.attr("autocomplete"),spellcheck:$input.attr("spellcheck"),style:$input.attr("style")}),$input.addClass(www.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!$input.attr("dir")&&$input.attr("dir","auto")}catch(e){}return $input}function getBackgroundStyles($el){return{backgroundAttachment:$el.css("background-attachment"),backgroundClip:$el.css("background-clip"),backgroundColor:$el.css("background-color"),backgroundImage:$el.css("background-image"),backgroundOrigin:$el.css("background-origin"),backgroundPosition:$el.css("background-position"),backgroundRepeat:$el.css("background-repeat"),backgroundSize:$el.css("background-size")}}function revert($input){var www,$wrapper;www=$input.data(keys.www),$wrapper=$input.parent().filter(www.selectors.wrapper),_.each($input.data(keys.attrs),function(val,key){_.isUndefined(val)?$input.removeAttr(key):$input.attr(key,val)}),$input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input),$wrapper.length&&($input.detach().insertAfter($wrapper),$wrapper.remove())}function $elOrNull(obj){var isValid,$el;return isValid=_.isJQuery(obj)||_.isElement(obj),$el=isValid?$(obj).first():[],$el.length?$el:null}old=$.fn.typeahead,keys={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},methods={initialize:function initialize(o,datasets){var www;return datasets=_.isArray(datasets)?datasets:[].slice.call(arguments,1),o=o||{},www=WWW(o.classNames),this.each(attach);function attach(){var $input,$wrapper,$hint,$menu,defaultHint,defaultMenu,eventBus,input,menu,typeahead,MenuConstructor;_.each(datasets,function(d){d.highlight=!!o.highlight}),$input=$(this),$wrapper=$(www.html.wrapper),$hint=$elOrNull(o.hint),$menu=$elOrNull(o.menu),defaultHint=!1!==o.hint&&!$hint,defaultMenu=!1!==o.menu&&!$menu,defaultHint&&($hint=buildHintFromInput($input,www)),defaultMenu&&($menu=$(www.html.menu).css(www.css.menu)),$hint&&$hint.val(""),$input=prepInput($input,www),(defaultHint||defaultMenu)&&($wrapper.css(www.css.wrapper),$input.css(defaultHint?www.css.input:www.css.inputWithNoHint),$input.wrap($wrapper).parent().prepend(defaultHint?$hint:null).append(defaultMenu?$menu:null)),MenuConstructor=defaultMenu?DefaultMenu:Menu,eventBus=new EventBus({el:$input}),input=new Input({hint:$hint,input:$input},www),menu=new MenuConstructor({node:$menu,datasets:datasets},www),typeahead=new Typeahead({input:input,menu:menu,eventBus:eventBus,minLength:o.minLength},www),$input.data(keys.www,www),$input.data(keys.typeahead,typeahead)}},isEnabled:function isEnabled(){var enabled;return ttEach(this.first(),function(t){enabled=t.isEnabled()}),enabled},enable:function enable(){return ttEach(this,function(t){t.enable()}),this},disable:function disable(){return ttEach(this,function(t){t.disable()}),this},isActive:function isActive(){var active;return ttEach(this.first(),function(t){active=t.isActive()}),active},activate:function activate(){return ttEach(this,function(t){t.activate()}),this},deactivate:function deactivate(){return ttEach(this,function(t){t.deactivate()}),this},isOpen:function isOpen(){var open;return ttEach(this.first(),function(t){open=t.isOpen()}),open},open:function open(){return ttEach(this,function(t){t.open()}),this},close:function close(){return ttEach(this,function(t){t.close()}),this},select:function select(el){var success=!1,$el=$(el);return ttEach(this.first(),function(t){success=t.select($el)}),success},autocomplete:function autocomplete(el){var success=!1,$el=$(el);return ttEach(this.first(),function(t){success=t.autocomplete($el)}),success},moveCursor:function moveCursoe(delta){var success=!1;return ttEach(this.first(),function(t){success=t.moveCursor(delta)}),success},val:function val(newVal){var query;
16return arguments.length?(ttEach(this,function(t){t.setVal(newVal)}),this):(ttEach(this.first(),function(t){query=t.getVal()}),query)},destroy:function destroy(){return ttEach(this,function(typeahead,$input){revert($input),typeahead.destroy()}),this}},$.fn.typeahead=function(method){return methods[method]?methods[method].apply(this,[].slice.call(arguments,1)):methods.initialize.apply(this,arguments)},$.fn.typeahead.noConflict=function noConflict(){return $.fn.typeahead=old,this}}()});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.