').addClass("crumb");if(n){var s=n.split("/");l().each(s,(function(t,n){if(""===(n=s.pop()))return!1;e.$dirTree.prepend(o.octemplate({dir:s.join("/")+"/"+n,name:n}))}))}o.octemplate({dir:"",name:""},{escapeFunction:null}).prependTo(this.$dirTree)},_handleTreeListSelect:function(t,e){var n=t.data,o=l()(t.target).closest(".crumb").data("dir");n._fillFilePicker(o);var s=t.target.closest(".oc-dialog"),a=l()(".primary",s);this._changeButtonsText(e,o.split(/[/]+/).pop()),-1!==this.$filePicker.data("mimetype").indexOf("httpd/unix-directory")||this.$filePicker.data("allowDirectoryChooser")?a.prop("disabled",!1):a.prop("disabled",!0)},_handlePickerClick:function(t,e,n){var o=this.$filePicker.closest(".oc-dialog").find(".primary");"file"===e.data("type")?(!0===this.$filePicker.data("multiselect")&&t.ctrlKey||this.$filelist.find(".filepicker_element_selected").removeClass("filepicker_element_selected"),e.toggleClass("filepicker_element_selected"),o.prop("disabled",!1)):"dir"===e.data("type")&&(this._fillFilePicker(this.$filePicker.data("path")+"/"+e.data("entryname")),this._changeButtonsText(n,e.data("entryname")),-1!==this.$filePicker.data("mimetype").indexOf("httpd/unix-directory")||this.$filePicker.data("allowDirectoryChooser")?o.prop("disabled",!1):o.prop("disabled",!0))},_changeButtonsText:function(e,n){var o=""===n?t("core","Copy"):t("core","Copy to {folder}",{folder:n}),s=""===n?t("core","Move"):t("core","Move to {folder}",{folder:n}),a=l()(".oc-dialog-buttonrow button");switch(e){case this.FILEPICKER_TYPE_CHOOSE:case this.FILEPICKER_TYPE_CUSTOM:break;case this.FILEPICKER_TYPE_COPY:a.text(o);break;case this.FILEPICKER_TYPE_MOVE:a.text(s);break;case this.FILEPICKER_TYPE_COPY_MOVE:a.eq(0).text(o),a.eq(1).text(s)}}},V=G,W=((t,e)=>{let n=t.getElementsByTagName("head")[0].getAttribute("data-requesttoken");return{getToken:()=>n,setToken:t=>{n=t,e("csrf-token-update",{token:n})}}})(document,r.emit),Z=W.getToken,J=(W.setToken,function(t,e){var n,o,s="";if(this.typelessListeners=[],this.closed=!1,this.listeners={},e)for(n in e)s+=n+"="+encodeURIComponent(e[n])+"&";if(s+="requesttoken="+encodeURIComponent(Z()),this.useFallBack||"undefined"==typeof EventSource){var a="oc_eventsource_iframe_"+J.iframeCount;J.fallBackSources[J.iframeCount]=this,this.iframe=l()(""),this.iframe.attr("id",a),this.iframe.hide(),o="&",-1===t.indexOf("?")&&(o="?"),this.iframe.attr("src",t+o+"fallback=true&fallback_id="+J.iframeCount+"&"+s),l()("body").append(this.iframe),this.useFallBack=!0,J.iframeCount++}else o="&",-1===t.indexOf("?")&&(o="?"),this.source=new EventSource(t+o+s),this.source.onmessage=function(t){for(var e=0;evoid 0!==window._oc_l10n_registry_translations[t]&&void 0!==window._oc_l10n_registry_plural_functions[t],ft=t=>({translations:window._oc_l10n_registry_translations[t]||{},pluralFunction:window._oc_l10n_registry_plural_functions[t]}),ht={load(t,e){if(pt(t)||"en"===Et.getLocale()){const t=l().Deferred(),n=t.promise();return n.then(e),t.resolve(),n}const n=this,o=(0,c.generateFilePath)(t,"l10n",Et.getLocale()+".json");return l().get(o).then((function(e){e.translations&&n.register(t,e.translations,e.pluralForm)})).then(e)},register(t,e){var n,o,s;n=t,o=e,s=this._getPlural,pt(n)?((t,e,n)=>{window._oc_l10n_registry_translations[t]=Object.assign(window._oc_l10n_registry_translations[t],e),window._oc_l10n_registry_plural_functions[t]=n})(n,o,s):((t,e,n)=>{window._oc_l10n_registry_translations[t]=e,window._oc_l10n_registry_plural_functions[t]=n})(n,o,s)},_unregister:t=>{delete window._oc_l10n_registry_translations[t],delete window._oc_l10n_registry_plural_functions[t]},translate(t,e,n,o,s){const a=s||{};p.default.defaults(a,{escape:!0,sanitize:!0});const r=a.sanitize?at().sanitize:ct(),i=a.escape?ut():ct();let l=e;const c=ft(t).translations[e];return void 0!==c&&(l=c),r("object"==typeof n||void 0!==o?function(t,e,n){return t.replace(/%n/g,n).replace(/{([^{}]*)}/g,(function(t,n){const o=e[n];return r("string"==typeof o||"number"==typeof o?i(o):t)}))}(l,n,o):l)},translatePlural(t,e,n,o,s,a){const r="_"+e+"_::_"+n+"_",i=ft(t),c=i.translations[r];if(void 0!==c){const e=c;if(l().isArray(e)){const n=i.pluralFunction(o);return this.translate(t,e[n],s,o,a)}}return 1===o?this.translate(t,e,s,o,a):this.translate(t,n,s,o,a)},_getPlural(t){let e=Et.getLanguage();if("pt-BR"===e&&(e="xbr"),void 0===e||""===e)return 1===t?0:1;switch(e.length>3&&(e=e.substring(0,e.lastIndexOf("-"))),e){case"az":case"bo":case"dz":case"id":case"ja":case"jv":case"ka":case"km":case"kn":case"ko":case"ms":case"th":case"tr":case"vi":case"zh":default:return 0;case"af":case"bn":case"bg":case"ca":case"da":case"de":case"el":case"en":case"eo":case"es":case"et":case"eu":case"fa":case"fi":case"fo":case"fur":case"fy":case"gl":case"gu":case"ha":case"he":case"hu":case"is":case"it":case"ku":case"lb":case"ml":case"mn":case"mr":case"nah":case"nb":case"ne":case"nl":case"nn":case"no":case"oc":case"om":case"or":case"pa":case"pap":case"ps":case"pt":case"so":case"sq":case"sv":case"sw":case"ta":case"te":case"tk":case"ur":case"zu":return 1===t?0:1;case"am":case"bh":case"fil":case"fr":case"gun":case"hi":case"hy":case"ln":case"mg":case"nso":case"xbr":case"ti":case"wa":return 0===t||1===t?0:1;case"be":case"bs":case"hr":case"ru":case"sh":case"sr":case"uk":return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"cs":case"sk":return 1===t?0:t>=2&&t<=4?1:2;case"ga":return 1===t?0:2===t?1:2;case"lt":return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2;case"sl":return t%100==1?0:t%100==2?1:t%100==3||t%100==4?2:3;case"mk":return t%10==1?0:1;case"mt":return 1===t?0:0===t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3;case"lv":return 0===t?0:t%10==1&&t%100!=11?1:2;case"pl":return 1===t?0:t%10>=2&&t%10<=4&&(t%100<12||t%100>14)?1:2;case"cy":return 1===t?0:2===t?1:8===t||11===t?2:3;case"ro":return 1===t?0:0===t||t%100>0&&t%100<20?1:2;case"ar":return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11&&t%100<=99?4:5}}},mt=ht;it().registerHelper("t",(function(t,e){return ht.translate(t,e)}));var gt=s(9944);const vt={startSaving(e){this.startAction(e,t("core","Saving …"))},startAction(t,e){l()(t).text(e).removeClass("success").removeClass("error").stop(!0,!0).show()},finishedSaving(t,e){this.finishedAction(t,e)},finishedAction(t,e){"success"===e.status?this.finishedSuccess(t,e.data.message):this.finishedError(t,e.data.message)},finishedSuccess(t,e){l()(t).text(e).addClass("success").removeClass("error").stop(!0,!0).delay(3e3).fadeOut(900).show()},finishedError(t,e){l()(t).text(e).addClass("error").removeClass("success").show()}};var wt=s(30381),yt=s.n(wt);const bt={callback:null,pageLoadTime:null,init(){l()(".password-confirm-required").on("click",p.default.bind(this.requirePasswordConfirmation,this)),this.pageLoadTime=yt().now()},requiresPasswordConfirmation(){const t=this.pageLoadTime-1e3*window.nc_pageLoad,e=yt().now()-(t+1e3*window.nc_lastLogin);return window.backendAllowsPasswordConfirmation&&e>18e5},requirePasswordConfirmation(e,n,o){n=void 0!==n?n:{};const s={title:t("core","Authentication required"),text:t("core","This action requires you to confirm your password"),confirm:t("core","Confirm"),label:t("core","Password"),error:""},a=p.default.extend(s,n),r=this;this.requiresPasswordConfirmation()&&Et.dialogs.prompt(a.text,a.title,(function(t,e){t&&""!==e?r._confirmPassword(e,a):p.default.isFunction(o)&&o()}),!0,a.label,!0).then((function(){const t=l()(".oc-dialog:visible");if(t.find(".ui-icon").remove(),t.addClass("password-confirmation"),""!==a.error){const e=l()("").addClass("msg warning").text(a.error);t.find(".oc-dialog-content").append(e)}t.find(".oc-dialog-buttonrow").addClass("aside");const e=t.find("button");e.eq(0).hide(),e.eq(1).text(a.confirm)})),this.callback=e},_confirmPassword(e,n){const o=this;l().ajax({url:(0,c.generateUrl)("/login/confirm"),data:{password:e},type:"POST",success(t){window.nc_lastLogin=t.lastLogin,p.default.isFunction(o.callback)&&o.callback()},error(){n.error=t("core","Failed to authenticate, try again"),Et.PasswordConfirmation.requirePasswordConfirmation(o.callback,n)}})}},_t={_plugins:{},register(t,e){let n=this._plugins[t];n||(n=this._plugins[t]=[]),n.push(e)},getPlugins(t){return this._plugins[t]||[]},attach(t,e,n){const o=this.getPlugins(t);for(let t=0;t-1&&parseInt(navigator.userAgent.split("/").pop())<51){const t=document.querySelectorAll('[fill^="url(#"], [stroke^="url(#"], [filter^="url(#invert"]');for(let e,n=0,o=t.length;n=0?t.substr(e+1):t.length?t.substr(1):""},_decodeQuery:t=>t.replace(/\+/g," "),parseUrlQuery(){const t=this._parseHashQuery();let e;return t&&(e=Et.parseQueryString(this._decodeQuery(t))),e=p.default.extend(e||{},Et.parseQueryString(this._decodeQuery(location.search))),e||{}},_onPopState(t){if(this._cancelPop)return void(this._cancelPop=!1);let e;if(this._handlers.length){e=t&&t.state,p.default.isString(e)?e=Et.parseQueryString(e):e||(e=this.parseUrlQuery()||{});for(let t=0;t="0"&&n<="9";r!==a&&(s++,e[s]="",a=r),e[s]+=n,o++}return e}const xt={History:Ct,humanFileSize:s(3378).s,computerFileSize(t){if("string"!=typeof t)return null;const e=t.toLowerCase().trim();let n=null;const o=e.match(/^[\s+]?([0-9]*)(\.([0-9]+))?( +)?([kmgtp]?b?)$/i);return null===o?null:(n=parseFloat(e),isFinite(n)?(o[5]&&(n*={b:1,k:1024,kb:1024,mb:1048576,m:1048576,gb:1073741824,g:1073741824,tb:1099511627776,t:1099511627776,pb:0x4000000000000,p:0x4000000000000}[o[5]]),n=Math.round(n),n):null)},formatDate:(t,e)=>(void 0===window.TESTING&&console.warn("OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment"),e=e||"LLL",yt()(t).format(e)),relativeModifiedDate(e){void 0===window.TESTING&&console.warn("OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment");const n=yt()().diff(yt()(e));return n>=0&&n<45e3?t("core","seconds ago"):yt()(e).fromNow()},getScrollBarWidth(){if(this._scrollBarWidth)return this._scrollBarWidth;const t=document.createElement("p");t.style.width="100%",t.style.height="200px";const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);const n=t.offsetWidth;e.style.overflow="scroll";let o=t.offsetWidth;return n===o&&(o=e.clientWidth),document.body.removeChild(e),this._scrollBarWidth=n-o,this._scrollBarWidth},stripTime:t=>new Date(t.getFullYear(),t.getMonth(),t.getDate()),naturalSortCompare(t,e){let n;const o=kt(t),s=kt(e);for(n=0;o[n]&&s[n];n++)if(o[n]!==s[n]){const t=Number(o[n]),e=Number(s[n]);return t==o[n]&&e==s[n]?t-e:o[n].localeCompare(s[n],Et.getLanguage())}return o.length-s.length},waitFor(t,e){const n=function(){!0!==t()&&setTimeout(n,e)};n()},isCookieSetToValue(t,e){const n=document.cookie.split(";");for(let o=0;o!$_",fileIsBlacklisted:t=>!!t.match(I.blacklist_files_regex),addScript:(t,e,n)=>{let o;console.warn("OC.addScript is deprecated, use OCP.Loader.loadScript instead");const s=(0,c.generateFilePath)(t,"js",e+".js");return d[s]?n&&n():(o=l().Deferred(),l().getScript(s,(()=>o.resolve())),d[s]=o),d[s]},addStyle:(t,e)=>{console.warn("OC.addStyle is deprecated, use OCP.Loader.loadStylesheet instead");const n=(0,c.generateFilePath)(t,"css",e+".css");-1===u.indexOf(n)&&(u.push(n),document.createStyleSheet?document.createStyleSheet(n):(e=l()(''),l()("head").append(e)))},Apps:v,AppConfig:_,appConfig:b,appSettings:e=>{if(console.warn("OC.appSettings is deprecated and will be removed with Nextcloud 18"),void 0===e||void 0===e.appid)throw{name:"MissingParameter",message:"The parameter appid is missing"};var n={scriptName:"settings.php",cache:!0};l().extend(n,e);var o=l()("#appsettings");if(0===o.length)throw{name:"MissingDOMElement",message:'There has be be an element with id "appsettings" for the popup to show.'};var s=l()("#appsettings_popup");if(0===s.length&&(l()("body").prepend(''),(s=l()("#appsettings_popup")).addClass(o.hasClass("topright")?"topright":"bottomleft")),s.is(":visible"))s.hide().remove();else{const e=o.hasClass("topright")?"up":"left";l().get((0,c.generateFilePath)(n.appid,"",n.scriptName),(function(o){s.html(o).ready((function(){if(s.prepend('
'+t("core","Settings")+'
').show(),s.find(".close").bind("click",(function(){s.remove()})),void 0!==n.loadJS){var o;if(!0===n.loadJS)o="settings.js";else{if("string"!=typeof n.loadJS)throw{name:"InvalidParameter",message:'The "loadJS" parameter must be either boolean or a string.'};o=n.loadJS}n.cache&&l().ajaxSetup({cache:!0}),l().getScript((0,c.generateFilePath)(n.appid,"js",o)).fail((function(t,e,n){throw n}))}})).show()}),"html")}},appswebroots:P,Backbone:j,ContactsMenu:B,config:I,currentUser:Y,dialogs:V,EventSource:Q,getCurrentUser:()=>({uid:Y,displayName:H}),isUserAdmin:()=>ot,L10N:mt,_ajaxConnectionLostHandler:m,_processAjaxError:t=>{(0!==t.status||"abort"!==t.statusText&&"timeout"!==t.statusText&&!Et._reloadCalled)&&(p.default.contains([302,303,307,401],t.status)&&Et.currentUser?setTimeout((function(){if(!Et._userIsNavigatingAway&&!Et._reloadCalled){let t=0;const e=5,o=setInterval((function(){h.showUpdate(n("core","Problem loading page, reloading in %n second","Problem loading page, reloading in %n seconds",e-t)),t>=e&&(clearInterval(o),Et.reload()),t++}),1e3);Et._reloadCalled=!0}}),100):0===t.status&&setTimeout((function(){Et._userIsNavigatingAway||Et._reloadCalled||Et._ajaxConnectionLostHandler()}),100))},registerXHRForErrorProcessing:t=>{t.addEventListener&&(t.addEventListener("load",(()=>{4===t.readyState&&(t.status>=200&&t.status<300||304===t.status||l()(document).trigger(new(l().Event)("ajaxError"),t))})),t.addEventListener("error",(()=>{l()(document).trigger(new(l().Event)("ajaxError"),t)})))},getCapabilities:()=>(console.warn("OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities"),(0,X.getCapabilities)()),hideMenus:nt,registerMenu:function(t,e,n,o){e.addClass("menu");const s="A"===t.prop("tagName")||"BUTTON"===t.prop("tagName");t.on(s?"click.menu":"click.menu keyup.menu",(function(s){s.preventDefault(),s.key&&"Enter"!==s.key||(e.is(tt)?nt():(tt&&nt(),!0===o&&e.parent().addClass("openedMenu"),t.attr("aria-expanded",!0),e.slideToggle(50,n),tt=e,et=t))}))},showMenu:(t,e,n)=>{e.is(tt)||(nt(),tt=e,et=t,e.trigger(new(l().Event)("beforeShow")),e.show(),e.trigger(new(l().Event)("afterShow")),p.default.isFunction(n)&&n())},unregisterMenu:(t,e)=>{e.is(tt)&&nt(),t.off("click.menu").removeClass("menutoggle"),e.removeClass("menu")},basename:U.EZ,encodePath:U.Ec,dirname:U.XX,isSamePath:U.Mg,joinPaths:U.RQ,getHost:()=>window.location.host,getHostName:()=>window.location.hostname,getPort:()=>window.location.port,getProtocol:()=>window.location.protocol.split(":")[0],getCanonicalLocale:gt.getCanonicalLocale,getLocale:()=>{var t;return null!==(t=l()("html").data("locale"))&&void 0!==t?t:"en"},getLanguage:()=>l()("html").prop("lang"),addTranslations:mt.load,buildQueryString:t=>t?l().map(t,(function(t,e){let n=encodeURIComponent(e);return null!=t&&(n+="="+encodeURIComponent(t)),n})).join("&"):"",parseQueryString:t=>{let e,n;const o={};let s;if(!t)return null;e=t.indexOf("?"),e>=0&&(t=t.substr(e+1));const a=t.replace(/\+/g,"%20").split("&");for(let t=0;t=0?[r.substr(0,e),r.substr(e+1)]:[r],n.length&&(s=decodeURIComponent(n[0]),s&&(o[s]=n.length>1?decodeURIComponent(n[1]):null))}return o},msg:vt,Notification:h,PasswordConfirmation:bt,Plugins:_t,theme:Pt,Util:xt,debug:Tt,filePath:c.generateFilePath,generateUrl:c.generateUrl,get:(Lt=window,t=>{const e=t.split("."),n=e.pop();for(let t=0;t(e,n)=>{const o=e.split("."),s=o.pop();for(let e=0;e{window.location=t},reload:()=>{window.location.reload()},requestToken:Z(),linkTo:c.linkTo,linkToOCS:(t,e)=>(0,c.generateOcsUrl)(t,{},{ocsVersion:e||1})+"/",linkToRemote:c.generateRemoteUrl,linkToRemoteBase:t=>(0,c.getRootUrl)()+"/remote.php/"+t,webroot:Ot};var Lt;(0,r.subscribe)("csrf-token-update",(t=>{OC.requestToken=t.token,console.info("OC.requestToken changed",t.token)}));var St=s(16453),jt=s(17563),Ut=s(55586),It=s.n(Ut);const Ft={name:"LoginButton",props:{loading:{type:Boolean,required:!0},invertedColors:{type:Boolean,default:!1}}};var Rt=s(51900);const $t=(0,Rt.Z)(Ft,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"submit-wrapper"},on:{click:function(e){return t.$emit("click")}}},[n("input",{staticClass:"login primary",attrs:{id:"submit-form",type:"submit",title:""},domProps:{value:t.loading?t.t("core","Logging in …"):t.t("core","Log in")}}),t._v(" "),n("div",{staticClass:"submit-icon",class:{"icon-confirm-white":!t.loading,"icon-loading-small":t.loading&&t.invertedColors,"icon-loading-small-dark":t.loading&&!t.invertedColors}})])}),[],!1,null,"125b100b",null).exports,Nt={name:"LoginForm",components:{LoginButton:$t},props:{username:{type:String,default:""},redirectUrl:{type:[String,Boolean],default:!1},errors:{type:Array,default:()=>[]},messages:{type:Array,default:()=>[]},throttleDelay:{type:Number,default:0},invertedColors:{type:Boolean,default:!1},autoCompleteAllowed:{type:Boolean,default:!0},directLogin:{type:Boolean,default:!1}},data(){return{loading:!1,timezone:It().determine().name(),timezoneOffset:-(new Date).getTimezoneOffset()/60,user:this.username,password:"",passwordInputType:"password"}},computed:{apacheAuthFailed(){return-1!==this.errors.indexOf("apacheAuthFailed")},internalException(){return-1!==this.errors.indexOf("internalexception")},invalidPassword(){return-1!==this.errors.indexOf("invalidpassword")},userDisabled(){return-1!==this.errors.indexOf("userdisabled")},toggleIcon:()=>(0,c.imagePath)("core","actions/toggle.svg"),loadingIcon:()=>(0,c.imagePath)("core","loading-dark.gif"),loginActionUrl:()=>(0,c.generateUrl)("login")},mounted(){""===this.username?this.$refs.user.focus():this.$refs.password.focus()},methods:{togglePassword(){"password"===this.passwordInputType?this.passwordInputType="text":this.passwordInputType="password"},updateUsername(){this.$emit("update:username",this.user)},submit(){this.loading=!0,this.$emit("submit")}}},Mt=(0,Rt.Z)(Nt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{ref:"loginForm",attrs:{method:"post",name:"login",action:t.loginActionUrl},on:{submit:t.submit}},[n("fieldset",[t.apacheAuthFailed?n("div",{staticClass:"warning"},[t._v("\n\t\t\t"+t._s(t.t("core","Server side authentication failed!"))),n("br"),t._v(" "),n("small",[t._v(t._s(t.t("core","Please contact your administrator."))+"\n\t\t\t")])]):t._e(),t._v(" "),t._l(t.messages,(function(e,o){return n("div",{key:o,staticClass:"warning"},[t._v("\n\t\t\t"+t._s(e)),n("br")])})),t._v(" "),t.internalException?n("div",{staticClass:"warning"},[t._v("\n\t\t\t"+t._s(t.t("core","An internal error occurred."))),n("br"),t._v(" "),n("small",[t._v(t._s(t.t("core","Please try again or contact your administrator."))+"\n\t\t\t")])]):t._e(),t._v(" "),n("div",{staticClass:"hidden",attrs:{id:"message"}},[n("img",{staticClass:"float-spinner",attrs:{alt:"",src:t.loadingIcon}}),t._v(" "),n("span",{attrs:{id:"messageText"}}),t._v(" "),n("div",{staticStyle:{clear:"both"}})]),t._v(" "),n("p",{staticClass:"grouptop",class:{shake:t.invalidPassword}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.user,expression:"user"}],ref:"user",attrs:{id:"user",type:"text",name:"user",autocapitalize:"none",autocorrect:"off",autocomplete:t.autoCompleteAllowed?"on":"off",placeholder:t.t("core","Username or email"),"aria-label":t.t("core","Username or email"),required:""},domProps:{value:t.user},on:{change:t.updateUsername,input:function(e){e.target.composing||(t.user=e.target.value)}}}),t._v(" "),n("label",{staticClass:"infield",attrs:{for:"user"}},[t._v(t._s(t.t("core","Username or email")))])]),t._v(" "),n("p",{staticClass:"groupbottom",class:{shake:t.invalidPassword}},[n("input",{ref:"password",staticClass:"password-with-toggle",attrs:{id:"password",type:t.passwordInputType,name:"password",autocorrect:"off",autocapitalize:"none",autocomplete:t.autoCompleteAllowed?"current-password":"off",placeholder:t.t("core","Password"),"aria-label":t.t("core","Password"),required:""}}),t._v(" "),n("label",{staticClass:"infield",attrs:{for:"password"}},[t._v(t._s(t.t("Password")))]),t._v(" "),n("a",{staticClass:"toggle-password",attrs:{href:"#"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.togglePassword.apply(null,arguments)}}},[n("img",{attrs:{src:t.toggleIcon,alt:t.t("core","Toggle password visibility")}})])]),t._v(" "),n("LoginButton",{attrs:{loading:t.loading,"inverted-colors":t.invertedColors}}),t._v(" "),t.invalidPassword?n("p",{staticClass:"warning wrongPasswordMsg"},[t._v("\n\t\t\t"+t._s(t.t("core","Wrong username or password."))+"\n\t\t")]):t.userDisabled?n("p",{staticClass:"warning userDisabledMsg"},[t._v("\n\t\t\t"+t._s(t.t("core","User disabled"))+"\n\t\t")]):t._e(),t._v(" "),t.throttleDelay&&t.throttleDelay>5e3?n("p",{staticClass:"warning throttledMsg"},[t._v("\n\t\t\t"+t._s(t.t("core","We have detected multiple invalid login attempts from your IP. Therefore your next login is throttled up to 30 seconds."))+"\n\t\t")]):t._e(),t._v(" "),t.redirectUrl?n("input",{attrs:{type:"hidden",name:"redirect_url"},domProps:{value:t.redirectUrl}}):t._e(),t._v(" "),n("input",{attrs:{type:"hidden",name:"timezone"},domProps:{value:t.timezone}}),t._v(" "),n("input",{attrs:{type:"hidden",name:"timezone_offset"},domProps:{value:t.timezoneOffset}}),t._v(" "),n("input",{attrs:{type:"hidden",name:"requesttoken"},domProps:{value:t.OC.requestToken}}),t._v(" "),t.directLogin?n("input",{attrs:{type:"hidden",name:"direct",value:"1"}}):t._e()],2)])}),[],!1,null,"0b3a0522",null).exports;var zt=s(4820),Dt=s(13053),Bt=s(63024);class qt extends Error{}const Ht={name:"PasswordLessLoginForm",components:{LoginButton:$t,InformationIcon:Dt.Z,LockOpenIcon:Bt.Z},props:{username:{type:String,default:""},redirectUrl:{type:[String,Boolean],default:!1},invertedColors:{type:Boolean,default:!1},autoCompleteAllowed:{type:Boolean,default:!0},isHttps:{type:Boolean,default:!1},isLocalhost:{type:Boolean,default:!1},hasPublicKeyCredential:{type:Boolean,default:!1}},data(){return{user:this.username,loading:!1,validCredentials:!0}},methods:{authenticate(){console.debug("passwordless login initiated"),this.getAuthenticationData(this.user).then((t=>(console.debug(t),t))).then(this.sign).then(this.completeAuthentication).catch((t=>{t instanceof qt?this.validCredentials=!1:console.debug(t)}))},getAuthenticationData(t){const e=function(t){const e=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=new Array(5-e).join("=")}return window.atob(t)};return function(t){const e=(0,c.generateUrl)("/login/webauthn/start");return zt.default.post(e,{loginName:t}).then((t=>t.data))}(t).then((t=>{if(console.debug("Obtained PublicKeyCredentialRequestOptions"),console.debug(t),!Object.prototype.hasOwnProperty.call(t,"allowCredentials"))throw console.debug("No credentials found."),new qt;return t.challenge=Uint8Array.from(e(t.challenge),(t=>t.charCodeAt(0))),t.allowCredentials=t.allowCredentials.map((function(t){return{...t,id:Uint8Array.from(e(t.id),(t=>t.charCodeAt(0)))}})),console.debug("Converted PublicKeyCredentialRequestOptions"),console.debug(t),t})).catch((t=>{throw console.debug("Error while obtaining data"),t}))},sign(t){const e=function(t){return window.btoa(String.fromCharCode(...t))};return navigator.credentials.get({publicKey:t}).then((t=>{return console.debug(t),console.debug(new Uint8Array(t.rawId)),console.debug(e(new Uint8Array(t.rawId))),{id:t.id,type:t.type,rawId:e(new Uint8Array(t.rawId)),response:{authenticatorData:e(new Uint8Array(t.response.authenticatorData)),clientDataJSON:e(new Uint8Array(t.response.clientDataJSON)),signature:e(new Uint8Array(t.response.signature)),userHandle:t.response.userHandle?(n=new Uint8Array(t.response.userHandle),String.fromCharCode(...n)):null}};var n})).then((t=>(console.debug(t),t))).catch((t=>{console.debug("GOT AN ERROR!"),console.debug(t)}))},completeAuthentication(t){console.debug("TIME TO COMPLETE");const e=this.redirectUrl;return function(t){const e=(0,c.generateUrl)("/login/webauthn/finish");return zt.default.post(e,{data:t}).then((t=>t.data))}(JSON.stringify(t)).then((t=>{console.debug("Logged in redirecting"),window.location.href=e})).catch((t=>{console.debug("GOT AN ERROR WHILE SUBMITTING CHALLENGE!"),console.debug(t)}))},submit(){}}};var Yt=s(93379),Kt=s.n(Yt),Gt=s(27429);Kt()(Gt.Z,{insert:"head",singleton:!1}),Gt.Z.locals;const Vt=(0,Rt.Z)(Ht,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return(t.isHttps||t.isLocalhost)&&t.hasPublicKeyCredential?n("form",{ref:"loginForm",attrs:{method:"post",name:"login"},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[n("fieldset",[n("p",{staticClass:"grouptop groupbottom"},[n("label",{staticClass:"infield",attrs:{for:"user"}},[t._v(t._s(t.t("core","Username or\temail")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.user,expression:"user"}],ref:"user",attrs:{id:"user",type:"text",name:"user",autocomplete:t.autoCompleteAllowed?"on":"off",placeholder:t.t("core","Username or email"),"aria-label":t.t("core","Username or email"),required:""},domProps:{value:t.user},on:{change:function(e){return t.$emit("update:username",t.user)},input:function(e){e.target.composing||(t.user=e.target.value)}}})]),t._v(" "),t.validCredentials?t._e():n("div",{staticClass:"body-login-container update form__message-box"},[t._v("\n\t\t\t"+t._s(t.t("core","Your account is not setup for passwordless login."))+"\n\t\t")]),t._v(" "),t.validCredentials?n("LoginButton",{attrs:{loading:t.loading,"inverted-colors":t.invertedColors},on:{click:t.authenticate}}):t._e()],1)]):t.hasPublicKeyCredential?t.isHttps||t.isLocalhost?t._e():n("div",{staticClass:"body-login-container update"},[n("LockOpenIcon",{attrs:{size:"70"}}),t._v(" "),n("h2",[t._v(t._s(t.t("core","Your connection is not secure")))]),t._v(" "),n("p",{staticClass:"infogroup"},[t._v("\n\t\t"+t._s(t.t("core","Passwordless authentication is only available over a secure connection."))+"\n\t")])],1):n("div",{staticClass:"body-login-container update"},[n("InformationIcon",{attrs:{size:"70"}}),t._v(" "),n("h2",[t._v(t._s(t.t("core","Browser not supported")))]),t._v(" "),n("p",{staticClass:"infogroup"},[t._v("\n\t\t"+t._s(t.t("core","Passwordless authentication is not supported in your browser."))+"\n\t")])],1)}),[],!1,null,"4f29a6e2",null).exports,Wt={name:"ResetPassword",props:{username:{type:String,required:!0},resetPasswordLink:{type:String,required:!0},invertedColors:{type:Boolean,default:!1}},data(){return{error:!1,loading:!1,message:void 0,user:this.username}},watch:{username(t){this.user=t}},methods:{updateUsername(){this.$emit("update:username",this.user)},submit(){this.loading=!0,this.error=!1,this.message="";const t=(0,c.generateUrl)("/lostpassword/email"),e={user:this.user};return zt.default.post(t,e).then((t=>t.data)).then((t=>{if("success"!==t.status)throw new Error("got status ".concat(t.status));this.message="send-success"})).catch((t=>{console.error("could not send reset email request",t),this.error=!0,this.message="send-error"})).then((()=>{this.loading=!1}))}}};var Zt=s(44685);Kt()(Zt.Z,{insert:"head",singleton:!1}),Zt.Z.locals;const Jt=(0,Rt.Z)(Wt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[n("fieldset",[n("p",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.user,expression:"user"}],attrs:{id:"user",type:"text",name:"user",autocapitalize:"off",placeholder:t.t("core","Username or email"),"aria-label":t.t("core","Username or email"),required:""},domProps:{value:t.user},on:{change:t.updateUsername,input:function(e){e.target.composing||(t.user=e.target.value)}}}),t._v(" "),n("label",{staticClass:"infield",attrs:{for:"user"}},[t._v(t._s(t.t("core","Username or email")))])]),t._v(" "),n("div",{attrs:{id:"reset-password-wrapper"}},[n("input",{staticClass:"login primary",attrs:{id:"reset-password-submit",type:"submit",title:""},domProps:{value:t.t("core","Reset password")}}),t._v(" "),n("div",{staticClass:"submit-icon",class:{"icon-confirm-white":!t.loading,"icon-loading-small":t.loading&&t.invertedColors,"icon-loading-small-dark":t.loading&&!t.invertedColors}})]),t._v(" "),"send-success"===t.message?n("p",{staticClass:"update"},[t._v("\n\t\t\t"+t._s(t.t("core","A password reset message has been sent to the email address of this account. If you do not receive it, check your spam/junk folders or ask your local administrator for help."))+"\n\t\t\t"),n("br"),t._v("\n\t\t\t"+t._s(t.t("core","If it is not there ask your local administrator."))+"\n\t\t")]):"send-error"===t.message?n("p",{staticClass:"update warning"},[t._v("\n\t\t\t"+t._s(t.t("core","Couldn't send reset email. Please contact your administrator."))+"\n\t\t")]):"reset-error"===t.message?n("p",{staticClass:"update warning"},[t._v("\n\t\t\t"+t._s(t.t("core","Password cannot be changed. Please contact your administrator."))+"\n\t\t")]):t.message?n("p",{staticClass:"update",class:{warning:t.error}}):t._e(),t._v(" "),n("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.$emit("abort")}}},[t._v("\n\t\t\t"+t._s(t.t("core","Back to login"))+"\n\t\t")])])])}),[],!1,null,"d9d670b8",null).exports,Qt={name:"UpdatePassword",props:{username:{type:String,required:!0},resetPasswordTarget:{type:String,required:!0},invertedColors:{type:Boolean,default:!1}},data(){return{error:!1,loading:!1,message:void 0,user:this.username,password:"",encrypted:!1,proceed:!1}},watch:{username(t){this.user=t}},methods:{async submit(){this.loading=!0,this.error=!1,this.message="";try{const{data:t}=await zt.default.post(this.resetPasswordTarget,{password:this.password,proceed:this.proceed});if(t&&"success"===t.status)this.message="send-success",this.$emit("update:username",this.user),this.$emit("done");else{if(!t||!t.encryption)throw t&&t.msg?new Error(t.msg):new Error;this.encrypted=!0}}catch(e){this.error=!0,this.message=e.message?e.message:t("core","Password cannot be changed. Please contact your administrator.")}finally{this.loading=!1}}}};var Xt=s(91123);Kt()(Xt.Z,{insert:"head",singleton:!1}),Xt.Z.locals;const te=(0,Rt.Z)(Qt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[n("fieldset",[n("p",[n("label",{staticClass:"infield",attrs:{for:"password"}},[t._v(t._s(t.t("core","New password")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.password,expression:"password"}],attrs:{id:"password",type:"password",name:"password",autocomplete:"new-password",autocapitalize:"none",autocorrect:"off",required:"",placeholder:t.t("core","New password")},domProps:{value:t.password},on:{input:function(e){e.target.composing||(t.password=e.target.value)}}})]),t._v(" "),t.encrypted?n("div",{staticClass:"update"},[n("p",[t._v("\n\t\t\t\t"+t._s(t.t("core","Your files are encrypted. There will be no way to get your data back after your password is reset. If you are not sure what to do, please contact your administrator before you continue. Do you really want to continue?"))+"\n\t\t\t")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.proceed,expression:"proceed"}],staticClass:"checkbox",attrs:{id:"encrypted-continue",type:"checkbox"},domProps:{checked:Array.isArray(t.proceed)?t._i(t.proceed,null)>-1:t.proceed},on:{change:function(e){var n=t.proceed,o=e.target,s=!!o.checked;if(Array.isArray(n)){var a=t._i(n,null);o.checked?a<0&&(t.proceed=n.concat([null])):a>-1&&(t.proceed=n.slice(0,a).concat(n.slice(a+1)))}else t.proceed=s}}}),t._v(" "),n("label",{attrs:{for:"encrypted-continue"}},[t._v("\n\t\t\t\t"+t._s(t.t("core","I know what I'm doing"))+"\n\t\t\t")])]):t._e(),t._v(" "),n("div",{attrs:{id:"submit-wrapper"}},[n("input",{staticClass:"login primary",attrs:{id:"submit",type:"submit",title:""},domProps:{value:t.loading?t.t("core","Resetting password"):t.t("core","Reset password")}}),t._v(" "),n("div",{staticClass:"submit-icon",class:{"icon-loading-small":t.loading&&t.invertedColors,"icon-loading-small-dark":t.loading&&!t.invertedColors}})]),t._v(" "),t.error&&t.message?n("p",{class:{warning:t.error}},[t._v("\n\t\t\t"+t._s(t.message)+"\n\t\t")]):t._e()])])}),[],!1,null,"9ae5fdb4",null).exports,ee=jt.parse(location.search);if("1"===ee.clear)try{window.localStorage.clear(),window.sessionStorage.clear(),console.debug("Browser storage cleared")}catch(t){console.error("Could not clear browser storage",t)}const ne={name:"Login",components:{LoginForm:Mt,PasswordLessLoginForm:Vt,ResetPassword:Jt,UpdatePassword:te},data(){return{loading:!1,user:this.username,passwordlessLogin:!1,resetPassword:!1,errors:(0,St.loadState)("core","loginErrors",[]),messages:(0,St.loadState)("core","loginMessages",[]),redirectUrl:(0,St.loadState)("core","loginRedirectUrl",!1),username:(0,St.loadState)("core","loginUsername",""),throttleDelay:(0,St.loadState)("core","loginThrottleDelay",0),invertedColors:OCA.Theming&&OCA.Theming.inverted,canResetPassword:(0,St.loadState)("core","loginCanResetPassword",!1),resetPasswordLink:(0,St.loadState)("core","loginResetPasswordLink",""),autoCompleteAllowed:(0,St.loadState)("core","loginAutocomplete",!0),resetPasswordTarget:(0,St.loadState)("core","resetPasswordTarget",""),resetPasswordUser:(0,St.loadState)("core","resetPasswordUser",""),directLogin:"1"===ee.direct,hasPasswordless:(0,St.loadState)("core","webauthn-available",!1),countAlternativeLogins:(0,St.loadState)("core","countAlternativeLogins",!1),isHttps:"https:"===window.location.protocol,isLocalhost:"localhost"===window.location.hostname,hasPublicKeyCredential:void 0!==window.PublicKeyCredential,hideLoginForm:(0,St.loadState)("core","hideLoginForm",!1)}},methods:{passwordResetFinished(){this.resetPasswordTarget="",this.directLogin=!0}}};var oe=s(35162);Kt()(oe.Z,{insert:"head",singleton:!1}),oe.Z.locals;const se=(0,Rt.Z)(ne,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return!t.hideLoginForm||t.directLogin?n("div",[n("transition",{attrs:{name:"fade",mode:"out-in"}},[t.passwordlessLogin||t.resetPassword||""!==t.resetPasswordTarget?!t.loading&&t.passwordlessLogin?n("div",{key:"reset",staticClass:"login-additional"},[n("PasswordLessLoginForm",{attrs:{username:t.user,"redirect-url":t.redirectUrl,"inverted-colors":t.invertedColors,"auto-complete-allowed":t.autoCompleteAllowed,"is-https":t.isHttps,"is-localhost":t.isLocalhost,"has-public-key-credential":t.hasPublicKeyCredential},on:{"update:username":function(e){t.user=e},submit:function(e){t.loading=!0}}}),t._v(" "),n("a",{attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.passwordlessLogin=!1}}},[t._v("\n\t\t\t\t"+t._s(t.t("core","Back"))+"\n\t\t\t")])],1):!t.loading&&t.canResetPassword?n("div",{key:"reset",staticClass:"login-additional"},[n("div",{staticClass:"lost-password-container"},[t.resetPassword?n("ResetPassword",{attrs:{username:t.user,"reset-password-link":t.resetPasswordLink,"inverted-colors":t.invertedColors},on:{"update:username":function(e){t.user=e},abort:function(e){t.resetPassword=!1}}}):t._e()],1)]):""!==t.resetPasswordTarget?n("div",[n("UpdatePassword",{attrs:{username:t.user,"reset-password-target":t.resetPasswordTarget,"inverted-colors":t.invertedColors},on:{"update:username":function(e){t.user=e},done:t.passwordResetFinished}})],1):t._e():n("div",{key:"login"},[n("LoginForm",{attrs:{username:t.user,"redirect-url":t.redirectUrl,"direct-login":t.directLogin,messages:t.messages,errors:t.errors,"throttle-delay":t.throttleDelay,"inverted-colors":t.invertedColors,"auto-complete-allowed":t.autoCompleteAllowed},on:{"update:username":function(e){t.user=e},submit:function(e){t.loading=!0}}}),t._v(" "),t.canResetPassword&&""!==t.resetPasswordLink?n("a",{attrs:{id:"lost-password",href:t.resetPasswordLink}},[t._v("\n\t\t\t\t"+t._s(t.t("core","Forgot password?"))+"\n\t\t\t")]):t.canResetPassword&&!t.resetPassword?n("a",{attrs:{id:"lost-password",href:t.resetPasswordLink},on:{click:function(e){e.preventDefault(),t.resetPassword=!0}}},[t._v("\n\t\t\t\t"+t._s(t.t("core","Forgot password?"))+"\n\t\t\t")]):t._e(),t._v(" "),n("br"),t._v(" "),t.hasPasswordless?[t.countAlternativeLogins?n("div",{staticClass:"alternative-logins"},[t.hasPasswordless?n("a",{staticClass:"button",class:{"single-alt-login-option":t.countAlternativeLogins},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.passwordlessLogin=!0}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("core","Log in with a device"))+"\n\t\t\t\t\t")]):t._e()]):n("a",{attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.passwordlessLogin=!0}}},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","Log in with a device"))+"\n\t\t\t\t")])]:t._e()],2)])],1):n("div",[n("transition",{attrs:{name:"fade",mode:"out-in"}},[n("div",{staticClass:"warning"},[t._v("\n\t\t\t"+t._s(t.t("core","Login form is disabled."))),n("br"),t._v(" "),n("small",[t._v(t._s(t.t("core","Please contact your administrator."))+"\n\t\t\t")])])])],1)}),[],!1,null,null,null).exports,ae={data:()=>({OC:Et}),methods:{t:mt.translate.bind(mt),n:mt.translatePlural.bind(mt)}};a.default.mixin(ae),(new(a.default.extend(se))).$mount("#login")},27429:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var o=n(94015),s=n.n(o),a=n(23645),r=n.n(a)()(s());r.push([t.id,".body-login-container.update[data-v-4f29a6e2]{margin:15px 0}.body-login-container.update.form__message-box[data-v-4f29a6e2]{width:240px;margin:5px}","",{version:3,sources:["webpack://./core/src/components/login/PasswordLessLoginForm.vue"],names:[],mappings:"AAmOA,8CACC,aAAA,CAEA,gEACC,WAAA,CACA,UAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.body-login-container.update {\n\tmargin: 15px 0;\n\n\t&.form__message-box {\n\t\twidth: 240px;\n\t\tmargin: 5px;\n\t}\n}\n"],sourceRoot:""}]);const i=r},44685:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var o=n(94015),s=n.n(o),a=n(23645),r=n.n(a)()(s());r.push([t.id,"\n.update[data-v-d9d670b8] {\n\twidth: auto;\n}\n","",{version:3,sources:["webpack://./core/src/components/login/ResetPassword.vue"],names:[],mappings:";AAmJA;CACA,WAAA;AACA",sourcesContent:["\x3c!--\n - @copyright 2019 Christoph Wurst \n -\n - @author 2019 Christoph Wurst \n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see .\n --\x3e\n\n\n\t\n\n\n