PageSourceSearch

https://statics.3cat.cat/js/htmltwig/login/htmltwig.login.ccma-sx3.min.js?v=7.2609.6

js 3cat.cat collected 2026-10-01 10:34:48 UTC 14,545 bytes, 2 lines download raw bytes

1!function(r){var o={};function n(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}n.m=r,n.c=o,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="https://statics.3cat.cat/js/htmltwig/login/",n(n.s=0)}([function(t,e){function C(t){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */R=function(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i,a,c,s,n=e&&e.prototype instanceof f?e:f,u=Object.create(n.prototype),l=new k(o||[]);return u._invoke=(i=t,a=r,c=l,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return $()}for(c.method=t,c.arg=e;;){var r=c.delegate;if(r){var o=L(r,c);if(o){if(o===h)continue;return o}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===s)throw s="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);s="executing";var n=g(i,a,c);if("normal"===n.type){if(s=c.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(s="completed",c.method="throw",c.arg=n.arg)}}),u}function g(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h={};function f(){}function s(){}function u(){}var d={};i(d,n,function(){return this});var p=Object.getPrototypeOf,m=p&&p(p(x([])));m&&m!==t&&l.call(m,n)&&(d=m);var y=u.prototype=f.prototype=Object.create(d);function v(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function w(s,u){var e;this._invoke=function(r,o){function t(){return new u(function(t,e){!function e(t,r,o,n){var i=g(s[t],s,r);if("throw"!==i.type){var a=i.arg,c=a.value;return c&&"object"==C(c)&&l.call(c,"__await")?u.resolve(c.__await).then(function(t){e("next",t,o,n)},function(t){e("throw",t,o,n)}):u.resolve(c).then(function(t){a.value=t,o(a)},function(t){return e("throw",t,o,n)})}n(i.arg)}(r,o,t,e)})}return e=e?e.then(t,t):t()}}function L(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=g(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var n=o.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function U(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(e){if(e){var t=e[n];if(t)return t.call(e);
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(l.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:$}}function $(){return{value:void 0,done:!0}}return i(y,"constructor",s.prototype=u),i(u,"constructor",s),s.displayName=i(u,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===s||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,i(t,o,"GeneratorFunction")),t.prototype=Object.create(y),t},a.awrap=function(t){return{__await:t}},v(w.prototype),i(w.prototype,r,function(){return this}),a.AsyncIterator=w,a.async=function(t,e,r,o,n){void 0===n&&(n=Promise);var i=new w(c(t,e,r,o),n);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},v(y),i(y,o,"Generator"),i(y,n,function(){return this}),i(y,"toString",function(){return"[object Generator]"}),a.keys=function(r){var o=[];for(var t in r)o.push(t);return o.reverse(),function t(){for(;o.length;){var e=o.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=x,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(U),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var o=this;function t(t,e){return i.type="throw",i.arg=r,o.next=t,e&&(o.method="next",o.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e],i=n.completion;if("root"===n.tryLoc)return t("end");if(n.tryLoc<=this.prev){var a=l.call(n,"catchLoc"),c=l.call(n,"finallyLoc");if(a&&c){if(this.prev<n.catchLoc)return t(n.catchLoc,!0);if(this.prev<n.finallyLoc)return t(n.finallyLoc)}else if(a){if(this.prev<n.catchLoc)return t(n.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return t(n.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var i=n?n.completion:{};return i.type=t,i.arg=e,n?(this.method="next",this.next=n.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),U(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var n=o.arg;U(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},a}function s(t,e,r,o,n,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(o,n)}!function(t,e){"use strict";e.Moduls=e.Moduls||{};var c,r,o=!1;function n(t){return decodeURIComponent(Array.prototype.map.call(atob(t),function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))}e.Moduls.login={type:"ccma",getUser:function(){var t=$("body").data("modul").ccmalogin;return t&&t.checkUserFromCookie(),o},getUserAsRawString:function(){return $.cookie("_ccma_usuari_")},isLogged:function(){return!!$.cookie("_ccma_usuari_")},getSyncCCMAIdint:function(){var t,e=$("body").data("modul").ccmalogin;return e&&(t=e.getUserFromCookie()),t?t.idint:null},getAsyncCCMAIdint:(c=R().mark(function t(){return R().wrap(function(t){for(;;
1)switch(t.prev=t.next){case 0:return t.abrupt("return",this.getSyncCCMAIdint());case 1:case"end":return t.stop()}},t,this)}),r=function(){var t=this,a=arguments;return new Promise(function(e,r){var o=c.apply(t,a);function n(t){s(o,e,r,n,i,"next",t)}function i(t){s(o,e,r,n,i,"throw",t)}n(void 0)})},function(){return r.apply(this,arguments)})},e.getUser=e.getUser||function(){var t;return Moduls.login.isLogged()&&(t=Moduls.login.getUser()),t},t.add({name:"ccmalogin",tagName:"body",userCookieName:"_ccma_usuari_",user:!1,loginURL:"https://registreusuari.3cat.cat/usuaris/login",loginModalURL:"https://registreusuari.3cat.cat/usuaris/login?embed=true",logoutURL:"//registreusuari.3cat.cat/usuaris/logout",logoutModalURL:"//registreusuari.3cat.cat/usuaris/logout?embed=true",profileURL:"https://registreusuari.3cat.cat/usuaris/consulta-dades",registreURL:"https://registreusuari.3cat.cat",loginModalTemplate:"htmltwig.login.modal.ccma",callbackURL:window.location.protocol+"//"+window.location.hostname+"/usuaris/login.html",triggeredUser:!1,initialize:function(){this.BaseModul.prototype.initialize.apply(this,arguments),$(document).on("LoginQualifio",_.bind(function(t){this.$el.trigger("openLogin")},this)),this.registerLoginLogoutListeners(),this.registerPostMessageListeners(),_.defer(_.bind(function(){this.checkUserFromCookie()},this))},events:{openLogin:"loginQualifio","click .ccmalogin.loginbutton":"login","click .ccmalogin.logoutbutton":"logout","click .ccmalogin.profilebutton":"profile"},login:function(t){var e;t.preventDefault(),$(t.currentTarget).hasClass("inmodal")?(void 0!==(e=$(t.currentTarget).find("button").attr("data-element"))&&!1!==e||(e="body"),$(t.currentTarget).hasClass("R-htmltwig-pmtard-trigger")&&(this.loginModalURL+="&permestard=true"),this.loginPopup(e)):(e=$(t.currentTarget).attr("id"),this.goToURL(this.loginURL,e))},loginQualifio:function(t){var e;t.preventDefault(),void 0!==(e=$(t.currentTarget).find("button").attr("data-element"))&&!1!==e||(e="body"),$(t.currentTarget).hasClass("R-htmltwig-pmtard-trigger")&&(this.loginModalURL+="&permestard=true"),this.loginPopup(e)},loginPopup:function(e){var t=$(".ccmaloginmodal"),r=this;0<t.length&&t.remove(),this.getTemplate(this.loginModalTemplate,function(t){$(e).append(t({url:r.loginModalURL+"&referal="+r.callbackURL})),$(".ccmaloginmodal").modal("show"),$(".ccmaloginmodal").on("hidden",function(t){$(document).trigger("cerrarModal")})})},logout:function(t){$(t.currentTarget).hasClass("inmodal")?this.logoutPopup(t):this.goToURL(this.logoutURL,"")},logoutPopup:function(){var t=$(".ccmalogout"),e=this;0<t.length&&t.remove(),this.getTemplate(this.loginModalTemplate,function(t){$("body").append(t({url:e.logoutModalURL+"&referal="+e.callbackURL}))})},profile:function(){window.location.href=this.profileURL},registerLoginLogoutListeners:function(){var t=_.bind(this.onLoginChanged,this);$(document).on("loginRU",t).on("logoutRU",t)},onLogin:function(){var t=this.$el.find(".capital-letter.logat"),e=this.$el.find(".nomUsuari.logat");void 0!==t&&t.text(this.getFirstChar(this.user.nom)),void 0!==e&&e.text(this.user.nom),this.$el.find(".ccmalogin.loggedblock").show(),this.$el.find(".ccmalogin.loginblock").hide(),this.$el.find(".ccmalogin.nom").text(this.user.nom)},onLogout:function(){this.$el.find(".ccmalogin.loginblock").show(),this.$el.find(".ccmalogin.loggedblock").hide()},onLoginChanged:function(t,e){try{void 0===t&&console.error(t)}catch(t){console.error(t)}this.user=o=e,this.user?this.onLogin():this.onLogout()},registerPostMessageListeners:function(){var e,r=this;window.addEventListener("message",function(t){"https://registreusuari.3cat.cat"===t.origin&&"login"!==t.data&&r.isValidUserMessage(t.data)&&r.handleRefreshUserCookie(JSON.parse(t.data)),"https://www.3cat.cat"!==t.origin&&"http://www.3cat.cat"!==t.origin&&"https://registreusuari.3cat.cat"!==t.origin||"login"!==t.data||(r.checkUserFromCookie(),$(".ccmaloginmodal").modal("hide"),$("#loginccmaiframe")[0].src.includes("permestard=true")&&$(document).trigger("onLoginRU"),"https://registreusuari.3cat.cat"===t.origin&&("referal"===(e=window.location.search.substring(1).split("="))[0]?window.location.href=r.registreURL+e[1]:window.location.href=r.registreURL+"/usuaris/"))},!1)},isValidUserMessage:function(t){return!!this.getUserFromEncodedString(t)},handleRefreshUserCookie:function(t){t.error?this.triggerLogout():(t.ts=(new Date).getTime(),$.cookie(this.userCookieName,JSON.stringify(t),{expires:1,path:"/",domain:".3cat.cat"}),this.triggerLogin(t))},triggerLogin:function(t){this.triggeredUser&&this.triggeredUser.id===t.id||(this.triggeredUser=t,$(document).trigger("loginRU",t))},triggerLogout:function(){null!==this.triggeredUser&&(this.triggeredUser=null,$(document).trigger("logoutRU"))},checkUserFromCookie:function(){var t=this.getUserFromCookie();void 0===t||t.error?this.triggerLogout():(this.isUserExpired(t)&&this.refreshUserCookie(t),this.triggerLogin(t))},goToURL:function(t,e){var r=window.location.href,o="";void 0!==e&&""!==e&&(o=e,-1===r.indexOf("#",r.length-1)&&(o="#"+o)),window.location.href=t+"?referal="+encodeURIComponent(r+o)},getUserFromCookie:function(){var t=$.cookie(this.userCookieName);return this.getUserFromEncodedString(t)},getUserFromEncodedString:function(t){var e,r,o=null;try{t&&(void 0!==(r=JSON.parse(t)).i&&(o=n(r.i)),e={cognom:n(r.c),idint:o,nom:n(r.n),access_token:r.a,email:n(r.e),username:n(r.u),ts:r.ts})}catch(t){e=null}if(e&&e.access_token&&e.email)return e},isUserExpired:function(t){return!t.ts||864e5<(new Date).getTime()-t.ts},refreshUserCookie:function(){var t=this;0===$("#refresca-token-iframe").length&&$('<iframe id="refresca-token-iframe" style="display:none"></iframe>').appendTo("body").attr("src","https://registreusuari.3cat.cat/usuaris/refresca-token").load(function(){t.checkUserFromCookie()})},getFirstChar:function(t){var e=t.trim();return(e=e.replace(/\s/g,"")).charAt(0).toUpperCase()}})}(ModulJitpub,window)}]);
2//# sourceMappingURL=htmltwig.login.ccma-sx3.min.js.map

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.