academico.unaj.edu.pe Open in urlscan Pro
2606:4700:10::ac43:4d7  Public Scan

URL: http://academico.unaj.edu.pe/avunaj2/lib/requirejs.php/1632687207/core/first.js
Submission: On October 06 via manual from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

define ("core/pending",["jquery"],function(a){var b=function(b){var c=a.Deferred();b=b||{};M.util.js_pending(b);c.then(function(){return M.util.js_complete(b)}).catch();return c};b.prototype.constructor=b;return b});
define ("core/pubsub",["exports","core/pending"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.publish=a.unsubscribe=a.subscribe=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c={};a.subscribe=function subscribe(a,b){c[a]=c[a]||[];c[a].push(b)};a.unsubscribe=function unsubscribe(a,b){if(c[a]){for(var d=0;d<c[a].length;d++){if(c[a][d]===b){c[a].splice(d,1);break}}}};var d=function(a,d){var e=new b.default("Publishing "+a);if(c[a]){c[a].forEach(function(a){a(d)})}e.resolve()};a.publish=d});
define ("core/addblockmodal",["jquery","core/modal_factory","core/templates","core/str","core/notification"],function(a,b,c,d,e){return{init:function init(f){var g=a("[data-key=addblock]"),h=f.blocks.map(function(a){return{key:"pluginname",component:"block_"+a}}),i=d.get_strings(h).then(function(a){return a.map(function(a,b){return{name:f.blocks[b],title:a}})}).then(function(a){f.blocks=a;return c.render("core/add_block_body",f)}).fail(e.exception),j=d.get_string("addblock").fail(e.exception);b.create({title:j,body:i,type:"CANCEL"},g)}}});
define ("core/prefetch",["exports","core/config"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var i="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function c(a){return g(a)||f(a)||e(a)||d()}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(a,b){if(!a)return;if("string"==typeof a)return h(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return h(a,b)}function f(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function g(a){if(Array.isArray(a))return h(a)}function h(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}var j=!1,k=[],l={},m,n=function(){if(k){var d=k.slice();k=[];("function"==typeof i.define&&i.define.amd?new Promise(function(a,b){i.require(["core/templates"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&i.require&&"component"===i.require.loader?Promise.resolve(require(("core/templates"))):Promise.resolve(i["core/templates"])).then(function(a){return a.prefetchTemplates(d)}).catch()}var a=l;l={};var b=[];Object.keys(a).forEach(function(d){b.push.apply(b,c(a[d].map(function(a){return{component:d,key:a}})))});("function"==typeof i.define&&i.define.amd?new Promise(function(a,b){i.require(["core/str"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&i.require&&"component"===i.require.loader?Promise.resolve(require(("core/str"))):Promise.resolve(i["core/str"])).then(function(a){return a.get_strings(b)}).catch()},o=function(){if(m){return}if(j){n();return}m=setTimeout(function(){j=!0;m=null;("function"==typeof i.define&&i.define.amd?new Promise(function(a,c){i.require([b.default.iconsystemmodule],a,c)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&i.require&&"component"===i.require.loader?Promise.resolve(require((b.default.iconsystemmodule))):Promise.resolve(i[b.default.iconsystemmodule])).then(function(a){var b=new a;q(b.getTemplateName());return b}).then(function(a){n();a.init()}).catch()},500)},p=function(a){k=k.concat(a);o()},q=function(a){p([a])},r=function(a,b){if(!l[a]){l[a]=[]}l[a]=l[a].concat(b);o()},s=function(a,b){if(!l[a]){l[a]=[]}l[a].push(b);o()};p([].concat(["core/loading"],["core/modal"],["core/modal_backdrop"]));r("core",["cancel","closebuttontitle","loading","savechanges"]);r("core_form",["showless","showmore"]);a.default={prefetchTemplate:q,prefetchTemplates:p,prefetchString:s,prefetchStrings:r};return a.default});
define ("core/checkbox-toggleall",["jquery","core/pubsub"],function(a,b){var c=!1,d={checkboxToggled:"core/checkbox-toggleall:checkboxToggled"},e=function(a,b,c){if(c){return a.find("[data-action=\"toggle\"][data-togglegroup=\""+b+"\"]")}else{return a.find("[data-action=\"toggle\"][data-togglegroup^=\""+b+"\"]")}},f=function(a,b){return e(a,b,!1).filter("[data-toggle=\"slave\"]")},g=function(a,b,c){return e(a,b,c).filter("[data-toggle=\"master\"]")},h=function(a,b){return e(a,b,!0).filter("[data-toggle=\"action\"]")},i=function(b){var c=b.data.root,d=a(b.target),e=d.data("togglegroup"),f;if(d.is(":checkbox")){f=d.is(":checked")}else{f=1===d.data("checkall")}l(c,e,f)},j=function(a,b){var c=f(a,b);if(0<c.length){var d=c.filter(":checked"),e=c.length===d.length;o(a,b,e,!0);n(a,b,!d.length)}},k=function(a){var b=a.split(" "),c=[],d="";b.forEach(function(a){d+=" "+a;c.push(d.trim())});return c},l=function(a,c,e){var g=f(a,c);g.prop("checked",e).trigger("change");var h=g.filter(":checked");o(a,c,e,!1);n(a,c,!h.length);var i=k(c).filter(function(a){return a!==c});i.forEach(function(b){j(a,b)});b.publish(d.checkboxToggled,{root:a,toggleGroupName:c,slaves:g,checkedSlaves:h,anyChecked:e})},m=function(c){var e=c.data.root,g=a(c.target),h=g.data("togglegroup"),i=f(e,h),l=i.filter(":checked"),m=k(h);m.forEach(function(a){j(e,a)});b.publish(d.checkboxToggled,{root:e,toggleGroupName:h,slaves:i,checkedSlaves:l,anyChecked:!!l.length})},n=function(a,b,c){h(a,b).prop("disabled",c)},o=function(b,c,d,e){var f=g(b,c,e);f.prop("checked",d);f.each(function(c,e){e=a(e);var f;if(d){f=e.data("toggle-deselectall")}else{f=e.data("toggle-selectall")}if(e.is(":checkbox")){var g=b.find("[for=\""+e.attr("id")+"\"]");if(g.length){if(g.html()!==f){g.html(f)}}}else{e.text(f);e.data("checkall",d?0:1)}})},p=function(){if(!c){c=!0;var b=a(document.body);b.on("click","[data-action=\"toggle\"][data-toggle=\"master\"]",{root:b},i);b.on("click","[data-action=\"toggle\"][data-toggle=\"slave\"]",{root:b},m)}};return{init:function init(){p()},events:d,setGroupState:function setGroupState(b,c,d){b=a(b);o(b,c,d,!0);l(b,c,d)},updateSlavesFromMasterState:function updateSlavesFromMasterState(b,c){b=a(b);var d=g(b,c,!1),e;if(d.is(":checkbox")){e=d.is(":checked")}else{e=1===d.data("checkall")}l(b,c,e)}}});
define ("core/modal_events",[],function(){return{shown:"modal:shown",hidden:"modal:hidden",destroyed:"modal:destroyed",bodyRendered:"modal:bodyRendered",outsideClick:"modal:outsideClick",save:"modal-save-cancel:save",cancel:"modal-save-cancel:cancel"}});
function _typeof2(e){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof2=function(e){return typeof e}}else{_typeof2=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof2(e)}define ("core/adapter",[],function(){return function d(c,e,t){function r(i,o){if(!e[i]){if(!c[i]){var s="function"==typeof require&&require;if(!o&&s)return s(i,!0);if(n)return n(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=e[i]={exports:{}};c[i][0].call(p.exports,function(t){var e=c[i][1][t];return r(e?e:t)},p,p.exports,d,c,e,t)}return e[i].exports}for(var n="function"==typeof require&&require,a=0;a<t.length;a++){r(t[a])}return r}({1:[function(e,t){'use strict';var r=e("./adapter_factory.js"),a=(0,r.adapterFactory)({window:window});t.exports=a},{"./adapter_factory.js":2}],2:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.adapterFactory=function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},t=e.window,r=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},a=i.log,n=i.detectBrowser(t),o={browserDetails:n,commonShim:g,extractVersion:i.extractVersion,disableLog:i.disableLog,disableWarnings:i.disableWarnings};switch(n.browser){case"chrome":if(!s||!s.shimPeerConnection||!r.shimChrome){a("Chrome shim is not included in this adapter release.");return o}a("adapter.js shimming chrome.");o.browserShim=s;s.shimGetUserMedia(t);s.shimMediaStream(t);s.shimPeerConnection(t);s.shimOnTrack(t);s.shimAddTrackRemoveTrack(t);s.shimGetSendersWithDtmf(t);s.shimGetStats(t);s.shimSenderReceiverGetStats(t);s.fixNegotiationNeeded(t);g.shimRTCIceCandidate(t);g.shimConnectionState(t);g.shimMaxMessageSize(t);g.shimSendThrowTypeError(t);g.removeAllowExtmapMixed(t);break;case"firefox":if(!l||!l.shimPeerConnection||!r.shimFirefox){a("Firefox shim is not included in this adapter release.");return o}a("adapter.js shimming firefox.");o.browserShim=l;l.shimGetUserMedia(t);l.shimPeerConnection(t);l.shimOnTrack(t);l.shimRemoveStream(t);l.shimSenderGetStats(t);l.shimReceiverGetStats(t);l.shimRTCDataChannel(t);l.shimAddTransceiver(t);l.shimCreateOffer(t);l.shimCreateAnswer(t);g.shimRTCIceCandidate(t);g.shimConnectionState(t);g.shimMaxMessageSize(t);g.shimSendThrowTypeError(t);break;case"edge":if(!c||!c.shimPeerConnection||!r.shimEdge){a("MS edge shim is not included in this adapter release.");return o}a("adapter.js shimming edge.");o.browserShim=c;c.shimGetUserMedia(t);c.shimGetDisplayMedia(t);c.shimPeerConnection(t);c.shimReplaceTrack(t);g.shimMaxMessageSize(t);g.shimSendThrowTypeError(t);break;case"safari":if(!f||!r.shimSafari){a("Safari shim is not included in this adapter release.");return o}a("adapter.js shimming safari.");o.browserShim=f;f.shimRTCIceServerUrls(t);f.shimCreateOfferLegacy(t);f.shimCallbacksAPI(t);f.shimLocalStreamsAPI(t);f.shimRemoteStreamsAPI(t);f.shimTrackEventTransceiver(t);f.shimGetUserMedia(t);g.shimRTCIceCandidate(t);g.shimMaxMessageSize(t);g.shimSendThrowTypeError(t);g.removeAllowExtmapMixed(t);break;default:a("Unsupported browser!");break;}return o};var n=e("./utils"),i=a(n),o=e("./chrome/chrome_shim"),s=a(o),d=e("./edge/edge_shim"),c=a(d),p=e("./firefox/firefox_shim"),l=a(p),m=e("./safari/safari_shim"),f=a(m),h=e("./common_shim"),g=a(h);function a(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.shimGetDisplayMedia=r.shimGetUserMedia=void 0;var d="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)},c=e("./getusermedia");Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return c.shimGetUserMedia}});var p=e("./getdisplaymedia");Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return p.shimGetDisplayMedia}});r.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream};r.shimOnTrack=n;r.shimGetSendersWithDtmf=i;r.shimGetStats=function(e){if(!e.RTCPeerConnection){return}var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,r=Array.prototype.slice.call(arguments),a=r[0],n=r[1],i=r[2];if(0<arguments.length&&"function"==typeof a){return t.apply(this,arguments)}if(0===t.length&&(0===arguments.length||"function"!=typeof a)){return t.apply(this,[])}var o=function(e){var t={},r=e.result();r.forEach(function(e){var r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){r[t]=e.stat(t)});t[r.id]=r});return t},s=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(2<=arguments.length){var d=function(e){n(s(o(e)))};return t.apply(this,[d,a])}return new Promise(function(r,a){t.apply(e,[function(e){r(s(o(e)))},a])}).then(n,i)}};r.shimSenderReceiverGetStats=o;r.shimAddTrackRemoveTrackWithNative=s;r.shimAddTrackRemoveTrack=function(e){if(!e.RTCPeerConnection){return}var n=m.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&65<=n.version){return s(e)}var i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=i.apply(this);this._reverseStreams=this._reverseStreams||{};return t.map(function(t){return e._reverseStreams[t.id]})};var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var r=this;this._streams=this._streams||{};this._reverseStreams=this._reverseStreams||{};t.getTracks().forEach(function(e){var t=r.getSenders().find(function(t){return t.track===e});if(t){throw new DOMException("Track already exists.","InvalidAccessError")}});if(!this._reverseStreams[t.id]){var a=new e.MediaStream(t.getTracks());this._streams[t.id]=a;this._reverseStreams[a.id]=t;t=a}o.apply(this,[t])};var d=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{};this._reverseStreams=this._reverseStreams||{};d.apply(this,[this._streams[e.id]||e]);delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id];delete this._streams[e.id]};e.RTCPeerConnection.prototype.addTrack=function(r,a){var n=this;if("closed"===this.signalingState){throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError")}var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(function(e){return e===r})){throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError")}var o=this.getSenders().find(function(e){return e.track===r});if(o){throw new DOMException("Track already exists.","InvalidAccessError")}this._streams=this._streams||{};this._reverseStreams=this._reverseStreams||{};var s=this._streams[a.id];if(s){s.addTrack(r);Promise.resolve().then(function(){n.dispatchEvent(new Event("negotiationneeded"))})}else{var d=new e.MediaStream([r]);this._streams[a.id]=d;this._reverseStreams[d.id]=a;this.addStream(d)}return this.getSenders().find(function(e){return e.track===r})};function t(e,t){var r=t.sdp;Object.keys(e._reverseStreams||[]).forEach(function(t){var a=e._reverseStreams[t],n=e._streams[a.id];r=r.replace(new RegExp(n.id,"g"),a.id)});return new RTCSessionDescription({type:t.type,sdp:r})}function r(e,t){var r=t.sdp;Object.keys(e._reverseStreams||[]).forEach(function(t){var a=e._reverseStreams[t],n=e._streams[a.id];r=r.replace(new RegExp(a.id,"g"),n.id)});return new RTCSessionDescription({type:t.type,sdp:r})}["createOffer","createAnswer"].forEach(function(r){var n=e.RTCPeerConnection.prototype[r],i=a({},r,function(){var e=this,r=arguments,a=arguments.length&&"function"==typeof arguments[0];if(a){return n.apply(this,[function(a){var n=t(e,a);r[0].apply(null,[n])},function(e){if(r[1]){r[1].apply(null,e)}},arguments[2]])}return n.apply(this,arguments).then(function(r){return t(e,r)})});e.RTCPeerConnection.prototype[r]=i[r]});var c=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){if(!arguments.length||!arguments[0].type){return c.apply(this,arguments)}arguments[0]=r(this,arguments[0]);return c.apply(this,arguments)};var p=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=p.get.apply(this);if(""===e.type){return e}return t(this,e)}});e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState){throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError")}if(!e._pc){throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError")}var r=e._pc===this;if(!r){throw new DOMException("Sender was not created by this connection.","InvalidAccessError")}this._streams=this._streams||{};var a;Object.keys(this._streams).forEach(function(r){var n=t._streams[r].getTracks().find(function(t){return e.track===t});if(n){a=t._streams[r]}});if(a){if(1===a.getTracks().length){this.removeStream(this._reverseStreams[a.id])}else{a.removeTrack(e.track)}this.dispatchEvent(new Event("negotiationneeded"))}}};r.shimPeerConnection=function(e){var t=m.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection){e.RTCPeerConnection=e.webkitRTCPeerConnection}if(!e.RTCPeerConnection){return}if(53>t.version){["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t],n=a({},t,function(){arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]);return r.apply(this,arguments)});e.RTCPeerConnection.prototype[t]=n[t]})}var r=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){if(!arguments[0]){if(arguments[1]){arguments[1].apply(null)}return Promise.resolve()}if(78>t.version&&arguments[0]&&""===arguments[0].candidate){return Promise.resolve()}return r.apply(this,arguments)}};r.fixNegotiationNeeded=function(e){m.wrapPeerConnectionEvent(e,"negotiationneeded",function(t){var e=t.target;if("stable"!==e.signalingState){return}return t})};var l=e("../utils.js"),m=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(l);function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}else{e[t]=r}return e}function n(t){if("object"===("undefined"==typeof t?"undefined":d(t))&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){if(this._ontrack){this.removeEventListener("track",this._ontrack)}this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var r=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var a=this;if(!this._ontrackpoly){this._ontrackpoly=function(r){r.stream.addEventListener("addtrack",function(e){var n;if(t.RTCPeerConnection.prototype.getReceivers){n=a.getReceivers().find(function(t){return t.track&&t.track.id===e.track.id})}else{n={track:e.track}}var i=new Event("track");i.track=e.track;i.receiver=n;i.transceiver={receiver:n};i.streams=[r.stream];a.dispatchEvent(i)});r.stream.getTracks().forEach(function(e){var n;if(t.RTCPeerConnection.prototype.getReceivers){n=a.getReceivers().find(function(t){return t.track&&t.track.id===e.id})}else{n={track:e}}var i=new Event("track");i.track=e;i.receiver=n;i.transceiver={receiver:n};i.streams=[r.stream];a.dispatchEvent(i)})};this.addEventListener("addstream",this._ontrackpoly)}return r.apply(this,arguments)}}else{m.wrapPeerConnectionEvent(t,"track",function(t){if(!t.transceiver){Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}})}return t})}}function i(e){if("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){if(this._dtmf===void 0){if("audio"===t.kind){this._dtmf=e.createDTMFSender(t)}else{this._dtmf=null}}return this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){this._senders=this._senders||[];return this._senders.slice()};var r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e){var a=r.apply(this,arguments);if(!a){a=t(this,e);this._senders.push(a)}return a};var a=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){a.apply(this,arguments);var t=this._senders.indexOf(e);if(-1!==t){this._senders.splice(t,1)}}}var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;this._senders=this._senders||[];n.apply(this,[e]);e.getTracks().forEach(function(e){r._senders.push(t(r,e))})};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[];i.apply(this,[e]);e.getTracks().forEach(function(e){var r=t._senders.find(function(t){return t.track===e});if(r){t._senders.splice(t._senders.indexOf(r),1)}})}}else if("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var o=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=o.apply(this,[]);t.forEach(function(t){return t._pc=e});return t};Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){if(this._dtmf===void 0){if("audio"===this.track.kind){this._dtmf=this._pc.createDTMFSender(this.track)}else{this._dtmf=null}}return this._dtmf}})}}function o(e){if(!("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver)){return}if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;if(t){e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);r.forEach(function(t){return t._pc=e});return r}}var r=e.RTCPeerConnection.prototype.addTrack;if(r){e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);e._pc=this;return e}}e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return m.filterStats(t,e.track,!0)})}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var a=e.RTCPeerConnection.prototype.getReceivers;if(a){e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=a.apply(this,[]);t.forEach(function(t){return t._pc=e});return t}}m.wrapPeerConnectionEvent(e,"track",function(t){t.receiver._pc=t.srcElement;return t});e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then(function(t){return m.filterStats(t,e.track,!1)})}}if(!("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype)){return}var n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(0<arguments.length&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],r=void 0,a=void 0,i=void 0;this.getSenders().forEach(function(e){if(e.track===t){if(r){i=!0}else{r=e}}});this.getReceivers().forEach(function(e){if(e.track===t){if(a){i=!0}else{a=e}}return e.track===t});if(i||r&&a){return Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError"))}else if(r){return r.getStats()}else if(a){return a.getStats()}return Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return n.apply(this,arguments)}}function s(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};return Object.keys(this._shimmedLocalStreams).map(function(t){return e._shimmedLocalStreams[t][0]})};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r){return t.apply(this,arguments)}this._shimmedLocalStreams=this._shimmedLocalStreams||{};var a=t.apply(this,arguments);if(!this._shimmedLocalStreams[r.id]){this._shimmedLocalStreams[r.id]=[r,a]}else if(-1===this._shimmedLocalStreams[r.id].indexOf(a)){this._shimmedLocalStreams[r.id].push(a)}return a};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};e.getTracks().forEach(function(e){var r=t.getSenders().find(function(t){return t.track===e});if(r){throw new DOMException("Track already exists.","InvalidAccessError")}});var a=this.getSenders();r.apply(this,arguments);var n=this.getSenders().filter(function(e){return-1===a.indexOf(e)});this._shimmedLocalStreams[e.id]=[e].concat(n)};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{};delete this._shimmedLocalStreams[e.id];return a.apply(this,arguments)};var n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};if(e){Object.keys(this._shimmedLocalStreams).forEach(function(r){var a=t._shimmedLocalStreams[r].indexOf(e);if(-1!==a){t._shimmedLocalStreams[r].splice(a,1)}if(1===t._shimmedLocalStreams[r].length){delete t._shimmedLocalStreams[r]}})}return n.apply(this,arguments)}}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.shimGetDisplayMedia=a;function a(e,t){if(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices){return}if(!e.navigator.mediaDevices){return}if("function"!=typeof t){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then(function(t){var a=r.video&&r.video.width,n=r.video&&r.video.height,i=r.video&&r.video.frameRate;r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}};if(a){r.video.mandatory.maxWidth=a}if(n){r.video.mandatory.maxHeight=n}return e.navigator.mediaDevices.getUserMedia(r)})}}},{}],5:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)};r.shimGetUserMedia=function(e){var t=e&&e.navigator;if(!t.mediaDevices){return}var r=i.detectBrowser(e),n=function(e){if("object"!==("undefined"==typeof e?"undefined":a(e))||e.mandatory||e.optional){return e}var t={};Object.keys(e).forEach(function(n){if("require"===n||"advanced"===n||"mediaSource"===n){return}var i="object"===a(e[n])?e[n]:{ideal:e[n]};if(i.exact!==void 0&&"number"==typeof i.exact){i.min=i.max=i.exact}var r=function(e,t){if(e){return e+t.charAt(0).toUpperCase()+t.slice(1)}return"deviceId"===t?"sourceId":t};if(i.ideal!==void 0){t.optional=t.optional||[];var o={};if("number"==typeof i.ideal){o[r("min",n)]=i.ideal;t.optional.push(o);o={};o[r("max",n)]=i.ideal;t.optional.push(o)}else{o[r("",n)]=i.ideal;t.optional.push(o)}}if(i.exact!==void 0&&"number"!=typeof i.exact){t.mandatory=t.mandatory||{};t.mandatory[r("",n)]=i.exact}else{["min","max"].forEach(function(e){if(i[e]!==void 0){t.mandatory=t.mandatory||{};t.mandatory[r(e,n)]=i[e]}})}});if(e.advanced){t.optional=(t.optional||[]).concat(e.advanced)}return t},s=function(e,i){if(61<=r.version){return i(e)}e=JSON.parse(JSON.stringify(e));if(e&&"object"===a(e.audio)){var s=function(e,t,r){if(t in e&&!(r in e)){e[r]=e[t];delete e[t]}};e=JSON.parse(JSON.stringify(e));s(e.audio,"autoGainControl","googAutoGainControl");s(e.audio,"noiseSuppression","googNoiseSuppression");e.audio=n(e.audio)}if(e&&"object"===a(e.video)){var d=e.video.facingMode;d=d&&("object"===("undefined"==typeof d?"undefined":a(d))?d:{ideal:d});var c=66>r.version;if(d&&("user"===d.exact||"environment"===d.exact||"user"===d.ideal||"environment"===d.ideal)&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!c)){delete e.video.facingMode;var p;if("environment"===d.exact||"environment"===d.ideal){p=["back","rear"]}else if("user"===d.exact||"user"===d.ideal){p=["front"]}if(p){return t.mediaDevices.enumerateDevices().then(function(t){t=t.filter(function(e){return"videoinput"===e.kind});var r=t.find(function(e){return p.some(function(t){return e.label.toLowerCase().includes(t)})});if(!r&&t.length&&p.includes("back")){r=t[t.length-1]}if(r){e.video.deviceId=d.exact?{exact:r.deviceId}:{ideal:r.deviceId}}e.video=n(e.video);o("chrome: "+JSON.stringify(e));return i(e)})}}e.video=n(e.video)}o("chrome: "+JSON.stringify(e));return i(e)},d=function(t){if(64<=r.version){return t}return{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};t.getUserMedia=function(e,r,a){s(e,function(e){t.webkitGetUserMedia(e,r,function(t){if(a){a(d(t))}})})}.bind(t);if(t.mediaDevices.getUserMedia){var p=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return s(e,function(e){return p(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length){t.getTracks().forEach(function(e){e.stop()});throw new DOMException("","NotFoundError")}return t},function(t){return Promise.reject(d(t))})})}}};var n=e("../utils.js"),i=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(n);var o=i.log},{"../utils.js":15}],6:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)};r.shimRTCIceCandidate=a;r.shimMaxMessageSize=n;r.shimSendThrowTypeError=i;r.shimConnectionState=o;r.removeAllowExtmapMixed=function(e){if(!e.RTCPeerConnection){return}var t=l.detectBrowser(e);if("chrome"===t.browser&&71<=t.version){return}var r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){e.sdp=e.sdp.split("\n").filter(function(e){return"a=extmap-allow-mixed"!==e.trim()}).join("\n")}return r.apply(this,arguments)}};var d=e("sdp"),c=function(e){return e&&e.__esModule?e:{default:e}}(d),p=e("./utils"),l=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(p);function a(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype){return}var r=t.RTCIceCandidate;t.RTCIceCandidate=function(e){if("object"===("undefined"==typeof e?"undefined":s(e))&&e.candidate&&0===e.candidate.indexOf("a=")){e=JSON.parse(JSON.stringify(e));e.candidate=e.candidate.substr(2)}if(e.candidate&&e.candidate.length){var t=new r(e),a=c.default.parseCandidate(e.candidate),n=Object.assign(t,a);n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}};return n}return new r(e)};t.RTCIceCandidate.prototype=r.prototype;l.wrapPeerConnectionEvent(t,"icecandidate",function(r){if(r.candidate){Object.defineProperty(r,"candidate",{value:new t.RTCIceCandidate(r.candidate),writable:"false"})}return r})}function n(e){if(!e.RTCPeerConnection){return}var t=l.detectBrowser(e);if(!("sctp"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return"undefined"==typeof this._sctp?null:this._sctp}})}var r=function(e){if(!e||!e.sdp){return!1}var t=c.default.splitSections(e.sdp);t.shift();return t.some(function(e){var t=c.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")})},a=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||2>t.length){return-1}var r=parseInt(t[1],10);return r!==r?-1:r},n=function(e){var r=65536;if("firefox"===t.browser){if(57>t.version){if(-1===e){r=16384}else{r=2147483637}}else if(60>t.version){r=57===t.version?65535:65536}else{r=2147483637}}return r},i=function(e,r){var a=65536;if("firefox"===t.browser&&57===t.version){a=65535}var n=c.default.matchPrefix(e.sdp,"a=max-message-size:");if(0<n.length){a=parseInt(n[0].substr(19),10)}else if("firefox"===t.browser&&-1!==r){a=2147483637}return a},o=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){this._sctp=null;if("chrome"===t.browser&&76<=t.version){var e=this.getConfiguration(),s=e.sdpSemantics;if("plan-b"===s){Object.defineProperty(this,"sctp",{get:function(){return"undefined"==typeof this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}}if(r(arguments[0])){var d=a(arguments[0]),c=n(d),p=i(arguments[0],d),l=void 0;if(0===c&&0===p){l=Number.POSITIVE_INFINITY}else if(0===c||0===p){l=Math.max(c,p)}else{l=Math.min(c,p)}var m={};Object.defineProperty(m,"maxMessageSize",{get:function(){return l}});this._sctp=m}return o.apply(this,arguments)}}function i(e){if(!(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype)){return}function t(e,t){var r=e.send;e.send=function(){var a=arguments[0],n=a.length||a.size||a.byteLength;if("open"===e.readyState&&t.sctp&&n>t.sctp.maxMessageSize){throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)")}return r.apply(e,arguments)}}var r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=r.apply(this,arguments);t(e,this);return e};l.wrapPeerConnectionEvent(e,"datachannel",function(r){t(r.channel,r.target);return r})}function o(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype){return}var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0});Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){if(this._onconnectionstatechange){this.removeEventListener("connectionstatechange",this._onconnectionstatechange);delete this._onconnectionstatechange}if(e){this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)}},enumerable:!0,configurable:!0});["setLocalDescription","setRemoteDescription"].forEach(function(e){var r=t[e];t[e]=function(){if(!this._connectionstatechangepoly){this._connectionstatechangepoly=function(t){var e=t.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;var r=new Event("connectionstatechange",t);e.dispatchEvent(r)}return t};this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)}return r.apply(this,arguments)}})}},{"./utils":15,sdp:17}],7:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.shimGetDisplayMedia=r.shimGetUserMedia=void 0;var i=e("./getusermedia");Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}});r.shimPeerConnection=a;r.shimReplaceTrack=n;var s=e("../utils"),d=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(s),c=e("./filtericeservers"),p=e("rtcpeerconnection-shim"),l=function(e){return e&&e.__esModule?e:{default:e}}(p);function a(e){var t=d.detectBrowser(e);if(e.RTCIceGatherer){if(!e.RTCIceCandidate){e.RTCIceCandidate=function(e){return e}}if(!e.RTCSessionDescription){e.RTCSessionDescription=function(e){return e}}if(15025>t.version){var r=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){r.set.call(this,e);var t=new Event("enabled");t.enabled=e;this.dispatchEvent(t)}})}}if(e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){if(this._dtmf===void 0){if("audio"===this.track.kind){this._dtmf=new e.RTCDtmfSender(this)}else if("video"===this.track.kind){this._dtmf=null}}return this._dtmf}})}if(e.RTCDtmfSender&&!e.RTCDTMFSender){e.RTCDTMFSender=e.RTCDtmfSender}var a=(0,l.default)(e,t.version);e.RTCPeerConnection=function(e){if(e&&e.iceServers){e.iceServers=(0,c.filterIceServers)(e.iceServers,t.version);d.log("ICE servers after filtering:",e.iceServers)}return new a(e)};e.RTCPeerConnection.prototype=a.prototype}function n(e){if(e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)){e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack}}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.filterIceServers=function(e){var t=!1;e=JSON.parse(JSON.stringify(e));return e.filter(function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;if(e.url&&!e.urls){n.deprecated("RTCIceServer.url","RTCIceServer.urls")}var a="string"==typeof r;if(a){r=[r]}r=r.filter(function(e){if(0===e.indexOf("stun:")){return!1}var r=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");if(r&&!t){t=!0;return!0}return r&&!t});delete e.url;e.urls=a?r[0]:r;return!!r.length}})};var a=e("../utils"),n=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(a)},{"../utils":15}],9:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.shimGetDisplayMedia=a;function a(e){if(!("getDisplayMedia"in e.navigator)){return}if(!e.navigator.mediaDevices){return}if(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices){return}e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)}},{}],10:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.shimGetUserMedia=function(e){var t=e&&e.navigator,r=function(t){return{name:{PermissionDeniedError:"NotAllowedError"}[t.name]||t.name,message:t.message,constraint:t.constraint,toString:function(){return this.name}}},a=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return a(e).catch(function(t){return Promise.reject(r(t))})}}},{}],11:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.shimGetDisplayMedia=r.shimGetUserMedia=void 0;var d="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)},c=e("./getusermedia");Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return c.shimGetUserMedia}});var p=e("./getdisplaymedia");Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return p.shimGetDisplayMedia}});r.shimOnTrack=n;r.shimPeerConnection=function(e){var t=m.detectBrowser(e);if("object"!==("undefined"==typeof e?"undefined":d(e))||!(e.RTCPeerConnection||e.mozRTCPeerConnection)){return}if(!e.RTCPeerConnection&&e.mozRTCPeerConnection){e.RTCPeerConnection=e.mozRTCPeerConnection}if(53>t.version){["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var r=e.RTCPeerConnection.prototype[t],n=a({},t,function(){arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]);return r.apply(this,arguments)});e.RTCPeerConnection.prototype[t]=n[t]})}if(68>t.version){var r=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){if(!arguments[0]){if(arguments[1]){arguments[1].apply(null)}return Promise.resolve()}if(arguments[0]&&""===arguments[0].candidate){return Promise.resolve()}return r.apply(this,arguments)}}var n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),r=e[0],a=e[1],o=e[2];return i.apply(this,[r||null]).then(function(r){if(53>t.version&&!a){try{r.forEach(function(e){e.type=n[e.type]||e.type})}catch(t){if("TypeError"!==t.name){throw t}r.forEach(function(e,t){r.set(t,Object.assign({},e,{type:n[e.type]||e.type}))})}}return r}).then(a,o)}};r.shimSenderGetStats=i;r.shimReceiverGetStats=o;r.shimRemoveStream=s;r.shimRTCDataChannel=function(e){if(e.DataChannel&&!e.RTCDataChannel){e.RTCDataChannel=e.DataChannel}};r.shimAddTransceiver=function(e){if(!("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection)){return}var t=e.RTCPeerConnection.prototype.addTransceiver;if(t){e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],r=e&&"sendEncodings"in e;if(r){e.sendEncodings.forEach(function(e){if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid)){throw new TypeError("Invalid RID value provided.")}}if("scaleResolutionDownBy"in e){if(!(1<=parseFloat(e.scaleResolutionDownBy))){throw new RangeError("scale_resolution_down_by must be >= 1.0")}}if("maxFramerate"in e){if(!(0<=parseFloat(e.maxFramerate))){throw new RangeError("max_framerate must be >= 0.0")}}})}var a=t.apply(this,arguments);if(r){var n=a.sender,i=n.getParameters();if(!("encodings"in i)){i.encodings=e.sendEncodings;this.setParametersPromises.push(n.setParameters(i).catch(function(){}))}}return a}}};r.shimCreateOffer=function(e){if(!("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection)){return}var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,r=arguments;if(this.setParametersPromises&&this.setParametersPromises.length){return Promise.all(this.setParametersPromises).then(function(){return t.apply(e,r)}).finally(function(){e.setParametersPromises=[]})}return t.apply(this,arguments)}};r.shimCreateAnswer=function(e){if(!("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection)){return}var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,r=arguments;if(this.setParametersPromises&&this.setParametersPromises.length){return Promise.all(this.setParametersPromises).then(function(){return t.apply(e,r)}).finally(function(){e.setParametersPromises=[]})}return t.apply(this,arguments)}};var l=e("../utils"),m=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(l);function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}else{e[t]=r}return e}function n(e){if("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)){Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}}function i(e){if(!("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection&&e.RTCRtpSender)){return}if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype){return}var t=e.RTCPeerConnection.prototype.getSenders;if(t){e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);r.forEach(function(t){return t._pc=e});return r}}var r=e.RTCPeerConnection.prototype.addTrack;if(r){e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);e._pc=this;return e}}e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function o(e){if(!("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCPeerConnection&&e.RTCRtpSender)){return}if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype){return}var t=e.RTCPeerConnection.prototype.getReceivers;if(t){e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,r=t.apply(this,[]);r.forEach(function(t){return t._pc=e});return r}}m.wrapPeerConnectionEvent(e,"track",function(t){t.receiver._pc=t.srcElement;return t});e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function s(e){if(!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype){return}e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;m.deprecated("removeStream","removeTrack");this.getSenders().forEach(function(r){if(r.track&&e.getTracks().includes(r.track)){t.removeTrack(r)}})}}},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});r.shimGetDisplayMedia=a;function a(e,t){if(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices){return}if(!e.navigator.mediaDevices){return}e.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){var a=new DOMException("getDisplayMedia without video constraints is undefined");a.name="NotFoundError";a.code=8;return Promise.reject(a)}if(!0===r.video){r.video={mediaSource:t}}else{r.video.mediaSource=t}return e.navigator.mediaDevices.getUserMedia(r)}}},{}],13:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)};r.shimGetUserMedia=a;var i=e("../utils"),o=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(i);function a(e){var t=o.detectBrowser(e),r=e&&e.navigator,a=e&&e.MediaStreamTrack;r.getUserMedia=function(e,t,a){o.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia");r.mediaDevices.getUserMedia(e).then(t,a)};if(!(55<t.version&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var i=function(e,t,r){if(t in e&&!(r in e)){e[r]=e[t];delete e[t]}},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){if("object"===("undefined"==typeof e?"undefined":n(e))&&"object"===n(e.audio)){e=JSON.parse(JSON.stringify(e));i(e.audio,"autoGainControl","mozAutoGainControl");i(e.audio,"noiseSuppression","mozNoiseSuppression")}return s(e)};if(a&&a.prototype.getSettings){var d=a.prototype.getSettings;a.prototype.getSettings=function(){var e=d.apply(this,arguments);i(e,"mozAutoGainControl","autoGainControl");i(e,"mozNoiseSuppression","noiseSuppression");return e}}if(a&&a.prototype.applyConstraints){var p=a.prototype.applyConstraints;a.prototype.applyConstraints=function(e){if("audio"===this.kind&&"object"===("undefined"==typeof e?"undefined":n(e))){e=JSON.parse(JSON.stringify(e));i(e,"autoGainControl","mozAutoGainControl");i(e,"noiseSuppression","mozNoiseSuppression")}return p.apply(this,[e])}}}}},{"../utils":15}],14:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)};r.shimLocalStreamsAPI=a;r.shimRemoteStreamsAPI=n;r.shimCallbacksAPI=function(e){if("object"!==("undefined"==typeof e?"undefined":d(e))||!e.RTCPeerConnection){return}var t=e.RTCPeerConnection.prototype,r=t.createOffer,a=t.createAnswer,n=t.setLocalDescription,i=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){var a=2<=arguments.length?arguments[2]:arguments[0],n=r.apply(this,[a]);if(!t){return n}n.then(e,t);return Promise.resolve()};t.createAnswer=function(e,t){var r=2<=arguments.length?arguments[2]:arguments[0],n=a.apply(this,[r]);if(!t){return n}n.then(e,t);return Promise.resolve()};var s=function(e,t,r){var a=n.apply(this,[e]);if(!r){return a}a.then(t,r);return Promise.resolve()};t.setLocalDescription=s;s=function(e,t,r){var a=i.apply(this,[e]);if(!r){return a}a.then(t,r);return Promise.resolve()};t.setRemoteDescription=s;s=function(e,t,r){var a=o.apply(this,[e]);if(!r){return a}a.then(t,r);return Promise.resolve()};t.addIceCandidate=s};r.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var r=t.mediaDevices,a=r.getUserMedia.bind(r);t.mediaDevices.getUserMedia=function(e){return a(i(e))}}if(!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia){t.getUserMedia=function(e,r,a){t.mediaDevices.getUserMedia(e).then(r,a)}.bind(t)}};r.shimConstraints=i;r.shimRTCIceServerUrls=o;r.shimTrackEventTransceiver=s;r.shimCreateOfferLegacy=function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){if("undefined"!=typeof e.offerToReceiveAudio){e.offerToReceiveAudio=!!e.offerToReceiveAudio}var r=this.getTransceivers().find(function(e){return"audio"===e.receiver.track.kind});if(!1===e.offerToReceiveAudio&&r){if("sendrecv"===r.direction){if(r.setDirection){r.setDirection("sendonly")}else{r.direction="sendonly"}}else if("recvonly"===r.direction){if(r.setDirection){r.setDirection("inactive")}else{r.direction="inactive"}}}else if(!0===e.offerToReceiveAudio&&!r){this.addTransceiver("audio")}if("undefined"!=typeof e.offerToReceiveVideo){e.offerToReceiveVideo=!!e.offerToReceiveVideo}var a=this.getTransceivers().find(function(e){return"video"===e.receiver.track.kind});if(!1===e.offerToReceiveVideo&&a){if("sendrecv"===a.direction){if(a.setDirection){a.setDirection("sendonly")}else{a.direction="sendonly"}}else if("recvonly"===a.direction){if(a.setDirection){a.setDirection("inactive")}else{a.direction="inactive"}}}else if(!0===e.offerToReceiveVideo&&!a){this.addTransceiver("video")}}return t.apply(this,arguments)}};var c=e("../utils"),p=function(e){if(e&&e.__esModule){return e}else{var t={};if(null!=e){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t.default=e;return t}}(c);function a(e){if("object"!==("undefined"==typeof e?"undefined":d(e))||!e.RTCPeerConnection){return}if(!("getLocalStreams"in e.RTCPeerConnection.prototype)){e.RTCPeerConnection.prototype.getLocalStreams=function(){if(!this._localStreams){this._localStreams=[]}return this._localStreams}}if(!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;if(!this._localStreams){this._localStreams=[]}if(!this._localStreams.includes(e)){this._localStreams.push(e)}e.getAudioTracks().forEach(function(a){return t.call(r,a,e)});e.getVideoTracks().forEach(function(a){return t.call(r,a,e)})};e.RTCPeerConnection.prototype.addTrack=function(){var e=arguments[1];if(e){if(!this._localStreams){this._localStreams=[e]}else if(!this._localStreams.includes(e)){this._localStreams.push(e)}}return t.apply(this,arguments)}}if(!("removeStream"in e.RTCPeerConnection.prototype)){e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;if(!this._localStreams){this._localStreams=[]}var r=this._localStreams.indexOf(e);if(-1===r){return}this._localStreams.splice(r,1);var a=e.getTracks();this.getSenders().forEach(function(e){if(a.includes(e.track)){t.removeTrack(e)}})}}}function n(e){if("object"!==("undefined"==typeof e?"undefined":d(e))||!e.RTCPeerConnection){return}if(!("getRemoteStreams"in e.RTCPeerConnection.prototype)){e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}}if(!("onaddstream"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;if(this._onaddstream){this.removeEventListener("addstream",this._onaddstream);this.removeEventListener("track",this._onaddstreampoly)}this.addEventListener("addstream",this._onaddstream=e);this.addEventListener("track",this._onaddstreampoly=function(r){r.streams.forEach(function(e){if(!t._remoteStreams){t._remoteStreams=[]}if(t._remoteStreams.includes(e)){return}t._remoteStreams.push(e);var r=new Event("addstream");r.stream=e;t.dispatchEvent(r)})})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;if(!this._onaddstreampoly){this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach(function(t){if(!e._remoteStreams){e._remoteStreams=[]}if(0<=e._remoteStreams.indexOf(t)){return}e._remoteStreams.push(t);var r=new Event("addstream");r.stream=t;e.dispatchEvent(r)})})}return t.apply(e,arguments)}}}function i(e){if(e&&e.video!==void 0){return Object.assign({},e,{video:p.compactObject(e.video)})}return e}function o(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){for(var a=[],n=0,o;n<e.iceServers.length;n++){o=e.iceServers[n];if(!o.hasOwnProperty("urls")&&o.hasOwnProperty("url")){p.deprecated("RTCIceServer.url","RTCIceServer.urls");o=JSON.parse(JSON.stringify(o));o.urls=o.url;delete o.url;a.push(o)}else{a.push(e.iceServers[n])}}e.iceServers=a}return new t(e,r)};e.RTCPeerConnection.prototype=t.prototype;if("generateCertificate"in e.RTCPeerConnection){Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}}function s(e){if("object"===("undefined"==typeof e?"undefined":d(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)){Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}}},{"../utils":15}],15:[function(e,t,r){'use strict';Object.defineProperty(r,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)};r.extractVersion=n;r.wrapPeerConnectionEvent=function(e,t,r){if(!e.RTCPeerConnection){return}var a=e.RTCPeerConnection.prototype,n=a.addEventListener;a.addEventListener=function(e,a){if(e!==t){return n.apply(this,arguments)}var i=function(t){var e=r(t);if(e){a(e)}};this._eventMap=this._eventMap||{};this._eventMap[a]=i;return n.apply(this,[e,i])};var i=a.removeEventListener;a.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[r]){return i.apply(this,arguments)}var a=this._eventMap[r];delete this._eventMap[r];return i.apply(this,[e,a])};Object.defineProperty(a,"on"+t,{get:function(){return this["_on"+t]},set:function(e){if(this["_on"+t]){this.removeEventListener(t,this["_on"+t]);delete this["_on"+t]}if(e){this.addEventListener(t,this["_on"+t]=e)}},enumerable:!0,configurable:!0})};r.disableLog=function(e){if("boolean"!=typeof e){return new Error("Argument type: "+("undefined"==typeof e?"undefined":l(e))+". Please use a boolean.")}m=e;return e?"adapter.js logging disabled":"adapter.js logging enabled"};r.disableWarnings=function(e){if("boolean"!=typeof e){return new Error("Argument type: "+("undefined"==typeof e?"undefined":l(e))+". Please use a boolean.")}f=!e;return"adapter.js deprecation warnings "+(e?"disabled":"enabled")};r.log=i;r.deprecated=o;r.detectBrowser=s;r.compactObject=c;r.walkStats=p;r.filterStats=function(e,t,r){var a=r?"outbound-rtp":"inbound-rtp",n=new Map;if(null===t){return n}var i=[];e.forEach(function(e){if("track"===e.type&&e.trackIdentifier===t.id){i.push(e)}});i.forEach(function(t){e.forEach(function(r){if(r.type===a&&r.trackId===t.id){p(e,r,n)}})});return n};function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}else{e[t]=r}return e}var m=!0,f=!0;function n(e,t,r){var a=e.match(t);return a&&a.length>=r&&parseInt(a[r],10)}function i(){if("object"===("undefined"==typeof window?"undefined":l(window))){if(m){return}if("undefined"!=typeof console&&"function"==typeof console.log){console.log.apply(console,arguments)}}}function o(e,t){if(!f){return}console.warn(e+" is deprecated, please use "+t+" instead.")}function s(e){var t=e.navigator,r={browser:null,version:null};if("undefined"==typeof e||!e.navigator){r.browser="Not a browser.";return r}if(t.mozGetUserMedia){r.browser="firefox";r.version=n(t.userAgent,/Firefox\/(\d+)\./,1)}else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer){r.browser="chrome";r.version=n(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2)}else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/)){r.browser="edge";r.version=n(t.userAgent,/Edge\/(\d+).(\d+)$/,2)}else if(e.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./)){r.browser="safari";r.version=n(t.userAgent,/AppleWebKit\/(\d+)\./,1);r.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}else{r.browser="Not a supported browser.";return r}return r}function d(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e){if(!d(e)){return e}return Object.keys(e).reduce(function(t,r){var n=d(e[r]),i=n?c(e[r]):e[r],o=n&&!Object.keys(i).length;if(i===void 0||o){return t}return Object.assign(t,a({},r,i))},{})}function p(e,t,r){if(!t||r.has(t.id)){return}r.set(t.id,t);Object.keys(t).forEach(function(a){if(a.endsWith("Id")){p(e,e.get(t[a]),r)}else if(a.endsWith("Ids")){t[a].forEach(function(t){p(e,e.get(t),r)})}})}},{}],16:[function(e,t){'use strict';var c=e("sdp");function r(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}function a(e,t,r,a,n){var i=c.writeRtpDescription(e.kind,t);i+=c.writeIceParameters(e.iceGatherer.getLocalParameters());i+=c.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":n||"active");i+="a=mid:"+e.mid+"\r\n";if(e.rtpSender&&e.rtpReceiver){i+="a=sendrecv\r\n"}else if(e.rtpSender){i+="a=sendonly\r\n"}else if(e.rtpReceiver){i+="a=recvonly\r\n"}else{i+="a=inactive\r\n"}if(e.rtpSender){var o=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=o;var s="msid:"+(a?a.id:"-")+" "+o+"\r\n";i+="a="+s;i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s;if(e.sendEncodingParameters[0].rtx){i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s;i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n"}}i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+c.localCName+"\r\n";if(e.rtpSender&&e.sendEncodingParameters[0].rtx){i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+c.localCName+"\r\n"}return i}function n(e,t){var r=!1;e=JSON.parse(JSON.stringify(e));return e.filter(function(e){if(e&&(e.urls||e.url)){var a=e.urls||e.url;if(e.url&&!e.urls){console.warn("RTCIceServer.url is deprecated! Use urls instead.")}var n="string"==typeof a;if(n){a=[a]}a=a.filter(function(e){var a=0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!r;if(a){r=!0;return!0}return 0===e.indexOf("stun:")&&14393<=t&&-1===e.indexOf("?transport=udp")});delete e.url;e.urls=n?a[0]:a;return!!a.length}})}function i(e,t){var r={codecs:[],headerExtensions:[],fecMechanisms:[]},a=function(e,t){e=parseInt(e,10);for(var r=0;r<t.length;r++){if(t[r].payloadType===e||t[r].preferredPayloadType===e){return t[r]}}},n=function(e,t,r,n){var i=a(e.parameters.apt,r),o=a(t.parameters.apt,n);return i&&o&&i.name.toLowerCase()===o.name.toLowerCase()};e.codecs.forEach(function(a){for(var o=0,s;o<t.codecs.length;o++){s=t.codecs[o];if(a.name.toLowerCase()===s.name.toLowerCase()&&a.clockRate===s.clockRate){if("rtx"===a.name.toLowerCase()&&a.parameters&&s.parameters.apt){if(!n(a,s,e.codecs,t.codecs)){continue}}s=JSON.parse(JSON.stringify(s));s.numChannels=Math.min(a.numChannels,s.numChannels);r.codecs.push(s);s.rtcpFeedback=s.rtcpFeedback.filter(function(e){for(var t=0;t<a.rtcpFeedback.length;t++){if(a.rtcpFeedback[t].type===e.type&&a.rtcpFeedback[t].parameter===e.parameter){return!0}}return!1});break}}});e.headerExtensions.forEach(function(e){for(var a=0,n;a<t.headerExtensions.length;a++){n=t.headerExtensions[a];if(e.uri===n.uri){r.headerExtensions.push(n);break}}});return r}function o(e,t,r){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(r)}function s(e,t){var r=e.getRemoteCandidates().find(function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type});if(!r){e.addRemoteCandidate(t)}return!r}function d(t,r){var a=new Error(r);a.name=t;a.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[t];return a}t.exports=function(e,t){function p(t,r){r.addTrack(t);r.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function l(t,r){r.removeTrack(t);r.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}function m(t,r,a,n){var i=new Event("track");i.track=r;i.receiver=a;i.transceiver={receiver:a};i.streams=n;e.setTimeout(function(){t._dispatchEvent("track",i)})}var f=function(r){var a=this,o=document.createDocumentFragment();["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){a[e]=o[e].bind(o)});this.canTrickleIceCandidates=null;this.needNegotiation=!1;this.localStreams=[];this.remoteStreams=[];this._localDescription=null;this._remoteDescription=null;this.signalingState="stable";this.iceConnectionState="new";this.connectionState="new";this.iceGatheringState="new";r=JSON.parse(JSON.stringify(r||{}));this.usingBundle="max-bundle"===r.bundlePolicy;if("negotiate"===r.rtcpMuxPolicy){throw d("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported")}else if(!r.rtcpMuxPolicy){r.rtcpMuxPolicy="require"}switch(r.iceTransportPolicy){case"all":case"relay":break;default:r.iceTransportPolicy="all";break;}switch(r.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:r.bundlePolicy="balanced";break;}r.iceServers=n(r.iceServers||[],t);this._iceGatherers=[];if(r.iceCandidatePoolSize){for(var s=r.iceCandidatePoolSize;0<s;s--){this._iceGatherers.push(new e.RTCIceGatherer({iceServers:r.iceServers,gatherPolicy:r.iceTransportPolicy}))}}else{r.iceCandidatePoolSize=0}this._config=r;this.transceivers=[];this._sdpSessionId=c.generateSessionId();this._sdpSessionVersion=0;this._dtlsRole=void 0;this._isClosed=!1};Object.defineProperty(f.prototype,"localDescription",{configurable:!0,get:function get(){return this._localDescription}});Object.defineProperty(f.prototype,"remoteDescription",{configurable:!0,get:function get(){return this._remoteDescription}});f.prototype.onicecandidate=null;f.prototype.onaddstream=null;f.prototype.ontrack=null;f.prototype.onremovestream=null;f.prototype.onsignalingstatechange=null;f.prototype.oniceconnectionstatechange=null;f.prototype.onconnectionstatechange=null;f.prototype.onicegatheringstatechange=null;f.prototype.onnegotiationneeded=null;f.prototype.ondatachannel=null;f.prototype._dispatchEvent=function(e,t){if(this._isClosed){return}this.dispatchEvent(t);if("function"==typeof this["on"+e]){this["on"+e](t)}};f.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)};f.prototype.getConfiguration=function(){return this._config};f.prototype.getLocalStreams=function(){return this.localStreams};f.prototype.getRemoteStreams=function(){return this.remoteStreams};f.prototype._createTransceiver=function(e,t){var r=0<this.transceivers.length,a={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&r){a.iceTransport=this.transceivers[0].iceTransport;a.dtlsTransport=this.transceivers[0].dtlsTransport}else{var n=this._createIceAndDtlsTransports();a.iceTransport=n.iceTransport;a.dtlsTransport=n.dtlsTransport}if(!t){this.transceivers.push(a)}return a};f.prototype.addTrack=function(t,r){if(this._isClosed){throw d("InvalidStateError","Attempted to call addTrack on a closed peerconnection.")}var a=this.transceivers.find(function(e){return e.track===t});if(a){throw d("InvalidAccessError","Track already exists.")}for(var n,o=0;o<this.transceivers.length;o++){if(!this.transceivers[o].track&&this.transceivers[o].kind===t.kind){n=this.transceivers[o]}}if(!n){n=this._createTransceiver(t.kind)}this._maybeFireNegotiationNeeded();if(-1===this.localStreams.indexOf(r)){this.localStreams.push(r)}n.track=t;n.stream=r;n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport);return n.rtpSender};f.prototype.addStream=function(e){var r=this;if(15025<=t){e.getTracks().forEach(function(t){r.addTrack(t,e)})}else{var a=e.clone();e.getTracks().forEach(function(e,t){var r=a.getTracks()[t];e.addEventListener("enabled",function(e){r.enabled=e.enabled})});a.getTracks().forEach(function(e){r.addTrack(e,a)})}};f.prototype.removeTrack=function(r){if(this._isClosed){throw d("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.")}if(!(r instanceof e.RTCRtpSender)){throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.")}var a=this.transceivers.find(function(e){return e.rtpSender===r});if(!a){throw d("InvalidAccessError","Sender was not created by this connection.")}var n=a.stream;a.rtpSender.stop();a.rtpSender=null;a.track=null;a.stream=null;var i=this.transceivers.map(function(e){return e.stream});if(-1===i.indexOf(n)&&-1<this.localStreams.indexOf(n)){this.localStreams.splice(this.localStreams.indexOf(n),1)}this._maybeFireNegotiationNeeded()};f.prototype.removeStream=function(e){var t=this;e.getTracks().forEach(function(e){var r=t.getSenders().find(function(t){return t.track===e});if(r){t.removeTrack(r)}})};f.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})};f.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})};f.prototype._createIceGatherer=function(t,r){var a=this;if(r&&0<t){return this.transceivers[0].iceGatherer}else if(this._iceGatherers.length){return this._iceGatherers.shift()}var n=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});Object.defineProperty(n,"state",{value:"new",writable:!0});this.transceivers[t].bufferedCandidateEvents=[];this.transceivers[t].bufferCandidates=function(e){var r=!e.candidate||0===Object.keys(e.candidate).length;n.state=r?"completed":"gathering";if(null!==a.transceivers[t].bufferedCandidateEvents){a.transceivers[t].bufferedCandidateEvents.push(e)}};n.addEventListener("localcandidate",this.transceivers[t].bufferCandidates);return n};f.prototype._gather=function(t,r){var a=this,n=this.transceivers[r].iceGatherer;if(n.onlocalcandidate){return}var i=this.transceivers[r].bufferedCandidateEvents;this.transceivers[r].bufferedCandidateEvents=null;n.removeEventListener("localcandidate",this.transceivers[r].bufferCandidates);n.onlocalcandidate=function(e){if(a.usingBundle&&0<r){return}var i=new Event("icecandidate");i.candidate={sdpMid:t,sdpMLineIndex:r};var o=e.candidate,s=!o||0===Object.keys(o).length;if(s){if("new"===n.state||"gathering"===n.state){n.state="completed"}}else{if("new"===n.state){n.state="gathering"}o.component=1;o.ufrag=n.getLocalParameters().usernameFragment;var d=c.writeCandidate(o);i.candidate=Object.assign(i.candidate,c.parseCandidate(d));i.candidate.candidate=d;i.candidate.toJSON=function(){return{candidate:i.candidate.candidate,sdpMid:i.candidate.sdpMid,sdpMLineIndex:i.candidate.sdpMLineIndex,usernameFragment:i.candidate.usernameFragment}}}var p=c.getMediaSections(a._localDescription.sdp);if(!s){p[i.candidate.sdpMLineIndex]+="a="+i.candidate.candidate+"\r\n"}else{p[i.candidate.sdpMLineIndex]+="a=end-of-candidates\r\n"}a._localDescription.sdp=c.getDescription(a._localDescription.sdp)+p.join("");var l=a.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});if("gathering"!==a.iceGatheringState){a.iceGatheringState="gathering";a._emitGatheringStateChange()}if(!s){a._dispatchEvent("icecandidate",i)}if(l){a._dispatchEvent("icecandidate",new Event("icecandidate"));a.iceGatheringState="complete";a._emitGatheringStateChange()}};e.setTimeout(function(){i.forEach(function(t){n.onlocalcandidate(t)})},0)};f.prototype._createIceAndDtlsTransports=function(){var t=this,r=new e.RTCIceTransport(null);r.onicestatechange=function(){t._updateIceConnectionState();t._updateConnectionState()};var a=new e.RTCDtlsTransport(r);a.ondtlsstatechange=function(){t._updateConnectionState()};a.onerror=function(){Object.defineProperty(a,"state",{value:"failed",writable:!0});t._updateConnectionState()};return{iceTransport:r,dtlsTransport:a}};f.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;if(t){delete t.onlocalcandidate;delete this.transceivers[e].iceGatherer}var r=this.transceivers[e].iceTransport;if(r){delete r.onicestatechange;delete this.transceivers[e].iceTransport}var a=this.transceivers[e].dtlsTransport;if(a){delete a.ondtlsstatechange;delete a.onerror;delete this.transceivers[e].dtlsTransport}};f.prototype._transceive=function(e,r,a){var n=i(e.localCapabilities,e.remoteCapabilities);if(r&&e.rtpSender){n.encodings=e.sendEncodingParameters;n.rtcp={cname:c.localCName,compound:e.rtcpParameters.compound};if(e.recvEncodingParameters.length){n.rtcp.ssrc=e.recvEncodingParameters[0].ssrc}e.rtpSender.send(n)}if(a&&e.rtpReceiver&&0<n.codecs.length){if("video"===e.kind&&e.recvEncodingParameters&&15019>t){e.recvEncodingParameters.forEach(function(e){delete e.rtx})}if(e.recvEncodingParameters.length){n.encodings=e.recvEncodingParameters}else{n.encodings=[{}]}n.rtcp={compound:e.rtcpParameters.compound};if(e.rtcpParameters.cname){n.rtcp.cname=e.rtcpParameters.cname}if(e.sendEncodingParameters.length){n.rtcp.ssrc=e.sendEncodingParameters[0].ssrc}e.rtpReceiver.receive(n)}};f.prototype.setLocalDescription=function(e){var t=this;if(-1===["offer","answer"].indexOf(e.type)){return Promise.reject(d("TypeError","Unsupported type \""+e.type+"\""))}if(!o("setLocalDescription",e.type,t.signalingState)||t._isClosed){return Promise.reject(d("InvalidStateError","Can not set local "+e.type+" in state "+t.signalingState))}var r,a;if("offer"===e.type){r=c.splitSections(e.sdp);a=r.shift();r.forEach(function(e,r){var a=c.parseRtpParameters(e);t.transceivers[r].localCapabilities=a});t.transceivers.forEach(function(e,r){t._gather(e.mid,r)})}else if("answer"===e.type){r=c.splitSections(t._remoteDescription.sdp);a=r.shift();var n=0<c.matchPrefix(a,"a=ice-lite").length;r.forEach(function(e,r){var o=t.transceivers[r],s=o.iceGatherer,d=o.iceTransport,p=o.dtlsTransport,l=o.localCapabilities,m=o.remoteCapabilities,f=c.isRejected(e)&&0===c.matchPrefix(e,"a=bundle-only").length;if(!f&&!o.rejected){var h=c.getIceParameters(e,a),g=c.getDtlsParameters(e,a);if(n){g.role="server"}if(!t.usingBundle||0===r){t._gather(o.mid,r);if("new"===d.state){d.start(s,h,n?"controlling":"controlled")}if("new"===p.state){p.start(g)}}var u=i(l,m);t._transceive(o,0<u.codecs.length,!1)}})}t._localDescription={type:e.type,sdp:e.sdp};if("offer"===e.type){t._updateSignalingState("have-local-offer")}else{t._updateSignalingState("stable")}return Promise.resolve()};f.prototype.setRemoteDescription=function(r){var a=this;if(-1===["offer","answer"].indexOf(r.type)){return Promise.reject(d("TypeError","Unsupported type \""+r.type+"\""))}if(!o("setRemoteDescription",r.type,a.signalingState)||a._isClosed){return Promise.reject(d("InvalidStateError","Can not set remote "+r.type+" in state "+a.signalingState))}var n={};a.remoteStreams.forEach(function(e){n[e.id]=e});var f=[],h=c.splitSections(r.sdp),g=h.shift(),u=0<c.matchPrefix(g,"a=ice-lite").length,y=0<c.matchPrefix(g,"a=group:BUNDLE ").length;a.usingBundle=y;var v=c.matchPrefix(g,"a=ice-options:")[0];if(v){a.canTrickleIceCandidates=0<=v.substr(14).split(" ").indexOf("trickle")}else{a.canTrickleIceCandidates=!1}h.forEach(function(o,d){var m=c.splitLines(o),h=c.getKind(o),v=c.isRejected(o)&&0===c.matchPrefix(o,"a=bundle-only").length,C=m[0].substr(2).split(" ")[2],T=c.getDirection(o,g),S=c.parseMsid(o),R=c.getMid(o)||c.generateIdentifier();if(v||"application"===h&&("DTLS/SCTP"===C||"UDP/DTLS/SCTP"===C)){a.transceivers[d]={mid:R,kind:h,protocol:C,rejected:!0};return}if(!v&&a.transceivers[d]&&a.transceivers[d].rejected){a.transceivers[d]=a._createTransceiver(h,!0)}var P,_,E,k,b,x,M,D,I,w=c.parseRtpParameters(o),L,G;if(!v){L=c.getIceParameters(o,g);G=c.getDtlsParameters(o,g);G.role="client"}M=c.parseRtpEncodingParameters(o);var j=c.parseRtcpParameters(o),O=0<c.matchPrefix(o,"a=end-of-candidates",g).length,A=c.matchPrefix(o,"a=candidate:").map(function(e){return c.parseCandidate(e)}).filter(function(e){return 1===e.component});if(("offer"===r.type||"answer"===r.type)&&!v&&y&&0<d&&a.transceivers[d]){a._disposeIceAndDtlsTransports(d);a.transceivers[d].iceGatherer=a.transceivers[0].iceGatherer;a.transceivers[d].iceTransport=a.transceivers[0].iceTransport;a.transceivers[d].dtlsTransport=a.transceivers[0].dtlsTransport;if(a.transceivers[d].rtpSender){a.transceivers[d].rtpSender.setTransport(a.transceivers[0].dtlsTransport)}if(a.transceivers[d].rtpReceiver){a.transceivers[d].rtpReceiver.setTransport(a.transceivers[0].dtlsTransport)}}if("offer"===r.type&&!v){P=a.transceivers[d]||a._createTransceiver(h);P.mid=R;if(!P.iceGatherer){P.iceGatherer=a._createIceGatherer(d,y)}if(A.length&&"new"===P.iceTransport.state){if(O&&(!y||0===d)){P.iceTransport.setRemoteCandidates(A)}else{A.forEach(function(e){s(P.iceTransport,e)})}}D=e.RTCRtpReceiver.getCapabilities(h);if(15019>t){D.codecs=D.codecs.filter(function(e){return"rtx"!==e.name})}x=P.sendEncodingParameters||[{ssrc:1001*(2*d+2)}];var U=!1;if("sendrecv"===T||"sendonly"===T){U=!P.rtpReceiver;b=P.rtpReceiver||new e.RTCRtpReceiver(P.dtlsTransport,h);if(U){var F;I=b.track;if(S&&"-"===S.stream){}else if(S){if(!n[S.stream]){n[S.stream]=new e.MediaStream;Object.defineProperty(n[S.stream],"id",{get:function get(){return S.stream}})}Object.defineProperty(I,"id",{get:function get(){return S.track}});F=n[S.stream]}else{if(!n.default){n.default=new e.MediaStream}F=n.default}if(F){p(I,F);P.associatedRemoteMediaStreams.push(F)}f.push([I,b,F])}}else if(P.rtpReceiver&&P.rtpReceiver.track){P.associatedRemoteMediaStreams.forEach(function(e){var t=e.getTracks().find(function(e){return e.id===P.rtpReceiver.track.id});if(t){l(t,e)}});P.associatedRemoteMediaStreams=[]}P.localCapabilities=D;P.remoteCapabilities=w;P.rtpReceiver=b;P.rtcpParameters=j;P.sendEncodingParameters=x;P.recvEncodingParameters=M;a._transceive(a.transceivers[d],!1,U)}else if("answer"===r.type&&!v){P=a.transceivers[d];_=P.iceGatherer;E=P.iceTransport;k=P.dtlsTransport;b=P.rtpReceiver;x=P.sendEncodingParameters;D=P.localCapabilities;a.transceivers[d].recvEncodingParameters=M;a.transceivers[d].remoteCapabilities=w;a.transceivers[d].rtcpParameters=j;if(A.length&&"new"===E.state){if((u||O)&&(!y||0===d)){E.setRemoteCandidates(A)}else{A.forEach(function(e){s(P.iceTransport,e)})}}if(!y||0===d){if("new"===E.state){E.start(_,L,"controlling")}if("new"===k.state){k.start(G)}}var N=i(P.localCapabilities,P.remoteCapabilities),z=N.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length;if(!z&&P.sendEncodingParameters[0].rtx){delete P.sendEncodingParameters[0].rtx}a._transceive(P,"sendrecv"===T||"recvonly"===T,"sendrecv"===T||"sendonly"===T);if(b&&("sendrecv"===T||"sendonly"===T)){I=b.track;if(S){if(!n[S.stream]){n[S.stream]=new e.MediaStream}p(I,n[S.stream]);f.push([I,b,n[S.stream]])}else{if(!n.default){n.default=new e.MediaStream}p(I,n.default);f.push([I,b,n.default])}}else{delete P.rtpReceiver}}});if(a._dtlsRole===void 0){a._dtlsRole="offer"===r.type?"active":"passive"}a._remoteDescription={type:r.type,sdp:r.sdp};if("offer"===r.type){a._updateSignalingState("have-remote-offer")}else{a._updateSignalingState("stable")}Object.keys(n).forEach(function(t){var r=n[t];if(r.getTracks().length){if(-1===a.remoteStreams.indexOf(r)){a.remoteStreams.push(r);var i=new Event("addstream");i.stream=r;e.setTimeout(function(){a._dispatchEvent("addstream",i)})}f.forEach(function(e){var t=e[0],n=e[1];if(r.id!==e[2].id){return}m(a,t,n,[r])})}});f.forEach(function(e){if(e[2]){return}m(a,e[0],e[1],[])});e.setTimeout(function(){if(!(a&&a.transceivers)){return}a.transceivers.forEach(function(e){if(e.iceTransport&&"new"===e.iceTransport.state&&0<e.iceTransport.getRemoteCandidates().length){console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification");e.iceTransport.addRemoteCandidate({})}})},4e3);return Promise.resolve()};f.prototype.close=function(){this.transceivers.forEach(function(e){if(e.iceTransport){e.iceTransport.stop()}if(e.dtlsTransport){e.dtlsTransport.stop()}if(e.rtpSender){e.rtpSender.stop()}if(e.rtpReceiver){e.rtpReceiver.stop()}});this._isClosed=!0;this._updateSignalingState("closed")};f.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)};f.prototype._maybeFireNegotiationNeeded=function(){var t=this;if("stable"!==this.signalingState||!0===this.needNegotiation){return}this.needNegotiation=!0;e.setTimeout(function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}},0)};f.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(e){if(e.iceTransport&&!e.rejected){t[e.iceTransport.state]++}});e="new";if(0<t.failed){e="failed"}else if(0<t.checking){e="checking"}else if(0<t.disconnected){e="disconnected"}else if(0<t.new){e="new"}else if(0<t.connected){e="connected"}else if(0<t.completed){e="completed"}if(e!==this.iceConnectionState){this.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",r)}};f.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(e){if(e.iceTransport&&e.dtlsTransport&&!e.rejected){t[e.iceTransport.state]++;t[e.dtlsTransport.state]++}});t.connected+=t.completed;e="new";if(0<t.failed){e="failed"}else if(0<t.connecting){e="connecting"}else if(0<t.disconnected){e="disconnected"}else if(0<t.new){e="new"}else if(0<t.connected){e="connected"}if(e!==this.connectionState){this.connectionState=e;var r=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",r)}};f.prototype.createOffer=function(){var r=this;if(r._isClosed){return Promise.reject(d("InvalidStateError","Can not call createOffer after close"))}var n=r.transceivers.filter(function(e){return"audio"===e.kind}).length,i=r.transceivers.filter(function(e){return"video"===e.kind}).length,o=arguments[0];if(o){if(o.mandatory||o.optional){throw new TypeError("Legacy mandatory/optional constraints not supported.")}if(o.offerToReceiveAudio!==void 0){if(!0===o.offerToReceiveAudio){n=1}else if(!1===o.offerToReceiveAudio){n=0}else{n=o.offerToReceiveAudio}}if(o.offerToReceiveVideo!==void 0){if(!0===o.offerToReceiveVideo){i=1}else if(!1===o.offerToReceiveVideo){i=0}else{i=o.offerToReceiveVideo}}}r.transceivers.forEach(function(e){if("audio"===e.kind){n--;if(0>n){e.wantReceive=!1}}else if("video"===e.kind){i--;if(0>i){e.wantReceive=!1}}});while(0<n||0<i){if(0<n){r._createTransceiver("audio");n--}if(0<i){r._createTransceiver("video");i--}}var s=c.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.transceivers.forEach(function(a,n){var i=a.track,o=a.kind,s=a.mid||c.generateIdentifier();a.mid=s;if(!a.iceGatherer){a.iceGatherer=r._createIceGatherer(n,r.usingBundle)}var d=e.RTCRtpSender.getCapabilities(o);if(15019>t){d.codecs=d.codecs.filter(function(e){return"rtx"!==e.name})}d.codecs.forEach(function(e){if("H264"===e.name&&e.parameters["level-asymmetry-allowed"]===void 0){e.parameters["level-asymmetry-allowed"]="1"}if(a.remoteCapabilities&&a.remoteCapabilities.codecs){a.remoteCapabilities.codecs.forEach(function(t){if(e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate){e.preferredPayloadType=t.payloadType}})}});d.headerExtensions.forEach(function(e){var t=a.remoteCapabilities&&a.remoteCapabilities.headerExtensions||[];t.forEach(function(t){if(e.uri===t.uri){e.id=t.id}})});var p=a.sendEncodingParameters||[{ssrc:1001*(2*n+1)}];if(i){if(15019<=t&&"video"===o&&!p[0].rtx){p[0].rtx={ssrc:p[0].ssrc+1}}}if(a.wantReceive){a.rtpReceiver=new e.RTCRtpReceiver(a.dtlsTransport,o)}a.localCapabilities=d;a.sendEncodingParameters=p});if("max-compat"!==r._config.bundlePolicy){s+="a=group:BUNDLE "+r.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"}s+="a=ice-options:trickle\r\n";r.transceivers.forEach(function(e,t){s+=a(e,e.localCapabilities,"offer",e.stream,r._dtlsRole);s+="a=rtcp-rsize\r\n";if(e.iceGatherer&&"new"!==r.iceGatheringState&&(0===t||!r.usingBundle)){e.iceGatherer.getLocalCandidates().forEach(function(e){e.component=1;s+="a="+c.writeCandidate(e)+"\r\n"});if("completed"===e.iceGatherer.state){s+="a=end-of-candidates\r\n"}}});var p=new e.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(p)};f.prototype.createAnswer=function(){var r=this;if(r._isClosed){return Promise.reject(d("InvalidStateError","Can not call createAnswer after close"))}if(!("have-remote-offer"===r.signalingState||"have-local-pranswer"===r.signalingState)){return Promise.reject(d("InvalidStateError","Can not call createAnswer in signalingState "+r.signalingState))}var n=c.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);if(r.usingBundle){n+="a=group:BUNDLE "+r.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"}n+="a=ice-options:trickle\r\n";var o=c.getMediaSections(r._remoteDescription.sdp).length;r.transceivers.forEach(function(e,s){if(s+1>o){return}if(e.rejected){if("application"===e.kind){if("DTLS/SCTP"===e.protocol){n+="m=application 0 DTLS/SCTP 5000\r\n"}else{n+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n"}}else if("audio"===e.kind){n+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n"}else if("video"===e.kind){n+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"}n+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n";return}if(e.stream){var d;if("audio"===e.kind){d=e.stream.getAudioTracks()[0]}else if("video"===e.kind){d=e.stream.getVideoTracks()[0]}if(d){if(15019<=t&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx){e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}}}}var c=i(e.localCapabilities,e.remoteCapabilities),p=c.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length;if(!p&&e.sendEncodingParameters[0].rtx){delete e.sendEncodingParameters[0].rtx}n+=a(e,c,"answer",e.stream,r._dtlsRole);if(e.rtcpParameters&&e.rtcpParameters.reducedSize){n+="a=rtcp-rsize\r\n"}});var s=new e.RTCSessionDescription({type:"answer",sdp:n});return Promise.resolve(s)};f.prototype.addIceCandidate=function(e){var t=this,r;if(e&&!(e.sdpMLineIndex!==void 0||e.sdpMid)){return Promise.reject(new TypeError("sdpMLineIndex or sdpMid required"))}return new Promise(function(a,n){if(!t._remoteDescription){return n(d("InvalidStateError","Can not add ICE candidate without a remote description"))}else if(!e||""===e.candidate){for(var o=0;o<t.transceivers.length;o++){if(t.transceivers[o].rejected){continue}t.transceivers[o].iceTransport.addRemoteCandidate({});r=c.getMediaSections(t._remoteDescription.sdp);r[o]+="a=end-of-candidates\r\n";t._remoteDescription.sdp=c.getDescription(t._remoteDescription.sdp)+r.join("");if(t.usingBundle){break}}}else{var p=e.sdpMLineIndex;if(e.sdpMid){for(var l=0;l<t.transceivers.length;l++){if(t.transceivers[l].mid===e.sdpMid){p=l;break}}}var m=t.transceivers[p];if(m){if(m.rejected){return a()}var f=0<Object.keys(e.candidate).length?c.parseCandidate(e.candidate):{};if("tcp"===f.protocol&&(0===f.port||9===f.port)){return a()}if(f.component&&1!==f.component){return a()}if(0===p||0<p&&m.iceTransport!==t.transceivers[0].iceTransport){if(!s(m.iceTransport,f)){return n(d("OperationError","Can not add ICE candidate"))}}var h=e.candidate.trim();if(0===h.indexOf("a=")){h=h.substr(2)}r=c.getMediaSections(t._remoteDescription.sdp);r[p]+="a="+(f.type?h:"end-of-candidates")+"\r\n";t._remoteDescription.sdp=c.getDescription(t._remoteDescription.sdp)+r.join("")}else{return n(d("OperationError","Can not add ICE candidate"))}}a()})};f.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var r=null;this.transceivers.forEach(function(e){if(e.rtpSender&&e.rtpSender.track===t){r=e.rtpSender}else if(e.rtpReceiver&&e.rtpReceiver.track===t){r=e.rtpReceiver}});if(!r){throw d("InvalidAccessError","Invalid selector.")}return r.getStats()}var a=[];this.transceivers.forEach(function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(t){if(e[t]){a.push(e[t].getStats())}})});return Promise.all(a).then(function(e){var t=new Map;e.forEach(function(e){e.forEach(function(e){t.set(e.id,e)})});return t})};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach(function(t){var a=e[t];if(a&&a.prototype&&a.prototype.getStats){var n=a.prototype.getStats;a.prototype.getStats=function(){return n.apply(this).then(function(e){var t=new Map;Object.keys(e).forEach(function(a){e[a].type=r(e[a]);t.set(a,e[a])});return t})}}});var h=["createOffer","createAnswer"];h.forEach(function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;if("function"==typeof e[0]||"function"==typeof e[1]){return t.apply(this,[arguments[2]]).then(function(t){if("function"==typeof e[0]){e[0].apply(null,[t])}},function(t){if("function"==typeof e[1]){e[1].apply(null,[t])}})}return t.apply(this,arguments)}});h=["setLocalDescription","setRemoteDescription","addIceCandidate"];h.forEach(function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;if("function"==typeof e[1]||"function"==typeof e[2]){return t.apply(this,arguments).then(function(){if("function"==typeof e[1]){e[1].apply(null)}},function(t){if("function"==typeof e[2]){e[2].apply(null,[t])}})}return t.apply(this,arguments)}});["getStats"].forEach(function(e){var t=f.prototype[e];f.prototype[e]=function(){var e=arguments;if("function"==typeof e[1]){return t.apply(this,arguments).then(function(){if("function"==typeof e[1]){e[1].apply(null)}})}return t.apply(this,arguments)}});return f}},{sdp:17}],17:[function(e,t){'use strict';var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier();r.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})};r.splitSections=function(e){var t=e.split("\nm=");return t.map(function(e,t){return(0<t?"m="+e:e).trim()+"\r\n"})};r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]};r.getMediaSections=function(e){var t=r.splitSections(e);t.shift();return t};r.matchPrefix=function(e,t){return r.splitLines(e).filter(function(e){return 0===e.indexOf(t)})};r.parseCandidate=function(e){var t;if(0===e.indexOf("a=candidate:")){t=e.substring(12).split(" ")}else{t=e.substring(10).split(" ")}for(var r={foundation:t[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},a=8;a<t.length;a+=2){switch(t[a]){case"raddr":r.relatedAddress=t[a+1];break;case"rport":r.relatedPort=parseInt(t[a+1],10);break;case"tcptype":r.tcpType=t[a+1];break;case"ufrag":r.ufrag=t[a+1];r.usernameFragment=t[a+1];break;default:r[t[a]]=t[a+1];break;}}return r};r.writeCandidate=function(e){var t=[e.foundation,e.component,e.protocol.toUpperCase(),e.priority,e.address||e.ip,e.port],r=e.type;t.push("typ");t.push(r);if("host"!==r&&e.relatedAddress&&e.relatedPort){t.push("raddr");t.push(e.relatedAddress);t.push("rport");t.push(e.relatedPort)}if(e.tcpType&&"tcp"===e.protocol.toLowerCase()){t.push("tcptype");t.push(e.tcpType)}if(e.usernameFragment||e.ufrag){t.push("ufrag");t.push(e.usernameFragment||e.ufrag)}return"candidate:"+t.join(" ")};r.parseIceOptions=function(e){return e.substr(14).split(" ")};r.parseRtpMap=function(e){var t=e.substr(9).split(" "),r={payloadType:parseInt(t.shift(),10)};t=t[0].split("/");r.name=t[0];r.clockRate=parseInt(t[1],10);r.channels=3===t.length?parseInt(t[2],10):1;r.numChannels=r.channels;return r};r.writeRtpMap=function(e){var t=e.payloadType;if(e.preferredPayloadType!==void 0){t=e.preferredPayloadType}var r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"};r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:0<t[0].indexOf("/")?t[0].split("/")[1]:"sendrecv",uri:t[1]}};r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"};r.parseFmtp=function(e){for(var t={},r,a=e.substr(e.indexOf(" ")+1).split(";"),n=0;n<a.length;n++){r=a[n].trim().split("=");t[r[0].trim()]=r[1]}return t};r.writeFmtp=function(e){var t="",r=e.payloadType;if(e.preferredPayloadType!==void 0){r=e.preferredPayloadType}if(e.parameters&&Object.keys(e.parameters).length){var a=[];Object.keys(e.parameters).forEach(function(t){if(e.parameters[t]){a.push(t+"="+e.parameters[t])}else{a.push(t)}});t+="a=fmtp:"+r+" "+a.join(";")+"\r\n"}return t};r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}};r.writeRtcpFb=function(e){var t="",r=e.payloadType;if(e.preferredPayloadType!==void 0){r=e.preferredPayloadType}if(e.rtcpFeedback&&e.rtcpFeedback.length){e.rtcpFeedback.forEach(function(e){t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})}return t};r.parseSsrcMedia=function(e){var t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},a=e.indexOf(":",t);if(-1<a){r.attribute=e.substr(t+1,a-t-1);r.value=e.substr(a+1)}else{r.attribute=e.substr(t+1)}return r};r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map(function(e){return parseInt(e,10)})}};r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t){return t.substr(6)}};r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}};r.getDtlsParameters=function(e,t){var a=r.matchPrefix(e+t,"a=fingerprint:");return{role:"auto",fingerprints:a.map(r.parseFingerprint)}};r.writeDtlsParameters=function(e,t){var r="a=setup:"+t+"\r\n";e.fingerprints.forEach(function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"});return r};r.getIceParameters=function(e,t){var a=r.splitLines(e);a=a.concat(r.splitLines(t));var n={usernameFragment:a.filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:a.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)};return n};r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"};r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},a=r.splitLines(e),n=a[0].split(" "),o=3;o<n.length;o++){var s=n[o],d=r.matchPrefix(e,"a=rtpmap:"+s+" ")[0];if(d){var c=r.parseRtpMap(d),p=r.matchPrefix(e,"a=fmtp:"+s+" ");c.parameters=p.length?r.parseFmtp(p[0]):{};c.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+s+" ").map(r.parseRtcpFb);t.codecs.push(c);switch(c.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(c.name.toUpperCase());break;default:break;}}}r.matchPrefix(e,"a=extmap:").forEach(function(e){t.headerExtensions.push(r.parseExtmap(e))});return t};r.writeRtpDescription=function(e,t){var a="";a+="m="+e+" ";a+=0<t.codecs.length?"9":"0";a+=" UDP/TLS/RTP/SAVPF ";a+=t.codecs.map(function(e){if(e.preferredPayloadType!==void 0){return e.preferredPayloadType}return e.payloadType}).join(" ")+"\r\n";a+="c=IN IP4 0.0.0.0\r\n";a+="a=rtcp:9 IN IP4 0.0.0.0\r\n";t.codecs.forEach(function(e){a+=r.writeRtpMap(e);a+=r.writeFmtp(e);a+=r.writeRtcpFb(e)});var n=0;t.codecs.forEach(function(e){if(e.maxptime>n){n=e.maxptime}});if(0<n){a+="a=maxptime:"+n+"\r\n"}a+="a=rtcp-mux\r\n";if(t.headerExtensions){t.headerExtensions.forEach(function(e){a+=r.writeExtmap(e)})}return a};r.parseRtpEncodingParameters=function(e){var t=[],a=r.parseRtpParameters(e),n=-1!==a.fecMechanisms.indexOf("RED"),i=-1!==a.fecMechanisms.indexOf("ULPFEC"),o=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),s=0<o.length&&o[0].ssrc,d,c=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.substr(17).split(" ");return t.map(function(e){return parseInt(e,10)})});if(0<c.length&&1<c[0].length&&c[0][0]===s){d=c[0][1]}a.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};if(s&&d){r.rtx={ssrc:d}}t.push(r);if(n){r=JSON.parse(JSON.stringify(r));r.fec={ssrc:s,mechanism:i?"red+ulpfec":"red"};t.push(r)}}});if(0===t.length&&s){t.push({ssrc:s})}var p=r.matchPrefix(e,"b=");if(p.length){if(0===p[0].indexOf("b=TIAS:")){p=parseInt(p[0].substr(7),10)}else if(0===p[0].indexOf("b=AS:")){p=.95*(1e3*parseInt(p[0].substr(5),10))-16000}else{p=void 0}t.forEach(function(e){e.maxBitrate=p})}return t};r.parseRtcpParameters=function(e){var t={},a=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];if(a){t.cname=a.value;t.ssrc=a.ssrc}var n=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=0<n.length;t.compound=0===n.length;var i=r.matchPrefix(e,"a=rtcp-mux");t.mux=0<i.length;return t};r.parseMsid=function(e){var t,a=r.matchPrefix(e,"a=msid:");if(1===a.length){t=a[0].substr(7).split(" ");return{stream:t[0],track:t[1]}}var n=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});if(0<n.length){t=n[0].value.split(" ");return{stream:t[0],track:t[1]}}};r.parseSctpDescription=function(e){var t=r.parseMLine(e),a=r.matchPrefix(e,"a=max-message-size:"),n;if(0<a.length){n=parseInt(a[0].substr(19),10)}if(isNaN(n)){n=65536}var i=r.matchPrefix(e,"a=sctp-port:");if(0<i.length){return{port:parseInt(i[0].substr(12),10),protocol:t.fmt,maxMessageSize:n}}var o=r.matchPrefix(e,"a=sctpmap:");if(0<o.length){var s=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:n}}};r.writeSctpDescription=function(e,t){var r=[];if("DTLS/SCTP"!==e.protocol){r=["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]}else{r=["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"]}if(t.maxMessageSize!==void 0){r.push("a=max-message-size:"+t.maxMessageSize+"\r\n")}return r.join("")};r.generateSessionId=function(){return Math.random().toString().substr(2,21)};r.writeSessionBoilerplate=function(e,t,a){var n,i=t!==void 0?t:2;if(e){n=e}else{n=r.generateSessionId()}return"v=0\r\no="+(a||"thisisadapterortc")+" "+n+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"};r.writeMediaSection=function(e,t,a,n){var i=r.writeRtpDescription(e.kind,t);i+=r.writeIceParameters(e.iceGatherer.getLocalParameters());i+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===a?"actpass":"active");i+="a=mid:"+e.mid+"\r\n";if(e.direction){i+="a="+e.direction+"\r\n"}else if(e.rtpSender&&e.rtpReceiver){i+="a=sendrecv\r\n"}else if(e.rtpSender){i+="a=sendonly\r\n"}else if(e.rtpReceiver){i+="a=recvonly\r\n"}else{i+="a=inactive\r\n"}if(e.rtpSender){var o="msid:"+n.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+o;i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+o;if(e.sendEncodingParameters[0].rtx){i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+o;i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n"}}i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n";if(e.rtpSender&&e.sendEncodingParameters[0].rtx){i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"}return i};r.getDirection=function(e,t){for(var a=r.splitLines(e),n=0;n<a.length;n++){switch(a[n]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return a[n].substr(2);default:}}if(t){return r.getDirection(t)}return"sendrecv"};r.getKind=function(e){var t=r.splitLines(e),a=t[0].split(" ");return a[0].substr(2)};r.isRejected=function(e){return"0"===e.split(" ",2)[1]};r.parseMLine=function(e){var t=r.splitLines(e),a=t[0].substr(2).split(" ");return{kind:a[0],port:parseInt(a[1],10),protocol:a[2],fmt:a.slice(3).join(" ")}};r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0],a=t.substr(2).split(" ");return{username:a[0],sessionId:a[1],sessionVersion:parseInt(a[2],10),netType:a[3],addressType:a[4],address:a[5]}};r.isValidSDP=function(e){if("string"!=typeof e||0===e.length){return!1}for(var t=r.splitLines(e),a=0;a<t.length;a++){if(2>t[a].length||"="!==t[a].charAt(1)){return!1}}return!0};if("object"===_typeof2(t)){t.exports=r}},{}]},{},[1])(1)});
define ("core/backoff_timer",function(){var a=function(a,b){this.callback=a;this.backOffFunction=b};a.prototype.callback=null;a.prototype.backOffFunction=null;a.prototype.time=null;a.prototype.timeout=null;a.prototype.generateNextTime=function(){var a=this.backOffFunction(this.time);this.time=a;return a};a.prototype.reset=function(){this.time=null;this.stop();return this};a.prototype.stop=function(){if(this.timeout){window.clearTimeout(this.timeout);this.timeout=null}return this};a.prototype.start=function(){if(!this.timeout){var a=this.generateNextTime();this.timeout=window.setTimeout(function(){this.callback();this.stop();this.start()}.bind(this),a)}return this};a.prototype.restart=function(){return this.reset().start()};a.getIncrementalCallback=function(a,b,c,d){return function(e){if(!e){return a}if(e+b>c){return d}return e+b}};return a});
define ("core/localstorage",["core/config","core/storagewrapper"],function(a,b){var c=new b(window.localStorage);return{get:function get(a){return c.get(a)},set:function set(a,b){return c.set(a,b)}}});
define ("core/autoscroll",["jquery"],function(a){var b={SCROLL_THRESHOLD:30,SCROLL_FREQUENCY:1e3/60,SCROLL_SPEED:.5,scrollingId:null,scrollAmount:0,callback:null,start:function start(c){a(window).on("mousemove",b.mouseMove);a(window).on("touchmove",b.touchMove);b.callback=c},stop:function stop(){a(window).off("mousemove",b.mouseMove);a(window).off("touchmove",b.touchMove);if(null!==b.scrollingId){b.stopScrolling()}},touchMove:function touchMove(a){for(var c=0;c<a.changedTouches.length;c++){b.handleMove(a.changedTouches[c].clientX,a.changedTouches[c].clientY)}},mouseMove:function mouseMove(a){b.handleMove(a.clientX,a.clientY)},handleMove:function handleMove(c,d){if(d<b.SCROLL_THRESHOLD){b.scrollAmount=-Math.min(b.SCROLL_THRESHOLD-d,b.SCROLL_THRESHOLD)}else if(d>a(window).height()-b.SCROLL_THRESHOLD){b.scrollAmount=Math.min(d-(a(window).height()-b.SCROLL_THRESHOLD),b.SCROLL_THRESHOLD)}else{b.scrollAmount=0}if(b.scrollAmount&&null===b.scrollingId){b.startScrolling()}else if(!b.scrollAmount&&null!==b.scrollingId){b.stopScrolling()}},startScrolling:function startScrolling(){var c=a(document).height()-a(window).height();b.scrollingId=window.setInterval(function(){var d=a(window).scrollTop(),e=Math.round(b.scrollAmount*b.SCROLL_SPEED);if(0>d+e){e=-d}if(d+e>c){e=c-d}if(0===e){return}a(window).scrollTop(d+e);var f=a(window).scrollTop()-d;if(0==f){return}if(b.callback){b.callback(f)}},b.SCROLL_FREQUENCY)},stopScrolling:function stopScrolling(){window.clearInterval(b.scrollingId);b.scrollingId=null}};return{start:b.start,stop:b.stop}});
define ("core/modal_registry",["core/notification","core/prefetch"],function(a,b){var c={},d=function(a){return c[a]};return{register:function register(e,f,g){if(d(e)){a.exception({message:"Modal of  type '"+e+"' is already registered"})}if(!f||"function"!=typeof f){a.exception({message:"You must provide a modal module"})}if(!g){a.exception({message:"You must provide a modal template"})}c[e]={module:f,template:g};b.prefetchTemplate(g)},get:d}});
define ("core/event",["jquery","core/yui"],function(a,b){return{Events:{FORM_FIELD_VALIDATION:"core_form-field-validation"},getLegacyEvents:function getLegacyEvents(){var c=a.Deferred();b.use("event","moodle-core-event",function(){c.resolve(window.M.core.event)});return c.promise()},notifyFilterContentUpdated:function notifyFilterContentUpdated(c){c=a(c);b.use("event","moodle-core-event",function(b){a(document).trigger(M.core.event.FILTER_CONTENT_UPDATED,[c]);var d=new b.NodeList(c.get());b.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:d})})},notifyFormSubmitAjax:function notifyFormSubmitAjax(c,d){d=d||!1;b.use("event","moodle-core-event",function(b){if(d){window.skipClientValidation=!0}a(c).trigger(M.core.event.FORM_SUBMIT_AJAX);b.one(c).fire(M.core.event.FORM_SUBMIT_AJAX,{currentTarget:b.one(c)});if(d){window.skipClientValidation=!1}})},notifyEditorContentRestored:function notifyEditorContentRestored(){b.use("event","moodle-core-event",function(b){a(document).trigger(M.core.event.EDITOR_CONTENT_RESTORED);b.fire(M.core.event.EDITOR_CONTENT_RESTORED)})}}});
function _typeof(e){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(e){return typeof e}}else{_typeof=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}(function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define ("core/popper",t):e.Popper=t()})(this,function(){'use strict';for(var _="undefined"!=typeof window&&"undefined"!=typeof window.document,X=["Edge","Trident","Firefox"],J=0,Q=0;Q<X.length;Q+=1){if(_&&0<=navigator.userAgent.indexOf(X[Q])){J=1;break}}var Z=_&&window.Promise,$=Z?function(e){var t=!1;return function(){if(t){return}t=!0;Promise.resolve().then(function(){t=!1;e()})}}:function(e){var t=!1;return function(){if(!t){t=!0;setTimeout(function(){t=!1;e()},J)}}};function e(e){return e&&"[object Function]"==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType){return[]}var o=window.getComputedStyle(e,null);return t?o[t]:o}function o(e){if("HTML"===e.nodeName){return e}return e.parentNode||e.host}function n(e){if(!e){return window.document.body}switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;if(/(auto|scroll)/.test(r+s+p)){return e}return n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;if(!i||"BODY"===i||"HTML"===i){if(e){return e.ownerDocument.documentElement}return window.document.documentElement}if(-1!==["TD","TABLE"].indexOf(o.nodeName)&&"static"===t(o,"position")){return r(o)}return o}function p(e){var t=e.nodeName;if("BODY"===t){return!1}return"HTML"===t||r(e.firstElementChild)===e}function s(e){if(null!==e.parentNode){return s(e.parentNode)}return e}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType){return window.document.documentElement}var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0);a.setEnd(n,0);var l=a.commonAncestorContainer;if(e!==l&&t!==l||i.contains(n)){if(p(l)){return l}return r(l)}var f=s(e);if(f.host){return d(f.host,t)}else{return d(e,s(t).host)}}function a(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"top",o="top"===t?"scrollTop":"scrollLeft",i=e.nodeName;if("BODY"===i||"HTML"===i){var n=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||n;return r[o]}return e[o]}function l(e,t){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!1,i=a(t,"top"),n=a(t,"left"),r=o?-1:1;e.top+=i*r;e.bottom+=i*r;e.left+=n*r;e.right+=n*r;return e}function f(e,t){var o="x"===t?"Left":"Top",i="Left"===o?"Right":"Bottom";return+e["border"+o+"Width"].split("px")[0]+ +e["border"+i+"Width"].split("px")[0]}var ee=void 0,te=function(){if(ee===void 0){ee=-1!==navigator.appVersion.indexOf("MSIE 10")}return ee};function m(e,t,o,i){return Math.max(t["offset"+e],t["scroll"+e],o["client"+e],o["offset"+e],o["scroll"+e],te()?o["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function c(){var e=window.document.body,t=window.document.documentElement,o=te()&&window.getComputedStyle(t);return{height:m("Height",e,t,o),width:m("Width",e,t,o)}}var oe=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},ie=function(){function e(e,t){for(var o=0,n;o<t.length;o++){n=t[o];n.enumerable=n.enumerable||!1;n.configurable=!0;if("value"in n)n.writable=!0;Object.defineProperty(e,n.key,n)}}return function(t,o,i){if(o)e(t.prototype,o);if(i)e(t,i);return t}}(),ne=function(e,t,o){if(t in e){Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0})}else{e[t]=o}return e},re=Object.assign||function(e){for(var t=1,o;t<arguments.length;t++){o=arguments[t];for(var n in o){if(Object.prototype.hasOwnProperty.call(o,n)){e[n]=o[n]}}}return e};function h(e){return re({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var o={};if(te()){try{o=e.getBoundingClientRect();var i=a(e,"top"),n=a(e,"left");o.top+=i;o.left+=n;o.bottom+=i;o.right+=n}catch(e){}}else{o=e.getBoundingClientRect()}var r={left:o.left,top:o.top,width:o.right-o.left,height:o.bottom-o.top},p="HTML"===e.nodeName?c():{},s=p.width||e.clientWidth||r.right-r.left,d=p.height||e.clientHeight||r.bottom-r.top,l=e.offsetWidth-s,m=e.offsetHeight-d;if(l||m){var u=t(e);l-=f(u,"x");m-=f(u,"y");r.width-=l;r.height-=m}return h(r)}function g(e,o){var i=te(),r="HTML"===o.nodeName,p=u(e),s=u(o),d=n(e),a=t(o),f=+a.borderTopWidth.split("px")[0],m=+a.borderLeftWidth.split("px")[0],c=h({top:p.top-s.top-f,left:p.left-s.left-m,width:p.width,height:p.height});c.marginTop=0;c.marginLeft=0;if(!i&&r){var g=+a.marginTop.split("px")[0],b=+a.marginLeft.split("px")[0];c.top-=f-g;c.bottom-=f-g;c.left-=m-b;c.right-=m-b;c.marginTop=g;c.marginLeft=b}if(i?o.contains(d):o===d&&"BODY"!==d.nodeName){c=l(c,o)}return c}function b(e){var t=e.ownerDocument.documentElement,o=g(e,t),i=Math.max(t.clientWidth,window.innerWidth||0),n=Math.max(t.clientHeight,window.innerHeight||0),r=a(t),p=a(t,"left"),s={top:r-o.top+o.marginTop,left:p-o.left+o.marginLeft,width:i,height:n};return h(s)}function y(e){var i=e.nodeName;if("BODY"===i||"HTML"===i){return!1}if("fixed"===t(e,"position")){return!0}return y(o(e))}function w(e,t,i,r){var p={top:0,left:0},s=d(e,t);if("viewport"===r){p=b(s)}else{var a;if("scrollParent"===r){a=n(o(e));if("BODY"===a.nodeName){a=e.ownerDocument.documentElement}}else if("window"===r){a=e.ownerDocument.documentElement}else{a=r}var l=g(a,s);if("HTML"===a.nodeName&&!y(s)){var f=c(),m=f.height,h=f.width;p.top+=l.top-l.marginTop;p.bottom=m+l.top;p.left+=l.left-l.marginLeft;p.right=h+l.left}else{p=l}}p.left+=i;p.top+=i;p.right-=i;p.bottom-=i;return p}function E(e){var t=e.width,o=e.height;return t*o}function v(e,t,o,i,n){var r=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;if(-1===e.indexOf("auto")){return e}var p=w(o,i,r,n),s={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},d=Object.keys(s).map(function(e){return re({key:e},s[e],{area:E(s[e])})}).sort(function(e,t){return t.area-e.area}),a=d.filter(function(e){var t=e.width,i=e.height;return t>=o.clientWidth&&i>=o.clientHeight}),l=0<a.length?a[0].key:d[0].key,f=e.split("-")[1];return l+(f?"-"+f:"")}function x(e,t,o){var i=d(t,o);return g(o,i)}function O(e){var t=window.getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n={width:e.offsetWidth+i,height:e.offsetHeight+o};return n}function L(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function S(e,t,o){o=o.split("-")[0];var i=O(e),n={width:i.width,height:i.height},r=-1!==["right","left"].indexOf(o),p=r?"top":"left",s=r?"left":"top",d=r?"height":"width",a=!r?"height":"width";n[p]=t[p]+t[d]/2-i[d]/2;if(o===s){n[s]=t[s]-i[a]}else{n[s]=t[L(s)]}return n}function T(e,t){if(Array.prototype.find){return e.find(t)}return e.filter(t)[0]}function C(e,t,o){if(Array.prototype.findIndex){return e.findIndex(function(e){return e[t]===o})}var i=T(e,function(e){return e[t]===o});return e.indexOf(i)}function D(t,o,i){var n=i===void 0?t:t.slice(0,C(t,"name",i));n.forEach(function(t){if(t["function"]){console.warn("`modifier.function` is deprecated, use `modifier.fn`!")}var i=t["function"]||t.fn;if(t.enabled&&e(i)){o.offsets.popper=h(o.offsets.popper);o.offsets.reference=h(o.offsets.reference);o=i(o,t)}});return o}function N(){if(this.state.isDestroyed){return}var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=x(this.state,this.popper,this.reference);e.placement=v(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);e.originalPlacement=e.placement;e.offsets.popper=S(this.popper,e.offsets.reference,e.placement);e.offsets.popper.position="absolute";e=D(this.modifiers,e);if(!this.state.isCreated){this.state.isCreated=!0;this.options.onCreate(e)}else{this.options.onUpdate(e)}}function k(e,t){return e.some(function(e){var o=e.name,i=e.enabled;return i&&o===t})}function W(e){for(var t=[!1,"ms","Webkit","Moz","O"],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<t.length-1;n++){var r=t[n],p=r?""+r+o:e;if("undefined"!=typeof window.document.body.style[p]){return p}}return null}function B(){this.state.isDestroyed=!0;if(k(this.modifiers,"applyStyle")){this.popper.removeAttribute("x-placement");this.popper.style.left="";this.popper.style.position="";this.popper.style.top="";this.popper.style[W("transform")]=""}this.disableEventListeners();if(this.options.removeOnDestroy){this.popper.parentNode.removeChild(this.popper)}return this}function P(e){var t=e.ownerDocument;return t?t.defaultView:window}function H(e,t,o,i){var r="BODY"===e.nodeName,p=r?e.ownerDocument.defaultView:e;p.addEventListener(t,o,{passive:!0});if(!r){H(n(p.parentNode),t,o,i)}i.push(p)}function A(e,t,o,i){o.updateBound=i;P(e).addEventListener("resize",o.updateBound,{passive:!0});var r=n(e);H(r,"scroll",o.updateBound,o.scrollParents);o.scrollElement=r;o.eventsEnabled=!0;return o}function I(){if(!this.state.eventsEnabled){this.state=A(this.reference,this.options,this.state,this.scheduleUpdate)}}function M(e,t){P(e).removeEventListener("resize",t.updateBound);t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)});t.updateBound=null;t.scrollParents=[];t.scrollElement=null;t.eventsEnabled=!1;return t}function R(){if(this.state.eventsEnabled){window.cancelAnimationFrame(this.scheduleUpdate);this.state=M(this.reference,this.state)}}function U(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function Y(e,t){Object.keys(t).forEach(function(o){var i="";if(-1!==["width","height","top","right","bottom","left"].indexOf(o)&&U(t[o])){i="px"}e.style[o]=t[o]+i})}function F(e,t){Object.keys(t).forEach(function(o){var i=t[o];if(!1!==i){e.setAttribute(o,t[o])}else{e.removeAttribute(o)}})}function j(e,t,o){var i=T(e,function(e){var o=e.name;return o===t}),n=!!i&&e.some(function(e){return e.name===o&&e.enabled&&e.order<i.order});if(!n){var r="`"+t+"`";console.warn("`"+o+"`"+" modifier is required by "+r+" modifier in order to work, be sure to include it before "+r+"!")}return n}function q(e){if("end"===e){return"start"}else if("start"===e){return"end"}return e}var pe=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],se=pe.slice(3);function K(e){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1,o=se.indexOf(e),i=se.slice(o+1).concat(se.slice(0,o));return t?i.reverse():i}var de={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function V(e,t,o,i){var n=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+n[1],p=n[2];if(!r){return e}if(0===p.indexOf("%")){var s;switch(p){case"%p":s=o;break;case"%":case"%r":default:s=i;}var d=h(s);return d[t]/100*r}else if("vh"===p||"vw"===p){var a;if("vh"===p){a=Math.max(document.documentElement.clientHeight,window.innerHeight||0)}else{a=Math.max(document.documentElement.clientWidth,window.innerWidth||0)}return a/100*r}else{return r}}function z(e,t,o,i){var n=[0,0],r=-1!==["right","left"].indexOf(i),p=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=p.indexOf(T(p,function(e){return-1!==e.search(/,|\s/)}));if(p[s]&&-1===p[s].indexOf(",")){console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.")}var d=/\s*,\s*|\s+/,a=-1!==s?[p.slice(0,s).concat([p[s].split(d)[0]]),[p[s].split(d)[1]].concat(p.slice(s+1))]:[p];a=a.map(function(e,i){var n=(1===i?!r:r)?"height":"width",p=!1;return e.reduce(function(e,t){if(""===e[e.length-1]&&-1!==["+","-"].indexOf(t)){e[e.length-1]=t;p=!0;return e}else if(p){e[e.length-1]+=t;p=!1;return e}else{return e.concat(t)}},[]).map(function(e){return V(e,n,t,o)})});a.forEach(function(e,t){e.forEach(function(o,i){if(U(o)){n[t]+=o*("-"===e[i-1]?-1:1)}})});return n}function G(e,t){var o=t.offset,i=e.placement,n=e.offsets,r=n.popper,p=n.reference,s=i.split("-")[0],d=void 0;if(U(+o)){d=[+o,0]}else{d=z(o,r,p,s)}if("left"===s){r.top+=d[0];r.left-=d[1]}else if("right"===s){r.top+=d[0];r.left+=d[1]}else if("top"===s){r.left+=d[0];r.top-=d[1]}else if("bottom"===s){r.left+=d[0];r.top+=d[1]}e.popper=r;return e}var ae=function(){function t(o,i){var n=this,r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};oe(this,t);this.scheduleUpdate=function(){return requestAnimationFrame(n.update)};this.update=$(this.update.bind(this));this.options=re({},t.Defaults,r);this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]};this.reference=o&&o.jquery?o[0]:o;this.popper=i&&i.jquery?i[0]:i;this.options.modifiers={};Object.keys(re({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){n.options.modifiers[e]=re({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})});this.modifiers=Object.keys(this.options.modifiers).map(function(e){return re({name:e},n.options.modifiers[e])}).sort(function(e,t){return e.order-t.order});this.modifiers.forEach(function(t){if(t.enabled&&e(t.onLoad)){t.onLoad(n.reference,n.popper,n.options,t,n.state)}});this.update();var p=this.options.eventsEnabled;if(p){this.enableEventListeners()}this.state.eventsEnabled=p}ie(t,[{key:"update",value:function(){return N.call(this)}},{key:"destroy",value:function(){return B.call(this)}},{key:"enableEventListeners",value:function(){return I.call(this)}},{key:"disableEventListeners",value:function(){return R.call(this)}}]);return t}();ae.Utils=("undefined"!=typeof window?window:global).PopperUtils;ae.placements=pe;ae.Defaults={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,o=t.split("-")[0],i=t.split("-")[1];if(i){var n=e.offsets,r=n.reference,p=n.popper,s=-1!==["bottom","top"].indexOf(o),d=s?"left":"top",a=s?"width":"height",l={start:ne({},d,r[d]),end:ne({},d,r[d]+r[a]-p[a])};e.offsets.popper=re({},p,l[i])}return e}},offset:{order:200,enabled:!0,fn:G,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var o=t.boundariesElement||r(e.instance.popper);if(e.instance.reference===o){o=r(o)}var i=w(e.instance.popper,e.instance.reference,t.padding,o);t.boundaries=i;var n=t.priority,p=e.offsets.popper,s={primary:function(e){var o=p[e];if(p[e]<i[e]&&!t.escapeWithReference){o=Math.max(p[e],i[e])}return ne({},e,o)},secondary:function(e){var o="right"===e?"left":"top",n=p[o];if(p[e]>i[e]&&!t.escapeWithReference){n=Math.min(p[o],i[e]-("right"===e?p.width:p.height))}return ne({},o,n)}};n.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";p=re({},p,s[t](e))});e.offsets.popper=p;return e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split("-")[0],r=Math.floor,p=-1!==["top","bottom"].indexOf(n),s=p?"right":"bottom",d=p?"left":"top",a=p?"width":"height";if(o[s]<r(i[d])){e.offsets.popper[d]=r(i[d])-o[a]}if(o[d]>r(i[s])){e.offsets.popper[d]=r(i[s])}return e}},arrow:{order:500,enabled:!0,fn:function(e,o){if(!j(e.instance.modifiers,"arrow","keepTogether")){return e}var i=o.element;if("string"==typeof i){i=e.instance.popper.querySelector(i);if(!i){return e}}else{if(!e.instance.popper.contains(i)){console.warn("WARNING: `arrow.element` must be child of its popper element!");return e}}var n=e.placement.split("-")[0],r=e.offsets,p=r.popper,s=r.reference,d=-1!==["left","right"].indexOf(n),a=d?"height":"width",l=d?"Top":"Left",f=l.toLowerCase(),m=d?"left":"top",c=d?"bottom":"right",u=O(i)[a];if(s[c]-u<p[f]){e.offsets.popper[f]-=p[f]-(s[c]-u)}if(s[f]+u>p[c]){e.offsets.popper[f]+=s[f]+u-p[c]}var g=s[f]+s[a]/2-u/2,b=t(e.instance.popper,"margin"+l).replace("px",""),y=g-h(e.offsets.popper)[f]-b;y=Math.max(Math.min(p[a]-u,y),0);e.arrowElement=i;e.offsets.arrow={};e.offsets.arrow[f]=Math.round(y);e.offsets.arrow[m]="";return e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(k(e.instance.modifiers,"inner")){return e}if(e.flipped&&e.placement===e.originalPlacement){return e}var o=w(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split("-")[0],n=L(i),r=e.placement.split("-")[1]||"",p=[];switch(t.behavior){case de.FLIP:p=[i,n];break;case de.CLOCKWISE:p=K(i);break;case de.COUNTERCLOCKWISE:p=K(i,!0);break;default:p=t.behavior;}p.forEach(function(s,d){if(i!==s||p.length===d+1){return e}i=e.placement.split("-")[0];n=L(i);var a=e.offsets.popper,l=e.offsets.reference,f=Math.floor,m="left"===i&&f(a.right)>f(l.left)||"right"===i&&f(a.left)<f(l.right)||"top"===i&&f(a.bottom)>f(l.top)||"bottom"===i&&f(a.top)<f(l.bottom),c=f(a.left)<f(o.left),h=f(a.right)>f(o.right),u=f(a.top)<f(o.top),g=f(a.bottom)>f(o.bottom),b="left"===i&&c||"right"===i&&h||"top"===i&&u||"bottom"===i&&g,y=-1!==["top","bottom"].indexOf(i),w=!!t.flipVariations&&(y&&"start"===r&&c||y&&"end"===r&&h||!y&&"start"===r&&u||!y&&"end"===r&&g);if(m||b||w){e.flipped=!0;if(m||b){i=p[d+1]}if(w){r=q(r)}e.placement=i+(r?"-"+r:"");e.offsets.popper=re({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement));e=D(e.instance.modifiers,e,"flip")}});return e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split("-")[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==["left","right"].indexOf(o),s=-1===["top","left"].indexOf(o);n[p?"left":"top"]=r[o]-(s?n[p?"width":"height"]:0);e.placement=L(t);e.offsets.popper=h(n);return e}},hide:{order:800,enabled:!0,fn:function(e){if(!j(e.instance.modifiers,"hide","preventOverflow")){return e}var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide){return e}e.hide=!0;e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide){return e}e.hide=!1;e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var o=t.x,i=t.y,n=e.offsets.popper,p=T(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;if(p!==void 0){console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!")}var s=p!==void 0?p:t.gpuAcceleration,d=r(e.instance.popper),a=u(d),l={position:n.position},f={left:Math.floor(n.left),top:Math.floor(n.top),bottom:Math.floor(n.bottom),right:Math.floor(n.right)},m="bottom"===o?"top":"bottom",c="right"===i?"left":"right",h=W("transform"),g=void 0,b=void 0;if("bottom"===m){b=-a.height+f.bottom}else{b=f.top}if("right"===c){g=-a.width+f.right}else{g=f.left}if(s&&h){l[h]="translate3d("+g+"px, "+b+"px, 0)";l[m]=0;l[c]=0;l.willChange="transform"}else{var y="bottom"===m?-1:1,w="right"===c?-1:1;l[m]=b*y;l[c]=g*w;l.willChange=m+", "+c}var E={"x-placement":e.placement};e.attributes=re({},E,e.attributes);e.styles=re({},l,e.styles);e.arrowStyles=re({},e.offsets.arrow,e.arrowStyles);return e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){Y(e.instance.popper,e.styles);F(e.instance.popper,e.attributes);if(e.arrowElement&&Object.keys(e.arrowStyles).length){Y(e.arrowElement,e.arrowStyles)}return e},onLoad:function(e,t,o,i,n){var r=x(n,t,e),p=v(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);t.setAttribute("x-placement",p);Y(t,{position:"absolute"});return o},gpuAcceleration:void 0}}};return ae});
define ("core/modal_backdrop",["jquery","core/templates","core/notification","core/fullscreen"],function(a,b,c,d){var e={ROOT:"[data-region=\"modal-backdrop\"]"},f=function(b){this.root=a(b);this.isAttached=!1;this.attachmentPoint=document.createElement("div");document.body.append(this.attachmentPoint);if(!this.root.is(e.ROOT)){c.exception({message:"Element is not a modal backdrop"})}};f.prototype.getRoot=function(){return this.root};f.prototype.getAttachmentPoint=function(){return a(d.getElement()||this.attachmentPoint)};f.prototype.attachToDOM=function(){this.getAttachmentPoint().append(this.root);if(this.isAttached){return}this.isAttached=!0};f.prototype.setZIndex=function(a){this.root.css("z-index",a)};f.prototype.isVisible=function(){return this.root.hasClass("show")};f.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")};f.prototype.show=function(){if(this.isVisible()){return}this.attachToDOM();this.root.removeClass("hide").addClass("show")};f.prototype.hide=function(){if(!this.isVisible()){return}if(this.hasTransitions()){this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this))}else{this.getRoot().removeClass("show").addClass("hide")}if(a(document.body).find(this.getRoot()).length){a(document.body).append(this.getRoot())}};f.prototype.destroy=function(){this.root.remove();this.attachmentPoint.remove()};return f});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}(function(a,b){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&exports&&"string"!=typeof exports.nodeName){b(exports)}else if("function"==typeof define&&define.amd){define ("core/mustache",["exports"],b)}else{a.Mustache={};b(a.Mustache)}})(this,function(a){var o=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===o.call(a)};function b(a){return"function"==typeof a}function c(a){return p(a)?"array":_typeof(a)}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function e(a,b){return null!=a&&"object"===_typeof(a)&&b in a}function f(a,b){return null!=a&&"object"!==_typeof(a)&&a.hasOwnProperty&&a.hasOwnProperty(b)}var q=RegExp.prototype.test;function g(a,b){return q.call(a,b)}function h(a){return!g(/\S/,a)}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};var s=/\s*=/;function i(b,c){if(!b)return[];var g=!1,m=[],n=[],o=[],q=!1,r=!1,t="",u=0;function e(){if(q&&!r){while(o.length){delete n[o.pop()]}}else{o=[]}q=!1;r=!1}var v,w,x;function f(a){if("string"==typeof a)a=a.split(/\s+/,2);if(!p(a)||2!==a.length)throw new Error("Invalid tags: "+a);v=new RegExp(d(a[0])+"\\s*");w=new RegExp("\\s*"+d(a[1]));x=new RegExp("\\s*"+d("}"+a[1]))}f(c||a.tags);var y=new l(b),z,A,B,C,D,E;while(!y.eos()){z=y.pos;B=y.scanUntil(v);if(B){for(var F=0,G=B.length;F<G;++F){C=B.charAt(F);if(h(C)){o.push(n.length);t+=C}else{r=!0;g=!0;t+=" "}n.push(["text",C,z,z+1]);z+=1;if("\n"===C){e();t="";u=0;g=!1}}}if(!y.scan(v))break;q=!0;A=y.scan(/#|\^|\/|>|\{|&|=|!|\$|</)||"name";y.scan(/\s*/);if("="===A){B=y.scanUntil(s);y.scan(s);y.scanUntil(w)}else if("{"===A){B=y.scanUntil(x);y.scan(/\s*\}/);y.scanUntil(w);A="&"}else{B=y.scanUntil(w)}if(!y.scan(w))throw new Error("Unclosed tag at "+y.pos);if(">"==A){D=[A,B,z,y.pos,t,u,g]}else{D=[A,B,z,y.pos]}u++;n.push(D);if("#"===A||"^"===A||"$"===A||"<"===A){m.push(D)}else if("/"===A){E=m.pop();if(!E)throw new Error("Unopened section \""+B+"\" at "+z);if(E[1]!==B)throw new Error("Unclosed section \""+E[1]+"\" at "+z)}else if("name"===A||"{"===A||"&"===A){r=!0}else if("="===A){f(B)}}e();E=m.pop();if(E)throw new Error("Unclosed section \""+E[1]+"\" at "+y.pos);return k(j(n))}function j(a){for(var b=[],c,d,e=0,f=a.length;e<f;++e){c=a[e];if(c){if("text"===c[0]&&d&&"text"===d[0]){d[1]+=c[1];d[3]=c[3]}else{b.push(c);d=c}}}return b}function k(a){for(var b=[],c=b,d=[],e,f,g=0,h=a.length;g<h;++g){e=a[g];switch(e[0]){case"$":case"<":case"#":case"^":c.push(e);d.push(e);c=e[4]=[];break;case"/":f=d.pop();f[5]=e[2];c=0<d.length?d[d.length-1][4]:b;break;default:c.push(e);}}return b}function l(a){this.string=a;this.tail=a;this.pos=0}l.prototype.eos=function(){return""===this.tail};l.prototype.scan=function(a){var b=this.tail.match(a);if(!b||0!==b.index)return"";var c=b[0];this.tail=this.tail.substring(c.length);this.pos+=c.length;return c};l.prototype.scanUntil=function(a){var b=this.tail.search(a),c;switch(b){case-1:c=this.tail;this.tail="";break;case 0:c="";break;default:c=this.tail.substring(0,b);this.tail=this.tail.substring(b);}this.pos+=c.length;return c};function m(a,b){this.view=a;this.blocks={};this.cache={".":this.view};this.parent=b}m.prototype.push=function(a){return new m(a,this)};m.prototype.setBlockVar=function(a,b){var c=this.blocks;c[a]=b;return b};m.prototype.clearBlockVars=function(){this.blocks={}};m.prototype.getBlockVar=function(a){var b=this.blocks,c;if(b.hasOwnProperty(a)){c=b[a]}else{if(this.parent){c=this.parent.getBlockVar(a)}}return c};m.prototype.lookup=function(a){var c=this.cache,d;if(c.hasOwnProperty(a)){d=c[a]}else{var g=this,h,i,j,k=!1;while(g){if(0<a.indexOf(".")){h=g.view;i=a.split(".");j=0;while(null!=h&&j<i.length){if(j===i.length-1)k=e(h,i[j])||f(h,i[j]);h=h[i[j++]]}}else{h=g.view[a];k=e(g.view,a)}if(k){d=h;break}g=g.parent}c[a]=d}if(b(d))d=d.call(this.view);return d};function n(){this.cache={}}n.prototype.clearCache=function(){this.cache={}};n.prototype.parse=function(b,c){var d=this.cache,e=b+":"+(c||a.tags).join(":"),f=d[e];if(null==f)f=d[e]=i(b,c);return f};n.prototype.render=function(a,b,c,d){var e=this.parse(a,d),f=b instanceof m?b:new m(b);return this.renderTokens(e,f,c,a,d)};n.prototype.renderTokens=function(a,b,c,d,e){for(var f="",g,h,j,k=0,l=a.length;k<l;++k){j=void 0;g=a[k];h=g[0];if("#"===h)j=this.renderSection(g,b,c,d);else if("^"===h)j=this.renderInverted(g,b,c,d);else if(">"===h)j=this.renderPartial(g,b,c,e);else if("<"===h)j=this.renderBlock(g,b,c,d);else if("$"===h)j=this.renderBlockVariable(g,b,c,d);else if("&"===h)j=this.unescapedValue(g,b);else if("name"===h)j=this.escapedValue(g,b);else if("text"===h)j=this.rawValue(g);if(j!==void 0)f+=j}return f};n.prototype.renderSection=function(a,c,d,e){var g=this,h="",i=c.lookup(a[1]);function f(a){return g.render(a,c,d)}if(!i)return;if(p(i)){for(var k=0,l=i.length;k<l;++k){h+=this.renderTokens(a[4],c.push(i[k]),d,e)}}else if("object"===_typeof(i)||"string"==typeof i||"number"==typeof i){h+=this.renderTokens(a[4],c.push(i),d,e)}else if(b(i)){if("string"!=typeof e)throw new Error("Cannot use higher-order sections without the original template");i=i.call(c.view,e.slice(a[3],a[5]),f);if(null!=i)h+=i}else{h+=this.renderTokens(a[4],c,d,e)}return h};n.prototype.renderInverted=function(a,b,c,d){var e=b.lookup(a[1]);if(!e||p(e)&&0===e.length)return this.renderTokens(a[4],b,c,d)};n.prototype.indentPartial=function(a,b,c){for(var d=b.replace(/[^ \t]/g,""),e=a.split("\n"),f=0;f<e.length;f++){if(e[f].length&&(0<f||!c)){e[f]=d+e[f]}}return e.join("\n")};n.prototype.renderPartial=function(a,c,d,e){if(!d)return;var f=b(d)?d(a[1]):d[a[1]];if(null!=f){var g=a[6],h=a[5],i=a[4],j=f;if(0==h&&i){j=this.indentPartial(f,i,g)}return this.renderTokens(this.parse(j,e),c,d,j)}};n.prototype.renderBlock=function(a,c,d,e){if(!d)return;var f=b(d)?d(a[1]):d[a[1]];if(null!=f)c.clearBlockVars();this.renderTokens(a[4],c,d,e);var g=this.renderTokens(this.parse(f),c,d,f);c.clearBlockVars();return g};n.prototype.renderBlockVariable=function(a,b,c,d){var e=a[1],f=b.getBlockVar(e);if(!f){b.setBlockVar(e,d.slice(a[3],a[5]));return this.renderTokens(a[4],b,c,d)}else{return this.renderTokens(this.parse(f),b,c,f)}};n.prototype.unescapedValue=function(a,b){var c=b.lookup(a[1]);if(null!=c)return c};n.prototype.escapedValue=function(b,c){var d=c.lookup(b[1]);if(null!=d)return a.escape(d)};n.prototype.rawValue=function(a){return a[1]};a.name="mustache.js";a.version="3.1.0";a.tags=["{{","}}"];var t=new n;a.clearCache=function(){return t.clearCache()};a.parse=function(a,b){return t.parse(a,b)};a.render=function(a,b,d,e){if("string"!=typeof a){throw new TypeError("Invalid template! Template should be a \"string\" but \""+c(a)+"\" was given as the first argument for mustache#render(template, view, partials)")}return t.render(a,b,d,e)};a.to_html=function(c,d,e,f){var g=a.render(c,d,e);if(b(f)){f(g)}else{return g}};a.escape=function(a){return(a+"").replace(/[&<>"'`=\/]/g,function(a){return r[a]})};a.Scanner=l;a.Context=m;a.Writer=n;return a});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/sortable_list",["jquery","core/log","core/autoscroll","core/str","core/modal_factory","core/modal_events","core/notification"],function(b,a,c,d,e,f,g){var h={targetListSelector:null,moveHandlerSelector:"[data-drag-type=move]",isHorizontal:!1,autoScroll:!0},j={keyboardDragClass:"dragdrop-keyboard-drag",isDraggedClass:"sortable-list-is-dragged",currentPositionClass:"sortable-list-current-position",sourceListClass:"sortable-list-source",targetListClass:"sortable-list-target",overElementClass:"sortable-list-over-element"},k=function(a){return{setup:function setup(b,c,d){if(c.includes("notPassive")){this.addEventListener(a,d,{passive:!1});return!0}else{return!1}}}};if(function eventListenerOptionsSupported(){var a=!1,b;try{b=Object.defineProperty({},"passive",{get:function get(){a=!0}});document.addEventListener("testpassiveeventoptions",b,b);document.removeEventListener("testpassiveeventoptions",b,b)}catch(b){a=!1}return a}){b.event.special.touchstart=k("touchstart");b.event.special.touchmove=k("touchmove");b.event.special.touchend=k("touchend")}var l=function(a,c){this.info=null;this.proxy=null;this.proxyDelta=null;this.dragCounter=0;this.lastEvent=null;this.config=b.extend({},h,c||{});this.config.listSelector=a;if(!this.config.targetListSelector){this.config.targetListSelector=a}if("object"===_typeof(this.config.listSelector)){b(this.config.listSelector).on("mousedown touchstart.notPassive",b.proxy(this.dragStartHandler,this))}else{b("body").on("mousedown touchstart.notPassive",this.config.listSelector,b.proxy(this.dragStartHandler,this))}if(null!==this.config.moveHandlerSelector){b("body").on("click keypress",this.config.moveHandlerSelector,b.proxy(this.clickHandler,this))}};l.EVENTS={DRAGSTART:"sortablelist-dragstart",DRAG:"sortablelist-drag",DROP:"sortablelist-drop",DRAGEND:"sortablelist-dragend"};l.prototype.resetDraggedClasses=function(){var a=[j.isDraggedClass,j.currentPositionClass,j.overElementClass,j.targetListClass];for(var c in a){b("."+a[c]).removeClass(a[c])}if(this.proxy){this.proxy.remove();this.proxy=b()}};l.prototype.calculatePositionOnPage=function(a){if(a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches[0]!==void 0){var c=a.originalEvent.touches[0];a.pageX=c.pageX;a.pageY=c.pageY}if(a.pageX===void 0){a.pageX=this.lastEvent.pageX;a.pageY=this.lastEvent.pageY}else{this.lastEvent=a}if(a.clientX===void 0){a.clientX=Math.round(a.pageX-b(window).scrollLeft());a.clientY=Math.round(a.pageY-b(window).scrollTop())}};l.prototype.dragStartHandler=function(a){if(null!==this.info){if("click"===this.info.type||"touchend"===this.info.type){return}this.moveElement(this.info.sourceList,this.info.sourceNextElement);this.finishDragging()}if("mousedown"===a.type&&1!==a.which){return}this.calculatePositionOnPage(a);var d=b(a.target).closest(b(a.currentTarget).children());if(!d.length){return}if(null!==this.config.moveHandlerSelector){if(!b(a.target).closest(this.config.moveHandlerSelector,d).length){return}}a.stopPropagation();a.preventDefault();this.dragCounter++;this.info={element:d,sourceNextElement:d.next(),sourceList:d.parent(),targetNextElement:d.next(),targetList:d.parent(),type:a.type,dropped:!1,startX:a.pageX,startY:a.pageY,startTime:new Date().getTime()};b(this.config.targetListSelector).addClass(j.targetListClass);var e=d.offset();d.addClass(j.currentPositionClass);this.proxyDelta={x:e.left-a.pageX,y:e.top-a.pageY};this.proxy=b();var f=this.dragCounter;setTimeout(b.proxy(function(){if(null===this.info||"click"===this.info.type||"keypress"===this.info.type||this.dragCounter!==f){return}this.createProxy()},this),500);b(window).on("mousemove touchmove.notPassive mouseup touchend.notPassive",b.proxy(this.dragHandler,this));b(window).on("keypress",b.proxy(this.dragcancelHandler,this));if(this.config.autoScroll){c.start(function(){b(window).trigger("mousemove")})}this.executeCallback(l.EVENTS.DRAGSTART)};l.prototype.createProxy=function(){this.proxy=this.info.element.clone();this.info.sourceList.append(this.proxy);this.proxy.removeAttr("id").removeClass(j.currentPositionClass).addClass(j.isDraggedClass).css({position:"fixed"});this.proxy.offset({top:this.proxyDelta.y+this.lastEvent.pageY,left:this.proxyDelta.x+this.lastEvent.pageX})};l.prototype.clickHandler=function(a){if("keypress"===a.type&&13!==a.originalEvent.keyCode&&32!==a.originalEvent.keyCode){return}if(null!==this.info){return}var c=b(a.target).closest(this.config.moveHandlerSelector),d=c.closest(this.config.listSelector),e=c.closest(d.children());if(!e.length){return}a.preventDefault();a.stopPropagation();this.dragCounter++;this.info={element:e,sourceNextElement:e.next(),sourceList:d,targetNextElement:e.next(),targetList:d,dropped:!1,type:a.type,startTime:new Date().getTime()};this.executeCallback(l.EVENTS.DRAGSTART);this.displayMoveDialogue(c)};l.prototype.getPositionInNode=function(a,b,c){if(!c.length){return null}var d=c[0],e=d.getBoundingClientRect(),f=b-(e.top+window.scrollY),g=a-(e.left+window.scrollX);if(g>=-0&&g<=e.width+0&&f>=-0&&f<=e.height+0){return{x:g,y:f,xRatio:e.width?g/e.width:0,yRatio:e.height?f/e.height:0}}return null};l.prototype.isListHorizontal=function(a){var b=this.config.isHorizontal;if(!0===b||!1===b){return b}return b(a)};l.prototype.dragHandler=function(a){a.preventDefault();a.stopPropagation();this.calculatePositionOnPage(a);this.proxy.offset({top:-1e3,left:-1e3});var c=b(document.elementFromPoint(a.clientX,a.clientY)),d=this.info.element[0],e=function(){return this!==d},f=c.closest("."+j.targetListClass+" > :not(."+j.isDraggedClass+")").filter(e),g=c.closest("."+j.targetListClass),h=this.proxy,i=function(){return!h||!h.length||this!==h[0]};b("."+j.overElementClass).removeClass(j.overElementClass);f.addClass(j.overElementClass);this.proxy.offset({top:this.proxyDelta.y+a.pageY,left:this.proxyDelta.x+a.pageX});if(g.length&&!g.children().filter(i).length){this.moveElement(g,b())}else if(1===f.length&&!this.info.element.find(f[0]).length){var k=this.getPositionInNode(a.pageX,a.pageY,f);if(k){var m=f.parent(),n=this.isListHorizontal(m)?k.xRatio:k.yRatio,o=f.find("."+j.targetListClass),p=!o.children().filter(i).filter(e).length;if(o.length&&p&&.2<n&&.8>n){this.moveElement(o,b())}else if(.5<n){this.moveElement(m,f.next().filter(i))}else{this.moveElement(m,f)}}}if("mouseup"===a.type||"touchend"===a.type){this.info.endX=a.pageX;this.info.endY=a.pageY;this.info.endTime=new Date().getTime();this.info.dropped=!0;this.info.positionChanged=this.hasPositionChanged(this.info);var q=this.info;this.executeCallback(l.EVENTS.DROP);this.finishDragging();if("touchend"===a.type&&null!==this.config.moveHandlerSelector&&500>q.endTime-q.startTime&&!q.positionChanged){this.clickHandler(a)}}};l.prototype.hasPositionChanged=function(a){return a.sourceList[0]!==a.targetList[0]||a.sourceNextElement.length!==a.targetNextElement.length||a.sourceNextElement.length&&a.sourceNextElement[0]!==a.targetNextElement[0]};l.prototype.moveElement=function(a,b){var c=this.info.element;if(b.length&&b[0]===c[0]){return}if(a[0]===this.info.targetList[0]&&b.length===this.info.targetNextElement.length&&b[0]===this.info.targetNextElement[0]){return}if(b.length){a[0].insertBefore(c[0],b[0])}else if(this.proxy&&this.proxy.parent().length&&this.proxy.parent()[0]===a[0]){a[0].insertBefore(c[0],this.proxy[0])}else{a[0].appendChild(c[0])}this.info.targetList=a;this.info.targetNextElement=b;this.executeCallback(l.EVENTS.DRAG)};l.prototype.finishDragging=function(){this.resetDraggedClasses();if(this.config.autoScroll){c.stop()}b(window).off("mousemove touchmove.notPassive mouseup touchend.notPassive",b.proxy(this.dragHandler,this));b(window).off("keypress",b.proxy(this.dragcancelHandler,this));this.executeCallback(l.EVENTS.DRAGEND);this.info=null};l.prototype.executeCallback=function(a){this.info.element.trigger(a,this.info)};l.prototype.dragcancelHandler=function(a){if("keypress"!==a.type||27!==a.originalEvent.keyCode){return}this.moveElement(this.info.sourceList,this.info.sourceNextElement);this.finishDragging()};l.prototype.getElementName=function(a){return b.Deferred().resolve(a.text())};l.prototype.getDestinationName=function(a,b){if(!b.length){return d.get_string("movecontenttothetop","moodle")}else{return this.getElementName(b).then(function(a){return d.get_string("movecontentafter","moodle",a)})}};l.prototype.getMoveDialogueTitle=function(a,c){if(c.attr("title")){return b.Deferred().resolve(c.attr("title"))}return this.getElementName(a).then(function(a){return d.get_string("movecontent","moodle",a)})};l.prototype.getDestinationsList=function(){var a=[],c=b(this.config.targetListSelector),d=b("<ul/>").addClass(j.keyboardDragClass),e=b.when().then(function(){return d}),f=b.proxy(function(c,f,g){if(f.is(this.info.element)||g.is(this.info.element)){return}if(b.contains(this.info.element[0],c[0])){return}e=e.then(b.proxy(function(){return this.getDestinationName(c,g)},this)).then(function(e){var g=b("<li/>").appendTo(d),h=b("<a href=\"#\"/>").attr("data-core_sortable_list-quickmove",1).appendTo(g);h.data("parent-element",c).data("before-element",f).text(e);return d})},this),g=function(){if(-1!==b.inArray(this,a)){return}a.push(this);var d=b(this),e=d.children();e.each(function(){var a=b(this);f(d,a,a.prev());a.find(c).each(g)});f(d,b(),e.last())};c.each(g);return e};l.prototype.displayMoveDialogue=function(a){e.create({type:e.types.CANCEL,title:this.getMoveDialogueTitle(this.info.element,a),body:this.getDestinationsList()}).then(b.proxy(function(c){var d=b.proxy(function(d){d.preventDefault();d.stopPropagation();this.moveElement(b(d.currentTarget).data("parent-element"),b(d.currentTarget).data("before-element"));this.info.endTime=new Date().getTime();this.info.positionChanged=this.hasPositionChanged(this.info);this.info.dropped=!0;a.focus();this.executeCallback(l.EVENTS.DROP);c.hide()},this);c.getRoot().on("click","[data-core_sortable_list-quickmove]",d);c.getRoot().on(f.hidden,b.proxy(function(){c.getRoot().off("click","[data-core_sortable_list-quickmove]",d);c.destroy();this.finishDragging()},this));c.setLarge();c.show();return c},this)).catch(g.exception)};return l});
define ("core/popover_region_controller",["jquery","core/str","core/custom_interaction_events"],function(a,b,c){var d={CONTENT:".popover-region-content",CONTENT_CONTAINER:".popover-region-content-container",MENU_CONTAINER:".popover-region-container",MENU_TOGGLE:".popover-region-toggle",CAN_RECEIVE_FOCUS:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]"},e=function(b){this.root=a(b);this.content=this.root.find(d.CONTENT);this.contentContainer=this.root.find(d.CONTENT_CONTAINER);this.menuContainer=this.root.find(d.MENU_CONTAINER);this.menuToggle=this.root.find(d.MENU_TOGGLE);this.isLoading=!1;this.promises={closeHandlers:a.Deferred(),navigationHandlers:a.Deferred()};this.registerBaseEventListeners()};e.prototype.events=function(){return{menuOpened:"popoverregion:menuopened",menuClosed:"popoverregion:menuclosed",startLoading:"popoverregion:startLoading",stopLoading:"popoverregion:stopLoading"}};e.prototype.getContentContainer=function(){return this.contentContainer};e.prototype.getContent=function(){return this.content};e.prototype.isMenuOpen=function(){return!this.root.hasClass("collapsed")};e.prototype.toggleMenu=function(){if(this.isMenuOpen()){this.closeMenu()}else{this.openMenu()}};e.prototype.closeMenu=function(){if(!this.isMenuOpen()){return}this.root.addClass("collapsed");this.menuContainer.attr("aria-expanded","false");this.menuContainer.attr("aria-hidden","true");this.updateButtonAriaLabel();this.root.trigger(this.events().menuClosed)};e.prototype.openMenu=function(){if(this.isMenuOpen()){return}this.root.removeClass("collapsed");this.menuContainer.attr("aria-expanded","true");this.menuContainer.attr("aria-hidden","false");this.updateButtonAriaLabel();this.promises.closeHandlers.resolve();this.promises.navigationHandlers.resolve();this.root.trigger(this.events().menuOpened)};e.prototype.updateButtonAriaLabel=function(){if(this.isMenuOpen()){b.get_string("hidepopoverwindow").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))}else{b.get_string("showpopoverwindow").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))}};e.prototype.startLoading=function(){this.isLoading=!0;this.getContentContainer().addClass("loading");this.getContentContainer().attr("aria-busy","true");this.root.trigger(this.events().startLoading)};e.prototype.stopLoading=function(){this.isLoading=!1;this.getContentContainer().removeClass("loading");this.getContentContainer().attr("aria-busy","false");this.root.trigger(this.events().stopLoading)};e.prototype.focusMenuToggle=function(){this.menuToggle.focus()};e.prototype.contentItemHasFocus=function(){return 0<this.getContentItemWithFocus().length};e.prototype.getContentItemWithFocus=function(){var b=a(document.activeElement),c=this.getContent().children(),d=c.filter(b);if(!d.length){d=c.has(b)}return d};e.prototype.focusContentItem=function(a){if(a.is(d.CAN_RECEIVE_FOCUS)){a.focus()}else{a.find(d.CAN_RECEIVE_FOCUS).first().focus()}};e.prototype.focusFirstContentItem=function(){this.focusContentItem(this.getContent().children().first())};e.prototype.focusLastContentItem=function(){this.focusContentItem(this.getContent().children().last())};e.prototype.focusNextContentItem=function(){var a=this.getContentItemWithFocus();if(a.length&&a.next()){this.focusContentItem(a.next())}};e.prototype.focusPreviousContentItem=function(){var a=this.getContentItemWithFocus();if(a.length&&a.prev()){this.focusContentItem(a.prev())}};e.prototype.registerBaseEventListeners=function(){c.define(this.root,[c.events.activate,c.events.escape]);this.root.on(c.events.activate,d.MENU_TOGGLE,function(){this.toggleMenu()}.bind(this));this.promises.closeHandlers.done(function(){this.root.on(c.events.escape,function(){this.closeMenu();this.focusMenuToggle()}.bind(this));a("html").click(function(b){var c=a(b.target);if(!this.root.is(c)&&!this.root.has(c).length){this.closeMenu()}}.bind(this));c.define(this.getContentContainer(),[c.events.scrollBottom])}.bind(this))};e.prototype.registerListNavigationEventListeners=function(){c.define(this.root,[c.events.down]);this.root.on(c.events.down,function(a,b){if(!this.isMenuOpen()){this.openMenu();this.focusFirstContentItem()}else{if(this.contentItemHasFocus()){this.focusNextContentItem()}else{this.focusFirstContentItem()}}b.originalEvent.preventDefault()}.bind(this));this.promises.navigationHandlers.done(function(){c.define(this.root,[c.events.up,c.events.home,c.events.end]);this.root.on(c.events.up,function(a,b){this.focusPreviousContentItem();b.originalEvent.preventDefault()}.bind(this));this.root.on(c.events.home,function(a,b){this.focusFirstContentItem();b.originalEvent.preventDefault()}.bind(this));this.root.on(c.events.end,function(a,b){this.focusLastContentItem();b.originalEvent.preventDefault()}.bind(this))}.bind(this))};return e});
define ("core/showhidesettings",["jquery"],function(a){var n;function b(a){return a.is("input[type=hidden]")&&a.siblings("input[type=checkbox][name=\""+a.attr("name")+"\"]").length}function c(a,b){return a.is("input[type=radio]")&&a.attr("value")!==b}function d(a,d){return!b(a)&&!c(a,d)}function e(a){return a.is("input[type=radio]")&&!a.prop("checked")}function f(a){return a.is("input[type=checkbox]")&&!a.prop("checked")}function g(a){return a.is("select")&&a.prop("multiple")}function h(a,b){var c=a.val()||[];if(!b.length){return!1}if(c.length!==b.length){return!1}for(var d in c){if(c.hasOwnProperty(d)){if(-1===b.indexOf(c[d])){return!1}}}return!0}var o={notchecked:function notchecked(b,c){var e=!1;c=c+"";b.each(function(b,f){var g=a(f);if(d(g,c)){e=e||!g.prop("checked")}});return e},checked:function checked(b,c){var e=!1;c=c+"";b.each(function(b,f){var g=a(f);if(d(g,c)){e=e||g.prop("checked")}});return e},noitemselected:function noitemselected(b){var c=!1;b.each(function(b,d){var e=a(d);c=c||-1===e.prop("selectedIndex")});return c},eq:function eq(c,d){var i=!1,j=!1;d=d+"";c.each(function(c,k){var l=a(k);if(e(l)){return}if(b(l)){j=l.val()===d;return}if(f(l)){i=i||j;return}if(g(l)){var m=d.split("|");i=h(l,m);return}i=i||l.val()===d});return i},in:function _in(c,d){var i=!1,j=!1,k=d.split("|");c.each(function(c,d){var l=a(d);if(e(l)){return}if(b(l)){j=-1<k.indexOf(l.val());return}if(f(l)){i=i||j;return}if(g(l)){i=h(l,k);return}i=i||-1<k.indexOf(l.val())});return i},defaultCondition:function defaultCondition(c,d){var i=!1,j=!1;d=d+"";c.each(function(c,k){var l=a(k);if(e(l)){return}if(b(l)){j=l.val()!==d;return}if(f(l)){i=i||j;return}if(g(l)){var m=d.split("|");i=!h(l,m);return}i=i||l.val()!==d});return i}};function i(b){return a("[name=\""+b+"\"],[name^=\""+b+"[\"]")}function j(a,b,c){if("function"==typeof o[b]){return o[b](a,c)}return o.defaultCondition(a,c)}function k(){var b={};a.each(n,function(c){var d=i(c);a.each(n[c],function(c,e){a.each(e,function(e,f){var g=j(d,c,e);a.each(f,function(a,c){if(b.hasOwnProperty(c)){b[c]=b[c]||g}else{b[c]=g}})})})});a.each(b,function(b,c){i(b).each(function(b,d){var e=a(d).closest(".form-item");if(e.length){if(c){e.hide()}else{e.show()}}})})}function l(){a.each(n,function(a){var b=i(a);if(b.length){b.on("change",k)}});k()}function m(){a(".form-dependenton").hide()}return{init:function init(a){n=a.dependencies;l();m()}}});
define ("core/form-cohort-selector",["core/ajax","jquery"],function(a,b){return{processResults:function processResults(a,c){var d=[],e=0,f=(b(a).data("exclude")+"").split(",");for(e=0;e<c.cohorts.length;e++){if(-1===f.indexOf(c.cohorts[e].id+"")){d.push({value:c.cohorts[e].id,label:c.cohorts[e].name})}}return d},transport:function transport(c,d,e,f){var g=b(c),h=null;if("undefined"==typeof d){d=""}var i=g.data("contextid"),j={query:d,includes:"parents",limitfrom:0,limitnum:100,context:{contextid:i}};h=a.call([{methodname:"core_cohort_search_cohorts",args:j}]);b.when.apply(b.when,h).done(function(a){e(a)}).fail(f)}}});
define ("core/sessionstorage",["core/config","core/storagewrapper"],function(a,b){var c=new b(window.sessionStorage);return{get:function get(a){return c.get(a)},set:function set(a,b){return c.set(a,b)}}});
define ("core/paged_content_paging_bar",["jquery","core/custom_interaction_events","core/paged_content_events","core/str","core/pubsub","core/pending"],function(a,b,c,d,e,f){var g={ROOT:"[data-region=\"paging-bar\"]",PAGE:"[data-page]",PAGE_ITEM:"[data-region=\"page-item\"]",PAGE_LINK:"[data-region=\"page-link\"]",FIRST_BUTTON:"[data-control=\"first\"]",LAST_BUTTON:"[data-control=\"last\"]",NEXT_BUTTON:"[data-control=\"next\"]",PREVIOUS_BUTTON:"[data-control=\"previous\"]",DOTS_BUTTONS:"[data-dots]",BEGINNING_DOTS_BUTTON:"[data-dots=\"beginning\"]",ENDING_DOTS_BUTTON:"[data-dots=\"ending\"]"},h=function(a,b){return a.find(g.PAGE_ITEM+"[data-page-number=\""+b+"\"]")},i=function(a){return a.find(g.NEXT_BUTTON)},j=function(a,b){a.attr("data-last-page-number",b)},k=function(a){return parseInt(a.attr("data-last-page-number"),10)},l=function(a){return parseInt(a.attr("data-active-page-number"),10)},m=function(a,b){a.attr("data-active-page-number",b)},n=function(a){var b=l(a);return!isNaN(b)&&0!=b},o=function(a,b){if(b.attr("data-page")!=void 0){return parseInt(b.attr("data-page-number"),10)}var c=1,d=null;switch(b.attr("data-control")){case"first":c=1;break;case"last":c=k(a);break;case"next":d=l(a);var e=k(a);if(!e){c=d+1}else if(d&&d<e){c=d+1}else{c=e}break;case"previous":d=l(a);if(d&&1<d){c=d-1}else{c=1}break;default:c=1;break;}return parseInt(c,10)},p=function(a){return parseInt(a.attr("data-items-per-page"),10)},q=function(a,b){a.attr("data-items-per-page",b)},r=function(a){a.removeClass("hidden")},s=function(a){a.addClass("hidden")},t=function(a){var b=a.find(g.NEXT_BUTTON),c=a.find(g.LAST_BUTTON);b.addClass("disabled");b.attr("aria-disabled",!0);c.addClass("disabled");c.attr("aria-disabled",!0)},u=function(a){var b=a.find(g.NEXT_BUTTON),c=a.find(g.LAST_BUTTON);b.removeClass("disabled");b.removeAttr("aria-disabled");c.removeClass("disabled");c.removeAttr("aria-disabled")},v=function(a){var b=a.find(g.PREVIOUS_BUTTON),c=a.find(g.FIRST_BUTTON);b.addClass("disabled");b.attr("aria-disabled",!0);c.addClass("disabled");c.attr("aria-disabled",!0)},w=function(b){var c=l(b),d=k(b),e=b.find(g.DOTS_BUTTONS),f=b.find(g.BEGINNING_DOTS_BUTTON),h=b.find(g.ENDING_DOTS_BUTTON),i=b.find(g.PAGE),j=parseInt(b.attr("data-bar-size"),10);if(j&&d>j){var m=Math.max(c-Math.round(j/2),1),n=m+j-1;if(n>=d){n=d;m=n-j+1}if(1<m){r(f);m++}else{s(f)}if(n<d){r(h);n--}else{s(h)}e.addClass("disabled");e.attr("aria-disabled",!0);s(i);i.each(function(b,c){c=a(c);if(b+1>=m&&b+1<=n){r(c)}})}else{s(e)}},x=function(a){var b=a.find(g.PREVIOUS_BUTTON),c=a.find(g.FIRST_BUTTON);b.removeClass("disabled");b.removeAttr("aria-disabled");c.removeClass("disabled");c.removeAttr("aria-disabled")},y=function(a){var b=a.attr("data-aria-label-components-pagination-item"),c=b.split(",").map(function(a){return a.trim()});return c},z=function(a){var b=a.attr("data-aria-label-components-pagination-active-item"),c=b.split(",").map(function(a){return a.trim()});return c},A=function(b,c){var d=0;m(b,0);c.each(function(c,e){var f=c+1;e=a(e);e.attr("data-page-number",f);d++;if(e.hasClass("active")){m(b,f)}});j(b,d)},B=function(b){var c=y(b),e=z(b),f=l(b),h=b.find(g.PAGE_ITEM),i=h.map(function(d,g){g=a(g);var h=o(b,g);if(h===f){return{key:e[0],component:e[1],param:h}}else{return{key:c[0],component:c[1],param:h}}});d.get_strings(i).then(function(b){h.each(function(c,d){d=a(d);var e=b[c];d.attr("aria-label",e);d.find(g.PAGE_LINK).attr("aria-label",e)});return b}).catch(function(){})},C=function(a,b,d){var i=new f("core/paged_content_paging_bar:showPage"),j=k(a),n=b==l(a),o=p(a);if(!n){a.find(g.PAGE_ITEM).removeClass("active").removeAttr("aria-current");var q=h(a,b);q.addClass("active");q.attr("aria-current",!0);m(a,b);w(a)}if(j&&b>=j){t(a)}else{u(a)}if(1<b){x(a)}else{v(a)}B(a);e.publish(d+c.SHOW_PAGES,[{pageNumber:b,limit:o,offset:(b-1)*o}]);i.resolve()},D=function(d,f){var h=d.attr("data-ignore-control-while-loading"),i=!1;if(""==h){h=!0}b.define(d,[b.events.activate]);d.on(b.events.activate,g.PAGE_ITEM,function(b,c){c.originalEvent.preventDefault();c.originalEvent.stopPropagation();if(h&&i){return}var e=a(b.target).closest(g.PAGE_ITEM);if(!e.hasClass("disabled")){var j=o(d,e);C(d,j,f);i=!0}});e.subscribe(f+c.ALL_ITEMS_LOADED,function(a){i=!1;var b=k(d);if(!b||a<b){j(d,a)}if(1===a&&d.attr("data-hide-control-on-single-page")){s(d);t(d);v(d)}else{r(d);t(d)}});e.subscribe(f+c.PAGES_SHOWN,function(){i=!1});e.subscribe(f+c.SET_ITEMS_PER_PAGE_LIMIT,function(a){q(d,a);j(d,0);m(d,0);r(d);C(d,1,f)})};return{init:function init(b,c){b=a(b);var d=b.find(g.PAGE);A(b,d);D(b,c);if(n(b)){var e=l(b);h(b,e).click();if(1==e){v(b)}}else{i(b).click()}w(b)},disableNextControlButtons:t,enableNextControlButtons:u,disablePreviousControlButtons:v,enablePreviousControlButtons:x,showPage:C,rootSelector:g.ROOT}});
define ("core/yui",function(){return Y});
define ("core/icon_system",["jquery"],function(a){var b=function(){};b.prototype.init=function(){return a.when(this)};b.prototype.renderIcon=function(){throw new Error("Abstract function not implemented.")};b.prototype.getTemplateName=function(){throw new Error("Abstract function not implemented.")};return b});
define ("core/chart_output_base",["jquery"],function(a){function b(b,c){this._node=a(b);this._chart=c}b.prototype.update=function(){throw new Error("Not supported.")};return b});
define ("core/ajax",["jquery","core/config","core/log","core/url"],function(a,b,c,d){var e=!1,f=function(a){var b=this,c=null,e=0,f,g,h;if(a.error){for(;e<b.length;e++){f=b[e];f.deferred.reject(a)}return}for(e=0;e<b.length;e++){f=b[e];g=a[e];if("undefined"!=typeof g){if(!1===g.error){f.deferred.resolve(g.data)}else{c=g.exception;h=b[e].nosessionupdate;break}}else{c=new Error("missing response");break}}if(null!==c){if("servicerequireslogin"===c.errorcode&&!h){window.location=d.relativeUrl("/login/index.php")}else{b.forEach(function(a){a.deferred.reject(c)})}}},g=function(a,b,d){var f=this,g=0;for(g=0;g<f.length;g++){var h=f[g];if(e){c.error("Page unloaded.");c.error(d)}else{h.deferred.reject(d)}}};return{call:function call(c,d,h,j,k,l){a(window).bind("beforeunload",function(){e=!0});var m=[],n,o=[],p=[],q="";if("undefined"==typeof h){h=!0}if("undefined"==typeof d){d=!0}if("undefined"==typeof k){k=0}if("undefined"==typeof l){l=null}else{l=parseInt(l);if(0>=l){l=null}else if(!l){l=null}}if("undefined"==typeof j){j=!1}for(n=0;n<c.length;n++){var r=c[n];m.push({index:n,methodname:r.methodname,args:r.args});r.nosessionupdate=j;r.deferred=a.Deferred();o.push(r.deferred.promise());if("undefined"!=typeof r.done){r.deferred.done(r.done)}if("undefined"!=typeof r.fail){r.deferred.fail(r.fail)}r.index=n;p.push(r.methodname)}if(5>=p.length){q=p.sort().join()}else{q=p.length+"-method-calls"}m=JSON.stringify(m);var s={type:"POST",context:c,dataType:"json",processData:!1,async:d,contentType:"application/json",timeout:k},t="service.php",u=b.wwwroot+"/lib/ajax/";if(!h){t="service-nologin.php";u+=t+"?info="+q;if(l){u+="&cachekey="+l;s.type="GET"}}else{u+=t+"?sesskey="+b.sesskey+"&info="+q}if(j){u+="&nosessionupdate=true"}if("POST"===s.type){s.data=m}else{var v=u+"&args="+encodeURIComponent(m);if(v.length>2e3){s.type="POST";s.data=m}else{u=v}}if(d){a.ajax(u,s).done(f).fail(g)}else{s.success=f;s.error=g;a.ajax(u,s)}return o}}});
define ("core/chart_pie",["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}b.prototype=Object.create(a.prototype);b.prototype.TYPE="pie";b.prototype._doughnut=null;b.prototype.create=function(b,c){var d=a.prototype.create.apply(this,arguments);d.setDoughnut(c.doughnut);return d};b.prototype.addSeries=function(b){if(null===b.getColor()){for(var c=[],d=this.getConfigColorSet()||a.prototype.COLORSET,e=0;e<b.getCount();e++){c.push(d[e%d.length])}b.setColors(c)}return a.prototype.addSeries.apply(this,arguments)};b.prototype.getDoughnut=function(){return this._doughnut};b.prototype.setDoughnut=function(a){this._doughnut=!!a};b.prototype._validateSeries=function(){if(1<=this._series.length){throw new Error("Pie charts only support one serie.")}return a.prototype._validateSeries.apply(this,arguments)};return b});
define ("core/chart_axis",[],function(){function a(){}a.prototype.POS_DEFAULT=null;a.prototype.POS_BOTTOM="bottom";a.prototype.POS_LEFT="left";a.prototype.POS_RIGHT="right";a.prototype.POS_TOP="top";a.prototype._label=null;a.prototype._labels=null;a.prototype._max=null;a.prototype._min=null;a.prototype._position=null;a.prototype._stepSize=null;a.prototype.create=function(b){var c=new a;c.setPosition(b.position);c.setLabel(b.label);c.setStepSize(b.stepSize);c.setMax(b.max);c.setMin(b.min);c.setLabels(b.labels);return c};a.prototype.getLabel=function(){return this._label};a.prototype.getLabels=function(){return this._labels};a.prototype.getMax=function(){return this._max};a.prototype.getMin=function(){return this._min};a.prototype.getPosition=function(){return this._position};a.prototype.getStepSize=function(){return this._stepSize};a.prototype.setLabel=function(a){this._label=a||null};a.prototype.setLabels=function(a){this._labels=a||null;if(null!==this._labels&&null===this._stepSize&&(null===this._min||0===this._min)&&null===this._max){this.setStepSize(1);this.setMin(0);this.setMax(a.length-1)}};a.prototype.setMax=function(a){this._max="undefined"!=typeof a?a:null};a.prototype.setMin=function(a){this._min="undefined"!=typeof a?a:null};a.prototype.setPosition=function(a){if(a!=this.POS_DEFAULT&&a!=this.POS_BOTTOM&&a!=this.POS_LEFT&&a!=this.POS_RIGHT&&a!=this.POS_TOP){throw new Error("Invalid axis position.")}this._position=a};a.prototype.setStepSize=function(a){if("undefined"==typeof a||null===a){a=null}else if(isNaN(+a)){throw new Error("Value for stepSize is not a number.")}else{a=+a}this._stepSize=a};return a});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/chart_base",["core/chart_series","core/chart_axis"],function(a,b){function c(){this._series=[];this._labels=[];this._xaxes=[];this._yaxes=[];this._setDefaults()}c.prototype._series=null;c.prototype._labels=null;c.prototype._legendOptions=null;c.prototype._title=null;c.prototype._xaxes=null;c.prototype._yaxes=null;c.prototype.COLORSET=["#f3c300","#875692","#f38400","#a1caf1","#be0032","#c2b280","#7f180d","#008856","#e68fac","#0067a5"];c.prototype._configColorSet=null;c.prototype.TYPE=null;c.prototype.addSeries=function(a){this._validateSeries(a);this._series.push(a);if(null===a.getColor()){var b=this.getConfigColorSet()||c.prototype.COLORSET;a.setColor(b[this._series.length%b.length])}};c.prototype.create=function(c,d){var e=new c;e.setConfigColorSet(d.config_colorset);e.setLabels(d.labels);e.setTitle(d.title);if(d.legend_options){e.setLegendOptions(d.legend_options)}d.series.forEach(function(b){e.addSeries(a.prototype.create(b))});d.axes.x.forEach(function(a,c){e.setXAxis(b.prototype.create(a),c)});d.axes.y.forEach(function(a,c){e.setYAxis(b.prototype.create(a),c)});return e};c.prototype.__getAxis=function(a,c,d){var e="x"===a?this._xaxes:this._yaxes,f=("x"===a?this.setXAxis:this.setYAxis).bind(this),g;c="undefined"==typeof c?0:c;d="undefined"==typeof d?!1:d;g=e[c];if("undefined"==typeof g){if(!d){throw new Error("Unknown axis.")}g=new b;f(g,c)}return g};c.prototype.getConfigColorSet=function(){return this._configColorSet};c.prototype.getLabels=function(){return this._labels};c.prototype.getLegendOptions=function(){return this._legendOptions};c.prototype.getSeries=function(){return this._series};c.prototype.getTitle=function(){return this._title};c.prototype.getType=function(){if(!this.TYPE){throw new Error("The TYPE property has not been set.")}return this.TYPE};c.prototype.getXAxes=function(){return this._xaxes};c.prototype.getXAxis=function(a,b){return this.__getAxis("x",a,b)};c.prototype.getYAxes=function(){return this._yaxes};c.prototype.getYAxis=function(a,b){return this.__getAxis("y",a,b)};c.prototype.setConfigColorSet=function(a){this._configColorSet=a};c.prototype._setDefaults=function(){};c.prototype.setLabels=function(a){if(a.length&&this._series.length&&this._series[0].length!=a.length){throw new Error("Series must match label values.")}this._labels=a};c.prototype.setLegendOptions=function(a){if("object"!==_typeof(a)){throw new Error("Setting legend with non-object value:"+a)}this._legendOptions=a};c.prototype.setTitle=function(a){this._title=a};c.prototype.setXAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("x",a,b);this._xaxes[b]=a};c.prototype.setYAxis=function(a,b){b="undefined"==typeof b?0:b;this._validateAxis("y",a,b);this._yaxes[b]=a};c.prototype._validateAxis=function(a,b,c){c="undefined"==typeof c?0:c;if(0<c){var d="x"==a?this._xaxes:this._yaxes;if("undefined"==typeof d[c-1]){throw new Error("Missing "+a+" axis at index lower than "+c)}}};c.prototype._validateSeries=function(a){if(this._series.length&&this._series[0].getCount()!=a.getCount()){throw new Error("Series do not have an equal number of values.")}else if(this._labels.length&&this._labels.length!=a.getCount()){throw new Error("Series must match label values.")}};return c});
define ("core/local/modal/alert",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function f(a,b,c){if(b)e(a.prototype,b);if(c)e(a,c);return a}function g(a,b,c){if("undefined"!=typeof Reflect&&Reflect.get){g=Reflect.get}else{g=function(a,b,c){var d=h(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(c)}return e.value}}return g(a,b,c||a)}function h(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=p(a);if(null===a)break}return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===c(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}var q=function(a){i(b,a);var c=k(b);function b(){d(this,b);return c.apply(this,arguments)}f(b,[{key:"registerEventListeners",value:function registerEventListeners(){g(p(b.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return b}(b.default);a.default=q;return a.default});
define ("core/local/aria/aria-hidden",["exports","core/normalise","./selectors"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.unhideSiblings=a.hideSiblings=a.unhide=a.hide=void 0;c=function(a){return a&&a.__esModule?a:{default:a}}(c);var d=new Map,e=new Map,f=function(){return MutationObserver&&"function"==typeof MutationObserver},g=function(a){if(!(a instanceof HTMLElement)){return}if(a.matches(c.default.elements.focusable)){h(a)}a.querySelectorAll(c.default.elements.focusable).forEach(h)},h=function(a){if("undefined"!=typeof a.dataset.ariaHiddenTabIndex){return}if(a.getAttribute("tabindex")){a.dataset.ariaHiddenTabIndex=a.getAttribute("tabindex")}else{a.dataset.ariaHiddenTabIndex=""}a.setAttribute("tabindex",-1)},i=function(a){if(!(a instanceof HTMLElement)){return}if(a.matches(c.default.elements.focusableToUnhide)){j(a)}a.querySelectorAll(c.default.elements.focusableToUnhide).forEach(j)},j=function(a){if(a.closest(c.default.aria.hidden)){return}var b=a.dataset.ariaHiddenTabIndex;if(""===b){a.removeAttribute("tabindex")}else{a.setAttribute("tabindex",b)}delete a.dataset.ariaHiddenTabIndex},k=function(a){return(0,b.getList)(a).forEach(l)};a.hide=k;var l=function(a){if(!(a instanceof HTMLElement)){return}if(a.closest(c.default.aria.hidden)){return}a.setAttribute("aria-hidden",!0);g(a);if(f()){var b=new MutationObserver(function(a){a.forEach(function(a){a.addedNodes.forEach(g)})});b.observe(a,{childList:!0,subtree:!0});d.set(a,b)}},m=function(a){return(0,b.getList)(a).forEach(n)};a.unhide=m;var n=function(a){if(!(a instanceof HTMLElement)){return}a.removeAttribute("aria-hidden");i(a);if(d.has(a)){d.get(a).disconnect();d.delete(a)}};a.hideSiblings=function hideSiblings(a){return(0,b.getList)(a).forEach(o)};var o=function(a){if(!(a instanceof HTMLElement)){return}if(!a.parentElement){return}a.parentElement.childNodes.forEach(function(b){if(b===a){return}k(b)});if(f()){var b=new MutationObserver(function(b){b.forEach(function(b){b.addedNodes.forEach(function(b){if(a.contains(b)){return}k(b)})})});b.observe(a.parentElement,{childList:!0,subtree:!0});e.set(a.parentElement,b)}};a.unhideSiblings=function unhideSiblings(a){return(0,b.getList)(a).forEach(p)};var p=function(a){if(!(a instanceof HTMLElement)){return}if(!a.parentElement){return}a.parentElement.childNodes.forEach(function(b){if(b===a){return}m(b)});if(e.has(a.parentElement)){e.get(a.parentElement).disconnect();e.delete(a.parentElement)}}});
define ("core/local/aria/focuslock",["exports","./selectors"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.untrapFocus=a.trapFocus=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=[],d=[],e=[],f=null,g=!1,h=!1,i=function(a){if(g){return}var b=n();if(!b.parentNode){s()}if(b.contains(a.target)){f=a.target}else{j();if(f==document.activeElement){k()}f=document.activeElement}},j=function(){var a=n(),c=Array.from(a.querySelectorAll(b.default.elements.focusable));c.unshift(a);return c.some(function(a){return m(a)})},k=function(){var a=n(),c=Array.from(a.querySelectorAll(b.default.elements.focusable)).reverse();c.push(a);return c.some(function(a){return m(a)})},l=function(a){if(0<a.tabIndex||0===a.tabIndex&&null!==a.getAttribute("tabIndex")){return!0}if(a.disabled){return!1}switch(a.nodeName){case"A":return!!a.href&&"ignore"!=a.rel;case"INPUT":return"hidden"!=a.type&&"file"!=a.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1;}},m=function(a){if(!l(a)){return!1}g=!0;try{a.focus()}catch(a){}g=!1;return document.activeElement===a},n=function(){return c[c.length-1]},o=function(a){if(a===n()){return}c.push(a);var b=n(),f=document.createElement("div");f.tabIndex=0;f.style.position="fixed";f.style.top=0;f.style.left=0;var g=f.cloneNode();b.parentNode.insertBefore(g,b);d.push(g);var h=f.cloneNode();b.parentNode.insertBefore(h,b.nextSibling);e.push(h)},p=function(){c.pop();var a=e.pop();if(a){a.remove()}var b=d.pop();if(b){b.remove()}},q=function(){return!!c.length},r=function(a){o(a);if(!h){document.addEventListener("focus",i,!0)}if(!j()){var b=n(),c=b.tabIndex;b.tabIndex=0;m(b);b.tabIndex=c}f=document.activeElement;h=!0};a.trapFocus=r;var s=function(){p();if(q()){return}document.removeEventListener("focus",i,!0);f=null;g=!1;h=!1};a.untrapFocus=s});
define ("core/local/aria/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={aria:{hidden:"[aria-hidden]"},elements:{focusable:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]",focusableToUnhide:"[data-aria-hidden-tab-index]"}};return a.default});
define ("core/emoji/data",["exports"],function(F){"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.byShortName=F.byCategory=void 0;F.byCategory=[{name:"Smileys & People",emojis:[{unified:"1F600",shortnames:["grinning"]},{unified:"1F601",shortnames:["grin"]},{unified:"1F602",shortnames:["joy"]},{unified:"1F923",shortnames:["rolling_on_the_floor_laughing"]},{unified:"1F603",shortnames:["smiley"]},{unified:"1F604",shortnames:["smile"]},{unified:"1F605",shortnames:["sweat_smile"]},{unified:"1F606",shortnames:["laughing"]},{unified:"1F609",shortnames:["wink"]},{unified:"1F60A",shortnames:["blush"]},{unified:"1F60B",shortnames:["yum"]},{unified:"1F60E",shortnames:["sunglasses"]},{unified:"1F60D",shortnames:["heart_eyes"]},{unified:"1F618",shortnames:["kissing_heart"]},{unified:"1F617",shortnames:["kissing"]},{unified:"1F619",shortnames:["kissing_smiling_eyes"]},{unified:"1F61A",shortnames:["kissing_closed_eyes"]},{unified:"263A-FE0F",shortnames:["relaxed"]},{unified:"1F642",shortnames:["slightly_smiling_face"]},{unified:"1F917",shortnames:["hugging_face"]},{unified:"1F929",shortnames:["star-struck"]},{unified:"1F914",shortnames:["thinking_face"]},{unified:"1F928",shortnames:["face_with_raised_eyebrow"]},{unified:"1F610",shortnames:["neutral_face"]},{unified:"1F611",shortnames:["expressionless"]},{unified:"1F636",shortnames:["no_mouth"]},{unified:"1F644",shortnames:["face_with_rolling_eyes"]},{unified:"1F60F",shortnames:["smirk"]},{unified:"1F623",shortnames:["persevere"]},{unified:"1F625",shortnames:["disappointed_relieved"]},{unified:"1F62E",shortnames:["open_mouth"]},{unified:"1F910",shortnames:["zipper_mouth_face"]},{unified:"1F62F",shortnames:["hushed"]},{unified:"1F62A",shortnames:["sleepy"]},{unified:"1F62B",shortnames:["tired_face"]},{unified:"1F634",shortnames:["sleeping"]},{unified:"1F60C",shortnames:["relieved"]},{unified:"1F61B",shortnames:["stuck_out_tongue"]},{unified:"1F61C",shortnames:["stuck_out_tongue_winking_eye"]},{unified:"1F61D",shortnames:["stuck_out_tongue_closed_eyes"]},{unified:"1F924",shortnames:["drooling_face"]},{unified:"1F612",shortnames:["unamused"]},{unified:"1F613",shortnames:["sweat"]},{unified:"1F614",shortnames:["pensive"]},{unified:"1F615",shortnames:["confused"]},{unified:"1F643",shortnames:["upside_down_face"]},{unified:"1F911",shortnames:["money_mouth_face"]},{unified:"1F632",shortnames:["astonished"]},{unified:"2639-FE0F",shortnames:["white_frowning_face"]},{unified:"1F641",shortnames:["slightly_frowning_face"]},{unified:"1F616",shortnames:["confounded"]},{unified:"1F61E",shortnames:["disappointed"]},{unified:"1F61F",shortnames:["worried"]},{unified:"1F624",shortnames:["triumph"]},{unified:"1F622",shortnames:["cry"]},{unified:"1F62D",shortnames:["sob"]},{unified:"1F626",shortnames:["frowning"]},{unified:"1F627",shortnames:["anguished"]},{unified:"1F628",shortnames:["fearful"]},{unified:"1F629",shortnames:["weary"]},{unified:"1F92F",shortnames:["exploding_head"]},{unified:"1F62C",shortnames:["grimacing"]},{unified:"1F630",shortnames:["cold_sweat"]},{unified:"1F631",shortnames:["scream"]},{unified:"1F633",shortnames:["flushed"]},{unified:"1F92A",shortnames:["zany_face"]},{unified:"1F635",shortnames:["dizzy_face"]},{unified:"1F621",shortnames:["rage"]},{unified:"1F620",shortnames:["angry"]},{unified:"1F92C",shortnames:["face_with_symbols_on_mouth"]},{unified:"1F637",shortnames:["mask"]},{unified:"1F912",shortnames:["face_with_thermometer"]},{unified:"1F915",shortnames:["face_with_head_bandage"]},{unified:"1F922",shortnames:["nauseated_face"]},{unified:"1F92E",shortnames:["face_vomiting"]},{unified:"1F927",shortnames:["sneezing_face"]},{unified:"1F607",shortnames:["innocent"]},{unified:"1F920",shortnames:["face_with_cowboy_hat"]},{unified:"1F921",shortnames:["clown_face"]},{unified:"1F925",shortnames:["lying_face"]},{unified:"1F92B",shortnames:["shushing_face"]},{unified:"1F92D",shortnames:["face_with_hand_over_mouth"]},{unified:"1F9D0",shortnames:["face_with_monocle"]},{unified:"1F913",shortnames:["nerd_face"]},{unified:"1F608",shortnames:["smiling_imp"]},{unified:"1F47F",shortnames:["imp"]},{unified:"1F479",shortnames:["japanese_ogre"]},{unified:"1F47A",shortnames:["japanese_goblin"]},{unified:"1F480",shortnames:["skull"]},{unified:"2620-FE0F",shortnames:["skull_and_crossbones"]},{unified:"1F47B",shortnames:["ghost"]},{unified:"1F47D",shortnames:["alien"]},{unified:"1F47E",shortnames:["space_invader"]},{unified:"1F916",shortnames:["robot_face"]},{unified:"1F4A9",shortnames:["hankey"]},{unified:"1F63A",shortnames:["smiley_cat"]},{unified:"1F638",shortnames:["smile_cat"]},{unified:"1F639",shortnames:["joy_cat"]},{unified:"1F63B",shortnames:["heart_eyes_cat"]},{unified:"1F63C",shortnames:["smirk_cat"]},{unified:"1F63D",shortnames:["kissing_cat"]},{unified:"1F640",shortnames:["scream_cat"]},{unified:"1F63F",shortnames:["crying_cat_face"]},{unified:"1F63E",shortnames:["pouting_cat"]},{unified:"1F648",shortnames:["see_no_evil"]},{unified:"1F649",shortnames:["hear_no_evil"]},{unified:"1F64A",shortnames:["speak_no_evil"]},{unified:"1F476",shortnames:["baby"]},{unified:"1F9D2",shortnames:["child"]},{unified:"1F466",shortnames:["boy"]},{unified:"1F467",shortnames:["girl"]},{unified:"1F9D1",shortnames:["adult"]},{unified:"1F468",shortnames:["man"]},{unified:"1F469",shortnames:["woman"]},{unified:"1F9D3",shortnames:["older_adult"]},{unified:"1F474",shortnames:["older_man"]},{unified:"1F475",shortnames:["older_woman"]},{unified:"1F468-200D-2695-FE0F",shortnames:["male-doctor"]},{unified:"1F469-200D-2695-FE0F",shortnames:["female-doctor"]},{unified:"1F468-200D-1F393",shortnames:["male-student"]},{unified:"1F469-200D-1F393",shortnames:["female-student"]},{unified:"1F468-200D-1F3EB",shortnames:["male-teacher"]},{unified:"1F469-200D-1F3EB",shortnames:["female-teacher"]},{unified:"1F468-200D-2696-FE0F",shortnames:["male-judge"]},{unified:"1F469-200D-2696-FE0F",shortnames:["female-judge"]},{unified:"1F468-200D-1F33E",shortnames:["male-farmer"]},{unified:"1F469-200D-1F33E",shortnames:["female-farmer"]},{unified:"1F468-200D-1F373",shortnames:["male-cook"]},{unified:"1F469-200D-1F373",shortnames:["female-cook"]},{unified:"1F468-200D-1F527",shortnames:["male-mechanic"]},{unified:"1F469-200D-1F527",shortnames:["female-mechanic"]},{unified:"1F468-200D-1F3ED",shortnames:["male-factory-worker"]},{unified:"1F469-200D-1F3ED",shortnames:["female-factory-worker"]},{unified:"1F468-200D-1F4BC",shortnames:["male-office-worker"]},{unified:"1F469-200D-1F4BC",shortnames:["female-office-worker"]},{unified:"1F468-200D-1F52C",shortnames:["male-scientist"]},{unified:"1F469-200D-1F52C",shortnames:["female-scientist"]},{unified:"1F468-200D-1F4BB",shortnames:["male-technologist"]},{unified:"1F469-200D-1F4BB",shortnames:["female-technologist"]},{unified:"1F468-200D-1F3A4",shortnames:["male-singer"]},{unified:"1F469-200D-1F3A4",shortnames:["female-singer"]},{unified:"1F468-200D-1F3A8",shortnames:["male-artist"]},{unified:"1F469-200D-1F3A8",shortnames:["female-artist"]},{unified:"1F468-200D-2708-FE0F",shortnames:["male-pilot"]},{unified:"1F469-200D-2708-FE0F",shortnames:["female-pilot"]},{unified:"1F468-200D-1F680",shortnames:["male-astronaut"]},{unified:"1F469-200D-1F680",shortnames:["female-astronaut"]},{unified:"1F468-200D-1F692",shortnames:["male-firefighter"]},{unified:"1F469-200D-1F692",shortnames:["female-firefighter"]},{unified:"1F46E-200D-2642-FE0F",shortnames:["male-police-officer","cop"]},{unified:"1F46E-200D-2640-FE0F",shortnames:["female-police-officer"]},{unified:"1F575-FE0F-200D-2642-FE0F",shortnames:["male-detective","sleuth_or_spy"]},{unified:"1F575-FE0F-200D-2640-FE0F",shortnames:["female-detective"]},{unified:"1F482-200D-2642-FE0F",shortnames:["male-guard","guardsman"]},{unified:"1F482-200D-2640-FE0F",shortnames:["female-guard"]},{unified:"1F477-200D-2642-FE0F",shortnames:["male-construction-worker","construction_worker"]},{unified:"1F477-200D-2640-FE0F",shortnames:["female-construction-worker"]},{unified:"1F934",shortnames:["prince"]},{unified:"1F478",shortnames:["princess"]},{unified:"1F473-200D-2642-FE0F",shortnames:["man-wearing-turban","man_with_turban"]},{unified:"1F473-200D-2640-FE0F",shortnames:["woman-wearing-turban"]},{unified:"1F472",shortnames:["man_with_gua_pi_mao"]},{unified:"1F9D5",shortnames:["person_with_headscarf"]},{unified:"1F9D4",shortnames:["bearded_person"]},{unified:"1F471-200D-2642-FE0F",shortnames:["blond-haired-man","person_with_blond_hair"]},{unified:"1F471-200D-2640-FE0F",shortnames:["blond-haired-woman"]},{unified:"1F935",shortnames:["man_in_tuxedo"]},{unified:"1F470",shortnames:["bride_with_veil"]},{unified:"1F930",shortnames:["pregnant_woman"]},{unified:"1F931",shortnames:["breast-feeding"]},{unified:"1F47C",shortnames:["angel"]},{unified:"1F385",shortnames:["santa"]},{unified:"1F936",shortnames:["mrs_claus"]},{unified:"1F9D9-200D-2640-FE0F",shortnames:["female_mage","mage"]},{unified:"1F9D9-200D-2642-FE0F",shortnames:["male_mage"]},{unified:"1F9DA-200D-2640-FE0F",shortnames:["female_fairy","fairy"]},{unified:"1F9DA-200D-2642-FE0F",shortnames:["male_fairy"]},{unified:"1F9DB-200D-2640-FE0F",shortnames:["female_vampire","vampire"]},{unified:"1F9DB-200D-2642-FE0F",shortnames:["male_vampire"]},{unified:"1F9DC-200D-2640-FE0F",shortnames:["mermaid"]},{unified:"1F9DC-200D-2642-FE0F",shortnames:["merman","merperson"]},{unified:"1F9DD-200D-2640-FE0F",shortnames:["female_elf"]},{unified:"1F9DD-200D-2642-FE0F",shortnames:["male_elf","elf"]},{unified:"1F9DE-200D-2640-FE0F",shortnames:["female_genie"]},{unified:"1F9DE-200D-2642-FE0F",shortnames:["male_genie","genie"]},{unified:"1F9DF-200D-2640-FE0F",shortnames:["female_zombie"]},{unified:"1F9DF-200D-2642-FE0F",shortnames:["male_zombie","zombie"]},{unified:"1F64D-200D-2642-FE0F",shortnames:["man-frowning"]},{unified:"1F64D-200D-2640-FE0F",shortnames:["woman-frowning","person_frowning"]},{unified:"1F64E-200D-2642-FE0F",shortnames:["man-pouting"]},{unified:"1F64E-200D-2640-FE0F",shortnames:["woman-pouting","person_with_pouting_face"]},{unified:"1F645-200D-2642-FE0F",shortnames:["man-gesturing-no"]},{unified:"1F645-200D-2640-FE0F",shortnames:["woman-gesturing-no","no_good"]},{unified:"1F646-200D-2642-FE0F",shortnames:["man-gesturing-ok"]},{unified:"1F646-200D-2640-FE0F",shortnames:["woman-gesturing-ok","ok_woman"]},{unified:"1F481-200D-2642-FE0F",shortnames:["man-tipping-hand"]},{unified:"1F481-200D-2640-FE0F",shortnames:["woman-tipping-hand","information_desk_person"]},{unified:"1F64B-200D-2642-FE0F",shortnames:["man-raising-hand"]},{unified:"1F64B-200D-2640-FE0F",shortnames:["woman-raising-hand","raising_hand"]},{unified:"1F647-200D-2642-FE0F",shortnames:["man-bowing","bow"]},{unified:"1F647-200D-2640-FE0F",shortnames:["woman-bowing"]},{unified:"1F926",shortnames:["face_palm"]},{unified:"1F926-200D-2642-FE0F",shortnames:["man-facepalming"]},{unified:"1F926-200D-2640-FE0F",shortnames:["woman-facepalming"]},{unified:"1F937",shortnames:["shrug"]},{unified:"1F937-200D-2642-FE0F",shortnames:["man-shrugging"]},{unified:"1F937-200D-2640-FE0F",shortnames:["woman-shrugging"]},{unified:"1F486-200D-2642-FE0F",shortnames:["man-getting-massage"]},{unified:"1F486-200D-2640-FE0F",shortnames:["woman-getting-massage","massage"]},{unified:"1F487-200D-2642-FE0F",shortnames:["man-getting-haircut"]},{unified:"1F487-200D-2640-FE0F",shortnames:["woman-getting-haircut","haircut"]},{unified:"1F6B6-200D-2642-FE0F",shortnames:["man-walking","walking"]},{unified:"1F6B6-200D-2640-FE0F",shortnames:["woman-walking"]},{unified:"1F3C3-200D-2642-FE0F",shortnames:["man-running","runner"]},{unified:"1F3C3-200D-2640-FE0F",shortnames:["woman-running"]},{unified:"1F483",shortnames:["dancer"]},{unified:"1F57A",shortnames:["man_dancing"]},{unified:"1F46F-200D-2642-FE0F",shortnames:["man-with-bunny-ears-partying"]},{unified:"1F46F-200D-2640-FE0F",shortnames:["woman-with-bunny-ears-partying","dancers"]},{unified:"1F9D6-200D-2640-FE0F",shortnames:["woman_in_steamy_room"]},{unified:"1F9D6-200D-2642-FE0F",shortnames:["man_in_steamy_room","person_in_steamy_room"]},{unified:"1F9D7-200D-2640-FE0F",shortnames:["woman_climbing","person_climbing"]},{unified:"1F9D7-200D-2642-FE0F",shortnames:["man_climbing"]},{unified:"1F9D8-200D-2640-FE0F",shortnames:["woman_in_lotus_position","person_in_lotus_position"]},{unified:"1F9D8-200D-2642-FE0F",shortnames:["man_in_lotus_position"]},{unified:"1F6C0",shortnames:["bath"]},{unified:"1F6CC",shortnames:["sleeping_accommodation"]},{unified:"1F574-FE0F",shortnames:["man_in_business_suit_levitating"]},{unified:"1F5E3-FE0F",shortnames:["speaking_head_in_silhouette"]},{unified:"1F464",shortnames:["bust_in_silhouette"]},{unified:"1F465",shortnames:["busts_in_silhouette"]},{unified:"1F93A",shortnames:["fencer"]},{unified:"1F3C7",shortnames:["horse_racing"]},{unified:"26F7-FE0F",shortnames:["skier"]},{unified:"1F3C2",shortnames:["snowboarder"]},{unified:"1F3CC-FE0F-200D-2642-FE0F",shortnames:["man-golfing","golfer"]},{unified:"1F3CC-FE0F-200D-2640-FE0F",shortnames:["woman-golfing"]},{unified:"1F3C4-200D-2642-FE0F",shortnames:["man-surfing","surfer"]},{unified:"1F3C4-200D-2640-FE0F",shortnames:["woman-surfing"]},{unified:"1F6A3-200D-2642-FE0F",shortnames:["man-rowing-boat","rowboat"]},{unified:"1F6A3-200D-2640-FE0F",shortnames:["woman-rowing-boat"]},{unified:"1F3CA-200D-2642-FE0F",shortnames:["man-swimming","swimmer"]},{unified:"1F3CA-200D-2640-FE0F",shortnames:["woman-swimming"]},{unified:"26F9-FE0F-200D-2642-FE0F",shortnames:["man-bouncing-ball","person_with_ball"]},{unified:"26F9-FE0F-200D-2640-FE0F",shortnames:["woman-bouncing-ball"]},{unified:"1F3CB-FE0F-200D-2642-FE0F",shortnames:["man-lifting-weights","weight_lifter"]},{unified:"1F3CB-FE0F-200D-2640-FE0F",shortnames:["woman-lifting-weights"]},{unified:"1F6B4-200D-2642-FE0F",shortnames:["man-biking","bicyclist"]},{unified:"1F6B4-200D-2640-FE0F",shortnames:["woman-biking"]},{unified:"1F6B5-200D-2642-FE0F",shortnames:["man-mountain-biking","mountain_bicyclist"]},{unified:"1F6B5-200D-2640-FE0F",shortnames:["woman-mountain-biking"]},{unified:"1F3CE-FE0F",shortnames:["racing_car"]},{unified:"1F3CD-FE0F",shortnames:["racing_motorcycle"]},{unified:"1F938",shortnames:["person_doing_cartwheel"]},{unified:"1F938-200D-2642-FE0F",shortnames:["man-cartwheeling"]},{unified:"1F938-200D-2640-FE0F",shortnames:["woman-cartwheeling"]},{unified:"1F93C",shortnames:["wrestlers"]},{unified:"1F93C-200D-2642-FE0F",shortnames:["man-wrestling"]},{unified:"1F93C-200D-2640-FE0F",shortnames:["woman-wrestling"]},{unified:"1F93D",shortnames:["water_polo"]},{unified:"1F93D-200D-2642-FE0F",shortnames:["man-playing-water-polo"]},{unified:"1F93D-200D-2640-FE0F",shortnames:["woman-playing-water-polo"]},{unified:"1F93E",shortnames:["handball"]},{unified:"1F93E-200D-2642-FE0F",shortnames:["man-playing-handball"]},{unified:"1F93E-200D-2640-FE0F",shortnames:["woman-playing-handball"]},{unified:"1F939",shortnames:["juggling"]},{unified:"1F939-200D-2642-FE0F",shortnames:["man-juggling"]},{unified:"1F939-200D-2640-FE0F",shortnames:["woman-juggling"]},{unified:"1F46B",shortnames:["couple"]},{unified:"1F46C",shortnames:["two_men_holding_hands"]},{unified:"1F46D",shortnames:["two_women_holding_hands"]},{unified:"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468",shortnames:["woman-kiss-man","couplekiss"]},{unified:"1F468-200D-2764-FE0F-200D-1F48B-200D-1F468",shortnames:["man-kiss-man"]},{unified:"1F469-200D-2764-FE0F-200D-1F48B-200D-1F469",shortnames:["woman-kiss-woman"]},{unified:"1F469-200D-2764-FE0F-200D-1F468",shortnames:["woman-heart-man","couple_with_heart"]},{unified:"1F468-200D-2764-FE0F-200D-1F468",shortnames:["man-heart-man"]},{unified:"1F469-200D-2764-FE0F-200D-1F469",shortnames:["woman-heart-woman"]},{unified:"1F468-200D-1F469-200D-1F466",shortnames:["man-woman-boy","family"]},{unified:"1F468-200D-1F469-200D-1F467",shortnames:["man-woman-girl"]},{unified:"1F468-200D-1F469-200D-1F467-200D-1F466",shortnames:["man-woman-girl-boy"]},{unified:"1F468-200D-1F469-200D-1F466-200D-1F466",shortnames:["man-woman-boy-boy"]},{unified:"1F468-200D-1F469-200D-1F467-200D-1F467",shortnames:["man-woman-girl-girl"]},{unified:"1F468-200D-1F468-200D-1F466",shortnames:["man-man-boy"]},{unified:"1F468-200D-1F468-200D-1F467",shortnames:["man-man-girl"]},{unified:"1F468-200D-1F468-200D-1F467-200D-1F466",shortnames:["man-man-girl-boy"]},{unified:"1F468-200D-1F468-200D-1F466-200D-1F466",shortnames:["man-man-boy-boy"]},{unified:"1F468-200D-1F468-200D-1F467-200D-1F467",shortnames:["man-man-girl-girl"]},{unified:"1F469-200D-1F469-200D-1F466",shortnames:["woman-woman-boy"]},{unified:"1F469-200D-1F469-200D-1F467",shortnames:["woman-woman-girl"]},{unified:"1F469-200D-1F469-200D-1F467-200D-1F466",shortnames:["woman-woman-girl-boy"]},{unified:"1F469-200D-1F469-200D-1F466-200D-1F466",shortnames:["woman-woman-boy-boy"]},{unified:"1F469-200D-1F469-200D-1F467-200D-1F467",shortnames:["woman-woman-girl-girl"]},{unified:"1F468-200D-1F466",shortnames:["man-boy"]},{unified:"1F468-200D-1F466-200D-1F466",shortnames:["man-boy-boy"]},{unified:"1F468-200D-1F467",shortnames:["man-girl"]},{unified:"1F468-200D-1F467-200D-1F466",shortnames:["man-girl-boy"]},{unified:"1F468-200D-1F467-200D-1F467",shortnames:["man-girl-girl"]},{unified:"1F469-200D-1F466",shortnames:["woman-boy"]},{unified:"1F469-200D-1F466-200D-1F466",shortnames:["woman-boy-boy"]},{unified:"1F469-200D-1F467",shortnames:["woman-girl"]},{unified:"1F469-200D-1F467-200D-1F466",shortnames:["woman-girl-boy"]},{unified:"1F469-200D-1F467-200D-1F467",shortnames:["woman-girl-girl"]},{unified:"1F933",shortnames:["selfie"]},{unified:"1F4AA",shortnames:["muscle"]},{unified:"1F448",shortnames:["point_left"]},{unified:"1F449",shortnames:["point_right"]},{unified:"261D-FE0F",shortnames:["point_up"]},{unified:"1F446",shortnames:["point_up_2"]},{unified:"1F595",shortnames:["middle_finger"]},{unified:"1F447",shortnames:["point_down"]},{unified:"270C-FE0F",shortnames:["v"]},{unified:"1F91E",shortnames:["crossed_fingers"]},{unified:"1F596",shortnames:["spock-hand"]},{unified:"1F918",shortnames:["the_horns"]},{unified:"1F919",shortnames:["call_me_hand"]},{unified:"1F590-FE0F",shortnames:["raised_hand_with_fingers_splayed"]},{unified:"270B",shortnames:["hand"]},{unified:"1F44C",shortnames:["ok_hand"]},{unified:"1F44D",shortnames:["+1"]},{unified:"1F44E",shortnames:["-1"]},{unified:"270A",shortnames:["fist"]},{unified:"1F44A",shortnames:["facepunch"]},{unified:"1F91B",shortnames:["left-facing_fist"]},{unified:"1F91C",shortnames:["right-facing_fist"]},{unified:"1F91A",shortnames:["raised_back_of_hand"]},{unified:"1F44B",shortnames:["wave"]},{unified:"1F91F",shortnames:["i_love_you_hand_sign"]},{unified:"270D-FE0F",shortnames:["writing_hand"]},{unified:"1F44F",shortnames:["clap"]},{unified:"1F450",shortnames:["open_hands"]},{unified:"1F64C",shortnames:["raised_hands"]},{unified:"1F932",shortnames:["palms_up_together"]},{unified:"1F64F",shortnames:["pray"]},{unified:"1F91D",shortnames:["handshake"]},{unified:"1F485",shortnames:["nail_care"]},{unified:"1F442",shortnames:["ear"]},{unified:"1F443",shortnames:["nose"]},{unified:"1F463",shortnames:["footprints"]},{unified:"1F440",shortnames:["eyes"]},{unified:"1F441-FE0F",shortnames:["eye"]},{unified:"1F441-FE0F-200D-1F5E8-FE0F",shortnames:["eye-in-speech-bubble"]},{unified:"1F9E0",shortnames:["brain"]},{unified:"1F445",shortnames:["tongue"]},{unified:"1F444",shortnames:["lips"]},{unified:"1F48B",shortnames:["kiss"]},{unified:"1F498",shortnames:["cupid"]},{unified:"2764-FE0F",shortnames:["heart"]},{unified:"1F493",shortnames:["heartbeat"]},{unified:"1F494",shortnames:["broken_heart"]},{unified:"1F495",shortnames:["two_hearts"]},{unified:"1F496",shortnames:["sparkling_heart"]},{unified:"1F497",shortnames:["heartpulse"]},{unified:"1F499",shortnames:["blue_heart"]},{unified:"1F49A",shortnames:["green_heart"]},{unified:"1F49B",shortnames:["yellow_heart"]},{unified:"1F9E1",shortnames:["orange_heart"]},{unified:"1F49C",shortnames:["purple_heart"]},{unified:"1F5A4",shortnames:["black_heart"]},{unified:"1F49D",shortnames:["gift_heart"]},{unified:"1F49E",shortnames:["revolving_hearts"]},{unified:"1F49F",shortnames:["heart_decoration"]},{unified:"2763-FE0F",shortnames:["heavy_heart_exclamation_mark_ornament"]},{unified:"1F48C",shortnames:["love_letter"]},{unified:"1F4A4",shortnames:["zzz"]},{unified:"1F4A2",shortnames:["anger"]},{unified:"1F4A3",shortnames:["bomb"]},{unified:"1F4A5",shortnames:["boom"]},{unified:"1F4A6",shortnames:["sweat_drops"]},{unified:"1F4A8",shortnames:["dash"]},{unified:"1F4AB",shortnames:["dizzy"]},{unified:"1F4AC",shortnames:["speech_balloon"]},{unified:"1F5E8-FE0F",shortnames:["left_speech_bubble"]},{unified:"1F5EF-FE0F",shortnames:["right_anger_bubble"]},{unified:"1F4AD",shortnames:["thought_balloon"]},{unified:"1F573-FE0F",shortnames:["hole"]},{unified:"1F453",shortnames:["eyeglasses"]},{unified:"1F576-FE0F",shortnames:["dark_sunglasses"]},{unified:"1F454",shortnames:["necktie"]},{unified:"1F455",shortnames:["shirt"]},{unified:"1F456",shortnames:["jeans"]},{unified:"1F9E3",shortnames:["scarf"]},{unified:"1F9E4",shortnames:["gloves"]},{unified:"1F9E5",shortnames:["coat"]},{unified:"1F9E6",shortnames:["socks"]},{unified:"1F457",shortnames:["dress"]},{unified:"1F458",shortnames:["kimono"]},{unified:"1F459",shortnames:["bikini"]},{unified:"1F45A",shortnames:["womans_clothes"]},{unified:"1F45B",shortnames:["purse"]},{unified:"1F45C",shortnames:["handbag"]},{unified:"1F45D",shortnames:["pouch"]},{unified:"1F6CD-FE0F",shortnames:["shopping_bags"]},{unified:"1F392",shortnames:["school_satchel"]},{unified:"1F45E",shortnames:["mans_shoe"]},{unified:"1F45F",shortnames:["athletic_shoe"]},{unified:"1F460",shortnames:["high_heel"]},{unified:"1F461",shortnames:["sandal"]},{unified:"1F462",shortnames:["boot"]},{unified:"1F451",shortnames:["crown"]},{unified:"1F452",shortnames:["womans_hat"]},{unified:"1F3A9",shortnames:["tophat"]},{unified:"1F393",shortnames:["mortar_board"]},{unified:"1F9E2",shortnames:["billed_cap"]},{unified:"26D1-FE0F",shortnames:["helmet_with_white_cross"]},{unified:"1F4FF",shortnames:["prayer_beads"]},{unified:"1F484",shortnames:["lipstick"]},{unified:"1F48D",shortnames:["ring"]},{unified:"1F48E",shortnames:["gem"]}]},{name:"Animals & Nature",emojis:[{unified:"1F435",shortnames:["monkey_face"]},{unified:"1F412",shortnames:["monkey"]},{unified:"1F98D",shortnames:["gorilla"]},{unified:"1F436",shortnames:["dog"]},{unified:"1F415",shortnames:["dog2"]},{unified:"1F429",shortnames:["poodle"]},{unified:"1F43A",shortnames:["wolf"]},{unified:"1F98A",shortnames:["fox_face"]},{unified:"1F431",shortnames:["cat"]},{unified:"1F408",shortnames:["cat2"]},{unified:"1F981",shortnames:["lion_face"]},{unified:"1F42F",shortnames:["tiger"]},{unified:"1F405",shortnames:["tiger2"]},{unified:"1F406",shortnames:["leopard"]},{unified:"1F434",shortnames:["horse"]},{unified:"1F40E",shortnames:["racehorse"]},{unified:"1F984",shortnames:["unicorn_face"]},{unified:"1F993",shortnames:["zebra_face"]},{unified:"1F98C",shortnames:["deer"]},{unified:"1F42E",shortnames:["cow"]},{unified:"1F402",shortnames:["ox"]},{unified:"1F403",shortnames:["water_buffalo"]},{unified:"1F404",shortnames:["cow2"]},{unified:"1F437",shortnames:["pig"]},{unified:"1F416",shortnames:["pig2"]},{unified:"1F417",shortnames:["boar"]},{unified:"1F43D",shortnames:["pig_nose"]},{unified:"1F40F",shortnames:["ram"]},{unified:"1F411",shortnames:["sheep"]},{unified:"1F410",shortnames:["goat"]},{unified:"1F42A",shortnames:["dromedary_camel"]},{unified:"1F42B",shortnames:["camel"]},{unified:"1F992",shortnames:["giraffe_face"]},{unified:"1F418",shortnames:["elephant"]},{unified:"1F98F",shortnames:["rhinoceros"]},{unified:"1F42D",shortnames:["mouse"]},{unified:"1F401",shortnames:["mouse2"]},{unified:"1F400",shortnames:["rat"]},{unified:"1F439",shortnames:["hamster"]},{unified:"1F430",shortnames:["rabbit"]},{unified:"1F407",shortnames:["rabbit2"]},{unified:"1F43F-FE0F",shortnames:["chipmunk"]},{unified:"1F994",shortnames:["hedgehog"]},{unified:"1F987",shortnames:["bat"]},{unified:"1F43B",shortnames:["bear"]},{unified:"1F428",shortnames:["koala"]},{unified:"1F43C",shortnames:["panda_face"]},{unified:"1F43E",shortnames:["feet"]},{unified:"1F983",shortnames:["turkey"]},{unified:"1F414",shortnames:["chicken"]},{unified:"1F413",shortnames:["rooster"]},{unified:"1F423",shortnames:["hatching_chick"]},{unified:"1F424",shortnames:["baby_chick"]},{unified:"1F425",shortnames:["hatched_chick"]},{unified:"1F426",shortnames:["bird"]},{unified:"1F427",shortnames:["penguin"]},{unified:"1F54A-FE0F",shortnames:["dove_of_peace"]},{unified:"1F985",shortnames:["eagle"]},{unified:"1F986",shortnames:["duck"]},{unified:"1F989",shortnames:["owl"]},{unified:"1F438",shortnames:["frog"]},{unified:"1F40A",shortnames:["crocodile"]},{unified:"1F422",shortnames:["turtle"]},{unified:"1F98E",shortnames:["lizard"]},{unified:"1F40D",shortnames:["snake"]},{unified:"1F432",shortnames:["dragon_face"]},{unified:"1F409",shortnames:["dragon"]},{unified:"1F995",shortnames:["sauropod"]},{unified:"1F996",shortnames:["t-rex"]},{unified:"1F433",shortnames:["whale"]},{unified:"1F40B",shortnames:["whale2"]},{unified:"1F42C",shortnames:["dolphin"]},{unified:"1F41F",shortnames:["fish"]},{unified:"1F420",shortnames:["tropical_fish"]},{unified:"1F421",shortnames:["blowfish"]},{unified:"1F988",shortnames:["shark"]},{unified:"1F419",shortnames:["octopus"]},{unified:"1F41A",shortnames:["shell"]},{unified:"1F980",shortnames:["crab"]},{unified:"1F990",shortnames:["shrimp"]},{unified:"1F991",shortnames:["squid"]},{unified:"1F40C",shortnames:["snail"]},{unified:"1F98B",shortnames:["butterfly"]},{unified:"1F41B",shortnames:["bug"]},{unified:"1F41C",shortnames:["ant"]},{unified:"1F41D",shortnames:["bee"]},{unified:"1F41E",shortnames:["beetle"]},{unified:"1F997",shortnames:["cricket"]},{unified:"1F577-FE0F",shortnames:["spider"]},{unified:"1F578-FE0F",shortnames:["spider_web"]},{unified:"1F982",shortnames:["scorpion"]},{unified:"1F490",shortnames:["bouquet"]},{unified:"1F338",shortnames:["cherry_blossom"]},{unified:"1F4AE",shortnames:["white_flower"]},{unified:"1F3F5-FE0F",shortnames:["rosette"]},{unified:"1F339",shortnames:["rose"]},{unified:"1F940",shortnames:["wilted_flower"]},{unified:"1F33A",shortnames:["hibiscus"]},{unified:"1F33B",shortnames:["sunflower"]},{unified:"1F33C",shortnames:["blossom"]},{unified:"1F337",shortnames:["tulip"]},{unified:"1F331",shortnames:["seedling"]},{unified:"1F332",shortnames:["evergreen_tree"]},{unified:"1F333",shortnames:["deciduous_tree"]},{unified:"1F334",shortnames:["palm_tree"]},{unified:"1F335",shortnames:["cactus"]},{unified:"1F33E",shortnames:["ear_of_rice"]},{unified:"1F33F",shortnames:["herb"]},{unified:"2618-FE0F",shortnames:["shamrock"]},{unified:"1F340",shortnames:["four_leaf_clover"]},{unified:"1F341",shortnames:["maple_leaf"]},{unified:"1F342",shortnames:["fallen_leaf"]},{unified:"1F343",shortnames:["leaves"]}]},{name:"Food & Drink",emojis:[{unified:"1F347",shortnames:["grapes"]},{unified:"1F348",shortnames:["melon"]},{unified:"1F349",shortnames:["watermelon"]},{unified:"1F34A",shortnames:["tangerine"]},{unified:"1F34B",shortnames:["lemon"]},{unified:"1F34C",shortnames:["banana"]},{unified:"1F34D",shortnames:["pineapple"]},{unified:"1F34E",shortnames:["apple"]},{unified:"1F34F",shortnames:["green_apple"]},{unified:"1F350",shortnames:["pear"]},{unified:"1F351",shortnames:["peach"]},{unified:"1F352",shortnames:["cherries"]},{unified:"1F353",shortnames:["strawberry"]},{unified:"1F95D",shortnames:["kiwifruit"]},{unified:"1F345",shortnames:["tomato"]},{unified:"1F965",shortnames:["coconut"]},{unified:"1F951",shortnames:["avocado"]},{unified:"1F346",shortnames:["eggplant"]},{unified:"1F954",shortnames:["potato"]},{unified:"1F955",shortnames:["carrot"]},{unified:"1F33D",shortnames:["corn"]},{unified:"1F336-FE0F",shortnames:["hot_pepper"]},{unified:"1F952",shortnames:["cucumber"]},{unified:"1F966",shortnames:["broccoli"]},{unified:"1F344",shortnames:["mushroom"]},{unified:"1F95C",shortnames:["peanuts"]},{unified:"1F330",shortnames:["chestnut"]},{unified:"1F35E",shortnames:["bread"]},{unified:"1F950",shortnames:["croissant"]},{unified:"1F956",shortnames:["baguette_bread"]},{unified:"1F968",shortnames:["pretzel"]},{unified:"1F95E",shortnames:["pancakes"]},{unified:"1F9C0",shortnames:["cheese_wedge"]},{unified:"1F356",shortnames:["meat_on_bone"]},{unified:"1F357",shortnames:["poultry_leg"]},{unified:"1F969",shortnames:["cut_of_meat"]},{unified:"1F953",shortnames:["bacon"]},{unified:"1F354",shortnames:["hamburger"]},{unified:"1F35F",shortnames:["fries"]},{unified:"1F355",shortnames:["pizza"]},{unified:"1F32D",shortnames:["hotdog"]},{unified:"1F96A",shortnames:["sandwich"]},{unified:"1F32E",shortnames:["taco"]},{unified:"1F32F",shortnames:["burrito"]},{unified:"1F959",shortnames:["stuffed_flatbread"]},{unified:"1F95A",shortnames:["egg"]},{unified:"1F373",shortnames:["fried_egg"]},{unified:"1F958",shortnames:["shallow_pan_of_food"]},{unified:"1F372",shortnames:["stew"]},{unified:"1F963",shortnames:["bowl_with_spoon"]},{unified:"1F957",shortnames:["green_salad"]},{unified:"1F37F",shortnames:["popcorn"]},{unified:"1F96B",shortnames:["canned_food"]},{unified:"1F371",shortnames:["bento"]},{unified:"1F358",shortnames:["rice_cracker"]},{unified:"1F359",shortnames:["rice_ball"]},{unified:"1F35A",shortnames:["rice"]},{unified:"1F35B",shortnames:["curry"]},{unified:"1F35C",shortnames:["ramen"]},{unified:"1F35D",shortnames:["spaghetti"]},{unified:"1F360",shortnames:["sweet_potato"]},{unified:"1F362",shortnames:["oden"]},{unified:"1F363",shortnames:["sushi"]},{unified:"1F364",shortnames:["fried_shrimp"]},{unified:"1F365",shortnames:["fish_cake"]},{unified:"1F361",shortnames:["dango"]},{unified:"1F95F",shortnames:["dumpling"]},{unified:"1F960",shortnames:["fortune_cookie"]},{unified:"1F961",shortnames:["takeout_box"]},{unified:"1F366",shortnames:["icecream"]},{unified:"1F367",shortnames:["shaved_ice"]},{unified:"1F368",shortnames:["ice_cream"]},{unified:"1F369",shortnames:["doughnut"]},{unified:"1F36A",shortnames:["cookie"]},{unified:"1F382",shortnames:["birthday"]},{unified:"1F370",shortnames:["cake"]},{unified:"1F967",shortnames:["pie"]},{unified:"1F36B",shortnames:["chocolate_bar"]},{unified:"1F36C",shortnames:["candy"]},{unified:"1F36D",shortnames:["lollipop"]},{unified:"1F36E",shortnames:["custard"]},{unified:"1F36F",shortnames:["honey_pot"]},{unified:"1F37C",shortnames:["baby_bottle"]},{unified:"1F95B",shortnames:["glass_of_milk"]},{unified:"2615",shortnames:["coffee"]},{unified:"1F375",shortnames:["tea"]},{unified:"1F376",shortnames:["sake"]},{unified:"1F37E",shortnames:["champagne"]},{unified:"1F377",shortnames:["wine_glass"]},{unified:"1F378",shortnames:["cocktail"]},{unified:"1F379",shortnames:["tropical_drink"]},{unified:"1F37A",shortnames:["beer"]},{unified:"1F37B",shortnames:["beers"]},{unified:"1F942",shortnames:["clinking_glasses"]},{unified:"1F943",shortnames:["tumbler_glass"]},{unified:"1F964",shortnames:["cup_with_straw"]},{unified:"1F962",shortnames:["chopsticks"]},{unified:"1F37D-FE0F",shortnames:["knife_fork_plate"]},{unified:"1F374",shortnames:["fork_and_knife"]},{unified:"1F944",shortnames:["spoon"]},{unified:"1F52A",shortnames:["hocho"]},{unified:"1F3FA",shortnames:["amphora"]}]},{name:"Travel & Places",emojis:[{unified:"1F30D",shortnames:["earth_africa"]},{unified:"1F30E",shortnames:["earth_americas"]},{unified:"1F30F",shortnames:["earth_asia"]},{unified:"1F310",shortnames:["globe_with_meridians"]},{unified:"1F5FA-FE0F",shortnames:["world_map"]},{unified:"1F5FE",shortnames:["japan"]},{unified:"1F3D4-FE0F",shortnames:["snow_capped_mountain"]},{unified:"26F0-FE0F",shortnames:["mountain"]},{unified:"1F30B",shortnames:["volcano"]},{unified:"1F5FB",shortnames:["mount_fuji"]},{unified:"1F3D5-FE0F",shortnames:["camping"]},{unified:"1F3D6-FE0F",shortnames:["beach_with_umbrella"]},{unified:"1F3DC-FE0F",shortnames:["desert"]},{unified:"1F3DD-FE0F",shortnames:["desert_island"]},{unified:"1F3DE-FE0F",shortnames:["national_park"]},{unified:"1F3DF-FE0F",shortnames:["stadium"]},{unified:"1F3DB-FE0F",shortnames:["classical_building"]},{unified:"1F3D7-FE0F",shortnames:["building_construction"]},{unified:"1F3D8-FE0F",shortnames:["house_buildings"]},{unified:"1F3D9-FE0F",shortnames:["cityscape"]},{unified:"1F3DA-FE0F",shortnames:["derelict_house_building"]},{unified:"1F3E0",shortnames:["house"]},{unified:"1F3E1",shortnames:["house_with_garden"]},{unified:"1F3E2",shortnames:["office"]},{unified:"1F3E3",shortnames:["post_office"]},{unified:"1F3E4",shortnames:["european_post_office"]},{unified:"1F3E5",shortnames:["hospital"]},{unified:"1F3E6",shortnames:["bank"]},{unified:"1F3E8",shortnames:["hotel"]},{unified:"1F3E9",shortnames:["love_hotel"]},{unified:"1F3EA",shortnames:["convenience_store"]},{unified:"1F3EB",shortnames:["school"]},{unified:"1F3EC",shortnames:["department_store"]},{unified:"1F3ED",shortnames:["factory"]},{unified:"1F3EF",shortnames:["japanese_castle"]},{unified:"1F3F0",shortnames:["european_castle"]},{unified:"1F492",shortnames:["wedding"]},{unified:"1F5FC",shortnames:["tokyo_tower"]},{unified:"1F5FD",shortnames:["statue_of_liberty"]},{unified:"26EA",shortnames:["church"]},{unified:"1F54C",shortnames:["mosque"]},{unified:"1F54D",shortnames:["synagogue"]},{unified:"26E9-FE0F",shortnames:["shinto_shrine"]},{unified:"1F54B",shortnames:["kaaba"]},{unified:"26F2",shortnames:["fountain"]},{unified:"26FA",shortnames:["tent"]},{unified:"1F301",shortnames:["foggy"]},{unified:"1F303",shortnames:["night_with_stars"]},{unified:"1F304",shortnames:["sunrise_over_mountains"]},{unified:"1F305",shortnames:["sunrise"]},{unified:"1F306",shortnames:["city_sunset"]},{unified:"1F307",shortnames:["city_sunrise"]},{unified:"1F309",shortnames:["bridge_at_night"]},{unified:"2668-FE0F",shortnames:["hotsprings"]},{unified:"1F30C",shortnames:["milky_way"]},{unified:"1F3A0",shortnames:["carousel_horse"]},{unified:"1F3A1",shortnames:["ferris_wheel"]},{unified:"1F3A2",shortnames:["roller_coaster"]},{unified:"1F488",shortnames:["barber"]},{unified:"1F3AA",shortnames:["circus_tent"]},{unified:"1F3AD",shortnames:["performing_arts"]},{unified:"1F5BC-FE0F",shortnames:["frame_with_picture"]},{unified:"1F3A8",shortnames:["art"]},{unified:"1F3B0",shortnames:["slot_machine"]},{unified:"1F682",shortnames:["steam_locomotive"]},{unified:"1F683",shortnames:["railway_car"]},{unified:"1F684",shortnames:["bullettrain_side"]},{unified:"1F685",shortnames:["bullettrain_front"]},{unified:"1F686",shortnames:["train2"]},{unified:"1F687",shortnames:["metro"]},{unified:"1F688",shortnames:["light_rail"]},{unified:"1F689",shortnames:["station"]},{unified:"1F68A",shortnames:["tram"]},{unified:"1F69D",shortnames:["monorail"]},{unified:"1F69E",shortnames:["mountain_railway"]},{unified:"1F68B",shortnames:["train"]},{unified:"1F68C",shortnames:["bus"]},{unified:"1F68D",shortnames:["oncoming_bus"]},{unified:"1F68E",shortnames:["trolleybus"]},{unified:"1F690",shortnames:["minibus"]},{unified:"1F691",shortnames:["ambulance"]},{unified:"1F692",shortnames:["fire_engine"]},{unified:"1F693",shortnames:["police_car"]},{unified:"1F694",shortnames:["oncoming_police_car"]},{unified:"1F695",shortnames:["taxi"]},{unified:"1F696",shortnames:["oncoming_taxi"]},{unified:"1F697",shortnames:["car"]},{unified:"1F698",shortnames:["oncoming_automobile"]},{unified:"1F699",shortnames:["blue_car"]},{unified:"1F69A",shortnames:["truck"]},{unified:"1F69B",shortnames:["articulated_lorry"]},{unified:"1F69C",shortnames:["tractor"]},{unified:"1F6B2",shortnames:["bike"]},{unified:"1F6F4",shortnames:["scooter"]},{unified:"1F6F5",shortnames:["motor_scooter"]},{unified:"1F68F",shortnames:["busstop"]},{unified:"1F6E3-FE0F",shortnames:["motorway"]},{unified:"1F6E4-FE0F",shortnames:["railway_track"]},{unified:"26FD",shortnames:["fuelpump"]},{unified:"1F6A8",shortnames:["rotating_light"]},{unified:"1F6A5",shortnames:["traffic_light"]},{unified:"1F6A6",shortnames:["vertical_traffic_light"]},{unified:"1F6A7",shortnames:["construction"]},{unified:"1F6D1",shortnames:["octagonal_sign"]},{unified:"2693",shortnames:["anchor"]},{unified:"26F5",shortnames:["boat"]},{unified:"1F6F6",shortnames:["canoe"]},{unified:"1F6A4",shortnames:["speedboat"]},{unified:"1F6F3-FE0F",shortnames:["passenger_ship"]},{unified:"26F4-FE0F",shortnames:["ferry"]},{unified:"1F6E5-FE0F",shortnames:["motor_boat"]},{unified:"1F6A2",shortnames:["ship"]},{unified:"2708-FE0F",shortnames:["airplane"]},{unified:"1F6E9-FE0F",shortnames:["small_airplane"]},{unified:"1F6EB",shortnames:["airplane_departure"]},{unified:"1F6EC",shortnames:["airplane_arriving"]},{unified:"1F4BA",shortnames:["seat"]},{unified:"1F681",shortnames:["helicopter"]},{unified:"1F69F",shortnames:["suspension_railway"]},{unified:"1F6A0",shortnames:["mountain_cableway"]},{unified:"1F6A1",shortnames:["aerial_tramway"]},{unified:"1F6F0-FE0F",shortnames:["satellite"]},{unified:"1F680",shortnames:["rocket"]},{unified:"1F6F8",shortnames:["flying_saucer"]},{unified:"1F6CE-FE0F",shortnames:["bellhop_bell"]},{unified:"1F6AA",shortnames:["door"]},{unified:"1F6CF-FE0F",shortnames:["bed"]},{unified:"1F6CB-FE0F",shortnames:["couch_and_lamp"]},{unified:"1F6BD",shortnames:["toilet"]},{unified:"1F6BF",shortnames:["shower"]},{unified:"1F6C1",shortnames:["bathtub"]},{unified:"231B",shortnames:["hourglass"]},{unified:"23F3",shortnames:["hourglass_flowing_sand"]},{unified:"231A",shortnames:["watch"]},{unified:"23F0",shortnames:["alarm_clock"]},{unified:"23F1-FE0F",shortnames:["stopwatch"]},{unified:"23F2-FE0F",shortnames:["timer_clock"]},{unified:"1F570-FE0F",shortnames:["mantelpiece_clock"]},{unified:"1F55B",shortnames:["clock12"]},{unified:"1F567",shortnames:["clock1230"]},{unified:"1F550",shortnames:["clock1"]},{unified:"1F55C",shortnames:["clock130"]},{unified:"1F551",shortnames:["clock2"]},{unified:"1F55D",shortnames:["clock230"]},{unified:"1F552",shortnames:["clock3"]},{unified:"1F55E",shortnames:["clock330"]},{unified:"1F553",shortnames:["clock4"]},{unified:"1F55F",shortnames:["clock430"]},{unified:"1F554",shortnames:["clock5"]},{unified:"1F560",shortnames:["clock530"]},{unified:"1F555",shortnames:["clock6"]},{unified:"1F561",shortnames:["clock630"]},{unified:"1F556",shortnames:["clock7"]},{unified:"1F562",shortnames:["clock730"]},{unified:"1F557",shortnames:["clock8"]},{unified:"1F563",shortnames:["clock830"]},{unified:"1F558",shortnames:["clock9"]},{unified:"1F564",shortnames:["clock930"]},{unified:"1F559",shortnames:["clock10"]},{unified:"1F565",shortnames:["clock1030"]},{unified:"1F55A",shortnames:["clock11"]},{unified:"1F566",shortnames:["clock1130"]},{unified:"1F311",shortnames:["new_moon"]},{unified:"1F312",shortnames:["waxing_crescent_moon"]},{unified:"1F313",shortnames:["first_quarter_moon"]},{unified:"1F314",shortnames:["moon"]},{unified:"1F315",shortnames:["full_moon"]},{unified:"1F316",shortnames:["waning_gibbous_moon"]},{unified:"1F317",shortnames:["last_quarter_moon"]},{unified:"1F318",shortnames:["waning_crescent_moon"]},{unified:"1F319",shortnames:["crescent_moon"]},{unified:"1F31A",shortnames:["new_moon_with_face"]},{unified:"1F31B",shortnames:["first_quarter_moon_with_face"]},{unified:"1F31C",shortnames:["last_quarter_moon_with_face"]},{unified:"1F321-FE0F",shortnames:["thermometer"]},{unified:"2600-FE0F",shortnames:["sunny"]},{unified:"1F31D",shortnames:["full_moon_with_face"]},{unified:"1F31E",shortnames:["sun_with_face"]},{unified:"2B50",shortnames:["star"]},{unified:"1F31F",shortnames:["star2"]},{unified:"1F320",shortnames:["stars"]},{unified:"2601-FE0F",shortnames:["cloud"]},{unified:"26C5",shortnames:["partly_sunny"]},{unified:"26C8-FE0F",shortnames:["thunder_cloud_and_rain"]},{unified:"1F324-FE0F",shortnames:["mostly_sunny"]},{unified:"1F325-FE0F",shortnames:["barely_sunny"]},{unified:"1F326-FE0F",shortnames:["partly_sunny_rain"]},{unified:"1F327-FE0F",shortnames:["rain_cloud"]},{unified:"1F328-FE0F",shortnames:["snow_cloud"]},{unified:"1F329-FE0F",shortnames:["lightning"]},{unified:"1F32A-FE0F",shortnames:["tornado"]},{unified:"1F32B-FE0F",shortnames:["fog"]},{unified:"1F32C-FE0F",shortnames:["wind_blowing_face"]},{unified:"1F300",shortnames:["cyclone"]},{unified:"1F308",shortnames:["rainbow"]},{unified:"1F302",shortnames:["closed_umbrella"]},{unified:"2602-FE0F",shortnames:["umbrella"]},{unified:"2614",shortnames:["umbrella_with_rain_drops"]},{unified:"26F1-FE0F",shortnames:["umbrella_on_ground"]},{unified:"26A1",shortnames:["zap"]},{unified:"2744-FE0F",shortnames:["snowflake"]},{unified:"2603-FE0F",shortnames:["snowman"]},{unified:"26C4",shortnames:["snowman_without_snow"]},{unified:"2604-FE0F",shortnames:["comet"]},{unified:"1F525",shortnames:["fire"]},{unified:"1F4A7",shortnames:["droplet"]},{unified:"1F30A",shortnames:["ocean"]}]},{name:"Activities",emojis:[{unified:"1F383",shortnames:["jack_o_lantern"]},{unified:"1F384",shortnames:["christmas_tree"]},{unified:"1F386",shortnames:["fireworks"]},{unified:"1F387",shortnames:["sparkler"]},{unified:"2728",shortnames:["sparkles"]},{unified:"1F388",shortnames:["balloon"]},{unified:"1F389",shortnames:["tada"]},{unified:"1F38A",shortnames:["confetti_ball"]},{unified:"1F38B",shortnames:["tanabata_tree"]},{unified:"1F38D",shortnames:["bamboo"]},{unified:"1F38E",shortnames:["dolls"]},{unified:"1F38F",shortnames:["flags"]},{unified:"1F390",shortnames:["wind_chime"]},{unified:"1F391",shortnames:["rice_scene"]},{unified:"1F380",shortnames:["ribbon"]},{unified:"1F381",shortnames:["gift"]},{unified:"1F397-FE0F",shortnames:["reminder_ribbon"]},{unified:"1F39F-FE0F",shortnames:["admission_tickets"]},{unified:"1F3AB",shortnames:["ticket"]},{unified:"1F396-FE0F",shortnames:["medal"]},{unified:"1F3C6",shortnames:["trophy"]},{unified:"1F3C5",shortnames:["sports_medal"]},{unified:"1F947",shortnames:["first_place_medal"]},{unified:"1F948",shortnames:["second_place_medal"]},{unified:"1F949",shortnames:["third_place_medal"]},{unified:"26BD",shortnames:["soccer"]},{unified:"26BE",shortnames:["baseball"]},{unified:"1F3C0",shortnames:["basketball"]},{unified:"1F3D0",shortnames:["volleyball"]},{unified:"1F3C8",shortnames:["football"]},{unified:"1F3C9",shortnames:["rugby_football"]},{unified:"1F3BE",shortnames:["tennis"]},{unified:"1F3B1",shortnames:["8ball"]},{unified:"1F3B3",shortnames:["bowling"]},{unified:"1F3CF",shortnames:["cricket_bat_and_ball"]},{unified:"1F3D1",shortnames:["field_hockey_stick_and_ball"]},{unified:"1F3D2",shortnames:["ice_hockey_stick_and_puck"]},{unified:"1F3D3",shortnames:["table_tennis_paddle_and_ball"]},{unified:"1F3F8",shortnames:["badminton_racquet_and_shuttlecock"]},{unified:"1F94A",shortnames:["boxing_glove"]},{unified:"1F94B",shortnames:["martial_arts_uniform"]},{unified:"1F945",shortnames:["goal_net"]},{unified:"1F3AF",shortnames:["dart"]},{unified:"26F3",shortnames:["golf"]},{unified:"26F8-FE0F",shortnames:["ice_skate"]},{unified:"1F3A3",shortnames:["fishing_pole_and_fish"]},{unified:"1F3BD",shortnames:["running_shirt_with_sash"]},{unified:"1F3BF",shortnames:["ski"]},{unified:"1F6F7",shortnames:["sled"]},{unified:"1F94C",shortnames:["curling_stone"]},{unified:"1F3AE",shortnames:["video_game"]},{unified:"1F579-FE0F",shortnames:["joystick"]},{unified:"1F3B2",shortnames:["game_die"]},{unified:"2660-FE0F",shortnames:["spades"]},{unified:"2665-FE0F",shortnames:["hearts"]},{unified:"2666-FE0F",shortnames:["diamonds"]},{unified:"2663-FE0F",shortnames:["clubs"]},{unified:"1F0CF",shortnames:["black_joker"]},{unified:"1F004",shortnames:["mahjong"]},{unified:"1F3B4",shortnames:["flower_playing_cards"]}]},{name:"Objects",emojis:[{unified:"1F507",shortnames:["mute"]},{unified:"1F508",shortnames:["speaker"]},{unified:"1F509",shortnames:["sound"]},{unified:"1F50A",shortnames:["loud_sound"]},{unified:"1F4E2",shortnames:["loudspeaker"]},{unified:"1F4E3",shortnames:["mega"]},{unified:"1F4EF",shortnames:["postal_horn"]},{unified:"1F514",shortnames:["bell"]},{unified:"1F515",shortnames:["no_bell"]},{unified:"1F3BC",shortnames:["musical_score"]},{unified:"1F3B5",shortnames:["musical_note"]},{unified:"1F3B6",shortnames:["notes"]},{unified:"1F399-FE0F",shortnames:["studio_microphone"]},{unified:"1F39A-FE0F",shortnames:["level_slider"]},{unified:"1F39B-FE0F",shortnames:["control_knobs"]},{unified:"1F3A4",shortnames:["microphone"]},{unified:"1F3A7",shortnames:["headphones"]},{unified:"1F4FB",shortnames:["radio"]},{unified:"1F3B7",shortnames:["saxophone"]},{unified:"1F3B8",shortnames:["guitar"]},{unified:"1F3B9",shortnames:["musical_keyboard"]},{unified:"1F3BA",shortnames:["trumpet"]},{unified:"1F3BB",shortnames:["violin"]},{unified:"1F941",shortnames:["drum_with_drumsticks"]},{unified:"1F4F1",shortnames:["iphone"]},{unified:"1F4F2",shortnames:["calling"]},{unified:"260E-FE0F",shortnames:["phone"]},{unified:"1F4DE",shortnames:["telephone_receiver"]},{unified:"1F4DF",shortnames:["pager"]},{unified:"1F4E0",shortnames:["fax"]},{unified:"1F50B",shortnames:["battery"]},{unified:"1F50C",shortnames:["electric_plug"]},{unified:"1F4BB",shortnames:["computer"]},{unified:"1F5A5-FE0F",shortnames:["desktop_computer"]},{unified:"1F5A8-FE0F",shortnames:["printer"]},{unified:"2328-FE0F",shortnames:["keyboard"]},{unified:"1F5B1-FE0F",shortnames:["three_button_mouse"]},{unified:"1F5B2-FE0F",shortnames:["trackball"]},{unified:"1F4BD",shortnames:["minidisc"]},{unified:"1F4BE",shortnames:["floppy_disk"]},{unified:"1F4BF",shortnames:["cd"]},{unified:"1F4C0",shortnames:["dvd"]},{unified:"1F3A5",shortnames:["movie_camera"]},{unified:"1F39E-FE0F",shortnames:["film_frames"]},{unified:"1F4FD-FE0F",shortnames:["film_projector"]},{unified:"1F3AC",shortnames:["clapper"]},{unified:"1F4FA",shortnames:["tv"]},{unified:"1F4F7",shortnames:["camera"]},{unified:"1F4F8",shortnames:["camera_with_flash"]},{unified:"1F4F9",shortnames:["video_camera"]},{unified:"1F4FC",shortnames:["vhs"]},{unified:"1F50D",shortnames:["mag"]},{unified:"1F50E",shortnames:["mag_right"]},{unified:"1F52C",shortnames:["microscope"]},{unified:"1F52D",shortnames:["telescope"]},{unified:"1F4E1",shortnames:["satellite_antenna"]},{unified:"1F56F-FE0F",shortnames:["candle"]},{unified:"1F4A1",shortnames:["bulb"]},{unified:"1F526",shortnames:["flashlight"]},{unified:"1F3EE",shortnames:["izakaya_lantern"]},{unified:"1F4D4",shortnames:["notebook_with_decorative_cover"]},{unified:"1F4D5",shortnames:["closed_book"]},{unified:"1F4D6",shortnames:["book"]},{unified:"1F4D7",shortnames:["green_book"]},{unified:"1F4D8",shortnames:["blue_book"]},{unified:"1F4D9",shortnames:["orange_book"]},{unified:"1F4DA",shortnames:["books"]},{unified:"1F4D3",shortnames:["notebook"]},{unified:"1F4D2",shortnames:["ledger"]},{unified:"1F4C3",shortnames:["page_with_curl"]},{unified:"1F4DC",shortnames:["scroll"]},{unified:"1F4C4",shortnames:["page_facing_up"]},{unified:"1F4F0",shortnames:["newspaper"]},{unified:"1F5DE-FE0F",shortnames:["rolled_up_newspaper"]},{unified:"1F4D1",shortnames:["bookmark_tabs"]},{unified:"1F516",shortnames:["bookmark"]},{unified:"1F3F7-FE0F",shortnames:["label"]},{unified:"1F4B0",shortnames:["moneybag"]},{unified:"1F4B4",shortnames:["yen"]},{unified:"1F4B5",shortnames:["dollar"]},{unified:"1F4B6",shortnames:["euro"]},{unified:"1F4B7",shortnames:["pound"]},{unified:"1F4B8",shortnames:["money_with_wings"]},{unified:"1F4B3",shortnames:["credit_card"]},{unified:"1F4B9",shortnames:["chart"]},{unified:"1F4B1",shortnames:["currency_exchange"]},{unified:"1F4B2",shortnames:["heavy_dollar_sign"]},{unified:"2709-FE0F",shortnames:["email"]},{unified:"1F4E7",shortnames:["e-mail"]},{unified:"1F4E8",shortnames:["incoming_envelope"]},{unified:"1F4E9",shortnames:["envelope_with_arrow"]},{unified:"1F4E4",shortnames:["outbox_tray"]},{unified:"1F4E5",shortnames:["inbox_tray"]},{unified:"1F4E6",shortnames:["package"]},{unified:"1F4EB",shortnames:["mailbox"]},{unified:"1F4EA",shortnames:["mailbox_closed"]},{unified:"1F4EC",shortnames:["mailbox_with_mail"]},{unified:"1F4ED",shortnames:["mailbox_with_no_mail"]},{unified:"1F4EE",shortnames:["postbox"]},{unified:"1F5F3-FE0F",shortnames:["ballot_box_with_ballot"]},{unified:"270F-FE0F",shortnames:["pencil2"]},{unified:"2712-FE0F",shortnames:["black_nib"]},{unified:"1F58B-FE0F",shortnames:["lower_left_fountain_pen"]},{unified:"1F58A-FE0F",shortnames:["lower_left_ballpoint_pen"]},{unified:"1F58C-FE0F",shortnames:["lower_left_paintbrush"]},{unified:"1F58D-FE0F",shortnames:["lower_left_crayon"]},{unified:"1F4DD",shortnames:["memo"]},{unified:"1F4BC",shortnames:["briefcase"]},{unified:"1F4C1",shortnames:["file_folder"]},{unified:"1F4C2",shortnames:["open_file_folder"]},{unified:"1F5C2-FE0F",shortnames:["card_index_dividers"]},{unified:"1F4C5",shortnames:["date"]},{unified:"1F4C6",shortnames:["calendar"]},{unified:"1F5D2-FE0F",shortnames:["spiral_note_pad"]},{unified:"1F5D3-FE0F",shortnames:["spiral_calendar_pad"]},{unified:"1F4C7",shortnames:["card_index"]},{unified:"1F4C8",shortnames:["chart_with_upwards_trend"]},{unified:"1F4C9",shortnames:["chart_with_downwards_trend"]},{unified:"1F4CA",shortnames:["bar_chart"]},{unified:"1F4CB",shortnames:["clipboard"]},{unified:"1F4CC",shortnames:["pushpin"]},{unified:"1F4CD",shortnames:["round_pushpin"]},{unified:"1F4CE",shortnames:["paperclip"]},{unified:"1F587-FE0F",shortnames:["linked_paperclips"]},{unified:"1F4CF",shortnames:["straight_ruler"]},{unified:"1F4D0",shortnames:["triangular_ruler"]},{unified:"2702-FE0F",shortnames:["scissors"]},{unified:"1F5C3-FE0F",shortnames:["card_file_box"]},{unified:"1F5C4-FE0F",shortnames:["file_cabinet"]},{unified:"1F5D1-FE0F",shortnames:["wastebasket"]},{unified:"1F512",shortnames:["lock"]},{unified:"1F513",shortnames:["unlock"]},{unified:"1F50F",shortnames:["lock_with_ink_pen"]},{unified:"1F510",shortnames:["closed_lock_with_key"]},{unified:"1F511",shortnames:["key"]},{unified:"1F5DD-FE0F",shortnames:["old_key"]},{unified:"1F528",shortnames:["hammer"]},{unified:"26CF-FE0F",shortnames:["pick"]},{unified:"2692-FE0F",shortnames:["hammer_and_pick"]},{unified:"1F6E0-FE0F",shortnames:["hammer_and_wrench"]},{unified:"1F5E1-FE0F",shortnames:["dagger_knife"]},{unified:"2694-FE0F",shortnames:["crossed_swords"]},{unified:"1F52B",shortnames:["gun"]},{unified:"1F3F9",shortnames:["bow_and_arrow"]},{unified:"1F6E1-FE0F",shortnames:["shield"]},{unified:"1F527",shortnames:["wrench"]},{unified:"1F529",shortnames:["nut_and_bolt"]},{unified:"2699-FE0F",shortnames:["gear"]},{unified:"1F5DC-FE0F",shortnames:["compression"]},{unified:"2697-FE0F",shortnames:["alembic"]},{unified:"2696-FE0F",shortnames:["scales"]},{unified:"1F517",shortnames:["link"]},{unified:"26D3-FE0F",shortnames:["chains"]},{unified:"1F489",shortnames:["syringe"]},{unified:"1F48A",shortnames:["pill"]},{unified:"1F6AC",shortnames:["smoking"]},{unified:"26B0-FE0F",shortnames:["coffin"]},{unified:"26B1-FE0F",shortnames:["funeral_urn"]},{unified:"1F5FF",shortnames:["moyai"]},{unified:"1F6E2-FE0F",shortnames:["oil_drum"]},{unified:"1F52E",shortnames:["crystal_ball"]},{unified:"1F6D2",shortnames:["shopping_trolley"]}]},{name:"Symbols",emojis:[{unified:"1F3E7",shortnames:["atm"]},{unified:"1F6AE",shortnames:["put_litter_in_its_place"]},{unified:"1F6B0",shortnames:["potable_water"]},{unified:"267F",shortnames:["wheelchair"]},{unified:"1F6B9",shortnames:["mens"]},{unified:"1F6BA",shortnames:["womens"]},{unified:"1F6BB",shortnames:["restroom"]},{unified:"1F6BC",shortnames:["baby_symbol"]},{unified:"1F6BE",shortnames:["wc"]},{unified:"1F6C2",shortnames:["passport_control"]},{unified:"1F6C3",shortnames:["customs"]},{unified:"1F6C4",shortnames:["baggage_claim"]},{unified:"1F6C5",shortnames:["left_luggage"]},{unified:"26A0-FE0F",shortnames:["warning"]},{unified:"1F6B8",shortnames:["children_crossing"]},{unified:"26D4",shortnames:["no_entry"]},{unified:"1F6AB",shortnames:["no_entry_sign"]},{unified:"1F6B3",shortnames:["no_bicycles"]},{unified:"1F6AD",shortnames:["no_smoking"]},{unified:"1F6AF",shortnames:["do_not_litter"]},{unified:"1F6B1",shortnames:["non-potable_water"]},{unified:"1F6B7",shortnames:["no_pedestrians"]},{unified:"1F4F5",shortnames:["no_mobile_phones"]},{unified:"1F51E",shortnames:["underage"]},{unified:"2622-FE0F",shortnames:["radioactive_sign"]},{unified:"2623-FE0F",shortnames:["biohazard_sign"]},{unified:"2B06-FE0F",shortnames:["arrow_up"]},{unified:"2197-FE0F",shortnames:["arrow_upper_right"]},{unified:"27A1-FE0F",shortnames:["arrow_right"]},{unified:"2198-FE0F",shortnames:["arrow_lower_right"]},{unified:"2B07-FE0F",shortnames:["arrow_down"]},{unified:"2199-FE0F",shortnames:["arrow_lower_left"]},{unified:"2B05-FE0F",shortnames:["arrow_left"]},{unified:"2196-FE0F",shortnames:["arrow_upper_left"]},{unified:"2195-FE0F",shortnames:["arrow_up_down"]},{unified:"2194-FE0F",shortnames:["left_right_arrow"]},{unified:"21A9-FE0F",shortnames:["leftwards_arrow_with_hook"]},{unified:"21AA-FE0F",shortnames:["arrow_right_hook"]},{unified:"2934-FE0F",shortnames:["arrow_heading_up"]},{unified:"2935-FE0F",shortnames:["arrow_heading_down"]},{unified:"1F503",shortnames:["arrows_clockwise"]},{unified:"1F504",shortnames:["arrows_counterclockwise"]},{unified:"1F519",shortnames:["back"]},{unified:"1F51A",shortnames:["end"]},{unified:"1F51B",shortnames:["on"]},{unified:"1F51C",shortnames:["soon"]},{unified:"1F51D",shortnames:["top"]},{unified:"1F6D0",shortnames:["place_of_worship"]},{unified:"269B-FE0F",shortnames:["atom_symbol"]},{unified:"1F549-FE0F",shortnames:["om_symbol"]},{unified:"2721-FE0F",shortnames:["star_of_david"]},{unified:"2638-FE0F",shortnames:["wheel_of_dharma"]},{unified:"262F-FE0F",shortnames:["yin_yang"]},{unified:"271D-FE0F",shortnames:["latin_cross"]},{unified:"2626-FE0F",shortnames:["orthodox_cross"]},{unified:"262A-FE0F",shortnames:["star_and_crescent"]},{unified:"262E-FE0F",shortnames:["peace_symbol"]},{unified:"1F54E",shortnames:["menorah_with_nine_branches"]},{unified:"1F52F",shortnames:["six_pointed_star"]},{unified:"2648",shortnames:["aries"]},{unified:"2649",shortnames:["taurus"]},{unified:"264A",shortnames:["gemini"]},{unified:"264B",shortnames:["cancer"]},{unified:"264C",shortnames:["leo"]},{unified:"264D",shortnames:["virgo"]},{unified:"264E",shortnames:["libra"]},{unified:"264F",shortnames:["scorpius"]},{unified:"2650",shortnames:["sagittarius"]},{unified:"2651",shortnames:["capricorn"]},{unified:"2652",shortnames:["aquarius"]},{unified:"2653",shortnames:["pisces"]},{unified:"26CE",shortnames:["ophiuchus"]},{unified:"1F500",shortnames:["twisted_rightwards_arrows"]},{unified:"1F501",shortnames:["repeat"]},{unified:"1F502",shortnames:["repeat_one"]},{unified:"25B6-FE0F",shortnames:["arrow_forward"]},{unified:"23E9",shortnames:["fast_forward"]},{unified:"23ED-FE0F",shortnames:["black_right_pointing_double_triangle_with_vertical_bar"]},{unified:"23EF-FE0F",shortnames:["black_right_pointing_triangle_with_double_vertical_bar"]},{unified:"25C0-FE0F",shortnames:["arrow_backward"]},{unified:"23EA",shortnames:["rewind"]},{unified:"23EE-FE0F",shortnames:["black_left_pointing_double_triangle_with_vertical_bar"]},{unified:"1F53C",shortnames:["arrow_up_small"]},{unified:"23EB",shortnames:["arrow_double_up"]},{unified:"1F53D",shortnames:["arrow_down_small"]},{unified:"23EC",shortnames:["arrow_double_down"]},{unified:"23F8-FE0F",shortnames:["double_vertical_bar"]},{unified:"23F9-FE0F",shortnames:["black_square_for_stop"]},{unified:"23FA-FE0F",shortnames:["black_circle_for_record"]},{unified:"23CF-FE0F",shortnames:["eject"]},{unified:"1F3A6",shortnames:["cinema"]},{unified:"1F505",shortnames:["low_brightness"]},{unified:"1F506",shortnames:["high_brightness"]},{unified:"1F4F6",shortnames:["signal_strength"]},{unified:"1F4F3",shortnames:["vibration_mode"]},{unified:"1F4F4",shortnames:["mobile_phone_off"]},{unified:"2640-FE0F",shortnames:["female_sign"]},{unified:"2642-FE0F",shortnames:["male_sign"]},{unified:"2695-FE0F",shortnames:["medical_symbol"]},{unified:"267B-FE0F",shortnames:["recycle"]},{unified:"269C-FE0F",shortnames:["fleur_de_lis"]},{unified:"1F531",shortnames:["trident"]},{unified:"1F4DB",shortnames:["name_badge"]},{unified:"1F530",shortnames:["beginner"]},{unified:"2B55",shortnames:["o"]},{unified:"2705",shortnames:["white_check_mark"]},{unified:"2611-FE0F",shortnames:["ballot_box_with_check"]},{unified:"2714-FE0F",shortnames:["heavy_check_mark"]},{unified:"2716-FE0F",shortnames:["heavy_multiplication_x"]},{unified:"274C",shortnames:["x"]},{unified:"274E",shortnames:["negative_squared_cross_mark"]},{unified:"2795",shortnames:["heavy_plus_sign"]},{unified:"2796",shortnames:["heavy_minus_sign"]},{unified:"2797",shortnames:["heavy_division_sign"]},{unified:"27B0",shortnames:["curly_loop"]},{unified:"27BF",shortnames:["loop"]},{unified:"303D-FE0F",shortnames:["part_alternation_mark"]},{unified:"2733-FE0F",shortnames:["eight_spoked_asterisk"]},{unified:"2734-FE0F",shortnames:["eight_pointed_black_star"]},{unified:"2747-FE0F",shortnames:["sparkle"]},{unified:"203C-FE0F",shortnames:["bangbang"]},{unified:"2049-FE0F",shortnames:["interrobang"]},{unified:"2753",shortnames:["question"]},{unified:"2754",shortnames:["grey_question"]},{unified:"2755",shortnames:["grey_exclamation"]},{unified:"2757",shortnames:["exclamation"]},{unified:"3030-FE0F",shortnames:["wavy_dash"]},{unified:"00A9-FE0F",shortnames:["copyright"]},{unified:"00AE-FE0F",shortnames:["registered"]},{unified:"2122-FE0F",shortnames:["tm"]},{unified:"0023-FE0F-20E3",shortnames:["hash"]},{unified:"002A-FE0F-20E3",shortnames:["keycap_star"]},{unified:"0030-FE0F-20E3",shortnames:["zero"]},{unified:"0031-FE0F-20E3",shortnames:["one"]},{unified:"0032-FE0F-20E3",shortnames:["two"]},{unified:"0033-FE0F-20E3",shortnames:["three"]},{unified:"0034-FE0F-20E3",shortnames:["four"]},{unified:"0035-FE0F-20E3",shortnames:["five"]},{unified:"0036-FE0F-20E3",shortnames:["six"]},{unified:"0037-FE0F-20E3",shortnames:["seven"]},{unified:"0038-FE0F-20E3",shortnames:["eight"]},{unified:"0039-FE0F-20E3",shortnames:["nine"]},{unified:"1F51F",shortnames:["keycap_ten"]},{unified:"1F4AF",shortnames:["100"]},{unified:"1F520",shortnames:["capital_abcd"]},{unified:"1F521",shortnames:["abcd"]},{unified:"1F522",shortnames:["1234"]},{unified:"1F523",shortnames:["symbols"]},{unified:"1F524",shortnames:["abc"]},{unified:"1F170-FE0F",shortnames:["a"]},{unified:"1F18E",shortnames:["ab"]},{unified:"1F171-FE0F",shortnames:["b"]},{unified:"1F191",shortnames:["cl"]},{unified:"1F192",shortnames:["cool"]},{unified:"1F193",shortnames:["free"]},{unified:"2139-FE0F",shortnames:["information_source"]},{unified:"1F194",shortnames:["id"]},{unified:"24C2-FE0F",shortnames:["m"]},{unified:"1F195",shortnames:["new"]},{unified:"1F196",shortnames:["ng"]},{unified:"1F17E-FE0F",shortnames:["o2"]},{unified:"1F197",shortnames:["ok"]},{unified:"1F17F-FE0F",shortnames:["parking"]},{unified:"1F198",shortnames:["sos"]},{unified:"1F199",shortnames:["up"]},{unified:"1F19A",shortnames:["vs"]},{unified:"1F201",shortnames:["koko"]},{unified:"1F202-FE0F",shortnames:["sa"]},{unified:"1F237-FE0F",shortnames:["u6708"]},{unified:"1F236",shortnames:["u6709"]},{unified:"1F22F",shortnames:["u6307"]},{unified:"1F250",shortnames:["ideograph_advantage"]},{unified:"1F239",shortnames:["u5272"]},{unified:"1F21A",shortnames:["u7121"]},{unified:"1F232",shortnames:["u7981"]},{unified:"1F251",shortnames:["accept"]},{unified:"1F238",shortnames:["u7533"]},{unified:"1F234",shortnames:["u5408"]},{unified:"1F233",shortnames:["u7a7a"]},{unified:"3297-FE0F",shortnames:["congratulations"]},{unified:"3299-FE0F",shortnames:["secret"]},{unified:"1F23A",shortnames:["u55b6"]},{unified:"1F235",shortnames:["u6e80"]},{unified:"25AA-FE0F",shortnames:["black_small_square"]},{unified:"25AB-FE0F",shortnames:["white_small_square"]},{unified:"25FB-FE0F",shortnames:["white_medium_square"]},{unified:"25FC-FE0F",shortnames:["black_medium_square"]},{unified:"25FD",shortnames:["white_medium_small_square"]},{unified:"25FE",shortnames:["black_medium_small_square"]},{unified:"2B1B",shortnames:["black_large_square"]},{unified:"2B1C",shortnames:["white_large_square"]},{unified:"1F536",shortnames:["large_orange_diamond"]},{unified:"1F537",shortnames:["large_blue_diamond"]},{unified:"1F538",shortnames:["small_orange_diamond"]},{unified:"1F539",shortnames:["small_blue_diamond"]},{unified:"1F53A",shortnames:["small_red_triangle"]},{unified:"1F53B",shortnames:["small_red_triangle_down"]},{unified:"1F4A0",shortnames:["diamond_shape_with_a_dot_inside"]},{unified:"1F518",shortnames:["radio_button"]},{unified:"1F532",shortnames:["black_square_button"]},{unified:"1F533",shortnames:["white_square_button"]},{unified:"26AA",shortnames:["white_circle"]},{unified:"26AB",shortnames:["black_circle"]},{unified:"1F534",shortnames:["red_circle"]},{unified:"1F535",shortnames:["large_blue_circle"]}]},{name:"Flags",emojis:[{unified:"1F3C1",shortnames:["checkered_flag"]},{unified:"1F6A9",shortnames:["triangular_flag_on_post"]},{unified:"1F38C",shortnames:["crossed_flags"]},{unified:"1F3F4",shortnames:["waving_black_flag"]},{unified:"1F3F3-FE0F",shortnames:["waving_white_flag"]},{unified:"1F3F3-FE0F-200D-1F308",shortnames:["rainbow-flag"]},{unified:"1F1E6-1F1E8",shortnames:["flag-ac"]},{unified:"1F1E6-1F1E9",shortnames:["flag-ad"]},{unified:"1F1E6-1F1EA",shortnames:["flag-ae"]},{unified:"1F1E6-1F1EB",shortnames:["flag-af"]},{unified:"1F1E6-1F1EC",shortnames:["flag-ag"]},{unified:"1F1E6-1F1EE",shortnames:["flag-ai"]},{unified:"1F1E6-1F1F1",shortnames:["flag-al"]},{unified:"1F1E6-1F1F2",shortnames:["flag-am"]},{unified:"1F1E6-1F1F4",shortnames:["flag-ao"]},{unified:"1F1E6-1F1F6",shortnames:["flag-aq"]},{unified:"1F1E6-1F1F7",shortnames:["flag-ar"]},{unified:"1F1E6-1F1F8",shortnames:["flag-as"]},{unified:"1F1E6-1F1F9",shortnames:["flag-at"]},{unified:"1F1E6-1F1FA",shortnames:["flag-au"]},{unified:"1F1E6-1F1FC",shortnames:["flag-aw"]},{unified:"1F1E6-1F1FD",shortnames:["flag-ax"]},{unified:"1F1E6-1F1FF",shortnames:["flag-az"]},{unified:"1F1E7-1F1E6",shortnames:["flag-ba"]},{unified:"1F1E7-1F1E7",shortnames:["flag-bb"]},{unified:"1F1E7-1F1E9",shortnames:["flag-bd"]},{unified:"1F1E7-1F1EA",shortnames:["flag-be"]},{unified:"1F1E7-1F1EB",shortnames:["flag-bf"]},{unified:"1F1E7-1F1EC",shortnames:["flag-bg"]},{unified:"1F1E7-1F1ED",shortnames:["flag-bh"]},{unified:"1F1E7-1F1EE",shortnames:["flag-bi"]},{unified:"1F1E7-1F1EF",shortnames:["flag-bj"]},{unified:"1F1E7-1F1F1",shortnames:["flag-bl"]},{unified:"1F1E7-1F1F2",shortnames:["flag-bm"]},{unified:"1F1E7-1F1F3",shortnames:["flag-bn"]},{unified:"1F1E7-1F1F4",shortnames:["flag-bo"]},{unified:"1F1E7-1F1F6",shortnames:["flag-bq"]},{unified:"1F1E7-1F1F7",shortnames:["flag-br"]},{unified:"1F1E7-1F1F8",shortnames:["flag-bs"]},{unified:"1F1E7-1F1F9",shortnames:["flag-bt"]},{unified:"1F1E7-1F1FB",shortnames:["flag-bv"]},{unified:"1F1E7-1F1FC",shortnames:["flag-bw"]},{unified:"1F1E7-1F1FE",shortnames:["flag-by"]},{unified:"1F1E7-1F1FF",shortnames:["flag-bz"]},{unified:"1F1E8-1F1E6",shortnames:["flag-ca"]},{unified:"1F1E8-1F1E8",shortnames:["flag-cc"]},{unified:"1F1E8-1F1E9",shortnames:["flag-cd"]},{unified:"1F1E8-1F1EB",shortnames:["flag-cf"]},{unified:"1F1E8-1F1EC",shortnames:["flag-cg"]},{unified:"1F1E8-1F1ED",shortnames:["flag-ch"]},{unified:"1F1E8-1F1EE",shortnames:["flag-ci"]},{unified:"1F1E8-1F1F0",shortnames:["flag-ck"]},{unified:"1F1E8-1F1F1",shortnames:["flag-cl"]},{unified:"1F1E8-1F1F2",shortnames:["flag-cm"]},{unified:"1F1E8-1F1F3",shortnames:["cn"]},{unified:"1F1E8-1F1F4",shortnames:["flag-co"]},{unified:"1F1E8-1F1F5",shortnames:["flag-cp"]},{unified:"1F1E8-1F1F7",shortnames:["flag-cr"]},{unified:"1F1E8-1F1FA",shortnames:["flag-cu"]},{unified:"1F1E8-1F1FB",shortnames:["flag-cv"]},{unified:"1F1E8-1F1FC",shortnames:["flag-cw"]},{unified:"1F1E8-1F1FD",shortnames:["flag-cx"]},{unified:"1F1E8-1F1FE",shortnames:["flag-cy"]},{unified:"1F1E8-1F1FF",shortnames:["flag-cz"]},{unified:"1F1E9-1F1EA",shortnames:["de"]},{unified:"1F1E9-1F1EC",shortnames:["flag-dg"]},{unified:"1F1E9-1F1EF",shortnames:["flag-dj"]},{unified:"1F1E9-1F1F0",shortnames:["flag-dk"]},{unified:"1F1E9-1F1F2",shortnames:["flag-dm"]},{unified:"1F1E9-1F1F4",shortnames:["flag-do"]},{unified:"1F1E9-1F1FF",shortnames:["flag-dz"]},{unified:"1F1EA-1F1E6",shortnames:["flag-ea"]},{unified:"1F1EA-1F1E8",shortnames:["flag-ec"]},{unified:"1F1EA-1F1EA",shortnames:["flag-ee"]},{unified:"1F1EA-1F1EC",shortnames:["flag-eg"]},{unified:"1F1EA-1F1ED",shortnames:["flag-eh"]},{unified:"1F1EA-1F1F7",shortnames:["flag-er"]},{unified:"1F1EA-1F1F8",shortnames:["es"]},{unified:"1F1EA-1F1F9",shortnames:["flag-et"]},{unified:"1F1EA-1F1FA",shortnames:["flag-eu"]},{unified:"1F1EB-1F1EE",shortnames:["flag-fi"]},{unified:"1F1EB-1F1EF",shortnames:["flag-fj"]},{unified:"1F1EB-1F1F0",shortnames:["flag-fk"]},{unified:"1F1EB-1F1F2",shortnames:["flag-fm"]},{unified:"1F1EB-1F1F4",shortnames:["flag-fo"]},{unified:"1F1EB-1F1F7",shortnames:["fr"]},{unified:"1F1EC-1F1E6",shortnames:["flag-ga"]},{unified:"1F1EC-1F1E7",shortnames:["gb"]},{unified:"1F1EC-1F1E9",shortnames:["flag-gd"]},{unified:"1F1EC-1F1EA",shortnames:["flag-ge"]},{unified:"1F1EC-1F1EB",shortnames:["flag-gf"]},{unified:"1F1EC-1F1EC",shortnames:["flag-gg"]},{unified:"1F1EC-1F1ED",shortnames:["flag-gh"]},{unified:"1F1EC-1F1EE",shortnames:["flag-gi"]},{unified:"1F1EC-1F1F1",shortnames:["flag-gl"]},{unified:"1F1EC-1F1F2",shortnames:["flag-gm"]},{unified:"1F1EC-1F1F3",shortnames:["flag-gn"]},{unified:"1F1EC-1F1F5",shortnames:["flag-gp"]},{unified:"1F1EC-1F1F6",shortnames:["flag-gq"]},{unified:"1F1EC-1F1F7",shortnames:["flag-gr"]},{unified:"1F1EC-1F1F8",shortnames:["flag-gs"]},{unified:"1F1EC-1F1F9",shortnames:["flag-gt"]},{unified:"1F1EC-1F1FA",shortnames:["flag-gu"]},{unified:"1F1EC-1F1FC",shortnames:["flag-gw"]},{unified:"1F1EC-1F1FE",shortnames:["flag-gy"]},{unified:"1F1ED-1F1F0",shortnames:["flag-hk"]},{unified:"1F1ED-1F1F2",shortnames:["flag-hm"]},{unified:"1F1ED-1F1F3",shortnames:["flag-hn"]},{unified:"1F1ED-1F1F7",shortnames:["flag-hr"]},{unified:"1F1ED-1F1F9",shortnames:["flag-ht"]},{unified:"1F1ED-1F1FA",shortnames:["flag-hu"]},{unified:"1F1EE-1F1E8",shortnames:["flag-ic"]},{unified:"1F1EE-1F1E9",shortnames:["flag-id"]},{unified:"1F1EE-1F1EA",shortnames:["flag-ie"]},{unified:"1F1EE-1F1F1",shortnames:["flag-il"]},{unified:"1F1EE-1F1F2",shortnames:["flag-im"]},{unified:"1F1EE-1F1F3",shortnames:["flag-in"]},{unified:"1F1EE-1F1F4",shortnames:["flag-io"]},{unified:"1F1EE-1F1F6",shortnames:["flag-iq"]},{unified:"1F1EE-1F1F7",shortnames:["flag-ir"]},{unified:"1F1EE-1F1F8",shortnames:["flag-is"]},{unified:"1F1EE-1F1F9",shortnames:["it"]},{unified:"1F1EF-1F1EA",shortnames:["flag-je"]},{unified:"1F1EF-1F1F2",shortnames:["flag-jm"]},{unified:"1F1EF-1F1F4",shortnames:["flag-jo"]},{unified:"1F1EF-1F1F5",shortnames:["jp"]},{unified:"1F1F0-1F1EA",shortnames:["flag-ke"]},{unified:"1F1F0-1F1EC",shortnames:["flag-kg"]},{unified:"1F1F0-1F1ED",shortnames:["flag-kh"]},{unified:"1F1F0-1F1EE",shortnames:["flag-ki"]},{unified:"1F1F0-1F1F2",shortnames:["flag-km"]},{unified:"1F1F0-1F1F3",shortnames:["flag-kn"]},{unified:"1F1F0-1F1F5",shortnames:["flag-kp"]},{unified:"1F1F0-1F1F7",shortnames:["kr"]},{unified:"1F1F0-1F1FC",shortnames:["flag-kw"]},{unified:"1F1F0-1F1FE",shortnames:["flag-ky"]},{unified:"1F1F0-1F1FF",shortnames:["flag-kz"]},{unified:"1F1F1-1F1E6",shortnames:["flag-la"]},{unified:"1F1F1-1F1E7",shortnames:["flag-lb"]},{unified:"1F1F1-1F1E8",shortnames:["flag-lc"]},{unified:"1F1F1-1F1EE",shortnames:["flag-li"]},{unified:"1F1F1-1F1F0",shortnames:["flag-lk"]},{unified:"1F1F1-1F1F7",shortnames:["flag-lr"]},{unified:"1F1F1-1F1F8",shortnames:["flag-ls"]},{unified:"1F1F1-1F1F9",shortnames:["flag-lt"]},{unified:"1F1F1-1F1FA",shortnames:["flag-lu"]},{unified:"1F1F1-1F1FB",shortnames:["flag-lv"]},{unified:"1F1F1-1F1FE",shortnames:["flag-ly"]},{unified:"1F1F2-1F1E6",shortnames:["flag-ma"]},{unified:"1F1F2-1F1E8",shortnames:["flag-mc"]},{unified:"1F1F2-1F1E9",shortnames:["flag-md"]},{unified:"1F1F2-1F1EA",shortnames:["flag-me"]},{unified:"1F1F2-1F1EB",shortnames:["flag-mf"]},{unified:"1F1F2-1F1EC",shortnames:["flag-mg"]},{unified:"1F1F2-1F1ED",shortnames:["flag-mh"]},{unified:"1F1F2-1F1F0",shortnames:["flag-mk"]},{unified:"1F1F2-1F1F1",shortnames:["flag-ml"]},{unified:"1F1F2-1F1F2",shortnames:["flag-mm"]},{unified:"1F1F2-1F1F3",shortnames:["flag-mn"]},{unified:"1F1F2-1F1F4",shortnames:["flag-mo"]},{unified:"1F1F2-1F1F5",shortnames:["flag-mp"]},{unified:"1F1F2-1F1F6",shortnames:["flag-mq"]},{unified:"1F1F2-1F1F7",shortnames:["flag-mr"]},{unified:"1F1F2-1F1F8",shortnames:["flag-ms"]},{unified:"1F1F2-1F1F9",shortnames:["flag-mt"]},{unified:"1F1F2-1F1FA",shortnames:["flag-mu"]},{unified:"1F1F2-1F1FB",shortnames:["flag-mv"]},{unified:"1F1F2-1F1FC",shortnames:["flag-mw"]},{unified:"1F1F2-1F1FD",shortnames:["flag-mx"]},{unified:"1F1F2-1F1FE",shortnames:["flag-my"]},{unified:"1F1F2-1F1FF",shortnames:["flag-mz"]},{unified:"1F1F3-1F1E6",shortnames:["flag-na"]},{unified:"1F1F3-1F1E8",shortnames:["flag-nc"]},{unified:"1F1F3-1F1EA",shortnames:["flag-ne"]},{unified:"1F1F3-1F1EB",shortnames:["flag-nf"]},{unified:"1F1F3-1F1EC",shortnames:["flag-ng"]},{unified:"1F1F3-1F1EE",shortnames:["flag-ni"]},{unified:"1F1F3-1F1F1",shortnames:["flag-nl"]},{unified:"1F1F3-1F1F4",shortnames:["flag-no"]},{unified:"1F1F3-1F1F5",shortnames:["flag-np"]},{unified:"1F1F3-1F1F7",shortnames:["flag-nr"]},{unified:"1F1F3-1F1FA",shortnames:["flag-nu"]},{unified:"1F1F3-1F1FF",shortnames:["flag-nz"]},{unified:"1F1F4-1F1F2",shortnames:["flag-om"]},{unified:"1F1F5-1F1E6",shortnames:["flag-pa"]},{unified:"1F1F5-1F1EA",shortnames:["flag-pe"]},{unified:"1F1F5-1F1EB",shortnames:["flag-pf"]},{unified:"1F1F5-1F1EC",shortnames:["flag-pg"]},{unified:"1F1F5-1F1ED",shortnames:["flag-ph"]},{unified:"1F1F5-1F1F0",shortnames:["flag-pk"]},{unified:"1F1F5-1F1F1",shortnames:["flag-pl"]},{unified:"1F1F5-1F1F2",shortnames:["flag-pm"]},{unified:"1F1F5-1F1F3",shortnames:["flag-pn"]},{unified:"1F1F5-1F1F7",shortnames:["flag-pr"]},{unified:"1F1F5-1F1F8",shortnames:["flag-ps"]},{unified:"1F1F5-1F1F9",shortnames:["flag-pt"]},{unified:"1F1F5-1F1FC",shortnames:["flag-pw"]},{unified:"1F1F5-1F1FE",shortnames:["flag-py"]},{unified:"1F1F6-1F1E6",shortnames:["flag-qa"]},{unified:"1F1F7-1F1EA",shortnames:["flag-re"]},{unified:"1F1F7-1F1F4",shortnames:["flag-ro"]},{unified:"1F1F7-1F1F8",shortnames:["flag-rs"]},{unified:"1F1F7-1F1FA",shortnames:["ru"]},{unified:"1F1F7-1F1FC",shortnames:["flag-rw"]},{unified:"1F1F8-1F1E6",shortnames:["flag-sa"]},{unified:"1F1F8-1F1E7",shortnames:["flag-sb"]},{unified:"1F1F8-1F1E8",shortnames:["flag-sc"]},{unified:"1F1F8-1F1E9",shortnames:["flag-sd"]},{unified:"1F1F8-1F1EA",shortnames:["flag-se"]},{unified:"1F1F8-1F1EC",shortnames:["flag-sg"]},{unified:"1F1F8-1F1ED",shortnames:["flag-sh"]},{unified:"1F1F8-1F1EE",shortnames:["flag-si"]},{unified:"1F1F8-1F1EF",shortnames:["flag-sj"]},{unified:"1F1F8-1F1F0",shortnames:["flag-sk"]},{unified:"1F1F8-1F1F1",shortnames:["flag-sl"]},{unified:"1F1F8-1F1F2",shortnames:["flag-sm"]},{unified:"1F1F8-1F1F3",shortnames:["flag-sn"]},{unified:"1F1F8-1F1F4",shortnames:["flag-so"]},{unified:"1F1F8-1F1F7",shortnames:["flag-sr"]},{unified:"1F1F8-1F1F8",shortnames:["flag-ss"]},{unified:"1F1F8-1F1F9",shortnames:["flag-st"]},{unified:"1F1F8-1F1FB",shortnames:["flag-sv"]},{unified:"1F1F8-1F1FD",shortnames:["flag-sx"]},{unified:"1F1F8-1F1FE",shortnames:["flag-sy"]},{unified:"1F1F8-1F1FF",shortnames:["flag-sz"]},{unified:"1F1F9-1F1E6",shortnames:["flag-ta"]},{unified:"1F1F9-1F1E8",shortnames:["flag-tc"]},{unified:"1F1F9-1F1E9",shortnames:["flag-td"]},{unified:"1F1F9-1F1EB",shortnames:["flag-tf"]},{unified:"1F1F9-1F1EC",shortnames:["flag-tg"]},{unified:"1F1F9-1F1ED",shortnames:["flag-th"]},{unified:"1F1F9-1F1EF",shortnames:["flag-tj"]},{unified:"1F1F9-1F1F0",shortnames:["flag-tk"]},{unified:"1F1F9-1F1F1",shortnames:["flag-tl"]},{unified:"1F1F9-1F1F2",shortnames:["flag-tm"]},{unified:"1F1F9-1F1F3",shortnames:["flag-tn"]},{unified:"1F1F9-1F1F4",shortnames:["flag-to"]},{unified:"1F1F9-1F1F7",shortnames:["flag-tr"]},{unified:"1F1F9-1F1F9",shortnames:["flag-tt"]},{unified:"1F1F9-1F1FB",shortnames:["flag-tv"]},{unified:"1F1F9-1F1FC",shortnames:["flag-tw"]},{unified:"1F1F9-1F1FF",shortnames:["flag-tz"]},{unified:"1F1FA-1F1E6",shortnames:["flag-ua"]},{unified:"1F1FA-1F1EC",shortnames:["flag-ug"]},{unified:"1F1FA-1F1F2",shortnames:["flag-um"]},{unified:"1F1FA-1F1F3",shortnames:["flag-un"]},{unified:"1F1FA-1F1F8",shortnames:["us"]},{unified:"1F1FA-1F1FE",shortnames:["flag-uy"]},{unified:"1F1FA-1F1FF",shortnames:["flag-uz"]},{unified:"1F1FB-1F1E6",shortnames:["flag-va"]},{unified:"1F1FB-1F1E8",shortnames:["flag-vc"]},{unified:"1F1FB-1F1EA",shortnames:["flag-ve"]},{unified:"1F1FB-1F1EC",shortnames:["flag-vg"]},{unified:"1F1FB-1F1EE",shortnames:["flag-vi"]},{unified:"1F1FB-1F1F3",shortnames:["flag-vn"]},{unified:"1F1FB-1F1FA",shortnames:["flag-vu"]},{unified:"1F1FC-1F1EB",shortnames:["flag-wf"]},{unified:"1F1FC-1F1F8",shortnames:["flag-ws"]},{unified:"1F1FD-1F1F0",shortnames:["flag-xk"]},{unified:"1F1FE-1F1EA",shortnames:["flag-ye"]},{unified:"1F1FE-1F1F9",shortnames:["flag-yt"]},{unified:"1F1FF-1F1E6",shortnames:["flag-za"]},{unified:"1F1FF-1F1F2",shortnames:["flag-zm"]},{unified:"1F1FF-1F1FC",shortnames:["flag-zw"]},{unified:"1F3F4-E0067-E0062-E0065-E006E-E0067-E007F",shortnames:["flag-england"]},{unified:"1F3F4-E0067-E0062-E0073-E0063-E0074-E007F",shortnames:["flag-scotland"]},{unified:"1F3F4-E0067-E0062-E0077-E006C-E0073-E007F",shortnames:["flag-wales"]}]}];F.byShortName={hash:"0023-FE0F-20E3",keycap_star:"002A-FE0F-20E3",zero:"0030-FE0F-20E3",one:"0031-FE0F-20E3",two:"0032-FE0F-20E3",three:"0033-FE0F-20E3",four:"0034-FE0F-20E3",five:"0035-FE0F-20E3",six:"0036-FE0F-20E3",seven:"0037-FE0F-20E3",eight:"0038-FE0F-20E3",nine:"0039-FE0F-20E3",copyright:"00A9-FE0F",registered:"00AE-FE0F",mahjong:"1F004",black_joker:"1F0CF",a:"1F170-FE0F",b:"1F171-FE0F",o2:"1F17E-FE0F",parking:"1F17F-FE0F",ab:"1F18E",cl:"1F191",cool:"1F192",free:"1F193",id:"1F194",new:"1F195",ng:"1F196",ok:"1F197",sos:"1F198",up:"1F199",vs:"1F19A","flag-ac":"1F1E6-1F1E8","flag-ad":"1F1E6-1F1E9","flag-ae":"1F1E6-1F1EA","flag-af":"1F1E6-1F1EB","flag-ag":"1F1E6-1F1EC","flag-ai":"1F1E6-1F1EE","flag-al":"1F1E6-1F1F1","flag-am":"1F1E6-1F1F2","flag-ao":"1F1E6-1F1F4","flag-aq":"1F1E6-1F1F6","flag-ar":"1F1E6-1F1F7","flag-as":"1F1E6-1F1F8","flag-at":"1F1E6-1F1F9","flag-au":"1F1E6-1F1FA","flag-aw":"1F1E6-1F1FC","flag-ax":"1F1E6-1F1FD","flag-az":"1F1E6-1F1FF","flag-ba":"1F1E7-1F1E6","flag-bb":"1F1E7-1F1E7","flag-bd":"1F1E7-1F1E9","flag-be":"1F1E7-1F1EA","flag-bf":"1F1E7-1F1EB","flag-bg":"1F1E7-1F1EC","flag-bh":"1F1E7-1F1ED","flag-bi":"1F1E7-1F1EE","flag-bj":"1F1E7-1F1EF","flag-bl":"1F1E7-1F1F1","flag-bm":"1F1E7-1F1F2","flag-bn":"1F1E7-1F1F3","flag-bo":"1F1E7-1F1F4","flag-bq":"1F1E7-1F1F6","flag-br":"1F1E7-1F1F7","flag-bs":"1F1E7-1F1F8","flag-bt":"1F1E7-1F1F9","flag-bv":"1F1E7-1F1FB","flag-bw":"1F1E7-1F1FC","flag-by":"1F1E7-1F1FE","flag-bz":"1F1E7-1F1FF","flag-ca":"1F1E8-1F1E6","flag-cc":"1F1E8-1F1E8","flag-cd":"1F1E8-1F1E9","flag-cf":"1F1E8-1F1EB","flag-cg":"1F1E8-1F1EC","flag-ch":"1F1E8-1F1ED","flag-ci":"1F1E8-1F1EE","flag-ck":"1F1E8-1F1F0","flag-cl":"1F1E8-1F1F1","flag-cm":"1F1E8-1F1F2",cn:"1F1E8-1F1F3","flag-co":"1F1E8-1F1F4","flag-cp":"1F1E8-1F1F5","flag-cr":"1F1E8-1F1F7","flag-cu":"1F1E8-1F1FA","flag-cv":"1F1E8-1F1FB","flag-cw":"1F1E8-1F1FC","flag-cx":"1F1E8-1F1FD","flag-cy":"1F1E8-1F1FE","flag-cz":"1F1E8-1F1FF",de:"1F1E9-1F1EA","flag-dg":"1F1E9-1F1EC","flag-dj":"1F1E9-1F1EF","flag-dk":"1F1E9-1F1F0","flag-dm":"1F1E9-1F1F2","flag-do":"1F1E9-1F1F4","flag-dz":"1F1E9-1F1FF","flag-ea":"1F1EA-1F1E6","flag-ec":"1F1EA-1F1E8","flag-ee":"1F1EA-1F1EA","flag-eg":"1F1EA-1F1EC","flag-eh":"1F1EA-1F1ED","flag-er":"1F1EA-1F1F7",es:"1F1EA-1F1F8","flag-et":"1F1EA-1F1F9","flag-eu":"1F1EA-1F1FA","flag-fi":"1F1EB-1F1EE","flag-fj":"1F1EB-1F1EF","flag-fk":"1F1EB-1F1F0","flag-fm":"1F1EB-1F1F2","flag-fo":"1F1EB-1F1F4",fr:"1F1EB-1F1F7","flag-ga":"1F1EC-1F1E6",gb:"1F1EC-1F1E7","flag-gd":"1F1EC-1F1E9","flag-ge":"1F1EC-1F1EA","flag-gf":"1F1EC-1F1EB","flag-gg":"1F1EC-1F1EC","flag-gh":"1F1EC-1F1ED","flag-gi":"1F1EC-1F1EE","flag-gl":"1F1EC-1F1F1","flag-gm":"1F1EC-1F1F2","flag-gn":"1F1EC-1F1F3","flag-gp":"1F1EC-1F1F5","flag-gq":"1F1EC-1F1F6","flag-gr":"1F1EC-1F1F7","flag-gs":"1F1EC-1F1F8","flag-gt":"1F1EC-1F1F9","flag-gu":"1F1EC-1F1FA","flag-gw":"1F1EC-1F1FC","flag-gy":"1F1EC-1F1FE","flag-hk":"1F1ED-1F1F0","flag-hm":"1F1ED-1F1F2","flag-hn":"1F1ED-1F1F3","flag-hr":"1F1ED-1F1F7","flag-ht":"1F1ED-1F1F9","flag-hu":"1F1ED-1F1FA","flag-ic":"1F1EE-1F1E8","flag-id":"1F1EE-1F1E9","flag-ie":"1F1EE-1F1EA","flag-il":"1F1EE-1F1F1","flag-im":"1F1EE-1F1F2","flag-in":"1F1EE-1F1F3","flag-io":"1F1EE-1F1F4","flag-iq":"1F1EE-1F1F6","flag-ir":"1F1EE-1F1F7","flag-is":"1F1EE-1F1F8",it:"1F1EE-1F1F9","flag-je":"1F1EF-1F1EA","flag-jm":"1F1EF-1F1F2","flag-jo":"1F1EF-1F1F4",jp:"1F1EF-1F1F5","flag-ke":"1F1F0-1F1EA","flag-kg":"1F1F0-1F1EC","flag-kh":"1F1F0-1F1ED","flag-ki":"1F1F0-1F1EE","flag-km":"1F1F0-1F1F2","flag-kn":"1F1F0-1F1F3","flag-kp":"1F1F0-1F1F5",kr:"1F1F0-1F1F7","flag-kw":"1F1F0-1F1FC","flag-ky":"1F1F0-1F1FE","flag-kz":"1F1F0-1F1FF","flag-la":"1F1F1-1F1E6","flag-lb":"1F1F1-1F1E7","flag-lc":"1F1F1-1F1E8","flag-li":"1F1F1-1F1EE","flag-lk":"1F1F1-1F1F0","flag-lr":"1F1F1-1F1F7","flag-ls":"1F1F1-1F1F8","flag-lt":"1F1F1-1F1F9","flag-lu":"1F1F1-1F1FA","flag-lv":"1F1F1-1F1FB","flag-ly":"1F1F1-1F1FE","flag-ma":"1F1F2-1F1E6","flag-mc":"1F1F2-1F1E8","flag-md":"1F1F2-1F1E9","flag-me":"1F1F2-1F1EA","flag-mf":"1F1F2-1F1EB","flag-mg":"1F1F2-1F1EC","flag-mh":"1F1F2-1F1ED","flag-mk":"1F1F2-1F1F0","flag-ml":"1F1F2-1F1F1","flag-mm":"1F1F2-1F1F2","flag-mn":"1F1F2-1F1F3","flag-mo":"1F1F2-1F1F4","flag-mp":"1F1F2-1F1F5","flag-mq":"1F1F2-1F1F6","flag-mr":"1F1F2-1F1F7","flag-ms":"1F1F2-1F1F8","flag-mt":"1F1F2-1F1F9","flag-mu":"1F1F2-1F1FA","flag-mv":"1F1F2-1F1FB","flag-mw":"1F1F2-1F1FC","flag-mx":"1F1F2-1F1FD","flag-my":"1F1F2-1F1FE","flag-mz":"1F1F2-1F1FF","flag-na":"1F1F3-1F1E6","flag-nc":"1F1F3-1F1E8","flag-ne":"1F1F3-1F1EA","flag-nf":"1F1F3-1F1EB","flag-ng":"1F1F3-1F1EC","flag-ni":"1F1F3-1F1EE","flag-nl":"1F1F3-1F1F1","flag-no":"1F1F3-1F1F4","flag-np":"1F1F3-1F1F5","flag-nr":"1F1F3-1F1F7","flag-nu":"1F1F3-1F1FA","flag-nz":"1F1F3-1F1FF","flag-om":"1F1F4-1F1F2","flag-pa":"1F1F5-1F1E6","flag-pe":"1F1F5-1F1EA","flag-pf":"1F1F5-1F1EB","flag-pg":"1F1F5-1F1EC","flag-ph":"1F1F5-1F1ED","flag-pk":"1F1F5-1F1F0","flag-pl":"1F1F5-1F1F1","flag-pm":"1F1F5-1F1F2","flag-pn":"1F1F5-1F1F3","flag-pr":"1F1F5-1F1F7","flag-ps":"1F1F5-1F1F8","flag-pt":"1F1F5-1F1F9","flag-pw":"1F1F5-1F1FC","flag-py":"1F1F5-1F1FE","flag-qa":"1F1F6-1F1E6","flag-re":"1F1F7-1F1EA","flag-ro":"1F1F7-1F1F4","flag-rs":"1F1F7-1F1F8",ru:"1F1F7-1F1FA","flag-rw":"1F1F7-1F1FC","flag-sa":"1F1F8-1F1E6","flag-sb":"1F1F8-1F1E7","flag-sc":"1F1F8-1F1E8","flag-sd":"1F1F8-1F1E9","flag-se":"1F1F8-1F1EA","flag-sg":"1F1F8-1F1EC","flag-sh":"1F1F8-1F1ED","flag-si":"1F1F8-1F1EE","flag-sj":"1F1F8-1F1EF","flag-sk":"1F1F8-1F1F0","flag-sl":"1F1F8-1F1F1","flag-sm":"1F1F8-1F1F2","flag-sn":"1F1F8-1F1F3","flag-so":"1F1F8-1F1F4","flag-sr":"1F1F8-1F1F7","flag-ss":"1F1F8-1F1F8","flag-st":"1F1F8-1F1F9","flag-sv":"1F1F8-1F1FB","flag-sx":"1F1F8-1F1FD","flag-sy":"1F1F8-1F1FE","flag-sz":"1F1F8-1F1FF","flag-ta":"1F1F9-1F1E6","flag-tc":"1F1F9-1F1E8","flag-td":"1F1F9-1F1E9","flag-tf":"1F1F9-1F1EB","flag-tg":"1F1F9-1F1EC","flag-th":"1F1F9-1F1ED","flag-tj":"1F1F9-1F1EF","flag-tk":"1F1F9-1F1F0","flag-tl":"1F1F9-1F1F1","flag-tm":"1F1F9-1F1F2","flag-tn":"1F1F9-1F1F3","flag-to":"1F1F9-1F1F4","flag-tr":"1F1F9-1F1F7","flag-tt":"1F1F9-1F1F9","flag-tv":"1F1F9-1F1FB","flag-tw":"1F1F9-1F1FC","flag-tz":"1F1F9-1F1FF","flag-ua":"1F1FA-1F1E6","flag-ug":"1F1FA-1F1EC","flag-um":"1F1FA-1F1F2","flag-un":"1F1FA-1F1F3",us:"1F1FA-1F1F8","flag-uy":"1F1FA-1F1FE","flag-uz":"1F1FA-1F1FF","flag-va":"1F1FB-1F1E6","flag-vc":"1F1FB-1F1E8","flag-ve":"1F1FB-1F1EA","flag-vg":"1F1FB-1F1EC","flag-vi":"1F1FB-1F1EE","flag-vn":"1F1FB-1F1F3","flag-vu":"1F1FB-1F1FA","flag-wf":"1F1FC-1F1EB","flag-ws":"1F1FC-1F1F8","flag-xk":"1F1FD-1F1F0","flag-ye":"1F1FE-1F1EA","flag-yt":"1F1FE-1F1F9","flag-za":"1F1FF-1F1E6","flag-zm":"1F1FF-1F1F2","flag-zw":"1F1FF-1F1FC",koko:"1F201",sa:"1F202-FE0F",u7121:"1F21A",u6307:"1F22F",u7981:"1F232",u7a7a:"1F233",u5408:"1F234",u6e80:"1F235",u6709:"1F236",u6708:"1F237-FE0F",u7533:"1F238",u5272:"1F239",u55b6:"1F23A",ideograph_advantage:"1F250",accept:"1F251",cyclone:"1F300",foggy:"1F301",closed_umbrella:"1F302",night_with_stars:"1F303",sunrise_over_mountains:"1F304",sunrise:"1F305",city_sunset:"1F306",city_sunrise:"1F307",rainbow:"1F308",bridge_at_night:"1F309",ocean:"1F30A",volcano:"1F30B",milky_way:"1F30C",earth_africa:"1F30D",earth_americas:"1F30E",earth_asia:"1F30F",globe_with_meridians:"1F310",new_moon:"1F311",waxing_crescent_moon:"1F312",first_quarter_moon:"1F313",moon:"1F314",full_moon:"1F315",waning_gibbous_moon:"1F316",last_quarter_moon:"1F317",waning_crescent_moon:"1F318",crescent_moon:"1F319",new_moon_with_face:"1F31A",first_quarter_moon_with_face:"1F31B",last_quarter_moon_with_face:"1F31C",full_moon_with_face:"1F31D",sun_with_face:"1F31E",star2:"1F31F",stars:"1F320",thermometer:"1F321-FE0F",mostly_sunny:"1F324-FE0F",barely_sunny:"1F325-FE0F",partly_sunny_rain:"1F326-FE0F",rain_cloud:"1F327-FE0F",snow_cloud:"1F328-FE0F",lightning:"1F329-FE0F",tornado:"1F32A-FE0F",fog:"1F32B-FE0F",wind_blowing_face:"1F32C-FE0F",hotdog:"1F32D",taco:"1F32E",burrito:"1F32F",chestnut:"1F330",seedling:"1F331",evergreen_tree:"1F332",deciduous_tree:"1F333",palm_tree:"1F334",cactus:"1F335",hot_pepper:"1F336-FE0F",tulip:"1F337",cherry_blossom:"1F338",rose:"1F339",hibiscus:"1F33A",sunflower:"1F33B",blossom:"1F33C",corn:"1F33D",ear_of_rice:"1F33E",herb:"1F33F",four_leaf_clover:"1F340",maple_leaf:"1F341",fallen_leaf:"1F342",leaves:"1F343",mushroom:"1F344",tomato:"1F345",eggplant:"1F346",grapes:"1F347",melon:"1F348",watermelon:"1F349",tangerine:"1F34A",lemon:"1F34B",banana:"1F34C",pineapple:"1F34D",apple:"1F34E",green_apple:"1F34F",pear:"1F350",peach:"1F351",cherries:"1F352",strawberry:"1F353",hamburger:"1F354",pizza:"1F355",meat_on_bone:"1F356",poultry_leg:"1F357",rice_cracker:"1F358",rice_ball:"1F359",rice:"1F35A",curry:"1F35B",ramen:"1F35C",spaghetti:"1F35D",bread:"1F35E",fries:"1F35F",sweet_potato:"1F360",dango:"1F361",oden:"1F362",sushi:"1F363",fried_shrimp:"1F364",fish_cake:"1F365",icecream:"1F366",shaved_ice:"1F367",ice_cream:"1F368",doughnut:"1F369",cookie:"1F36A",chocolate_bar:"1F36B",candy:"1F36C",lollipop:"1F36D",custard:"1F36E",honey_pot:"1F36F",cake:"1F370",bento:"1F371",stew:"1F372",fried_egg:"1F373",fork_and_knife:"1F374",tea:"1F375",sake:"1F376",wine_glass:"1F377",cocktail:"1F378",tropical_drink:"1F379",beer:"1F37A",beers:"1F37B",baby_bottle:"1F37C",knife_fork_plate:"1F37D-FE0F",champagne:"1F37E",popcorn:"1F37F",ribbon:"1F380",gift:"1F381",birthday:"1F382",jack_o_lantern:"1F383",christmas_tree:"1F384",santa:"1F385",fireworks:"1F386",sparkler:"1F387",balloon:"1F388",tada:"1F389",confetti_ball:"1F38A",tanabata_tree:"1F38B",crossed_flags:"1F38C",bamboo:"1F38D",dolls:"1F38E",flags:"1F38F",wind_chime:"1F390",rice_scene:"1F391",school_satchel:"1F392",mortar_board:"1F393",medal:"1F396-FE0F",reminder_ribbon:"1F397-FE0F",studio_microphone:"1F399-FE0F",level_slider:"1F39A-FE0F",control_knobs:"1F39B-FE0F",film_frames:"1F39E-FE0F",admission_tickets:"1F39F-FE0F",carousel_horse:"1F3A0",ferris_wheel:"1F3A1",roller_coaster:"1F3A2",fishing_pole_and_fish:"1F3A3",microphone:"1F3A4",movie_camera:"1F3A5",cinema:"1F3A6",headphones:"1F3A7",art:"1F3A8",tophat:"1F3A9",circus_tent:"1F3AA",ticket:"1F3AB",clapper:"1F3AC",performing_arts:"1F3AD",video_game:"1F3AE",dart:"1F3AF",slot_machine:"1F3B0","8ball":"1F3B1",game_die:"1F3B2",bowling:"1F3B3",flower_playing_cards:"1F3B4",musical_note:"1F3B5",notes:"1F3B6",saxophone:"1F3B7",guitar:"1F3B8",musical_keyboard:"1F3B9",trumpet:"1F3BA",violin:"1F3BB",musical_score:"1F3BC",running_shirt_with_sash:"1F3BD",tennis:"1F3BE",ski:"1F3BF",basketball:"1F3C0",checkered_flag:"1F3C1",snowboarder:"1F3C2","woman-running":"1F3C3-200D-2640-FE0F","man-running":"1F3C3-200D-2642-FE0F",runner:"1F3C3-200D-2642-FE0F","woman-surfing":"1F3C4-200D-2640-FE0F","man-surfing":"1F3C4-200D-2642-FE0F",surfer:"1F3C4-200D-2642-FE0F",sports_medal:"1F3C5",trophy:"1F3C6",horse_racing:"1F3C7",football:"1F3C8",rugby_football:"1F3C9","woman-swimming":"1F3CA-200D-2640-FE0F","man-swimming":"1F3CA-200D-2642-FE0F",swimmer:"1F3CA-200D-2642-FE0F","woman-lifting-weights":"1F3CB-FE0F-200D-2640-FE0F","man-lifting-weights":"1F3CB-FE0F-200D-2642-FE0F",weight_lifter:"1F3CB-FE0F-200D-2642-FE0F","woman-golfing":"1F3CC-FE0F-200D-2640-FE0F","man-golfing":"1F3CC-FE0F-200D-2642-FE0F",golfer:"1F3CC-FE0F-200D-2642-FE0F",racing_motorcycle:"1F3CD-FE0F",racing_car:"1F3CE-FE0F",cricket_bat_and_ball:"1F3CF",volleyball:"1F3D0",field_hockey_stick_and_ball:"1F3D1",ice_hockey_stick_and_puck:"1F3D2",table_tennis_paddle_and_ball:"1F3D3",snow_capped_mountain:"1F3D4-FE0F",camping:"1F3D5-FE0F",beach_with_umbrella:"1F3D6-FE0F",building_construction:"1F3D7-FE0F",house_buildings:"1F3D8-FE0F",cityscape:"1F3D9-FE0F",derelict_house_building:"1F3DA-FE0F",classical_building:"1F3DB-FE0F",desert:"1F3DC-FE0F",desert_island:"1F3DD-FE0F",national_park:"1F3DE-FE0F",stadium:"1F3DF-FE0F",house:"1F3E0",house_with_garden:"1F3E1",office:"1F3E2",post_office:"1F3E3",european_post_office:"1F3E4",hospital:"1F3E5",bank:"1F3E6",atm:"1F3E7",hotel:"1F3E8",love_hotel:"1F3E9",convenience_store:"1F3EA",school:"1F3EB",department_store:"1F3EC",factory:"1F3ED",izakaya_lantern:"1F3EE",japanese_castle:"1F3EF",european_castle:"1F3F0","rainbow-flag":"1F3F3-FE0F-200D-1F308",waving_white_flag:"1F3F3-FE0F","flag-england":"1F3F4-E0067-E0062-E0065-E006E-E0067-E007F","flag-scotland":"1F3F4-E0067-E0062-E0073-E0063-E0074-E007F","flag-wales":"1F3F4-E0067-E0062-E0077-E006C-E0073-E007F",waving_black_flag:"1F3F4",rosette:"1F3F5-FE0F",label:"1F3F7-FE0F",badminton_racquet_and_shuttlecock:"1F3F8",bow_and_arrow:"1F3F9",amphora:"1F3FA","skin-tone-2":"1F3FB","skin-tone-3":"1F3FC","skin-tone-4":"1F3FD","skin-tone-5":"1F3FE","skin-tone-6":"1F3FF",rat:"1F400",mouse2:"1F401",ox:"1F402",water_buffalo:"1F403",cow2:"1F404",tiger2:"1F405",leopard:"1F406",rabbit2:"1F407",cat2:"1F408",dragon:"1F409",crocodile:"1F40A",whale2:"1F40B",snail:"1F40C",snake:"1F40D",racehorse:"1F40E",ram:"1F40F",goat:"1F410",sheep:"1F411",monkey:"1F412",rooster:"1F413",chicken:"1F414",dog2:"1F415",pig2:"1F416",boar:"1F417",elephant:"1F418",octopus:"1F419",shell:"1F41A",bug:"1F41B",ant:"1F41C",bee:"1F41D",beetle:"1F41E",fish:"1F41F",tropical_fish:"1F420",blowfish:"1F421",turtle:"1F422",hatching_chick:"1F423",baby_chick:"1F424",hatched_chick:"1F425",bird:"1F426",penguin:"1F427",koala:"1F428",poodle:"1F429",dromedary_camel:"1F42A",camel:"1F42B",dolphin:"1F42C",mouse:"1F42D",cow:"1F42E",tiger:"1F42F",rabbit:"1F430",cat:"1F431",dragon_face:"1F432",whale:"1F433",horse:"1F434",monkey_face:"1F435",dog:"1F436",pig:"1F437",frog:"1F438",hamster:"1F439",wolf:"1F43A",bear:"1F43B",panda_face:"1F43C",pig_nose:"1F43D",feet:"1F43E",chipmunk:"1F43F-FE0F",eyes:"1F440","eye-in-speech-bubble":"1F441-FE0F-200D-1F5E8-FE0F",eye:"1F441-FE0F",ear:"1F442",nose:"1F443",lips:"1F444",tongue:"1F445",point_up_2:"1F446",point_down:"1F447",point_left:"1F448",point_right:"1F449",facepunch:"1F44A",wave:"1F44B",ok_hand:"1F44C","+1":"1F44D","-1":"1F44E",clap:"1F44F",open_hands:"1F450",crown:"1F451",womans_hat:"1F452",eyeglasses:"1F453",necktie:"1F454",shirt:"1F455",jeans:"1F456",dress:"1F457",kimono:"1F458",bikini:"1F459",womans_clothes:"1F45A",purse:"1F45B",handbag:"1F45C",pouch:"1F45D",mans_shoe:"1F45E",athletic_shoe:"1F45F",high_heel:"1F460",sandal:"1F461",boot:"1F462",footprints:"1F463",bust_in_silhouette:"1F464",busts_in_silhouette:"1F465",boy:"1F466",girl:"1F467","male-farmer":"1F468-200D-1F33E","male-cook":"1F468-200D-1F373","male-student":"1F468-200D-1F393","male-singer":"1F468-200D-1F3A4","male-artist":"1F468-200D-1F3A8","male-teacher":"1F468-200D-1F3EB","male-factory-worker":"1F468-200D-1F3ED","man-boy-boy":"1F468-200D-1F466-200D-1F466","man-boy":"1F468-200D-1F466","man-girl-boy":"1F468-200D-1F467-200D-1F466","man-girl-girl":"1F468-200D-1F467-200D-1F467","man-girl":"1F468-200D-1F467","man-man-boy":"1F468-200D-1F468-200D-1F466","man-man-boy-boy":"1F468-200D-1F468-200D-1F466-200D-1F466","man-man-girl":"1F468-200D-1F468-200D-1F467","man-man-girl-boy":"1F468-200D-1F468-200D-1F467-200D-1F466","man-man-girl-girl":"1F468-200D-1F468-200D-1F467-200D-1F467","man-woman-boy":"1F468-200D-1F469-200D-1F466","man-woman-boy-boy":"1F468-200D-1F469-200D-1F466-200D-1F466","man-woman-girl":"1F468-200D-1F469-200D-1F467","man-woman-girl-boy":"1F468-200D-1F469-200D-1F467-200D-1F466","man-woman-girl-girl":"1F468-200D-1F469-200D-1F467-200D-1F467","male-technologist":"1F468-200D-1F4BB","male-office-worker":"1F468-200D-1F4BC","male-mechanic":"1F468-200D-1F527","male-scientist":"1F468-200D-1F52C","male-astronaut":"1F468-200D-1F680","male-firefighter":"1F468-200D-1F692","male-doctor":"1F468-200D-2695-FE0F","male-judge":"1F468-200D-2696-FE0F","male-pilot":"1F468-200D-2708-FE0F","man-heart-man":"1F468-200D-2764-FE0F-200D-1F468","man-kiss-man":"1F468-200D-2764-FE0F-200D-1F48B-200D-1F468",man:"1F468","female-farmer":"1F469-200D-1F33E","female-cook":"1F469-200D-1F373","female-student":"1F469-200D-1F393","female-singer":"1F469-200D-1F3A4","female-artist":"1F469-200D-1F3A8","female-teacher":"1F469-200D-1F3EB","female-factory-worker":"1F469-200D-1F3ED","woman-boy-boy":"1F469-200D-1F466-200D-1F466","woman-boy":"1F469-200D-1F466","woman-girl-boy":"1F469-200D-1F467-200D-1F466","woman-girl-girl":"1F469-200D-1F467-200D-1F467","woman-girl":"1F469-200D-1F467","woman-woman-boy":"1F469-200D-1F469-200D-1F466","woman-woman-boy-boy":"1F469-200D-1F469-200D-1F466-200D-1F466","woman-woman-girl":"1F469-200D-1F469-200D-1F467","woman-woman-girl-boy":"1F469-200D-1F469-200D-1F467-200D-1F466","woman-woman-girl-girl":"1F469-200D-1F469-200D-1F467-200D-1F467","female-technologist":"1F469-200D-1F4BB","female-office-worker":"1F469-200D-1F4BC","female-mechanic":"1F469-200D-1F527","female-scientist":"1F469-200D-1F52C","female-astronaut":"1F469-200D-1F680","female-firefighter":"1F469-200D-1F692","female-doctor":"1F469-200D-2695-FE0F","female-judge":"1F469-200D-2696-FE0F","female-pilot":"1F469-200D-2708-FE0F","woman-heart-man":"1F469-200D-2764-FE0F-200D-1F468","woman-heart-woman":"1F469-200D-2764-FE0F-200D-1F469","woman-kiss-man":"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468","woman-kiss-woman":"1F469-200D-2764-FE0F-200D-1F48B-200D-1F469",woman:"1F469",family:"1F468-200D-1F469-200D-1F466",couple:"1F46B",two_men_holding_hands:"1F46C",two_women_holding_hands:"1F46D","female-police-officer":"1F46E-200D-2640-FE0F","male-police-officer":"1F46E-200D-2642-FE0F",cop:"1F46E-200D-2642-FE0F","woman-with-bunny-ears-partying":"1F46F-200D-2640-FE0F","man-with-bunny-ears-partying":"1F46F-200D-2642-FE0F",dancers:"1F46F-200D-2640-FE0F",bride_with_veil:"1F470","blond-haired-woman":"1F471-200D-2640-FE0F","blond-haired-man":"1F471-200D-2642-FE0F",person_with_blond_hair:"1F471-200D-2642-FE0F",man_with_gua_pi_mao:"1F472","woman-wearing-turban":"1F473-200D-2640-FE0F","man-wearing-turban":"1F473-200D-2642-FE0F",man_with_turban:"1F473-200D-2642-FE0F",older_man:"1F474",older_woman:"1F475",baby:"1F476","female-construction-worker":"1F477-200D-2640-FE0F","male-construction-worker":"1F477-200D-2642-FE0F",construction_worker:"1F477-200D-2642-FE0F",princess:"1F478",japanese_ogre:"1F479",japanese_goblin:"1F47A",ghost:"1F47B",angel:"1F47C",alien:"1F47D",space_invader:"1F47E",imp:"1F47F",skull:"1F480","woman-tipping-hand":"1F481-200D-2640-FE0F","man-tipping-hand":"1F481-200D-2642-FE0F",information_desk_person:"1F481-200D-2640-FE0F","female-guard":"1F482-200D-2640-FE0F","male-guard":"1F482-200D-2642-FE0F",guardsman:"1F482-200D-2642-FE0F",dancer:"1F483",lipstick:"1F484",nail_care:"1F485","woman-getting-massage":"1F486-200D-2640-FE0F","man-getting-massage":"1F486-200D-2642-FE0F",massage:"1F486-200D-2640-FE0F","woman-getting-haircut":"1F487-200D-2640-FE0F","man-getting-haircut":"1F487-200D-2642-FE0F",haircut:"1F487-200D-2640-FE0F",barber:"1F488",syringe:"1F489",pill:"1F48A",kiss:"1F48B",love_letter:"1F48C",ring:"1F48D",gem:"1F48E",couplekiss:"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468",bouquet:"1F490",couple_with_heart:"1F469-200D-2764-FE0F-200D-1F468",wedding:"1F492",heartbeat:"1F493",broken_heart:"1F494",two_hearts:"1F495",sparkling_heart:"1F496",heartpulse:"1F497",cupid:"1F498",blue_heart:"1F499",green_heart:"1F49A",yellow_heart:"1F49B",purple_heart:"1F49C",gift_heart:"1F49D",revolving_hearts:"1F49E",heart_decoration:"1F49F",diamond_shape_with_a_dot_inside:"1F4A0",bulb:"1F4A1",anger:"1F4A2",bomb:"1F4A3",zzz:"1F4A4",boom:"1F4A5",sweat_drops:"1F4A6",droplet:"1F4A7",dash:"1F4A8",hankey:"1F4A9",muscle:"1F4AA",dizzy:"1F4AB",speech_balloon:"1F4AC",thought_balloon:"1F4AD",white_flower:"1F4AE",100:"1F4AF",moneybag:"1F4B0",currency_exchange:"1F4B1",heavy_dollar_sign:"1F4B2",credit_card:"1F4B3",yen:"1F4B4",dollar:"1F4B5",euro:"1F4B6",pound:"1F4B7",money_with_wings:"1F4B8",chart:"1F4B9",seat:"1F4BA",computer:"1F4BB",briefcase:"1F4BC",minidisc:"1F4BD",floppy_disk:"1F4BE",cd:"1F4BF",dvd:"1F4C0",file_folder:"1F4C1",open_file_folder:"1F4C2",page_with_curl:"1F4C3",page_facing_up:"1F4C4",date:"1F4C5",calendar:"1F4C6",card_index:"1F4C7",chart_with_upwards_trend:"1F4C8",chart_with_downwards_trend:"1F4C9",bar_chart:"1F4CA",clipboard:"1F4CB",pushpin:"1F4CC",round_pushpin:"1F4CD",paperclip:"1F4CE",straight_ruler:"1F4CF",triangular_ruler:"1F4D0",bookmark_tabs:"1F4D1",ledger:"1F4D2",notebook:"1F4D3",notebook_with_decorative_cover:"1F4D4",closed_book:"1F4D5",book:"1F4D6",green_book:"1F4D7",blue_book:"1F4D8",orange_book:"1F4D9",books:"1F4DA",name_badge:"1F4DB",scroll:"1F4DC",memo:"1F4DD",telephone_receiver:"1F4DE",pager:"1F4DF",fax:"1F4E0",satellite_antenna:"1F4E1",loudspeaker:"1F4E2",mega:"1F4E3",outbox_tray:"1F4E4",inbox_tray:"1F4E5",package:"1F4E6","e-mail":"1F4E7",incoming_envelope:"1F4E8",envelope_with_arrow:"1F4E9",mailbox_closed:"1F4EA",mailbox:"1F4EB",mailbox_with_mail:"1F4EC",mailbox_with_no_mail:"1F4ED",postbox:"1F4EE",postal_horn:"1F4EF",newspaper:"1F4F0",iphone:"1F4F1",calling:"1F4F2",vibration_mode:"1F4F3",mobile_phone_off:"1F4F4",no_mobile_phones:"1F4F5",signal_strength:"1F4F6",camera:"1F4F7",camera_with_flash:"1F4F8",video_camera:"1F4F9",tv:"1F4FA",radio:"1F4FB",vhs:"1F4FC",film_projector:"1F4FD-FE0F",prayer_beads:"1F4FF",twisted_rightwards_arrows:"1F500",repeat:"1F501",repeat_one:"1F502",arrows_clockwise:"1F503",arrows_counterclockwise:"1F504",low_brightness:"1F505",high_brightness:"1F506",mute:"1F507",speaker:"1F508",sound:"1F509",loud_sound:"1F50A",battery:"1F50B",electric_plug:"1F50C",mag:"1F50D",mag_right:"1F50E",lock_with_ink_pen:"1F50F",closed_lock_with_key:"1F510",key:"1F511",lock:"1F512",unlock:"1F513",bell:"1F514",no_bell:"1F515",bookmark:"1F516",link:"1F517",radio_button:"1F518",back:"1F519",end:"1F51A",on:"1F51B",soon:"1F51C",top:"1F51D",underage:"1F51E",keycap_ten:"1F51F",capital_abcd:"1F520",abcd:"1F521",1234:"1F522",symbols:"1F523",abc:"1F524",fire:"1F525",flashlight:"1F526",wrench:"1F527",hammer:"1F528",nut_and_bolt:"1F529",hocho:"1F52A",gun:"1F52B",microscope:"1F52C",telescope:"1F52D",crystal_ball:"1F52E",six_pointed_star:"1F52F",beginner:"1F530",trident:"1F531",black_square_button:"1F532",white_square_button:"1F533",red_circle:"1F534",large_blue_circle:"1F535",large_orange_diamond:"1F536",large_blue_diamond:"1F537",small_orange_diamond:"1F538",small_blue_diamond:"1F539",small_red_triangle:"1F53A",small_red_triangle_down:"1F53B",arrow_up_small:"1F53C",arrow_down_small:"1F53D",om_symbol:"1F549-FE0F",dove_of_peace:"1F54A-FE0F",kaaba:"1F54B",mosque:"1F54C",synagogue:"1F54D",menorah_with_nine_branches:"1F54E",clock1:"1F550",clock2:"1F551",clock3:"1F552",clock4:"1F553",clock5:"1F554",clock6:"1F555",clock7:"1F556",clock8:"1F557",clock9:"1F558",clock10:"1F559",clock11:"1F55A",clock12:"1F55B",clock130:"1F55C",clock230:"1F55D",clock330:"1F55E",clock430:"1F55F",clock530:"1F560",clock630:"1F561",clock730:"1F562",clock830:"1F563",clock930:"1F564",clock1030:"1F565",clock1130:"1F566",clock1230:"1F567",candle:"1F56F-FE0F",mantelpiece_clock:"1F570-FE0F",hole:"1F573-FE0F",man_in_business_suit_levitating:"1F574-FE0F","female-detective":"1F575-FE0F-200D-2640-FE0F","male-detective":"1F575-FE0F-200D-2642-FE0F",sleuth_or_spy:"1F575-FE0F-200D-2642-FE0F",dark_sunglasses:"1F576-FE0F",spider:"1F577-FE0F",spider_web:"1F578-FE0F",joystick:"1F579-FE0F",man_dancing:"1F57A",linked_paperclips:"1F587-FE0F",lower_left_ballpoint_pen:"1F58A-FE0F",lower_left_fountain_pen:"1F58B-FE0F",lower_left_paintbrush:"1F58C-FE0F",lower_left_crayon:"1F58D-FE0F",raised_hand_with_fingers_splayed:"1F590-FE0F",middle_finger:"1F595","spock-hand":"1F596",black_heart:"1F5A4",desktop_computer:"1F5A5-FE0F",printer:"1F5A8-FE0F",three_button_mouse:"1F5B1-FE0F",trackball:"1F5B2-FE0F",frame_with_picture:"1F5BC-FE0F",card_index_dividers:"1F5C2-FE0F",card_file_box:"1F5C3-FE0F",file_cabinet:"1F5C4-FE0F",wastebasket:"1F5D1-FE0F",spiral_note_pad:"1F5D2-FE0F",spiral_calendar_pad:"1F5D3-FE0F",compression:"1F5DC-FE0F",old_key:"1F5DD-FE0F",rolled_up_newspaper:"1F5DE-FE0F",dagger_knife:"1F5E1-FE0F",speaking_head_in_silhouette:"1F5E3-FE0F",left_speech_bubble:"1F5E8-FE0F",right_anger_bubble:"1F5EF-FE0F",ballot_box_with_ballot:"1F5F3-FE0F",world_map:"1F5FA-FE0F",mount_fuji:"1F5FB",tokyo_tower:"1F5FC",statue_of_liberty:"1F5FD",japan:"1F5FE",moyai:"1F5FF",grinning:"1F600",grin:"1F601",joy:"1F602",smiley:"1F603",smile:"1F604",sweat_smile:"1F605",laughing:"1F606",innocent:"1F607",smiling_imp:"1F608",wink:"1F609",blush:"1F60A",yum:"1F60B",relieved:"1F60C",heart_eyes:"1F60D",sunglasses:"1F60E",smirk:"1F60F",neutral_face:"1F610",expressionless:"1F611",unamused:"1F612",sweat:"1F613",pensive:"1F614",confused:"1F615",confounded:"1F616",kissing:"1F617",kissing_heart:"1F618",kissing_smiling_eyes:"1F619",kissing_closed_eyes:"1F61A",stuck_out_tongue:"1F61B",stuck_out_tongue_winking_eye:"1F61C",stuck_out_tongue_closed_eyes:"1F61D",disappointed:"1F61E",worried:"1F61F",angry:"1F620",rage:"1F621",cry:"1F622",persevere:"1F623",triumph:"1F624",disappointed_relieved:"1F625",frowning:"1F626",anguished:"1F627",fearful:"1F628",weary:"1F629",sleepy:"1F62A",tired_face:"1F62B",grimacing:"1F62C",sob:"1F62D",open_mouth:"1F62E",hushed:"1F62F",cold_sweat:"1F630",scream:"1F631",astonished:"1F632",flushed:"1F633",sleeping:"1F634",dizzy_face:"1F635",no_mouth:"1F636",mask:"1F637",smile_cat:"1F638",joy_cat:"1F639",smiley_cat:"1F63A",heart_eyes_cat:"1F63B",smirk_cat:"1F63C",kissing_cat:"1F63D",pouting_cat:"1F63E",crying_cat_face:"1F63F",scream_cat:"1F640",slightly_frowning_face:"1F641",slightly_smiling_face:"1F642",upside_down_face:"1F643",face_with_rolling_eyes:"1F644","woman-gesturing-no":"1F645-200D-2640-FE0F","man-gesturing-no":"1F645-200D-2642-FE0F",no_good:"1F645-200D-2640-FE0F","woman-gesturing-ok":"1F646-200D-2640-FE0F","man-gesturing-ok":"1F646-200D-2642-FE0F",ok_woman:"1F646-200D-2640-FE0F","woman-bowing":"1F647-200D-2640-FE0F","man-bowing":"1F647-200D-2642-FE0F",bow:"1F647-200D-2642-FE0F",see_no_evil:"1F648",hear_no_evil:"1F649",speak_no_evil:"1F64A","woman-raising-hand":"1F64B-200D-2640-FE0F","man-raising-hand":"1F64B-200D-2642-FE0F",raising_hand:"1F64B-200D-2640-FE0F",raised_hands:"1F64C","woman-frowning":"1F64D-200D-2640-FE0F","man-frowning":"1F64D-200D-2642-FE0F",person_frowning:"1F64D-200D-2640-FE0F","woman-pouting":"1F64E-200D-2640-FE0F","man-pouting":"1F64E-200D-2642-FE0F",person_with_pouting_face:"1F64E-200D-2640-FE0F",pray:"1F64F",rocket:"1F680",helicopter:"1F681",steam_locomotive:"1F682",railway_car:"1F683",bullettrain_side:"1F684",bullettrain_front:"1F685",train2:"1F686",metro:"1F687",light_rail:"1F688",station:"1F689",tram:"1F68A",train:"1F68B",bus:"1F68C",oncoming_bus:"1F68D",trolleybus:"1F68E",busstop:"1F68F",minibus:"1F690",ambulance:"1F691",fire_engine:"1F692",police_car:"1F693",oncoming_police_car:"1F694",taxi:"1F695",oncoming_taxi:"1F696",car:"1F697",oncoming_automobile:"1F698",blue_car:"1F699",truck:"1F69A",articulated_lorry:"1F69B",tractor:"1F69C",monorail:"1F69D",mountain_railway:"1F69E",suspension_railway:"1F69F",mountain_cableway:"1F6A0",aerial_tramway:"1F6A1",ship:"1F6A2","woman-rowing-boat":"1F6A3-200D-2640-FE0F","man-rowing-boat":"1F6A3-200D-2642-FE0F",rowboat:"1F6A3-200D-2642-FE0F",speedboat:"1F6A4",traffic_light:"1F6A5",vertical_traffic_light:"1F6A6",construction:"1F6A7",rotating_light:"1F6A8",triangular_flag_on_post:"1F6A9",door:"1F6AA",no_entry_sign:"1F6AB",smoking:"1F6AC",no_smoking:"1F6AD",put_litter_in_its_place:"1F6AE",do_not_litter:"1F6AF",potable_water:"1F6B0","non-potable_water":"1F6B1",bike:"1F6B2",no_bicycles:"1F6B3","woman-biking":"1F6B4-200D-2640-FE0F","man-biking":"1F6B4-200D-2642-FE0F",bicyclist:"1F6B4-200D-2642-FE0F","woman-mountain-biking":"1F6B5-200D-2640-FE0F","man-mountain-biking":"1F6B5-200D-2642-FE0F",mountain_bicyclist:"1F6B5-200D-2642-FE0F","woman-walking":"1F6B6-200D-2640-FE0F","man-walking":"1F6B6-200D-2642-FE0F",walking:"1F6B6-200D-2642-FE0F",no_pedestrians:"1F6B7",children_crossing:"1F6B8",mens:"1F6B9",womens:"1F6BA",restroom:"1F6BB",baby_symbol:"1F6BC",toilet:"1F6BD",wc:"1F6BE",shower:"1F6BF",bath:"1F6C0",bathtub:"1F6C1",passport_control:"1F6C2",customs:"1F6C3",baggage_claim:"1F6C4",left_luggage:"1F6C5",couch_and_lamp:"1F6CB-FE0F",sleeping_accommodation:"1F6CC",shopping_bags:"1F6CD-FE0F",bellhop_bell:"1F6CE-FE0F",bed:"1F6CF-FE0F",place_of_worship:"1F6D0",octagonal_sign:"1F6D1",shopping_trolley:"1F6D2",hammer_and_wrench:"1F6E0-FE0F",shield:"1F6E1-FE0F",oil_drum:"1F6E2-FE0F",motorway:"1F6E3-FE0F",railway_track:"1F6E4-FE0F",motor_boat:"1F6E5-FE0F",small_airplane:"1F6E9-FE0F",airplane_departure:"1F6EB",airplane_arriving:"1F6EC",satellite:"1F6F0-FE0F",passenger_ship:"1F6F3-FE0F",scooter:"1F6F4",motor_scooter:"1F6F5",canoe:"1F6F6",sled:"1F6F7",flying_saucer:"1F6F8",zipper_mouth_face:"1F910",money_mouth_face:"1F911",face_with_thermometer:"1F912",nerd_face:"1F913",thinking_face:"1F914",face_with_head_bandage:"1F915",robot_face:"1F916",hugging_face:"1F917",the_horns:"1F918",call_me_hand:"1F919",raised_back_of_hand:"1F91A","left-facing_fist":"1F91B","right-facing_fist":"1F91C",handshake:"1F91D",crossed_fingers:"1F91E",i_love_you_hand_sign:"1F91F",face_with_cowboy_hat:"1F920",clown_face:"1F921",nauseated_face:"1F922",rolling_on_the_floor_laughing:"1F923",drooling_face:"1F924",lying_face:"1F925","woman-facepalming":"1F926-200D-2640-FE0F","man-facepalming":"1F926-200D-2642-FE0F",face_palm:"1F926",sneezing_face:"1F927",face_with_raised_eyebrow:"1F928","star-struck":"1F929",zany_face:"1F92A",shushing_face:"1F92B",face_with_symbols_on_mouth:"1F92C",face_with_hand_over_mouth:"1F92D",face_vomiting:"1F92E",exploding_head:"1F92F",pregnant_woman:"1F930","breast-feeding":"1F931",palms_up_together:"1F932",selfie:"1F933",prince:"1F934",man_in_tuxedo:"1F935",mrs_claus:"1F936","woman-shrugging":"1F937-200D-2640-FE0F","man-shrugging":"1F937-200D-2642-FE0F",shrug:"1F937","woman-cartwheeling":"1F938-200D-2640-FE0F","man-cartwheeling":"1F938-200D-2642-FE0F",person_doing_cartwheel:"1F938","woman-juggling":"1F939-200D-2640-FE0F","man-juggling":"1F939-200D-2642-FE0F",juggling:"1F939",fencer:"1F93A","woman-wrestling":"1F93C-200D-2640-FE0F","man-wrestling":"1F93C-200D-2642-FE0F",wrestlers:"1F93C","woman-playing-water-polo":"1F93D-200D-2640-FE0F","man-playing-water-polo":"1F93D-200D-2642-FE0F",water_polo:"1F93D","woman-playing-handball":"1F93E-200D-2640-FE0F","man-playing-handball":"1F93E-200D-2642-FE0F",handball:"1F93E",wilted_flower:"1F940",drum_with_drumsticks:"1F941",clinking_glasses:"1F942",tumbler_glass:"1F943",spoon:"1F944",goal_net:"1F945",first_place_medal:"1F947",second_place_medal:"1F948",third_place_medal:"1F949",boxing_glove:"1F94A",martial_arts_uniform:"1F94B",curling_stone:"1F94C",croissant:"1F950",avocado:"1F951",cucumber:"1F952",bacon:"1F953",potato:"1F954",carrot:"1F955",baguette_bread:"1F956",green_salad:"1F957",shallow_pan_of_food:"1F958",stuffed_flatbread:"1F959",egg:"1F95A",glass_of_milk:"1F95B",peanuts:"1F95C",kiwifruit:"1F95D",pancakes:"1F95E",dumpling:"1F95F",fortune_cookie:"1F960",takeout_box:"1F961",chopsticks:"1F962",bowl_with_spoon:"1F963",cup_with_straw:"1F964",coconut:"1F965",broccoli:"1F966",pie:"1F967",pretzel:"1F968",cut_of_meat:"1F969",sandwich:"1F96A",canned_food:"1F96B",crab:"1F980",lion_face:"1F981",scorpion:"1F982",turkey:"1F983",unicorn_face:"1F984",eagle:"1F985",duck:"1F986",bat:"1F987",shark:"1F988",owl:"1F989",fox_face:"1F98A",butterfly:"1F98B",deer:"1F98C",gorilla:"1F98D",lizard:"1F98E",rhinoceros:"1F98F",shrimp:"1F990",squid:"1F991",giraffe_face:"1F992",zebra_face:"1F993",hedgehog:"1F994",sauropod:"1F995","t-rex":"1F996",cricket:"1F997",cheese_wedge:"1F9C0",face_with_monocle:"1F9D0",adult:"1F9D1",child:"1F9D2",older_adult:"1F9D3",bearded_person:"1F9D4",person_with_headscarf:"1F9D5",woman_in_steamy_room:"1F9D6-200D-2640-FE0F",man_in_steamy_room:"1F9D6-200D-2642-FE0F",person_in_steamy_room:"1F9D6-200D-2642-FE0F",woman_climbing:"1F9D7-200D-2640-FE0F",man_climbing:"1F9D7-200D-2642-FE0F",person_climbing:"1F9D7-200D-2640-FE0F",woman_in_lotus_position:"1F9D8-200D-2640-FE0F",man_in_lotus_position:"1F9D8-200D-2642-FE0F",person_in_lotus_position:"1F9D8-200D-2640-FE0F",female_mage:"1F9D9-200D-2640-FE0F",male_mage:"1F9D9-200D-2642-FE0F",mage:"1F9D9-200D-2640-FE0F",female_fairy:"1F9DA-200D-2640-FE0F",male_fairy:"1F9DA-200D-2642-FE0F",fairy:"1F9DA-200D-2640-FE0F",female_vampire:"1F9DB-200D-2640-FE0F",male_vampire:"1F9DB-200D-2642-FE0F",vampire:"1F9DB-200D-2640-FE0F",mermaid:"1F9DC-200D-2640-FE0F",merman:"1F9DC-200D-2642-FE0F",merperson:"1F9DC-200D-2642-FE0F",female_elf:"1F9DD-200D-2640-FE0F",male_elf:"1F9DD-200D-2642-FE0F",elf:"1F9DD-200D-2642-FE0F",female_genie:"1F9DE-200D-2640-FE0F",male_genie:"1F9DE-200D-2642-FE0F",genie:"1F9DE-200D-2642-FE0F",female_zombie:"1F9DF-200D-2640-FE0F",male_zombie:"1F9DF-200D-2642-FE0F",zombie:"1F9DF-200D-2642-FE0F",brain:"1F9E0",orange_heart:"1F9E1",billed_cap:"1F9E2",scarf:"1F9E3",gloves:"1F9E4",coat:"1F9E5",socks:"1F9E6",bangbang:"203C-FE0F",interrobang:"2049-FE0F",tm:"2122-FE0F",information_source:"2139-FE0F",left_right_arrow:"2194-FE0F",arrow_up_down:"2195-FE0F",arrow_upper_left:"2196-FE0F",arrow_upper_right:"2197-FE0F",arrow_lower_right:"2198-FE0F",arrow_lower_left:"2199-FE0F",leftwards_arrow_with_hook:"21A9-FE0F",arrow_right_hook:"21AA-FE0F",watch:"231A",hourglass:"231B",keyboard:"2328-FE0F",eject:"23CF-FE0F",fast_forward:"23E9",rewind:"23EA",arrow_double_up:"23EB",arrow_double_down:"23EC",black_right_pointing_double_triangle_with_vertical_bar:"23ED-FE0F",black_left_pointing_double_triangle_with_vertical_bar:"23EE-FE0F",black_right_pointing_triangle_with_double_vertical_bar:"23EF-FE0F",alarm_clock:"23F0",stopwatch:"23F1-FE0F",timer_clock:"23F2-FE0F",hourglass_flowing_sand:"23F3",double_vertical_bar:"23F8-FE0F",black_square_for_stop:"23F9-FE0F",black_circle_for_record:"23FA-FE0F",m:"24C2-FE0F",black_small_square:"25AA-FE0F",white_small_square:"25AB-FE0F",arrow_forward:"25B6-FE0F",arrow_backward:"25C0-FE0F",white_medium_square:"25FB-FE0F",black_medium_square:"25FC-FE0F",white_medium_small_square:"25FD",black_medium_small_square:"25FE",sunny:"2600-FE0F",cloud:"2601-FE0F",umbrella:"2602-FE0F",snowman:"2603-FE0F",comet:"2604-FE0F",phone:"260E-FE0F",ballot_box_with_check:"2611-FE0F",umbrella_with_rain_drops:"2614",coffee:"2615",shamrock:"2618-FE0F",point_up:"261D-FE0F",skull_and_crossbones:"2620-FE0F",radioactive_sign:"2622-FE0F",biohazard_sign:"2623-FE0F",orthodox_cross:"2626-FE0F",star_and_crescent:"262A-FE0F",peace_symbol:"262E-FE0F",yin_yang:"262F-FE0F",wheel_of_dharma:"2638-FE0F",white_frowning_face:"2639-FE0F",relaxed:"263A-FE0F",female_sign:"2640-FE0F",male_sign:"2642-FE0F",aries:"2648",taurus:"2649",gemini:"264A",cancer:"264B",leo:"264C",virgo:"264D",libra:"264E",scorpius:"264F",sagittarius:"2650",capricorn:"2651",aquarius:"2652",pisces:"2653",spades:"2660-FE0F",clubs:"2663-FE0F",hearts:"2665-FE0F",diamonds:"2666-FE0F",hotsprings:"2668-FE0F",recycle:"267B-FE0F",wheelchair:"267F",hammer_and_pick:"2692-FE0F",anchor:"2693",crossed_swords:"2694-FE0F",medical_symbol:"2695-FE0F",scales:"2696-FE0F",alembic:"2697-FE0F",gear:"2699-FE0F",atom_symbol:"269B-FE0F",fleur_de_lis:"269C-FE0F",warning:"26A0-FE0F",zap:"26A1",white_circle:"26AA",black_circle:"26AB",coffin:"26B0-FE0F",funeral_urn:"26B1-FE0F",soccer:"26BD",baseball:"26BE",snowman_without_snow:"26C4",partly_sunny:"26C5",thunder_cloud_and_rain:"26C8-FE0F",ophiuchus:"26CE",pick:"26CF-FE0F",helmet_with_white_cross:"26D1-FE0F",chains:"26D3-FE0F",no_entry:"26D4",shinto_shrine:"26E9-FE0F",church:"26EA",mountain:"26F0-FE0F",umbrella_on_ground:"26F1-FE0F",fountain:"26F2",golf:"26F3",ferry:"26F4-FE0F",boat:"26F5",skier:"26F7-FE0F",ice_skate:"26F8-FE0F","woman-bouncing-ball":"26F9-FE0F-200D-2640-FE0F","man-bouncing-ball":"26F9-FE0F-200D-2642-FE0F",person_with_ball:"26F9-FE0F-200D-2642-FE0F",tent:"26FA",fuelpump:"26FD",scissors:"2702-FE0F",white_check_mark:"2705",airplane:"2708-FE0F",email:"2709-FE0F",fist:"270A",hand:"270B",v:"270C-FE0F",writing_hand:"270D-FE0F",pencil2:"270F-FE0F",black_nib:"2712-FE0F",heavy_check_mark:"2714-FE0F",heavy_multiplication_x:"2716-FE0F",latin_cross:"271D-FE0F",star_of_david:"2721-FE0F",sparkles:"2728",eight_spoked_asterisk:"2733-FE0F",eight_pointed_black_star:"2734-FE0F",snowflake:"2744-FE0F",sparkle:"2747-FE0F",x:"274C",negative_squared_cross_mark:"274E",question:"2753",grey_question:"2754",grey_exclamation:"2755",exclamation:"2757",heavy_heart_exclamation_mark_ornament:"2763-FE0F",heart:"2764-FE0F",heavy_plus_sign:"2795",heavy_minus_sign:"2796",heavy_division_sign:"2797",arrow_right:"27A1-FE0F",curly_loop:"27B0",loop:"27BF",arrow_heading_up:"2934-FE0F",arrow_heading_down:"2935-FE0F",arrow_left:"2B05-FE0F",arrow_up:"2B06-FE0F",arrow_down:"2B07-FE0F",black_large_square:"2B1B",white_large_square:"2B1C",star:"2B50",o:"2B55",wavy_dash:"3030-FE0F",part_alternation_mark:"303D-FE0F",congratulations:"3297-FE0F",secret:"3299-FE0F"}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/emoji/auto_complete",["exports","core/emoji/data","core/templates","core/utils","core/localstorage","core/key_codes"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=i(b);e=g(e);f=g(f);function g(a){return a&&a.__esModule?a:{default:a}}function h(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;h=function(){return a};return a}function i(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=h();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function j(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function k(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){j(h,d,e,f,g,"next",a)}function g(a){j(h,d,e,f,g,"throw",a)}f(void 0)})}}function l(a){return p(a)||o(a)||n(a)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(a,b){if(!a)return;if("string"==typeof a)return q(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return q(a,b)}function o(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function p(a){if(Array.isArray(a))return q(a)}function q(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}var r="moodle-recent-emojis",s={EMOJI_BUTTON:"[data-region=\"emoji-button\"]",ACTIVE_EMOJI_BUTTON:"[data-region=\"emoji-button\"].active"},t=function(){var a=e.default.get(r);return a?JSON.parse(a):[]},u=function(a,b){var c={unified:a,shortnames:[b]},d=t(),f=[c].concat(l(d.filter(function(a){return a.unified!=c.unified})));f=f.slice(0,27);e.default.set(r,JSON.stringify(f))},v=function(a){var c=b.byShortName[a];if(c){var d=c.split("-").map(function(a){return"0x".concat(a)});return String.fromCodePoint.apply(null,d)}else{return null}},w=function(){var a=k(regeneratorRuntime.mark(function a(d,e){var f,g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f={emojis:e.map(function(a,c){return{active:0===c,emojitext:v(a),displayshortname:":".concat(a,":"),shortname:a,unified:b.byShortName[a]}})};a.next=3;return(0,c.render)("core/emoji/auto_complete",f);case 3:g=a.sent;d.innerHTML=g;case 5:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),x=function(a,c){if(""===a){return t().map(function(a){return a.shortnames[0]}).slice(0,c)}else{a=a.toLowerCase();return Object.keys(b.byShortName).filter(function(b){return b.includes(a)}).slice(0,c)}},y=function(a,b){var c=a.slice(0,b).match(/(\S*)$/),d=a.slice(b).match(/^(\S*)/),e="",f="";if(c){e=c[c.length-1]}if(d){f=d[d.length-1]}return"".concat(e).concat(f)},z=function(a){return /^:[^:\s]+:$/.test(a)},A=function(a){return /^:[^:\s]*$/.test(a)},B=function(a){return a.replace(/:/g,"")},C=function(a){return a.querySelector(s.ACTIVE_EMOJI_BUTTON)},D=function(a){var b=C(a),c=b.previousElementSibling;if(c){b.classList.remove("active");c.classList.add("active");c.scrollIntoView({behaviour:"smooth",inline:"center"})}},E=function(a){var b=C(a),c=b.nextElementSibling;if(c){b.classList.remove("active");c.classList.add("active");c.scrollIntoView({behaviour:"smooth",inline:"center"})}},F=function(a,b){var c=a.getAttribute("data-short-name"),d=a.getAttribute("data-unified");u(d,c);b(a.innerHTML.trim())};a.default=function(a,c,g,h){var i=!1,j="";c.addEventListener("keyup",(0,d.debounce)(function(){var d=c.value,e=c.selectionStart,f=y(d,e);if(f===j){return}else{j=f}if(z(f)){var k=B(f),l=v(k);i=!1;if(l){u(b.byShortName[k],k);h(l)}}else if(A(f)){var m=x(B(f),50);if(m.length){w(a,m);i=!0}else{i=!1}}else{i=!1}g(i)},200));c.addEventListener("keydown",function(b){if(i){var c=b.shiftKey||b.metaKey||b.altKey||b.ctrlKey;if(!c){switch(b.which){case f.default.escape:i=!1;g(!1);break;case f.default.arrowLeft:D(a);b.preventDefault();break;case f.default.arrowRight:E(a);b.preventDefault();break;case f.default.enter:F(C(a),h);b.preventDefault();b.stopPropagation();break;}}}});a.addEventListener("click",function(a){var b=a.target;if(b.matches(s.EMOJI_BUTTON)){F(b,h)}})};return a.default});
define ("core/emoji/picker",["exports","core/localstorage","core/emoji/data","core/utils","core/str","core/templates"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);c=h(c);function g(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;g=function(){return a};return a}function h(a){if(a&&a.__esModule){return a}if(null===a||"object"!==j(a)&&"function"!=typeof a){return{default:a}}var b=g();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function j(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){j=function(a){return typeof a}}else{j=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return j(a)}function k(a){return n(a)||m(a)||q(a)||l()}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function n(a){if(Array.isArray(a))return r(a)}function o(a,b){return t(a)||s(a,b)||q(a,b)||p()}function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(a,b){if(!a)return;if("string"==typeof a)return r(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return r(a,b)}function r(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function s(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function t(a){if(Array.isArray(a))return a}function u(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function v(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){u(h,d,e,f,g,"next",a)}function g(a){u(h,d,e,f,g,"throw",a)}f(void 0)})}}function w(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function x(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){w(Object(c),!0).forEach(function(b){y(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{w(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function y(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}var z=5,A="moodle-recent-emojis",B=40,C=7,D={EMOJI:0,HEADER:1},E={CATEGORY_SELECTOR:"[data-action=\"show-category\"]",EMOJIS_CONTAINER:"[data-region=\"emojis-container\"]",EMOJI_PREVIEW:"[data-region=\"emoji-preview\"]",EMOJI_SHORT_NAME:"[data-region=\"emoji-short-name\"]",ROW_CONTAINER:"[data-region=\"row-container\"]",SEARCH_INPUT:"[data-region=\"search-input\"]",SEARCH_RESULTS_CONTAINER:"[data-region=\"search-results-container\"]"},F=function(a,b,c,d){var e=[];e.push({index:d+e.length,type:D.HEADER,data:{name:a,displayName:b}});for(var f=0,g;f<c.length;f+=C){g=c.slice(f,f+C);e.push({index:d+e.length,type:D.EMOJI,data:g})}return e},G=function(a){return a.map(function(a,b){return x({},a,{index:b})})},H=function(a){return a.reduce(function(a,b,c){if(b.type===D.HEADER){a[b.data.name]=c*B}return a},{})},I=function(){var a=v(regeneratorRuntime.mark(function a(b,c){var d,e,g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d={index:b,text:c};a.next=3;return(0,f.render)("core/emoji/header_row",d);case 3:e=a.sent;g=document.createElement("div");g.innerHTML=e;return a.abrupt("return",g.firstChild);case 7:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),J=function(){var a=v(regeneratorRuntime.mark(function a(b,c){var d,e,g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d={index:b,emojis:c.map(function(a){var b=a.unified.split("-").map(function(a){return"0x".concat(a)}),c=String.fromCodePoint.apply(null,b);return{shortnames:":".concat(a.shortnames.join(": :"),":"),unified:a.unified,text:c,spacer:!1}}),spacers:Array(C-c.length).fill(!0)};a.next=3;return(0,f.render)("core/emoji/emoji_row",d);case 3:e=a.sent;g=document.createElement("div");g.innerHTML=e;return a.abrupt("return",g.firstChild);case 7:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),K=function(a){return null!==a.getAttribute("data-short-names")},L=function(a){if(!a){return null}if("show-category"===a.getAttribute("data-action")){return a}else{return L(a.parentElement)}},M=function(a,b){return a.querySelector("[data-category=\"".concat(b,"\"]"))},N=function(a,b){for(var c=a.querySelectorAll(E.CATEGORY_SELECTOR),d=0,e;d<c.length;d++){e=c[d];e.classList.remove("selected")}b.classList.add("selected")},O=function(a,b,c){var d=[];if(0>b){b=0}for(var i in c){var j=c[i];d.push([j,i])}d.sort(function(c,d){var e=o(c,1),f=e[0],a=o(d,1),g=a[0];if(f<g){return-1}else if(f>g){return 1}else{return 0}});var e=d.reduce(function(a,c){var d=o(c,2),e=d[0],f=d[1];if(e<=b){a.categoryName=f;a.previousPosition=a.currentPosition;a.currentPosition=b}else if(null===a.nextPosition){a.nextPosition=e}return a},{categoryName:null,currentPosition:null,previousPosition:null,nextPosition:null}),f=e.categoryName,g=e.previousPosition,h=e.nextPosition;return[M(a,f),g,h]},P=function(){var a=b.default.get(A);return a?JSON.parse(a):[]},Q=function(a){b.default.set(A,JSON.stringify(a))},R=function(a,b,c){var d=a[0].data.name,e=a[0].data.displayName,f=P(),g=[c].concat(k(f.filter(function(a){return a.unified!=c.unified})));g=g.slice(0,3*C);var h=F(d,e,g);Q(g);return[G(h.concat(a.slice(b))),h.length]},S=function(a,b,c){var d=a>B?Math.floor(a/B):0,e=d>=z?d-z:d,f=c.slice(e,d+b+z);return f},T=function(){var a=v(regeneratorRuntime.mark(function a(b){var c;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c=null;if(!(b.type===D.HEADER)){a.next=7;break}a.next=4;return I(b.index,b.data.displayName);case 4:c=a.sent;a.next=10;break;case 7:a.next=9;return J(b.index,b.data);case 9:c=a.sent;case 10:c.style.position="absolute";c.style.left=0;c.style.right=0;c.style.top="".concat(b.index*B,"px");return a.abrupt("return",c);case 15:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),U=function(c,a){if(c.index!==a.index){return!1}if(c.type!==a.type){return!1}if(j(c.data)!=j(a.data)){return!1}if(c.type===D.HEADER){return c.data.name===a.data.name}else{if(c.data.length!==a.data.length){return!1}for(var b=0;b<c.data.length;b++){if(c.data[b].unified!=a.data[b].unified){return!1}}}return!0},V=function(){var a=v(regeneratorRuntime.mark(function a(b,c,d){var e,f,g,h,i;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:e=d.filter(function(a){return!c.some(function(b){return U(b,a)})});f=c.filter(function(a){return d.some(function(b){return U(a,b)})});g=c.filter(function(a){return!d.some(function(b){return U(a,b)})});h=g.map(function(a){return b.querySelectorAll("[data-row=\"".concat(a.index,"\"]"))});a.next=6;return Promise.all(e.map(function(a){return T(a)}));case 6:i=a.sent;i.forEach(function(a,c){for(var d=e[c],g=null,h=0,j;h<f.length;h++){j=f[h];if(j.index>d.index){g=h;break}}if(null!==g){var k=f[g],l=b.querySelector("[data-row=\"".concat(k.index,"\"]"));b.insertBefore(a,l);f.splice(g,0,f)}else{f.push(d);b.appendChild(a)}});h.forEach(function(a){for(var c=0,d;c<a.length;c++){d=a[c];b.removeChild(d)}});case 9:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),W=function(a){var b=[],c=[],d=0,e=!1,f=function(){var d=v(regeneratorRuntime.mark(function d(){var g;return regeneratorRuntime.wrap(function(d){while(1){switch(d.prev=d.next){case 0:if(c.length){d.next=2;break}return d.abrupt("return");case 2:if(!e){d.next=4;break}return d.abrupt("return");case 4:e=!0;g=c.slice();c=[];d.next=9;return V(a,b,g);case 9:b=g;e=!1;f();case 12:case"end":return d.stop();}}},d)}));return function(){return d.apply(this,arguments)}}();return function(b,e){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:10;c=S(b,g,e);f();if(d!==e.length){a.style.height="".concat(e.length*B,"px")}d=e.length}},X=function(a,b){b.classList.remove("hidden");a.classList.add("hidden")},Y=function(a,b,c){b.classList.add("hidden");a.classList.remove("hidden");c.value=""},Z=function(a,b){return function(c){var d=c.target;if(K(d)){b.textContent=d.getAttribute("data-short-names");a.textContent=d.textContent}}},$=function(a,b){return function(c){var d=c.target;if(K(d)){b.textContent="";a.textContent=""}}},_=function(a,b,c,d,e,f){return function(g,h,i){var j=g.target,k=h,l=i;Y(b,c,d);if(K(j)){var m=j.getAttribute("data-unified"),n=j.getAttribute("data-short-names").replace(/:/g,"").split(" "),p=b.scrollTop,q=null!==b.querySelector("[data-row=\"".concat(a-1,"\"]")),r=R(h,a,{unified:m,shortnames:n}),s=o(r,2);k=s[0];a=s[1];l=H(k);if(q){f(p,k)}e(j.textContent);return[k,l]}var t=L(j);if(t){var u=t.getAttribute("data-category"),v=i[u];b.scrollTop=v}return[k,l]}},aa=function(a,b,c,d,e){var f=O(a,c.scrollTop,d),g=o(f,3),h=g[0],i=g[1],j=g[2];return function(d,f){var g=c.scrollTop,k=b+B,l=b-B,m=g>=j||g<i;if(m){var n=O(a,g,d),p=o(n,3);h=p[0];i=p[1];j=p[2];N(a,h)}if(g<l||g>k){requestAnimationFrame(function(){e(g,f);b=g})}}},ba=function(a,b,d){var f=b.querySelector(E.ROW_CONTAINER),g=W(f);b.appendChild(f);return v(regeneratorRuntime.mark(function f(){var h,i,j,k;return regeneratorRuntime.wrap(function(f){while(1){switch(f.prev=f.next){case 0:h=a.value.toLowerCase();if(!h){f.next=11;break}X(d,b);i=Object.keys(c.byShortName).reduce(function(a,b){if(b.includes(h)){a.push({shortnames:[b],unified:c.byShortName[b]})}return a},[]);f.next=6;return(0,e.get_string)("searchresults","core");case 6:j=f.sent;k=F(j,j,i,0);g(0,k,k.length);f.next=12;break;case 11:Y(d,b,a);case 12:case"end":return f.stop();}}},f)}))},ca=function(a,b,c,e,f,g,h,i){var j=a.querySelector(E.SEARCH_INPUT),k=a.querySelector(E.SEARCH_RESULTS_CONTAINER),l=a.querySelector(E.EMOJI_PREVIEW),m=a.querySelector(E.EMOJI_SHORT_NAME),n=_(i,b,k,j,f,c),p=aa(a,e,b,g,c),q=ba(j,k,b);a.addEventListener("focus",Z(l,m),!0);a.addEventListener("blur",$(l,m),!0);a.addEventListener("mouseenter",Z(l,m),!0);a.addEventListener("mouseleave",$(l,m),!0);a.addEventListener("click",function(a){var b=n(a,h,g),c=o(b,2);h=c[0];g=c[1]});b.addEventListener("scroll",(0,d.throttle)(function(){return p(g,h)},50));j.addEventListener("input",(0,d.debounce)(q,200))},da=function(a,b){var d=a.querySelector(E.EMOJIS_CONTAINER),e=d.querySelector(E.ROW_CONTAINER),f=P(),g=[{name:"Recent",emojis:f}].concat(k(c.byCategory)),h=[],i=0;g.forEach(function(b){var c=M(a,b.name),d=c.title,e=F(b.name,d,b.emojis,h.length);if("Recent"===b.name){i=e.length}h=h.concat(e)});h=G(h);var j=H(h),l=W(e);l(0,h);ca(a,d,l,0,b,j,h,i)};a.default=da;return a.default});
define ("core/tooltip",["jquery","core/aria"],function(a,b){var c=function(b){this._regionSelector=b;a(this._regionSelector).each(function(b,c){var d=a(c).attr("aria-describedby");if(d){var e=document.getElementById(d);if(e){var f="tooltip"==a(e).attr("role");if(f){a(e).hide();a(c).attr("tabindex","0")}a(c).on("focus",this._handleFocus.bind(this));a(c).on("mouseover",this._handleMouseOver.bind(this));a(c).on("mouseout",this._handleMouseOut.bind(this));a(c).on("blur",this._handleBlur.bind(this));a(c).on("keydown",this._handleKeyDown.bind(this))}}}.bind(this))};c.prototype._regionSelector=null;c.prototype._showTooltip=function(c){var d=a(c.target),e=d.attr("aria-describedby");if(e){var f=a(document.getElementById(e));f.show();b.unhide(f);if(!f.is(".tooltip")){var g=a("<div class=\"tooltip-inner\"></div>");g.append(f.contents());f.append(g);f.addClass("tooltip");f.addClass("bottom");f.append("<div class=\"tooltip-arrow\"></div>")}var h=d.offset();h.top+=d.height()+10;a(f).offset(h)}};c.prototype._hideTooltip=function(c){var d=a(c.target),e=d.attr("aria-describedby");if(e){var f=document.getElementById(e);a(f).hide();b.hide(f)}};c.prototype._handleFocus=function(a){this._showTooltip(a)};c.prototype._handleKeyDown=function(a){if(27==a.which){this._hideTooltip(a)}};c.prototype._handleMouseOver=function(a){this._showTooltip(a)};c.prototype._handleMouseOut=function(b){var c=a(b.target);if(!c.is(":focus")){this._hideTooltip(b)}};c.prototype._handleBlur=function(a){this._hideTooltip(a)};return c});
define ("core/storagewrapper",["core/config"],function(a){var b=function(b){this.storage=b;this.supported=this.detectSupport();this.hashSource=a.wwwroot+"/"+a.jsrev;this.hash=this.hashString(this.hashSource);this.prefix=this.hash+"/";this.jsrevPrefix=this.hashString(a.wwwroot)+"/jsrev";this.validateCache()};b.prototype.detectSupport=function(){if(-1==a.jsrev){return!1}if("undefined"==typeof this.storage){return!1}try{if(null===this.storage){return!1}this.storage.setItem("test","1");this.storage.removeItem("test");return!0}catch(a){return!1}};b.prototype.prefixKey=function(a){return this.prefix+a};b.prototype.validateCache=function(){var b=this.storage.getItem(this.jsrevPrefix);if(null===b){this.storage.setItem(this.jsrevPrefix,a.jsrev);return}var c=a.jsrev;if(c!=b){this.storage.clear();this.storage.setItem(this.jsrevPrefix,a.jsrev)}};b.prototype.hashString=function(a){var b=0,c,d,e;if(0===a.length){return b}for(c=0,e=a.length;c<e;c++){d=a.charCodeAt(c);b=(b<<5)-b+d;b|=0}return b};b.prototype.get=function(a){if(!this.supported){return!1}a=this.prefixKey(a);return this.storage.getItem(a)};b.prototype.set=function(a,b){if(!this.supported){return!1}a=this.prefixKey(a);try{this.storage.setItem(a,b)}catch(a){return!1}return!0};return b});
define ("core/str",["exports","jquery","core/ajax","core/localstorage"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.cache_strings=a.get_strings=a.get_string=void 0;b=e(b);c=e(c);d=e(d);function e(a){return a&&a.__esModule?a:{default:a}}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}var i=[];a.get_string=function get_string(a,b,c,d){return j([{key:a,component:b,param:c,lang:d}]).then(function(a){return a[0]})};var j=function(a){var e=[],f=(0,b.default)("html").attr("lang").replace(/-/g,"_"),j=function(a){var b=a.key,c=a.component,d=a.lang,e=void 0===d?f:d;if(!c){c="core"}return"core_str/".concat(b,"/").concat(c,"/").concat(e)},k=a.map(function(a){var b=j(a),c=a.component,k=a.key,l=a.param,m=a.lang,n=void 0===m?f:m,o=function(a){i[b]=a;return a};if(c in M.str&&k in M.str[c]){return o(new Promise(function(a){a(M.util.get_string(k,c,l,n))}))}var p=d.default.get(b);if(p){M.str[c]=g({},M.str[c],h({},k,p));return o(new Promise(function(a){a(M.util.get_string(k,c,l,n))}))}if(b in i){return o(i[b]).then(function(){return M.util.get_string(k,c,l,n)})}else{return o(new Promise(function(a,f){e.push({methodname:"core_get_string",args:{stringid:k,stringparams:[],component:c,lang:n},done:function done(e){M.str[c]=g({},M.str[c],h({},k,e));d.default.set(b,e);a(M.util.get_string(k,c,l,n))},fail:f})}))}});if(e.length){c.default.call(e,!0,!1,!1,0,M.cfg.langrev)}return b.default.when.apply(b.default,k).then(function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++){b[c]=arguments[c]}return b})};a.get_strings=j;var k=function(a){var c=(0,b.default)("html").attr("lang").replace(/-/g,"_");a.forEach(function(a){var e=a.key,f=a.component,g=a.value,h=a.lang,j=void 0===h?c:h,k=["core_str",e,f,j].join("/");if(!(f in M.str)||!(e in M.str[f])){if(!(f in M.str)){M.str[f]={}}M.str[f][e]=g}if(!d.default.get(k)){d.default.set(k,g)}if(!(k in i)){i[k]=b.default.Deferred().resolve(g).promise()}})};a.cache_strings=k});
define ("core/tree",["jquery"],function(a){var b={ITEM:"[role=treeitem]",GROUP:"[role=treeitem]:has([role=group]), [role=treeitem][aria-owns], [role=treeitem][data-requires-ajax=true]",CLOSED_GROUP:"[role=treeitem]:has([role=group])[aria-expanded=false], [role=treeitem][aria-owns][aria-expanded=false], [role=treeitem][data-requires-ajax=true][aria-expanded=false]",FIRST_ITEM:"[role=treeitem]:first",VISIBLE_ITEM:"[role=treeitem]:visible",UNLOADED_AJAX_ITEM:"[role=treeitem][data-requires-ajax=true][data-loaded=false][aria-expanded=true]"},c=function(c,d){this.treeRoot=a(c);this.treeRoot.data("activeItem",null);this.selectCallback=d;this.keys={tab:9,enter:13,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,asterisk:106};this.initialiseNodes(this.treeRoot);this.setActiveItem(this.treeRoot.find(b.FIRST_ITEM));this.refreshVisibleItemsCache();this.bindEventHandlers()};c.prototype.registerEnterCallback=function(a){this.enterCallback=a};c.prototype.refreshVisibleItemsCache=function(){this.treeRoot.data("visibleItems",this.treeRoot.find(b.VISIBLE_ITEM))};c.prototype.getVisibleItems=function(){return this.treeRoot.data("visibleItems")};c.prototype.setActiveItem=function(a){var b=this.treeRoot.data("activeItem");if(a===b){return}if(b){b.attr("tabindex","-1");b.attr("aria-selected","false")}a.attr("tabindex","0");a.attr("aria-selected","true");this.treeRoot.data("activeItem",a);if("function"==typeof this.selectCallback){this.selectCallback(a)}};c.prototype.isGroupItem=function(a){return a.is(b.GROUP)};c.prototype.getGroupFromItem=function(a){var b=this.treeRoot.find("#"+a.attr("aria-owns")),c=a.children("[role=group]");if(b.length>c.length){return b}else{return c}};c.prototype.isGroupCollapsed=function(a){return"false"===a.attr("aria-expanded")};c.prototype.isGroupCollapsible=function(a){return"false"!==a.attr("data-collapsible")};c.prototype.initialiseNodes=function(c){this.removeAllFromTabOrder(c);this.setAriaSelectedFalseOnItems(c);var d=this;c.find(b.UNLOADED_AJAX_ITEM).each(function(){var b=a(this);d.collapseGroup(b);d.expandGroup(b)})};c.prototype.removeAllFromTabOrder=function(b){b.find("*").attr("tabindex","-1");this.getGroupFromItem(a(b)).find("*").attr("tabindex","-1")};c.prototype.setAriaSelectedFalseOnItems=function(a){a.find(b.ITEM).attr("aria-selected","false")};c.prototype.expandAllGroups=function(){var c=this;this.treeRoot.find(b.CLOSED_GROUP).each(function(){var b=a(this);c.expandGroup(a(this)).done(function(){c.expandAllChildGroups(b)})})};c.prototype.expandAllChildGroups=function(c){var d=this;this.getGroupFromItem(c).find(b.CLOSED_GROUP).each(function(){var b=a(this);d.expandGroup(a(this)).done(function(){d.expandAllChildGroups(b)})})};c.prototype.expandGroup=function(b){var c=a.Deferred();if("false"!==b.attr("data-expandable")&&this.isGroupCollapsed(b)){if("true"===b.attr("data-requires-ajax")&&"true"!==b.attr("data-loaded")){b.attr("data-loaded",!1);var d=b.closest("[data-ajax-loader]").attr("data-ajax-loader"),e=this,f=b.find("p");f.addClass("loading");require([d],function(a){a.load(b).done(function(){b.attr("data-loaded",!0);e.initialiseNodes(b);e.finishExpandingGroup(b);f.removeClass("loading");c.resolve()})})}else{this.finishExpandingGroup(b);c.resolve()}}else{c.resolve()}return c};c.prototype.finishExpandingGroup=function(a){var b=this.getGroupFromItem(a);b.removeAttr("aria-hidden");a.attr("aria-expanded","true");this.refreshVisibleItemsCache()};c.prototype.collapseGroup=function(a){if(!this.isGroupCollapsible(a)||this.isGroupCollapsed(a)){return}var b=this.getGroupFromItem(a);b.attr("aria-hidden","true");a.attr("aria-expanded","false");this.refreshVisibleItemsCache()};c.prototype.toggleGroup=function(a){if("true"===a.attr("aria-expanded")){this.collapseGroup(a)}else{this.expandGroup(a)}};c.prototype.handleKeyDown=function(c){var d=a(c.target),e=this.getVisibleItems().index(d);if(c.altKey||c.ctrlKey||c.metaKey||c.shiftKey&&c.keyCode!=this.keys.tab){return}switch(c.keyCode){case this.keys.home:{this.getVisibleItems().first().focus();c.preventDefault();return}case this.keys.end:{this.getVisibleItems().last().focus();c.preventDefault();return}case this.keys.enter:{var f=d.children("a").length?d.children("a"):d.children().not(b.GROUP).find("a");if(f.length){if(f.first().data("overrides-tree-activation-key-handler")){f.first().triggerHandler(c)}else if("function"==typeof this.enterCallback){this.enterCallback(d)}else{window.location.href=f.first().attr("href")}}else if(this.isGroupItem(d)){this.toggleGroup(d,!0)}c.preventDefault();return}case this.keys.space:{if(this.isGroupItem(d)){this.toggleGroup(d,!0)}else if(d.children("a").length){var g=d.children("a").first();if(g.data("overrides-tree-activation-key-handler")){g.triggerHandler(c)}}c.preventDefault();return}case this.keys.left:{var h=function(b){b.getVisibleItems().filter(function(){return b.getGroupFromItem(a(this)).has(d).length}).focus()};if(this.isGroupItem(d)){if(this.isGroupCollapsed(d)){h(this)}else{this.collapseGroup(d)}}else{h(this)}c.preventDefault();return}case this.keys.right:{if(this.isGroupItem(d)){if(this.isGroupCollapsed(d)){this.expandGroup(d)}else{this.getGroupFromItem(d).find(b.ITEM).first().focus()}}c.preventDefault();return}case this.keys.up:{if(0<e){var i=this.getVisibleItems().eq(e-1);i.focus()}c.preventDefault();return}case this.keys.down:{if(e<this.getVisibleItems().length-1){var j=this.getVisibleItems().eq(e+1);j.focus()}c.preventDefault();return}case this.keys.asterisk:{this.expandAllGroups();c.preventDefault()}}};c.prototype.handleClick=function(b){if(b.altKey||b.ctrlKey||b.shiftKey||b.metaKey){return}var c=a(b.target).closest("[role=\"treeitem\"]");if(!c.is(b.currentTarget)){return}c.focus();if(this.isGroupItem(c)){this.toggleGroup(c)}};c.prototype.handleFocus=function(b){this.setActiveItem(a(b.target))};c.prototype.bindEventHandlers=function(){this.treeRoot.on({click:this.handleClick.bind(this),keydown:this.handleKeyDown.bind(this),focus:this.handleFocus.bind(this)},b.ITEM)};return c});
define ("core/fragment",["jquery","core/ajax"],function(a,b){var c=function loadFragment(a,c,d,e){var f=[];for(var g in e){f.push({name:g,value:e[g]})}return b.call([{methodname:"core_get_fragment",args:{component:a,callback:c,contextid:d,args:f}}])[0]};return{loadFragment:function loadFragment(b,d,e,f){var g=a.Deferred();c(b,d,e,f).then(function(b){var c=a(b.javascript),d="";c.each(function(b,c){c=a(c);var e=c.prop("tagName");if(e&&"script"==e.toLowerCase()){if(c.attr("src")){var f=!1;a("script").each(function(b,d){if(a(d).attr("src")==c.attr("src")){f=!0}return!f});if(!f){d+=" { ";d+=" node = document.createElement(\"script\"); ";d+=" node.type = \"text/javascript\"; ";d+=" node.src = decodeURI(\""+encodeURI(c.attr("src"))+"\"); ";d+=" document.getElementsByTagName(\"head\")[0].appendChild(node); ";d+=" } "}}else{d+=" "+c.text()}}});g.resolve(b.html,d)}).fail(function(a){g.reject(a)});return g.promise()}}});
define ("core/permissionmanager",["jquery","core/config","core/notification","core/templates","core/yui"],function(a,b,c,d,e){var f={ADDROLE:"a.allowlink, a.prohibitlink",REMOVEROLE:"a.preventlink, a.unprohibitlink",UNPROHIBIT:"a.unprohibitlink"},g=a.Event("rolesloaded"),h,j,k,l,m=null,n=function loadOverideableRoles(){var d={contextid:h,getroles:1,sesskey:b.sesskey};a.post(k+"roles/ajax.php",d,null,"json").done(function(b){try{l=b;n=function loadOverideableRoles(){a("body").trigger(g)};n()}catch(a){c.exception(a)}}).fail(function(a,b,d){c.exception(d)})},o=function(b,e,f){var g={contextid:h,roleid:e,sesskey:M.cfg.sesskey,action:f,capability:b.data("name")};a.post(k+"roles/ajax.php",g,null,"json").done(function(f){var g=f;try{var h={rolename:l[e],roleid:e,adminurl:k,imageurl:M.util.image_url("t/delete","moodle")};switch(g){case"allow":h.spanclass="allowed";h.linkclass="preventlink";h.action="prevent";h.icon="t/delete";h.iconalt=M.util.get_string("deletexrole","core_role",l[e]);break;case"prohibit":h.spanclass="forbidden";h.linkclass="unprohibitlink";h.action="unprohibit";h.icon="t/delete";h.iconalt=M.util.get_string("deletexrole","core_role",l[e]);break;case"prevent":b.find("a[data-role-id=\""+e+"\"]").first().closest(".allowed").remove();return;case"unprohibit":b.find("a[data-role-id=\""+e+"\"]").first().closest(".forbidden").remove();return;default:return;}d.render("core/permissionmanager_role",h).done(function(c){if("allow"==g){a(c).insertBefore(b.find(".allowmore").first())}else if("prohibit"==g){a(c).insertBefore(b.find(".prohibitmore").first());var d=b.find(".allowedroles").first().find("a[data-role-id=\""+e+"\"]");if(d){d.first().closest(".allowed").remove()}}m.hide()}).fail(c.exception)}catch(a){c.exception(a)}}).fail(function(a,b,d){c.exception(d)})},p=function(b){b.preventDefault();var g=a(b.currentTarget);a("body").one("rolesloaded",function(){e.use("moodle-core-notification-dialogue",function(){var b=g.data("action"),h=g.closest("tr.rolecap"),k={cap:h.data("humanname"),context:j},n=M.util.get_string("role"+b+"info","core_role",k);if(null===m){m=new M.core.dialogue({draggable:!0,modal:!0,closeButton:!0,width:"450px"})}m.set("headerContent",M.util.get_string("role"+b+"header","core_role"));var p,e,q=[];switch(b){case"allow":e=h.find(f.REMOVEROLE);break;case"prohibit":e=h.find(f.UNPROHIBIT);break;}for(p in l){var r="",s=e.filter("[data-role-id='"+p+"']").length;if(s){r="disabled"}var t={roleid:p,rolename:l[p],disabled:r};q.push(t)}d.render("core/permissionmanager_panelcontent",{message:n,roles:q}).done(function(c){m.set("bodyContent",c);m.show();a("div.role_buttons").on("click","button",function(c){var d=a(c.currentTarget).data("role-id");o(h,d,b)})}).fail(c.exception)})});n()},q=function(b){b.preventDefault();var d=a(b.currentTarget);a("body").one("rolesloaded",function(){var a=d.data("action"),b=d.data("role-id"),e=d.closest("tr.rolecap"),f={role:l[b],cap:e.data("humanname"),context:j};c.confirm(M.util.get_string("confirmunassigntitle","core_role"),M.util.get_string("confirmrole"+a,"core_role",f),M.util.get_string("confirmunassignyes","core_role"),M.util.get_string("confirmunassignno","core_role"),function(){o(e,b,a)})});n()};return{initialize:function initialize(b){h=b.contextid;j=b.contextname;k=b.adminurl;var c=a("body");c.on("click",f.ADDROLE,p);c.on("click",f.REMOVEROLE,q)}}});
define ("core/form-course-selector",["core/ajax","jquery"],function(a,b){return{processResults:function processResults(a,c){var d=[],e=0,f=(b(a).data("exclude")+"").split(",");for(e=0;e<c.courses.length;e++){if(-1===f.indexOf(c.courses[e].id+"")){d.push({value:c.courses[e].id,label:c.courses[e].displayname})}}return d},transport:function transport(c,d,e,f){var g=b(c),h=g.data("requiredcapabilities");if(""!==h.trim()){h=h.split(",")}else{h=[]}var i=g.data("limittoenrolled"),j=g.data("includefrontpage"),k=g.data("onlywithcompletion"),l=null;if("undefined"==typeof d){d=""}var m={criterianame:"search",criteriavalue:d,page:0,perpage:100,requiredcapabilities:h,limittoenrolled:i,onlywithcompletion:k},n=[{methodname:"core_course_search_courses",args:m}];if(j){n.push({methodname:"core_course_get_courses",args:{options:{ids:[j]}}})}l=a.call(n);b.when.apply(b.when,l).done(function(a,b){if(b&&1==b.length){var c=b.pop(),f=""===d||-1<c.fullname.toUpperCase().indexOf(d.toUpperCase())||-1<c.shortname.toUpperCase().indexOf(d.toUpperCase());if(f){a.courses.splice(0,0,c)}}e(a)}).fail(f)}}});
define ("core/auto_rows",["jquery"],function(a){var b={ELEMENT:"[data-auto-rows]"},c={ROW_CHANGE:"autorows:rowchange"},d=function(a){var b=a.attr("rows"),c=a.data("min-rows"),d=a.attr("data-max-rows"),e=a.height(),f=a.innerHeight(),g=a[0].scrollHeight,h=(g-(f-e))/(e/b);a.css("height","");if(h<c){return c}else if(d&&h>=d){return d}else{return h}},e=function(b){var e=a(b.target),f=e.data("min-rows"),g=e.attr("rows");if("undefined"==typeof f){e.data("min-rows",g)}e.attr("rows",1);var h=d(e);e.attr("rows",h);if(h!=g){e.trigger(c.ROW_CHANGE)}};return{init:function init(c){if(a(c).data("auto-rows")){a(c).on("input propertychange",e.bind(this))}else{a(c).on("input propertychange",b.ELEMENT,e.bind(this))}},events:c}});
define ("core/paged_content_paging_dropdown",["jquery","core/custom_interaction_events","core/paged_content_events","core/pubsub"],function(a,b,c,d){var f={ROOT:"[data-region=\"paging-dropdown-container\"]",DROPDOWN_ITEM:"[data-region=\"dropdown-item\"]",DROPDOWN_TOGGLE:"[data-region=\"dropdown-toggle\"]",ACTIVE_DROPDOWN_ITEM:"[data-region=\"dropdown-item\"].active",CARET:"[data-region=\"caret\"]"},g=function(a){return parseInt(a.attr("data-page-number"),10)},h=function(a){return a.find(f.DROPDOWN_ITEM)},i=function(b,c){var d=g(c);return h(b).filter(function(b,c){return g(a(c))<d})},j=function(a){return parseInt(a.attr("data-item-count"),10)},k=function(b,c){if(c.attr("data-offset")!=void 0){return parseInt(c.attr("data-offset"),10)}var d=0;i(b,c).each(function(b,c){c=a(c);d+=j(c)});c.attr("data-offset",d);return d},l=function(a){return a.find(f.ACTIVE_DROPDOWN_ITEM)},m=function(b,c){return c.map(function(c,d){d=a(d);return{pageNumber:g(d),limit:j(d),offset:k(b,d)}}).get()},n=function(b){b.each(function(b,c){c=a(c);c.attr("data-page-number",b+1)})},o=function(a,b,e){var g=i(a,b),h=g.add(b),j=m(a,h),k=a.find(f.DROPDOWN_TOGGLE),n=k.find(f.CARET);l(a).removeClass("active");b.addClass("active");k.html(b.text());k.append(n);d.publish(e+c.SHOW_PAGES,j)};return{init:function init(c,d){c=a(c);var e=h(c);n(e);var g=l(c);if(g.length){o(c,g,d)}b.define(c,[b.events.activate]);c.on(b.events.activate,f.DROPDOWN_ITEM,function(b,e){var g=a(b.target).closest(f.DROPDOWN_ITEM);o(c,g,d);e.originalEvent.preventDefault()})},rootSelector:f.ROOT}});
define ("core/url",["jquery","core/config"],function(a,b){return{fileUrl:function fileUrl(a,c){var d=b.wwwroot+a;if("/"!=c.charAt(0)){c="/"+c}if(b.slasharguments){d+=c}else{d+="?file="+encodeURIComponent(c)}return d},relativeUrl:function relativeUrl(c,d,e){if(0===c.indexOf("http:")||0===c.indexOf("https:")||0<=c.indexOf("://")){throw new Error("relativeUrl function does not accept absolute urls")}if("/"!=c.charAt(0)){c="/"+c}if("admin"!==b.admin){c=c.replace(/^\/admin\//,"/"+b.admin+"/")}d=d||{};if(e){d.sesskey=b.sesskey}var f="";if(Object.keys(d).length){f=a.map(d,function(a,b){return b+"="+a}).join("&")}if(""!==f){return b.wwwroot+c+"?"+f}else{return b.wwwroot+c}},imageUrl:function imageUrl(a,b){return M.util.image_url(a,b)}}});
define ("core/icon_system_standard",["core/icon_system","core/url","core/mustache"],function(a,b,c){var d=function(){a.apply(this,arguments)};d.prototype=Object.create(a.prototype);d.prototype.renderIcon=function(a,d,e,f){var g=b.imageUrl(a,d),h={attributes:[{name:"src",value:g},{name:"alt",value:e},{name:"title",value:e}]};if("undefined"==typeof e||""==e){h.attributes.push({name:"aria-hidden",value:"true"})}var i=c.render(f,h);return i.trim()};d.prototype.getTemplateName=function(){return"core/pix_icon"};return d});
define ("core/truncate",["jquery"],function(a){var b=function(a,b){var c=a+"",d=c.length,e=b?+b:0;if(e!=e){e=0}if(-1>=e||e>=d){return""}e=0|e;var f=c.charCodeAt(e),g,h=e+1,i=1;if(55296<=f&&56319>=f&&d>h){g=c.charCodeAt(h);if(56320<=g&&57343>=g){i=2}}return i},c=function(a){for(var c=0,d=0;d<a.length;d+=b(a,d)){c++}return c},d=function(a,c){if(!a.length){return 0}var d=0,e=0;do{d+=b(a,d);e++}while(d<a.length&&e<c);return d};a.truncate=function(b,c){return a("<div></div>").append(b).truncate(c).html()};a.fn.truncate=function(b){if(!isNaN(parseFloat(b)))b={length:b};var e=a.extend({},a.truncate.defaults,b);return this.each(function(){var b=a(this);if(e.noBreaks)b.find("br").replaceWith(" ");var f=e.ellipsis.length,g=b.text(),h=c(g),j=h-e.length+f;if(h<e.length)return;if(e.stripTags)b.text(g);if(e.words&&0<j){var k=g.slice(0,d(g,e.length-f)+1),l=k.replace(/(\s*\S+|\s)$/,""),m=c(l),n=k.match(/\s/)?!1:!0;if(e.keepFirstWord&&0===m){j=h-c(/^(\S*)/.exec(g)[0])-f}else if(n&&0===m){j=h-e.length+f}else{j=h-m-1}}if(j>h){j=h-e.length}if(0>j||!j&&!e.truncated)return;a.each(b.contents().get().reverse(),function(b,g){var h=a(g),i=h.text(),k=c(i);if(k<=j){e.truncated=!0;j-=k;h.remove();return}if(3===g.nodeType){var l=k-j;l=0<=l?d(i,l):0;a(g.splitText(l)).replaceWith(e.ellipsis);return!1}h.truncate(a.extend(e,{length:k-j+f}));return!1})})};a.truncate.defaults={stripTags:!1,words:!1,keepFirstWord:!1,noBreaks:!1,length:1/0,ellipsis:"\u2026"};return{truncate:a.truncate}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/drawer",["exports","jquery","core/pubsub","core/aria","core/drawer_events"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=h(b);c=g(c);d=g(d);e=h(e);function f(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;f=function(){return a};return a}function g(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=f();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var g=d?Object.getOwnPropertyDescriptor(a,e):null;if(g&&(g.get||g.set)){Object.defineProperty(c,e,g)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function h(a){return a&&a.__esModule?a:{default:a}}var i=function(a){a=(0,b.default)(a);d.unhide(a.get());a.removeClass("hidden");a.attr("aria-expanded",!0);a.focus();c.publish(e.default.DRAWER_SHOWN,a)},j=function(a){a=(0,b.default)(a);a.addClass("hidden");a.attr("aria-expanded",!1);d.hide(a.get());c.publish(e.default.DRAWER_HIDDEN,a)},k=function(a){var b=a.hasClass("hidden");return!b},l=function(a){if(k(a)){j(a)}else{i(a)}},m=function(a){a=(0,b.default)(a);return a.closest("[data-region=\"right-hand-drawer\"]")};a.default={hide:j,show:i,isVisible:k,toggle:l,registerToggles:function registerToggles(a,b){var c=null;b.attr("aria-expanded",k(a));b.on("click",function(d){d.preventDefault();var e=k(a);l(a);b.attr("aria-expanded",!e);if(!e){c=b.filter(function(a,b){return b==d.target||b.contains(d.target)})}else if(c){c.focus();c=null}})},getDrawerRoot:m};return a.default});
define ("core/custom_interaction_events",["jquery","core/key_codes"],function(a,b){var c={activate:"cie:activate",keyboardActivate:"cie:keyboardactivate",escape:"cie:escape",down:"cie:down",up:"cie:up",home:"cie:home",end:"cie:end",next:"cie:next",previous:"cie:previous",asterix:"cie:asterix",scrollLock:"cie:scrollLock",scrollTop:"cie:scrollTop",scrollBottom:"cie:scrollBottom",ctrlPageUp:"cie:ctrlPageUp",ctrlPageDown:"cie:ctrlPageDown",enter:"cie:enter",accessibleChange:"cie:accessibleChange"},d={},e=function(a,b){b=b||[];if(b.length&&-1!==b.indexOf(a)){return!0}return!1},f=function(a){return a.shiftKey||a.metaKey||a.altKey||a.ctrlKey},g=function(b,c){var e="";if(!c.hasOwnProperty("originalEvent")){e=""+b+c.type+c.timeStamp;if(!d.hasOwnProperty(e)){d[e]=!0;a(c.target).trigger(b,[{originalEvent:c}])}return}e="triggeredCustom_"+b;if(!c.originalEvent.hasOwnProperty(e)){c.originalEvent[e]=!0;a(c.target).trigger(b,[{originalEvent:c}])}},h=function(a,b,c){a.off("keydown."+b).on("keydown."+b,function(a){if(!f(a)){if(a.keyCode==c){g(b,a)}}})},i=function(a){a.off("click.cie.activate").on("click.cie.activate",function(a){g(c.activate,a)});a.off("keydown.cie.activate").on("keydown.cie.activate",function(a){if(!f(a)){if(a.keyCode==b.enter||a.keyCode==b.space){g(c.activate,a)}}})},j=function(a){a.off("keydown.cie.keyboardactivate").on("keydown.cie.keyboardactivate",function(a){if(!f(a)){if(a.keyCode==b.enter||a.keyCode==b.space){g(c.keyboardActivate,a)}}})},k=function(a){h(a,c.escape,b.escape)},l=function(a){h(a,c.down,b.arrowDown)},m=function(a){h(a,c.up,b.arrowUp)},n=function(a){h(a,c.home,b.home)},o=function(a){h(a,c.end,b.end)},p=function(d){var e="rtl"==a("html").attr("dir")?b.arrowLeft:b.arrowRight;h(d,c.next,e)},q=function(d){var e="rtl"==a("html").attr("dir")?b.arrowRight:b.arrowLeft;h(d,c.previous,e)},r=function(a){h(a,c.asterix,b.asterix)},s=function(a){a.off("scroll.cie.scrollTop").on("scroll.cie.scrollTop",function(b){var d=a.scrollTop();if(0===d){g(c.scrollTop,b)}})},t=function(a){a.off("scroll.cie.scrollBottom").on("scroll.cie.scrollBottom",function(b){var d=a.scrollTop(),e=a.innerHeight(),f=a[0].scrollHeight;if(d+e>=f){g(c.scrollBottom,b)}})},u=function(a){a.off("DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock").on("DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock",function(b){var d=a.scrollTop(),e=a[0].scrollHeight,f=a.height(),h="DOMMouseScroll"==b.type?-40*b.originalEvent.detail:b.originalEvent.wheelDelta,i=0<h;if(!i&&-h>e-f-d){a.scrollTop(e);b.stopPropagation();b.preventDefault();b.returnValue=!1;g(c.scrollLock,b);return!1}else if(i&&h>d){a.scrollTop(0);b.stopPropagation();b.preventDefault();b.returnValue=!1;g(c.scrollLock,b);return!1}return!0})},v=function(a){a.off("keydown.cie.ctrlpageup").on("keydown.cie.ctrlpageup",function(a){if(a.ctrlKey){if(a.keyCode==b.pageUp){g(c.ctrlPageUp,a)}}})},w=function(a){a.off("keydown.cie.ctrlpagedown").on("keydown.cie.ctrlpagedown",function(a){if(a.ctrlKey){if(a.keyCode==b.pageDown){g(c.ctrlPageDown,a)}}})},x=function(a){h(a,c.enter,b.enter)},y=function(a){var d=-1!==navigator.userAgent.indexOf("Macintosh"),e="ontouchstart"in window||"msMaxTouchPoints"in navigator&&0<navigator.msMaxTouchPoints;if(d||e){a.on("change",function(a){g(c.accessibleChange,a)})}else{var f=function(a){a.dataset.initValue=a.value},h=function(a){if("initValue"in a.dataset){a.value=a.dataset.initValue}},i=function(a){if(!("initValue"in a.target.dataset)){return}if(a.target.value!==a.target.dataset.initValue){a.target.dataset.initValue=a.target.value;g(c.accessibleChange,a)}},j=a.get()[0];j.addEventListener("focus",function(a){f(a.target)},!0);j.addEventListener("blur",function(a){i(a)},!0);a.on("keydown",function(a){if(a.which===b.enter){i(a)}else if(a.which===b.escape){h(a.target);a.target.dataset.ignoreChange=!0}else{a.target.dataset.ignoreChange=!0}});a.on("change",function(a){if(a.target.dataset.ignoreChange){return}i(a)});a.on("keyup",function(a){delete a.target.dataset.ignoreChange});a.on("click",function(a){i(a)})}},z=function(){var a={};a[c.activate]=i;a[c.keyboardActivate]=j;a[c.escape]=k;a[c.down]=l;a[c.up]=m;a[c.home]=n;a[c.end]=o;a[c.next]=p;a[c.previous]=q;a[c.asterix]=r;a[c.scrollLock]=u;a[c.scrollTop]=s;a[c.scrollBottom]=t;a[c.ctrlPageUp]=v;a[c.ctrlPageDown]=w;a[c.enter]=x;a[c.accessibleChange]=y;return a};return{define:function define(b,c){b=a(b);c=c||[];if(!b.length||!c.length){return}a.each(z(),function(a,d){if(e(a,c)){d(b)}})},events:c}});
define ("core/paged_content_pages",["jquery","core/templates","core/notification","core/pubsub","core/paged_content_events","core/pending"],function(a,b,c,d,e,f){var g={ROOT:"[data-region=\"page-container\"]",PAGE_REGION:"[data-region=\"paged-content-page\"]",ACTIVE_PAGE_REGION:"[data-region=\"paged-content-page\"].active"},h={PAGING_CONTENT_ITEM:"core/paged_content_page",LOADING:"core/overlay_loading"},i=function(a,b){return a.find("[data-page=\""+b+"\"]")},j=function(d){var e=a.Deferred();d.attr("aria-busy",!0);var g=new f("core/paged_content_pages:startLoading");b.render(h.LOADING,{visible:!0}).then(function(b){var c=a(b),f=setTimeout(function(){d.css("position","relative");c.appendTo(d)},300);e.always(function(){clearTimeout(f);c.remove();d.css("position","");d.removeAttr("aria-busy");g.resolve()})}).fail(c.exception);return e},k=function(d,e,f){var g=a.Deferred();e.then(function(a,e){e=e||"";b.render(h.PAGING_CONTENT_ITEM,{page:f,content:a}).then(function(a){b.appendNodeContents(d,a,e);var c=i(d,f);g.resolve(c)}).fail(function(a){g.reject(a)}).fail(c.exception)}).fail(function(a){g.reject(a)}).fail(c.exception);return g.promise()},l=function(b,h,l,m){var n=new f("core/paged_content_pages:showPages"),o=[],p=[],q=a.Deferred();h.forEach(function(a){var c=a.pageNumber,d=i(b,c);if(d.length){o.push(d)}else{p.push(a)}});if(p.length&&"function"==typeof m){var r=m(p,{allItemsLoaded:function allItemsLoaded(a){d.publish(l+e.ALL_ITEMS_LOADED,a)}}),s=r.map(function(a,c){return k(b,a,p[c].pageNumber)});a.when.apply(a,s).then(function(){var a=Array.prototype.slice.call(arguments);q.resolve(a)}).fail(function(a){q.reject(a)}).fail(c.exception)}else{q.resolve([])}var t=j(b);q.then(function(a){var c=o.concat(a);b.find(g.PAGE_REGION).addClass("hidden");c.forEach(function(a){if(!0){a.removeClass("hidden")}})}).then(function(){d.publish(l+e.PAGES_SHOWN,h)}).fail(c.exception).always(function(){t.resolve();n.resolve()}).catch()};return{init:function init(b,c,f){b=a(b);d.subscribe(c+e.SHOW_PAGES,function(a){l(b,a,c,f)});d.subscribe(c+e.SET_ITEMS_PER_PAGE_LIMIT,function(){b.empty()})},rootSelector:g.ROOT}});
define ("core/chartjs",["core/chartjs-lazy"],function(a){return a});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/chart_series",[],function(){function a(a,b){if("string"!=typeof a){throw new Error("Invalid label for series.")}else if("object"!==_typeof(b)){throw new Error("Values for a series must be an array.")}else if(1>b.length){throw new Error("Invalid values received for series.")}this._colors=[];this._label=a;this._values=b}a.prototype.TYPE_DEFAULT=null;a.prototype.TYPE_LINE="line";a.prototype._colors=null;a.prototype._fill=!1;a.prototype._label=null;a.prototype._labels=null;a.prototype._smooth=!1;a.prototype._type=a.prototype.TYPE_DEFAULT;a.prototype._values=null;a.prototype._xaxis=null;a.prototype._yaxis=null;a.prototype.create=function(b){var c=new a(b.label,b.values);c.setType(b.type);c.setXAxis(b.axes.x);c.setYAxis(b.axes.y);c.setLabels(b.labels);if(b.colors&&1<b.colors.length){c.setColors(b.colors)}else{c.setColor(b.colors[0])}c.setFill(b.fill);c.setSmooth(b.smooth);return c};a.prototype.getColor=function(){return this._colors[0]||null};a.prototype.getColors=function(){return this._colors};a.prototype.getCount=function(){return this._values.length};a.prototype.getFill=function(){return this._fill};a.prototype.getLabel=function(){return this._label};a.prototype.getLabels=function(){return this._labels};a.prototype.getSmooth=function(){return this._smooth};a.prototype.getType=function(){return this._type};a.prototype.getValues=function(){return this._values};a.prototype.getXAxis=function(){return this._xaxis};a.prototype.getYAxis=function(){return this._yaxis};a.prototype.hasColoredValues=function(){return this._colors.length==this.getCount()};a.prototype.setColor=function(a){this._colors=[a]};a.prototype.setColors=function(a){if(a&&a.length!=this.getCount()){throw new Error("When setting multiple colors there must be one per value.")}this._colors=a||[]};a.prototype.setFill=function(a){this._fill="undefined"==typeof a?null:a};a.prototype.setLabels=function(a){this._validateLabels(a);a="undefined"==typeof a?null:a;this._labels=a};a.prototype.setSmooth=function(a){a="undefined"==typeof a?null:a;this._smooth=a};a.prototype.setType=function(a){if(a!=this.TYPE_DEFAULT&&a!=this.TYPE_LINE){throw new Error("Invalid serie type.")}this._type=a||null};a.prototype.setXAxis=function(a){this._xaxis=a||null};a.prototype.setYAxis=function(a){this._yaxis=a||null};a.prototype._validateLabels=function(a){if(a&&0<a.length&&a.length!=this.getCount()){throw new Error("Series labels must match series values.")}};return a});
define ("core/log",["core/loglevel"],function(a){var b=a.methodFactory;a.methodFactory=function(a,c){var d=b(a,c);return function(a,b){if(b){d(b+": "+a)}else{d(a)}}};a.setConfig=function(b){if("undefined"!=typeof b.level){a.setLevel(b.level)}};return a});
function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(!a)return;if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return _arrayLikeToArray(a,b)}function _arrayLikeToArray(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function _iterableToArrayLimit(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function _arrayWithHoles(a){if(Array.isArray(a))return a}define ("core/modal_factory",["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_cancel","core/local/modal/alert","core/templates","core/notification","core/custom_interaction_events","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k){var l={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CANCEL:"core/modal_cancel",ALERT:"core/local/modal/alert"},m={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CANCEL:"CANCEL",ALERT:"ALERT"};c.register(m.DEFAULT,d,l.DEFAULT);c.register(m.SAVE_CANCEL,e,l.SAVE_CANCEL);c.register(m.CANCEL,f,l.CANCEL);c.register(m.ALERT,g,l.ALERT);var n=function(c,d,e){var f=null,g="function"==typeof e.preShowCallback,h=function(b,d){var h=new k("core/modal_factory:setUpTrigger:triggeredCallback");f=a(b.currentTarget);c.then(function(a){if(g){e.preShowCallback(f,a)}a.show();return a}).then(h.resolve);d.originalEvent.preventDefault()};if(Array.isArray(d)){var i=d[1];d=d[0];j.define(d,[j.events.activate]);d.on(j.events.activate,i,h)}else{j.define(d,[j.events.activate]);d.on(j.events.activate,h)}c.then(function(a){a.getRoot().on(b.hidden,function(){if(null!==f){f.focus()}});return a})},o=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},p=function(b,c){var d=b.template,e=h.render(d,c).then(function(c){var d=a(c);return o(b,d)}).fail(i.exception);return e};return{create:function create(a,b){var d=a.type||m.DEFAULT,e=a.large?!0:!1,f=a.hasOwnProperty("scrollable")?a.scrollable:!0,g=null,h={};g=c.get(d);if(!g){i.exception({message:"Unable to find modal of type: "+d})}if("undefined"!=typeof a.templateContext){h=a.templateContext}var j=p(g,h).then(function(b){if("undefined"!=typeof a.title){b.setTitle(a.title)}if("undefined"!=typeof a.body){b.setBody(a.body)}if("undefined"!=typeof a.footer){b.setFooter(a.footer)}if(a.buttons){Object.entries(a.buttons).forEach(function(a){var c=_slicedToArray(a,2),d=c[0],e=c[1];b.setButtonText(d,e)})}if(e){b.setLarge()}if("undefined"!=typeof a.removeOnClose){b.setRemoveOnClose(a.removeOnClose)}b.setScrollable(f);return b});if("undefined"!=typeof b){n(j,b,a)}return j},types:m}});
define ("core/modal_save_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function f(a,b,c){if(b)e(a.prototype,b);if(c)e(a,c);return a}function g(a,b,c){if("undefined"!=typeof Reflect&&Reflect.get){g=Reflect.get}else{g=function(a,b,c){var d=h(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(c)}return e.value}}return g(a,b,c||a)}function h(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=p(a);if(null===a)break}return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===c(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}var q=function(a){i(b,a);var c=k(b);function b(a){var e;d(this,b);e=c.call(this,a);if(!e.getFooter().find(e.getActionSelector("save")).length){Notification.exception({message:"No save button found"})}if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}f(b,[{key:"registerEventListeners",value:function registerEventListeners(){g(p(b.prototype),"registerEventListeners",this).call(this);this.registerCloseOnSave();this.registerCloseOnCancel()}},{key:"setFooter",value:function setFooter(){Notification.exception({message:"Can not change the footer of a save cancel modal"})}},{key:"setSaveButtonText",value:function setSaveButtonText(a){return this.setButtonText("save",a)}}]);return b}(b.default);a.default=q;return a.default});
define ("core/paged_content_events",[],function(){return{SHOW_PAGES:"core-paged-content-show-pages",PAGES_SHOWN:"core-paged-content-pages-shown",ALL_ITEMS_LOADED:"core-paged-content-all-items-loaded",SET_ITEMS_PER_PAGE_LIMIT:"core-paged-content-set-items-per-page-limit"}});
define ("core/toast",["exports","core/templates","core/notification","core/pending"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.add=a.addToastRegion=void 0;b=e(b);c=e(c);d=e(d);function e(a){return a&&a.__esModule?a:{default:a}}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function i(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function j(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){i(h,d,e,f,g,"next",a)}function g(a){i(h,d,e,f,g,"throw",a)}f(void 0)})}}var k=function(){var a=j(regeneratorRuntime.mark(function a(e){var f,g,h,i;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f=new d.default("addToastRegion");a.prev=1;a.next=4;return b.default.renderForPromise("core/local/toast/wrapper",{});case 4:g=a.sent;h=g.html;i=g.js;b.default.prependNodeContents(e,h,i);a.next=13;break;case 10:a.prev=10;a.t0=a["catch"](1);c.default.exception(a.t0);case 13:f.resolve();case 14:case"end":return a.stop();}}},a,null,[[1,10]])}));return function(){return a.apply(this,arguments)}}();a.addToastRegion=k;var l=function(){var a=j(regeneratorRuntime.mark(function a(e,f){var h,i,j,k,l,n;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:h=new d.default("addToastRegion");f=g({closeButton:!1,autohide:!0,delay:4e3},f);i="core/local/toast/message";a.prev=3;a.next=6;return m();case 6:j=a.sent;a.next=9;return b.default.renderForPromise(i,g({message:e},f));case 9:k=a.sent;l=k.html;n=k.js;b.default.prependNodeContents(j,l,n);a.next=18;break;case 15:a.prev=15;a.t0=a["catch"](3);c.default.exception(a.t0);case 18:h.resolve();case 19:case"end":return a.stop();}}},a,null,[[3,15]])}));return function(){return a.apply(this,arguments)}}();a.add=l;var m=function(){var a=j(regeneratorRuntime.mark(function a(){var b;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:b=document.querySelectorAll(".toast-wrapper");if(!b.length){a.next=3;break}return a.abrupt("return",b[b.length-1]);case 3:a.next=5;return k(document.body,"fixed-bottom");case 5:return a.abrupt("return",m());case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}()});
define ("core/aria",["exports","./local/aria/aria-hidden"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"hide",{enumerable:!0,get:function get(){return b.hide}});Object.defineProperty(a,"unhide",{enumerable:!0,get:function get(){return b.unhide}});Object.defineProperty(a,"hideSiblings",{enumerable:!0,get:function get(){return b.hideSiblings}});Object.defineProperty(a,"unhideSiblings",{enumerable:!0,get:function get(){return b.unhideSiblings}})});
define ("core/icon_system_fontawesome",["core/icon_system","jquery","core/ajax","core/mustache","core/localstorage","core/url"],function(a,b,c,d,e,f){var g=null,h=null,i=function(){a.apply(this,arguments)};i.prototype=Object.create(a.prototype);i.prototype.init=function(){var a=M.cfg.theme;if(g){return b.when(this)}var d=e.get("core_iconsystem/theme/"+a+"/core/iconmap-fontawesome");if(d){d=JSON.parse(d)}if(d){g=d;return b.when(this)}if(null===h){h=c.call([{methodname:"core_output_load_fontawesome_icon_system_map",args:{themename:M.cfg.theme}}],!0,!1,!1,0,M.cfg.themerev)[0]}return h.then(function(c){g={};b.each(c,function(a,b){g[b.component+"/"+b.pix]=b.to});e.set("core_iconsystem/theme/"+a+"/core/iconmap-fontawesome",JSON.stringify(g));return this}.bind(this))};i.prototype.renderIcon=function(a,b,c,e){var h=g[b+"/"+a],i=!1;if("undefined"==typeof h){var j=f.imageUrl(a,b);i={attributes:[{name:"src",value:j},{name:"alt",value:c},{name:"title",value:c}]}}var k={key:h,title:c,alt:c,unmappedIcon:i};if("undefined"==typeof c||""===c){k["aria-hidden"]=!0}var l=d.render(e,k);return l.trim()};i.prototype.getTemplateName=function(){return"core/pix_icon_fontawesome"};return i});
define ("core/chart_output",["core/chart_output_chartjs"],function(a){return a});
define ("core/loadingicon",["jquery","core/templates"],function(a,b){var c={LOADING:"core/loading"},d=function(){return b.render(c.LOADING,{})},e=function(b,c){return d().then(function(d){var e=a(d).hide();a(b).append(e);e.fadeIn(150);return a.when(e.promise(),c)}).then(function(a){return a.fadeOut(100).promise()}).then(function(a){a.remove()})};return{getIcon:d,addIconToContainer:function addIconToContainer(b){return d().then(function(c){var d=a(c).hide();a(b).append(d);d.fadeIn(150);return d})},addIconToContainerWithPromise:function addIconToContainerWithPromise(b){var c=a.Deferred();e(b,c);return c},addIconToContainerRemoveOnCompletion:e}});
define ("core/chart_output_chartjs",["jquery","core/chartjs","core/chart_axis","core/chart_bar","core/chart_output_base","core/chart_line","core/chart_pie","core/chart_series"],function(a,b,c,d,e,f,g,h){var j=function(a,b){return"axis-"+a+"-"+b};function i(){e.prototype.constructor.apply(this,arguments);this._canvas=this._node;if("CANVAS"!=this._canvas.prop("tagName")){this._canvas=a("<canvas>");this._node.append(this._canvas)}this._build()}i.prototype=Object.create(e.prototype);i.prototype._config=null;i.prototype._chartjs=null;i.prototype._canvas=null;i.prototype._build=function(){this._config=this._makeConfig();this._chartjs=new b(this._canvas[0],this._config)};i.prototype._cleanData=function(b){if(b instanceof Array){return b.map(function(b){return a("<span>").html(b).text()})}else{return a("<span>").html(b).text()}};i.prototype._getChartType=function(){var a=this._chart.getType();if(this._chart.getType()===d.prototype.TYPE&&!0===this._chart.getHorizontal()){a="horizontalBar"}else if(this._chart.getType()===g.prototype.TYPE&&!0===this._chart.getDoughnut()){a="doughnut"}return a};i.prototype._makeAxisConfig=function(a,b,d){var e={id:j(b,d)};if(a.getPosition()!==c.prototype.POS_DEFAULT){e.position=a.getPosition()}if(null!==a.getLabel()){e.scaleLabel={display:!0,labelString:this._cleanData(a.getLabel())}}if(null!==a.getStepSize()){e.ticks=e.ticks||{};e.ticks.stepSize=a.getStepSize()}if(null!==a.getMax()){e.ticks=e.ticks||{};e.ticks.max=a.getMax()}if(null!==a.getMin()){e.ticks=e.ticks||{};e.ticks.min=a.getMin()}return e};i.prototype._makeConfig=function(){var a={type:this._getChartType(),data:{labels:this._cleanData(this._chart.getLabels()),datasets:this._makeDatasetsConfig()},options:{title:{display:null!==this._chart.getTitle(),text:this._cleanData(this._chart.getTitle())}}},b=this._chart.getLegendOptions();if(b){a.options.legend=b}this._chart.getXAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{};a.options.scales.xAxes=a.options.scales.xAxes||[];a.options.scales.xAxes[c]=this._makeAxisConfig(b,"x",c);if(null!==d){a.options.scales.xAxes[c].ticks.callback=function(a,b){return d[b]||""}}a.options.scales.xAxes[c].stacked=this._isStacked()}.bind(this));this._chart.getYAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{};a.options.scales.yAxes=a.options.scales.yAxes||[];a.options.scales.yAxes[c]=this._makeAxisConfig(b,"y",c);if(null!==d){a.options.scales.yAxes[c].ticks.callback=function(a){return d[parseInt(a,10)]||""}}a.options.scales.yAxes[c].stacked=this._isStacked()}.bind(this));a.options.tooltips={callbacks:{label:this._makeTooltip.bind(this)}};return a};i.prototype._makeDatasetsConfig=function(){var a=this._chart.getSeries().map(function(a){var b=a.hasColoredValues()?a.getColors():a.getColor(),c={label:this._cleanData(a.getLabel()),data:a.getValues(),type:a.getType(),fill:a.getFill(),backgroundColor:b,borderColor:this._chart.getType()==g.prototype.TYPE?"#fff":b,lineTension:this._isSmooth(a)?.3:0};if(null!==a.getXAxis()){c.xAxisID=j("x",a.getXAxis())}if(null!==a.getYAxis()){c.yAxisID=j("y",a.getYAxis())}return c}.bind(this));return a};i.prototype._makeTooltip=function(a,b){var c=this._chart.getSeries()[a.datasetIndex],d=c.getLabel(),e=c.getLabels(),f=b.datasets[a.datasetIndex].data,g=f[a.index],h=[];if(""==a.xLabel&&""==a.yLabel){var i=this._cleanData(this._chart.getLabels());h.push(i[a.index])}if(null!==e){h.push(this._cleanData(e[a.index]))}else{h.push(this._cleanData(d)+": "+g)}return h};i.prototype._isSmooth=function(a){var b=!1;if(this._chart.getType()===f.prototype.TYPE){b=a.getSmooth();if(null===b){b=this._chart.getSmooth()}}else if(a.getType()===h.prototype.TYPE_LINE){b=a.getSmooth()}return b};i.prototype._isStacked=function(){var a=!1;if(this._chart.getType()===d.prototype.TYPE){a=this._chart.getStacked()}return a};i.prototype.update=function(){a.extend(!0,this._config,this._makeConfig());this._chartjs.update()};return i});
define ("core/dragdrop",["jquery","core/autoscroll"],function(a,b){var c={eventCaptureOptions:{passive:!1,capture:!0},dragProxy:null,onMove:null,onDrop:null,initialPosition:null,initialX:null,initialY:null,touching:null,prepare:function prepare(a){a.preventDefault();var b;if("touchstart"===a.type){b=null===c.touching&&0<a.changedTouches.length}else{b=1===a.which}if(b){var d=c.getEventXY(a);d.start=!0;return d}else{return{start:!1}}},start:function start(a,d,e,f){var g=c.getEventXY(a);c.initialX=g.x;c.initialY=g.y;c.initialPosition=d.offset();c.dragProxy=d;c.onMove=e;c.onDrop=f;switch(a.type){case"mousedown":c.addEventSpecial("mousemove",c.mouseMove);c.addEventSpecial("mouseup",c.mouseUp);break;case"touchstart":c.addEventSpecial("touchend",c.touchEnd);c.addEventSpecial("touchcancel",c.touchEnd);c.addEventSpecial("touchmove",c.touchMove);c.touching=a.changedTouches[0].identifier;break;default:throw new Error("Unexpected event type: "+a.type);}b.start(c.scroll)},addEventSpecial:function addEventSpecial(a,b){try{window.addEventListener(a,b,c.eventCaptureOptions)}catch(d){c.eventCaptureOptions=!0;window.addEventListener(a,b,c.eventCaptureOptions)}},getEventXY:function getEventXY(a){switch(a.type){case"touchstart":return{x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY};case"mousedown":return{x:a.pageX,y:a.pageY};default:throw new Error("Unexpected event type: "+a.type);}},touchMove:function touchMove(a){a.preventDefault();for(var b=0;b<a.changedTouches.length;b++){if(a.changedTouches[b].identifier===c.touching){c.handleMove(a.changedTouches[b].pageX,a.changedTouches[b].pageY)}}},mouseMove:function mouseMove(a){c.handleMove(a.pageX,a.pageY)},handleMove:function handleMove(b,d){var e=c.dragProxy.offset(),f=e.top-parseInt(c.dragProxy.css("top")),g=e.left-parseInt(c.dragProxy.css("left")),h=a(document).height()-c.dragProxy.outerHeight()-f,i=a(document).width()-c.dragProxy.outerWidth()-g,j=c.initialPosition,k={top:Math.max(-f,Math.min(h,j.top+(d-c.initialY)-f)),left:Math.max(-g,Math.min(i,j.left+(b-c.initialX)-g))};c.dragProxy.css(k);c.onMove(b,d,c.dragProxy)},touchEnd:function touchEnd(a){a.preventDefault();for(var b=0;b<a.changedTouches.length;b++){if(a.changedTouches[b].identifier===c.touching){c.handleEnd(a.changedTouches[b].pageX,a.changedTouches[b].pageY)}}},mouseUp:function mouseUp(a){c.handleEnd(a.pageX,a.pageY)},handleEnd:function handleEnd(a,d){if(null!==c.touching){window.removeEventListener("touchend",c.touchEnd,c.eventCaptureOptions);window.removeEventListener("touchcancel",c.touchEnd,c.eventCaptureOptions);window.removeEventListener("touchmove",c.touchMove,c.eventCaptureOptions);c.touching=null}else{window.removeEventListener("mousemove",c.mouseMove,c.eventCaptureOptions);window.removeEventListener("mouseup",c.mouseUp,c.eventCaptureOptions)}b.stop();c.onDrop(a,d,c.dragProxy)},scroll:function scroll(b){var d=a(document).height()-c.dragProxy.outerHeight(),e=c.dragProxy.offset();e.top=Math.min(d,e.top+b);c.dragProxy.css(e)}};return{prepare:c.prepare,start:c.start}});
define ("core/user_date",["jquery","core/ajax","core/sessionstorage","core/config"],function(a,b,c,d){var e={},f=function(b){var c=a("html").attr("lang").replace(/-/g,"_");return"core_user_date/"+c+"/"+d.usertimezone+"/"+b.timestamp+"/"+b.format},g=function(a){return c.get(a)},h=function(a,b){c.set(a,b)},i=function(a){return"undefined"!=typeof e[a]},j=function(a){return e[a]},k=function(a,b){e[a]=b},l=function(a){var c=a.map(function(a){var b=a.hasOwnProperty("fixday")?a.fixday:1,c=a.hasOwnProperty("fixhour")?a.fixhour:1;return{timestamp:a.timestamp,format:a.format,type:a.type||null,fixday:b,fixhour:c}}),e={methodname:"core_get_user_dates",args:{contextid:d.contextid,timestamps:c}};return b.call([e],!0,!0)[0].then(function(b){b.dates.forEach(function(b,c){var d=a[c],e=f(d);h(e,b);d.deferred.resolve(b)})}).catch(function(b){a.forEach(function(a){a.deferred.reject(b)})})};return{get:function get(b){var c=[],d=[];b.forEach(function(b){var e=f(b);if(i(e)){d.push(j(e))}else{var h=a.Deferred(),l=g(e);if(l){h.resolve(l)}else{b.deferred=h;c.push(b)}k(e,h.promise());d.push(h.promise())}});if(c.length){l(c)}return a.when.apply(a,d).then(function(){return 1===arguments.length?[arguments[0]]:Array.apply(null,arguments)})},getUserMidnightForTimestamp:function getUserMidnightForTimestamp(a,b){var c=a>b,d=Math.abs(a-b),e=c?Math.floor(d/86400):Math.ceil(d/86400),f=e*86400,g=c?b+f:b-f;return g}}});
define ("core/paged_content_factory",["jquery","core/templates","core/notification","core/paged_content","core/paged_content_events","core/pubsub","core/ajax"],function(a,b,c,d,e,f,g){var h={PAGED_CONTENT:"core/paged_content"},j={ITEMS_PER_PAGE_SINGLE:25,ITEMS_PER_PAGE_ARRAY:[25,50,100,0],MAX_PAGES:3},k=function(){return{pagingbar:!1,pagingdropdown:!1,skipjs:!0,ignorecontrolwhileloading:!0,controlplacementbottom:!1}},l=function(){return{showitemsperpageselector:!1,itemsperpage:35,previous:!0,next:!0,activepagenumber:1,hidecontrolonsinglepage:!0,pages:[]}},m=function(a,b){var c=1;if(0<a){var d=a%b;if(d){a-=d;c=a/b+1}else{c=a/b}}return c},n=function(b,c){if(null===c){c=j.ITEMS_PER_PAGE_SINGLE}if(a.isArray(c)){c=c[0]}var d=l();d.itemsperpage=c;for(var e=m(b,c),f=1,g;f<=e;f++){g={number:f,page:""+f};if(1==f){g.active=!0}d.pages.push(g)}d.barsize=10;return d},o=function(b){var c=[];if(a.isArray(b)){c=b.map(function(a){if("number"==typeof a){return{value:a,active:!1}}else{return a}});var d=c.filter(function(a){return a.active});if(!d.length){c[0].active=!0}}else{c=[{value:b,active:!0}]}return c},p=function(b){if(null===b){b=j.ITEMS_PER_PAGE_ARRAY}var c=l();c.itemsperpage=o(b);c.showitemsperpageselector=a.isArray(b)&&1<b.length;return c},q=function(a,b){if(a){return n(a,b)}else{return p(b)}},r=function(b,c){if(null===b){b=j.ITEMS_PER_PAGE_SINGLE}if(a.isArray(b)){return{options:b}}var d={options:[]},e=0,f=0,g=j.MAX_PAGES;if(c.hasOwnProperty("maxPages")){g=c.maxPages}for(var h=1,k;h<=g;h++){k=0;if(2>=h){k=b;f=b}else{f=2*f;k=f}e+=k;var l={itemcount:k,content:e};if(1==h){l.active=!0}d.options.push(l)}return d},s=function(a,b,c){var d=k();if(c.hasOwnProperty("ignoreControlWhileLoading")){d.ignorecontrolwhileloading=c.ignoreControlWhileLoading}if(c.hasOwnProperty("controlPlacementBottom")){d.controlplacementbottom=c.controlPlacementBottom}if(c.hasOwnProperty("hideControlOnSinglePage")){d.hidecontrolonsinglepage=c.hideControlOnSinglePage}if(c.hasOwnProperty("ariaLabels")){d.arialabels=c.ariaLabels}if(c.hasOwnProperty("dropdown")&&c.dropdown){d.pagingdropdown=r(b,c)}else{d.pagingbar=q(a,b)}return d},t=function(e,f,g,i){i=i||{};var j=a.Deferred(),k=s(e,f,i);b.render(h.PAGED_CONTENT,k).then(function(b,c){b=a(b);var e=b.attr("id");if(i.hasOwnProperty("eventNamespace")){e=i.eventNamespace}var f=b;d.init(f,g,e);v(e,i);j.resolve(b,c)}).fail(function(a){j.reject(a)}).fail(c.exception);return j.promise()},u=function(a){return function callback(b){g.call([{methodname:"core_user_update_user_preferences",args:{preferences:[{type:a,value:b}]}}])}},v=function(a,b){if(b.hasOwnProperty("persistentLimitKey")){f.subscribe(a+e.SET_ITEMS_PER_PAGE_LIMIT,u(b.persistentLimitKey))}};return{create:function create(a,b){return t(null,null,a,b)},createWithLimit:function createWithLimit(a,b,c){return t(null,a,b,c)},createWithTotalAndLimit:t,createFromStaticList:function createFromStaticList(a,b,c,d){if("undefined"==typeof d){d={}}var e=a.length;return t(e,b,function(b){var d=[];b.forEach(function(b){var c=b.offset,f=b.limit?c+b.limit:e,g=a.slice(c,f);d.push(g)});return c(d)},d)},createFromAjax:t,resetLastPageNumber:function resetLastPageNumber(a,b){f.publish(a+e.ALL_ITEMS_LOADED,b)}}});
define ("core/normalise",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.getList=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){if(a instanceof HTMLElement){return[a]}if(a instanceof Array){return a}if(a instanceof NodeList){return Array.from(a)}if(a instanceof b.default){return a.get()}return Array.from(a)};a.getList=c});
define ("core/page_global",["jquery","core/custom_interaction_events","core/str","core/network"],function(a,b,c,d){var e=function(){var d=a("body");b.define(d,[b.events.activate]);d.on(b.events.activate,"[data-show-active-item]",function(b){var d=a(b.target).closest(".dropdown-item"),e=d.closest("[data-show-active-item]");if(!d.hasClass("dropdown-item")){return}if(d.hasClass("active")){return}var f=e.find(".dropdown-item");f.removeClass("active");f.removeAttr("aria-current");if(!e.attr("data-skip-active-class")){d.addClass("active")}d.attr("aria-current",!0);var g=d.text(),h=e.parent().find("[data-toggle=\"dropdown\"]"),i=h.find("[data-active-item-text]");if(i.length){i.html(g)}else{h.html(g)}var j=e.attr("data-active-item-button-aria-label-components");if(j){var k=j.split(",");k.push(g);c.get_string(k[0].trim(),k[1].trim(),k[2].trim()).then(function(a){h.attr("aria-label",a);return a}).catch(function(){return!1})}})};return{init:function init(){e();d.init()}}});
define ("core/tag",["jquery","core/ajax","core/templates","core/notification","core/str","core/modal_factory","core/modal_events","core/pending"],function(a,b,c,d,f,g,h,i){return{initTagindexPage:function initTagindexPage(){a("body").delegate(".tagarea[data-ta] a[data-quickload=1]","click",function(f){var e=new i("core/tag:initTagindexPage");f.preventDefault();var g=a(this),h=g[0].search.replace(/^\?/,""),j=g.closest(".tagarea[data-ta]"),k=h.split("&").reduce(function(a,b){var c=b.split("=");a[c[0]]=decodeURIComponent(c[1]);return a},{});b.call([{methodname:"core_tag_get_tagindex",args:{tagindex:k}}])[0].then(function(a){return c.render("core_tag/index",a)}).then(function(a,b){c.replaceNode(j,a,b)}).always(e.resolve).catch(d.exception)})},initManagePage:function initManagePage(){a("body").on("updated","[data-inplaceeditable]",function(b){var c=new i("core/tag:initManagePage");f.get_strings([{key:"selecttag",component:"core_tag"},{key:"now",component:"core"}]).then(function(c){a("label[for=\"tagselect"+b.ajaxreturn.itemid+"\"]").html(c[0]);a(b.target).closest("tr").find("td.col-timemodified").html(c[1])}).always(c.resolve).catch(d.exception);if("tagflag"===b.ajaxreturn.itemtype){var e=a(b.target).closest("tr");if("0"===b.ajaxreturn.value){e.removeClass("flagged-tag")}else{e.addClass("flagged-tag")}}});a(".tag-management-table").delegate("a.tagdelete","click",function(b){var c=new i("core/tag:tagdelete");b.preventDefault();var e=a(this).attr("href");f.get_strings([{key:"delete",component:"core"},{key:"confirmdeletetag",component:"tag"},{key:"yes",component:"core"},{key:"no",component:"core"}]).then(function(a){return d.confirm(a[0],a[1],a[2],a[3],function(){window.location.href=e})}).always(c.resolve).catch(d.exception)});a("#tag-management-delete").click(function(b){var c=a(this).closest("form").get(0),e=a(c).find("input[type=checkbox]:checked").length;if(!e){return}var g=new i("core/tag:tag-management-delete"),h=a("<input type='hidden'/>").attr("name",this.name);b.preventDefault();f.get_strings([{key:"delete",component:"core"},{key:"confirmdeletetags",component:"tag"},{key:"yes",component:"core"},{key:"no",component:"core"}]).then(function(a){return d.confirm(a[0],a[1],a[2],a[3],function(){h.appendTo(c);c.submit()})}).always(g.resolve).catch(d.exception)});a("#tag-management-combine").click(function(b){var e=new i("core/tag:tag-management-combine");b.preventDefault();var j=a(this).closest("form").get(0),k=a(j).find("input[type=checkbox]:checked");if(1>=k.length){f.get_strings([{key:"combineselected",component:"tag"},{key:"selectmultipletags",component:"tag"},{key:"ok"}]).then(function(a){return d.alert(a[0],a[1],a[2])}).always(e.resolve).catch(d.exception);return}var l=a("<input type='hidden'/>").attr("name",this.name),m="",n=[];k.each(function(){var b=a(this).val(),c=a(".inplaceeditable[data-itemtype=tagname][data-itemid="+b+"]").attr("data-value");n.push({id:b,name:c})});f.get_strings([{key:"combineselected",component:"tag"},{key:"continue",component:"core"}]).then(function(a){var b=a[0];m=a[1];return g.create({title:b,body:c.render("core_tag/combine_tags",{tags:n}),type:g.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(m);return a}).then(function(b){b.getRoot().on(h.save,function(b){b.preventDefault();l.appendTo(j);var c=a("input[name=maintag]:checked","#combinetags_form").val();a("<input type='hidden'/>").attr("name","maintag").attr("value",c).appendTo(j);j.submit()});b.getRoot().on(h.hidden,function(){b.destroy()});b.show();a("#combinetags_form input[type=radio]").first().focus().prop("checked",!0)}).always(e.resolve).catch(d.exception)});a("body").on("updatefailed","[data-inplaceeditable][data-itemtype=tagname]",function(b){var c=b.exception,e=b.newvalue,g=a(b.target).attr("data-itemid");if("namesalreadybeeingused"===c.errorcode){var h=new i("core/tag:updatefailed");b.preventDefault();f.get_strings([{key:"confirm",component:"core"},{key:"nameuseddocombine",component:"tag"},{key:"yes",component:"core"},{key:"cancel",component:"core"}]).then(function(a){return d.confirm(a[0],a[1],a[2],a[3],function(){window.location.href=window.location.href+"&newname="+encodeURIComponent(e)+"&tagid="+encodeURIComponent(g)+"&action=renamecombine&sesskey="+M.cfg.sesskey})}).always(h.resolve).catch(d.exception)}});a("body").on("click","a[data-action=addstandardtag]",function(b){var e=new i("core/tag:addstandardtag");b.preventDefault();return g.create({title:f.get_string("addotags","tag"),body:c.render("core_tag/add_tags",{actionurl:window.location.href,sesskey:M.cfg.sesskey}),type:g.types.SAVE_CANCEL}).then(function(b){b.setSaveButtonText(f.get_string("continue","core"));b.getRoot().on(h.save,function(b){var c=a(b.currentTarget).find("#id_tagslist"),d=c.val().trim();c.val(d);var e=a("#addtags_form");e.on("submit",function(b){var c=a("#addtags_form");if(!1===c[0].checkValidity()){b.preventDefault();b.stopPropagation()}c.addClass("was-validated");a("[data-region=\"tagslistinput\"]").addClass("error");var d=a("#id_tagslist_error_message");d.removeAttr("hidden");d.addClass("help-block")});e.submit();return!1});b.getRoot().on(h.hidden,function(){b.destroy()});b.show()}).always(e.resolve).catch(d.exception)})},initManageCollectionsPage:function initManageCollectionsPage(){a("body").on("updated","[data-inplaceeditable]",function(b){var c=new i("core/tag:initManageCollectionsPage-updated"),d=b.ajaxreturn,e,f,g;if("core_tag"===d.component&&"tagareaenable"===d.itemtype){e=a(this).attr("data-itemid");a(".tag-collections-table ul[data-collectionid] li[data-areaid="+e+"]").hide();g=d.value;if("1"===g){a(this).closest("tr").removeClass("dimmed_text");f=a(this).closest("tr").find("[data-itemtype=\"tagareacollection\"]").attr("data-value");a(".tag-collections-table ul[data-collectionid="+f+"] li[data-areaid="+e+"]").show()}else{a(this).closest("tr").addClass("dimmed_text")}}if("core_tag"===d.component&&"tagareacollection"===d.itemtype){e=a(this).attr("data-itemid");a(".tag-collections-table ul[data-collectionid] li[data-areaid="+e+"]").hide();f=a(this).attr("data-value");g=a(this).closest("tr").find("[data-itemtype=\"tagareaenable\"]").attr("data-value");if("1"===g){a(".tag-collections-table ul[data-collectionid="+f+"] li[data-areaid="+e+"]").show()}}c.resolve()});a("body").on("click",".addtagcoll > a",function(b){var e=new i("core/tag:initManageCollectionsPage-addtagcoll");b.preventDefault();var j=a(this).attr("data-url"),k="";f.get_strings([{key:"addtagcoll",component:"tag"},{key:"create",component:"core"}]).then(function(a){var b=a[0];k=a[1];var d={actionurl:j,sesskey:M.cfg.sesskey};return g.create({title:b,body:c.render("core_tag/add_tag_collection",d),type:g.types.SAVE_CANCEL})}).then(function(b){b.setSaveButtonText(k);b.getRoot().on(h.save,function(b){var c=a(b.currentTarget).find("#addtagcoll_name"),d=c.val().trim();c.val(d);var f=a("#addtagcoll_form");f.on("submit",function(b){if(!1===f[0].checkValidity()){b.preventDefault();b.stopPropagation()}f.addClass("was-validated");a("[data-region=\"addtagcoll_nameinput\"]").addClass("error");var c=a("#id_addtagcoll_name_error_message");c.removeAttr("hidden");c.addClass("help-block")});f.submit();return!1});b.getRoot().on(h.hidden,function(){b.destroy()});b.show();return b}).always(e.resolve).catch(d.exception)});a("body").on("click",".tag-collections-table .action_delete",function(b){var c=new i("core/tag:initManageCollectionsPage-action_delete");b.preventDefault();var e=a(this).attr("data-url")+"&sesskey="+M.cfg.sesskey;f.get_strings([{key:"delete"},{key:"suredeletecoll",component:"tag",param:a(this).attr("data-collname")},{key:"yes"},{key:"no"}]).then(function(a){return d.confirm(a[0],a[1],a[2],a[3],function(){window.location.href=e})}).always(c.resolve).catch(d.exception)})}}});
define ("core/chart_line",["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}b.prototype=Object.create(a.prototype);b.prototype.TYPE="line";b.prototype._smooth=!1;b.prototype.create=function(b,c){var d=a.prototype.create.apply(this,arguments);d.setSmooth(c.smooth);return d};b.prototype.getSmooth=function(){return this._smooth};b.prototype.setSmooth=function(a){this._smooth=!!a};return b});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}(function(a,b){"use strict";if("function"==typeof define&&define.amd){define ("core/loglevel",b)}else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){module.exports=b()}else{a.log=b()}})(this,function(){"use strict";var h=function(){},i="undefined",j=("undefined"==typeof window?"undefined":_typeof(window))!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"];function a(a,b){var c=a[b];if("function"==typeof c.bind){return c.bind(a)}else{try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}}function b(){if(console.log){if(console.log.apply){console.log.apply(console,arguments)}else{Function.prototype.apply.apply(console.log,[console,arguments])}}if(console.trace)console.trace()}function c(c){if("debug"===c){c="log"}if(("undefined"==typeof console?"undefined":_typeof(console))===i){return!1}else if("trace"===c&&j){return b}else if(console[c]!==void 0){return a(console,c)}else if(console.log!==void 0){return a(console,"log")}else{return h}}function d(a,b){for(var c=0,d;c<k.length;c++){d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){if(("undefined"==typeof console?"undefined":_typeof(console))!==i){d.call(this,b,c);this[a].apply(this,arguments)}}}function f(a){return c(a)||e.apply(this,arguments)}function g(a,b,c){var h=this,j,l="loglevel";if(a){l+=":"+a}function e(a){var b=(k[a]||"silent").toUpperCase();if(("undefined"==typeof window?"undefined":_typeof(window))===i)return;try{window.localStorage[l]=b;return}catch(a){}try{window.document.cookie=encodeURIComponent(l)+"="+b+";"}catch(a){}}function g(){var a;if(("undefined"==typeof window?"undefined":_typeof(window))===i)return;try{a=window.localStorage[l]}catch(a){}if(_typeof(a)===i){try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(l)+"=");if(-1!==c){a=/^([^;]+)/.exec(b.slice(c))[1]}}catch(a){}}if(h.levels[a]===void 0){a=void 0}return a}h.name=a;h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5};h.methodFactory=c||f;h.getLevel=function(){return j};h.setLevel=function(b,c){if("string"==typeof b&&h.levels[b.toUpperCase()]!==void 0){b=h.levels[b.toUpperCase()]}if("number"==typeof b&&0<=b&&b<=h.levels.SILENT){j=b;if(!1!==c){e(b)}d.call(h,b,a);if(("undefined"==typeof console?"undefined":_typeof(console))===i&&b<h.levels.SILENT){return"No console available for logging"}}else{throw"log.setLevel() called with invalid level: "+b}};h.setDefaultLevel=function(a){if(!g()){h.setLevel(a,!1)}};h.enableAll=function(a){h.setLevel(h.levels.TRACE,a)};h.disableAll=function(a){h.setLevel(h.levels.SILENT,a)};var m=g();if(null==m){m=null==b?"WARN":b}h.setLevel(m,!1)}var l=new g,m={};l.getLogger=function(a){if("string"!=typeof a||""===a){throw new TypeError("You must supply a name when creating a logger.")}var b=m[a];if(!b){b=m[a]=new g(a,l.getLevel(),l.methodFactory)}return b};var n=("undefined"==typeof window?"undefined":_typeof(window))!==i?window.log:void 0;l.noConflict=function(){if(("undefined"==typeof window?"undefined":_typeof(window))!==i&&window.log===l){window.log=n}return l};l.getLoggers=function(){return m};return l});
define ("core/chart_bar",["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}b.prototype=Object.create(a.prototype);b.prototype._horizontal=!1;b.prototype._stacked=!1;b.prototype.TYPE="bar";b.prototype.create=function(b,c){var d=a.prototype.create.apply(this,arguments);d.setHorizontal(c.horizontal);d.setStacked(c.stacked);return d};b.prototype._setDefaults=function(){a.prototype._setDefaults.apply(this,arguments);var b=this.getYAxis(0,!0);b.setMin(0)};b.prototype.getHorizontal=function(){return this._horizontal};b.prototype.getStacked=function(){return this._stacked};b.prototype.setHorizontal=function(a){var b=this.getXAxis(0,!0);if(null===b.getMin()){b.setMin(0)}this._horizontal=!!a};b.prototype.setStacked=function(a){this._stacked=!!a};return b});
define ("core/config",function(){return M.cfg});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/modal",["jquery","core/templates","core/notification","core/key_codes","core/custom_interaction_events","core/modal_backdrop","core/event","core/modal_events","core/local/aria/focuslock","core/pending","core/aria","core/fullscreen"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m={CONTAINER:"[data-region=\"modal-container\"]",MODAL:"[data-region=\"modal\"]",HEADER:"[data-region=\"header\"]",TITLE:"[data-region=\"title\"]",BODY:"[data-region=\"body\"]",FOOTER:"[data-region=\"footer\"]",HIDE:"[data-action=\"hide\"]",DIALOG:"[role=dialog]",FORM:"form",MENU_BAR:"[role=menubar]",HAS_Z_INDEX:".moodle-has-zindex",CAN_RECEIVE_FOCUS:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]"},n={LOADING:"core/loading",BACKDROP:"core/modal_backdrop"},o,p=0,q=function(b){this.root=a(b);this.modal=this.root.find(m.MODAL);this.header=this.modal.find(m.HEADER);this.headerPromise=a.Deferred();this.title=this.header.find(m.TITLE);this.titlePromise=a.Deferred();this.body=this.modal.find(m.BODY);this.bodyPromise=a.Deferred();this.footer=this.modal.find(m.FOOTER);this.footerPromise=a.Deferred();this.hiddenSiblings=[];this.isAttached=!1;this.bodyJS=null;this.footerJS=null;this.modalCount=p++;this.attachmentPoint=document.createElement("div");document.body.append(this.attachmentPoint);if(!this.root.is(m.CONTAINER)){c.exception({message:"Element is not a modal container"})}if(!this.modal.length){c.exception({message:"Container does not contain a modal"})}if(!this.header.length){c.exception({message:"Modal is missing a header region"})}if(!this.title.length){c.exception({message:"Modal header is missing a title region"})}if(!this.body.length){c.exception({message:"Modal is missing a body region"})}if(!this.footer.length){c.exception({message:"Modal is missing a footer region"})}this.registerEventListeners()};q.prototype.attachToDOM=function(){this.getAttachmentPoint().append(this.root);if(this.isAttached){return}i.trapFocus(this.root[0]);if(this.bodyJS){b.runTemplateJS(this.bodyJS);this.bodyJS=null}if(this.footerJS){b.runTemplateJS(this.footerJS);this.footerJS=null}this.isAttached=!0};q.prototype.countOtherVisibleModals=function(){var b=0;a("body").find(m.CONTAINER).each(function(c,d){d=a(d);if(!this.root.is(d)&&d.hasClass("show")){b++}}.bind(this));return b};q.prototype.getBackdrop=function(){if(!o){o=b.render(n.BACKDROP,{}).then(function(b){var c=a(b);return new f(c)}).fail(c.exception)}return o};q.prototype.getRoot=function(){return this.root};q.prototype.getModal=function(){return this.modal};q.prototype.getTitle=function(){return this.title};q.prototype.getBody=function(){return this.body};q.prototype.getFooter=function(){return this.footer};q.prototype.getTitlePromise=function(){return this.titlePromise};q.prototype.getBodyPromise=function(){return this.bodyPromise};q.prototype.getFooterPromise=function(){return this.footerPromise};q.prototype.getModalCount=function(){return this.modalCount};q.prototype.setTitle=function(b){var d=this.getTitle();this.titlePromise=a.Deferred();this.asyncSet(b,d.html.bind(d)).then(function(){this.titlePromise.resolve(d)}.bind(this)).catch(c.exception)};q.prototype.setBody=function(d){this.bodyPromise=a.Deferred();var e=this.getBody();if("string"==typeof d){e.html(d);g.notifyFilterContentUpdated(e);this.getRoot().trigger(h.bodyRendered,this);this.bodyPromise.resolve(e)}else{var f="amd-modal-js-pending-id-"+this.getModalCount();M.util.js_pending(f);var i=null;e.css("overflow","hidden");d=a.when(d);if("pending"==d.state()){var j=e.innerHeight();if(100>j){j=100}e.animate({height:j+"px"},150);e.html("");i=b.render(n.LOADING,{}).then(function(b){var c=a(b).hide();e.html(c);c.fadeIn(150);return a.when(c.promise(),d)}).then(function(a){return a.fadeOut(100).promise()}).then(function(){return d})}else{i=d}i.then(function(a,c){var d=null;if(this.isVisible()){e.css("opacity",0);var f=e.innerHeight();e.html(a);e.css("height","");var g=e.innerHeight();e.css("height",f+"px");d=e.animate({height:g+"px",opacity:1},{duration:150,queue:!1}).promise()}else{e.html(a)}if(c){if(this.isAttached){b.runTemplateJS(c)}else{this.bodyJS=c}}return d}.bind(this)).then(function(a){g.notifyFilterContentUpdated(e);this.getRoot().trigger(h.bodyRendered,this);return a}.bind(this)).then(function(){this.bodyPromise.resolve(e)}.bind(this)).fail(c.exception).always(function(){e.css("height","");e.css("overflow","");e.css("opacity","");M.util.js_complete(f)}).fail(c.exception)}};q.prototype.setFooter=function(d){this.showFooter();this.footerPromise=a.Deferred();var e=this.getFooter();if("string"==typeof d){e.html(d);this.footerPromise.resolve(e)}else{b.render(n.LOADING,{}).then(function(a){e.html(a);return d}).then(function(a,c){e.html(a);if(c){if(this.isAttached){b.runTemplateJS(c)}else{this.footerJS=c}}return e}.bind(this)).then(function(a){this.footerPromise.resolve(a)}.bind(this)).catch(c.exception)}};q.prototype.hasFooterContent=function(){return this.getFooter().children().length?!0:!1};q.prototype.hideFooter=function(){this.getFooter().addClass("hidden")};q.prototype.showFooter=function(){this.getFooter().removeClass("hidden")};q.prototype.setLarge=function(){if(this.isLarge()){return}this.getModal().addClass("modal-lg")};q.prototype.isLarge=function(){return this.getModal().hasClass("modal-lg")};q.prototype.setSmall=function(){if(this.isSmall()){return}this.getModal().removeClass("modal-lg")};q.prototype.isSmall=function(){return!this.getModal().hasClass("modal-lg")};q.prototype.setScrollable=function(a){if(!a){this.getModal()[0].classList.remove("modal-dialog-scrollable");return}this.getModal()[0].classList.add("modal-dialog-scrollable")};q.prototype.calculateZIndex=function(){var b=a(m.DIALOG+", "+m.MENU_BAR+", "+m.HAS_Z_INDEX),c=parseInt(this.root.css("z-index"));b.each(function(b,d){d=a(d);var e=d.css("z-index")?parseInt(d.css("z-index")):0;if(e>c){c=e}});return c};q.prototype.isVisible=function(){return this.root.hasClass("show")};q.prototype.hasFocus=function(){var b=a(document.activeElement);return this.root.is(b)||this.root.has(b).length};q.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")};q.prototype.getAttachmentPoint=function(){return a(l.getElement()||this.attachmentPoint)};q.prototype.show=function(){if(this.isVisible()){return a.Deferred().resolve()}var b=new j("core/modal:show");if(this.hasFooterContent()){this.showFooter()}else{this.hideFooter()}this.attachToDOM();return this.getBackdrop().then(function(b){var c=this.calculateZIndex(),d=c+2;this.root.css("z-index",d);b.setZIndex(d-1);b.show();this.root.removeClass("hide").addClass("show");this.accessibilityShow();this.getModal().focus();a("body").addClass("modal-open");this.root.trigger(h.shown,this)}.bind(this)).then(b.resolve)};q.prototype.hideIfNotForm=function(){var a=this.modal.find(m.FORM);if(0==a.length){this.hide()}};q.prototype.hide=function(){this.getBackdrop().done(function(b){i.untrapFocus();if(!this.countOtherVisibleModals()){b.hide();a("body").removeClass("modal-open")}var c=parseInt(this.root.css("z-index"));this.root.css("z-index","");b.setZIndex(c-3);this.accessibilityHide();if(this.hasTransitions()){this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this))}else{this.getRoot().removeClass("show").addClass("hide")}if(a(document.body).find(this.getRoot()).length){a(document.body).append(this.getRoot())}this.root.trigger(h.hidden,this)}.bind(this))};q.prototype.destroy=function(){this.hide();this.root.remove();this.root.trigger(h.destroyed,this);this.attachmentPoint.remove()};q.prototype.accessibilityShow=function(){k.unhide(this.root.get());k.hideSiblings(this.root.get()[0])};q.prototype.accessibilityHide=function(){k.unhideSiblings(this.root.get()[0]);k.hide(this.root.get())};q.prototype.registerEventListeners=function(){this.getRoot().on("keydown",function(a){if(!this.isVisible()){return}if(a.keyCode==d.escape){if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this));this.getRoot().click(function(b){if(!a(b.target).closest(m.MODAL).length){if(a(b.target).closest(m.CONTAINER).length){var c=a.Event(h.outsideClick);this.getRoot().trigger(c,this);if(!c.isDefaultPrevented()){this.hideIfNotForm()}}}}.bind(this));e.define(this.getModal(),[e.events.activate]);this.getModal().on(e.events.activate,m.HIDE,function(a,b){this.hide();b.originalEvent.preventDefault()}.bind(this))};q.prototype.registerCloseOnCancel=function(){this.getModal().on(e.events.activate,this.getActionSelector("cancel"),function(b,c){var d=a.Event(h.cancel);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){c.originalEvent.preventDefault();if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this))};q.prototype.registerCloseOnSave=function(){this.getModal().on(e.events.activate,this.getActionSelector("save"),function(b,c){var d=a.Event(h.save);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){c.originalEvent.preventDefault();if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this))};q.prototype.asyncSet=function(b,d){var e=b;if("object"!==_typeof(b)||!b.hasOwnProperty("then")){e=a.Deferred();e.resolve(b)}e.then(function(a){d(a)}).fail(c.exception);return e};q.prototype.setButtonText=function(a,b){var c=this.getFooter().find(this.getActionSelector(a));if(!c){throw new Error("Unable to find the '"+a+"' button")}return this.asyncSet(b,c.text.bind(c))};q.prototype.getActionSelector=function(a){return"[data-action='"+a+"']"};q.prototype.setRemoveOnClose=function(a){this.removeOnClose=a};return q});
define ("core/network",["jquery","core/ajax","core/config","core/notification","core/str"],function(a,b,c,d,e){var f=!1,g=!1,h=0,i=0,j=!1,k=!1,l=1e3*Math.min(c.sessiontimeout/10,600),m=function(){k=!0},n=function(){if(k){return e.get_strings([{key:"sessionexpired",component:"error"},{key:"sessionerroruser",component:"error"}]).then(function(a){d.alert(a[0],a[1]);return!0}).fail(d.exception)}else{return b.call([{methodname:"core_session_touch",args:{}}],!0,!0,!1,i)[0].then(function(){if(0<h){setTimeout(n,h)}return!0}).fail(function(){d.alert("",j)})}},o=function(){k=!1;return b.call([{methodname:"core_session_time_remaining",args:{}}],!0,!0,!0)[0].then(function(a){if(0>=a.userid){return!1}if(0>a.timeremaining){e.get_strings([{key:"sessionexpired",component:"error"},{key:"sessionerroruser",component:"error"}]).then(function(a){d.alert(a[0],a[1]);return!0}).fail(d.exception)}else if(1e3*a.timeremaining<2*l&&!g){setTimeout(m,1e3*a.timeremaining);g=!0;e.get_strings([{key:"norecentactivity",component:"moodle"},{key:"sessiontimeoutsoon",component:"moodle"},{key:"extendsession",component:"moodle"},{key:"cancel",component:"moodle"}]).then(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){n();g=!1;setTimeout(o,5*l);return!0},function(){g=!1;setTimeout(o,l)});return!0}).fail(d.exception)}else{setTimeout(o,l)}return!0})},p=function(){if(0<h){setTimeout(n,h)}else{setTimeout(o,5*l)}},q=function(){if(window.parent===window){return!1}var a;try{a=window.parent.location.href}catch(a){return!1}return a.startsWith(M.cfg.wwwroot)},r=function(){if(f){return}f=!0;if(q()){window.console.log("Not starting Moodle session timeout warning in this iframe.");return}window.console.log("Starting Moodle session timeout warning.");p()},s=function(a,b,c){if(f){window.console.warn("Ignoring session keep-alive. The core/network module was already initialised.");return}f=!0;if(q()){window.console.warn("Ignoring session keep-alive in this iframe inside another Moodle page.");return}window.console.log("Starting Moodle session keep-alive.");h=1e3*a;j=c;i=1e3*b;p()};return{keepalive:s,init:r}});
define ("core/notification",["exports","core/pending","core/log"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=a.init=a.exception=a.saveCancel=a.confirm=a.alert=a.addNotification=a.fetchNotifications=void 0;b=d(b);c=d(c);var q="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){return k(a)||j(a,b)||g(a,b)||f()}function f(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(a,b){if(!a)return;if("string"==typeof a)return h(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return h(a,b)}function h(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function j(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function k(a){if(Array.isArray(a))return a}function l(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function m(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){l(Object(c),!0).forEach(function(b){n(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{l(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function n(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function o(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function p(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){o(h,d,e,f,g,"next",a)}function g(a){o(h,d,e,f,g,"throw",a)}f(void 0)})}}var r=M.cfg.contextid,s={success:"core/notification_success",info:"core/notification_info",warning:"core/notification_warning",error:"core/notification_error"},t="user-notifications",u={notificationRegion:"#".concat(t),fallbackRegionParents:["#region-main","[role=\"main\"]","body"]},v=function(){var a=A();if(a){return!1}var b=document.createElement("span");b.id=t;return u.fallbackRegionParents.some(function(a){var c=document.querySelector(a);if(c){c.prepend(b);return!0}return!1})},w=function(){var a=p(regeneratorRuntime.mark(function a(){var b;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return"function"==typeof q.define&&q.define.amd?new Promise(function(a,b){q.require(["core/ajax"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&q.require&&"component"===q.require.loader?Promise.resolve(require(("core/ajax"))):Promise.resolve(q["core/ajax"]);case 2:b=a.sent;return a.abrupt("return",b.call([{methodname:"core_fetch_notifications",args:{contextid:r}}])[0].then(x));case 4:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.fetchNotifications=w;var x=function(a){if(!a.length){return Promise.resolve()}var c=new b.default("core/notification:addNotifications");a.forEach(function(a){return z(a.template,a.variables)});return c.resolve()},y=function(a){var c=new b.default("core/notification:addNotifications"),d=s.error;a=m({closebutton:!0,announce:!0,type:"error"},a);if(a.template){d=a.template;delete a.template}else if(a.type){if("undefined"!=typeof s[a.type]){d=s[a.type]}delete a.type}return z(d,a).then(c.resolve)};a.addNotification=y;var z=function(){var a=p(regeneratorRuntime.mark(function a(d,e){var f,g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:if(!("undefined"==typeof e.message||!e.message)){a.next=3;break}c.default.debug("Notification received without content. Skipping.");return a.abrupt("return");case 3:f=new b.default("core/notification:renderNotification");a.next=6;return"function"==typeof q.define&&q.define.amd?new Promise(function(a,b){q.require(["core/templates"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&q.require&&"component"===q.require.loader?Promise.resolve(require(("core/templates"))):Promise.resolve(q["core/templates"]);case 6:g=a.sent;g.renderForPromise(d,e).then(function(a){var b=a.html,c=a.js,d=void 0===c?"":c;g.prependNodeContents(A(),b,d);return}).then(f.resolve).catch(E);case 8:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),A=function(){return document.querySelector(u.notificationRegion)},B=function(){var a=p(regeneratorRuntime.mark(function a(c,d,e){var f,g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f=new b.default("core/notification:alert");a.next=3;return"function"==typeof q.define&&q.define.amd?new Promise(function(a,b){q.require(["core/modal_factory"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&q.require&&"component"===q.require.loader?Promise.resolve(require(("core/modal_factory"))):Promise.resolve(q["core/modal_factory"]);case 3:g=a.sent;return a.abrupt("return",g.create({type:g.types.ALERT,body:d,title:c,buttons:{cancel:e},removeOnClose:!0}).then(function(a){a.show();f.resolve();return a}));case 5:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.alert=B;var C=function(a,b,c,d,e,f){return D(a,b,c,e,f)};a.confirm=C;var D=function(){var a=p(regeneratorRuntime.mark(function a(c,d,f,g,h){var i,j,k,l,m;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:i=new b.default("core/notification:confirm");a.next=3;return Promise.all(["function"==typeof q.define&&q.define.amd?new Promise(function(a,b){q.require(["core/modal_factory"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&q.require&&"component"===q.require.loader?Promise.resolve(require(("core/modal_factory"))):Promise.resolve(q["core/modal_factory"]),"function"==typeof q.define&&q.define.amd?new Promise(function(a,b){q.require(["core/modal_events"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&q.require&&"component"===q.require.loader?Promise.resolve(require(("core/modal_events"))):Promise.resolve(q["core/modal_events"])]);case 3:j=a.sent;k=e(j,2);l=k[0];m=k[1];return a.abrupt("return",l.create({type:l.types.SAVE_CANCEL,title:c,body:d,buttons:{save:f},removeOnClose:!0}).then(function(a){a.show();a.getRoot().on(m.save,g);a.getRoot().on(m.cancel,h);i.resolve();return a}));case 8:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.saveCancel=D;var E=function(){var a=p(regeneratorRuntime.mark(function a(c){var d,e,f,g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d=new b.default("core/notification:displayException");if(!c.stack){c.stack=""}if(c.debuginfo){c.stack+=c.debuginfo+"\n"}if(!c.backtrace&&c.stacktrace){c.backtrace=c.stacktrace}if(c.backtrace){c.stack+=c.backtrace;e=c.backtrace.match(/line ([^ ]*) of/);f=c.backtrace.match(/ of ([^:]*): /);if(e&&e[1]){c.lineNumber=e[1]}if(f&&f[1]){c.fileName=f[1];if(30<c.fileName.length){c.fileName="..."+c.fileName.substr(c.fileName.length-27)}}}if("undefined"==typeof c.name&&c.errorcode){c.name=c.errorcode}a.next=8;return"function"==typeof q.define&&q.define.amd?new Promise(function(a,b){q.require(["core/yui"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&q.require&&"component"===q.require.loader?Promise.resolve(require(("core/yui"))):Promise.resolve(q["core/yui"]);case 8:g=a.sent;g.use("moodle-core-notification-exception",function(){var a=new M.core.exception(c);a.show();d.resolve()});case 10:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.exception=E;var F=function(a,b){r=a;v();x(b)};a.init=F;a.default={init:F,fetchNotifications:w,addNotification:y,alert:B,confirm:C,saveCancel:D,exception:E};return a.default});
define ("core/drawer_events",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={DRAWER_SHOWN:"drawer-shown",DRAWER_HIDDEN:"drawer-hidden"};return a.default});
define ("core/modal_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function f(a,b,c){if(b)e(a.prototype,b);if(c)e(a,c);return a}function g(a,b,c){if("undefined"!=typeof Reflect&&Reflect.get){g=Reflect.get}else{g=function(a,b,c){var d=h(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(c)}return e.value}}return g(a,b,c||a)}function h(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=p(a);if(null===a)break}return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===c(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}var q=function(a){i(b,a);var c=k(b);function b(a){var e;d(this,b);e=c.call(this,a);if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}f(b,[{key:"registerEventListeners",value:function registerEventListeners(){g(p(b.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return b}(b.default);a.default=q;return a.default});
define ("core/inplace_editable",["jquery","core/ajax","core/templates","core/notification","core/str","core/config","core/url","core/form-autocomplete","core/pending"],function(a,b,c,d,e,f,g,h,i){a("body").on("click keypress","[data-inplaceeditable] [data-inplaceeditablelink]",function(j){if("keypress"===j.type&&13!==j.keyCode){return}var k=new i("autocomplete-start-editing");j.stopImmediatePropagation();j.preventDefault();var l=a(this),m=l.closest("[data-inplaceeditable]"),n=function(b){b.addClass("updating");var c=b.find("img.spinner");if(c.length){c.show()}else{c=a("<img/>").attr("src",g.imageUrl("i/loading_small")).addClass("spinner").addClass("smallicon");b.append(c)}},o=function(a){a.removeClass("updating");a.find("img.spinner").hide()},p=function(f,g){var h=[f.attr("data-itemid"),f.attr("data-component"),f.attr("data-itemtype")].join("-"),j=new i(h);n(f);b.call([{methodname:"core_update_inplace_editable",args:{itemid:f.attr("data-itemid"),component:f.attr("data-component"),itemtype:f.attr("data-itemtype"),value:g}}])[0].then(function(b){return c.render("core/inplace_editable",b).then(function(d,e){var g=f.attr("data-value"),h=a(d);c.replaceNode(f,h,e);h.find("[data-inplaceeditablelink]").focus();h.trigger({type:"updated",ajaxreturn:b,oldvalue:g})})}).then(function(){return j.resolve()}).fail(function(b){var c=a.Event("updatefailed",{exception:b,newvalue:g});o(f);M.util.js_complete(h);f.trigger(c);if(!c.isDefaultPrevented()){d.exception(b)}})},q=function(a){a.find("input").off();a.find("select").off();a.html(a.attr("data-oldcontent"));a.removeAttr("data-oldcontent");a.removeClass("inplaceeditingon");a.find("[data-inplaceeditablelink]").focus()},r=function(b,c){var d=b,e;for(e=0;e<c;e++){d+=Math.floor(10*Math.random())+""}if(0===a("#"+d).length){return d}return r(b,c)},s=function(b){e.get_string("edittitleinstructions").done(function(c){var d=a("<span class=\"editinstructions\">"+c+"</span>").attr("id",r("id_editinstructions_",20)),e=a("<input type=\"text\"/>").attr("id",r("id_inplacevalue_",20)).attr("value",b.attr("data-value")).attr("aria-describedby",d.attr("id")).addClass("ignoredirty").addClass("form-control"),g=a("<label class=\"accesshide\">"+m.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));b.html("").append(d).append(g).append(e);e.focus();e.select();e.on("keyup keypress focusout",function(a){if(f.behatsiterunning&&"focusout"===a.type){return}if("keypress"===a.type&&13===a.keyCode){var c=e.val();q(b);p(b,c)}if("keyup"===a.type&&27===a.keyCode||"focusout"===a.type){q(b)}})})},t=function(a,b){q(a);p(a,b)},u=function(b,c){var d,e=a("<select></select>").attr("id",r("id_inplacevalue_",20)).addClass("custom-select"),g=a("<label class=\"accesshide\">"+m.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));for(d in c){e.append(a("<option>").attr("value",c[d].key).html(c[d].value))}e.val(b.attr("data-value"));b.html("").append(g).append(e);e.focus();e.select();e.on("keyup change focusout",function(a){if(f.behatsiterunning&&"focusout"===a.type){return}if("change"===a.type){var c=e.val();q(b);p(b,c)}if("keyup"===a.type&&27===a.keyCode||"focusout"===a.type){q(b)}})},v=function(b,f){var g,j=a("<select></select>").attr("id",r("id_inplacevalue_",20)).addClass("form-autocomplete-original-select").addClass("custom-select"),k=a("<label class=\"accesshide\">"+m.attr("data-editlabel")+"</label>").attr("for",j.attr("id")),l=f.options,n=f.attributes,o=a("<a href=\"#\"></a>"),s=a("<a href=\"#\"></a>");for(g in l){j.append(a("<option>").attr("value",l[g].key).html(l[g].value))}if(n.multiple){j.attr("multiple","true")}j.val(JSON.parse(b.attr("data-value")));e.get_string("savechanges","core").then(function(a){return c.renderPix("e/save","core",a)}).then(function(a){o.append(a)}).fail(d.exception);e.get_string("cancel","core").then(function(a){return c.renderPix("e/cancel","core",a)}).then(function(a){s.append(a)}).fail(d.exception);b.html("").append(k).append(j).append(o).append(s);j.focus();j.select();h.enhance(j,n.tags,n.ajax,n.placeholder,n.caseSensitive,n.showSuggestions,n.noSelectionString).then(function(){b.find("[role=combobox]").focus()}).fail(d.exception);j.on("keyup",function(a){if("keyup"===a.type&&27===a.keyCode||"focusout"===a.type){q(b)}});o.on("click",function(a){var c=JSON.stringify(j.val());j.empty();q(b);p(b,c);a.preventDefault()});s.on("click",function(a){j.empty();q(b);a.preventDefault()})};(function turnEditingOffEverywhere(){a("span.inplaceeditable.inplaceeditingon").each(function(){q(a(this))})})();(function turnEditingOn(b){b.addClass("inplaceeditingon");b.attr("data-oldcontent",b.html());var c=b.attr("data-type"),d=b.attr("data-options");if("toggle"===c){t(b,d)}else if("select"===c){u(b,a.parseJSON(d))}else if("autocomplete"===c){v(b,a.parseJSON(d))}else{s(b)}})(m);k.resolve()});return{}});
define ("core/form-autocomplete",["jquery","core/log","core/str","core/templates","core/notification","core/loadingicon","core/aria"],function(a,b,c,d,f,g,h){var i={DOWN:40,ENTER:13,SPACE:32,ESCAPE:27,COMMA:44,UP:38,LEFT:37,RIGHT:39},j=Date.now(),k=function(b,c){var d=a(document.getElementById(c.selectionId)),e=d.children("[aria-selected=true]").length;b=b%e;while(0>b){b+=e}var f=a(d.children("[aria-selected=true]").get(b)),g=c.selectionId+"-"+b;d.children().attr("data-active-selection",null).attr("id","");f.attr("data-active-selection",!0).attr("id",g);d.attr("aria-activedescendant",g);d.attr("data-active-value",f.attr("data-value"));return a.Deferred().resolve()},l=function(b){var c=a(document.getElementById(b.selectionId)),d=c.attr("aria-activedescendant");if(d){var e=a(document.getElementById(d));if(e.length){return e}}var f=c.attr("data-active-value");return c.find("[data-value=\""+f+"\"]")},m=function(b){var c=l(b),d=c.attr("data-value"),e=a(document.getElementById(b.selectionId));if(d){var f=e.find("[aria-selected=true]").index(c);if(-1!==f){k(f,b);return}}k(0,b)},n=function(b,c,e){var g="form-autocomplete-updateSelectionList-"+c.inputId;M.util.js_pending(g);var h=[],i=a(document.getElementById(c.selectionId));e.children("option").each(function(b,c){if(a(c).prop("selected")){var d;if(a(c).data("html")){d=a(c).data("html")}else{d=a(c).html()}if(""!==d){h.push({label:d,value:a(c).attr("value")})}}});if(!o(c,h)){M.util.js_complete(g);return Promise.resolve()}c.items=h;var j=a.extend(b,c);return d.render(b.templates.items,j).then(function(a,b){d.replaceNodeContents(i,a,b);m(c)}).then(function(){return M.util.js_complete(g)}).catch(f.exception)},o=function(a,b){if(a.items.length!==b.length){return!0}return 0<a.items.filter(function(a){return-1===b.indexOf(a)}).length},p=function(a){if("undefined"!=typeof M.core_formchangechecker){M.core_formchangechecker.set_form_changed()}a[0].dispatchEvent(new Event("change"))},q=function(b,c,d,e){var f=a(d).attr("data-value");e.children("option").each(function(b,c){if(a(c).attr("value")==f){a(c).prop("selected",!1);if(a(c).attr("data-iscustom")){a(c).remove()}}});return n(b,c,e).then(function(){p(e)})},r=function(b,c){var d=a(document.getElementById(c.inputId)),e=a(document.getElementById(c.suggestionsId)),f=e.children(":not([aria-hidden])").length;b=b%f;while(0>b){b+=f}var g=a(e.children(":not([aria-hidden])").get(b)),h=a(e.children("[role=option]")).index(g),i=c.suggestionsId+"-"+h;e.children().attr("aria-selected",!1).attr("id","");g.attr("aria-selected",!0).attr("id",i);d.attr("aria-activedescendant",i);var j=g.offset().top-e.offset().top+e.scrollTop()-e.height()/2;return e.animate({scrollTop:j},100).promise()},s=function(b){var c=a(document.getElementById(b.suggestionsId)),d=c.children("[aria-selected=true]"),e=c.children(":not([aria-hidden])").index(d);return r(e+1,b)},t=function(b){var c=a(document.getElementById(b.selectionId)),d=c.children("[data-active-selection]");if(!d){return k(0,b)}var e=c.children("[aria-selected=true]").index(d);return k(e-1,b)},u=function(b){var c=a(document.getElementById(b.selectionId)),d=c.children("[data-active-selection]"),e=0;if(d){e=c.children("[aria-selected=true]").index(d);e=e+1}else{e=0}return k(e,b)},v=function(b){var c=a(document.getElementById(b.suggestionsId)),d=c.children("[aria-selected=true]"),e=c.children(":not([aria-hidden])").index(d);return r(e-1,b)},w=function(b){var c=a(document.getElementById(b.inputId)),d=a(document.getElementById(b.suggestionsId));if("true"===c.attr("aria-expanded")){c.attr("aria-expanded",!1)}c.attr("aria-activedescendant",b.selectionId);h.hide(d.get());d.hide();return a.Deferred().resolve()},x=function(b,e,g,i){var j="form-autocomplete-updateSuggestions-"+e.inputId;M.util.js_pending(j);var k=a(document.getElementById(e.inputId)),l=a(document.getElementById(e.suggestionsId)),m=!1,n=[];i.children("option").each(function(b,c){if(!0!==a(c).prop("selected")){n[n.length]={label:c.innerHTML,value:a(c).attr("value")}}});var o=e.caseSensitive?g:g.toLocaleLowerCase(),p=a.extend({options:n},b,e),q=d.render("core/form_autocomplete_suggestions",p).then(function(f,g){d.replaceNode(l,f,g);l=a(document.getElementById(e.suggestionsId));h.unhide(l.get());l.show();l.children().each(function(c,d){d=a(d);if(b.caseSensitive&&-1<d.text().indexOf(o)||!b.caseSensitive&&-1<d.text().toLocaleLowerCase().indexOf(o)){h.unhide(d.get());d.show();m=!0}else{d.hide();h.hide(d.get())}});k.attr("aria-expanded",!0);if(i.attr("data-notice")){l.html(i.attr("data-notice"))}else if(m){if(!b.tags){r(0,e)}}else{c.get_string("nosuggestions","form").done(function(a){l.html(a)})}return l}).then(function(){return M.util.js_complete(j)}).catch(f.exception);return q},y=function(b,c,d){var e=a(document.getElementById(c.inputId)),f=e.val(),g=f.split(","),h=!1;a.each(g,function(c,e){e=e.trim();if(""!==e){if(!b.multiple){d.children("option").prop("selected",!1)}d.children("option").each(function(b,c){if(a(c).attr("value")==e){h=!0;a(c).prop("selected",!0)}});if(!h){var f=a("<option>");f.append(document.createTextNode(e));f.attr("value",e);d.append(f);f.prop("selected",!0);f.attr("data-iscustom",!0)}}});return n(b,c,d).then(function(){p(d)}).then(function(){e.val("")}).then(function(){return w(c)})},z=function(b,c,d){var e=a(document.getElementById(c.inputId)),f=a(document.getElementById(c.suggestionsId)),g=f.children("[aria-selected=true]").attr("data-value");if(!b.multiple){d.children("option").prop("selected",!1)}d.children("option").each(function(b,c){if(a(c).attr("value")==g){a(c).prop("selected",!0)}});return n(b,c,d).then(function(){p(d)}).then(function(){if(b.closeSuggestionsOnSelect){e.val("");return w(c)}else{e.focus();return x(b,c,e.val(),d)}})},A=function(b,c,d,e,f){var h=C("updateAjax"),i=a(document.getElementById(d.selectId)).parent();g.addIconToContainerRemoveOnCompletion(i,h);var j=a(b.currentTarget).val();f.transport(c.selector,j,function(b){var g=f.processResults(c.selector,b),i=[];if(!c.multiple){e.children("option").remove()}e.children("option").each(function(b,c){c=a(c);if(!c.prop("selected")){c.remove()}else{i.push(c.attr("value")+"")}});if(!c.multiple&&0===e.children("option").length){var j=a("<option>");e.append(j)}if(a.isArray(g)){a.each(g,function(b,c){if(-1===i.indexOf(c.value+"")){var d=a("<option>");d.append(c.label);d.attr("value",c.value);e.append(d)}});e.attr("data-notice","")}else{e.attr("data-notice",g)}h.resolve(x(c,d,"",e))},function(a){h.reject(a)});return h},B=function(b,c,d){var g=a(document.getElementById(c.inputId));g.on("keydown",function(f){var e=C("addNavigation-"+c.inputId+"-"+f.keyCode);switch(f.keyCode){case i.DOWN:if(!b.showSuggestions){e.resolve();return!0}else if("true"===g.attr("aria-expanded")){e.resolve(s(c))}else{if(!g.val()&&b.ajax){require([b.ajax],function(a){e.resolve(A(f,b,c,d,a))})}else{e.resolve(x(b,c,g.val(),d))}}f.preventDefault();return!1;case i.UP:e.resolve(v(c));f.preventDefault();return!1;case i.ENTER:var h=a(document.getElementById(c.suggestionsId));if("true"===g.attr("aria-expanded")&&0<h.children("[aria-selected=true]").length){e.resolve(z(b,c,d))}else if(b.tags){e.resolve(y(b,c,d))}else{e.resolve()}f.preventDefault();return!1;case i.ESCAPE:if("true"===g.attr("aria-expanded")){e.resolve(w(c))}else{e.resolve()}f.preventDefault();return!1;}e.resolve();return!0});g.on("keypress",function(a){if(a.keyCode===i.COMMA){if(b.tags){C("keypress-"+a.keyCode).resolve(y(b,c,d))}a.preventDefault();return!1}return!0});g.closest("form").on("submit",function(){if(b.tags){C("form-autocomplete-submit").resolve(y(b,c,d))}return!0});g.on("blur",function(){var e=C("form-autocomplete-blur");window.setTimeout(function(){var f=a(document.activeElement),h=a.Deferred();if(f.is(document.getElementById(c.suggestionsId))){g.focus()}else if(!f.is(g)&&a(document.getElementById(c.inputId)).length){if(b.tags){h.then(function(){return y(b,c,d)}).catch()}h.then(function(){return w(c)}).catch()}h.then(function(){return e.resolve()}).catch();h.resolve()},500)});if(b.showSuggestions){var h=a(document.getElementById(c.downArrowId));h.on("click",function(a){var e=C("form-autocomplete-show-suggestions");g.focus();if(!g.val()&&b.ajax){require([b.ajax],function(f){e.resolve(A(a,b,c,d,f))})}else{e.resolve(x(b,c,g.val(),d))}})}var j=a(document.getElementById(c.suggestionsId));j.parent().prop("onclick",null).off("click");j.parent().on("click","#".concat(c.suggestionsId," [role=option]"),function(f){var e=C("form-autocomplete-parent"),g=a(f.currentTarget).closest("[role=option]"),h=a(document.getElementById(c.suggestionsId)),i=h.children(":not([aria-hidden])").index(g);r(i,c).then(function(){return z(b,c,d)}).then(function(){return e.resolve()}).catch()});var k=a(document.getElementById(c.selectionId));k.on("click","[role=option]",function(f){var e=C("form-autocomplete-clicks");e.resolve(q(b,c,a(f.currentTarget),d))});k.on("focus",function(){m(c)});k.on("keydown",function(f){var e=C("form-autocomplete-keydown-"+f.keyCode);switch(f.keyCode){case i.RIGHT:case i.DOWN:f.preventDefault();e.resolve(u(c));return;case i.LEFT:case i.UP:f.preventDefault();e.resolve(t(c));return;case i.SPACE:case i.ENTER:var g=a(document.getElementById(c.selectionId)).children("[data-active-selection]");if(g){f.preventDefault();e.resolve(q(b,c,g,d))}return;}e.resolve()});if(b.showSuggestions){g.on("focus",function(b){var c=a(b.currentTarget).val();a(b.currentTarget).data("last-value",c)});if(b.ajax){require([b.ajax],function(h){var i=null,j=!1,k="autocomplete-throttledhandler",l=function(a){i=null;j=!0;A(a,b,c,d,h).then(function(){if(null===i){M.util.js_complete(k)}j=!1;return arguments[0]}).catch(f.exception)},m=function(a){window.clearTimeout(i);if(j){i=window.setTimeout(m.bind(this,a),100);return}if(null===i){M.util.js_pending(k)}i=window.setTimeout(l.bind(this,a),300)};g.on("input",function(b){var c=a(b.currentTarget).val(),d=a(b.currentTarget).data("last-value");if(d!==c){m(b)}a(b.currentTarget).data("last-value",c)})})}else{g.on("input",function(f){var e=a(f.currentTarget).val(),g=a(f.currentTarget).data("last-value");if(g!==e){x(b,c,e,d)}a(f.currentTarget).data("last-value",e)})}}},C=function(b){var c="form-autocomplete:"+b;M.util.js_pending(c);var d=a.Deferred();d.then(function(){M.util.js_complete(c);return arguments[0]}).catch(f.exception);return d};return{enhance:function enhance(e,g,i,k,l,m,o,p,q){var r={selector:e,tags:!1,ajax:!1,placeholder:k,caseSensitive:!1,showSuggestions:!0,noSelectionString:o,templates:a.extend({input:"core/form_autocomplete_input",items:"core/form_autocomplete_selection_items",layout:"core/form_autocomplete_layout",selection:"core/form_autocomplete_selection",suggestions:"core/form_autocomplete_suggestions"},q)},s="autocomplete-setup-"+e;M.util.js_pending(s);if("undefined"!=typeof g){r.tags=g}if("undefined"!=typeof i){r.ajax=i}if("undefined"!=typeof l){r.caseSensitive=l}if("undefined"!=typeof m){r.showSuggestions=m}if("undefined"==typeof o){c.get_string("noselection","form").done(function(a){r.noSelectionString=a}).fail(f.exception)}var t=a(e);if(!t){b.debug("Selector not found: "+e);M.util.js_complete(s);return!1}h.hide(t.get());t.css("visibility","hidden");var u={selectId:t.attr("id"),inputId:"form_autocomplete_input-"+j,suggestionsId:"form_autocomplete_suggestions-"+j,selectionId:"form_autocomplete_selection-"+j,downArrowId:"form_autocomplete_downarrow-"+j,items:[]};j++;r.multiple=t.attr("multiple");if(!r.multiple){t.prepend("<option>")}if("undefined"!=typeof p){r.closeSuggestionsOnSelect=p}else{r.closeSuggestionsOnSelect=!r.multiple}var v=a("[for="+u.selectId+"]"),w=[];t.children("option").each(function(b,c){w[b]={label:c.innerHTML,value:a(c).attr("value")}});var x=a.extend({},r,u);x.options=w;x.items=[];var y="",z=d.render(r.templates.layout,{}).then(function(b){return a(b)}),A=d.render(r.templates.input,x).then(function(b,c){y+=c;return a(b)}),C=d.render(r.templates.suggestions,x).then(function(b,c){y+=c;return a(b)}),D=d.render(r.templates.selection,x).then(function(b,c){y+=c;return a(b)});return a.when(z,A,C,D).then(function(b,c,e,f){t.hide();var g=t.parent();a(c).find("input").attr("data-fieldtype","autocomplete");g.append(b);g.find("[data-region=\"form_autocomplete-input\"]").replaceWith(c);g.find("[data-region=\"form_autocomplete-suggestions\"]").replaceWith(e);g.find("[data-region=\"form_autocomplete-selection\"]").replaceWith(f);d.runTemplateJS(y);v.attr("for",u.inputId);B(r,u,t);var i=a(document.getElementById(u.suggestionsId));i.hide();h.hide(i.get())}).then(function(){return n(r,u,t)}).then(function(){return M.util.js_complete(s)}).catch(function(a){M.util.js_complete(s);f.exception(a)})}}});
define ("core/utils",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.debounce=a.throttle=void 0;a.throttle=function throttle(a,b){var c=!1,d=null,e=function(){for(var f=arguments.length,g=Array(f),h=0;h<f;h++){g[h]=arguments[h]}if(null===d){d=!1}else{d=!0}if(c){return}a.apply(this,g);c=!0;setTimeout(function(){var a=d;c=!1;d=null;if(a){e(g)}},b)};return e};a.debounce=function debounce(a,b){var c=null;return function(){for(var d=this,e=arguments.length,f=Array(e),g=0;g<e;g++){f[g]=arguments[g]}clearTimeout(c);c=setTimeout(function(){a.apply(d,f)},b)}}});
define ("core/key_codes",function(){return{tab:9,enter:13,shift:16,ctrl:17,alt:18,escape:27,space:32,end:35,home:36,arrowLeft:37,arrowUp:38,arrowRight:39,arrowDown:40,8:56,asterix:106,pageUp:33,pageDown:34}});
define ("core/chart_output_htmltable",["jquery","core/chart_output_base"],function(a,b){function c(){b.prototype.constructor.apply(this,arguments);this._build()}c.prototype=Object.create(b.prototype);c.prototype._build=function(){this._node.empty();this._node.append(this._makeTable())};c.prototype._makeTable=function(){var b=a("<table>"),d=this._chart,c,e,f=d.getLabels(),g=0<f.length,h=d.getSeries(),i,j=h[0].getCount();b.addClass("chart-output-htmltable generaltable");if(null!==d.getTitle()){b.append(a("<caption>").text(d.getTitle()))}c=a("<tr>");if(g){c.append(a("<td>"))}h.forEach(function(b){c.append(a("<th>").text(b.getLabel()).attr("scope","col"))});b.append(c);for(var k=0;k<j;k++){c=a("<tr>");if(0<f.length){c.append(a("<th>").text(f[k]).attr("scope","row"))}for(var l=0;l<h.length;l++){e=h[l].getValues()[k];i=h[l].getLabels();if(null!==i){e=h[l].getLabels()[k]}c.append(a("<td>").text(e))}b.append(c)}return b};c.prototype.update=function(){this._build()};return c});
define ("core/templates",["core/mustache","jquery","core/ajax","core/str","core/notification","core/url","core/config","core/localstorage","core/icon_system","core/event","core/yui","core/log","core/truncate","core/user_date","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=0,q={},r={},s={},t={},u=[],v=!1,w=["js"],x=function(a){if(a){if("moodle"!==a&&"core"!==a){return a}}return"core"},y=function(a){if(a in r){return r[a]}if(a in q){r[a]=b.Deferred().resolve(q[a]).promise();return r[a]}if(0>=M.cfg.templaterev){return null}var c=h.get("core_template/"+M.cfg.templaterev+":"+a);if(c){q[a]=c;r[a]=b.Deferred().resolve(c).promise();return r[a]}return null},z=function(){if(!u.length){return}if(v){return}v=!0;var a=u.slice(),e=b.Deferred(),f=[],g=a.map(function(a){var c=x(a.component),i=a.name,j=a.searchKey,k=a.theme,l=a.deferred,m=null,n=y(j);if(n){m=n}else{f.push({methodname:"core_output_load_template_with_dependencies",args:{component:c,template:i,themename:k,lang:b("html").attr("lang").replace(/-/g,"_")}});var o=f.length-1;m=e.promise().then(function(a){g[j]=a[o].then(function(a){var b=null;a.templates.forEach(function(a){a.component=x(a.component);var d=[k,a.component,a.name].join("/");q[d]=a.value;if(0<M.cfg.templaterev){h.set("core_template/"+M.cfg.templaterev+":"+d,a.value)}if(a.component==c&&a.name==i){b=a.value}});if(a.strings.length){d.cache_strings(a.strings.map(function(a){return{component:x(a.component),key:a.name,value:a.value}}))}return b});return g[j]})}return m.then(function(a){return l.resolve(a)}).catch(function(a){l.reject(a);throw a})});if(f.length){e.resolve(c.call(f,!0,!1,!1,0,M.cfg.templaterev))}else{e.resolve()}b.when.apply(null,g).then(function(){u.splice(0,a.length);v=!1;z()}).catch(function(){u.splice(0,a.length);v=!1;z()})},A=function(){this.requiredStrings=[];this.requiredJS=[];this.requiredDates=[];this.currentThemeName=""};A.prototype.requiredStrings=null;A.prototype.requiredDates=[];A.prototype.requiredJS=null;A.prototype.currentThemeName="";A.prototype.getTemplate=function(a){var c=this.currentThemeName,d=c+"/"+a,e=y(d);if(e){return e}var f=u.filter(function(a){return a.searchKey==d});if(f.length){return f[0].deferred.promise()}var g=a.split("/"),h=x(g.shift()),i=g.join("/"),j=b.Deferred();u.push({component:h,name:i,theme:c,searchKey:d,deferred:j});z();return j.promise()};A.prototype.prefetchTemplates=function(a,c){a.forEach(function(a){var d=c+"/"+a;if(y(d)){return}var e=u.filter(function(a){return a.searchKey==d});if(e.length){return}var f=a.split("/"),g=x(f.shift()),h=f.join("/");u.push({component:g,name:h,theme:c,searchKey:d,deferred:b.Deferred()})});z()};A.prototype.partialHelper=function(a){var b=this.currentThemeName+"/"+a;if(!(b in q)){e.exception(new Error("Failed to pre-fetch the template: "+a))}return q[b]};A.prototype.renderIcon=function(a,c,d){var f=g.iconsystemmodule;c=x(c);var h=b.Deferred();require([f],function(a){var b=new a;if(!(b instanceof i)){h.reject("Invalid icon system specified"+g.iconsystemmodule)}else{t=b;b.init().then(h.resolve).catch(e.exception)}});return h.then(function(a){return this.getTemplate(a.getTemplateName())}.bind(this)).then(function(b){return t.renderIcon(a,c,d,b)})};A.prototype.pixHelper=function(a,b,c){var d=b.split(","),e="",f="",g="";if(0<d.length){e=c(d.shift().trim(),a)}if(0<d.length){f=c(d.shift().trim(),a)}if(0<d.length){g=c(d.join(",").trim(),a)}var h=t.getTemplateName(),i=this.currentThemeName+"/"+h,j=q[i];f=x(f);e=e.replace(/&#x2F;/gi,"/");return t.renderIcon(e,f,g,j)};A.prototype.jsHelper=function(a,b,c){this.requiredJS.push(c(b,a));return""};A.prototype.stringHelper=function(a,b,c){var d=b.split(","),e="",f="",g="";if(0<d.length){e=d.shift().trim()}if(0<d.length){f=d.shift().trim()}if(0<d.length){g=d.join(",").trim()}f=x(f);if(""!==g){g=c(g,a)}if(0===g.indexOf("{")&&0!==g.indexOf("{{")){g=JSON.parse(g)}var h=this.requiredStrings.length;this.requiredStrings.push({key:e,component:f,param:g});return"[[_s"+h+"]]"};A.prototype.quoteHelper=function(a,b,c){var d=c(b.trim(),a);d=d.replace(/"/g,"\\\"").replace(/\t/g,"&#9;").replace(/([{}]{2,3})/g,"{{=<% %>=}}$1<%={{ }}=%>").replace(/(\r\n|\r|\n)/g,"&#x0a;");return"\""+d+"\""};A.prototype.shortenTextHelper=function(a,b,c){var d=b.match(/(.*?),(.*)/),e=d[1].trim(),f=d[2].trim(),g=c(f,a);return m.truncate(g,{length:e,words:!0,ellipsis:"..."})};A.prototype.userDateHelper=function(a,b,c){var d=b.match(/(.*?),(.*)/),e=c(d[1].trim(),a),f=c(d[2].trim(),a),g=this.requiredDates.length;this.requiredDates.push({timestamp:e,format:f});return"[[_t_"+g+"]]"};A.prototype.addHelperFunction=function(a,b){return function(){return function(c,d){var e=w.reduce(function(a,c){if(b.hasOwnProperty(c)){a[c]=b[c]}return a},{});w.forEach(function(a){b[a]=function(){return""}});var f=a.apply(this,[b,c,d]);for(var g in e){b[g]=e[g]}return f}.bind(this)}.bind(this)};A.prototype.addHelpers=function(a,b){this.currentThemeName=b;this.requiredStrings=[];this.requiredJS=[];a.uniqid=p++;a.str=this.addHelperFunction(this.stringHelper,a);a.pix=this.addHelperFunction(this.pixHelper,a);a.js=this.addHelperFunction(this.jsHelper,a);a.quote=this.addHelperFunction(this.quoteHelper,a);a.shortentext=this.addHelperFunction(this.shortenTextHelper,a);a.userdate=this.addHelperFunction(this.userDateHelper,a);a.globals={config:g};a.currentTheme=b};A.prototype.getJS=function(){var a="";if(0<this.requiredJS.length){a=this.requiredJS.join(";\n")}return a};A.prototype.treatStringsInContent=function(a,b){var c=/\[\[_s\d+\]\]/,d,e,f,g,h,i;do{d="";e=a.search(c);while(-1<e){d+=a.substring(0,e);a=a.substr(e);f="";g=4;h=a.substr(g,1);do{f+=h;g++;h=a.substr(g,1)}while("]"!=h);i=b[parseInt(f,10)];if("undefined"==typeof i){l.debug("Could not find string for pattern [[_s"+f+"]].");i=""}d+=i;a=a.substr(6+f.length);e=a.search(c)}a=d+a;e=a.search(c)}while(-1<e);return a};A.prototype.treatDatesInContent=function(a,b){b.forEach(function(b,c){var d=new RegExp("\\[\\[_t_"+c+"\\]\\]","g");a=a.replace(d,b)});return a};A.prototype.doRender=function(c,e,f){this.currentThemeName=f;var g=t.getTemplateName(),h=new o("core/templates:doRender");return this.getTemplate(g).then(function(){this.addHelpers(e,f);var d=a.render(c,e,this.partialHelper.bind(this));return b.Deferred().resolve(d.trim(),this.getJS()).promise()}.bind(this)).then(function(a,c){if(0<this.requiredStrings.length){return d.get_strings(this.requiredStrings).then(function(d){this.requiredDates=this.requiredDates.map(function(a){return{timestamp:this.treatStringsInContent(a.timestamp,d),format:this.treatStringsInContent(a.format,d)}}.bind(this));a=this.treatStringsInContent(a,d);c=this.treatStringsInContent(c,d);return b.Deferred().resolve(a,c).promise()}.bind(this))}return b.Deferred().resolve(a,c).promise()}.bind(this)).then(function(a,c){if(0<this.requiredDates.length){return n.get(this.requiredDates).then(function(d){a=this.treatDatesInContent(a,d);c=this.treatDatesInContent(c,d);return b.Deferred().resolve(a,c).promise()}.bind(this))}return b.Deferred().resolve(a,c).promise()}.bind(this)).then(function(a,c){h.resolve();return b.Deferred().resolve(a,c).promise()})};var B=function(a){if(""!==a.trim()){var c=b("<script>").attr("type","text/javascript").html(a);b("head").append(c)}},C=function(a,c,d,e){var f=b(a);if(f.length){var g=b(c),h=null;if(e){h=new k.NodeList(f.children().get());h.destroy(!0);f.empty();f.append(g)}else{h=new k.NodeList(f.get());h.destroy(!0);f.replaceWith(g)}B(d);j.notifyFilterContentUpdated(g);return g.get()}return[]};A.prototype.scanForPartials=function(b){var c=a.parse(b),d=[],e=function(a,b){var c,d;for(c=0;c<a.length;c++){d=a[c];if(">"==d[0]||"<"==d[0]){b.push(d[1])}if(4<d.length){e(d[4],b)}}};e(c,d);return d};A.prototype.cachePartials=function(a,c){var d=this.currentThemeName+"/"+a;if(d in s){return s[d]}c=c||[d];s[d]=b.Deferred();this.getTemplate(a).then(function(e){var f=this.scanForPartials(e),g=f.filter(function(b){if(0<=c.indexOf(this.currentThemeName+"/"+b)){return!1}return b!=a}.bind(this)),h=g.map(function(a){c.push(this.currentThemeName+"/"+a);return this.cachePartials(a,c)}.bind(this));return b.when.apply(b,h).then(function(){return s[d].resolve(e)})}.bind(this)).catch(s[d].reject);return s[d]};A.prototype.render=function(a,c,d){if("undefined"==typeof d){d=g.theme}this.currentThemeName=d;var f=g.iconsystemmodule,h=b.Deferred();require([f],function(a){var b=new a;if(!(b instanceof i)){h.reject("Invalid icon system specified"+g.iconsystem)}else{t=b;b.init().then(h.resolve).catch(e.exception)}});return h.then(function(){return this.cachePartials(a)}.bind(this)).then(function(a){return this.doRender(a,c,d)}.bind(this))};var D=function(a,c,d){var e=b(a);if(e.length){var f=b(c);e.prepend(f);B(d);j.notifyFilterContentUpdated(e);return f.get()}return[]},E=function(a,c,d){var e=b(a);if(e.length){var f=b(c);e.append(f);B(d);j.notifyFilterContentUpdated(e);return f.get()}return[]};return{render:function render(a,b,c){var d=new A;return d.render(a,b,c)},prefetchTemplates:function prefetchTemplates(a,b){var c=new A;if("undefined"==typeof b){b=g.theme}return c.prefetchTemplates(a,b)},renderForPromise:function renderForPromise(a,b,c){var d=new A;return d.render(a,b,c).then(function(a,b){return{html:a,js:b}})},renderPix:function renderPix(a,b,c){var d=new A;return d.renderIcon(a,x(b),c)},runTemplateJS:B,replaceNodeContents:function replaceNodeContents(a,b,c){return C(a,b,c,!0)},replaceNode:function replaceNode(a,b,c){return C(a,b,c,!1)},prependNodeContents:function prependNodeContents(a,b,c){return D(a,b,c)},appendNodeContents:function appendNodeContents(a,b,c){return E(a,b,c)}}});
define ("core/first",["jquery"],function(a){a(document).bind("ajaxStart",function(){M.util.js_pending("jq")}).bind("ajaxStop",function(){M.util.js_complete("jq")})});
define ("core/fullscreen",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.getElement=void 0;a.getElement=function getElement(){var a=null;if(document.fullscreenElement){a=document.fullscreenElement}else if(document.mozFullscreenElement){a=document.mozFullscreenElement}else if(document.msFullscreenElement){a=document.msFullscreenElement}else if(document.webkitFullscreenElement){a=document.webkitFullscreenElement}return a}});
define ("core/userfeedback",["exports","core/ajax","core/notification"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.registerEventListeners=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}var f={regions:{root:"[data-region=\"core/userfeedback\"]"},actions:{}};f.actions.give="".concat(f.regions.root," [data-action=\"give\"]");f.actions.remind="".concat(f.regions.root," [data-action=\"remind\"]");a.registerEventListeners=function registerEventListeners(){document.addEventListener("click",function(a){var b=a.target.closest(f.actions.give);if(b){a.preventDefault();if(!window.open(b.href)){throw new Error("Unable to open popup")}Promise.resolve(b).then(h).then(g).catch(c.default.exception)}var d=a.target.closest(f.actions.remind);if(d){a.preventDefault();Promise.resolve(d).then(h).then(g).catch(c.default.exception)}})};var g=function(a){if(a.dataset.record){return b.default.call([{methodname:"core_create_userfeedback_action_record",args:{action:a.dataset.action,contextid:M.cfg.contextid}}])[0]}return Promise.resolve()},h=function(a){if(a.dataset.hide){a.closest(f.regions.root).remove()}return a}});
define ("core/chart_builder",["jquery"],function(a){return{make:function make(b){var c=a.Deferred();require(["core/chart_"+b.type],function(a){var d=a.prototype.create(a,b);c.resolve(d)});return c.promise()}}});
define ("core/paged_content",["jquery","core/paged_content_pages","core/paged_content_paging_bar","core/paged_content_paging_bar_limit_selector","core/paged_content_paging_dropdown"],function(a,b,c,d,e){return{init:function init(f,g,h){f=a(f);var i=f.find(b.rootSelector),j=f.find(c.rootSelector),k=f.find(e.rootSelector),l=f.find(d.rootSelector),m=f.attr("id");if(h){m=h}b.init(i,m,g);if(j.length){c.init(j,m)}if(l.length){d.init(l,m)}if(k.length){e.init(k,m)}},rootSelector:"[data-region=\"paged-content-container\"]"}});
define ("core/paged_content_paging_bar_limit_selector",["jquery","core/custom_interaction_events","core/paged_content_events","core/pubsub"],function(a,b,c,d){var f={ROOT:"[data-region=\"paging-control-limit-container\"]",LIMIT_OPTION:"[data-limit]",LIMIT_TOGGLE:"[data-action=\"limit-toggle\"]"};return{init:function init(e,g){e=a(e);b.define(e,[b.events.activate]);e.on(b.events.activate,f.LIMIT_OPTION,function(b,e){var h=a(b.target).closest(f.LIMIT_OPTION);if(h.hasClass("active")){return}var i=parseInt(h.attr("data-limit"),10);d.publish(g+c.SET_ITEMS_PER_PAGE_LIMIT,i);e.originalEvent.preventDefault()})},rootSelector:f.ROOT}});
define ("core_backup/async_backup",["jquery","core/ajax","core/str","core/notification","core/templates"],function(a,b,c,d,e){var q=900,r=1e3,s={},t=15e3,u=15e3,v=1.5,w,x,y,z,A,B,C,D=2e3;function f(a,b,c){var d=Math.round(c)+"%",e=document.querySelectorAll("[data-"+b+"id="+CSS.escape(a)+"]")[0],f=c.toFixed(2)+"%";e.setAttribute("aria-valuenow",d);e.style.width=d;e.innerHTML=f}function g(a,b,c){clearInterval(a);return setInterval(b,c)}function h(c){var f=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[1],j=a(i).text(),k=h[0],l=a(k).text();b.call([{methodname:"core_backup_get_async_backup_links_backup",args:{filename:l,contextid:x}}])[0].done(function(a){var b={filename:l,time:j,size:a.filesize,fileurl:a.fileurl,restoreurl:a.restoreurl};e.render("core/async_backup_progress_row",b).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(new Error("Failed to load table row"))})})}function i(c){var f=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[0],j=h[1],k=a(j).text();b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:c,contextid:x}}])[0].done(function(b){var c=a(i).text(),f={resourcename:c,restoreurl:b.restoreurl,time:k};e.render("core/async_restore_progress_row",f).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(new Error("Failed to load table row"))})})}function j(a){var f=document.querySelectorAll("[data-restoreid="+CSS.escape(a)+"]")[0],g=f.closest("tr").children[1],h=g.innerHTML,i=document.createElement("a"),j=f.closest("td"),k=j.previousElementSibling;c.get_string("complete").then(function(a){k.innerHTML=a}).catch(function(){d.exception(new Error("Failed to load string: complete"))});e.render("core/async_copy_complete_cell",{}).then(function(a,b){e.replaceNodeContents(j,a,b)}).fail(function(){d.exception(new Error("Failed to load table cell"))});b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:a,contextid:0}}])[0].done(function(a){i.setAttribute("href",a.restoreurl);i.innerHTML=h;g.innerHTML=null;g.appendChild(i)}).fail(function(){d.exception(new Error("Failed to update table row"))})}function k(e){var g=100*e.progress,h="backup",i=document.querySelectorAll("[data-"+h+"id="+CSS.escape(w)+"]")[0],j=a("#"+w+"_status"),k=a("#"+w+"_detail"),l=a("#"+w+"_button"),m;if(e.status==800){i.classList.add("bg-success");f(w,h,g);var n="async"+z+"processing";c.get_string(n,"backup").then(function(a){j.text(a)}).catch(function(){d.exception(new Error("Failed to load string: backup "+n))})}else if(e.status==q){i.classList.add("bg-danger");i.classList.remove("bg-success");f(w,h,100);var o="async"+z+"error",p="async"+z+"errordetail";m=[{key:o,component:"backup"},{key:p,component:"backup"}];c.get_strings(m).then(function(a){j.text(a[0]);k.text(a[1])}).catch(function(){d.exception(new Error("Failed to load string"))});a(".backup_progress").children("span").removeClass("backup_stage_current");a(".backup_progress").children("span").last().addClass("backup_stage_current");clearInterval(A)}else if(e.status==r){i.classList.add("bg-success");f(w,h,100);var s="async"+z+"complete";c.get_string(s,"backup").then(function(a){j.text(a)}).catch(function(){d.exception(new Error("Failed to load string: backup "+s))});if("restore"==z){b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:w,contextid:x}}])[0].done(function(a){var b="async"+z+"completedetail",e="async"+z+"completebutton",f=[{key:b,component:"backup",param:a.restoreurl},{key:e,component:"backup"}];c.get_strings(f).then(function(b){k.html(b[0]);l.text(b[1]);l.attr("href",a.restoreurl)}).catch(function(){d.exception(new Error("Failed to load string"))})})}else{var t="async"+z+"completedetail",u="async"+z+"completebutton";m=[{key:t,component:"backup",param:y},{key:u,component:"backup"}];c.get_strings(m).then(function(a){k.html(a[0]);l.text(a[1]);l.attr("href",y)}).catch(function(){d.exception(new Error("Failed to load string"))})}a(".backup_progress").children("span").removeClass("backup_stage_current");a(".backup_progress").children("span").last().addClass("backup_stage_current");clearInterval(A)}}function l(a){a.forEach(function(a){var b=100*a.progress,c=a.backupid,d=a.operation,e=document.querySelectorAll("[data-"+d+"id="+CSS.escape(c)+"]")[0];if(a.status==800){e.classList.add("bg-success");f(c,d,b)}else if(a.status==q){e.classList.add("bg-danger");e.classList.add("complete");e.classList.remove("bg-success");f(c,d,100)}else if(a.status==r){e.classList.add("bg-success");e.classList.add("complete");f(c,d,100);if("backup"==d){h(c)}else{i(c)}}})}function m(a){a.forEach(function(a){var b=100*a.progress,e=a.backupid,g=a.operation,h=document.querySelectorAll("[data-"+g+"id="+CSS.escape(e)+"]")[0];if("restore"==g){var i=h.closest("tr").children[3];c.get_string("restore").then(function(a){i.innerHTML=a}).catch(function(){d.exception(new Error("Failed to load string: restore"))})}if(a.status==800){h.classList.add("bg-success");f(e,g,b)}else if(a.status==q){h.classList.add("bg-danger");h.classList.add("complete");h.classList.remove("bg-success");f(e,g,100)}else if(a.status==r&&"restore"==g){h.classList.add("bg-success");h.classList.add("complete");f(e,g,100);j(e)}})}function n(){b.call([{methodname:"core_backup_get_async_backup_progress",args:{backupids:[w],contextid:x}}],!0,!0,!1,D)[0].done(function(a){k(a[0]);u=t;A=g(A,n,t)}).fail(function(){u=u*v;A=g(A,n,u)})}function o(){var c=[],d=a(".progress").find(".progress-bar").not(".complete");d.each(function(){c.push(this.id.substring(0,32))});if(0<c.length){b.call([{methodname:"core_backup_get_async_backup_progress",args:{backupids:c,contextid:x}}],!0,!0,!1,D)[0].done(function(a){l(a);u=t;B=g(B,o,t)}).fail(function(){u=u*v;B=g(B,o,u)})}else{clearInterval(B)}}function p(){var c=[],d=a(".progress").find(".progress-bar[data-operation][data-backupid][data-restoreid]").not(".complete");d.each(function(){var a={backupid:this.dataset.backupid,restoreid:this.dataset.restoreid,operation:this.dataset.operation};c.push(a)});if(0<c.length){b.call([{methodname:"core_backup_get_copy_progress",args:{copies:c}}],!0,!0,!1,D)[0].done(function(a){m(a);u=t;C=g(C,p,t)}).fail(function(){u=u*v;C=g(C,p,u)})}else{clearInterval(C)}}s.asyncBackupAllStatus=function(a){x=a;B=setInterval(o,u)};s.asyncCopyAllStatus=function(){C=setInterval(p,u)};s.asyncBackupStatus=function(b,c,d,e){w=b;x=c;y=d;if("backup"==e){z="backup"}else{z="restore"}a(".backup_progress").children("a").removeAttr("href");A=setInterval(n,u)};return s});
define ("core_badges/backpackactions",["exports","jquery","core_badges/selectors","core/str","core/pending","core/modal_factory","core/modal_events","core/config"],function(a,b,c,d,e,f,g,h){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=i(b);c=i(c);e=i(e);f=i(f);g=i(g);h=i(h);function i(a){return a&&a.__esModule?a:{default:a}}function j(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function k(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){j(h,d,e,f,g,"next",a)}function g(a){j(h,d,e,f,g,"throw",a)}f(void 0)})}}var l=function(){var a=new e.default,d=(0,b.default)(c.default.elements.main);m(d);a.resolve()};a.init=l;var m=function(a){a.on("click",c.default.actions.deletebackpack,function(){var a=k(regeneratorRuntime.mark(function a(c){var d,e;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c.preventDefault();d=(0,b.default)(c.currentTarget);a.next=4;return n(d);case 4:e=a.sent;o(e,d);case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}())},n=function(){var a=k(regeneratorRuntime.mark(function a(b){var e;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:e=b.closest(c.default.elements.backpackurl).attr("data-backpackurl");a.t0=f.default;a.next=4;return(0,d.get_string)("delexternalbackpack","core_badges");case 4:a.t1=a.sent;a.next=7;return(0,d.get_string)("delexternalbackpackconfirm","core_badges",e);case 7:a.t2=a.sent;a.t3=f.default.types.SAVE_CANCEL;a.t4={title:a.t1,body:a.t2,type:a.t3};return a.abrupt("return",a.t0.create.call(a.t0,a.t4));case 11:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),o=function(){var a=k(regeneratorRuntime.mark(function a(b,c){return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.t0=b;a.next=3;return(0,d.get_string)("delete","core");case 3:a.t1=a.sent;a.t0.setSaveButtonText.call(a.t0,a.t1);b.getRoot().on(g.default.save,function(){window.location.href=c.attr("href")+"&sesskey="+h.default.sesskey+"&confirm=1"});b.getRoot().on(g.default.hidden,function(){b.destroy()});b.show();case 8:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}()});
define ("core_badges/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var b={actions:{deletebackpack:function getDataSelector(a,b){return"[data-".concat(a,"=\"").concat(b,"\"]")}("action","deletebackpack")},elements:{clearsearch:".input-group-append .clear-icon",main:"#backpacklist",backpackurl:"[data-backpackurl]"}};a.default=b;return a.default});
define ("core_calendar/calendar",["jquery","core/ajax","core/str","core/templates","core/notification","core/custom_interaction_events","core/modal_events","core/modal_factory","core_calendar/modal_event_form","core_calendar/summary_modal","core_calendar/repository","core_calendar/events","core_calendar/view_manager","core_calendar/crud","core_calendar/selectors"],function(a,b,c,d,f,g,h,i,j,k,l,m,n,o,p){var q={ROOT:"[data-region='calendar']",DAY:"[data-region='day']",NEW_EVENT_BUTTON:"[data-action='new-event-button']",DAY_CONTENT:"[data-region='day-content']",LOADING_ICON:".loading-icon",VIEW_DAY_LINK:"[data-action='view-day-link']",CALENDAR_MONTH_WRAPPER:".calendarwrapper",TODAY:".today"},r=function(b,c,e,g){var h=null,i=g.attr("data-day-timestamp");if(e){h=e.attr("data-day-timestamp")}if(!e||h!=i){d.render("core/loading",{}).then(function(a,b){g.find(q.DAY_CONTENT).addClass("hidden");d.appendNodeContents(g,a,b);if(e){e.find(q.DAY_CONTENT).addClass("hidden");d.appendNodeContents(e,a,b)}}).then(function(){return l.updateEventStartDay(c,i)}).then(function(){a("body").trigger(m.eventMoved,[c,e,g])}).always(function(){var a=g.find(q.LOADING_ICON);g.find(q.DAY_CONTENT).removeClass("hidden");d.replaceNode(a,"","");if(e){var b=e.find(q.LOADING_ICON);e.find(q.DAY_CONTENT).removeClass("hidden");d.replaceNode(b,"","")}}).fail(f.exception)}},s=function(b,c){var d=a("body");d.on(m.created,function(){n.reloadCurrentMonth(b)});d.on(m.deleted,function(){n.reloadCurrentMonth(b)});d.on(m.updated,function(){n.reloadCurrentMonth(b)});d.on(m.editActionEvent,function(a,b){window.location.assign(b)});d.on(m.moveEvent,r);d.on(m.eventMoved,function(){n.reloadCurrentMonth(b)});o.registerEditListeners(b,c)},t=function(b){b.on("click",q.VIEW_DAY_LINK,function(c){var d=a(c.target),e=d.data("year"),g=d.data("month"),h=d.data("day"),i=d.data("courseid"),j=d.data("categoryid");n.refreshDayContent(b,e,g,h,i,j,b,"core_calendar/calendar_day").then(function(){c.preventDefault();var a="?view=day&time="+d.data("timestamp");return window.history.pushState({},"",a)}).fail(f.exception)});b.on("change",p.elements.courseSelector,function(){var c=a(this),d=c.val();n.reloadCurrentMonth(b,d,null).then(function(){return b.find(p.elements.courseSelector).val(d)}).fail(f.exception)});var c=o.registerEventFormModal(b),d=a(q.CALENDAR_MONTH_WRAPPER).data("context-id");s(b,c);if(d){b.on("click",q.DAY,function(b){var d=a(b.target);if(!d.is(q.VIEW_DAY_LINK)){var e=a(this).attr("data-new-event-timestamp");c.then(function(a){var b=d.closest(p.wrapper);a.setCourseId(b.data("courseid"));var c=b.data("categoryid");if("undefined"!=typeof c){a.setCategoryId(c)}a.setContextId(b.data("contextId"));a.setStartTime(e);a.show()}).fail(f.exception);b.preventDefault()}})}};return{init:function init(b){b=a(b);n.init(b);t(b)}}});
define ("core_calendar/crud",["jquery","core/str","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_factory","core/modal_events","core_calendar/modal_event_form","core_calendar/repository","core_calendar/events","core_calendar/modal_delete","core_calendar/selectors","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){function o(d,e,f){var i=new n("core_calendar/crud:confirmDeletion"),m=[{key:"deleteevent",component:"calendar"}];f=parseInt(f,10);var o,p=1<f;if(p){m.push({key:"confirmeventseriesdelete",component:"calendar",param:{name:e,count:f}});o=g.create({type:l.TYPE})}else{m.push({key:"confirmeventdelete",component:"calendar",param:e});o=g.create({type:g.types.SAVE_CANCEL})}var q=b.get_strings(m),r=a.when(q,o).then(function(b,e){e.setRemoveOnClose(!0);e.setTitle(b[0]);e.setBody(b[1]);if(!p){e.setSaveButtonText(b[0])}e.show();e.getRoot().on(h.save,function(){var b=new n("calendar/crud:initModal:deletedevent");j.deleteEvent(d,!1).then(function(){a("body").trigger(k.deleted,[d,!1])}).then(b.resolve).catch(c.exception)});e.getRoot().on(k.deleteAll,function(){var b=new n("calendar/crud:initModal:deletedallevent");j.deleteEvent(d,!0).then(function(){a("body").trigger(k.deleted,[d,!0])}).then(b.resolve).catch(c.exception)});return e}).then(function(a){i.resolve();return a}).catch(c.exception);return r}return{registerRemove:function(b){b.on("click",m.actions.remove,function(b){var c=a(this).closest(m.eventItem),d=c.data("eventId"),e=c.data("eventTitle"),f=c.data("eventCount");o(d,e,f);b.preventDefault()})},registerEditListeners:function(b,d){var e=new n("core_calendar/crud:registerEditListeners");return d.then(function(c){a("body").on(k.editEvent,function(a,d){var e=b.find(m.wrapper);c.setEventId(d);c.setContextId(e.data("contextId"));c.show();a.stopImmediatePropagation()});return c}).then(function(a){e.resolve();return a}).catch(c.exception)},registerEventFormModal:function registerEventFormModal(b){var d=g.create({type:i.TYPE,large:!0});b.on("click",m.actions.create,function(a){d.then(function(a){var c=b.find(m.wrapper),d=c.data("categoryid");if("undefined"!=typeof d){a.setCategoryId(d)}var e=b.find(m.today),f=b.find(m.day);if(!e.length&&f.length){a.setStartTime(f.data("newEventTimestamp"))}a.setContextId(c.data("contextId"));a.setCourseId(c.data("courseid"));a.show()}).fail(c.exception);a.preventDefault()});b.on("click",m.actions.edit,function(b){b.preventDefault();var e=a(b.currentTarget),f=e.closest(m.wrapper),g=e.closest(m.eventItem);d.then(function(a){a.setEventId(g.data("eventId"));a.setContextId(f.data("contextId"));a.show();b.stopImmediatePropagation()}).fail(c.exception)});return d}}});
define ("core_calendar/month_view_drag_drop",["jquery","core/notification","core/str","core_calendar/events","core_calendar/drag_drop_data_store"],function(a,b,c,d,f){var g={ROOT:"[data-region='calendar']",DRAGGABLE:"[draggable=\"true\"][data-region=\"event-item\"]",DROP_ZONE:"[data-drop-zone=\"month-view-day\"]",WEEK:"[data-region=\"month-view-week\"]"},h="bg-faded",i="bg-danger text-white",j="bg-primary text-white",k=h+" "+i+" "+j,l=!1,m=function(b){var c=a(b.target).closest(g.DROP_ZONE);return c.length?c:null},n=function(a){var b=a.attr("data-day-timestamp"),c=f.getMinTimestart(),d=f.getMaxTimestart();if(c&&c>b){return!1}if(d&&d<b){return!1}return!0},o=function(a){var b=a.attr("data-day-timestamp"),c=f.getMinTimestart(),d=f.getMaxTimestart();if(c&&c>b){return f.getMinError()}if(d&&d<b){return f.getMaxError()}return null},p=function(){a(g.ROOT).find(g.DROP_ZONE).each(function(b,c){c=a(c);c.removeClass(k)})},q=function(a,b,c){if("undefined"==typeof c){c=f.getDurationDays()}var d=n(a);a.removeClass(k);if(b){if(d){a.addClass(j)}else{a.addClass(i)}}else{a.removeClass(j+" "+i);if(!d){a.addClass(h)}}c--;if(0<c){var e=a.next();if(!e.length){var l=a.closest(g.WEEK).next();if(l.length){e=l.children(g.DROP_ZONE).first()}}if(e.length){q(e,b,c)}}},r=function(){a(g.ROOT).find(g.DROP_ZONE).each(function(b,c){c=a(c);if(!n(c)){q(c,!1)}})},s=function(b){var c=a(b.target),d=c.closest(g.DRAGGABLE);if(!d.length){return}var e=d.find("[data-event-id]"),h=e.attr("data-event-id"),i=d.attr("data-min-day-timestamp"),j=d.attr("data-max-day-timestamp"),k=d.attr("data-min-day-error"),l=d.attr("data-max-day-error"),m=g.ROOT+" [data-event-id=\""+h+"\"]",n=a(m).length;f.setEventId(h);f.setDurationDays(n);if(i){f.setMinTimestart(i)}if(j){f.setMaxTimestart(j)}if(k){f.setMinError(k)}if(l){f.setMaxError(l)}b.dataTransfer.effectAllowed="move";b.dataTransfer.dropEffect="move";b.dataTransfer.setData("text/plain",h);b.dropEffect="move";r()},t=function(a){if(!f.hasEventId()){return}a.preventDefault();var b=m(a);if(!b){return}q(b,!0)},u=function(a){if(!f.hasEventId()){return}var b=m(a);if(!b){return}q(b,!1);a.preventDefault()},v=function(h){if(!f.hasEventId()){return}var e=m(h);if(!e){f.clearAll();p();return}if(n(e)){var i=f.getEventId(),j=g.ROOT+" [data-event-id=\""+i+"\"]",k=a(j),l=null;if(k.length){l=k.closest(g.DROP_ZONE)}a("body").trigger(d.moveEvent,[i,l,e])}else{var q=o(e);c.get_string("errorinvaliddate","calendar").then(function(a){b.exception({name:a,message:q||a})})}f.clearAll();p();h.preventDefault()},w=function(){f.clearAll();p()},x=function(){r()};return{init:function init(){if(!l){document.addEventListener("dragstart",s,!1);document.addEventListener("dragover",t,!1);document.addEventListener("dragleave",u,!1);document.addEventListener("drop",v,!1);document.addEventListener("dragend",w,!1);a("body").on(d.monthChanged,x);l=!0}}}});
define ("core_calendar/events",[],function(){return{created:"calendar-events:created",deleted:"calendar-events:deleted",deleteAll:"calendar-events:delete_all",updated:"calendar-events:updated",editEvent:"calendar-events:edit_event",editActionEvent:"calendar-events:edit_action_event",eventMoved:"calendar-events:event_moved",dayChanged:"calendar-events:day_changed",monthChanged:"calendar-events:month_changed",moveEvent:"calendar-events:move_event",filterChanged:"calendar-events:filter_changed",viewUpdated:"calendar-events:view_updated"}});
define ("core_calendar/modal_event_form",["jquery","core/event","core/str","core/notification","core/templates","core/custom_interaction_events","core/modal","core/modal_registry","core/fragment","core_calendar/events","core_calendar/repository"],function(a,b,c,d,e,f,g,h,i,j,k){var l=!1,m={SAVE_BUTTON:"[data-action=\"save\"]",LOADING_ICON_CONTAINER:"[data-region=\"loading-icon-container\"]"},n=function(a){g.call(this,a);this.eventId=null;this.startTime=null;this.courseId=null;this.categoryId=null;this.contextId=null;this.reloadingBody=!1;this.reloadingTitle=!1;this.saveButton=this.getFooter().find(m.SAVE_BUTTON)};n.TYPE="core_calendar-modal_event_form";n.prototype=Object.create(g.prototype);n.prototype.constructor=n;n.prototype.setContextId=function(a){this.contextId=a};n.prototype.getContextId=function(){return this.contextId};n.prototype.setCourseId=function(a){this.courseId=a};n.prototype.getCourseId=function(){return this.courseId};n.prototype.setCategoryId=function(a){this.categoryId=a};n.prototype.getCategoryId=function(){return this.categoryId};n.prototype.hasCourseId=function(){return null!==this.courseId};n.prototype.hasCategoryId=function(){return null!==this.categoryId};n.prototype.setEventId=function(a){this.eventId=a};n.prototype.getEventId=function(){return this.eventId};n.prototype.hasEventId=function(){return null!==this.eventId};n.prototype.setStartTime=function(a){this.startTime=a};n.prototype.getStartTime=function(){return this.startTime};n.prototype.hasStartTime=function(){return null!==this.startTime};n.prototype.getForm=function(){return this.getBody().find("form")};n.prototype.disableButtons=function(){this.saveButton.prop("disabled",!0)};n.prototype.enableButtons=function(){this.saveButton.prop("disabled",!1)};n.prototype.reloadTitleContent=function(){if(this.reloadingTitle){return this.titlePromise}this.reloadingTitle=!0;if(this.hasEventId()){this.titlePromise=c.get_string("editevent","calendar")}else{this.titlePromise=c.get_string("newevent","calendar")}this.titlePromise.then(function(a){this.setTitle(a);return a}.bind(this)).always(function(){this.reloadingTitle=!1}.bind(this)).fail(d.exception);return this.titlePromise};n.prototype.reloadBodyContent=function(a){if(this.reloadingBody){return this.bodyPromise}this.reloadingBody=!0;this.disableButtons();var b={};if(this.hasEventId()){b.eventid=this.getEventId()}if(this.hasStartTime()){b.starttime=this.getStartTime()}if(this.hasCourseId()){b.courseid=this.getCourseId()}if(this.hasCategoryId()){b.categoryid=this.getCategoryId()}if("undefined"!=typeof a){b.formdata=a}this.bodyPromise=i.loadFragment("calendar","event_form",this.getContextId(),b);this.setBody(this.bodyPromise);this.bodyPromise.then(function(){this.enableButtons()}.bind(this)).fail(d.exception).always(function(){this.reloadingBody=!1}.bind(this)).fail(d.exception);return this.bodyPromise};n.prototype.reloadAllContent=function(){return a.when(this.reloadTitleContent(),this.reloadBodyContent())};n.prototype.show=function(){this.reloadAllContent();g.prototype.show.call(this)};n.prototype.hide=function(){g.prototype.hide.call(this);this.setEventId(null);this.setStartTime(null);this.setCourseId(null);this.setCategoryId(null)};n.prototype.getFormData=function(){return this.getForm().serialize()};n.prototype.save=function(){var b,c=this.saveButton.find(m.LOADING_ICON_CONTAINER);b=this.getForm().find("[aria-invalid=\"true\"]");if(b.length){b.first().focus();return}c.removeClass("hidden");this.disableButtons();var e=this.getFormData();return k.submitCreateUpdateForm(e).then(function(b){if(b.validationerror){this.reloadBodyContent(e)}else{var c=this.hasEventId();this.hide();if(c){a("body").trigger(j.updated,[b.event])}else{a("body").trigger(j.created,[b.event])}}}.bind(this)).always(function(){c.addClass("hidden");this.enableButtons()}.bind(this)).fail(d.exception)};n.prototype.registerEventListeners=function(){g.prototype.registerEventListeners.call(this);this.getModal().on(f.events.activate,m.SAVE_BUTTON,function(a,b){this.getForm().submit();b.originalEvent.preventDefault();a.stopPropagation()}.bind(this));this.getModal().on("submit",function(a){b.notifyFormSubmitAjax(this.getForm()[0]);this.save();a.preventDefault();a.stopPropagation()}.bind(this))};if(!l){h.register(n.TYPE,n,"calendar/modal_event_form");l=!0}return n});
define ("core_calendar/month_navigation_drag_drop",["jquery","core_calendar/drag_drop_data_store"],function(a,b){var c={DRAGGABLE:"[draggable=\"true\"][data-region=\"event-item\"]",DROP_ZONE:"[data-drop-zone=\"nav-link\"]"},d="bg-primary text-white",e="drop-target",f=!1,g=null,h=null,i=function(a,b){if(b){a.addClass(d)}else{a.removeClass(d)}},j=function(){h.find(c.DROP_ZONE).addClass(e)},k=function(){h.find(c.DROP_ZONE).removeClass(e)},l=function(b){var d=a(b.target).closest(c.DROP_ZONE);return d.length?d:null},m=function(b){var d=a(b.target).closest(c.DRAGGABLE);if(d.length){j()}},n=function(a){if(!b.hasEventId()){return}a.preventDefault();var c=l(a);if(!c){return}if(!b.hasEventId()){return}if(!g){g=setTimeout(function(){c.click();g=null},1e3)}i(c,!0);k()},o=function(a){if(!b.hasEventId()){return}var c=l(a);if(!c){return}if(g){clearTimeout(g);g=null}i(c,!1);j();a.preventDefault()},p=function(a){if(!b.hasEventId()){return}k();var c=l(a);if(!c){return}i(c,!1);a.preventDefault()};return{init:function init(c){if(!f){document.addEventListener("dragstart",m,!1);document.addEventListener("dragover",n,!1);document.addEventListener("dragleave",o,!1);document.addEventListener("drop",p,!1);document.addEventListener("dragend",k,!1);f=!0}h=a(c);if(b.hasEventId()){j()}}}});
define ("core_calendar/calendar_mini",["jquery","core_calendar/selectors","core_calendar/events","core_calendar/view_manager"],function(a,b,c,d){var e=function(b){var d=a("body"),e="."+b.attr("id");d.on(c.created+e,b,f);d.on(c.deleted+e,b,f);d.on(c.updated+e,b,f);d.on(c.eventMoved+e,b,f)},f=function(b){var e=b.data,f=a("body"),g="."+e.attr("id");if(e.is(":visible")){d.reloadCurrentMonth(e)}else{f.off(c.created+g);f.off(c.deleted+g);f.off(c.updated+g);f.off(c.eventMoved+g)}},g=function(f){a("body").on(c.filterChanged,function(a,c){var d=f.find(b.eventType[c.type]);d.toggleClass("calendar_event_"+c.type,!c.hidden)});var g="."+f.attr("id");a("body").on("change"+g,b.elements.courseSelector,function(){if(f.is(":visible")){var b=a(this),c=b.val();d.reloadCurrentMonth(f,c,null)}else{a("body").off("change"+g)}})};return{init:function init(b,c){b=a(b);d.init(b);g(b);e(b);if(c){d.reloadCurrentMonth(b)}}}});
define ("core_calendar/calendar_threemonth",["jquery","core/notification","core_calendar/selectors","core_calendar/events","core/templates","core_calendar/view_manager"],function(a,b,c,d,e,f){var g=function(g){var h=a("body");h.on([d.monthChanged,d.dayChanged].join(" "),function(a,c,d,e,f){g.queue(function(g){return i(a,c,d,e,f).then(function(){return g()}).fail(b.exception)})});var i=function(b,d,e,h,i){var j=g.find("[data-year=\""+d+"\"][data-month=\""+e+"\"]"),k=j.closest(c.calendarPeriods.month),l=g.find(c.calendarPeriods.month),m=a(l[0]),n=a(l[2]),o=a("<span>");o.attr("data-template","core_calendar/threemonth_month");o.attr("data-includenavigation",!1);o.attr("data-mini",!0);var p=a("<div>");p.hide();p.append(o);var q,r,s;if(k.is(m)){p.insertBefore(m);q=m.data("previousYear");r=m.data("previousMonth");s=n}else if(k.is(n)){p.insertAfter(n);q=n.data("nextYear");r=n.data("nextMonth");s=m}else{return a.Deferred().resolve()}return f.refreshMonthContent(o,q,r,h,i,o).then(function(){var b=a.Deferred(),c=a.Deferred();s.slideUp("fast",function(){a(this).remove();b.resolve()});p.slideDown("fast",function(){c.resolve()});return a.when(b,c)})};g.on("click",c.links.miniDayLink,function(b){var d=a(b.target),e=d.data("year"),g=d.data("month"),h=d.text(),i=d.data("courseid"),j=d.data("categoryid"),k=a("body").find(c.calendarMain);f.refreshDayContent(k,e,g,h,i,j,k.find("[id^=\"calendar-\"][data-template^=\"core_calendar/\"]"),"core_calendar/calendar_day");b.preventDefault();window.history.pushState({},"","?view=day")})};return{init:function init(b){b=a(b);g(b)}}});
define ("core_calendar/event_form",["jquery","core_calendar/repository"],function(a,b){var c={EVENT_GROUP_COURSE_ID:"[name=\"groupcourseid\"]",EVENT_GROUP_ID:"[name=\"groupid\"]",SELECT_OPTION:"option"},d=function(d){var e=d.find(c.EVENT_GROUP_COURSE_ID),f=function(b){var e=d.find(c.EVENT_GROUP_ID),f=e.find(c.SELECT_OPTION),g=a(b);f.remove();e.prop("disabled",!1);g.each(function(b,c){a(e).append(a("<option></option>").attr("value",c.id).text(c.name))})};e.on("change",function(){var a=d.find(c.EVENT_GROUP_COURSE_ID).val();b.getCourseGroupsData(a).then(function(a){return f(a)}).catch(Notification.exception)})};return{init:function init(b){var c=a("#"+b);d(c)}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_calendar/view_manager",["exports","jquery","core/templates","core/notification","core_calendar/repository","core_calendar/events","core_calendar/selectors","core/modal_factory","core/modal_events","core_calendar/summary_modal","core/custom_interaction_events","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k,l){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=a.reloadCurrentUpcoming=a.changeDay=a.reloadCurrentDay=a.refreshDayContent=a.reloadCurrentMonth=a.changeMonth=a.refreshMonthContent=void 0;b=o(b);c=o(c);d=o(d);e=n(e);f=o(f);g=n(g);h=o(h);i=o(i);j=o(j);k=o(k);l=o(l);function m(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;m=function(){return a};return a}function n(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=m();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function o(a){return a&&a.__esModule?a:{default:a}}var p=function(a){a=(0,b.default)(a);a.on("click",g.links.eventLink,function(a){var b=a.target,c=null,d=null,e=new l.default("core_calendar/view_manager:eventLink:click");if(b.matches(g.actions.viewEvent)){c=b}else{c=b.closest(g.actions.viewEvent)}if(c){d=c.dataset.eventId}else{d=b.querySelector(g.actions.viewEvent).dataset.eventId}if(d){a.preventDefault();a.stopPropagation();A(d).then(e.resolve).catch()}else{e.resolve()}});a.on("click",g.links.navLink,function(b){var c=a.find(g.wrapper),d=c.data("view"),e=c.data("courseid"),f=c.data("categoryid"),h=b.currentTarget;if("month"===d){r(a,h.href,h.dataset.year,h.dataset.month,e,f,h.dataset.day);b.preventDefault()}else if("day"===d){v(a,h.href,h.dataset.year,h.dataset.month,h.dataset.day,e,f);b.preventDefault()}});var c=a.find(g.viewSelector);k.default.define(c,[k.default.events.activate]);c.on(k.default.events.activate,function(b){b.preventDefault();var c=b.target;if(c.classList.contains("active")){return}var e=c.dataset.view,f=c.dataset.year,g=c.dataset.month,h=c.dataset.day,i=c.dataset.courseid,j=c.dataset.categoryid;if("month"==e){q(a,f,g,i,j,a,"core_calendar/calendar_month",h).then(function(){return window.history.pushState({},"","?view=month")}).fail(d.default.exception)}else if("day"==e){t(a,f,g,h,i,j,a,"core_calendar/calendar_day").then(function(){return window.history.pushState({},"","?view=day")}).fail(d.default.exception)}else if("upcoming"==e){y(a,i,j,a,"core_calendar/calendar_upcoming").then(function(){return window.history.pushState({},"","?view=upcoming")}).fail(d.default.exception)}})},q=function(a,b,h,i,j){var k=5<arguments.length&&arguments[5]!==void 0?arguments[5]:null,l=6<arguments.length&&arguments[6]!==void 0?arguments[6]:"",m=7<arguments.length&&arguments[7]!==void 0?arguments[7]:1;w(a);k=k||a.find(g.wrapper);l=l||a.attr("data-template");M.util.js_pending([a.get("id"),b,h,i].join("-"));var n=a.data("includenavigation"),o=a.data("mini");return e.getCalendarMonthData(b,h,i,j,n,o,m).then(function(a){a.viewingmonth=!0;return c.default.render(l,a)}).then(function(a,b){return c.default.replaceNode(k,a,b)}).then(function(){document.querySelector("body").dispatchEvent(new CustomEvent(f.default.viewUpdated))}).always(function(){M.util.js_complete([a.get("id"),b,h,i].join("-"));return x(a)}).fail(d.default.exception)};a.refreshMonthContent=q;var r=function(a,c,d,e,g,h){var i=6<arguments.length&&arguments[6]!==void 0?arguments[6]:1;return q(a,d,e,g,h,null,"",i).then(function(){if(c.length&&"#"!==c){window.history.pushState({},"",c)}for(var a=arguments.length,b=Array(a),d=0;d<a;d++){b[d]=arguments[d]}return b}).then(function(){(0,b.default)("body").trigger(f.default.monthChanged,[d,e,g,h]);for(var a=arguments.length,c=Array(a),i=0;i<a;i++){c[i]=arguments[i]}return c})};a.changeMonth=r;var s=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0,d=a.find(g.wrapper).data("year"),e=a.find(g.wrapper).data("month"),f=a.find(g.wrapper).data("day");b=b||a.find(g.wrapper).data("courseid");c=c||a.find(g.wrapper).data("categoryid");return q(a,d,e,b,c,null,"",f)};a.reloadCurrentMonth=s;var t=function(a,b,h,i,j,k){var l=6<arguments.length&&arguments[6]!==void 0?arguments[6]:null,m=7<arguments.length&&arguments[7]!==void 0?arguments[7]:"";w(a);if(!l||0==l.length){l=a.find(g.wrapper)}m=m||a.attr("data-template");M.util.js_pending([a.get("id"),b,h,i,j,k].join("-"));var n=a.data("includenavigation");return e.getCalendarDayData(b,h,i,j,k,n).then(function(a){a.viewingday=!0;return c.default.render(m,a)}).then(function(a,b){return c.default.replaceNode(l,a,b)}).then(function(){document.querySelector("body").dispatchEvent(new CustomEvent(f.default.viewUpdated))}).always(function(){M.util.js_complete([a.get("id"),b,h,i,j,k].join("-"));return x(a)}).fail(d.default.exception)};a.refreshDayContent=t;var u=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0,d=a.find(g.wrapper),e=d.data("year"),f=d.data("month"),h=d.data("day");b=b||a.find(g.wrapper).data("courseid");c=c||a.find(g.wrapper).data("categoryid");return t(a,e,f,h,b,c)};a.reloadCurrentDay=u;var v=function(a,c,d,e,g,h,i){return t(a,d,e,g,h,i).then(function(){if(c.length&&"#"!==c){window.history.pushState({},"",c)}for(var a=arguments.length,b=Array(a),d=0;d<a;d++){b[d]=arguments[d]}return b}).then(function(){(0,b.default)("body").trigger(f.default.dayChanged,[d,e,h,i]);for(var a=arguments.length,c=Array(a),g=0;g<a;g++){c[g]=arguments[g]}return c})};a.changeDay=v;var w=function(a){var b=a.find(g.containers.loadingIcon);b.removeClass("hidden")},x=function(a){var b=a.find(g.containers.loadingIcon);b.addClass("hidden")},y=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0,i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null,j=4<arguments.length&&arguments[4]!==void 0?arguments[4]:"";w(a);i=i||a.find(g.wrapper);j=j||a.attr("data-template");b=b||a.find(g.wrapper).data("courseid");h=h||a.find(g.wrapper).data("categoryid");return e.getCalendarUpcomingData(b,h).then(function(a){a.viewingupcoming=!0;return c.default.render(j,a)}).then(function(a,b){return c.default.replaceNode(i,a,b)}).then(function(){document.querySelector("body").dispatchEvent(new CustomEvent(f.default.viewUpdated))}).always(function(){return x(a)}).fail(d.default.exception)};a.reloadCurrentUpcoming=y;var z=function(a){return"calendar_event_"+a},A=function(a){var b=new l.default("core_calendar/view_manager:renderEventSummaryModal");return e.getEventById(a).then(function(b){if(!b.event){throw new Error("Error encountered while trying to fetch calendar event with ID: "+a)}return b.event}).then(function(a){var b={title:a.name,type:j.default.TYPE,body:c.default.render("core_calendar/event_summary_body",a),templateContext:{canedit:a.canedit,candelete:a.candelete,headerclasses:z(a.normalisedeventtype),isactionevent:a.isactionevent,url:a.url,action:a.action}};return h.default.create(b)}).then(function(a){a.getRoot().on(i.default.hidden,function(){a.destroy()});a.show();return a}).then(function(a){b.resolve();return a}).catch(d.default.exception)};a.init=function init(a,b){p(a,b)}});
define ("core_calendar/modal_delete",["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_events","core/modal_registry","core_calendar/events"],function(a,b,c,d,f,g,h){var i=!1,j={DELETE_ONE_BUTTON:"[data-action=\"deleteone\"]",DELETE_ALL_BUTTON:"[data-action=\"deleteall\"]",CANCEL_BUTTON:"[data-action=\"cancel\"]"},k=function(a){d.call(this,a);this.setRemoveOnClose(!0)};k.TYPE="core_calendar-modal_delete";k.prototype=Object.create(d.prototype);k.prototype.constructor=k;k.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this);this.getModal().on(c.events.activate,j.DELETE_ONE_BUTTON,function(b,c){var d=a.Event(f.save);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,j.DELETE_ALL_BUTTON,function(b,c){var d=a.Event(h.deleteAll);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,j.CANCEL_BUTTON,function(b,c){var d=a.Event(f.cancel);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this))};if(!i){g.register(k.TYPE,k,"calendar/event_delete_modal");i=!0}return k});
define ("core_calendar/calendar_filter",["jquery","core_calendar/selectors","core_calendar/events","core/str","core/templates"],function(a,b,c,d,e){var f=function(d){d.on("click",b.eventFilterItem,function(b){var c=a(b.currentTarget);g(c);b.preventDefault()});a("body").on(c.viewUpdated,function(){var c=d.find(b.eventFilterItem);c.each(function(b,c){c=a(c);if(c.data("eventtype-hidden")){var d=i(c);h(d)}})})},g=function(a){var b=i(a);b.hidden=!b.hidden;M.util.js_pending("core_calendar/calendar_filter:toggleFilter");return d.get_string("eventtype"+b.eventtype,"calendar").then(function(a){b.name=a;b.icon=!0;b.key="i/"+b.eventtype+"event";b.component="core";return b}).then(function(a){return e.render("core_calendar/event_filter_key",a)}).then(function(b,c){return e.replaceNode(a,b,c)}).then(function(){h(b);M.util.js_complete("core_calendar/calendar_filter:toggleFilter")})},h=function(b){M.util.js_pending("month-mini-filterChanged");a("body").trigger(c.filterChanged,{type:b.eventtype,hidden:b.hidden});M.util.js_complete("month-mini-filterChanged")},i=function(a){return{eventtype:a.data("eventtype"),hidden:a.data("eventtype-hidden")}};return{init:function init(b){b=a(b);f(b)}}});
define ("core_calendar/calendar_view",["jquery","core/str","core/notification","core_calendar/selectors","core_calendar/events","core_calendar/view_manager","core_calendar/repository","core/modal_factory","core_calendar/modal_event_form","core/modal_events","core_calendar/crud"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(b,g){var h=a("body");k.registerRemove(b);var i="reloadCurrent"+g.charAt(0).toUpperCase()+g.slice(1);h.on(e.created,function(){f[i](b)});h.on(e.deleted,function(){f[i](b)});h.on(e.updated,function(){f[i](b)});b.on("change",d.courseSelector,function(){var e=a(this),g=e.val();f[i](b,g,null).then(function(){return b.find(d.courseSelector).val(g)}).then(function(){window.history.pushState({},"","?view=upcoming&course="+g)}).fail(c.exception)});h.on(e.filterChanged,function(a,c){var e=b.find(d.eventType[c.type]);if(!0==c.hidden){e.addClass("hidden")}else{e.removeClass("hidden")}});var j=k.registerEventFormModal(b);k.registerEditListeners(b,j)};return{init:function init(b,c){b=a(b);f.init(b,c);l(b,c)}}});
define ("core_calendar/drag_drop_data_store",[],function(){var a=null,b=null,c=null,d=null,e=null,f=null,g=function(b){a=b},h=function(){return a},i=function(){return null!==a},j=function(a){b=a},k=function(){return b},l=function(a){c=a},m=function(){return c},n=function(){return null!==c},o=function(a){d=a},p=function(){return d},q=function(){return null!==d},r=function(a){e=a},s=function(){return e},t=function(a){f=a},u=function(){return f};return{setEventId:g,getEventId:h,hasEventId:i,setDurationDays:j,getDurationDays:k,setMinTimestart:l,getMinTimestart:m,hasMinTimestart:n,setMaxTimestart:o,getMaxTimestart:p,hasMaxTimestart:q,setMinError:r,getMinError:s,setMaxError:t,getMaxError:u,clearAll:function clearAll(){g(null);j(null);l(null);o(null);r(null);t(null)}}});
define ("core_calendar/summary_modal",["jquery","core/str","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/modal_factory","core/modal_events","core_calendar/repository","core_calendar/events","core_calendar/crud"],function(a,b,c,d,e,f,g,h,i,j,k){var l=!1,m={ROOT:"[data-region='summary-modal-container']",EDIT_BUTTON:"[data-action=\"edit\"]",DELETE_BUTTON:"[data-action=\"delete\"]"},n=function(a){e.call(this,a)};n.TYPE="core_calendar-event_summary";n.prototype=Object.create(e.prototype);n.prototype.constructor=n;n.prototype.getEditButton=function(){if("undefined"==typeof this.editButton){this.editButton=this.getFooter().find(m.EDIT_BUTTON)}return this.editButton};n.prototype.getDeleteButton=function(){if("undefined"==typeof this.deleteButton){this.deleteButton=this.getFooter().find(m.DELETE_BUTTON)}return this.deleteButton};n.prototype.getEventId=function(){return this.getBody().find(m.ROOT).attr("data-event-id")};n.prototype.getEventTitle=function(){return this.getBody().find(m.ROOT).attr("data-event-title")};n.prototype.getEventCount=function(){return this.getBody().find(m.ROOT).attr("data-event-count")};n.prototype.getEditUrl=function(){return this.getBody().find(m.ROOT).attr("data-edit-url")};n.prototype.isActionEvent=function(){return"true"==this.getBody().find(m.ROOT).attr("data-action-event")};n.prototype.registerEventListeners=function(){e.prototype.registerEventListeners.call(this);M.util.js_pending("core_calendar/summary_modal:registerEventListeners:bodyRendered");this.getRoot().on(h.bodyRendered,function(){this.getModal().data({eventTitle:this.getEventTitle(),eventId:this.getEventId(),eventCount:this.getEventCount()}).attr("data-type","event");k.registerRemove(this.getModal());M.util.js_complete("core_calendar/summary_modal:registerEventListeners:bodyRendered")}.bind(this));a("body").on(j.deleted,function(){this.hide()}.bind(this));d.define(this.getEditButton(),[d.events.activate]);this.getEditButton().on(d.events.activate,function(b,c){if(this.isActionEvent()){a("body").trigger(j.editActionEvent,[this.getEditUrl()])}else{a("body").trigger(j.editEvent,[this.getEventId()])}this.hide();b.preventDefault();b.stopPropagation();c.originalEvent.preventDefault();c.originalEvent.stopPropagation()}.bind(this))};if(!l){f.register(n.TYPE,n,"core_calendar/event_summary_modal");l=!0}return n});
define ("core_calendar/selectors",[],function(){return{eventFilterItem:"[data-action='filter-event-type']",eventType:{site:"[data-eventtype-site]",category:"[data-eventtype-category]",course:"[data-eventtype-course]",group:"[data-eventtype-group]",user:"[data-eventtype-user]",other:"[data-eventtype-other]"},popoverType:{site:"[data-popover-eventtype-site]",category:"[data-popover-eventtype-category]",course:"[data-popover-eventtype-course]",group:"[data-popover-eventtype-group]",user:"[data-popover-eventtype-user]",other:"[data-popover-eventtype-other]"},calendarPeriods:{month:"[data-period='month']"},courseSelector:"select[name=\"course\"]",viewSelector:"div[data-region=\"view-selector\"]",actions:{create:"[data-action=\"new-event-button\"]",edit:"[data-action=\"edit\"]",remove:"[data-action=\"delete\"]",viewEvent:"[data-action=\"view-event\"]"},elements:{courseSelector:"select[name=\"course\"]"},today:".today",day:"[data-region=\"day\"]",calendarMain:"[data-region=\"calendar\"]",wrapper:".calendarwrapper",eventItem:"[data-type=\"event\"]",links:{navLink:".calendarwrapper .arrow_link",eventLink:"[data-region='event-item']",miniDayLink:"[data-region='mini-day-link']"},containers:{loadingIcon:"[data-region=\"overlay-icon-container\"]"}}});
define ("core_calendar/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.getCourseGroupsData=a.getCalendarUpcomingData=a.updateEventStartDay=a.getCalendarDayData=a.getCalendarMonthData=a.submitCreateUpdateForm=a.getEventById=a.deleteEvent=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1;return b.default.call([{methodname:"core_calendar_delete_calendar_events",args:{events:[{eventid:a,repeat:c}]}}])[0]};a.deleteEvent=c;var d=function(a){return b.default.call([{methodname:"core_calendar_get_calendar_event_by_id",args:{eventid:a}}])[0]};a.getEventById=d;var e=function(a){return b.default.call([{methodname:"core_calendar_submit_create_update_form",args:{formdata:a}}])[0]};a.submitCreateUpdateForm=e;var f=function(a,c,d,e,f,g){var h=6<arguments.length&&arguments[6]!==void 0?arguments[6]:1;return b.default.call([{methodname:"core_calendar_get_calendar_monthly_view",args:{year:a,month:c,courseid:d,categoryid:e,includenavigation:f,mini:g,day:h}}])[0]};a.getCalendarMonthData=f;var g=function(a,c,d,e,f){return b.default.call([{methodname:"core_calendar_get_calendar_day_view",args:{year:a,month:c,day:d,courseid:e,categoryid:f}}])[0]};a.getCalendarDayData=g;var h=function(a,c){return b.default.call([{methodname:"core_calendar_update_event_start_day",args:{eventid:a,daytimestamp:c}}])[0]};a.updateEventStartDay=h;var i=function(a,c){return b.default.call([{methodname:"core_calendar_get_calendar_upcoming_view",args:{courseid:a,categoryid:c}}])[0]};a.getCalendarUpcomingData=i;var j=function(a){return b.default.call([{methodname:"core_group_get_course_groups",args:{courseid:a}}])[0]};a.getCourseGroupsData=j});
define ("core_contentbank/search",["exports","jquery","core_contentbank/selectors","core/str","core/pending","core/utils"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=g(b);c=g(c);e=g(e);function g(a){return a&&a.__esModule?a:{default:a}}function h(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function i(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function f(a){h(i,d,e,f,g,"next",a)}function g(a){h(i,d,e,f,g,"throw",a)}f(void 0)})}}var j=function(){var a=new e.default,d=(0,b.default)(c.default.regions.contentbank);k(d);a.resolve()};a.init=j;var k=function(a){var b=a.find(c.default.elements.searchinput)[0];a.on("click",c.default.actions.search,function(c){c.preventDefault();l(a,b.value)});a.on("click",c.default.actions.clearSearch,function(c){c.preventDefault();b.value="";b.focus();l(a,b.value)});b.addEventListener("input",(0,f.debounce)(function(){l(a,b.value)},300))},l=function(){var a=i(regeneratorRuntime.mark(function a(b,e){var f,g,h,i;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f=b.find(c.default.actions.clearSearch)[0];g=b.find(c.default.elements.cbnavbarbreadcrumb)[0];h=b.find(c.default.elements.cbnavbartotalsearch)[0];i=m(b,e);if(!(0<e.length)){a.next=13;break}f.classList.remove("d-none");g.classList.add("d-none");a.next=9;return(0,d.get_string)("itemsfound","core_contentbank",i.length);case 9:h.innerHTML=a.sent;h.classList.remove("d-none");a.next=16;break;case 13:f.classList.add("d-none");g.classList.remove("d-none");h.classList.add("d-none");case 16:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),m=function(a,b){var d=Array.from(a.find(c.default.elements.listitem)),e=[];d.forEach(function(a){var d=a.getAttribute("data-name");if(""===b||d.toLowerCase().includes(b.toLowerCase())){e.push(a);var f=a.querySelector(c.default.regions.cbcontentname);f.innerHTML=n(d,b);a.classList.remove("d-none")}else{a.classList.add("d-none")}});return e},n=function(a,b){var c=a;if(""!==b){var d=a.toLowerCase().indexOf(b.toLowerCase());if(-1<d){c=a.substr(0,d)+"<span class=\"matchtext\">"+a.substr(d,b.length)+"</span>"+a.substr(d+b.length)}}return c}});
define ("core_contentbank/actions",["jquery","core/ajax","core/notification","core/str","core/templates","core/url","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g,h){var k={DELETE_CONTENT:"[data-action=\"deletecontent\"]",RENAME_CONTENT:"[data-action=\"renamecontent\"]"},l=function(){this.registerEvents()};l.prototype.registerEvents=function(){a(k.DELETE_CONTENT).click(function(b){b.preventDefault();var e=a(this).data("contentname"),f=a(this).data("contentid"),j=a(this).data("contextid"),k="";d.get_strings([{key:"deletecontent",component:"core_contentbank"},{key:"deletecontentconfirm",component:"core_contentbank",param:{name:e}},{key:"delete",component:"core"}]).then(function(a){var b=a[0],c=a[1];k=a[2];return g.create({title:b,body:c,type:g.types.SAVE_CANCEL,large:!0})}).done(function(a){a.setSaveButtonText(k);a.getRoot().on(h.save,function(){return i(f,j)});a.getRoot().on(h.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(k.RENAME_CONTENT).click(function(b){b.preventDefault();var f=a(this).data("contentname"),i=a(this).data("contentid"),k="";d.get_strings([{key:"renamecontent",component:"core_contentbank"},{key:"rename",component:"core_contentbank"}]).then(function(a){var b=a[0];k=a[1];return g.create({title:b,body:e.render("core_contentbank/renamecontent",{contentid:i,name:f}),type:g.types.SAVE_CANCEL})}).then(function(b){b.setSaveButtonText(k);b.getRoot().on(h.save,function(b){var e=a("#newname").val().trim();if(e){j(i,e)}else{d.get_strings([{key:"error"},{key:"emptynamenotallowed",component:"core_contentbank"}]).then(function(a){c.alert(a[0],a[1])}).catch(c.exception);b.preventDefault()}});b.getRoot().on(h.hidden,function(){b.destroy()});b.show()}).catch(c.exception)})};function i(a,d){var e="success";b.call([{methodname:"core_contentbank_delete_content",args:{contentids:{contentid:a}}}])[0].then(function(a){if(a.result){return"contentdeleted"}e="error";return"contentnotdeleted"}).done(function(a){var b={contextid:d};if("success"==e){b.statusmsg=a}else{b.errormsg=a}window.location.href=f.relativeUrl("contentbank/index.php",b,!1)}).fail(c.exception)}function j(a,d){var e="success";b.call([{methodname:"core_contentbank_rename_content",args:{contentid:a,name:d}}])[0].then(function(a){if(a.result){return"contentrenamed"}e="error";return a.warnings[0].message}).then(function(b){var d=null;if("success"==e){d={id:a,statusmsg:b};window.location.href=f.relativeUrl("contentbank/view.php",d,!1)}else{c.addNotification({message:b,type:"error"});c.fetchNotifications()}}).catch(c.exception)}return{init:function init(){return new l}}});
define ("core_contentbank/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var b=function(a,b){return"[data-".concat(a,"=\"").concat(b,"\"]")},c={regions:{cbcontentname:b("region","cb-content-name"),contentbank:b("region","contentbank"),filearea:b("region","filearea")},actions:{search:b("action","searchcontent"),clearSearch:b("action","clearsearch"),viewgrid:b("action","viewgrid"),viewlist:b("action","viewlist"),sortname:b("action","sortname"),sortdate:b("action","sortdate"),sortsize:b("action","sortsize"),sorttype:b("action","sorttype"),sortauthor:b("action","sortauthor")},elements:{listitem:".cb-listitem",cbnavbarbreadcrumb:".cb-navbar-breadbrumb",cbnavbartotalsearch:".cb-navbar-totalsearch",searchinput:"#searchinput",sortbutton:".cb-btnsort"}};a.default=c;return a.default});
define ("core_contentbank/sort",["exports","./selectors","core/str","core/prefetch","core/ajax","core/notification"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=g(b);d=g(d);e=g(e);f=g(f);function g(a){return a&&a.__esModule?a:{default:a}}var h=function(){var a=document.querySelector(b.default.regions.contentbank);d.default.prefetchStrings("contentbank",["contentname","lastmodified","size","type","author"]);d.default.prefetchStrings("moodle",["sortbyx","sortbyxreverse"]);i(a)};a.init=h;var i=function(a){a.addEventListener("click",function(c){var d=a.querySelector(b.default.actions.viewlist),e=a.querySelector(b.default.actions.viewgrid);if(c.target.closest(b.default.actions.viewgrid)){a.classList.remove("view-list");a.classList.add("view-grid");e.classList.add("active");d.classList.remove("active");j(!1);return}if(c.target.closest(b.default.actions.viewlist)){a.classList.remove("view-grid");a.classList.add("view-list");d.classList.add("active");e.classList.remove("active");j(!0);return}var f=document.querySelector(b.default.regions.filearea),g=f.querySelectorAll(b.default.elements.listitem);if(f&&g){var h=c.target.closest(b.default.actions.sortname);if(h){var i=k(a,h);m(f,g,"data-file",i);return}var l=c.target.closest(b.default.actions.sortdate);if(l){var n=k(a,l);m(f,g,"data-timemodified",n);return}var o=c.target.closest(b.default.actions.sortsize);if(o){var p=k(a,o);m(f,g,"data-bytes",p);return}var q=c.target.closest(b.default.actions.sorttype);if(q){var r=k(a,q);m(f,g,"data-type",r);return}var s=c.target.closest(b.default.actions.sortauthor);if(s){var t=k(a,s);m(f,g,"data-author",t)}}})},j=function(a){if(!1===a){a=null}var b={methodname:"core_user_update_user_preferences",args:{preferences:[{type:"core_contentbank_view_list",value:a}]}};return e.default.call([b])[0].catch(f.default.exception)},k=function(a,c){var d=a.querySelectorAll(b.default.elements.sortbutton);d.forEach(function(a){if(a!==c){a.classList.remove("dir-asc");a.classList.remove("dir-desc");a.classList.add("dir-none");l(a,!1)}});var e=!0;if(c.classList.contains("dir-none")){c.classList.remove("dir-none");c.classList.add("dir-asc")}else if(c.classList.contains("dir-asc")){c.classList.remove("dir-asc");c.classList.add("dir-desc");e=!1}else if(c.classList.contains("dir-desc")){c.classList.remove("dir-desc");c.classList.add("dir-asc")}l(c,e);return e},l=function(a,b){var d=b?"sortbyxreverse":"sortbyx";return(0,c.get_string)(a.dataset.string,"contentbank").then(function(a){return(0,c.get_string)(d,"core",a)}).then(function(b){a.setAttribute("title",b);return b}).catch()},m=function(a,b,c,d){var e=[].slice.call(b).sort(function(e,a){var b=e.getAttribute(c),f=a.getAttribute(c);if(!isNaN(b)){b=parseInt(b);f=parseInt(f)}if(d){return b>f?1:-1}else{return b<f?1:-1}});e.forEach(function(b){return a.appendChild(b)})}});
define ("core_course/events",[],function(){return{favourited:"core_course:favourited",unfavorited:"core_course:unfavorited"}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_course/downloadcontent",["exports","core/config","core/custom_interaction_events","core/modal_factory","jquery","core/pending","core/key_codes"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=j(b);c=j(c);d=i(d);e=j(e);f=j(f);function h(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;h=function(){return a};return a}function i(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=h();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function j(a){return a&&a.__esModule?a:{default:a}}var k=function(){var a=new f.default;(0,e.default)("[data-downloadcourse]").on("click keydown",function(a){if("click"===a.type||a.which===g.enter||a.which===g.space){a.preventDefault();l(a.currentTarget)}});a.resolve()};a.init=k;var l=function(a){d.create({title:a.dataset.downloadTitle,type:d.types.SAVE_CANCEL,body:"<p>".concat(a.dataset.downloadBody,"</p>"),buttons:{save:a.dataset.downloadButtonText},templateContext:{classes:"downloadcoursecontentmodal"}}).then(function(b){b.show();var d=document.querySelector(".modal .downloadcoursecontentmodal [data-action=\"save\"]"),f=document.querySelector(".modal .downloadcoursecontentmodal [data-action=\"cancel\"]"),g=document.querySelector(".modal[data-region=\"modal-container\"]");(0,e.default)(d).on(c.default.events.activate,function(c){return m(c,a,b)});(0,e.default)(f).on(c.default.events.activate,function(){b.destroy()});if(g.querySelector(".downloadcoursecontentmodal")){(0,e.default)(g).on(c.default.events.activate,function(){b.destroy()})}})},m=function(a,c,d){a.preventDefault();var e=document.createElement("form");e.action=c.dataset.downloadLink;e.method="POST";e.target="_blank";var f=document.createElement("input");f.name="sesskey";f.value=b.default.sesskey;e.appendChild(f);e.style.display="none";document.body.appendChild(e);e.submit();document.body.removeChild(e);d.destroy()}});
define ("core_course/copy_modal",["jquery","core/str","core/modal_factory","core/modal_events","core/ajax","core/fragment","core/notification","core/config"],function(a,b,c,d,f,g,h,i){var m={},n,o,p,q="<p class=\"text-center\"><i class=\"fa fa-spinner fa-pulse fa-2x fa-fw\"></i></p>";function j(){b.get_string("loading").then(function(a){c.create({type:c.types.DEFAULT,title:a,body:q,large:!0}).done(function(a){p=a;p.getRoot().on("click","#id_submitreturn",l);p.getRoot().on("click","#id_submitdisplay",function(a){a.formredirect=!0;l(a)});p.getRoot().on("click","#id_cancel",function(a){a.preventDefault();p.setBody(q);p.hide()})})}).catch(function(){h.exception(new Error("Failed to load string: loading"))})}function k(a){if("undefined"==typeof a){a={}}var c={jsonformdata:JSON.stringify(a),courseid:o.id};p.setBody(q);b.get_string("copycoursetitle","backup",o.shortname).then(function(a){p.setTitle(a);p.setBody(g.loadFragment("course","new_base_form",n,c))}).catch(function(){h.exception(new Error("Failed to load string: copycoursetitle"))})}function l(b){b.preventDefault();var c=p.getRoot().find("form").serialize(),d=JSON.stringify(c),e=a.merge(p.getRoot().find("[aria-invalid=\"true\"]"),p.getRoot().find(".error"));if(e.length){e.first().focus();return}f.call([{methodname:"core_backup_submit_copy_form",args:{jsonformdata:d}}])[0].done(function(){p.setBody(q);p.hide();if(!0==b.formredirect){var a=i.wwwroot+"/backup/copyprogress.php?id="+o.id;window.location.assign(a)}}).fail(function(){k(c)})}m.init=function(b){n=b;j();a(".action-copy").on("click",function(a){a.preventDefault();var b=new URL(this.getAttribute("href")),c=new URLSearchParams(b.search),d=c.get("id");f.call([{methodname:"core_course_get_courses",args:{options:{ids:[d]}}}])[0].done(function(a){o=a[0];k()}).fail(function(){h.exception(new Error("Failed to load course"))});p.show()})};return m});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_course/local/activitychooser/dialogue",["exports","jquery","core/modal_events","core_course/local/activitychooser/selectors","core/templates","core/key_codes","core/loadingicon","core_course/local/activitychooser/repository","core/notification","core/utils"],function(a,b,c,d,e,f,g,h,i,j){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.displayChooser=void 0;b=m(b);c=l(c);d=m(d);e=l(e);h=l(h);i=m(i);var v="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function k(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;k=function(){return a};return a}function l(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=k();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function m(a){return a&&a.__esModule?a:{default:a}}function n(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function o(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){n(h,d,e,f,g,"next",a)}function g(a){n(h,d,e,f,g,"throw",a)}f(void 0)})}}function p(a,b){return u(a)||t(a,b)||r(a,b)||q()}function q(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(a,b){if(!a)return;if("string"==typeof a)return s(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return s(a,b)}function s(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function t(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function u(a){if(Array.isArray(a))return a}var w=function(a){return"function"==typeof v.define&&v.define.amd?new Promise(function(b,c){v.require([a],b,c)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&v.require&&"component"===v.require.loader?Promise.resolve(require((a))):Promise.resolve(v[a])},x=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(null!==c&&!0===b.showFooter){c.setFooter(e.render("core_course/local/activitychooser/footer_partial",b))}var f=a.find(d.default.regions.help)[0];f.innerHTML="";f.classList.add("m-auto");var h=(0,g.addIconToContainer)(f),j=null,k=new Promise(function(a){j=a}),l=e.renderForPromise("core_course/local/activitychooser/help",b);Promise.all([l,h,k]).then(function(a){var b=p(a,1),c=b[0],d=c.html,g=c.js;return e.replaceNodeContents(f,d,g)}).then(function(){f.querySelector(d.default.regions.chooserSummary.header).focus();return f}).catch(i.default.exception);a.one("slid.bs.carousel",function(){j()});a.carousel("next")},y=function(){var a=o(regeneratorRuntime.mark(function a(b,c,d){var e,f,g,i;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:e=c.dataset.favourited;f=c.dataset.id;g=c.dataset.name;i=c.dataset.internal;if(!("true"===e)){a.next=10;break}a.next=7;return h.unfavouriteModule(g,f);case 7:d(i,!1,b);a.next=13;break;case 10:a.next=12;return h.favouriteModule(g,f);case 12:d(i,!0,b);case 13:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),z=function(a,c,f,g){var h=function(){var e=o(regeneratorRuntime.mark(function g(h){var e,i,j,k,l,m,n,o,p,q;return regeneratorRuntime.wrap(function(g){while(1){switch(g.prev=g.next){case 0:if(h.target.closest(d.default.actions.optionActions.showSummary)){e=(0,b.default)(a.getBody()[0].querySelector(d.default.regions.carousel));i=h.target.closest(d.default.regions.chooserOption.container);j=i.dataset.modname;k=c.get(j);k.showFooter=a.hasFooterContent();x(e,k,a)}if(!h.target.closest(d.default.actions.optionActions.manageFavourite)){g.next=10;break}l=h.target.closest(d.default.actions.optionActions.manageFavourite);g.next=5;return y(a.getBody()[0],l,f);case 5:m=a.getBody()[0].querySelector(d.default.elements.activetab).getAttribute("href");n=a.getBody()[0].querySelector(d.default.regions.getSectionChooserOptions(m));o=n.querySelector(d.default.regions.chooserOption.container);C(o,!0);A(a.getBody()[0],c,n,a);case 10:if(h.target.matches(d.default.actions.closeOption)){p=(0,b.default)(a.getBody()[0].querySelector(d.default.regions.carousel));p.carousel("prev");p.on("slid.bs.carousel",function(){var b=a.getBody()[0].querySelector(d.default.regions.modules),c=b.querySelector(d.default.regions.getModuleSelector(h.target.dataset.modname));c.focus()})}if(h.target.closest(d.default.actions.clearSearch)){q=a.getBody()[0].querySelector(d.default.actions.search);q.value="";q.focus();F(a,c,q.value)}case 12:case"end":return g.stop();}}},g)}));return function(){return e.apply(this,arguments)}}(),i=function(){var b=o(regeneratorRuntime.mark(function b(c){var d;return regeneratorRuntime.wrap(function(b){while(1){switch(b.prev=b.next){case 0:if(!(!0===g.footer)){b.next=6;break}b.next=3;return w(g.customfooterjs);case 3:d=b.sent;b.next=6;return d.footerClickListener(c,g,a);case 6:case"end":return b.stop();}}},b)}));return function(){return b.apply(this,arguments)}}();a.getBodyPromise().then(function(a){return a[0]}).then(function(a){(0,b.default)(a.querySelector(d.default.regions.carousel)).carousel({interval:!1,pause:!0,keyboard:!1});return a}).then(function(a){a.addEventListener("click",h);return a}).then(function(b){var e=b.querySelector(d.default.actions.search);e.addEventListener("input",(0,j.debounce)(function(){F(a,c,e.value)},300));return b}).then(function(b){var e=b.querySelector(d.default.elements.activetab).getAttribute("href"),f=b.querySelector(d.default.regions.getSectionChooserOptions(e)),g=f.querySelector(d.default.regions.chooserOption.container);C(g,!0);A(b,c,f,a);return b}).catch();a.getFooterPromise().then(function(a){return a[0]}).then(function(a){a.addEventListener("click",i);return a}).catch()},A=function(a,c,g){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null,i=g.querySelectorAll(d.default.regions.chooserOption.container);Array.from(i).forEach(function(e){return e.addEventListener("keydown",function(i){if(i.keyCode===f.enter||i.keyCode===f.space){if(i.target.matches(d.default.actions.optionActions.showSummary)){i.preventDefault();var e=i.target.closest(d.default.regions.chooserOption.container),j=e.dataset.modname,k=c.get(j),l=(0,b.default)(a.querySelector(d.default.regions.carousel));l.carousel({interval:!1,pause:!0,keyboard:!1});k.showFooter=h.hasFooterContent();x(l,k,h)}}if(i.keyCode===f.arrowRight){i.preventDefault();var m=i.target.closest(d.default.regions.chooserOption.container),n=m.nextElementSibling,o=g.firstElementChild,p=D(n,o);B(p,m)}if(i.keyCode===f.arrowLeft){i.preventDefault();var q=i.target.closest(d.default.regions.chooserOption.container),r=q.previousElementSibling,s=g.lastElementChild,t=D(r,s);B(t,q)}if(i.keyCode===f.home){i.preventDefault();var u=i.target.closest(d.default.regions.chooserOption.container),v=g.firstElementChild;B(v,u)}if(i.keyCode===f.end){i.preventDefault();var w=i.target.closest(d.default.regions.chooserOption.container),y=g.lastElementChild;B(y,w)}})})},B=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;if(null!==b){C(b,!1)}C(a,!0);a.focus()},C=function(a,b){var c=a.querySelector(d.default.actions.addChooser),e=a.querySelector(d.default.actions.optionActions.showSummary),f=a.querySelector(d.default.actions.optionActions.manageFavourite);if(b){a.tabIndex=0;c.tabIndex=0;e.tabIndex=0;f.tabIndex=0}else{a.tabIndex=-1;c.tabIndex=-1;e.tabIndex=-1;f.tabIndex=-1}},D=function(a,b){if(null!==a){return a}else{return b}},E=function(){var a=o(regeneratorRuntime.mark(function a(b,c){var d,f,g,h;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d={searchresultsnumber:c.length,searchresults:c};a.next=3;return e.renderForPromise("core_course/local/activitychooser/search_results",d);case 3:f=a.sent;g=f.html;h=f.js;a.next=8;return e.replaceNodeContents(b,g,h);case 8:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),F=function(){var a=o(regeneratorRuntime.mark(function a(b,c,e){var f,g,h,i,j,k,l;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f=b.getBody()[0];g=f.querySelector(d.default.regions.searchResults);h=f.querySelector(d.default.regions.chooser);i=f.querySelector(d.default.actions.clearSearch);if(!(0<e.length)){a.next=16;break}j=G(c,e);a.next=8;return E(g,j);case 8:k=g.querySelector(d.default.regions.searchResultItems);l=k.querySelector(d.default.regions.chooserOption.container);if(l){C(l,!0);A(f,c,k,b)}i.classList.remove("d-none");h.setAttribute("hidden","hidden");g.removeAttribute("hidden");a.next=19;break;case 16:i.classList.add("d-none");g.setAttribute("hidden","hidden");h.removeAttribute("hidden");case 19:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),G=function(a,b){if(""===b){return a}b=b.toLowerCase();var c=[];a.forEach(function(a){var d=a.title.toLowerCase(),e=a.help.toLowerCase();if(d.includes(b)||e.includes(b)){c.push(a)}});return c},H=function(a,c){a.getModal()[0].tabIndex=-1;a.getBodyPromise().then(function(f){(0,b.default)(d.default.elements.tab).on("shown.bs.tab",function(b){var e=b.target.getAttribute("href"),g=f[0].querySelector(d.default.regions.getSectionChooserOptions(e)),h=g.querySelector(d.default.regions.chooserOption.container),i=b.relatedTarget.getAttribute("href"),j=f[0].querySelector(d.default.regions.getSectionChooserOptions(i));I(j);C(h,!0);A(f[0],c,g,a)})}).catch(i.default.exception)},I=function(a){var b=a.querySelectorAll(d.default.regions.chooserOption.container);b.forEach(function(a){C(a,!1)})};a.displayChooser=function displayChooser(a,b,d,e){var f=new Map;b.forEach(function(a){f.set(a.componentname+"_"+a.link,a)});a.then(function(a){z(a,f,d,e);H(a,f);a.getRoot().on(c.hidden,function(){a.destroy()});return a}).catch()}});
define ("core_course/local/activitychooser/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var b=function(a,b){return"[data-".concat(a,"=\"").concat(b,"\"]")},c={regions:{chooser:b("region","chooser-container"),getSectionChooserOptions:function getSectionChooserOptions(a){return"".concat(a," ").concat(b("region","chooser-options-container"))},chooserOption:{container:b("region","chooser-option-container"),actions:b("region","chooser-option-actions-container"),info:b("region","chooser-option-info-container")},chooserSummary:{container:b("region","chooser-option-summary-container"),content:b("region","chooser-option-summary-content-container"),header:b("region","summary-header"),actions:b("region","chooser-option-summary-actions-container")},carousel:b("region","carousel"),help:b("region","help"),modules:b("region","modules"),favouriteTabNav:b("region","favourite-tab-nav"),defaultTabNav:b("region","default-tab-nav"),activityTabNav:b("region","activity-tab-nav"),favouriteTab:b("region","favourites"),recommendedTab:b("region","recommended"),defaultTab:b("region","default"),activityTab:b("region","activity"),resourceTab:b("region","resources"),getModuleSelector:function getModuleSelector(a){return"[role=\"menuitem\"][data-modname=\"".concat(a,"\"]")},searchResults:b("region","search-results-container"),searchResultItems:b("region","search-result-items-container")},actions:{optionActions:{showSummary:b("action","show-option-summary"),manageFavourite:b("action","manage-module-favourite")},addChooser:b("action","add-chooser-option"),closeOption:b("action","close-chooser-option-summary"),hide:b("action","hide"),search:b("action","search"),clearSearch:b("action","clearsearch")},render:{favourites:b("render","favourites-area")},elements:{section:".section",sectionmodchooser:"button.section-modchooser-link",sitemenu:".block_site_main_menu",sitetopic:"div.sitetopic",tab:"a[data-toggle=\"tab\"]",activetab:"a[data-toggle=\"tab\"][aria-selected=\"true\"]",visibletabs:"a[data-toggle=\"tab\"]:not(.d-none)"}};a.default=c;return a.default});
define ("core_course/local/activitychooser/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.fetchFooterData=a.unfavouriteModule=a.favouriteModule=a.activityModules=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){return b.default.call([{methodname:"core_course_get_course_content_items",args:{courseid:a}}])[0]};a.activityModules=c;var d=function(a,c){return b.default.call([{methodname:"core_course_add_content_item_to_user_favourites",args:{componentname:a,contentitemid:c}}])[0]};a.favouriteModule=d;var e=function(a,c){return b.default.call([{methodname:"core_course_remove_content_item_from_user_favourites",args:{componentname:a,contentitemid:c}}])[0]};a.unfavouriteModule=e;var f=function(a,c){return b.default.call([{methodname:"core_course_get_activity_chooser_footer",args:{courseid:a,sectionid:c}}])[0]};a.fetchFooterData=f});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_course/activitychooser",["exports","core_course/local/activitychooser/dialogue","core_course/local/activitychooser/repository","core_course/local/activitychooser/selectors","core/custom_interaction_events","core/templates","core/modal_factory","core/str","core/pending"],function(a,b,c,d,e,f,g,h,i){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=l(b);c=l(c);d=j(d);e=j(e);f=l(f);g=l(g);i=j(i);function j(a){return a&&a.__esModule?a:{default:a}}function k(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;k=function(){return a};return a}function l(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=k();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function m(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function n(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){m(h,d,e,f,g,"next",a)}function g(a){m(h,d,e,f,g,"throw",a)}f(void 0)})}}var o=2,p=function(a,b){var c=new i.default;q(a,b);c.resolve()};a.init=p;var q=function(a,g){var h=["click",e.default.events.activate,e.default.events.keyboardActivate],i=function(){var b=null;return function(){if(!b){b=new Promise(function(b){b(c.activityModules(a))})}return b}}(),j=function(){var b=null;return function(d){if(!b){b=new Promise(function(b){b(c.fetchFooterData(a,d))})}return b}}();e.default.define(document,h);h.forEach(function(a){document.addEventListener(a,function(){var a=n(regeneratorRuntime.mark(function a(c){var e,h,k,l,m,o,p,q,u;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:if(!c.target.closest(d.default.elements.sectionmodchooser)){a.next=21;break}h=c.target.closest(d.default.elements.section);k=c.target.closest(d.default.elements.sectionmodchooser);if(null!==h&&h.hasAttribute("data-sectionid")){e=h}else{e=k}m=new Promise(function(a){l=a});a.next=7;return j(e.dataset.sectionid);case 7:o=a.sent;p=t(m,o);a.next=11;return i().catch(function(){var a=n(regeneratorRuntime.mark(function a(b){var c;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c={errormessage:b.message};a.t0=l;a.next=4;return f.render("core_course/local/activitychooser/error",c);case 4:a.t1=a.sent;(0,a.t0)(a.t1);case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}());case 11:q=a.sent;if(q){a.next=14;break}return a.abrupt("return");case 14:u=r(q,e.dataset.sectionid,e.dataset.sectionreturnid);b.displayChooser(p,u,v(q,e.dataset.sectionid),o);a.t0=l;a.next=19;return f.render("core_course/activitychooser",s(u,g));case 19:a.t1=a.sent;(0,a.t0)(a.t1);case 21:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}())})},r=function(a,b,c){var d=JSON.parse(JSON.stringify(a));d.content_items.forEach(function(a){a.link+="&section="+b+"&sr="+(null!==c&&void 0!==c?c:0)});return d.content_items},s=function(a,b){var c=[],d=[],e=!0,f=!1,g=!1,h=parseInt(b.tabmode),i=a.filter(function(a){return!0===a.favourite}),j=a.filter(function(a){return!0===a.recommended});if((h===0||h===o)&&h!==1){c=a.filter(function(a){return a.archetype===0});d=a.filter(function(a){return a.archetype===1});f=!0;g=!0;if(h===o){e=!1}}var k=!!i.length,l=!1===e&&!1===k,m=!0===e&&!1===k;return{default:a,showAll:e,activities:c,showActivities:f,activitiesFirst:l,resources:d,showResources:g,favourites:i,recommended:j,favouritesFirst:k,fallback:m}},t=function(a,b){return g.create({type:g.types.DEFAULT,title:(0,h.get_string)("addresourceoractivity"),body:a,footer:b.customfootertemplate,large:!0,scrollable:!1,templateContext:{classes:"modchooser"}}).then(function(a){a.show();return a})},u=function(a,b){a.tabIndex=-1;a.classList.add("d-none");if(a.classList.contains("active")){a.classList.remove("active");a.setAttribute("aria-selected","false");var f=b.querySelector(d.default.regions.favouriteTab);f.classList.remove("active");var c=b.querySelector(d.default.regions.defaultTabNav),e=b.querySelector(d.default.regions.activityTabNav);if(!1===c.classList.contains("d-none")){c.classList.add("active");c.setAttribute("aria-selected","true");c.tabIndex=0;c.focus();var g=b.querySelector(d.default.regions.defaultTab);g.classList.add("active")}else{e.classList.add("active");e.setAttribute("aria-selected","true");e.tabIndex=0;e.focus();var h=b.querySelector(d.default.regions.activityTab);h.classList.add("active")}}},v=function(a,b){return function(){var c=n(regeneratorRuntime.mark(function c(e,g,h){var i,j,k,l,m,n,o,p,q,s,t;return regeneratorRuntime.wrap(function(c){while(1){switch(c.prev=c.next){case 0:i=h.querySelector(d.default.render.favourites);j=h.querySelectorAll("[data-internal=\"".concat(e,"\"] ").concat(d.default.actions.optionActions.manageFavourite));k=h.querySelector(d.default.regions.favouriteTabNav);l=a.content_items.find(function(a){var b=a.name;return b===e});m={};if(!l){c.next=27;break}if(!g){c.next=21;break}l.favourite=!0;m.content_items=a.content_items.filter(function(a){return!0===a.favourite});n=r(m,b);c.next=12;return f.renderForPromise("core_course/local/activitychooser/favourites",{favourites:n});case 12:o=c.sent;p=o.html;q=o.js;c.next=17;return f.replaceNodeContents(i,p,q);case 17:Array.from(j).forEach(function(a){a.classList.remove("text-muted");a.classList.add("text-primary");a.dataset.favourited="true";a.setAttribute("aria-pressed",!0);a.firstElementChild.classList.remove("fa-star-o");a.firstElementChild.classList.add("fa-star")});k.classList.remove("d-none");c.next=27;break;case 21:l.favourite=!1;s=i.querySelector("[data-internal=\"".concat(e,"\"]"));s.parentNode.removeChild(s);Array.from(j).forEach(function(a){a.classList.add("text-muted");a.classList.remove("text-primary");a.dataset.favourited="false";a.setAttribute("aria-pressed",!1);a.firstElementChild.classList.remove("fa-star");a.firstElementChild.classList.add("fa-star-o")});t=a.content_items.filter(function(a){return!0===a.favourite});if(0===t.length){u(k,h)}case 27:case"end":return c.stop();}}},c)}));return function(){return c.apply(this,arguments)}}()}});
define ("core_course/recommendations",["exports","core/ajax","core/notification"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}var e=function(a){var d={methodname:"core_course_toggle_activity_recommendation",args:{area:a.currentTarget.dataset.area,id:a.currentTarget.dataset.id}};b.default.call([d])[0].fail(c.default.exception)};a.init=function init(){var a=document.querySelectorAll("[data-area]");a.forEach(function(a){a.addEventListener("change",e)})}});
define ("core_course/actions",["jquery","core/ajax","core/templates","core/notification","core/str","core/url","core/yui","core/modal_factory","core/modal_events","core/key_codes","core/log"],function(a,b,c,d,e,f,g,h,i,j,k){var l={EDITINPROGRESS:"editinprogress",SECTIONDRAGGABLE:"sectiondraggable",EDITINGMOVE:"editing_move"},m={ACTIVITYLI:"li.activity",ACTIONAREA:".actions",ACTIVITYACTION:"a.cm-edit-action",MENU:".moodle-actionmenu[data-enhance=moodle-core-actionmenu]",TOGGLE:".toggle-display,.dropdown-toggle",SECTIONLI:"li.section",SECTIONACTIONMENU:".section_action_menu",ADDSECTIONS:"#changenumsections [data-add-sections]"};g.use("moodle-course-coursebase",function(){var a=M.course.format.get_section_selector();if(a){m.SECTIONLI=a}});var n=function(a){var b;g.use("moodle-course-util",function(c){b=c.Moodle.core_course.util.cm.getId(c.Node(a.get(0)))});return b},o=function(a){var b;g.use("moodle-course-util",function(c){b=c.Moodle.core_course.util.cm.getName(c.Node(a.get(0)))});return b},p=function(a){a.addClass(l.EDITINPROGRESS);var b=a.find(m.ACTIONAREA).get(0);if(b){var c=M.util.add_spinner(g,g.Node(b));c.show();return c}return null},q=function(a){a.addClass(l.EDITINPROGRESS);var b=a.find(m.SECTIONACTIONMENU).get(0);if(b){var c=M.util.add_spinner(g,g.Node(b));c.show();return c}return null},r=function(a){var b=M.util.add_lightbox(g,g.Node(a.get(0)));b.show();return b},s=function(a,b,c){window.setTimeout(function(){a.removeClass(l.EDITINPROGRESS);if(b){b.hide()}},c)},t=function(a,b){if(a){window.setTimeout(function(){a.hide()},b)}},u=function(a){g.use("moodle-course-coursebase",function(){M.course.coursebase.invoke_function("setup_for_resource","#"+a)});if(M.core.actionmenu&&M.core.actionmenu.newDOMNode){M.core.actionmenu.newDOMNode(g.one("#"+a))}},v=function(b,c){var d=a("#"+b),e="[data-action="+c+"]";if("groupsseparate"===c||"groupsvisible"===c||"groupsnone"===c){e="[data-action=groupsseparate],[data-action=groupsvisible],[data-action=groupsnone]"}if(d.find(e).is(":visible")){d.find(e).focus()}else{d.find(m.MENU).find(m.TOGGLE).focus()}},w=function(b){var c=a("a:visible"),d=!1,e=null;c.each(function(){if(a.contains(b[0],this)){d=!0}else if(d){e=this;return!1}});return e},x=function(c,e,f){var g=f.attr("data-action"),h=p(c),i=b.call([{methodname:"core_course_edit_module",args:{id:e,action:g,sectionreturn:f.attr("data-sectionreturn")?f.attr("data-sectionreturn"):0}}],!0),j;if("duplicate"===g){j=r(f.closest(m.SECTIONLI))}a.when.apply(a,i).done(function(b){var d=w(c);c.replaceWith(b);a("<div>"+b+"</div>").find(m.ACTIVITYLI).each(function(b){u(a(this).attr("id"));if(0===b){v(a(this).attr("id"),g);d=null}});if(d){d.focus()}s(c,h,400);t(j,400);c.trigger(a.Event("coursemoduleedited",{ajaxreturn:b,action:g}))}).fail(function(b){s(c,h);t(j);var f=a.Event("coursemoduleeditfailed",{exception:b,action:g});c.trigger(f);if(!f.isDefaultPrevented()){d.exception(b)}})},y=function(c,d,e){var f=p(c),g=b.call([{methodname:"core_course_get_module",args:{id:d,sectionreturn:e}}],!0);a.when.apply(a,g).done(function(a){s(c,f,400);D(a)}).fail(function(){s(c,f)})},z=function(a,b){var c=a.attr("class").match(/modtype_([^\s]*)/)[1],f=o(a);e.get_string("pluginname",c).done(function(a){e.get_strings([{key:"confirm"},{key:null===f?"deletechecktype":"deletechecktypename",param:{type:a,name:f}},{key:"yes"},{key:"no"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],b)})})},A=function(a,b){e.get_strings([{key:"confirm"},{key:"yes"},{key:"no"}]).done(function(c){d.confirm(c[0],a,c[1],c[2],b)})},B=function(a,b,f,g,h){return e.get_strings([{key:f,component:g}]).then(function(d){a.find("span.menu-action-text").html(d[0]);return c.renderPix(b,"core")}).then(function(b){a.find(".icon").replaceWith(b);a.attr("data-action",h)}).catch(d.exception)},C=function(b,c,d,e){var f=c.attr("data-action");if("hide"===f||"show"===f){if("hide"===f){b.addClass("hidden");B(c,"i/show","showfromothers","format_"+e,"show")}else{b.removeClass("hidden");B(c,"i/hide","hidefromothers","format_"+e,"hide")}if(d.modules!==void 0){for(var g in d.modules){D(d.modules[g])}}if(d.section_availability!==void 0){b.find(".section_availability").first().replaceWith(d.section_availability)}}else if("setmarker"===f){var h=a(m.SECTIONLI+".current"),i=h.find(m.SECTIONACTIONMENU+" a[data-action=removemarker]");h.removeClass("current");B(i,"i/marker","highlight","core","setmarker");b.addClass("current");B(c,"i/marked","highlightoff","core","removemarker")}else if("removemarker"===f){b.removeClass("current");B(c,"i/marker","highlight","core","setmarker")}},D=function(b){a("<div>"+b+"</div>").find(m.ACTIVITYLI).each(function(){var c=a(this).attr("id");a(m.ACTIVITYLI+"#"+c).replaceWith(b);u(c)})},E=function(c,e,f,g){var h=f.attr("data-action"),i=f.attr("data-sectionreturn")?f.attr("data-sectionreturn"):0,j=q(c),k=b.call([{methodname:"core_course_edit_section",args:{id:e,action:h,sectionreturn:i}}],!0),l=r(c);a.when.apply(a,k).done(function(b){var d=a.parseJSON(b);s(c,j);t(l);c.find(m.SECTIONACTIONMENU).find(m.TOGGLE).focus();var i=a.Event("coursesectionedited",{ajaxreturn:d,action:h});c.trigger(i);if(!i.isDefaultPrevented()){C(c,f,d,g)}}).fail(function(b){s(c,j);t(l);var f=a.Event("coursesectioneditfailed",{exception:b,action:h});c.trigger(f);if(!f.isDefaultPrevented()){d.exception(b)}})};g.use("moodle-course-coursebase",function(){M.course.coursebase.register_module({set_visibility_resource_ui:function set_visibility_resource_ui(b){var c=a(b.element.getDOMNode()),d=n(c);if(d){var e=c.find("."+l.EDITINGMOVE).attr("data-sectionreturn");y(c,d,e)}}})});return{initCoursePage:function initCoursePage(b){a("body").on("click keypress",m.ACTIVITYLI+" "+m.ACTIVITYACTION+"[data-action]",function(b){if("keypress"===b.type&&13!==b.keyCode){return}var c=a(this),d=c.closest(m.ACTIVITYLI),e=c.attr("data-action"),f=n(d);switch(e){case"moveleft":case"moveright":case"delete":case"duplicate":case"hide":case"stealth":case"show":case"groupsseparate":case"groupsvisible":case"groupsnone":break;default:return;}if(!f){return}b.preventDefault();if("delete"===e){z(d,function(){x(d,f,c)})}else{x(d,f,c)}});a("body").on("click keypress",m.SECTIONLI+" "+m.SECTIONACTIONMENU+"[data-sectionid] a[data-action]",function(c){if("keypress"===c.type&&13!==c.keyCode){return}var d=a(this),e=d.closest(m.SECTIONLI),f=d.closest(m.SECTIONACTIONMENU).attr("data-sectionid");c.preventDefault();if(d.attr("data-confirm")){A(d.attr("data-confirm"),function(){E(e,f,d,b)})}else{E(e,f,d,b)}});e.get_string("numberweeks").done(function(b){var c=a(m.ADDSECTIONS),d=c.attr("data-add-sections"),e=c.attr("data-new-sections"),f=a("<div><label for=\"add_section_numsections\"></label> <input id=\"add_section_numsections\" type=\"number\" min=\"1\" max=\""+e+"\" value=\"1\"></div>");f.find("label").html(b);h.create({title:d,type:h.types.SAVE_CANCEL,body:f.html()},c).done(function(b){var e=a(b.getBody()).find("#add_section_numsections"),f=function(){if(""+parseInt(e.val())===e.val()&&1<=parseInt(e.val())){document.location=c.attr("href")+"&numsections="+parseInt(e.val())}};b.setSaveButtonText(d);b.getRoot().on(i.shown,function(){e.focus().select().on("keydown",function(a){if(a.keyCode===j.enter){f()}})});b.getRoot().on(i.save,function(a){a.preventDefault();f()})})})},replaceSectionActionItem:function replaceSectionActionItem(a,b,c,d,e,f){k.debug("replaceSectionActionItem() is deprecated and will be removed.");var g=a.find(m.SECTIONACTIONMENU+" "+b);B(g,c,d,e,f)}}});
define ("core_course/repository",["jquery","core/ajax"],function(a,b){return{getEnrolledCoursesByTimelineClassification:function getEnrolledCoursesByTimelineClassification(a,c,d,e){var f={classification:a};if("undefined"!=typeof c){f.limit=c}if("undefined"!=typeof d){f.offset=d}if("undefined"!=typeof e){f.sort=e}return b.call([{methodname:"core_course_get_enrolled_courses_by_timeline_classification",args:f}])[0]},getLastAccessedCourses:function getLastAccessedCourses(a,c,d,e){var f={};if("undefined"!=typeof a){f.userid=a}if("undefined"!=typeof c){f.limit=c}if("undefined"!=typeof d){f.offset=d}if("undefined"!=typeof e){f.sort=e}return b.call([{methodname:"core_course_get_recent_courses",args:f}])[0]},getUsersFromCourseModuleID:function getEnrolledUsersFromCourseModuleID(a,c){return b.call([{methodname:"core_course_get_enrolled_users_by_cmid",args:{cmid:a,groupid:c}}])[0]}}});
define ("core_customfield/form",["jquery","core/str","core/notification","core/ajax","core/templates","core/sortable_list","core/pending","core/inplace_editable"],function(a,b,c,d,e,f,g){var h=function(f,h,i,j,k){var l=new g("core_customfield/form:confirmDelete");b.get_strings([{key:"confirm"},{key:"confirmdelete"+h,component:"core_customfield"},{key:"yes"},{key:"no"}]).then(function(b){c.confirm(b[0],b[1],b[2],b[3],function(){var b=new g("core_customfield/form:confirmDelete"),l="field"===h?"core_customfield_delete_field":"core_customfield_delete_category";d.call([{methodname:l,args:{id:f}},{methodname:"core_customfield_reload_template",args:{component:i,area:j,itemid:k}}])[1].then(function(a){return e.render("core_customfield/list",a)}).then(function(b,c){e.replaceNode(a("[data-region=\"list-page\"]"),b,c);return null}).then(b.resolve).catch(c.exception)})}).then(l.resolve).catch(c.exception)},i=function(b,f,h){var i=new g("core_customfield/form:confirmDelete"),j=d.call([{methodname:"core_customfield_create_category",args:{component:b,area:f,itemid:h}},{methodname:"core_customfield_reload_template",args:{component:b,area:f,itemid:h}}]),k;j[0].then(function(a){k=a;return null}).catch(c.exception);j[1].then(function(a){return e.render("core_customfield/list",a)}).then(function(b,c){e.replaceNode(a("[data-region=\"list-page\"]"),b,c);window.location.href="#category-"+k;return null}).catch(c.exception);Promise.all(j).then(i.resolve).catch()};return{init:function init(){var e=a("#customfield_catlist"),j=e.attr("data-component"),k=e.attr("data-area"),l=e.attr("data-itemid");a("[data-role=deletefield]").on("click",function(b){h(a(this).attr("data-id"),"field",j,k,l);b.preventDefault()});a("[data-role=deletecategory]").on("click",function(b){h(a(this).attr("data-id"),"category",j,k,l);b.preventDefault()});a("[data-role=addnewcategory]").on("click",function(){i(j,k,l)});var m=function(a){return a.closest("[data-category-id]").find("[data-inplaceeditable][data-itemtype=category][data-component=core_customfield]").attr("data-value")},n=new f(a("#customfield_catlist .categorieslist"),{moveHandlerSelector:".movecategory [data-drag-type=move]"});n.getElementName=function(b){return a.Deferred().resolve(m(b))};a("[data-category-id]").on("sortablelist-drop",function(a,b){if(b.positionChanged){var e=new g("core_customfield/form:categoryid:on:sortablelist-drop");d.call([{methodname:"core_customfield_move_category",args:{id:b.element.data("category-id"),beforeid:b.targetNextElement.data("category-id")}}])[0].then(e.resolve).catch(c.exception)}a.stopPropagation()});var o=new f(a("#customfield_catlist .fieldslist tbody"),{moveHandlerSelector:".movefield [data-drag-type=move]"});o.getDestinationName=function(c,d){if(!d.length){return b.get_string("totopofcategory","customfield",m(c))}else if(d.attr("data-field-name")){return b.get_string("afterfield","customfield",d.attr("data-field-name"))}else{return a.Deferred().resolve("")}};a("[data-field-name]").on("sortablelist-drop",function(a,b){a.stopPropagation();if(b.positionChanged){var e=new g("core_customfield/form:fieldname:on:sortablelist-drop");d.call([{methodname:"core_customfield_move_field",args:{id:b.element.data("field-id"),beforeid:b.targetNextElement.data("field-id"),categoryid:+b.targetList.closest("[data-category-id]").attr("data-category-id")}}])[0].then(e.resolve).catch(c.exception)}});a("[data-field-name]").on("sortablelist-drag",function(d){var e=new g("core_customfield/form:fieldname:on:sortablelist-drag");d.stopPropagation();b.get_string("therearenofields","core_customfield").then(function(b){a("#customfield_catlist .categorieslist").children().each(function(){var c=a(this).find(a(".field")),d=a(this).find(a(".nofields"));if(!c.length&&!d.length){a(this).find("tbody").append("<tr class=\"nofields\"><td colspan=\"5\">"+b+"</td></tr>")}if(c.length&&d.length){d.remove()}});return null}).then(e.resolve).catch(c.exception)});a("[data-category-id], [data-field-name]").on("sortablelist-dragstart",function(b,c){setTimeout(function(){a(".sortable-list-is-dragged").width(c.element.width())},501)})}}});
define ("core_form/defaultcustom",["jquery"],function(a){a("body").on("change","input[data-defaultcustom=true]",function onChangeSelect(b){var c=a(b.target),d=JSON.parse(c.attr("data-defaultvalue")),e=JSON.parse(c.attr("data-customvalue")),f=c.attr("data-type"),g=c.closest("form"),h=c.attr("name").replace(/\[customize\]$/,"[value]"),i=c.prop("checked")?e:d;if("text"===f){g.find("[name=\""+h+"\"]").val(i)}else if("date_selector"===f){g.find("[name=\""+h+"[day]\"]").val(i.day);g.find("[name=\""+h+"[month]\"]").val(i.month);g.find("[name=\""+h+"[year]\"]").val(i.year)}else if("date_time_selector"===f){g.find("[name=\""+h+"[day]\"]").val(i.day);g.find("[name=\""+h+"[month]\"]").val(i.month);g.find("[name=\""+h+"[year]\"]").val(i.year);g.find("[name=\""+h+"[hour]\"]").val(i.hour);g.find("[name=\""+h+"[minute]\"]").val(i.minute)}})});
define ("core_form/events",["exports","core/str"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.triggerUploadCompleted=a.triggerUploadStarted=a.types=void 0;var c;(0,b.get_string)("changesmadereallygoaway","moodle").then(function(a){c=a;return a}).catch();var d=function(a){if(a){a.returnValue=c}},e={uploadStarted:"core_form/uploadStarted",uploadCompleted:"core_form/uploadCompleted"};a.types=e;a.triggerUploadStarted=function triggerUploadStarted(a){window.addEventListener("beforeunload",d);var b=new CustomEvent(e.uploadStarted,{bubbles:!0,cancellable:!1}),c=document.getElementById(a);c.dispatchEvent(b);return b};a.triggerUploadCompleted=function triggerUploadCompleted(a){window.removeEventListener("beforeunload",d);var b=new CustomEvent(e.uploadCompleted,{bubbles:!0,cancellable:!1}),c=document.getElementById(a);c.dispatchEvent(b);return b}});
define ("core_form/filetypes",["jquery","core/log","core/str","core/modal_factory","core/modal_events","core/ajax","core/templates","core/tree"],function(a,b,c,d,e,f,g,h){"use strict";var i=function(c,d,e,f){this.elementId=c;this.elementLabel=d;this.onlyTypes=e;this.allowAll=f;this.inputField=a("#"+c);this.wrapperBrowserTrigger=a("[data-filetypesbrowser=\""+c+"\"]");this.wrapperDescriptions=a("[data-filetypesdescriptions=\""+c+"\"]");if(!this.wrapperBrowserTrigger.length){return}if(!this.inputField.length||!this.wrapperDescriptions.length){b.error("core_form/filetypes: Unexpected DOM structure, unable to enhance filetypes field "+c);return}this.prepareBrowserTrigger().then(function(){return this.prepareBrowserModal()}.bind(this)).then(function(){return this.prepareBrowserTree()}.bind(this))};i.prototype.prepareBrowserTrigger=function(){return g.render("core_form/filetypes-trigger",{}).then(function(a){this.wrapperBrowserTrigger.html(a);this.browserTrigger=this.wrapperBrowserTrigger.find("[data-filetypeswidget=\"browsertrigger\"]")}.bind(this))};i.prototype.prepareBrowserModal=function(){return d.create({type:d.types.SAVE_CANCEL,title:this.elementLabel}).then(function(a){this.browserModal=a}.bind(this)).then(function(){this.browserModal.getRoot().on(e.hidden,function(){this.browserTrigger.focus()}.bind(this));this.browserModal.getRoot().on(e.save,function(){this.saveBrowserModal()}.bind(this))}.bind(this))};i.prototype.prepareBrowserTree=function(){this.browserTrigger.on("click",function(b){b.preventDefault();if(this.inputField.is("[disabled]")){return}var c=this.loadBrowserModalBody();c.then(function(){this.browserTree=new h(this.browserModal.getBody());this.browserTree.handleKeyDown=function(a,b){if(b.keyCode==this.browserTree.keys.enter||b.keyCode==this.browserTree.keys.space){b.preventDefault();b.stopPropagation();this.toggleCheckbox(a.attr("data-filetypesbrowserkey"))}else{h.prototype.handleKeyDown.call(this.browserTree,a,b)}}.bind(this);if(this.allowAll){this.hideOrShowItemsDependingOnAllowAll(this.browserModal.getRoot().find("input[type=\"checkbox\"][data-filetypesbrowserkey=\"*\"]").first());this.browserModal.getRoot().on("change","input[type=\"checkbox\"][data-filetypesbrowserkey=\"*\"]",function(b){this.hideOrShowItemsDependingOnAllowAll(a(b.currentTarget))}.bind(this))}this.browserModal.getRoot().on("change","input[type=\"checkbox\"][data-filetypesbrowserkey]",function(b){var c=a(b.currentTarget),d=c.attr("data-filetypesbrowserkey");this.browserModal.getRoot().find("input[type=\"checkbox\"][data-filetypesbrowserkey=\""+d+"\"]").prop("checked",c.prop("checked"))}.bind(this))}.bind(this)).then(function(){this.browserModal.show()}.bind(this));this.browserModal.setBody(c)}.bind(this));return a.when()};i.prototype.loadBrowserModalBody=function(){var a={onlytypes:this.onlyTypes.join(),allowall:this.allowAll,current:this.inputField.val()};return f.call([{methodname:"core_form_get_filetypes_browser_data",args:a}])[0].then(function(a){return g.render("core_form/filetypes-browser",{elementid:this.elementId,groups:a.groups})}.bind(this))};i.prototype.toggleCheckbox=function(a){var b=this.browserModal.getRoot().find("input[type=\"checkbox\"][data-filetypesbrowserkey=\""+a+"\"]").first();b.prop("checked",!b.prop("checked"))};i.prototype.saveBrowserModal=function(){if(this.allowAll){var b=this.browserModal.getRoot().find("input[type=\"checkbox\"][data-filetypesbrowserkey=\"*\"]");if(b.length&&b.prop("checked")){this.inputField.val("*");this.updateDescriptions(["*"]);return}}var c=[];this.browserModal.getRoot().find("input[type=\"checkbox\"]").each(function(){var b=a(this),d=b.attr("data-filetypesbrowserkey");if(b.prop("checked")){c.push(d)}});c=c.filter(function(b,c,d){return d.indexOf(b)==c});this.inputField.val(c.join(" "));this.updateDescriptions(c)};i.prototype.updateDescriptions=function(a){var b=[];a.forEach(function(a){b.push({description:this.browserModal.getRoot().find("[data-filetypesname=\""+a+"\"]").first().text().trim(),extensions:this.browserModal.getRoot().find("[data-filetypesextensions=\""+a+"\"]").first().text().trim()})}.bind(this));var c={hasdescriptions:0<b.length,descriptions:b};return g.render("core_form/filetypes-descriptions",c).then(function(a){this.wrapperDescriptions.html(a)}.bind(this))};i.prototype.hideOrShowItemsDependingOnAllowAll=function(a){var b=this.browserModal.getRoot().find("[role=\"treeitem\"][data-filetypesbrowserkey!=\"*\"]");if(a.prop("checked")){b.hide()}else{b.show()}};return{init:function init(a,b,c,d){new i(a,b,c,d)}}});
define ("core_form/submit",["exports","core_form/events"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;var c=0,d=[],e=function(a){d.push(a);if(!c){c=setInterval(function(){var a=document.cookie.split(f()+"=");if(2==a.length){g();clearInterval(c);c=0;d.forEach(function(a){a.disabled=!1})}},500)}},f=function(){return"moodledownload_"+M.cfg.sesskey},g=function(){document.cookie=encodeURIComponent(f())+"=deleted; expires="+new Date(0).toUTCString()};a.init=function init(a){var c=document.getElementById(a);document.addEventListener(b.types.uploadStarted,function(a){window.console.log(a.target);c.disabled=!0});document.addEventListener(b.types.uploadCompleted,function(a){window.console.log(a.target);c.disabled=!1});if("off"===c.form.dataset.doubleSubmitProtection){return}c.form.addEventListener("submit",function(a){var b=function(){if(a.defaultPrevented||c.disabled){return}c.disabled=!0;g();e(c)};window.addEventListener("beforeunload",b);setTimeout(function(){window.removeEventListener("beforeunload",b)},0)},!1)}});
define ("core_form/showadvanced",["jquery","core/log","core/str","core/notification"],function(a,b,c,d){var f={FIELDSETCONTAINSADVANCED:"fieldset.containsadvancedelements",DIVFITEMADVANCED:"div.fitem.advanced",DIVADVANCEDSECTION:"div#form-advanced-div",DIVFCONTAINER:"div.fcontainer",MORELESSLINK:"fieldset.containsadvancedelements .moreless-toggler"},g={SHOW:"show",MORELESSACTIONS:"moreless-actions",MORELESSTOGGLER:"moreless-toggler",SHOWLESS:"moreless-less"},h={FITEM:"<div class=\"fitem\"></div>",FELEMENT:"<div class=\"felement\"></div>",ADVANCEDDIV:"<div id=\"form-advanced-div\"></div>"},i=0,j=function(b){this.id=b;var c=a(document.getElementById(b));this.enhanceForm(c)};j.prototype.id="";j.prototype.enhanceForm=function(b){var c=b.find(f.FIELDSETCONTAINSADVANCED);c.each(function(b,c){this.enhanceFieldset(a(c))}.bind(this));b.on("click",f.MORELESSLINK,this.switchState);b.on("keydown",f.MORELESSLINK,function(a){if(13==a.which||32==a.which){return this.switchState(a)}return!0}.bind(this));return this};j.prototype.generateId=function(a){var b=a.prop("id");if("undefined"==typeof b){b="showadvancedid-"+i++;a.prop("id",b)}return b};j.prototype.enhanceFieldset=function(e){var i=a("input[name=mform_showmore_"+e.prop("id")+"]");if(!i.length){b.debug("M.form.showadvanced::processFieldset was called on an fieldset without a status field: '"+e.prop("id")+"'");return this}c.get_strings([{key:"showmore",component:"core_form"},{key:"showless",component:"core_form"}]).then(function(b){var c=b[0],d=b[1],j=a("<a href=\"#\"></a>");j.addClass(g.MORELESSTOGGLER);if("0"===i.val()){j.html(c);j.attr("aria-expanded","false")}else{j.html(d);j.attr("aria-expanded","true");j.addClass(g.SHOWLESS);e.find(f.DIVFITEMADVANCED).addClass(g.SHOW)}var k=[];e.find(f.DIVFITEMADVANCED).each(function(b,c){k[k.length]=this.generateId(a(c))}.bind(this));j.attr("role","button");j.attr("aria-controls","form-advanced-div");var l=a(h.ADVANCEDDIV);e.find(f.DIVFITEMADVANCED).wrapAll(l);var m=a(h.FITEM);m.addClass(g.MORELESSACTIONS);var n=a(h.FELEMENT);n.append(j);m.append(n);e.find(f.DIVADVANCEDSECTION).before(m);return!0}.bind(this)).fail(d.exception);return this};j.prototype.switchState=function(b){b.preventDefault();c.get_strings([{key:"showmore",component:"core_form"},{key:"showless",component:"core_form"}]).then(function(c){var d=c[0],e=c[1],h=a(b.target).closest(f.FIELDSETCONTAINSADVANCED);h.find(f.DIVFITEMADVANCED).toggleClass(g.SHOW);var i=a("input[name=mform_showmore_"+h.prop("id")+"]");if("0"===i.val()){i.val(1);a(b.target).addClass(g.SHOWLESS);a(b.target).html(e);a(b.target).attr("aria-expanded","true")}else{i.val(0);a(b.target).removeClass(g.SHOWLESS);a(b.target).html(d);a(b.target).attr("aria-expanded","false")}return!0}).fail(d.exception);return this};return{init:function init(a){return new j(a)}}});
define ("core_form/passwordunmask",["jquery","core/templates"],function(a,b){var c=function(b){this.wrapperSelector="[data-passwordunmask=\"wrapper\"][data-passwordunmaskid=\""+b+"\"]";this.wrapper=a(this.wrapperSelector);this.editorSpace=this.wrapper.find("[data-passwordunmask=\"editor\"]");this.editLink=this.wrapper.find("a[data-passwordunmask=\"edit\"]");this.editInstructions=this.wrapper.find("[data-passwordunmask=\"instructions\"]");this.displayValue=this.wrapper.find("[data-passwordunmask=\"displayvalue\"]");this.inputFieldLabel=a("label[for=\""+b+"\"]");this.inputField=this.editorSpace.find(document.getElementById(b));this.inputField.attr("type","hidden");this.inputField.removeClass("hiddenifjs");if(!this.editInstructions.attr("id")){this.editInstructions.attr("id",b+"_instructions")}this.editInstructions.hide();this.setDisplayValue();this.addListeners()};c.prototype.addListeners=function(){this.wrapper.on("click keypress","[data-passwordunmask=\"edit\"]",a.proxy(function(b){if("keypress"===b.type&&13!==b.keyCode){return}b.stopImmediatePropagation();b.preventDefault();if("hidden"!==this.inputField.attr("type")){if("click"!==b.type&&!a(b.relatedTarget).is(":input")){this.turnEditingOff(!0)}else{this.turnEditingOff(!1)}}else{this.turnEditingOn()}},this));this.wrapper.on("click keypress","[data-passwordunmask=\"unmask\"]",a.proxy(function(a){if("keypress"===a.type&&13!==a.keyCode){return}a.stopImmediatePropagation();a.preventDefault();this.wrapper.data("unmasked",!this.wrapper.data("unmasked"));this.setDisplayValue()},this));this.wrapper.on("keydown","input",a.proxy(function(a){if("keydown"===a.type&&13!==a.keyCode){return}a.stopImmediatePropagation();a.preventDefault();this.turnEditingOff(!0)},this));this.inputFieldLabel.on("click",a.proxy(function(a){a.preventDefault();this.turnEditingOn()},this));return this};c.prototype.checkFocusOut=function(b){if(!this.isEditing()){return}window.setTimeout(a.proxy(function(){var c=b.relatedTarget||document.activeElement;if(this.wrapper.has(a(c)).length){return}this.turnEditingOff(!a(c).is(":input,a"))},this),100)};c.prototype.passwordVisible=function(){return!!this.wrapper.data("unmasked")};c.prototype.isEditing=function(){return"hidden"!==this.inputField.attr("type")};c.prototype.turnEditingOn=function(){var b=this.getDisplayValue();if(this.passwordVisible()){this.inputField.attr("type","text")}else{this.inputField.attr("type","password")}this.inputField.val(b);this.inputField.attr("size",this.inputField.attr("data-size"));if(this.editInstructions.length){this.inputField.attr("aria-describedby",this.editInstructions.attr("id"));this.editInstructions.show()}this.wrapper.attr("data-passwordunmask-visible",1);this.editLink.hide();this.inputField.focus().select();a("body").on("focusout",this.wrapperSelector,a.proxy(this.checkFocusOut,this));return this};c.prototype.turnEditingOff=function(b){a("body").off("focusout",this.wrapperSelector,this.checkFocusOut);var c=this.getDisplayValue();this.inputField.attr("type","hidden").attr("aria-describedby",null);this.inputField.val(c);this.editInstructions.hide();this.wrapper.removeAttr("data-passwordunmask-visible");this.inputField.removeAttr("size");this.editLink.show();this.setDisplayValue();if(b){this.editLink.focus()}return this};c.prototype.getDisplayValue=function(){return this.inputField.val()};c.prototype.setDisplayValue=function(){var c=this.getDisplayValue();if(this.isEditing()){if(this.wrapper.data("unmasked")){this.inputField.attr("type","text")}else{this.inputField.attr("type","password")}this.inputField.val(c)}if(c&&this.wrapper.data("unmasked")){this.displayValue.text(c)}else{if(!c){c=""}b.render("core_form/element-passwordunmask-fill",{element:{frozen:this.inputField.is("[readonly]"),value:c,valuechars:c.split("")}}).done(a.proxy(function(a,c){this.displayValue.html(a);b.runTemplateJS(c)},this))}return this};return c});
define ("core_grades/grades/grader/gradingpanel/comparison",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.compareData=a.fillInitialValues=void 0;var b=function(a){Array.prototype.forEach.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){}else if("radio"===a.type||"checkbox"===a.type){a.dataset.initialValue=JSON.stringify(a.checked)}else if("undefined"!=typeof a.value){a.dataset.initialValue=JSON.stringify(a.value)}else if("select-one"===a.type){Array.prototype.forEach.call(a.options,function(a){a.dataset.initialValue=JSON.stringify(a.selected)})}})};a.fillInitialValues=b;a.compareData=function compareData(a){var c=Array.prototype.some.call(a.elements,function(a){if("submit"===a.type||"button"===a.type){return!1}else if("radio"===a.type||"checkbox"===a.type){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.checked)}}else if("undefined"!=typeof a.value){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.value)}}else if("select-one"===a.type){return Array.prototype.some.call(a.options,function(a){if("undefined"!=typeof a.dataset.initialValue){return a.dataset.initialValue!==JSON.stringify(a.selected)}return!1})}return!0});b(a);return c}});
define ("core_grades/grades/grader/gradingpanel/scale",["exports","./repository","core_grades/grades/grader/gradingpanel/comparison","jquery","./normalise"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;d=function(a){return a&&a.__esModule?a:{default:a}}(d);a.fetchCurrentGrade=function fetchCurrentGrade(){return(0,b.fetchGrade)("scale").apply(void 0,arguments)};var f=function(a,f,g,h,i,j){var k=j.querySelector("form"),l=k.querySelector("select[name=\"grade\"]");if(!l.checkValidity()||!l.value.trim()){return e.invalidResult}if(!0===(0,c.compareData)(k)){return(0,b.saveGrade)("scale")(a,f,g,h,i,(0,d.default)(k).serialize())}else{return""}};a.storeCurrentGrade=f});
define ("core_grades/grades/grader/gradingpanel/point",["exports","./repository","core_grades/grades/grader/gradingpanel/comparison","jquery","./normalise"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;d=function(a){return a&&a.__esModule?a:{default:a}}(d);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function g(a){f(i,d,e,g,h,"next",a)}function h(a){f(i,d,e,g,h,"throw",a)}g(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(){return(0,b.fetchGrade)("point").apply(void 0,arguments)};var h=function(){var a=g(regeneratorRuntime.mark(function a(f,g,h,i,j,k){var l,m;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:l=k.querySelector("form");m=l.querySelector("input[name=\"grade\"]");if(!(!m.checkValidity()||!m.value.trim())){a.next=4;break}return a.abrupt("return",e.invalidResult);case 4:if(!(!0===(0,c.compareData)(l))){a.next=10;break}a.next=7;return(0,b.saveGrade)("point")(f,g,h,i,j,(0,d.default)(l).serialize());case 7:return a.abrupt("return",a.sent);case 10:return a.abrupt("return","");case 11:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
define ("core_grades/grades/grader/gradingpanel/normalise",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.failedUpdate=a.invalidResult=a.normaliseResult=void 0;a.normaliseResult=function normaliseResult(a){return{result:a,failed:!!a.warnings.length,success:!a.warnings.length,error:null}};a.invalidResult=function invalidResult(){return{success:!1,failed:!1,result:{},error:null}};a.failedUpdate=function failedUpdate(a){return{success:!1,failed:!0,result:{},error:a}}});
define ("core_grades/grades/grader/gradingpanel/repository",["exports","core/ajax","./normalise"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.saveGrade=a.fetchGrade=void 0;function d(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function e(a){return function(){var b=this,c=arguments;return new Promise(function(e,f){var i=a.apply(b,c);function g(a){d(i,e,f,g,h,"next",a)}function h(a){d(i,e,f,g,h,"throw",a)}g(void 0)})}}a.fetchGrade=function fetchGrade(a){return function(c,d,e,f){return(0,b.call)([{methodname:"core_grades_grader_gradingpanel_".concat(a,"_fetch"),args:{component:c,contextid:d,itemname:e,gradeduserid:f}}])[0]}};a.saveGrade=function saveGrade(a){return function(){var d=e(regeneratorRuntime.mark(function d(e,f,g,h,i,j){return regeneratorRuntime.wrap(function(d){while(1){switch(d.prev=d.next){case 0:d.t0=c.normaliseResult;d.next=3;return(0,b.call)([{methodname:"core_grades_grader_gradingpanel_".concat(a,"_store"),args:{component:e,contextid:f,itemname:g,gradeduserid:h,notifyuser:i,formdata:j}}])[0];case 3:d.t1=d.sent;return d.abrupt("return",(0,d.t0)(d.t1));case 5:case"end":return d.stop();}}},d)}));return function(){return d.apply(this,arguments)}}()}});
define ("core_grades/edittree_index",["jquery"],function(a){var b=function(){a("body").on("change",".weightoverride",b.toggleWeightInput);a("#menumoveafter").on("change",function(){var b=a(this).closest("form"),c=b.find("#bulkmoveinput");c.val(1);b.submit()})};b.toggleWeightInput=function(b){b.preventDefault();var c=a(this),d=c.closest("tr");a("input[name=\"weight_"+d.data("itemid")+"\"]").prop("disabled",!c.prop("checked"))};return{enhance:b}});
define ("core_h5p/editor_display",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a){var c=(0,b.default)("#"+a),d=(0,b.default)(".h5p-editor"),e=d.closest("form"),f=(0,b.default)("h5p-editor-upload"),g=(0,b.default)("input[name=\"h5plibrary\"]"),h=(0,b.default)("input[name=\"h5pparams\"]"),i=(0,b.default)("input[name=\"name\"]"),j=(0,b.default)("input[name=\"h5paction\"]");j.val("create");H5PEditor.init(e,j,f,c,d,g,h,"",i,function cancelSubmitCallback(a){return a.is("[name=\"cancel\"]")});document.querySelector("#"+a+" iframe").setAttribute("name","h5p-editor")};a.init=c});
define ("core_message/toggle_contact_button",["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e){var f=function(a){return"1"==a.attr("data-is-contact")},g=function(a){a.attr("data-is-contact","1")},h=function(a){a.attr("data-is-contact","0")},i=function(a){return a.attr("data-userid")},j=function(a){return a.attr("data-currentuserid")},k=function(a){return a.hasClass("loading")||a.attr("disabled")},l=function(c,e){if(k(c)){return a.Deferred()}c.addClass("loading");c.attr("disabled","disabled");return b.call([e])[0].fail(d.exception).always(function(){c.removeClass("loading");c.removeAttr("disabled")})},m=function(a){if(k(a)){return}var b={methodname:"core_message_create_contact_request",args:{userid:j(a),requesteduserid:i(a)}};l(a,b).done(function(){g(a);c.render("message/remove_contact_button",{}).done(function(b,d){c.replaceNodeContents(a,b,d)})})},n=function(a){if(k(a)){return}var b={methodname:"core_message_delete_contacts",args:{userids:[i(a)]}};l(a,b).done(function(){h(a);c.render("message/add_contact_button",{}).done(function(b,d){c.replaceNodeContents(a,b,d)})})};return{enhance:function enhance(b){b=a(b);if(!b.children(".loading-icon").length){c.render("core/loading",{}).done(function(a,c){b.append(a,c)})}e.define(b,[e.events.activate]);b.on(e.events.activate,function(a,c){if(f(b)){n(b)}else{m(b)}a.preventDefault();c.originalEvent.preventDefault()})}}});
define ("core_message/message_drawer_view_conversation_state_manager",["jquery"],function(a){var b=function(b){return a.extend(!0,{},b)},c=function(a,b,c){return a.map(function(a){var d=a.useridfrom==b;return{id:""+a.id,fromLoggedInUser:d,userFrom:c[a.useridfrom],text:a.text,timeCreated:a.timecreated?parseInt(a.timecreated,10):null}})},d=function(a){return a.map(function(a){return{id:a.id,fullname:a.fullname,profileurl:a.profileurl,profileimageurl:a.profileimageurl,profileimageurlsmall:a.profileimageurlsmall,isonline:a.isonline,showonlinestatus:a.showonlinestatus,isblocked:a.isblocked,iscontact:a.iscontact,isdeleted:a.isdeleted,canmessage:a.canmessage,canmessageevenifblocked:a.canmessageevenifblocked,requirescontact:a.requirescontact,contactrequests:a.contactrequests||[]}})};return{buildInitialState:function buildInitialState(a,b,c,d,e,f){return{midnight:a,loggedInUserId:b,id:c,messagePollMin:d,messagePollMax:e,messagePollAfterMax:f,name:null,subname:null,type:null,totalMemberCount:null,imageUrl:null,isFavourite:null,isMuted:null,canDeleteMessagesForAllUsers:!1,deleteMessagesForAllUsers:!1,members:{},messages:[],hasTriedToLoadMessages:!1,loadingMessages:!0,loadingMembers:!0,loadingConfirmAction:!1,pendingBlockUserIds:[],pendingUnblockUserIds:[],pendingRemoveContactIds:[],pendingAddContactIds:[],pendingDeleteMessageIds:[],pendingSendMessageIds:[],pendingDeleteConversation:!1,selectedMessageIds:[],showEmojiAutoComplete:!1,showEmojiPicker:!1}},addMessages:function addMessages(a,d){var e=b(a),f=c(d,a.loggedInUserId,a.members);f=f.map(function(a){a.sendState=null;a.timeAdded=Date.now();a.errorMessage=null;return a});var g=a.messages.concat(f);g.sort(function(c,a){if(null===c.timeCreated&&null===a.timeCreated){if(c.timeAdded<a.timeAdded){return-1}else if(c.timeAdded>a.timeAdded){return 1}}if(null===c.timeCreated&&null!==a.timeCreated){return 1}else if(null!==c.timeCreated&&null===a.timeCreated){return-1}else if(c.timeCreated<a.timeCreated){return-1}else if(c.timeCreated>a.timeCreated){return 1}else if(c.id<a.id){return-1}else if(c.id>a.id){return 1}else{return 0}});e.messages=g.filter(function(a,b,c){return!b||a.id!=c[b-1].id});return e},updateMessages:function updateMessages(d,e){var f=b(d),g=e.reduce(function(a,b){var e=b[0],f=b[1],g=c([f],d.loggedInUserId,d.members),h=g[0];a[e.id]=h;return a},{});f.messages=f.messages.map(function(b){if(b.id in g){return a.extend(b,g[b.id])}else{return b}});return f},removeMessages:function removeMessages(a,c){var d=b(a),e=c.map(function(a){return""+a.id});d.messages=d.messages.filter(function(a){return 0>e.indexOf(a.id)});return d},removeMessagesById:function removeMessagesById(a,c){var d=b(a);c=c.map(function(a){return""+a});d.messages=d.messages.filter(function(a){return 0>c.indexOf(a.id)});return d},addMembers:function addMembers(a,c){var e=b(a),f=d(c);f.forEach(function(a){e.members[a.id]=a});return e},removeMembers:function removeMembers(a,c){var d=b(a);c.forEach(function(a){delete d.members[a.id]});return d},setLoadingMessages:function setLoadingMessages(a,c){var d=b(a);d.loadingMessages=c;if(a.loadingMessages&&!c){d.hasTriedToLoadMessages=!0}return d},setLoadingMembers:function setLoadingMembers(a,c){var d=b(a);d.loadingMembers=c;return d},setId:function setId(a,c){var d=b(a);d.id=c;return d},setName:function setName(a,c){var d=b(a);d.name=c;return d},setSubname:function setSubname(a,c){var d=b(a);d.subname=c;return d},setType:function setType(a,c){var d=b(a);d.type=c;return d},setIsFavourite:function setIsFavourite(a,c){var d=b(a);d.isFavourite=c;return d},setIsMuted:function setIsMuted(a,c){var d=b(a);d.isMuted=c;return d},setCanDeleteMessagesForAllUsers:function setCanDeleteMessagesForAllUsers(a,c){var d=b(a);d.canDeleteMessagesForAllUsers=c;return d},setDeleteMessagesForAllUsers:function setDeleteMessagesForAllUsers(a,c){var d=b(a);d.deleteMessagesForAllUsers=c;return d},setTotalMemberCount:function setTotalMemberCount(a,c){var d=b(a);d.totalMemberCount=c;return d},setImageUrl:function setImageUrl(a,c){var d=b(a);d.imageUrl=c;return d},setLoadingConfirmAction:function setLoadingConfirmAction(a,c){var d=b(a);d.loadingConfirmAction=c;return d},setPendingDeleteConversation:function setPendingDeleteConversation(a,c){var d=b(a);d.pendingDeleteConversation=c;return d},setMessagesSendPendingById:function setMessagesSendPendingById(a,c){var d=b(a);c=c.map(function(a){return""+a});d.messages.forEach(function(a){if(0<=c.indexOf(a.id)){a.sendState="pending";a.errorMessage=null}});return d},setMessagesSendSuccessById:function setMessagesSendSuccessById(a,c){var d=b(a);c=c.map(function(a){return""+a});d.messages.forEach(function(a){if(0<=c.indexOf(a.id)){a.sendState="sent";a.errorMessage=null}});return d},setMessagesSendFailById:function setMessagesSendFailById(a,c,d){var e=b(a);c=c.map(function(a){return""+a});e.messages.forEach(function(a){if(0<=c.indexOf(a.id)){a.sendState="error";a.errorMessage=d}});return e},setShowEmojiAutoComplete:function setShowEmojiAutoComplete(a,c){var d=b(a);d.showEmojiAutoComplete=c;return d},setShowEmojiPicker:function setShowEmojiPicker(a,c){var d=b(a);d.showEmojiPicker=c;return d},addPendingBlockUsersById:function addPendingBlockUsersById(a,c){var d=b(a);c.forEach(function(a){d.pendingBlockUserIds.push(a)});return d},addPendingRemoveContactsById:function addPendingRemoveContactsById(a,c){var d=b(a);c.forEach(function(a){d.pendingRemoveContactIds.push(a)});return d},addPendingUnblockUsersById:function addPendingUnblockUsersById(a,c){var d=b(a);c.forEach(function(a){d.pendingUnblockUserIds.push(a)});return d},addPendingAddContactsById:function addPendingAddContactsById(a,c){var d=b(a);c.forEach(function(a){d.pendingAddContactIds.push(a)});return d},addPendingDeleteMessagesById:function addPendingDeleteMessagesById(a,c){var d=b(a);c.forEach(function(a){d.pendingDeleteMessageIds.push(a)});return d},removePendingBlockUsersById:function removePendingBlockUsersById(a,c){var d=b(a);d.pendingBlockUserIds=d.pendingBlockUserIds.filter(function(a){return 0>c.indexOf(a)});return d},removePendingRemoveContactsById:function removePendingRemoveContactsById(a,c){var d=b(a);d.pendingRemoveContactIds=d.pendingRemoveContactIds.filter(function(a){return 0>c.indexOf(a)});return d},removePendingUnblockUsersById:function removePendingUnblockUsersById(a,c){var d=b(a);d.pendingUnblockUserIds=d.pendingUnblockUserIds.filter(function(a){return 0>c.indexOf(a)});return d},removePendingAddContactsById:function removePendingAddContactsById(a,c){var d=b(a);d.pendingAddContactIds=d.pendingAddContactIds.filter(function(a){return 0>c.indexOf(a)});return d},removePendingDeleteMessagesById:function removePendingDeleteMessagesById(a,c){var d=b(a);c=c.map(function(a){return""+a});d.pendingDeleteMessageIds=d.pendingDeleteMessageIds.filter(function(a){return 0>c.indexOf(a)});return d},addSelectedMessagesById:function addSelectedMessagesById(a,c){var d=b(a);c=c.map(function(a){return""+a});d.selectedMessageIds=d.selectedMessageIds.concat(c);return d},removeSelectedMessagesById:function removeSelectedMessagesById(a,c){var d=b(a);c=c.map(function(a){return""+a});d.selectedMessageIds=d.selectedMessageIds.filter(function(a){return 0>c.indexOf(a)});return d},markMessagesAsRead:function markMessagesAsRead(a,c){var d=b(a),e=c.map(function(a){return a.id});d.messages=d.messages.map(function(a){if(0<=e.indexOf(a.id)){a.isRead=!0}return a});return d},addContactRequests:function addContactRequests(a,c){var d=b(a);c.forEach(function(a){var b=a.userid,c=a.requesteduserid;d.members[b].contactrequests.push(a);d.members[c].contactrequests.push(a)});return d},removeContactRequests:function removeContactRequests(a,c){var d=b(a);c.forEach(function(a){var b=a.userid,c=a.requesteduserid;d.members[b].contactrequests=d.members[b].contactrequests.filter(function(a){return a.userid!=b});d.members[c].contactrequests=d.members[c].contactrequests.filter(function(a){return a.requesteduserid!=c})});return d}}});
define ("core_message/notification_processor_settings",["jquery","core/ajax","core/str","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/fragment"],function(a,b,c,d,e,f,g,h){var i=!1,j={SAVE_BUTTON:"[data-action=\"save\"]",CANCEL_BUTTON:"[data-action=\"cancel\"]",PROCESSOR:"[data-processor-name]",PREFERENCE_ROW:"[data-region=\"preference-row\"]"},k=function(a){f.call(this,a);this.name=null;this.userId=null;this.contextId=null;this.element=null;this.saveButton=this.getFooter().find(j.SAVE_BUTTON);this.cancelButton=this.getFooter().find(j.CANCEL_BUTTON)};k.TYPE="core_message-notification_processor_settings";k.prototype=Object.create(f.prototype);k.prototype.constructor=k;k.prototype.setUserId=function(a){this.userId=a};k.prototype.getUserId=function(){return this.userId};k.prototype.setElement=function(a){this.element=a};k.prototype.getElement=function(){return this.element};k.prototype.setName=function(a){this.name=a};k.prototype.getName=function(){return this.name};k.prototype.setContextId=function(a){this.contextId=a};k.prototype.getContextId=function(){return this.contextId};k.prototype.getForm=function(){return this.getBody().find("form")};k.prototype.disableButtons=function(){this.saveButton.prop("disabled",!0);this.cancelButton.prop("disabled",!0)};k.prototype.enableButtons=function(){this.saveButton.prop("disabled",!1);this.cancelButton.prop("disabled",!1)};k.prototype.loadTitleContent=function(){this.titlePromise=c.get_string("processorsettings","message");this.setTitle(this.titlePromise);return this.titlePromise};k.prototype.loadBodyContent=function(){this.disableButtons();var a={userid:this.getUserId(),type:this.getName()};this.bodyPromise=h.loadFragment("message","processor_settings",this.getContextId(),a);this.setBody(this.bodyPromise);this.bodyPromise.then(function(){this.enableButtons()}.bind(this)).fail(d.exception);return this.bodyPromise};k.prototype.loadAllContent=function(){return a.when(this.loadTitleContent(),this.loadBodyContent())};k.prototype.show=function(){this.loadAllContent();f.prototype.show.call(this)};k.prototype.hide=function(){f.prototype.hide.call(this);this.setContextId(null);this.setName(null);this.setUserId(null)};k.prototype.updateConfiguredStatus=function(){var c=a(this.getElement()).closest(j.PROCESSOR);if(!c.hasClass("unconfigured")){return!1}var e=c.attr("data-processor-name"),f={methodname:"core_message_get_message_processor",args:{name:e,userid:this.userId}};return b.call([f])[0].fail(d.exception).done(function(b){if(b.userconfigured){var d=a(j.PREFERENCE_ROW+" [data-processor-name=\""+e+"\"]");c.removeClass("unconfigured");d.removeClass("disabled")}})};k.prototype.registerEventListeners=function(){f.prototype.registerEventListeners.call(this);this.getModal().on(e.events.activate,j.SAVE_BUTTON,function(a,b){this.getForm().submit();b.originalEvent.preventDefault()}.bind(this));this.getModal().on("mpp:formsubmitted",function(a){this.hide();this.updateConfiguredStatus();a.stopPropagation()}.bind(this));this.getModal().on(e.events.activate,j.CANCEL_BUTTON,function(a,b){this.hide();b.originalEvent.preventDefault();a.stopPropagation()}.bind(this))};if(!i){g.register(k.TYPE,k,"core/modal_save_cancel");i=!0}return k});
function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}f(void 0)})}}define ("core_message/message_drawer_view_overview_section",["jquery","core/custom_interaction_events","core/notification","core/pubsub","core/str","core/pending","core/templates","core/user_date","core_message/message_repository","core_message/message_drawer_events","core_message/message_drawer_router","core_message/message_drawer_routes","core_message/message_drawer_lazy_load_list","core_message/message_drawer_view_conversation_constants"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o={TOGGLE:"[data-region=\"toggle\"]",CONVERSATION:"[data-conversation-id]",BLOCKED_ICON_CONTAINER:"[data-region=\"contact-icon-blocked\"]",LAST_MESSAGE:"[data-region=\"last-message\"]",LAST_MESSAGE_DATE:"[data-region=\"last-message-date\"]",MUTED_ICON_CONTAINER:"[data-region=\"muted-icon-container\"]",UNREAD_COUNT:"[data-region=\"unread-count\"]",SECTION_TOTAL_COUNT:"[data-region=\"section-total-count\"]",SECTION_TOTAL_COUNT_CONTAINER:"[data-region=\"section-total-count-container\"]",SECTION_UNREAD_COUNT:"[data-region=\"section-unread-count\"]",PLACEHOLDER_CONTAINER:"[data-region=\"placeholder-container\"]"},p={CONVERSATIONS_LIST:"core_message/message_drawer_conversations_list",CONVERSATIONS_LIST_ITEMS_PLACEHOLDER:"core_message/message_drawer_conversations_list_items_placeholder"},q=50,r={},s={},t=!1,u=!1,v=function(a){return m.getRoot(a).hasClass("show")},w=function(a){a.addClass("expanded")},x=function(a){a.removeClass("expanded")},y=function(a,b){var c=a.find(o.SECTION_TOTAL_COUNT_CONTAINER),d=c.find(o.SECTION_TOTAL_COUNT);d.text(b);c.removeClass("hidden");e.get_string("totalconversations","core_message",b).done(function(a){c.attr("aria-label",a)});var f=20<b?20:b,h=Array.apply(null,Array(f)).map(function(){return!0});g.render(p.CONVERSATIONS_LIST_ITEMS_PLACEHOLDER,{placeholders:h}).then(function(b){var c=a.find(o.PLACEHOLDER_CONTAINER);c.html(b)}).catch(function(){})},z=function(a,b){var c=a.find(o.SECTION_UNREAD_COUNT);c.text(b);e.get_string("unreadconversations","core_message",b).done(function(a){c.attr("aria-label",a)});if(0<b){c.removeClass("hidden")}},A=function(b){var c=function(b){return Object.keys(b).reduce(function(d,e){if(a.isArray(b[e])){d[e.toLowerCase()]=b[e].map(c)}else{d[e.toLowerCase()]=b[e]}return d},{})},d=c(b);d.messages=d.messages.map(function(a){a.useridfrom=a.userfrom.id;return a});return d},B=function(b,d){var h=new f,i=function(){var b=_asyncToGenerator(regeneratorRuntime.mark(function b(d){var f,h,i,j,k,l,m;return regeneratorRuntime.wrap(function(b){while(1){switch(b.prev=b.next){case 0:if(d){b.next=2;break}return b.abrupt("return",null);case 2:f=document.createElement("element");f.innerHTML=d.text.replace(/<img /g,"<noimg ");h=f.querySelector("[src]")||!1;if(h){b.next=10;break}i=a(d.text).text();if(!i){b.next=10;break}if(!(-1==i.indexOf("<"))){b.next=10;break}return b.abrupt("return",i);case 10:j="i/messagecontentmultimediageneral";k="messagecontentmultimediageneral";if(d.text.includes("<img")){j="i/messagecontentimage";k="messagecontentimage"}else if(d.text.includes("<video")){j="i/messagecontentvideo";k="messagecontentvideo"}else if(d.text.includes("<audio")){j="i/messagecontentaudio";k="messagecontentaudio"}b.prev=13;b.next=16;return e.get_string(k,"core_message");case 16:l=b.sent;b.next=19;return g.renderPix(j,"core",l);case 19:m=b.sent;return b.abrupt("return",m+" "+l);case 23:b.prev=23;b.t0=b["catch"](13);c.exception(b.t0);return b.abrupt("return",null);case 27:case"end":return b.stop();}}},b,null,[[13,23]])}));return function(){return b.apply(this,arguments)}}(),j=b.map(function(a){var b=a.messages.length?a.messages[a.messages.length-1]:null;return i(b).then(function(c){var e={id:a.id,imageurl:a.imageurl,name:a.name,subname:a.subname,unreadcount:a.unreadcount,ismuted:a.ismuted,lastmessagedate:b?b.timecreated:null,sentfromcurrentuser:b?b.useridfrom==d:null,lastmessage:c},f=null;if(a.type==n.CONVERSATION_TYPES.SELF){f=a.members[0]}else if(a.type==n.CONVERSATION_TYPES.PRIVATE){f=a.members.reduce(function(a,b){if(!a&&b.id!=d){a=b}return a},null)}if(null!==f){e.userid=f.id;e.showonlinestatus=f.showonlinestatus;e.isonline=f.isonline;e.isblocked=f.isblocked}if(a.type==n.CONVERSATION_TYPES.PUBLIC){e.lastsendername=a.members.reduce(function(a,c){if(!a&&b&&c.id==b.useridfrom){a=c.fullname}return a},null)}return e}).catch(c.exception)});return Promise.all(j).then(function(a){a.forEach(function(a){if(new Date().toDateString()==new Date(1e3*a.lastmessagedate).toDateString()){a.istoday=!0}});return g.render(p.CONVERSATIONS_LIST,{conversations:a})}).then(function(b,c){h.resolve();return a.Deferred().resolve(b,c)}).catch(function(a){h.resolve();c.exception(a)})},C=function(a,b,d){var e=null,f=!0;if(a&&a.length){var g=a.filter(function(a){return a!=n.CONVERSATION_TYPES.SELF});f=a.length!=g.length;e=g[0]}return function(a,g){return i.getConversations(g,e,q+1,d,b,f).then(function(b){var c=b.conversations;if(c.length>q){c=c.slice(0,-1)}else{m.setLoadedAll(a,!0)}d=d+q;c.forEach(function(a){r[a.id]=a});return c}).catch(c.exception)}},D=function(a){return a.find(o.SECTION_TOTAL_COUNT)},E=function(a){return a.find(o.SECTION_UNREAD_COUNT)},F=function(a){if(t){var b=D(a),c=parseInt(b.text());c=c+1;b.text(c)}},G=function(a){if(t){var b=D(a),c=parseInt(b.text());c=c-1;b.text(c)}},H=function(a){if(u){var b=E(a),c=parseInt(b.text());c=c-1;b.text(c);if(1>c){b.addClass("hidden")}}},I=function(a,b){return a.find("[data-conversation-id=\""+b+"\"]")},J=function(a,b){return a.find("[data-user-id=\""+b+"\"]")},K=function(a){a.find(o.MUTED_ICON_CONTAINER).removeClass("hidden")},L=function(a){a.find(o.MUTED_ICON_CONTAINER).addClass("hidden")},M=function(a){a.find(o.BLOCKED_ICON_CONTAINER).removeClass("hidden")},N=function(a){a.find(o.BLOCKED_ICON_CONTAINER).addClass("hidden")},O=function(a,b,d){var e=a.find(o.CONVERSATION);if(!e.length){var f=m.getRoot(a);m.showContent(f);m.hideEmptyMessage(f)}r[b.id]=b;return B([b],d).then(function(b){var c=m.getContentContainer(a);return c.prepend(b)}).then(function(){return F(a)}).catch(c.exception)},P=function(a,b){b.remove();G(a);var c=a.find(o.CONVERSATION);if(!c.length){var d=m.getRoot(a);m.hideContent(d);m.showEmptyMessage(d)}},Q=function(a,b){var c=b.find(o.UNREAD_COUNT);c.text("0");c.addClass("hidden");H(a)},R=function(g,h,i,n,p,q){var t=m.getRoot(h),u=function(a){var b=parseInt(a.type,10);if(n&&0>n.indexOf(b)||p&&!a.isFavourite||!p&&a.isFavourite){return!1}return!0},v=h.find(o.TOGGLE);h.css("min-height",v.outerHeight());h.on("show.bs.collapse",function(){w(h);m.show(t,i,function(a,b,d){return B(b,d).then(function(b){a.append(b);return b}).catch(c.exception)})});h.on("hidden.bs.collapse",function(){x(h)});d.subscribe(j.CONTACT_BLOCKED,function(a){var b=J(h,a);if(b.length){M(b)}});d.subscribe(j.CONTACT_UNBLOCKED,function(a){var b=J(h,a);if(b.length){N(b)}});d.subscribe(j.CONVERSATION_SET_MUTED,function(a){var b=a.id,c=I(h,b);if(c.length){K(c)}});d.subscribe(j.CONVERSATION_UNSET_MUTED,function(a){var b=a.id,c=I(h,b);if(c.length){L(c)}});d.subscribe(j.CONVERSATION_NEW_LAST_MESSAGE,function(a){if(!u(a)){return}var b=new f("core_message/message_drawer_view_overview_section:new"),d=a.loggedInUserId,e=a.id,g=I(h,e);a=A(a);if(g.length){var i=m.getContentContainer(h);B([a],d).then(function(b){if(s[e]){if(a.messages[0].timeadded<s[e]){return}}i.prepend(b);g.remove()}).then(b.resolve).catch(c.exception)}else if(a.messages.length){O(h,a,d).then(b.resolve).catch()}else{b.resolve()}});d.subscribe(j.CONVERSATION_DELETED,function(a){var b=I(h,a);delete r[a];s[a]=new Date;if(b.length){P(h,b)}});d.subscribe(j.CONVERSATION_READ,function(a){var b=I(h,a);if(b.length){Q(h,b)}});d.subscribe(j.CONVERSATION_SET_FAVOURITE,function(a){var b=null;if(u(a)){b=I(h,a.id);if(!b.length){O(h,A(a),a.loggedInUserId)}}else{b=I(h,a.id);if(b.length){P(h,b)}}});d.subscribe(j.CONVERSATION_UNSET_FAVOURITE,function(a){var b=null;if(u(a)){b=I(h,a.id);if(!b.length){O(h,A(a),a.loggedInUserId)}}else{b=I(h,a.id);if(b.length){P(h,b)}}});b.define(h,[b.events.activate]);h.on(b.events.activate,o.CONVERSATION,function(b,c){var d=a(b.target).closest(o.CONVERSATION),e=d.attr("data-conversation-id"),f=r[e];k.go(g,l.VIEW_CONVERSATION,f,q);c.originalEvent.preventDefault()})};return{show:function show(b,d,e,f,g,h,i,j,k){var l=a(e);if(!l.attr("data-init")){var n=C(g,h,0);R(b,l,n,g,h,k);if(v(l)){w(l);var o=m.getRoot(l);m.show(o,n,function(a,b,d){return B(b,d).then(function(b){a.append(b);return b}).catch(c.exception)})}i.then(function(a){y(l,a);t=!0}).catch(function(){});j.then(function(a){z(l,a);u=!0}).catch(function(){});l.attr("data-init",!0)}},isVisible:v}});
define ("core_message/message_drawer_view_contacts",["jquery","core/pubsub","core/str","core_message/message_drawer_events","core_message/message_drawer_view_contacts_section_contacts","core_message/message_drawer_view_contacts_section_requests"],function(a,b,c,d,e,f){var g={ACTION_SHOW_CONTACTS_SECTION:"[data-action=\"show-contacts-section\"]",ACTION_SHOW_REQUESTS_SECTION:"[data-action=\"show-requests-section\"]",CONTACT_REQUEST_COUNT:"[data-region=\"contact-request-count\"]",CONTACTS_SECTION_CONTAINER:"[data-section=\"contacts\"]",REQUESTS_SECTION_CONTAINER:"[data-section=\"requests\"]"},h=function(a){return a.find(g.CONTACTS_SECTION_CONTAINER)},i=function(a){return a.find(g.REQUESTS_SECTION_CONTAINER)},j=function(a){return a.find(g.ACTION_SHOW_CONTACTS_SECTION)},k=function(a){return a.find(g.ACTION_SHOW_REQUESTS_SECTION)},l=function(a){return a.hasClass("active")},m=function(a){return function(){var b=a.find(g.CONTACT_REQUEST_COUNT),c=parseInt(b.text(),10);c=isNaN(c)?0:c-1;if(0>=c){b.addClass("hidden")}else{b.text(c)}}},n=function(a){var c=h(a),g=i(a),l=j(a),n=k(a);l.on("show.bs.tab",function(){e.show(c)});n.on("show.bs.tab",function(){f.show(g)});b.subscribe(d.CONTACT_REQUEST_ACCEPTED,m(a));b.subscribe(d.CONTACT_REQUEST_DECLINED,m(a))};return{show:function show(b,c,d,g,m){d=a(d);if(!d.attr("data-contacts-init")){n(d);d.attr("data-contacts-init",!0)}var o=h(d),p=i(d);if(m){var q=j(d),r=k(d);if("requests"==m){q.removeClass("active");o.removeClass("show active");r.addClass("active");p.addClass("show active")}else{r.removeClass("active");p.removeClass("show active");q.addClass("active");o.addClass("show active")}}if(l(o)){e.show(o)}else{f.show(p)}return a.Deferred().resolve().promise()},description:function description(){return c.get_string("messagedrawerviewcontacts","core_message")}}});
define ("core_message/preferences_processor_form",["jquery","core/ajax","core/notification"],function(a,b,c){var d=function(b){this.root=a(b);this.userId=this.root.attr("data-user-id");this.name=this.root.attr("data-processor-name");this.root.find("form").on("submit",function(c){c.preventDefault();this.save().done(function(){a(b).trigger("mpp:formsubmitted")})}.bind(this))};d.prototype.startLoading=function(){this.root.addClass("loading")};d.prototype.stopLoading=function(){this.root.removeClass("loading")};d.prototype.isLoading=function(){return this.root.hasClass("loading")};d.prototype.save=function(){if(this.isLoading()){return a.Deferred()}this.startLoading();var d=this.root.find("form").serializeArray(),e={methodname:"core_message_message_processor_config_form",args:{userid:this.userId,name:this.name,formvalues:d}};return b.call([e])[0].fail(c.exception).always(function(){this.stopLoading()}.bind(this))};return d});
define ("core_message/message_send_bulk",["exports","core/str","core/modal_factory","core/templates","core/modal_events","core/ajax","core/notification"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.sendMessage=a.showModal=void 0;c=h(c);d=h(d);e=h(e);f=h(f);g=h(g);function h(a){return a&&a.__esModule?a:{default:a}}var i=function(a){var f=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;if(!a.length){return Promise.resolve()}var g=null;if(1==a.length){g=(0,b.get_string)("sendbulkmessagesingle","core_message")}else{g=(0,b.get_string)("sendbulkmessage","core_message",a.length)}return c.default.create({type:c.default.types.SAVE_CANCEL,body:d.default.render("core_message/send_bulk_message",{}),title:g}).then(function(b){b.setSaveButtonText(g);b.getRoot().on(e.default.hidden,function(){if(f){f()}b.getRoot().remove()});b.getRoot().on(e.default.save,function(){var c=b.getRoot().find("form textarea").val();j(c,a)});b.show();return b})};a.showModal=i;var j=function(a,c){var d=[];c.forEach(function(b){d.push({touserid:b,text:a})});return f.default.call([{methodname:"core_message_send_instant_messages",args:{messages:d}}])[0].then(function(a){if(1==a.length){return(0,b.get_string)("sendbulkmessagesentsingle","core_message")}else{return(0,b.get_string)("sendbulkmessagesent","core_message",a.length)}}).then(function(a){g.default.addNotification({message:a,type:"success"});return!0}).catch(g.default.exception)};a.sendMessage=j});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_message/message_drawer_view_search",["jquery","core/custom_interaction_events","core/notification","core/pubsub","core/str","core/templates","core_message/message_repository","core_message/message_drawer_events"],function(a,b,c,d,e,f,g,h){var i=50,j=3,k={BLOCK_ICON_CONTAINER:"[data-region=\"block-icon-container\"]",CANCEL_SEARCH_BUTTON:"[data-action=\"cancel-search\"]",CONTACTS_CONTAINER:"[data-region=\"contacts-container\"]",CONTACTS_LIST:"[data-region=\"contacts-container\"] [data-region=\"list\"]",EMPTY_MESSAGE_CONTAINER:"[data-region=\"empty-message-container\"]",LIST:"[data-region=\"list\"]",LOADING_ICON_CONTAINER:"[data-region=\"loading-icon-container\"]",LOADING_PLACEHOLDER:"[data-region=\"loading-placeholder\"]",MESSAGES_LIST:"[data-region=\"messages-container\"] [data-region=\"list\"]",MESSAGES_CONTAINER:"[data-region=\"messages-container\"]",NON_CONTACTS_CONTAINER:"[data-region=\"non-contacts-container\"]",NON_CONTACTS_LIST:"[data-region=\"non-contacts-container\"] [data-region=\"list\"]",SEARCH_ICON_CONTAINER:"[data-region=\"search-icon-container\"]",SEARCH_ACTION:"[data-action=\"search\"]",SEARCH_INPUT:"[data-region=\"search-input\"]",SEARCH_RESULTS_CONTAINER:"[data-region=\"search-results-container\"]",LOAD_MORE_USERS:"[data-action=\"load-more-users\"]",LOAD_MORE_MESSAGES:"[data-action=\"load-more-messages\"]",BUTTON_TEXT:"[data-region=\"button-text\"]",NO_RESULTS_CONTAINTER:"[data-region=\"no-results-container\"]",ALL_CONTACTS_CONTAINER:"[data-region=\"all-contacts-container\"]"},l={CONTACTS_LIST:"core_message/message_drawer_contacts_list",NON_CONTACTS_LIST:"core_message/message_drawer_non_contacts_list",MESSAGES_LIST:"core_message/message_drawer_messages_list"},m=function(a){return a.attr("data-user-id")},n=function(a){return a.find(k.EMPTY_MESSAGE_CONTAINER)},o=function(a){return a.find(k.LOADING_ICON_CONTAINER)},p=function(a){return a.find(k.LOADING_PLACEHOLDER)},q=function(a){return a.find(k.SEARCH_ICON_CONTAINER)},r=function(a){return a.find(k.SEARCH_INPUT)},s=function(a){return a.find(k.SEARCH_RESULTS_CONTAINER)},t=function(a){return a.find(k.CONTACTS_CONTAINER)},u=function(a){return a.find(k.NON_CONTACTS_CONTAINER)},v=function(a){return a.find(k.MESSAGES_CONTAINER)},w=function(a){n(a).removeClass("hidden")},x=function(a){n(a).addClass("hidden")},y=function(a){o(a).removeClass("hidden")},z=function(a){o(a).addClass("hidden")},A=function(a){p(a).removeClass("hidden")},B=function(a){p(a).addClass("hidden")},C=function(a){q(a).removeClass("hidden")},D=function(a){q(a).addClass("hidden")},E=function(a){s(a).removeClass("hidden")},F=function(a){s(a).addClass("hidden")},G=function(a){var b=s(a);b.find(k.ALL_CONTACTS_CONTAINER).addClass("hidden");b.find(k.MESSAGES_CONTAINER).addClass("hidden");b.find(k.NO_RESULTS_CONTAINTER).removeClass("hidden")},H=function(a){var b=s(a);b.find(k.ALL_CONTACTS_CONTAINER).removeClass("hidden");b.find(k.MESSAGES_CONTAINER).removeClass("hidden");b.find(k.NO_RESULTS_CONTAINTER).addClass("hidden")},I=function(a){var b=s(a);b.find(k.ALL_CONTACTS_CONTAINER).removeClass("hidden")},J=function(a){var b=s(a);b.find(k.ALL_CONTACTS_CONTAINER).addClass("hidden")},K=function(a){var b=s(a);b.find(k.CONTACTS_CONTAINER).removeClass("hidden")},L=function(a){var b=s(a);b.find(k.CONTACTS_CONTAINER).addClass("hidden")},M=function(a){var b=s(a);b.find(k.NON_CONTACTS_CONTAINER).removeClass("hidden")},N=function(a){var b=s(a);b.find(k.NON_CONTACTS_CONTAINER).addClass("hidden")},O=function(a){var b=s(a);b.find(k.MESSAGES_CONTAINER).removeClass("hidden")},P=function(a){var b=s(a);b.find(k.MESSAGES_CONTAINER).addClass("hidden")},Q=function(a){r(a).prop("disabled",!0)},R=function(a){r(a).prop("disabled",!1)},S=function(a){r(a).val("")},T=function(a){a.find(k.CONTACTS_LIST).empty();a.find(k.NON_CONTACTS_LIST).empty();a.find(k.MESSAGES_LIST).empty();H(a);I(a);K(a);M(a);O(a);Y(a);aa(a)},U=function(a,b){D(a);x(b);F(b);y(a);A(b);Q(a)},V=function(a,b){C(a);x(b);E(b);z(a);B(b);R(a)},W=function(a){var b=a.find(k.LOAD_MORE_USERS);b.prop("disabled",!0);b.find(k.BUTTON_TEXT).addClass("hidden");b.find(k.LOADING_ICON_CONTAINER).removeClass("hidden")},X=function(a){var b=a.find(k.LOAD_MORE_USERS);b.prop("disabled",!1);b.find(k.BUTTON_TEXT).removeClass("hidden");b.find(k.LOADING_ICON_CONTAINER).addClass("hidden")},Y=function(a){a.find(k.LOAD_MORE_USERS).removeClass("hidden")},Z=function(a){a.find(k.LOAD_MORE_USERS).addClass("hidden")},$=function(a){var b=a.find(k.LOAD_MORE_MESSAGES);b.prop("disabled",!0);b.find(k.BUTTON_TEXT).addClass("hidden");b.find(k.LOADING_ICON_CONTAINER).removeClass("hidden")},_=function(a){var b=a.find(k.LOAD_MORE_MESSAGES);b.prop("disabled",!1);b.find(k.BUTTON_TEXT).removeClass("hidden");b.find(k.LOADING_ICON_CONTAINER).addClass("hidden")},aa=function(a){a.find(k.LOAD_MORE_MESSAGES).removeClass("hidden")},ba=function(a){a.find(k.LOAD_MORE_MESSAGES).addClass("hidden")},ca=function(a,b){return a.find("[data-contact-user-id=\""+b+"\"]")},da=function(a,b){var c=u(a),d=ca(c,b.userid);if(d.length){d.remove();var e=t(a);e.removeClass("hidden");e.find(k.LIST).append(d)}if(!c.find(k.LIST).children().length){c.addClass("hidden")}},ea=function(a,b){var c=t(a),d=ca(c,b);if(d.length){d.remove();var e=u(a);e.removeClass("hidden");e.find(k.LIST).append(d)}if(!c.find(k.LIST).children().length){c.addClass("hidden")}},fa=function(a,b){var c=ca(a,b);if(c.length){c.find(k.BLOCK_ICON_CONTAINER).removeClass("hidden")}},ga=function(a,b){var c=ca(a,b);if(c.length){c.find(k.BLOCK_ICON_CONTAINER).addClass("hidden")}},ha=function(a,b){if(!a){return""}var c=new RegExp("("+b+")","gi");return a.replace(c,"<span class=\"matchtext\">$1</span>")},ia=function(a,b){var c=t(a),d=a.attr("data-in-panel"),e=c.find(k.LIST);return f.render(l.CONTACTS_LIST,{contacts:b,frompanel:d}).then(function(a){e.append(a);return a})},ja=function(a,b){var c=u(a),d=a.attr("data-in-panel"),e=c.find(k.LIST);return f.render(l.NON_CONTACTS_LIST,{noncontacts:b,frompanel:d}).then(function(a){e.append(a);return a})},ka=function(a,b){var c=v(a),d=a.attr("data-in-panel"),e=c.find(k.LIST);return f.render(l.MESSAGES_LIST,{messages:b,frompanel:d}).then(function(a){e.append(a);return a})},la=function(b,c,d,e,f){var h=!1;W(b);return g.searchUsers(c,d,e+1,f).then(function(a){var b=a.contacts,c=a.noncontacts;if(b.length<=e&&c.length<=e){h=!0;return{contacts:b,noncontacts:c}}else{return{contacts:b.slice(0,e),noncontacts:c.slice(0,e)}}}).then(function(c){var e=c.contacts.length,f=c.noncontacts.length;if(e){c.contacts.forEach(function(a){a.highlight=ha(a.fullname,d)})}if(f){c.noncontacts.forEach(function(a){a.highlight=ha(a.fullname,d)})}return a.when(e?ia(b,c.contacts):!0,f?ja(b,c.noncontacts):!0).then(function(){return{contactsCount:e,nonContactsCount:f}})}).then(function(a){X(b);if(h){Z(b)}return a}).catch(function(a){X(b);throw a})},ma=function(a,b,c,d,e){var f=!1;$(a);return g.searchMessages(b,c,d+1,e).then(function(a){var b=a.contacts;if(b.length<=d){f=!0;return b}else{return b.slice(0,d)}}).then(function(b){if(b.length){b.forEach(function(a){a.lastmessage=ha(a.lastmessage,c)});return ka(a,b).then(function(){return b.length})}else{return b.length}}).then(function(b){_(a);if(f){ba(a)}return b}).catch(function(b){_(a);throw b})},na=function(b,c,d,e,f,g,h){var i=m(c);U(b,c);T(c);return a.when(la(c,i,d,e,f),ma(c,i,d,g,h)).then(function(a,d){var e=a.contactsCount,f=a.nonContactsCount;V(b,c);if(!e&&!f&&!d){G(c)}else{if(!e&&!f){J(c)}else{if(!e){L(c)}if(!f){N(c)}}if(!d){P(c)}}})},oa=function(a,e){var f=m(e),g=r(a),l="",n=0,o=0,p=function(b,d){l=g.val().trim();if(""!==l){n=0;o=0;na(a,e,l,j,o,50,n).then(function(){g.focus();o=o+j;n=n+50}).catch(c.exception)}d.originalEvent.preventDefault()};b.define(g,[b.events.enter]);b.define(a,[b.events.activate]);b.define(e,[b.events.activate]);g.on(b.events.enter,p);a.on(b.events.activate,k.SEARCH_ACTION,p);e.on(b.events.activate,k.LOAD_MORE_MESSAGES,function(a,b){if(""!==l){ma(e,f,l,50,n).then(function(){n=n+50}).catch(c.exception)}b.originalEvent.preventDefault()});e.on(b.events.activate,k.LOAD_MORE_USERS,function(a,b){if(""!==l){la(e,f,l,i,o).then(function(){o=o+i}).catch(c.exception)}b.originalEvent.preventDefault()});a.on(b.events.activate,k.CANCEL_SEARCH_BUTTON,function(){S(a);w(e);C(a);F(e);z(a);B(e);o=0;n=0});d.subscribe(h.CONTACT_ADDED,function(a){da(e,a)});d.subscribe(h.CONTACT_REMOVED,function(a){ea(e,a)});d.subscribe(h.CONTACT_BLOCKED,function(a){fa(e,a)});d.subscribe(h.CONTACT_UNBLOCKED,function(a){ga(e,a)})},pa=function(a,b){if("object"!==_typeof(b)){return e.get_string("messagedrawerviewsearch","core_message")}var c=r(b),d=c.val().trim();return e.get_string("messagedrawerviewsearch","core_message",d)};return{show:function show(b,c,d){if(!d.attr("data-init")){oa(c,d);d.attr("data-init",!0)}var e=r(c);e.focus();return a.Deferred().resolve().promise()},description:pa}});
define ("core_message/message_repository",["jquery","core/ajax","core/notification","core_message/message_drawer_view_conversation_constants"],function(a,b,c,d){var e=d.CONVERSATION_TYPES,f=function(a,c){var d=c.map(function(b){return{touserid:a,text:b}});return b.call([{methodname:"core_message_send_instant_messages",args:{messages:d}}])[0].then(function(a){var b=a.reduce(function(a,b){if(b.errormessage){a.push(b.errormessage)}return a},[]);if(b.length){throw new Error(b.join("\n"))}return a}).then(function(a){return a.map(function(a){return{id:a.msgid,text:a.text,timecreated:a.timecreated,useridfrom:a.useridfrom,conversationid:a.conversationid,candeletemessagesforallusers:a.candeletemessagesforallusers}})})},g=function(a,c){var d=c.map(function(a){return{text:a}});return b.call([{methodname:"core_message_send_messages_to_conversation",args:{conversationid:a,messages:d}}])[0]};return{countUnreadConversations:function countUnreadConversations(a){var d=b.call([{methodname:"core_message_get_unread_conversations_count",args:a}])[0];d.fail(c.exception);return d},getContacts:function getContacts(a,c,d){var e={userid:a};if("undefined"!=typeof c){e.limitnum=c}if("undefined"!=typeof d){e.limitfrom=d}return b.call([{methodname:"core_message_get_user_contacts",args:e}])[0]},blockUser:function blockUser(c,d){return a.when.apply(null,b.call([{methodname:"core_message_block_user",args:{userid:c,blockeduserid:d}},{methodname:"core_message_get_member_info",args:{referenceuserid:c,userids:[d],includecontactrequests:!0,includeprivacyinfo:!0}}])).then(function(a,b){return b.length?b[0]:{}})},unblockUser:function unblockUser(c,d){return a.when.apply(null,b.call([{methodname:"core_message_unblock_user",args:{userid:c,unblockeduserid:d}},{methodname:"core_message_get_member_info",args:{referenceuserid:c,userids:[d],includecontactrequests:!0,includeprivacyinfo:!0}}])).then(function(a,b){return b.length?b[0]:{}})},createContactRequest:function createContactRequest(a,c){return b.call([{methodname:"core_message_create_contact_request",args:{userid:a,requesteduserid:c}}])[0]},deleteContacts:function deleteContacts(c,d){return a.when.apply(null,b.call([{methodname:"core_message_delete_contacts",args:{userid:c,userids:d}},{methodname:"core_message_get_member_info",args:{referenceuserid:c,userids:d,includecontactrequests:!0,includeprivacyinfo:!0}}])).then(function(a,b){return b})},getMessages:function getMessages(a,c,d,e,f,g){var h={currentuserid:a,convid:c,newest:f?!0:!1};if("undefined"!=typeof d){h.limitnum=d}if("undefined"!=typeof e){h.limitfrom=e}if("undefined"!=typeof g){h.timefrom=g}return b.call([{methodname:"core_message_get_conversation_messages",args:h}])[0]},searchUsers:function searchUsers(a,c,d,e){var f={userid:a,search:c};if("undefined"!=typeof d){f.limitnum=d}if("undefined"!=typeof e){f.limitfrom=e}return b.call([{methodname:"core_message_message_search_users",args:f}])[0]},searchMessages:function searchMessages(a,c,d,e){var f={userid:a,search:c};if("undefined"!=typeof d){f.limitnum=d}if("undefined"!=typeof e){f.limitfrom=e}return b.call([{methodname:"core_message_data_for_messagearea_search_messages",args:f}])[0]},sendMessagesToUser:f,sendMessageToUser:function sendMessageToUser(a,b){return f(a,[b]).then(function(a){return a[0]})},sendMessagesToConversation:g,sendMessageToConversation:function sendMessageToConversation(a,b){return g(a,[b]).then(function(a){return a[0]})},savePreferences:function savePreferences(a,c){return b.call([{methodname:"core_user_update_user_preferences",args:{userid:a,preferences:c}}])[0]},getPreferences:function getPreferences(a){return b.call([{methodname:"core_user_get_user_preferences",args:{userid:a}}])[0]},deleteMessages:function deleteMessages(c,d){return a.when.apply(null,b.call(d.map(function(a){return{methodname:"core_message_delete_message",args:{messageid:a,userid:c}}})))},deleteMessagesForAllUsers:function deleteMessagesForAllUsers(c,d){return a.when.apply(null,b.call(d.map(function(a){return{methodname:"core_message_delete_message_for_all_users",args:{messageid:a,userid:c}}})))},deleteConversation:function deleteConversation(a,c){return b.call([{methodname:"core_message_delete_conversations_by_id",args:{userid:a,conversationids:[c]}}])[0]},getContactRequests:function getContactRequests(a){return b.call([{methodname:"core_message_get_contact_requests",args:{userid:a}}])[0]},acceptContactRequest:function acceptContactRequest(c,d){return a.when.apply(null,b.call([{methodname:"core_message_confirm_contact_request",args:{userid:c,requesteduserid:d}},{methodname:"core_message_get_member_info",args:{referenceuserid:d,userids:[c],includecontactrequests:!0,includeprivacyinfo:!0}}])).then(function(a,b){return b.length?b[0]:{}})},declineContactRequest:function declineContactRequest(c,d){return a.when.apply(null,b.call([{methodname:"core_message_decline_contact_request",args:{userid:c,requesteduserid:d}},{methodname:"core_message_get_member_info",args:{referenceuserid:d,userids:[c],includecontactrequests:!0,includeprivacyinfo:!0}}])).then(function(a,b){return b.length?b[0]:{}})},getConversation:function getConversation(a,c,d,e,f,g,h,i,j){var k={userid:a,conversationid:c};if("undefined"!=typeof d&&null!==d){k.includecontactrequests=d}if("undefined"!=typeof e&&null!==e){k.includeprivacyinfo=e}if("undefined"!=typeof f&&null!==f){k.memberlimit=f}if("undefined"!=typeof g&&null!==g){k.memberoffset=g}if("undefined"!=typeof h&&null!==h){k.messagelimit=h}if("undefined"!=typeof i&&null!==i){k.messageoffset=i}if("undefined"!=typeof j&&null!==j){k.newestmessagesfirst=j}return b.call([{methodname:"core_message_get_conversation",args:k}])[0]},getConversationBetweenUsers:function getConversationBetweenUsers(a,c,d,e,f,g,h,i,j){var k={userid:a,otheruserid:c};if("undefined"!=typeof d&&null!==d){k.includecontactrequests=d}if("undefined"!=typeof e&&null!==e){k.includeprivacyinfo=e}if("undefined"!=typeof f&&null!==f){k.memberlimit=f}if("undefined"!=typeof g&&null!==g){k.memberoffset=g}if("undefined"!=typeof h&&null!==h){k.messagelimit=h}if("undefined"!=typeof i&&null!==i){k.messageoffset=i}if("undefined"!=typeof j&&null!==j){k.newestmessagesfirst=j}return b.call([{methodname:"core_message_get_conversation_between_users",args:k}])[0]},getSelfConversation:function getSelfConversation(a,c,d,e){var f={userid:a};if("undefined"!=typeof c&&null!==c){f.messagelimit=c}if("undefined"!=typeof d&&null!==d){f.messageoffset=d}if("undefined"!=typeof e&&null!==e){f.newestmessagesfirst=e}return b.call([{methodname:"core_message_get_self_conversation",args:f}])[0]},getConversations:function getConversations(a,c,d,f,g,h){var i={userid:a,type:c};if("undefined"!=typeof d&&null!==d){i.limitnum=d}if("undefined"!=typeof f&&null!==f){i.limitfrom=f}if("undefined"!=typeof g&&null!==g){i.favourites=g}if("undefined"!=typeof h&&null!==h){i.mergeself=h}return b.call([{methodname:"core_message_get_conversations",args:i}])[0].then(function(a){if(a.conversations.length){a.conversations=a.conversations.map(function(a){if(a.type==e.PRIVATE||a.type==e.SELF){var b=a.members.length?a.members[0]:null;if(b){a.name=a.name?a.name:b.fullname;a.imageurl=a.imageurl?a.imageurl:b.profileimageurl}}return a})}return a})},getConversationMembers:function getConversationMembers(a,c,d,e,f){var g={userid:c,conversationid:a};if("undefined"!=typeof d&&null!==d){g.limitnum=d}if("undefined"!=typeof e&&null!==e){g.limitfrom=e}if("undefined"!=typeof f&&null!==f){g.includecontactrequests=f}return b.call([{methodname:"core_message_get_conversation_members",args:g}])[0]},setFavouriteConversations:function setFavouriteConversations(a,c){return b.call([{methodname:"core_message_set_favourite_conversations",args:{userid:a,conversations:c}}])[0]},setMutedConversations:function setMutedConversations(a,c){return b.call([{methodname:"core_message_mute_conversations",args:{userid:a,conversationids:c}}])[0]},unsetFavouriteConversations:function unsetFavouriteConversations(a,c){return b.call([{methodname:"core_message_unset_favourite_conversations",args:{userid:a,conversations:c}}])[0]},unsetMutedConversations:function unsetMutedConversations(a,c){return b.call([{methodname:"core_message_unmute_conversations",args:{userid:a,conversationids:c}}])[0]},getMemberInfo:function getMemberInfo(a,c,d,e){var f={referenceuserid:a,userids:c};if("undefined"!=typeof d){f.includecontactrequests=d}if("undefined"!=typeof e){f.includeprivacyinfo=e}return b.call([{methodname:"core_message_get_member_info",args:f}])[0]},markAllConversationMessagesAsRead:function markAllConversationMessagesAsRead(a,c){return b.call([{methodname:"core_message_mark_all_conversation_messages_as_read",args:{userid:a,conversationid:c}}])[0]},getUserMessagePreferences:function getUserMessagePreferences(a){return b.call([{methodname:"core_message_get_user_message_preferences",args:{userid:a}}])[0]},getTotalConversationCounts:function getTotalConversationCounts(a){return b.call([{methodname:"core_message_get_conversation_counts",args:{userid:a}}])[0]},getUnreadConversationCounts:function getUnreadConversationCounts(a){return b.call([{methodname:"core_message_get_unread_conversation_counts",args:{userid:a}}])[0]},getAllConversationCounts:function getAllConversationCounts(c){return a.when.apply(null,b.call([{methodname:"core_message_get_conversation_counts",args:{userid:c}},{methodname:"core_message_get_unread_conversation_counts",args:{userid:c}}])).then(function(a,b){return{total:a,unread:b}})}}});
define ("core_message/message_drawer_view_group_info",["jquery","core/str","core/templates","core_message/message_repository","core_message/message_drawer_lazy_load_list"],function(a,b,c,d,e){var f={CONTENT_CONTAINER:"[data-region=\"group-info-content-container\"]",MEMBERS_LIST:"[data-region=\"members-list\"]"},g={CONTENT:"core_message/message_drawer_view_group_info_body_content",MEMBERS_LIST:"core_message/message_drawer_view_group_info_participants_list"},h=function(a){return a.find(f.CONTENT_CONTAINER)},i=function(a,b,d){var e=50<b.totalMemberCount?50:b.totalMemberCount,f=Array.apply(null,Array(e)).map(function(){return!0}),i={name:b.name,subname:b.subname,imageurl:b.imageUrl,placeholders:f,loggedinuser:{id:d}};return c.render(g.CONTENT,i).then(function(b){h(a).append(b);return b})},j=function(a,b,c){return function(f,g){return d.getConversationMembers(a.id,g,b+1,c).then(function(a){if(a.length>b){a=a.slice(0,-1)}else{e.setLoadedAll(f,!0)}c=c+b;return a.filter(function(a){return a.id!=g})})}},k=function(a,b){return c.render(g.MEMBERS_LIST,{contacts:b}).then(function(b){a.append(b);return b})};return{show:function show(b,c,d,f,g,l){var m=a(d);h(m).empty();return i(m,g,l).then(function(){var a=e.getRoot(m);e.show(a,j(g,50,0),k)})},description:function description(a,c){return b.get_string("messagedrawerviewgroupinfo","core_message",c.name)}}});
define ("core_message/message_user_button",["jquery","core/custom_interaction_events","core_message/message_drawer_helper","core/templates"],function(a,b,c,d){var e={MESSAGE_TEXTAREA:"[data-region=\"send-message-txt\"]",MESSAGE_USER_BUTTON:"#message-user-button",MESSAGE_JUMP:"[data-region=\"jumpto\"]"},f={CONTENT:"core_message/message_jumpto"},g=function(a){return parseInt(a.attr("data-userid"))},h=function(a){return parseInt(a.attr("data-conversationid"))};return{send:function send(i){i=a(i);var j={conversationid:h(i),buttonid:a(i).attr("id"),userid:g(i)};d.render(f.CONTENT,{}).then(function(a){i.after(a)}).then(function(){a(e.MESSAGE_USER_BUTTON).next().focus(function(){a(e.MESSAGE_TEXTAREA).focus()})});b.define(i,[b.events.activate]);i.on(b.events.activate,function(b,d){if(a(b.target).hasClass("active")){c.hide();a(e.MESSAGE_USER_BUTTON).next().attr("tabindex",-1)}else{a(e.MESSAGE_USER_BUTTON).next().attr("tabindex",0);if(j.conversationid){c.showConversation(j)}else{c.createConversationWithUser(j)}}a(b.target).focus();a(b.target).toggleClass("active");b.preventDefault();d.originalEvent.preventDefault()})}}});
define ("core_message/message_drawer_view_contact",["jquery","core/str","core/templates"],function(a,b,c){var d={CONTENT_CONTAINER:"[data-region=\"content-container\"]"},e={CONTENT:"core_message/message_drawer_view_contact_body_content"},f=function(a){return a.find(d.CONTENT_CONTAINER)},g=function(a,b){return c.render(e.CONTENT,b).then(function(b){f(a).append(b);return b})};return{show:function show(b,c,d,e,h){var i=a(d);f(i).empty();return g(i,h)},description:function description(a,c){return b.get_string("messagedrawerviewcontact","core_message",c.fullname)}}});
define ("core_message/message_notification_preference",["jquery","core_message/notification_preference"],function(a,b){var c={PREFERENCE_KEY:"[data-preference-key]"},d=function(a,c){b.call(this,a,c)};d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.getPreferenceKey=function(){return this.root.find(c.PREFERENCE_KEY).attr("data-preference-key")};return d});
define ("core_message/message_preferences",["jquery","core/ajax","core/notification","core_message/message_notification_preference","core/custom_interaction_events"],function(a,b,c,d,e){var f={PREFERENCE:"[data-state]",PREFERENCES_CONTAINER:"[data-region=\"preferences-container\"]",CONTACTABLE_PRIVACY_CONTAINER:"[data-region=\"privacy-setting-container\"]"},g=function(b){this.root=a(b);this.userId=this.root.find(f.PREFERENCES_CONTAINER).attr("data-user-id");this.registerEventListeners()};g.prototype.preferencesDisabled=function(){return this.root.find(f.PREFERENCES_CONTAINER).hasClass("disabled")};g.prototype.saveContactablePrivacySetting=function(){var d=this.root.find(f.CONTACTABLE_PRIVACY_CONTAINER),e=a("input[type='radio']:checked").val();if(d.hasClass("loading")){return a.Deferred().resolve()}d.addClass("loading");var g={methodname:"core_user_update_user_preferences",args:{userid:this.userId,preferences:[{type:d.attr("data-preference-key"),value:e}]}};return b.call([g])[0].fail(c.exception).always(function(){d.removeClass("loading")})};g.prototype.registerEventListeners=function(){e.define(this.root,[e.events.activate]);this.root.on("change",function(b){if("message_blocknoncontacts"==b.target.name){this.saveContactablePrivacySetting()}else{if(!this.preferencesDisabled()){var c=a(b.target).closest(f.PREFERENCES_CONTAINER),e=a(b.target).closest(f.PREFERENCE),g=new d(c,this.userId);e.addClass("loading");g.save().always(function(){e.removeClass("loading")})}}}.bind(this))};return g});
define ("core_message/message_drawer_helper",["core/pubsub","core_message/message_drawer_events"],function(a,b){return{createConversationWithUser:function createConversationWithUser(c){a.publish(b.CREATE_CONVERSATION_WITH_USER,c)},hide:function hide(){a.publish(b.HIDE)},show:function show(){a.publish(b.SHOW)},showConversation:function showConversation(c){a.publish(b.SHOW_CONVERSATION,c)},showSettings:function showSettings(){a.publish(b.SHOW_SETTINGS)}}});
define ("core_message/message_drawer_routes",[],function(){return{VIEW_CONTACT:"view-contact",VIEW_CONTACTS:"view-contacts",VIEW_CONVERSATION:"view-conversation",VIEW_GROUP_INFO:"view-group-info",VIEW_OVERVIEW:"view-overview",VIEW_SEARCH:"view-search",VIEW_SETTINGS:"view-settings"}});
define ("core_message/message_drawer_lazy_load_list",["jquery","core/custom_interaction_events"],function(a,b){var c={ROOT:"[data-region=\"lazy-load-list\"]",LOADING_ICON_CONTAINER:"[data-region=\"loading-icon-container\"]",CONTENT_CONTAINER:"[data-region=\"content-container\"]",EMPTY_MESSAGE:"[data-region=\"empty-message-container\"]",PLACEHOLDER:"[data-region=\"placeholder-container\"]"},d=function(a){a.attr("data-loading",!0)},e=function(a){a.attr("data-loading",!1)},f=function(a){return"true"===a.attr("data-loading")},g=function(a){return a.attr("data-user-id")},h=function(a){return a.find(c.CONTENT_CONTAINER)},i=function(a){a.find(c.LOADING_ICON_CONTAINER).removeClass("hidden")},j=function(a){a.find(c.LOADING_ICON_CONTAINER).addClass("hidden")},k=function(a){a.find(c.EMPTY_MESSAGE).removeClass("hidden")},l=function(a){a.find(c.PLACEHOLDER).removeClass("hidden")},m=function(a){a.find(c.PLACEHOLDER).addClass("hidden")},n=function(a){h(a).removeClass("hidden")},o=function(a){h(a).addClass("hidden")},p=function(a){return"true"==a.attr("data-loaded-all")},q=function(a,b){a.attr("data-loaded-all",b)},r=function(a){return!p(a)&&!f(a)},s=function(a,b,c){var f=g(a);d(a);return b(a,f).then(function(b){if(0<b.length){var d=h(a);return c(d,b,f).then(function(){return b})}else{return b}}).then(function(b){e(a);a.attr("data-seen",!0);if(!b.length){q(a,!0)}return b}).catch(function(){e(a);a.attr("data-seen",!0)})},t=function(a,b,c){h(a).empty();l(a);o(a);return s(a,b,c).then(function(b){m(a);if(!b.length){k(a)}else{n(a)}}).catch(function(){m(a);n(a)})},u=function(a,c,d){b.define(a,[b.events.scrollBottom]);a.on(b.events.scrollBottom,function(){if(r(a)){i(a);s(a,c,d).then(function(){return j(a)}).catch(function(){return j(a)})}})};return{show:function show(b,c,d){b=a(b);if(!b.attr("data-init")){u(b,c,d);t(b,c,d);b.attr("data-init",!0)}},getContentContainer:h,getRoot:function getRoot(a){return a.find(c.ROOT)},setLoadedAll:q,showEmptyMessage:k,hideEmptyMessage:function hideEmptyMessage(a){a.find(c.EMPTY_MESSAGE).addClass("hidden")},showContent:n,hideContent:o}});
define ("core_message/message_drawer_view_settings",["jquery","core/notification","core/str","core/pubsub","core/templates","core_message/message_repository","core/custom_interaction_events","core_message/message_drawer_events"],function(a,b,c,d,e,f,g,h){var i={CHECKBOX:"input[type=\"checkbox\"]",SETTINGS:"[data-region=\"settings\"]",PRIVACY_PREFERENCE:"[data-preference=\"blocknoncontacts\"] input[type=\"radio\"]",NOTIFICATIONS_PREFERENCE:"[data-preference=\"notifications\"] input[type=\"checkbox\"]",ENTER_TO_SEND_PREFERENCE:"[data-preference=\"entertosend\"] input[type=\"checkbox\"]",NOTIFICATION_PREFERENCES_CONTAINER:"[data-region=\"notification-preference-container\"]",CONTENT_CONTAINER:"[data-region=\"content-container\"]",PLACEHOLDER_CONTAINER:"[data-region=\"placeholder-container\"]"},j={NOTIFICATION_PREFERENCES:"core_message/message_drawer_view_settings_body_content_notification_preferences"},k=function(b,c){var d=b.find(i.PRIVACY_PREFERENCE);d.each(function(b,d){d=a(d);if(d.val()==c){d.prop("checked",!0)}else{d.prop("checked",!1)}})},l=function(a,b){var c=a.find(i.ENTER_TO_SEND_PREFERENCE);if(b){c.prop("checked",!0)}else{c.prop("checked",!1)}},m=function(a,c){return f.savePreferences(a,c).then(function(){d.publish(h.PREFERENCES_UPDATED,c)}).catch(b.exception)},n=function(b,c){var d=b.find(i.SETTINGS);g.define(d,[g.events.activate]);d.on(g.events.activate,i.NOTIFICATIONS_PREFERENCE,function(b){var d=a(b.target).closest(i.NOTIFICATION_PREFERENCES_CONTAINER),e=d.find(i.CHECKBOX);if(!e.length){return}var f=e.toArray().reduce(function(b,c){c=a(c);if(c.prop("checked")){b.push(c.attr("data-name"))}return b},[]),g=f.length?f.join(","):"none";m(c,[{type:"message_provider_moodle_instantmessage_loggedoff",value:g},{type:"message_provider_moodle_instantmessage_loggedin",value:g}])});d.on("change",i.PRIVACY_PREFERENCE,function(b){var d=a(b.target).val();m(c,[{type:"message_blocknoncontacts",value:d}])});d.on(g.events.activate,i.ENTER_TO_SEND_PREFERENCE,function(b){var d=a(b.target).prop("checked");m(c,[{type:"message_entertosend",value:d}])})},o=function(a,c){f.getUserMessagePreferences(c).then(function(b){k(a,b.blocknoncontacts);l(a,b.entertosend);var c=[];if(b.preferences.components.length){b.preferences.components.forEach(function(a){if(a.notifications.length){var b=a.notifications.filter(function(a){return a.preferencekey=="message_provider_moodle_instantmessage"});if(b.length){var d=a.notifications[0];c=d.processors.map(function(a){var b=a.loggedin.checked||a.loggedoff.checked;return{displayname:a.displayname,name:a.name,checked:b,locked:a.locked,lockedmessage:a.lockedmessage||null}})}}})}var d=a.find(i.NOTIFICATION_PREFERENCES_CONTAINER);if(c.length){d.removeClass("hidden");return e.render(j.NOTIFICATION_PREFERENCES,{processors:c}).then(function(a){d.append(a);return a})}else{return!0}}).then(function(){a.find(i.CONTENT_CONTAINER).removeClass("hidden");a.find(i.PLACEHOLDER_CONTAINER).addClass("hidden");n(a,c)}).catch(b.exception)};return{show:function show(b,c,d,e,f){if(!d.attr("data-init")){o(d,f);d.attr("data-init",!0)}return a.Deferred().resolve().promise()},description:function description(){return c.get_string("messagedrawerviewsettings","core_message")}}});
define ("core_message/message_drawer_view_conversation_constants",[],function(){return{SELECTORS:{ACTION_ACCEPT_CONTACT_REQUEST:"[data-action=\"accept-contact-request\"]",ACTION_CANCEL_CONFIRM:"[data-action=\"cancel-confirm\"]",ACTION_OKAY_CONFIRM:"[data-action=\"okay-confirm\"]",ACTION_CANCEL_EDIT_MODE:"[data-action=\"cancel-edit-mode\"]",ACTION_CONFIRM_ADD_CONTACT:"[data-action=\"confirm-add-contact\"]",ACTION_CONFIRM_BLOCK:"[data-action=\"confirm-block\"]",ACTION_CONFIRM_DELETE_SELECTED_MESSAGES:"[data-action=\"confirm-delete-selected-messages\"]",ACTION_CONFIRM_DELETE_CONVERSATION:"[data-action=\"confirm-delete-conversation\"]",ACTION_CONFIRM_FAVOURITE:"[data-action=\"confirm-favourite\"]",ACTION_CONFIRM_MUTE:"[data-action=\"confirm-mute\"]",ACTION_CONFIRM_UNFAVOURITE:"[data-action=\"confirm-unfavourite\"]",ACTION_CONFIRM_REMOVE_CONTACT:"[data-action=\"confirm-remove-contact\"]",ACTION_CONFIRM_UNBLOCK:"[data-action=\"confirm-unblock\"]",ACTION_CONFIRM_UNMUTE:"[data-action=\"confirm-unmute\"]",ACTION_DECLINE_CONTACT_REQUEST:"[data-action=\"decline-contact-request\"]",ACTION_REQUEST_ADD_CONTACT:"[data-action=\"request-add-contact\"]",ACTION_REQUEST_BLOCK:"[data-action=\"request-block\"]",ACTION_REQUEST_DELETE_CONVERSATION:"[data-action=\"request-delete-conversation\"]",ACTION_REQUEST_DELETE_SELECTED_MESSAGES:"[data-action=\"delete-selected-messages\"]",ACTION_REQUEST_REMOVE_CONTACT:"[data-action=\"request-remove-contact\"]",ACTION_REQUEST_UNBLOCK:"[data-action=\"request-unblock\"]",ACTION_VIEW_CONTACT:"[data-action=\"view-contact\"]",ACTION_VIEW_GROUP_INFO:"[data-action=\"view-group-info\"]",CAN_RECEIVE_FOCUS:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]",CONFIRM_DIALOGUE:"[data-region=\"confirm-dialogue\"]",CONFIRM_DIALOGUE_BUTTON_TEXT:"[data-region=\"dialogue-button-text\"]",CONFIRM_DIALOGUE_CANCEL_BUTTON:"[data-action=\"cancel-confirm\"]",CONFIRM_DIALOGUE_CONTAINER:"[data-region=\"confirm-dialogue-container\"]",CONFIRM_DIALOGUE_HEADER:"[data-region=\"dialogue-header\"]",CONFIRM_DIALOGUE_OKAY_BUTTON:"[data-action=\"okay-confirm\"]",CONFIRM_DIALOGUE_TEXT:"[data-region=\"dialogue-text\"]",CONTACT_REQUEST_SENT_MESSAGE_CONTAINER:"[data-region=\"contact-request-sent-message-container\"]",CONTENT_PLACEHOLDER_CONTAINER:"[data-region=\"content-placeholder\"]",CONTENT_CONTAINER:"[data-region=\"content-container\"]",CONTENT_MESSAGES_CONTAINER:"[data-region=\"content-message-container\"]",CONTENT_MESSAGES_FOOTER_CONTAINER:"[data-region=\"content-messages-footer-container\"]",CONTENT_MESSAGES_FOOTER_EDIT_MODE_CONTAINER:"[data-region=\"content-messages-footer-edit-mode-container\"]",CONTENT_MESSAGES_FOOTER_REQUIRE_CONTACT_CONTAINER:"[data-region=\"content-messages-footer-require-contact-container\"]",CONTENT_MESSAGES_FOOTER_REQUIRE_UNBLOCK_CONTAINER:"[data-region=\"content-messages-footer-require-unblock-container\"]",CONTENT_MESSAGES_FOOTER_UNABLE_TO_MESSAGE_CONTAINER:"[data-region=\"content-messages-footer-unable-to-message\"]",DAY_MESSAGES_CONTAINER:"[data-region=\"day-messages-container\"]",DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE:"[data-region=\"delete-messages-for-all-users-toggle\"]",DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE_CONTAINER:"[data-region=\"delete-messages-for-all-users-toggle-container\"]",EMOJI_AUTO_COMPLETE_CONTAINER:"[data-region=\"emoji-auto-complete-container\"]",EMOJI_PICKER_CONTAINER:"[data-region=\"emoji-picker-container\"]",EMOJI_PICKER:"[data-region=\"emoji-picker\"]",EMOJI_PICKER_SEARCH_INPUT:"[data-region=\"search-input\"]",ERROR_MESSAGE_CONTAINER:"[data-region=\"error-message-container\"]",ERROR_MESSAGE:"[data-region=\"error-message\"]",FAVOURITE_ICON_CONTAINER:"[data-region=\"favourite-icon-container\"]",FOOTER_CONTAINER:"[data-region=\"content-messages-footer-container\"]",HEADER:"[data-region=\"header-content\"]",HEADER_EDIT_MODE:"[data-region=\"header-edit-mode\"]",HEADER_PLACEHOLDER_CONTAINER:"[data-region=\"header-placeholder\"]",LOADING_ICON_CONTAINER:"[data-region=\"loading-icon-container\"]",MESSAGE:"[data-region=\"message\"]",MESSAGE_NOT_SELECTED:"[data-region=\"message\"][aria-checked=\"false\"]",MESSAGE_NOT_SELECTED_ICON:"[data-region=\"not-selected-icon\"]",MESSAGE_SELECTED_ICON:"[data-region=\"selected-icon\"]",MESSAGES:"[data-region=\"content-message-container\"]",MESSAGES_CONTAINER:"[data-region=\"content-message-container\"]",MESSAGES_SELECTED_COUNT:"[data-region=\"message-selected-court\"]",MESSAGE_TEXT_AREA:"[data-region=\"send-message-txt\"]",MORE_MESSAGES_LOADING_ICON_CONTAINER:"[data-region=\"more-messages-loading-icon-container\"]",MUTED_ICON_CONTAINER:"[data-region=\"muted-icon-container\"]",PLACEHOLDER_CONTAINER:"[data-region=\"placeholder-container\"]",RETRY_SEND:"[data-region=\"retry-send\"]",SELF_CONVERSATION_MESSAGE_CONTAINER:"[data-region=\"self-conversation-message-container\"]",SEND_MESSAGE_BUTTON:"[data-action=\"send-message\"]",SEND_MESSAGE_ICON_CONTAINER:"[data-region=\"send-icon-container\"]",TEXT:"[data-region=\"text\"]",TEXT_CONTAINER:"[data-region=\"text-container\"]",TIME_CREATED:"[data-region=\"time-created\"]",TITLE:"[data-region=\"title\"]",TOGGLE_EMOJI_PICKER_BUTTON:"[data-action=\"toggle-emoji-picker\"]"},TEMPLATES:{HEADER_PRIVATE:"core_message/message_drawer_view_conversation_header_content_type_private",HEADER_PRIVATE_NO_CONTROLS:"core_message/message_drawer_view_conversation_header_content_type_private_no_controls",HEADER_PUBLIC:"core_message/message_drawer_view_conversation_header_content_type_public",HEADER_SELF:"core_message/message_drawer_view_conversation_header_content_type_self",DAY:"core_message/message_drawer_view_conversation_body_day",MESSAGE:"core_message/message_drawer_view_conversation_body_message",MESSAGES:"core_message/message_drawer_view_conversation_body_messages"},CONVERSATION_TYPES:{PRIVATE:1,PUBLIC:2,SELF:3},NEWEST_MESSAGES_FIRST:!0,LOAD_MESSAGE_LIMIT:100,MILLISECONDS_IN_SEC:1e3}});
define ("core_message/notification_preference",["jquery","core/ajax","core/notification","core_message/notification_processor"],function(a,b,c,d){var e={PROCESSOR:"[data-processor-name]",STATE_INPUTS:"[data-state] input"},f=function(b,c){this.root=a(b);this.userId=c};f.prototype.getPreferenceKey=function(){return this.root.attr("data-preference-key")};f.prototype.getLoggedInPreferenceKey=function(){return this.getPreferenceKey()+"_loggedin"};f.prototype.getLoggedOffPreferenceKey=function(){return this.getPreferenceKey()+"_loggedoff"};f.prototype.getProcessors=function(){return this.root.find(e.PROCESSOR).map(function(b,c){return new d(a(c))})};f.prototype.startLoading=function(){this.root.addClass("loading");this.root.find(e.STATE_INPUTS).prop("disabled",!0)};f.prototype.stopLoading=function(){this.root.removeClass("loading");this.root.find(e.STATE_INPUTS).prop("disabled",!1)};f.prototype.isLoading=function(){return this.root.hasClass("loading")};f.prototype.save=function(){if(this.isLoading()){return a.Deferred().resolve()}this.startLoading();var d="",e="";this.getProcessors().each(function(a,b){if(b.isLoggedInEnabled()){if(""===d){d=b.getName()}else{d+=","+b.getName()}}if(b.isLoggedOffEnabled()){if(""===e){e=b.getName()}else{e+=","+b.getName()}}});if(""===d){d="none"}if(""===e){e="none"}var f={userid:this.userId,preferences:[{type:this.getLoggedInPreferenceKey(),value:d},{type:this.getLoggedOffPreferenceKey(),value:e}]};return b.call([{methodname:"core_user_update_user_preferences",args:f}])[0].fail(c.exception).always(function(){this.stopLoading()}.bind(this))};return f});
define ("core_message/message_drawer_view_overview",["jquery","core/key_codes","core/pubsub","core/str","core_message/message_drawer_router","core_message/message_drawer_routes","core_message/message_drawer_events","core_message/message_drawer_view_overview_section","core_message/message_repository","core_message/message_drawer_view_conversation_constants"],function(a,b,c,d,e,f,g,h,i,j){var k={CONTACT_REQUEST_COUNT:"[data-region=\"contact-request-count\"]",FAVOURITES:"[data-region=\"view-overview-favourites\"]",GROUP_MESSAGES:"[data-region=\"view-overview-group-messages\"]",MESSAGES:"[data-region=\"view-overview-messages\"]",SEARCH_INPUT:"[data-region=\"view-overview-search-input\"]",SECTION_TOGGLE_BUTTON:"[data-toggle]"},l={PRIVATE:[j.CONVERSATION_TYPES.PRIVATE,j.CONVERSATION_TYPES.SELF],PUBLIC:[j.CONVERSATION_TYPES.PUBLIC],FAVOURITE:null},m=null,n=function(a){if(null===m){m=i.getAllConversationCounts(a)}return m},o=function(a,b,c){var d=0;if(b&&b.length){d=b.reduce(function(b,c){return b+a.types[c]},d)}if(c){d+=a.favourites}return d},p=function(a){var b=a.some(function(a){var b=a[0];return h.isVisible(b)});if(b){return}a.sort(function(c,a){var b=c[1],d=c[2],e=a[1],f=a[2];if(0<d&&0==f){return-1}else if(0==d&&0<f){return 1}else if(0<b&&0==e){return-1}else if(0==b&&0<e){return 1}else{return 0}});var c=a[0][0],d=c.find(k.SECTION_TOGGLE_BUTTON);d.click()},q=function(a){return a.find(k.SEARCH_INPUT)},r=function(a){return a.attr("data-user-id")},s=function(a){return function(){var b=a.find(k.CONTACT_REQUEST_COUNT),c=parseInt(b.text(),10);c=isNaN(c)?0:c-1;if(0>=c){b.addClass("hidden")}else{b.text(c)}}},t=function(a,d){var h=q(d),i=[b.tab,b.shift,b.ctrl,b.alt];h.on("click",function(){e.go(a,f.VIEW_SEARCH)});h.on("keydown",function(b){if(0>i.indexOf(b.keyCode)&&"Meta"!=b.key){e.go(a,f.VIEW_SEARCH)}});c.subscribe(g.CONTACT_REQUEST_ACCEPTED,s(d));c.subscribe(g.CONTACT_REQUEST_DECLINED,s(d))};return{show:function show(a,b,c){if(!b.attr("data-init")){t(a,b);b.attr("data-init",!0)}var d=b.attr("data-in-panel")?"frompanel":null;q(b).val("");var e=r(c),f=n(e),g=[[c.find(k.FAVOURITES),l.FAVOURITE,!0],[c.find(k.GROUP_MESSAGES),l.PUBLIC,!1],[c.find(k.MESSAGES),l.PRIVATE,!1]];g.forEach(function(b){var c=b[0],e=b[1],g=b[2],i=f.then(function(a){return o(a.total,e,g)}),j=f.then(function(a){return o(a.unread,e,g)});h.show(a,null,c,null,e,g,i,j,d)});return f.then(function(a){var b=g.map(function(b){var c=b[0],d=b[1],e=b[2],f=o(a.total,d,e),g=o(a.unread,d,e);return[c,f,g]});return p(b)})},description:function description(){return d.get_string("messagedrawerviewoverview","core_message")}}});
define ("core_message/message_drawer",["jquery","core/custom_interaction_events","core/pubsub","core_message/message_drawer_view_contact","core_message/message_drawer_view_contacts","core_message/message_drawer_view_conversation","core_message/message_drawer_view_group_info","core_message/message_drawer_view_overview","core_message/message_drawer_view_search","core_message/message_drawer_view_settings","core_message/message_drawer_router","core_message/message_drawer_routes","core_message/message_drawer_events","core/pending","core/drawer"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p={DRAWER:"[data-region=\"right-hand-drawer\"]",JUMPTO:".popover-region [data-region=\"jumpto\"]",PANEL_BODY_CONTAINER:"[data-region=\"panel-body-container\"]",PANEL_HEADER_CONTAINER:"[data-region=\"panel-header-container\"]",VIEW_CONTACT:"[data-region=\"view-contact\"]",VIEW_CONTACTS:"[data-region=\"view-contacts\"]",VIEW_CONVERSATION:"[data-region=\"view-conversation\"]",VIEW_GROUP_INFO:"[data-region=\"view-group-info\"]",VIEW_OVERVIEW:"[data-region=\"view-overview\"]",VIEW_SEARCH:"[data-region=\"view-search\"]",VIEW_SETTINGS:"[data-region=\"view-settings\"]",ROUTES:"[data-route]",ROUTES_BACK:"[data-route-back]",HEADER_CONTAINER:"[data-region=\"header-container\"]",BODY_CONTAINER:"[data-region=\"body-container\"]",FOOTER_CONTAINER:"[data-region=\"footer-container\"]",CLOSE_BUTTON:"[data-action=\"closedrawer\"]"},q=function(a,b,c){var d=b.find(p.HEADER_CONTAINER).find(c);if(!d.length){d=b.find(p.PANEL_HEADER_CONTAINER).find(c)}var e=b.find(p.BODY_CONTAINER).find(c);if(!e.length){e=b.find(p.PANEL_BODY_CONTAINER).find(c)}var f=b.find(p.FOOTER_CONTAINER).find(c);return[a,d.length?d:null,e.length?e:null,f.length?f:null]},r=[[l.VIEW_CONTACT,p.VIEW_CONTACT,d.show,d.description],[l.VIEW_CONTACTS,p.VIEW_CONTACTS,e.show,e.description],[l.VIEW_CONVERSATION,p.VIEW_CONVERSATION,f.show,f.description],[l.VIEW_GROUP_INFO,p.VIEW_GROUP_INFO,g.show,g.description],[l.VIEW_OVERVIEW,p.VIEW_OVERVIEW,h.show,h.description],[l.VIEW_SEARCH,p.VIEW_SEARCH,i.show,i.description],[l.VIEW_SETTINGS,p.VIEW_SETTINGS,j.show,j.description]],s=function(a,b){r.forEach(function(c){k.add(a,c[0],q(a,b,c[1]),c[2],c[3])})},t=function(a,b){if(!b.attr("data-shown")){k.go(a,l.VIEW_OVERVIEW);b.attr("data-shown",!0)}var c=o.getDrawerRoot(b);if(c.length){o.show(c)}},u=function(a){var b=o.getDrawerRoot(a);if(b.length){o.hide(b)}},v=function(a){var b=o.getDrawerRoot(a);if(b.length){return o.isVisible(b)}return!0},w=function(b){a(p.DRAWER).attr("data-origin",b)},x=function(d,e,f){b.define(e,[b.events.activate]);var g=/^data-route-param-?(\d*)$/;e.on(b.events.activate,p.ROUTES,function(b,c){for(var e=a(b.target).closest(p.ROUTES),f=e.attr("data-route"),h=[],j=0;j<e[0].attributes.length;j++){h.push(e[0].attributes[j])}var l=h.filter(function(a){var b=a.nodeName,c=g.test(b);return c});l.sort(function(c,a){var b=g.exec(c.nodeName),d=g.exec(a.nodeName),e=1<b.length?b[1]:0,f=1<d.length?d[1]:0;if(e<f){return-1}else if(f<e){return 1}else{return 0}});var m=l.map(function(a){return a.nodeValue}),n=[d,f].concat(m);k.go.apply(null,n);c.originalEvent.preventDefault()});e.on(b.events.activate,p.ROUTES_BACK,function(a,b){k.back(d);b.originalEvent.preventDefault()});e.on("hide.bs.collapse",".collapse",function(b){var c=new n;a(b.target).one("hidden.bs.collapse",function(){c.resolve()})});e.on("show.bs.collapse",".collapse",function(b){var c=new n;a(b.target).one("shown.bs.collapse",function(){c.resolve()})});a(p.JUMPTO).focus(function(){var b=a(p.HEADER_CONTAINER).find("input:visible");if(b.length){b.focus()}else{a(p.HEADER_CONTAINER).find(p.ROUTES_BACK).focus()}});a(p.DRAWER).focus(function(){var b=a(this).attr("data-origin");if(b){a("#"+b).focus()}});if(!f){c.subscribe(m.SHOW,function(){t(d,e)});c.subscribe(m.HIDE,function(){u(e)});c.subscribe(m.TOGGLE_VISIBILITY,function(b){if(v(e)){u(e);a(p.JUMPTO).attr("tabindex",-1)}else{t(d,e);w(b);a(p.JUMPTO).attr("tabindex",0)}})}c.subscribe(m.SHOW_CONVERSATION,function(a){w(a.buttonid);t(d,e);k.go(d,l.VIEW_CONVERSATION,a.conversationid)});var h=e.find(p.CLOSE_BUTTON);h.on(b.events.activate,function(){c.publish(m.TOGGLE_VISIBILITY)});c.subscribe(m.CREATE_CONVERSATION_WITH_USER,function(a){w(a.buttonid);t(d,e);k.go(d,l.VIEW_CONVERSATION,null,"create",a.userid)});c.subscribe(m.SHOW_SETTINGS,function(){t(d,e);k.go(d,l.VIEW_SETTINGS)});c.subscribe(m.PREFERENCES_UPDATED,function(a){var b=a.filter(function(a){return"message_entertosend"==a.type}),c=b.length?b[0]:null;if(c){var d=e.find(p.FOOTER_CONTAINER).find(p.VIEW_CONVERSATION);d.attr("data-enter-to-send",c.value)}})};return{init:function init(b,c,d,e){b=a(b);s(c,b);x(c,b,d);if(d){t(c,b);if(e){var f=e.params||[];f=[c,e.path].concat(f);k.go.apply(null,f)}}}}});
function _typeof(e){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(e){return typeof e}}else{_typeof=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}define ("core_message/message_drawer_view_conversation",["jquery","core/auto_rows","core/backoff_timer","core/custom_interaction_events","core/notification","core/pending","core/pubsub","core/str","core_message/message_repository","core_message/message_drawer_events","core_message/message_drawer_view_conversation_constants","core_message/message_drawer_view_conversation_patcher","core_message/message_drawer_view_conversation_renderer","core_message/message_drawer_view_conversation_state_manager","core_message/message_drawer_router","core_message/message_drawer_routes","core/emoji/auto_complete","core/emoji/picker"],function(s,e,t,n,a,d,r,i,o,g,l,m,c,_,E,u,C,I){var v={},h=null,f=!1,T=0,A=null,p=!1,O=[],M=!0,S=!1,N=!1,b=[],R=null,U=[],L=l.NEWEST_MESSAGES_FIRST,D=l.LOAD_MESSAGE_LIMIT,w=l.MILLISECONDS_IN_SEC,y=l.SELECTORS,P=l.CONVERSATION_TYPES,B=function(){if(!h||h.type==P.PUBLIC){return null}var e=h.loggedInUserId;if(h.type==P.SELF){return e}var s=Object.keys(h.members).filter(function(s){return e!=s});return s.length?s[0]:null},F=function(e){return Object.keys(v).reduce(function(s,t){if(!s){var n=v[t].state;if(n.type!=P.PUBLIC){if(e in n.members){s=n.id}}}return s},null)},k=function(e){return{id:parseInt(e.attr("data-user-id"),10),fullname:null,profileimageurl:null,profileimageurlsmall:null,isonline:null,showonlinestatus:null,isblocked:null,iscontact:null,isdeleted:null,canmessage:null,canmessageevenifblocked:null,requirescontact:null,contactrequests:[]}},V=function(){return T},x=function(e){T=e;v[h.id].messagesOffset=e},G=function(){return f},q=function(e){f=e;v[h.id].loadedAllMessages=e},j=function(e){return e.find(y.MESSAGES_CONTAINER)},K=function(e){return{id:e.id,name:e.name,subname:e.subname,imageUrl:e.imageUrl,isFavourite:e.isFavourite,isMuted:e.isMuted,type:e.type,totalMemberCount:e.totalMemberCount,loggedInUserId:e.loggedInUserId,messages:e.messages.map(function(e){return s.extend({},e)}),members:Object.keys(e.members).map(function(t){var n=s.extend({},e.members[t]);n.contactrequests=e.members[t].contactrequests.map(function(e){return s.extend({},e)});return n})}},Q=function(e,s){var t=e.id,n=t==s?P.SELF:P.PRIVATE,d=_.setLoadingMembers(h,!0);d=_.setLoadingMessages(d,!0);R(d);return o.getMemberInfo(t,[s],!0,!0).then(function(e){if(e.length){return e[0]}else{throw new Error("Unable to load other user profile")}}).then(function(s){var t=n==P.SELF?[s]:[s,e],a=_.addMembers(h,t);a=_.setLoadingMembers(a,!1);a=_.setLoadingMessages(a,!1);a=_.setName(a,s.fullname);a=_.setType(a,n);a=_.setImageUrl(a,s.profileimageurl);a=_.setTotalMemberCount(a,t.length);R(a);return s}).catch(function(e){var s=_.setLoadingMembers(h,!1);R(s);a.exception(e)})},W=function(e,s){var t=null;if(e.type==P.PRIVATE){var n=e.members.filter(function(e){return e.id!=s});t=n.length?n[0]:null}else if(e.type==P.SELF){t=e.members[0]}var a=e.name,d=e.imageurl;if(e.type!=P.PUBLIC){a=a||t?t.fullname:"";d=d||t?t.profileimageurl:""}var r=_.addMembers(h,e.members);r=_.setName(r,a);r=_.setSubname(r,e.subname);r=_.setType(r,e.type);r=_.setImageUrl(r,d);r=_.setTotalMemberCount(r,e.membercount);r=_.setIsFavourite(r,e.isfavourite);r=_.setIsMuted(r,e.ismuted);r=_.addMessages(r,e.messages);r=_.setCanDeleteMessagesForAllUsers(r,e.candeletemessagesforallusers);return r},J=function(e,s,t,n,d){var r=s.id,i=_.setLoadingMembers(h,!0);i=_.setLoadingMessages(i,!0);R(i);return o.getConversation(r,e,!0,!0,0,0,t+1,n,d).then(function(e){if(e.messages.length>t){e.messages=e.messages.slice(1)}else{q(!0)}x(n+t);return e}).then(function(e){var t=e.members.filter(function(e){return e.id==s.id});if(1>t.length){e.members=e.members.concat([s])}var n=W(e,s.id);n=_.setLoadingMembers(n,!1);n=_.setLoadingMessages(n,!1);return R(n).then(function(){return e})}).then(function(){return z(e)}).catch(function(e){var s=_.setLoadingMembers(h,!1);s=_.setLoadingMessages(s,!1);R(s);a.exception(e)})},X=function(e,s,t,n){var d=e.members.filter(function(e){return e.id==s.id});if(1>d.length){e.members=e.members.concat([s])}var r=e.messages.length,i=r>=t,o=W(e,s.id);o=_.setLoadingMembers(o,!1);o=_.setLoadingMessages(o,!i);var g=R(o);return g.then(function(){if(!i){return Y(e.id,t,r,n,[])}else{return{messages:e.messages}}}).then(function(){var e=h.messages;x(e.length);z(h.id);return e}).catch(a.exception)},Y=function(e,s,t,n,a,d){return o.getMessages(h.loggedInUserId,e,s?s+1:s,t,n,d).then(function(e){if(e.id!=h.id){e.messages=[];if(e.id in v){delete v[e.id]}}return e}).then(function(e){if(e.messages.length&&a.length){e.messages=e.messages.filter(function(e){return 0>a.indexOf(parseInt(e.id,10))})}return e}).then(function(e){if(!s){return e}else if(e.messages.length>s){e.messages=e.messages.slice(0,-1)}else{q(!0)}return e}).then(function(e){var s=e.members.filter(function(e){return!(e.id in h.members)}),t=_.addMembers(h,s);t=_.addMessages(t,e.messages);t=_.setLoadingMessages(t,!1);return R(t).then(function(){return e})}).catch(function(e){var s=_.setLoadingMessages(h,!1);R(s);throw e})},H=function(e,t){return function(){var n=h.messages,a=n.length?n[n.length-1]:null,d=a?a.timeCreated:null;if(d&&!M&&!S&&!N){for(var o=[],l=n.length-1,m;0<=l;l--){m=n[l];if(m.timeCreated===d){o.push(m.id)}else{break}}return Y(e,0,0,t,o,d).then(function(s){if(s.messages.length){A.restart();var t=K(h);r.publish(g.CONVERSATION_NEW_LAST_MESSAGE,t);return z(e)}else{return s}})}return s.Deferred().resolve().promise()}},z=function(e){var s=h.loggedInUserId,t=new d("core_message/message_drawer_view_conversation:markConversationAsRead");return o.markAllConversationMessagesAsRead(s,e).then(function(){var s=_.markMessagesAsRead(h,h.messages);r.publish(g.CONVERSATION_READ,e);return R(s)}).then(function(e){t.resolve();return e})},Z=function(e){Ee(e);var s=_.addPendingBlockUsersById(h,[e]);R(s)},$=function(e){var s=_.setLoadingConfirmAction(h,!0),t=new d("core_message/message_drawer_view_conversation:blockUser");R(s);return o.blockUser(h.loggedInUserId,e).then(function(s){var t=_.addMembers(h,[s]);t=_.removePendingBlockUsersById(t,[e]);t=_.setLoadingConfirmAction(t,!1);r.publish(g.CONTACT_BLOCKED,e);return R(t)}).then(function(e){t.resolve();return e})},ee=function(e){Ee(e);var s=_.addPendingUnblockUsersById(h,[e]);R(s)},se=function(e){var s=_.setLoadingConfirmAction(h,!0),t=new d("core_message/message_drawer_view_conversation:unblockUser");R(s);return o.unblockUser(h.loggedInUserId,e).then(function(s){var t=_.addMembers(h,[s]);t=_.removePendingUnblockUsersById(t,[e]);t=_.setLoadingConfirmAction(t,!1);r.publish(g.CONTACT_UNBLOCKED,e);return R(t)}).then(function(e){t.resolve();return e})},te=function(e){Ee(e);var s=_.addPendingRemoveContactsById(h,[e]);R(s)},ne=function(e){var s=_.setLoadingConfirmAction(h,!0),t=new d("core_message/message_drawer_view_conversation:removeContact");R(s);return o.deleteContacts(h.loggedInUserId,[e]).then(function(s){var t=_.addMembers(h,s);t=_.removePendingRemoveContactsById(t,[e]);t=_.setLoadingConfirmAction(t,!1);r.publish(g.CONTACT_REMOVED,e);return R(t)}).then(function(e){t.resolve();return e})},ae=function(e){Ee(e);var s=_.addPendingAddContactsById(h,[e]);R(s)},de=function(e){var s=_.setLoadingConfirmAction(h,!0),t=new d("core_message/message_drawer_view_conversation:addContactRequests");R(s);return o.createContactRequest(h.loggedInUserId,e).then(function(e){if(!e.request){throw new Error(e.warnings[0].message)}return e.request}).then(function(s){var t=_.removePendingAddContactsById(h,[e]);t=_.addContactRequests(t,[s]);t=_.setLoadingConfirmAction(t,!1);return R(t)}).then(function(e){t.resolve();return e})},re=function(){var e=h.loggedInUserId,s=h.id,t=new d("core_message/message_drawer_view_conversation:setFavourite");return o.setFavouriteConversations(e,[s]).then(function(){var e=_.setIsFavourite(h,!0);return R(e)}).then(function(){return r.publish(g.CONVERSATION_SET_FAVOURITE,K(h))}).then(function(e){t.resolve();return e})},ie=function(){var e=h.loggedInUserId,s=h.id,t=new d("core_message/message_drawer_view_conversation:unsetFavourite");return o.unsetFavouriteConversations(e,[s]).then(function(){var e=_.setIsFavourite(h,!1);return R(e)}).then(function(){return r.publish(g.CONVERSATION_UNSET_FAVOURITE,K(h))}).then(function(e){t.resolve();return e})},oe=function(){var e=h.loggedInUserId,s=h.id,t=new d("core_message/message_drawer_view_conversation:markConversationAsRead");return o.setMutedConversations(e,[s]).then(function(){var e=_.setIsMuted(h,!0);return R(e)}).then(function(){return r.publish(g.CONVERSATION_SET_MUTED,K(h))}).then(function(e){t.resolve();return e})},ge=function(){var e=h.loggedInUserId,s=h.id;return o.unsetMutedConversations(e,[s]).then(function(){var e=_.setIsMuted(h,!1);return R(e)}).then(function(){return r.publish(g.CONVERSATION_UNSET_MUTED,K(h))})},le=function(e){var s=h.selectedMessageIds;Ee(e);var t=_.addPendingDeleteMessagesById(h,s);R(t)},me=function(){var e=new d("core_message/message_drawer_view_conversation:deleteSelectedMessages"),t=h.pendingDeleteMessageIds,n=h.messages.filter(function(e){return 0<=t.indexOf(e.id)&&("sent"==e.sendState||null===e.sendState)}),i=_.setLoadingConfirmAction(h,!0);R(i);var l=s.Deferred().resolve().promise();if(n.length){var m=n.map(function(e){return e.id});if(i.deleteMessagesForAllUsers){l=o.deleteMessagesForAllUsers(h.loggedInUserId,m)}else{l=o.deleteMessages(h.loggedInUserId,m)}}N=!0;if(A){A.stop()}return l.then(function(){var e=_.removeMessagesById(h,t);e=_.removePendingDeleteMessagesById(e,t);e=_.removeSelectedMessagesById(e,t);e=_.setLoadingConfirmAction(e,!1);e=_.setDeleteMessagesForAllUsers(e,!1);var s=h.messages[h.messages.length-1],n=e.messages.length?e.messages[e.messages.length-1]:null;if(n&&n.id!=s.id){var a=K(e);r.publish(g.CONVERSATION_NEW_LAST_MESSAGE,a)}else if(!e.messages.length){r.publish(g.CONVERSATION_DELETED,e.id)}N=!1;return R(e)}).then(function(s){e.resolve();return s}).catch(a.exception)},ce=function(e){Ee(e);var s=_.setPendingDeleteConversation(h,!0);R(s)},_e=function(){var e=new d("core_message/message_drawer_view_conversation:markConversationAsRead"),s=_.setLoadingConfirmAction(h,!0);R(s);N=!0;if(A){A.stop()}return o.deleteConversation(h.loggedInUserId,h.id).then(function(){var e=_.removeMessages(h,h.messages);e=_.removeSelectedMessagesById(e,h.selectedMessageIds);e=_.setPendingDeleteConversation(e,!1);e=_.setLoadingConfirmAction(e,!1);r.publish(g.CONVERSATION_DELETED,e.id);N=!1;return R(e)}).then(function(s){e.resolve();return s})},Ee=function(e){var s=h.pendingDeleteMessageIds,t=_.removePendingAddContactsById(h,[e]);t=_.removePendingRemoveContactsById(t,[e]);t=_.removePendingUnblockUsersById(t,[e]);t=_.removePendingBlockUsersById(t,[e]);t=_.removePendingDeleteMessagesById(t,s);t=_.setPendingDeleteConversation(t,!1);t=_.setDeleteMessagesForAllUsers(t,!1);R(t)},ue=function(e){var s=new d("core_message/message_drawer_view_conversation:acceptContactRequest"),t=h.loggedInUserId,n=h.members[e].contactrequests.filter(function(e){return e.requesteduserid==t}),a=n[0],i=_.setLoadingConfirmAction(h,!0);R(i);return o.acceptContactRequest(e,t).then(function(e){var s=_.removeContactRequests(h,[a]);s=_.addMembers(h,[e]);s=_.setLoadingConfirmAction(s,!1);return R(s)}).then(function(){r.publish(g.CONTACT_ADDED,h.members[e]);r.publish(g.CONTACT_REQUEST_ACCEPTED,a)}).then(function(e){s.resolve();return e})},Ce=function(e){var s=new d("core_message/message_drawer_view_conversation:declineContactRequest"),t=h.loggedInUserId,n=h.members[e].contactrequests.filter(function(e){return e.requesteduserid==t}),a=n[0],i=_.setLoadingConfirmAction(h,!0);R(i);return o.declineContactRequest(e,t).then(function(e){var s=_.removeContactRequests(h,[a]);s=_.addMembers(h,[e]);s=_.setLoadingConfirmAction(s,!1);return R(s)}).then(function(){r.publish(g.CONTACT_REQUEST_DECLINED,a)}).then(function(e){s.resolve();return e})},Ie=function(){if(S){return}if(!b.length){return}var e=new d("core_message/message_drawer_view_conversation:processSendMessageBuffer");S=!0;var t=b.slice();b=[];var n=h.id,a=null,l=t.map(function(e){return e.text}),m=t.map(function(e){return e.id}),c=null,E=null;if(!n&&h.type!=P.PUBLIC){var u=B();c=o.sendMessagesToUser(u,l).then(function(e){if(e.length){a=parseInt(e[0].conversationid,10);E=e[0].candeletemessagesforallusers}return e})}else{c=o.sendMessagesToConversation(n,l)}c.then(function(e){var s=e.map(function(e){return e.id}),n=[],d=[],i=[];t.forEach(function(s,t){var a=e[t];n.push([s,a]);if(0<=h.selectedMessageIds.indexOf(s.id)){d.push(s.id);i.push(a.id)}});var o=_.updateMessages(h,n);o=_.setMessagesSendSuccessById(o,s);if(d.length){o=_.removeSelectedMessagesById(o,d)}if(i.length){o=_.addSelectedMessagesById(o,i)}var l=K(o);if(!o.id){o=_.setId(o,a);l.id=a;xe(a);r.publish(g.CONVERSATION_CREATED,l);o=_.setCanDeleteMessagesForAllUsers(o,E)}R(o);S=!1;Ie();r.publish(g.CONVERSATION_NEW_LAST_MESSAGE,l)}).then(function(s){e.resolve();return s}).catch(function(t){var n;if(t.message){n=s.Deferred().resolve(t.message).promise()}else{n=i.get_string("unknownerror","core")}var a=function(e){var s=_.setMessagesSendFailById(h,m,e);R(s);S=!1;Ie()};n.then(a).then(function(s){e.resolve();return s}).catch(function(s){var e=s.message||"Something went wrong!";a(e)})})},ve=function(e){var s=e.replace(/<style([\s\S]*?)<\/style>/gi,"");s=s.replace(/<script([\s\S]*?)<\/script>/gi,"");s=s.replace(/<\/div>/ig,"\n");s=s.replace(/<\/li>/ig,"\n");s=s.replace(/<li>/ig,"  *  ");s=s.replace(/<\/ul>/ig,"\n");s=s.replace(/<\/p>/ig,"\n");s=s.replace(/<br[^>]*>/gi,"\n");s=s.replace(/<[^>]+>/ig,"");s=s.replace(/\n+/ig,"\n");return s.replace(/\n/ig,"<br>")},he=function(e){var s="temp"+Date.now(),t={id:s,useridfrom:h.loggedInUserId,text:ve(e),timecreated:null},n=_.addMessages(h,[t]);R(n);var a={id:s,useridfrom:h.loggedInUserId,text:e,timecreated:null};b.push(a);Ie()},fe=function(e){var s=_.setMessagesSendPendingById(h,[e.id]);R(s);b.push(e);Ie()},Te=function(e){var s=h;if(-1<h.selectedMessageIds.indexOf(e)){s=_.removeSelectedMessagesById(h,[e])}else{s=_.addSelectedMessagesById(h,[e])}R(s)},Ae=function(){Ee(B());var e=_.removeSelectedMessagesById(h,h.selectedMessageIds);R(e)},pe=function(e,t,n){if(p){return}if(!O.length){return}p=!0;var d=O.shift(),r=U.map(function(e){return e(d.patch)});s.when.apply(null,r).then(function(){p=!1;d.deferred.resolve(!0);pe(e,t,n)}).catch(function(e){p=!1;d.deferred.reject(e);a.exception(e)})},Oe=function(e,t,n,a){var d=function(s){return c.render(e,t,n,s)};if(!a){var r=_.buildInitialState(h.midnight,h.loggedInUserId,h.id),i=m.buildPatch(r,h);d(i)}U.push(d);return function(a){var d=m.buildPatch(h,a),r=s.Deferred();if(Object.keys(d).length){O.push({patch:d,deferred:r})}else{r.resolve(!0)}h=a;if(a.id){v[a.id]={state:a,messagesOffset:V(),loadedAllMessages:G()}}pe(e,t,n);return r.promise()}},Me=function(e){return function(s,t){if(!h.loadingConfirmAction){e(B());var n=_.setLoadingConfirmAction(h,!1);R(n)}t.originalEvent.preventDefault()}},Se=function(t,e){var n=s(t.target),a=n.closest(y.FOOTER_CONTAINER),d=a.find(y.MESSAGE_TEXT_AREA),r=d.val().trim();if(""!==r){he(r);d.val("");d.focus()}e.originalEvent.preventDefault()},Ne=function(t,e){var n=window.getSelection(),a=s(t.target);if(""!=n.toString()){return}if(a.is("a")){return}var d=a.closest(y.MESSAGE),r=d.attr("data-message-id");Te(r);e.originalEvent.preventDefault()},be=function(t,e){var n=s(t.target),a=n.closest(y.MESSAGE),d=a.attr("data-message-id"),r=h.messages.filter(function(e){return e.id==d}),i=r.length?r[0]:null;if(i){fe(i)}e.originalEvent.preventDefault();e.originalEvent.stopPropagation();t.stopPropagation()},Re=function(s,e){Ae();e.originalEvent.preventDefault()},Ue=function(s){return function(t,e){var n=B(),a=h.members[n];E.go(s,u.VIEW_CONTACT,a);e.originalEvent.preventDefault()}},Le=function(s,e){re().catch(a.exception);e.originalEvent.preventDefault()},De=function(s,e){ie().catch(a.exception);e.originalEvent.preventDefault()},we=function(s,e){oe().catch(a.exception);e.originalEvent.preventDefault()},ye=function(s,e){ge().catch(a.exception);e.originalEvent.preventDefault()},Pe=function(t){var e=s(t.target).prop("checked"),n=_.setDeleteMessagesForAllUsers(h,e);R(n)},Be=function(s){return function(t,e){E.go(s,u.VIEW_GROUP_INFO,{id:h.id,name:h.name,subname:h.subname,imageUrl:h.imageUrl,totalMemberCount:h.totalMemberCount},h.loggedInUserId);e.originalEvent.preventDefault()}},Fe=function(s,e){var t=_.setShowEmojiPicker(h,!h.showEmojiPicker);R(t);e.originalEvent.preventDefault()},ke=function(t){var e=s(t.target);if(h.showEmojiPicker&&!e.closest(y.EMOJI_PICKER_CONTAINER).length&&!e.closest(y.TOGGLE_EMOJI_PICKER_BUTTON).length){var n=_.setShowEmojiPicker(h,!1);R(n)}},Ve=function(t,d,i,o){var l=!1,m=j(i),c=o.find(y.EMOJI_PICKER),E=o.find(y.EMOJI_AUTO_COMPLETE_CONTAINER),v=o.find(y.MESSAGE_TEXT_AREA),f=[[y.ACTION_REQUEST_BLOCK,Me(Z)],[y.ACTION_REQUEST_UNBLOCK,Me(ee)],[y.ACTION_REQUEST_ADD_CONTACT,Me(ae)],[y.ACTION_REQUEST_REMOVE_CONTACT,Me(te)],[y.ACTION_REQUEST_DELETE_CONVERSATION,Me(ce)],[y.ACTION_CANCEL_EDIT_MODE,Re],[y.ACTION_VIEW_CONTACT,Ue(t)],[y.ACTION_VIEW_GROUP_INFO,Be(t)],[y.ACTION_CONFIRM_FAVOURITE,Le],[y.ACTION_CONFIRM_MUTE,we],[y.ACTION_CONFIRM_UNFAVOURITE,De],[y.ACTION_CONFIRM_UNMUTE,ye]],T=[[y.ACTION_CANCEL_CONFIRM,Me(Ee)],[y.ACTION_CONFIRM_BLOCK,Me($)],[y.ACTION_CONFIRM_UNBLOCK,Me(se)],[y.ACTION_CONFIRM_ADD_CONTACT,Me(de)],[y.ACTION_CONFIRM_REMOVE_CONTACT,Me(ne)],[y.ACTION_CONFIRM_DELETE_SELECTED_MESSAGES,Me(me)],[y.ACTION_CONFIRM_DELETE_CONVERSATION,Me(_e)],[y.ACTION_OKAY_CONFIRM,Me(Ee)],[y.ACTION_REQUEST_ADD_CONTACT,Me(ae)],[y.ACTION_ACCEPT_CONTACT_REQUEST,Me(ue)],[y.ACTION_DECLINE_CONTACT_REQUEST,Me(Ce)],[y.MESSAGE,Ne],[y.DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE,Pe],[y.RETRY_SEND,be]],p=[[y.SEND_MESSAGE_BUTTON,Se],[y.TOGGLE_EMOJI_PICKER_BUTTON,Fe],[y.ACTION_REQUEST_DELETE_SELECTED_MESSAGES,Me(le)],[y.ACTION_REQUEST_ADD_CONTACT,Me(ae)],[y.ACTION_REQUEST_UNBLOCK,Me(ee)]];e.init(o);if(E.length){C(E[0],v[0],function(e){var s=_.setShowEmojiAutoComplete(h,e);R(s)},function(e){var s=_.setShowEmojiAutoComplete(h,!1);R(s);v.focus();var t=v.prop("selectionStart"),n=v.val(),a=n.substring(0,t).replace(/\S*$/,""),d=n.substring(t).replace(/^\S*/,"");v.val(a+e+d);v.prop("selectionStart",a.length+e.length);v.prop("selectionEnd",a.length+e.length)})}if(c.length){I(c[0],function(e){var s=_.setShowEmojiPicker(h,!h.showEmojiPicker);R(s);v.focus();var t=v.prop("selectionStart"),n=v.val(),a=n.substring(0,t),d=n.substring(t,n.length);v.val(a+e+d);v.prop("selectionStart",t+e.length);v.prop("selectionEnd",t+e.length)})}n.define(d,[n.events.activate]);n.define(i,[n.events.activate]);n.define(o,[n.events.activate,n.events.enter,n.events.escape]);n.define(m,[n.events.scrollTop,n.events.scrollLock]);m.on(n.events.scrollTop,function(s,e){var t=1<Object.keys(h.members).length;if(!M&&!l&&!G()&&t){l=!0;var n=_.setLoadingMessages(h,!0);R(n);Y(h.id,D,V(),L,[]).then(function(){l=!1;x(V()+D)}).catch(function(e){l=!1;a.exception(e)})}e.originalEvent.preventDefault()});f.forEach(function(e){var s=e[0],t=e[1];d.on(n.events.activate,s,t)});T.forEach(function(e){var s=e[0],t=e[1];i.on(n.events.activate,s,t)});p.forEach(function(e){var s=e[0],t=e[1];o.on(n.events.activate,s,t)});o.on(n.events.enter,y.MESSAGE_TEXT_AREA,function(s,e){var t=o.attr("data-enter-to-send");if(t&&"false"!=t&&"0"!=t){Se(s,e)}});o.on(n.events.escape,y.EMOJI_PICKER_CONTAINER,Fe);s(document.body).on("click",ke);r.subscribe(g.ROUTE_CHANGED,function(e){if(A){if(e.route!=u.VIEW_CONVERSATION){A.stop()}}})},xe=function(e){if(A){A.stop()}A=new t(H(e,L),t.getIncrementalCallback(h.messagePollMin*w,w,h.messagePollMax*w,h.messagePollAfterMax*w));A.start()},Ge=function(e,s,t){if(A){A.stop()}f=!1;T=0;A=null;p=!1;O=[];M=!0;S=!1;N=!1;b=[];var n=t.id,a=parseInt(e.attr("data-midnight"),10),d=parseInt(e.attr("data-message-poll-min"),10),r=parseInt(e.attr("data-message-poll-max"),10),i=parseInt(e.attr("data-message-poll-after-max"),10),o=_.buildInitialState(a,n,s,d,r,i);if(!h){h=o}R(o)},qe=function(e,s,t){Ge(e,null,s);var n=null;if(s.id!=t){n=o.getConversationBetweenUsers(s.id,t,!0,!0,0,0,D,0,L)}else{n=o.getSelfConversation(s.id,D,0,L)}return n.then(function(t){return Ke(e,t,s)}).catch(function(){return Q(s,t)})},je=function(e,t,n){var a=null;if(t in v){a=v[t]}Ge(e,t,n);var d=s.Deferred().resolve({}).promise();if(a){var r=a.state;r=_.setLoadingMessages(r,!1);r=_.setLoadingMembers(r,!1);x(a.messagesOffset);q(a.loadedAllMessages);R(r)}else{d=J(t,n,D,0,L)}return d.then(function(){return xe(t)})},Ke=function(e,t,n){var a=null;if(t.id in v){a=v[t.id]}Ge(e,t.id,n);var d=s.Deferred().resolve({}).promise();if(a){var r=a.state;r=_.setLoadingMessages(r,!1);r=_.setLoadingMembers(r,!1);x(a.messagesOffset);q(a.loadedAllMessages);R(r)}else{d=X(t,n,D,L)}return d.then(function(){return xe(t.id)})},Qe=function(e,t,n,d,r,i,o){var g=null,m=null;if(r&&null!==r&&"object"==_typeof(r)){g=r;m=parseInt(g.id,10)}else{g=null;m=parseInt(r,10);m=isNaN(m)?null:m}if(!m&&i&&o){m=F(o)}var c=!h||h.id!=m||o&&o!=B();if(!n.attr("data-init")){R=Oe(t,n,d,c);Ve(e,t,n,d);n.attr("data-init",!0)}if(c){var _=null,E=k(n);if(g){_=Ke(n,g,E,o)}else if(m){_=je(n,m,E,o)}else{_=qe(n,E,o)}return _.then(function(){M=!1;t.find(l.SELECTORS.CAN_RECEIVE_FOCUS).first().focus()}).catch(function(e){M=!1;a.exception(e)})}xe(m);if(h.type==P.PRIVATE&&i){var u=B();switch(i){case"block":return Z(u);case"unblock":return ee(u);case"add-contact":return ae(u);case"remove-contact":return te(u);}}return s.Deferred().resolve().promise()},We=function(){return i.get_string("messagedrawerviewconversation","core_message",h.name)};return{show:Qe,description:We}});
define ("core_message/message_drawer_view_conversation_renderer",["jquery","core/notification","core/str","core/templates","core/user_date","core_message/message_drawer_view_conversation_constants","core/aria"],function(a,b,c,d,e,f,g){var h=f.SELECTORS,i=f.TEMPLATES,j=f.CONVERSATION_TYPES,k=function(a){return a.find(h.CONTENT_MESSAGES_CONTAINER)},l=function(a){k(a).removeClass("hidden")},m=function(a){k(a).addClass("hidden")},n=function(a){return a.find(h.SELF_CONVERSATION_MESSAGE_CONTAINER)},o=function(a){return n(a).addClass("hidden")},p=function(a){return a.find(h.CONTACT_REQUEST_SENT_MESSAGE_CONTAINER)},q=function(a){return p(a).addClass("hidden")},r=function(a){return a.find(h.CONTENT_MESSAGES_FOOTER_CONTAINER)},s=function(a){r(a).removeClass("hidden")},t=function(a){r(a).addClass("hidden")},u=function(a){return a.find(h.CONTENT_MESSAGES_FOOTER_EDIT_MODE_CONTAINER)},v=function(a){u(a).removeClass("hidden")},w=function(a){u(a).addClass("hidden")},x=function(a){return a.find(h.PLACEHOLDER_CONTAINER)},y=function(a){x(a).removeClass("hidden")},z=function(a){x(a).addClass("hidden")},A=function(a){return a.find(h.CONTENT_MESSAGES_FOOTER_REQUIRE_CONTACT_CONTAINER)},B=function(a){A(a).removeClass("hidden")},C=function(a){A(a).addClass("hidden")},D=function(a){return a.find(h.CONTENT_MESSAGES_FOOTER_REQUIRE_UNBLOCK_CONTAINER)},E=function(a){D(a).removeClass("hidden")},F=function(a){D(a).addClass("hidden")},G=function(a){return a.find(h.CONTENT_MESSAGES_FOOTER_UNABLE_TO_MESSAGE_CONTAINER)},H=function(a){G(a).removeClass("hidden")},I=function(a){G(a).addClass("hidden")},J=function(a){Q(a);T(a);W(a)},K=function(a){t(a);w(a);z(a);C(a);F(a);I(a)},L=function(a){return a.find(h.CONTENT_PLACEHOLDER_CONTAINER)},M=function(a){L(a).removeClass("hidden")},N=function(a){L(a).addClass("hidden")},O=function(a){return a.find(h.HEADER)},P=function(a){O(a).removeClass("hidden")},Q=function(a){O(a).addClass("hidden")},R=function(a){return a.find(h.HEADER_EDIT_MODE)},S=function(a){R(a).removeClass("hidden")},T=function(a){R(a).addClass("hidden")},U=function(a){return a.find(h.HEADER_PLACEHOLDER_CONTAINER)},V=function(a){U(a).removeClass("hidden")},W=function(a){U(a).addClass("hidden")},X=function(a){return a.find(h.EMOJI_PICKER_CONTAINER)},Y=function(a){return a.find(h.EMOJI_AUTO_COMPLETE_CONTAINER)},Z=function(a,b){var c=k(a);return c.find("[data-message-id=\""+b+"\"]")},$=function(a,b){var c=k(a);return c.find("[data-day-id=\""+b+"\"]")},_=function(a){return a.find(h.MORE_MESSAGES_LOADING_ICON_CONTAINER)},aa=function(a){_(a).removeClass("hidden")},ba=function(a){_(a).addClass("hidden")},ca=function(a){return a.find(h.CONFIRM_DIALOGUE_CONTAINER)},da=function(a){var b=ca(a),c=b.siblings(":not(.hidden)");g.hide(c.get());c.attr("data-confirm-dialogue-hidden",!0);b.removeClass("hidden")},ea=function(a){var b=ca(a),c=b.siblings("[data-confirm-dialogue-hidden=\"true\"]");g.unhide(c.get());c.removeAttr("data-confirm-dialogue-hidden");b.addClass("hidden")},fa=function(a,b){R(a).find(h.MESSAGES_SELECTED_COUNT).text(b)},ga=function(a,b){return a.map(function(a){return{id:a.id,isread:a.isRead,fromloggedinuser:a.fromLoggedInUser,userfrom:a.userFrom,text:a.text,formattedtime:a.timeCreated?b[a.timeCreated]:null}})},ha=function(b,c,e,f,g){var h=k(c),j=f.map(function(a){return d.render(i.DAY,{timestamp:a.value.timestamp,messages:ga(a.value.messages,g)})});return a.when.apply(a,j).then(function(){f.forEach(function(b,d){j[d].then(function(d){if(b.before){var e=$(c,b.before.timestamp);return a(d).insertBefore(e)}else{return h.append(d)}}).catch(function(){})})})},ia=function(b,c,e,f,g){var j=f.map(function(a){return a.value}),k=ga(j,g);return d.render(i.MESSAGES,{messages:k}).then(function(b){var d=a(b);f.forEach(function(a){var b=d.find("[data-message-id=\""+a.value.id+"\"]");if(a.before){var e=Z(c,a.before.id);return b.insertBefore(e)}else{var f=$(c,a.day.timestamp),g=f.find(h.DAY_MESSAGES_CONTAINER);return g.append(b)}})})},ja=function(a,b,c,d,e){d.forEach(function(a){var c=a.before,d=a.after,f=Z(b,c.id);if(c.id!=d.id){f.attr("data-message-id",d.id)}if(c.timeCreated!=d.timeCreated){var i=e[d.timeCreated];f.find(h.LOADING_ICON_CONTAINER).addClass("hidden");f.find(h.TIME_CREATED).text(i).removeClass("hidden")}if(c.sendState!=d.sendState){var j=f.find(h.LOADING_ICON_CONTAINER),k=f.find(h.TIME_CREATED),l=f.find(h.RETRY_SEND);j.addClass("hidden");g.hide(j.get());k.addClass("hidden");g.hide(k.get());l.addClass("hidden");g.hide(l.get());f.removeClass("border border-danger");switch(d.sendState){case"pending":j.removeClass("hidden");g.unhide(j.get());break;case"error":l.removeClass("hidden");g.unhide(l.get());f.addClass("border border-danger");break;case"sent":k.removeClass("hidden");g.unhide(k.get());break;}}if(c.text!=d.text){f.find(h.TEXT_CONTAINER).html(d.text)}if(c.errorMessage!=d.errorMessage){var m=f.find(h.ERROR_MESSAGE_CONTAINER),a=m.find(h.ERROR_MESSAGE);if(d.errorMessage){m.removeClass("hidden");g.unhide(m.get());a.text(d.errorMessage)}else{m.addClass("hidden");g.unhide(m.get());a.text("")}}})},ka=function(a,b){b.forEach(function(b){$(a,b.timestamp).remove()})},la=function(a,b){b.forEach(function(b){Z(a,b.id).remove()})},ma=function(b,d,f,g){var h=[],i=0<g.days.add.length,j=0<g.messages.add.length,k=0<g.messages.update.length,l=[],m=a.Deferred().resolve({}).promise();if(i){l=l.concat(g.days.add.reduce(function(a,b){return a.concat(b.value.messages.reduce(function(a,b){if(b.timeCreated){a.push(b.timeCreated)}return a},[]))},[]))}if(j){l=l.concat(g.messages.add.reduce(function(a,b){if(b.value.timeCreated){a.push(b.value.timeCreated)}return a},[]))}if(k){l=l.concat(g.messages.update.reduce(function(a,b){if(b.before.timeCreated!=b.after.timeCreated){a.push(b.after.timeCreated)}return a},[]))}if(l.length){m=c.get_string("strftimetime24","core_langconfig").then(function(a){var b=l.map(function(b){return{timestamp:b,format:a}});return e.get(b)}).then(function(a){return l.reduce(function(b,c,d){b[c]=a[d];return b},{})})}if(i){h.push(m.then(function(a){return ha(b,d,f,g.days.add,a)}))}if(j){h.push(m.then(function(a){return ia(b,d,f,g.messages.add,a)}))}if(k){h.push(m.then(function(a){return ja(b,d,f,g.messages.update,a)}))}if(0<g.days.remove.length){ka(d,g.days.remove)}if(0<g.messages.remove.length){la(d,g.messages.remove)}return a.when.apply(a,h)},na=function(a,b,c,e){var f=O(a),g=i.HEADER_PUBLIC;e.context.showrouteback="false"===a.attr("data-from-panel");if(e.type==j.PRIVATE){g=e.showControls?i.HEADER_PRIVATE:i.HEADER_PRIVATE_NO_CONTROLS}else if(e.type==j.SELF){g=i.HEADER_SELF}return d.render(g,e.context).then(function(a,b){d.replaceNodeContents(f,a,b)})},oa=function(a,b,d,e){K(d);switch(e.type){case"placeholder":return y(d);case"add-contact":return c.get_strings([{key:"requirecontacttomessage",component:"core_message",param:e.user.fullname},{key:"isnotinyourcontacts",component:"core_message",param:e.user.fullname}]).then(function(a){var b=a[1],c=a[0],e=A(d);e.find(h.TITLE).text(b);e.find(h.TEXT).text(c);B(d);return a});case"edit-mode":return v(d);case"content":return s(d);case"unblock":return E(d);case"unable-to-message":return H(d);}return!0},pa=function(a,b,c,d){var e=k(b),f=Z(b,d),g=f.position();if(g){var h=e.scrollTop()+g.top;e.scrollTop(h)}},qa=function(a,b,c,d){if(d){Q(a);V(a)}else{P(a);W(a)}},ra=function(a,b,c,d){if(d){m(b);M(b)}else{l(b);N(b)}},sa=function(a,b,c,d){if(d){aa(b)}else{ba(b)}},ta=function(a,b,c,d){var e=X(c);if(d){e.removeClass("hidden");g.unhide(e.get());e.find(h.EMOJI_PICKER_SEARCH_INPUT).focus()}else{e.addClass("hidden");g.hide(e.get())}},ua=function(a,b,c,d){var e=Y(c);if(d){e.removeClass("hidden");g.unhide(e.get())}else{e.addClass("hidden");g.hide(e.get())}},va=function(b,c,d,e,f,g,i,j,k){var l=ca(c),m=e.map(function(a){return l.find(a)}),n=l.find(h.CONFIRM_DIALOGUE_CANCEL_BUTTON),o=l.find(h.CONFIRM_DIALOGUE_OKAY_BUTTON),p=l.find(h.CONFIRM_DIALOGUE_TEXT),q=l.find(h.CONFIRM_DIALOGUE_HEADER);l.find("button").addClass("hidden");if(i){n.removeClass("hidden")}else{n.addClass("hidden")}if(k){o.removeClass("hidden")}else{o.addClass("hidden")}if(g){q=a("<h3 class=\"h6\" data-region=\"dialogue-header\"></h3>");q.text(g);var r=l.find(h.CONFIRM_DIALOGUE);r.prepend(q)}else if(q.length){q.remove()}m.forEach(function(a){a.removeClass("hidden")});p.text(f);da(d);da(c);if(!j){da(b)}l.find(h.CAN_RECEIVE_FOCUS).filter(":visible").first().focus()},wa=function(a,b,c){var d=ca(b),e=d.find(h.CONFIRM_DIALOGUE_CANCEL_BUTTON),f=d.find(h.CONFIRM_DIALOGUE_OKAY_BUTTON),g=d.find(h.CONFIRM_DIALOGUE_TEXT),i=d.find(h.CONFIRM_DIALOGUE_HEADER);Fa(b);ea(b);ea(c);ea(a);d.find("button").addClass("hidden");e.removeClass("hidden");f.removeClass("hidden");g.text("");if(i.length){i.remove()}a.find(h.CAN_RECEIVE_FOCUS).first().focus();return!0},xa=function(a,b,d,e){if(e){if(e.canmessageevenifblocked){return c.get_string("cantblockuser","core_message",e.fullname).then(function(c){return va(a,b,d,[],c,"",!1,!1,!0)})}else{return c.get_string("blockuserconfirm","core_message",e.fullname).then(function(c){return va(a,b,d,[h.ACTION_CONFIRM_BLOCK],c,"",!0,!1)})}}else{return wa(a,b,d)}},ya=function(a,b,d,e){if(e){return c.get_string("unblockuserconfirm","core_message",e.fullname).then(function(c){return va(a,b,d,[h.ACTION_CONFIRM_UNBLOCK],c,"",!0,!1)})}else{return wa(a,b,d)}},za=function(a,b,d,e){if(e){return c.get_string("addcontactconfirm","core_message",e.fullname).then(function(c){return va(a,b,d,[h.ACTION_CONFIRM_ADD_CONTACT],c,"",!0,!1)})}else{return wa(a,b,d)}},Aa=function(a,b,d,e){if(e){return c.get_string("removecontactconfirm","core_message",e.fullname).then(function(c){return va(a,b,d,[h.ACTION_CONFIRM_REMOVE_CONTACT],c,"",!0,!1)})}else{return wa(a,b,d)}},Ba=function(a,b,d,e){var f=null;if(e.type==j.SELF){f="deleteselectedmessagesconfirmselfconversation"}else{if(e.canDeleteMessagesForAllUsers){Ea(b);f="deleteforeveryoneselectedmessagesconfirm"}else{f="deleteselectedmessagesconfirm"}}if(e.show){return c.get_string(f,"core_message").then(function(c){return va(a,b,d,[h.ACTION_CONFIRM_DELETE_SELECTED_MESSAGES],c,"",!0,!1)})}else{return wa(a,b,d)}},Ca=function(a,b,d,e){var f=null;if(e==j.SELF){f="deleteallselfconfirm"}else if(e){f="deleteallconfirm"}if(f){return c.get_string(f,"core_message").then(function(c){return va(a,b,d,[h.ACTION_CONFIRM_DELETE_CONVERSATION],c,"",!0,!1)})}else{return wa(a,b,d)}},Da=function(a,b,d,e){if(e){return c.get_string("userwouldliketocontactyou","core_message",e.fullname).then(function(c){var e=[h.ACTION_ACCEPT_CONTACT_REQUEST,h.ACTION_DECLINE_CONTACT_REQUEST];return va(a,b,d,e,c,"",!1,!0)})}else{return wa(a,b,d)}},Ea=function(a){var b=ca(a),c=b.find(h.DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE_CONTAINER);c.removeClass("hidden")},Fa=function(a){var b=ca(a),c=b.find(h.DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE_CONTAINER),d=b.find(h.DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE);d.prop("checked",!1);c.addClass("hidden")},Ga=function(a,b,c,d){if(d){a.find(h.ACTION_REQUEST_BLOCK).addClass("hidden");a.find(h.ACTION_REQUEST_UNBLOCK).removeClass("hidden")}else{a.find(h.ACTION_REQUEST_BLOCK).removeClass("hidden");a.find(h.ACTION_REQUEST_UNBLOCK).addClass("hidden")}},Ha=function(a,b,c,d){var e=a.find(h.FAVOURITE_ICON_CONTAINER),f=a.find(h.ACTION_CONFIRM_FAVOURITE),g=a.find(h.ACTION_CONFIRM_UNFAVOURITE);switch(d){case"hide":e.addClass("hidden");f.addClass("hidden");g.addClass("hidden");break;case"show-add":e.addClass("hidden");f.removeClass("hidden");g.addClass("hidden");break;case"show-remove":e.removeClass("hidden");f.addClass("hidden");g.removeClass("hidden");break;}},Ia=function(a,b,c,d){var e=a.find(h.MUTED_ICON_CONTAINER),f=a.find(h.ACTION_CONFIRM_MUTE),g=a.find(h.ACTION_CONFIRM_UNMUTE);switch(d){case"hide":e.addClass("hidden");f.addClass("hidden");g.addClass("hidden");break;case"show-mute":e.addClass("hidden");f.removeClass("hidden");g.addClass("hidden");break;case"show-unmute":e.removeClass("hidden");f.addClass("hidden");g.removeClass("hidden");break;}},Ja=function(a,b,c,d){var e=a.find(h.ACTION_REQUEST_ADD_CONTACT),f=a.find(h.ACTION_REQUEST_REMOVE_CONTACT);switch(d){case"pending-contact":e.addClass("hidden");f.addClass("hidden");break;case"contact":e.addClass("hidden");f.removeClass("hidden");break;case"non-contact":e.removeClass("hidden");f.addClass("hidden");break;}},Ka=function(a,b,c,d){var e=ca(b),f=e.find("button"),g=e.find(h.CONFIRM_DIALOGUE_BUTTON_TEXT),i=e.find(h.LOADING_ICON_CONTAINER);if(d){f.prop("disabled",!0);g.addClass("hidden");i.removeClass("hidden")}else{f.prop("disabled",!1);g.removeClass("hidden");i.addClass("hidden")}},La=function(a,b,c,d){var e=null;if(d){e=b.find(h.MESSAGE_NOT_SELECTED);e.find(h.MESSAGE_NOT_SELECTED_ICON).removeClass("hidden");Q(a);S(a)}else{e=k(b);e.find(h.MESSAGE_NOT_SELECTED_ICON).addClass("hidden");e.find(h.MESSAGE_SELECTED_ICON).addClass("hidden");P(a);T(a)}},Ma=function(a,b,c,d){var e=0<d.count;if(d.add.length){d.add.forEach(function(a){var c=Z(b,a);c.find(h.MESSAGE_NOT_SELECTED_ICON).addClass("hidden");c.find(h.MESSAGE_SELECTED_ICON).removeClass("hidden");c.attr("aria-checked",!0)})}if(d.remove.length){d.remove.forEach(function(a){var c=Z(b,a);if(e){c.find(h.MESSAGE_NOT_SELECTED_ICON).removeClass("hidden")}c.find(h.MESSAGE_SELECTED_ICON).addClass("hidden");c.attr("aria-checked",!1)})}fa(a,d.count)},Na=function(a,b,d,e){if(e.show&&!e.hasMessages){return c.get_strings([{key:"requirecontacttomessage",component:"core_message",param:e.user.fullname},{key:"isnotinyourcontacts",component:"core_message",param:e.user.fullname}]).then(function(c){var e=c[1],f=c[0];return va(a,b,d,[h.ACTION_REQUEST_ADD_CONTACT],f,e,!1,!0)})}else{return wa(a,b,d)}},Oa=function(a,b,c,d){var e=n(b);if(d){e.removeClass("hidden")}else{e.addClass("hidden")}return!0},Pa=function(a,b,d,e){var f=p(b);if(e){return c.get_string("yourcontactrequestpending","core_message",e).then(function(a){f.find(h.TEXT).text(a);f.removeClass("hidden");return a})}else{f.addClass("hidden");return!0}},Qa=function(a,b,c){wa(a,b,c);q(b);o(b);J(a);V(a);K(c);y(c);return!0};return{render:function render(c,d,e,f){var g=[{reset:Qa},{conversation:ma,header:na,footer:oa,confirmBlockUser:xa,confirmUnblockUser:ya,confirmAddContact:za,confirmRemoveContact:Aa,confirmDeleteSelectedMessages:Ba,confirmDeleteConversation:Ca,confirmContactRequest:Da,requireAddContact:Na,selfConversationMessage:Oa,contactRequestSent:Pa},{loadingMembers:qa,loadingFirstMessages:ra,loadingMessages:sa,isBlocked:Ga,isContact:Ja,isFavourite:Ha,isMuted:Ia,loadingConfirmAction:Ka,inEditMode:La,showEmojiPicker:ta,showEmojiAutoComplete:ua},{scrollToMessage:pa,selectedMessages:Ma}],h=function(a){var b=[];for(var g in f){if(a.hasOwnProperty(g)){var h=a[g],i=f[g];b.push(h(c,d,e,i))}}return b},i=h(g[0]);i=i.concat(h(g[1]));return a.when.apply(a,i).then(function(){for(var a=2;a<g.length;a++){h(g[a])}}).catch(b.exception)}}});
define ("core_message/notification_processor",["jquery"],function(a){var b={STATE_NONE:"[data-state=\"none\"]",STATE_BOTH:"[data-state=\"both\"]",STATE_LOGGED_IN:"[data-state=\"loggedin\"]",STATE_LOGGED_OFF:"[data-state=\"loggedoff\"]"},c=function(b){this.root=a(b)};c.prototype.getName=function(){return this.root.attr("data-processor-name")};c.prototype.isLoggedInEnabled=function(){var a=this.root.find(b.STATE_NONE).find("input");if(a.prop("checked")){return!1}var c=this.root.find(b.STATE_BOTH).find("input"),d=this.root.find(b.STATE_LOGGED_IN).find("input");return d.prop("checked")||c.prop("checked")};c.prototype.isLoggedOffEnabled=function(){var a=this.root.find(b.STATE_NONE).find("input");if(a.prop("checked")){return!1}var c=this.root.find(b.STATE_BOTH).find("input"),d=this.root.find(b.STATE_LOGGED_OFF).find("input");return d.prop("checked")||c.prop("checked")};return c});
define ("core_message/message_drawer_view_contacts_section_contacts",["jquery","core/notification","core/pubsub","core/templates","core_message/message_repository","core_message/message_drawer_events","core_message/message_drawer_lazy_load_list"],function(a,b,c,d,e,f,g){var h={BLOCK_ICON_CONTAINER:"[data-region=\"block-icon-container\"]",CONTACT:"[data-region=\"contact\"]",CONTENT_CONTAINER:"[data-region=\"contacts-content-container\"]"},i={CONTACTS_LIST:"core_message/message_drawer_contacts_list"},j=function(a,b){return a.find("[data-contact-user-id=\""+b+"\"]")},k=function(c,e){var f=e.map(function(b){return a.extend(b,{id:b.userid})});return d.render(i.CONTACTS_LIST,{contacts:f}).then(function(a){c.append(a);return a}).catch(b.exception)},l=function(a){return function(c,d){return e.getContacts(d,101,a).then(function(a){return a}).then(function(a){if(a.length>100){a.pop()}else{g.setLoadedAll(c,!0)}return a}).then(function(b){a=a+100;return b}).catch(b.exception)}},m=function(a,b){j(a,b).remove()},n=function(a,b){var c=j(a,b);if(c.length){c.find(h.BLOCK_ICON_CONTAINER).removeClass("hidden")}},o=function(a,b){var c=j(a,b);if(c.length){c.find(h.BLOCK_ICON_CONTAINER).addClass("hidden")}},p=function(a){c.subscribe(f.CONTACT_ADDED,function(b){var c=g.getContentContainer(a);k(c,[b]);g.hideEmptyMessage(a);g.showContent(a)});c.subscribe(f.CONTACT_REMOVED,function(b){m(a,b);var c=a.find(h.CONTACT);if(!c.length){g.hideContent(a);g.showEmptyMessage(a)}});c.subscribe(f.CONTACT_BLOCKED,function(b){n(a,b)});c.subscribe(f.CONTACT_UNBLOCKED,function(b){o(a,b)})};return{show:function show(a){if(!a.attr("data-contacts-init")){p(a);a.attr("data-contacts-init",!0)}g.show(a,l(0),k)}}});
define ("core_message/message_drawer_events",[],function(){return{CREATE_CONVERSATION_WITH_USER:"message-drawer-create-conversation-with-user",CONTACT_BLOCKED:"message-drawer-contact-blocked",CONTACT_UNBLOCKED:"message-drawer-contact-unblocked",CONTACT_ADDED:"message-drawer-contact-added",CONTACT_REMOVED:"message-drawer-contact-removed",CONTACT_REQUEST_ACCEPTED:"message-drawer-contact-request-accepted",CONTACT_REQUEST_DECLINED:"message-drawer-contact-request-declined",CONVERSATION_CREATED:"message-drawer-conversation-created",CONVERSATION_NEW_LAST_MESSAGE:"message-drawer-conversation-new-last-message",CONVERSATION_DELETED:"message-drawer-conversation-deleted",CONVERSATION_READ:"message-drawer-conversation-read",CONVERSATION_SET_FAVOURITE:"message-drawer-conversation-set-favourite",CONVERSATION_SET_MUTED:"message-drawer-conversation-set-muted",CONVERSATION_UNSET_FAVOURITE:"message-drawer-conversation-unset-favourite",CONVERSATION_UNSET_MUTED:"message-drawer-conversation-unset-muted",PREFERENCES_UPDATED:"message-drawer-preferences-updated",ROUTE_CHANGED:"message-drawer-route-change",SHOW:"message-drawer-show",HIDE:"message-drawer-hide",TOGGLE_VISIBILITY:"message-drawer-toggle",SHOW_CONVERSATION:"message-drawer-show-conversation",SHOW_SETTINGS:"message-drawer-show-settings"}});
define ("core_message/message_drawer_view_contacts_section_requests",["jquery","core/notification","core/pubsub","core/templates","core_message/message_repository","core_message/message_drawer_events","core_message/message_drawer_lazy_load_list"],function(a,b,c,d,e,f,g){var h={CONTACT_REQUEST:"[data-region=\"contact-request\"]"},i={REQUESTS_LIST:"core_message/message_drawer_view_contacts_body_section_requests_list"},j=function(a,c){var e=c.map(function(a){return{id:a.id,profileimageurl:a.profileimageurl,fullname:a.fullname}});return d.render(i.REQUESTS_LIST,{requests:e}).then(function(b){a.append(b);return b}).catch(b.exception)},k=function(a,c){return e.getContactRequests(c).then(function(b){g.setLoadedAll(a,!0);return b}).catch(b.exception)},l=function(a){return function(b){a.find("[data-request-id=\""+b.userid+"\"]").remove();var c=a.find(h.CONTACT_REQUEST);if(!c.length){g.showEmptyMessage(a);g.hideContent(a)}}},m=function(a){c.subscribe(f.CONTACT_REQUEST_ACCEPTED,l(a));c.subscribe(f.CONTACT_REQUEST_DECLINED,l(a))};return{show:function show(a){if(!a.attr("data-contacts-init")){m(a);a.attr("data-contacts-init",!0)}g.show(a,k,j)}}});
define ("core_message/preferences_notifications_list_controller",["jquery","core/ajax","core/notification","core/custom_interaction_events","core_message/notification_preference","core_message/notification_processor_settings","core/modal_factory"],function(a,b,c,d,f,g,h){var i={DISABLE_NOTIFICATIONS:"[data-region=\"disable-notification-container\"] [data-disable-notifications]",DISABLE_NOTIFICATIONS_CONTAINER:"[data-region=\"disable-notification-container\"]",PREFERENCE:"[data-state]",PREFERENCE_ROW:"[data-region=\"preference-row\"]",PREFERENCE_INPUT:"[data-state] input",PROCESSOR_SETTING:"[data-processor-setting]"},j=function(b){this.root=a(b);this.userId=this.root.attr("data-user-id");this.registerEventListeners()};j.prototype.isDisabled=function(){return this.root.hasClass("disabled")};j.prototype.setDisabled=function(){this.root.addClass("disabled");this.root.find(i.PREFERENCE_INPUT).prop("disabled",!0)};j.prototype.setEnabled=function(){this.root.removeClass("disabled");this.root.find(i.PREFERENCE_INPUT).prop("disabled",!1)};j.prototype.toggleDisableAllStatus=function(){var d=a(i.DISABLE_NOTIFICATIONS),e=a(i.DISABLE_NOTIFICATIONS_CONTAINER),f=d.prop("checked");if(e.hasClass("loading")){return a.Deferred().resolve()}e.addClass("loading");var g={methodname:"core_user_update_user_preferences",args:{userid:this.userId,emailstop:f?1:0}};return b.call([g])[0].done(function(){if(f){this.setDisabled()}else{this.setEnabled()}}.bind(this)).always(function(){e.removeClass("loading")}).fail(c.exception)};j.prototype.registerEventListeners=function(){var b=a(i.DISABLE_NOTIFICATIONS);d.define(this.root,[d.events.activate]);this.root.on("change",function(b){if(!this.isDisabled()){var c=a(b.target).closest(i.PREFERENCE),d=a(b.target).closest(i.PREFERENCE_ROW),e=new f(d,this.userId);c.addClass("loading");e.save().always(function(){c.removeClass("loading")})}}.bind(this));var j=h.create({type:g.TYPE});this.root.on(d.events.activate,i.PROCESSOR_SETTING,function(b,d){var e=a(b.target).closest(i.PROCESSOR_SETTING);d.originalEvent.preventDefault();j.then(function(c){c.setUserId(a(e).attr("data-user-id"));c.setName(a(e).attr("data-name"));c.setContextId(a(e).attr("data-context-id"));c.setElement(e);c.show();b.stopImmediatePropagation()}).fail(c.exception)});d.define(b,[d.events.activate]);b.on(d.events.activate,function(){this.toggleDisableAllStatus()}.bind(this))};return j});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_message/message_drawer_view_conversation_patcher",["jquery","core/user_date","core_message/message_drawer_view_conversation_constants"],function(a,b,c){var d=function(a,c){var d=a.reduce(function(a,d){var e=d.timeCreated?d.timeCreated:c,f=b.getUserMidnightForTimestamp(e,c);if(a.hasOwnProperty(f)){a[f].push(d)}else{a[f]=[d]}return a},{});return Object.keys(d).map(function(a){return{timestamp:a,messages:d[a]}})},e=function(c,a,d){a=a.slice();var e=[],f=[],g=[];c.forEach(function(b){var c=!1,e=0;for(;e<a.length;e++){var h=a[e];if(d(b,h)){c=!0;g.push({a:b,b:h});break}}if(c){a.splice(e,1)}else{f.push(b)}});e=a;return{missingFromA:e,missingFromB:f,matches:g}},f=function(a,b){for(var c=null,d=0,e;d<a.length;d++){e=a[d];if(b(e)){return e}}return c},g=function(c,d){c=c.slice();d=d.slice();c.sort();d.sort();var e=c.length,f=d.length;if(1>e&&1>f){return!0}if(e!=f){return!1}return c.every(function(a,b){return a==d[b]})},h=function(c,a){var b=Object.keys(c),d=Object.keys(a);if(b.length!=d.length){return!1}return b.every(function(b){var d=c[b],e=a[b],f=_typeof(d),i=_typeof(e);f=null===d?"null":f;i=null===d?"null":i;f="object"===f&&Array.isArray(f)?"array":f;i="object"===i&&Array.isArray(i)?"array":i;if(f!==i){return!1}switch(f){case"object":return h(d,e);case"array":return g(d,e);default:return c[b]==a[b];}})},i=function(c,a){return h({id:c.id,state:c.sendState,text:c.text,timeCreated:c.timeCreated},{id:a.id,state:a.sendState,text:a.text,timeCreated:a.timeCreated})},j=function(a,b,c){return{remove:b,add:c.map(function(b){var c=f(a,function(a){return b.timestamp<a.timestamp});return{before:c,value:b}})}},k=function(a){var b=[],c=[],d=[];a.forEach(function(a){var g=a.a,h=a.b,j=e(g.messages,h.messages,i),k=e(j.missingFromB,j.missingFromA,function(c,a){return c.id==a.id||c.sendState!=a.sendState&&c.timeAdded==a.timeAdded});b=b.concat(k.missingFromB);k.missingFromA.forEach(function(a){var b=null;if(a.timeCreated){b=f(g.messages,function(b){if(a.timeCreated==b.timeCreated){return a.id<b.id}else{return a.timeCreated<b.timeCreated}})}c.push({before:b,value:a,day:g})});d=d.concat(k.matches.map(function(a){return{before:a.a,after:a.b}}))});return{add:c,remove:b,update:d}},l=function(a,b){var c=e(a.messages,b.messages,i);if(c.missingFromA.length||c.missingFromB.length){var f=d(a.messages,a.midnight),g=d(b.messages,b.midnight),h=e(f,g,function(a,b){return a.timestamp==b.timestamp});return{days:j(f,h.missingFromB,h.missingFromA),messages:k(h.matches)}}else{return null}},m=function(a,b){var d=L(a,b),e=B(a,b),f=J(a),g=J(b),h=d&&d.show&&!d.hasMessages,i=d&&!d.show,j=!f&&g;j=j||h||i;j=j||null!==e;if(j){return{type:c.CONVERSATION_TYPES.PRIVATE,showControls:!h&&!e,context:{id:b.id,name:b.name,subname:b.subname,totalmembercount:b.totalMemberCount,imageurl:b.imageUrl,isfavourite:b.isFavourite,ismuted:b.isMuted,showfavourite:null!==b.id,userid:g.id,showonlinestatus:g.showonlinestatus,isonline:g.isonline,isblocked:g.isblocked,iscontact:g.iscontact}}}return null},n=function(a,b){var d=null===a.name&&null!==b.name;if(d){return{type:c.CONVERSATION_TYPES.SELF,showControls:!1,context:{id:b.id,name:b.name,subname:b.subname,imageurl:b.imageUrl,isfavourite:b.isFavourite,showfavourite:null!==b.id,showonlinestatus:!0}}}return null},o=function(a,b){var d=a.totalMemberCount,e=b.totalMemberCount;if(d!=e){return{type:c.CONVERSATION_TYPES.PUBLIC,showControls:!0,context:{id:b.id,name:b.name,subname:b.subname,totalmembercount:b.totalMemberCount,imageurl:b.imageUrl,isfavourite:b.isFavourite,ismuted:b.isMuted,showfavourite:null!==b.id}}}else{return null}},p=function(a,b){var c=a.messages,d=b.messages;if(1>d.length){return null}if(1>c.length){return d[d.length-1].id}var e=c[a.messages.length-1],f=d[d.length-1],g=c[0],h=d[0];if(e.id!=f.id){return f.id}else if(g.id!=h.id){return g.id}return null},q=function(a,b){if(!a.loadingMembers&&b.loadingMembers){return!0}else if(a.loadingMembers&&!b.loadingMembers){return!1}else{return null}},r=function(a,b){if(a.hasTriedToLoadMessages===b.hasTriedToLoadMessages){return null}else if(!b.hasTriedToLoadMessages&&b.loadingMessages){return!0}else if(b.hasTriedToLoadMessages&&!b.loadingMessages){return!1}else{return null}},s=function(a,b){if(!a.loadingMessages&&b.loadingMessages){return!0}else if(a.loadingMessages&&!b.loadingMessages){return!1}else{return null}},t=function(a,b){if(!a.showEmojiPicker&&b.showEmojiPicker){return!0}else if(a.showEmojiPicker&&!b.showEmojiPicker){return!1}else{return null}},u=function(a,b){if(!a.showEmojiAutoComplete&&b.showEmojiAutoComplete){return!0}else if(a.showEmojiAutoComplete&&!b.showEmojiAutoComplete){return!1}else{return null}},v=function(a,b){if(b.pendingBlockUserIds.length){var c=b.pendingBlockUserIds[0];return b.members[c]}else if(a.pendingBlockUserIds.length){return!1}return null},w=function(a,b){if(b.pendingUnblockUserIds.length){var c=b.pendingUnblockUserIds[0];return b.members[c]}else if(a.pendingUnblockUserIds.length){return!1}return null},x=function(a,b){if(b.pendingAddContactIds.length){var c=b.pendingAddContactIds[0];return b.members[c]}else if(a.pendingAddContactIds.length){return!1}return null},y=function(a,b){if(b.pendingRemoveContactIds.length){var c=b.pendingRemoveContactIds[0];return b.members[c]}else if(a.pendingRemoveContactIds.length){return!1}return null},z=function(a,b){var c=a.pendingDeleteMessageIds.length,d=b.pendingDeleteMessageIds.length;if(d&&!c){return{show:!0,type:b.type,canDeleteMessagesForAllUsers:b.canDeleteMessagesForAllUsers}}else if(c&&!d){return{show:!1}}return null},A=function(a,b){if(!a.pendingDeleteConversation&&b.pendingDeleteConversation){return b.type}else if(a.pendingDeleteConversation&&!b.pendingDeleteConversation){return!1}return null},B=function(a,b){var c=a.loggedInUserId,d=J(a),e=J(b),f=!d?[]:d.contactrequests.filter(function(a){return a.requesteduserid==c&&a.userid==d.id}),g=!e?[]:e.contactrequests.filter(function(a){return a.requesteduserid==c&&a.userid==e.id}),h=f.length?f[0]:null,i=g.length?g[0]:null;if(!h&&i){return e}else if(h&&!i){return!1}else{return null}},C=function(a,b){var c=J(a),d=J(b);if(!c&&!d){return null}else if(!c&&d){return d.isblocked?!0:null}else if(!d&&c){return c.isblocked?!1:null}else if(c.isblocked&&!d.isblocked){return!1}else if(!c.isblocked&&d.isblocked){return!0}else{return null}},D=function(a,b){var c=a.isFavourite,d=b.isFavourite;if(null===a.id&&null===b.id){return null}else if(null===a.id&&null!==b.id){return"show-add"}else if(null!==a.id&&null===b.id){return"hide"}else if(c==d){return null}else if(!c&&d){return"show-remove"}else if(c&&!d){return"show-add"}else{return null}},E=function(a,b){var c=a.isMuted,d=b.isMuted;if(null===a.id&&null===b.id){return null}else if(null===a.id&&null!==b.id){return"show-mute"}else if(null!==a.id&&null===b.id){return"hide"}else if(c==d){return null}else if(!c&&d){return"show-unmute"}else if(c&&!d){return"show-mute"}else{return null}},F=function(a,b){var c=a.loggedInUserId,d=J(a),e=J(b),f=!d?[]:d.contactrequests.filter(function(a){return a.userid==c&&a.requesteduserid==d.id||a.userid==d.id&&a.requesteduserid==c}),g=!e?[]:e.contactrequests.filter(function(a){return a.userid==c&&a.requesteduserid==e.id||a.userid==e.id&&a.requesteduserid==c}),h=0<f.length,i=0<g.length;if(!d&&!e){return null}else if(h&&i){return null}else if(!h&&i&&!e.iscontact){return"pending-contact"}else if(!d&&e){return e.iscontact?"contact":null}else if(!e&&d){return d.iscontact?"non-contact":null}else if(d.iscontact&&!e.iscontact){return i?"pending-contact":"non-contact"}else if(!d.iscontact&&e.iscontact){return"contact"}else{return null}},G=function(a,b){if(!a.loadingConfirmAction&&b.loadingConfirmAction){return!0}else if(a.loadingConfirmAction&&!b.loadingConfirmAction){return!1}else{return null}},H=function(a,b){var c=0<a.selectedMessageIds.length,d=0<b.selectedMessageIds.length,e=a.messages.length!=b.messages.length;if(!c&&d){return!0}else if(c&&!d){return!1}else if(c&&e){return!0}else{return null}},I=function(a,b){var c=a.selectedMessageIds,d=b.selectedMessageIds;if(g(c,d)){return null}var f=e(c,d,function(c,a){return c==a});return{count:d.length,add:f.missingFromA,remove:f.missingFromB}},J=function(a){return Object.keys(a.members).reduce(function(b,c){if(c!=a.loggedInUserId&&!b){b=a.members[c]}return b},null)},K=function(a,b){if(b.canmessage){return!1}var c=b.contactrequests.filter(function(b){return b.userid==a||b.requesteduserid}),d=0<c.length;return b.requirescontact&&!b.iscontact&&!d},L=function(a,b){var c=J(a),d=J(b),e=0<a.messages.length,f=0<b.messages.length,g=b.loggedInUserId,h=c&&K(g,c),i=d&&K(g,d),j=x(a,b);if(!a.hasTriedToLoadMessages&&!b.hasTriedToLoadMessages){return null}if(!c&&!d){return null}if(!c&&i){return{show:!0,hasMessages:f,user:d}}if(!1===j&&i){return{show:!0,hasMessages:f,user:d}}if(a.hasTriedToLoadMessages&&b.hasTriedToLoadMessages){if(!h&&i){return{show:!0,hasMessages:f,user:d}}if(h&&!i){return{show:!1,hasMessages:f}}}if(!a.hasTriedToLoadMessages&&b.hasTriedToLoadMessages){if(i){return{show:!0,hasMessages:f,user:d}}}if(a.hasTriedToLoadMessages&&!b.hasTriedToLoadMessages){if(h){return{show:!1,hasMessages:e}}}return null},M=function(a,b){var c=J(a),d=J(b);if(!c&&!d){return null}else if(c&&!d){return c.isblocked?!1:null}else if(!c&&d){return d.isblocked?!0:null}else if(!c.isblocked&&d.isblocked){return!0}else if(c.isblocked&&!d.isblocked){return!1}return null},N=function(a,b){var d=J(a),e=J(b);if(b.type==c.CONVERSATION_TYPES.SELF){return null}if(!d&&!e){return null}else if(d&&!e){return d.canmessage?null:!0}else if(!d&&e){return e.canmessage?null:!0}else if(!d.canmessage&&e.canmessage){return!1}else if(d.canmessage&&!e.canmessage){return!0}return null},O=function(a,b){var c=r(a,b),d=H(a,b),e=L(a,b),f=M(a,b),g=N(a,b),h=null!==e?e.show&&e.hasMessages:null,j=J(b),k=function(a,c){if(a){return c}else if(null!==a&&!a){if(!j){return{type:"content"}}else if(j.isblocked){return{type:"unblock"}}else if(b.messages.length&&K(b.loggedInUserId,j)){return{type:"add-contact",user:j}}else if(!j.canmessage&&j.requirescontact&&!j.iscontact){return{type:"unable-to-message"}}}return null};if(null===c&&null===d&&null===e&&null===f){return null}for(var l=[[c,{type:"placeholder"}],[d,{type:"edit-mode"}],[g,{type:"unable-to-message"}],[f,{type:"unblock"}],[h,{type:"add-contact",user:j}]],m=0;m<l.length;m++){var n=l[m][0],o=l[m][1],p=k(n,o);if(null!==p){return p}}return{type:"content"}},P=function(a,b){var c=r(a,b),d=H(a,b);if(null===c&&null===d){return null}if(c){return{type:"placeholder"}}if(d){return{type:"edit-mode"}}return{type:"content"}},Q=function(a,b){var c=a.type,d=b.type,e=a.id,f=b.id,g=Object.keys(a.members),h=Object.keys(b.members);g.sort();h.sort();var i=g.every(function(a,b){return a==h[b]});if(c!=d){return!0}else if(e&&!f){return!0}else if(e&&f&&e!=f){return!0}else if(!e&&!f&&!i){return!0}return null},R=function(a,b){if(a.type!=b.type){return b.type==c.CONVERSATION_TYPES.SELF}return null},S=function(a,b){var c=b.loggedInUserId,d=J(a),e=J(b),f=!d?[]:d.contactrequests.filter(function(a){return a.userid==c}),g=!e?[]:e.contactrequests.filter(function(a){return a.userid==c}),h=0<f.length,i=0<g.length,j=0<a.messages.length,k=0<a.messages.length;if(!h&&i&&!e.iscontact&&!k){return e.fullname}else if(d&&!d.iscontact&&i&&e.iscontact){return!1}else if(h&&!i){return!1}else if(!j&&k){return!1}else{return null}},T=function(b,d){var e={all:{reset:Q,conversation:l,scrollToMessage:p,loadingMembers:q,loadingFirstMessages:r,loadingMessages:s,confirmDeleteSelectedMessages:z,inEditMode:H,selectedMessages:I,isFavourite:D,isMuted:E,showEmojiPicker:t,showEmojiAutoComplete:u}};e[c.CONVERSATION_TYPES.PRIVATE]={header:m,footer:O,confirmBlockUser:v,confirmUnblockUser:w,confirmAddContact:x,confirmRemoveContact:y,confirmContactRequest:B,confirmDeleteConversation:A,isBlocked:C,isContact:F,loadingConfirmAction:G,requireAddContact:L,contactRequestSent:S};e[c.CONVERSATION_TYPES.PUBLIC]={header:o,footer:P};e[c.CONVERSATION_TYPES.SELF]={header:n,footer:P,confirmDeleteConversation:A,selfConversationMessage:R};var f=a.extend({},e.all);if(d.type&&d.type in e){f=a.extend(f,e[d.type])}return Object.keys(f).reduce(function(a,c){var e=f[c],g=e(b,d);if(null!==g){a[c]=g}return a},{})};return{buildPatch:T}});
define ("core_message/message_popover",["jquery","core/custom_interaction_events","core/pubsub","core_message/message_drawer_events"],function(a,b,c,d){var e={COUNT_CONTAINER:"[data-region=\"count-container\"]"},f=function(a){c.publish(d.TOGGLE_VISIBILITY,a)},g=function(a){return function(){var b=a.find(e.COUNT_CONTAINER),c=parseInt(b.text(),10);if(isNaN(c)){b.addClass("hidden")}else if(!c||2>c){b.addClass("hidden")}else{c=c-1;b.text(c)}}},h=function(a){b.define(a,[b.events.activate]);a.on(b.events.activate,function(b,c){f(a.attr("id"));a.focus();c.originalEvent.preventDefault()});c.subscribe(d.CONVERSATION_READ,g(a));c.subscribe(d.CONTACT_REQUEST_ACCEPTED,g(a));c.subscribe(d.CONTACT_REQUEST_DECLINED,g(a))};return{init:function init(b){b=a(b);h(b)}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_message/message_drawer_router",["jquery","core/pubsub","core/str","core_message/message_drawer_events","core/aria"],function(a,b,c,d,e){var f={},g={},h={CAN_RECEIVE_FOCUS:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]",ROUTES_BACK:"[data-route-back]"},j=function(c,g){var j,k=[].slice.call(arguments).some(function(a){return"frompanel"==a}),l=[].slice.call(arguments,2),m=a.Deferred().resolve().promise();Object.keys(f[c]).forEach(function(a){var b=f[c][a],d=a===g;if(d){j=b}b.parameters.forEach(function(a){if("object"!==_typeof(a)||null===a){return}a.removeClass("previous");a.attr("data-from-panel",!1);if(d){if(k){a.attr("data-from-panel",!0)}a.removeClass("hidden");e.unhide(a.get())}else{if(!a.attr("data-in-panel")){a.addClass("hidden");e.hide(a.get())}else if("view-search"==g||"view-overview"==g){a.addClass("hidden");e.hide(a.get())}}})});if(j){if(j.onGo){m=j.onGo.apply(void 0,j.parameters.concat(l));for(var n=a(document.activeElement),o=!1,p=null,q=1,r;q<j.parameters.length;q++){r=j.parameters[q];if("object"!==_typeof(r)||null===r){continue}if(!p){p=r}if(r.has(n).length){o=!0;break}}if(!o){p.find(h.CAN_RECEIVE_FOCUS).filter(":visible").first().focus()}}}var s={route:g,params:l,renderPromise:m};b.publish(d.ROUTE_CHANGED,s);return s},k=function(b){var d=a(document.activeElement),e=j.apply(b,arguments),k=!1;if(!g[b]){g[b]=[]}g[b]=g[b].reduce(function(a,b){if(b.route===e.route){k=!0}if(!k){a.push(b)}return a},[]);var l=g[b].length,m=l?g[b][l-1]:null;if(m){for(var n=f[b][m.route],o=n.parameters,p=1;p<o.length;p++){if("object"!==_typeof(o[p])||null===o[p]){continue}o[p].addClass("previous")}m.focusElement=d;if(n.getDescription){n.getDescription.apply(null,n.parameters.concat(m.params)).then(function(a){return c.get_string("backto","core_message",a)}).then(function(a){return e.renderPromise.then(function(){f[b][e.route].parameters.forEach(function(b){if("object"!==_typeof(b)||!b){return}b.find(h.ROUTES_BACK).attr("aria-label",a)})})}).catch(function(){})}}g[b].push(e);return e};return{add:function add(a,b,c,d,e){if(!f[a]){f[a]=[]}f[a][b]={parameters:c,onGo:d,getDescription:e}},go:k,back:function back(a){if(g[a].length){g[a].pop();var b=g[a].pop();if(b){k.apply(void 0,[a,b.route].concat(b.params));window.setTimeout(function(){b.focusElement.focus()},50)}}}}});
define ("core_payment/events",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={proceed:"core_payment-modal_gateways:proceed"};return a.default});
define ("core_payment/gateways_modal",["exports","core/modal_factory","core/templates","core/str","./repository","./selectors","core/modal_events","core_payment/events","core/toast","core/notification","./modal_gateways"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=l(b);c=l(c);f=l(f);g=l(g);h=l(h);j=l(j);k=l(k);var o="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function l(a){return a&&a.__esModule?a:{default:a}}function m(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function n(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){m(h,d,e,f,g,"next",a)}function g(a){m(h,d,e,f,g,"throw",a)}f(void 0)})}}var p=function(){document.addEventListener("click",function(a){var b=a.target.closest("[data-action=\"core_payment/triggerPayment\"]");if(b){a.preventDefault();q(b,{focusOnClose:a.target})}})},q=function(){var a=n(regeneratorRuntime.mark(function a(l){var m,n,o,p,q,u,v,w,x,y,z=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:m=1<z.length&&z[1]!==void 0?z[1]:{},n=m.focusOnClose,o=void 0===n?null:n;a.t0=b.default;a.t1=k.default.TYPE;a.next=5;return(0,d.get_string)("selectpaymenttype","core_payment");case 5:a.t2=a.sent;a.next=8;return c.default.render("core_payment/gateways_modal",{});case 8:a.t3=a.sent;a.t4={type:a.t1,title:a.t2,body:a.t3};a.next=12;return a.t0.create.call(a.t0,a.t4);case 12:p=a.sent;q=p.getRoot()[0];(0,i.addToastRegion)(q);p.show();p.getRoot().on(g.default.hidden,function(){p.destroy();try{o.focus()}catch(a){}});p.getRoot().on(h.default.proceed,function(a){var b=(q.querySelector(f.default.values.gateway)||{value:""}).value;if(b){t(b,l.dataset.component,l.dataset.paymentarea,l.dataset.itemid,l.dataset.description).then(function(a){p.hide();j.default.addNotification({message:a,type:"success"});location.reload();return a}).catch(function(a){return j.default.alert("",a)})}else{(0,d.get_string)("nogatewayselected","core_payment").then(function(a){return(0,i.add)(a)}).catch()}a.preventDefault()});q.addEventListener("change",function(a){if(a.target.matches(f.default.elements.gateways)){s(q,l.dataset.cost)}});a.next=21;return(0,e.getAvailableGateways)(l.dataset.component,l.dataset.paymentarea,l.dataset.itemid);case 21:u=a.sent;v={gateways:u};a.next=25;return c.default.renderForPromise("core_payment/gateways",v);case 25:w=a.sent;x=w.html;y=w.js;c.default.replaceNodeContents(q.querySelector(f.default.regions.gatewaysContainer),x,y);r(q);a.next=32;return s(q,l.dataset.cost);case 32:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),r=function(a){var b=a.querySelectorAll(f.default.elements.gateways);if(1==b.length){b[0].checked=!0}},s=function(){var a=n(regeneratorRuntime.mark(function a(b){var d,e,g,h,i,j,k,l=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d=1<l.length&&l[1]!==void 0?l[1]:"";e=b.querySelector(f.default.values.gateway);g=parseInt((e||{dataset:{surcharge:0}}).dataset.surcharge);h=(e||{dataset:{cost:d}}).dataset.cost;a.next=6;return c.default.renderForPromise("core_payment/fee_breakdown",{fee:h,surcharge:g});case 6:i=a.sent;j=i.html;k=i.js;c.default.replaceNodeContents(b.querySelector(f.default.regions.costContainer),j,k);case 10:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),t=function(){var a=n(regeneratorRuntime.mark(function a(b,c,d,e,f){var g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return"function"==typeof o.define&&o.define.amd?new Promise(function(a,c){o.require(["paygw_".concat(b,"/gateways_modal")],a,c)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&o.require&&"component"===o.require.loader?Promise.resolve(require(("paygw_".concat(b,"/gateways_modal")))):Promise.resolve(o["paygw_".concat(b,"/gateways_modal")]);case 2:g=a.sent;return a.abrupt("return",g.process(c,d,e,f));case 4:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),u=function(){if(!u.initialised){u.initialised=!0;p()}};a.init=u;u.initialised=!1});
define ("core_payment/modal_gateways",["exports","jquery","core/custom_interaction_events","core/modal","core/modal_events","core_payment/events","core/modal_registry"],function(a,b,c,d,f,g,h){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=i(b);c=i(c);d=i(d);f=i(f);g=i(g);h=i(h);function i(a){return a&&a.__esModule?a:{default:a}}function j(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){j=function(a){return typeof a}}else{j=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return j(a)}function k(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function l(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function m(a,b,c){if(b)l(a.prototype,b);if(c)l(a,c);return a}function n(a,b,c){if("undefined"!=typeof Reflect&&Reflect.get){n=Reflect.get}else{n=function(a,b,c){var d=o(a,b);if(!d)return;var e=Object.getOwnPropertyDescriptor(d,b);if(e.get){return e.get.call(c)}return e.value}}return n(a,b,c||a)}function o(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=v(a);if(null===a)break}return a}function p(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)q(a,b)}function q(a,b){q=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return q(a,b)}function r(a){return function(){var b=v(a),c;if(u()){var d=v(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return s(this,c)}}function s(a,b){if(b&&("object"===j(b)||"function"==typeof b)){return b}return t(a)}function t(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function v(a){v=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return v(a)}var w=!1,x={PROCEED_BUTTON:"[data-action=\"proceed\"]",CANCEL_BUTTON:"[data-action=\"cancel\"]"},y=function(a){p(d,a);var e=r(d);function d(a){k(this,d);return e.call(this,a)}m(d,[{key:"registerEventListeners",value:function registerEventListeners(){var a=this;n(v(d.prototype),"registerEventListeners",this).call(this);this.getModal().on(c.default.events.activate,x.PROCEED_BUTTON,function(c,d){var e=b.default.Event(g.default.proceed);a.getRoot().trigger(e,a);if(!e.isDefaultPrevented()){a.hide();d.originalEvent.preventDefault()}});this.getModal().on(c.default.events.activate,x.CANCEL_BUTTON,function(c,d){var e=b.default.Event(f.default.cancel);a.getRoot().trigger(e,a);if(!e.isDefaultPrevented()){a.hide();d.originalEvent.preventDefault()}})}}]);return d}(d.default);a.default=y;y.TYPE="core_payment-modal_gateways";if(!w){h.default.register(y.TYPE,y,"core_payment/modal_gateways");w=!0}return a.default});
define ("core_payment/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={elements:{gateways:"[data-region=\"gateways-container\"] input[type=\"radio\"]"},regions:{gatewaysContainer:"[data-region=\"gateways-container\"]",costContainer:"[data-region=\"fee-breakdown-container\"]"},values:{gateway:"[data-region=\"gateways-container\"] input[type=\"radio\"]:checked"}};return a.default});
define ("core_payment/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.getAvailableGateways=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a,c,d){return b.default.call([{methodname:"core_payment_get_available_gateways",args:{component:a,paymentarea:c,itemid:d}}])[0]};a.getAvailableGateways=c});
define ("core_question/edit_tags",["jquery","core/fragment","core/str","core/modal_events","core/modal_factory","core/notification","core/custom_interaction_events","core_question/repository","core_question/selectors"],function(a,b,c,d,e,f,g,h,i){var j=function(a){a.find(i.actions.save).prop("disabled",!1)},k=function(a){a.find(i.actions.save).prop("disabled",!0)},l=function(a){return a.getBody().find("form").serialize()},m=function(a){var b=a.find(i.containers.loadingIcon);b.removeClass("hidden")},n=function(a){var b=a.find(i.containers.loadingIcon);b.addClass("hidden")},o=function(a,b){a.getBody().attr("data-contextid",b)},p=function(a){return a.getBody().data("contextid")},q=function(a,b){a.getBody().attr("data-questionid",b)},r=function(a){return a.getBody().data("questionid")},s=function(h){var l=e.create({type:e.types.SAVE_CANCEL,large:!1},[h,i.actions.edittags]).then(function(a){c.get_string("questiontags","question").then(function(b){a.setTitle(b);return b}).fail(f.exception);a.getRoot().on(d.save,function(b){var c=a.getBody().find("form");c.submit();b.preventDefault()});a.getRoot().on("submit","form",function(b){t(a,h).then(function(){a.hide();location.reload()}).fail(f.exception);b.preventDefault();b.stopPropagation()});return a});h.on(g.events.activate,i.actions.edittags,function(c){var d=a(c.currentTarget),e=d.data("questionid"),g=!!d.data("cantag"),p=d.data("contextid");l.then(function(a){k(h);m(h);var c=b.loadFragment("question","tags_form",p,{id:e});a.setBody(c);c.then(function(){j(h)}).always(function(){n(h)}).fail(f.exception);if(g){a.getRoot().find(i.actions.save).show()}else{a.getRoot().find(i.actions.save).hide()}q(a,e);o(a,p);return a}).fail(f.exception);c.preventDefault()})},t=function(a,b){k(b);m(b);var c=l(a),d=r(a),e=p(a);return h.submitTagCreateUpdateForm(d,e,c).always(function(){n(b);j(b)}).fail(f.exception)};return{init:function init(b){b=a(b);s(b)}}});
define ("core_question/selectors",[],function(){return{actions:{save:"[data-action=\"save\"]",edittags:"[data-action=\"edittags\"]"},containers:{loadingIcon:"[data-region=\"overlay-icon-container\"]"}}});
define ("core_question/repository",["jquery","core/ajax"],function(a,b){return{submitTagCreateUpdateForm:function submitTagCreateUpdateForm(a,c,d){return b.call([{methodname:"core_question_submit_tags_form",args:{questionid:a,contextid:c,formdata:d}}])[0]}}});
define ("core_search/form-search-user-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h,i={query:e},j=a(d).attr("withincourseid");if("undefined"!=typeof j&&""!==a("#id_searchwithin").val()){i.courseid=j}else{i.courseid=0}h=b.call([{methodname:"core_search_get_relevant_users",args:i}]);h[0].then(function(b){var d=[];a.each(b,function(a,b){d.push(c.render("core_search/form-user-selector-suggestion",b))});return a.when.apply(a.when,d).then(function(){var c=arguments,d=0;a.each(b,function(a,b){b._label=c[d++]});f(b)})}).fail(g)}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_table/dynamic",["exports","core_table/local/dynamic/selectors","./local/dynamic/events","core/pending","core/loadingicon","core_table/local/dynamic/repository","core/notification"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"Events",{enumerable:!0,get:function get(){return c.default}});a.getTableFromId=a.init=a.showColumn=a.hideColumn=a.getLastInitial=a.setLastInitial=a.getFirstInitial=a.setFirstInitial=a.getPageSize=a.setPageSize=a.getPageNumber=a.setPageNumber=a.setSortOrder=a.getFilters=a.setFilters=a.updateTable=a.refreshTableContent=void 0;b=j(b);c=h(c);d=h(d);g=h(g);function h(a){return a&&a.__esModule?a:{default:a}}function i(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;i=function(){return a};return a}function j(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=i();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function k(a){return o(a)||n(a)||m(a)||l()}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(a,b){if(!a)return;if("string"==typeof a)return p(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return p(a,b)}function n(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function o(a){if(Array.isArray(a))return p(a)}function p(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}var q=!1,r=function(a){if(!a){throw new Error("The table specified is not a dynamic table and cannot be updated")}if(!a.matches(b.main.region)){throw new Error("The table specified is not a dynamic table and cannot be updated")}return!0},s=function(a){return JSON.parse(a.dataset.tableFilters)},t=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1,g=s(a);(0,e.addIconToContainer)(a);var h=new d.default("core_table/dynamic:refreshTableContent");return(0,f.fetch)(a.dataset.tableComponent,a.dataset.tableHandler,a.dataset.tableUniqueid,{sortData:JSON.parse(a.dataset.tableSortData),joinType:g.jointype,filters:g.filters,firstinitial:a.dataset.tableFirstInitial,lastinitial:a.dataset.tableLastInitial,pageNumber:a.dataset.tablePageNumber,pageSize:a.dataset.tablePageSize,hiddenColumns:JSON.parse(a.dataset.tableHiddenColumns)},b).then(function(b){var c=document.createElement("div");c.innerHTML=b.html;a.replaceWith.apply(a,k(c.childNodes));return E(a.dataset.tableUniqueid)}).then(function(a){a.dispatchEvent(new CustomEvent(c.default.tableContentRefreshed,{bubbles:!0}));return a}).then(function(a){h.resolve();return a})};a.refreshTableContent=t;var u=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},c=b.sortBy,e=void 0===c?null:c,f=b.sortOrder,g=void 0===f?null:f,h=b.filters,i=void 0===h?null:h,j=b.firstInitial,k=void 0===j?null:j,l=b.lastInitial,m=void 0===l?null:l,n=b.pageNumber,o=void 0===n?null:n,p=b.pageSize,q=void 0===p?null:p,s=b.hiddenColumns,u=void 0===s?null:s,v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;r(a);var w=new d.default("core_table/dynamic:updateTable"),x=!1;if(e&&g){x=!0;var y=JSON.parse(a.dataset.tableSortData);y.unshift({sortby:e,sortorder:parseInt(g,10)});a.dataset.tableSortData=JSON.stringify(y)}if(null!==k){if(a.dataset.tableFirstInitial!==k){x=!0}a.dataset.tableFirstInitial=k}if(null!==m){if(a.dataset.tableLastInitial!==m){x=!0}a.dataset.tableLastInitial=m}if(null!==q){if(a.dataset.tablePageSize!=q){x=!0}a.dataset.tablePageSize=q}if(i){var z=JSON.stringify(i);if(a.dataset.tableFilters!==z){x=!0}a.dataset.tableFilters=z}if(x){o=1}if(u){var A=JSON.stringify(u);if(a.dataset.tableHiddenColumns!==A){x=!0}a.dataset.tableHiddenColumns=A}if(null!==o){if(a.dataset.tablePageNumber!=o){x=!0}a.dataset.tablePageNumber=o}if(v&&x){return t(a).then(function(a){w.resolve();return a})}else{w.resolve();return Promise.resolve(a)}};a.updateTable=u;var v=function(a){r(a);return a.dataset};a.setFilters=function setFilters(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;return u(a,{filters:b},c)};a.getFilters=function getFilters(a){r(a);return s(a)};var w=function(a,b,c){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:!0;return u(a,{sortBy:b,sortOrder:c},d)};a.setSortOrder=w;var x=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;return u(a,{pageNumber:b},c)};a.setPageNumber=x;a.getPageNumber=function getPageNumber(a){return v(a).tablePageNumber};a.setPageSize=function setPageSize(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;return u(a,{pageSize:b,pageNumber:1},c)};a.getPageSize=function getPageSize(a){return v(a).tablePageSize};var y=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;return u(a,{firstInitial:b},c)};a.setFirstInitial=y;a.getFirstInitial=function getFirstInitial(a){return v(a).tableFirstInitial};var z=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;return u(a,{lastInitial:b},c)};a.setLastInitial=z;a.getLastInitial=function getLastInitial(a){return v(a).tableLastInitial};var A=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0,d=JSON.parse(a.dataset.tableHiddenColumns);d.push(b);return u(a,{hiddenColumns:d},c)};a.hideColumn=A;var B=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0,d=JSON.parse(a.dataset.tableHiddenColumns);d=d.filter(function(a){return a!==b});return u(a,{hiddenColumns:d},c)};a.showColumn=B;var C=function(a){return t(a,!0)},D=function(){if(q){return}q=!0;document.addEventListener("click",function(a){var c=a.target.closest(b.main.region);if(!c){return}var d=a.target.closest(b.table.links.sortableColumn);if(d){a.preventDefault();w(c,d.dataset.sortby,d.dataset.sortorder).catch(g.default.exception)}var e=a.target.closest(b.initialsBar.links.firstInitial);if(null!==e){a.preventDefault();y(c,e.dataset.initial).catch(g.default.exception)}var f=a.target.closest(b.initialsBar.links.lastInitial);if(null!==f){a.preventDefault();z(c,f.dataset.initial).catch(g.default.exception)}var h=a.target.closest(b.paginationBar.links.pageItem);if(h){a.preventDefault();x(c,h.dataset.pageNumber).catch(g.default.exception)}var i=a.target.closest(b.table.links.hide);if(i){a.preventDefault();A(c,i.dataset.column).catch(g.default.exception)}var j=a.target.closest(b.table.links.show);if(j){a.preventDefault();B(c,j.dataset.column).catch(g.default.exception)}var k=a.target.closest(".resettable a");if(k){a.preventDefault();C(c).catch(g.default.exception)}})};a.init=D;var E=function(a){var c=document.querySelector(b.main.fromRegionId(a));if(!c){throw new Error("The table specified is not a dynamic table and cannot be updated")}return c};a.getTableFromId=E});
define ("core_table/local/dynamic/events",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var b={tableContentRefreshed:function prefixEventName(a){return"core_table/dynamic:".concat(a)}("tableContentRefreshed")};a.default=b;return a.default});
define ("core_table/local/dynamic/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={main:{region:"[data-region=\"core_table/dynamic\"]",fromRegionId:function fromRegionId(a){return"[data-region=\"core_table/dynamic\"][data-table-uniqueid=\"".concat(a,"\"]")}},table:{links:{sortableColumn:"a[data-sortable=\"1\"]",hide:"a[data-action=\"hide\"]",show:"a[data-action=\"show\"]"}},initialsBar:{links:{firstInitial:".firstinitial [data-initial]",lastInitial:".lastinitial [data-initial]"}},paginationBar:{links:{pageItem:".pagination [data-page-number]"}}};return a.default});
define ("core_table/local/dynamic/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.fetch=void 0;a.fetch=function fetch(a,c,d){var e=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{},f=e.sortData,g=void 0===f?[]:f,h=e.joinType,i=void 0===h?null:h,j=e.filters,k=void 0===j?{}:j,l=e.firstinitial,m=void 0===l?null:l,n=e.lastinitial,o=void 0===n?null:n,p=e.pageNumber,q=void 0===p?null:p,r=e.pageSize,s=void 0===r?null:r,t=e.hiddenColumns,u=void 0===t?{}:t,v=4<arguments.length&&arguments[4]!==void 0?arguments[4]:!1;return(0,b.call)([{methodname:"core_table_get_dynamic_table_content",args:{component:a,handler:c,uniqueid:d,sortdata:g,jointype:i,filters:k,firstinitial:m,lastinitial:o,pagenumber:q,pagesize:s,hiddencolumns:u,resetpreferences:v}}])[0]}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_user/status_field",["exports","core_table/dynamic","./repository","core/str","core_table/local/dynamic/selectors","core/fragment","core/modal_events","core/modal_factory","core/notification","core/templates","core/toast"],function(a,b,c,d,f,g,h,i,j,k,l){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=o(b);c=o(c);d=o(d);f=m(f);g=m(g);h=m(h);i=m(i);j=m(j);k=m(k);function m(a){return a&&a.__esModule?a:{default:a}}function n(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;n=function(){return a};return a}function o(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=n();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function p(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function q(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){p(Object(c),!0).forEach(function(b){r(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{p(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function r(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function s(a,b){return x(a)||w(a,b)||u(a,b)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(a,b){if(!a)return;if("string"==typeof a)return v(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return v(a,b)}function v(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function w(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function x(a){if(Array.isArray(a))return a}var y={editEnrolment:"[data-action=\"editenrolment\"]",showDetails:"[data-action=\"showdetails\"]",unenrol:"[data-action=\"unenrol\"]",statusElement:"[data-status]"},z=function(a){return a.closest(f.default.main.region)},A=function(a){return a.closest(y.statusElement)},B=function(a){return a.getAttribute("rel")},C=function(a,b){var c=function(b,c){return I(a,b,c)};document.addEventListener("click",function(a){var d=a.target.closest(f.default.main.fromRegionId(b));if(!d){return}var e=a.target.closest(y.editEnrolment);if(e){a.preventDefault();D(e,c)}var g=a.target.closest(y.unenrol);if(g){a.preventDefault();E(g)}var h=a.target.closest(y.showDetails);if(h){a.preventDefault();F(h)}})},D=function(a,b){var c=A(a),f=B(a);i.default.create({large:!0,title:d.get_string("edituserenrolment","enrol",c.dataset.fullname),type:i.default.types.SAVE_CANCEL,body:b(f)}).then(function(d){d.getRoot().on(h.default.save,function(g){g.preventDefault();G(a,b,d,f,c.dataset)});d.getRoot().on(h.default.hidden,function(){d.destroy()});d.show();return d}).catch(j.default.exception)},E=function(a){var b=A(a),c=B(a);i.default.create({type:i.default.types.SAVE_CANCEL}).then(function(f){f.getRoot().on(h.default.save,function(d){d.preventDefault();H(a,f,{ueid:c},b.dataset)});f.getRoot().on(h.default.hidden,function(){f.destroy()});f.show();var g=[{key:"unenrol",component:"enrol"},{key:"unenrolconfirm",component:"enrol",param:{user:b.dataset.fullname,course:b.dataset.coursename,enrolinstancename:b.dataset.enrolinstancename}}];return Promise.all([d.get_strings(g),f])}).then(function(a){var b=s(a,2),c=b[0],d=b[1];d.setTitle(c[0]);d.setSaveButtonText(c[0]);d.setBody(c[1]);return d}).catch(j.default.exception)},F=function(a){var b=A(a),c=q({editenrollink:"",statusclass:b.querySelector("span.badge").getAttribute("class")},b.dataset),f=b.querySelector(y.editEnrolment);if(f){c.editenrollink=f.outerHTML}i.default.create({large:!0,type:i.default.types.CANCEL,title:d.get_string("enroldetails","enrol"),body:k.default.render("core_user/status_details",c)}).then(function(a){if(f){a.getRoot().on("click",y.editEnrolment,function(b){b.preventDefault();a.hide();f.click()})}a.show();a.getRoot().on(h.default.hidden,function(){return a.destroy()});return a}).catch(j.default.exception)},G=function(a,e,f,g,h){var i=f.getRoot().find("form");c.submitUserEnrolmentForm(i.serialize()).then(function(a){if(!a.result){throw a.result}f.hide();f.destroy();return a}).then(function(){b.refreshTableContent(z(a)).catch(j.default.exception);return d.get_string("enrolmentupdatedforuser","core_enrol",h)}).then(function(a){(0,l.add)(a)}).catch(function(){f.setBody(e(g,JSON.stringify(i.serialize())));return f})},H=function(a,e,f,g){c.unenrolUser(f.ueid).then(function(a){if(!a.result){j.default.alert(a.errors[0].key,a.errors[0].message);return a}e.hide();e.destroy();return a}).then(function(){b.refreshTableContent(z(a)).catch(j.default.exception);return d.get_string("unenrolleduser","core_enrol",g)}).then(function(a){(0,l.add)(a)}).catch(j.default.exception)},I=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;return g.default.loadFragment("enrol","user_enrolment_form",a,{ueid:b,formdata:c})};a.init=function init(a){var b=a.contextid,c=a.uniqueid;C(b,c)}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_user/participants",["exports","core_table/dynamic","core/str","core/checkbox-toggleall","core/custom_interaction_events","core_table/local/dynamic/selectors","core/modal_events","core/notification","core/pending","jquery","core_user/local/participants/bulkactions","core/inplace_editable"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=n(b);c=n(c);d=l(d);e=l(e);f=l(f);g=l(g);h=l(h);i=l(i);j=l(j);function l(a){return a&&a.__esModule?a:{default:a}}function m(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;m=function(){return a};return a}function n(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=m();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function o(a,b){return t(a)||s(a,b)||q(a,b)||p()}function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(a,b){if(!a)return;if("string"==typeof a)return r(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return r(a,b)}function r(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function s(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function t(a){if(Array.isArray(a))return a}var u={bulkActionSelect:"#formactionid",bulkUserSelectedCheckBoxes:"input[data-togglegroup='participants-table'][data-toggle='slave']:checked",checkCountButton:"#checkall",showCountText:"[data-region=\"participant-count\"]",showCountToggle:"[data-action=\"showcount\"]",stateHelpIcon:"[data-region=\"state-help-icon\"]",tableForm:function tableForm(a){return"form[data-table-unique-id=\"".concat(a,"\"]")}};a.init=function init(a){var l=a.uniqueid,m=a.noteStateNames,n=void 0===m?{}:m,p=document.querySelector(u.tableForm(l)),q=function(a){return p.querySelector(f.default.main.fromRegionId(a))},r=function(){e.default.define(u.bulkActionSelect,[e.default.events.accessibleChange]);(0,j.default)(u.bulkActionSelect).on(e.default.events.accessibleChange,function(a){var b=a.target.closest("select"),c=b.value,d=q(l),e=d.querySelectorAll(u.bulkUserSelectedCheckBoxes),f=new i.default("core_user/participants:bulkActionSelect");if(-1!==c.indexOf("#")){a.preventDefault();var j=[];e.forEach(function(a){j.push(a.getAttribute("name").replace("user",""))});var m;if("#messageselect"===c){m=(0,k.showSendMessage)(j)}else if("#addgroupnote"===c){m=(0,k.showAddNote)(p.dataset.courseId,j,n,p.querySelector(u.stateHelpIcon))}if(m){var o=new i.default("core_user/participants:bulkActionSelected");m.then(function(a){a.getRoot().on(g.default.hidden,function(){b.focus()});o.resolve();return a}).catch(h.default.exception)}}else if(""!==c&&e.length){b.form.submit()}s(b);f.resolve()});p.addEventListener("click",function(a){var c=p.querySelector(u.showCountToggle),e=p.querySelector(u.checkCountButton),f=c&&c.contains(a.target),g=e&&e.contains(a.target);if(f||g){a.preventDefault();var i=q(l);b.setPageSize(i,c.dataset.targetPageSize).then(function(a){d.default.setGroupState(p,"participants-table",g);return a}).catch(h.default.exception)}});p.addEventListener(b.Events.tableContentRefreshed,function(a){var b=p.querySelector(u.showCountToggle),e=p.querySelector(u.checkCountButton),f=a.target,g=parseInt(p.dataset.tableDefaultPerPage,10),i=parseInt(f.dataset.tablePageSize,10),j=parseInt(f.dataset.tableTotalRows,10);d.default.updateSlavesFromMasterState(p,"participants-table");var k=[{key:"countparticipantsfound",component:"core_user",param:j}];if(j<=g){b.classList.add("hidden");if(e){e.classList.add("hidden")}}else if(j<=i){k.push({key:"showperpage",component:"core",param:g});k.push({key:"selectalluserswithcount",component:"core",param:g});b.classList.remove("hidden");b.dataset.targetPageSize=g;if(e){e.classList.add("hidden")}}else{k.push({key:"showall",component:"core",param:j});k.push({key:"selectalluserswithcount",component:"core",param:j});b.classList.remove("hidden");b.dataset.targetPageSize=j;if(e){e.classList.remove("hidden")}}c.get_strings(k).then(function(a){var c=o(a,3),d=c[0],f=c[1],g=c[2],h=p.querySelector(u.showCountText);h.innerHTML=d;if(f){b.innerHTML=f}if(g&&e){e.value=g}}).catch(h.default.exception)})},s=function(a){a.value=""};r()}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_user/local/participants/bulkactions",["exports","core_user/repository","core/str","core/modal_events","core/modal_factory","core/notification","core/templates","core/toast"],function(a,b,c,d,e,f,g,h){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.showSendMessage=a.showAddNote=void 0;b=k(b);c=k(c);d=i(d);e=i(e);f=i(f);g=i(g);function i(a){return a&&a.__esModule?a:{default:a}}function j(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;j=function(){return a};return a}function k(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=j();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}var l=function(a,b,f,h){if(!b.length){return Promise.resolve()}var i=[];for(var l in f){switch(l){case"draft":i.push({value:"personal",label:f[l]});break;case"public":i.push({value:"course",label:f[l],selected:1});break;case"site":i.push({value:l,label:f[l]});break;}}var j={stateNames:i,stateHelpIcon:h.innerHTML},k=null;if(1===b.length){k=c.get_string("addbulknotesingle","core_notes")}else{k=c.get_string("addbulknote","core_notes",b.length)}return e.default.create({type:e.default.types.SAVE_CANCEL,body:g.default.render("core_user/add_bulk_note",j),title:k,buttons:{save:k},removeOnClose:!0}).then(function(c){c.getRoot().on(d.default.save,function(){return m(a,b,c)});c.show();return c})};a.showAddNote=l;var m=function(a,d,e){var g=e.getRoot().find("form textarea").val(),i=e.getRoot().find("form select").val(),j=d.map(function(b){return{userid:b,text:g,courseid:a,publishstate:i}});return b.createNotesForUsers(j).then(function(a){if(1===a.length){return c.get_string("addbulknotedonesingle","core_notes")}else{return c.get_string("addbulknotedone","core_notes",a.length)}}).then(function(a){return(0,h.add)(a)}).catch(f.default.exception)},n=function(a){if(!a.length){return Promise.resolve()}var b;if(1===a.length){b=c.get_string("sendbulkmessagesingle","core_message")}else{b=c.get_string("sendbulkmessage","core_message",a.length)}return e.default.create({type:e.default.types.SAVE_CANCEL,body:g.default.render("core_user/send_bulk_message",{}),title:b,buttons:{save:b},removeOnClose:!0}).then(function(b){b.getRoot().on(d.default.save,function(c){var d=b.getRoot().find("form textarea").val();if(""===d.trim()){b.getRoot().find("[data-role=\"messagetextrequired\"]").removeAttr("hidden");c.preventDefault();return}o(b,a,d)});b.show();return b})};a.showSendMessage=n;var o=function(a,d,e){var g=d.map(function(a){return{touserid:a,text:e}});return b.sendMessagesToUsers(g).then(function(a){if(1==a.length){return c.get_string("sendbulkmessagesentsingle","core_message")}else{return c.get_string("sendbulkmessagesent","core_message",a.length)}}).then(function(a){return(0,h.add)(a)}).catch(f.default.exception)}});
define ("core_user/local/participantsfilter/filtertypes/courseid",["exports","../filter"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function e(a){return function(){var b=this,c=arguments;return new Promise(function(e,f){var i=a.apply(b,c);function g(a){d(i,e,f,g,h,"next",a)}function h(a){d(i,e,f,g,h,"throw",a)}g(void 0)})}}function f(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function g(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function h(a,b,c){if(b)g(a.prototype,b);if(c)g(a,c);return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===c(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}var q=function(a){i(b,a);var c=k(b);function b(a,d){f(this,b);return c.call(this,a,d)}h(b,[{key:"addValueSelector",value:function(){var a=e(regeneratorRuntime.mark(function a(){return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:case"end":return a.stop();}}},a)}));return function addValueSelector(){return a.apply(this,arguments)}}()},{key:"filterValue",get:function get(){return{name:this.name,jointype:1,values:[parseInt(this.rootNode.dataset.tableCourseId,10)]}}}]);return b}(b.default);a.default=q;return a.default});
define ("core_user/local/participantsfilter/filtertypes/keyword",["exports","../filter","core/str"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function d(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){d=function(a){return typeof a}}else{d=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return d(a)}function e(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function f(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function g(a,b,c){if(b)f(a.prototype,b);if(c)f(a,c);return a}function h(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)i(a,b)}function i(a,b){i=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return i(a,b)}function j(a){return function(){var b=n(a),c;if(m()){var d=n(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return k(this,c)}}function k(a,b){if(b&&("object"===d(b)||"function"==typeof b)){return b}return l(a)}function l(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function n(a){n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return n(a)}var o=function(a){h(b,a);var d=j(b);function b(){e(this,b);return d.apply(this,arguments)}g(b,[{key:"values",get:function get(){return this.rawValues}},{key:"placeholder",get:function get(){return(0,c.get_string)("placeholdertype","core_user")}},{key:"showSuggestions",get:function get(){return!1}}]);return b}(b.default);a.default=o;return a.default});
define ("core_user/local/participantsfilter/filter",["exports","core/form-autocomplete","./selectors","core/str"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=e(b);c=e(c);function e(a){return a&&a.__esModule?a:{default:a}}function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function g(a){f(i,d,e,g,h,"next",a)}function h(a){f(i,d,e,g,h,"throw",a)}g(void 0)})}}function h(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function i(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function j(a,b,c){if(b)i(a.prototype,b);if(c)i(a,c);return a}var k=function(a){return a.querySelectorAll(":checked")},l=function(){function a(b,c,d){h(this,a);this.filterType=b;this.rootNode=c;this.addValueSelector(d)}j(a,[{key:"tearDown",value:function tearDown(){}},{key:"addValueSelector",value:function(){var a=g(regeneratorRuntime.mark(function a(){var c=this,d,e,f,g,h=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d=0<h.length&&h[0]!==void 0?h[0]:[];e=this.getFilterValueNode();e.innerHTML=this.getSourceDataForFilter().outerHTML;f=e.querySelector("select");f.id="filter-value-"+f.getAttribute("data-field-name");g=document.createElement("label");g.setAttribute("for",f.id);g.classList.add("sr-only");g.innerText=f.getAttribute("data-field-title");e.appendChild(g);d.forEach(function(a){var b=f.querySelector("option[value=\"".concat(a,"\"]"));if(b){b.selected=!0}else if(!c.showSuggestions){b=document.createElement("option");b.value=a;b.innerHTML=a;b.selected=!0;f.append(b)}});a.t0=b.default;a.t1=f;a.t2="1"==f.dataset.allowCustom;a.next=16;return this.placeholder;case 16:a.t3=a.sent;a.t4=this.showSuggestions;a.t5=!f.multiple;a.t6={items:"core_user/local/participantsfilter/autocomplete_selection_items",layout:"core_user/local/participantsfilter/autocomplete_layout",selection:"core_user/local/participantsfilter/autocomplete_selection"};a.t0.enhance.call(a.t0,a.t1,a.t2,null,a.t3,!1,a.t4,null,a.t5,a.t6);case 21:case"end":return a.stop();}}},a,this)}));return function addValueSelector(){return a.apply(this,arguments)}}()},{key:"getSourceDataForFilter",value:function getSourceDataForFilter(){var a=this.rootNode.querySelector(c.default.filterset.regions.datasource);return a.querySelector(c.default.data.fields.byName(this.filterType))}},{key:"getFilterValueNode",value:function getFilterValueNode(){return this.filterRoot.querySelector(c.default.filter.regions.values)}},{key:"placeholder",get:function get(){return(0,d.get_string)("placeholdertypeorselect","core_user")}},{key:"showSuggestions",get:function get(){return!0}},{key:"filterRoot",get:function get(){return this.rootNode.querySelector(c.default.filter.byName(this.filterType))}},{key:"name",get:function get(){return this.filterType}},{key:"jointype",get:function get(){return parseInt(this.filterRoot.querySelector(c.default.filter.fields.join).value,10)}},{key:"rawValues",get:function get(){var a=this.getFilterValueNode(),b=a.querySelector("select");return Object.values(k(b)).map(function(a){return a.value})}},{key:"values",get:function get(){return this.rawValues.map(function(a){return parseInt(a,10)})}},{key:"filterValue",get:function get(){return{name:this.name,jointype:this.jointype,values:this.values}}}]);return a}();a.default=l;return a.default});
define ("core_user/local/participantsfilter/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var b=function(a){return"[data-filterregion=\"".concat(a,"\"]")},c=function(a){return"[data-filteraction=\"".concat(a,"\"]")},d=function(a){return"[data-filterfield=\"".concat(a,"\"]")},e={filter:{region:b("filter"),actions:{remove:c("remove")},fields:{join:d("join"),type:d("type")},regions:{values:b("value")},byName:function byName(a){return"".concat(b("filter"),"[data-filter-type=\"").concat(a,"\"]")}},filterset:{region:b("actions"),actions:{addRow:c("add"),applyFilters:c("apply"),resetFilters:c("reset")},regions:{filtermatch:b("filtermatch"),filterlist:b("filters"),datasource:b("filtertypedata")},fields:{join:"".concat(b("filtermatch")," ").concat(d("join"))}},data:{fields:{byName:function byName(a){return"[data-field-name=\"".concat(a,"\"]")},all:"".concat(b("filtertypedata")," [data-field-name]")},typeList:b("filtertypelist"),typeListSelect:"select".concat(b("filtertypelist"))}};a.default=e;return a.default});
define ("core_user/unified_filter",["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={UNIFIED_FILTERS:"#unified-filters"},f=function init(){M.util.js_pending("unified_filter_datasource");c.get_strings([{key:"userfilterplaceholder",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}]).done(function(a){var c=a[0],f=a[1];b.enhance(e.UNIFIED_FILTERS,!0,"core_user/unified_filter_datasource",c,!1,!0,f,!0).then(function(){M.util.js_complete("unified_filter_datasource")}).fail(d.exception)}).fail(d.exception);var f=a(e.UNIFIED_FILTERS).val();a(e.UNIFIED_FILTERS).on("change",function(){var b=a(this).val(),c=[],d=[],e=!1;a.each(b,function(a,b){var f=b.split(":",2);if(2!==f.length){d.push(b);return!0}var g=f[0],h=f[1];if("undefined"!=typeof c[g]){e=!0}c[g]=h;return!0});if(e){var g=[];for(var h in c){g.push(h+":"+c[h])}g=g.concat(d);a(this).val(g)}if(f.join(",")!=b.join(",")){this.form.submit()}})},g=function getForm(){return a(e.UNIFIED_FILTERS).closest("form")};return{init:function init(){f()},getForm:function getForm(){return g()}}});
define ("core_user/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.sendMessagesToUsers=a.createNotesForUsers=a.submitUserEnrolmentForm=a.unenrolUser=void 0;a.unenrolUser=function unenrolUser(a){return(0,b.call)([{methodname:"core_enrol_unenrol_user_enrolment",args:{ueid:a}}])[0]};a.submitUserEnrolmentForm=function submitUserEnrolmentForm(a){return(0,b.call)([{methodname:"core_enrol_submit_user_enrolment_form",args:{formdata:a}}])[0]};a.createNotesForUsers=function createNotesForUsers(a){return(0,b.call)([{methodname:"core_notes_create_notes",args:{notes:a}}])[0]};a.sendMessagesToUsers=function sendMessagesToUsers(a){return(0,b.call)([{methodname:"core_message_send_instant_messages",args:{messages:a}}])[0]}});
define ("core_user/unified_filter_datasource",["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function list(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){if(""!==c.trim()&&-1===e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())){return!0}if(-1<a.inArray(e.value,g)){return!0}d.push(e);return!0});var h=new a.Deferred;h.resolve(d);return h.promise()},processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.value,label:b.label})});return d},transport:function transport(a,b,d){this.list(a,b).then(d).catch(c.exception)}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_user/participantsfilter",["exports","./local/participantsfilter/filtertypes/courseid","core_table/dynamic","./local/participantsfilter/filter","core/str","core/notification","core/pending","./local/participantsfilter/selectors","core/templates","core/custom_interaction_events","jquery"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=n(b);c=m(c);d=n(d);f=n(f);g=n(g);h=n(h);i=n(i);j=n(j);k=n(k);var A="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function l(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;l=function(){return a};return a}function m(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=l();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function n(a){return a&&a.__esModule?a:{default:a}}function o(a){return r(a)||q(a)||u(a)||p()}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function r(a){if(Array.isArray(a))return v(a)}function s(a,b){return x(a)||w(a,b)||u(a,b)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(a,b){if(!a)return;if("string"==typeof a)return v(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return v(a,b)}function v(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function w(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function x(a){if(Array.isArray(a))return a}function y(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function z(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){y(h,d,e,f,g,"next",a)}function g(a){y(h,d,e,f,g,"throw",a)}f(void 0)})}}var B=function(a){var l=document.querySelector("#".concat(a)),m={courseid:new b.default("courseid",l)},n=function(){return l.querySelector(h.default.filterset.regions.filterlist)},p=function(){var a=new g.default("core_user/participantsfilter:addFilterRow"),b=1+n().querySelectorAll(h.default.filter.region).length;return i.default.renderForPromise("core_user/local/participantsfilter/filterrow",{rownumber:b}).then(function(a){var b=a.html,c=a.js,d=i.default.appendNodeContents(n(),b,c);return d}).then(function(a){var b=l.querySelector(h.default.data.typeList);a.forEach(function(a){var c=a.querySelector(h.default.filter.fields.type);if(c){c.innerHTML=b.innerHTML}});return a}).then(function(a){C();return a}).then(function(b){a.resolve();return b}).catch(f.default.exception)},q=function(a){var b=l.querySelector(h.default.filterset.regions.datasource);return b.querySelector(h.default.data.fields.byName(a))},r=function(){var a=z(regeneratorRuntime.mark(function a(b,c,e){var f,g,i;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:b.dataset.filterType=c;f=q(c);g=d.default;if(!f.dataset.filterTypeClass){a.next=7;break}a.next=6;return"function"==typeof A.define&&A.define.amd?new Promise(function(a,b){A.require([f.dataset.filterTypeClass],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&A.require&&"component"===A.require.loader?Promise.resolve(require((f.dataset.filterTypeClass))):Promise.resolve(A[f.dataset.filterTypeClass]);case 6:g=a.sent;case 7:m[c]=new g(c,l,e);i=b.querySelector(h.default.filter.fields.type);i.value=c;i.disabled="disabled";C();return a.abrupt("return",m[c]);case 13:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),t=function(a){return m[a]},u=function(a,b){var c=n().querySelectorAll(h.default.filter.region).length;if(1===c){w(a,b)}else{v(a,b)}},v=function(){var a=z(regeneratorRuntime.mark(function a(b){var c,d,e,f,g=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c=1<g.length&&g[1]!==void 0?g[1]:!0;d=b.querySelector(h.default.filter.fields.type);e=!!d.value;x(b.dataset.filterType);b.remove();C();if(e&&c){E()}a.next=9;return F();case 9:f=a.sent;n().querySelectorAll(h.default.filter.region).forEach(function(a,b){a.querySelector("legend").innerText=f[b]});case 11:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),w=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!0,c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;x(a.dataset.filterType);return i.default.renderForPromise("core_user/local/participantsfilter/filterrow",{rownumber:c}).then(function(b){var c=b.html,d=b.js,e=i.default.replaceNode(a,c,d);return e}).then(function(a){var b=l.querySelector(h.default.data.typeList);a.forEach(function(a){var c=a.querySelector(h.default.filter.fields.type);if(c){c.innerHTML=b.innerHTML}});return a}).then(function(a){C();return a}).then(function(a){if(b){return E()}else{return a}}).catch(f.default.exception)},x=function(a){if(a){var b=t(a);if(b){b.tearDown();delete m[a]}}},y=function(){var a=new g.default("core_user/participantsfilter:setFilterFromConfig"),b=n().querySelectorAll(h.default.filter.region);b.forEach(function(a){return u(a,!1)});return E().then(function(b){a.resolve();return b})},B=function(){var a=n().querySelectorAll(h.default.filter.region);a.forEach(function(a){var b=a.querySelector(h.default.filter.fields.type);if(!b.value){u(a,!1)}})},C=function(){var a=n().querySelectorAll(h.default.filter.region);a.forEach(function(a){var b=a.querySelectorAll(h.default.filter.fields.type+" option");b.forEach(function(b){if(b.value===a.dataset.filterType){b.classList.remove("hidden");b.disabled=!1}else if(m[b.value]){b.classList.add("hidden");b.disabled=!0}else{b.classList.remove("hidden");b.disabled=!1}})});var b=l.querySelector(h.default.filterset.actions.addRow),c=l.querySelectorAll(h.default.data.fields.all);if(c.length<=a.length){b.setAttribute("disabled","disabled")}else{b.removeAttribute("disabled")}if(1===a.length){l.querySelector(h.default.filterset.regions.filtermatch).classList.add("hidden");l.querySelector(h.default.filterset.fields.join).value=1;l.dataset.filterverb=1}else{l.querySelector(h.default.filterset.regions.filtermatch).classList.remove("hidden")}},D=function(a){var b=Object.entries(a.filters);if(!b.length){return Promise.resolve()}l.querySelector(h.default.filterset.fields.join).value=a.jointype;var c=b.map(function(a){var b=s(a,2),c=b[0],d=b[1];if("courseid"===c){return!1}var e=d.values;if(!e.length){return!1}return p().then(function(a){var b=s(a,1),d=b[0];return r(d,c,e)})}).filter(function(a){return a});if(!c.length){return Promise.resolve()}return Promise.all(c).then(function(){return B()}).then(C).then(E)},E=function(){var a=new g.default("core_user/participantsfilter:updateTableFromFilter"),b={};Object.values(m).forEach(function(a){b[a.filterValue.name]=a.filterValue});return c.setFilters(c.getTableFromId(l.dataset.tableRegion),{jointype:parseInt(l.querySelector(h.default.filterset.fields.join).value,10),filters:b}).then(function(b){a.resolve();return b}).catch(f.default.exception)},F=function(){var a=z(regeneratorRuntime.mark(function a(){var b,c,d;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:b=document.querySelector(h.default.data.typeListSelect).length-1;c=[];o(Array(b)).forEach(function(a,b){c.push({key:"filterrowlegend",component:"core_user",param:b+1})});a.next=5;return(0,e.get_strings)(c).then(function(a){return a}).catch(f.default.exception);case 5:d=a.sent;return a.abrupt("return",d);case 7:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();l.querySelector(h.default.filterset.region).addEventListener("click",function(a){if(a.target.closest(h.default.filterset.actions.addRow)){a.preventDefault();p()}if(a.target.closest(h.default.filterset.actions.applyFilters)){a.preventDefault();E()}if(a.target.closest(h.default.filterset.actions.resetFilters)){a.preventDefault();y()}});l.querySelector(h.default.filterset.regions.filterlist).addEventListener("click",function(a){if(a.target.closest(h.default.filter.actions.remove)){a.preventDefault();u(a.target.closest(h.default.filter.region),!0)}});var G=(0,k.default)(n());j.default.define(G,[j.default.events.accessibleChange]);G.on(j.default.events.accessibleChange,function(a){var b=a.target.closest(h.default.filter.fields.type);if(b&&b.value){var c=a.target.closest(h.default.filter.region);r(c,b.value)}});l.querySelector(h.default.filterset.fields.join).addEventListener("change",function(a){l.dataset.filterverb=a.target.value});var H=c.getTableFromId(l.dataset.tableRegion),I=c.getFilters(H);if(I){var J=new g.default("core_user/participantsfilter:setFilterFromConfig");D(I).then(function(){return J.resolve()}).catch()}};a.init=B});
define ("qtype_ddimageortext/question",["jquery","core/dragdrop","core/key_codes"],function(a,b,c){"use strict";function d(a,b,c){this.containerId=a;M.util.js_pending("qtype_ddimageortext-init-"+this.containerId);this.places=c;this.allImagesLoaded=!1;this.imageLoadingTimeoutId=null;this.isPrinting=!1;if(b){this.getRoot().addClass("qtype_ddimageortext-readonly")}var d=this;this.getNotYetLoadedImages().one("load",function(){d.waitForAllImagesToBeLoaded()});this.waitForAllImagesToBeLoaded()}d.prototype.waitForAllImagesToBeLoaded=function(){var a=this;if(this.allImagesLoaded){return}if(null!==this.imageLoadingTimeoutId){clearTimeout(this.imageLoadingTimeoutId)}if(0<this.getNotYetLoadedImages().length){this.imageLoadingTimeoutId=setTimeout(function(){a.waitForAllImagesToBeLoaded()},100);return}this.allImagesLoaded=!0;a.setupQuestion()};d.prototype.getNotYetLoadedImages=function(){var a=this;return this.getRoot().find(".ddarea img").not(function(b,c){return a.imageIsLoaded(c)})};d.prototype.imageIsLoaded=function(a){return a.complete&&0!==a.naturalHeight};d.prototype.setupQuestion=function(){this.resizeAllDragsAndDrops();this.cloneDrags();this.positionDragsAndDrops();M.util.js_complete("qtype_ddimageortext-init-"+this.containerId)};d.prototype.resizeAllDragsAndDrops=function(){var b=this;this.getRoot().find(".draghomes > div").each(function(c,d){b.resizeAllDragsAndDropsInGroup(b.getClassnameNumericSuffix(a(d),"dragitemgroup"))})};d.prototype.resizeAllDragsAndDropsInGroup=function(b){var c=this.getRoot(),d=c.find(".dragitemgroup"+b+" .draghome"),e=0,f=0;d.each(function(a,b){e=Math.max(e,Math.ceil(b.offsetWidth));f=Math.max(f,Math.ceil(b.offsetHeight))});e+=10;f+=10;d.each(function(b,c){var d=Math.round((e-c.offsetWidth)/2),g=Math.floor((f-c.offsetHeight)/2);a(c).css({"padding-left":d+"px","padding-right":e-c.offsetWidth-d+"px","padding-top":g+"px","padding-bottom":f-c.offsetHeight-g+"px"})});for(var g in this.places){if(!this.places.hasOwnProperty(g)){continue}var h=this.places[g],i=h.text;if(parseInt(h.group)!==b){continue}if(""===i){i=M.util.get_string("blank","qtype_ddimageortext")}c.find(".dropzones").append("<div class=\"dropzone active group"+h.group+" place"+g+"\" tabindex=\"0\"><span class=\"accesshide\">"+i+"</span>&nbsp;</div>");c.find(".dropzone.place"+g).width(e-2).height(f-2)}};d.prototype.cloneDrags=function(){var b=this;b.getRoot().find(".draghome").each(function(c,d){var e=a(d),f=e.clone();f.removeClass();f.addClass("draghome choice"+b.getChoice(e)+" group"+b.getGroup(e)+" dragplaceholder");e.before(f)})};d.prototype.cloneDragsForOneChoice=function(a){if(a.hasClass("infinite")){for(var b=this.noOfDropsInGroup(this.getGroup(a)),c=0;c<b;c++){this.cloneDrag(a)}}else{this.cloneDrag(a)}};d.prototype.cloneDrag=function(a){var b=a.clone();b.removeClass("draghome").addClass("drag unplaced moodle-has-zindex").offset(a.offset());this.getRoot().find(".dragitems").append(b)};d.prototype.positionDragsAndDrops=function(){var b=this,c=this.getRoot(),d=this.bgRatio();c.find(".ddarea .dropzone").each(function(c,e){var f=a(e),g=b.places[b.getPlace(f)];f.css("left",parseInt(g.xy[0])*d).css("top",parseInt(g.xy[1])*d);f.data("originX",parseInt(g.xy[0])).data("originY",parseInt(g.xy[1]));b.handleElementScale(f,"left top")});c.find(".draghome").not(".dragplaceholder").each(function(c,d){var e=a(d),f=b.getClassnameNumericSuffix(e,"inplace");e.addClass("unplaced").removeClass("placed");e.removeAttr("tabindex");if(null!==f){e.removeClass("inplace"+f)}});c.find("input.placeinput").each(function(d,e){var f=a(e),g=f.val();if(0===g.length||0<g.length&&"0"===g){return}var h=b.getPlace(f),i=b.getUnplacedChoice(b.getGroup(f),g),j=b.getDragClone(i);if(j.length){if(i.hasClass("infinite")){var k=b.noOfDropsInGroup(b.getGroup(i)),l=b.getInfiniteDragClones(i,!1);if(l.length<k){var m=i.clone();m.removeClass("beingdragged");m.removeAttr("tabindex");j.after(m)}else{j.addClass("active")}}else{j.addClass("active")}}var n=c.find(".dropzone.place"+h);b.sendDragToDrop(i,n)})};d.prototype.handleDragStart=function(c){var d=this,e=a(c.target).closest(".draghome"),g=this.calculateZIndex(),h=b.prepare(c);if(!h.start){return}e.addClass("beingdragged").css("transform","").css("z-index",g+2);var i=this.getClassnameNumericSuffix(e,"inplace");if(null!==i){this.setInputValue(i,0);e.removeClass("inplace"+i);var j=d.getDrop(e,i);if(j.length){j.addClass("active");e.offset(j.offset())}}else{var k=d.getDragClone(e);if(k.length){if(e.hasClass("infinite")){var l=this.noOfDropsInGroup(d.getGroup(e)),m=this.getInfiniteDragClones(e,!1);if(m.length<l){var n=e.clone();n.removeClass("beingdragged");n.removeAttr("tabindex");k.after(n);f.addEventHandlersToDrag(n);e.offset(n.offset())}else{k.addClass("active");e.offset(k.offset())}}else{k.addClass("active");e.offset(k.offset())}}}b.start(c,e,function(a,b,c){d.dragMove(a,b,c)},function(a,b,c){d.dragEnd(a,b,c)})};d.prototype.dragMove=function(b,c,d){var e=this,f=!1;this.getRoot().find(".dropzone.group"+this.getGroup(d)).each(function(d,g){var h=a(g);if(e.isPointInDrop(b,c,h)&&!f){f=!0;h.addClass("valid-drag-over-drop")}else{h.removeClass("valid-drag-over-drop")}});this.getRoot().find(".draghome.placed.group"+this.getGroup(d)).not(".beingdragged").each(function(g,h){var i=a(h);if(e.isPointInDrop(b,c,i)&&!f&&!e.isDragSameAsDrop(d,i)){f=!0;i.addClass("valid-drag-over-drop")}else{i.removeClass("valid-drag-over-drop")}})};d.prototype.dragEnd=function(b,c,d){var e=this,f=this.getRoot(),g=!1;f.find(".dropzone.group"+this.getGroup(d)).each(function(f,h){var i=a(h);if(!e.isPointInDrop(b,c,i)){return!0}i.removeClass("valid-drag-over-drop");e.sendDragToDrop(d,i);g=!0;return!1});if(!g){f.find(".draghome.placed.group"+this.getGroup(d)).not(".beingdragged").each(function(f,h){var i=a(h);if(!e.isPointInDrop(b,c,i)||e.isDragSameAsDrop(d,i)){return!0}i.removeClass("valid-drag-over-drop");var j=e.getClassnameNumericSuffix(i,"inplace"),k=e.getDrop(d,j);e.sendDragToDrop(d,k);g=!0;return!1})}if(!g){this.sendDragHome(d)}};d.prototype.sendDragToDrop=function(a,b){var c=this.getCurrentDragInPlace(this.getPlace(b));if(0!==c.length){c.addClass("beingdragged");c.offset(c.offset());var d=this.getClassnameNumericSuffix(c,"inplace"),e=this.getDrop(c,d);e.addClass("active");this.sendDragHome(c)}if(0===a.length){this.setInputValue(this.getPlace(b),0);if(b.data("isfocus")){b.focus()}}else{this.setInputValue(this.getPlace(b),this.getChoice(a));a.removeClass("unplaced").addClass("placed inplace"+this.getPlace(b));a.attr("tabindex",0);this.animateTo(a,b)}};d.prototype.sendDragHome=function(a){var b=this.getClassnameNumericSuffix(a,"inplace");if(null!==b){a.removeClass("inplace"+b)}a.data("unplaced",!0);this.animateTo(a,this.getDragHome(this.getGroup(a),this.getChoice(a)))};d.prototype.handleKeyPress=function(b){var d=a(b.target).closest(".dropzone");if(0===d.length){var e=a(b.target),g=this.getClassnameNumericSuffix(e,"inplace");if(null!==g){d=this.getDrop(e,g)}}var h=this.getCurrentDragInPlace(this.getPlace(d)),i=a();switch(b.keyCode){case c.space:case c.arrowRight:case c.arrowDown:i=this.getNextDrag(this.getGroup(d),h);break;case c.arrowLeft:case c.arrowUp:i=this.getPreviousDrag(this.getGroup(d),h);break;case c.escape:f.isKeyboardNavigation=!1;break;default:f.isKeyboardNavigation=!1;return;}if(i.length){i.data("isfocus",!0);i.addClass("beingdragged");var j=this.getDragClone(i);if(j.length){if(i.hasClass("infinite")){var k=this.noOfDropsInGroup(this.getGroup(i)),l=this.getInfiniteDragClones(i,!1);if(l.length<k){var m=i.clone();m.removeClass("beingdragged");m.removeAttr("tabindex");j.after(m);f.addEventHandlersToDrag(m);i.offset(m.offset())}else{j.addClass("active");i.offset(j.offset())}}else{j.addClass("active");i.offset(j.offset())}}}else{d.data("isfocus",!0)}b.preventDefault();this.sendDragToDrop(i,d)};d.prototype.getNextDrag=function(a,b){var c,d=this.noOfChoicesInGroup(a);if(0===b.length){c=1}else{c=this.getChoice(b)+1}var e=this.getUnplacedChoice(a,c);while(0===e.length&&c<d){c++;e=this.getUnplacedChoice(a,c)}return e};d.prototype.getPreviousDrag=function(a,b){var c;if(0===b.length){c=this.noOfChoicesInGroup(a)}else{c=this.getChoice(b)-1}var d=this.getUnplacedChoice(a,c);while(0===d.length&&1<c){c--;d=this.getUnplacedChoice(a,c)}return d};d.prototype.animateTo=function(b,c){var d=b.offset(),e=c.offset(),f=this;M.util.js_pending("qtype_ddimageortext-animate-"+f.containerId);b.animate({left:parseInt(b.css("left"))+e.left-d.left,top:parseInt(b.css("top"))+e.top-d.top},{duration:"fast",done:function done(){a("body").trigger("qtype_ddimageortext-dragmoved",[b,c,f]);M.util.js_complete("qtype_ddimageortext-animate-"+f.containerId)}})};d.prototype.isPointInDrop=function(a,b,c){var d=c.offset();if(c.hasClass("draghome")){return a>=d.left&&a<d.left+c.outerWidth()&&b>=d.top&&b<d.top+c.outerHeight()}return a>=d.left&&a<d.left+c.width()&&b>=d.top&&b<d.top+c.height()};d.prototype.setInputValue=function(a,b){this.getRoot().find("input.placeinput.place"+a).val(b)};d.prototype.getRoot=function(){return a(document.getElementById(this.containerId))};d.prototype.bgImage=function(){return this.getRoot().find("img.dropbackground")};d.prototype.getDragHome=function(a,b){if(!this.getRoot().find(".draghome.dragplaceholder.group"+a+".choice"+b).is(":visible")){return this.getRoot().find(".dragitemgroup"+a+" .draghome.infinite.choice"+b+".group"+a)}return this.getRoot().find(".draghome.dragplaceholder.group"+a+".choice"+b)};d.prototype.getUnplacedChoice=function(a,b){return this.getRoot().find(".ddarea .draghome.group"+a+".choice"+b+".unplaced").slice(0,1)};d.prototype.getCurrentDragInPlace=function(a){return this.getRoot().find(".ddarea .draghome.inplace"+a)};d.prototype.noOfDropsInGroup=function(a){return this.getRoot().find(".dropzone.group"+a).length};d.prototype.noOfChoicesInGroup=function(a){return this.getRoot().find(".dragitemgroup"+a+" .draghome").length};d.prototype.getClassnameNumericSuffix=function(a,b){var c=a.attr("class");if(""!==c){for(var d=c.split(" "),e=0,f;e<d.length;e++){f=new RegExp("^"+b+"([0-9])+$");if(f.test(d[e])){var g=/([0-9])+$/.exec(d[e]);return+g[0]}}}return null};d.prototype.getChoice=function(a){return this.getClassnameNumericSuffix(a,"choice")};d.prototype.getGroup=function(a){return this.getClassnameNumericSuffix(a,"group")};d.prototype.getPlace=function(a){return this.getClassnameNumericSuffix(a,"place")};d.prototype.getDragClone=function(a){return this.getRoot().find(".dragitemgroup"+this.getGroup(a)+" .draghome.choice"+this.getChoice(a)+".group"+this.getGroup(a)+".dragplaceholder")};d.prototype.getInfiniteDragClones=function(a,b){if(b){return this.getRoot().find(".dragitemgroup"+this.getGroup(a)+" .draghome.choice"+this.getChoice(a)+".group"+this.getGroup(a)+".infinite").not(".dragplaceholder")}return this.getRoot().find(".draghome.choice"+this.getChoice(a)+".group"+this.getGroup(a)+".infinite").not(".dragplaceholder")};d.prototype.getDrop=function(a,b){return this.getRoot().find(".dropzone.group"+this.getGroup(a)+".place"+b)};d.prototype.handleResize=function(){var b=this,c=this.bgRatio();if(this.isPrinting){c=1}this.getRoot().find(".ddarea .dropzone").each(function(d,e){a(e).css("left",parseInt(a(e).data("originX"))*parseFloat(c)).css("top",parseInt(a(e).data("originY"))*parseFloat(c));b.handleElementScale(e,"left top")});this.getRoot().find("div.droparea .draghome").not(".beingdragged").each(function(d,e){a(e).css("left",parseFloat(a(e).data("originX"))*parseFloat(c)).css("top",parseFloat(a(e).data("originY"))*parseFloat(c));b.handleElementScale(e,"left top")})};d.prototype.bgRatio=function(){var a=this.bgImage(),b=a.get(0).naturalWidth,c=a.width();return c/b};d.prototype.handleElementScale=function(b,c){var d=parseFloat(this.bgRatio());if(this.isPrinting){d=1}a(b).css({"-webkit-transform":"scale("+d+")","-moz-transform":"scale("+d+")","-ms-transform":"scale("+d+")","-o-transform":"scale("+d+")",transform:"scale("+d+")","transform-origin":c})};d.prototype.calculateZIndex=function(){var b=0;this.getRoot().find(".ddarea .dropzone, div.droparea .draghome").each(function(c,d){d=a(d);var e=d.css("z-index")?parseInt(d.css("z-index")):0;if(e>b){b=e}});return b};d.prototype.isDragSameAsDrop=function(a,b){return this.getChoice(a)===this.getChoice(b)&&this.getGroup(a)===this.getGroup(b)};var f={eventHandlersInitialised:!1,isPrinting:!1,isKeyboardNavigation:!1,questions:{},init:function init(a,b,c){f.questions[a]=new d(a,b,c);if(!f.eventHandlersInitialised){f.setupEventHandlers();f.eventHandlersInitialised=!0}},setupEventHandlers:function setupEventHandlers(){f.addEventHandlersToDrag(a(".que.ddimageortext:not(.qtype_ddimageortext-readonly) .draghome"));a("body").on("keydown",".que.ddimageortext:not(.qtype_ddimageortext-readonly) .dropzones .dropzone",f.handleKeyPress).on("keydown",".que.ddimageortext:not(.qtype_ddimageortext-readonly) .draghome.placed:not(.beingdragged)",f.handleKeyPress).on("qtype_ddimageortext-dragmoved",f.handleDragMoved);a(window).on("resize",function(){f.handleWindowResize(!1)});window.addEventListener("beforeprint",function(){f.isPrinting=!0;f.handleWindowResize(f.isPrinting)});window.addEventListener("afterprint",function(){f.isPrinting=!1;f.handleWindowResize(f.isPrinting)});setTimeout(function(){f.fixLayoutIfThingsMoved()},100)},addEventHandlersToDrag:function addEventHandlersToDrag(a){a.unbind("mousedown touchstart");a.on("mousedown touchstart",f.handleDragStart)},handleDragStart:function handleDragStart(a){a.preventDefault();var b=f.getQuestionForEvent(a);if(b){b.handleDragStart(a)}},handleKeyPress:function handleKeyPress(a){if(f.isKeyboardNavigation){return}f.isKeyboardNavigation=!0;var b=f.getQuestionForEvent(a);if(b){b.handleKeyPress(a)}},handleWindowResize:function handleWindowResize(a){for(var b in f.questions){if(f.questions.hasOwnProperty(b)){f.questions[b].isPrinting=a;f.questions[b].handleResize()}}},fixLayoutIfThingsMoved:function fixLayoutIfThingsMoved(){this.handleWindowResize(f.isPrinting);setTimeout(function(){f.fixLayoutIfThingsMoved(f.isPrinting)},100)},handleDragMoved:function handleDragMoved(a,b,c,d){b.removeClass("beingdragged").css("z-index","");b.css("top",c.position().top).css("left",c.position().left);c.after(b);c.removeClass("active");if("undefined"!=typeof b.data("unplaced")&&!0===b.data("unplaced")){b.removeClass("placed").addClass("unplaced");b.removeAttr("tabindex");b.removeData("unplaced");b.css("top","").css("left","").css("transform","");if(b.hasClass("infinite")&&1<d.getInfiniteDragClones(b,!0).length){d.getInfiniteDragClones(b,!0).first().remove()}}else{b.data("originX",c.data("originX")).data("originY",c.data("originY"));d.handleElementScale(b,"left top")}if("undefined"!=typeof b.data("isfocus")&&!0===b.data("isfocus")){b.focus();b.removeData("isfocus")}if("undefined"!=typeof c.data("isfocus")&&!0===c.data("isfocus")){c.removeData("isfocus")}if(f.isKeyboardNavigation){f.isKeyboardNavigation=!1}},getQuestionForEvent:function getQuestionForEvent(b){var c=a(b.currentTarget).closest(".que.ddimageortext").attr("id");return f.questions[c]}};return{init:f.init}});
define ("qtype_ddimageortext/form",["jquery","core/dragdrop"],function(a,b){"use strict";var c={maxBgImageSize:null,maxDragImageSize:null,fp:null,init:function init(){c.fp=c.filePickers();a("#id_previewareaheader").append("<div class=\"ddarea que ddimageortext\">  <div class=\"droparea\">    <img class=\"dropbackground\" />    <div class=\"dropzones\"></div>  </div>  <div class=\"dragitems\"></div></div>");c.updateVisibilityOfFilePickers();c.setOptionsForDragItemSelectors();c.setupEventHandlers();c.waitForFilePickerToInitialise()},waitForFilePickerToInitialise:function waitForFilePickerToInitialise(){if(null===c.fp.file("bgimage").href){setTimeout(c.waitForFilePickerToInitialise,1e3);return}M.util.js_pending("dragDropToImageForm");a("form.mform[data-qtype=\"ddimageortext\"]").on("change",".filepickerhidden",function(){M.util.js_pending("dragDropToImageForm");c.loadPreviewImage()});c.loadPreviewImage()},loadPreviewImage:function loadPreviewImage(){a("fieldset#id_previewareaheader .dropbackground").one("load",c.afterPreviewImageLoaded).attr("src",c.fp.file("bgimage").href)},afterPreviewImageLoaded:function afterPreviewImageLoaded(){c.createDropZones();M.util.js_complete("dragDropToImageForm")},createDropZones:function createDropZones(){var b=a(".dropzones");b.empty();var d=c.fp.file("bgimage").href;if(null===d){return}for(var e=c.form.getFormValue("nodropzone",[]),f=0,g;f<e;f++){g=c.form.getFormValue("drops",[f,"choice"]);if("0"===g){continue}g=g-1;var h=c.form.getFormValue("drags",[g,"draggroup"]),i=c.form.getFormValue("draglabel",[g]);if("image"===c.form.getFormValue("drags",[g,"dragitemtype"])){var j=c.fp.file("dragitem["+g+"]").href;if(null===j){continue}b.append("<img class=\"droppreview group"+h+" drop"+f+"\" src=\""+j+"\" alt=\""+i+"\" data-drop-no=\""+f+"\">")}else if(""!==i){b.append("<div class=\"droppreview group"+h+" drop"+f+"\"  data-drop-no=\""+f+"\">"+i+"</div>")}}c.waitForAllDropImagesToBeLoaded()},waitForAllDropImagesToBeLoaded:function waitForAllDropImagesToBeLoaded(){var b=a(".dropzones img").not(function(a,b){return c.imageIsLoaded(b)});if(0<b.length){setTimeout(function(){c.waitForAllDropImagesToBeLoaded()},100);return}c.updateDropZones()},imageIsLoaded:function imageIsLoaded(a){return a.complete&&0!==a.naturalHeight},updateDropZones:function updateDropZones(){var b=c.fp.file("bgimage").href;if(null===b){return}for(var d=a("fieldset#id_previewareaheader .dropbackground").offset(),e=c.form.getFormValue("nodropzone",[]),f=0,g;f<e;f++){g=a(".dropzones .drop"+f);if(0===g.length){continue}var h=c.form.getFormValue("drops",[f,"choice"])-1;g.offset({left:d.left+parseInt(c.form.getFormValue("drops",[f,"xleft"])),top:d.top+parseInt(c.form.getFormValue("drops",[f,"ytop"]))});var i=c.form.getFormValue("draglabel",[h]);if(g.is("img")){g.attr("alt",i)}else{g.html(i)}}a(".dropzones .droppreview").css("padding","0");for(var j=a(".draggroup select").first().find("option").length,k=1;k<=j;k++){c.resizeAllDragsAndDropsInGroup(k)}},resizeAllDragsAndDropsInGroup:function resizeAllDragsAndDropsInGroup(b){var c=a(".dropzones .droppreview.group"+b),d=0,e=0;c.each(function(a,b){d=Math.max(d,Math.ceil(b.offsetWidth));e=Math.max(e,Math.ceil(b.offsetHeight))});d+=10;e+=10;c.each(function(b,c){var f=Math.round((d-c.offsetWidth)/2),g=Math.floor((e-c.offsetHeight)/2);a(c).css({"padding-left":f+"px","padding-right":d-c.offsetWidth-f+"px","padding-top":g+"px","padding-bottom":e-c.offsetHeight-g+"px"})})},setupEventHandlers:function setupEventHandlers(){a("fieldset#id_draggableitemheader").on("change input","input, select",function(b){var d=a(b.target).closest("select, input");if(d.hasClass("dragitemtype")){c.updateVisibilityOfFilePickers()}c.setOptionsForDragItemSelectors();if(d.is(".dragitemtype, .draggroup")){c.createDropZones()}else if(d.is(".draglabel")){c.updateDropZones()}});a("fieldset#id_dropzoneheader").on("change input","input, select",function(b){var d=a(b.target).closest("select, input");if(d.is("select")){c.createDropZones()}else{c.updateDropZones()}});a("fieldset#id_previewareaheader").on("mousedown touchstart",".droppreview",function(a){c.dragStart(a)});a(window).on("resize",function(){c.updateDropZones()})},updateVisibilityOfFilePickers:function updateVisibilityOfFilePickers(){for(var b=c.form.getFormValue("noitems",[]),d=0,e;d<b;d++){e=a("input#id_dragitem_"+d).closest(".fitem_ffilepicker");if("image"===c.form.getFormValue("drags",[d,"dragitemtype"])){e.show()}else{e.hide()}}},setOptionsForDragItemSelectors:function setOptionsForDragItemSelectors(){for(var b={0:""},d=c.form.getFormValue("noitems",[]),e=c.form.getFormValue("nodropzone",[]),f=0;f<d;f++){var g=c.form.getFormValue("draglabel",[f]),h=c.fp.file(c.form.toNameWithIndex("dragitem",[f]));if("image"===c.form.getFormValue("drags",[f,"dragitemtype"])&&null!==h.name){b[f+1]=f+1+". "+g+" ("+h.name+")"}else if(""!==g){b[f+1]=f+1+". "+g}}for(var i=0;i<e;i++){var j=a("#id_drops_"+i+"_choice"),k=j.val();j.find("option").remove();for(var l in b){if(!b.hasOwnProperty(l)){continue}j.append("<option value=\""+l+"\">"+b[l]+"</option>");var m=j.find("option[value=\""+l+"\"]");if(parseInt(l)===parseInt(k)){m.attr("selected",!0)}else if(c.isItemUsed(parseInt(l))){m.attr("disabled",!0)}}}},isItemUsed:function isItemUsed(b){if(0===b){return!1}if(c.form.getFormValue("drags",[b-1,"infinite"])){return!1}return 0!==a("fieldset#id_dropzoneheader select").filter(function(c,d){return parseInt(a(d).val())===b}).length},dragStart:function dragStart(d){var e=a(d.target).closest(".droppreview"),f=b.prepare(d);if(!f.start){return}b.start(d,e,function(a,b,d){c.dragMove(d)},function(){c.dragEnd()})},dragMove:function dragMove(b){var d=a("fieldset#id_previewareaheader .dropbackground"),e=d.offset(),f=b.data("dropNo"),g=b.offset(),h=Math.round(g.left-e.left),i=Math.round(g.top-e.top);h=Math.round(Math.max(0,Math.min(h,d.outerWidth()-b.outerWidth())));i=Math.round(Math.max(0,Math.min(i,d.outerHeight()-b.outerHeight())));c.form.setFormValue("drops",[f,"xleft"],h);c.form.setFormValue("drops",[f,"ytop"],i)},dragEnd:function dragEnd(){c.updateDropZones()},form:{toNameWithIndex:function toNameWithIndex(a,b){for(var c=a,d=0;d<b.length;d++){c=c+"["+b[d]+"]"}return c},getEl:function getEl(b,c){var d=a("form.mform[data-qtype=\"ddimageortext\"]")[0];return d.elements[this.toNameWithIndex(b,c)]},getFormValue:function getFormValue(a,b){var c=this.getEl(a,b);if(!c.type){c=c[c.length-1]}if("checkbox"===c.type){return c.checked}else{return c.value}},setFormValue:function setFormValue(a,b,c){var d=this.getEl(a,b);if("checkbox"===d.type){d.checked=c}else{d.value=c}}},filePickers:function filePickers(){var b,c;if(b===void 0){b={};c={};var d=a("form.mform[data-qtype=\"ddimageortext\"] input.filepickerhidden");d.each(function(a,d){b[d.value]=d.name;c[d.name]=d.parentNode})}return{file:function file(b){var d=a(c[b]),e=d.find("div.filepicker-filelist a");if(e.length){return{href:e.get(0).href,name:e.get(0).innerHTML}}else{return{href:null,name:null}}},name:function name(a){return b[a]}}}};return{init:c.init}});
define ("qtype_ddmarker/shapes",function(){"use strict";function a(a,b){this.x=a;this.y=b}a.prototype.toString=function(){return this.x+","+this.y};a.prototype.move=function(a,b){this.x+=a;this.y+=b};a.prototype.offset=function(b,c){if(b instanceof a){c=b.y;b=b.x}return new a(this.x+b,this.y+c)};a.parse=function(b){var c=b.split(",");if(2!==c.length){throw new Error(b+" is not a valid point")}return new a(Math.round(c[0]),Math.round(c[1]))};function b(b,c,d){this.label=b;this.centre=new a(c||0,d||0)}b.prototype.getType=function(){throw new Error("Not implemented.")};b.prototype.getCoordinates=function(){throw new Error("Not implemented.")};b.prototype.parse=function(a,b){void(a,b);throw new Error("Not implemented.")};b.prototype.move=function(){};b.prototype.edit=function(){};b.prototype.normalizeShape=function(){};b.prototype.makeSvg=function(){throw new Error("Not implemented.")};b.prototype.updateSvg=function(){};b.prototype.makeSimilarCircle=function(){throw new Error("Not implemented.")};b.prototype.makeSimilarRectangle=function(){throw new Error("Not implemented.")};b.prototype.makeSimilarPolygon=function(){throw new Error("Not implemented.")};b.prototype.getHandlePositions=function(){return null};function c(a,c,d,e){c=c||15;d=d||15;b.call(this,a,c,d);this.radius=e||15}c.prototype=new b;c.prototype.getType=function(){return"circle"};c.prototype.getCoordinates=function(){return this.centre+";"+Math.abs(this.radius)};c.prototype.makeSvg=function(a){var b=h(a,"circle");this.updateSvg(b);return b};c.prototype.updateSvg=function(a){a.childNodes[0].setAttribute("cx",this.centre.x);a.childNodes[0].setAttribute("cy",this.centre.y);a.childNodes[0].setAttribute("r",Math.abs(this.radius));a.childNodes[1].setAttribute("x",this.centre.x);a.childNodes[1].setAttribute("y",this.centre.y+15);a.childNodes[1].textContent=this.label};c.prototype.parse=function(b,c){if(!b.match(/^\d+(\.\d+)?,\d+(\.\d+)?;\d+(\.\d+)?$/)){return!1}var d=b.split(";");this.centre=a.parse(d[0]);this.centre.x=this.centre.x*parseFloat(c);this.centre.y=this.centre.y*parseFloat(c);this.radius=Math.round(d[1])*parseFloat(c);return!0};c.prototype.move=function(a,b,c,d){this.centre.move(a,b);if(this.centre.x<this.radius){this.centre.x=this.radius}if(this.centre.x>c-this.radius){this.centre.x=c-this.radius}if(this.centre.y<this.radius){this.centre.y=this.radius}if(this.centre.y>d-this.radius){this.centre.y=d-this.radius}};c.prototype.edit=function(a,b,c,d,e){this.radius+=b;var f=Math.min(this.centre.x,this.centre.y,d-this.centre.x,e-this.centre.y);if(this.radius>f){this.radius=f}if(this.radius<-f){this.radius=-f}};c.prototype.normalizeShape=function(){this.radius=Math.abs(this.radius)};c.prototype.makeSimilarRectangle=function(){return new d(this.label,this.centre.x-this.radius,this.centre.y-this.radius,2*this.radius,2*this.radius)};c.prototype.makeSimilarPolygon=function(){return new e(this.label,[this.centre.offset(-this.radius,-this.radius),this.centre.offset(-this.radius,this.radius),this.centre.offset(this.radius,this.radius),this.centre.offset(this.radius,-this.radius)])};c.prototype.getHandlePositions=function(){return{moveHandle:this.centre,editHandles:[this.centre.offset(this.radius,0)]}};function d(a,c,d,e,f){b.call(this,a,c,d);this.width=e||30;this.height=f||30}d.prototype=new b;d.prototype.getType=function(){return"rectangle"};d.prototype.getCoordinates=function(){return this.centre+";"+this.width+","+this.height};d.prototype.makeSvg=function(a){var b=h(a,"rect");this.updateSvg(b);return b};d.prototype.updateSvg=function(a){if(0<=this.width){a.childNodes[0].setAttribute("x",this.centre.x);a.childNodes[0].setAttribute("width",this.width)}else{a.childNodes[0].setAttribute("x",this.centre.x+this.width);a.childNodes[0].setAttribute("width",-this.width)}if(0<=this.height){a.childNodes[0].setAttribute("y",this.centre.y);a.childNodes[0].setAttribute("height",this.height)}else{a.childNodes[0].setAttribute("y",this.centre.y+this.height);a.childNodes[0].setAttribute("height",-this.height)}a.childNodes[1].setAttribute("x",this.centre.x+this.width/2);a.childNodes[1].setAttribute("y",this.centre.y+this.height/2+15);a.childNodes[1].textContent=this.label};d.prototype.parse=function(b,c){if(!b.match(/^\d+(\.\d+)?,\d+(\.\d+)?;\d+(\.\d+)?,\d+(\.\d+)?$/)){return!1}var d=b.split(";");this.centre=a.parse(d[0]);this.centre.x=this.centre.x*parseFloat(c);this.centre.y=this.centre.y*parseFloat(c);var e=a.parse(d[1]);this.width=e.x*parseFloat(c);this.height=e.y*parseFloat(c);return!0};d.prototype.move=function(a,b,c,d){this.centre.move(a,b);if(0>this.centre.x){this.centre.x=0}if(this.centre.x>c-this.width){this.centre.x=c-this.width}if(0>this.centre.y){this.centre.y=0}if(this.centre.y>d-this.height){this.centre.y=d-this.height}};d.prototype.edit=function(a,b,c,d,e){this.width+=b;this.height+=c;if(this.width<-this.centre.x){this.width=-this.centre.x}if(this.width>d-this.centre.x){this.width=d-this.centre.x}if(this.height<-this.centre.y){this.height=-this.centre.y}if(this.height>e-this.centre.y){this.height=e-this.centre.y}};d.prototype.normalizeShape=function(){if(0>this.width){this.centre.x+=this.width;this.width=-this.width}if(0>this.height){this.centre.y+=this.height;this.height=-this.height}};d.prototype.makeSimilarCircle=function(){return new c(this.label,Math.round(this.centre.x+this.width/2),Math.round(this.centre.y+this.height/2),Math.round((this.width+this.height)/4))};d.prototype.makeSimilarPolygon=function(){return new e(this.label,[this.centre,this.centre.offset(0,this.height),this.centre.offset(this.width,this.height),this.centre.offset(this.width,0)])};d.prototype.getHandlePositions=function(){return{moveHandle:this.centre.offset(this.width/2,this.height/2),editHandles:[this.centre.offset(this.width,this.height)]}};function e(c,d){b.call(this,c,0,0);this.points=d?d.slice():[new a(10,10),new a(40,10),new a(10,40)];this.normalizeShape();this.ratio=1}e.prototype=new b;e.prototype.getType=function(){return"polygon"};e.prototype.getCoordinates=function(){for(var a="",b=0;b<this.points.length;b++){a+=this.centre.offset(this.points[b])+";"}return a.slice(0,a.length-1)};e.prototype.makeSvg=function(a){var b=h(a,"polygon");this.updateSvg(b);return b};e.prototype.updateSvg=function(a){a.childNodes[0].setAttribute("points",this.getCoordinates().replace(/[,;]/g," "));a.childNodes[0].setAttribute("transform","scale("+parseFloat(this.ratio)+")");a.childNodes[1].setAttribute("x",this.centre.x);a.childNodes[1].setAttribute("y",this.centre.y+15);a.childNodes[1].textContent=this.label};e.prototype.parse=function(b,c){if(!b.match(/^\d+(\.\d+)?,\d+(\.\d+)?(?:;\d+(\.\d+)?,\d+(\.\d+)?)*$/)){return!1}for(var d=b.split(";"),e=[],f=0;f<d.length;f++){e.push(a.parse(d[f]))}this.points=e;this.centre.x=0;this.centre.y=0;this.ratio=c;this.normalizeShape();return!0};e.prototype.move=function(a,b,c,d){this.centre.move(a,b);for(var e=c,f=0,g=d,h=0,j=0;j<this.points.length;j++){e=Math.min(e,this.points[j].x);f=Math.max(f,this.points[j].x);g=Math.min(g,this.points[j].y);h=Math.max(h,this.points[j].y)}if(this.centre.x<-e){this.centre.x=-e}if(this.centre.x>c-f){this.centre.x=c-f}if(this.centre.y<-g){this.centre.y=-g}if(this.centre.y>d-h){this.centre.y=d-h}};e.prototype.edit=function(a,b,c,d,e){this.points[a].move(b,c);if(this.points[a].x<-this.centre.x){this.points[a].x=-this.centre.x}if(this.points[a].x>d-this.centre.x){this.points[a].x=d-this.centre.x}if(this.points[a].y<-this.centre.y){this.points[a].y=-this.centre.y}if(this.points[a].y>e-this.centre.y){this.points[a].y=e-this.centre.y}};e.prototype.addNewPointAfter=function(b){this.points.splice(b,0,new a(this.points[b].x,this.points[b].y))};e.prototype.normalizeShape=function(){var a,b=0,c=0;if(0===this.points.length){return}for(a=0;a<this.points.length;a++){b+=this.points[a].x;c+=this.points[a].y}b=Math.round(b/this.points.length);c=Math.round(c/this.points.length);if(0===b&&0===c){return}for(a=0;a<this.points.length;a++){this.points[a].move(-b,-c)}this.centre.move(b,c)};e.prototype.makeSimilarCircle=function(){return this.makeSimilarRectangle().makeSimilarCircle()};e.prototype.makeSimilarRectangle=function(){for(var a,b=0,c=0,e=0,f=0,g=0;g<this.points.length;g++){a=this.points[g];b=Math.min(b,a.x);c=Math.max(c,a.x);e=Math.min(e,a.y);f=Math.max(f,a.y)}return new d(this.label,this.centre.x+b,this.centre.y+e,Math.max(c-b,10),Math.max(f-e,10))};e.prototype.getHandlePositions=function(){for(var a=[],b=0;b<this.points.length;b++){a.push(this.points[b].offset(this.centre.x,this.centre.y))}this.centre.x=this.centre.x*parseFloat(this.ratio);this.centre.y=this.centre.y*parseFloat(this.ratio);return{moveHandle:this.centre,editHandles:a}};function f(a){b.call(this,a)}f.prototype=new b;f.prototype.getType=function(){return"null"};f.prototype.getCoordinates=function(){return""};f.prototype.makeSvg=function(){return null};f.prototype.updateSvg=function(){};f.prototype.parse=function(){return!1};f.prototype.makeSimilarCircle=function(){return new c(this.label)};f.prototype.makeSimilarRectangle=function(){return new d(this.label)};f.prototype.makeSimilarPolygon=function(){return new e(this.label)};function g(a,b){var c=a.ownerDocument.createElementNS("http://www.w3.org/2000/svg",b);a.appendChild(c);return c}function h(a,b){var c=g(a,"g");g(c,b).setAttribute("class","shape");g(c,"text").setAttribute("class","shapeLabel");return c}return{Point:a,Shape:b,Circle:c,Rectangle:d,Polygon:e,NullShape:f,createSvgElement:g,make:function make(a,b){switch(a){case"circle":return new c(b);case"rectangle":return new d(b);case"polygon":return new e(b);default:return new f(b);}},getSimilar:function getSimilar(a,b){if(a===b.getType()){return b}switch(a){case"circle":return b.makeSimilarCircle();case"rectangle":return b.makeSimilarRectangle();case"polygon":return b.makeSimilarPolygon();default:return new f(b.label);}}}});
define ("qtype_ddmarker/question",["jquery","core/dragdrop","qtype_ddmarker/shapes","core/key_codes"],function(a,b,c,d){"use strict";function e(a,b,c){var d=this;this.containerId=a;this.visibleDropZones=c;this.shapes=[];this.shapeSVGs=[];this.isPrinting=!1;if(b){this.getRoot().addClass("qtype_ddmarker-readonly")}d.cloneDrags();d.repositionDrags();d.drawDropzones()}e.prototype.drawDropzones=function(){if(0<this.visibleDropZones.length){var a=this.bgImage();this.getRoot().find("div.dropzones").html("<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"dropzones\" width=\""+a.outerWidth()+"\" height=\""+a.outerHeight()+"\"></svg>");for(var b=this.getRoot().find("svg.dropzones"),c=0,d=0,e;d<this.visibleDropZones.length;d++){e="color"+c;c=(c+1)%8;this.addDropzone(b,d,e)}}};e.prototype.addDropzone=function(a,b,d){var e=this.visibleDropZones[b],f=c.make(e.shape,""),g,h=this.bgRatio();if(!f.parse(e.coords,h)){return}g=this.getRoot().find("div.markertexts span.markertext"+b);if(g.length){if(""!==e.markertext){g.html(e.markertext)}else{g.remove()}}else if(""!==e.markertext){this.getRoot().find("div.markertexts").append("<span class=\""+("markertext markertext"+b)+"\">"+e.markertext+"</span>");var i=this.getRoot().find("div.ddarea div.markertexts span.markertext"+b);if(i.length){var j=f.getHandlePositions(),k=j.moveHandle.x-i.outerWidth()/2-4,l=j.moveHandle.y-i.outerHeight()/2;i.css("left",k).css("top",l);i.data("originX",i.position().left/h).data("originY",i.position().top/h);this.handleElementScale(i,"center")}}var m=f.makeSvg(a[0]);m.setAttribute("class","dropzone "+d);this.shapes[this.shapes.length]=f;this.shapeSVGs[this.shapeSVGs.length]=m};e.prototype.repositionDrags=function(){var b=this.getRoot(),c=this;b.find("div.draghomes .marker").not(".dragplaceholder").each(function(b,c){a(c).addClass("unneeded")});b.find("input.choices").each(function(a,b){var d=c.getChoiceNoFromElement(b),e=c.getCoords(b);if(e.length){var f=c.getRoot().find(".draghomes span.marker.choice"+d).not(".dragplaceholder");f.remove();for(var g=0,h;g<e.length;g++){h=f.clone();h.data("pagex",e[g].x).data("pagey",e[g].y);c.sendDragToDrop(h,!1)}c.getDragClone(f).addClass("active");c.cloneDragIfNeeded(f)}})};e.prototype.getCoords=function(b){var d=[],e=a(b).val();if(""!==e){for(var f=e.split(";"),g=0;g<f.length;g++){d[g]=this.convertToWindowXY(c.Point.parse(f[g]))}}return d};e.prototype.convertToWindowXY=function(a){var b=this.bgImage();return a.offset(b.offset().left+1,b.offset().top+1)};e.prototype.convertToBgImgXY=function(a){var b=this.bgImage();return a.offset(-b.offset().left-1,-b.offset().top-1)};e.prototype.coordsInBgImg=function(a){var b=this.bgImage(),c=b.offset();return a.x>=c.left&&a.x<c.left+b.width()&&a.y>=c.top&&a.y<c.top+b.height()};e.prototype.getRoot=function(){return a(document.getElementById(this.containerId))};e.prototype.bgImage=function(){return this.getRoot().find("img.dropbackground")};e.prototype.handleDragStart=function(c){var d=this,e=a(c.target).closest(".marker"),f=b.prepare(c);if(!f.start){return}e.addClass("beingdragged").css("transform","");var g=!e.hasClass("unneeded");if(!g){var h=d.getDragClone(e);if(h.length){h.addClass("active");e.offset(h.offset())}}b.start(c,e,function(){},function(a,b,c){d.dragEnd(c)})};e.prototype.dragEnd=function(a){var b=!1,d=this.getChoiceNoFromElement(a),e=this.bgRatio(),f;a.data("pagex",a.offset().left).data("pagey",a.offset().top);f=new c.Point(a.data("pagex"),a.data("pagey"));if(this.coordsInBgImg(f)){this.sendDragToDrop(a,!0);b=!0;var g=this.convertToBgImgXY(f);g=new c.Point(g.x/e,g.y/e);a.data("originX",g.x).data("originY",g.y)}if(!b){this.sendDragHome(a);this.removeDragIfNeeded(a)}else{this.cloneDragIfNeeded(a)}this.saveCoordsForChoice(d)};e.prototype.saveCoordsForChoice=function(b){var d=[],e=this.getRoot().find("div.droparea span.marker.choice"+b),f=this,g=this.bgRatio();if(e.length){e.each(function(){var b=a(this);if(!b.hasClass("beingdragged")){if(b.data("scaleRatio")!==g){b.data("pagex",b.offset().left).data("pagey",b.offset().top)}var e=new c.Point(b.data("pagex"),b.data("pagey"));if(f.coordsInBgImg(e)){var h=f.convertToBgImgXY(e);h=new c.Point(h.x/g,h.y/g);d[d.length]=h}}})}this.getRoot().find("input.choice"+b).val(d.join(";"))};e.prototype.handleKeyPress=function(b){var e=a(b.target).closest(".marker"),f=new c.Point(e.offset().left,e.offset().top),g=this.getChoiceNoFromElement(e);switch(b.keyCode){case d.arrowLeft:case 65:f.x-=1;break;case d.arrowRight:case 68:f.x+=1;break;case d.arrowDown:case 83:f.y+=1;break;case d.arrowUp:case 87:f.y-=1;break;case d.space:case d.escape:f=null;break;default:return;}b.preventDefault();if(null!==f){f=this.constrainToBgImg(f);e.offset({left:f.x,top:f.y});e.data("pagex",e.offset().left).data("pagey",e.offset().top);var h=this.convertToBgImgXY(new c.Point(e.data("pagex"),e.data("pagey")));e.data("originX",h.x/this.bgRatio()).data("originY",h.y/this.bgRatio());if(this.coordsInBgImg(new c.Point(e.offset().left,e.offset().top))){if(e.hasClass("unneeded")){this.sendDragToDrop(e,!0);var i=this.getDragClone(e);if(i.length){i.addClass("active")}this.cloneDragIfNeeded(e)}}}else{e.css("left","").css("top","");e.data("pagex",e.offset().left).data("pagey",e.offset().top);this.sendDragHome(e);this.removeDragIfNeeded(e)}e.focus();this.saveCoordsForChoice(g)};e.prototype.constrainToBgImg=function(a){var b=this.bgImage(),c=this.convertToBgImgXY(a);c.x=Math.max(0,c.x);c.y=Math.max(0,c.y);c.x=Math.min(b.width(),c.x);c.y=Math.min(b.height(),c.y);return this.convertToWindowXY(c)};e.prototype.getChoiceNoFromElement=function(a){return+this.getClassnameNumericSuffix(a,"choice")};e.prototype.getClassnameNumericSuffix=function(b,c){var d=a(b).attr("class");if(d!==void 0&&""!==d){for(var e=d.split(" "),f=0,g;f<e.length;f++){g=new RegExp("^"+c+"([0-9])+$");if(g.test(e[f])){var h=/([0-9])+$/.exec(e[f]);return+h[0]}}}return null};e.prototype.handleResize=function(){var b=this,c=this.bgRatio();if(this.isPrinting){c=1}this.getRoot().find("div.droparea .marker").not(".beingdragged").each(function(d,e){a(e).css("left",parseFloat(a(e).data("originX"))*parseFloat(c)).css("top",parseFloat(a(e).data("originY"))*parseFloat(c));b.handleElementScale(e,"left top")});this.getRoot().find("div.droparea svg.dropzones").width(this.bgImage().width()).height(this.bgImage().height());for(var d=0;d<this.visibleDropZones.length;d++){var e=b.visibleDropZones[d],f=e.coords,g=b.shapes[d],h=b.shapeSVGs[d];g.parse(f,c);g.updateSvg(h);var i=g.getHandlePositions(),j=this.getRoot().find("div.ddarea div.markertexts span.markertext"+d);j.css("left",i.moveHandle.x-j.outerWidth()/2-4).css("top",i.moveHandle.y-j.outerHeight()/2);b.handleElementScale(j,"center")}};e.prototype.cloneDrags=function(){var b=this;this.getRoot().find("div.draghomes span.marker").each(function(c,d){var e=a(d),f=e.clone();f.removeClass();f.addClass("marker");f.addClass("choice"+b.getChoiceNoFromElement(e));f.addClass(b.getDragNoClass(e,!1));f.addClass("dragplaceholder");e.before(f)})};e.prototype.getDragNo=function(a){return this.getClassnameNumericSuffix(a,"dragno")};e.prototype.getDragNoClass=function(a,b){var c="dragno"+this.getDragNo(a);if(this.isInfiniteDrag(a)){c="infinite"}if(b){return"."+c}return c};e.prototype.getDragClone=function(a){return this.getRoot().find(".draghomes span.marker.choice"+this.getChoiceNoFromElement(a)+this.getDragNoClass(a,!0)+".dragplaceholder")};e.prototype.dropArea=function(){return this.getRoot().find("div.droparea")};e.prototype.sendDragHome=function(a){a.removeClass("beingdragged").addClass("unneeded").css("top","").css("left","").css("transform","");var b=this.getDragClone(a);b.after(a);b.removeClass("active")};e.prototype.sendDragToDrop=function(a,b){var d=this.dropArea(),e=this.bgRatio();a.removeClass("beingdragged").removeClass("unneeded");var f=this.convertToBgImgXY(new c.Point(a.data("pagex"),a.data("pagey")));if(b){a.data("originX",f.x/e).data("originY",f.y/e);a.css("left",f.x).css("top",f.y)}else{a.data("originX",f.x).data("originY",f.y);a.css("left",f.x*e).css("top",f.y*e)}a.data("scaleRatio",e);d.append(a);this.handleElementScale(a,"left top")};e.prototype.cloneDragIfNeeded=function(a){var b=this.getInput(a),c=+this.getClassnameNumericSuffix(b,"noofdrags"),d=this.getRoot().find("div.droparea .marker.choice"+this.getChoiceNoFromElement(a)+this.getDragNoClass(a,!0)).length,e=this.getRoot().find("div.draghomes .marker.choice"+this.getChoiceNoFromElement(a)+this.getDragNoClass(a,!0)).not(".dragplaceholder").length;if((this.isInfiniteDrag(a)||!this.isInfiniteDrag(a)&&d<c)&&0===e){var g=a.clone();g.addClass("unneeded").css("top","").css("left","").css("transform","");this.getDragClone(a).removeClass("active").after(g);f.addEventHandlersToMarker(g)}};e.prototype.removeDragIfNeeded=function(a){var b=this.getRoot().find("div.draghomes .marker.choice"+this.getChoiceNoFromElement(a)+this.getDragNoClass(a,!0)).not(".dragplaceholder"),c=b.length;while(1<c){b.first().remove();c--}};e.prototype.getInput=function(a){var b=this.getChoiceNoFromElement(a);return this.getRoot().find("input.choices.choice"+b)};e.prototype.bgRatio=function(){var a=this.bgImage(),b=a.get(0).naturalWidth,c=a.width();return c/b};e.prototype.handleElementScale=function(b,c){var d=parseFloat(this.bgRatio());if(this.isPrinting){d=1}a(b).css({"-webkit-transform":"scale("+d+")","-moz-transform":"scale("+d+")","-ms-transform":"scale("+d+")","-o-transform":"scale("+d+")",transform:"scale("+d+")","transform-origin":c})};e.prototype.isInfiniteDrag=function(a){return a.hasClass("infinite")};var f={eventHandlersInitialised:!1,isPrinting:!1,isKeyboardNavigation:!1,questions:{},init:function init(a,b,c){f.questions[a]=new e(a,b,c);if(!f.eventHandlersInitialised){f.setupEventHandlers();f.eventHandlersInitialised=!0}},setupEventHandlers:function setupEventHandlers(){f.addEventHandlersToMarker(a(".que.ddmarker:not(.qtype_ddmarker-readonly) div.draghomes .marker"));f.addEventHandlersToMarker(a(".que.ddmarker:not(.qtype_ddmarker-readonly) div.droparea .marker"));a(window).on("resize",function(){f.handleWindowResize(!1)});window.addEventListener("beforeprint",function(){f.isPrinting=!0;f.handleWindowResize(f.isPrinting)});window.addEventListener("afterprint",function(){f.isPrinting=!1;f.handleWindowResize(f.isPrinting)});setTimeout(function(){f.fixLayoutIfThingsMoved()},100)},addEventHandlersToMarker:function addEventHandlersToMarker(a){a.on("mousedown touchstart",f.handleDragStart).on("keydown keypress",f.handleKeyPress).focusin(function(a){f.handleKeyboardFocus(a,!0)}).focusout(function(a){f.handleKeyboardFocus(a,!1)})},handleDragStart:function handleDragStart(a){a.preventDefault();var b=f.getQuestionForEvent(a);if(b){b.handleDragStart(a)}},handleKeyPress:function handleKeyPress(a){var b=f.getQuestionForEvent(a);if(b){b.handleKeyPress(a)}},handleWindowResize:function handleWindowResize(a){for(var b in f.questions){if(f.questions.hasOwnProperty(b)){f.questions[b].isPrinting=a;f.questions[b].handleResize()}}},handleKeyboardFocus:function handleKeyboardFocus(a,b){f.isKeyboardNavigation=b},fixLayoutIfThingsMoved:function fixLayoutIfThingsMoved(){if(!f.isKeyboardNavigation){this.handleWindowResize(f.isPrinting)}setTimeout(function(){f.fixLayoutIfThingsMoved(f.isPrinting)},100)},getQuestionForEvent:function getQuestionForEvent(b){var c=a(b.currentTarget).closest(".que.ddmarker").attr("id");return f.questions[c]}};return{init:f.init}});
define ("qtype_ddmarker/form",["jquery","core/dragdrop","qtype_ddmarker/shapes"],function(a,b,c){"use strict";function d(a){this.dropzoneNo=a;this.svgEl=null;this.shape=c.make(this.getShapeType(),this.getLabel());this.updateCoordinatesFromForm()}d.prototype.updateCoordinatesFromForm=function(a){var b=this.getCoordinates(),c="polygon"===this.shape.getType()&&this.shape.points.length;if(this.shape.getCoordinates()===b){return}if(!this.shape.parse(b,1)){return}if("polygon"===this.shape.getType()&&c!==this.shape.points.length){var d=this.isActive();this.removeFromSvg();if(a){this.addToSvg(a);if(d){this.setActive()}}}else{this.updateSvgEl()}this.setCoordinatesInForm()};d.prototype.updateLabel=function(){var a=this.getLabel();if(this.shape.label!==a){this.shape.label=a;this.updateSvgEl()}};d.prototype.changeShape=function(a){var b=this.getShapeType(),d=this.isActive();if(b===this.shape.getType()){return}this.removeFromSvg();this.shape=c.getSimilar(b,this.shape);if(a){this.addToSvg(a);if(d){this.setActive()}}this.setCoordinatesInForm()};d.prototype.addToSvg=function(a){if(null!==this.svgEl){throw new Error("this.svgEl already set")}this.svgEl=this.shape.makeSvg(a);if(!this.svgEl){return}this.svgEl.setAttribute("class","dropzone");this.svgEl.setAttribute("data-dropzone-no",this.dropzoneNo);var b=this.shape.getHandlePositions();if(null===b){return}var d=c.createSvgElement(this.svgEl,"circle");d.setAttribute("cx",b.moveHandle.x);d.setAttribute("cy",b.moveHandle.y);d.setAttribute("r",7);d.setAttribute("class","handle move");for(var e=0;e<b.editHandles.length;++e){this.makeEditHandle(e,b.editHandles[e])}};d.prototype.makeEditHandle=function(a,b){var d=c.createSvgElement(this.svgEl,"rect");d.setAttribute("x",b.x-6);d.setAttribute("y",b.y-6);d.setAttribute("width",11);d.setAttribute("height",11);d.setAttribute("class","handle edit");d.setAttribute("data-edit-handle-no",a)};d.prototype.removeFromSvg=function(){if(null!==this.svgEl){this.svgEl.parentNode.removeChild(this.svgEl);this.svgEl=null}};d.prototype.updateSvgEl=function(){if(null===this.svgEl){return}this.shape.updateSvg(this.svgEl);var a=this.shape.getHandlePositions();if(null===a){return}this.svgEl.childNodes[2].setAttribute("cx",a.moveHandle.x);this.svgEl.childNodes[2].setAttribute("cy",a.moveHandle.y);for(var b=0;b<a.editHandles.length;++b){this.svgEl.childNodes[3+b].setAttribute("x",a.editHandles[b].x-6);this.svgEl.childNodes[3+b].setAttribute("y",a.editHandles[b].y-6)}};d.prototype.isActive=function(){return null!==this.svgEl&&this.svgEl.getAttribute("class").match(/\bactive\b/)};d.prototype.setActive=function(){var a=this.svgEl.parentNode;a.removeChild(this.svgEl);a.appendChild(this.svgEl);this.svgEl.setAttribute("class",this.svgEl.getAttribute("class")+" active")};d.prototype.setCoordinatesInForm=function(){f.form.setFormValue("drops",[this.dropzoneNo,"coords"],this.shape.getCoordinates())};d.prototype.getCoordinates=function(){return f.form.getFormValue("drops",[this.dropzoneNo,"coords"]).replace(/\s*/g,"")};d.prototype.getChoiceNo=function(){return f.form.getFormValue("drops",[this.dropzoneNo,"choice"])};d.prototype.getLabel=function(){return f.form.getMarkerText(this.getChoiceNo())};d.prototype.getShapeType=function(){return f.form.getFormValue("drops",[this.dropzoneNo,"shape"])};d.prototype.handleMove=function(c){var d=b.prepare(c);if(!d.start){return}var e=this,f=d.x,g=d.y,h=this.makeDragProxy(d.x,d.y),i=a("fieldset#id_previewareaheader .dropbackground"),j=i.width(),k=i.height();b.start(c,a(h),function(a,b){e.shape.move(a-f,b-g,j,k);f=a;g=b;e.updateSvgEl();e.setCoordinatesInForm()},function(){document.body.removeChild(h)})};d.prototype.handleEdit=function(c,d,e){var f=b.prepare(c);if(!f.start){return}if("polygon"===this.shape.getType()&&(c.ctrlKey||c.metaKey)){this.shape.addNewPointAfter(d);this.removeFromSvg();this.addToSvg(e);this.setActive()}var g=this,h=f.x,i=f.y,j=this.makeDragProxy(f.x,f.y),k=a("fieldset#id_previewareaheader .dropbackground"),l=k.width(),m=k.height();b.start(c,a(j),function(a,b){g.shape.edit(d,a-h,b-i,l,m);h=a;i=b;g.updateSvgEl();g.setCoordinatesInForm()},function(){document.body.removeChild(j);g.shape.normalizeShape();g.updateSvgEl();g.setCoordinatesInForm()})};d.prototype.makeDragProxy=function(a,b){var c=document.createElement("div");c.style.position="absolute";c.style.top=b+"px";c.style.left=a+"px";c.style.width="1px";c.style.height="1px";document.body.appendChild(c);return c};var f={fp:null,noDropZones:null,dropZones:[],init:function init(){f.fp=f.filePickers();f.noDropZones=f.form.getFormValue("nodropzone",[]);f.setupPreviewArea();f.setOptionsForDragItemSelectors();f.createShapes();f.setupEventHandlers();f.waitForFilePickerToInitialise()},setupPreviewArea:function setupPreviewArea(){a("fieldset#id_previewareaheader div.fcontainer").append("<div class=\"ddarea que ddmarker\">   <div id=\"ddm-droparea\" class=\"droparea\">       <img class=\"dropbackground\" />       <div id=\"ddm-dropzone\" class=\"dropzones\">       </div>   </div></div>")},setOptionsForDragItemSelectors:function setOptionsForDragItemSelectors(){var b={0:""},c=f.form.getFormValue("noitems",[]),d=[],e,g,h;for(g=1;g<=c;g++){h=f.form.getMarkerText(g);if(""!==h){b[g]=a("<div/>").text(h).html()}}for(g=0;g<f.noDropZones;g++){e=a("#id_drops_"+g+"_choice");d[g]=+e.val()}for(g=0;g<f.noDropZones;g++){e=a("#id_drops_"+g+"_choice");e.find("option").remove();for(var j in b){j=+j;var l="<option value=\""+j+"\">"+b[j]+"</option>";e.append(l);var m=e.find("option[value=\""+j+"\"]");if(0===j){continue}if(j===d[g]){m.attr("selected",!0);continue}var n=f.form.getFormValue("drags",[j-1,"noofdrags"]);if(0===+n){continue}for(var o in d){if(+d[o]!==j){continue}if(1===+n){m.attr("disabled",!0);break}else{n--}}}if(0<f.dropZones.length){f.dropZones[g].updateLabel()}}},createShapes:function createShapes(){for(var a=0;a<f.noDropZones;a++){f.dropZones[a]=new d(a)}},setupEventHandlers:function setupEventHandlers(){a("fieldset#id_draggableitemheader").on("change input","input, select",function(){f.setOptionsForDragItemSelectors()});a("fieldset#id_dropzoneheader").on("change input","input, select",function(a){var b=a.currentTarget.name.match(/^drops\[(\d+)]\[([a-z]*)]$/);if(!b){return}var c=b[1],d=b[2],e=f.dropZones[c];switch(d){case"shape":e.changeShape(f.form.getSvg());break;case"coords":e.updateCoordinatesFromForm(f.form.getSvg());break;case"choice":e.updateLabel();break;}});var b=a("fieldset#id_previewareaheader");b.on("click","g.dropzone",function(b){var c=a(b.currentTarget).data("dropzone-no"),d=f.dropZones[c].isActive();a(f.form.getSvg()).find(".dropzone.active").removeClass("active");if(!d){f.dropZones[c].setActive()}});b.on("mousedown touchstart",".dropzone .handle.move",function(b){var c=a(b.currentTarget).closest("g").data("dropzoneNo");f.dropZones[c].handleMove(b)});b.on("mousedown touchstart",".dropzone .handle.edit",function(b){var c=a(b.currentTarget).closest("g").data("dropzoneNo"),d=b.currentTarget.getAttribute("data-edit-handle-no");f.dropZones[c].handleEdit(b,d,f.form.getSvg())})},waitForFilePickerToInitialise:function waitForFilePickerToInitialise(){if(null===f.fp.file("bgimage").href){setTimeout(f.waitForFilePickerToInitialise,1e3);return}a("form.mform[data-qtype=\"ddmarker\"]").on("change","#id_bgimage",f.loadPreviewImage);f.loadPreviewImage()},loadPreviewImage:function loadPreviewImage(){a("fieldset#id_previewareaheader .dropbackground").one("load",f.afterPreviewImageLoaded).attr("src",f.fp.file("bgimage").href)},afterPreviewImageLoaded:function afterPreviewImageLoaded(){var b=a("fieldset#id_previewareaheader .dropbackground");a("#ddm-dropzone").css("position","relative").css("top",-1*(b.height()+1));a("#ddm-droparea").css("height",b.height()+20);f.updateSvgDisplay()},updateSvgDisplay:function updateSvgDisplay(){var b=a("fieldset#id_previewareaheader .dropbackground"),c;if(f.form.getSvg()){for(c=0;c<f.noDropZones;c++){f.dropZones[c].updateSvgEl()}}else{a("#ddm-dropzone").html("<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"dropzones\" width=\""+b.outerWidth()+"\" height=\""+b.outerHeight()+"\"></svg>");for(c=0;c<f.noDropZones;c++){f.dropZones[c].addToSvg(f.form.getSvg())}}},form:{getMarkerText:function getMarkerText(a){if(0!==+a){var b=f.form.getFormValue("drags",[a-1,"label"]);return b.replace(/^\s*(.*)\s*$/,"$1")}else{return""}},getSvg:function getSvg(){var b=a("fieldset#id_previewareaheader svg");if(0===b.length){return null}else{return b[0]}},toNameWithIndex:function toNameWithIndex(a,b){for(var c=a,d=0;d<b.length;d++){c=c+"["+b[d]+"]"}return c},getEl:function getEl(b,c){var d=a("form.mform[data-qtype=\"ddmarker\"]")[0];return d.elements[this.toNameWithIndex(b,c)]},getFormValue:function getFormValue(a,b){var c=this.getEl(a,b);if("checkbox"===c.type){return c.checked}else{return c.value}},setFormValue:function setFormValue(a,b,c){var d=this.getEl(a,b);if("checkbox"===d.type){d.checked=c}else{d.value=c}}},filePickers:function filePickers(){var b,c;if(b===void 0){b={};c={};a("form.mform input.filepickerhidden").each(function(a,d){b[d.value]=d.name;c[d.name]=d.parentNode})}return{file:function file(b){var d=a(c[b]).find("div.filepicker-filelist a");if(d.length){return{href:d.get(0).href,name:d.get(0).innerHTML}}else{return{href:null,name:null}}},name:function name(a){return b[a]}}}};return{init:f.init}});
define ("qtype_ddwtos/ddwtos",["jquery","core/dragdrop","core/key_codes"],function(a,b,c){"use strict";function d(a,b){this.containerId=a;if(b){this.getRoot().addClass("qtype_ddwtos-readonly")}this.resizeAllDragsAndDrops();this.cloneDrags();this.positionDrags()}d.prototype.resizeAllDragsAndDrops=function(){var b=this;this.getRoot().find(".answercontainer > div").each(function(c,d){b.resizeAllDragsAndDropsInGroup(b.getClassnameNumericSuffix(a(d),"draggrouphomes"))})};d.prototype.resizeAllDragsAndDropsInGroup=function(a){var b=this,c=this.getRoot().find(".draggrouphomes"+a+" span.draghome"),d=0,e=0;c.each(function(a,b){d=Math.max(d,Math.ceil(b.offsetWidth));e=Math.max(e,Math.ceil(0+b.offsetHeight))});d+=8;e+=2;c.each(function(a,c){b.setElementSize(c,d,e)});this.getRoot().find("span.drop.group"+a).each(function(a,c){b.setElementSize(c,d,e)})};d.prototype.setElementSize=function(b,c,d){a(b).width(c).height(d).css("lineHeight",d+"px")};d.prototype.cloneDrags=function(){var b=this;b.getRoot().find("span.draghome").each(function(c,d){var e=a(d),f=e.clone();f.removeClass();f.addClass("draghome choice"+b.getChoice(e)+" group"+b.getGroup(e)+" dragplaceholder");e.before(f)})};d.prototype.positionDrags=function(){var b=this,c=this.getRoot();c.find("span.draghome").not(".dragplaceholder").each(function(c,d){var e=a(d),f=b.getClassnameNumericSuffix(e,"inplace");e.addClass("unplaced").removeClass("placed");e.removeAttr("tabindex");if(null!==f){e.removeClass("inplace"+f)}});c.find("input.placeinput").each(function(d,e){var g=a(e),h=g.val(),i=b.getPlace(g),j=c.find(".drop.place"+i),k=j.offset();j.data("prev-top",k.top).data("prev-left",k.left);if("0"===h){return}var l=b.getUnplacedChoice(b.getGroup(g),h),m=b.getDragClone(l);if(m.length){if(l.hasClass("infinite")){var n=b.noOfDropsInGroup(b.getGroup(l)),o=b.getInfiniteDragClones(l,!1);if(o.length<n){var p=l.clone();m.after(p);f.addEventHandlersToDrag(p)}else{m.addClass("active")}}else{m.addClass("active")}}b.sendDragToDrop(b.getUnplacedChoice(b.getGroup(g),h),j)})};d.prototype.handleDragStart=function(c){var d=this,e=a(c.target).closest(".draghome"),g=b.prepare(c);if(!g.start){return}e.addClass("beingdragged");var h=this.getClassnameNumericSuffix(e,"inplace");if(null!==h){this.setInputValue(h,0);e.removeClass("inplace"+h);var i=d.getDrop(e,h);if(i.length){i.addClass("active");e.offset(i.offset())}}else{var j=d.getDragClone(e);if(j.length){if(e.hasClass("infinite")){var k=this.noOfDropsInGroup(this.getGroup(e)),l=this.getInfiniteDragClones(e,!1);if(l.length<k){var m=e.clone();m.removeClass("beingdragged");j.after(m);f.addEventHandlersToDrag(m);e.offset(m.offset())}else{j.addClass("active");e.offset(j.offset())}}else{j.addClass("active");e.offset(j.offset())}}}b.start(c,e,function(a,b,c){d.dragMove(a,b,c)},function(a,b,c){d.dragEnd(a,b,c)})};d.prototype.dragMove=function(b,c,d){var e=this;this.getRoot().find("span.drop.group"+this.getGroup(d)).each(function(d,f){var g=a(f);if(e.isPointInDrop(b,c,g)){g.addClass("valid-drag-over-drop")}else{g.removeClass("valid-drag-over-drop")}});this.getRoot().find("span.draghome.placed.group"+this.getGroup(d)).not(".beingdragged").each(function(f,g){var h=a(g);if(e.isPointInDrop(b,c,h)&&!e.isDragSameAsDrop(d,h)){h.addClass("valid-drag-over-drop")}else{h.removeClass("valid-drag-over-drop")}})};d.prototype.dragEnd=function(b,c,d){var e=this,f=this.getRoot(),g=!1;f.find("span.drop.group"+this.getGroup(d)).each(function(f,h){var i=a(h);if(!e.isPointInDrop(b,c,i)){return!0}i.removeClass("valid-drag-over-drop");e.sendDragToDrop(d,i);g=!0;return!1});f.find("span.draghome.placed.group"+this.getGroup(d)).not(".beingdragged").each(function(f,h){var i=a(h);if(!e.isPointInDrop(b,c,i)||e.isDragSameAsDrop(d,i)){return!0}i.removeClass("valid-drag-over-drop");var j=e.getClassnameNumericSuffix(i,"inplace"),k=e.getDrop(d,j);e.sendDragToDrop(d,k);g=!0;return!1});if(!g){this.sendDragHome(d)}};d.prototype.sendDragToDrop=function(a,b){var c=this.getCurrentDragInPlace(this.getPlace(b));if(0!==c.length){var d=this.getClassnameNumericSuffix(c,"inplace"),e=this.getDrop(c,d);e.addClass("active");c.addClass("beingdragged");c.offset(e.offset());this.sendDragHome(c)}if(0===a.length){this.setInputValue(this.getPlace(b),0);if(b.data("isfocus")){b.focus()}}else{this.setInputValue(this.getPlace(b),this.getChoice(a));a.removeClass("unplaced").addClass("placed inplace"+this.getPlace(b));a.attr("tabindex",0);this.animateTo(a,b)}};d.prototype.sendDragHome=function(a){var b=this.getClassnameNumericSuffix(a,"inplace");if(null!==b){a.removeClass("inplace"+b)}a.data("unplaced",!0);this.animateTo(a,this.getDragHome(this.getGroup(a),this.getChoice(a)))};d.prototype.handleKeyPress=function(b){var d=a(b.target).closest(".drop");if(0===d.length){var e=a(b.target),g=this.getClassnameNumericSuffix(e,"inplace");if(null!==g){d=this.getDrop(e,g)}}var h=this.getCurrentDragInPlace(this.getPlace(d)),i=a();switch(b.keyCode){case c.space:case c.arrowRight:case c.arrowDown:i=this.getNextDrag(this.getGroup(d),h);break;case c.arrowLeft:case c.arrowUp:i=this.getPreviousDrag(this.getGroup(d),h);break;case c.escape:break;default:f.isKeyboardNavigation=!1;return;}if(i.length){i.data("isfocus",!0);i.addClass("beingdragged");var j=this.getDragClone(i);if(j.length){if(i.hasClass("infinite")){var k=this.noOfDropsInGroup(this.getGroup(i)),l=this.getInfiniteDragClones(i,!1);if(l.length<k){var m=i.clone();m.removeClass("beingdragged");m.removeAttr("tabindex");j.after(m);f.addEventHandlersToDrag(m);i.offset(m.offset())}else{j.addClass("active");i.offset(j.offset())}}else{j.addClass("active");i.offset(j.offset())}}}else{d.data("isfocus",!0)}b.preventDefault();this.sendDragToDrop(i,d)};d.prototype.getNextDrag=function(a,b){var c,d=this.noOfChoicesInGroup(a);if(0===b.length){c=1}else{c=this.getChoice(b)+1}var e=this.getUnplacedChoice(a,c);while(0===e.length&&c<d){c++;e=this.getUnplacedChoice(a,c)}return e};d.prototype.getPreviousDrag=function(a,b){var c;if(0===b.length){c=this.noOfChoicesInGroup(a)}else{c=this.getChoice(b)-1}var d=this.getUnplacedChoice(a,c);while(0===d.length&&1<c){c--;d=this.getUnplacedChoice(a,c)}return d};d.prototype.animateTo=function(b,c){var d=b.offset(),e=c.offset(),f=this;M.util.js_pending("qtype_ddwtos-animate-"+f.containerId);b.animate({left:parseInt(b.css("left"))+e.left-d.left,top:parseInt(b.css("top"))+e.top-d.top},{duration:"fast",done:function done(){a("body").trigger("qtype_ddwtos-dragmoved",[b,c,f]);M.util.js_complete("qtype_ddwtos-animate-"+f.containerId)}})};d.prototype.isPointInDrop=function(a,b,c){var d=c.offset();return a>=d.left&&a<d.left+c.width()&&b>=d.top&&b<d.top+c.height()};d.prototype.setInputValue=function(a,b){this.getRoot().find("input.placeinput.place"+a).val(b)};d.prototype.getRoot=function(){return a(document.getElementById(this.containerId))};d.prototype.getDragHome=function(a,b){if(!this.getRoot().find(".draghome.dragplaceholder.group"+a+".choice"+b).is(":visible")){return this.getRoot().find(".draggrouphomes"+a+" span.draghome.infinite.choice"+b+".group"+a)}return this.getRoot().find(".draghome.dragplaceholder.group"+a+".choice"+b)};d.prototype.getUnplacedChoice=function(a,b){return this.getRoot().find(".draghome.group"+a+".choice"+b+".unplaced").slice(0,1)};d.prototype.getCurrentDragInPlace=function(a){return this.getRoot().find("span.draghome.inplace"+a)};d.prototype.noOfDropsInGroup=function(a){return this.getRoot().find(".drop.group"+a).length};d.prototype.noOfChoicesInGroup=function(a){return this.getRoot().find(".draghome.group"+a).length};d.prototype.getClassnameNumericSuffix=function(a,b){var c=a.attr("class");if(""!==c){for(var d=c.split(" "),e=0,f;e<d.length;e++){f=new RegExp("^"+b+"([0-9])+$");if(f.test(d[e])){var g=/([0-9])+$/.exec(d[e]);return+g[0]}}}return null};d.prototype.getChoice=function(a){return this.getClassnameNumericSuffix(a,"choice")};d.prototype.getGroup=function(a){return this.getClassnameNumericSuffix(a,"group")};d.prototype.getPlace=function(a){return this.getClassnameNumericSuffix(a,"place")};d.prototype.getDragClone=function(a){return this.getRoot().find(".draggrouphomes"+this.getGroup(a)+" span.draghome.choice"+this.getChoice(a)+".group"+this.getGroup(a)+".dragplaceholder")};d.prototype.getInfiniteDragClones=function(a,b){if(b){return this.getRoot().find(".draggrouphomes"+this.getGroup(a)+" span.draghome.choice"+this.getChoice(a)+".group"+this.getGroup(a)+".infinite").not(".dragplaceholder")}return this.getRoot().find("span.draghome.choice"+this.getChoice(a)+".group"+this.getGroup(a)+".infinite").not(".dragplaceholder")};d.prototype.getDrop=function(a,b){return this.getRoot().find(".drop.group"+this.getGroup(a)+".place"+b)};d.prototype.isDragSameAsDrop=function(a,b){return this.getChoice(a)===this.getChoice(b)&&this.getGroup(a)===this.getGroup(b)};var f={eventHandlersInitialised:!1,isKeyboardNavigation:!1,questions:{},init:function init(a,b){f.questions[a]=new d(a,b);if(!f.eventHandlersInitialised){f.setupEventHandlers();f.eventHandlersInitialised=!0}},setupEventHandlers:function setupEventHandlers(){f.addEventHandlersToDrag(a(".que.ddwtos:not(.qtype_ddwtos-readonly) span.draghome"));a("body").on("keydown",".que.ddwtos:not(.qtype_ddwtos-readonly) span.drop",f.handleKeyPress).on("keydown",".que.ddwtos:not(.qtype_ddwtos-readonly) span.draghome.placed:not(.beingdragged)",f.handleKeyPress).on("qtype_ddwtos-dragmoved",f.handleDragMoved)},addEventHandlersToDrag:function addEventHandlersToDrag(a){a.unbind("mousedown touchstart");a.on("mousedown touchstart",f.handleDragStart)},handleDragStart:function handleDragStart(a){a.preventDefault();var b=f.getQuestionForEvent(a);if(b){b.handleDragStart(a)}},handleKeyPress:function handleKeyPress(a){if(f.isKeyboardNavigation){return}f.isKeyboardNavigation=!0;var b=f.getQuestionForEvent(a);if(b){b.handleKeyPress(a)}},getQuestionForEvent:function getQuestionForEvent(b){var c=a(b.currentTarget).closest(".que.ddwtos").attr("id");return f.questions[c]},handleDragMoved:function handleDragMoved(a,b,c,d){b.removeClass("beingdragged");b.css("top","").css("left","");c.after(b);c.removeClass("active");if("undefined"!=typeof b.data("unplaced")&&!0===b.data("unplaced")){b.removeClass("placed").addClass("unplaced");b.removeAttr("tabindex");b.removeData("unplaced");if(b.hasClass("infinite")&&1<d.getInfiniteDragClones(b,!0).length){d.getInfiniteDragClones(b,!0).first().remove()}}if("undefined"!=typeof b.data("isfocus")&&!0===b.data("isfocus")){b.focus();b.removeData("isfocus")}if("undefined"!=typeof c.data("isfocus")&&!0===c.data("isfocus")){c.removeData("isfocus")}if(f.isKeyboardNavigation){f.isKeyboardNavigation=!1}}};return{init:f.init}});
define ("qtype_multichoice/clearchoice",["jquery","core/custom_interaction_events"],function(a,b){var c={CHOICE_ELEMENT:".answer input",LINK:"a",RADIO:"input[type=\"radio\"]"},d=function(a){a.find(c.RADIO).prop("disabled",!1).prop("checked",!0)},e=function(a,b){return a.find("div[id=\""+b+"\"]")},f=function(a){a.addClass("sr-only");a.attr("aria-hidden",!0);a.find(c.LINK).attr("tabindex",-1)},g=function(a){a.removeClass("sr-only");a.removeAttr("aria-hidden");a.find(c.LINK).attr("tabindex",0);a.find(c.RADIO).prop("disabled",!0)},h=function(a,h){var i=e(a,h);i.on(b.events.activate,c.LINK,function(a,b){d(i);f(i);b.originalEvent.preventDefault()});a.on("change",c.CHOICE_ELEMENT,function(){g(i)});i.find(c.RADIO).focus(function(){var b=a.find(c.CHOICE_ELEMENT).first();b.focus()})};return{init:function init(b,c){b=a("#"+b);h(b,c)}}});
define ("qtype_multichoice/answers",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var b={ANSWER_LABEL:"[data-region=answer-label]"};a.default={init:function init(a){var c=document.getElementById(a),d=c.querySelectorAll(b.ANSWER_LABEL);d.forEach(function(a){a.addEventListener("click",function(a){var b=a.currentTarget.id,d=c.querySelector("[aria-labelledby=\"".concat(b,"\"]"));d.click()})})}};return a.default});
define ("mod_assign/override_form",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a,c){var d=document.getElementById(a),e=d.querySelector("[name=\"".concat(c,"\"]"));(0,b.default)(e).on("change",function(){var a=document.createElement("input");a.setAttribute("type","hidden");a.setAttribute("name","userchange");a.setAttribute("value",!0);d.appendChild(a);if("undefined"!=typeof M.core_formchangechecker){M.core_formchangechecker.reset_form_dirty_state()}d.submit()})};a.init=c});
define ("mod_assign/grading_panel",["jquery","core/yui","core/notification","core/templates","core/fragment","core/ajax","core/str","mod_assign/grading_form_change_checker","mod_assign/grading_events","core/event","core/toast"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(b){this._regionSelector=b;this._region=a(b);this._userCache=[];this.registerEventListeners()};l.prototype._regionSelector=null;l.prototype._lastUserId=0;l.prototype._lastAttemptNumber=-1;l.prototype._region=null;l.prototype.nextUserId=null;l.prototype.nextUser=!1;l.prototype._niceReplaceNodeContents=function(b,c,e){var f=a.Deferred();b.fadeOut("fast",function(){d.replaceNodeContents(b,c,e);b.fadeIn("fast",function(){f.resolve()})});return f.promise()};l.prototype._saveFormState=function(){var b=a("[data-region=\"grading-actions-form\"] [name=\"sendstudentnotifications\"]").prop("checked");a(".gradeform [name=\"sendstudentnotifications\"]").val(b)};l.prototype._submitForm=function(b,d,e){var g=a(this._region.find("form.gradeform"));a("[data-region=\"overlay\"]").show();g.trigger("save-form-state");j.notifyFormSubmitAjax(g[0]);var h=g.serialize(),i=this._region.attr("data-assignmentid");f.call([{methodname:"mod_assign_submit_grading_form",args:{assignmentid:i,userid:this._lastUserId,jsonformdata:JSON.stringify(h)},done:this._handleFormSubmissionResponse.bind(this,h,d,e),fail:c.exception}])};l.prototype._handleFormSubmissionResponse=function(d,e,f,h){if("undefined"==typeof e){e=this._lastUserId}if(h.length){a(document).trigger("reset",[this._lastUserId,d])}else{g.get_strings([{key:"gradechangessaveddetail",component:"mod_assign"}]).done(function(a){k.add(a[0])}).fail(c.exception);b.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});if(e==this._lastUserId){a(document).trigger("reset",e)}else if(f){a(document).trigger("done-saving-show-next",!0)}else{a(document).trigger("user-changed",e)}}a("[data-region=\"overlay\"]").hide()};l.prototype._resetForm=function(b,c,d){var e=a.Event("custom");if("undefined"==typeof c){c=this._lastUserId}this._lastUserId=0;this._refreshGradingPanel(e,c,d)};l.prototype._chooseAttempt=function(b){var d=a(b.target),e=d.data("submissions"),f=a(document.getElementById(e)),h=f.clone(),i=h.wrap(a("<form/>")).html();g.get_strings([{key:"viewadifferentattempt",component:"mod_assign"},{key:"view",component:"core"},{key:"cancel",component:"core"}]).done(function(b){c.confirm(b[0],i,b[1],b[2],function(){var b=a("input:radio[name='select-attemptnumber']:checked").val();this._refreshGradingPanel(null,this._lastUserId,"",b)}.bind(this))}.bind(this)).fail(c.exception)};l.prototype._addPopoutButtons=function(b){var e=a(b);d.render("mod_assign/popout_button",{}).done(function(a){var b=e.find("[data-fieldtype=\"filemanager\"],[data-fieldtype=\"editor\"],[data-fieldtype=\"grading\"]").closest(".fitem");b.addClass("has-popout").find("label").parent().append(a);e.on("click","[data-region=\"popout-button\"]",this._togglePopout.bind(this))}.bind(this)).fail(c.exception)};l.prototype._togglePopout=function(b){b.preventDefault();var c=a(b.target).closest(".fitem");if(c.hasClass("popout")){a(".popout").removeClass("popout")}else{a(".popout").removeClass("popout");c.addClass("popout");c.addClass("moodle-has-zindex")}};l.prototype._refreshGradingPanel=function(b,f,g,i){var j=this._region.attr("data-contextid");if("undefined"==typeof g){g=""}if("undefined"==typeof i){i=-1}if(this._lastUserId==f&&this._lastAttemptNumber==i&&""===g){return}this._lastUserId=f;this._lastAttemptNumber=i;a(document).trigger("start-loading-user");window.M.util.js_pending("mod-assign-loading-user");d.render("mod_assign/loading",{}).done(function(b,d){this._niceReplaceNodeContents(this._region,b,d).done(function(){if(0<f){this._region.show();var b={userid:f,attemptnumber:i,jsonformdata:JSON.stringify(g)};e.loadFragment("mod_assign","gradingpanel",j,b).done(function(b,d){this._niceReplaceNodeContents(this._region,b,d).done(function(){h.saveFormState("[data-region=\"grade-panel\"] .gradeform");a(document).on("editor-content-restored",function(){h.saveFormState("[data-region=\"grade-panel\"] .gradeform")});a("[data-region=\"attempt-chooser\"]").on("click",this._chooseAttempt.bind(this));this._addPopoutButtons("[data-region=\"grade-panel\"] .gradeform");a(document).trigger("finish-loading-user");window.M.util.js_complete("mod-assign-loading-user")}.bind(this)).fail(c.exception)}.bind(this)).fail(c.exception);a("[data-region=\"review-panel\"]").show()}else{this._region.hide();a("[data-region=\"review-panel\"]").hide();a(document).trigger("finish-loading-user");window.M.util.js_complete("mod-assign-loading-user")}}.bind(this))}.bind(this)).fail(c.exception)};l.prototype._getNextUser=function(a,b){this.nextUserId=b.nextUserId;this.nextUser=b.nextUser};l.prototype._handleSaveAndShowNext=function(){this._submitForm(null,this.nextUserId,this.nextUser)};l.prototype.getPanelElement=function(){return a("[data-region=\"grade-panel\"]")};l.prototype.collapsePanel=function(){this.getPanelElement().addClass("collapsed")};l.prototype.expandPanel=function(){this.getPanelElement().removeClass("collapsed")};l.prototype.registerEventListeners=function(){var b=a(document),c=a(this._region);c.on("submit","form",function(a){a.preventDefault()});b.on("next-user",this._getNextUser.bind(this));b.on("user-changed",this._refreshGradingPanel.bind(this));b.on("save-changes",this._submitForm.bind(this));b.on("save-and-show-next",this._handleSaveAndShowNext.bind(this));b.on("reset",this._resetForm.bind(this));b.on("save-form-state",this._saveFormState.bind(this));b.on(i.COLLAPSE_GRADE_PANEL,function(){this.collapsePanel()}.bind(this));b.on(i.COLLAPSE_REVIEW_PANEL,function(){this.expandPanel()}.bind(this));b.on(i.EXPAND_GRADE_PANEL,function(){this.expandPanel()}.bind(this))};return l});
define ("mod_assign/grading_review_panel",["jquery","mod_assign/grading_events"],function(a,b){var c=function(){this._region=a("[data-region=\"review-panel-content\"]");this.registerEventListeners()};c.prototype._region=null;c.prototype.getReviewPanel=function(a){var b=this._region.data("panel-owner");if("undefined"==typeof b){this._region.data("review-panel-plugin",a)}if(this._region.data("review-panel-plugin")==a){return this._region[0]}return!1};c.prototype.getTogglePanelButton=function(){return this.getPanelElement().find("[data-region=\"review-panel-toggle\"]")};c.prototype.getPanelElement=function(){return a("[data-region=\"review-panel\"]")};c.prototype.getPanelContentElement=function(){return a("[data-region=\"review-panel-content\"]")};c.prototype.togglePanel=function(){if(this.getPanelElement().hasClass("collapsed")){a(document).trigger(b.EXPAND_REVIEW_PANEL)}else{a(document).trigger(b.COLLAPSE_REVIEW_PANEL)}};c.prototype.collapsePanel=function(){this.getPanelElement().addClass("collapsed").removeClass("grade-panel-collapsed");this.getPanelContentElement().attr("aria-hidden",!0)};c.prototype.expandPanel=function(){this.getPanelElement().removeClass("collapsed");this.getPanelContentElement().removeAttr("aria-hidden")};c.prototype.registerEventListeners=function(){var c=this.getTogglePanelButton();c.click(function(a){this.togglePanel();a.preventDefault()}.bind(this));c.keydown(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(13===a.keyCode||32===a.keyCode){this.togglePanel();a.preventDefault()}}}.bind(this));var d=a(document);d.on(b.COLLAPSE_REVIEW_PANEL,function(){this.collapsePanel()}.bind(this));d.on(b.COLLAPSE_GRADE_PANEL,function(){this.expandPanel();this.getPanelElement().addClass("grade-panel-collapsed")}.bind(this));d.on(b.EXPAND_REVIEW_PANEL,function(){this.expandPanel()}.bind(this));d.on(b.EXPAND_GRADE_PANEL,function(){this.getPanelElement().removeClass("grade-panel-collapsed")}.bind(this))};return c});
define ("mod_assign/participant_selector",["core/ajax","jquery","core/templates"],function(a,b,c){return{processResults:function processResults(a,b){return b},transport:function transport(d,e,f,g){var h=b(d).attr("data-assignmentid"),i=b(d).attr("data-groupid"),j=b("[data-region=\"configure-filters\"] input[type=\"checkbox\"]"),k=[];j.each(function(a,c){k[b(c).attr("name")]=b(c).prop("checked")});a.call([{methodname:"mod_assign_list_participants",args:{assignid:h,groupid:i,filter:e,limit:30,includeenrolments:!1,tablesort:!0}}])[0].then(function(a){var d=[],e=b("[data-showuseridentity]").data("showuseridentity").split(",");b.each(a,function(a,f){var g=f,h=[],i=!0;if(k.filter_submitted&&!f.submitted){i=!1}if(k.filter_notsubmitted&&f.submitted){i=!1}if(k.filter_requiregrading&&!f.requiregrading){i=!1}if(k.filter_grantedextension&&!f.grantedextension){i=!1}if(i){b.each(e,function(a,b){if("undefined"!=typeof f[b]&&""!==f[b]){g.hasidentity=!0;h.push(f[b])}});g.identity=h.join(", ");d.push(c.render("mod_assign/list_participant_user_summary",g).then(function(a){return{value:f.id,label:a}}))}});return b.when.apply(b,d)}).then(function(){var a=[];if(arguments[0]){a=Array.prototype.slice.call(arguments)}f(a)}).catch(g)}}});
define ("mod_assign/grading_form_change_checker",["jquery"],function(a){return{saveFormState:function saveFormState(b){a(b).trigger("save-form-state");var c=a(b).serialize();a(b).data("saved-form-state",c)},checkFormForChanges:function checkFormForChanges(b){a(b).trigger("save-form-state");var c=a(b).serialize(),d=a(b).data("saved-form-state");if("undefined"==typeof d){return!1}return d!=c}}});
define ("mod_assign/grading_events",function(){return{COLLAPSE_REVIEW_PANEL:"grading:collapse-review-panel",EXPAND_REVIEW_PANEL:"grading:expand-review-panel",COLLAPSE_GRADE_PANEL:"grading:collapse-grade-panel",EXPAND_GRADE_PANEL:"grading:expand-grade-panel"}});
define ("mod_assign/grading_navigation",["jquery","core/notification","core/str","core/form-autocomplete","core/ajax","mod_assign/grading_form_change_checker"],function(a,b,c,d,e,f){var g=function(e){this._regionSelector=e;this._region=a(e);this._filters=[];this._users=[];this._filteredUsers=[];this._lastXofYUpdate=0;this._firstLoadUsers=!0;this._loadAllUsers();this._region.find("[data-action=\"previous-user\"]").on("click",this._handlePreviousUser.bind(this));this._region.find("[data-action=\"next-user\"]").on("click",this._handleNextUser.bind(this));this._region.find("[data-action=\"change-user\"]").on("change",this._handleChangeUser.bind(this));this._region.find("[data-region=\"user-filters\"]").on("click",this._toggleExpandFilters.bind(this));a(document).on("user-changed",this._refreshSelector.bind(this));a(document).on("done-saving-show-next",this._handleNextUser.bind(this));var f=this._region.find("[data-region=\"user-filters\"]"),g=a(document.getElementById(f.attr("aria-controls")));g.on("change","select",this._filterChanged.bind(this));var h=a("[data-region=\"grading-navigation-panel\"]").data("first-userid");if(h){this._selectUserById(h)}c.get_string("changeuser","mod_assign").done(function(a){d.enhance("[data-action=change-user]",!1,"mod_assign/participant_selector",a)}).fail(b.exception);a(document).bind("start-loading-user",function(){this._isLoading=!0}.bind(this));a(document).bind("finish-loading-user",function(){this._isLoading=!1}.bind(this))};g.prototype._isLoading=!1;g.prototype._regionSelector=null;g.prototype._filters=null;g.prototype._users=null;g.prototype._region=null;g.prototype._lastFilters="";g.prototype._loadAllUsers=function(){var a=this._region.find("[data-action=change-user]"),c=a.attr("data-assignmentid"),d=a.attr("data-groupid"),f=this._region.find("[data-region=\"configure-filters\"]"),g=f.find("select[name=\"filter\"]").val(),h=f.find("select[name=\"workflowfilter\"]");if(h){g+=","+h.val()}var i=f.find("select[name=\"markerfilter\"]");if(i){g+=","+i.val()}if(this._lastFilters==g){return!1}this._lastFilters=g;e.call([{methodname:"mod_assign_list_participants",args:{assignid:c,groupid:d,filter:"",onlyids:!0,tablesort:!0},done:this._usersLoaded.bind(this),fail:b.exception}]);return!0};g.prototype._usersLoaded=function(b){this._firstLoadUsers=!1;this._filteredUsers=this._users=b;if(this._users.length){var c=this._region.find("[data-region=\"user-filters\"]"),d=a(document.getElementById(c.attr("aria-controls")));d.find("select[name=\"filter\"]").trigger("change")}else{this._selectNoUser()}this._triggerNextUserEvent()};g.prototype._checkClickOutsideConfigureFilters=function(b){var c=this._region.find("[data-region=\"configure-filters\"]");if(!c.is(b.target)&&0===c.has(b.target).length){var d=this._region.find("[data-region=\"user-filters\"]");c.hide();c.attr("aria-hidden","true");d.attr("aria-expanded","false");a(document).unbind("click.mod_assign_grading_navigation")}};g.prototype._updateFilterPreferences=function(b,c,d){var f=[],g=0;if(0==c.length||this._firstLoadUsers){var h=a.Deferred();h.resolve();return h}for(g=0;g<c.length;g++){var j=c[g];if("none"==j){j=""}f.push({userid:b,name:d[g],value:j})}return e.call([{methodname:"core_user_set_user_preferences",args:{preferences:f}}])[0]};g.prototype._filterChanged=function(){var d=this._region.find("[data-region=\"configure-filters\"]"),e=d.find("select"),f=[];this._filters=[];e.each(function(b,c){var d=a(c);this._filters.push(d.val());f.push("assign_"+d.prop("name"))}.bind(this));var g=[];d.find("option:checked").each(function(b,c){g[g.length]=a(c).text()});if(g.length){this._region.find("[data-region=\"user-filters\"] span").text(g.join(", "))}else{c.get_string("nofilters","mod_assign").done(function(a){this._region.find("[data-region=\"user-filters\"] span").text(a)}.bind(this)).fail(b.exception)}var h=this._region.find("[data-action=change-user]"),i=h.data("currentuserid");this._updateFilterPreferences(i,this._filters,f).done(function(){if(!this._loadAllUsers()){var b=parseInt(h.attr("data-selected")),c=0;a.each(this._filteredUsers,function(a,d){if(b==d.id){c=a}});if(this._filteredUsers.length){this._selectUserById(this._filteredUsers[c].id)}else{this._selectNoUser()}}}.bind(this)).fail(b.exception);this._refreshCount()};g.prototype._selectNoUser=function(){if(this._isLoading){return}if(f.checkFormForChanges("[data-region=\"grade-panel\"] .gradeform")){c.get_strings([{key:"unsavedchanges",component:"mod_assign"},{key:"unsavedchangesquestion",component:"mod_assign"},{key:"saveandcontinue",component:"mod_assign"},{key:"cancel",component:"core"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){a(document).trigger("save-changes",-1)})})}else{a(document).trigger("user-changed",-1)}};g.prototype._selectUserById=function(d){var e=this._region.find("[data-action=change-user]"),g=parseInt(d,10);if(this._isLoading){return}if(f.checkFormForChanges("[data-region=\"grade-panel\"] .gradeform")){c.get_strings([{key:"unsavedchanges",component:"mod_assign"},{key:"unsavedchangesquestion",component:"mod_assign"},{key:"saveandcontinue",component:"mod_assign"},{key:"cancel",component:"core"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){a(document).trigger("save-changes",g)})})}else{e.attr("data-selected",d);if(!isNaN(g)&&0<g){a(document).trigger("user-changed",d)}}};g.prototype._toggleExpandFilters=function(b){b.preventDefault();var c=a(b.target).closest("[data-region=\"user-filters\"]"),d="true"==c.attr("aria-expanded"),e=a(document.getElementById(c.attr("aria-controls")));if(d){e.hide();e.attr("aria-hidden","true");c.attr("aria-expanded","false");a(document).unbind("click.mod_assign_grading_navigation")}else{e.css("display","inline-block");e.attr("aria-hidden","false");c.attr("aria-expanded","true");b.stopPropagation();a(document).on("click.mod_assign_grading_navigation",this._checkClickOutsideConfigureFilters.bind(this))}};g.prototype._handlePreviousUser=function(a){a.preventDefault();var b=this._region.find("[data-action=change-user]"),c=b.attr("data-selected"),d=0,e=0;for(d=0;d<this._filteredUsers.length;d++){if(this._filteredUsers[d].id==c){e=d;break}}var f=this._filteredUsers.length,g=e-1;if(0>g){g=f-1}if(f){this._selectUserById(this._filteredUsers[g].id)}};g.prototype._handleNextUser=function(b,c){b.preventDefault();var d=this._region.find("[data-action=change-user]"),e=d.attr("data-selected"),f=0,g=0;for(f=0;f<this._filteredUsers.length;f++){if(this._filteredUsers[f].id==e){g=f;break}}var h=this._filteredUsers.length,j=(g+1)%h;if(c&&h){var k=this._filteredUsers[j].id,l=parseInt(k,10);d.attr("data-selected",k);if(!isNaN(l)&&0<l){a(document).trigger("user-changed",k)}}else if(h){this._selectUserById(this._filteredUsers[j].id)}};g.prototype._setCountString=function(a,d){var e=0;this._lastXofYUpdate++;e=this._lastXofYUpdate;c.get_string("xofy","mod_assign",{x:a,y:d}).done(function(a){if(e==this._lastXofYUpdate){this._region.find("[data-region=\"user-count-summary\"]").text(a)}}.bind(this)).fail(b.exception)};g.prototype._refreshCount=function(){var a=this._region.find("[data-action=change-user]"),b=a.attr("data-selected"),c=0,d=0;if(isNaN(b)||0>=b){this._region.find("[data-region=\"user-count\"]").hide()}else{this._region.find("[data-region=\"user-count\"]").show();for(c=0;c<this._filteredUsers.length;c++){if(this._filteredUsers[c].id==b){d=c;break}}var e=this._filteredUsers.length;if(e){d+=1}this._setCountString(d,e);if(0<d){var f=new URL(window.location);if(0<parseInt(f.searchParams.get("blindid"))){var g=this._filteredUsers[d-1].recordid;f.searchParams.set("blindid",g)}else{f.searchParams.set("userid",b)}window.history.replaceState({},"",f)}}};g.prototype._refreshSelector=function(a,b){var c=this._region.find("[data-action=change-user]");b=parseInt(b,10);if(!isNaN(b)&&0<b){c.attr("data-selected",b)}this._refreshCount()};g.prototype._triggerNextUserEvent=function(){if(1<this._filteredUsers.length){a(document).trigger("next-user",{nextUserId:null,nextUser:!0})}else{a(document).trigger("next-user",{nextUser:!1})}};g.prototype._handleChangeUser=function(){var d=this._region.find("[data-action=change-user]"),e=parseInt(d.val(),10);if(this._isLoading){return}if(f.checkFormForChanges("[data-region=\"grade-panel\"] .gradeform")){c.get_strings([{key:"unsavedchanges",component:"mod_assign"},{key:"unsavedchangesquestion",component:"mod_assign"},{key:"saveandcontinue",component:"mod_assign"},{key:"cancel",component:"core"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){a(document).trigger("save-changes",e)})})}else{if(!isNaN(e)&&0<e){d.attr("data-selected",e);a(document).trigger("user-changed",e)}}};return g});
define ("mod_assign/grading_navigation_user_info",["jquery","core/notification","core/ajax","core/templates"],function(a,b,c,d){var e=function(b){this._regionSelector=b;this._region=a(b);this._userCache={};a(document).on("user-changed",this._refreshUserInfo.bind(this))};e.prototype._regionSelector=null;e.prototype._userCache=null;e.prototype._region=null;e.prototype._lastUserId=0;e.prototype._getAssignmentId=function(){return this._region.attr("data-assignmentid")};e.prototype._refreshUserInfo=function(e,f){var g=a.Deferred();this._region.attr("data-userid",f);if(this._lastUserId==f){return}this._lastUserId=f;d.render("mod_assign/loading",{}).done(function(e,h){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,e,h);this._region.fadeIn("fast")}.bind(this));if(0>f){d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){if(f==this._lastUserId){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b);this._region.fadeIn("fast")}.bind(this))}}.bind(this)).fail(b.exception);return}if("undefined"!=typeof this._userCache[f]){g.resolve(this._userCache[f])}else{var i=this._getAssignmentId(),j=c.call([{methodname:"mod_assign_get_participant",args:{userid:f,assignid:i,embeduser:!0}}]);j[0].done(function(a){if(!a.hasOwnProperty("id")){g.reject("No users")}else{this._userCache[f]=a;g.resolve(this._userCache[f])}}.bind(this)).fail(b.exception)}g.done(function(c){var e=a("[data-showuseridentity]").data("showuseridentity").split(","),g=[];c.courseid=a("[data-region=\"grading-navigation-panel\"]").attr("data-courseid");if(c.user){a.each(e,function(a,b){if("undefined"!=typeof c.user[b]&&""!==c.user[b]){c.hasidentity=!0;g.push(c.user[b])}});c.identity=g.join(", ");if(c.user.profileimageurl){c.profileimageurl=c.user.profileimageurl}}d.render("mod_assign/grading_navigation_user_summary",c).done(function(a,b){if(f==this._lastUserId){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b);this._region.fadeIn("fast")}.bind(this))}}.bind(this)).fail(b.exception)}.bind(this)).fail(function(){d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b);this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception)}.bind(this))}.bind(this)).fail(b.exception)};return e});
define ("mod_assign/grading_actions",["jquery","mod_assign/grading_events"],function(a,b){var c=function(b){this._regionSelector=b;this._region=a(b);this.registerEventListeners()};c.prototype._regionSelector=null;c.prototype._lastUserId=0;c.prototype._region=null;c.prototype._showActionsForm=function(a,b){var c=this._region.find("[data-region=grading-actions-form]");if(b!=this._lastUserId&&0<b){this._lastUserId=b}if(0<b){c.removeClass("hide")}else{c.addClass("hide")}};c.prototype._trigger=function(b){a(document).trigger(b)};c.prototype.getReviewPanelElement=function(){return a("[data-region=\"review-panel\"]")};c.prototype.hasReviewPanelElement=function(){return 0<this.getReviewPanelElement().length};c.prototype.getCollapseGradePanelButton=function(){return a("[data-region=\"grade-actions\"] .collapse-grade-panel")};c.prototype.getCollapseReviewPanelButton=function(){return a("[data-region=\"grade-actions\"] .collapse-review-panel")};c.prototype.getExpandAllPanelsButton=function(){return a("[data-region=\"grade-actions\"] .collapse-none")};c.prototype.resetLayoutButtons=function(){this.getCollapseGradePanelButton().removeClass("active");this.getCollapseReviewPanelButton().removeClass("active");this.getExpandAllPanelsButton().removeClass("active")};c.prototype.collapseReviewPanel=function(){a(document).trigger(b.COLLAPSE_REVIEW_PANEL);a(document).trigger(b.EXPAND_GRADE_PANEL);this.resetLayoutButtons();this.getCollapseReviewPanelButton().addClass("active")};c.prototype.collapseGradePanel=function(){a(document).trigger(b.COLLAPSE_GRADE_PANEL);a(document).trigger(b.EXPAND_REVIEW_PANEL);this.resetLayoutButtons();this.getCollapseGradePanelButton().addClass("active")};c.prototype.expandAllPanels=function(){a(document).trigger(b.EXPAND_GRADE_PANEL);a(document).trigger(b.EXPAND_REVIEW_PANEL);this.resetLayoutButtons();this.getExpandAllPanelsButton().addClass("active")};c.prototype.registerEventListeners=function(){if(this.hasReviewPanelElement()){var b=this.getCollapseReviewPanelButton();b.click(function(a){this.collapseReviewPanel();a.preventDefault()}.bind(this));b.keydown(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(13===a.keyCode||32===a.keyCode){this.collapseReviewPanel();a.preventDefault()}}}.bind(this));var c=this.getCollapseGradePanelButton();c.click(function(a){this.collapseGradePanel();a.preventDefault()}.bind(this));c.keydown(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(13===a.keyCode||32===a.keyCode){this.collapseGradePanel();a.preventDefault()}}}.bind(this));var d=this.getExpandAllPanelsButton();d.click(function(a){this.expandAllPanels();a.preventDefault()}.bind(this));d.keydown(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(13===a.keyCode||32===a.keyCode){this.expandAllPanels();a.preventDefault()}}}.bind(this))}a(document).on("user-changed",this._showActionsForm.bind(this));this._region.find("[name=\"savechanges\"]").on("click",this._trigger.bind(this,"save-changes"));this._region.find("[name=\"saveandshownext\"]").on("click",this._trigger.bind(this,"save-and-show-next"));this._region.find("[name=\"resetbutton\"]").on("click",this._trigger.bind(this,"reset"));this._region.find("form").on("submit",function(a){a.preventDefault()})};return c});
define ("mod_customcert/dialogue",["core/yui"],function(a){var b=function(b,c,d,e,f){this.yuiDialogue=null;var g=this;if("undefined"==typeof f){f=!1}a.use("moodle-core-notification","timers",function(){var h="480px";if(f){h="800px"}g.yuiDialogue=new M.core.dialogue({headerContent:b,bodyContent:c,draggable:!0,visible:!1,center:!0,modal:!0,width:h});g.yuiDialogue.after("visibleChange",function(b){if(b.newVal){if("undefined"!=typeof d){a.soon(function(){d(g);g.yuiDialogue.centerDialogue()})}}else{if("undefined"!=typeof e){a.soon(function(){e(g)})}}});g.yuiDialogue.show()})};b.prototype.close=function(){this.yuiDialogue.hide();this.yuiDialogue.destroy()};b.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()};return b});
define ("mod_customcert/rearrange-area",["jquery","core/yui","core/fragment","mod_customcert/dialogue","core/notification","core/str","core/templates","core/ajax"],function(a,b,c,d,f,g,h,i){var j=function(b){this._node=a(b);this._setEvents()};j.prototype.CUSTOMCERT_REF_POINT_TOPLEFT=0;j.prototype.CUSTOMCERT_REF_POINT_TOPCENTER=1;j.prototype.CUSTOMCERT_REF_POINT_TOPRIGHT=2;j.prototype.PIXELSINMM=3.779527559055;j.prototype._setEvents=function(){this._node.on("click",".element",this._editElement.bind(this))};j.prototype._editElement=function(a){var e=a.currentTarget.id.substr(8),h=this._node.attr("data-contextid");c.loadFragment("mod_customcert","editelement",h,{elementid:e}).done(function(a,c){g.get_string("editelement","mod_customcert").done(function(f){b.use("moodle-core-formchangechecker",function(){new d(f,"<div id='elementcontent'></div>",this._editElementDialogueConfig.bind(this,e,a,c),void 0,!0)}.bind(this))}.bind(this))}.bind(this)).fail(f.exception)};j.prototype._editElementDialogueConfig=function(b,c,d,g){h.replaceNode("#elementcontent",c,d);this._setPositionInForm(b);var i=a(g.getContent());i.on("click","#id_submitbutton",function(c){M.core_formchangechecker.reset_form_dirty_state();this._saveElement(b).then(function(){this._getElementHTML(b).done(function(c){var d=this._node.find("#element-"+b),e=parseInt(a("#id_refpoint").val()),f="";if(e==this.CUSTOMCERT_REF_POINT_TOPLEFT){f="refpoint-left"}else if(e==this.CUSTOMCERT_REF_POINT_TOPCENTER){f="refpoint-center"}else if(e==this.CUSTOMCERT_REF_POINT_TOPRIGHT){f="refpoint-right"}d.empty().append(c);d.removeClass();d.addClass("element "+f);d.attr("data-refpoint",e);var h=a("#editelementform #id_posx").val(),i=a("#editelementform #id_posy").val();this._setPosition(b,e,h,i);g.close()}.bind(this))}.bind(this)).fail(f.exception);c.preventDefault()}.bind(this));i.on("click","#id_cancel",function(a){g.close();a.preventDefault()})};j.prototype._setPosition=function(a,c,d,e){var f=b.one("#element-"+a);d=b.one("#pdf").getX()+d*this.PIXELSINMM;e=b.one("#pdf").getY()+e*this.PIXELSINMM;var g=parseFloat(f.getComputedStyle("width")),h=f.width*this.PIXELSINMM;if(h&&g>h){g=h}switch(c){case this.CUSTOMCERT_REF_POINT_TOPCENTER:d-=g/2;break;case this.CUSTOMCERT_REF_POINT_TOPRIGHT:d=d-g+2;break;}f.setX(d);f.setY(e)};j.prototype._setPositionInForm=function(c){var d=a("#editelementform #id_posx"),e=a("#editelementform #id_posy");if(d.length&&e.length){var f=b.one("#element-"+c),g=f.getX()-b.one("#pdf").getX(),h=f.getY()-b.one("#pdf").getY(),i=parseInt(f.getData("refpoint")),j=parseFloat(f.getComputedStyle("width"));switch(i){case this.CUSTOMCERT_REF_POINT_TOPCENTER:g+=j/2;break;case this.CUSTOMCERT_REF_POINT_TOPRIGHT:g+=j;break;}g=Math.round(parseFloat(g/this.PIXELSINMM));h=Math.round(parseFloat(h/this.PIXELSINMM));d.val(g);e.val(h)}};j.prototype._getElementHTML=function(a){var b=this._node.attr("data-templateid"),c=i.call([{methodname:"mod_customcert_get_element_html",args:{templateid:b,elementid:a}}]);return c[0]};j.prototype._saveElement=function(b){var c=this._node.attr("data-templateid"),d=a("#editelementform").serializeArray(),e=i.call([{methodname:"mod_customcert_save_element",args:{templateid:c,elementid:b,values:d}}]);return e[0]};return{init:function init(a){new j(a)}}});
define ("mod_feedback/edit",["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={deleteItem:function deleteItem(b){b.preventDefault();var e=a(b.currentTarget).attr("href");c.get_strings([{key:"confirmation",component:"admin"},{key:"confirmdeleteitem",component:"mod_feedback"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).then(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){window.location=e})}).catch()},setup:function setup(){a("body").delegate("[data-action=\"delete\"]","click",e.deleteItem)}};return{setup:e.setup}});
define ("mod_forum/discussion_nested_v2",["exports","jquery","core/auto_rows","core/custom_interaction_events","core/notification","core/templates","mod_forum/discussion","mod_forum/inpage_reply","mod_forum/lock_toggle","mod_forum/favourite_toggle","mod_forum/pin_toggle","mod_forum/selectors","mod_forum/subscription_toggle"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=n(b);c=n(c);d=n(d);e=n(e);f=n(f);g=n(g);h=n(h);i=n(i);j=n(j);k=n(k);l=n(l);m=n(m);var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function n(a){return a&&a.__esModule?a:{default:a}}function o(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function p(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){o(Object(c),!0).forEach(function(b){q(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{o(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function q(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function r(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function s(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){r(h,d,e,f,g,"next",a)}function g(a){r(h,d,e,f,g,"throw",a)}f(void 0)})}}var u=function(a){return a.closest(l.default.post.post)},v=function(a,b){return a.find("".concat(l.default.post.post,"[data-post-id=").concat(b,"]"))},w=function(a){return a.parents(l.default.post.post)},x=function(a){return a.children().not(l.default.post.repliesContainer).find(l.default.post.forumCoreContent)},y=function(a){return a.children().filter(l.default.post.inpageReplyContainer)},z=function(a){return y(a).find(l.default.post.inpageReplyContent)},A=function(a){return x(a).find(l.default.post.inpageReplyCreateButton)},B=function(a){return a.children(l.default.post.repliesVisibilityToggleContainer)},C=function(a){return a.children(l.default.post.repliesContainer)},D=function(a){return 0<C(a).children().length},E=function(a){return a.find(l.default.post.showReplies)},F=function(a){return a.find(l.default.post.hideReplies)},G=function(a){var b=C(a);return b.is(":visible")},H=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,c=C(a),d=B(a),e=E(d),f=F(d);e.addClass("hidden");f.removeClass("hidden");c.slideDown({duration:150,queue:!1,complete:function complete(){if(b){var a=v(c,b);if(a.length){a[0].scrollIntoView()}}}}).css("display","none").fadeIn(150)},I=function(a){var b=C(a),c=B(a),d=E(c),e=F(c);d.removeClass("hidden");e.addClass("hidden");b.slideUp({duration:150,queue:!1}).fadeOut(150)},J=null,K=function(a){return function(){var b=s(regeneratorRuntime.mark(function b(c){var d,g,h,i;return regeneratorRuntime.wrap(function(b){while(1){switch(b.prev=b.next){case 0:d=y(c);g=B(c);h=A(c);if(N(d)){b.next=15;break}b.prev=4;b.next=7;return O(a,h,c);case 7:i=b.sent;f.default.appendNodeContents(d,i,"");b.next=14;break;case 11:b.prev=11;b.t0=b["catch"](4);e.default.exception(b.t0);case 14:("function"==typeof t.define&&t.define.amd?new Promise(function(a,b){t.require(["core/yui"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&t.require&&"component"===t.require.loader?Promise.resolve(require(("core/yui"))):Promise.resolve(t["core/yui"])).then(function(a){return new Promise(function(b){a.use("moodle-core-formchangechecker",function(a){b(a)})})}).then(function(a){M.core_formchangechecker.init({formid:a.one(c[0].querySelector("form")).generateID()});return a}).catch();case 15:h.fadeOut(150,function(){var a=z(c);a.slideDown({duration:150,queue:!1,complete:function complete(){a.find("textarea").focus()}}).css("display","none").fadeIn(150);if(g.length&&D(c)){g.fadeIn(150);I(c)}});case 16:case"end":return b.stop();}}},b,null,[[4,11]])}));return function(){return b.apply(this,arguments)}}()},L=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,c=z(a),d=A(a),e=B(a);if(e.length&&D(a)){e.fadeOut(150);if(!G(a)){H(a,b)}}c.slideUp({duration:150,queue:!1,complete:function complete(){d.fadeIn(150)}}).fadeOut(200)},N=function(a){return 0<a.find(l.default.post.inpageReplyContent).length},O=function(a,b,c){var d=x(c),e=d.find(l.default.post.forumSubject).text(),g=d.find(l.default.post.authorName).text(),i=p({postid:c.data("post-id"),reply_url:b.attr("data-href"),sesskey:M.cfg.sesskey,parentsubject:e,parentauthorname:g,canreplyprivately:b.data("can-reply-privately"),postformat:h.default.CONTENT_FORMATS.MOODLE},a);return f.default.render("mod_forum/inpage_reply_v2",i)},P=function(a){B(a).find(l.default.post.replyCount).each(function(a,b){var c=parseInt(b.innerText,10);b.innerText=c+1})},Q=function(a){d.default.define(a,[d.default.events.activate]);c.default.init(a);a.on(d.default.events.activate,l.default.post.inpageReplyCreateButton,function(a,c){c.originalEvent.preventDefault();var d=u((0,b.default)(a.currentTarget));J(d)});a.on(d.default.events.activate,l.default.post.inpageReplyCancelButton,function(a,c){c.originalEvent.preventDefault();var d=u((0,b.default)(a.currentTarget));L(d)});a.on(d.default.events.activate,l.default.post.showReplies,function(a,c){c.originalEvent.preventDefault();var d=u((0,b.default)(a.target));H(d)});a.on(d.default.events.activate,l.default.post.hideReplies,function(a,c){c.originalEvent.preventDefault();var d=u((0,b.default)(a.target));I(d)});a.on(h.default.EVENTS.POST_CREATED,l.default.post.inpageSubmitBtn,function(a,c){var d=(0,b.default)(a.currentTarget),e=u(d),f=w(d);L(e,c);f.each(function(a,c){P((0,b.default)(c))})})},R=function(a,b){J=K(b);Q(a);g.default.init(a);h.default.init(a);var c=a.find(l.default.discussion.tools);i.default.init(c,!1);j.default.init(c,!1,function(a,b){var c=b.userstate.favourited?0:1;return a.data("targetstate",c)});k.default.init(c,!1,function(a,b){var c=b.pinned?0:1;return a.data("targetstate",c)});m.default.init(c,!1,function(a,b){var c=b.userstate.subscribed?0:1;a.data("targetstate",c)})};a.init=R});
define ("mod_forum/forum_events",[],function(){return{SUBSCRIPTION_TOGGLED:"mod_forum/subscription_toggle:subscriptionToggled"}});
define ("mod_forum/lock_toggle",["jquery","core/templates","core/notification","mod_forum/repository","mod_forum/selectors"],function(a,b,c,d,e){return{init:function registerEventListeners(b,f){b.on("click",e.lock.toggle,function(b){var e=a(this),g=e.data("forumid"),h=e.data("discussionid"),i=e.data("state");d.setDiscussionLockState(g,h,i).then(function(){return location.reload()}).catch(c.exception);if(f){b.preventDefault()}})}}});
define ("mod_forum/discussion_list",["jquery","core/templates","core/str","core/notification","mod_forum/subscription_toggle","mod_forum/selectors","mod_forum/repository","core/pubsub","mod_forum/forum_events"],function(a,b,c,d,e,f,g,h,i){var j=function(e){h.subscribe(i.SUBSCRIPTION_TOGGLED,function(a){var b=a.discussionId,c=a.subscriptionState,d=e.find(f.discussion.item+"[data-discussionid= "+b+"]"),g=d.find(f.discussion.subscribedLabel);if(c){d.addClass("subscribed");g.removeAttr("hidden")}else{d.removeClass("subscribed");g.attr("hidden",!0)}});e.on("click",f.favourite.toggle,function(){var b=a(this),c=b.data("forumid"),e=b.data("discussionid"),f=b.data("targetstate");g.setFavouriteDiscussionState(c,e,f).then(function(){return location.reload()}).catch(d.exception)});e.on("click",f.pin.toggle,function(b){b.preventDefault();var c=a(this),e=c.data("forumid"),f=c.data("discussionid"),h=c.data("targetstate");g.setPinDiscussionState(e,f,h).then(function(){return location.reload()}).catch(d.exception)});e.on("click",f.lock.toggle,function(h){var e=a(this),i=e.data("forumid"),j=e.data("discussionid"),k=e.data("state");g.setDiscussionLockState(i,j,k).then(function(a){var b=e.parents(f.summary.actions).find(f.lock.icon),c=e.parents(f.discussion.item).find(f.discussion.lockedLabel);if(a.locked){b.removeClass("hidden");c.removeAttr("hidden")}else{b.addClass("hidden");c.attr("hidden",!0)}return a}).then(function(a){a.forumid=i;return b.render("mod_forum/discussion_lock_toggle",a)}).then(function(a,c){return b.replaceNode(e,a,c)}).then(function(){return c.get_string("lockupdated","forum").done(function(a){return d.addNotification({message:a,type:"info"})})}).catch(d.exception);h.preventDefault()})};return{init:function init(a){e.init(a,!1,function(a,b){var d=a.attr("id"),e=b.userstate.subscribed?0:1;a.data("targetstate",e);var f=b.userstate.subscribed?"unsubscribediscussion":"subscribediscussion";return c.get_string(f,"mod_forum").then(function(b){a.closest("td").find("label[for=\""+d+"\"]").find("span").text(b);return b})});j(a)}}});
define ("mod_forum/form-user-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h,i=a(d).attr("courseid");h=b.call([{methodname:"core_enrol_search_users",args:{courseid:i,search:e,searchanywhere:!0,page:0,perpage:30}}]);h[0].then(function(b){var d=[],e=0;a.each(b,function(a,b){d.push(c.render("mod_forum/form-user-selector-suggestion",b))});return a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[e];e++});f(b)})}).fail(g)}}});
define ("mod_forum/discussion",["jquery","core/custom_interaction_events","mod_forum/selectors","core/pubsub","mod_forum/forum_events","core/str","core/notification"],function(a,b,c,d,e,f,g){var h=function(a){var b=a.prev(c.post.post);if(b.length){var d=b.find(c.post.post).last();if(d.length){d.focus()}else{b.focus()}}else{a.parents(c.post.post).first().focus()}},i=function(b){var d=b.find(c.post.post).first();if(d.length){d.focus()}else{var e=b.next(c.post.post);if(e.length){e.focus()}else{for(var f=b.parents(c.post.post).toArray(),g=0,h;g<f.length;g++){h=a(f[g]).next(c.post.post);if(h.length){h.focus();break}}}}},j=function(b){var d=a(b).closest(c.post.inpageReplyContent);return d.length?!0:!1},k=function(k){var l=k.find(c.post.post);l.each(function(b,d){var e=a(d).find(c.post.action),f=e.first();e.attr("tabindex","-1");f.attr("tabindex",0)});b.define(k,[b.events.up,b.events.down,b.events.next,b.events.previous,b.events.home,b.events.end]);k.on(b.events.up,function(b,d){var e=document.activeElement;if(j(e)){return}var f=a(e).closest(c.post.post);if(f.length){h(f)}else{k.find(c.post.post).first().focus()}d.originalEvent.preventDefault()});k.on(b.events.down,function(b,d){var e=document.activeElement;if(j(e)){return}var f=a(e).closest(c.post.post);if(f.length){i(f)}else{k.find(c.post.post).first().focus()}d.originalEvent.preventDefault()});k.on(b.events.home,function(a,b){if(j(document.activeElement)){return}k.find(c.post.post).first().focus();b.originalEvent.preventDefault()});k.on(b.events.end,function(a,b){if(j(document.activeElement)){return}k.find(c.post.post).last().focus();b.originalEvent.preventDefault()});k.on(b.events.next,c.post.action,function(b,d){var e=a(b.target),f=e.closest(c.post.actionsContainer),g=f.find(c.post.action),h=e.next(c.post.action);g.attr("tabindex","-1");if(!h.length){h=g.first()}h.attr("tabindex",0);h.focus();d.originalEvent.preventDefault()});k.on(b.events.previous,c.post.action,function(b,d){var e=a(b.target),f=e.closest(c.post.actionsContainer),g=f.find(c.post.action),h=e.prev(c.post.action);g.attr("tabindex","-1");if(!h.length){h=g.last()}h.attr("tabindex",0);h.focus();d.originalEvent.preventDefault()});k.on(b.events.home,c.post.action,function(b,d){var e=a(b.target),f=e.closest(c.post.actionsContainer),g=f.find(c.post.action),h=g.first();g.attr("tabindex","-1");h.attr("tabindex",0);h.focus();b.stopPropagation();d.originalEvent.preventDefault()});k.on(b.events.end,c.post.action,function(b,d){var e=a(b.target),f=e.closest(c.post.actionsContainer),g=f.find(c.post.action),h=g.last();g.attr("tabindex","-1");h.attr("tabindex",0);h.focus();b.stopPropagation();d.originalEvent.preventDefault()});d.subscribe(e.SUBSCRIPTION_TOGGLED,function(a){var b=a.subscriptionState,c=b?"discussionsubscribed":"discussionunsubscribed";f.get_string(c,"forum").then(function(a){return g.addNotification({message:a,type:"info"})}).catch(g.exception)})};return{init:function init(a){k(a)}}});
define ("mod_forum/local/layouts",["exports","./layout/fullscreen"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"createFullScreenWindow",{enumerable:!0,get:function get(){return b.createLayout}})});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("mod_forum/local/layout/fullscreen",["exports","core/loadingicon","core/toast","core/local/aria/focuslock"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.createLayout=void 0;d=f(d);function e(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;e=function(){return a};return a}function f(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=e();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if(Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;if(g&&(g.get||g.set)){Object.defineProperty(c,f,g)}else{c[f]=a[f]}}}c.default=a;if(b){b.set(a,c)}return c}var g=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.fullscreen,e=void 0===b?!0:b,f=a.showLoader,g=void 0===f?!1:f,j=a.focusOnClose,k=void 0===j?null:j,l=document.createElement("div");document.body.append(l);l.classList.add("layout");l.classList.add("fullscreen");l.setAttribute("role","application");(0,c.addToastRegion)(l);i();d.trapFocus(l);var m=h(l,d,k);if(g){m.showLoadingIcon()}if(e){m.requestFullscreen()}return m};a.createLayout=g;var h=function(a,c,d){var e=document.createElement("div");a.append(e);var f=document.createElement("div");a.append(f);var g=function(){if(a.requestFullscreen){a.requestFullscreen()}else if(a.msRequestFullscreen){a.msRequestFullscreen()}else if(a.mozRequestFullscreen){a.mozRequestFullscreen()}else if(a.webkitRequestFullscreen){a.webkitRequestFullscreen()}else{a.setTop(0)}},h=function(){if(document.exitRequestFullScreen){if(document.fullScreenElement!==a){return}document.exitRequestFullScreen()}else if(document.msExitFullscreen){if(document.msFullscreenElement!==a){return}document.msExitFullscreen()}else if(document.mozCancelFullScreen){if(document.mozFullScreenElement!==a){return}document.mozCancelFullScreen()}else if(document.webkitExitFullscreen){if(document.webkitFullscreenElement!==a){return}document.webkitExitFullscreen()}},i=function(){var a=f.lastElementChild;while(a){f.removeChild(a);a=f.lastElementChild}};return{close:function close(){h();j();c.untrapFocus();a.remove();if(d){try{d.focus()}catch(a){}}},toggleFullscreen:function toggleFullscreen(){if(document.exitRequestFullScreen){if(document.fullScreenElement===a){h()}else{g()}}else if(document.msExitFullscreen){if(document.msFullscreenElement===a){h()}else{g()}}else if(document.mozCancelFullScreen){if(document.mozFullScreenElement===a){h()}else{g()}}else if(document.webkitExitFullscreen){if(document.webkitFullscreenElement===a){h()}else{g()}}},requestFullscreen:g,exitFullscreen:h,getContainer:function getContainer(){return e},setContent:function setContent(a){i();var b=e.lastElementChild;while(b){e.removeChild(b);b=e.lastElementChild}e.append(a)},showLoadingIcon:function showLoadingIcon(){(0,b.addIconToContainer)(f)},hideLoadingIcon:i}},i=function(){document.querySelector("body").classList.add("overflow-hidden")},j=function(){document.querySelector("body").classList.remove("overflow-hidden")}});
define ("mod_forum/local/grades/local/grader/user_picker/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={regions:{currentUser:"[data-region=\"user_picker/current_user\"]",userRegion:"[data-region=\"user_picker/user\"]"},actions:{changeUser:"[data-action=\"change-user\"]"}};return a.default});
define ("mod_forum/local/grades/local/grader/gradingpanel",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var d="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function b(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function c(a){return function(){var c=this,d=arguments;return new Promise(function(e,f){var i=a.apply(c,d);function g(a){b(i,e,f,g,h,"next",a)}function h(a){b(i,e,f,g,h,"throw",a)}g(void 0)})}}var e=function(){var a=c(regeneratorRuntime.mark(function a(b,c,e,f,g){var h,i;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:h="".concat(e,"/grades/grader/gradingpanel");if(f){h+="/".concat(f)}a.next=4;return"function"==typeof d.define&&d.define.amd?new Promise(function(a,b){d.require([h],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&d.require&&"component"===d.require.loader?Promise.resolve(require((h))):Promise.resolve(d[h]);case 4:i=a.sent;return a.abrupt("return",{getter:function(a){return i.fetchCurrentGrade(b,c,g,a)},setter:function(a,d,e){return i.storeCurrentGrade(b,c,g,a,d,e)}});case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.default=e;return a.default});
define ("mod_forum/local/grades/local/grader/user_picker",["exports","core/templates","./user_picker/selectors","core/str"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=e(b);c=e(c);function e(a){return a&&a.__esModule?a:{default:a}}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function i(a,b){return n(a)||m(a,b)||k(a,b)||j()}function j(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(a,b){if(!a)return;if("string"==typeof a)return l(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return l(a,b)}function l(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function m(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function n(a){if(Array.isArray(a))return a}function o(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function p(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){o(h,d,e,f,g,"next",a)}function g(a){o(h,d,e,f,g,"throw",a)}f(void 0)})}}function q(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function r(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function s(a,b,c){if(b)r(a.prototype,b);if(c)r(a,c);return a}var t=function(){function a(b,c,d){q(this,a);this.userList=b;this.showUserCallback=c;this.preChangeUserCallback=d;this.currentUserIndex=0;this.render=this.render.bind(this);this.setUserId=this.setUserId.bind(this)}s(a,[{key:"setUserId",value:function setUserId(a){var b=this.userList.findIndex(function(b){return b.id===parseInt(a)});if(-1===b){throw Error("User with id ".concat(a," not found"))}this.currentUserIndex=b}},{key:"render",value:function(){var a=p(regeneratorRuntime.mark(function a(){var c,d,e;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:this.root=document.createElement("div");a.next=3;return this.renderNavigator();case 3:c=a.sent;d=c.html;e=c.js;b.default.replaceNodeContents(this.root,d,e);a.next=9;return this.showUser(this.currentUser);case 9:this.registerEventListeners();case 10:case"end":return a.stop();}}},a,this)}));return function render(){return a.apply(this,arguments)}}()},{key:"renderNavigator",value:function renderNavigator(){return b.default.renderForPromise("".concat("mod_forum/local/grades/local/grader","/user_picker"),{})}},{key:"renderUserChange",value:function renderUserChange(a){return b.default.renderForPromise("".concat("mod_forum/local/grades/local/grader","/user_picker/user"),a)}},{key:"showUser",value:function(){var a=p(regeneratorRuntime.mark(function a(e){var f,g,h,j,k,l,m;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return Promise.all([this.renderUserChange(e),this.showUserCallback(e)]);case 2:f=a.sent;g=i(f,1);h=g[0];j=h.html;k=h.js;l=this.root.querySelector(c.default.regions.userRegion);b.default.replaceNodeContents(l,j,k);m=this.root.querySelector(c.default.regions.currentUser);a.next=12;return(0,d.get_string)("nowgradinguser","mod_forum",e.fullname);case 12:m.textContent=a.sent;case 13:case"end":return a.stop();}}},a,this)}));return function showUser(){return a.apply(this,arguments)}}()},{key:"registerEventListeners",value:function registerEventListeners(){var a=this;this.root.addEventListener("click",function(){var b=p(regeneratorRuntime.mark(function b(d){var e,f;return regeneratorRuntime.wrap(function(b){while(1){switch(b.prev=b.next){case 0:e=d.target.closest(c.default.actions.changeUser);if(!e){b.next=9;break}b.next=4;return a.preChangeUserCallback(a.currentUser);case 4:f=b.sent;if(f.failed){b.next=9;break}a.updateIndex(parseInt(e.dataset.direction));b.next=9;return a.showUser(a.currentUser);case 9:case"end":return b.stop();}}},b)}));return function(){return b.apply(this,arguments)}}())}},{key:"updateIndex",value:function updateIndex(a){this.currentUserIndex+=a;if(0>this.currentUserIndex){this.currentUserIndex=this.userList.length-1}else if(this.currentUserIndex>this.userList.length-1){this.currentUserIndex=0}return this.currentUserIndex}},{key:"currentUser",get:function get(){return g({},this.userList[this.currentUserIndex],{total:this.userList.length,displayIndex:this.currentUserIndex+1})}},{key:"rootNode",get:function get(){return this.root}}]);return a}(),u=function(){var a=p(regeneratorRuntime.mark(function a(b,c,d){var e,f,g,h,i=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:e=3<i.length&&i[3]!==void 0?i[3]:{},f=e.initialUserId,g=void 0===f?null:f;h=new t(b,c,d);if(g){h.setUserId(g)}a.next=5;return h.render();case 5:return a.abrupt("return",h);case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.default=u;return a.default});
define ("mod_forum/local/grades/local/grader/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;var b=function(a,b){return"[data-".concat(a,"=\"").concat(b,"\"]")},c={buttons:{toggleFullscreen:b("action","togglefullscreen"),closeGrader:b("action","closegrader"),collapseGradingDrawer:b("action","collapse-grading-drawer"),saveGrade:b("action","savegrade"),selectUser:b("action","select-user"),toggleSearch:b("action","toggle-search")},regions:{bodyContainer:b("region","body-container"),moduleContainer:b("region","module_content_container"),moduleReplace:b("region","module_content"),pickerRegion:b("region","user_picker"),gradingInfoContainer:b("region","grading-info-container"),gradingPanel:b("region","grade"),gradingPanelContainer:b("region","grading-panel-container"),gradingPanelErrors:b("region","grade-errors"),searchResultsContainer:b("region","search-results-container"),statusContainer:b("region","status-container"),userSearchContainer:b("region","user-search-container"),userSearchInput:b("region","user-search-input")},values:{sendStudentNotifications:"[data-region=\"notification\"] input[type=\"radio\"]:checked"}};a.default=c;return a.default});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("mod_forum/local/grades/grader",["exports","core/templates","./local/grader/selectors","./local/grader/user_picker","mod_forum/local/layout/fullscreen","./local/grader/gradingpanel","core/toast","core/notification","core/str","core_grades/grades/grader/gradingpanel/normalise","core/loadingicon","core/utils","core_grades/grades/grader/gradingpanel/comparison","core/modal_factory","core/modal_events","core/pubsub","core/drawer_events"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"getGradingPanelFunctions",{enumerable:!0,get:function get(){return f.default}});a.view=a.launch=void 0;b=t(b);c=t(c);d=t(d);f=t(f);n=s(n);o=s(o);q=t(q);function r(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;r=function(){return a};return a}function s(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=r();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function t(a){return a&&a.__esModule?a:{default:a}}function u(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function v(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){u(Object(c),!0).forEach(function(b){w(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{u(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function w(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function x(a,b){return C(a)||B(a,b)||z(a,b)||y()}function y(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function z(a,b){if(!a)return;if("string"==typeof a)return A(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return A(a,b)}function A(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function B(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function C(a){if(Array.isArray(a))return a}function D(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function E(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){D(h,d,e,f,g,"next",a)}function g(a){D(h,d,e,f,g,"throw",a)}f(void 0)})}}var F={grader:{app:"mod_forum/local/grades/grader",gradingPanel:{error:"mod_forum/local/grades/local/grader/gradingpanel/error"},searchResults:"mod_forum/local/grades/local/grader/user_picker/user_search",status:"mod_forum/local/grades/local/grader/status"}},G=function(a,d){var e=a.querySelector(c.default.regions.pickerRegion);b.default.replaceNodeContents(e,d,"")},H=function(a,b){return[a,b]},I=function(a,d,e,f){var g=!0;return function(){var h=E(regeneratorRuntime.mark(function h(i){var j,l,n,o,p,q,r,s,t,u,v,w,y,z;return regeneratorRuntime.wrap(function(h){while(1){switch(h.prev=h.next){case 0:j=g?null:(0,k.addIconToContainerWithPromise)(a);h.next=3;return Promise.all([d(i.id).then(H),e(i.id)]);case 3:l=h.sent;n=x(l,2);o=x(n[0],2);p=o[0];q=o[1];r=n[1];b.default.replaceNodeContents(a.querySelector(c.default.regions.moduleReplace),p,q);h.next=12;return b.default.render(r.templatename,r.grade).then(H);case 12:s=h.sent;t=x(s,2);u=t[0];v=t[1];w=a.querySelector(c.default.regions.gradingPanelContainer);y=w.querySelector(c.default.regions.gradingPanel);b.default.replaceNodeContents(y,u,v);z=y.querySelector("form");(0,m.fillInitialValues)(z);z.addEventListener("submit",function(a){f(i);a.preventDefault()});w.scrollTop=0;g=!1;if(j){j.resolve()}return h.abrupt("return",r);case 26:case"end":return h.stop();}}},h)}));return function(){return h.apply(this,arguments)}}()},J=function(a,b,c){a.classList.add("hidden");b.classList.add("hidden");c.classList.remove("hidden")},K=function(a,b,c){a.classList.remove("hidden");b.classList.remove("hidden");c.classList.add("hidden")},L=function(a,b,d){b.classList.remove("collapsed");a.setAttribute("aria-expanded","true");a.classList.add("expand");a.classList.remove("collapse");var e=b.parentElement.querySelector(c.default.regions.gradingInfoContainer);e.setAttribute("aria-hidden","true");var f=b.parentElement.querySelector(c.default.buttons.collapseGradingDrawer);f.setAttribute("aria-hidden","true");f.setAttribute("tabindex","-1");d.focus()},M=function(a,b,d){b.classList.add("collapsed");a.setAttribute("aria-expanded","false");a.classList.add("collapse");a.classList.remove("expand");a.focus();var e=b.parentElement.querySelector(c.default.regions.gradingInfoContainer);e.removeAttribute("aria-hidden");var f=b.parentElement.querySelector(c.default.buttons.collapseGradingDrawer);f.removeAttribute("aria-hidden");f.setAttribute("tabindex","0");d.value=""},N=function(a,b){if(""===b){return a}b=b.toLowerCase();return a.filter(function(a){return a.fullname.toLowerCase().includes(b)})},O=function(){var a=E(regeneratorRuntime.mark(function a(c,d){var e,f,g;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return b.default.renderForPromise(F.grader.searchResults,{users:d});case 2:e=a.sent;f=e.html;g=e.js;b.default.replaceNodeContents(c,f,g);case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),P=function(a,b,d,e){var f=a.getContainer(),g=f.querySelector(c.default.buttons.toggleSearch),h=f.querySelector(c.default.regions.userSearchContainer),i=h.querySelector(c.default.regions.userSearchInput),j=f.querySelector(c.default.regions.bodyContainer),k=f.querySelector(c.default.regions.pickerRegion),m=f.querySelector(c.default.regions.searchResultsContainer);f.addEventListener("click",function(f){if(f.target.closest(c.default.buttons.toggleFullscreen)){f.stopImmediatePropagation();f.preventDefault();a.toggleFullscreen();return}if(f.target.closest(c.default.buttons.closeGrader)){f.stopImmediatePropagation();f.preventDefault();a.close();return}if(f.target.closest(c.default.buttons.saveGrade)){d(b.currentUser)}if(f.target.closest(c.default.buttons.toggleSearch)){if("true"===g.getAttribute("aria-expanded")){M(g,h,i);K(j,k,m);m.innerHTML=""}else{L(g,h,i);J(j,k,m);O(m,e)}return}var l=f.target.closest(c.default.buttons.selectUser);if(l){var n=l.getAttribute("data-userid"),o=e.find(function(a){return a.id==n});b.setUserId(n);b.showUser(o);M(g,h,i);K(j,k,m);m.innerHTML=""}});i.addEventListener("input",(0,l.debounce)(function(){var a=N(e,i.value);O(m,a)},300));(0,p.subscribe)(q.default.DRAWER_HIDDEN,function(a){var b=a[0];if(b.querySelector(c.default.regions.gradingPanel)){Q(f,0)}});(0,p.subscribe)(q.default.DRAWER_SHOWN,function(a){var b=a[0];if(b.querySelector(c.default.regions.gradingPanel)){Q(f,b.offsetWidth)}})},Q=function(a,b){var d=a.querySelector(c.default.regions.moduleContainer);if(d){d.style.marginRight="".concat(b,"px")}},R=function(a,b){return function(){var d=E(regeneratorRuntime.mark(function d(e){var f;return regeneratorRuntime.wrap(function(d){while(1){switch(d.prev=d.next){case 0:d.prev=0;a.querySelector(c.default.regions.gradingPanelErrors).innerHTML="";d.next=4;return b(e.id,a.querySelector(c.default.values.sendStudentNotifications).value,a.querySelector(c.default.regions.gradingPanel));case 4:f=d.sent;if(!f.success){d.next=11;break}d.t0=g.add;d.next=9;return(0,i.get_string)("grades:gradesavedfor","mod_forum",e);case 9:d.t1=d.sent;(0,d.t0)(d.t1);case 11:if(f.failed){S(a,e,f.error)}return d.abrupt("return",f);case 15:d.prev=15;d.t2=d["catch"](0);S(a,e,d.t2);return d.abrupt("return",(0,j.failedUpdate)(d.t2));case 19:case"end":return d.stop();}}},d,null,[[0,15]])}));return function(){return d.apply(this,arguments)}}()},S=function(){var a=E(regeneratorRuntime.mark(function a(d,e,f){var h,j,k,l,m,n;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.t0=Promise;a.t1=b.default.renderForPromise(F.grader.gradingPanel.error,{error:f});a.next=4;return(0,i.get_string)("grades:gradesavefailed","mod_forum",v({error:f.message},e));case 4:a.t2=a.sent;a.t3=[a.t1,a.t2];a.next=8;return a.t0.all.call(a.t0,a.t3);case 8:h=a.sent;j=x(h,2);k=j[0];l=k.html;m=k.js;n=j[1];b.default.replaceNodeContents(d.querySelector(c.default.regions.gradingPanelErrors),l,m);(0,g.add)(n);case 16:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),T=function(){var a=E(regeneratorRuntime.mark(function a(f,g,j,k){var l,m,n,o,p,q,r,s,t,u,v,w,y,z,A,B,C,D,H,J,K,L,M=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:l=4<M.length&&M[4]!==void 0?M[4]:{},m=l.initialUserId,n=void 0===m?null:m,o=l.moduleName,p=l.courseName,q=l.courseUrl,r=l.sendStudentNotifications,s=l.focusOnClose,t=void 0===s?null:s;a.next=3;return f();case 3:u=a.sent;if(u.length){a.next=12;break}a.t0=h.addNotification;a.next=8;return(0,i.get_string)("nouserstograde","core_grades");case 8:a.t1=a.sent;a.t2={message:a.t1,type:"error"};(0,a.t0)(a.t2);return a.abrupt("return");case 12:a.next=14;return Promise.all([(0,e.createLayout)({fullscreen:!1,showLoader:!1,focusOnClose:t}),b.default.renderForPromise(F.grader.app,{moduleName:o,courseName:p,courseUrl:q,drawer:{show:!0},defaultsendnotifications:r})]);case 14:v=a.sent;w=x(v,2);y=w[0];z=w[1];A=z.html;B=z.js;C=y.getContainer();D=R(C,k);b.default.replaceNodeContents(C,A,B);H=I(C,g,j,D);J=u.map(function(a){return a.id});K=C.querySelector(c.default.regions.statusContainer);a.next=28;return(0,d.default)(u,function(){var a=E(regeneratorRuntime.mark(function a(c){var d,e;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return H(c);case 2:d=a.sent;e={status:d.hasgrade,index:J.indexOf(c.id)+1,total:u.length};b.default.render(F.grader.status,e).then(function(a){K.innerHTML=a;return a}).catch();case 5:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),D,{initialUserId:n});case 28:L=a.sent;P(y,L,D,u);G(C,L.rootNode);case 31:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.launch=T;var U=function(){var a=E(regeneratorRuntime.mark(function a(c,d,e){var f,g,h,i,j,l,m,p,q,r,s,t,u,v,w,y,z,A=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:f=3<A.length&&A[3]!==void 0?A[3]:{},g=f.focusOnClose,h=void 0===g?null:g;a.next=3;return Promise.all([c(d),n.create({title:e,large:!0,type:n.types.CANCEL})]);case 3:i=a.sent;j=x(i,2);l=j[0];m=j[1];p=(0,k.addIconToContainerWithPromise)(m.getRoot());m.getRoot().on(o.hidden,function(){m.destroy();if(h){try{h.focus()}catch(a){}}});m.show();q=document.createElement("div");a.next=13;return b.default.renderForPromise("mod_forum/local/grades/view_grade",l);case 13:r=a.sent;s=r.html;t=r.js;b.default.replaceNodeContents(q,s,t);a.next=19;return V(l);case 19:u=a.sent;v=x(u,2);w=v[0];y=v[1];z=q.querySelector("[data-region=\"grade-template\"]");b.default.replaceNodeContents(z,w,y);m.setBody(q.outerHTML);p.resolve();case 27:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.view=U;var V=function(){var a=E(regeneratorRuntime.mark(function a(c){var d,e,f;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return b.default.renderForPromise(c.templatename,c.grade);case 2:d=a.sent;e=d.html;f=d.js;return a.abrupt("return",[e,f]);case 6:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}()});
define ("mod_forum/posts_list",["jquery","core/templates","core/notification","core/pending","core/yui","mod_forum/selectors","mod_forum/inpage_reply"],function(a,b,c,d,e,f,g){var h=function(h){h.on("click",f.post.inpageReplyLink,function(h){h.preventDefault();if(window.location.hash){var i=window.location.href.split("#")[0];history.pushState({},document.title,i)}var j=new d("inpage-reply"),k=a(h.currentTarget).parents(f.post.forumCoreContent),l=k.find(f.post.forumSubject),m=a(h.currentTarget).parents(f.post.forumContent),n={postid:a(m).data("post-id"),reply_url:a(h.currentTarget).attr("href"),sesskey:M.cfg.sesskey,parentsubject:l.data("replySubject"),canreplyprivately:a(h.currentTarget).data("can-reply-privately"),postformat:g.CONTENT_FORMATS.MOODLE};if(!m.find(f.post.inpageReplyContent).length){b.render("mod_forum/inpage_reply",n).then(function(a,c){return b.appendNodeContents(k,a,c)}).then(function(){return m.find(f.post.inpageReplyContent).slideToggle(300,j.resolve).find("textarea").focus()}).then(function(){e.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.init({formid:"inpage-reply-".concat(n.postid)})})}).fail(c.exception)}else{var o=m.find(f.post.inpageReplyContent);o.slideToggle(300,j.resolve);if(o.is(":visible")){o.find("textarea").focus()}}})};return{init:function init(a){h(a);g.init(a)}}});
define ("mod_forum/grades/grader/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={launch:"[data-grade-action=\"launch\"]",gradableItem:"[data-gradable-itemtype]",gradableItems:{wholeForum:"[data-gradable-itemtype=\"forum\"]"},expandConversation:"[data-action=\"view-context\"]",posts:"[data-region=\"posts\"]",viewGrade:"[data-grade-action=\"view\"]"};return a.default});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("mod_forum/grades/expandconversation",["exports","./grader/selectors","mod_forum/repository","core/notification","core/templates","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.registerEventListeners=void 0;b=j(b);c=h(c);e=h(e);f=j(f);g=j(g);function h(a){return a&&a.__esModule?a:{default:a}}function i(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;i=function(){return a};return a}function j(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=i();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function k(a,b){return r(a)||q(a,b)||m(a,b)||l()}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(a,b){if(!a)return;if("string"==typeof a)return p(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return p(a,b)}function p(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function q(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function r(a){if(Array.isArray(a))return a}function s(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function t(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){s(h,d,e,f,g,"next",a)}function g(a){s(h,d,e,f,g,"throw",a)}f(void 0)})}}var u=function(a){return a.closest(b.expandConversation)},v=function(){var a=t(regeneratorRuntime.mark(function a(b){var d,h,i,j,l,m,n,o,p,q,r,s,t,u,v=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d=1<v.length&&v[1]!==void 0?v[1]:{},h=d.focusOnClose,i=void 0===h?null:h;j=b.dataset.postid;l=b.dataset.discussionid;m=b.dataset.name;n="1"==b.dataset.experimentalDisplayMode;a.next=7;return Promise.all([c.default.getDiscussionPosts(parseInt(l)),f.create({title:m,large:!0,type:f.types.CANCEL})]);case 7:o=a.sent;p=k(o,2);q=p[0];r=p[1];s=new Map(q.posts.map(function(a){a.readonly=!0;a.hasreplies=!1;a.replies=[];return[a.id,a]}));t=[];q.posts.forEach(function(a){if(a.parentid){var b=s.get(a.parentid);if(b){a.parentauthorname=b.author.fullname;b.hasreplies=!0;b.replies.push(a)}else{t.push(a)}}else{t.push(a)}});r.getRoot().on(g.hidden,function(){r.destroy();try{i.focus()}catch(a){}});r.getRoot().on(g.bodyRendered,function(){var a=r.getRoot()[0].querySelector("#p".concat(j));if(a){a.scrollIntoView({behavior:"smooth"})}});r.show();u=e.default.render("mod_forum/grades/grader/discussion/post_modal",{posts:t,experimentaldisplaymode:n});r.setBody(u);case 19:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.registerEventListeners=function registerEventListeners(a){a.addEventListener("click",function(a){var b=u(a.target);if(b){a.preventDefault();try{v(b,{focusOnClose:a.target})}catch(a){(0,d.exception)(a)}}})}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("mod_forum/grades/grader",["exports","./grader/selectors","mod_forum/repository","core/templates","../local/grades/grader","core/notification","core_course/repository","core/url"],function(a,b,c,d,e,f,g,h){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.registerLaunchListeners=void 0;b=k(b);c=i(c);d=i(d);e=k(e);f=i(f);g=i(g);function i(a){return a&&a.__esModule?a:{default:a}}function j(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;j=function(){return a};return a}function k(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=j();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function l(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function m(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){l(Object(c),!0).forEach(function(b){n(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{l(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function n(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function o(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function p(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){o(h,d,e,f,g,"next",a)}function g(a){o(h,d,e,f,g,"throw",a)}f(void 0)})}}var q={contentRegion:"mod_forum/grades/grader/discussion/posts"},r=function(a,b){return function(e){return c.default.getDiscussionByUserID(e,a).then(function(a){a.discussions=a.discussions.map(u);a.experimentaldisplaymode=b?!0:!1;return d.default.render(q.contentRegion,a)}).catch(f.default.exception)}},s=function(a,b){return p(regeneratorRuntime.mark(function c(){var d;return regeneratorRuntime.wrap(function(c){while(1){switch(c.prev=c.next){case 0:c.next=2;return g.default.getUsersFromCourseModuleID(a,b);case 2:d=c.sent;return c.abrupt("return",d.users);case 4:case"end":return c.stop();}}},c)}))},t=function(a){return a.closest(b.gradableItem)},u=function(a){var b=new Map;a.posts.parentposts.forEach(function(a){return b.set(a.id,a)});var c=a.posts.userposts.map(function(a){a.readonly=!0;a.hasreplies=!1;a.replies=[];var c=a.parentid?b.get(a.parentid):null;if(c){c.hasreplies=!1;c.replies=[];c.readonly=!0;a.parentauthorname=c.author.fullname}return{parent:c,post:a}});return m({},a,{posts:c})},v=function(){var a=p(regeneratorRuntime.mark(function a(b){var c,d,f,g,i,j,k=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c=1<k.length&&k[1]!==void 0?k[1]:{},d=c.focusOnClose,f=void 0===d?null:d;g=b.dataset;a.next=4;return e.getGradingPanelFunctions("mod_forum",g.contextid,g.gradingComponent,g.gradingComponentSubtype,g.gradableItemtype);case 4:i=a.sent;j=g.group?g.group:0;a.next=8;return e.launch(s(g.cmid,j),r(g.cmid,"1"==g.experimentalDisplayMode),i.getter,i.setter,{groupid:g.groupid,initialUserId:g.initialuserid,moduleName:g.name,courseName:g.courseName,courseUrl:(0,h.relativeUrl)("/course/view.php",{id:g.courseId}),sendStudentNotifications:g.sendStudentNotifications,focusOnClose:f});case 8:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),w=function(){var a=p(regeneratorRuntime.mark(function a(b){var c,d,f,g,h,i=arguments;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c=1<i.length&&i[1]!==void 0?i[1]:{},d=c.focusOnClose,f=void 0===d?null:d;g=b.dataset;a.next=4;return e.getGradingPanelFunctions("mod_forum",g.contextid,g.gradingComponent,g.gradingComponentSubtype,g.gradableItemtype);case 4:h=a.sent;a.next=7;return e.view(h.getter,g.userid,g.name,{focusOnClose:f});case 7:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.registerLaunchListeners=function registerLaunchListeners(){document.addEventListener("click",function(){var a=p(regeneratorRuntime.mark(function a(c){var d,e;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:if(!c.target.matches(b.launch)){a.next=17;break}d=t(c.target);if(d){a.next=4;break}throw Error("Unable to find a gradable item");case 4:if(!d.matches(b.gradableItems.wholeForum)){a.next=16;break}c.preventDefault();a.prev=6;a.next=9;return v(d,{focusOnClose:c.target});case 9:a.next=14;break;case 11:a.prev=11;a.t0=a["catch"](6);f.default.exception(a.t0);case 14:a.next=17;break;case 16:throw Error("Unable to find a valid gradable item");case 17:if(!c.target.matches(b.viewGrade)){a.next=35;break}c.preventDefault();e=t(c.target);if(e){a.next=22;break}throw Error("Unable to find a gradable item");case 22:if(!e.matches(b.gradableItems.wholeForum)){a.next=34;break}c.preventDefault();a.prev=24;a.next=27;return w(e,{focusOnClose:c.target});case 27:a.next=32;break;case 29:a.prev=29;a.t1=a["catch"](24);f.default.exception(a.t1);case 32:a.next=35;break;case 34:throw Error("Unable to find a valid gradable item");case 35:case"end":return a.stop();}}},a,null,[[6,11],[24,29]])}));return function(){return a.apply(this,arguments)}}())}});
define ("mod_forum/favourite_toggle",["jquery","core/templates","core/notification","mod_forum/repository","mod_forum/selectors","core/str"],function(a,b,c,d,e,f){return{init:function registerEventListeners(b,g,h){b.on("click",e.favourite.toggle,function(b){var e=a(this),i=e.data("forumid"),j=e.data("discussionid"),k=e.data("targetstate");d.setFavouriteDiscussionState(i,j,k).then(function(a){return h(e,a)}).then(function(){return f.get_string("favouriteupdated","forum").done(function(a){return c.addNotification({message:a,type:"info"})})}).catch(c.exception);if(g){b.preventDefault()}})}}});
define ("mod_forum/pin_toggle",["jquery","core/ajax","core/str","core/templates","core/notification","mod_forum/repository","mod_forum/selectors","core/str"],function(a,b,c,d,f,g,h,i){return{init:function registerEventListeners(b,c,d){b.on("click",h.pin.toggle,function(b){var e=a(this),h=e.data("forumid"),j=e.data("discussionid"),k=e.data("targetstate");g.setPinDiscussionState(h,j,k).then(function(a){return d(e,a)}).then(function(){return i.get_string("pinupdated","forum").done(function(a){return f.addNotification({message:a,type:"info"})})}).fail(f.exception);if(c){b.preventDefault()}})}}});
define ("mod_forum/inpage_reply",["jquery","core/templates","core/notification","mod_forum/repository","mod_forum/selectors"],function(a,b,c,d,f){var g={NESTED_V2:4,THREADED:2,NESTED:3,FLAT_OLDEST_FIRST:1,FLAT_NEWEST_FIRST:-1},h={POST_CREATED:"mod_forum-post-created"},i={MOODLE:0},j=function(a){var b=a.find(f.post.inpageSubmitBtnText),c=a.find(f.post.loadingIconContainer),d=a.outerWidth();a.css("width",d);b.addClass("hidden");c.removeClass("hidden")},k=function(a){var b=a.find(f.post.inpageSubmitBtnText),c=a.find(f.post.loadingIconContainer);a.css("width","");b.removeClass("hidden");c.addClass("hidden")},l=function(l){l.on("click",f.post.inpageSubmitBtn,function(m){m.preventDefault();var e=a(m.currentTarget),n=e.parent().find(f.post.inpageReplyButton),o=e.parents(f.post.inpageReplyForm).get(0),p=o.elements.post.value.trim(),q=i.MOODLE,r=o.elements.reply.value,s=o.elements.subject.value,t=e.closest(f.post.post),u=o.elements.privatereply!=void 0?o.elements.privatereply.checked:!1,v=l.find(f.post.modeSelect),w=v.length?parseInt(v.get(0).value):null,x;if(p.length){j(e);n.prop("disabled",!0);d.addDiscussionPost(r,s,p,q,u,!0).then(function(a){var b=a.messages.reduce(function(a,b){if("success"==b.type){a+="<p>"+b.message+"</p>"}return a},"");c.addNotification({message:b,type:"success"});return a}).then(function(a){o.reset();var c=a.post;x=c.id;switch(w){case g.NESTED_V2:var d=c.capabilities,e=t.children().not(f.post.repliesContainer).find(f.post.authorName).text();c.parentauthorname=e;c.showactionmenu=d.view||d.controlreadstatus||d.edit||d.split||d.delete||d.export||c.urls.viewparent;return b.render("mod_forum/forum_discussion_nested_v2_post_reply",c);case g.THREADED:return b.render("mod_forum/forum_discussion_threaded_post",c);case g.NESTED:return b.render("mod_forum/forum_discussion_nested_post",c);default:return b.render("mod_forum/forum_discussion_post",c);}}).then(function(a,c){var d=t.find(f.post.repliesContainer).first();if(w==g.FLAT_NEWEST_FIRST){return b.prependNodeContents(d,a,c)}else{return b.appendNodeContents(d,a,c)}}).then(function(){e.trigger(h.POST_CREATED,x);k(e);n.prop("disabled",!1);if("undefined"!=typeof M.core_formchangechecker){M.core_formchangechecker.reset_form_dirty_state()}return t.find(f.post.inpageReplyContent).hide()}).then(function(){location.href="#p"+x}).catch(function(a){k(e);n.prop("disabled",!1);return c.exception(a)})}})};return{init:function init(a){l(a)},CONTENT_FORMATS:i,EVENTS:h}});
define ("mod_forum/selectors",[],function(){return{subscription:{toggle:"[data-type='subscription-toggle'][data-action='toggle']"},summary:{actions:"[data-container='discussion-summary-actions']"},post:{post:"[data-region=\"post\"]",action:"[data-region=\"post-action\"]",actionsContainer:"[data-region=\"post-actions-container\"]",authorName:"[data-region=\"author-name\"]",forumCoreContent:"[data-region-content='forum-post-core']",forumContent:"[data-content='forum-post']",forumSubject:"[data-region-content='forum-post-core-subject']",inpageReplyButton:"button",inpageReplyLink:"[data-action='collapsible-link']",inpageReplyCancelButton:"[data-action='cancel-inpage-reply']",inpageReplyCreateButton:"[data-action='create-inpage-reply']",inpageReplyContainer:"[data-region=\"inpage-reply-container\"]",inpageReplyContent:"[data-content='inpage-reply-content']",inpageReplyForm:"form[data-content='inpage-reply-form']",inpageSubmitBtn:"[data-action='forum-inpage-submit']",inpageSubmitBtnText:"[data-region='submit-text']",loadingIconContainer:"[data-region='loading-icon-container']",repliesContainer:"[data-region='replies-container']",replyCount:"[data-region=\"reply-count\"]",modeSelect:"select[name='mode']",showReplies:"[data-action=\"show-replies\"]",hideReplies:"[data-action=\"hide-replies\"]",repliesVisibilityToggleContainer:"[data-region=\"replies-visibility-toggle-container\"]"},lock:{toggle:"[data-action='toggle'][data-type='lock-toggle']",icon:"[data-region='locked-icon']"},favourite:{toggle:"[data-type='favorite-toggle'][data-action='toggle']"},pin:{toggle:"[data-type='pin-toggle'][data-action='toggle']"},discussion:{tools:"[data-container=\"discussion-tools\"]",item:"[data-region=\"discussion-list-item\"]",lockedLabel:"[data-region='locked-label']",subscribedLabel:"[data-region='subscribed-label']",timedLabel:"[data-region='timed-label']"}}});
define ("mod_forum/repository",["core/ajax"],function(a){return{setDiscussionSubscriptionState:function setDiscussionSubscriptionState(b,c,d){return a.call([{methodname:"mod_forum_set_subscription_state",args:{forumid:b,discussionid:c,targetstate:d}}])[0]},addDiscussionPost:function addDiscussionPost(b,c,d,e,f,g){return a.call([{methodname:"mod_forum_add_discussion_post",args:{postid:b,message:d,messageformat:e,subject:c,options:[{name:"private",value:f},{name:"topreferredformat",value:g}]}}])[0]},setDiscussionLockState:function setDiscussionLockState(b,c,d){return a.call([{methodname:"mod_forum_set_lock_state",args:{forumid:b,discussionid:c,targetstate:d}}])[0]},setFavouriteDiscussionState:function setFavouriteDiscussionState(b,c,d){return a.call([{methodname:"mod_forum_toggle_favourite_state",args:{discussionid:c,targetstate:d}}])[0]},setPinDiscussionState:function setPinDiscussionState(b,c,d){return a.call([{methodname:"mod_forum_set_pin_state",args:{discussionid:c,targetstate:d}}])[0]},getDiscussionByUserID:function getDiscussionByUserID(b,c){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"modified",e=3<arguments.length&&arguments[3]!==void 0?arguments[3]:"DESC";return a.call([{methodname:"mod_forum_get_discussion_posts_by_userid",args:{userid:b,cmid:c,sortby:d,sortdirection:e}}])[0]},getDiscussionPosts:function getDiscussionPosts(b){var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"created",d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"ASC";return a.call([{methodname:"mod_forum_get_discussion_posts",args:{discussionid:b,sortby:c,sortdirection:d}}])[0]}}});
define ("mod_forum/subscription_toggle",["jquery","core/templates","core/notification","mod_forum/repository","mod_forum/selectors","core/pubsub","mod_forum/forum_events"],function(a,b,c,d,e,f,g){return{init:function registerEventListeners(b,h,i){b.on("click",e.subscription.toggle,function(b){var e=a(this),j=e.data("forumid"),k=e.data("discussionid"),l=e.data("targetstate");d.setDiscussionSubscriptionState(j,k,l).then(function(a){f.publish(g.SUBSCRIPTION_TOGGLED,{discussionId:k,subscriptionState:l});return i(e,a)}).catch(c.exception);if(h){b.preventDefault()}})}}});
define ("mod_lti/tool_configure_controller",["jquery","core/ajax","core/notification","core/templates","mod_lti/events","mod_lti/keys","mod_lti/tool_type","mod_lti/tool_proxy","core/str"],function(a,b,c,d,e,f,g,h,i){var j={EXTERNAL_REGISTRATION_CONTAINER:"#external-registration-container",EXTERNAL_REGISTRATION_PAGE_CONTAINER:"#external-registration-page-container",EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER:"#external-registration-template-container",CARTRIDGE_REGISTRATION_CONTAINER:"#cartridge-registration-container",CARTRIDGE_REGISTRATION_FORM:"#cartridge-registration-form",ADD_TOOL_FORM:"#add-tool-form",TOOL_LIST_CONTAINER:"#tool-list-container",TOOL_CREATE_BUTTON:"#tool-create-button",TOOL_CREATE_LTILEGACY_BUTTON:"#tool-createltilegacy-button",REGISTRATION_CHOICE_CONTAINER:"#registration-choice-container",TOOL_URL:"#tool-url"},k=function(){return a(j.TOOL_LIST_CONTAINER)},l=function(){return a(j.EXTERNAL_REGISTRATION_CONTAINER)},m=function(){return a(j.CARTRIDGE_REGISTRATION_CONTAINER)},n=function(){return a(j.REGISTRATION_CHOICE_CONTAINER)},o=function(b){if(b.data&&"org.imsglobal.lti.close"===b.data.subject){a(j.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER).empty();r();w();z();w();D()}},p=function(b){a(j.EXTERNAL_REGISTRATION_PAGE_CONTAINER).removeClass("hidden");var c=a(j.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER);c.append(a("<iframe src='startltiadvregistration.php?url="+encodeURIComponent(b)+"'></iframe>"));u();window.addEventListener("message",o,!1)},q=function(){return a(j.TOOL_URL).val()},r=function(){l().addClass("hidden")},s=function(){m().addClass("hidden")},t=function(){n().addClass("hidden")},u=function(){s();t();l().removeClass("hidden");x(l())},v=function(a){r();t();var b=m();b.find("input").val("");b.removeClass("hidden");b.find(j.CARTRIDGE_REGISTRATION_FORM).attr("data-cartridge-url",a);x(b)},w=function(){r();s();n().removeClass("hidden");x(n())},x=function(a){var b=a.children().detach();b.appendTo(a)},y=function(){k().addClass("hidden")},z=function(){k().removeClass("hidden")},A=function(a){var b=a.error?"error":"success";c.addNotification({message:a.message,type:b})},B=function(a){a.addClass("loading")},C=function(a){a.removeClass("loading")},D=function(){var b=a.Deferred(),e=k();B(e);a.when(g.query(),h.query({orphanedonly:!0})).done(function(a,c){d.render("mod_lti/tool_list",{tools:a,proxies:c}).done(function(a,c){e.empty();e.append(a);d.runTemplateJS(c);b.resolve()}).fail(b.reject)}).fail(b.reject);b.fail(c.exception).always(function(){C(e)})},E=function(){var b=q().trim();if(b){a(j.TOOL_URL).val("");y();p(b)}},F=function(){var b=q().trim();if(""===b){return a.Deferred().resolve()}var d=a(j.TOOL_CREATE_LTILEGACY_BUTTON);B(d);var f=g.isCartridge(b);f.always(function(){C(d)});f.done(function(c){if(c.iscartridge){a(j.TOOL_URL).val("");a(document).trigger(e.START_CARTRIDGE_REGISTRATION,b)}else{a(document).trigger(e.START_EXTERNAL_REGISTRATION,{url:b})}});f.fail(function(){i.get_string("errorbadurl","mod_lti").done(function(b){a(document).trigger(e.REGISTRATION_FEEDBACK,{message:b,error:!0})}).fail(c.exception)});return f},G=function(){a(document).on(e.NEW_TOOL_TYPE,function(){D()});a(document).on(e.START_EXTERNAL_REGISTRATION,function(){u();a(j.TOOL_URL).val("");y()});a(document).on(e.STOP_EXTERNAL_REGISTRATION,function(){z();w()});a(document).on(e.START_CARTRIDGE_REGISTRATION,function(a,b){v(b)});a(document).on(e.STOP_CARTRIDGE_REGISTRATION,function(){m().find(j.CARTRIDGE_REGISTRATION_FORM).removeAttr("data-cartridge-url");w()});a(document).on(e.REGISTRATION_FEEDBACK,function(a,b){A(b)});var b=a(j.TOOL_CREATE_LTILEGACY_BUTTON);b.click(function(a){a.preventDefault();F()});var c=a(j.TOOL_CREATE_BUTTON);c.click(function(a){a.preventDefault();E()})};return{init:function init(){G();D()}}});
define ("mod_lti/keys",[],function(){return{ENTER:13,SPACE:32}});
define ("mod_lti/external_registration",["jquery","core/ajax","core/notification","core/templates","mod_lti/events","mod_lti/tool_proxy","mod_lti/tool_type","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g,h,i){var j={EXTERNAL_REGISTRATION_CONTAINER:"#external-registration-page-container",EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER:"#external-registration-template-container",EXTERNAL_REGISTRATION_CANCEL_BUTTON:"#cancel-external-registration",TOOL_TYPE_CAPABILITIES_CONTAINER:"#tool-type-capabilities-container",TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER:"#tool-type-capabilities-template-container",CAPABILITIES_AGREE_CONTAINER:".capabilities-container"},k=function(){return a(j.EXTERNAL_REGISTRATION_CANCEL_BUTTON)},l=function(){return a(j.EXTERNAL_REGISTRATION_CONTAINER)},m=function(){return a(j.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER)},n=function(){return a(j.TOOL_TYPE_CAPABILITIES_CONTAINER)},o=function(){return a(j.TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER)},p=function(){n().addClass("loading")},q=function(){n().removeClass("loading")},r=function(){k().addClass("loading")},s=function(){k().removeClass("loading")},t=function(){n().addClass("hidden")},u=function(){n().removeClass("hidden")},v=function(){l().addClass("hidden")},w=function(){l().removeClass("hidden")},x=function(a){var b=k();b.attr("data-tool-proxy-id",a)},y=function(){var a=k();return a.attr("data-tool-proxy-id")},z=function(){var a=k();a.removeAttr("data-tool-proxy-id")},A=function(){return y()?!0:!1},B=function(){var a=k();return a.attr("data-tool-proxy-new")&&A()},C=function(){var a=k();return a.attr("data-tool-proxy-new","new")},D=function(){var a=k();return a.removeAttr("data-tool-proxy-new")},E=function(a){return b.call([{methodname:"mod_lti_get_tool_proxy_registration_request",args:{id:a}}])[0]},F=function(){r();var b=a.Deferred();if(B()){var d=y();f.delete(d).done(function(){b.resolve()}).fail(function(a){b.reject(a)})}else{b.resolve()}b.done(function(){L();s()}).fail(function(b){c.exception(b);L();s();i.get_string("failedtodeletetoolproxy","mod_lti").done(function(b){a(document).trigger(e.REGISTRATION_FEEDBACK,{message:b,error:!0})}).fail(c.exception)});return b},G=function(a){var b=d.render("mod_lti/tool_proxy_registration_form",a);b.done(function(a,b){var c=m();c.append(a);d.runTemplateJS(b);c.find("form").submit();w()}).fail(c.exception);return b},H=function(a){return g.update({id:a.id,state:g.constants.state.configured})},I=function(b){var f=a.Deferred();d.render("mod_lti/tool_type_capabilities_agree",b).done(function(a,c){var g=o();v();u();d.replaceNodeContents(g,a,c);var h=g.find(j.CAPABILITIES_AGREE_CONTAINER);h.on(e.CAPABILITIES_AGREE,function(){p();H(b).always(function(){q();g.empty();f.resolve()})});h.on(e.CAPABILITIES_DECLINE,function(){g.empty();f.resolve()})}).fail(f.reject);f.done(function(){t()}).fail(c.exception);return f},J=function(b){var c=a.Deferred();if(!b||""===b){c.resolve()}else{f.create({regurl:b}).done(function(a){C();c=K(a.id)}).fail(function(b){F();var d={message:b.message,error:!0};a(document).trigger(e.REGISTRATION_FEEDBACK,d);c.reject(b)})}return c},K=function(b){var c=a.Deferred();x(b);E(b).done(function(a){G(a).done(function(){c.resolve()}).fail(c.fail)}).fail(c.fail);return c},L=function(){if(A()){z()}D(!1);v();var b=m();b.empty();a(document).trigger(e.STOP_EXTERNAL_REGISTRATION)},M=function(){a(document).on(e.START_EXTERNAL_REGISTRATION,function(a,b){if(!b){return}if(b.url){J(b.url)}if(b.proxyid){K(b.proxyid)}});var b=k();b.click(function(a){a.preventDefault();F()});b.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==h.ENTER||a.keyCode==h.SPACE){a.preventDefault();F()}}});window.triggerExternalRegistrationComplete=function(b){var d=a.Deferred(),f={message:"",error:!1};if("success"==b.status){i.get_string("successfullycreatedtooltype","mod_lti").done(function(a){f.message=a}).fail(c.exception);d.done(function(){L();a(document).trigger(e.REGISTRATION_FEEDBACK,f);a(document).trigger(e.NEW_TOOL_TYPE)}).fail(c.exception);if(B()){var h=y();g.getFromToolProxyId(h).done(function(a){if(a&&a.length){var b=a[0];if(b.hascapabilitygroups){I(b).always(function(){d.resolve()})}else{d.resolve()}}else{d.resolve()}}).fail(function(){d.resolve()})}}else{f.message=b.error;f.error=!0;d.done(function(){F().always(function(){a(document).trigger(e.REGISTRATION_FEEDBACK,f)})}).fail(c.exception);d.resolve()}return d}};return{init:function init(){M()}}});
define ("mod_lti/events",[],function(){return{NEW_TOOL_TYPE:"lti.tool.type.new",START_EXTERNAL_REGISTRATION:"lti.registration.external.start",STOP_EXTERNAL_REGISTRATION:"lti.registration.external.stop",START_CARTRIDGE_REGISTRATION:"lti.registration.cartridge.start",STOP_CARTRIDGE_REGISTRATION:"lti.registration.cartridge.stop",REGISTRATION_FEEDBACK:"lti.registration.feedback",CAPABILITIES_AGREE:"lti.tool.type.capabilities.agree",CAPABILITIES_DECLINE:"lti.tool.type.capabilities.decline"}});
define ("mod_lti/tool_card_controller",["jquery","core/ajax","core/notification","core/templates","core/modal_factory","mod_lti/tool_type","mod_lti/events","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g,h,i){var j={DELETE_BUTTON:".delete",NAME_ELEMENT:".name",DESCRIPTION_ELEMENT:".description",CAPABILITIES_CONTAINER:".capabilities-container",ACTIVATE_BUTTON:".tool-card-footer a.activate"},k=2e3,l=function(a){return a.find(j.DELETE_BUTTON)},m=function(a){return a.find(j.NAME_ELEMENT)},n=function(a){return a.find(j.DESCRIPTION_ELEMENT)},o=function(a){return a.find(j.ACTIVATE_BUTTON)},p=function(a){return o(a).length?!0:!1},q=function(a){return a.find(j.CAPABILITIES_CONTAINER)},r=function(a){return q(a).length?!0:!1},s=function(a){return a.attr("data-type-id")},t=function(a){a.removeClass("announcement loading success fail capabilities")},u=function(a){t(a);a.addClass("announcement loading")},v=function(a){a.removeClass("announcement loading")},w=function(b){var c=a.Deferred();t(b);b.addClass("announcement success");setTimeout(function(){b.removeClass("announcement success");c.resolve()},k);return c},x=function(b){var c=a.Deferred();t(b);b.addClass("announcement fail");setTimeout(function(){b.removeClass("announcement fail");c.resolve()},k);return c},y=function(b){var d=a.Deferred(),e=s(b);u(b);if(""===e){return a.Deferred().resolve()}i.get_strings([{key:"delete",component:"mod_lti"},{key:"delete_confirmation",component:"mod_lti"},{key:"delete",component:"mod_lti"},{key:"cancel",component:"core"}]).done(function(a){c.confirm(a[0],a[1],a[2],a[3],function(){f.delete(e).done(function(){v(b);w(b).done(function(){b.remove()}).fail(c.exception).always(function(){d.resolve()})}).fail(function(a){x(b);d.reject(a)})},function(){v(b);d.resolve()})}).fail(function(a){v(b);c.exception(a);d.reject(a)});return d},z=function(a,b){a.attr("data-val-snapshot",b)},A=function(a){return a.attr("data-val-snapshot")},B=function(a){var b=n(a);if(b.hasClass("loading")){return}var c=b.text().trim();z(b,c)},C=function(b){var d=s(b);if(""===d){return a.Deferred().resolve()}var e=n(b);if(e.hasClass("loading")){return a.Deferred().resolve()}var g=e.text().trim(),h=A(e);if(h==g){return a.Deferred().resolve()}e.addClass("loading");var i=f.update({id:d,description:g});i.done(function(a){e.removeClass("loading");e.text(a.description)}).fail(c.exception);i.fail(function(){e.removeClass("loading")});return i},D=function(a){var b=m(a);if(b.hasClass("loading")){return}var c=b.text().trim();z(b,c)},E=function(b){var c=s(b);if(""===c){return a.Deferred().resolve()}var d=m(b);if(d.hasClass("loading")){return a.Deferred().resolve()}var e=d.text().trim(),g=A(d);if(g==e){return a.Deferred().resolve()}d.addClass("loading");var h=f.update({id:c,name:e});h.done(function(a){d.removeClass("loading");d.text(a.name)});h.fail(function(){d.removeClass("loading")});return h},F=function(b){var c=s(b);if(""===c){return a.Deferred().resolve()}u(b);var e=f.update({id:c,state:f.constants.state.configured});e.then(function(a){v(b);w(b);return a}).then(function(a){return d.render("mod_lti/tool_card",a)}).then(function(a,c){d.replaceNode(b,a,c)}).catch(function(){v(b);x(b)});return e},G=function(a){a.addClass("announcement capabilities")},H=function(a){a.removeClass("announcement capabilities")},I=function(a){if(r(a)){G(a)}else{F(a)}},J=function(a){var b=l(a);b.click(function(b){b.preventDefault();y(a)});b.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==h.ENTER||a.keyCode==h.SPACE){a.preventDefault();b.click()}}});var c=n(a);c.focus(function(b){b.preventDefault();B(a)});c.blur(function(b){b.preventDefault();C(a)});c.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==h.ENTER){a.preventDefault();c.blur()}}});var d=m(a);d.focus(function(b){b.preventDefault();D(a)});d.blur(function(b){b.preventDefault();E(a)});d.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==h.ENTER){a.preventDefault();d.blur()}}});if(p(a)){var f=o(a);f.click(function(b){b.preventDefault();I(a)});f.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==h.ENTER||a.keyCode==h.SPACE){a.preventDefault();f.click()}}})}if(r(a)){var i=q(a);i.on(g.CAPABILITIES_AGREE,function(){F(a)});i.on(g.CAPABILITIES_DECLINE,function(){H(a)})}},K=function(b){var c=a("#"+b.data("uniqid")+"-"+b.data("deploymentid")),f={uniqid:b.data("uniqid"),platformid:b.data("platformid"),clientid:b.data("clientid"),deploymentid:b.data("deploymentid"),urls:{publickeyset:b.data("publickeyseturl"),accesstoken:b.data("accesstokenurl"),authrequest:b.data("authrequesturl")}},g=d.render("mod_lti/tool_config_modal_body",f),h="mailto:?subject="+encodeURIComponent(b.data("mailtosubject"))+"&body="+encodeURIComponent(b.data("platformidstr"))+":%20"+encodeURIComponent(b.data("platformid"))+"%0D%0A"+encodeURIComponent(b.data("clientidstr"))+":%20"+encodeURIComponent(b.data("clientid"))+"%0D%0A"+encodeURIComponent(b.data("deploymentidstr"))+":%20"+encodeURIComponent(b.data("deploymentid"))+"%0D%0A"+encodeURIComponent(b.data("publickeyseturlstr"))+":%20"+encodeURIComponent(b.data("publickeyseturl"))+"%0D%0A"+encodeURIComponent(b.data("accesstokenurlstr"))+":%20"+encodeURIComponent(b.data("accesstokenurl"))+"%0D%0A"+encodeURIComponent(b.data("authrequesturlstr"))+":%20"+encodeURIComponent(b.data("authrequesturl"))+"%0D%0A";f={mailto:h};var i=d.render("mod_lti/tool_config_modal_footer",f);e.create({large:!0,title:b.data("modaltitle"),body:g,footer:i},c)};return{init:function init(a){J(a);K(a)}}});
define ("mod_lti/form-field",["jquery"],function(a){var b=function(a,b,c,d){this.name=a;this.id="id_"+this.name;this.selector="#"+this.id;this.type=b;this.resetIfUndefined=c;this.defaultValue=d};b.TYPES={TEXT:1,SELECT:2,CHECKBOX:3,EDITOR:4};b.prototype.setFieldValue=function(c){if(null===c){if(this.resetIfUndefined){c=this.defaultValue}else{return}}switch(this.type){case b.TYPES.CHECKBOX:if(c){a(this.selector).prop("checked",!0)}else{a(this.selector).prop("checked",!1)}break;case b.TYPES.EDITOR:if("undefined"!=typeof c.text){var d=a(this.selector+"editable");if(d.length){d.html(c.text)}else if("undefined"!=typeof tinyMCE){tinyMCE.execInstanceCommand(this.id,"mceInsertContent",!1,c.text)}a(this.selector).val(c.text)}break;default:a(this.selector).val(c);break;}};return b});
define ("mod_lti/tool_type",["core/ajax","core/notification"],function(a,b){return{query:function query(c){var d=a.call([{methodname:"mod_lti_get_tool_types",args:c||{}}])[0];d.fail(b.exception);return d},create:function create(b){var c=a.call([{methodname:"mod_lti_create_tool_type",args:b}])[0];return c},update:function update(c){var d=a.call([{methodname:"mod_lti_update_tool_type",args:c}])[0];d.fail(b.exception);return d},delete:function _delete(c){var d=a.call([{methodname:"mod_lti_delete_tool_type",args:{id:c}}])[0];d.fail(b.exception);return d},getFromToolProxyId:function getFromToolProxyId(a){return this.query({toolproxyid:a})},isCartridge:function isCartridge(b){var c=a.call([{methodname:"mod_lti_is_cartridge",args:{url:b}}])[0];return c},constants:{state:{configured:1,pending:2,rejected:3}}}});
define ("mod_lti/cartridge_registration_form",["jquery","core/ajax","core/notification","mod_lti/tool_type","mod_lti/events","mod_lti/keys","core/str"],function(a,b,c,d,f,g,h){var i={CARTRIDGE_URL:"#cartridge-url",CONSUMER_KEY:"#registration-key",SHARED_SECRET:"#registration-secret",REGISTRATION_FORM:"#cartridge-registration-form",REGISTRATION_SUBMIT_BUTTON:"#cartridge-registration-submit",REGISTRATION_CANCEL_BUTTON:"#cartridge-registration-cancel"},j=function(){return a(i.REGISTRATION_FORM).attr("data-cartridge-url")},k=function(){return a(i.REGISTRATION_SUBMIT_BUTTON)},l=function(){return a(i.REGISTRATION_CANCEL_BUTTON)},m=function(){return a(i.CONSUMER_KEY).val()},n=function(){return a(i.SHARED_SECRET).val()},o=function(){k().addClass("loading")},p=function(){k().removeClass("loading")},q=function(){return k().hasClass("loading")},r=function(){if(q()){return!1}var b=j();if(""===b){return!1}o();var e=m(),g=n(),i=d.create({cartridgeurl:b,key:e,secret:g});i.done(function(){h.get_string("successfullycreatedtooltype","mod_lti").done(function(b){a(document).trigger(f.NEW_TOOL_TYPE);a(document).trigger(f.STOP_CARTRIDGE_REGISTRATION);a(document).trigger(f.REGISTRATION_FEEDBACK,{message:b})}).fail(c.exception)}).fail(function(){h.get_string("failedtocreatetooltype","mod_lti").done(function(b){a(document).trigger(f.NEW_TOOL_TYPE);a(document).trigger(f.STOP_CARTRIDGE_REGISTRATION);a(document).trigger(f.REGISTRATION_FEEDBACK,{message:b,error:!0})}).fail(c.exception)}).always(function(){p()});return i},s=function(){var b=a(i.REGISTRATION_FORM);b.submit(function(a){a.preventDefault();r()});var c=l();c.click(function(b){b.preventDefault();a(document).trigger(f.STOP_CARTRIDGE_REGISTRATION)});c.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==g.ENTER||a.keyCode==g.SPACE){a.preventDefault();c.click()}}})};return{init:function init(){s()}}});
define ("mod_lti/tool_proxy",["core/ajax","core/notification"],function(a,b){return{query:function query(c){var d=a.call([{methodname:"mod_lti_get_tool_proxies",args:c||{}}])[0];d.fail(b.exception);return d},delete:function _delete(c){var d=a.call([{methodname:"mod_lti_delete_tool_proxy",args:{id:c}}])[0];d.fail(b.exception);return d},create:function create(b){var c=a.call([{methodname:"mod_lti_create_tool_proxy",args:b}])[0];return c}}});
define ("mod_lti/contentitem_return",["jquery"],function(a){return{init:function init(b){a(window).ready(function(){if(window!=top){parent.processContentItemReturnData(b)}else{window.processContentItemReturnData(b)}})}}});
define ("mod_lti/external_registration_return",[],function(){return{init:function init(a,b,c,d){if(window.parent){window.parent.triggerExternalRegistrationComplete({message:a,error:b,id:c,status:d})}}}});
define ("mod_lti/tool_proxy_card_controller",["jquery","core/ajax","core/notification","core/templates","mod_lti/tool_proxy","mod_lti/events","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g,h){var i={DELETE_BUTTON:".delete",CAPABILITIES_CONTAINER:".capabilities-container",ACTIVATE_BUTTON:".tool-card-footer a.activate"},j=2e3,k=function(a){return a.find(i.DELETE_BUTTON)},l=function(a){return a.find(i.ACTIVATE_BUTTON)},m=function(a){return a.attr("data-proxy-id")},n=function(a){a.removeClass("announcement loading success fail capabilities")},o=function(a){n(a);a.addClass("announcement loading")},p=function(a){a.removeClass("announcement loading")},q=function(b){var c=a.Deferred();n(b);b.addClass("announcement success");setTimeout(function(){b.removeClass("announcement success");c.resolve()},j);return c},r=function(b){var c=a.Deferred();n(b);b.addClass("announcement fail");setTimeout(function(){b.removeClass("announcement fail");c.resolve()},j);return c},s=function(b){var d=a.Deferred(),f=m(b);o(b);if(""===f){return a.Deferred().resolve()}h.get_strings([{key:"delete",component:"mod_lti"},{key:"delete_confirmation",component:"mod_lti"},{key:"delete",component:"mod_lti"},{key:"cancel",component:"core"}]).done(function(a){c.confirm(a[0],a[1],a[2],a[3],function(){e.delete(f).done(function(){p(b);q(b).done(function(){b.remove();d.resolve()}).fail(c.exception)}).fail(function(a){r(b);d.reject(a)})},function(){p(b);d.resolve()})}).fail(function(a){p(b);c.exception(a);d.reject(a)});return d},t=function(b){var c={proxyid:m(b)};a(document).trigger(f.START_EXTERNAL_REGISTRATION,c)},u=function(a){var b=k(a);b.click(function(b){b.preventDefault();s(a)});b.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==g.ENTER||a.keyCode==g.SPACE){a.preventDefault();b.click()}}});var c=l(a);c.click(function(b){b.preventDefault();t(a)});c.keypress(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(a.keyCode==g.ENTER||a.keyCode==g.SPACE){a.preventDefault();c.click()}}})};return{init:function init(a){u(a)}}});
function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}f(void 0)})}}define ("mod_lti/contentitem",["jquery","core/notification","core/str","core/templates","mod_lti/form-field","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g){var h,i,j=[new e("name",e.TYPES.TEXT,!1,""),new e("introeditor",e.TYPES.EDITOR,!1,""),new e("toolurl",e.TYPES.TEXT,!0,""),new e("securetoolurl",e.TYPES.TEXT,!0,""),new e("instructorchoiceacceptgrades",e.TYPES.CHECKBOX,!0,!0),new e("instructorchoicesendname",e.TYPES.CHECKBOX,!0,!0),new e("instructorchoicesendemailaddr",e.TYPES.CHECKBOX,!0,!0),new e("instructorcustomparameters",e.TYPES.TEXT,!0,""),new e("icon",e.TYPES.TEXT,!0,""),new e("secureicon",e.TYPES.TEXT,!0,""),new e("launchcontainer",e.TYPES.SELECT,!0,0),new e("grade_modgrade_point",e.TYPES.TEXT,!1,""),new e("lineitemresourceid",e.TYPES.TEXT,!0,""),new e("lineitemtag",e.TYPES.TEXT,!0,"")],k=function(a){a.setAttribute("hidden","true");a.setAttribute("aria-hidden","true");a.setAttribute("tab-index","-1")},l=function(a){a.removeAttribute("hidden");a.setAttribute("aria-hidden","false");a.setAttribute("tab-index","1")},m=function(){var a=_asyncToGenerator(regeneratorRuntime.mark(function a(b){var c,e,f,g,h,i,j;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c=document.querySelector("#region-main-box form");e=c.querySelector("[data-attribute=\"dynamic-import\"]");f=c.querySelector("#fgroup_id_buttonar");g=c.querySelector("#id_submitbutton");Array.from(c.children).forEach(k);k(g);a.next=8;return d.renderForPromise("mod_lti/tool_deeplinking_results",{items:b});case 8:h=a.sent;i=h.html;j=h.js;a.next=13;return d.replaceNodeContents(e,i,j);case 13:l(e);l(f);case 15:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),n=function(a){var b={};["name","toolurl","securetoolurl","instructorcustomparameters","icon","secureicon","launchcontainer","lineitemresourceid","lineitemtag"].forEach(function(c){b[c]=a[c]||""});b["introeditor[text]"]=a.introeditor?a.introeditor.text:"";b["introeditor[format]"]=a.introeditor?a.introeditor.format:"";if(1===a.instructorchoiceacceptgrades){b.instructorchoiceacceptgrades="1";b["grade[modgrade_point]"]=a.grade_modgrade_point||"100"}else{b.instructorchoiceacceptgrades="0"}return b};window.processContentItemReturnData=function(a){if(h){h.hide()}if(a.multiple){for(var b in j){j[b].setFieldValue("name"===j[b].name?"item":null)}var c=[];a.multiple.forEach(function(a){c.push(n(a))});m(a.multiple);var f=document.querySelector("#id_submitbutton2");f.onclick=function(a){a.preventDefault();f.disabled=!0;var b=new FormData(document.querySelector("form.mform")),d=function(){document.querySelector("#id_cancel").click()};c.reduce(function postVariant(a,c){Object.entries(c).forEach(function(a){return b.set(a[0],a[1])});var d=new URLSearchParams(b),e=function(){return fetch(document.location.pathname,{method:"post",body:d})};return a.then(e).catch(e)},Promise.resolve()).then(d).catch(d)}}else{for(b in j){var d=j[b],e=null;if("undefined"!=typeof a[d.name]){e=a[d.name]}d.setFieldValue(e)}d.setFieldValue(e)}if(i){i(a)}};return{init:function init(a,e,j){i=j;var k=d.render("mod_lti/contentitem",{url:a,postData:e});if(h){h.setBody(k);h.show();return}c.get_string("selectcontent","lti").then(function(a){return f.create({title:a,body:k,large:!0})}).then(function(a){h=a;a.getRoot().on(g.hidden,function(){a.setBody("");b.fetchNotifications()});a.show()}).catch(b.exception)}}});
define ("mod_quiz/add_random_form",["jquery","mod_quiz/random_question_form_preview"],function(a,b){var c={PREVIEW_CONTAINER:"[data-region=\"random-question-preview-container\"]",CATEGORY_FORM_ELEMENT:"[name=\"category\"]",SUBCATEGORY_FORM_ELEMENT:"[name=\"includesubcategories\"]",TAG_IDS_FORM_ELEMENT:"[name=\"fromtags[]\"]"},d=function(a){return a.find(c.CATEGORY_FORM_ELEMENT).val()},e=function(a){var b=d(a),c=b.split(",");return c[0]},f=function(a,b){var c=d(a);return-1<b.indexOf(c)},g=function(a,b){if(f(a,b)){return!0}else{return a.find(c.SUBCATEGORY_FORM_ELEMENT).is(":checked")}},h=function(a){var b=a.find(c.TAG_IDS_FORM_ELEMENT).val();return b.map(function(a){var b=a.split(",");return b[0]})},i=function(a,d,f){var i=a.find(c.PREVIEW_CONTAINER);b.reload(i,e(a),g(a,f),h(a),d)},j=function(a){if(0<a.closest(c.CATEGORY_FORM_ELEMENT).length){return!0}if(0<a.closest(c.SUBCATEGORY_FORM_ELEMENT).length){return!0}if(0<a.closest(c.TAG_IDS_FORM_ELEMENT).length){return!0}return!1},k=function(c,d,e){var f=null;c.on("change",function(g){if(!j(a(g.target))){return}b.showLoadingIcon(c);if(f){clearTimeout(f)}f=setTimeout(function(){i(c,d,e)},2000)})};return{init:function init(b,c,d,e){if(!0==e){var f=a("#"+b);i(f,c,d,e);k(f,c,d,e)}}}});
define ("mod_quiz/modal_add_random_question",["jquery","core/yui","core/notification","core/modal","core/modal_events","core/modal_registry","core/fragment","core/templates"],function(a,b,c,d,e,f,g,h){var i=!1,j={EXISTING_CATEGORY_CONTAINER:"[data-region=\"existing-category-container\"]",EXISTING_CATEGORY_FORM_ELEMENT:"#id_existingcategoryheader",NEW_CATEGORY_CONTAINER:"[data-region=\"new-category-container\"]",NEW_CATEGORY_FORM_ELEMENT:"#id_newcategoryheader",TAB_CONTENT:"[data-region=\"tab-content\"]",ADD_ON_PAGE_FORM_ELEMENT:"[name=\"addonpage\"]",SUBMIT_BUTTON_ELEMENT:"input[type=\"submit\"]",CANCEL_BUTTON_ELEMENT:"input[type=\"submit\"][name=\"cancel\"]",FORM_HEADER:"legend",BUTTON_CONTAINER:".fitem"},k=function(a){d.call(this,a);this.contextId=null;this.addOnPageId=null;this.category=null;this.returnUrl=null;this.cmid=null;this.loadedForm=!1};k.TYPE="mod_quiz-quiz-add-random-question";k.prototype=Object.create(d.prototype);k.prototype.constructor=k;k.prototype.setContextId=function(a){this.contextId=a};k.prototype.getContextId=function(){return this.contextId};k.prototype.setAddOnPageId=function(a){this.addOnPageId=a;this.getBody().find(j.ADD_ON_PAGE_FORM_ELEMENT).val(a)};k.prototype.getAddOnPageId=function(){return this.addOnPageId};k.prototype.setCategory=function(a){this.category=a};k.prototype.getCategory=function(){return this.category};k.prototype.setReturnUrl=function(a){this.returnUrl=a};k.prototype.getReturnUrl=function(){return this.returnUrl};k.prototype.setCMID=function(a){this.cmid=a};k.prototype.getCMID=function(){return this.cmid};k.prototype.moveFormElementIntoTab=function(b,c){var d=b.find(j.SUBMIT_BUTTON_ELEMENT),e=a("<div class=\"modal-footer mt-1\" data-region=\"footer\"></div>");b.find(j.FORM_HEADER).addClass("hidden");b.wrap(c);d.closest(j.BUTTON_CONTAINER).remove();d.appendTo(e);e.appendTo(b)};k.prototype.moveTabsIntoTabContent=function(a){var b=this.getBody().find(j.TAB_CONTENT).empty();a.find("[role=\"tabpanel\"]").wrapAll(b)};k.prototype.moveCancelButtonToTabs=function(a){var b=a.find(j.CANCEL_BUTTON_ELEMENT).addClass("ml-1"),c=a.find("[data-region=\"footer\"]");b.closest(j.BUTTON_CONTAINER).remove();b.clone().appendTo(c)};k.prototype.loadForm=function(){return g.loadFragment("mod_quiz","add_random_question_form",this.getContextId(),{addonpage:this.getAddOnPageId(),cat:this.getCategory(),returnurl:this.getReturnUrl(),cmid:this.getCMID()}).then(function(b,c){var d=a(b),e=d.find(j.EXISTING_CATEGORY_FORM_ELEMENT),f=this.getBody().find(j.EXISTING_CATEGORY_CONTAINER),g=d.find(j.NEW_CATEGORY_FORM_ELEMENT),i=this.getBody().find(j.NEW_CATEGORY_CONTAINER);this.moveFormElementIntoTab(e,f);this.moveFormElementIntoTab(g,i);this.moveTabsIntoTabContent(d);this.moveCancelButtonToTabs(d);h.replaceNode(this.getBody().find(j.TAB_CONTENT),d,c)}.bind(this)).then(function(){b.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()})}).fail(c.exception)};k.prototype.show=function(){d.prototype.show.call(this);if(!this.loadedForm){this.loadForm();this.loadedForm=!0}};if(!i){f.register(k.TYPE,k,"mod_quiz/modal_add_random_question");i=!0}return k});
define ("mod_quiz/quizquestionbank",["mod_quiz/add_question_modal_launcher","mod_quiz/modal_quiz_question_bank"],function(a,b){return{init:function init(c){a.init(b.TYPE,".menu [data-action=\"questionbank\"]",c)}}});
define ("mod_quiz/repaginate",["jquery","core/modal_factory"],function(a,b){var c={REPAGINATECOMMAND:"#repaginatecommand",HEADER:"header",BODY:"form"};return{init:function init(){b.create({title:a(c.REPAGINATECOMMAND).data(c.HEADER),body:a(c.REPAGINATECOMMAND).data(c.BODY),large:!1},a(c.REPAGINATECOMMAND))}}});
define ("mod_quiz/random_question_form_preview",["jquery","core/ajax","core/str","core/notification","core/templates","core/paged_content_factory"],function(a,b,c,d,e,f){var g="mod_quiz/random_question_form_preview_question_list",h={LOADING_ICON_CONTAINER:"[data-region=\"overlay-icon-container\"]",QUESTION_COUNT_CONTAINER:"[data-region=\"question-count-container\"]",QUESTION_LIST_CONTAINER:"[data-region=\"question-list-container\"]"},i=function(a){a.find(h.LOADING_ICON_CONTAINER).removeClass("hidden")},j=function(a){a.find(h.LOADING_ICON_CONTAINER).addClass("hidden")},k=function(a,b){c.get_string("questionsmatchingfilter","mod_quiz",b).then(function(b){a.find(h.QUESTION_COUNT_CONTAINER).html(b)}).fail(d.exception)},l=function(a,c,d,e,f,g){return b.call([{methodname:"core_question_get_random_question_summaries",args:{categoryid:a,includesubcategories:c,tagids:d,contextid:e,limit:f,offset:g}}])[0]},m=function(a,b,c,h,i,j){return f.createFromAjax(i,5,function(f){return f.map(function(f){var i=f.limit,k=f.offset;if(0==k){return e.render(g,{questions:j})}else{return l(a,b,c,h,i,k).then(function(a){var b=a.questions;return e.render(g,{questions:b})}).fail(d.exception)}})})};return{reload:function reload(b,c,f,g,n){i(b);return l(c,f,g,n,5,0).then(function(a){var c=a.totalcount;k(b,c);return a}).then(function(b){var d=b.totalcount,e=b.questions;if(e.length){return m(c,f,g,n,d,e)}else{return a.Deferred().resolve("","")}}).then(function(a,c){var d=b.find(h.QUESTION_LIST_CONTAINER);e.replaceNodeContents(d,a,c)}).always(function(){j(b)}).fail(d.exception)},showLoadingIcon:i,hideLoadingIcon:j}});
define ("mod_quiz/modal_quiz_question_bank",["jquery","core/yui","core/notification","core/modal","core/modal_events","core/modal_registry","core/fragment"],function(a,b,c,d,e,f,g){var h=!1,i={ADD_TO_QUIZ_CONTAINER:"td.addtoquizaction",ANCHOR:"a[href]",PREVIEW_CONTAINER:"td.previewaction",SEARCH_OPTIONS:"#advancedsearch",DISPLAY_OPTIONS:"#displayoptions",ADD_QUESTIONS_FORM:"form[action=\"edit.php\"]"},j=function(a){d.call(this,a);this.contextId=null;this.addOnPageId=null};j.TYPE="mod_quiz-quiz-question-bank";j.prototype=Object.create(d.prototype);j.prototype.constructor=j;j.prototype.setContextId=function(a){this.contextId=a};j.prototype.getContextId=function(){return this.contextId};j.prototype.setAddOnPageId=function(a){this.addOnPageId=a};j.prototype.getAddOnPageId=function(){return this.addOnPageId};j.prototype.show=function(){this.reloadBodyContent(window.location.search);return d.prototype.show.call(this)};j.prototype.reloadBodyContent=function(a){var b=g.loadFragment("mod_quiz","quiz_question_bank",this.getContextId(),{querystring:a}).fail(c.exception);this.setBody(b)};j.prototype.handleAddToQuizEvent=function(a,b){var c=b.attr("href")+"&addonpage="+this.getAddOnPageId();b.attr("href",c)};j.prototype.handlePreviewContainerEvent=function(a,b){window.openpopup(a,{url:b.attr("href"),name:"questionpreview",options:["height=600","width=800","top=0","left=0","menubar=0","location=0","scrollbars","resizable","toolbar","status","directories=0","fullscreen=0","dependent"].join(",")})};j.prototype.handleDisplayOptionFormEvent=function(b){b.stopPropagation();b.preventDefault();var c=a(b.target).closest(i.DISPLAY_OPTIONS),d="?"+c.serialize();this.reloadBodyContent(d)};j.prototype.registerDisplayOptionListeners=function(){this.getModal().on("change",i.DISPLAY_OPTIONS,function(b){var c=a(b.target);if(c.attr("aria-autocomplete")){return}this.handleDisplayOptionFormEvent(b)}.bind(this));this.getModal().on("submit",i.DISPLAY_OPTIONS,function(a){this.handleDisplayOptionFormEvent(a)}.bind(this))};j.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this);this.registerDisplayOptionListeners();this.getModal().on("submit",i.ADD_QUESTIONS_FORM,function(b){var c=a(b.currentTarget);a("<input />").attr("type","hidden").attr("name","addonpage").attr("value",this.getAddOnPageId()).appendTo(c)}.bind(this));this.getModal().on("click",i.ANCHOR,function(b){var c=a(b.currentTarget);if(c.closest(i.ADD_TO_QUIZ_CONTAINER).length){this.handleAddToQuizEvent(b,c);return}if(c.closest(i.PREVIEW_CONTAINER).length){this.handlePreviewContainerEvent(b,c);return}if(c.closest(i.SEARCH_OPTIONS).length){return}b.preventDefault();this.reloadBodyContent(c.prop("search"))}.bind(this));this.getRoot().on(e.bodyRendered,function(){b.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()})})};if(!h){f.register(j.TYPE,j,"core/modal");h=!0}return j});
define ("mod_quiz/add_random_question",["mod_quiz/add_question_modal_launcher","mod_quiz/modal_add_random_question"],function(a,b){return{init:function init(c,d,e,f){a.init(b.TYPE,".menu [data-action=\"addarandomquestion\"]",c,function(a,b){b.setCategory(d);b.setReturnUrl(e);b.setCMID(f)})}}});
define ("mod_quiz/add_question_modal_launcher",["jquery","core/notification","core/modal_factory"],function(a,b,c){return{init:function init(d,e,f,g){var h=a("body");return c.create({type:d,large:!0,preShowCallback:function preShowCallback(b,c){b=a(b);c.setContextId(f);c.setAddOnPageId(b.attr("data-addonpage"));c.setTitle(b.attr("data-header"));if(g){g(b,c)}}},[h,e]).fail(b.exception)}}});
define ("mod_quiz/preflightcheck",["jquery","core/yui"],function(a,b){var c={confirmDialogue:null,init:function init(a,d,e,f){var g=a;b.use("moodle-core-notification",function(){if(b.one(e)){c.confirmDialogue=new M.core.dialogue({headerContent:d,bodyContent:b.one(e),draggable:!0,visible:!1,center:!0,modal:!0,width:null,extraClasses:["mod_quiz_preflight_popup"]});b.one(a).on("click",c.displayDialogue);b.one("#id_cancel").on("click",c.hideDialogue);g=c.confirmDialogue.get("boundingBox").one("[name=\"submitbutton\"]")}if(f){b.one(g).on("click",c.launchQuizPopup,c,f)}})},displayDialogue:function displayDialogue(a){if(a){a.halt()}c.confirmDialogue.show()},hideDialogue:function hideDialogue(a){if(a){a.halt()}c.confirmDialogue.hide(a)},launchQuizPopup:function launchQuizPopup(a,c){a.halt();b.use("moodle-core-formchangechecker","io-form",function(){M.core_formchangechecker.reset_form_dirty_state();var d=a.target.ancestor("form");window.openpopup(a,{url:d.get("action")+"?"+b.IO.stringify(d).replace(/\bcancel=/,"x="),windowname:"quizpopup",options:c,fullscreen:!0})})}};return c});
define ("mod_survey/validation",["jquery","core/str","core/modal_factory","core/notification"],function(a,b,c,d){return{ensureRadiosChosen:function ensureRadiosChosen(e){var f=b.get_strings([{key:"error",component:"moodle"},{key:"questionsnotanswered",component:"survey"}]).then(function(a){return c.create({type:c.types.CANCEL,title:a[0],body:a[1]})}).catch(d.exception),g=a("#"+e);g.submit(function(a){if(0!==g.find("input:radio[data-survey-default=\"true\"]:checked").length){a.preventDefault();return f.then(function(a){a.show();return!1})}return!0})}}});
define ("mod_workshop/modform",["jquery"],function(a){var e={text:{available:null,required:null,requiredHidden:null},file:{available:null,required:null,requiredHidden:null}};function b(a,b){if(!a.available.prop("checked")){a.required.prop("disabled",!0);a.required.prop("checked",!1);if(b.available.prop("checked")){b.required.prop("disabled",!0);b.required.prop("checked",!0);b.requiredHidden.val(1)}}}function c(a){a.required.prop("disabled",!1);a.required.prop("checked",!1);a.requiredHidden.val(0)}function d(){b(e.file,e.text);b(e.text,e.file);if(e.text.available.prop("checked")&&e.file.available.prop("checked")){c(e.text);c(e.file)}}return{init:function init(){e.text.available=a("#id_submissiontypetextavailable");e.text.required=a("#id_submissiontypetextrequired");e.text.requiredHidden=a("input[name=\"submissiontypetextrequired\"][type=\"hidden\"]");e.file.available=a("#id_submissiontypefileavailable");e.file.required=a("#id_submissiontypefilerequired");e.file.requiredHidden=a("input[name=\"submissiontypefilerequired\"][type=\"hidden\"]");e.text.available.on("change",d);e.file.available.on("change",d);d()}}});
define ("mod_workshop/workshopview",["jquery"],function(a){function b(b){var c=0;b.height("auto");b.each(function(){var b=a(this).height();if(b>c){c=b}});b.height(c)}return{init:function init(){var c=a(".path-mod-workshop .userplan dt"),d=a(".path-mod-workshop .userplan dd");b(c);b(d);a(window).on("resize",function(){b(c);b(d)})}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("enrol_manual/quickenrolment",["exports","core_table/dynamic","core/str","core/toast","core/config","core/fragment","core/modal_events","core/modal_factory","core/notification","jquery","core/pending","core/prefetch"],function(a,b,c,d,e,f,g,h,i,j,k,l){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=o(b);c=o(c);d=o(d);e=m(e);f=m(f);g=m(g);h=m(h);i=m(i);j=m(j);k=m(k);l=m(l);function m(a){return a&&a.__esModule?a:{default:a}}function n(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;n=function(){return a};return a}function o(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=n();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function p(a,b){return u(a)||t(a,b)||r(a,b)||q()}function q(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(a,b){if(!a)return;if("string"==typeof a)return s(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return s(a,b)}function s(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function t(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function u(a){if(Array.isArray(a))return a}var v={cohortSelector:"#id_cohortlist",triggerButtons:".enrolusersbutton.enrol_manual_plugin [type='submit']",unwantedHiddenFields:"input[value='_qf__force_multiselect_submission']",buttonWrapper:"[data-region=\"wrapper\"]"},w=function(a){return f.default.loadFragment("enrol_manual","enrol_users_form",a,{})},x=function(a){var c=a.closest(v.buttonWrapper);return b.getTableFromId(c.dataset.tableUniqueid)},y=function(a){document.addEventListener("click",function(b){if(b.target.closest(v.triggerButtons)){b.preventDefault();z(x(b.target),a)}})},z=function(a,b){var d=new k.default("enrol_manual/quickenrolment:showModal");return h.default.create({type:h.default.types.SAVE_CANCEL,large:!0,title:c.get_string("enrolusers","enrol_manual"),body:w(b),buttons:{save:c.get_string("enrolusers","enrol_manual")}}).then(function(b){b.getRoot().on(g.default.save,function(a){a.preventDefault();b.getRoot().find("form").submit()});b.getRoot().on("submit","form",function(c){c.preventDefault();A(a,b)});b.getRoot().on(g.default.hidden,function(){b.destroy()});b.show();return b}).then(function(a){return Promise.all([a,a.getBodyPromise()])}).then(function(a){var b=p(a,2),d=b[0],e=b[1];if(e.get(0).querySelector(v.cohortSelector)){return d.setSaveButtonText(c.get_string("enroluserscohorts","enrol_manual")).then(function(){return d})}return d}).then(function(a){d.resolve();return a}).catch(i.default.exception)},A=function(a,f){var g=f.getRoot().find("form");g.get(0).querySelectorAll(v.unwantedHiddenFields).forEach(function(a){return a.remove()});f.hide();f.destroy();j.default.ajax("".concat(e.default.wwwroot,"/enrol/manual/ajax.php?").concat(g.serialize()),{type:"GET",processData:!1,contentType:"application/json"}).then(function(a){if(a.error){throw new Error(a.error)}return a.count}).then(function(d){return Promise.all([c.get_string("totalenrolledusers","enrol",d),b.refreshTableContent(a)])}).then(function(a){var b=p(a,1),c=b[0];return c}).then(function(a){return d.add(a)}).catch(function(a){i.default.addNotification({message:a.message,type:"error"})})},B=function(a){var b=a.contextid;y(b);l.default.prefetchStrings("enrol_manual",["enrolusers","enroluserscohorts"]);l.default.prefetchString("enrol","totalenrolledusers")};a.init=B});
define ("enrol_manual/form-potential-user-selector",["jquery","core/ajax","core/templates","core/str"],function(a,b,c,d){return{processResults:function processResults(b,c){var d=[];if(a.isArray(c)){a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d}else{return c}},transport:function transport(e,f,g,h){var i,j=a(e).attr("courseid"),k=a(e).attr("userfields").split(",");if("undefined"==typeof j){j="1"}var l=a(e).attr("enrolid");if("undefined"==typeof l){l=""}var m=parseInt(a(e).attr("perpage"));if(isNaN(m)){m=100}i=b.call([{methodname:"core_enrol_get_potential_users",args:{courseid:j,enrolid:l,search:f,searchanywhere:!0,page:0,perpage:m+1}}]);i[0].then(function(b){var e=[],f=0;if(b.length<=m){a.each(b,function(b,d){var f=d,g=[];a.each(k,function(a,b){if("undefined"!=typeof d[b]&&""!==d[b]){f.hasidentity=!0;g.push(d[b])}});f.identity=g.join(", ");e.push(c.render("enrol_manual/form-user-selector-suggestion",f))});return a.when.apply(a.when,e).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[f];f++});g(b)})}else{return d.get_string("toomanyuserstoshow","core",">"+m).then(function(a){g(a)})}}).fail(h)}}});
define ("message_popup/notification_area_events",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={showNotification:"notification-area-events:showNotification",notificationShown:"notification-area-events:notificationShown"};return a.default});
define ("message_popup/notification_area_content_area",["jquery","core/templates","core/notification","core/custom_interaction_events","message_popup/notification_repository","message_popup/notification_area_events"],function(a,b,c,d,e,f){var g={CONTAINER:"[data-region=\"notification-area\"]",CONTENT:"[data-region=\"content\"]",HEADER:"[data-region=\"header\"]",FOOTER:"[data-region=\"footer\"]",TOGGLE_MODE:"[data-action=\"toggle-mode\"]"},h={HEADER:"message_popup/notification_area_content_area_header",CONTENT:"message_popup/notification_area_content_area_content",FOOTER:"message_popup/notification_area_content_area_footer"},i=function(b,c){this.root=a(b);this.container=this.root.closest(g.CONTAINER);this.userId=c;this.header=this.root.find(g.HEADER);this.content=this.root.find(g.CONTENT);this.footer=this.root.find(g.FOOTER);this.registerEventListeners()};i.prototype.getRoot=function(){return this.root};i.prototype.getContainer=function(){return this.container};i.prototype.getUserId=function(){return this.userId};i.prototype.getHeader=function(){return this.header};i.prototype.getContent=function(){return this.content};i.prototype.getFooter=function(){return this.footer};i.prototype.show=function(){this.getContainer().addClass("show-content-area")};i.prototype.hide=function(){this.getContainer().removeClass("show-content-area")};i.prototype.setHeaderHTML=function(a){this.getHeader().empty().html(a)};i.prototype.setContentHTML=function(a){this.getContent().empty().html(a)};i.prototype.setFooterHTML=function(a){this.getFooter().empty().html(a)};i.prototype.showNotification=function(c){var d=b.render(h.HEADER,c).done(function(a){this.setHeaderHTML(a)}.bind(this)),e=b.render(h.CONTENT,c).done(function(a){this.setContentHTML(a)}.bind(this)),g=b.render(h.FOOTER,c).done(function(a){this.setFooterHTML(a)}.bind(this));return a.when(d,e,g).done(function(){this.show();this.getContainer().trigger(f.notificationShown,[c])}.bind(this))};i.prototype.registerEventListeners=function(){d.define(this.getRoot(),[d.events.activate]);this.getRoot().on(d.events.activate,g.VIEW_TOGGLE,function(){this.hide()}.bind(this));this.getContainer().on(f.showNotification,function(a,b){this.showNotification(b)}.bind(this))};return i});
define ("message_popup/notification_popover_controller",["jquery","core/ajax","core/templates","core/str","core/url","core/notification","core/custom_interaction_events","core/popover_region_controller","message_popup/notification_repository","message_popup/notification_area_events"],function(a,b,c,d,e,f,g,h,i,j){var k={MARK_ALL_READ_BUTTON:"[data-action=\"mark-all-read\"]",ALL_NOTIFICATIONS_CONTAINER:"[data-region=\"all-notifications\"]",NOTIFICATION:"[data-region=\"notification-content-item-container\"]",UNREAD_NOTIFICATION:"[data-region=\"notification-content-item-container\"].unread",NOTIFICATION_LINK:"[data-action=\"content-item-link\"]",EMPTY_MESSAGE:"[data-region=\"empty-message\"]",COUNT_CONTAINER:"[data-region=\"count-container\"]"},l=function(a){h.call(this,a);this.markAllReadButton=this.root.find(k.MARK_ALL_READ_BUTTON);this.unreadCount=0;this.lastQueried=0;this.userId=this.root.attr("data-userid");this.container=this.root.find(k.ALL_NOTIFICATIONS_CONTAINER);this.limit=20;this.offset=0;this.loadedAll=!1;this.initialLoad=!1;this.unreadCount=this.root.find(k.COUNT_CONTAINER).html()};l.prototype=Object.create(h.prototype);l.prototype.constructor=l;l.prototype.updateButtonAriaLabel=function(){if(this.isMenuOpen()){d.get_string("hidenotificationwindow","message").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))}else{if(this.unreadCount){d.get_string("shownotificationwindowwithcount","message",this.unreadCount).done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))}else{d.get_string("shownotificationwindownonew","message").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))}}};l.prototype.getContent=function(){return this.container};l.prototype.getOffset=function(){return this.offset};l.prototype.incrementOffset=function(){this.offset+=this.limit};l.prototype.hasDoneInitialLoad=function(){return this.initialLoad};l.prototype.hasLoadedAllContent=function(){return this.loadedAll};l.prototype.setLoadedAllContent=function(a){this.loadedAll=a};l.prototype.renderUnreadCount=function(){var a=this.root.find(k.COUNT_CONTAINER);if(this.unreadCount){a.text(this.unreadCount);a.removeClass("hidden")}else{a.addClass("hidden")}};l.prototype.hideUnreadCount=function(){this.root.find(k.COUNT_CONTAINER).addClass("hidden")};l.prototype.getNotificationElement=function(a){var b=this.root.find(k.NOTIFICATION+"[data-id=\""+a+"\"]");return 1==b.length?b:null};l.prototype.renderNotifications=function(b,d){var f=[];a.each(b,function(a,b){var d=this.getOffset()-this.limit;b.viewmoreurl=e.relativeUrl("/message/output/popup/notifications.php",{notificationid:b.id,offset:d});var g={notificationid:b.id};b.contexturl=e.relativeUrl("message/output/popup/mark_notification_read.php",g);var h=c.render("message_popup/notification_content_item",b).then(function(a,b){return{html:a,js:b}});f.push(h)}.bind(this));return a.when.apply(a,f).then(function(){a.each(arguments,function(a,b){d.append(b.html);c.runTemplateJS(b.js)})})};l.prototype.loadMoreNotifications=function(){if(this.isLoading||this.hasLoadedAllContent()){return a.Deferred().resolve()}this.startLoading();var b={limit:this.limit,offset:this.getOffset(),useridto:this.userId},c=this.getContent();return i.query(b).then(function(a){var b=a.notifications;this.unreadCount=a.unreadcount;this.lastQueried=Math.floor(new Date().getTime()/1e3);this.setLoadedAllContent(!b.length||b.length<this.limit);this.initialLoad=!0;this.updateButtonAriaLabel();if(b.length){this.incrementOffset();return this.renderNotifications(b,c)}return!1}.bind(this)).always(function(){this.stopLoading()}.bind(this))};l.prototype.markAllAsRead=function(){this.markAllReadButton.addClass("loading");var a={useridto:this.userId,timecreatedto:this.lastQueried};return i.markAllAsRead(a).then(function(){this.unreadCount=0;this.root.find(k.UNREAD_NOTIFICATION).removeClass("unread")}.bind(this)).always(function(){this.markAllReadButton.removeClass("loading")}.bind(this))};l.prototype.registerEventListeners=function(){g.define(this.root,[g.events.activate]);this.root.on(g.events.activate,k.MARK_ALL_READ_BUTTON,function(a,b){this.markAllAsRead();a.stopPropagation();b.originalEvent.preventDefault()}.bind(this));this.root.on(g.events.activate,k.NOTIFICATION_LINK,function(b){var c=a(b.target).closest(k.NOTIFICATION);if(c.hasClass("unread")){this.unreadCount--;c.removeClass("unread")}b.stopPropagation()}.bind(this));this.root.on(this.events().menuOpened,function(){this.hideUnreadCount();this.updateButtonAriaLabel();if(!this.hasDoneInitialLoad()){this.loadMoreNotifications()}}.bind(this));this.root.on(this.events().menuClosed,function(){this.renderUnreadCount();this.updateButtonAriaLabel()}.bind(this));this.root.on(this.events().startLoading,function(){this.getContent().attr("aria-busy","true")}.bind(this));this.root.on(this.events().stopLoading,function(){this.getContent().attr("aria-busy","false")}.bind(this));this.getContentContainer().on(g.events.scrollBottom,function(){if(!this.isLoading&&!this.hasLoadedAllContent()){this.loadMoreNotifications()}}.bind(this));g.define(this.getContentContainer(),[g.events.scrollLock]);a(document).on(j.notificationShown,function(a,b){if(!b.read){var c=this.getNotificationElement(b.id);if(c){c.removeClass("unread")}this.unreadCount--;this.renderUnreadCount()}}.bind(this))};return l});
define ("message_popup/notification_repository",["core/ajax","core/notification"],function(a,b){return{query:function query(c){if("undefined"==typeof c.limit){c.limit=20}if("undefined"==typeof c.offset){c.offset=0}var d=a.call([{methodname:"message_popup_get_popup_notifications",args:c}])[0];d.fail(b.exception);return d},countUnread:function countUnread(c){var d=a.call([{methodname:"message_popup_get_unread_popup_notification_count",args:c}])[0];d.fail(b.exception);return d},markAllAsRead:function markAllAsRead(c){var d=a.call([{methodname:"core_message_mark_all_notifications_as_read",args:c}])[0];d.fail(b.exception);return d},markAsRead:function markAsRead(c,d){var e={notificationid:c};if(d){e.timeread=d}var f=a.call([{methodname:"core_message_mark_notification_read",args:e}])[0];f.fail(b.exception);return f}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("message_popup/notification_area_control_area",["jquery","core/templates","core/notification","core/custom_interaction_events","message_popup/notification_repository","message_popup/notification_area_events"],function(a,b,c,d,e,f){var g={CONTAINER:"[data-region=\"notification-area\"]",CONTENT:"[data-region=\"content\"]",NOTIFICATION:"[data-region=\"notification-content-item-container\"]",CAN_RECEIVE_FOCUS:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]"},h={NOTIFICATION:"message_popup/notification_content_item"},i=function(b,c){this.root=a(b);this.container=this.root.closest(g.CONTAINER);this.userId=c;this.content=this.root.find(g.CONTENT);this.offset=0;this.limit=20;this.initialLoad=!1;this.isLoading=!1;this.loadedAll=!1;this.notifications={};this.registerEventListeners()};i.prototype.getRoot=function(){return this.root};i.prototype.getContainer=function(){return this.container};i.prototype.getUserId=function(){return this.userId};i.prototype.getContent=function(){return this.content};i.prototype.getOffset=function(){return this.offset};i.prototype.getLimit=function(){return this.limit};i.prototype.setOffset=function(a){this.offset=a};i.prototype.setLimit=function(a){this.limit=a};i.prototype.incrementOffset=function(){this.offset+=this.limit};i.prototype.startLoading=function(){this.isLoading=!0;this.getRoot().addClass("loading")};i.prototype.stopLoading=function(){this.isLoading=!1;this.getRoot().removeClass("loading")};i.prototype.hasDoneInitialLoad=function(){return this.initialLoad};i.prototype.hasLoadedAllContent=function(){return this.loadedAll};i.prototype.setLoadedAllContent=function(a){this.loadedAll=a};i.prototype.setCacheNotification=function(a){this.notifications[a.id]=a};i.prototype.getCacheNotification=function(a){return this.notifications[a]};i.prototype.getNotificationElement=function(a){var b=this.getRoot().find(g.NOTIFICATION+"[data-id=\""+a+"\"]");return 1==b.length?b:null};i.prototype.scrollNotificationIntoView=function(a){var b=a.position(),c=this.getRoot(),d=b.top-c.scrollTop();if(d>c.innerHeight()){var e=a.outerHeight();e=4*e;var f=b.top-e;c.scrollTop(f)}};i.prototype.showNotification=function(b){if("object"!==_typeof(b)){b=this.getNotificationElement(b)}if(b&&b.length){this.getRoot().find(g.NOTIFICATION).removeClass("selected");b.addClass("selected").find(g.CAN_RECEIVE_FOCUS).focus();var c=b.attr("data-id"),d=this.getCacheNotification(c);this.scrollNotificationIntoView(b);this.getContainer().trigger(f.showNotification,[a.extend({},d)])}};i.prototype.markNotificationAsRead=function(a){return e.markAsRead(a.attr("data-id")).done(function(){a.removeClass("unread")})};i.prototype.renderNotifications=function(c){var d=[],e=this.getContent();a.each(c,function(a,c){var e=c.contexturl;delete c.contexturl;var f=b.render(h.NOTIFICATION,c).then(function(a,b){c.contexturl=e;this.setCacheNotification(c);return{html:a,js:b}}.bind(this));d.push(f)}.bind(this));return a.when.apply(a,d).then(function(){a.each(arguments,function(a,c){e.append(c.html);b.runTemplateJS(c.js)})})};i.prototype.loadMoreNotifications=function(){if(this.isLoading||this.hasLoadedAllContent()){return a.Deferred().resolve()}this.startLoading();var b={limit:this.getLimit(),offset:this.getOffset(),useridto:this.getUserId()};if(!this.initialLoad){b.limit=this.getOffset()+this.getLimit();b.offset=0}var c=e.query(b).then(function(a){var b=a.notifications;this.unreadCount=a.unreadcount;this.setLoadedAllContent(!b.length||b.length<this.getLimit());this.initialLoad=!0;if(b.length){this.incrementOffset();return this.renderNotifications(b)}return!1}.bind(this)).always(function(){this.stopLoading()}.bind(this));return c};i.prototype.registerEventListeners=function(){d.define(this.getRoot(),[d.events.activate,d.events.scrollBottom,d.events.scrollLock,d.events.up,d.events.down]);this.getRoot().on(d.events.scrollBottom,function(){this.loadMoreNotifications()}.bind(this));this.getRoot().on(d.events.activate,g.NOTIFICATION,function(b){var c=a(b.target).closest(g.NOTIFICATION);this.showNotification(c)}.bind(this));this.getRoot().on(d.events.up,g.NOTIFICATION,function(b,c){var d=a(b.target).closest(g.NOTIFICATION);this.showNotification(d.prev());c.originalEvent.preventDefault()}.bind(this));this.getRoot().on(d.events.down,g.NOTIFICATION,function(b,c){var d=a(b.target).closest(g.NOTIFICATION);this.showNotification(d.next());c.originalEvent.preventDefault()}.bind(this));this.getContainer().on(f.notificationShown,function(a,b){if(!b.read){var c=this.getNotificationElement(b.id);if(c){this.markNotificationAsRead(c)}var d=this.getCacheNotification(b.id);if(d){d.read=!0}}}.bind(this))};return i});
define ("block_myoverview/main",["jquery","block_myoverview/view","block_myoverview/view_nav"],function(a,b,c){return{init:function init(d){d=a(d);c.init(d);b.init(d)}}});
define ("block_myoverview/view",["jquery","block_myoverview/repository","core/paged_content_factory","core/pubsub","core/custom_interaction_events","core/notification","core/templates","core_course/events","block_myoverview/selectors","core/paged_content_events","core/aria"],function(a,b,c,d,e,f,g,h,i,j,k){var l={COURSE_REGION:"[data-region=\"course-view-content\"]",ACTION_HIDE_COURSE:"[data-action=\"hide-course\"]",ACTION_SHOW_COURSE:"[data-action=\"show-course\"]",ACTION_ADD_FAVOURITE:"[data-action=\"add-favourite\"]",ACTION_REMOVE_FAVOURITE:"[data-action=\"remove-favourite\"]",FAVOURITE_ICON:"[data-region=\"favourite-icon\"]",ICON_IS_FAVOURITE:"[data-region=\"is-favourite\"]",ICON_NOT_FAVOURITE:"[data-region=\"not-favourite\"]",PAGED_CONTENT_CONTAINER:"[data-region=\"page-container\"]"},m={COURSES_CARDS:"block_myoverview/view-cards",COURSES_LIST:"block_myoverview/view-list",COURSES_SUMMARY:"block_myoverview/view-summary",NOCOURSES:"core_course/no-courses"},n={GROUPING_ALLINCLUDINGHIDDEN:"allincludinghidden",GROUPING_ALL:"all",GROUPING_INPROGRESS:"inprogress",GROUPING_FUTURE:"future",GROUPING_PAST:"past",GROUPING_FAVOURITES:"favourites",GROUPING_HIDDEN:"hidden"},o=[12,24,48,96,0],p=[],q=0,r=0,s=0,t=null,u=function(a){var b=a.find(i.courseView.region);return{display:b.attr("data-display"),grouping:b.attr("data-grouping"),sort:b.attr("data-sort"),displaycategories:b.attr("data-displaycategories"),customfieldname:b.attr("data-customfieldname"),customfieldvalue:b.attr("data-customfieldvalue")}},v={ignoreControlWhileLoading:!0,controlPlacementBottom:!0,persistentLimitKey:"block_myoverview_user_paging_preference"},w=function(a,c){return b.getEnrolledCoursesByTimeline({offset:q,limit:c,classification:a.grouping,sort:a.sort,customfieldname:a.customfieldname,customfieldvalue:a.customfieldvalue})},x=function(a,b){return a.find(l.FAVOURITE_ICON+"[data-course-id=\""+b+"\"]")},y=function(a,b){return a.find("[data-region=\"paged-content-page\"][data-page=\""+b+"\"]")},z=function(a){return a.attr("data-course-id")},A=function(a,b){var c=x(a,b),d=c.find(l.ICON_IS_FAVOURITE);d.addClass("hidden");k.hide(d);var e=c.find(l.ICON_NOT_FAVOURITE);e.removeClass("hidden");k.unhide(e)},B=function(a,b){var c=x(a,b),d=c.find(l.ICON_IS_FAVOURITE);d.removeClass("hidden");k.unhide(d);var e=c.find(l.ICON_NOT_FAVOURITE);e.addClass("hidden");k.hide(e)},C=function(a,b){return a.find("[data-action=\"add-favourite\"][data-course-id=\""+b+"\"]")},D=function(a,b){return a.find("[data-action=\"remove-favourite\"][data-course-id=\""+b+"\"]")},E=function(a,b){var c=D(a,b),e=C(a,b);M(b,!0).then(function(g){if(g){d.publish(h.favourited,b);c.removeClass("hidden");e.addClass("hidden");B(a,b)}else{f.alert("Starring course failed","Could not change favourite state")}}).catch(f.exception)},F=function(a,b){var c=D(a,b),e=C(a,b);M(b,!1).then(function(g){if(g){d.publish(h.unfavorited,b);c.addClass("hidden");e.removeClass("hidden");A(a,b)}else{f.alert("Starring course failed","Could not change favourite state")}}).catch(f.exception)},G=function(a,b){return a.find("[data-action=\"hide-course\"][data-course-id=\""+b+"\"]")},H=function(a,b){return a.find("[data-action=\"show-course\"][data-course-id=\""+b+"\"]")},I=function(a,b){var c=G(a,b),d=H(a,b),e=u(a);K(b,!0);if(e.grouping!=n.GROUPING_ALLINCLUDINGHIDDEN){L(a,b)}c.addClass("hidden");d.removeClass("hidden")},J=function(a,b){var c=G(a,b),d=H(a,b),e=u(a);K(b,null);if(e.grouping!=n.GROUPING_ALLINCLUDINGHIDDEN){L(a,b)}c.removeClass("hidden");d.addClass("hidden")},K=function(a,c){if(!1===c){c=null}return b.updateUserPreferences({preferences:[{type:"block_myoverview_hidden_course_"+a,value:c}]})},L=function(b,d){var e=b.find("[data-region=\"paging-bar\"]"),h=parseInt(e.attr("data-active-page-number")),i=p[h],j=i.courses.reduce(function(a,b){if(d!=b.id){a.push(b)}return a},[]);if(p[h+1]!=void 0){var k=p[h+1].courses.slice(0,1);p.forEach(function(b,c){if(c>h){var d=[];if(p[c+1]!=void 0){d=p[c+1].courses.slice(0,1)}p[c].courses=a.merge(p[c].courses.slice(1),d)}});j=a.merge(j,k)}if(r==h+1&&0==p[h+1].courses.length){var l=b.find("[data-region=\"paged-content-container\"]");c.resetLastPageNumber(a(l).attr("id"),h)}p[h].courses=j;q--;var m=y(b,h);N(b,p[h]).then(function(a,b){return g.replaceNodeContents(m,a,b)}).catch(f.exception);p.forEach(function(a,c){if(c>h){var d=y(b,c);d.remove()}})},M=function(a,c){return b.setFavouriteCourses({courses:[{id:a,favourite:c}]}).then(function(b){if(0==b.warnings.length){p.forEach(function(b){b.courses.forEach(function(d,e){if(d.id==a){b.courses[e].isfavourite=c}})});return!0}else{return!1}}).catch(f.exception)},N=function(a,b){var c=u(a),d="";if("card"==c.display){d=m.COURSES_CARDS}else if("list"==c.display){d=m.COURSES_LIST}else{d=m.COURSES_SUMMARY}b.courses=b.courses.map(function(a){a.showcoursecategory="on"==c.displaycategories?!0:!1;return a});if(b.courses.length){return g.render(d,{courses:b.courses})}else{var e=a.find(i.courseView.region).attr("data-nocoursesimg");return g.render(m.NOCOURSES,{nocoursesimg:e})}},O=function(a){this.find(i.courseView.region).attr("data-paging",a)},P=function(a,b){var c=b+j.SET_ITEMS_PER_PAGE_LIMIT;d.subscribe(c,O.bind(a))},Q=function(b){t="block_myoverview_"+b.attr("id")+"_"+Math.random();var d=parseInt(b.find(i.courseView.region).attr("data-paging"),10),e=o.map(function(a){var b=!1;if(a==d){b=!0}return{value:a,active:b}}),h=parseInt(b.find(i.courseView.region).attr("data-totalcoursecount"),10);e=e.filter(function(a){return a.value<h||0===a.value});var j=u(b),k=a.extend({},v);k.eventNamespace=t;var l=c.createWithLimit(e,function(c,d){var e=[];c.forEach(function(c){var g=c.pageNumber,h=0<c.limit?c.limit:0;if(s!=h){p=[];q=0;r=0}if(r==g){d.allItemsLoaded(r);e.push(N(b,p[g]));return}s=h;if(p[g+1]==void 0){if(p[g]==void 0){h*=2}}var i=w(j,h).then(function(e){var f=e.courses,h=0,i=[];if(p[g]!=void 0){i=p[g].courses;var j=i.length;if(j<c.limit){h=c.limit-j;i=a.merge(p[g].courses,f.slice(0,h))}}else{h=c.limit||!1;i=0<c.limit?f.slice(0,c.limit):f}p[g]={courses:i};var k=!1!==h?f.slice(h,f.length):[];if(k.length){p[g+1]={courses:k}}if(p[g].courses.length<c.limit||!k.length){r=g;d.allItemsLoaded(g)}else if(p[g+1]!=void 0&&p[g+1].courses.length<c.limit){r=g+1}q=e.nextoffset;return N(b,p[g])}).catch(f.exception);e.push(i)});return e},k);l.then(function(a,c){P(b,t);return g.replaceNodeContents(b.find(i.courseView.region),a,c)}).catch(f.exception)},R=function(b){e.define(b,[e.events.activate]);b.on(e.events.activate,l.ACTION_ADD_FAVOURITE,function(c,d){var e=a(c.target).closest(l.ACTION_ADD_FAVOURITE),f=z(e);E(b,f);d.originalEvent.preventDefault()});b.on(e.events.activate,l.ACTION_REMOVE_FAVOURITE,function(c,d){var e=a(c.target).closest(l.ACTION_REMOVE_FAVOURITE),f=z(e);F(b,f);d.originalEvent.preventDefault()});b.on(e.events.activate,l.FAVOURITE_ICON,function(a,b){b.originalEvent.preventDefault()});b.on(e.events.activate,l.ACTION_HIDE_COURSE,function(c,d){var e=a(c.target).closest(l.ACTION_HIDE_COURSE),f=z(e);I(b,f);d.originalEvent.preventDefault()});b.on(e.events.activate,l.ACTION_SHOW_COURSE,function(c,d){var e=a(c.target).closest(l.ACTION_SHOW_COURSE),f=z(e);J(b,f);d.originalEvent.preventDefault()})},S=function(b){b=a(b);p=[];r=0;q=0;Q(b);if(!b.attr("data-init")){R(b);b.attr("data-init",!0)}},T=function(a){if(0<p.length){p.forEach(function(b,c){var d=y(a,c);N(a,b).then(function(a,b){return g.replaceNodeContents(d,a,b)}).catch(f.exception)})}else{S(a)}};return{init:S,reset:T}});
define ("block_myoverview/view_nav",["jquery","core/custom_interaction_events","block_myoverview/repository","block_myoverview/view","block_myoverview/selectors"],function(a,b,c,d,f){var g={FILTERS:"[data-region=\"filter\"]",FILTER_OPTION:"[data-filter]",DISPLAY_OPTION:"[data-display-option]"},h=function(a,b){var d=null;if("display"==a){d="block_myoverview_user_view_preference"}else if("sort"==a){d="block_myoverview_user_sort_preference"}else if("customfieldvalue"==a){d="block_myoverview_user_grouping_customfieldvalue_preference"}else{d="block_myoverview_user_grouping_preference"}c.updateUserPreferences({preferences:[{type:d,value:b}]})},i=function(c){var e=c.find(g.FILTERS);b.define(e,[b.events.activate]);e.on(b.events.activate,g.FILTER_OPTION,function(b,e){var g=a(b.target);if(g.hasClass("active")){return}var i=g.attr("data-filter"),j=g.attr("data-pref"),k=g.attr("data-customfieldvalue");c.find(f.courseView.region).attr("data-"+i,g.attr("data-value"));h(i,j);if(k){c.find(f.courseView.region).attr("data-customfieldvalue",k);h("customfieldvalue",k)}d.init(c);e.originalEvent.preventDefault()});b.define(e,[b.events.activate]);e.on(b.events.activate,g.DISPLAY_OPTION,function(b,e){var g=a(b.target);if(g.hasClass("active")){return}var i=g.attr("data-display-option"),j=g.attr("data-pref");c.find(f.courseView.region).attr("data-display",g.attr("data-value"));h(i,j);d.reset(c);e.originalEvent.preventDefault()})};return{init:function init(b){b=a(b);i(b)}}});
define ("block_myoverview/selectors",[],function(){return{courseView:{region:"[data-region=\"courses-view\"]",regionContent:"[data-region=\"course-view-content\"]"}}});
define ("block_myoverview/repository",["core/ajax","core/notification"],function(a,b){return{getEnrolledCoursesByTimeline:function getEnrolledCoursesByTimeline(b){var c=a.call([{methodname:"core_course_get_enrolled_courses_by_timeline_classification",args:b}])[0];return c},setFavouriteCourses:function setFavouriteCourses(b){var c=a.call([{methodname:"core_course_set_favourite_courses",args:b}])[0];return c},updateUserPreferences:function updateUserPreferences(c){a.call([{methodname:"core_user_update_user_preferences",args:c}])[0].fail(b.exception)}}});
define ("block_navigation/navblock",["jquery","core/tree"],function(a,b){return{init:function init(a){var c=new b(".block_navigation .block_tree");c.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c);Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})};c.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c);Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})}}}});
define ("block_navigation/nav_loader",["jquery","core/ajax","core/config","block_navigation/ajax_response_renderer"],function(a,b,c,d){var f=c.wwwroot+"/lib/ajax/getnavbranch.php";function e(a){return a.closest("[data-block]").attr("data-instanceid")}return{load:function load(b){b=a(b);var g=a.Deferred(),h={elementid:b.attr("data-node-id"),id:b.attr("data-node-key"),type:b.attr("data-node-type"),sesskey:c.sesskey,instance:e(b)};a.ajax(f,{type:"POST",dataType:"json",data:h}).done(function(a){d.render(b,a);g.resolve()});return g}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("block_navigation/ajax_response_renderer",["jquery","core/templates","core/notification","core/url","core/aria"],function(a,b,c,d,e){var g={ACTIVITY:40,RESOURCE:50};function f(h,i){var j=a("<ul></ul>");j.attr("role","group");e.hide(j);a.each(i,function(e,h){if("object"!==_typeof(h)){return}var i=a("<li></li>"),k=a("<p></p>"),l=h.id||h.key+"_tree_item",m=null,n=h.expandable||h.haschildren?!0:!1;i.attr("role","treeitem");k.addClass("tree_item");k.attr("id",l);k.attr("tabindex","-1");if(h.requiresajaxloading){i.attr("data-requires-ajax",!0);i.attr("data-node-id",h.id);i.attr("data-node-key",h.key);i.attr("data-node-type",h.type)}if(n){i.addClass("collapsed contains_branch");i.attr("aria-expanded",!1);k.addClass("branch")}var o=null;if(h.link){var p=a("<a title=\""+h.title+"\" href=\""+h.link+"\"></a>");o=p;p.append("<span class=\"item-content-wrap\">"+h.name+"</span>");if(h.hidden){p.addClass("dimmed")}k.append(p)}else{var q=a("<span></span>");o=q;q.append("<span class=\"item-content-wrap\">"+h.name+"</span>");if(h.hidden){q.addClass("dimmed")}k.append(q)}if(h.icon&&(!n||h.type===g.ACTIVITY||h.type===g.RESOURCE)){i.addClass("item_with_icon");k.addClass("hasicon");if(h.type===g.ACTIVITY||h.type===g.RESOURCE){m=a("<img/>");m.attr("alt",h.icon.alt);m.attr("title",h.icon.title);m.attr("src",d.imageUrl(h.icon.pix,h.icon.component));a.each(h.icon.classes,function(a,b){m.addClass(b)});o.prepend(m)}else{if("moodle"==h.icon.component){h.icon.component="core"}b.renderPix(h.icon.pix,h.icon.component,h.icon.title).then(function(a){o.prepend(a)}).catch(c.exception)}}i.append(k);j.append(i);if(h.children&&h.children.length){f(i,h.children)}else if(n&&!h.requiresajaxloading){i.removeClass("contains_branch");k.addClass("emptybranch")}});h.append(j);var k=h.attr("id")+"_group";j.attr("id",k);h.attr("aria-owns",k);h.attr("role","treeitem")}return{render:function render(a,b){if(b.children&&b.children.length){f(a,b.children);var c=a.children("[role='treeitem']").first(),d=a.find("#"+c.attr("aria-owns"));c.attr("aria-expanded",!0);e.unhide(d)}else{if(a.hasClass("contains_branch")){a.removeClass("contains_branch");a.addClass("emptybranch")}}}}});
define ("block_navigation/site_admin_loader",["jquery","core/ajax","core/config","block_navigation/ajax_response_renderer"],function(a,b,c,d){var e=c.wwwroot+"/lib/ajax/getsiteadminbranch.php";return{load:function load(b){b=a(b);var f=a.Deferred(),g={type:71,sesskey:c.sesskey};a.ajax(e,{type:"POST",dataType:"json",data:g}).done(function(a){d.render(b,a);f.resolve()});return f}}});
define ("block_online_users/change_user_visibility",["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={CHANGE_VISIBILITY_LINK:"#change-user-visibility",CHANGE_VISIBILITY_ICON:"#change-user-visibility .icon"},f=function(a,c){var e="show"==a?1:0;b.call([{methodname:"core_user_set_user_preferences",args:{preferences:[{name:"block_online_users_uservisibility",value:e,userid:c}]}}])[0].then(function(b){if(b.saved){var c=g(a);h(c);i(c)}}).catch(d.exception)},g=function(a){return"show"==a?"hide":"show"},h=function(b){k(b).then(function(c){a(e.CHANGE_VISIBILITY_LINK).attr({"data-action":b,title:c})}).catch(d.exception)},i=function(b){var c=a(e.CHANGE_VISIBILITY_ICON);k(b).then(function(d){a(c).attr({title:d,"aria-label":d});if(c.is("img")){a(c).attr({src:M.util.image_url("t/"+b),alt:d})}else{a(c).addClass(j(b));a(c).removeClass(j(g(b)))}}).catch(d.exception)},j=function(a){return"show"==a?"fa-eye-slash":"fa-eye"},k=function(a){return c.get_string("online_status:"+a,"block_online_users")};return{init:function init(){a(e.CHANGE_VISIBILITY_LINK).on("click",function(b){b.preventDefault();var c=a(this).attr("data-action"),d=a(this).attr("data-userid");f(c,d)})}}});
define ("block_recentlyaccessedcourses/main",["jquery","core/custom_interaction_events","core/notification","core/pubsub","core/paged_content_paging_bar","core/templates","core_course/events","core_course/repository","core/aria"],function(a,b,c,d,e,f,g,h,i){var j={BLOCK_CONTAINER:"[data-region=\"recentlyaccessedcourses\"]",CARD_CONTAINER:"[data-region=\"card-deck\"]",COURSE_IS_FAVOURITE:"[data-region=\"is-favourite\"]",CONTENT:"[data-region=\"view-content\"]",EMPTY_MESSAGE:"[data-region=\"empty-message\"]",LOADING_PLACEHOLDER:"[data-region=\"loading-placeholder\"]",PAGING_BAR:"[data-region=\"paging-bar\"]",PAGING_BAR_NEXT:"[data-control=\"next\"]",PAGING_BAR_PREVIOUS:"[data-control=\"previous\"]"},k=!1,l=[],m=null,n=null,o=0,p=1,q=function(a){a.find(j.EMPTY_MESSAGE).removeClass("hidden");a.find(j.LOADING_PLACEHOLDER).addClass("hidden");a.find(j.CONTENT).addClass("hidden")},r=function(a){a.find(j.CONTENT).removeClass("hidden");a.find(j.EMPTY_MESSAGE).addClass("hidden");a.find(j.LOADING_PLACEHOLDER).addClass("hidden")},s=function(a){var b=a.find(j.PAGING_BAR);b.css("opacity",1);b.css("visibility","visible");i.unhide(b)},t=function(a){var b=a.find(j.PAGING_BAR);b.css("opacity",0);b.css("visibility","hidden");i.hide(b)},u=function(a,b){l.forEach(function(a){if(a.attr("data-course-id")==b){a.find(j.COURSE_IS_FAVOURITE).removeClass("hidden")}})},v=function(a,b){l.forEach(function(a){if(a.attr("data-course-id")==b){a.find(j.COURSE_IS_FAVOURITE).addClass("hidden")}})},w=function(b){var d=a(j.BLOCK_CONTAINER).data("displaycoursecategory"),e=b.map(function(a){a.showcoursecategory=d;return f.render("block_recentlyaccessedcourses/course-card",a)});return a.when.apply(null,e).then(function(){var b=[];e.forEach(function(d){d.then(function(c){b.push(a(c))}).catch(c.exception)});return b})},x=function(a){return h.getLastAccessedCourses(a,10).then(function(a){return w(a)})},y=function(a){var b=a.find(j.CONTENT).find(j.CARD_CONTAINER),c=parseFloat(a.css("width")),d=l.length,f=0;if(!n){b.html(l[0]);n=l[0].outerWidth(!0)}p=Math.floor(c/n);if(o+p<d){f=o}else{var g=o+p-d;f=o-g;f=0<=f?f:0}if(0===p){p=1}var h=l.slice(f,f+p),i=h.reduce(function(a,b){return a+b.attr("data-course-id")},"");if(l.length>h.length){b.addClass("justify-content-center");b.removeClass("justify-content-start")}else{b.removeClass("justify-content-center");b.addClass("justify-content-start")}if(m!=i){var k=a.find(e.rootSelector);b.html(h);m=i;if(p>=l.length){t(a)}else{s(a);if(0===o){e.disablePreviousControlButtons(k)}else{e.enablePreviousControlButtons(k)}if(o+p>=l.length){e.disableNextControlButtons(k)}else{e.enableNextControlButtons(k)}}}},z=function(c){var e=null,f=!1;d.subscribe(g.favourited,function(a){u(c,a)});d.subscribe(g.unfavorited,function(a){v(c,a)});d.subscribe("nav-drawer-toggle-start",function(){if(!k||!l.length||f){return}f=!0;var a=0,b=function(){setTimeout(function(){y(c);a++;if(5>a&&f){b()}},100)};b(c)});d.subscribe("nav-drawer-toggle-end",function(){f=!1});a(window).on("resize",function(){if(!k||!l.length){return}if(!e){e=setTimeout(function(){e=null;y(c)},66)}});b.define(c,[b.events.activate]);c.on(b.events.activate,j.PAGING_BAR_NEXT,function(b,d){var e=a(b.target).closest(j.PAGING_BAR_NEXT);if(!e.hasClass("disabled")){o=o+p;y(c)}d.originalEvent.preventDefault()});c.on(b.events.activate,j.PAGING_BAR_PREVIOUS,function(b,d){var e=a(b.target).closest(j.PAGING_BAR_PREVIOUS);if(!e.hasClass("disabled")){o=o-p;o=0>o?0:o;y(c)}d.originalEvent.preventDefault()})};return{init:function init(b,d){d=a(d);z(d);x(b).then(function(a){l=a;k=!0;if(l.length){r(d);y(d)}else{q(d)}}).catch(c.exception)}}});
define ("block_recentlyaccesseditems/main",["jquery","block_recentlyaccesseditems/repository","core/templates","core/notification"],function(a,b,c,d){var e={CARDDECK_CONTAINER:"[data-region=\"recentlyaccesseditems-view\"]",CARDDECK:"[data-region=\"recentlyaccesseditems-view-content\"]"},f=function(a){return b.getRecentItems(a)},g=function(a,b){if(0<b.length){return c.render("block_recentlyaccesseditems/view-cards",{items:b})}else{var d=a.attr("data-noitemsimgurl");return c.render("block_recentlyaccesseditems/no-items",{noitemsimgurl:d})}};return{init:function init(b){b=a(b);var h=b.find(e.CARDDECK_CONTAINER),i=b.find(e.CARDDECK),j=f(9);j.then(function(a){var b=g(h,a);b.then(function(a,b){return c.replaceNodeContents(i,a,b)}).catch(d.exception);return j}).catch(d.exception)}}});
define ("block_recentlyaccesseditems/repository",["core/ajax"],function(a){return{getRecentItems:function getRecentItems(b){var c={};if("undefined"!=typeof b){c.limit=b}return a.call([{methodname:"block_recentlyaccesseditems_get_recent_items",args:c}])[0]}}});
define ("block_settings/settingsblock",["jquery","core/tree"],function(a,b){return{init:function init(a,c){var d=new b(".block_settings .block_tree");if(c){var e=d.treeRoot.find("#"+c),f=e.children("a").first();f.replaceWith("<span tabindex=\"0\">"+f.html()+"</span>")}d.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c);Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})};d.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c);Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})}}}});
define ("block_starredcourses/main",["jquery","core/notification","block_starredcourses/repository","core/pubsub","core/templates","core_course/events"],function(a,b,c,d,e,f){var g={BLOCK_CONTAINER:"[data-region=\"starred-courses\"]",STARRED_COURSES_REGION_VIEW:"[data-region=\"starred-courses-view\"]",STARRED_COURSES_REGION:"[data-region=\"starred-courses-view-content\"]"},h=function(a,b){if(0<b.length){return e.render("core_course/view-cards",{courses:b})}else{var c=a.find(g.STARRED_COURSES_REGION_VIEW).attr("data-nocoursesimg");return e.render("block_starredcourses/no-courses",{nocoursesimg:c})}},i=function(d){var f=d.find(g.STARRED_COURSES_REGION);return c.getStarredCourses({limit:0,offset:0}).then(function(b){var c=a(g.BLOCK_CONTAINER).data("displaycoursecategory");b=b.map(function(a){a.showcoursecategory=c;return a});return h(d,b)}).then(function(a,b){return e.replaceNodeContents(f,a,b)}).catch(b.exception)},j=function(a){d.subscribe(f.favourited,function(){i(a)});d.subscribe(f.unfavorited,function(){i(a)})};return{init:function init(b){b=a(b);j(b);i(b)}}});
define ("block_starredcourses/repository",["jquery","core/ajax","core/notification"],function(a,b,c){return{getStarredCourses:function getStarredCourses(a){var d=b.call([{methodname:"block_starredcourses_get_starred_courses",args:a}])[0];d.fail(c.exception);return d}}});
define ("block_timeline/main",["jquery","block_timeline/view_nav","block_timeline/view"],function(a,b,c){var d={TIMELINE_VIEW:"[data-region=\"timeline-view\"]"};return{init:function init(e){e=a(e);var f=e.find(d.TIMELINE_VIEW);b.init(e,f);c.init(f)}}});
define ("block_timeline/calendar_events_repository",["jquery","core/ajax","core/notification"],function(a,b,c){return{queryByTime:function queryByTime(a){if(!a.hasOwnProperty("limit")){a.limit=20}a.limitnum=a.limit;delete a.limit;if(a.hasOwnProperty("starttime")){a.timesortfrom=a.starttime;delete a.starttime}if(a.hasOwnProperty("endtime")){a.timesortto=a.endtime;delete a.endtime}a.limittononsuspendedevents=!0;var d=b.call([{methodname:"core_calendar_get_action_events_by_timesort",args:a}])[0];d.fail(c.exception);return d},queryByCourse:function queryByCourse(a){if(!a.hasOwnProperty("limit")){a.limit=20}a.limitnum=a.limit;delete a.limit;if(a.hasOwnProperty("starttime")){a.timesortfrom=a.starttime;delete a.starttime}if(a.hasOwnProperty("endtime")){a.timesortto=a.endtime;delete a.endtime}var d=b.call([{methodname:"core_calendar_get_action_events_by_course",args:a}])[0];d.fail(c.exception);return d},queryByCourses:function queryByCourses(a){if(!a.hasOwnProperty("limit")){a.limit=10}a.limitnum=a.limit;delete a.limit;if(a.hasOwnProperty("starttime")){a.timesortfrom=a.starttime;delete a.starttime}if(a.hasOwnProperty("endtime")){a.timesortto=a.endtime;delete a.endtime}var d=b.call([{methodname:"core_calendar_get_action_events_by_courses",args:a}])[0];d.fail(c.exception);return d}}});
define ("block_timeline/view_dates",["jquery","core/str","block_timeline/event_list","core/pubsub","core/paged_content_events"],function(a,b,c,d,e){var f={EVENT_LIST_CONTAINER:"[data-region=\"event-list-container\"]"},g=[5,10,25],h=function(a){var b=parseInt(a.data("limit"),10),c=!1,d=g.map(function(a){if(b==a){c=!0}return{value:a,active:b==a}});if(!c){d[0].active=!0}return d},i=function(b,c){var f=c+e.SET_ITEMS_PER_PAGE_LIMIT;d.subscribe(f,function(c){a(b).data("limit",c)})},j=function(d){var e=d.find(f.EVENT_LIST_CONTAINER),g=a(e).attr("id")+"user_block_timeline"+Math.random();i(d,g);var j=h(d),k={persistentLimitKey:"block_timeline_user_limit_preference",eventNamespace:g};b.get_string("ariaeventlistpaginationnavdates","block_timeline").then(function(a){c.init(e,j,{},a,k);return a}).catch(function(){c.init(e,j,{},"",k)})};return{init:function init(b){b=a(b);if(b.hasClass("active")){j(b);b.attr("data-seen",!0)}},reset:function reset(a){a.removeAttr("data-seen");if(a.hasClass("active")){j(a);a.attr("data-seen",!0)}},shown:function shown(a){if(!a.attr("data-seen")){j(a);a.attr("data-seen",!0)}}}});
define ("block_timeline/view_courses",["jquery","core/notification","core/custom_interaction_events","core/str","core/templates","block_timeline/event_list","core_course/repository","block_timeline/calendar_events_repository"],function(a,b,c,d,e,f,g,h){var i={MORE_COURSES_BUTTON:"[data-action=\"more-courses\"]",MORE_COURSES_BUTTON_CONTAINER:"[data-region=\"more-courses-button-container\"]",NO_COURSES_EMPTY_MESSAGE:"[data-region=\"no-courses-empty-message\"]",COURSES_LIST:"[data-region=\"courses-list\"]",COURSE_ITEMS_LOADING_PLACEHOLDER:"[data-region=\"course-items-loading-placeholder\"]",COURSE_EVENTS_CONTAINER:"[data-region=\"course-events-container\"]",COURSE_NAME:"[data-region=\"course-name\"]",LOADING_ICON:".loading-icon"},j={COURSE_ITEMS:"block_timeline/course-items",LOADING_ICON:"core/loading"},k=5,l=86400,m=function(a){a.find(i.COURSE_ITEMS_LOADING_PLACEHOLDER).addClass("hidden")},n=function(a){a.find(i.MORE_COURSES_BUTTON_CONTAINER).addClass("hidden")},o=function(a){a.find(i.MORE_COURSES_BUTTON_CONTAINER).removeClass("hidden")},p=function(a){var b=a.find(i.MORE_COURSES_BUTTON);b.prop("disabled",!0);e.render(j.LOADING_ICON,{}).then(function(a){b.append(a);return a}).catch(function(){return!1})},q=function(a){var b=a.find(i.MORE_COURSES_BUTTON);b.prop("disabled",!1);b.find(i.LOADING_ICON).remove()},r=function(a){a.find(i.NO_COURSES_EMPTY_MESSAGE).removeClass("hidden")},s=function(a,b){var c=a.find(i.COURSES_LIST);e.appendNodeContents(c,b,"")},t=function(a){return 0<a.find(i.COURSE_EVENTS_CONTAINER).length},u=function(a){return parseInt(a.attr("data-offset"),10)},v=function(a,b){a.attr("data-offset",b)},w=function(a){return parseInt(a.attr("data-limit"),10)},x=function(a){return parseInt(a.attr("data-days-offset"),10)},y=function(a){var b=a.attr("data-days-limit");return b!=void 0?parseInt(b,10):void 0},z=function(a){return parseInt(a.attr("data-midnight"),10)},A=function(a){var b=z(a),c=x(a);return b+c*l},B=function(a){var b=z(a),c=y(a);return c!=void 0?b+c*l:!1},C=function(a,b,c,d){var e={courseids:a,starttime:b,limit:c};if(d){e.endtime=d}return h.queryByCourses(e)},D=function(a){return a.data("last-event-load-time")},E=function(a,b){a.data("last-event-load-time",b)},F=function(a,b){return D(a)>b},G=function(a,b,c){var d=a.map(function(a){return a.id});return C(d,b,k+1,c)},H=function(a,b,c,d,f,g){return e.render(j.COURSE_ITEMS,{courses:a,midnight:c,hasdaysoffset:!0,hasdayslimit:f!=void 0,daysoffset:d,dayslimit:f,nodayslimit:f==void 0,urls:{noevents:g}}).then(function(a){m(b);if(a){s(b,a)}else{if(!t(b)){r(b)}}return a}).then(function(c){if(a.length<2){n(b)}else{o(b)}return c}).catch(function(){m(b)})},I=function(c){var e=u(c),h=w(c);return g.getEnrolledCoursesByTimelineClassification("inprogress",h,e,"fullname asc").then(function(b){var e=Date.now(),g=b.courses,h=b.nextoffset,i=x(c),j=y(c),l=z(c),m=A(c),n=B(c),o=c.attr("data-no-events-url");v(c,h);var p=G(g,m,n),q=H(g,c,l,i,j,o);return a.when(p,q).then(function(b){if(F(c,e)){return b}g.forEach(function(e){var g=e.id,h=[],i=c.find("[data-region=\"course-events-container\"][data-course-id=\""+g+"\"]"),j=i.find(f.rootSelector),l=b.groupedbycourse.filter(function(a){return a.courseid==g});if(l.length){h=l[0].events}var m=a.Deferred().resolve({events:h}).promise();d.get_string("ariaeventlistpaginationnavcourses","block_timeline",e.fullnamedisplay).then(function(a){f.init(j,k,{1:m},a);return a}).catch(function(){f.init(j,k,{1:m})})});return b})}).catch(b.exception)},J=function(c){var e=Date.now(),g=A(c),h=B(c),j=c.find(i.COURSE_EVENTS_CONTAINER),l=j.map(function(){return a(this).attr("data-course-id")}).get();E(c,e);return C(l,g,k+1,h).then(function(b){if(F(c,e)){return b}j.each(function(c,e){e=a(e);var g=e.attr("data-course-id"),h=e.find(i.COURSE_NAME).text(),j=e.find(f.rootSelector),l=a.Deferred(),m=[],n=b.groupedbycourse.filter(function(a){return a.courseid==g});if(n.length){m=n[0].events}l.resolve({events:m});d.get_string("ariaeventlistpaginationnavcourses","block_timeline",h).then(function(a){f.init(j,k,{1:l.promise()},a);return a}).catch(function(){f.init(j,k,{1:l.promise()})})});return b}).catch(b.exception)},K=function(a){c.define(a,[c.events.activate]);a.on(c.events.activate,i.MORE_COURSES_BUTTON,function(b,c){p(a);I(a).then(function(){q(a)}).catch(function(){q(a)});if(c){c.originalEvent.preventDefault();c.originalEvent.stopPropagation()}b.stopPropagation()})},L=function(a){if(!a.attr("data-seen")){if(t(a)){J(a)}else{I(a)}a.attr("data-seen",!0)}};return{init:function init(b){b=a(b);E(b,Date.now());if(b.hasClass("active")){I(b);b.attr("data-seen",!0)}K(b)},reset:function reset(a){a.removeAttr("data-seen");if(a.hasClass("active")){L(a)}},shown:L}});
define ("block_timeline/view",["jquery","block_timeline/view_dates","block_timeline/view_courses"],function(a,b,c){var d={TIMELINE_DATES_VIEW:"[data-region=\"view-dates\"]",TIMELINE_COURSES_VIEW:"[data-region=\"view-courses\"]"};return{init:function init(e){e=a(e);var f=e.find(d.TIMELINE_DATES_VIEW),g=e.find(d.TIMELINE_COURSES_VIEW);b.init(f);c.init(g)},reset:function reset(a){var e=a.find(d.TIMELINE_DATES_VIEW),f=a.find(d.TIMELINE_COURSES_VIEW);b.reset(e);c.reset(f)},shown:function shown(a){var e=a.find(d.TIMELINE_DATES_VIEW),f=a.find(d.TIMELINE_COURSES_VIEW);if(e.hasClass("active")){b.shown(e)}else{c.shown(f)}}}});
define ("block_timeline/view_nav",["jquery","core/custom_interaction_events","block_timeline/view","core/ajax","core/notification"],function(a,b,c,d,e){var f={TIMELINE_DAY_FILTER:"[data-region=\"day-filter\"]",TIMELINE_DAY_FILTER_OPTION:"[data-from]",TIMELINE_VIEW_SELECTOR:"[data-region=\"view-selector\"]",DATA_DAYS_OFFSET:"[data-days-offset]",DATA_DAYS_LIMIT:"[data-days-limit]"},g=function(a,b){d.call([{methodname:"core_user_update_user_preferences",args:{preferences:[{type:a,value:b}]}}])[0].fail(e.exception)},h=function(d,h){var i=d.find(f.TIMELINE_DAY_FILTER);b.define(i,[b.events.activate]);i.on(b.events.activate,f.TIMELINE_DAY_FILTER_OPTION,function(b,e){var i=a(b.currentTarget).data("filtername");g("block_timeline_user_filter_preference",i);var j=a(b.target).closest(f.TIMELINE_DAY_FILTER_OPTION);if("true"==j.attr("aria-current")){return}var k=j.attr("data-from"),l=j.attr("data-to"),m=d.find(f.DATA_DAYS_OFFSET);m.attr("data-days-offset",k);if(l!=void 0){m.attr("data-days-limit",l)}else{m.removeAttr("data-days-limit")}c.reset(h);e.originalEvent.preventDefault()})},i=function(d,h){var i=d.find(f.TIMELINE_VIEW_SELECTOR);i.on("shown shown.bs.tab",function(b){c.shown(h);a(b.target).removeClass("active")});b.define(i,[b.events.activate]);i.on(b.events.activate,"[data-toggle='tab']",function(b){var c=a(b.currentTarget).data("filtername");g("block_timeline_user_sort_preference",c)})};return{init:function init(b,c){b=a(b);h(b,c);i(b,c)}}});
define ("block_timeline/event_list",["jquery","core/notification","core/templates","core/paged_content_factory","core/str","core/user_date","block_timeline/calendar_events_repository"],function(a,b,c,d,e,f,g){var h={EMPTY_MESSAGE:"[data-region=\"empty-message\"]",ROOT:"[data-region=\"event-list-container\"]",EVENT_LIST_CONTENT:"[data-region=\"event-list-content\"]",EVENT_LIST_LOADING_PLACEHOLDER:"[data-region=\"event-list-loading-placeholder\"]"},i={EVENT_LIST_CONTENT:"block_timeline/event-list-content"},j={ignoreControlWhileLoading:!0,controlPlacementBottom:!0,ariaLabels:{itemsperpagecomponents:"ariaeventlistpagelimit, block_timeline"}},k=function(a){a.find(h.EVENT_LIST_CONTENT).addClass("hidden");a.find(h.EMPTY_MESSAGE).removeClass("hidden")},l=function(a){a.find(h.EVENT_LIST_CONTENT).removeClass("hidden");a.find(h.EMPTY_MESSAGE).addClass("hidden")},m=function(a){a.find(h.EVENT_LIST_CONTENT).empty()},n=function(a,b){var c={},d={eventsbyday:[]};a.forEach(function(a){var b=a.timeusermidnight;if(c[b]){c[b].push(a)}else{c[b]=[a]}});Object.keys(c).forEach(function(a){var e=c[a];d.eventsbyday.push({past:a<b,dayTimestamp:a,events:e})});return d},o=function(a,b){var d=n(a,b),e=i.EVENT_LIST_CONTENT;return c.render(e,d)},p=function(a,b,c,d,e,f){var h=d!=void 0?a+d*86400:!1,i={starttime:a+c*86400,limit:b};if(e){i.aftereventid=e}if(h){i.endtime=h}if(f){i.courseid=f;return g.queryByCourse(i)}else{return g.queryByTime(i)}},q=function(a,b,c,d,e,g,h,i){var j=a.pageNumber,k=a.limit,l=j;while(!d.hasOwnProperty(l)){l--}var m=d[l],n=null;if(e&&e.hasOwnProperty(j)){n=e[j]}else{n=p(c,k+1,h,i,m,g)}return n.then(function(a){if(!a.events.length){b.allItemsLoaded(j);return[]}var d=a.events.filter(function(a){if("open"==a.eventtype||"opensubmission"==a.eventtype){var b=f.getUserMidnightForTimestamp(a.timesort,c);return b>c}return!0}),e=d.length<=k;if(e){b.allItemsLoaded(j)}else{d.pop()}return d})},r=function(c,f,g,h,i,k,l,m,n){var p={1:0},r=!1,s=a.extend({},j,n);return e.get_string("ariaeventlistpagelimit","block_timeline",a.isArray(c)?c[0].value:c).then(function(a){s.ariaLabels.itemsperpage=a;s.ariaLabels.paginationnav=m;return a}).then(function(){return d.createWithLimit(c,function(c,d){var e=[];c.forEach(function(a){var c=a.pageNumber,h=q(a,d,g,p,f,i,k,l).then(function(a){if(a.length){r=!0;var b=a[a.length-1].id;p[c+1]=b;return o(a,g)}else{return a}}).catch(b.exception);e.push(h)});a.when.apply(a,e).then(function(){h.resolve(r)}).catch(function(){h.resolve(r)});return e},s)})};return{init:function init(d,e,f,g,i){d=a(d);var j=a.Deferred(),n=d.find(h.EVENT_LIST_CONTENT),o=d.find(h.EVENT_LIST_LOADING_PLACEHOLDER),p=d.attr("data-course-id"),q=parseInt(d.attr("data-days-offset"),10),s=d.attr("data-days-limit"),t=parseInt(d.attr("data-midnight"),10);m(d);l(d);o.removeClass("hidden");if(s!=void 0){s=parseInt(s,10)}return r(e,f,t,j,p,q,s,g,i).then(function(b,e){b=a(b);b.addClass("hidden");c.replaceNodeContents(n,b,e);j.then(function(a){b.removeClass("hidden");o.addClass("hidden");if(!a){k(d)}return a}).catch(function(){return!1});return b}).catch(b.exception)},rootSelector:h.ROOT}});
define ("media_videojs/document",[],function(){return document});
define ("media_videojs/window",[],function(){return window});
define ("media_videojs/loader",["exports","core/config","core/event","jquery","core/ajax","core/localstorage","core/notification"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.setUp=void 0;b=h(b);c=h(c);d=h(d);e=h(e);f=h(f);g=h(g);var o="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function h(a){return a&&a.__esModule?a:{default:a}}function i(a,b){return n(a)||m(a,b)||k(a,b)||j()}function j(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(a,b){if(!a)return;if("string"==typeof a)return l(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return l(a,b)}function l(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function m(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function n(a){if(Array.isArray(a))return a}var p,q,r,s=function(a){q=a;p=!0;t(null,(0,d.default)("body"));c.default.getLegacyEvents().done(function(a){(0,d.default)(document).on(a.FILTER_CONTENT_UPDATED,t)})};a.setUp=s;var t=function(a,c){var e=u();c.find(".mediaplugin_videojs").addBack(".mediaplugin_videojs").find("audio, video").each(function(a,c){var f=(0,d.default)(c).attr("id"),h=(0,d.default)(c).data("setup-lazy"),j=["function"==typeof o.define&&o.define.amd?new Promise(function(a,b){o.require(["media_videojs/video-lazy"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&o.require&&"component"===o.require.loader?Promise.resolve(require(("media_videojs/video-lazy"))):Promise.resolve(o["media_videojs/video-lazy"])];if(h.techOrder&&-1!==h.techOrder.indexOf("youtube")){j.push("function"==typeof o.define&&o.define.amd?new Promise(function(a,b){o.require(["media_videojs/Youtube-lazy"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&o.require&&"component"===o.require.loader?Promise.resolve(require(("media_videojs/Youtube-lazy"))):Promise.resolve(o["media_videojs/Youtube-lazy"]))}if(h.techOrder&&-1!==h.techOrder.indexOf("flash")){j.push("function"==typeof o.define&&o.define.amd?new Promise(function(a,b){o.require(["media_videojs/videojs-flash-lazy"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&o.require&&"component"===o.require.loader?Promise.resolve(require(("media_videojs/videojs-flash-lazy"))):Promise.resolve(o["media_videojs/videojs-flash-lazy"]))}Promise.all([e].concat(j)).then(function(a){var c=i(a,2),d=c[0],e=c[1];if(p){e.options.flash.swf="".concat(b.default.wwwroot,"/media/player/videojs/videojs/video-js.swf");e.addLanguage(q,d);p=!1}e(f,h)}).catch(g.default.exception)})},u=function(){if(r){return Promise.resolve(r)}var a="media_videojs/".concat(q),b=f.default.get(a);if(b){var d=JSON.parse(b);r=d;return Promise.resolve(r)}var c={methodname:"media_videojs_get_language",args:{lang:q}};return e.default.call([c])[0].then(function(b){f.default.set(a,b);return b}).then(function(a){return JSON.parse(a)}).then(function(a){r=a;return a})}});
define ("editor_atto/events",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.notifyButtonHighlightToggled=a.eventTypes=void 0;var b={attoButtonHighlightToggled:"editor_atto/attoButtonHighlightToggled"};a.eventTypes=b;a.notifyButtonHighlightToggled=function notifyButtonHighlightToggled(a,c,d){var e=new CustomEvent(b.attoButtonHighlightToggled,{bubbles:!0,cancelable:!1,composed:!1,detail:{buttonName:c,highlight:d}});a.dispatchEvent(e);return e}});
define ("report_competency/user_course_navigation",["jquery"],function(a){var b=function(b,c,d,e,f,g){this._baseUrl=d;this._userId=e+"";this._courseId=f;this._moduleId=g;a(b).on("change",this._userChanged.bind(this));a(c).on("change",this._moduleChanged.bind(this))};b.prototype._userChanged=function(b){M.util.js_pending("report_competency/user_course_navigation:_userChanged");var c=a(b.target).val(),d="?user="+c+"&id="+this._courseId+"&mod="+this._moduleId;document.location=this._baseUrl+d};b.prototype._moduleChanged=function(b){M.util.js_pending("report_competency/user_course_navigation:_moduleChanged");var c=a(b.target).val(),d="?mod="+c+"&id="+this._courseId+"&user="+this._userId;document.location=this._baseUrl+d};b.prototype._userId=null;b.prototype._moduleId=null;b.prototype._courseId=null;b.prototype._baseUrl=null;return b});
define ("report_competency/grading_popup",["jquery","core/notification","core/str","core/ajax","core/log","core/templates","tool_lp/dialogue"],function(a,b,c,d,f,g,h){var i=function(b,c){this._regionSelector=b;this._userCompetencySelector=c;a(this._regionSelector).on("click",this._userCompetencySelector,this._handleClick.bind(this))};i.prototype._handleClick=function(c){var e=a(c.target).closest(this._userCompetencySelector),g=a(e).data("competencyid"),h=a(e).data("courseid"),i=a(e).data("userid");f.debug("Clicked on cell: competencyId="+g+", courseId="+h+", userId="+i);var j=d.call([{methodname:"tool_lp_data_for_user_competency_summary_in_course",args:{userid:i,competencyid:g,courseid:h}},{methodname:"core_competency_user_competency_viewed_in_course",args:{userid:i,competencyid:g,courseid:h}}]);a.when(j[0],j[1]).then(this._contextLoaded.bind(this)).catch(b.exception)};i.prototype._contextLoaded=function(b){b.displayuser=!0;M.util.js_pending("report_competency/grading_popup:_contextLoaded");return a.when(c.get_string("usercompetencysummary","report_competency"),g.render("tool_lp/user_competency_summary_in_course",b)).then(function(a,b){return new h(a,b[0],function(){g.runTemplateJS(b[1]);M.util.js_complete("report_competency/grading_popup:_contextLoaded")},this._refresh.bind(this),!0)}.bind(this))};i.prototype._refresh=function(){var c=a(this._regionSelector),e=c.data("courseid"),f=c.data("moduleid"),g=c.data("userid");if(""===f){f=0}return d.call([{methodname:"report_competency_data_for_report",args:{courseid:e,userid:g,moduleid:f},done:this._pageContextLoaded.bind(this),fail:b.exception}])};i.prototype._pageContextLoaded=function(a){g.render("report_competency/report",a).then(function(a,b){g.replaceNode(this._regionSelector,a,b)}.bind(this)).catch(b.exception)};i.prototype._regionSelector=null;i.prototype._userCompetencySelector=null;return i});
define ("report_insights/actions",["jquery","core/str","core/ajax","core/notification","core/url","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g){return{initBulk:function initBulk(h){var i=function(a,b,f){return c.call([{methodname:"report_insights_action_executed",args:{predictionids:a,actionname:f}}])[0].then(function(){var a=!1;b.forEach(function(b){if(!1===a){a=b.closest("table")}b.remove()});if(0===a.find("tbody > tr").length){var c={contextid:a.closest("div.insight-container").data("context-id"),modelid:a.closest("div.insight-container").data("model-id")};window.location.assign(e.relativeUrl("report/insights/insights.php",c,!1))}}).catch(d.exception)};a(h+" [data-bulk-actionname]").on("click",function(c){c.preventDefault();var e=a(c.currentTarget),h=e.data("bulk-actionname"),j=e.text().trim(),k=[],l=[];a(".insights-list input[data-togglegroup^=\"insight-bulk-action-\"][data-toggle=\"slave\"]:checked").each(function(){var b=a(this).closest("tr[data-prediction-id]");l.push(b);k.push(b.data("prediction-id"))});if(0===k.length){return this}var m=[];b.get_strings([{key:"confirmbulkaction",component:"report_insights",param:{action:j,nitems:k.length}},{key:"confirm",component:"moodle"}]).then(function(a){m=a;return f.create({type:f.types.SAVE_CANCEL,title:j,body:m[0]})}).then(function(a){a.setSaveButtonText(m[1]);a.show();a.getRoot().on(g.save,function(){return i(k,l,h)});return a}).catch(d.exception);return this})}}});
define ("report_insights/message_users",["jquery","core/str","core/log","core/modal_factory","core/modal_events","core/templates","core/notification","core/ajax"],function(a,b,c,d,e,f,g,h){var i={BULKACTIONSELECT:"#formactionid"},j=function(a,b){this.actionName=b;this.attachEventListeners(a)};j.prototype.actionName=null;j.prototype.modal=null;j.prototype.attachEventListeners=function(b){a(b+" button[data-bulk-sendmessage]").on("click",function(b){b.preventDefault();var d=a(b.currentTarget),e={},f=d.data("prediction-to-user-id");a(".insights-list input[data-togglegroup^=\"insight-bulk-action\"][data-toggle=\"slave\"]:checked").each(function(b,d){var g=a(d).closest("tr[data-prediction-id]").data("prediction-id");if("undefined"==typeof f[g]){c.error("Unknown user for prediction "+g);return}var h=f[g];e[g]=h});if(0===Object.keys(e).length){return this}this.showSendMessage(e);return this}.bind(this))};j.prototype.showSendMessage=function(c){var g=new Set(Object.values(c));if(0==g.length){return a.Deferred().resolve().promise()}var h=null;if(1==g.size){h=b.get_string("sendbulkmessagesingle","core_message")}else{h=b.get_string("sendbulkmessage","core_message",g.size)}return a.when(d.create({type:d.types.SAVE_CANCEL,body:f.render("core_user/send_bulk_message",{})}),h).then(function(b,d){this.modal=b;this.modal.setTitle(d);this.modal.setSaveButtonText(d);this.modal.getRoot().on(e.hidden,function(){a(i.BULKACTIONSELECT).focus();this.modal.getRoot().remove()}.bind(this));this.modal.getRoot().on(e.save,this.submitSendMessage.bind(this,c));this.modal.show();return this.modal}.bind(this))};j.prototype.submitSendMessage=function(a){var c=this.modal.getRoot().find("form textarea").val(),d=[],e=new Set(Object.values(a));e.forEach(function(a){d.push({touserid:a,text:c})});var f=this.actionName,i=null;return h.call([{methodname:"core_message_send_instant_messages",args:{messages:d}}])[0].then(function(a){if(1==a.length){return b.get_string("sendbulkmessagesentsingle","core_message")}else{return b.get_string("sendbulkmessagesent","core_message",a.length)}}).then(function(b){i=b;return h.call([{methodname:"report_insights_action_executed",args:{actionname:f,predictionids:Object.keys(a)}}])[0]}).then(function(){g.addNotification({message:i,type:"success"});return!0}).catch(g.exception)};return{init:function init(a,b){return new j(a,b)}}});
define ("report_participation/participants",["exports","jquery","core/custom_interaction_events","core/modal_events","core/notification","core_user/local/participants/bulkactions"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=g(b);c=g(c);d=g(d);e=g(e);function g(a){return a&&a.__esModule?a:{default:a}}var h={bulkActionSelect:"#formactionid",bulkUserSelectedCheckBoxes:"input[data-togglegroup^='participants-table'][data-toggle='slave']:checked",participantsForm:"#participantsform"};a.init=function init(){var a=document.querySelector(h.participantsForm),g=function(){c.default.define(h.bulkActionSelect,[c.default.events.accessibleChange]);(0,b.default)(h.bulkActionSelect).on(c.default.events.accessibleChange,function(b){var c=b.target.value,g=a.querySelectorAll(h.bulkUserSelectedCheckBoxes);if(-1!==c.indexOf("#")){b.preventDefault();var j=[];g.forEach(function(a){j.push(a.getAttribute("name").replace("user",""))});if("#messageselect"===c){(0,f.showSendMessage)(j).then(function(b){b.getRoot().on(d.default.hidden,function(){var b=a.querySelector(h.bulkActionSelect);i(b);b.focus()});return b}).catch(e.default.exception)}}else if(""!==c&&g.length){b.target.form().submit()}i(b.target)})},i=function(a){a.value=""};g()}});
define ("report_progress/completion_override",["jquery","core/ajax","core/str","core/modal_factory","core/modal_events","core/notification","core/custom_interaction_events","core/templates"],function(a,b,c,d,e,f,g,h){var i,j,k=function(a,b){return 0<a?"i/completion-"+b+"-y-override":"i/completion-"+b+"-n-override"},l=function(a){h.render("core/loading",{}).then(function(c){j.append(c);return b.call([{methodname:"core_completion_override_activity_completion_status",args:a}])[0]}).then(function(b){var d=0<b.state?1:0,e=d?"completion-y-override":"completion-n-override";c.get_string(e,"completion",i).then(function(a){var b={state:a,date:"",user:j.attr("data-userfullname"),activity:j.attr("data-activityname")};return c.get_string("progress-title","completion",b)}).then(function(a){var b=j.attr("data-completiontracking");return h.renderPix(k(d,b),"core",a)}).then(function(b){var c=0<d?0:1;j.find(".loading-icon").remove();j.data("changecompl",a.userid+"-"+a.cmid+"-"+c);j.attr("data-changecompl",a.userid+"-"+a.cmid+"-"+c);j.children("img").replaceWith(b)}).catch(f.exception)}).catch(f.exception)},m=function(b,g){g.originalEvent.preventDefault();g.originalEvent.stopPropagation();b.preventDefault();b.stopPropagation();j=a(b.currentTarget);var h=j.data("changecompl").split("-"),i={userid:h[0],cmid:h[1],newstate:h[2]},k=1==i.newstate?"completion-y":"completion-n";c.get_strings([{key:k,component:"completion"}]).then(function(a){return c.get_strings([{key:"confirm",component:"moodle"},{key:"areyousureoverridecompletion",component:"completion",param:a[0]}])}).then(function(a){return d.create({type:d.types.SAVE_CANCEL,title:a[0],body:a[1]})}).then(function(a){a.getRoot().on(e.save,function(){l(i)});a.getRoot().on(e.hidden,function(){j.focus();a.destroy()});a.show()}).catch(f.exception)};return{init:function init(b){i=b;a("#completion-progress a.changecompl").each(function(a,b){g.define(b,[g.events.activate])});a("#completion-progress").on(g.events.activate,"a.changecompl",function(a,b){m(a,b)})}}});
define ("gradingform_guide/grades/grader/gradingpanel",["exports","core/ajax","core_grades/grades/grader/gradingpanel/normalise","core_grades/grades/grader/gradingpanel/comparison","jquery"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;e=function(a){return a&&a.__esModule?a:{default:a}}(e);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function g(a){f(i,d,e,g,h,"next",a)}function h(a){f(i,d,e,g,h,"throw",a)}g(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(a,c,d,e){return(0,b.call)([{methodname:"gradingform_guide_grader_gradingpanel_fetch",args:{component:a,contextid:c,itemname:d,gradeduserid:e}}])[0]};var h=function(){var a=g(regeneratorRuntime.mark(function a(f,g,h,i,j,k){var l;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:l=k.querySelector("form");if(!(!0===(0,d.compareData)(l))){a.next=9;break}a.t0=c.normaliseResult;a.next=5;return(0,b.call)([{methodname:"gradingform_guide_grader_gradingpanel_store",args:{component:f,contextid:g,itemname:h,gradeduserid:i,notifyuser:j,formdata:(0,e.default)(l).serialize()}}])[0];case 5:a.t1=a.sent;return a.abrupt("return",(0,a.t0)(a.t1));case 9:return a.abrupt("return","");case 10:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
define ("gradingform_guide/grades/grader/gradingpanel/comments/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={frequentComment:"[data-gradingform_guide-role=\"frequent-comment\"]",criterion:"[data-gradingform-guide-role=\"criterion\"]",remark:"[data-gradingform-guide-role=\"remark\"]"};return a.default});
define ("gradingform_guide/grades/grader/gradingpanel/comments",["exports","./comments/selectors"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);a.init=function init(a){var c=document.querySelector("#".concat(a));c.addEventListener("click",function(a){if(!a.target.matches(b.default.frequentComment)){return}a.preventDefault();var c=a.target.closest(b.default.frequentComment),d=c.closest(b.default.criterion),e=d.querySelector(b.default.remark);if(!e){return}if(e.value.trim()){e.value+="\n".concat(c.innerHTML)}else{e.value+=c.innerHTML}})}});
define ("gradingform_guide/comment_chooser",["jquery","core/templates","core/notification","core/yui"],function(a,b,c){return{initialise:function initialise(d,e,f,g){function h(b,c){var e="<label>"+M.util.get_string("insertcomment","gradingform_guide")+"</label>",g="comment-chooser-"+d+"-cancel",h="<button id=\""+g+"\">"+M.util.get_string("cancel","moodle")+"</button>",i=new M.core.dialogue({modal:!0,headerContent:e,bodyContent:b,footerContent:h,focusAfterHide:"#"+f,id:"comments-chooser-dialog-"+d});a("#"+g).click(function(){i.hide()});a.each(c,function(b,c){var e="#comment-option-"+d+"-"+c.id;a(e).click(function(){var b=a("#"+f),d=b.val();if(""!==d.trim()){d+="\n"}d+=c.description;b.val(d);i.hide()});a(document).off("keypress",e).on("keypress",e,function(){var b=event.which||event.keyCode;if(13==b||32==b){a(e).click()}})});i.after("visibleChange",function(a){if(a.prevVal&&!a.newVal){this.destroy()}},i);i.show()}function i(){b.render("gradingform_guide/comment_chooser",{criterionId:d,comments:g}).done(function(a){h(a,g)}).fail(c.exception)}a("#"+e).click(function(a){a.preventDefault();i()})}}});
define ("gradingform_rubric/grades/grader/gradingpanel",["exports","core/ajax","core_grades/grades/grader/gradingpanel/normalise","core_grades/grades/grader/gradingpanel/comparison","jquery"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.storeCurrentGrade=a.fetchCurrentGrade=void 0;e=function(a){return a&&a.__esModule?a:{default:a}}(e);function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function g(a){f(i,d,e,g,h,"next",a)}function h(a){f(i,d,e,g,h,"throw",a)}g(void 0)})}}a.fetchCurrentGrade=function fetchCurrentGrade(a,c,d,e){return(0,b.call)([{methodname:"gradingform_rubric_grader_gradingpanel_fetch",args:{component:a,contextid:c,itemname:d,gradeduserid:e}}])[0]};var h=function(){var a=g(regeneratorRuntime.mark(function a(f,g,h,i,j,k){var l;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:l=k.querySelector("form");if(!(!0===(0,d.compareData)(l))){a.next=9;break}a.t0=c.normaliseResult;a.next=5;return(0,b.call)([{methodname:"gradingform_rubric_grader_gradingpanel_store",args:{component:f,contextid:g,itemname:h,gradeduserid:i,notifyuser:j,formdata:(0,e.default)(l).serialize()}}])[0];case 5:a.t1=a.sent;return a.abrupt("return",(0,a.t0)(a.t1));case 9:return a.abrupt("return","");case 10:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.storeCurrentGrade=h});
define ("tool_analytics/potential-contexts",["jquery","core/ajax"],function(a,b){return{processResults:function processResults(b,c){var d=[];if(a.isArray(c)){a.each(c,function(a,b){d.push({value:b.id,label:b.name})});return d}else{return c}},transport:function transport(c,d,e,f){var g,h=a(c).attr("modelid")||null;g=b.call([{methodname:"tool_analytics_potential_contexts",args:{query:d,modelid:h}}]);g[0].then(e).fail(f)}}});
define ("tool_analytics/log_info",["jquery","core/str","core/modal_factory","core/notification"],function(a,b,c,d){return{loadInfo:function loadInfo(e,f){var g=a("[data-model-log-id=\""+e+"\"]");b.get_string("loginfo","tool_analytics").then(function(b){var d=a("<ul>");f.forEach(function(a){d.append("<li>"+a+"</li>")});d.append("</ul>");return c.create({title:b,body:d.html(),large:!0},g)}).catch(d.exception)}}});
define ("tool_analytics/model",["jquery","core/str","core/log","core/notification","core/modal_factory","core/modal_events","core/templates"],function(b,c,d,e,f,g,h){var i={clear:{title:{key:"clearpredictions",component:"tool_analytics"},body:{key:"clearmodelpredictions",component:"tool_analytics"}},delete:{title:{key:"delete",component:"tool_analytics"},body:{key:"deletemodelconfirmation",component:"tool_analytics"}}},j=function(a){var c=b(a).closest("[data-model-name]");if(c.length){return c.attr("data-model-name")}else{d.error("Unexpected DOM error - unable to obtain the model name");return""}};return{confirmAction:function confirmAction(a,h){b("[data-action-id=\""+a+"\"]").on("click",function(k){k.preventDefault();var l=b(k.currentTarget);if("undefined"==typeof i[h]){d.error("Action \""+h+"\" is not allowed.");return}var a=[i[h].title,i[h].body];a[1].param=j(l);var m=c.get_strings(a),n=f.create({type:f.types.SAVE_CANCEL});b.when(m,n).then(function(a,b){b.setTitle(a[0]);b.setBody(a[1]);b.setSaveButtonText(a[0]);b.getRoot().on(g.save,function(){window.location.href=l.attr("href")});b.show();return b}).fail(e.exception)})},selectEvaluationOptions:function selectEvaluationOptions(a,d){b("[data-action-id=\""+a+"\"]").on("click",function(i){i.preventDefault();var j=b(i.currentTarget),a=b(this).attr("data-timesplitting-methods"),k=c.get_strings([{key:"evaluatemodel",component:"tool_analytics"},{key:"evaluate",component:"tool_analytics"}]),l=f.create({type:f.types.SAVE_CANCEL}),m=h.render("tool_analytics/evaluation_options",{trainedexternally:d,timesplittingmethods:JSON.parse(a)});b.when(k,l).then(function(a,c){c.getRoot().on(g.hidden,c.destroy.bind(c));c.setTitle(a[0]);c.setSaveButtonText(a[1]);c.setBody(m);c.getRoot().on(g.save,function(){var a=b("input[name='evaluationmode']:checked").val();if("trainedmodel"==a){j.attr("href",j.attr("href")+"&mode=trainedmodel")}var c=b("#id-evaluation-timesplitting").val();j.attr("href",j.attr("href")+"&timesplitting="+c);window.location.href=j.attr("href")});c.show();return c}).fail(e.exception)})},selectExportOptions:function selectExportOptions(a,d){b("[data-action-id=\""+a+"\"]").on("click",function(i){i.preventDefault();var j=b(i.currentTarget);if(!d){j.attr("href",j.attr("href")+"&action=exportmodel&includeweights=0");window.location.href=j.attr("href");return}var a=c.get_strings([{key:"export",component:"tool_analytics"}]),k=f.create({type:f.types.SAVE_CANCEL}),l=h.render("tool_analytics/export_options",{});b.when(a,k).then(function(a,c){c.getRoot().on(g.hidden,c.destroy.bind(c));c.setTitle(a[0]);c.setSaveButtonText(a[0]);c.setBody(l);c.getRoot().on(g.save,function(){var a=b("input[name='exportoption']:checked").val();if("exportdata"==a){j.attr("href",j.attr("href")+"&action=exportdata")}else{j.attr("href",j.attr("href")+"&action=exportmodel");if(b("#id-includeweights").is(":checked")){j.attr("href",j.attr("href")+"&includeweights=1")}else{j.attr("href",j.attr("href")+"&includeweights=0")}}window.location.href=j.attr("href")});c.show();return c}).fail(e.exception)})}}});
define ("tool_dataprivacy/purposesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:"[data-action=\"deletepurpose\"]"},h=function(){this.registerEvents()};h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name");d.get_strings([{key:"deletepurpose",component:"tool_dataprivacy"},{key:"deletepurposetext",component:"tool_dataprivacy",param:i},{key:"delete"}]).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){d.setSaveButtonText(j);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_delete_purpose",args:{id:h}}])[0].done(function(b){if(b.result){a("tr[data-purposeid=\""+h+"\"]").remove()}else{c.addNotification({message:b.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d})}).done(function(a){a.show()}).fail(c.exception)})};return{init:function init(){return new h}}});
define ("tool_dataprivacy/data_request_modal",["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","tool_dataprivacy/events"],function(a,b,c,d,e,f){var g=!1,h={APPROVE_BUTTON:"[data-action=\"approve\"]",DENY_BUTTON:"[data-action=\"deny\"]",COMPLETE_BUTTON:"[data-action=\"complete\"]"},i=function(a){d.call(this,a)};i.TYPE="tool_dataprivacy-data_request";i.prototype=Object.create(d.prototype);i.prototype.constructor=i;i.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this);this.getModal().on(c.events.activate,h.APPROVE_BUTTON,function(b,c){var d=a.Event(f.approve);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,h.DENY_BUTTON,function(b,c){var d=a.Event(f.deny);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,h.COMPLETE_BUTTON,function(b,c){var d=a.Event(f.complete);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this))};if(!g){e.register(i.TYPE,i,"tool_dataprivacy/data_request_modal");g=!0}return i});
define ("tool_dataprivacy/events",[],function(){return{approve:"tool_dataprivacy-data_request:approve",bulkApprove:"tool_dataprivacy-data_request:bulk_approve",deny:"tool_dataprivacy-data_request:deny",bulkDeny:"tool_dataprivacy-data_request:bulk_deny",complete:"tool_dataprivacy-data_request:complete"}});
define ("tool_dataprivacy/form-user-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h=b.call([{methodname:"tool_dataprivacy_get_users",args:{query:e}}]);h[0].then(function(b){var d=[],e=0;a.each(b,function(a,b){d.push(c.render("tool_dataprivacy/form-user-selector-suggestion",b))});return a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[e];e++});f(b)})}).fail(g)}}});
define ("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var h={MARK_FOR_DELETION:"[data-action=\"markfordeletion\"]",SELECT_ALL:"[data-action=\"selectall\"]"},i={SELECTCONTEXT:".selectcontext"},j=function(){this.registerEvents()};j.prototype.registerEvents=function(){a(h.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(i.SELECTCONTEXT).each(function(){var b=a(this);if(b.is(":checked")){c.push(b.val())}});g(c)});a(h.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);if(c.is(":checked")){a(i.SELECTCONTEXT).attr("checked","checked")}else{a(i.SELECTCONTEXT).removeAttr("checked")}})};function g(a){var g="";d.get_strings([{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}]).then(function(a){g=a[0];var b=a[1];return e.create({title:g,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){d.setSaveButtonText(g);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_confirm_contexts_for_deletion",args:{ids:a}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d}).done(function(a){a.show()}).fail(c.exception)}return j});
define ("tool_dataprivacy/request_filter",["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={REQUEST_FILTERS:"#request-filters"},f=function init(){c.get_strings([{key:"filter",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}]).then(function(a){var c=a[0],d=a[1];return b.enhance(e.REQUEST_FILTERS,!1,"",c,!1,!0,d,!0)}).fail(d.exception);var f=a(e.REQUEST_FILTERS).val();a(e.REQUEST_FILTERS).on("change",function(){var b=a(this).val();if(f.join(",")!==b.join(",")){if(0===b.length){a("#filters-cleared").val(1)}a(this.form).submit()}})};return{init:function init(){f()}}});
define ("tool_dataprivacy/categoriesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:"[data-action=\"deletecategory\"]"},h=function(){this.registerEvents()};h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name");d.get_strings([{key:"deletecategory",component:"tool_dataprivacy"},{key:"deletecategorytext",component:"tool_dataprivacy",param:i},{key:"delete"}]).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){d.setSaveButtonText(j);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_delete_category",args:{id:h}}])[0].done(function(b){if(b.result){a("tr[data-categoryid=\""+h+"\"]").remove()}else{c.addNotification({message:b.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d})}).done(function(a){a.show()}).fail(c.exception)})};return{init:function init(){return new h}}});
define ("tool_dataprivacy/myrequestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],function(a,b,c,d,e,f,g,h){var j={CANCEL_REQUEST:"[data-action=\"cancel\"]",CONTACT_DPO:"[data-action=\"contactdpo\"]"},k=function(){this.registerEvents()};k.prototype.registerEvents=function(){a(j.CANCEL_REQUEST).click(function(g){g.preventDefault();var h=a(this).data("requestid");d.get_strings([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var d=a[0],g=a[1];return e.create({title:d,body:g,type:e.types.SAVE_CANCEL}).then(function(a){a.setSaveButtonText(d);a.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:h}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});a.getRoot().on(f.hidden,function(){a.destroy()});return a})}).done(function(a){a.show()}).fail(c.exception)});a(j.CONTACT_DPO).click(function(b){var j=new h("dataprivacy/crud:initModal:contactdpo");b.preventDefault();var k=a(this).data("replytoemail"),l="";d.get_strings([{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}]).then(function(a){var b=a[0];l=a[1];return e.create({title:b,body:g.render("tool_dataprivacy/contact_dpo",{replytoemail:k}),type:e.types.SAVE_CANCEL,large:!0})}).then(function(b){b.setSaveButtonText(l);b.show();b.getRoot().on(f.save,function(b){var c=a("#message").val().trim();if(0===c.length){b.preventDefault();a("[data-region=\"messageinput\"]").addClass("has-danger notifyproblem");a("#id_error_message").removeAttr("hidden")}else{i(c)}});b.getRoot().on(f.hidden,function(){b.destroy()})}).then(j.resolve).catch(c.exception)})};function i(a){var e="success";b.call([{methodname:"tool_dataprivacy_contact_dpo",args:{message:a}}])[0].then(function(a){if(a.result){return d.get_string("requestsubmitted","tool_dataprivacy")}e="error";return a.warnings.join("<br>")}).done(function(a){c.addNotification({message:a,type:e})}).fail(c.exception)}return{init:function init(){return new k}}});
define ("tool_dataprivacy/defaultsactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates"],function(a,b,c,d,f,g,h){var k={EDIT_LEVEL_DEFAULTS:"[data-action=\"edit-level-defaults\"]",NEW_ACTIVITY_DEFAULTS:"[data-action=\"new-activity-defaults\"]",EDIT_ACTIVITY_DEFAULTS:"[data-action=\"edit-activity-defaults\"]",DELETE_ACTIVITY_DEFAULTS:"[data-action=\"delete-activity-defaults\"]"},l=-1,m=function(){this.registerEvents()};m.prototype.registerEvents=function(){a(k.EDIT_LEVEL_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),j=e.data("purpose"),k=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}}]),l=d.get_string("editdefaults","tool_dataprivacy",a("#defaults-header").text());a.when(k[0],k[1],l).then(function(a,b,c){var d=a.options,e=b.options;i(c,g,h,j,null,d,e,null);return!0}).catch(c.exception)});a(k.NEW_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{nodefaults:!0}}]),j=d.get_string("addnewdefaults","tool_dataprivacy");a.when(h[0],h[1],h[2],j).then(function(a,b,c,d){var e=a.options,f=b.options,h=c.options;i(d,g,null,null,null,e,f,h);return!0}).catch(c.exception)});a(k.EDIT_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),j=e.data("purpose"),k=e.data("activityname"),l=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{}}]),m=d.get_string("editmoduledefaults","tool_dataprivacy");a.when(l[0],l[1],l[2],m).then(function(a,b,c,d){var e=a.options,f=b.options,l=c.options;i(d,g,h,j,k,e,f,l);return!0}).catch(c.exception)});a(k.DELETE_ACTIVITY_DEFAULTS).click(function(b){b.preventDefault();var e=a(this),i=e.data("contextlevel"),k=e.data("activityname"),m=e.data("activitydisplayname");f.create({title:d.get_string("deletedefaults","tool_dataprivacy",m),body:h.render("tool_dataprivacy/delete_activity_defaults",{activityname:m}),type:f.types.SAVE_CANCEL,large:!0}).then(function(a){a.setSaveButtonText(d.get_string("delete"));a.getRoot().on(g.save,function(){j(i,l,l,k,!1)});a.getRoot().on(g.hidden,function(){a.destroy()});a.show();return!0}).catch(c.exception)})};function i(b,d,e,i,k,l,m,n){if(null!==e){l.forEach(function(a){if(a.id===e){a.selected=!0}})}if(null!==i){m.forEach(function(a){if(a.id===i){a.selected=!0}})}var o={contextlevel:d,categoryoptions:l,purposeoptions:m};if(null!==n&&n.length){if(null===k){o.newactivitydefaults=!0}else{n.forEach(function(a){if(k===a.name){a.selected=!0}})}o.modemodule=!0;o.activityoptions=n}f.create({title:b,body:h.render("tool_dataprivacy/category_purpose_form",o),type:f.types.SAVE_CANCEL,large:!0}).then(function(b){b.getRoot().on(g.save,function(){var b=a("#activity"),c="undefined"!=typeof b?b.val():null,d=a("#override"),e="undefined"!=typeof d?d.is(":checked"):!1;j(a("#contextlevel").val(),a("#category").val(),a("#purpose").val(),c,e)});b.getRoot().on(g.hidden,function(){b.destroy()});b.show();return b}).catch(c.exception)}function j(a,c,d,e,f){b.call([{methodname:"tool_dataprivacy_set_context_defaults",args:{contextlevel:a,category:c,purpose:d,override:f,activity:e}}])[0].done(function(a){if(a.result){window.location.reload()}})}return{init:function init(){return new m}}});
define ("tool_dataprivacy/effective_retention_period",["jquery"],function(a){var b={PURPOSE_SELECT:"#id_purposeid",RETENTION_FIELD:"#fitem_id_retention_current [data-fieldtype=static]"},c=function(a){this.purposeRetentionPeriods=a;this.registerEventListeners()},d=function(){a(b.PURPOSE_SELECT).off("change")};c.prototype.purposeRetentionPeriods=[];c.prototype.registerEventListeners=function(){a(b.PURPOSE_SELECT).on("change",function(c){var d=a(c.currentTarget).val(),e=this.purposeRetentionPeriods[d];a(b.RETENTION_FIELD).text(e)}.bind(this))};return{init:function init(a){d();return new c(a)}}});
define ("tool_dataprivacy/add_category",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={CATEGORY_LINK:"[data-add-element=\"category\"]"},i=function(a){this.contextId=a;this.strings=b.get_strings([{key:"addcategory",component:"tool_dataprivacy"},{key:"save",component:"admin"}]);this.registerEventListeners()};i.prototype.contextId=0;i.prototype.strings=0;i.prototype.registerEventListeners=function(){var b=a(h.CATEGORY_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))};i.prototype.getBody=function(a){var b=null;if("undefined"!=typeof a){b={jsonformdata:JSON.stringify(a)}}return g.loadFragment("tool_dataprivacy","addcategory_form",this.contextId,b)};i.prototype.setupFormModal=function(a,b){a.setLarge();a.setSaveButtonText(b);a.getRoot().on(f.hidden,this.destroy.bind(this));a.setBody(this.getBody());a.getRoot().on(f.save,this.submitForm.bind(this));a.getRoot().on("submit","form",this.submitFormAjax.bind(this));this.modal=a;a.show()};i.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_category_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){if(a.validationerrors){this.modal.setBody(this.getBody(b))}else{this.close()}}.bind(this),fail:d.exception}])};i.prototype.close=function(){this.destroy();document.location.reload()};i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});this.modal.destroy()};i.prototype.removeListeners=function(){a(h.CATEGORY_LINK).off("click")};return{getInstance:function getInstance(a){return new i(a)}}});
define ("tool_dataprivacy/add_purpose",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={PURPOSE_LINK:"[data-add-element=\"purpose\"]"},i=function(a){this.contextId=a;this.strings=b.get_strings([{key:"addpurpose",component:"tool_dataprivacy"},{key:"save",component:"admin"}]);this.registerEventListeners()};i.prototype.contextId=0;i.prototype.strings=0;i.prototype.registerEventListeners=function(){var b=a(h.PURPOSE_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))};i.prototype.getBody=function(a){var b=null;if("undefined"!=typeof a){b={jsonformdata:JSON.stringify(a)}}return g.loadFragment("tool_dataprivacy","addpurpose_form",this.contextId,b)};i.prototype.setupFormModal=function(a,b){a.setLarge();a.setSaveButtonText(b);a.getRoot().on(f.hidden,this.destroy.bind(this));a.setBody(this.getBody());a.getRoot().on(f.save,this.submitForm.bind(this));a.getRoot().on("submit","form",this.submitFormAjax.bind(this));this.modal=a;a.show()};i.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_purpose_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){if(a.validationerrors){this.modal.setBody(this.getBody(b))}else{this.close()}}.bind(this),fail:d.exception}])};i.prototype.close=function(){this.destroy();document.location.reload()};i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});this.modal.destroy()};i.prototype.removeListeners=function(){a(h.PURPOSE_LINK).off("click")};return{getInstance:function getInstance(a){return new i(a)}}});
define ("tool_dataprivacy/data_registry",["jquery","core/str","core/ajax","core/notification","core/templates","core/modal_factory","core/modal_events","core/fragment","tool_dataprivacy/add_purpose","tool_dataprivacy/add_category"],function(a,b,c,d,e,f,g,h,i,j){var k={TREE_NODES:"[data-context-tree-node=1]",FORM_CONTAINER:"#context-form-container"},l=function(a,b,c){this.systemContextId=a;this.currentContextLevel=b;this.currentContextId=c;this.init()};l.prototype.systemContextId=0;l.prototype.currentContextLevel=0;l.prototype.currentContextId=0;l.prototype.addpurpose=null;l.prototype.addcategory=null;l.prototype.init=function(){this.addpurpose=i.getInstance(this.systemContextId);this.addcategory=j.getInstance(this.systemContextId);this.strings=b.get_strings([{key:"changessaved",component:"moodle"},{key:"contextpurposecategorysaved",component:"tool_dataprivacy"},{key:"noblockstoload",component:"tool_dataprivacy"},{key:"noactivitiestoload",component:"tool_dataprivacy"},{key:"nocoursestoload",component:"tool_dataprivacy"}]);this.registerEventListeners();if(this.currentContextId){this.loadForm("context_form",[this.currentContextId],this.submitContextFormAjax.bind(this))}else{this.loadForm("contextlevel_form",[this.currentContextLevel],this.submitContextLevelFormAjax.bind(this))}};l.prototype.registerEventListeners=function(){a(k.TREE_NODES).on("click",function(b){b.preventDefault();var c=a(b.currentTarget);a(k.TREE_NODES).removeClass("active");c.addClass("active");var d=c.data("contextlevel"),e=c.data("contextid");if(d){window.history.pushState({},null,"?contextlevel="+d);this.addpurpose.removeListeners();this.addcategory.removeListeners();this.currentContextLevel=d;this.loadForm("contextlevel_form",[this.currentContextLevel],this.submitContextLevelFormAjax.bind(this))}else if(e){window.history.pushState({},null,"?contextid="+e);this.addpurpose.removeListeners();this.addcategory.removeListeners();this.currentContextId=e;this.loadForm("context_form",[this.currentContextId],this.submitContextFormAjax.bind(this))}else{var f=c.data("expandcontextid"),g=c.data("expandelement"),h=c.data("expanded");if(g){if(!h){if(c.data("loaded")||!f||!g){this.expand(c)}else{c.find("> i").removeClass("fa-plus");c.find("> i").addClass("fa-circle-o-notch fa-spin");this.loadExtra(c,f,g)}}else{this.collapse(c)}}}}.bind(this))};l.prototype.removeListeners=function(){a(k.TREE_NODES).off("click")};l.prototype.loadForm=function(b,c,f){this.clearForm();var g=h.loadFragment("tool_dataprivacy",b,this.systemContextId,c);g.done(function(b,c){a(k.FORM_CONTAINER).html(b);e.runTemplateJS(c);this.addpurpose.registerEventListeners();this.addcategory.registerEventListeners();a(k.FORM_CONTAINER).on("submit","form",f)}.bind(this)).fail(d.exception)};l.prototype.clearForm=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});a(k.FORM_CONTAINER).off("submit","form")};l.prototype.submitForm=function(b){b.preventDefault();a(k.FORM_CONTAINER).find("form").submit()};l.prototype.submitContextLevelFormAjax=function(a){this.submitFormAjax(a,"tool_dataprivacy_set_contextlevel_form")};l.prototype.submitContextFormAjax=function(a){this.submitFormAjax(a,"tool_dataprivacy_set_context_form")};l.prototype.submitFormAjax=function(b,e){b.preventDefault();var f=a(k.FORM_CONTAINER).find("form").serialize();return this.strings.then(function(a){c.call([{methodname:e,args:{jsonformdata:JSON.stringify(f)},done:function done(){d.alert(a[0],a[1])},fail:d.exception}])}).catch(d.exception)};l.prototype.loadExtra=function(a,b,f){c.call([{methodname:"tool_dataprivacy_tree_extra_branches",args:{contextid:b,element:f},done:function(b){if(0==b.branches.length){this.noElements(a,f);return}e.render("tool_dataprivacy/context_tree_branches",b).then(function(b){a.after(b);this.removeListeners();this.registerEventListeners();this.expand(a);a.data("loaded",1)}.bind(this)).fail(d.exception)}.bind(this),fail:d.exception}])};l.prototype.noElements=function(a,b){a.data("expandcontextid","");a.data("expandelement","");this.strings.then(function(c){var d=2;if("module"==b){d=3}else if("course"==b){d=4}a.text(c[d])}).fail(d.exception)};l.prototype.collapse=function(a){a.data("expanded",0);a.siblings("nav").addClass("hidden");a.find("> i").removeClass("fa-minus");a.find("> i").addClass("fa-plus")};l.prototype.expand=function(a){a.data("expanded",1);a.siblings("nav").removeClass("hidden");a.find("> i").removeClass("fa-plus");a.find("> i").removeClass("fa-circle-o-notch fa-spin");a.find("> i").addClass("fa-minus")};return{init:function init(a,b,c){return new l(a,b,c)}}});
define ("tool_dataprivacy/requestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","tool_dataprivacy/data_request_modal","tool_dataprivacy/events"],function(a,b,c,d,e,f,g,h,i){var q={APPROVE_REQUEST:"[data-action=\"approve\"]",DENY_REQUEST:"[data-action=\"deny\"]",VIEW_REQUEST:"[data-action=\"view\"]",MARK_COMPLETE:"[data-action=\"complete\"]",CHANGE_BULK_ACTION:"[id=\"bulk-action\"]",CONFIRM_BULK_ACTION:"[id=\"confirm-bulk-action\"]",SELECT_ALL:"[data-action=\"selectall\"]"},r={APPROVE:1,DENY:2},s={SELECT_REQUEST:".selectrequests"},t=function(){this.registerEvents()};t.prototype.registerEvents=function(){a(q.VIEW_REQUEST).click(function(d){d.preventDefault();var k=a(this).data("requestid"),m=b.call([{methodname:"tool_dataprivacy_get_data_request",args:{requestid:k}}]);a.when(m[0]).then(function(a){if(a.result){return a.result}c.addNotification({message:a.warnings[0].message,type:"error"});return!1}).then(function(a){var b=g.render("tool_dataprivacy/request_details",a),c={approvedeny:a.approvedeny,canmarkcomplete:a.canmarkcomplete};return e.create({title:a.typename,body:b,type:h.TYPE,large:!0,templateContext:c})}).then(function(a){a.getRoot().on(i.approve,function(){o(i.approve,j(k))});a.getRoot().on(i.deny,function(){o(i.deny,l(k))});a.getRoot().on(i.complete,function(){p("tool_dataprivacy_mark_complete",{requestid:k})});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(q.APPROVE_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.approve,j(c))});a(q.DENY_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.deny,l(c))});a(q.MARK_COMPLETE).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.complete,n(c))});a(q.CONFIRM_BULK_ACTION).click(function(){var b=[],e="",f={},g=[{key:"selectbulkaction",component:"tool_dataprivacy"},{key:"selectdatarequests",component:"tool_dataprivacy"},{key:"ok"}],h=parseInt(a("#bulk-action").val());if(h!=r.APPROVE&&h!=r.DENY){d.get_strings(g).done(function(a){c.alert("",a[0],a[2])}).fail(c.exception);return}a(".selectrequests:checked").each(function(){b.push(a(this).val())});if(1>b.length){d.get_strings(g).done(function(a){c.alert("",a[1],a[2])}).fail(c.exception);return}switch(h){case r.APPROVE:e=i.bulkApprove;f=k(b);break;case r.DENY:e=i.bulkDeny;f=m(b);}o(e,f)});a(q.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this).is(":checked");a(s.SELECT_REQUEST).prop("checked",c)})};function j(a){return{wsfunction:"tool_dataprivacy_approve_data_request",wsparams:{requestid:a}}}function k(a){return{wsfunction:"tool_dataprivacy_bulk_approve_data_requests",wsparams:{requestids:a}}}function l(a){return{wsfunction:"tool_dataprivacy_deny_data_request",wsparams:{requestid:a}}}function m(a){return{wsfunction:"tool_dataprivacy_bulk_deny_data_requests",wsparams:{requestids:a}}}function n(a){return{wsfunction:"tool_dataprivacy_mark_complete",wsparams:{requestid:a}}}function o(a,b){var g=[];switch(a){case i.approve:g=[{key:"approverequest",component:"tool_dataprivacy"},{key:"confirmapproval",component:"tool_dataprivacy"}];break;case i.bulkApprove:g=[{key:"bulkapproverequests",component:"tool_dataprivacy"},{key:"confirmbulkapproval",component:"tool_dataprivacy"}];break;case i.deny:g=[{key:"denyrequest",component:"tool_dataprivacy"},{key:"confirmdenial",component:"tool_dataprivacy"}];break;case i.bulkDeny:g=[{key:"bulkdenyrequests",component:"tool_dataprivacy"},{key:"confirmbulkdenial",component:"tool_dataprivacy"}];break;case i.complete:g=[{key:"markcomplete",component:"tool_dataprivacy"},{key:"confirmcompletion",component:"tool_dataprivacy"}];break;}var h="";d.get_strings(g).then(function(a){h=a[0];var b=a[1];return e.create({title:h,body:b,type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(h);a.getRoot().on(f.save,function(){p(b.wsfunction,b.wsparams)});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)}function p(a,d){b.call([{methodname:a,args:d}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)}return t});
define ("tool_dataprivacy/expand_contract",["jquery","core/url","core/str"],function(a,b,c){var d=a("<img alt=\"\" src=\""+b.imageUrl("t/expanded")+"\"/>"),e=a("<img alt=\"\" src=\""+b.imageUrl("t/collapsed")+"\"/>"),f={EXPAND:"fa-caret-right",COLLAPSE:"fa-caret-down"};return{expandCollapse:function expandCollapse(a,b){if(a.hasClass("hide")){a.removeClass("hide");a.addClass("visible");a.attr("aria-expanded",!0);b.find(":header i.fa").removeClass(f.EXPAND);b.find(":header i.fa").addClass(f.COLLAPSE);b.find(":header img.icon").attr("src",d.attr("src"))}else{a.removeClass("visible");a.addClass("hide");a.attr("aria-expanded",!1);b.find(":header i.fa").removeClass(f.COLLAPSE);b.find(":header i.fa").addClass(f.EXPAND);b.find(":header img.icon").attr("src",e.attr("src"))}},expandCollapseAll:function expandCollapseAll(b){var g="visible"==b?"hide":"visible",h="visible"==b?!0:!1,i="visible"==b?f.EXPAND:f.COLLAPSE,j="visible"==b?f.COLLAPSE:f.EXPAND,k="visible"==b?d.attr("src"):e.attr("src");a("."+g).each(function(){a(this).removeClass(g);a(this).addClass(b);a(this).attr("aria-expanded",h)});a(".tool_dataprivacy-expand-all").data("visibilityState",g);c.get_string(g,"tool_dataprivacy").then(function(b){a(".tool_dataprivacy-expand-all").html(b)}).catch(Notification.exception);a(":header i.fa").each(function(){a(this).removeClass(i);a(this).addClass(j)});a(":header img.icon").each(function(){a(this).attr("src",k)})}}});
define ("tool_licensemanager/delete_license",["jquery","core/modal_factory","core/modal_events","core/url","core/str"],function(a,b,c,d,e){var f=a(".delete-license");b.create({type:b.types.SAVE_CANCEL,title:e.get_string("deletelicense","tool_licensemanager"),body:e.get_string("deletelicenseconfirmmessage","tool_licensemanager"),preShowCallback:function preShowCallback(b,c){b=a(b);var e={action:"delete",license:b.data("license")};c.deleteURL=d.relativeUrl("/admin/tool/licensemanager/index.php",e,!0)},large:!0},f).done(function(a){a.getRoot().on(c.save,function(b){b.preventDefault();window.location.href=a.deleteURL})})});
define ("tool_lp/user_evidence_actions",["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/menubar","tool_lp/competencypicker_user_plans"],function(a,b,c,d,e,f,g){var h=function(a){this._type=a;if("evidence"===a){this._region="[data-region=\"user-evidence-page\"]";this._evidenceNode="[data-region=\"user-evidence-page\"]";this._template="tool_lp/user_evidence_page";this._contextMethod="tool_lp_data_for_user_evidence_page"}else if("list"===a){this._region="[data-region=\"user-evidence-list\"]";this._evidenceNode="[data-region=\"user-evidence-node\"]";this._template="tool_lp/user_evidence_list_page";this._contextMethod="tool_lp_data_for_user_evidence_list_page"}else{throw new TypeError("Unexpected type.")}};h.prototype._contextMethod=null;h.prototype._evidenceNode=null;h.prototype._region=null;h.prototype._template=null;h.prototype._type=null;h.prototype._getContextArgs=function(a){var b=this,c={};if("evidence"===b._type){c={id:a.id}}else if("list"===b._type){c={userid:a.userid}}return c};h.prototype._renderView=function(c){var d=this;return b.render(d._template,c).then(function(c,e){b.replaceNode(a(d._region),c,e)})};h.prototype._callAndRefresh=function(b,e){var f=this;b.push({methodname:f._contextMethod,args:f._getContextArgs(e)});return a.when.apply(a.when,c.call(b)).then(function(){return f._renderView(arguments[arguments.length-1])}).fail(d.exception)};h.prototype._doDelete=function(a){var b=this,c=[{methodname:"core_competency_delete_user_evidence",args:{id:a.id}}];b._callAndRefresh(c,a)};h.prototype.deleteEvidence=function(a){var b=this,f;f=c.call([{methodname:"core_competency_read_user_evidence",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"deleteuserevidence",component:"tool_lp",param:c.name},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doDelete(a)})}).fail(d.exception)}).fail(d.exception)};h.prototype._deleteEvidenceHandler=function(b){b.preventDefault();var c=this._findEvidenceData(a(b.target));this.deleteEvidence(c)};h.prototype._doCreateUserEvidenceCompetency=function(b,c){var d=this,e=[];a.each(c,function(a,c){e.push({methodname:"core_competency_create_user_evidence_competency",args:{userevidenceid:b.id,competencyid:c}})});d._callAndRefresh(e,b)};h.prototype.createUserEvidenceCompetency=function(a){var b=this,c=new g(a.userid);c.on("save",function(c,d){var e=d.competencyIds;b._doCreateUserEvidenceCompetency(a,e,d.requestReview)});c.display()};h.prototype._createUserEvidenceCompetencyHandler=function(b){b.preventDefault();var c=this._findEvidenceData(a(b.target));this.createUserEvidenceCompetency(c)};h.prototype._doDeleteUserEvidenceCompetency=function(a,b){var c=this,d=[];d.push({methodname:"core_competency_delete_user_evidence_competency",args:{userevidenceid:a.id,competencyid:b}});c._callAndRefresh(d,a)};h.prototype.deleteUserEvidenceCompetency=function(a,b){this._doDeleteUserEvidenceCompetency(a,b)};h.prototype._deleteUserEvidenceCompetencyHandler=function(b){var c=this._findEvidenceData(a(b.currentTarget)),d=a(b.currentTarget).data("id");b.preventDefault();this.deleteUserEvidenceCompetency(c,d)};h.prototype._doReviewUserEvidenceCompetencies=function(a){var b=this,c=[{methodname:"core_competency_request_review_of_user_evidence_linked_competencies",args:{id:a.id}}];b._callAndRefresh(c,a)};h.prototype.reviewUserEvidenceCompetencies=function(a){var b=this,f;f=c.call([{methodname:"core_competency_read_user_evidence",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"sendallcompetenciestoreview",component:"tool_lp",param:c.name},{key:"confirm",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doReviewUserEvidenceCompetencies(a)})}).fail(d.exception)}).fail(d.exception)};h.prototype._reviewUserEvidenceCompetenciesHandler=function(b){b.preventDefault();var c=this._findEvidenceData(a(b.target));this.reviewUserEvidenceCompetencies(c)};h.prototype._findEvidenceData=function(b){var c=b.parentsUntil(a(this._region).parent(),this._evidenceNode),d;if(1!=c.length){throw new Error("The evidence node was not located.")}d=c.data();if("undefined"==typeof d||"undefined"==typeof d.id){throw new Error("Evidence data could not be found.")}return d};h.prototype.enhanceMenubar=function(a){var b=this;f.enhance(a,{'[data-action="user-evidence-delete"]':b._deleteEvidenceHandler.bind(b),'[data-action="link-competency"]':b._createUserEvidenceCompetencyHandler.bind(b),'[data-action="send-competencies-review"]':b._reviewUserEvidenceCompetenciesHandler.bind(b)})};h.prototype.registerEvents=function(){var b=a(this._region),c=this;b.find("[data-action=\"user-evidence-delete\"]").click(c._deleteEvidenceHandler.bind(c));b.find("[data-action=\"link-competency\"]").click(c._createUserEvidenceCompetencyHandler.bind(c));b.find("[data-action=\"delete-competency-link\"]").click(c._deleteUserEvidenceCompetencyHandler.bind(c));b.find("[data-action=\"send-competencies-review\"]").click(c._reviewUserEvidenceCompetenciesHandler.bind(c))};return h});
define ("tool_lp/user_competency_plan_popup",["jquery","core/notification","core/str","core/ajax","core/templates","tool_lp/dialogue"],function(a,b,c,d,e,f){var g=function(b,c,d){this._regionSelector=b;this._userCompetencySelector=c;this._planId=d;a(this._regionSelector).on("click",this._userCompetencySelector,this._handleClick.bind(this))};g.prototype._handleClick=function(c){c.preventDefault();var e=a(c.target).closest("tr"),f=a(e).data("competencyid"),g=a(e).data("userid"),h=this._planId,i=d.call([{methodname:"tool_lp_data_for_user_competency_summary_in_plan",args:{competencyid:f,planid:h},done:this._contextLoaded.bind(this),fail:b.exception}]);i[0].then(function(a){var b="core_competency_user_competency_viewed_in_plan";if(a.plan.iscompleted){b="core_competency_user_competency_plan_viewed"}return d.call([{methodname:b,args:{competencyid:f,userid:g,planid:h}}])[0]}).catch(b.exception)};g.prototype._contextLoaded=function(a){var d=this;e.render("tool_lp/user_competency_summary_in_plan",a).done(function(a,g){c.get_string("usercompetencysummary","report_competency").done(function(b){new f(b,a,e.runTemplateJS.bind(e,g),d._refresh.bind(d),!0)}).fail(b.exception)}).fail(b.exception)};g.prototype._refresh=function(){var a=this._planId;d.call([{methodname:"tool_lp_data_for_plan_page",args:{planid:a},done:this._pageContextLoaded.bind(this),fail:b.exception}])};g.prototype._pageContextLoaded=function(a){var c=this;e.render("tool_lp/plan_page",a).done(function(a,b){e.replaceNode(c._regionSelector,a,b)}).fail(b.exception)};g.prototype._regionSelector=null;g.prototype._userCompetencySelector=null;g.prototype._planId=null;return g});
define ("tool_lp/dialogue",["core/yui"],function(a){var b=function(b,c,d,e,f){M.util.js_pending("tool_lp/dialogue:dialogue");this.yuiDialogue=null;var g=this;if("undefined"==typeof f){f=!1}a.use("moodle-core-notification","timers",function(){var h="480px";if(f){h="800px"}g.yuiDialogue=new M.core.dialogue({headerContent:b,bodyContent:c,draggable:!0,visible:!1,center:!0,modal:!0,width:h});g.yuiDialogue.before("visibleChange",function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")});g.yuiDialogue.after("visibleChange",function(b){if(b.newVal){if("undefined"!=typeof d){a.soon(function(){d(g);g.yuiDialogue.centerDialogue();M.util.js_complete("tool_lp/dialogue:before:visibleChange")})}else{M.util.js_complete("tool_lp/dialogue:before:visibleChange")}}else{if("undefined"!=typeof e){a.soon(function(){e(g);M.util.js_complete("tool_lp/dialogue:before:visibleChange")})}else{M.util.js_complete("tool_lp/dialogue:before:visibleChange")}}});g.yuiDialogue.show();M.util.js_complete("tool_lp/dialogue:dialogue")})};b.prototype.close=function(){this.yuiDialogue.hide();this.yuiDialogue.destroy()};b.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()};return b});
define ("tool_lp/user_competency_workflow",["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/menubar","tool_lp/event_base"],function(a,b,c,d,e,f,g){var h=function(){g.prototype.constructor.apply(this,[])};h.prototype=Object.create(g.prototype);h.prototype._nodeSelector="[data-node=\"user-competency\"]";h.prototype._cancelReviewRequest=function(a){var b={methodname:"core_competency_user_competency_cancel_review_request",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-request-cancelled",a);this._trigger("status-changed",a)}.bind(this)).catch(function(){this._trigger("error-occured",a)}.bind(this))};h.prototype.cancelReviewRequest=function(a){this._cancelReviewRequest(a)};h.prototype._cancelReviewRequestHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.cancelReviewRequest(c)};h.prototype._requestReview=function(a){var b={methodname:"core_competency_user_competency_request_review",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-requested",a);this._trigger("status-changed",a)}.bind(this)).catch(function(){this._trigger("error-occured",a)}.bind(this))};h.prototype.requestReview=function(a){this._requestReview(a)};h.prototype._requestReviewHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.requestReview(c)};h.prototype._startReview=function(a){var b={methodname:"core_competency_user_competency_start_review",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-started",a);this._trigger("status-changed",a)}.bind(this)).catch(function(){this._trigger("error-occured",a)}.bind(this))};h.prototype.startReview=function(a){this._startReview(a)};h.prototype._startReviewHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.startReview(c)};h.prototype._stopReview=function(a){var b={methodname:"core_competency_user_competency_stop_review",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-stopped",a);this._trigger("status-changed",a)}.bind(this)).catch(function(){this._trigger("error-occured",a)}.bind(this))};h.prototype.stopReview=function(a){this._stopReview(a)};h.prototype._stopReviewHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.stopReview(c)};h.prototype.enhanceMenubar=function(a){f.enhance(a,{'[data-action="request-review"]':this._requestReviewHandler.bind(this),'[data-action="cancel-review-request"]':this._cancelReviewRequestHandler.bind(this)})};h.prototype._findUserCompetencyData=function(a){var b=a.parents(this._nodeSelector),c;if(1!=b.length){throw new Error("The evidence node was not located.")}c=b.data();if("undefined"==typeof c||"undefined"==typeof c.userid||"undefined"==typeof c.competencyid){throw new Error("User competency data could not be found.")}return c};h.prototype.enhanceMenubar=function(a){f.enhance(a,{'[data-action="request-review"]':this._requestReviewHandler.bind(this),'[data-action="cancel-review-request"]':this._cancelReviewRequestHandler.bind(this),'[data-action="start-review"]':this._startReviewHandler.bind(this),'[data-action="stop-review"]':this._stopReviewHandler.bind(this)})};h.prototype.registerEvents=function(b){var c=a(b);c.find("[data-action=\"request-review\"]").click(this._requestReviewHandler.bind(this));c.find("[data-action=\"cancel-review-request\"]").click(this._cancelReviewRequestHandler.bind(this));c.find("[data-action=\"start-review\"]").click(this._startReviewHandler.bind(this));c.find("[data-action=\"stop-review\"]").click(this._stopReviewHandler.bind(this))};return h});
define ("tool_lp/menubar",["jquery"],function(a){var b=!1,c=!1,d=function(){a(".tool-lp-menu .tool-lp-sub-menu").attr("aria-hidden","true");c=!1},e=function(a,b){this.menuRoot=a;this.handlers=b;this.rootMenus=this.menuRoot.children("li");this.subMenus=this.rootMenus.children("ul");this.subMenuItems=this.subMenus.children("li");this.allItems=this.rootMenus.add(this.subMenuItems);this.activeItem=null;this.isChildOpen=!1;this.keys={tab:9,enter:13,esc:27,space:32,left:37,up:38,right:39,down:40};this.addAriaAttributes();this.addEventListeners()};e.prototype.openSubMenu=function(a){this.setOpenDirection();d();a.attr("aria-hidden","false");c=!0};e.prototype.addEventListeners=function(){var f=this;if(!1===b){a(document).click(function(){if(c){d()}});b=!0}this.subMenuItems.mouseenter(function(){a(this).addClass("menu-hover");return!0});this.subMenuItems.mouseout(function(){a(this).removeClass("menu-hover");return!0});this.allItems.click(function(b){return f.handleClick(a(this),b)});this.allItems.keydown(function(b){return f.handleKeyDown(a(this),b)});this.allItems.focus(function(){return f.handleFocus(a(this))});this.allItems.blur(function(){return f.handleBlur(a(this))})};e.prototype.handleClick=function(b,c){c.stopPropagation();var d=b.parent();if(d.is(".tool-lp-menu")){if("true"==b.children("ul").first().attr("aria-hidden")){this.openSubMenu(b.children("ul").first())}else{b.children("ul").first().attr("aria-hidden","true")}}else{this.allItems.removeClass("menu-hover menu-focus");this.activeItem=null;this.menuRoot.find("ul").not(".root-level").attr("aria-hidden","true");var e=b.find("a").first(),f=new a.Event("click");f.target=e;var g=!1;if(this.handlers){a.each(this.handlers,function(c,d){if(g){return}if(0<b.find(c).length){var h=a.proxy(d,e);g=!1===h(f)||f.isDefaultPrevented()}})}if(!g&&"#"!==e.attr("href")){window.location.href=e.attr("href")}}return!1};e.prototype.handleFocus=function(a){if(null===this.activeItem){this.activeItem=a}else if(a[0]!=this.activeItem[0]){return!0}var b=this.activeItem.parentsUntil("ul.tool-lp-menu").filter("li");this.allItems.removeClass("menu-focus");this.activeItem.addClass("menu-focus");b.addClass("menu-focus");if(!0===this.isChildOpen){var c=a.parent();if(c.is(".tool-lp-menu")&&"true"==a.attr("aria-haspopup")){this.openSubMenu(a.children("ul").first())}}return!0};e.prototype.handleBlur=function(a){a.removeClass("menu-focus");return!0};e.prototype.setOpenDirection=function(){var b=this.menuRoot.offset(),c=a(document.body).hasClass("dir-rtl"),d=this.rootMenus.outerHeight(),e=this.rootMenus.outerWidth(),f=this.rootMenus.find("ul.tool-lp-sub-menu");f.css("margin-right","");f.css("margin-left","");f.css("margin-top","");f.attr("aria-hidden",!1);var g=f.outerWidth(),h=f.outerHeight(),i=null,j=null,k=null,l=b.top-a(window).scrollTop();if(l+h>a(window).height()){i=h+d;f.css("margin-top","-"+i+"px")}if(c){if(0>b.left-g){j=g-e;f.css("margin-right","-"+j+"px")}}else{if(b.left+g>a(window).width()){k=g-e;f.css("margin-left","-"+k+"px")}}if(!0){this.menuRoot.addClass("tool-lp-menu-open-left")}else{this.menuRoot.removeClass("tool-lp-menu-open-left")}};e.prototype.handleKeyDown=function(a,b){if(b.altKey||b.ctrlKey){return!0}switch(b.keyCode){case this.keys.tab:{this.menuRoot.find("ul").attr("aria-hidden","true");this.allItems.removeClass("menu-focus");this.activeItem=null;this.isChildOpen=!1;break}case this.keys.esc:{var c=a.parent();if(c.is(".tool-lp-menu")){a.children("ul").first().attr("aria-hidden","true")}else{this.activeItem=c.parent();this.isChildOpen=!1;this.activeItem.focus();c.attr("aria-hidden","true")}b.stopPropagation();return!1}case this.keys.enter:case this.keys.space:{return this.handleClick(a,b)}case this.keys.left:{this.activeItem=this.moveToPrevious(a);this.activeItem.focus();b.stopPropagation();return!1}case this.keys.right:{this.activeItem=this.moveToNext(a);this.activeItem.focus();b.stopPropagation();return!1}case this.keys.up:{this.activeItem=this.moveUp(a);this.activeItem.focus();b.stopPropagation();return!1}case this.keys.down:{this.activeItem=this.moveDown(a);this.activeItem.focus();b.stopPropagation();return!1}}return!0};e.prototype.moveToNext=function(a){var b=a.parent(),c=b.children("li"),d=c.length,e=c.index(a),f=null,g=null;if(b.is(".tool-lp-menu")){if(e<d-1){f=a.next()}else{f=c.first()}if("true"==a.attr("aria-haspopup")){g=a.children("ul").first();if("false"==g.attr("aria-hidden")){g.attr("aria-hidden","true");this.isChildOpen=!0}}a.removeClass("menu-focus");if("true"===f.attr("aria-haspopup")&&!0===this.isChildOpen){g=f.children("ul").first();this.openSubMenu(g)}}else{if("true"==a.attr("aria-haspopup")){g=a.children("ul").first();f=g.children("li").first();this.openSubMenu(g)}else{var h=null,i=null;h=a.parentsUntil("ul.tool-lp-menu").filter("ul").not(".tool-lp-menu");h.attr("aria-hidden","true");h.find("li").removeClass("menu-focus");h.last().parent().removeClass("menu-focus");i=h.last().parent();e=this.rootMenus.index(i);if(e<this.rootMenus.length-1){f=i.next()}else{f=this.rootMenus.first()}f.addClass("menu-focus");if("true"==f.attr("aria-haspopup")){g=f.children("ul").first();f=g.children("li").first();this.openSubMenu(g);this.isChildOpen=!0}}}return f};e.prototype.moveToPrevious=function(a){var b=a.parent(),c=b.children("li"),d=c.index(a),e=null,f=null;if(b.is(".tool-lp-menu")){if(0<d){e=a.prev()}else{e=c.last()}if("true"==a.attr("aria-haspopup")){f=a.children("ul").first();if("false"==f.attr("aria-hidden")){f.attr("aria-hidden","true");this.isChildOpen=!0}}a.removeClass("menu-focus");if("true"===e.attr("aria-haspopup")&&!0===this.isChildOpen){f=e.children("ul").first();this.openSubMenu(f)}}else{var g=b.parent(),h=g.parent();if(!h.is(".tool-lp-menu")){e=b.parent();b.attr("aria-hidden","true");a.removeClass("menu-focus")}else{b.attr("aria-hidden","true");a.removeClass("menu-focus");g.removeClass("menu-focus");d=this.rootMenus.index(g);if(0<d){e=g.prev()}else{e=this.rootMenus.last()}e.addClass("menu-focus");if("true"==e.attr("aria-haspopup")){f=e.children("ul").first();this.openSubMenu(f);this.isChildOpen=!0;e=f.children("li").first()}}}return e};e.prototype.moveDown=function(a,b){var c=a.parent(),d=c.children("li").not(".separator"),e=d.length,f=d.index(a),g=null,h=null;if(c.is(".tool-lp-menu")){if("true"!=a.attr("aria-haspopup")){return a}h=a.children("ul").first();g=h.children("li").first();this.openSubMenu(h);return g}if(b){var i=!1,j=f+1;if(j==e){j=0}while(j!=f){var k=d.eq(j).html().charAt(0);if(k.toLowerCase()==b){i=!0;break}j=j+1;if(j==e){j=0}}if(!0==i){g=d.eq(j);a.removeClass("menu-focus");return g}else{return a}}else{if(f<e-1){g=d.eq(f+1)}else{g=d.first()}}a.removeClass("menu-focus");return g};e.prototype.moveUp=function(a){var b=a.parent(),c=b.children("li").not(".separator"),d=c.index(a),e=null;if(b.is(".tool-lp-menu")){return a}if(0<d){e=c.eq(d-1)}else{e=c.last()}a.removeClass("menu-focus");return e};e.prototype.addAriaAttributes=function(){this.menuRoot.attr("role","menubar");this.rootMenus.attr("role","menuitem");this.rootMenus.attr("tabindex","0");this.rootMenus.attr("aria-haspopup","true");this.subMenus.attr("role","menu");this.subMenus.attr("aria-hidden","true");this.subMenuItems.attr("role","menuitem");this.subMenuItems.attr("tabindex","-1");this.menuRoot.addClass("tool-lp-menu");this.allItems.addClass("tool-lp-menu-item");this.rootMenus.addClass("tool-lp-root-menu");this.subMenus.addClass("tool-lp-sub-menu");this.subMenuItems.addClass("dropdown-item")};return{enhance:function enhance(b,c){a(b).each(function(b,d){var f=a(d);if(!0!==f.data("menubarEnhanced")){new e(f,c);f.data("menubarEnhanced",!0)}})},closeAll:d}});
define ("tool_lp/competencies",["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/competencypicker","tool_lp/dragdrop-reorder","core/pending"],function(a,b,c,d,e,f,g,h){var i=function(b,c,d){this.itemid=b;this.itemtype=c;this.pageContextId=d;this.pickerInstance=null;a("[data-region=\"actions\"] button").prop("disabled",!1);this.registerEvents();this.registerDragDrop()};i.prototype.registerDragDrop=function(){var a=this;e.get_string("movecompetency","tool_lp").done(function(b){g.dragdrop("movecompetency",b,{identifier:"movecompetency",component:"tool_lp"},{identifier:"movecompetencyafter",component:"tool_lp"},"drag-samenode","drag-parentnode","drag-handlecontainer",function(b,c){a.handleDrop(b,c)})}).fail(b.exception)};i.prototype.handleDrop=function(d,e){var f=a(d).data("id"),g=a(e).data("id"),h=this,i=[];if("course"==h.itemtype){i=c.call([{methodname:"core_competency_reorder_course_competency",args:{courseid:h.itemid,competencyidfrom:f,competencyidto:g}}])}else if("template"==h.itemtype){i=c.call([{methodname:"core_competency_reorder_template_competency",args:{templateid:h.itemid,competencyidfrom:f,competencyidto:g}}])}else if("plan"==h.itemtype){i=c.call([{methodname:"core_competency_reorder_plan_competency",args:{planid:h.itemid,competencyidfrom:f,competencyidto:g}}])}else{return}i[0].fail(b.exception)};i.prototype.pickCompetency=function(){var g=this,i,j,k,l;if(!g.pickerInstance){if("template"===g.itemtype||"course"===g.itemtype){l="parents"}g.pickerInstance=new f(g.pageContextId,!1,l);g.pickerInstance.on("save",function(f,e){var l=e.competencyIds,m=new h;if("course"===g.itemtype){i=[];a.each(l,function(a,b){i.push({methodname:"core_competency_add_competency_to_course",args:{courseid:g.itemid,competencyid:b}})});i.push({methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:g.itemid,moduleid:0}});j="tool_lp/course_competencies_page";k="coursecompetenciespage"}else if("template"===g.itemtype){i=[];a.each(l,function(a,b){i.push({methodname:"core_competency_add_competency_to_template",args:{templateid:g.itemid,competencyid:b}})});i.push({methodname:"tool_lp_data_for_template_competencies_page",args:{templateid:g.itemid,pagecontext:{contextid:g.pageContextId}}});j="tool_lp/template_competencies_page";k="templatecompetenciespage"}else if("plan"===g.itemtype){i=[];a.each(l,function(a,b){i.push({methodname:"core_competency_add_competency_to_plan",args:{planid:g.itemid,competencyid:b}})});i.push({methodname:"tool_lp_data_for_plan_page",args:{planid:g.itemid}});j="tool_lp/plan_page";k="plan-page"}c.call(i)[i.length-1].then(function(a){return d.render(j,a)}).then(function(b,c){d.replaceNode(a("[data-region=\""+k+"\"]"),b,c)}).then(m.resolve).catch(b.exception)})}return g.pickerInstance.display()};i.prototype.doDelete=function(e){var f=this,g=[],h="",i="";if("course"==f.itemtype){g=c.call([{methodname:"core_competency_remove_competency_from_course",args:{courseid:f.itemid,competencyid:e}},{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:f.itemid,moduleid:0}}]);h="tool_lp/course_competencies_page";i="coursecompetenciespage"}else if("template"==f.itemtype){g=c.call([{methodname:"core_competency_remove_competency_from_template",args:{templateid:f.itemid,competencyid:e}},{methodname:"tool_lp_data_for_template_competencies_page",args:{templateid:f.itemid,pagecontext:{contextid:f.pageContextId}}}]);h="tool_lp/template_competencies_page";i="templatecompetenciespage"}else if("plan"==f.itemtype){g=c.call([{methodname:"core_competency_remove_competency_from_plan",args:{planid:f.itemid,competencyid:e}},{methodname:"tool_lp_data_for_plan_page",args:{planid:f.itemid}}]);h="tool_lp/plan_page";i="plan-page"}g[1].done(function(c){d.render(h,c).done(function(b,c){a("[data-region=\""+i+"\"]").replaceWith(b);d.runTemplateJS(c)}).fail(b.exception)}).fail(b.exception)};i.prototype.deleteHandler=function(a){var d=this,f=[],g;if("course"==d.itemtype){g="unlinkcompetencycourse"}else if("template"==d.itemtype){g="unlinkcompetencytemplate"}else if("plan"==d.itemtype){g="unlinkcompetencyplan"}else{return}f=c.call([{methodname:"core_competency_read_competency",args:{id:a}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:g,component:"tool_lp",param:c.shortname},{key:"confirm",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){d.doDelete(a)})}).fail(b.exception)}).fail(b.exception)};i.prototype.registerEvents=function(){var f=this;if("course"==f.itemtype){a("[data-region=\"coursecompetenciespage\"]").on("change","select[data-field=\"ruleoutcome\"]",function(g){var e=new h,i=[],j=a(g.target).data("id"),k=a(g.target).val();i=c.call([{methodname:"core_competency_set_course_competency_ruleoutcome",args:{coursecompetencyid:j,ruleoutcome:k}},{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:f.itemid,moduleid:0}}]);i[1].then(function(a){return d.render("tool_lp/course_competencies_page",a)}).then(function(b,c){return d.replaceNode(a("[data-region=\""+"coursecompetenciespage"+"\"]"),b,c)}).then(e.resolve).catch(b.exception)})}a("[data-region=\"actions\"] button").click(function(a){var b=new h;a.preventDefault();f.pickCompetency().then(b.resolve).catch()});a("[data-action=\"delete-competency-link\"]").click(function(b){b.preventDefault();var c=a(b.target).closest("[data-id]").data("id");f.deleteHandler(c)})};return i});
define ("tool_lp/actionselector",["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){var g=this;f.prototype.constructor.apply(this,[]);g._title=a;g._message=b;g._actions=c;g._confirm=d;g._cancel=e;g._selectedValue=null;g._reset()};g.prototype=Object.create(f.prototype);g.prototype._selectedValue=null;g.prototype._popup=null;g.prototype._title=null;g.prototype._message=null;g.prototype._actions=null;g.prototype._confirm=null;g.prototype._cancel=null;g.prototype._afterRender=function(){var b=this;b._find("[data-action=\"action-selector-confirm\"]").attr("disabled","disabled");b._find("[data-region=\"action-selector-radio-buttons\"]").change(function(){b._selectedValue=a("input[type='radio']:checked").val();b._find("[data-action=\"action-selector-confirm\"]").removeAttr("disabled");b._refresh.bind(b)});b._find("[data-action=\"action-selector-cancel\"]").click(function(a){a.preventDefault();b.close()});b._find("[data-action=\"action-selector-confirm\"]").click(function(a){a.preventDefault();if(!b._selectedValue.length){return}b._trigger("save",{action:b._selectedValue});b.close()})};g.prototype.close=function(){var a=this;a._popup.close();a._reset()};g.prototype.display=function(){var a=this;return a._render().then(function(b){a._popup=new e(a._title,b,a._afterRender.bind(a))}).fail(b.exception)};g.prototype._find=function(b){return a(this._popup.getContent()).find(b)};g.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find("[data-region=\"action-selector\"]").replaceWith(b);a._afterRender()})};g.prototype._render=function(){var a=this,b=[];for(var c in a._actions){b.push(a._actions[c])}var e={message:a._message,choices:b,confirm:a._confirm,cancel:a._cancel};return d.render("tool_lp/action_selector",e)};g.prototype._reset=function(){this._popup=null;this._selectedValue=""};return g});
define ("tool_lp/module_navigation",["jquery"],function(a){var b=function(b,c,d,e){this._baseUrl=c;this._moduleId=e;this._courseId=d;a(b).on("change",this._moduleChanged.bind(this))};b.prototype._moduleChanged=function(b){var c=a(b.target).val(),d="?mod="+c+"&courseid="+this._courseId;document.location=this._baseUrl+d};b.prototype._courseId=null;b.prototype._moduleId=null;b.prototype._baseUrl=null;return b});
define ("tool_lp/scalevalues",["jquery","core/ajax"],function(a,b){var c=[];return{get_values:function get_values(d){var e=a.Deferred();if("undefined"==typeof c[d]){b.call([{methodname:"core_competency_get_scale_values",args:{scaleid:d},done:function done(a){c[d]=a;e.resolve(a)},fail:e.reject}])}else{e.resolve(c[d])}return e.promise()}}});
define ("tool_lp/form-cohort-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h,i=parseInt(a(d).data("contextid"),10),j=a(d).data("includes");h=b.call([{methodname:"tool_lp_search_cohorts",args:{query:e,context:{contextid:i},includes:j}}]);h[0].then(function(b){var d=[],e=0;a.each(b.cohorts,function(a,b){d.push(c.render("tool_lp/form-cohort-selector-suggestion",b))});return a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b.cohorts,function(a,b){b._label=c[e];e++});f(b.cohorts)})}).catch(g)}}});
define ("tool_lp/frameworkactions",["jquery","core/templates","core/ajax","core/notification","core/str"],function(a,b,c,d,e){var f=0,g=0,h=function(c,d){a("[data-region=\"managecompetencies\"]").replaceWith(c);b.runTemplateJS(d)},i=function(a){b.render("tool_lp/manage_competency_frameworks_page",a).done(h).fail(d.exception)},j=function(b){b.preventDefault();g=a(this).attr("data-frameworkid");var e=c.call([{methodname:"core_competency_duplicate_competency_framework",args:{id:g}},{methodname:"tool_lp_data_for_competency_frameworks_manage_page",args:{pagecontext:{contextid:f}}}]);e[1].done(i).fail(d.exception)},k=function(){var a=c.call([{methodname:"core_competency_delete_competency_framework",args:{id:g}},{methodname:"tool_lp_data_for_competency_frameworks_manage_page",args:{pagecontext:{contextid:f}}}]);a[0].done(function(a){if(!1===a){var b=c.call([{methodname:"core_competency_read_competency_framework",args:{id:g}}]);b[0].done(function(a){e.get_strings([{key:"frameworkcannotbedeleted",component:"tool_lp",param:a.shortname},{key:"cancel",component:"moodle"}]).done(function(a){d.alert(null,a[0])}).fail(d.exception)})}}).fail(d.exception);a[1].done(i).fail(d.exception)},l=function(b){b.preventDefault();var f=a(this).attr("data-frameworkid");g=f;var h=c.call([{methodname:"core_competency_read_competency_framework",args:{id:g}}]);h[0].done(function(a){e.get_strings([{key:"confirm",component:"moodle"},{key:"deletecompetencyframework",component:"tool_lp",param:a.shortname},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],k)}).fail(d.exception)}).fail(d.exception)};return{deleteHandler:l,duplicateHandler:j,init:function init(a){f=a}}});
define ("tool_lp/form-user-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h,i=a(d).data("capability");if("undefined"==typeof i){i=""}h=b.call([{methodname:"tool_lp_search_users",args:{query:e,capability:i}}]);h[0].then(function(b){var d=[],e=0;a.each(b.users,function(b,e){var f=e,g=[];a.each(["idnumber","email","phone1","phone2","department","institution"],function(a,b){if("undefined"!=typeof e[b]&&""!==e[b]){f.hasidentity=!0;g.push(e[b])}});f.identity=g.join(", ");d.push(c.render("tool_lp/form-user-selector-suggestion",f))});return a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b.users,function(a,b){b._label=c[e];e++});f(b.users)})}).catch(g)}}});
define ("tool_lp/planactions",["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/menubar","tool_lp/dialogue"],function(a,b,c,d,e,f,g){var h=function(a){this._type=a;if("plan"===a){this._region="[data-region=\"plan-page\"]";this._planNode="[data-region=\"plan-page\"]";this._template="tool_lp/plan_page";this._contextMethod="tool_lp_data_for_plan_page"}else if("plans"===a){this._region="[data-region=\"plans\"]";this._planNode="[data-region=\"plan-node\"]";this._template="tool_lp/plans_page";this._contextMethod="tool_lp_data_for_plans_page"}else{throw new TypeError("Unexpected type.")}};h.prototype._contextMethod=null;h.prototype._planNode=null;h.prototype._region=null;h.prototype._template=null;h.prototype._type=null;h.prototype._getContextArgs=function(a){var b=this,c={};if("plan"===b._type){c={planid:a.id}}else if("plans"===b._type){c={userid:a.userid}}return c};h.prototype.refresh=function(b){var c=this._findPlanData(a(b));this._callAndRefresh([],c)};h.prototype._renderView=function(c){var d=this;return b.render(d._template,c).then(function(c,e){a(d._region).replaceWith(c);b.runTemplateJS(e)})};h.prototype._callAndRefresh=function(b,e){var f="tool_lp/planactions:_callAndRefresh-"+Math.floor(Math.random()*Math.floor(1e3));M.util.js_pending(f);var g=this;b.push({methodname:g._contextMethod,args:g._getContextArgs(e)});return a.when.apply(a,c.call(b)).then(function(){return g._renderView(arguments[arguments.length-1])}).fail(d.exception).always(function(){return M.util.js_complete(f)})};h.prototype._doDelete=function(a){var b=this,c=[{methodname:"core_competency_delete_plan",args:{id:a.id}}];b._callAndRefresh(c,a)};h.prototype.deletePlan=function(a){var b=this,f;f=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"deleteplan",component:"tool_lp",param:c.name},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doDelete(a)})}).fail(d.exception)}).fail(d.exception)};h.prototype._doReopenPlan=function(a){var b=this,c=[{methodname:"core_competency_reopen_plan",args:{planid:a.id}}];b._callAndRefresh(c,a)};h.prototype.reopenPlan=function(a){var b=this,f=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"reopenplanconfirm",component:"tool_lp",param:c.name},{key:"reopenplan",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doReopenPlan(a)})}).fail(d.exception)}).fail(d.exception)};h.prototype._doCompletePlan=function(a){var b=this,c=[{methodname:"core_competency_complete_plan",args:{planid:a.id}}];b._callAndRefresh(c,a)};h.prototype.completePlan=function(a){var b=this,f=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"completeplanconfirm",component:"tool_lp",param:c.name},{key:"completeplan",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doCompletePlan(a)})}).fail(d.exception)}).fail(d.exception)};h.prototype._doUnlinkPlan=function(a){var b=this,c=[{methodname:"core_competency_unlink_plan_from_template",args:{planid:a.id}}];b._callAndRefresh(c,a)};h.prototype.unlinkPlan=function(a){var b=this,f=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"unlinkplantemplateconfirm",component:"tool_lp",param:c.name},{key:"unlinkplantemplate",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doUnlinkPlan(a)})}).fail(d.exception)}).fail(d.exception)};h.prototype._doRequestReview=function(a){var b=[{methodname:"core_competency_plan_request_review",args:{id:a.id}}];this._callAndRefresh(b,a)};h.prototype.requestReview=function(a){this._doRequestReview(a)};h.prototype._doCancelReviewRequest=function(a){var b=[{methodname:"core_competency_plan_cancel_review_request",args:{id:a.id}}];this._callAndRefresh(b,a)};h.prototype.cancelReviewRequest=function(a){this._doCancelReviewRequest(a)};h.prototype._doStartReview=function(a){var b=[{methodname:"core_competency_plan_start_review",args:{id:a.id}}];this._callAndRefresh(b,a)};h.prototype.startReview=function(a){this._doStartReview(a)};h.prototype._doStopReview=function(a){var b=[{methodname:"core_competency_plan_stop_review",args:{id:a.id}}];this._callAndRefresh(b,a)};h.prototype.stopReview=function(a){this._doStopReview(a)};h.prototype._doApprove=function(a){var b=[{methodname:"core_competency_approve_plan",args:{id:a.id}}];this._callAndRefresh(b,a)};h.prototype.approve=function(a){this._doApprove(a)};h.prototype._doUnapprove=function(a){var b=[{methodname:"core_competency_unapprove_plan",args:{id:a.id}}];this._callAndRefresh(b,a)};h.prototype.unapprove=function(a){this._doUnapprove(a)};h.prototype._showLinkedCoursesHandler=function(f){f.preventDefault();var h=a(f.target).data("id"),i=c.call([{methodname:"tool_lp_list_courses_using_competency",args:{id:h}}]);i[0].done(function(a){b.render("tool_lp/linked_courses_summary",{courses:a}).done(function(a){e.get_string("linkedcourses","tool_lp").done(function(b){new g(b,a)}).fail(d.exception)}).fail(d.exception)}).fail(d.exception)};h.prototype._eventHandler=function(b,c){c.preventDefault();var d=this._findPlanData(a(c.target));this[b](d)};h.prototype._findPlanData=function(b){var c=b.parentsUntil(a(this._region).parent(),this._planNode),d;if(1!=c.length){throw new Error("The plan node was not located.")}d=c.data();if("undefined"==typeof d||"undefined"==typeof d.id){throw new Error("Plan data could not be found.")}return d};h.prototype.enhanceMenubar=function(a){f.enhance(a,{'[data-action="plan-delete"]':this._eventHandler.bind(this,"deletePlan"),'[data-action="plan-complete"]':this._eventHandler.bind(this,"completePlan"),'[data-action="plan-reopen"]':this._eventHandler.bind(this,"reopenPlan"),'[data-action="plan-unlink"]':this._eventHandler.bind(this,"unlinkPlan"),'[data-action="plan-request-review"]':this._eventHandler.bind(this,"requestReview"),'[data-action="plan-cancel-review-request"]':this._eventHandler.bind(this,"cancelReviewRequest"),'[data-action="plan-start-review"]':this._eventHandler.bind(this,"startReview"),'[data-action="plan-stop-review"]':this._eventHandler.bind(this,"stopReview"),'[data-action="plan-approve"]':this._eventHandler.bind(this,"approve"),'[data-action="plan-unapprove"]':this._eventHandler.bind(this,"unapprove")})};h.prototype.registerEvents=function(){var b=a(this._region);b.find("[data-action=\"plan-delete\"]").click(this._eventHandler.bind(this,"deletePlan"));b.find("[data-action=\"plan-complete\"]").click(this._eventHandler.bind(this,"completePlan"));b.find("[data-action=\"plan-reopen\"]").click(this._eventHandler.bind(this,"reopenPlan"));b.find("[data-action=\"plan-unlink\"]").click(this._eventHandler.bind(this,"unlinkPlan"));b.find("[data-action=\"plan-request-review\"]").click(this._eventHandler.bind(this,"requestReview"));b.find("[data-action=\"plan-cancel-review-request\"]").click(this._eventHandler.bind(this,"cancelReviewRequest"));b.find("[data-action=\"plan-start-review\"]").click(this._eventHandler.bind(this,"startReview"));b.find("[data-action=\"plan-stop-review\"]").click(this._eventHandler.bind(this,"stopReview"));b.find("[data-action=\"plan-approve\"]").click(this._eventHandler.bind(this,"approve"));b.find("[data-action=\"plan-unapprove\"]").click(this._eventHandler.bind(this,"unapprove"));b.find("[data-action=\"find-courses-link\"]").click(this._showLinkedCoursesHandler.bind(this))};return h});
define ("tool_lp/frameworks_datasource",["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function list(c,d){var e={context:{contextid:c}};a.extend(e,"undefined"==typeof d?{}:d);return b.call([{methodname:"core_competency_list_competency_frameworks",args:e}])[0]},processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b.shortname+" "+b.idnumber})});return d},transport:function transport(b,d,e){var f=a(b),g=f.data("contextid"),h=f.data("onlyvisible");if(!g){throw new Error("The attribute data-contextid is required on "+b)}this.list(g,{query:d,onlyvisible:h}).then(e).catch(c.exception)}}});
define ("tool_lp/competency_plan_navigation",["jquery"],function(a){var b=function(b,c,d,e,f){this._baseUrl=c;this._userId=d+"";this._competencyId=e+"";this._planId=f;this._ignoreFirstCompetency=!0;a(b).on("change",this._competencyChanged.bind(this))};b.prototype._competencyChanged=function(b){if(this._ignoreFirstCompetency){this._ignoreFirstCompetency=!1;return}var c=a(b.target).val(),d="?userid="+this._userId+"&planid="+this._planId+"&competencyid="+c;document.location=this._baseUrl+d};b.prototype._competencyId=null;b.prototype._userId=null;b.prototype._planId=null;b.prototype._baseUrl=null;b.prototype._ignoreFirstCompetency=null;return b});
define ("tool_lp/course_competency_settings",["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates","core/pending"],function(a,b,c,d,f,g,h){var i=function(b){a(b).on("click",this.configureSettings.bind(this))};i.prototype._dialogue=null;i.prototype.configureSettings=function(f){var e=new h,i=a(f.target).closest("a").data("courseid"),j=a(f.target).closest("a").data("pushratingstouserplans");f.preventDefault();a.when(d.get_string("configurecoursecompetencysettings","tool_lp"),g.render("tool_lp/course_competency_settings",{courseid:i,settings:{pushratingstouserplans:j}})).then(function(a,b){this._dialogue=new c(a,b[0],this.addListeners.bind(this));return this._dialogue}.bind(this)).then(e.resolve).catch(b.exception)};i.prototype.addListeners=function(){var a=this._find("[data-action=\"save\"]");a.on("click",this.saveSettings.bind(this));var b=this._find("[data-action=\"cancel\"]");b.on("click",this.cancelChanges.bind(this))};i.prototype.cancelChanges=function(a){a.preventDefault();this._dialogue.close()};i.prototype._find=function(b){return a("[data-region=\"coursecompetencysettings\"]").find(b)};i.prototype.saveSettings=function(a){var c=new h;a.preventDefault();var d=this._find("input[name=\"pushratingstouserplans\"]:checked").val(),e=this._find("input[name=\"courseid\"]").val();f.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:e,settings:{pushratingstouserplans:d}}}])[0].then(function(){return this.refreshCourseCompetenciesPage()}.bind(this)).then(c.resolve).catch(b.exception)};i.prototype.refreshCourseCompetenciesPage=function(){var c=this._find("input[name=\"courseid\"]").val(),d=new h;f.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:c,moduleid:0}}])[0].then(function(a){return g.render("tool_lp/course_competencies_page",a)}).then(function(b,c){g.replaceNode(a("[data-region=\"coursecompetenciespage\"]"),b,c);this._dialogue.close()}.bind(this)).then(d.resolve).catch(b.exception)};return i});
define ("tool_lp/parentcompetency_form",["jquery","core/ajax","core/str","tool_lp/competencypicker","core/templates","core/notification"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){this.buttonSelector=a;this.inputHiddenSelector=b;this.staticElementSelector=c;this.frameworkId=d;this.pageContextId=e;this.registerEvents()};g.prototype.buttonSelector=null;g.prototype.inputHiddenSelector=null;g.prototype.staticElementSelector=null;g.prototype.frameworkId=null;g.prototype.pageContextId=null;g.prototype.setParent=function(d){var e=this;if(0!==d.competencyId){b.call([{methodname:"core_competency_read_competency",args:{id:d.competencyId}}])[0].done(function(b){a(e.staticElementSelector).html(b.shortname);a(e.inputHiddenSelector).val(b.id)}).fail(f.exception)}else{c.get_string("competencyframeworkroot","tool_lp").then(function(b){a(e.staticElementSelector).html(b);a(e.inputHiddenSelector).val(d.competencyId)}).fail(f.exception)}};g.prototype.registerEvents=function(){var b=this;a(b.buttonSelector).on("click",function(a){a.preventDefault();var c=new d(b.pageContextId,b.frameworkId,"self",!1);c._render=function(){var a=this;return a._preRender().then(function(){var b={competencies:a._competencies,framework:a._getFramework(a._frameworkId),frameworks:a._frameworks,search:a._searchText,singleFramework:a._singleFramework};return e.render("tool_lp/competency_picker_competencyform",b)})};c.on("save",function(a,c){b.setParent(c)});c.display()})};return{init:function init(a,b,c,d,e){new g(a,b,c,d,e)}}});
define ("tool_lp/competency_rule_all",["jquery","core/str","tool_lp/competency_rule"],function(a,b,c){var d=function(){c.apply(this,arguments)};d.prototype=Object.create(c.prototype);d.prototype.getType=function(){return"core_competency\\competency_rule_all"};d.prototype.isValid=function(){return!0};return d});
define ("tool_lp/scaleconfig",["jquery","core/notification","core/templates","core/ajax","tool_lp/dialogue","tool_lp/scalevalues"],function(a,b,c,d,e,f){var g=function(b,c,d){this.selectSelector=b;this.inputSelector=c;this.triggerSelector=d;this.originalscaleid=a(b).val();a(b).on("change",this.scaleChangeHandler.bind(this)).change();a(d).click(this.showConfig.bind(this))};g.prototype.selectSelector=null;g.prototype.inputSelector=null;g.prototype.triggerSelector=null;g.prototype.scalevalues=null;g.prototype.originalscaleid=0;g.prototype.scaleid=0;g.prototype.popup=null;g.prototype.showConfig=function(){var d=this;this.scaleid=a(this.selectSelector).val();if(0>=this.scaleid){return}var f=a(this.selectSelector).find("option:selected").text();this.getScaleValues(this.scaleid).done(function(){var a={scalename:f,scales:d.scalevalues};c.render("tool_lp/scale_configuration_page",a).done(function(a){new e(f,a,d.initScaleConfig.bind(d))}).fail(b.exception)}).fail(b.exception)};g.prototype.retrieveOriginalScaleConfig=function(){var b=a(this.inputSelector).val();if(""!==b){var c=a.parseJSON(b),d=c.shift();if(d.scaleid===this.originalscaleid){return c}}return""};g.prototype.initScaleConfig=function(b){this.popup=b;var c=a(b.getContent());if(this.originalscaleid===this.scaleid){var d=this.retrieveOriginalScaleConfig();if(""!==d){d.forEach(function(a){if(1===a.scaledefault){c.find("[data-field=\"tool_lp_scale_default_"+a.id+"\"]").attr("checked",!0)}if(1===a.proficient){c.find("[data-field=\"tool_lp_scale_proficient_"+a.id+"\"]").attr("checked",!0)}})}}c.on("click","[data-action=\"close\"]",function(){this.setScaleConfig();b.close()}.bind(this));c.on("click","[data-action=\"cancel\"]",function(){b.close()})};g.prototype.setScaleConfig=function(){var b=a(this.popup.getContent()),c=[{scaleid:this.scaleid}];this.scalevalues.forEach(function(a){var d=0,e=0;if(b.find("[data-field=\"tool_lp_scale_default_"+a.id+"\"]").is(":checked")){d=1}if(b.find("[data-field=\"tool_lp_scale_proficient_"+a.id+"\"]").is(":checked")){e=1}if(!d&&!e){return}c.push({id:a.id,scaledefault:d,proficient:e})});var d=JSON.stringify(c);a(this.inputSelector).val(d);this.originalscaleid=this.scaleid};g.prototype.getScaleValues=function(a){return f.get_values(a).then(function(a){this.scalevalues=a;return a}.bind(this))};g.prototype.scaleChangeHandler=function(b){if(0>=a(b.target).val()){a(this.triggerSelector).prop("disabled",!0)}else{a(this.triggerSelector).prop("disabled",!1)}};return{init:function init(a,b,c){return new g(a,b,c)}}});
define ("tool_lp/competencypicker",["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","core/str","tool_lp/tree","core/pending"],function(a,b,c,d,e,f,g,h){var i=function(b,c,d,e){var f=this;f._eventNode=a("<div></div>");f._frameworks=[];f._reset();f._pageContextId=b;f._pageContextIncludes=d||"children";f._multiSelect="undefined"==typeof e||!0===e;if(c){f._frameworkId=c;f._singleFramework=!0}};i.prototype._competencies=null;i.prototype._disallowedCompetencyIDs=null;i.prototype._eventNode=null;i.prototype._frameworks=null;i.prototype._frameworkId=null;i.prototype._pageContextId=null;i.prototype._pageContextIncludes=null;i.prototype._popup=null;i.prototype._searchText="";i.prototype._selectedCompetencies=null;i.prototype._singleFramework=!1;i.prototype._multiSelect=!0;i.prototype._onlyVisible=!0;i.prototype._afterRender=function(){var c=this,d=new g(c._find("[data-enhance=linktree]"),c._multiSelect);c._find("[data-enhance=linktree]").show();d.on("selectionchanged",function(b,d){var e=d.selected;b.preventDefault();var f=[];a.each(e,function(b,d){var e=a(d).data("id"),g=!0;if("undefined"==typeof e){g=!1}else{a.each(c._disallowedCompetencyIDs,function(a,b){if(b==e){g=!1}})}if(g){f.push(e)}});c._selectedCompetencies=f;if(!c._selectedCompetencies.length){c._find("[data-region=\"competencylinktree\"] [data-action=\"add\"]").attr("disabled","disabled")}else{c._find("[data-region=\"competencylinktree\"] [data-action=\"add\"]").removeAttr("disabled")}});if(!c._singleFramework){c._find("[data-action=\"chooseframework\"]").change(function(d){c._frameworkId=a(d.target).val();c._loadCompetencies().then(c._refresh.bind(c)).catch(b.exception)})}c._find("[data-region=\"filtercompetencies\"] button").click(function(b){b.preventDefault();a(b.target).attr("disabled","disabled");c._searchText=c._find("[data-region=\"filtercompetencies\"] input").val()||"";return c._refresh().always(function(){a(b.target).removeAttr("disabled")})});c._find("[data-region=\"competencylinktree\"] [data-action=\"cancel\"]").click(function(a){a.preventDefault();c.close()});c._find("[data-region=\"competencylinktree\"] [data-action=\"add\"]").click(function(a){a.preventDefault();var b=new h;if(!c._selectedCompetencies.length){return}if(c._multiSelect){c._trigger("save",{competencyIds:c._selectedCompetencies})}else{c._trigger("save",{competencyId:c._selectedCompetencies[0]})}c.close();b.resolve()});var e=c._selectedCompetencies.slice(0);a.each(e,function(a,b){var e=c._find("[data-id="+b+"]");if(e.length){d.toggleItem(e);d.updateFocus(e)}})};i.prototype.close=function(){var a=this;a._popup.close();a._reset()};i.prototype.display=function(){var c=this;return a.when(f.get_string("competencypicker","tool_lp"),c._render()).then(function(a,b){c._popup=new e(a,b[0],c._afterRender.bind(c))}).catch(b.exception)};i.prototype._fetchCompetencies=function(a,d){var e=this;return c.call([{methodname:"core_competency_search_competencies",args:{searchtext:d,competencyframeworkid:a}}])[0].done(function(a){function b(a,c){for(var d=0;d<c.length;d++){if(c[d].parentid==a.id){a.haschildren=!0;c[d].children=[];c[d].haschildren=!1;a.children[a.children.length]=c[d];b(c[d],c)}}}var c,d,f=[];for(c=0;c<a.length;c++){d=a[c];if("0"==d.parentid){d.children=[];d.haschildren=0;f[f.length]=d;b(d,a)}}e._competencies=f}).fail(b.exception)};i.prototype._find=function(b){return a(this._popup.getContent()).find(b)};i.prototype._getFramework=function(b){var c;a.each(this._frameworks,function(a,d){if(d.id==b){c=d}});return c};i.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._frameworkId,this._searchText)};i.prototype._loadFrameworks=function(){var d,e=this;if(0<e._frameworks.length){return a.when()}if(e._singleFramework){d=c.call([{methodname:"core_competency_read_competency_framework",args:{id:this._frameworkId}}])[0].then(function(a){return[a]})}else{d=c.call([{methodname:"core_competency_list_competency_frameworks",args:{sort:"shortname",context:{contextid:e._pageContextId},includes:e._pageContextIncludes,onlyvisible:e._onlyVisible}}])[0]}return d.done(function(a){e._frameworks=a}).fail(b.exception)};i.prototype.on=function(a,b){this._eventNode.on(a,b)};i.prototype._preRender=function(){var b=this;return b._loadFrameworks().then(function(){if(!b._frameworkId&&0<b._frameworks.length){b._frameworkId=b._frameworks[0].id}if(!b._frameworkId){b._frameworks=[];return a.when()}return b._loadCompetencies()})};i.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find("[data-region=\"competencylinktree\"]").replaceWith(b);a._afterRender()})};i.prototype._render=function(){var b=this;return b._preRender().then(function(){if(!b._singleFramework){a.each(b._frameworks,function(a,c){if(c.id==b._frameworkId){c.selected=!0}else{c.selected=!1}})}var c={competencies:b._competencies,framework:b._getFramework(b._frameworkId),frameworks:b._frameworks,search:b._searchText,singleFramework:b._singleFramework};return d.render("tool_lp/competency_picker",c)})};i.prototype._reset=function(){this._competencies=[];this._disallowedCompetencyIDs=[];this._popup=null;this._searchText="";this._selectedCompetencies=[]};i.prototype.setDisallowedCompetencyIDs=function(a){this._disallowedCompetencyIDs=a};i.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])};return i});
define ("tool_lp/tree",["jquery","core/url","core/log"],function(a,b,c){var d=a("<img alt=\"\" src=\""+b.imageUrl("t/expanded")+"\"/>"),e=a("<img alt=\"\" src=\""+b.imageUrl("t/collapsed")+"\"/>"),f=function(b,c){this.treeRoot=a(b);this.multiSelect="undefined"==typeof c||!0===c;this.items=this.treeRoot.find("li");this.expandAll=20>this.items.length;this.parents=this.treeRoot.find("li:has(ul)");if(c){this.treeRoot.attr("aria-multiselectable","true")}this.items.attr("aria-selected","false");this.visibleItems=null;this.activeItem=null;this.lastActiveItem=null;this.keys={tab:9,enter:13,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,eight:56,asterisk:106};this.init();this.bindEventHandlers()};f.prototype.init=function(){this.parents.attr("aria-expanded","true");this.parents.prepend(d.clone());this.items.attr("role","tree-item");this.items.attr("tabindex","-1");this.parents.attr("role","group");this.treeRoot.attr("role","tree");this.visibleItems=this.treeRoot.find("li");var b=this;if(!this.expandAll){this.parents.each(function(){b.collapseGroup(a(this))});this.expandGroup(this.parents.first())}};f.prototype.expandGroup=function(a){var b=a.children("ul");b.show().attr("aria-hidden","false");a.attr("aria-expanded","true");a.children("img").attr("src",d.attr("src"));this.visibleItems=this.treeRoot.find("li:visible")};f.prototype.collapseGroup=function(a){var b=a.children("ul");b.hide().attr("aria-hidden","true");a.attr("aria-expanded","false");a.children("img").attr("src",e.attr("src"));this.visibleItems=this.treeRoot.find("li:visible")};f.prototype.toggleGroup=function(a){if("true"==a.attr("aria-expanded")){this.collapseGroup(a)}else{this.expandGroup(a)}};f.prototype.triggerChange=function(){var a=this.items.filter("[aria-selected=true]");if(!this.multiSelect){a=a.first()}this.treeRoot.trigger("selectionchanged",{selected:a})};f.prototype.multiSelectItem=function(b){if(!this.multiSelect){this.items.attr("aria-selected","false")}else if(null!==this.lastActiveItem){var c=this.visibleItems.index(this.lastActiveItem),d=this.visibleItems.index(this.activeItem),e=null;while(c<d){e=a(this.visibleItems.get(c));e.attr("aria-selected","true");c++}while(c>d){e=a(this.visibleItems.get(c));e.attr("aria-selected","true");c--}}b.attr("aria-selected","true");this.triggerChange()};f.prototype.selectItem=function(a){var b=a.parent();while("tree"!=b.attr("role")){b=b.parent();if("false"==b.attr("aria-expanded")){this.expandGroup(b)}b=b.parent()}this.items.attr("aria-selected","false");a.attr("aria-selected","true");this.triggerChange()};f.prototype.toggleItem=function(a){if(!this.multiSelect){this.selectItem(a);return}var b=a.attr("aria-selected");if("true"===b){b="false"}else{b="true"}a.attr("aria-selected",b);this.triggerChange()};f.prototype.updateFocus=function(a){this.lastActiveItem=this.activeItem;this.activeItem=a;var b=a.parent();while("tree"!=b.attr("role")){b=b.parent();if("false"==b.attr("aria-expanded")){this.expandGroup(b)}b=b.parent()}this.items.attr("tabindex","-1");a.attr("tabindex",0)};f.prototype.handleKeyDown=function(b,c){var d=this.visibleItems.index(b),e=null,f=c.shiftKey||c.ctrlKey||c.metaKey||c.altKey,g=this;switch(c.keyCode){case this.keys.home:{e=this.parents.first();e.focus();if(c.shiftKey){this.multiSelectItem(e)}else if(!f){this.selectItem(e)}c.stopPropagation();return!1}case this.keys.end:{e=this.visibleItems.last();e.focus();if(c.shiftKey){this.multiSelectItem(e)}else if(!f){this.selectItem(e)}c.stopPropagation();return!1}case this.keys.enter:case this.keys.space:{if(c.shiftKey){this.multiSelectItem(b)}else if(c.metaKey||c.ctrlKey){this.toggleItem(b)}else{this.selectItem(b)}c.stopPropagation();return!1}case this.keys.left:{if(b.has("ul")&&"true"==b.attr("aria-expanded")){this.collapseGroup(b)}else{var h=b.parent(),i=h.parent();if(i.is("li")){i.focus();if(c.shiftKey){this.multiSelectItem(i)}else if(!f){this.selectItem(i)}}}c.stopPropagation();return!1}case this.keys.right:{if(b.has("ul")&&"false"==b.attr("aria-expanded")){this.expandGroup(b)}else{e=b.children("ul").children("li").first();if(0<e.length){e.focus();if(c.shiftKey){this.multiSelectItem(e)}else if(!f){this.selectItem(e)}}}c.stopPropagation();return!1}case this.keys.up:{if(0<d){var j=this.visibleItems.eq(d-1);j.focus();if(c.shiftKey){this.multiSelectItem(j)}else if(!f){this.selectItem(j)}}c.stopPropagation();return!1}case this.keys.down:{if(d<this.visibleItems.length-1){var k=this.visibleItems.eq(d+1);k.focus();if(c.shiftKey){this.multiSelectItem(k)}else if(!f){this.selectItem(k)}}c.stopPropagation();return!1}case this.keys.asterisk:{this.parents.each(function(){g.expandGroup(a(this))});c.stopPropagation();return!1}case this.keys.eight:{if(c.shiftKey){this.parents.each(function(){g.expandGroup(a(this))});c.stopPropagation()}return!1}}return!0};f.prototype.handleKeyPress=function(a,b){if(b.altKey||b.ctrlKey||b.shiftKey||b.metaKey){return!0}switch(b.keyCode){case this.keys.tab:{return!0}case this.keys.enter:case this.keys.home:case this.keys.end:case this.keys.left:case this.keys.right:case this.keys.up:case this.keys.down:{b.stopPropagation();return!1}default:{var c=String.fromCharCode(b.which),d=!1,e=this.visibleItems.index(a),f=this.visibleItems.length,g=e+1;if(g==f){g=0}while(g!=e){var h=this.visibleItems.eq(g),i=h.text().charAt(0);if(h.has("ul")){i=h.find("span").text().charAt(0)}if(i.toLowerCase()==c){d=!0;break}g=g+1;if(g==f){g=0}}if(!0===d){this.updateFocus(this.visibleItems.eq(g))}b.stopPropagation();return!1}}return!0};f.prototype.on=function(a,b){if("selectionchanged"!==a){c.warning("Invalid custom event name for tree. Only \"selectionchanged\" is supported.")}else{this.treeRoot.on(a,b)}};f.prototype.handleDblClick=function(a,b){if(b.altKey||b.ctrlKey||b.shiftKey||b.metaKey){return!0}this.updateFocus(a);this.toggleGroup(a);b.stopPropagation();return!1};f.prototype.handleExpandCollapseClick=function(a,b){this.toggleGroup(a);b.stopPropagation();return!1};f.prototype.handleClick=function(a,b){if(b.shiftKey){this.multiSelectItem(a)}else if(b.metaKey||b.ctrlKey){this.toggleItem(a)}else{this.selectItem(a)}this.updateFocus(a);b.stopPropagation();return!1};f.prototype.handleBlur=function(){return!0};f.prototype.handleFocus=function(a){this.updateFocus(a);return!0};f.prototype.bindEventHandlers=function(){var b=this;this.parents.dblclick(function(c){return b.handleDblClick(a(this),c)});this.items.click(function(c){return b.handleClick(a(this),c)});this.items.children("img").click(function(c){return b.handleExpandCollapseClick(a(this).parent(),c)});this.items.keydown(function(c){return b.handleKeyDown(a(this),c)});this.items.keypress(function(c){return b.handleKeyPress(a(this),c)});this.items.focus(function(c){return b.handleFocus(a(this),c)});this.items.blur(function(c){return b.handleBlur(a(this),c)})};return f});
define ("tool_lp/user_competency_info",["jquery","core/notification","core/ajax","core/templates"],function(a,b,c,d){var e=function(a,b,c,d,e,f){this._rootElement=a;this._competencyId=b;this._userId=c;this._planId=d;this._courseId=e;this._valid=!0;this._displayuser="undefined"!=typeof f?f:!1;if(this._planId){this._methodName="tool_lp_data_for_user_competency_summary_in_plan";this._args={competencyid:this._competencyId,planid:this._planId};this._templateName="tool_lp/user_competency_summary_in_plan"}else if(this._courseId){this._methodName="tool_lp_data_for_user_competency_summary_in_course";this._args={userid:this._userId,competencyid:this._competencyId,courseid:this._courseId};this._templateName="tool_lp/user_competency_summary_in_course"}else{this._methodName="tool_lp_data_for_user_competency_summary";this._args={userid:this._userId,competencyid:this._competencyId};this._templateName="tool_lp/user_competency_summary"}};e.prototype.reload=function(){var a=this,e=[];if(!this._valid){return}e=c.call([{methodname:this._methodName,args:this._args}]);e[0].done(function(c){if(a._displayuser){c.displayuser=!0}d.render(a._templateName,c).done(function(b,c){d.replaceNode(a._rootElement,b,c)}).fail(b.exception)}).fail(b.exception)};e.prototype._rootElement=null;e.prototype._courseId=null;e.prototype._valid=null;e.prototype._planId=null;e.prototype._competencyId=null;e.prototype._userId=null;e.prototype._methodName=null;e.prototype._args=null;e.prototype._templateName=null;e.prototype._displayuser=!1;return e});
define ("tool_lp/dragdrop-reorder",["core/str","core/yui"],function(a,b){var c=null,d=function(a){var b=a.drag.get("node"),c=a.drop.get("node");this.callback(b.getDOMNode(),c.getDOMNode())};return{dragdrop:function dragdrop(e,f,g,h,i,j,k,l){a.get_strings([{key:"emptydragdropregion",component:"moodle"},{key:"movecontent",component:"moodle"},{key:"tocontent",component:"moodle"}]).done(function(){b.use("moodle-tool_lp-dragdrop-reorder",function(){if(c){c.destroy()}c=M.tool_lp.dragdrop_reorder({group:e,dragHandleText:f,sameNodeText:g,parentNodeText:h,sameNodeClass:i,parentNodeClass:j,dragHandleInsertClass:k,callback:b.bind(d,{callback:l})})})})}}});
define ("tool_lp/grade_dialogue",["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/event_base","core/str"],function(a,b,c,d,e,f){var g=function(a){e.prototype.constructor.apply(this,[]);this._ratingOptions=a};g.prototype=Object.create(e.prototype);g.prototype._popup=null;g.prototype._ratingOptions=null;g.prototype._afterRender=function(){var b=this._find("[data-action=\"rate\"]"),c=this._find("[name=\"rating\"]"),d=this._find("[name=\"comment\"]");this._find("[data-action=\"cancel\"]").click(function(a){a.preventDefault();this._trigger("cancelled");this.close()}.bind(this));c.change(function(){var c=a(this);if(!c.val()){b.prop("disabled",!0)}else{b.prop("disabled",!1)}}).change();b.click(function(a){a.preventDefault();var b=c.val();if(!b){return}this._trigger("rated",{rating:b,note:d.val()});this.close()}.bind(this))};g.prototype.close=function(){this._popup.close();this._popup=null};g.prototype.display=function(){M.util.js_pending("tool_lp/grade_dialogue:display");return a.when(f.get_string("rate","tool_lp"),this._render()).then(function(a,b){this._popup=new d(a,b[0],function(){this._afterRender();M.util.js_complete("tool_lp/grade_dialogue:display")}.bind(this));return this._popup}.bind(this)).catch(b.exception)};g.prototype._find=function(b){return a(this._popup.getContent()).find(b)};g.prototype._render=function(){var a={cangrade:this._canGrade,ratings:this._ratingOptions};return c.render("tool_lp/competency_grader",a)};return g});
define ("tool_lp/form_competency_element",["jquery","tool_lp/competencypicker","core/ajax","core/notification","core/templates"],function(a,b,c,d,e){var f=null,g=1,h=function(){var b=a("[data-action=\"competencies\"]").val(),f=[],g=0;if(""!=b){b=b.split(",");for(g=0;g<b.length;g++){f[f.length]={methodname:"core_competency_read_competency",args:{id:b[g]}}}}a.when.apply(a,c.call(f,!1)).then(function(){var a=0,b=[];for(a=0;a<arguments.length;a++){b[a]=arguments[a]}return e.render("tool_lp/form_competency_list",{competencies:b})}).then(function(b,c){e.replaceNode(a("[data-region=\"competencies\"]"),b,c);return!0}).fail(d.exception);return!0},i=function(b){var c=a("[data-action=\"competencies\"]").val().split(","),d=[],e,f=a(b.currentTarget).data("id");for(e=0;e<c.length;e++){if(c[e]!=f){d[d.length]=c[e]}}a("[data-action=\"competencies\"]").val(d.join(","));return h()},j=function(){var c=a("[data-action=\"competencies\"]").val().split(",");if(!f){f=new b(g,!1,"parents",!0);f.on("save",function(b,c){var d=a("[data-action=\"competencies\"]").val(),e=c.competencyIds;if(""!=d){e=e.concat(d.split(","))}var f=e.join(",");a("[data-action=\"competencies\"]").val(f);return h()})}f.setDisallowedCompetencyIDs(c);f.display()};return{init:function init(b){g=b;h();a("[data-action=\"select-competencies\"]").on("click",j);a("body").on("click","[data-action=\"deselect-competency\"]",i)}}});
define ("tool_lp/templateactions",["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/actionselector"],function(a,b,c,d,e,f){var g=0,h=0,i=!0,j=function(c,d){a("[data-region=\"managetemplates\"]").replaceWith(c);b.runTemplateJS(d)},k=function(a){b.render("tool_lp/manage_templates_page",a).done(j).fail(d.exception)},l=function(){var a=c.call([{methodname:"core_competency_delete_template",args:{id:h,deleteplans:i}},{methodname:"tool_lp_data_for_templates_manage_page",args:{pagecontext:{contextid:g}}}]);a[1].done(k).fail(d.exception)},m=function(b){b.preventDefault();h=a(this).attr("data-templateid");var e=c.call([{methodname:"core_competency_duplicate_template",args:{id:h}},{methodname:"tool_lp_data_for_templates_manage_page",args:{pagecontext:{contextid:g}}}]);e[1].done(k).fail(d.exception)},n=function(b){b.preventDefault();var g=a(this).attr("data-templateid");h=g;i=!0;var j=c.call([{methodname:"core_competency_read_template",args:{id:h}},{methodname:"core_competency_template_has_related_data",args:{id:h}}]);j[0].done(function(a){j[1].done(function(b){if(b){e.get_strings([{key:"deletetemplate",component:"tool_lp",param:a.shortname},{key:"deletetemplatewithplans",component:"tool_lp"},{key:"deleteplans",component:"tool_lp"},{key:"unlinkplanstemplate",component:"tool_lp"},{key:"confirm",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){var b=[{text:a[2],value:"delete"},{text:a[3],value:"unlink"}],c=new f(a[0],a[1],b,a[4],a[5]);c.display();c.on("save",function(a,b){if("delete"!=b.action){i=!1}l()})}).fail(d.exception)}else{e.get_strings([{key:"confirm",component:"moodle"},{key:"deletetemplate",component:"tool_lp",param:a.shortname},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],l)}).fail(d.exception)}}).fail(d.exception)}).fail(d.exception)};return{deleteHandler:n,duplicateHandler:m,init:function init(a){g=a}}});
define ("tool_lp/competency_rule",["jquery"],function(a){var b=function(b){this._eventNode=a("<div>");this._ready=a.Deferred();this._tree=b};b.prototype._competency=null;b.prototype._eventNode=null;b.prototype._ready=null;b.prototype._tree=null;b.prototype.canConfig=function(){return this._tree.hasChildren(this._competency.id)};b.prototype.getConfig=function(){return null};b.prototype.getType=function(){throw new Error("Not implemented")};b.prototype.init=function(){return this._load()};b.prototype.injectTemplate=function(){return a.Deferred().reject().promise()};b.prototype.isValid=function(){return!1};b.prototype._load=function(){return a.when()};b.prototype.on=function(a,b){this._eventNode.on(a,b)};b.prototype.setTargetCompetency=function(a){this._competency=a};b.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])};b.prototype._triggerChange=function(){this._trigger("change",this)};return b});
define ("tool_lp/competencyactions",["jquery","core/url","core/templates","core/notification","core/str","core/ajax","tool_lp/dragdrop-reorder","tool_lp/tree","tool_lp/dialogue","tool_lp/menubar","tool_lp/competencypicker","tool_lp/competency_outcomes","tool_lp/competencyruleconfig","core/pending"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=null,p=null,q=null,r,s,t,u,v,w,x=null,y=function(){var c=a("[data-region=\"competencyactions\"]").data("competency"),f={competencyframeworkid:o.getCompetencyFrameworkId(),pagecontextid:r};if(null!==c){f.parentid=c.id}var g=function(){var c=a.param(f);window.location=b.relativeUrl("/admin/tool/lp/editcompetency.php?"+c)};if(null!==c&&o.hasRule(c.id)){e.get_strings([{key:"confirm",component:"moodle"},{key:"addingcompetencywillresetparentrule",component:"tool_lp",param:c.shortname},{key:"yes",component:"core"},{key:"no",component:"core"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],g)}).fail(d.exception)}else{g()}},z=function(){var b=a("[data-region=\"filtercompetencies\"]").data("frameworkid"),c=f.call([{methodname:"core_competency_set_parent_competency",args:{competencyid:p,parentid:q}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b,search:a("[data-region=\"filtercompetencies\"] input").val()}}]);c[1].done(F).fail(d.exception)},A=function(){q="undefined"==typeof q?0:q;if(q==p){return}var a=o.getCompetency(q)||{},b=o.getCompetency(p)||{},c="movecompetencywillresetrules",f=!1;if(b.parentid==q){return}if(a.path&&0<=a.path.indexOf("/"+b.id+"/")){c="movecompetencytochildofselfwillresetrules";f=f||o.hasRule(b.id)}f=f||o.hasRule(a.id)||o.hasRule(b.parentid);if(f){e.get_strings([{key:"confirm",component:"moodle"},{key:c,component:"tool_lp"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],z)}).fail(d.exception)}else{z()}},B=function(b){var c=a(b.getContent()),d=c.find("[data-enhance=movetree]"),e=new h(d,!1);e.on("selectionchanged",function(b,c){var d=c.selected;q=a(d).data("id")});d.show();c.on("click","[data-action=\"move\"]",function(){b.close();A()});c.on("click","[data-action=\"cancel\"]",function(){b.close()})},C=function(a,b){var c;for(c=0;c<b.length;c++){if(b[c].parentid==a.id){a.haschildren=!0;b[c].children=[];b[c].haschildren=!1;a.children[a.children.length]=b[c];C(b[c],b)}}},D=function(b){b.preventDefault();var g=a("[data-region=\"competencyactions\"]").data("competency");p=g.id;var h=f.call([{methodname:"core_competency_search_competencies",args:{competencyframeworkid:g.competencyframeworkid,searchtext:""}},{methodname:"core_competency_read_competency_framework",args:{id:g.competencyframeworkid}}]);a.when.apply(null,h).done(function(a,b){var f,h=[];for(f=0;f<a.length;f++){var j=a[f];if("0"==j.parentid){j.children=[];j.haschildren=0;h[h.length]=j;C(j,a)}}e.get_strings([{key:"movecompetency",component:"tool_lp",param:g.shortname},{key:"move",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(a){c.render("tool_lp/competencies_move_tree",{framework:b,competencies:h}).done(function(b){new i(a[0],b,B)}).fail(d.exception)}).fail(d.exception)}).fail(d.exception)},E=function(){var c=a("[data-region=\"competencyactions\"]").data("competency"),d={competencyframeworkid:o.getCompetencyFrameworkId(),id:c.id,parentid:c.parentid,pagecontextid:r},e=a.param(d);window.location=b.relativeUrl("/admin/tool/lp/editcompetency.php?"+e)},F=function(b){c.render("tool_lp/manage_competencies_page",b).done(function(b,d){a("[data-region=\"managecompetencies\"]").replaceWith(b);c.runTemplateJS(d)}).fail(d.exception)},G=function(b){b.preventDefault();var c=a("[data-region=\"filtercompetencies\"]").data("frameworkid"),e=f.call([{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:c,search:a("[data-region=\"filtercompetencies\"] input").val()}}]);e[0].done(F).fail(d.exception)},H=function(){var b=a("[data-region=\"competencyactions\"]").data("competency"),c=f.call([{methodname:"core_competency_move_up_competency",args:{id:b.id}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b.competencyframeworkid,search:a("[data-region=\"filtercompetencies\"] input").val()}}]);c[1].done(F).fail(d.exception)},I=function(){var b=a("[data-region=\"competencyactions\"]").data("competency"),c=f.call([{methodname:"core_competency_move_down_competency",args:{id:b.id}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b.competencyframeworkid,search:a("[data-region=\"filtercompetencies\"] input").val()}}]);c[1].done(F).fail(d.exception)},J=function(){var b=a("[data-region=\"competencyactions\"]").data("competency"),g=f.call([{methodname:"tool_lp_list_courses_using_competency",args:{id:b.id}}]);g[0].done(function(a){c.render("tool_lp/linked_courses_summary",{courses:a}).done(function(a){e.get_string("linkedcourses","tool_lp").done(function(b){new i(b,a,B)}).fail(d.exception)}).fail(d.exception)}).fail(d.exception)},K=function(){u=a("[data-region=\"competencyactions\"]").data("competency");if(!s){s=new k(r,u.competencyframeworkid);s.on("save",function(b,e){var g=new n,h=e.competencyIds,i=[];a.each(h,function(a,b){i.push({methodname:"core_competency_add_related_competency",args:{competencyid:b,relatedcompetencyid:u.id}})});i.push({methodname:"tool_lp_data_for_related_competencies_section",args:{competencyid:u.id}});var j=f.call(i);j[i.length-1].then(function(a){return c.render("tool_lp/related_competencies",a)}).then(function(b,d){a("[data-region=\"relatedcompetencies\"]").replaceWith(b);c.runTemplateJS(d);V()}).then(g.resolve).catch(d.exception)})}s.setDisallowedCompetencyIDs([u.id]);s.display()},L=function(b){b.preventDefault();u=a("[data-region=\"competencyactions\"]").data("competency");t.setTargetCompetencyId(u.id);t.display()},M=function(a,b){var c={id:u.id,shortname:u.shortname,idnumber:u.idnumber,description:u.description,descriptionformat:u.descriptionformat,ruletype:b.ruletype,ruleoutcome:b.ruleoutcome,ruleconfig:b.ruleconfig},e=f.call([{methodname:"core_competency_update_competency",args:{competency:c}}]);e[0].then(function(a){if(a){u.ruletype=b.ruletype;u.ruleoutcome=b.ruleoutcome;u.ruleconfig=b.ruleconfig;Y(u)}}).catch(d.exception)},N=function(){var b=a("[data-region=\"competencyactions\"]").data("competency"),c=f.call([{methodname:"core_competency_delete_competency",args:{id:b.id}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b.competencyframeworkid,search:a("[data-region=\"filtercompetencies\"] input").val()}}]);c[0].done(function(a){if(!1===a){e.get_strings([{key:"competencycannotbedeleted",component:"tool_lp",param:b.shortname},{key:"cancel",component:"moodle"}]).done(function(a){d.alert(null,a[0])}).fail(d.exception)}}).fail(d.exception);c[1].done(F).fail(d.exception)},O=function(){var b=a("[data-region=\"competencyactions\"]").data("competency"),c="deletecompetency";if(o.hasRule(b.parentid)){c="deletecompetencyparenthasrule"}e.get_strings([{key:"confirm",component:"moodle"},{key:c,component:"tool_lp",param:b.shortname},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],N)}).fail(d.exception)},P=function(b){b.originalEvent.dataTransfer.setData("text",a(b.target).parent().data("id"))},Q=function(a){a.originalEvent.dataTransfer.dropEffect="move";a.preventDefault()},R=function(b){b.preventDefault();a(this).addClass("currentdragtarget")},S=function(b){b.preventDefault();a(this).removeClass("currentdragtarget")},T=function(b){b.preventDefault();p=b.originalEvent.dataTransfer.getData("text");q=a(b.target).parent().data("id");a(this).removeClass("currentdragtarget");A()},U=function(b){b.preventDefault();var e=this.id.substr(11),g=a("[data-region=\"competencyactions\"]").data("competency"),h=f.call([{methodname:"core_competency_remove_related_competency",args:{relatedcompetencyid:e,competencyid:g.id}},{methodname:"tool_lp_data_for_related_competencies_section",args:{competencyid:g.id}}]);h[1].done(function(b){c.render("tool_lp/related_competencies",b).done(function(b){a("[data-region=\"relatedcompetencies\"]").replaceWith(b);V()}).fail(d.exception)}).fail(d.exception)},V=function(){a("[data-action=\"deleterelation\"]").on("click",U)},W=function(a){if(a.id!==x){x=a.id;f.call([{methodname:"core_competency_competency_viewed",args:{id:a.id}}])}},X=function(a){var b=v[a];if(!b){b="competency"}return b},Y=function(e){var g=a.Deferred().resolve().promise(),h={};h.competency=e;h.showdeleterelatedaction=!0;h.showrelatedcompetencies=!0;h.showrule=!1;h.pluginbaseurl=b.relativeUrl("/admin/tool/lp");if(e.ruleoutcome!=l.NONE){g=l.getString(e.ruleoutcome).then(function(b){var c;a.each(w,function(a,b){if(b.type==e.ruletype){c=b.name}});return[b,c]})}g.then(function(a){if("undefined"!=typeof a){h.showrule=!0;h.rule={outcome:a[0],type:a[1]}}return h}).then(function(a){return c.render("tool_lp/competency_summary",a)}).then(function(b){a("[data-region=\"competencyinfo\"]").html(b);a("[data-action=\"deleterelation\"]").on("click",U);return c.render("tool_lp/loading",{})}).then(function(a,b){c.replaceNodeContents("[data-region=\"relatedcompetencies\"]",a,b);return f.call([{methodname:"tool_lp_data_for_related_competencies_section",args:{competencyid:e.id}}])[0]}).then(function(a){return c.render("tool_lp/related_competencies",a)}).then(function(b,d){a("[data-region=\"relatedcompetencies\"]").replaceWith(b);c.runTemplateJS(d);V()}).catch(d.exception)},Z=function(a){return e.get_string("taxonomy_add_"+X(a),"tool_lp")},$=function(a){return e.get_string("taxonomy_selected_"+X(a),"tool_lp")},_=function(b,c){var e=c.selected,f=a(e).data("id"),g=a("[data-region=\"competencyactions\"] [data-action=\"add\"]"),h=a("[data-region=\"competencyactionsmenu\"]"),i=a("[data-region=\"selected-competency\"]"),k=0,l=1;j.closeAll();if("undefined"==typeof f){a("[data-region=\"competencyinfo\"]").html(e.clone().children().remove().end().text());a("[data-region=\"competencyactions\"]").data("competency",null);h.hide()}else{var m=o.getCompetency(f);k=o.getCompetencyLevel(f);l=k+1;h.show();a("[data-region=\"competencyactions\"]").data("competency",m);Y(m);W(m)}$(k).then(function(a){i.text(a)}).catch(d.exception);Z(l).then(function(a){g.show().find("[data-region=\"term\"]").text(a)}).catch(d.exception);b.preventDefault();return!1},aa=function(a){var b=a.split(",");b.unshift("");delete b[0];return b};return{init:function init(b,c,d,e){o=b;r=c;v=aa(d);w=e;a("[data-region=\"competencyactions\"] [data-action=\"add\"]").on("click",y);j.enhance(".competencyactionsmenu",{'[data-action="edit"]':E,'[data-action="delete"]':O,'[data-action="move"]':D,'[data-action="moveup"]':H,'[data-action="movedown"]':I,'[data-action="linkedcourses"]':J,'[data-action="relatedcompetencies"]':K.bind(this),'[data-action="competencyrules"]':L.bind(this)});a("[data-region=\"competencyactionsmenu\"]").hide();a("[data-region=\"competencyactions\"] [data-action=\"add\"]").hide();a("[data-region=\"filtercompetencies\"]").on("submit",G);var f=a("[data-region=\"managecompetencies\"] [data-enhance=\"tree\"]");f.on("dragstart","li>span",P).on("dragover","li>span",Q).on("dragenter","li>span",R).on("dragleave","li>span",S).on("drop","li>span",T);b.on("selectionchanged",_);t=new m(o,w);t.on("save",M.bind(this))}}});
define ("tool_lp/competencydialogue",["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/dialogue"],function(a,b,c,d,e,f){var g,h=function(){};h.prototype.triggerCompetencyViewedEvent=function(a){c.call([{methodname:"core_competency_competency_viewed",args:{id:a}}])};h.prototype.showDialogue=function(a,c){var e=this.getCompetencyDataPromise(a,c),g=this;e.done(function(c){d.render("tool_lp/competency_summary",c).done(function(b){g.triggerCompetencyViewedEvent(a);new f(c.competency.shortname,b)}).fail(b.exception)}).fail(b.exception)};h.prototype.showDialogueFromData=function(a){var c=this;d.render("tool_lp/competency_summary",a).done(function(b){c.triggerCompetencyViewedEvent(a.id);new f(a.shortname,b,c.enhanceDialogue)}).fail(b.exception)};h.prototype.clickEventHandler=function(b){var c=b.data.compdialogue,d=a(b.currentTarget),e=d.data("id"),f=!d.data("excluderelated"),g=d.data("includecourses");c.showDialogue(e,{includerelated:f,includecourses:g});b.preventDefault()};h.prototype.getCompetencyDataPromise=function(a,d){var e=c.call([{methodname:"tool_lp_data_for_competency_summary",args:{competencyid:a,includerelated:d.includerelated||!1,includecourses:d.includecourses||!1}}]);return e[0].then(function(a){return a}).fail(b.exception)};return{init:function init(){if("undefined"!=typeof g){return}g=new h;a("body").delegate("[data-action=\"competency-dialogue\"]","click",{compdialogue:g},g.clickEventHandler.bind(g))}}});
define ("tool_lp/grade_user_competency_inline",["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length){throw new Error("Could not find the trigger")}this._scaleId=c;this._competencyId=d;this._userId=e;this._planId=g;this._courseId=h;this._chooseStr=i;this._setUp();j.click(function(a){a.preventDefault();this._dialogue.display()}.bind(this));if(this._planId){this._methodName="core_competency_grade_competency_in_plan";this._args={competencyid:this._competencyId,planid:this._planId}}else if(this._courseId){this._methodName="core_competency_grade_competency_in_course";this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}}else{this._methodName="core_competency_grade_competency";this._args={userid:this._userId,competencyid:this._competencyId}}};h.prototype=Object.create(f.prototype);h.prototype._setUp=function(){var a=[],d=this;M.util.js_pending("tool_lp/grade_user_competency_inline:_setUp");var f=g.get_values(d._scaleId);f.then(function(b){a.push({value:"",name:d._chooseStr});for(var c=0,e;c<b.length;c++){e=b[c];a.push({value:e.id,name:e.name})}return a}).then(function(a){return new e(a)}).then(function(a){a.on("rated",function(a,e){var f=d._args;f.grade=e.rating;f.note=e.note;c.call([{methodname:d._methodName,args:f,done:function done(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])});return a}).then(function(a){d._dialogue=a;M.util.js_complete("tool_lp/grade_user_competency_inline:_setUp")}).fail(b.exception)};h.prototype._scaleId=null;h.prototype._competencyId=null;h.prototype._userId=null;h.prototype._planId=null;h.prototype._courseId=null;h.prototype._chooseStr=null;h.prototype._dialogue=null;return h});
define ("tool_lp/competencytree",["core/ajax","core/notification","core/templates","tool_lp/tree","tool_lp/competency_outcomes","jquery"],function(a,b,c,d,e,f){var g={},h=0,j="",k="",l="",m=!1,n=function(a,b){var c=0,d=!1;a.haschildren=!1;a.children=[];for(c=0;c<b.length;c++){d=b[c];if(d.parentid==a.id){a.haschildren=!0;a.children.push(d);n(d,b)}}},o=function(b){var e=f.Deferred();c.render("tool_lp/loading",{}).done(function(i,o){c.replaceNodeContents(f(k),i,o);var p=a.call([{methodname:"core_competency_search_competencies",args:{searchtext:b,competencyframeworkid:h}}]);p[0].done(function(a){g={};var b=0;for(b=0;b<a.length;b++){g[a[b].id]=a[b]}var h=[],o=!1;for(b=0;b<a.length;b++){o=a[b];if(0===parseInt(o.parentid,10)){h.push(o);n(o,a)}}var p={shortname:j,canmanage:m,competencies:h};c.render("tool_lp/competencies_tree_root",p).done(function(a,b){c.replaceNodeContents(f(k),f(a).html(),b);var h=new d(k,!1);if(l){var i=f(k).find("[data-id="+l+"]");if(i.length){h.selectItem(i);h.updateFocus(i)}}e.resolve(g)}).fail(e.reject)}).fail(e.reject)});return e.promise()},p=function(a,b){var c=b.selected;l=c.attr("data-id")};return{init:function init(a,c,d,e,f,g){h=a;j=c;m=f;k=e;o(d).fail(b.exception);if(0<g){l=g}this.on("selectionchanged",p)},on:function on(a,b){f(k).on(a,b)},getChildren:function getChildren(a){var b=[];f.each(g,function(c,d){if(d.parentid==a){b.push(d)}});return b},getCompetencyFrameworkId:function getCompetencyFrameworkId(){return h},getCompetency:function getCompetency(a){return g[a]},getCompetencyLevel:function getCompetencyLevel(a){var b=this.getCompetency(a),c=b.path.replace(/^\/|\/$/g,"").split("/").length;return c},hasChildren:function hasChildren(a){return 0<this.getChildren(a).length},hasRule:function hasRule(a){var b=this.getCompetency(a);if(b){return b.ruleoutcome!=e.OUTCOME_NONE&&b.ruletype}return!1},reloadCompetencies:function reloadCompetencies(){return o("").fail(b.exception)},listCompetencies:function listCompetencies(){return g}}});
define ("tool_lp/competencyruleconfig",["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/competency_outcomes","core/str"],function(a,b,c,d,e,f){var g=function(b,c){this._eventNode=a("<div></div>");this._tree=b;this._rulesModules=c;this._setUp()};g.prototype._competency=null;g.prototype._eventNode=null;g.prototype._outcomesOption=null;g.prototype._popup=null;g.prototype._ready=null;g.prototype._rules=null;g.prototype._rulesModules=null;g.prototype._tree=null;g.prototype._afterChange=function(){if(!this._isValid()){this._find("[data-action=\"save\"]").prop("disabled",!0)}else{this._find("[data-action=\"save\"]").prop("disabled",!1)}};g.prototype._afterRuleConfigChange=function(a,b){if(b!=this._getRule()){return}this._afterChange()};g.prototype._afterRender=function(){var a=this;a._find("[name=\"outcome\"]").on("change",function(){a._switchedOutcome()}).trigger("change");a._find("[name=\"rule\"]").on("change",function(){a._switchedRule()}).trigger("change");a._find("[data-action=\"save\"]").on("click",function(){a._trigger("save",a._getConfig());a.close()});a._find("[data-action=\"cancel\"]").on("click",function(){a.close()})};g.prototype.canBeConfigured=function(){var b=!1;a.each(this._rules,function(a,c){if(c.canConfig()){b=!0}});return b};g.prototype.close=function(){this._popup.close();this._popup=null};g.prototype.display=function(){var c=this;if(!c._competency){return!1}return a.when(f.get_string("competencyrule","tool_lp"),c._render()).then(function(a,b){c._popup=new d(a,b[0],c._afterRender.bind(c))}).fail(b.exception)};g.prototype._find=function(b){return a(this._popup.getContent()).find(b)};g.prototype._getApplicableOutcomesOptions=function(){var b=this,c=[];a.each(b._outcomesOption,function(a,d){c.push({code:d.code,name:d.name,selected:d.code==b._competency.ruleoutcome?!0:!1})});return c};g.prototype._getApplicableRulesOptions=function(){var b=this,c=[];a.each(b._rules,function(a,d){if(!d.canConfig()){return}c.push({name:b._getRuleName(d.getType()),type:d.getType(),selected:d.getType()==b._competency.ruletype?!0:!1})});return c};g.prototype._getConfig=function(){var a=this._getRule();return{ruletype:a?a.getType():null,ruleconfig:a?a.getConfig():null,ruleoutcome:this._getOutcome()}};g.prototype._getOutcome=function(){return this._find("[name=\"outcome\"]").val()};g.prototype._getRule=function(){var b,c=this._find("[name=\"rule\"]").val();a.each(this._rules,function(a,d){if(d.getType()==c){b=d}});return b};g.prototype._getRuleName=function(b){var c=this,d;a.each(c._rulesModules,function(a,c){if(c.type==b){d=c.name}});return d};g.prototype._initOutcomes=function(){var a=this;return e.getAll().then(function(b){a._outcomesOption=b})};g.prototype._initRules=function(){var b=this,c=[];a.each(b._rules,function(d,e){var f=e.init().then(function(){e.setTargetCompetency(b._competency);e.on("change",b._afterRuleConfigChange.bind(b))},function(){b._rules.splice(d,1);return a.when()});c.push(f)});return a.when.apply(a.when,c)};g.prototype._isValid=function(){var a=this._getOutcome(),b=this._getRule();if(a==e.NONE){return!0}else if(!b){return!1}return b.isValid()};g.prototype.on=function(a,b){this._eventNode.on(a,b)};g.prototype._preRender=function(){return this.ready()};g.prototype.ready=function(){return this._ready.promise()};g.prototype._render=function(){var a=this;return this._preRender().then(function(){var b;if(!a.canBeConfigured()){b=!1}else{b={};b.outcomes=a._getApplicableOutcomesOptions();b.rules=a._getApplicableRulesOptions()}var d={competencyshortname:a._competency.shortname,config:b};return c.render("tool_lp/competency_rule_config",d)})};g.prototype.setTargetCompetencyId=function(b){var c=this;c._competency=c._tree.getCompetency(b);a.each(c._rules,function(a,b){b.setTargetCompetency(c._competency)})};g.prototype._setUp=function(){var b=this,c=[],d=[];b._ready=a.Deferred();b._rules=[];a.each(b._rulesModules,function(a,b){d.push(b.amd)});require(d,function(){a.each(arguments,function(a,c){var d=new c(b._tree);b._rules.push(d)});c.push(b._initRules());c.push(b._initOutcomes());a.when.apply(a.when,c).always(function(){b._ready.resolve()})})};g.prototype._switchedOutcome=function(){var a=this,b=a._getOutcome();if(b==e.NONE){a._find("[data-region=\"rule-type\"]").hide().find("[name=\"rule\"]").val(-1);a._find("[data-region=\"rule-config\"]").empty().hide();a._afterChange();return}a._find("[data-region=\"rule-type\"]").show();a._find("[data-region=\"rule-config\"]").show();a._afterChange()};g.prototype._switchedRule=function(){var a=this,b=a._find("[data-region=\"rule-config\"]"),c=a._getRule();if(!c){b.empty().hide();a._afterChange();return}c.injectTemplate(b).then(function(){b.show()}).always(function(){a._afterChange()}).catch(function(){b.empty().hide()})};g.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])};return g});
define ("tool_lp/user_competency_course_navigation",["jquery"],function(a){var b=function(b,c,d,e,f,g){this._baseUrl=d;this._userId=e+"";this._competencyId=f+"";this._courseId=g;a(b).on("change",this._userChanged.bind(this));a(c).on("change",this._competencyChanged.bind(this))};b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?userid="+c+"&courseid="+this._courseId+"&competencyid="+this._competencyId;document.location=this._baseUrl+d};b.prototype._competencyChanged=function(b){var c=a(b.target).val(),d="?userid="+this._userId+"&courseid="+this._courseId+"&competencyid="+c;document.location=this._baseUrl+d};b.prototype._competencyId=null;b.prototype._userId=null;b.prototype._courseId=null;b.prototype._baseUrl=null;b.prototype._ignoreFirstCompetency=null;return b});
define ("tool_lp/event_base",["jquery"],function(a){var b=function(){this._eventNode=a("<div></div>")};b.prototype._eventNode=null;b.prototype.on=function(a,b){this._eventNode.on(a,b)};b.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])};return b});
define ("tool_lp/evidence_delete",["jquery","core/notification","core/ajax","core/str","core/log"],function(a,b,c,d,e){var f={};return{register:function register(g,h){if("undefined"!=typeof f[g]){return}f[g]=a("body").delegate(g,"click",function(f){var g=a(f.currentTarget).parents(h);if(!g.length||1<g.length){e.error("None or too many evidence container were found.");return}var i=g.data("id");if(!i){e.error("Evidence ID was not found.");return}f.preventDefault();f.stopPropagation();d.get_strings([{key:"confirm",component:"moodle"},{key:"areyousure",component:"moodle"},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){b.confirm(a[0],a[1],a[2],a[3],function(){var a=c.call([{methodname:"core_competency_delete_evidence",args:{id:i}}]);a[0].then(function(){g.remove()}).fail(b.exception)})}).fail(b.exception)})}}});
define ("tool_lp/competency_outcomes",["jquery","core/str"],function(a,b){return{NONE:0,EVIDENCE:1,COMPLETE:2,RECOMMEND:3,getAll:function getAll(){var a=this;return b.get_strings([{key:"competencyoutcome_none",component:"tool_lp"},{key:"competencyoutcome_evidence",component:"tool_lp"},{key:"competencyoutcome_recommend",component:"tool_lp"},{key:"competencyoutcome_complete",component:"tool_lp"}]).then(function(b){var c={};c[a.NONE]={code:a.NONE,name:b[0]};c[a.EVIDENCE]={code:a.EVIDENCE,name:b[1]};c[a.RECOMMEND]={code:a.RECOMMEND,name:b[2]};c[a.COMPLETE]={code:a.COMPLETE,name:b[3]};return c})},getString:function getString(b){var c=this,d=c.getAll();return d.then(function(c){if("undefined"==typeof c[b]){return a.Deferred().reject().promise()}return c[b].name})}}});
define ("tool_lp/competency_rule_points",["jquery","core/str","core/templates","tool_lp/competency_rule"],function(a,b,c,d){var e=function(){d.apply(this,arguments)};e.prototype=Object.create(d.prototype);e.prototype._container=null;e.prototype._templateLoaded=!1;e.prototype.getConfig=function(){return JSON.stringify({base:{points:this._getRequiredPoints()},competencies:this._getCompetenciesConfig()})};e.prototype._getCompetenciesConfig=function(){var b=[];this._container.find("[data-competency]").each(function(){var c=a(this),d=c.data("competency"),e=parseInt(c.find("[name=\"points\"]").val(),10),f=c.find("[name=\"required\"]").prop("checked");b.push({id:d,points:e,required:f?1:0})});return b};e.prototype._getRequiredPoints=function(){return parseInt(this._container.find("[name=\"requiredpoints\"]").val()||1,10)};e.prototype.getType=function(){return"core_competency\\competency_rule_points"};e.prototype.injectTemplate=function(b){var d=this,e=this._tree.getChildren(this._competency.id),f,g={base:{points:2},competencies:[]};this._templateLoaded=!1;if(d._competency.ruletype==d.getType()){try{g=JSON.parse(d._competency.ruleconfig)}catch(a){}}f={requiredpoints:g&&g.base?g.base.points:2,competency:d._competency,children:[]};a.each(e,function(b,c){var d={id:c.id,shortname:c.shortname,required:!1,points:0};if(g){a.each(g.competencies,function(a,b){if(b.id==d.id){d.required=b.required?!0:!1;d.points=b.points}})}f.children.push(d)});return c.render("tool_lp/competency_rule_points",f).then(function(a){d._container=b;b.html(a);b.find("input").change(function(){d._triggerChange()});d._templateLoaded=!0;d._triggerChange()})};e.prototype.isValid=function(){if(!this._templateLoaded){return!1}var b=this._getRequiredPoints(),c=0,d=!0;a.each(this._getCompetenciesConfig(),function(a,b){if(0>b.points){d=!1}c+=b.points});d=d&&c>=b;return d};return e});
define ("tool_lp/competencypicker_user_plans",["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/tree","tool_lp/competencypicker"],function(a,b,c,d,e,f,g){var h=function(a,b,c){g.prototype.constructor.apply(this,[1,!1,"self",c]);this._userId=a;this._plans=[];if(b){this._planId=b;this._singlePlan=!0}};h.prototype=Object.create(g.prototype);h.prototype._plans=null;h.prototype._planId=null;h.prototype._singlePlan=!1;h.prototype._userId=null;h.prototype._afterRender=function(){var c=this;g.prototype._afterRender.apply(c,arguments);if(!c._singlePlan){c._find("[data-action=\"chooseplan\"]").change(function(d){c._planId=a(d.target).val();c._loadCompetencies().then(c._refresh.bind(c)).catch(b.exception)})}};h.prototype._fetchCompetencies=function(a,d){var e=this;return c.call([{methodname:"core_competency_list_plan_competencies",args:{id:a}}])[0].done(function(a){var b,c,f=[];for(b=0;b<a.length;b++){c=a[b].competency;if(0>c.shortname.toLowerCase().indexOf(d.toLowerCase())){continue}c.children=[];c.haschildren=0;f.push(c)}e._competencies=f}).fail(b.exception)};h.prototype._getPlan=function(b){var c;a.each(this._plans,function(a,d){if(d.id==b){c=d}});return c};h.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._planId,this._searchText)};h.prototype._loadPlans=function(){var d,e=this;if(0<e._plans.length){return a.when()}if(e._singlePlan){d=c.call([{methodname:"core_competency_read_plan",args:{id:this._planId}}])[0].then(function(a){return[a]})}else{d=c.call([{methodname:"core_competency_list_user_plans",args:{userid:e._userId}}])[0]}return d.done(function(a){e._plans=a}).fail(b.exception)};h.prototype._preRender=function(){var b=this;return b._loadPlans().then(function(){if(!b._planId&&0<b._plans.length){b._planId=b._plans[0].id}if(!b._planId){b._plans=[];return a.when()}return b._loadCompetencies()})};h.prototype._render=function(){var b=this;return b._preRender().then(function(){if(!b._singlePlan){a.each(b._plans,function(a,c){if(c.id==b._planId){c.selected=!0}else{c.selected=!1}})}var c={competencies:b._competencies,plan:b._getPlan(b._planId),plans:b._plans,search:b._searchText,singlePlan:b._singlePlan};return d.render("tool_lp/competency_picker_user_plans",c)})};return h});
define ("tool_moodlenet/select_page",["core/ajax","core/templates","tool_moodlenet/selectors","core/notification"],function(a,b,c,d){var e,f=function(a){return b.renderPix("courses","tool_moodlenet").then(function(a){return a}).then(function(a){var c=document.createElement("div");c.innerHTML=a.trim();return b.render("core_course/no-courses",{nocoursesimg:c.firstChild.src})}).then(function(c,d){b.replaceNodeContents(a,c,d);a.classList.add("mx-auto");a.classList.add("w-25")})},g=function(a,c){return b.render("tool_moodlenet/view-cards",{courses:c}).then(function(c,d){b.replaceNodeContents(a,c,d);a.classList.remove("mx-auto");a.classList.remove("w-25")})},h=function(b,h,i){var j=h.querySelector(c.region.searchIcon),k=h.querySelector(c.region.clearIcon);if(""!==b){j.classList.add("d-none");k.parentElement.classList.remove("d-none")}else{j.classList.remove("d-none");k.parentElement.classList.add("d-none")}a.call([{methodname:"tool_moodlenet_search_courses",args:{searchvalue:b}}])[0].then(function(a){if(0===a.courses.length){return f(i)}else{a.courses.forEach(function(a){a.viewurl+="&id="+e});return g(i,a.courses)}}).catch(d.exception)},i=function(a){var b=a.querySelector(c.region.searchInput),d=a.querySelector(c.region.courses),e=a.querySelector(c.region.clearIcon);e.addEventListener("click",function(){b.value="";h("",a,d)});b.addEventListener("input",k(function(){h(b.value,a,d)},300))},j=function(a){var b=a.querySelector(c.region.courses);h("",a,b)},k=function(a,b,c){var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function later(){d=null;if(!c){a.apply(e,f)}},b);if(g){a.apply(e,f)}}};return{init:function init(a){e=a;var b=document.querySelector(c.region.selectPage);i(b);j(b)}}});
define ("tool_moodlenet/instance_form",["tool_moodlenet/validator","tool_moodlenet/selectors","core/loadingicon","core/templates","core/notification","jquery"],function(a,b,c,d,e,f){var g=function(d){d.addEventListener("click",function(f){if(f.target.matches(b.action.submit)){var e=d.querySelector("[data-var=\"mnet-link\"]"),g=d.querySelector(b.region.spinner),h=document.querySelector(b.region.validationArea);g.classList.remove("d-none");var i=c.addIconToContainerWithPromise(g);a.validation(e).then(function(a){i.resolve();g.classList.add("d-none");if(a.result){e.classList.remove("is-invalid");e.classList.add("is-valid");h.innerText=a.message;h.classList.remove("text-danger");h.classList.add("text-success");setTimeout(function(){window.location=a.domain},1e3)}else{e.classList.add("is-invalid");h.innerText=a.message;h.classList.add("text-danger")}}).catch()}})},h=function(a,b,h,i){a.innerHTML="";var j=c.addIconToContainer(a),k=null,l=new Promise(function(a){k=a});f.when(j,l).then(function(){d.replaceNodeContents(a,b.customcarouseltemplate,"")}).catch(e.exception);g(a);h.one("slid.bs.carousel",function(){k()});h.carousel(2);i.setFooter(d.render("tool_moodlenet/chooser_footer_close_mnet",{}))},i=function(a,b,c){a.carousel(0);b.setFooter(c.customfootertemplate)};return{footerClickListener:function footerClickListener(a,c,d){if(a.target.matches(b.action.showMoodleNet)||a.target.closest(b.action.showMoodleNet)){a.preventDefault();var e=f(d.getBody()[0].querySelector(b.region.carousel)),g=e.find(b.region.moodleNet)[0];h(g,c,e,d)}if(a.target.matches(b.action.closeOption)){var j=f(d.getBody()[0].querySelector(b.region.carousel));i(j,d,c)}}}});
define ("tool_moodlenet/selectors",[],function(){return{action:{browse:"[data-action=\"browse\"]",submit:"[data-action=\"submit\"]",showMoodleNet:"[data-action=\"show-moodlenet\"]",closeOption:"[data-action=\"close-chooser-option-summary\"]"},region:{clearIcon:"[data-region=\"clear-icon\"]",courses:"[data-region=\"mnet-courses\"]",instancePage:"[data-region=\"moodle-net\"]",searchInput:"[data-region=\"search-input\"]",searchIcon:"[data-region=\"search-icon\"]",selectPage:"[data-region=\"moodle-net-select\"]",spinner:"[data-region=\"spinner\"]",validationArea:"[data-region=\"validation-area\"]",carousel:"[data-region=\"carousel\"]",moodleNet:"[data-region=\"pluginCarousel\"]"}}});
define ("tool_moodlenet/validator",["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){return{validation:function(e){var f=e.value;if(""===f||!f.includes("@")){a.when(c.get_string("profilevalidationerror","tool_moodlenet")).then(function(a){return Promise.reject().catch(function(){return{result:!1,message:a[0]}})}).fail(d.exception)}return b.call([{methodname:"tool_moodlenet_verify_webfinger",args:{profileurl:f,course:e.dataset.courseid,section:e.dataset.sectionid}}])[0].then(function(a){return a}).catch()}}});
define ("tool_policy/acceptances_filter_datasource",["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function list(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){if(""!==c.trim()&&-1===e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())){return!0}if(-1<a.inArray(e.value,g)){return!0}d.push(e);return!0});var h=new a.Deferred;h.resolve(d);return h.promise()},processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.value,label:b.label})});return d},transport:function transport(a,b,d){this.list(a,b).then(d).catch(c.exception)}}});
define ("tool_policy/acceptmodal",["jquery","core/str","core/modal_factory","core/modal_events","core/notification","core/fragment","core/ajax","core/yui"],function(a,b,c,d,f,g,h,i){"use strict";var e=function(a){this.contextid=a;this.init()};e.prototype.modal=null;e.prototype.contextid=-1;e.prototype.currentTrigger=null;e.prototype.triggers={SINGLE:"a[data-action=acceptmodal]",BULK:"input[data-action=acceptmodal]"};e.prototype.init=function(){a(this.triggers.SINGLE).on("click",function(b){b.preventDefault();this.currentTrigger=a(b.currentTarget);var c=a(b.currentTarget).attr("href"),d=c.slice(c.indexOf("?")+1);this.showFormModal(d)}.bind(this));a(this.triggers.BULK).on("click",function(c){c.preventDefault();this.currentTrigger=a(c.currentTarget);var d=a(c.currentTarget).closest("form");if(d.find("input[type=checkbox][name=\"userids[]\"]:checked").length){var e=d.serialize();this.showFormModal(e)}else{b.get_strings([{key:"notice"},{key:"selectusersforconsent",component:"tool_policy"},{key:"ok"}]).then(function(a){f.alert(a[0],a[1],a[2])}).fail(f.exception)}}.bind(this))};e.prototype.showFormModal=function(a){for(var d,e=a.split("&"),g=0,h;g<e.length;g++){h=e[g].split("=");if("action"==h[0]){d=h[1]}}b.get_strings([{key:"statusformtitleaccept",component:"tool_policy"},{key:"iagreetothepolicy",component:"tool_policy"},{key:"statusformtitlerevoke",component:"tool_policy"},{key:"irevokethepolicy",component:"tool_policy"},{key:"statusformtitledecline",component:"tool_policy"},{key:"declinethepolicy",component:"tool_policy"}]).then(function(b){var e,f;if("accept"==d){e=b[0];f=b[1]}else if("revoke"==d){e=b[2];f=b[3]}else if("decline"==d){e=b[4];f=b[5]}return c.create({type:c.types.SAVE_CANCEL,title:e,body:""}).done(function(b){this.modal=b;this.setupFormModal(a,f)}.bind(this))}.bind(this)).catch(f.exception)};e.prototype.setupFormModal=function(a,b){var c=this.modal;c.setLarge();c.setSaveButtonText(b);c.getRoot().on(d.hidden,this.destroy.bind(this));c.setBody(this.getBody(a));c.getRoot().on(d.save,this.submitForm.bind(this));c.getRoot().on("submit","form",this.submitFormAjax.bind(this));c.show()};e.prototype.getBody=function(a){if("undefined"==typeof a){a={}}var b={jsonformdata:JSON.stringify(a)};return g.loadFragment("tool_policy","accept_on_behalf",this.contextid,b)};e.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize(),c=h.call([{methodname:"tool_policy_submit_accept_on_behalf",args:{jsonformdata:JSON.stringify(b)}}]);c[0].done(function(a){if(a.validationerrors){this.modal.setBody(this.getBody(b))}else{this.close()}}.bind(this)).fail(f.exception)};e.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};e.prototype.close=function(){this.destroy();document.location.reload()};e.prototype.destroy=function(){i.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});this.modal.destroy();this.currentTrigger.focus()};return{getInstance:function getInstance(a){return new e(a)}}});
define ("tool_policy/policyactions",["jquery","core/ajax","core/notification","core/modal_factory","core/modal_events"],function(a,b,c,d,e){var f=function(a){this.registerEvents(a)};f.prototype.registerEvents=function(f){f.on("click",function(f){f.preventDefault();var g=a(this).data("versionid"),h=a(this).data("behalfid"),i=a.Deferred(),j=a.Deferred(),k=d.create({title:i,body:j,large:!0}).then(function(a){a.getRoot().on(e.hidden,function(){a.destroy()});return a}).then(function(a){a.show();return a}).catch(c.exception),l=b.call([{methodname:"tool_policy_get_policy_version",args:{versionid:g,behalfid:h}}]);a.when(l[0]).then(function(a){if(a.result.policy){i.resolve(a.result.policy.name);j.resolve(a.result.policy.content);return a}else{throw new Error(a.warnings[0].message)}}).catch(function(a){k.then(function(a){a.hide();a.destroy();return a}).catch(c.exception);return c.addNotification({message:a,type:"error"})})})};return{init:function init(b){b=a(b);return new f(b)}}});
define ("tool_policy/managedocsactions",["jquery","core/log","core/config","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){"use strict";var h={LINKS:"[data-action]",MAKE_CURRENT:"[data-action=\"makecurrent\"]",INACTIVATE:"[data-action=\"inactivate\"]",DELETE:"[data-action=\"delete\"]"};function g(a){this.base=a;this.initEvents()}g.prototype.initEvents=function(){var g=this;g.base.on("click",h.LINKS,function(g){g.stopPropagation();var i=a(g.currentTarget),j,k;if(i.is(h.MAKE_CURRENT)){j=d.get_strings([{key:"activating",component:"tool_policy"},{key:"activateconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"activateconfirmyes",component:"tool_policy"}])}else if(i.is(h.INACTIVATE)){j=d.get_strings([{key:"inactivating",component:"tool_policy"},{key:"inactivatingconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"inactivatingconfirmyes",component:"tool_policy"}])}else if(i.is(h.DELETE)){j=d.get_strings([{key:"deleting",component:"tool_policy"},{key:"deleteconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"delete",component:"core"}])}else{b.error("unknown action type detected","tool_policy/managedocsactions");return}g.preventDefault();j.then(function(a){k=a;return e.create({title:k[0],body:k[1],type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(k[2]);a.getRoot().on(f.save,function(){window.location.href=i.attr("href")+"&sesskey="+c.sesskey+"&confirm=1"});a.getRoot().on(f.hidden,function(){a.destroy()});a.show();return!0}).catch(function(a){b.error(a);return!1})})};return{init:function init(b){var c=a(document.getElementById(b));if(c.length){return new g(c)}else{throw new Error("managedocsactions: Invalid base element identifier")}}}});
define ("tool_policy/jquery-eu-cookie-law-popup",["jquery"],function(a){if(!window.console)window.console={};if(!window.console.log)window.console.log=function(){};a.fn.euCookieLawPopup=function(){var b=this;b.params={cookiePolicyUrl:"/?cookie-policy",popupPosition:"top",colorStyle:"default",compactStyle:!1,popupTitle:"This website is using cookies",popupText:"We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on this website.",buttonContinueTitle:"Continue",buttonLearnmoreTitle:"Learn&nbsp;more",buttonLearnmoreOpenInNewWindow:!0,agreementExpiresInDays:30,autoAcceptCookiePolicy:!1,htmlMarkup:null};b.vars={INITIALISED:!1,HTML_MARKUP:null,COOKIE_NAME:"EU_COOKIE_LAW_CONSENT"};var c=function(c,d,e){if(c){var f=a(c).attr("class")?a(c).attr("class"):"";if(-1<f.indexOf("eupopup-top")){b.params.popupPosition="top"}else if(-1<f.indexOf("eupopup-fixedtop")){b.params.popupPosition="fixedtop"}else if(-1<f.indexOf("eupopup-bottomright")){b.params.popupPosition="bottomright"}else if(-1<f.indexOf("eupopup-bottomleft")){b.params.popupPosition="bottomleft"}else if(-1<f.indexOf("eupopup-bottom")){b.params.popupPosition="bottom"}else if(-1<f.indexOf("eupopup-block")){b.params.popupPosition="block"}if(-1<f.indexOf("eupopup-color-default")){b.params.colorStyle="default"}else if(-1<f.indexOf("eupopup-color-inverse")){b.params.colorStyle="inverse"}if(-1<f.indexOf("eupopup-style-compact")){b.params.compactStyle=!0}}if(d){b.params.htmlMarkup=d}if(e){if("undefined"!=typeof e.cookiePolicyUrl){b.params.cookiePolicyUrl=e.cookiePolicyUrl}if("undefined"!=typeof e.popupPosition){b.params.popupPosition=e.popupPosition}if("undefined"!=typeof e.colorStyle){b.params.colorStyle=e.colorStyle}if("undefined"!=typeof e.popupTitle){b.params.popupTitle=e.popupTitle}if("undefined"!=typeof e.popupText){b.params.popupText=e.popupText}if("undefined"!=typeof e.buttonContinueTitle){b.params.buttonContinueTitle=e.buttonContinueTitle}if("undefined"!=typeof e.buttonLearnmoreTitle){b.params.buttonLearnmoreTitle=e.buttonLearnmoreTitle}if("undefined"!=typeof e.buttonLearnmoreOpenInNewWindow){b.params.buttonLearnmoreOpenInNewWindow=e.buttonLearnmoreOpenInNewWindow}if("undefined"!=typeof e.agreementExpiresInDays){b.params.agreementExpiresInDays=e.agreementExpiresInDays}if("undefined"!=typeof e.autoAcceptCookiePolicy){b.params.autoAcceptCookiePolicy=e.autoAcceptCookiePolicy}if("undefined"!=typeof e.htmlMarkup){b.params.htmlMarkup=e.htmlMarkup}}},d=function(){if(b.params.htmlMarkup){return b.params.htmlMarkup}var a="<div class=\"eupopup-container eupopup-container-"+b.params.popupPosition+(b.params.compactStyle?" eupopup-style-compact":"")+" eupopup-color-"+b.params.colorStyle+"\"><div class=\"eupopup-head\">"+b.params.popupTitle+"</div><div class=\"eupopup-body\">"+b.params.popupText+"</div><div class=\"eupopup-buttons\"><a href=\"#\" class=\"eupopup-button eupopup-button_1\">"+b.params.buttonContinueTitle+"</a><a href=\""+b.params.cookiePolicyUrl+"\""+(b.params.buttonLearnmoreOpenInNewWindow?" target=_blank ":"")+" class=\"eupopup-button eupopup-button_2\">"+b.params.buttonLearnmoreTitle+"</a><div class=\"clearfix\"></div></div><a href=\"#\" class=\"eupopup-closebutton\">x</a></div>";return a},e=function(c){var e=new Date,d=1e3*(60*(60*(24*b.params.agreementExpiresInDays)));e.setTime(e.getTime()+d);var f="expires="+e.toGMTString();document.cookie=b.vars.COOKIE_NAME+"="+c+"; "+f+";path=/";a(document).trigger("user_cookie_consent_changed",{consent:c})},f=function(){for(var a=!1,d=document.cookie.split(";"),e=0,f;e<d.length;e++){f=d[e].trim();if(-1!==f.indexOf(b.vars.COOKIE_NAME)){a=f.substring(b.vars.COOKIE_NAME.length+1,f.length)}}return a},g=function(){a(".eupopup-container").animate({opacity:0,height:0},200,function(){a(".eupopup-container").hide(0)})};return{init:function init(h){c(a(".eupopup").first(),a(".eupopup-markup").html(),h);if(f()){a(document).trigger("user_cookie_already_accepted",{consent:!0});return}if(b.vars.INITIALISED){return}b.vars.INITIALISED=!0;b.vars.HTML_MARKUP=d();if(0<a(".eupopup-block").length){a(".eupopup-block").append(b.vars.HTML_MARKUP)}else{a("BODY").append(b.vars.HTML_MARKUP)}a(".eupopup-button_1").click(function(){e(!0);g();return!1});a(".eupopup-closebutton").click(function(){e(!0);g();return!1});a(".eupopup-container").show();if(b.params.autoAcceptCookiePolicy){e(!0)}}}}});
define ("tool_policy/acceptances_filter",["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={UNIFIED_FILTERS:"#unified-filters"},f=function init(){M.util.js_pending("acceptances_filter_datasource");c.get_strings([{key:"filterplaceholder",component:"tool_policy"},{key:"nofiltersapplied",component:"tool_policy"}]).done(function(a){var c=a[0],f=a[1];b.enhance(e.UNIFIED_FILTERS,!0,"tool_policy/acceptances_filter_datasource",c,!1,!0,f,!0).then(function(){M.util.js_complete("acceptances_filter_datasource")}).fail(d.exception)}).fail(d.exception);var f=a(e.UNIFIED_FILTERS).val();a(e.UNIFIED_FILTERS).on("change",function(){var b=a(this).val(),c=[],d=[],e=!1;a.each(b,function(a,b){var f=b.split(":",2);if(2!==f.length){d.push(b);return!0}var g=f[0],h=f[1];if("undefined"!=typeof c[g]){e=!0}c[g]=h;return!0});if(e){var g=[];for(var h in c){g.push(h+":"+c[h])}g=g.concat(d);a(this).val(g)}if(f.join(",")!=b.join(",")){this.form.submit()}})},g=function getForm(){return a(e.UNIFIED_FILTERS).closest("form")};return{init:function init(){f()},getForm:function getForm(){return g()}}});
define ("tool_templatelibrary/search",["jquery","core/ajax","core/log","core/notification","core/templates","core/config"],function(a,b,c,d,e,f){var g=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a("[data-region=\"searchresults\"]"),b,c)}).fail(d.exception)},h=function(c){var e=a("[data-field=\"component\"]").val(),f=a("[data-region=\"list-templates\"] [data-region=\"input\"]").val();if(""!==f){a("[data-region=\"list-templates\"] [data-action=\"clearsearch\"]").removeClass("d-none")}else{a("[data-region=\"list-templates\"] [data-action=\"clearsearch\"]").addClass("d-none")}b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:e,search:f,themename:c},done:g,fail:d.exception}],!0,!1)},i=null,j=function(a,b){if(null!==i){window.clearTimeout(i)}i=window.setTimeout(function(){a();i=null},b)},k=function(){j(h.bind(this,f.theme),400)};a("[data-region=\"list-templates\"]").on("change","[data-field=\"component\"]",k);a("[data-region=\"list-templates\"]").on("input","[data-region=\"input\"]",k);a("[data-action=\"clearsearch\"]").on("click",function(){a("[data-region=\"input\"]").val("");h(f.theme);a(this).addClass("d-none")});h(f.theme);return{}});
define ("tool_templatelibrary/display",["jquery","core/ajax","core/log","core/notification","core/templates","core/config","core/str"],function(a,b,c,d,e,f,g){var h=function(a,b){if(!a){return!1}var c="@template "+b,d=0,e=[];e=a.match(/{{!([\s\S]*?)}}/g);if(null!==e){for(d=0;d<e.length;d++){var f=e[d],g=f.indexOf(c);if(-1!==g){var h=g+c.length+1;f=f.substr(h,f.length-2-h);return f}}}return!1},i=function(b,f,i){g.get_string("templateselected","tool_templatelibrary",b).done(function(b){a("[data-region=\"displaytemplateheader\"]").text(b)}).fail(d.exception);var j=h(f,b);if(!1===j){j=h(i,b)}if(j){f=j}a("[data-region=\"displaytemplatesource\"]").text(f);var k=f.match(/Example context \(json\):([\s\S]*)/),l=!1;if(k){var m=k[1].trim();try{l=a.parseJSON(m)}catch(a){c.debug("Could not parse json example context for template.");c.debug(a)}}if(l){e.render(b,l).done(function(b,c){e.replaceNodeContents(a("[data-region=\"displaytemplateexample\"]"),b,c)}).fail(d.exception)}else{g.get_string("templatehasnoexample","tool_templatelibrary").done(function(b){a("[data-region=\"displaytemplateexample\"]").text(b)}).fail(d.exception)}},j=function(c){var e=c.split("/"),g=e.shift(),h=e.join("/"),j=b.call([{methodname:"core_output_load_template",args:{component:g,template:h,themename:f.theme,includecomments:!0}},{methodname:"tool_templatelibrary_load_canonical_template",args:{component:g,template:h}}],!0,!1);a.when.apply(a,j).done(function(a,b){i(c,a,b)}).fail(d.exception)};a("[data-region=\"list-templates\"]").on("click","[data-templatename]",function(b){var c=a(this).data("templatename");b.preventDefault();j(c)});return{}});
define ("tool_usertours/filter_cssselector",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.filterMatches=void 0;a.filterMatches=function filterMatches(a){var b=a.filtervalues.cssselector;if(b[0]){return!!document.querySelector(b[0])}return!0}});
define ("tool_usertours/usertours",["core/ajax","tool_usertours/tour","jquery","core/templates","core/str","core/log","core/notification"],function(a,b,c,d,e,f,g){var h={tourId:null,currentTour:null,init:function init(a,b){for(var d=[],e=0;e<b.length;e++){d[e]="tool_usertours/filter_"+b[e]}require(d,function(){var d=null;for(var k in a){for(var e=a[k],f=0,g;f<b.length;f++){g=arguments[f];if(g.filterMatches(e)){d=e}else{d=null;break}}if(d){break}}if(null===d){return}h.tourId=d.tourId;var j=d.startTour;if("undefined"==typeof j){j=!0}if(j){h.fetchTour(h.tourId)}h.addResetLink();c("body").on("click","[data-action=\"tool_usertours/resetpagetour\"]",function(a){a.preventDefault();h.resetTourState(h.tourId)})})},fetchTour:function fetchTour(b){M.util.js_pending("admin_usertour_fetchTour"+b);c.when(a.call([{methodname:"tool_usertours_fetch_and_start_tour",args:{tourid:b,context:M.cfg.contextid,pageurl:window.location.href}}])[0],d.render("tool_usertours/tourstep",{})).then(function(a,c){if(!a.hasOwnProperty("tourconfig")){return}return h.startBootstrapTour(b,c[0],a.tourconfig)}).always(function(){M.util.js_complete("admin_usertour_fetchTour"+b)}).fail(g.exception)},addResetLink:function addResetLink(){var a;M.util.js_pending("admin_usertour_addResetLink");if(c(".tool_usertours-resettourcontainer").length){a=c(".tool_usertours-resettourcontainer")}else if(c(".logininfo").length){a=c(".logininfo")}else if(c("footer").length){a=c("footer")}else{a=c("body")}d.render("tool_usertours/resettour",{}).then(function(b,c){d.appendNodeContents(a,b,c)}).always(function(){M.util.js_complete("admin_usertour_addResetLink")}).fail()},startBootstrapTour:function startBootstrapTour(a,c,d){if(h.currentTour){d.onEnd=null;h.currentTour.endTour();delete h.currentTour}d.eventHandlers={afterEnd:[h.markTourComplete],afterRender:[h.markStepShown]};d.tourName=d.name;delete d.name;d.template=c;d.steps=d.steps.map(function(a){if("undefined"!=typeof a.element){a.target=a.element;delete a.element}if("undefined"!=typeof a.reflex){a.moveOnClick=!!a.reflex;delete a.reflex}if("undefined"!=typeof a.content){a.body=a.content;delete a.content}return a});h.currentTour=new b(d);return h.currentTour.startTour()},markStepShown:function markStepShown(){var b=this.getStepConfig(this.getCurrentStepNumber());c.when(a.call([{methodname:"tool_usertours_step_shown",args:{tourid:h.tourId,context:M.cfg.contextid,pageurl:window.location.href,stepid:b.stepid,stepindex:this.getCurrentStepNumber()}}])[0]).fail(f.error)},markTourComplete:function markTourComplete(){var b=this.getStepConfig(this.getCurrentStepNumber());c.when(a.call([{methodname:"tool_usertours_complete_tour",args:{tourid:h.tourId,context:M.cfg.contextid,pageurl:window.location.href,stepid:b.stepid,stepindex:this.getCurrentStepNumber()}}])[0]).fail(f.error)},resetTourState:function resetTourState(b){c.when(a.call([{methodname:"tool_usertours_reset_tour",args:{tourid:b,context:M.cfg.contextid,pageurl:window.location.href}}])[0]).then(function(a){if(a.startTour){h.fetchTour(a.startTour)}}).fail(g.exception)}};return{init:h.init,resetTourState:h.resetTourState}});
define ("tool_usertours/managesteps",["jquery","core/str","core/notification"],function(a,b,c){var d={removeStep:function removeStep(d){d.preventDefault();var e=a(d.currentTarget).attr("href");b.get_strings([{key:"confirmstepremovaltitle",component:"tool_usertours"},{key:"confirmstepremovalquestion",component:"tool_usertours"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).then(function(a){c.confirm(a[0],a[1],a[2],a[3],function(){window.location=e})}).catch()},setup:function setup(){a("body").delegate("[data-action=\"delete\"]","click",d.removeStep)}};return{setup:d.setup}});
define ("tool_usertours/managetours",["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={removeTour:function removeTour(b){b.preventDefault();var e=a(b.currentTarget).attr("href");c.get_strings([{key:"confirmtourremovaltitle",component:"tool_usertours"},{key:"confirmtourremovalquestion",component:"tool_usertours"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).then(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){window.location=e})}).catch()},setup:function setup(){a("body").delegate("[data-action=\"delete\"]","click",e.removeTour)}};return{setup:e.setup}});
define ("tool_usertours/tour",["exports","jquery","core/aria","core/popper"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=g(b);c=f(c);d=g(d);function e(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;e=function(){return a};return a}function f(a){if(a&&a.__esModule){return a}if(null===a||"object"!==h(a)&&"function"!=typeof a){return{default:a}}var b=e();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if(Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;if(g&&(g.get||g.set)){Object.defineProperty(c,f,g)}else{c[f]=a[f]}}}c.default=a;if(b){b.set(a,c)}return c}function g(a){return a&&a.__esModule?a:{default:a}}function h(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){h=function(a){return typeof a}}else{h=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return h(a)}function i(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function j(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function k(a,b,c){if(b)j(a.prototype,b);if(c)j(a,c);return a}var l=function(){function a(b){i(this,a);this.init(b)}k(a,[{key:"init",value:function init(a){this.eventHandlers={};this.reset();this.originalConfiguration=a||{};this.configure.apply(this,arguments);try{this.storage=window.sessionStorage;this.storageKey="tourstate_"+this.tourName}catch(a){this.storage=!1;this.storageKey=""}return this}},{key:"reset",value:function reset(){this.hide();this.eventHandlers=[];this.resetStepListeners();this.originalConfiguration={};this.steps=[];this.currentStepNumber=0;return this}},{key:"configure",value:function configure(a){var b=this;if("object"===h(a)){if("undefined"!=typeof a.tourName){this.tourName=a.tourName}if(a.eventHandlers){var c=function(c){a.eventHandlers[c].forEach(function(a){this.addEventHandler(c,a)},b)};for(var d in a.eventHandlers){c(d)}}this.resetStepDefaults(!0);if("object"===h(a.steps)){this.steps=a.steps}if("undefined"!=typeof a.template){this.templateContent=a.template}}this.checkMinimumRequirements();return this}},{key:"checkMinimumRequirements",value:function checkMinimumRequirements(){if(!this.tourName){throw new Error("Tour Name required")}if(!this.steps||!this.steps.length){throw new Error("Steps must be specified")}}},{key:"resetStepDefaults",value:function resetStepDefaults(a){if("undefined"==typeof a){a=!0}this.stepDefaults={};if(!a||"undefined"==typeof this.originalConfiguration.stepDefaults){this.setStepDefaults({})}else{this.setStepDefaults(this.originalConfiguration.stepDefaults)}return this}},{key:"setStepDefaults",value:function setStepDefaults(a){if(!this.stepDefaults){this.stepDefaults={}}b.default.extend(this.stepDefaults,{element:"",placement:"top",delay:0,moveOnClick:!1,moveAfterTime:0,orphan:!1,direction:1},a);return this}},{key:"getCurrentStepNumber",value:function getCurrentStepNumber(){return parseInt(this.currentStepNumber,10)}},{key:"setCurrentStepNumber",value:function setCurrentStepNumber(a){this.currentStepNumber=a;if(this.storage){try{this.storage.setItem(this.storageKey,a)}catch(a){if(a.code===DOMException.QUOTA_EXCEEDED_ERR){this.storage.removeItem(this.storageKey)}}}}},{key:"getNextStepNumber",value:function getNextStepNumber(a){if("undefined"==typeof a){a=this.getCurrentStepNumber()}var b=a+1;while(b<=this.steps.length){if(this.isStepPotentiallyVisible(this.getStepConfig(b))){return b}b++}return null}},{key:"getPreviousStepNumber",value:function getPreviousStepNumber(a){if("undefined"==typeof a){a=this.getCurrentStepNumber()}var b=a-1;while(0<=b){if(this.isStepPotentiallyVisible(this.getStepConfig(b))){return b}b--}return null}},{key:"isLastStep",value:function isLastStep(a){var b=this.getNextStepNumber(a);return null===b}},{key:"isFirstStep",value:function isFirstStep(a){var b=this.getPreviousStepNumber(a);return null===b}},{key:"isStepPotentiallyVisible",value:function isStepPotentiallyVisible(a){if(!a){return!1}if(this.isStepActuallyVisible(a)){return!0}if("undefined"!=typeof a.orphan&&a.orphan){return!0}if("undefined"!=typeof a.delay&&a.delay){return!0}return!1}},{key:"isStepActuallyVisible",value:function isStepActuallyVisible(a){if(!a){return!1}var b=this.getStepTarget(a);if(b&&b.length&&b.is(":visible")){return!!b.length}return!1}},{key:"next",value:function next(){return this.gotoStep(this.getNextStepNumber())}},{key:"previous",value:function previous(){return this.gotoStep(this.getPreviousStepNumber(),-1)}},{key:"gotoStep",value:function gotoStep(a,b){if(0>a){return this.endTour()}var c=this.getStepConfig(a);if(null===c){return this.endTour()}return this._gotoStep(c,b)}},{key:"_gotoStep",value:function _gotoStep(a,b){if(!a){return this.endTour()}if("undefined"!=typeof a.delay&&a.delay&&!a.delayed){a.delayed=!0;window.setTimeout(this._gotoStep.bind(this),a.delay,a,b);return this}else if(!a.orphan&&!this.isStepActuallyVisible(a)){var c=-1==b?"getPreviousStepNumber":"getNextStepNumber";return this.gotoStep(this[c](a.stepNumber),b)}this.hide();this.fireEventHandlers("beforeRender",a);this.renderStep(a);this.fireEventHandlers("afterRender",a);return this}},{key:"getStepConfig",value:function getStepConfig(a){if(null===a||0>a||a>=this.steps.length){return null}var c=this.normalizeStepConfig(this.steps[a]);c=b.default.extend(c,{stepNumber:a});return c}},{key:"normalizeStepConfig",value:function normalizeStepConfig(a){if("undefined"!=typeof a.reflex&&"undefined"==typeof a.moveAfterClick){a.moveAfterClick=a.reflex}if("undefined"!=typeof a.element&&"undefined"==typeof a.target){a.target=a.element}if("undefined"!=typeof a.content&&"undefined"==typeof a.body){a.body=a.content}a=b.default.extend({},this.stepDefaults,a);a=b.default.extend({},{attachTo:a.target,attachPoint:"after"},a);if(a.attachTo){a.attachTo=(0,b.default)(a.attachTo).first()}return a}},{key:"getStepTarget",value:function getStepTarget(a){if(a.target){return(0,b.default)(a.target)}return null}},{key:"fireEventHandlers",value:function fireEventHandlers(a,b){if("undefined"==typeof this.eventHandlers[a]){return this}this.eventHandlers[a].forEach(function(a){a.call(this,b)},this);return this}},{key:"addEventHandler",value:function addEventHandler(a,b){if("undefined"==typeof this.eventHandlers[a]){this.eventHandlers[a]=[]}this.eventHandlers[a].push(b);return this}},{key:"processStepListeners",value:function processStepListeners(a){this.listeners.push({node:this.currentStepNode,args:["click","[data-role=\"next\"]",b.default.proxy(this.next,this)]},{node:this.currentStepNode,args:["click","[data-role=\"previous\"]",b.default.proxy(this.previous,this)]},{node:this.currentStepNode,args:["click","[data-role=\"end\"]",b.default.proxy(this.endTour,this)]},{node:(0,b.default)("[data-flexitour=\"backdrop\"]"),args:["click",b.default.proxy(this.hide,this)]},{node:(0,b.default)("body"),args:["keydown",b.default.proxy(this.handleKeyDown,this)]});if(a.moveOnClick){var c=this.getStepTarget(a);this.listeners.push({node:c,args:["click",b.default.proxy(function(a){if(0===(0,b.default)(a.target).parents("[data-flexitour=\"container\"]").length){window.setTimeout(b.default.proxy(this.next,this),500)}},this)]})}this.listeners.forEach(function(a){a.node.on.apply(a.node,a.args)});return this}},{key:"resetStepListeners",value:function resetStepListeners(){if(this.listeners){this.listeners.forEach(function(a){a.node.off.apply(a.node,a.args)})}this.listeners=[];return this}},{key:"renderStep",value:function renderStep(a){this.currentStepConfig=a;this.setCurrentStepNumber(a.stepNumber);var c=(0,b.default)(this.getTemplateContent());c.find("[data-placeholder=\"title\"]").html(a.title);c.find("[data-placeholder=\"body\"]").html(a.body);if(this.isFirstStep(a.stepNumber)){c.find("[data-role=\"previous\"]").hide()}else{c.find("[data-role=\"previous\"]").prop("disabled",!1)}if(this.isLastStep(a.stepNumber)){c.find("[data-role=\"next\"]").hide();c.find("[data-role=\"end\"]").removeClass("btn-secondary").addClass("btn-primary")}else{c.find("[data-role=\"next\"]").prop("disabled",!1)}c.find("[data-role=\"previous\"]").attr("role","button");c.find("[data-role=\"next\"]").attr("role","button");c.find("[data-role=\"end\"]").attr("role","button");a.template=c;this.addStepToPage(a);this.processStepListeners(a);return this}},{key:"getTemplateContent",value:function getTemplateContent(){return(0,b.default)(this.templateContent).clone()}},{key:"addStepToPage",value:function addStepToPage(a){var c=(0,b.default)("<span data-flexitour=\"container\"></span>").html(a.template).hide(),e=(0,b.default)("body, html").stop(!0,!0);if(this.isStepActuallyVisible(a)){var f=this.getStepTarget(a);f.data("flexitour","target");var g=this.calculateZIndex(f);if(g){a.zIndex=g+1}if(a.zIndex){c.css("zIndex",a.zIndex+1)}this.positionBackdrop(a);(0,b.default)(document.body).append(c);this.currentStepNode=c;this.currentStepNode.css({top:0,left:0});e.animate({scrollTop:this.calculateScrollTop(a)}).promise().then(function(){this.positionStep(a);this.revealStep(a)}.bind(this)).catch(function(){})}else if(a.orphan){a.isOrphan=!0;a.attachTo=(0,b.default)("body").first();a.attachPoint="append";this.positionBackdrop(a);c.addClass("orphan");(0,b.default)(document.body).append(c);this.currentStepNode=c;this.currentStepNode.offset(this.calculateStepPositionInPage());this.currentStepNode.css("position","fixed");this.currentStepPopper=new d.default((0,b.default)("body"),this.currentStepNode[0],{removeOnDestroy:!0,placement:a.placement+"-start",arrowElement:"[data-role=\"arrow\"]",modifiers:{hide:{enabled:!1},applyStyle:{onLoad:null,enabled:!1}}});this.revealStep(a)}return this}},{key:"revealStep",value:function revealStep(a){this.currentStepNode.fadeIn("",b.default.proxy(function(){this.announceStep(a);this.currentStepNode.focus();window.setTimeout(b.default.proxy(function(){if(this.currentStepNode){this.currentStepNode.focus()}},this),100)},this));return this}},{key:"announceStep",value:function announceStep(a){var b="tour-step-"+this.tourName+"-"+a.stepNumber;this.currentStepNode.attr("id",b);var c=this.currentStepNode.find("[data-placeholder=\"body\"]").first();c.attr("id",b+"-body");c.attr("role","document");var d=this.currentStepNode.find("[data-placeholder=\"title\"]").first();d.attr("id",b+"-title");d.attr("aria-labelledby",b+"-body");this.currentStepNode.attr("role","dialog");this.currentStepNode.attr("tabindex",0);this.currentStepNode.attr("aria-labelledby",b+"-title");this.currentStepNode.attr("aria-describedby",b+"-body");var e=this.getStepTarget(a);if(e){if(!e.attr("tabindex")){e.attr("tabindex",0)}e.data("original-describedby",e.attr("aria-describedby")).attr("aria-describedby",b+"-body")}this.accessibilityShow(a);return this}},{key:"handleKeyDown",value:function handleKeyDown(a){var c="a[href], link[href], [draggable=true], [contenteditable=true], ";c+=":input:enabled, [tabindex], button:enabled";switch(a.keyCode){case 27:this.endTour();break;case 9:(function(){if(!this.currentStepConfig.hasBackdrop){return}var d=(0,b.default)(document.activeElement),e=this.getStepTarget(this.currentStepConfig),f=(0,b.default)(c),g=(0,b.default)("span[data-flexitour=\"container\"]"),h;if(e){f=f.filter(function(a,b){return null!==e&&(e.has(b).length||g.has(b).length||e.is(b)||g.is(b))})}f.each(function(a,b){if(d.is(b)){h=a;return!1}return!0});var i,j,k;if(void 0!=h){var l=1;if(a.shiftKey){l=-1}i=h;do{i+=l;j=(0,b.default)(f[i])}while(j.length&&j.is(":disabled")||j.is(":hidden"));if(j.length){k=j.closest(e).length;k=k||j.closest(this.currentStepNode).length}else{k=!1}}if(k){j.focus()}else{if(a.shiftKey){this.currentStepNode.find(c).last().focus()}else{if(this.currentStepConfig.isOrphan){this.currentStepNode.focus()}else{e.focus()}}}a.preventDefault()}).call(this);break;}}},{key:"startTour",value:function startTour(a){if(this.storage&&"undefined"==typeof a){var b=this.storage.getItem(this.storageKey);if(b){var c=parseInt(b,10);if(c<=this.steps.length){a=c}}}if("undefined"==typeof a){a=this.getCurrentStepNumber()}this.fireEventHandlers("beforeStart",a);this.gotoStep(a);this.fireEventHandlers("afterStart",a);return this}},{key:"restartTour",value:function restartTour(){return this.startTour(0)}},{key:"endTour",value:function endTour(){this.fireEventHandlers("beforeEnd");if(this.currentStepConfig){var a=this.getStepTarget(this.currentStepConfig);if(a){if(!a.attr("tabindex")){a.attr("tabindex","-1")}a.focus()}}this.hide(!0);this.fireEventHandlers("afterEnd");return this}},{key:"hide",value:function hide(a){this.fireEventHandlers("beforeHide");if(this.currentStepNode&&this.currentStepNode.length){this.currentStepNode.hide();if(this.currentStepPopper){this.currentStepPopper.destroy()}}if(this.currentStepConfig){var d=this.getStepTarget(this.currentStepConfig);if(d){if(d.data("original-labelledby")){d.attr("aria-labelledby",d.data("original-labelledby"))}if(d.data("original-describedby")){d.attr("aria-describedby",d.data("original-describedby"))}if(d.data("original-tabindex")){d.attr("tabindex",d.data("tabindex"))}}this.currentStepConfig=null}var c=0;if(a){c=400}(0,b.default)("[data-flexitour=\"step-background\"]").remove();(0,b.default)("[data-flexitour=\"step-backdrop\"]").removeAttr("data-flexitour");(0,b.default)("[data-flexitour=\"backdrop\"]").fadeOut(c,function(){(0,b.default)(this).remove()});if(this.currentStepNode&&this.currentStepNode.length){var e=this.currentStepNode.attr("id");if(e){var f="[aria-describedby=\""+e+"-body\"]";(0,b.default)(f).removeAttr("tabindex");(0,b.default)(f).removeAttr("aria-describedby")}}this.resetStepListeners();this.accessibilityHide();this.fireEventHandlers("afterHide");this.currentStepNode=null;this.currentStepPopper=null;return this}},{key:"show",value:function show(){var a=this.getCurrentStepNumber();return this.gotoStep(a)}},{key:"getStepContainer",value:function getStepContainer(){return(0,b.default)(this.currentStepNode)}},{key:"calculateScrollTop",value:function calculateScrollTop(a){var c=(0,b.default)(window).scrollTop(),d=(0,b.default)(window).height(),e=this.getStepTarget(a);if("top"===a.placement){c=e.offset().top-d/2}else if("bottom"===a.placement){c=e.offset().top+e.height()-d/2}else if(e.height()<=.8*d){c=e.offset().top-(d-e.height())/2}else{c=e.offset().top-.2*d}c=Math.max(0,c);c=Math.min((0,b.default)(document).height()-d,c);return Math.ceil(c)}},{key:"calculateStepPositionInPage",value:function calculateStepPositionInPage(){var a=(0,b.default)(window).height(),c=this.currentStepNode.height(),d=(0,b.default)(window).width(),e=this.currentStepNode.width();return{top:Math.ceil((a-c)/2),left:Math.ceil((d-e)/2)}}},{key:"positionStep",value:function positionStep(a){var c=this.currentStepNode;if(!c||!c.length){return this}a.placement=this.recalculatePlacement(a);var e;switch(a.placement){case"left":e=["left","right","top","bottom"];break;case"right":e=["right","left","top","bottom"];break;case"top":e=["top","bottom","right","left"];break;case"bottom":e=["bottom","top","right","left"];break;default:e="flip";break;}var f=this.getStepTarget(a),g={placement:a.placement+"-start",removeOnDestroy:!0,modifiers:{flip:{behaviour:e},arrow:{element:"[data-role=\"arrow\"]"}},onCreate:function onCreate(a){h(a)},onUpdate:function onUpdate(a){h(a)}},h=function(a){var c=a.placement.split("-")[0],d=-1!==["left","right"].indexOf(c),e=a.instance.popper.querySelector("[data-role=\"arrow\"]"),f=(0,b.default)(a.instance.popper.querySelector("[data-role=\"flexitour-step\"]"));if(d){var g=parseFloat(window.getComputedStyle(e).height),h=parseFloat(window.getComputedStyle(e).top),i=parseFloat(window.getComputedStyle(a.instance.popper).height),j=parseFloat(window.getComputedStyle(a.instance.popper).top),k=parseFloat(f.css("borderTopWidth")),l=2*parseFloat(f.css("borderTopLeftRadius")),m=h+g/2,n=i+j-k-l,o=j+k+l;if(m>=n||m<=o){var y=0;if(m>i/2){y=n-g}else{y=o+g}(0,b.default)(e).css("top",y)}}else{var p=parseFloat(window.getComputedStyle(e).width),q=parseFloat(window.getComputedStyle(e).left),r=parseFloat(window.getComputedStyle(a.instance.popper).width),s=parseFloat(window.getComputedStyle(a.instance.popper).left),t=parseFloat(f.css("borderTopWidth")),u=2*parseFloat(f.css("borderTopLeftRadius")),v=q+p/2,w=r+s-t-u,x=s+t+u;if(v>=w||v<=x){var z=0;if(v>r/2){z=w-p}else{z=x+p}(0,b.default)(e).css("left",z)}}},i=(0,b.default)("[data-flexitour=\"step-background\"]");if(i.length){f=i}this.currentStepPopper=new d.default(f,c[0],g);return this}},{key:"recalculatePlacement",value:function recalculatePlacement(a){var b=this.getStepTarget(a),c=this.currentStepNode.width()+16,d=b.offset().left-10,e=b.offset().left+b.width()+10,f=a.placement;if(-1!==["left","right"].indexOf(f)){if(d<c+10&&e+c+10>document.documentElement.clientWidth){f="top"}}return f}},{key:"positionBackdrop",value:function positionBackdrop(a){if(a.backdrop){this.currentStepConfig.hasBackdrop=!0;var g=(0,b.default)("<div data-flexitour=\"backdrop\"></div>");if(a.zIndex){if("append"===a.attachPoint){a.attachTo.append(g)}else{g.insertAfter(a.attachTo)}}else{(0,b.default)("body").append(g)}if(this.isStepActuallyVisible(a)){var c=(0,b.default)("<div data-flexitour=\"step-background\"></div>"),d=this.getStepTarget(a),e=10,f=d;if(e){f=(0,b.default)("body")}c.css({width:d.outerWidth()+e+e,height:d.outerHeight()+e+e,left:d.offset().left-e,top:d.offset().top-e,backgroundColor:this.calculateInherittedBackgroundColor(f)});if(d.offset().left<e){c.css({width:d.outerWidth()+d.offset().left+e,left:d.offset().left})}if(d.offset().top<e){c.css({height:d.outerHeight()+d.offset().top+e,top:d.offset().top})}var h=d.css("borderRadius");if(h&&h!==(0,b.default)("body").css("borderRadius")){c.css("borderRadius",h)}var i=this.calculatePosition(d);if("fixed"===i){c.css("top",0)}else if("absolute"===i){c.css("position","fixed")}var j=c.clone();j.css({backgroundColor:g.css("backgroundColor"),opacity:g.css("opacity")});j.attr("data-flexitour","step-background-fader");if(a.zIndex){if("append"===a.attachPoint){a.attachTo.append(c)}else{j.insertAfter(a.attachTo);c.insertAfter(a.attachTo)}}else{(0,b.default)("body").append(j);(0,b.default)("body").append(c)}d.attr("data-flexitour","step-backdrop");if(a.zIndex){g.css("zIndex",a.zIndex);c.css("zIndex",a.zIndex+1);d.css("zIndex",a.zIndex+2)}j.fadeOut("2000",function(){(0,b.default)(this).remove()})}}return this}},{key:"calculateZIndex",value:function calculateZIndex(a){a=(0,b.default)(a);while(a.length&&a[0]!==document){var c=a.css("position");if("absolute"===c||"relative"===c||"fixed"===c){var d=parseInt(a.css("zIndex"),10);if(!isNaN(d)&&0!==d){return d}}a=a.parent()}return 0}},{key:"calculateInherittedBackgroundColor",value:function calculateInherittedBackgroundColor(a){var c=(0,b.default)("<div>").hide();(0,b.default)("body").append(c);var d=c.css("backgroundColor");c.remove();a=(0,b.default)(a);while(a.length&&a[0]!==document){var e=a.css("backgroundColor");if(e!==d){return e}a=a.parent()}return null}},{key:"calculatePosition",value:function calculatePosition(a){a=(0,b.default)(a);while(a.length&&a[0]!==document){var c=a.css("position");if("static"!==c){return c}a=a.parent()}return null}},{key:"accessibilityShow",value:function accessibilityShow(){var a=function(a){var b=a.data("flexitour");if(b){switch(b){case"container":case"target":return;}}var d=a.attr("aria-hidden");if(!d){a.attr("data-has-hidden",!0);c.hide(a)}};this.currentStepNode.siblings().each(function(c,d){a((0,b.default)(d))});this.currentStepNode.parentsUntil("body").siblings().each(function(c,d){a((0,b.default)(d))})}},{key:"accessibilityHide",value:function accessibilityHide(){var a=function(a){var b=a.attr("data-has-hidden");if("undefined"!=typeof b){a.removeAttr("data-has-hidden");c.unhide(a)}};(0,b.default)("[data-has-hidden]").each(function(c,d){a((0,b.default)(d))})}}]);return a}();a.default=l;return a.default});
define ("tool_xmldb/move",["jquery","core/sortable_list","core/ajax","core/notification"],function(a,b,c,d){return{init:function init(e,f){var g=new b("#"+e+" tbody");g.getElementName=function(b){return a.Deferred().resolve(b.attr("data-name"))};var h;a("#"+e+" tbody tr").on(b.EVENTS.DRAGSTART,function(b,c){h=c.sourceList.children().index(c.element);setTimeout(function(){a(".sortable-list-is-dragged").width(c.element.width())},501)}).on(b.EVENTS.DROP,function(a,b){var e=b.targetList.children().index(b.element),g=b.element.find("[data-action="+f+"]");if(b.positionChanged&&g.length){var i={methodname:"tool_xmldb_invoke_move_action",args:{action:f,dir:g.attr("data-dir"),table:g.attr("data-table"),field:g.attr("data-field"),key:g.attr("data-key"),index:g.attr("data-index"),position:e-h}};c.call([i])[0].fail(d.exception)}})}}});
define ("theme_boost/scroll",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;function b(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function c(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function d(a,b,d){if(b)c(a.prototype,b);if(d)c(a,d);return a}var e=function(){function a(){b(this,a)}d(a,[{key:"init",value:function init(){this.scrollY=0;window.addEventListener("scroll",this.scrollHandler.bind(this));return this}},{key:"getScrollPosition",value:function getScrollPosition(){return window.pageYOffset||document.documentElement.scrollTop}},{key:"scrollHandler",value:function scrollHandler(){var a=document.querySelector("body"),b=this.getScrollPosition();if(b>=window.innerHeight){a.classList.add("scrolled")}else{a.classList.remove("scrolled")}}}]);return a}();a.default=e;return a.default});
define ("theme_boost/pending",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a,b){return h(a)||g(a,b)||e(a,b)||d()}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(a,b){if(!a)return;if("string"==typeof a)return f(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return f(a,b)}function f(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function g(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function h(a){if(Array.isArray(a))return a}var i={alert:[{start:"close",end:"closed"}],carousel:[{start:"slide",end:"slid"}],collapse:[{start:"hide",end:"hidden"},{start:"show",end:"shown"}],dropdown:[{start:"hide",end:"hidden"},{start:"show",end:"shown"}],modal:[{start:"hide",end:"hidden"},{start:"show",end:"shown"}],popover:[{start:"hide",end:"hidden"},{start:"show",end:"shown"}],tab:[{start:"hide",end:"hidden"},{start:"show",end:"shown"}],toast:[{start:"hide",end:"hidden"},{start:"show",end:"shown"}],tooltip:[{start:"hide",end:"hidden"},{start:"show",end:"shown"}]};a.default=function(){Object.entries(i).forEach(function(a){var d=c(a,2),e=d[0],f=d[1];f.forEach(function(a){var c="".concat(a.start,".bs.").concat(e),d="".concat(a.end,".bs.").concat(e);(0,b.default)(document.body).on(c,function(a){M.util.js_pending(d);(0,b.default)(a.target).one(d,function(){M.util.js_complete(d)})})})})};return a.default});
define ("theme_boost/popover",["exports","./bootstrap/popover"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"Popover",{enumerable:!0,get:function get(){return b.default}});b=function(a){return a&&a.__esModule?a:{default:a}}(b)});
define ("theme_boost/bootstrap/tab",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function f(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function g(a,b,c){if(b)f(a.prototype,b);if(c)f(a,c);return a}var h="bs.tab",i=".".concat(h),j=b.default.fn.tab,k="hide".concat(i),l="hidden".concat(i),m="show".concat(i),n="shown".concat(i),o="click".concat(i).concat(".data-api"),p="active",q="fade",r="show",s=".active",t="> li > .active",u=function(){function a(b){e(this,a);this._element=b}g(a,[{key:"show",value:function show(){var a=this;if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&(0,b.default)(this._element).hasClass(p)||(0,b.default)(this._element).hasClass("disabled")){return}var d,e,f=(0,b.default)(this._element).closest(".nav, .list-group")[0],g=c.default.getSelectorFromElement(this._element);if(f){var o="UL"===f.nodeName||"OL"===f.nodeName?t:s;e=b.default.makeArray((0,b.default)(f).find(o));e=e[e.length-1]}var h=b.default.Event(k,{relatedTarget:this._element}),i=b.default.Event(m,{relatedTarget:e});if(e){(0,b.default)(e).trigger(h)}(0,b.default)(this._element).trigger(i);if(i.isDefaultPrevented()||h.isDefaultPrevented()){return}if(g){d=document.querySelector(g)}this._activate(this._element,f);var j=function(){var c=b.default.Event(l,{relatedTarget:a._element}),d=b.default.Event(n,{relatedTarget:e});(0,b.default)(e).trigger(c);(0,b.default)(a._element).trigger(d)};if(d){this._activate(d,d.parentNode,j)}else{j()}}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,h);this._element=null}},{key:"_activate",value:function _activate(a,d,e){var f=this,g=d&&("UL"===d.nodeName||"OL"===d.nodeName)?(0,b.default)(d).find(t):(0,b.default)(d).children(s),h=g[0],i=e&&h&&(0,b.default)(h).hasClass(q),j=function(){return f._transitionComplete(a,h,e)};if(h&&i){var k=c.default.getTransitionDurationFromElement(h);(0,b.default)(h).removeClass(r).one(c.default.TRANSITION_END,j).emulateTransitionEnd(k)}else{j()}}},{key:"_transitionComplete",value:function _transitionComplete(a,d,e){if(d){(0,b.default)(d).removeClass(p);var f=(0,b.default)(d.parentNode).find("> .dropdown-menu .active")[0];if(f){(0,b.default)(f).removeClass(p)}if("tab"===d.getAttribute("role")){d.setAttribute("aria-selected",!1)}}(0,b.default)(a).addClass(p);if("tab"===a.getAttribute("role")){a.setAttribute("aria-selected",!0)}c.default.reflow(a);if(a.classList.contains(q)){a.classList.add(r)}if(a.parentNode&&(0,b.default)(a.parentNode).hasClass("dropdown-menu")){var g=(0,b.default)(a).closest(".dropdown")[0];if(g){var h=[].slice.call(g.querySelectorAll(".dropdown-toggle"));(0,b.default)(h).addClass(p)}a.setAttribute("aria-expanded",!0)}if(e){e()}}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this),e=d.data(h);if(!e){e=new a(this);d.data(h,e)}if("string"==typeof c){if("undefined"==typeof e[c]){throw new TypeError("No method named \"".concat(c,"\""))}e[c]()}})}},{key:"VERSION",get:function get(){return"4.5.0"}}]);return a}();(0,b.default)(document).on(o,"[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]",function(a){a.preventDefault();u._jQueryInterface.call((0,b.default)(this),"show")});b.default.fn.tab=u._jQueryInterface;b.default.fn.tab.Constructor=u;b.default.fn.tab.noConflict=function(){b.default.fn.tab=j;return u._jQueryInterface};a.default=u;return a.default});
define ("theme_boost/bootstrap/button",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function d(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function e(a,b,c){if(b)d(a.prototype,b);if(c)d(a,c);return a}var f="bs.button",g=".".concat(f),h=".data-api",i=b.default.fn.button,j="active",k="[data-toggle^=\"button\"]",l="input:not([type=\"hidden\"])",m=".btn",n="click".concat(g).concat(h),o="focus".concat(g).concat(h," ")+"blur".concat(g).concat(h),p="load".concat(g).concat(h),q=function(){function a(b){c(this,a);this._element=b}e(a,[{key:"toggle",value:function toggle(){var a=!0,c=!0,d=(0,b.default)(this._element).closest("[data-toggle=\"buttons\"]")[0];if(d){var e=this._element.querySelector(l);if(e){if("radio"===e.type){if(e.checked&&this._element.classList.contains(j)){a=!1}else{var f=d.querySelector(".active");if(f){(0,b.default)(f).removeClass(j)}}}if(a){if("checkbox"===e.type||"radio"===e.type){e.checked=!this._element.classList.contains(j)}(0,b.default)(e).trigger("change")}e.focus();c=!1}}if(!(this._element.hasAttribute("disabled")||this._element.classList.contains("disabled"))){if(c){this._element.setAttribute("aria-pressed",!this._element.classList.contains(j))}if(a){(0,b.default)(this._element).toggleClass(j)}}}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,f);this._element=null}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this).data(f);if(!d){d=new a(this);(0,b.default)(this).data(f,d)}if("toggle"===c){d[c]()}})}},{key:"VERSION",get:function get(){return"4.5.0"}}]);return a}();(0,b.default)(document).on(n,k,function(a){var c=a.target,d=c;if(!(0,b.default)(c).hasClass("btn")){c=(0,b.default)(c).closest(m)[0]}if(!c||c.hasAttribute("disabled")||c.classList.contains("disabled")){a.preventDefault()}else{var e=c.querySelector(l);if(e&&(e.hasAttribute("disabled")||e.classList.contains("disabled"))){a.preventDefault();return}if("LABEL"===d.tagName&&e&&"checkbox"===e.type){a.preventDefault()}q._jQueryInterface.call((0,b.default)(c),"toggle")}}).on(o,k,function(a){var c=(0,b.default)(a.target).closest(m)[0];(0,b.default)(c).toggleClass("focus",/^focus(in)?$/.test(a.type))});(0,b.default)(window).on(p,function(){for(var a=[].slice.call(document.querySelectorAll("[data-toggle=\"buttons\"] .btn")),b=0,c=a.length;b<c;b++){var d=a[b],e=d.querySelector(l);if(e.checked||e.hasAttribute("checked")){d.classList.add(j)}else{d.classList.remove(j)}}a=[].slice.call(document.querySelectorAll("[data-toggle=\"button\"]"));for(var f=0,g=a.length,h;f<g;f++){h=a[f];if("true"===h.getAttribute("aria-pressed")){h.classList.add(j)}else{h.classList.remove(j)}}});b.default.fn.button=q._jQueryInterface;b.default.fn.button.Constructor=q;b.default.fn.button.noConflict=function(){b.default.fn.button=i;return q._jQueryInterface};a.default=q;return a.default});
define ("theme_boost/bootstrap/popover",["exports","jquery","./tooltip"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function g(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function h(a,b,c){if(b)g(a.prototype,b);if(c)g(a,c);return a}function i(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});if(b)j(a,b)}function j(a,b){j=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return j(a,b)}function k(a){return function(){var b=p(a),c;if(n()){var d=p(this).constructor;c=Reflect.construct(b,arguments,d)}else{c=b.apply(this,arguments)}return l(this,c)}}function l(a,b){if(b&&("object"===e(b)||"function"==typeof b)){return b}return m(a)}function m(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return!0}catch(a){return!1}}function p(a){p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return p(a)}function q(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function r(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){q(Object(c),!0).forEach(function(b){s(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{q(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function s(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}var t="bs.popover",u=".".concat(t),v=b.default.fn.popover,w="bs-popover",x=new RegExp("(^|\\s)".concat(w,"\\S+"),"g"),y=r({},c.default.Default,{placement:"right",trigger:"click",content:"",template:"<div class=\"popover\" role=\"tooltip\"><div class=\"arrow\"></div><h3 class=\"popover-header\"></h3><div class=\"popover-body\"></div></div>"}),z=r({},c.default.DefaultType,{content:"(string|element|function)"}),A={HIDE:"hide".concat(u),HIDDEN:"hidden".concat(u),SHOW:"show".concat(u),SHOWN:"shown".concat(u),INSERTED:"inserted".concat(u),CLICK:"click".concat(u),FOCUSIN:"focusin".concat(u),FOCUSOUT:"focusout".concat(u),MOUSEENTER:"mouseenter".concat(u),MOUSELEAVE:"mouseleave".concat(u)},B=function(a){i(c,a);var d=k(c);function c(){f(this,c);return d.apply(this,arguments)}h(c,[{key:"isWithContent",value:function isWithContent(){return this.getTitle()||this._getContent()}},{key:"addAttachmentClass",value:function addAttachmentClass(a){(0,b.default)(this.getTipElement()).addClass("".concat(w,"-").concat(a))}},{key:"getTipElement",value:function getTipElement(){this.tip=this.tip||(0,b.default)(this.config.template)[0];return this.tip}},{key:"setContent",value:function setContent(){var a=(0,b.default)(this.getTipElement());this.setElementContent(a.find(".popover-header"),this.getTitle());var c=this._getContent();if("function"==typeof c){c=c.call(this.element)}this.setElementContent(a.find(".popover-body"),c);a.removeClass("".concat("fade"," ").concat("show"))}},{key:"_getContent",value:function _getContent(){return this.element.getAttribute("data-content")||this.config.content}},{key:"_cleanTipClass",value:function _cleanTipClass(){var a=(0,b.default)(this.getTipElement()),c=a.attr("class").match(x);if(null!==c&&0<c.length){a.removeClass(c.join(""))}}}],[{key:"_jQueryInterface",value:function _jQueryInterface(a){return this.each(function(){var d=(0,b.default)(this).data(t),f="object"===e(a)?a:null;if(!d&&/dispose|hide/.test(a)){return}if(!d){d=new c(this,f);(0,b.default)(this).data(t,d)}if("string"==typeof a){if("undefined"==typeof d[a]){throw new TypeError("No method named \"".concat(a,"\""))}d[a]()}})}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"Default",get:function get(){return y}},{key:"NAME",get:function get(){return"popover"}},{key:"DATA_KEY",get:function get(){return t}},{key:"Event",get:function get(){return A}},{key:"EVENT_KEY",get:function get(){return u}},{key:"DefaultType",get:function get(){return z}}]);return c}(c.default);b.default.fn.popover=B._jQueryInterface;b.default.fn.popover.Constructor=B;b.default.fn.popover.noConflict=function(){b.default.fn.popover=v;return B._jQueryInterface};a.default=B;return a.default});
define ("theme_boost/bootstrap/alert",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function f(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function g(a,b,c){if(b)f(a.prototype,b);if(c)f(a,c);return a}var h="bs.alert",i=".".concat(h),j=b.default.fn.alert,k="close".concat(i),l="closed".concat(i),m="click".concat(i).concat(".data-api"),n=function(){function a(b){e(this,a);this._element=b}g(a,[{key:"close",value:function close(a){var b=this._element;if(a){b=this._getRootElement(a)}var c=this._triggerCloseEvent(b);if(c.isDefaultPrevented()){return}this._removeElement(b)}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,h);this._element=null}},{key:"_getRootElement",value:function _getRootElement(a){var d=c.default.getSelectorFromElement(a),e=!1;if(d){e=document.querySelector(d)}if(!e){e=(0,b.default)(a).closest(".".concat("alert"))[0]}return e}},{key:"_triggerCloseEvent",value:function _triggerCloseEvent(a){var c=b.default.Event(k);(0,b.default)(a).trigger(c);return c}},{key:"_removeElement",value:function _removeElement(a){var d=this;(0,b.default)(a).removeClass("show");if(!(0,b.default)(a).hasClass("fade")){this._destroyElement(a);return}var e=c.default.getTransitionDurationFromElement(a);(0,b.default)(a).one(c.default.TRANSITION_END,function(b){return d._destroyElement(a,b)}).emulateTransitionEnd(e)}},{key:"_destroyElement",value:function _destroyElement(a){(0,b.default)(a).detach().trigger(l).remove()}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this),e=d.data(h);if(!e){e=new a(this);d.data(h,e)}if("close"===c){e[c](this)}})}},{key:"_handleDismiss",value:function _handleDismiss(a){return function(b){if(b){b.preventDefault()}a.close(this)}}},{key:"VERSION",get:function get(){return"4.5.0"}}]);return a}();(0,b.default)(document).on(m,"[data-dismiss=\"alert\"]",n._handleDismiss(new n));b.default.fn.alert=n._jQueryInterface;b.default.fn.alert.Constructor=n;b.default.fn.alert.noConflict=function(){b.default.fn.alert=j;return n._jQueryInterface};a.default=n;return a.default});
define ("theme_boost/bootstrap/collapse",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function j(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function k(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function l(a,b,c){if(b)k(a.prototype,b);if(c)k(a,c);return a}var m="bs.collapse",n=".".concat(m),o=b.default.fn.collapse,p={toggle:!0,parent:""},q={toggle:"boolean",parent:"(string|element)"},r="show".concat(n),s="shown".concat(n),t="hide".concat(n),u="hidden".concat(n),v="click".concat(n).concat(".data-api"),w="show",x="collapse",y="collapsing",z="collapsed",A="width",B="[data-toggle=\"collapse\"]",C=function(){function a(b,d){j(this,a);this._isTransitioning=!1;this._element=b;this._config=this._getConfig(d);this._triggerArray=[].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#".concat(b.id,"\"],")+"[data-toggle=\"collapse\"][data-target=\"#".concat(b.id,"\"]")));for(var e=[].slice.call(document.querySelectorAll(B)),f=0,g=e.length;f<g;f++){var h=e[f],k=c.default.getSelectorFromElement(h),l=[].slice.call(document.querySelectorAll(k)).filter(function(a){return a===b});if(null!==k&&0<l.length){this._selector=k;this._triggerArray.push(h)}}this._parent=this._config.parent?this._getParent():null;if(!this._config.parent){this._addAriaAndCollapsedClass(this._element,this._triggerArray)}if(this._config.toggle){this.toggle()}}l(a,[{key:"toggle",value:function toggle(){if((0,b.default)(this._element).hasClass(w)){this.hide()}else{this.show()}}},{key:"show",value:function show(){var d=this;if(this._isTransitioning||(0,b.default)(this._element).hasClass(w)){return}var e,f;if(this._parent){e=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter(function(a){if("string"==typeof d._config.parent){return a.getAttribute("data-parent")===d._config.parent}return a.classList.contains(x)});if(0===e.length){e=null}}if(e){f=(0,b.default)(e).not(this._selector).data(m);if(f&&f._isTransitioning){return}}var g=b.default.Event(r);(0,b.default)(this._element).trigger(g);if(g.isDefaultPrevented()){return}if(e){a._jQueryInterface.call((0,b.default)(e).not(this._selector),"hide");if(!f){(0,b.default)(e).data(m,null)}}var h=this._getDimension();(0,b.default)(this._element).removeClass(x).addClass(y);this._element.style[h]=0;if(this._triggerArray.length){(0,b.default)(this._triggerArray).removeClass(z).attr("aria-expanded",!0)}this.setTransitioning(!0);var i=function(){(0,b.default)(d._element).removeClass(y).addClass("".concat(x," ").concat(w));d._element.style[h]="";d.setTransitioning(!1);(0,b.default)(d._element).trigger(s)},j=h[0].toUpperCase()+h.slice(1),k="scroll".concat(j),l=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,i).emulateTransitionEnd(l);this._element.style[h]="".concat(this._element[k],"px")}},{key:"hide",value:function hide(){var a=this;if(this._isTransitioning||!(0,b.default)(this._element).hasClass(w)){return}var d=b.default.Event(t);(0,b.default)(this._element).trigger(d);if(d.isDefaultPrevented()){return}var e=this._getDimension();this._element.style[e]="".concat(this._element.getBoundingClientRect()[e],"px");c.default.reflow(this._element);(0,b.default)(this._element).addClass(y).removeClass("".concat(x," ").concat(w));var f=this._triggerArray.length;if(0<f){for(var l=0;l<f;l++){var g=this._triggerArray[l],h=c.default.getSelectorFromElement(g);if(null!==h){var i=(0,b.default)([].slice.call(document.querySelectorAll(h)));if(!i.hasClass(w)){(0,b.default)(g).addClass(z).attr("aria-expanded",!1)}}}}this.setTransitioning(!0);var j=function(){a.setTransitioning(!1);(0,b.default)(a._element).removeClass(y).addClass(x).trigger(u)};this._element.style[e]="";var k=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,j).emulateTransitionEnd(k)}},{key:"setTransitioning",value:function setTransitioning(a){this._isTransitioning=a}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,m);this._config=null;this._parent=null;this._element=null;this._triggerArray=null;this._isTransitioning=null}},{key:"_getConfig",value:function _getConfig(a){a=g({},p,{},a);a.toggle=!!a.toggle;c.default.typeCheckConfig("collapse",a,q);return a}},{key:"_getDimension",value:function _getDimension(){var a=(0,b.default)(this._element).hasClass(A);return a?A:"height"}},{key:"_getParent",value:function _getParent(){var d=this,e;if(c.default.isElement(this._config.parent)){e=this._config.parent;if("undefined"!=typeof this._config.parent.jquery){e=this._config.parent[0]}}else{e=document.querySelector(this._config.parent)}var f="[data-toggle=\"collapse\"][data-parent=\"".concat(this._config.parent,"\"]"),g=[].slice.call(e.querySelectorAll(f));(0,b.default)(g).each(function(b,c){d._addAriaAndCollapsedClass(a._getTargetFromElement(c),[c])});return e}},{key:"_addAriaAndCollapsedClass",value:function _addAriaAndCollapsedClass(a,c){var d=(0,b.default)(a).hasClass(w);if(c.length){(0,b.default)(c).toggleClass(z,!d).attr("aria-expanded",d)}}}],[{key:"_getTargetFromElement",value:function _getTargetFromElement(a){var b=c.default.getSelectorFromElement(a);return b?document.querySelector(b):null}},{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this),f=d.data(m),h=g({},p,{},d.data(),{},"object"===e(c)&&c?c:{});if(!f&&h.toggle&&"string"==typeof c&&/show|hide/.test(c)){h.toggle=!1}if(!f){f=new a(this,h);d.data(m,f)}if("string"==typeof c){if("undefined"==typeof f[c]){throw new TypeError("No method named \"".concat(c,"\""))}f[c]()}})}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"Default",get:function get(){return p}}]);return a}();(0,b.default)(document).on(v,B,function(a){if("A"===a.currentTarget.tagName){a.preventDefault()}var d=(0,b.default)(this),e=c.default.getSelectorFromElement(this),f=[].slice.call(document.querySelectorAll(e));(0,b.default)(f).each(function(){var a=(0,b.default)(this),c=a.data(m),e=c?"toggle":d.data();C._jQueryInterface.call(a,e)})});b.default.fn.collapse=C._jQueryInterface;b.default.fn.collapse.Constructor=C;b.default.fn.collapse.noConflict=function(){b.default.fn.collapse=o;return C._jQueryInterface};a.default=C;return a.default});
define ("theme_boost/bootstrap/scrollspy",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function i(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function j(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function k(a,b,c){if(b)j(a.prototype,b);if(c)j(a,c);return a}var l="bs.scrollspy",m=".".concat(l),n=b.default.fn.scrollspy,o={offset:10,method:"auto",target:""},p={offset:"number",method:"string",target:"(string|element)"},q="activate".concat(m),r="scroll".concat(m),s="load".concat(m).concat(".data-api"),t="active",u=".nav, .list-group",v=".nav-link",w=".list-group-item",x="position",y=function(){function a(c,d){var e=this;i(this,a);this._element=c;this._scrollElement="BODY"===c.tagName?window:c;this._config=this._getConfig(d);this._selector="".concat(this._config.target," ").concat(v,",")+"".concat(this._config.target," ").concat(w,",")+"".concat(this._config.target," ").concat(".dropdown-item");this._offsets=[];this._targets=[];this._activeTarget=null;this._scrollHeight=0;(0,b.default)(this._scrollElement).on(r,function(a){return e._process(a)});this.refresh();this._process()}k(a,[{key:"refresh",value:function refresh(){var a=this,d=this._scrollElement===this._scrollElement.window?"offset":x,e="auto"===this._config.method?d:this._config.method,f=e===x?this._getScrollTop():0;this._offsets=[];this._targets=[];this._scrollHeight=this._getScrollHeight();var g=[].slice.call(document.querySelectorAll(this._selector));g.map(function(a){var d,g=c.default.getSelectorFromElement(a);if(g){d=document.querySelector(g)}if(d){var h=d.getBoundingClientRect();if(h.width||h.height){return[(0,b.default)(d)[e]().top+f,g]}}return null}).filter(function(a){return a}).sort(function(c,a){return c[0]-a[0]}).forEach(function(b){a._offsets.push(b[0]);a._targets.push(b[1])})}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,l);(0,b.default)(this._scrollElement).off(m);this._element=null;this._scrollElement=null;this._config=null;this._selector=null;this._offsets=null;this._targets=null;this._activeTarget=null;this._scrollHeight=null}},{key:"_getConfig",value:function _getConfig(a){a=g({},o,{},"object"===e(a)&&a?a:{});if("string"!=typeof a.target&&c.default.isElement(a.target)){var d=(0,b.default)(a.target).attr("id");if(!d){d=c.default.getUID("scrollspy");(0,b.default)(a.target).attr("id",d)}a.target="#".concat(d)}c.default.typeCheckConfig("scrollspy",a,p);return a}},{key:"_getScrollTop",value:function _getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function _getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_getOffsetHeight",value:function _getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}},{key:"_process",value:function _process(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._getOffsetHeight();if(this._scrollHeight!==b){this.refresh()}if(a>=c){var d=this._targets[this._targets.length-1];if(this._activeTarget!==d){this._activate(d)}return}if(this._activeTarget&&a<this._offsets[0]&&0<this._offsets[0]){this._activeTarget=null;this._clear();return}for(var e=this._offsets.length,f;e--;){f=this._activeTarget!==this._targets[e]&&a>=this._offsets[e]&&("undefined"==typeof this._offsets[e+1]||a<this._offsets[e+1]);if(f){this._activate(this._targets[e])}}}},{key:"_activate",value:function _activate(a){this._activeTarget=a;this._clear();var c=this._selector.split(",").map(function(b){return"".concat(b,"[data-target=\"").concat(a,"\"],").concat(b,"[href=\"").concat(a,"\"]")}),d=(0,b.default)([].slice.call(document.querySelectorAll(c.join(","))));if(d.hasClass("dropdown-item")){d.closest(".dropdown").find(".dropdown-toggle").addClass(t);d.addClass(t)}else{d.addClass(t);d.parents(u).prev("".concat(v,", ").concat(w)).addClass(t);d.parents(u).prev(".nav-item").children(v).addClass(t)}(0,b.default)(this._scrollElement).trigger(q,{relatedTarget:a})}},{key:"_clear",value:function _clear(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(a){return a.classList.contains(t)}).forEach(function(a){return a.classList.remove(t)})}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this).data(l),f="object"===e(c)&&c;if(!d){d=new a(this,f);(0,b.default)(this).data(l,d)}if("string"==typeof c){if("undefined"==typeof d[c]){throw new TypeError("No method named \"".concat(c,"\""))}d[c]()}})}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"Default",get:function get(){return o}}]);return a}();(0,b.default)(window).on(s,function(){for(var a=[].slice.call(document.querySelectorAll("[data-spy=\"scroll\"]")),c=a.length,d=c,e;d--;){e=(0,b.default)(a[d]);y._jQueryInterface.call(e,e.data())}});b.default.fn.scrollspy=y._jQueryInterface;b.default.fn.scrollspy.Constructor=y;b.default.fn.scrollspy.noConflict=function(){b.default.fn.scrollspy=n;return y._jQueryInterface};a.default=y;return a.default});
define ("theme_boost/bootstrap/tooltip",["exports","./tools/sanitizer","jquery","core/popper","./util"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;c=f(c);d=f(d);e=f(e);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function h(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){g(Object(c),!0).forEach(function(b){i(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{g(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function i(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function j(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){j=function(a){return typeof a}}else{j=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return j(a)}function k(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function l(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function m(a,b,c){if(b)l(a.prototype,b);if(c)l(a,c);return a}var n="bs.tooltip",o=".".concat(n),p=c.default.fn.tooltip,q="bs-tooltip",r=new RegExp("(^|\\s)".concat(q,"\\S+"),"g"),s=["sanitize","whiteList","sanitizeFn"],t={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},u={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},v={animation:!0,template:"<div class=\"tooltip\" role=\"tooltip\"><div class=\"arrow\"></div><div class=\"tooltip-inner\"></div></div>",trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:b.DefaultWhitelist,popperConfig:null},w="show",x="out",y={HIDE:"hide".concat(o),HIDDEN:"hidden".concat(o),SHOW:"show".concat(o),SHOWN:"shown".concat(o),INSERTED:"inserted".concat(o),CLICK:"click".concat(o),FOCUSIN:"focusin".concat(o),FOCUSOUT:"focusout".concat(o),MOUSEENTER:"mouseenter".concat(o),MOUSELEAVE:"mouseleave".concat(o)},z="fade",A="show",B="hover",C="focus",D=function(){function a(b,c){k(this,a);if("undefined"==typeof d.default){throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)")}this._isEnabled=!0;this._timeout=0;this._hoverState="";this._activeTrigger={};this._popper=null;this.element=b;this.config=this._getConfig(c);this.tip=null;this._setListeners()}m(a,[{key:"enable",value:function enable(){this._isEnabled=!0}},{key:"disable",value:function disable(){this._isEnabled=!1}},{key:"toggleEnabled",value:function toggleEnabled(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function toggle(a){if(!this._isEnabled){return}if(a){var b=this.constructor.DATA_KEY,d=(0,c.default)(a.currentTarget).data(b);if(!d){d=new this.constructor(a.currentTarget,this._getDelegateConfig());(0,c.default)(a.currentTarget).data(b,d)}d._activeTrigger.click=!d._activeTrigger.click;if(d._isWithActiveTrigger()){d._enter(null,d)}else{d._leave(null,d)}}else{if((0,c.default)(this.getTipElement()).hasClass(A)){this._leave(null,this);return}this._enter(null,this)}}},{key:"dispose",value:function dispose(){clearTimeout(this._timeout);c.default.removeData(this.element,this.constructor.DATA_KEY);(0,c.default)(this.element).off(this.constructor.EVENT_KEY);(0,c.default)(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler);if(this.tip){(0,c.default)(this.tip).remove()}this._isEnabled=null;this._timeout=null;this._hoverState=null;this._activeTrigger=null;if(this._popper){this._popper.destroy()}this._popper=null;this.element=null;this.config=null;this.tip=null}},{key:"show",value:function show(){var a=this;if("none"===(0,c.default)(this.element).css("display")){throw new Error("Please use show on visible elements")}var b=c.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){(0,c.default)(this.element).trigger(b);var f=e.default.findShadowRoot(this.element),g=c.default.contains(null!==f?f:this.element.ownerDocument.documentElement,this.element);if(b.isDefaultPrevented()||!g){return}var h=this.getTipElement(),i=e.default.getUID(this.constructor.NAME);h.setAttribute("id",i);this.element.setAttribute("aria-describedby",i);this.setContent();if(this.config.animation){(0,c.default)(h).addClass(z)}var j="function"==typeof this.config.placement?this.config.placement.call(this,h,this.element):this.config.placement,k=this._getAttachment(j);this.addAttachmentClass(k);var l=this._getContainer();(0,c.default)(h).data(this.constructor.DATA_KEY,this);if(!c.default.contains(this.element.ownerDocument.documentElement,this.tip)){(0,c.default)(h).appendTo(l)}(0,c.default)(this.element).trigger(this.constructor.Event.INSERTED);this._popper=new d.default(this.element,h,this._getPopperConfig(k));(0,c.default)(h).addClass(A);if("ontouchstart"in document.documentElement){(0,c.default)(document.body).children().on("mouseover",null,c.default.noop)}var m=function(){if(a.config.animation){a._fixTransition()}var b=a._hoverState;a._hoverState=null;(0,c.default)(a.element).trigger(a.constructor.Event.SHOWN);if(b===x){a._leave(null,a)}};if((0,c.default)(this.tip).hasClass(z)){var n=e.default.getTransitionDurationFromElement(this.tip);(0,c.default)(this.tip).one(e.default.TRANSITION_END,m).emulateTransitionEnd(n)}else{m()}}}},{key:"hide",value:function hide(a){var b=this,d=this.getTipElement(),f=c.default.Event(this.constructor.Event.HIDE),g=function(){if(b._hoverState!==w&&d.parentNode){d.parentNode.removeChild(d)}b._cleanTipClass();b.element.removeAttribute("aria-describedby");(0,c.default)(b.element).trigger(b.constructor.Event.HIDDEN);if(null!==b._popper){b._popper.destroy()}if(a){a()}};(0,c.default)(this.element).trigger(f);if(f.isDefaultPrevented()){return}(0,c.default)(d).removeClass(A);if("ontouchstart"in document.documentElement){(0,c.default)(document.body).children().off("mouseover",null,c.default.noop)}this._activeTrigger["click"]=!1;this._activeTrigger[C]=!1;this._activeTrigger[B]=!1;if((0,c.default)(this.tip).hasClass(z)){var h=e.default.getTransitionDurationFromElement(d);(0,c.default)(d).one(e.default.TRANSITION_END,g).emulateTransitionEnd(h)}else{g()}this._hoverState=""}},{key:"update",value:function update(){if(null!==this._popper){this._popper.scheduleUpdate()}}},{key:"isWithContent",value:function isWithContent(){return!!this.getTitle()}},{key:"addAttachmentClass",value:function addAttachmentClass(a){(0,c.default)(this.getTipElement()).addClass("".concat(q,"-").concat(a))}},{key:"getTipElement",value:function getTipElement(){this.tip=this.tip||(0,c.default)(this.config.template)[0];return this.tip}},{key:"setContent",value:function setContent(){var a=this.getTipElement();this.setElementContent((0,c.default)(a.querySelectorAll(".tooltip-inner")),this.getTitle());(0,c.default)(a).removeClass("".concat(z," ").concat(A))}},{key:"setElementContent",value:function setElementContent(a,d){if("object"===j(d)&&(d.nodeType||d.jquery)){if(this.config.html){if(!(0,c.default)(d).parent().is(a)){a.empty().append(d)}}else{a.text((0,c.default)(d).text())}return}if(this.config.html){if(this.config.sanitize){d=(0,b.sanitizeHtml)(d,this.config.whiteList,this.config.sanitizeFn)}a.html(d)}else{a.text(d)}}},{key:"getTitle",value:function getTitle(){var a=this.element.getAttribute("data-original-title");if(!a){a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title}return a}},{key:"_getPopperConfig",value:function _getPopperConfig(a){var b=this,c={placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function onCreate(a){if(a.originalPlacement!==a.placement){b._handlePopperPlacementChange(a)}},onUpdate:function onUpdate(a){return b._handlePopperPlacementChange(a)}};return h({},c,{},this.config.popperConfig)}},{key:"_getOffset",value:function _getOffset(){var a=this,b={};if("function"==typeof this.config.offset){b.fn=function(b){b.offsets=h({},b.offsets,{},a.config.offset(b.offsets,a.element)||{});return b}}else{b.offset=this.config.offset}return b}},{key:"_getContainer",value:function _getContainer(){if(!1===this.config.container){return document.body}if(e.default.isElement(this.config.container)){return(0,c.default)(this.config.container)}return(0,c.default)(document).find(this.config.container)}},{key:"_getAttachment",value:function _getAttachment(a){return u[a.toUpperCase()]}},{key:"_setListeners",value:function _setListeners(){var a=this,b=this.config.trigger.split(" ");b.forEach(function(b){if("click"===b){(0,c.default)(a.element).on(a.constructor.Event.CLICK,a.config.selector,function(b){return a.toggle(b)})}else if(b!=="manual"){var d=b===B?a.constructor.Event.MOUSEENTER:a.constructor.Event.FOCUSIN,e=b===B?a.constructor.Event.MOUSELEAVE:a.constructor.Event.FOCUSOUT;(0,c.default)(a.element).on(d,a.config.selector,function(b){return a._enter(b)}).on(e,a.config.selector,function(b){return a._leave(b)})}});this._hideModalHandler=function(){if(a.element){a.hide()}};(0,c.default)(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler);if(this.config.selector){this.config=h({},this.config,{trigger:"manual",selector:""})}else{this._fixTitle()}}},{key:"_fixTitle",value:function _fixTitle(){var a=j(this.element.getAttribute("data-original-title"));if(this.element.getAttribute("title")||"string"!==a){this.element.setAttribute("data-original-title",this.element.getAttribute("title")||"");this.element.setAttribute("title","")}}},{key:"_enter",value:function _enter(a,b){var d=this.constructor.DATA_KEY;b=b||(0,c.default)(a.currentTarget).data(d);if(!b){b=new this.constructor(a.currentTarget,this._getDelegateConfig());(0,c.default)(a.currentTarget).data(d,b)}if(a){b._activeTrigger["focusin"===a.type?C:B]=!0}if((0,c.default)(b.getTipElement()).hasClass(A)||b._hoverState===w){b._hoverState=w;return}clearTimeout(b._timeout);b._hoverState=w;if(!b.config.delay||!b.config.delay.show){b.show();return}b._timeout=setTimeout(function(){if(b._hoverState===w){b.show()}},b.config.delay.show)}},{key:"_leave",value:function _leave(a,b){var d=this.constructor.DATA_KEY;b=b||(0,c.default)(a.currentTarget).data(d);if(!b){b=new this.constructor(a.currentTarget,this._getDelegateConfig());(0,c.default)(a.currentTarget).data(d,b)}if(a){b._activeTrigger["focusout"===a.type?C:B]=!1}if(b._isWithActiveTrigger()){return}clearTimeout(b._timeout);b._hoverState=x;if(!b.config.delay||!b.config.delay.hide){b.hide();return}b._timeout=setTimeout(function(){if(b._hoverState===x){b.hide()}},b.config.delay.hide)}},{key:"_isWithActiveTrigger",value:function _isWithActiveTrigger(){for(var a in this._activeTrigger){if(this._activeTrigger[a]){return!0}}return!1}},{key:"_getConfig",value:function _getConfig(a){var d=(0,c.default)(this.element).data();Object.keys(d).forEach(function(a){if(-1!==s.indexOf(a)){delete d[a]}});a=h({},this.constructor.Default,{},d,{},"object"===j(a)&&a?a:{});if("number"==typeof a.delay){a.delay={show:a.delay,hide:a.delay}}if("number"==typeof a.title){a.title=a.title.toString()}if("number"==typeof a.content){a.content=a.content.toString()}e.default.typeCheckConfig("tooltip",a,this.constructor.DefaultType);if(a.sanitize){a.template=(0,b.sanitizeHtml)(a.template,a.whiteList,a.sanitizeFn)}return a}},{key:"_getDelegateConfig",value:function _getDelegateConfig(){var a={};if(this.config){for(var b in this.config){if(this.constructor.Default[b]!==this.config[b]){a[b]=this.config[b]}}}return a}},{key:"_cleanTipClass",value:function _cleanTipClass(){var a=(0,c.default)(this.getTipElement()),b=a.attr("class").match(r);if(null!==b&&b.length){a.removeClass(b.join(""))}}},{key:"_handlePopperPlacementChange",value:function _handlePopperPlacementChange(a){this.tip=a.instance.popper;this._cleanTipClass();this.addAttachmentClass(this._getAttachment(a.placement))}},{key:"_fixTransition",value:function _fixTransition(){var a=this.getTipElement(),b=this.config.animation;if(null!==a.getAttribute("x-placement")){return}(0,c.default)(a).removeClass(z);this.config.animation=!1;this.hide();this.show();this.config.animation=b}}],[{key:"_jQueryInterface",value:function _jQueryInterface(b){return this.each(function(){var d=(0,c.default)(this).data(n),e="object"===j(b)&&b;if(!d&&/dispose|hide/.test(b)){return}if(!d){d=new a(this,e);(0,c.default)(this).data(n,d)}if("string"==typeof b){if("undefined"==typeof d[b]){throw new TypeError("No method named \"".concat(b,"\""))}d[b]()}})}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"Default",get:function get(){return v}},{key:"NAME",get:function get(){return"tooltip"}},{key:"DATA_KEY",get:function get(){return n}},{key:"Event",get:function get(){return y}},{key:"EVENT_KEY",get:function get(){return o}},{key:"DefaultType",get:function get(){return t}}]);return a}();c.default.fn.tooltip=D._jQueryInterface;c.default.fn.tooltip.Constructor=D;c.default.fn.tooltip.noConflict=function(){c.default.fn.tooltip=p;return D._jQueryInterface};a.default=D;return a.default});
define ("theme_boost/bootstrap/toast",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function i(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function j(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function k(a,b,c){if(b)j(a.prototype,b);if(c)j(a,c);return a}var l="bs.toast",m=".".concat(l),n=b.default.fn.toast,o="click.dismiss".concat(m),p="hide".concat(m),q="hidden".concat(m),r="show".concat(m),s="shown".concat(m),t="hide",u="show",v="showing",w={animation:"boolean",autohide:"boolean",delay:"number"},x={animation:!0,autohide:!0,delay:500},y=function(){function a(b,c){i(this,a);this._element=b;this._config=this._getConfig(c);this._timeout=null;this._setListeners()}k(a,[{key:"show",value:function show(){var a=this,d=b.default.Event(r);(0,b.default)(this._element).trigger(d);if(d.isDefaultPrevented()){return}if(this._config.animation){this._element.classList.add("fade")}var e=function(){a._element.classList.remove(v);a._element.classList.add(u);(0,b.default)(a._element).trigger(s);if(a._config.autohide){a._timeout=setTimeout(function(){a.hide()},a._config.delay)}};this._element.classList.remove(t);c.default.reflow(this._element);this._element.classList.add(v);if(this._config.animation){var f=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,e).emulateTransitionEnd(f)}else{e()}}},{key:"hide",value:function hide(){if(!this._element.classList.contains(u)){return}var a=b.default.Event(p);(0,b.default)(this._element).trigger(a);if(a.isDefaultPrevented()){return}this._close()}},{key:"dispose",value:function dispose(){clearTimeout(this._timeout);this._timeout=null;if(this._element.classList.contains(u)){this._element.classList.remove(u)}(0,b.default)(this._element).off(o);b.default.removeData(this._element,l);this._element=null;this._config=null}},{key:"_getConfig",value:function _getConfig(a){a=g({},x,{},(0,b.default)(this._element).data(),{},"object"===e(a)&&a?a:{});c.default.typeCheckConfig("toast",a,this.constructor.DefaultType);return a}},{key:"_setListeners",value:function _setListeners(){var a=this;(0,b.default)(this._element).on(o,"[data-dismiss=\"toast\"]",function(){return a.hide()})}},{key:"_close",value:function _close(){var a=this,d=function(){a._element.classList.add(t);(0,b.default)(a._element).trigger(q)};this._element.classList.remove(u);if(this._config.animation){var e=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,d).emulateTransitionEnd(e)}else{d()}}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this),f=d.data(l),g="object"===e(c)&&c;if(!f){f=new a(this,g);d.data(l,f)}if("string"==typeof c){if("undefined"==typeof f[c]){throw new TypeError("No method named \"".concat(c,"\""))}f[c](this)}})}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"DefaultType",get:function get(){return w}},{key:"Default",get:function get(){return x}}]);return a}();b.default.fn.toast=y._jQueryInterface;b.default.fn.toast.Constructor=y;b.default.fn.toast.noConflict=function(){b.default.fn.toast=n;return y._jQueryInterface};a.default=y;return a.default});
define ("theme_boost/bootstrap/carousel",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function i(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function j(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function k(a,b,c){if(b)j(a.prototype,b);if(c)j(a,c);return a}var l="bs.carousel",m=".".concat(l),n=".data-api",o=b.default.fn.carousel,p={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},q={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},r="next",s="prev",t="slide".concat(m),u="slid".concat(m),v="keydown".concat(m),w="mouseenter".concat(m),x="mouseleave".concat(m),y="touchstart".concat(m),z="touchmove".concat(m),A="touchend".concat(m),B="pointerdown".concat(m),C="pointerup".concat(m),D="dragstart".concat(m),E="load".concat(m).concat(n),F="click".concat(m).concat(n),G="active",H=".active.carousel-item",I={TOUCH:"touch",PEN:"pen"},J=function(){function a(b,c){i(this,a);this._items=null;this._interval=null;this._activeElement=null;this._isPaused=!1;this._isSliding=!1;this.touchTimeout=null;this.touchStartX=0;this.touchDeltaX=0;this._config=this._getConfig(c);this._element=b;this._indicatorsElement=this._element.querySelector(".carousel-indicators");this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints;this._pointerEvent=!!(window.PointerEvent||window.MSPointerEvent);this._addEventListeners()}k(a,[{key:"next",value:function next(){if(!this._isSliding){this._slide(r)}}},{key:"nextWhenVisible",value:function nextWhenVisible(){if(!document.hidden&&(0,b.default)(this._element).is(":visible")&&"hidden"!==(0,b.default)(this._element).css("visibility")){this.next()}}},{key:"prev",value:function prev(){if(!this._isSliding){this._slide(s)}}},{key:"pause",value:function pause(a){if(!a){this._isPaused=!0}if(this._element.querySelector(".carousel-item-next, .carousel-item-prev")){c.default.triggerTransitionEnd(this._element);this.cycle(!0)}clearInterval(this._interval);this._interval=null}},{key:"cycle",value:function cycle(a){if(!a){this._isPaused=!1}if(this._interval){clearInterval(this._interval);this._interval=null}if(this._config.interval&&!this._isPaused){this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval)}}},{key:"to",value:function to(a){var c=this;this._activeElement=this._element.querySelector(H);var d=this._getItemIndex(this._activeElement);if(a>this._items.length-1||0>a){return}if(this._isSliding){(0,b.default)(this._element).one(u,function(){return c.to(a)});return}if(d===a){this.pause();this.cycle();return}var e=a>d?r:s;this._slide(e,this._items[a])}},{key:"dispose",value:function dispose(){(0,b.default)(this._element).off(m);b.default.removeData(this._element,l);this._items=null;this._config=null;this._element=null;this._interval=null;this._isPaused=null;this._isSliding=null;this._activeElement=null;this._indicatorsElement=null}},{key:"_getConfig",value:function _getConfig(a){a=g({},p,{},a);c.default.typeCheckConfig("carousel",a,q);return a}},{key:"_handleSwipe",value:function _handleSwipe(){var a=Math.abs(this.touchDeltaX);if(a<=40){return}var b=a/this.touchDeltaX;this.touchDeltaX=0;if(0<b){this.prev()}if(0>b){this.next()}}},{key:"_addEventListeners",value:function _addEventListeners(){var a=this;if(this._config.keyboard){(0,b.default)(this._element).on(v,function(b){return a._keydown(b)})}if("hover"===this._config.pause){(0,b.default)(this._element).on(w,function(b){return a.pause(b)}).on(x,function(b){return a.cycle(b)})}if(this._config.touch){this._addTouchEventListeners()}}},{key:"_addTouchEventListeners",value:function _addTouchEventListeners(){var a=this;if(!this._touchSupported){return}var c=function(b){if(a._pointerEvent&&I[b.originalEvent.pointerType.toUpperCase()]){a.touchStartX=b.originalEvent.clientX}else if(!a._pointerEvent){a.touchStartX=b.originalEvent.touches[0].clientX}},d=function(b){if(b.originalEvent.touches&&1<b.originalEvent.touches.length){a.touchDeltaX=0}else{a.touchDeltaX=b.originalEvent.touches[0].clientX-a.touchStartX}},e=function(b){if(a._pointerEvent&&I[b.originalEvent.pointerType.toUpperCase()]){a.touchDeltaX=b.originalEvent.clientX-a.touchStartX}a._handleSwipe();if("hover"===a._config.pause){a.pause();if(a.touchTimeout){clearTimeout(a.touchTimeout)}a.touchTimeout=setTimeout(function(b){return a.cycle(b)},500+a._config.interval)}};(0,b.default)(this._element.querySelectorAll(".carousel-item img")).on(D,function(a){return a.preventDefault()});if(this._pointerEvent){(0,b.default)(this._element).on(B,function(a){return c(a)});(0,b.default)(this._element).on(C,function(a){return e(a)});this._element.classList.add("pointer-event")}else{(0,b.default)(this._element).on(y,function(a){return c(a)});(0,b.default)(this._element).on(z,function(a){return d(a)});(0,b.default)(this._element).on(A,function(a){return e(a)})}}},{key:"_keydown",value:function _keydown(a){if(/input|textarea/i.test(a.target.tagName)){return}switch(a.which){case 37:a.preventDefault();this.prev();break;case 39:a.preventDefault();this.next();break;default:}}},{key:"_getItemIndex",value:function _getItemIndex(a){this._items=a&&a.parentNode?[].slice.call(a.parentNode.querySelectorAll(".carousel-item")):[];return this._items.indexOf(a)}},{key:"_getItemByDirection",value:function _getItemByDirection(a,b){var c=this._getItemIndex(b),d=this._items.length-1;if((a===s&&0===c||a===r&&c===d)&&!this._config.wrap){return b}var e=a===s?-1:1,f=(c+e)%this._items.length;return-1===f?this._items[this._items.length-1]:this._items[f]}},{key:"_triggerSlideEvent",value:function _triggerSlideEvent(a,c){var d=this._getItemIndex(a),e=this._getItemIndex(this._element.querySelector(H)),f=b.default.Event(t,{relatedTarget:a,direction:c,from:e,to:d});(0,b.default)(this._element).trigger(f);return f}},{key:"_setActiveIndicatorElement",value:function _setActiveIndicatorElement(a){if(this._indicatorsElement){var c=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));(0,b.default)(c).removeClass(G);var d=this._indicatorsElement.children[this._getItemIndex(a)];if(d){(0,b.default)(d).addClass(G)}}}},{key:"_slide",value:function _slide(a,d){var e=this,f=this._element.querySelector(H),g=this._getItemIndex(f),h=d||f&&this._getItemByDirection(a,f),i=this._getItemIndex(h),j=!!this._interval,k,l,m;if(a===r){k="carousel-item-left";l="carousel-item-next";m="left"}else{k="carousel-item-right";l="carousel-item-prev";m="right"}if(h&&(0,b.default)(h).hasClass(G)){this._isSliding=!1;return}var n=this._triggerSlideEvent(h,m);if(n.isDefaultPrevented()){return}if(!f||!h){return}this._isSliding=!0;if(j){this.pause()}this._setActiveIndicatorElement(h);var o=b.default.Event(u,{relatedTarget:h,direction:m,from:g,to:i});if((0,b.default)(this._element).hasClass("slide")){(0,b.default)(h).addClass(l);c.default.reflow(h);(0,b.default)(f).addClass(k);(0,b.default)(h).addClass(k);var p=parseInt(h.getAttribute("data-interval"),10);if(p){this._config.defaultInterval=this._config.defaultInterval||this._config.interval;this._config.interval=p}else{this._config.interval=this._config.defaultInterval||this._config.interval}var q=c.default.getTransitionDurationFromElement(f);(0,b.default)(f).one(c.default.TRANSITION_END,function(){(0,b.default)(h).removeClass("".concat(k," ").concat(l)).addClass(G);(0,b.default)(f).removeClass("".concat(G," ").concat(l," ").concat(k));e._isSliding=!1;setTimeout(function(){return(0,b.default)(e._element).trigger(o)},0)}).emulateTransitionEnd(q)}else{(0,b.default)(f).removeClass(G);(0,b.default)(h).addClass(G);this._isSliding=!1;(0,b.default)(this._element).trigger(o)}if(j){this.cycle()}}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this).data(l),f=g({},p,{},(0,b.default)(this).data());if("object"===e(c)){f=g({},f,{},c)}var h="string"==typeof c?c:f.slide;if(!d){d=new a(this,f);(0,b.default)(this).data(l,d)}if("number"==typeof c){d.to(c)}else if("string"==typeof h){if("undefined"==typeof d[h]){throw new TypeError("No method named \"".concat(h,"\""))}d[h]()}else if(f.interval&&f.ride){d.pause();d.cycle()}})}},{key:"_dataApiClickHandler",value:function _dataApiClickHandler(d){var e=c.default.getSelectorFromElement(this);if(!e){return}var f=(0,b.default)(e)[0];if(!f||!(0,b.default)(f).hasClass("carousel")){return}var h=g({},(0,b.default)(f).data(),{},(0,b.default)(this).data()),i=this.getAttribute("data-slide-to");if(i){h.interval=!1}a._jQueryInterface.call((0,b.default)(f),h);if(i){(0,b.default)(f).data(l).to(i)}d.preventDefault()}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"Default",get:function get(){return p}}]);return a}();(0,b.default)(document).on(F,"[data-slide], [data-slide-to]",J._dataApiClickHandler);(0,b.default)(window).on(E,function(){for(var a=[].slice.call(document.querySelectorAll("[data-ride=\"carousel\"]")),c=0,d=a.length,e;c<d;c++){e=(0,b.default)(a[c]);J._jQueryInterface.call(e,e.data())}});b.default.fn.carousel=J._jQueryInterface;b.default.fn.carousel.Constructor=J;b.default.fn.carousel.noConflict=function(){b.default.fn.carousel=o;return J._jQueryInterface};a.default=J;return a.default});
define ("theme_boost/bootstrap/dropdown",["exports","jquery","core/popper","./util"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=e(b);c=e(c);d=e(d);function e(a){return a&&a.__esModule?a:{default:a}}function f(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){f=function(a){return typeof a}}else{f=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return f(a)}function g(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function h(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){g(Object(c),!0).forEach(function(b){i(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{g(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function i(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function j(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function k(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function l(a,b,c){if(b)k(a.prototype,b);if(c)k(a,c);return a}var m="bs.dropdown",n=".".concat(m),o=".data-api",p=b.default.fn.dropdown,q=27,r=32,s=9,t=38,u=40,v=new RegExp("".concat(t,"|").concat(u,"|").concat(q)),w="hide".concat(n),x="hidden".concat(n),y="show".concat(n),z="shown".concat(n),A="click".concat(n),B="click".concat(n).concat(o),C="keydown".concat(n).concat(o),D="keyup".concat(n).concat(o),E="disabled",F="show",G="dropdown-menu-right",H="[data-toggle=\"dropdown\"]",I=".dropdown-menu",J={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},K={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},L=function(){function a(b,c){j(this,a);this._element=b;this._popper=null;this._config=this._getConfig(c);this._menu=this._getMenuElement();this._inNavbar=this._detectNavbar();this._addEventListeners()}l(a,[{key:"toggle",value:function toggle(){if(this._element.disabled||(0,b.default)(this._element).hasClass(E)){return}var c=(0,b.default)(this._menu).hasClass(F);a._clearMenus();if(c){return}this.show(!0)}},{key:"show",value:function show(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:!1;if(this._element.disabled||(0,b.default)(this._element).hasClass(E)||(0,b.default)(this._menu).hasClass(F)){return}var f={relatedTarget:this._element},g=b.default.Event(y,f),h=a._getParentFromElement(this._element);(0,b.default)(h).trigger(g);if(g.isDefaultPrevented()){return}if(!this._inNavbar&&e){if("undefined"==typeof c.default){throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)")}var i=this._element;if("parent"===this._config.reference){i=h}else if(d.default.isElement(this._config.reference)){i=this._config.reference;if("undefined"!=typeof this._config.reference.jquery){i=this._config.reference[0]}}if("scrollParent"!==this._config.boundary){(0,b.default)(h).addClass("position-static")}this._popper=new c.default(i,this._menu,this._getPopperConfig())}if("ontouchstart"in document.documentElement&&0===(0,b.default)(h).closest(".navbar-nav").length){(0,b.default)(document.body).children().on("mouseover",null,b.default.noop)}this._element.focus();this._element.setAttribute("aria-expanded",!0);(0,b.default)(this._menu).toggleClass(F);(0,b.default)(h).toggleClass(F).trigger(b.default.Event(z,f))}},{key:"hide",value:function hide(){if(this._element.disabled||(0,b.default)(this._element).hasClass(E)||!(0,b.default)(this._menu).hasClass(F)){return}var c={relatedTarget:this._element},d=b.default.Event(w,c),e=a._getParentFromElement(this._element);(0,b.default)(e).trigger(d);if(d.isDefaultPrevented()){return}if(this._popper){this._popper.destroy()}(0,b.default)(this._menu).toggleClass(F);(0,b.default)(e).toggleClass(F).trigger(b.default.Event(x,c))}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,m);(0,b.default)(this._element).off(n);this._element=null;this._menu=null;if(null!==this._popper){this._popper.destroy();this._popper=null}}},{key:"update",value:function update(){this._inNavbar=this._detectNavbar();if(null!==this._popper){this._popper.scheduleUpdate()}}},{key:"_addEventListeners",value:function _addEventListeners(){var a=this;(0,b.default)(this._element).on(A,function(b){b.preventDefault();b.stopPropagation();a.toggle()})}},{key:"_getConfig",value:function _getConfig(a){a=h({},this.constructor.Default,{},(0,b.default)(this._element).data(),{},a);d.default.typeCheckConfig("dropdown",a,this.constructor.DefaultType);return a}},{key:"_getMenuElement",value:function _getMenuElement(){if(!this._menu){var b=a._getParentFromElement(this._element);if(b){this._menu=b.querySelector(I)}}return this._menu}},{key:"_getPlacement",value:function _getPlacement(){var a=(0,b.default)(this._element.parentNode),c="bottom-start";if(a.hasClass("dropup")){c=(0,b.default)(this._menu).hasClass(G)?"top-end":"top-start"}else if(a.hasClass("dropright")){c="right-start"}else if(a.hasClass("dropleft")){c="left-start"}else if((0,b.default)(this._menu).hasClass(G)){c="bottom-end"}return c}},{key:"_detectNavbar",value:function _detectNavbar(){return 0<(0,b.default)(this._element).closest(".navbar").length}},{key:"_getOffset",value:function _getOffset(){var a=this,b={};if("function"==typeof this._config.offset){b.fn=function(b){b.offsets=h({},b.offsets,{},a._config.offset(b.offsets,a._element)||{});return b}}else{b.offset=this._config.offset}return b}},{key:"_getPopperConfig",value:function _getPopperConfig(){var a={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};if("static"===this._config.display){a.modifiers.applyStyle={enabled:!1}}return h({},a,{},this._config.popperConfig)}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this).data(m),e="object"===f(c)?c:null;if(!d){d=new a(this,e);(0,b.default)(this).data(m,d)}if("string"==typeof c){if("undefined"==typeof d[c]){throw new TypeError("No method named \"".concat(c,"\""))}d[c]()}})}},{key:"_clearMenus",value:function _clearMenus(c){if(c&&(c.which===3||"keyup"===c.type&&c.which!==s)){return}for(var d=[].slice.call(document.querySelectorAll(H)),e=0,f=d.length;e<f;e++){var g=a._getParentFromElement(d[e]),h=(0,b.default)(d[e]).data(m),j={relatedTarget:d[e]};if(c&&"click"===c.type){j.clickEvent=c}if(!h){continue}var k=h._menu;if(!(0,b.default)(g).hasClass(F)){continue}if(c&&("click"===c.type&&/input|textarea/i.test(c.target.tagName)||"keyup"===c.type&&c.which===s)&&b.default.contains(g,c.target)){continue}var l=b.default.Event(w,j);(0,b.default)(g).trigger(l);if(l.isDefaultPrevented()){continue}if("ontouchstart"in document.documentElement){(0,b.default)(document.body).children().off("mouseover",null,b.default.noop)}d[e].setAttribute("aria-expanded","false");if(h._popper){h._popper.destroy()}(0,b.default)(k).removeClass(F);(0,b.default)(g).removeClass(F).trigger(b.default.Event(x,j))}}},{key:"_getParentFromElement",value:function _getParentFromElement(a){var b,c=d.default.getSelectorFromElement(a);if(c){b=document.querySelector(c)}return b||a.parentNode}},{key:"_dataApiKeydownHandler",value:function _dataApiKeydownHandler(c){if(/input|textarea/i.test(c.target.tagName)?c.which===r||c.which!==q&&(c.which!==u&&c.which!==t||(0,b.default)(c.target).closest(I).length):!v.test(c.which)){return}if(this.disabled||(0,b.default)(this).hasClass(E)){return}var d=a._getParentFromElement(this),e=(0,b.default)(d).hasClass(F);if(!e&&c.which===q){return}c.preventDefault();c.stopPropagation();if(!e||e&&(c.which===q||c.which===r)){if(c.which===q){(0,b.default)(d.querySelector(H)).trigger("focus")}(0,b.default)(this).trigger("click");return}var f=[].slice.call(d.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter(function(a){return(0,b.default)(a).is(":visible")});if(0===f.length){return}var g=f.indexOf(c.target);if(c.which===t&&0<g){g--}if(c.which===u&&g<f.length-1){g++}if(0>g){g=0}f[g].focus()}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"Default",get:function get(){return J}},{key:"DefaultType",get:function get(){return K}}]);return a}();(0,b.default)(document).on(C,H,L._dataApiKeydownHandler).on(C,I,L._dataApiKeydownHandler).on("".concat(B," ").concat(D),L._clearMenus).on(B,H,function(a){a.preventDefault();a.stopPropagation();L._jQueryInterface.call((0,b.default)(this),"toggle")}).on(B,".dropdown form",function(a){a.stopPropagation()});b.default.fn.dropdown=L._jQueryInterface;b.default.fn.dropdown.Constructor=L;b.default.fn.dropdown.noConflict=function(){b.default.fn.dropdown=p;return L._jQueryInterface};a.default=L;return a.default});
define ("theme_boost/bootstrap/tools/sanitizer",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.sanitizeHtml=function(a,c,d){if(0===a.length){return a}if(d&&"function"==typeof d){return d(a)}for(var e=new window.DOMParser,f=e.parseFromString(a,"text/html"),g=Object.keys(c),h=[].slice.call(f.body.querySelectorAll("*")),j=function(a){var d=h[a],e=d.nodeName.toLowerCase();if(-1===g.indexOf(d.nodeName.toLowerCase())){d.parentNode.removeChild(d);return"continue"}var f=[].slice.call(d.attributes),i=[].concat(c["*"]||[],c[e]||[]);f.forEach(function(a){if(!b(a,i)){d.removeAttribute(a.nodeName)}})},k=0,l=h.length,m;k<l;k++){m=j(k,l);if("continue"===m)continue}return f.body.innerHTML};a.DefaultWhitelist=void 0;var c=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"];a.DefaultWhitelist={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};function b(a,b){var d=a.nodeName.toLowerCase();if(-1!==b.indexOf(d)){if(-1!==c.indexOf(d)){return!!(a.nodeValue.match(/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi)||a.nodeValue.match(/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i))}return!0}for(var e=b.filter(function(a){return a instanceof RegExp}),f=0,g=e.length;f<g;f++){if(d.match(e[f])){return!0}}return!1}});
define ("theme_boost/bootstrap/modal",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function i(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function j(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function k(a,b,c){if(b)j(a.prototype,b);if(c)j(a,c);return a}var l="bs.modal",m=".".concat(l),n=b.default.fn.modal,o=27,p={backdrop:!0,keyboard:!0,focus:!0,show:!0},q={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},r="hide".concat(m),s="hidePrevented".concat(m),t="hidden".concat(m),u="show".concat(m),v="shown".concat(m),w="focusin".concat(m),x="resize".concat(m),y="click.dismiss".concat(m),z="keydown.dismiss".concat(m),A="mouseup.dismiss".concat(m),B="mousedown.dismiss".concat(m),C="click".concat(m).concat(".data-api"),D="modal-open",E="fade",F="show",G="modal-static",H=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",I=".sticky-top",J=function(){function a(b,c){i(this,a);this._config=this._getConfig(c);this._element=b;this._dialog=b.querySelector(".modal-dialog");this._backdrop=null;this._isShown=!1;this._isBodyOverflowing=!1;this._ignoreBackdropClick=!1;this._isTransitioning=!1;this._scrollbarWidth=0}k(a,[{key:"toggle",value:function toggle(a){return this._isShown?this.hide():this.show(a)}},{key:"show",value:function show(a){var c=this;if(this._isShown||this._isTransitioning){return}if((0,b.default)(this._element).hasClass(E)){this._isTransitioning=!0}var d=b.default.Event(u,{relatedTarget:a});(0,b.default)(this._element).trigger(d);if(this._isShown||d.isDefaultPrevented()){return}this._isShown=!0;this._checkScrollbar();this._setScrollbar();this._adjustDialog();this._setEscapeEvent();this._setResizeEvent();(0,b.default)(this._element).on(y,"[data-dismiss=\"modal\"]",function(a){return c.hide(a)});(0,b.default)(this._dialog).on(B,function(){(0,b.default)(c._element).one(A,function(a){if((0,b.default)(a.target).is(c._element)){c._ignoreBackdropClick=!0}})});this._showBackdrop(function(){return c._showElement(a)})}},{key:"hide",value:function hide(a){var d=this;if(a){a.preventDefault()}if(!this._isShown||this._isTransitioning){return}var e=b.default.Event(r);(0,b.default)(this._element).trigger(e);if(!this._isShown||e.isDefaultPrevented()){return}this._isShown=!1;var f=(0,b.default)(this._element).hasClass(E);if(f){this._isTransitioning=!0}this._setEscapeEvent();this._setResizeEvent();(0,b.default)(document).off(w);(0,b.default)(this._element).removeClass(F);(0,b.default)(this._element).off(y);(0,b.default)(this._dialog).off(B);if(f){var g=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,function(a){return d._hideModal(a)}).emulateTransitionEnd(g)}else{this._hideModal()}}},{key:"dispose",value:function dispose(){[window,this._element,this._dialog].forEach(function(a){return(0,b.default)(a).off(m)});(0,b.default)(document).off(w);b.default.removeData(this._element,l);this._config=null;this._element=null;this._dialog=null;this._backdrop=null;this._isShown=null;this._isBodyOverflowing=null;this._ignoreBackdropClick=null;this._isTransitioning=null;this._scrollbarWidth=null}},{key:"handleUpdate",value:function handleUpdate(){this._adjustDialog()}},{key:"_getConfig",value:function _getConfig(a){a=g({},p,{},a);c.default.typeCheckConfig("modal",a,q);return a}},{key:"_triggerBackdropTransition",value:function _triggerBackdropTransition(){var a=this;if("static"===this._config.backdrop){var d=b.default.Event(s);(0,b.default)(this._element).trigger(d);if(d.defaultPrevented){return}this._element.classList.add(G);var e=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,function(){a._element.classList.remove(G)}).emulateTransitionEnd(e);this._element.focus()}else{this.hide()}}},{key:"_showElement",value:function _showElement(a){var d=this,e=(0,b.default)(this._element).hasClass(E),f=this._dialog?this._dialog.querySelector(".modal-body"):null;if(!this._element.parentNode||this._element.parentNode.nodeType!==Node.ELEMENT_NODE){document.body.appendChild(this._element)}this._element.style.display="block";this._element.removeAttribute("aria-hidden");this._element.setAttribute("aria-modal",!0);if((0,b.default)(this._dialog).hasClass("modal-dialog-scrollable")&&f){f.scrollTop=0}else{this._element.scrollTop=0}if(e){c.default.reflow(this._element)}(0,b.default)(this._element).addClass(F);if(this._config.focus){this._enforceFocus()}var g=b.default.Event(v,{relatedTarget:a}),h=function(){if(d._config.focus){d._element.focus()}d._isTransitioning=!1;(0,b.default)(d._element).trigger(g)};if(e){var i=c.default.getTransitionDurationFromElement(this._dialog);(0,b.default)(this._dialog).one(c.default.TRANSITION_END,h).emulateTransitionEnd(i)}else{h()}}},{key:"_enforceFocus",value:function _enforceFocus(){var a=this;(0,b.default)(document).off(w).on(w,function(c){if(document!==c.target&&a._element!==c.target&&0===(0,b.default)(a._element).has(c.target).length){a._element.focus()}})}},{key:"_setEscapeEvent",value:function _setEscapeEvent(){var a=this;if(this._isShown){(0,b.default)(this._element).on(z,function(b){if(a._config.keyboard&&b.which===o){b.preventDefault();a.hide()}else if(!a._config.keyboard&&b.which===o){a._triggerBackdropTransition()}})}else if(!this._isShown){(0,b.default)(this._element).off(z)}}},{key:"_setResizeEvent",value:function _setResizeEvent(){var a=this;if(this._isShown){(0,b.default)(window).on(x,function(b){return a.handleUpdate(b)})}else{(0,b.default)(window).off(x)}}},{key:"_hideModal",value:function _hideModal(){var a=this;this._element.style.display="none";this._element.setAttribute("aria-hidden",!0);this._element.removeAttribute("aria-modal");this._isTransitioning=!1;this._showBackdrop(function(){(0,b.default)(document.body).removeClass(D);a._resetAdjustments();a._resetScrollbar();(0,b.default)(a._element).trigger(t)})}},{key:"_removeBackdrop",value:function _removeBackdrop(){if(this._backdrop){(0,b.default)(this._backdrop).remove();this._backdrop=null}}},{key:"_showBackdrop",value:function _showBackdrop(a){var d=this,e=(0,b.default)(this._element).hasClass(E)?E:"";if(this._isShown&&this._config.backdrop){this._backdrop=document.createElement("div");this._backdrop.className="modal-backdrop";if(e){this._backdrop.classList.add(e)}(0,b.default)(this._backdrop).appendTo(document.body);(0,b.default)(this._element).on(y,function(a){if(d._ignoreBackdropClick){d._ignoreBackdropClick=!1;return}if(a.target!==a.currentTarget){return}d._triggerBackdropTransition()});if(e){c.default.reflow(this._backdrop)}(0,b.default)(this._backdrop).addClass(F);if(!a){return}if(!e){a();return}var f=c.default.getTransitionDurationFromElement(this._backdrop);(0,b.default)(this._backdrop).one(c.default.TRANSITION_END,a).emulateTransitionEnd(f)}else if(!this._isShown&&this._backdrop){(0,b.default)(this._backdrop).removeClass(F);var g=function(){d._removeBackdrop();if(a){a()}};if((0,b.default)(this._element).hasClass(E)){var h=c.default.getTransitionDurationFromElement(this._backdrop);(0,b.default)(this._backdrop).one(c.default.TRANSITION_END,g).emulateTransitionEnd(h)}else{g()}}else if(a){a()}}},{key:"_adjustDialog",value:function _adjustDialog(){var a=this._element.scrollHeight>document.documentElement.clientHeight;if(!this._isBodyOverflowing&&a){this._element.style.paddingLeft="".concat(this._scrollbarWidth,"px")}if(this._isBodyOverflowing&&!a){this._element.style.paddingRight="".concat(this._scrollbarWidth,"px")}}},{key:"_resetAdjustments",value:function _resetAdjustments(){this._element.style.paddingLeft="";this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function _checkScrollbar(){var a=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(a.left+a.right)<window.innerWidth;this._scrollbarWidth=this._getScrollbarWidth()}},{key:"_setScrollbar",value:function _setScrollbar(){var a=this;if(this._isBodyOverflowing){var c=[].slice.call(document.querySelectorAll(H)),d=[].slice.call(document.querySelectorAll(I));(0,b.default)(c).each(function(c,d){var e=d.style.paddingRight,f=(0,b.default)(d).css("padding-right");(0,b.default)(d).data("padding-right",e).css("padding-right","".concat(parseFloat(f)+a._scrollbarWidth,"px"))});(0,b.default)(d).each(function(c,d){var e=d.style.marginRight,f=(0,b.default)(d).css("margin-right");(0,b.default)(d).data("margin-right",e).css("margin-right","".concat(parseFloat(f)-a._scrollbarWidth,"px"))});var e=document.body.style.paddingRight,f=(0,b.default)(document.body).css("padding-right");(0,b.default)(document.body).data("padding-right",e).css("padding-right","".concat(parseFloat(f)+this._scrollbarWidth,"px"))}(0,b.default)(document.body).addClass(D)}},{key:"_resetScrollbar",value:function _resetScrollbar(){var a=[].slice.call(document.querySelectorAll(H));(0,b.default)(a).each(function(a,c){var d=(0,b.default)(c).data("padding-right");(0,b.default)(c).removeData("padding-right");c.style.paddingRight=d?d:""});var c=[].slice.call(document.querySelectorAll("".concat(I)));(0,b.default)(c).each(function(a,c){var d=(0,b.default)(c).data("margin-right");if("undefined"!=typeof d){(0,b.default)(c).css("margin-right",d).removeData("margin-right")}});var d=(0,b.default)(document.body).data("padding-right");(0,b.default)(document.body).removeData("padding-right");document.body.style.paddingRight=d?d:""}},{key:"_getScrollbarWidth",value:function _getScrollbarWidth(){var a=document.createElement("div");a.className="modal-scrollbar-measure";document.body.appendChild(a);var b=a.getBoundingClientRect().width-a.clientWidth;document.body.removeChild(a);return b}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c,d){return this.each(function(){var f=(0,b.default)(this).data(l),h=g({},p,{},(0,b.default)(this).data(),{},"object"===e(c)&&c?c:{});if(!f){f=new a(this,h);(0,b.default)(this).data(l,f)}if("string"==typeof c){if("undefined"==typeof f[c]){throw new TypeError("No method named \"".concat(c,"\""))}f[c](d)}else if(h.show){f.show(d)}})}},{key:"VERSION",get:function get(){return"4.5.0"}},{key:"Default",get:function get(){return p}}]);return a}();(0,b.default)(document).on(C,"[data-toggle=\"modal\"]",function(a){var d=this,e,f=c.default.getSelectorFromElement(this);if(f){e=document.querySelector(f)}var h=(0,b.default)(e).data(l)?"toggle":g({},(0,b.default)(e).data(),{},(0,b.default)(this).data());if("A"===this.tagName||"AREA"===this.tagName){a.preventDefault()}var i=(0,b.default)(e).one(u,function(a){if(a.isDefaultPrevented()){return}i.one(t,function(){if((0,b.default)(d).is(":visible")){d.focus()}})});J._jQueryInterface.call((0,b.default)(e),h,this)});b.default.fn.modal=J._jQueryInterface;b.default.fn.modal.Constructor=J;b.default.fn.modal.noConflict=function(){b.default.fn.modal=n;return J._jQueryInterface};a.default=J;return a.default});
define ("theme_boost/bootstrap/index",["exports","./alert","./button","./carousel","./collapse","./dropdown","./modal","./popover","./scrollspy","./tab","./toast","./tooltip","./util"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"Alert",{enumerable:!0,get:function get(){return b.default}});Object.defineProperty(a,"Button",{enumerable:!0,get:function get(){return c.default}});Object.defineProperty(a,"Carousel",{enumerable:!0,get:function get(){return d.default}});Object.defineProperty(a,"Collapse",{enumerable:!0,get:function get(){return e.default}});Object.defineProperty(a,"Dropdown",{enumerable:!0,get:function get(){return f.default}});Object.defineProperty(a,"Modal",{enumerable:!0,get:function get(){return g.default}});Object.defineProperty(a,"Popover",{enumerable:!0,get:function get(){return h.default}});Object.defineProperty(a,"Scrollspy",{enumerable:!0,get:function get(){return i.default}});Object.defineProperty(a,"Tab",{enumerable:!0,get:function get(){return j.default}});Object.defineProperty(a,"Toast",{enumerable:!0,get:function get(){return k.default}});Object.defineProperty(a,"Tooltip",{enumerable:!0,get:function get(){return l.default}});Object.defineProperty(a,"Util",{enumerable:!0,get:function get(){return m.default}});b=n(b);c=n(c);d=n(d);e=n(e);f=n(f);g=n(g);h=n(h);i=n(i);j=n(j);k=n(k);l=n(l);m=n(m);function n(a){return a&&a.__esModule?a:{default:a}}});
define ("theme_boost/bootstrap/util",["exports","jquery"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){if(null===a||"undefined"==typeof a){return"".concat(a)}return{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase()}function d(){return{bindType:"transitionend",delegateType:"transitionend",handle:function handle(a){if((0,b.default)(a.target).is(this)){return a.handleObj.handler.apply(this,arguments)}}}}function e(a){var c=this,d=!1;(0,b.default)(this).one(g.TRANSITION_END,function(){d=!0});setTimeout(function(){if(!d){g.triggerTransitionEnd(c)}},a);return this}function f(){b.default.fn.emulateTransitionEnd=e;b.default.event.special[g.TRANSITION_END]=d()}var g={TRANSITION_END:"bsTransitionEnd",getUID:function getUID(a){do{a+=~~(Math.random()*1e6)}while(document.getElementById(a));return a},getSelectorFromElement:function getSelectorFromElement(a){var b=a.getAttribute("data-target");if(!b||"#"===b){var c=a.getAttribute("href");b=c&&"#"!==c?c.trim():""}try{return document.querySelector(b)?b:null}catch(a){return null}},getTransitionDurationFromElement:function getTransitionDurationFromElement(a){if(!a){return 0}var c=(0,b.default)(a).css("transition-duration"),d=(0,b.default)(a).css("transition-delay"),e=parseFloat(c),f=parseFloat(d);if(!e&&!f){return 0}c=c.split(",")[0];d=d.split(",")[0];return(parseFloat(c)+parseFloat(d))*1e3},reflow:function reflow(a){return a.offsetHeight},triggerTransitionEnd:function triggerTransitionEnd(a){(0,b.default)(a).trigger("transitionend")},supportsTransitionEnd:function supportsTransitionEnd(){return!0},isElement:function isElement(a){return(a[0]||a).nodeType},typeCheckConfig:function typeCheckConfig(a,b,d){for(var i in d){if(Object.prototype.hasOwnProperty.call(d,i)){var e=d[i],f=b[i],h=f&&g.isElement(f)?"element":c(f);if(!new RegExp(e).test(h)){throw new Error("".concat(a.toUpperCase(),": ")+"Option \"".concat(i,"\" provided type \"").concat(h,"\" ")+"but expected type \"".concat(e,"\"."))}}}},findShadowRoot:function findShadowRoot(a){if(!document.documentElement.attachShadow){return null}if("function"==typeof a.getRootNode){var b=a.getRootNode();return b instanceof ShadowRoot?b:null}if(a instanceof ShadowRoot){return a}if(!a.parentNode){return null}return g.findShadowRoot(a.parentNode)},jQueryDetection:function jQueryDetection(){if("undefined"==typeof b.default){throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.")}var a=b.default.fn.jquery.split(" ")[0].split("."),c=9;if(a[0]<2&&a[1]<c||a[0]===1&&a[1]===c&&a[2]<1||a[0]>=4){throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}}};g.jQueryDetection();f();a.default=g;return a.default});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("theme_boost/loader",["exports","jquery","./aria","./bootstrap/index","core/pending","./scroll","./pending"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"Bootstrap",{enumerable:!0,get:function get(){return d.default}});b=j(b);c=i(c);d=j(d);e=j(e);f=j(f);g=j(g);function h(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;h=function(){return a};return a}function i(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=h();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function j(a){return a&&a.__esModule?a:{default:a}}var k=function(){(0,b.default)("a[data-toggle=\"tab\"]").on("shown.bs.tab",function(a){var c=(0,b.default)(a.target).attr("href");if(history.replaceState){history.replaceState(null,null,c)}else{location.hash=c}});var a=window.location.hash;if(a){var c=document.querySelector(".nav-link[href=\""+a+"\"]");if(c){c.click()}}},l=function(){(0,b.default)("body").popover({container:"body",selector:"[data-toggle=\"popover\"]",trigger:"focus"});document.addEventListener("keydown",function(a){if("Escape"===a.key&&a.target.closest("[data-toggle=\"popover\"]")){(0,b.default)(a.target).popover("hide")}})},m=function(){(0,b.default)("body").tooltip({container:"body",selector:"[data-toggle=\"tooltip\"]"})},n=new e.default("theme_boost/loader:init");(0,g.default)();c.init();k();l();m();new f.default().init();b.default.fn.dropdown.Constructor.Default.flip=!1;n.resolve()});
define ("theme_boost/drawer",["jquery","core/custom_interaction_events","core/log","core/pubsub","core/aria"],function(a,b,c,d,e){var f={TOGGLE_REGION:"[data-region=\"drawer-toggle\"]",TOGGLE_ACTION:"[data-action=\"toggle-drawer\"]",TOGGLE_TARGET:"aria-controls",TOGGLE_SIDE:"left",BODY:"body",SECTION:".list-group-item[href*=\"#section-\"]",DRAWER:"#nav-drawer"},g=768>a(document).width(),h=function(){if(!a(f.TOGGLE_REGION).length){c.debug("Page is missing a drawer region")}if(!a(f.TOGGLE_ACTION).length){c.debug("Page is missing a drawer toggle link")}a(f.TOGGLE_REGION).each(function(b,c){var d=a(c).find(f.TOGGLE_ACTION),e=d.attr("aria-controls"),h=a(document.getElementById(e)),i="false"==d.attr("aria-expanded"),j=d.attr("data-side"),k=a(f.BODY),l=d.attr("data-preference");if(g){M.util.set_user_preference(l,"false")}h.on("mousewheel DOMMouseScroll",this.preventPageScroll);if(!i){k.addClass("drawer-open-"+j);d.attr("aria-expanded","true")}else{d.attr("aria-expanded","false")}}.bind(this));this.registerEventListeners();if(g){this.closeAll()}};h.prototype.closeAll=function(){a(f.TOGGLE_REGION).each(function(b,c){var d=a(c).find(f.TOGGLE_ACTION),h=d.attr("data-side"),i=a(f.BODY),j=d.attr("aria-controls"),k=a(document.getElementById(j)),l=d.attr("data-preference");d.attr("aria-expanded","false");i.removeClass("drawer-open-"+h);e.hide(k.get());k.addClass("closed");if(!g){M.util.set_user_preference(l,"false")}})};h.prototype.toggleDrawer=function(b){var c=a(b.target).closest("[data-action=toggle-drawer]"),h=c.attr("aria-controls"),i=a(document.getElementById(h)),j=a(f.BODY),k=c.attr("data-side"),l=c.attr("data-preference");if(g){M.util.set_user_preference(l,"false")}j.addClass("drawer-ease");var m="true"==c.attr("aria-expanded");if(!m){c.attr("aria-expanded","true");e.unhide(i.get());i.focus();j.addClass("drawer-open-"+k);i.removeClass("closed");if(!g){M.util.set_user_preference(l,"true")}}else{j.removeClass("drawer-open-"+k);c.attr("aria-expanded","false");i.addClass("closed").delay(500).queue(function(){if(a(this).hasClass("closed")){e.hide(this)}a(this).dequeue()});if(!g){M.util.set_user_preference(l,"false")}}d.publish("nav-drawer-toggle-start",m)};h.prototype.preventPageScroll=function(b){var c=b.wheelDelta||b.originalEvent&&b.originalEvent.wheelDelta||-b.originalEvent.detail,d=0<=this.scrollTop+a(this).outerHeight()-this.scrollHeight,e=0>=this.scrollTop;if(0>c&&d||0<c&&e){b.preventDefault()}};h.prototype.registerEventListeners=function(){a(f.TOGGLE_ACTION).each(function(c,d){b.define(a(d),[b.events.activate]);a(d).on(b.events.activate,function(a,b){this.toggleDrawer(b.originalEvent);b.originalEvent.preventDefault()}.bind(this))}.bind(this));a(f.SECTION).click(function(){if(g){this.closeAll()}}.bind(this));a(f.DRAWER).on("webkitTransitionEnd msTransitionEnd transitionend",function(b){var c=a(b.target).closest(f.DRAWER),e=!!c.attr("aria-hidden");d.publish("nav-drawer-toggle-end",e)})};return{init:function init(){return new h}}});
define ("theme_boost/toast",["exports","./bootstrap/toast"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"Toast",{enumerable:!0,get:function get(){return b.default}});b=function(a){return a&&a.__esModule?a:{default:a}}(b)});
define ("theme_boost/aria",["exports","jquery","core/pending"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}var e=function(){var a=!1,d=function(){a=!0},e=function(){var b=a;a=!1;return b};document.addEventListener("keydown",function(a){if(a.target.matches("[data-toggle=\"dropdown\"]")){var b=a.key;if("ArrowUp"==b){d()}if(" "==b||"Enter"==b){a.preventDefault();a.target.click()}}});var f=function(a){setTimeout(function delayedFocus(b){a.focus();b.resolve()},50,new c.default("core/aria:delayed-focus"))};(0,b.default)(".dropdown").on("shown.bs.dropdown",function(a){var b=a.target.querySelector("[role=\"menu\"]"),c=!1,d=!1;if(b){c=b.querySelectorAll("[role=\"menuitem\"]")}if(c&&0<c.length){if(e()){d=c[c.length-1]}else{d=c[0]}}if(d){f(d)}});document.addEventListener("keypress",function(a){if(a.target.matches(".dropdown [role=\"menu\"] [role=\"menuitem\"]")){var g=a.target.closest("[role=\"menu\"]");if(!g){return}var h=g.querySelectorAll("[role=\"menuitem\"]");if(!h){return}for(var b=a.key.toLowerCase(),c=0;c<h.length;c++){var d=h[c],e=d.text.trim().toLowerCase();if(0==e.indexOf(b)){f(d);break}}}});document.addEventListener("keydown",function(a){if(a.target.matches(".dropdown [role=\"menu\"] [role=\"menuitem\"]")){var b=a.key,c=!1,d=a.target.closest("[role=\"menu\"]");if(!d){return}var e=d.querySelectorAll("[role=\"menuitem\"]");if(!e){return}if("ArrowDown"==b){for(var g=0;g<e.length-1;g++){if(e[g]==a.target){c=e[g+1];break}}if(!c){c=e[0]}}else if("ArrowUp"==b){for(var h=1;h<e.length;h++){if(e[h]==a.target){c=e[h-1];break}}if(!c){c=e[e.length-1]}}else if("Home"==b){c=e[0]}else if("End"==b){c=e[e.length-1]}if(c){a.preventDefault();f(c)}}});(0,b.default)(".dropdown").on("hidden.bs.dropdown",function(a){var b=a.target.querySelector("[data-toggle=\"dropdown\"]");if(b){f(b)}})},f=function(){window.addEventListener("load",function(){var a=document.querySelectorAll("[data-aria-autofocus=\"true\"][role=\"alert\"]");Array.prototype.forEach.call(a,function(a){a.innerHTML+=" ";a.removeAttribute("data-aria-autofocus")})})},g=function(a){for(var c=a.target.closest("[role=\"tablist\"]"),d="vertical"==c.getAttribute("aria-orientation"),e=window.right_to_left(),f=d?"ArrowDown":e?"ArrowLeft":"ArrowRight",g=d?"ArrowUp":e?"ArrowRight":"ArrowLeft",h=Array.prototype.filter.call(c.querySelectorAll("[role=\"tab\"]"),function(a){return"none"!==getComputedStyle(a).display}),j=0;j<h.length;j++){h[j].index=j}switch(a.key){case f:a.preventDefault();if(a.target.index!==void 0&&h[a.target.index+1]){h[a.target.index+1].focus()}else{h[0].focus()}break;case g:a.preventDefault();if(a.target.index!==void 0&&h[a.target.index-1]){h[a.target.index-1].focus()}else{h[h.length-1].focus()}break;case"Home":a.preventDefault();h[0].focus();break;case"End":a.preventDefault();h[h.length-1].focus();break;case"Enter":case" ":a.preventDefault();(0,b.default)(a.target).tab("show");h.forEach(function(a){a.tabIndex=-1});a.target.tabIndex=0;}},h=function(){document.addEventListener("keydown",function(a){if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","Enter"," "].includes(a.key)){if(a.target.matches("[role=\"tablist\"] [role=\"tab\"]")){g(a)}}});document.addEventListener("click",function(a){if(a.target.matches("[role=\"tablist\"] [role=\"tab\"]")){var c=a.target.closest("[role=\"tablist\"]").querySelectorAll("[role=\"tab\"]");a.preventDefault();(0,b.default)(a.target).tab("show");c.forEach(function(a){a.tabIndex=-1});a.target.tabIndex=0}})};a.init=function init(){e();f();h()}});
define ("theme_boost/form-display-errors",["jquery","core/event"],function(a,b){return{enhance:function enhance(c){var d=document.getElementById(c);if(!d){return}a(d).on(b.Events.FORM_FIELD_VALIDATION,function(b,c){b.preventDefault();var e=a(d).closest(".form-group"),f=e.find(".form-control-feedback"),g=f.attr("id"),h=a(d).attr("aria-describedby");if("undefined"==typeof h){h=""}var i=[];if(h.length){i=h.split(" ")}var j=i.indexOf(g);if("TEXTAREA"==a(d).prop("tagName")&&e.find("[contenteditable]")){d=e.find("[contenteditable]")}if(""!==c){e.addClass("has-danger");e.data("client-validation-error",!0);a(d).addClass("is-invalid");if(-1===j){i.push(g);a(d).attr("aria-describedby",i.join(" "))}a(d).attr("aria-invalid",!0);f.attr("tabindex",0);f.html(c);if(!f.is(":visible")){f.show();f.focus()}}else{if(!0===e.data("client-validation-error")){e.removeClass("has-danger");e.data("client-validation-error",!1);a(d).removeClass("is-invalid");if(-1<j){i.splice(j,1)}if(i.length){h=i.join(" ");a(d).attr("aria-describedby",h)}else{a(d).removeAttr("aria-describedby")}a(d).attr("aria-invalid",!1);f.hide()}}});var e=d.closest("form");if(e&&!("boostFormErrorsEnhanced"in e.dataset)){e.addEventListener("submit",function(){var b=a(".form-control-feedback:visible");if(b.length){b[0].focus()}});e.dataset.boostFormErrorsEnhanced=1}}}});
define ("theme_moove/accessibilitybar",["jquery","core/ajax"],function(a,b){window.jQuery=a;var c={FONT_SIZE:"#fontsize_dec, #fontsize_reset, #fontsize_inc",SITE_COLOR:"#sitecolor_color1, #sitecolor_color2, #sitecolor_color3, #sitecolor_color4"},d=null,e=null,f=null,g=null,h=null,i=function(){var b=a("body").attr("class").split(/\s+/);a.each(b,function(a,b){if(b.includes("fontsize-inc-")||b.includes("fontsize-dec-")){var c=b.split("-");d=b;e=c[1];f=c[2]}});this.toggleFontsizeButtons();this.registerEventListeners()};i.prototype.registerEventListeners=function(){a(c.FONT_SIZE).click(function(b){var c=a(b.currentTarget);g=c.data("action");this.fontSize()}.bind(this));a(c.SITE_COLOR).click(function(b){var c=a(b.currentTarget);h=c.data("action");this.siteColor()}.bind(this))};i.prototype.fontSize=function(){var a=b.call([{methodname:"theme_moove_fontsize",args:{action:g}}]);a[0].done(function(){this.reloadFontsizeClass()}.bind(this))};i.prototype.reloadFontsizeClass=function(){if("reset"===g||"increase"===g&&"fontsize-dec-1"===d||"decrease"===g&&"fontsize-inc-1"===d){a("body").removeClass(d);d=null;e=null;f=null;this.toggleFontsizeButtons();return}if("increase"===g){if(null===f){d="fontsize-inc-1";e="inc";f=1}else if("inc"===e&&6>f){a("body").removeClass(d);f++;d="fontsize-inc-"+f}else if("dec"===e){a("body").removeClass(d);f--;d="fontsize-dec-"+f}a("body").addClass(d)}if("decrease"===g){if(null===f){d="fontsize-dec-1";e="dec";f=1}else if("dec"===e&&6>f){a("body").removeClass(d);f++;d="fontsize-dec-"+f}else if("inc"===e){a("body").removeClass(d);f--;d="fontsize-inc-"+f}a("body").addClass(d)}this.toggleFontsizeButtons()};i.prototype.toggleFontsizeButtons=function(){if(null===d){a("#fontsize_reset").addClass("disabled");a("#fontsize_inc").removeClass("disabled");a("#fontsize_dec").removeClass("disabled")}if(null!==d){a("#fontsize_reset").removeClass("disabled")}if("inc"===e){if(6==f){a("#fontsize_inc").addClass("disabled")}if(6>f){a("#fontsize_inc").removeClass("disabled")}}if("dec"===e){if(6==f){a("#fontsize_dec").addClass("disabled")}if(6>f){a("#fontsize_dec").removeClass("disabled")}}};i.prototype.siteColor=function(){var a=b.call([{methodname:"theme_moove_sitecolor",args:{action:h}}]);a[0].done(function(){this.reloadSitecolorClass()}.bind(this))};i.prototype.reloadSitecolorClass=function(){a("body").removeClass(function(a,b){return(b.match(/(^|\s)sitecolor-color-\S+/g)||[]).join(" ")});if("reset"!==h){a("body").addClass(h)}};return{init:function init(){return new i}}});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("theme_moove/metismenu",["exports","jquery"],function(a,b){'use strict';function c(a){return a&&"object"===_typeof(a)&&"default"in a?a["default"]:a}var b=c(require("jquery"));function d(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function e(a){for(var b=1;b<arguments.length;b++){var c=null!==arguments[b]?arguments[b]:{},e=Object.keys(c);if("function"==typeof Object.getOwnPropertySymbols){e=e.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))}e.forEach(function(b){d(a,b,c[b])})}return a}var f=function(a){var d={TRANSITION_END:"mmTransitionEnd",triggerTransitionEnd:function(b){a(b).trigger("transitionend")},supportsTransitionEnd:function(){return!0}};function b(){return{bindType:"transitionend",delegateType:"transitionend",handle:function(b){if(a(b.target).is(this)){return b.handleObj.handler.apply(this,arguments)}}}}function c(b){var c=this,e=!1;a(this).one(d.TRANSITION_END,function(){e=!0});setTimeout(function(){if(!e){d.triggerTransitionEnd(c)}},b);return this}(function(){a.fn.mmEmulateTransitionEnd=c;a.event.special[d.TRANSITION_END]=b()})();return d}(b),g=function(a){var b="metisMenu",c="."+b,d=a.fn.metisMenu,g=350,h={toggle:!0,preventDefault:!0,activeClass:"active",collapseClass:"collapse",collapseInClass:"in",collapsingClass:"collapsing",triggerElement:"a",parentTrigger:"li",subMenu:"ul"},i={SHOW:"show"+c,SHOWN:"shown"+c,HIDE:"hide"+c,HIDDEN:"hidden"+c,CLICK_DATA_API:"click"+c+".data-api"},j=function(){function c(a,b){this.element=a;this.config=e({},h,b);this.transitioning=null;this.init()}var d=c.prototype;d.init=function(){var b=this,c=this.config;a(this.element).find(c.parentTrigger+"."+c.activeClass).has(c.subMenu).children(c.subMenu).addClass(c.collapseClass+" "+c.collapseInClass);a(this.element).find(c.parentTrigger).not("."+c.activeClass).has(c.subMenu).children(c.subMenu).addClass(c.collapseClass);a(this.element).find(c.parentTrigger).has(c.subMenu).children(c.triggerElement).on(i.CLICK_DATA_API,function(d){var e=a(this),f=e.parent(c.parentTrigger),g=f.siblings(c.parentTrigger).children(c.triggerElement),h=f.children(c.subMenu);if(c.preventDefault){d.preventDefault()}if("true"===e.attr("aria-disabled")){return}if(f.hasClass(c.activeClass)){e.attr("aria-expanded",!1);b.hide(h)}else{b.show(h);e.attr("aria-expanded",!0);if(c.toggle){g.attr("aria-expanded",!1)}}if(c.onTransitionStart){c.onTransitionStart(d)}})};d.show=function(b){var c=this;if(this.transitioning||a(b).hasClass(this.config.collapsingClass)){return}var d=a(b),e=a.Event(i.SHOW);d.trigger(e);if(e.isDefaultPrevented()){return}d.parent(this.config.parentTrigger).addClass(this.config.activeClass);if(this.config.toggle){this.hide(d.parent(this.config.parentTrigger).siblings().children(this.config.subMenu+"."+this.config.collapseInClass))}d.removeClass(this.config.collapseClass).addClass(this.config.collapsingClass).height(0);this.setTransitioning(!0);d.height(b[0].scrollHeight).one(f.TRANSITION_END,function(){if(!c.config||!c.element){return}d.removeClass(c.config.collapsingClass).addClass(c.config.collapseClass+" "+c.config.collapseInClass).height("");c.setTransitioning(!1);d.trigger(i.SHOWN)}).mmEmulateTransitionEnd(g)};d.hide=function(b){var c=this;if(this.transitioning||!a(b).hasClass(this.config.collapseInClass)){return}var d=a(b),e=a.Event(i.HIDE);d.trigger(e);if(e.isDefaultPrevented()){return}d.parent(this.config.parentTrigger).removeClass(this.config.activeClass);d.addClass(this.config.collapsingClass).removeClass(this.config.collapseClass).removeClass(this.config.collapseInClass);this.setTransitioning(!0);var h=function(){if(!c.config||!c.element){return}if(c.transitioning&&c.config.onTransitionEnd){c.config.onTransitionEnd()}c.setTransitioning(!1);d.trigger(i.HIDDEN);d.removeClass(c.config.collapsingClass).addClass(c.config.collapseClass)};if(0===d.height()||"none"===d.css("display")){h()}else{d.height(0).one(f.TRANSITION_END,h).mmEmulateTransitionEnd(g)}};d.setTransitioning=function(a){this.transitioning=a};d.dispose=function(){a.removeData(this.element,b);a(this.element).find(this.config.parentTrigger).has(this.config.subMenu).children(this.config.triggerElement).off("click");this.transitioning=null;this.config=null;this.element=null};c.jQueryInterface=function(d){return this.each(function(){var f=a(this),g=f.data(b),i=e({},h,f.data(),"object"===_typeof(d)&&d?d:{});if(!g&&/dispose/.test(d)){this.dispose()}if(!g){g=new c(this,i);f.data(b,g)}if("string"==typeof d){if(g[d]===void 0){throw new Error("No method named \""+d+"\"")}g[d]()}})};return c}();a.fn.metisMenu=j.jQueryInterface;a.fn.metisMenu.Constructor=j;a.fn.metisMenu.noConflict=function(){a.fn.metisMenu=d;return j.jQueryInterface};return j}(b);a.default=g;return a.default});
define ("theme_moove/themesettings",["jquery","core/modal_factory","theme_moove/themesettings_modal"],function(a,b,c){var d={TOGGLE_REGION:"#themesettings-control"},e=function(){this.registerEventListeners()};e.prototype.openThemeSettings=function(){b.create({type:c.TYPE}).then(function(a){a.show()})};e.prototype.registerEventListeners=function(){a(d.TOGGLE_REGION).click(function(a){this.openThemeSettings(a);a.preventDefault()}.bind(this))};return{init:function init(){return new e}}});
define ("theme_moove/themesettings_modal",["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","core/ajax"],function(a,b,c,d,e,f){var g=!1,h={SAVE_BUTTON:"[data-action=\"save\"]",CANCEL_BUTTON:"[data-action=\"cancel\"]"},i=function(a){d.call(this,a);var b=f.call([{methodname:"theme_moove_getthemesettings",args:{}}]);b[0].done(function(a){document.getElementById("fonttype").value=a.fonttype;if(a.enableaccessibilitytoolbar){document.getElementById("enableaccessibilitytoolbar").checked=!0}})};i.TYPE="theme_moove-themesettings_modal";i.prototype=Object.create(d.prototype);i.prototype.constructor=i;i.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this);this.getModal().on(c.events.activate,h.SAVE_BUTTON,function(){var a=f.call([{methodname:"theme_moove_savethemesettings",args:{formdata:this.getFormData()}}]);a[0].done(function(){document.location.reload(!0)}.bind(this)).fail(function(a){var c=a.message;if(!c){c=a.error}b.addNotification({message:c,type:"error"});this.hide();this.destroy()}.bind(this))}.bind(this));this.getModal().on(c.events.activate,h.CANCEL_BUTTON,function(){this.hide();this.destroy()}.bind(this))};i.prototype.getFormData=function(){return this.getForm().serialize()};i.prototype.getForm=function(){return this.getBody().find("form")};if(!g){e.register(i.TYPE,i,"theme_moove/themesettings_modal");g=!0}return i});
function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("paygw_paypal/gateways_modal",["exports","./repository","core/templates","core/truncate","core/modal_factory","core/modal_events","core/str"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.process=void 0;b=j(b);c=h(c);d=h(d);e=h(e);f=h(f);function h(a){return a&&a.__esModule?a:{default:a}}function i(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;i=function(){return a};return a}function j(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=i();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function k(a,b){return r(a)||q(a,b)||m(a,b)||l()}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(a,b){if(!a)return;if("string"==typeof a)return p(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return p(a,b)}function p(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function q(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function r(a){if(Array.isArray(a))return a}function s(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function t(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){s(h,d,e,f,g,"next",a)}function g(a){s(h,d,e,f,g,"throw",a)}f(void 0)})}}var u=function(){var a=t(regeneratorRuntime.mark(function a(){var b;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.t0=e.default;a.next=3;return c.default.render("paygw_paypal/paypal_button_placeholder",{});case 3:a.t1=a.sent;a.t2={body:a.t1};a.next=7;return a.t0.create.call(a.t0,a.t2);case 7:b=a.sent;b.show();return a.abrupt("return",b);case 10:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),v=function(a,c,e,h){return Promise.all([u(),b.getConfigForJs(a,c,e)]).then(function(a){var b=k(a,2),c=b[0],d=b[1];c.getRoot().on(f.default.hidden,function(){c.destroy()});return Promise.all([c,d,w(d.clientid,d.currency)])}).then(function(i){var j=k(i,2),l=j[0],m=j[1];l.setBody("");return new Promise(function(i){window.paypal.Buttons({createOrder:function createOrder(a,b){return b.order.create({purchase_units:[{amount:{currency_code:m.currency_code,value:m.cost},description:d.default.truncate(h,{length:127,stripTags:!0})}],application_context:{shipping_preference:"NO_SHIPPING",brand_name:d.default.truncate(m.brandname,{length:127,stripTags:!0})}})},onApprove:function onApprove(d){l.getRoot().on(f.default.outsideClick,function(a){a.preventDefault()});l.setBody((0,g.get_string)("authorising","paygw_paypal"));b.markTransactionComplete(a,c,e,d.orderID).then(function(a){l.hide();return a}).then(i)}}).render(l.getBody()[0])})}).then(function(a){if(a.success){return Promise.resolve(a.message)}return Promise.reject(a.message)})};a.process=v;var w=function(a,b){var c="https://www.paypal.com/sdk/js?client-id=".concat(a,"&currency=").concat(b);if(w.currentlyloaded===c){return Promise.resolve()}if(w.currentlyloaded){var e=document.querySelector("script[src=\"".concat(w.currentlyloaded,"\"]"));if(e){e.parentNode.removeChild(e)}}var d=document.createElement("script");return new Promise(function(a){if(d.readyState){d.onreadystatechange=function(){if("complete"==this.readyState||"loaded"==this.readyState){this.onreadystatechange=null;a()}}}else{d.onload=function(){a()}}d.setAttribute("src",c);document.head.appendChild(d);w.currentlyloaded=c})};w.currentlyloaded=""});
define ("paygw_paypal/repository",["exports","core/ajax"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.markTransactionComplete=a.getConfigForJs=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c=function(a,c,d){return b.default.call([{methodname:"paygw_paypal_get_config_for_js",args:{component:a,paymentarea:c,itemid:d}}])[0]};a.getConfigForJs=c;var d=function(a,c,d,e){return b.default.call([{methodname:"paygw_paypal_create_transaction_complete",args:{component:a,paymentarea:c,itemid:d,orderid:e}}])[0]};a.markTransactionComplete=d});
define ("forumreport_summary/filters",["exports","jquery","core/popper","core/custom_interaction_events","forumreport_summary/selectors","core/yui","core/ajax","core/key_codes"],function(a,b,c,d,e,f,g,h){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=i(b);c=i(c);d=i(d);e=i(e);f=i(f);g=i(g);h=i(h);function i(a){return a&&a.__esModule?a:{default:a}}var j=function(a){var i=(0,b.default)(a);(0,b.default)(document).ready(function(){(0,b.default)(".loading-icon").hide();(0,b.default)("#summaryreport").removeClass("hidden")});var j=function(a,b){var c=document.forms.filtersform.action,d;if(a){a.preventDefault();var e=c.split("?"),f=e[1],g=b.split("&"),h="",i=[],j=[];f.split("&").forEach(function(a){var b=a.split("=");i.push(b[0]);j.push(b[1])});g.forEach(function(a){var b=a.split("="),c=i.indexOf(b[0]);if(-1<c){j[c]=b[1]}else{i.push(b[0]);j.push(b[1])}});i.forEach(function(a,b){h+="&".concat(a,"=").concat(j[b])});d=e[0]+"?"+h.substr(1)}else{d=c}document.forms.filtersform.action=d;document.forms.filtersform.submit()};(0,b.default)(".resettable").on("click","a",function(a){j(a,a.target.search.substr(1))});(0,b.default)("thead").on("click","a",function(a){j(a,a.target.search.substr(1))});(0,b.default)(".pagination").on("click","a",function(a){j(a,a.target.search.substr(1))});if(document.forms.selectperpage){document.forms.selectperpage.onsubmit=function(a){var b="perpage="+document.forms.selectperpage.elements.perpage.value;j(a,b)}}var k=document.getElementById("summaryreport").querySelector("form.dataformatselector");if(k){k.onsubmit=function(a){var b=k.querySelector("#downloadtype_download").value,c="download=".concat(b),d=document.forms.filtersform.action;j(a,c);document.forms.filtersform.action=d}}var l=function(a){f.default.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});(0,b.default)(a).addClass("hidden");j(!1)},m=function(a){var b=document.querySelector(a),d=document.querySelector(e.default.filters.date.calendar);d.style.removeProperty("z-index");new c.default(b,d,{placement:"bottom"})},n=function(a,b){b.classList.add("hidden");b.setAttribute("data-openfilter","false");a.classList.add("btn-primary");a.classList.remove("btn-outline-primary");a.setAttribute("aria-expanded",!1)};i.on(d.default.events.activate,e.default.filters.group.selectall,function(){var b=a.querySelectorAll(e.default.filters.group.checkbox+":not(:checked)");b.forEach(function(a){a.checked=!0})});i.on(d.default.events.activate,e.default.filters.group.clear,function(){var b=a.querySelectorAll(e.default.filters.group.checkbox+":checked");b.forEach(function(a){a.checked=!1})});i.on(d.default.events.activate,e.default.filters.group.trigger,function(){var b=a.querySelector(e.default.filters.group.trigger),d=a.querySelector(e.default.filters.group.popover);new c.default(b,d,{placement:"bottom"});d.classList.remove("hidden");d.setAttribute("data-openfilter","true");b.classList.add("btn-outline-primary");b.classList.remove("btn-primary");b.setAttribute("aria-expanded",!0);var f=function(a){if(a.target.id!==b.id&&d!==a.target.closest("[data-openfilter=\"true\"]")&&("undefined"==typeof a.keyCode||a.keyCode===h.default.enter||a.keyCode===h.default.space)){n(b,d);document.removeEventListener("click",f);document.removeEventListener("keyup",f);document.removeEventListener("keyup",g)}};document.addEventListener("click",f);document.addEventListener("keyup",f);var g=function(a){if(a.keyCode===h.default.escape){n(b,d);document.removeEventListener("keyup",g);document.removeEventListener("click",f)}};document.addEventListener("keyup",g)});i.on(d.default.events.activate,e.default.filters.group.save,function(){var b=a.querySelectorAll(e.default.filters.group.checkbox);b.forEach(function(a){var b=document.forms.filtersform,c=a.getAttribute("data-saveid");b.querySelector("#".concat(c)).checked=a.checked});l("#filter-groups-popover")});document.querySelectorAll(e.default.filters.exportlink.link).forEach(function(a){a.addEventListener("click",function(a){document.forms.exportlinkform.action=a.target.dataset.url;document.forms.exportlinkform.submit()})});i.on(d.default.events.activate,e.default.filters.date.trigger,function(){var b=a.querySelector(e.default.filters.date.trigger),d=a.querySelector(e.default.filters.date.popover);new c.default(b,d,{placement:"bottom"});d.classList.remove("hidden");d.setAttribute("data-openfilter","true");d.querySelector("[name=\"filterdatefrompopover[enabled]\"]").focus();b.classList.add("btn-outline-primary");b.classList.remove("btn-primary");b.setAttribute("aria-expanded",!0);var f=function(a){if(a.target.id!==b.id&&d!==a.target.closest("[data-openfilter=\"true\"]")&&("undefined"==typeof a.keyCode||a.keyCode===h.default.enter||a.keyCode===h.default.space)){n(b,d);document.removeEventListener("click",f);document.removeEventListener("keyup",f);document.removeEventListener("keyup",g)}};document.addEventListener("click",f);document.addEventListener("keyup",f);var g=function(a){if(a.keyCode===h.default.escape){n(b,d);document.removeEventListener("keyup",g);document.removeEventListener("click",f)}};document.addEventListener("keyup",g)});i.on(d.default.events.activate,e.default.filters.date.save,function(){var b=document.forms.filtersform,c=a.querySelector(e.default.filters.date.popover),d=c.querySelector("[name=\"filterdatefrompopover[enabled]\"]").checked?1:0,f=c.querySelector("[name=\"filterdatetopopover[enabled]\"]").checked?1:0;if(!d&&!f){b.elements["datefrom[timestamp]"].value=0;b.elements["datefrom[enabled]"].value=d;b.elements["dateto[timestamp]"].value=0;b.elements["dateto[enabled]"].value=f;l("#filter-dates-popover")}else{var h={data:[]};if(d){h.data.push({key:"from",year:c.querySelector("[name=\"filterdatefrompopover[year]\"]").value,month:c.querySelector("[name=\"filterdatefrompopover[month]\"]").value,day:c.querySelector("[name=\"filterdatefrompopover[day]\"]").value,hour:0,minute:0})}if(f){h.data.push({key:"to",year:c.querySelector("[name=\"filterdatetopopover[year]\"]").value,month:c.querySelector("[name=\"filterdatetopopover[month]\"]").value,day:c.querySelector("[name=\"filterdatetopopover[day]\"]").value,hour:23,minute:59})}g.default.call([{methodname:"core_calendar_get_timestamps",args:h}])[0].done(function(a){var c=0,e=0;a.timestamps.forEach(function(a){if("from"===a.key){c=a.timestamp}else if("to"===a.key){e=a.timestamp}});if(0<e&&c>e){var g=document.getElementById("dates-filter-warning");g.classList.remove("hidden");g.classList.add("d-block")}else{b.elements["datefrom[timestamp]"].value=c;b.elements["datefrom[enabled]"].value=d;b.elements["dateto[timestamp]"].value=e;b.elements["dateto[enabled]"].value=f;l("#filter-dates-popover")}})}});i.on(d.default.events.activate,e.default.filters.date.calendariconfrom,function(){m(e.default.filters.date.calendariconfrom)});i.on(d.default.events.activate,e.default.filters.date.calendariconto,function(){m(e.default.filters.date.calendariconto)})};a.init=j});
define ("forumreport_summary/selectors",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={filters:{group:{checkbox:"[data-region=\"filter-groups\"] input[type=\"checkbox\"]",clear:"[data-region=\"filter-groups\"] .filter-clear",popover:"#filter-groups-popover",save:"[data-region=\"filter-groups\"] .filter-save",selectall:"[data-region=\"filter-groups\"] .select-all",trigger:"#filter-groups-button"},date:{calendar:"#dateselector-calendar-panel",calendariconfrom:"#id_filterdatefrompopover_calendar",calendariconto:"#id_filterdatetopopover_calendar",popover:"#filter-dates-popover",save:"[data-region=\"filter-dates\"] .filter-save",trigger:"#filter-dates-button"},exportlink:{link:"#summaryreport #forumreport_summary_table button.export-link"}}};return a.default});
define ("quizaccess_seb/managetemplates",["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={removeTemplate:function removeTemplate(b){b.preventDefault();var e=a(b.currentTarget).attr("href");c.get_strings([{key:"confirmtemplateremovaltitle",component:"quizaccess_seb"},{key:"confirmtemplateremovalquestion",component:"quizaccess_seb"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).then(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){window.location=e})}).catch()},setup:function setup(){a("body").delegate("[data-action=\"delete\"]","click",e.removeTemplate)}};return{setup:e.setup}});