Linux moodl-moodle-3s8bw1nuh5yqd9-5b875fdd66-8hs4m 4.4.0-186-generic #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020 x86_64
Apache/2.4.41 (Ubuntu)
: 10.39.0.36 | : 10.36.0.0
Cant Read [ /etc/named.conf ]
7.4.3
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
moodledata /
filedir /
bf /
cd /
[ HOME SHELL ]
Name
Size
Permission
Action
bfcd1ebd4629fb366dc74d030d5150...
31.33
KB
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : bfcd1ebd4629fb366dc74d030d515074fe3a1fbc
!function(i){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}o.m=i,o.c=n,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=7)}([function(t,m,d){"use strict";(function(e){var t=d(2);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=setTimeout;function n(){}function a(t){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(t,this)}function o(i,n){for(;3===i._state;)i=i._value;0!==i._state?(i._handled=!0,a._immediateFn(function(){var t=1===i._state?n.onFulfilled:n.onRejected;if(null!==t){var e;try{e=t(i._value)}catch(t){return void s(n.promise,t)}r(n.promise,e)}else(1===i._state?r:s)(n.promise,i._value)})):i._deferreds.push(n)}function r(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===c(t)||"function"==typeof t)){var i=t.then;if(t instanceof a)return e._state=3,e._value=t,void l(e);if("function"==typeof i)return void p((n=i,o=t,function(){n.apply(o,arguments)}),e)}e._state=1,e._value=t,l(e)}catch(t){s(e,t)}var n,o}function s(t,e){t._state=2,t._value=e,l(t)}function l(t){2===t._state&&0===t._deferreds.length&&a._immediateFn(function(){t._handled||a._unhandledRejectionFn(t._value)});for(var e=0,i=t._deferreds.length;e<i;e++)o(t,t._deferreds[e]);t._deferreds=null}function u(t,e,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=i}function p(t,e){var i=!1;try{t(function(t){i||(i=!0,r(e,t))},function(t){i||(i=!0,s(e,t))})}catch(t){if(i)return;i=!0,s(e,t)}}a.prototype.catch=function(t){return this.then(null,t)},a.prototype.then=function(t,e){var i=new this.constructor(n);return o(this,new u(t,e,i)),i},a.prototype.finally=t.a,a.all=function(e){return new a(function(n,o){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var a=Array.prototype.slice.call(e);if(0===a.length)return n([]);var r=a.length;function s(e,t){try{if(t&&("object"===c(t)||"function"==typeof t)){var i=t.then;if("function"==typeof i)return void i.call(t,function(t){s(e,t)},o)}a[e]=t,0==--r&&n(a)}catch(t){o(t)}}for(var t=0;t<a.length;t++)s(t,a[t])})},a.resolve=function(e){return e&&"object"===c(e)&&e.constructor===a?e:new a(function(t){t(e)})},a.reject=function(i){return new a(function(t,e){e(i)})},a.race=function(o){return new a(function(t,e){for(var i=0,n=o.length;i<n;i++)o[i].then(t,e)})},a._immediateFn="function"==typeof e&&function(t){e(t)}||function(t){i(t,0)},a._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},m.a=a}).call(this,d(4).setImmediate)},function(t,e){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":i(window))&&(n=window)}t.exports=n},function(t,e,i){"use strict";e.a=function(e){var i=this.constructor;return this.then(function(t){return i.resolve(e()).then(function(){return t})},function(t){return i.resolve(e()).then(function(){return i.reject(t)})})}},function(t,e,i){},function(t,o,a){(function(t){var e=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function n(t,e){this._id=t,this._clearFn=e}o.setTimeout=function(){return new n(i.call(setTimeout,e,arguments),clearTimeout)},o.setInterval=function(){return new n(i.call(setInterval,e,arguments),clearInterval)},o.clearTimeout=o.clearInterval=function(t){t&&t.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(e,this._id)},o.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},o.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},o._unrefActive=o.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},a(5),o.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,o.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,a(1))},function(t,e,i){(function(t,h){!function(i,n){"use strict";if(!i.setImmediate){var o,a,e,r,t,s=1,c={},l=!1,u=i.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(i);p=p&&p.setTimeout?p:i,o="[object process]"==={}.toString.call(i.process)?function(t){h.nextTick(function(){d(t)})}:function(){if(i.postMessage&&!i.importScripts){var t=!0,e=i.onmessage;return i.onmessage=function(){t=!1},i.postMessage("","*"),i.onmessage=e,t}}()?(r="setImmediate$"+Math.random()+"$",t=function(t){t.source===i&&"string"==typeof t.data&&0===t.data.indexOf(r)&&d(+t.data.slice(r.length))},i.addEventListener?i.addEventListener("message",t,!1):i.attachEvent("onmessage",t),function(t){i.postMessage(r+t,"*")}):i.MessageChannel?((e=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){e.port2.postMessage(t)}):u&&"onreadystatechange"in u.createElement("script")?(a=u.documentElement,function(t){var e=u.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,a.removeChild(e),e=null},a.appendChild(e)}):function(t){setTimeout(d,0,t)},p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var n={callback:t,args:e};return c[s]=n,o(s),s++},p.clearImmediate=m}function m(t){delete c[t]}function d(t){if(l)setTimeout(d,0,t);else{var e=c[t];if(e){l=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(n,i)}}(e)}finally{m(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,i(1),i(6))},function(t,e){var i,n,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function s(e){if(i===setTimeout)return setTimeout(e,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(t){i=a}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(t){n=r}}();var c,l=[],u=!1,p=-1;function m(){u&&c&&(u=!1,c.length?l=c.concat(l):p=-1,l.length&&d())}function d(){if(!u){var t=s(m);u=!0;for(var e=l.length;e;){for(c=l,l=[];++p<e;)c&&c[p].run();p=-1,e=l.length}c=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===r||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function f(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new h(t,e)),1!==l.length||u||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,i){"use strict";i.r(e);i(3);function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var g=function(){function i(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i)}var t,e,n;return t=i,n=[{key:"extend",value:function(){for(var t=1;t<arguments.length;t++)for(var e in arguments[t])arguments[t].hasOwnProperty(e)&&("object"===o(arguments[0][e])&&"object"===o(arguments[t][e])?this.extend(arguments[0][e],arguments[t][e]):arguments[0][e]=arguments[t][e]);return arguments[0]}},{key:"stripHTML",value:function(t){var e=document.createElement("div");return e.innerHTML=i.htmlDecode(t),e.textContent||e.innerText||""}},{key:"htmlDecode",value:function(t){return(new DOMParser).parseFromString(t,"text/html").documentElement.textContent}},{key:"project",value:function(t,e,i,n,o){return n+(o-n)*(t-e)/(i-e)}},{key:"constrain",value:function(t,e,i){return Math.min(i,Math.max(e,t))}},{key:"isMobileDevice",value:function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t.substr(0,4)))&&(e=!0),e}}],(e=null)&&a(t.prototype,e),n&&a(t,n),i}();function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var n=function(){function n(t,e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.texts=t,this.selector=e,this.descriptionTop=document.createElement("div"),this.descriptionTop.classList.add("h5p-agamotto-description-top"),this.descriptionTop.style.opacity=1,this.descriptionTop.innerHTML=t[0],this.descriptionTop.setAttribute("aria-hidden","true"),this.descriptionBottom=document.createElement("div"),this.descriptionBottom.classList.add("h5p-agamotto-description-bottom"),this.descriptionBottom.style.opacity=0,this.descriptionBottom.innerHTML=t[1],this.descriptionsContainer=document.createElement("div"),this.descriptionsContainer.classList.add("h5p-agamotto-descriptions-container"),this.descriptionsContainer.appendChild(this.descriptionTop),this.descriptionsContainer.appendChild(this.descriptionBottom),this.descriptionsContainer.addEventListener("mouseup",function(t){-1!==n.TAGS_FOR_PROPAGATION_STOPPING.indexOf(t.target.tagName)&&(t.stopPropagation(),i.xAPIInteracted())})}var t,e,i;return t=n,(e=[{key:"getDOM",value:function(){return this.descriptionsContainer}},{key:"getCurrentDescriptionText",value:function(){return this.descriptionTop.textContent}},{key:"setText",value:function(t,e){this.descriptionBottom.style.opacity=.5<e?(this.descriptionTop.innerHTML=this.texts[t],this.descriptionBottom.innerHTML=this.texts[g.constrain(t+1,0,this.texts.length-1)],1-(this.descriptionTop.style.opacity=e)):(this.descriptionTop.innerHTML=this.texts[g.constrain(t+1,0,this.texts.length-1)],this.descriptionBottom.innerHTML=this.texts[t],this.descriptionTop.style.opacity=1-e,e)}},{key:"adjustHeight",value:function(){var e=this,i=0;this.texts.forEach(function(t){e.descriptionBottom.innerHTML=t,i=Math.max(i,e.descriptionBottom.offsetHeight)}),this.descriptionsContainer.style.height=i+"px"}}])&&r(t.prototype,e),i&&r(t,i),n}();n.TAGS_FOR_PROPAGATION_STOPPING=["A","EM","STRONG","SUB","SUP","SPAN"];var l=n,u=i(0);function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var p=function(){function f(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"#000000";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),this.images=t,this.images.map(function(t){t.alt=g.stripHTML(t.alt),t.title=g.stripHTML(t.title),t.description=g.stripHTML(t.description)}),this.ratio=this.images[0].img.naturalWidth/this.images[0].img.naturalHeight;for(var i=this.images[0].img.naturalWidth,n=this.images[0].img.naturalHeight,o=0;o<this.images.length;o++){var a=i,r=n,s=this.images[o].img.naturalWidth,c=this.images[o].img.naturalHeight;s/c<this.ratio&&r<c&&(s*=(c=r)/this.images[o].img.naturalHeight),s/c>this.ratio&&a<s&&(c*=(s=a)/this.images[o].img.naturalWidth),s/c===this.ratio&&(a=Math.max(a,s),r=Math.max(r,c));var l=g.constrain((a-s)/2,0,a),u=g.constrain((r-c)/2,0,r),p=document.createElement("canvas");p.setAttribute("width",a),p.setAttribute("height",r);var m=p.getContext("2d");m.beginPath(),m.rect(0,0,a,r),m.fillStyle=e,m.fill(),m.drawImage(this.images[o].img,l,u,s,c);var d=new Image,h=p.toDataURL("image/jpeg");d.crossOrigin=void 0!==H5P.getCrossOrigin?H5P.getCrossOrigin(h):"Anonymous",d.src=h,this.images[o].img=d}this.imageTop=document.createElement("img"),this.imageTop.classList.add("h5p-agamotto-image-top"),this.imageTop.src=t[0].img.src,this.imageTop.setAttribute("draggable","false"),this.imageTop.setAttribute("alt",this.images[0].alt),this.imageTop.setAttribute("title",this.images[0].title),this.imageTop.setAttribute("aria-label","".concat(t[0].alt,". ").concat(this.images[0].description)),this.imageBottom=document.createElement("img"),this.imageBottom.classList.add("h5p-agamotto-image-bottom"),this.imageBottom.src=this.images[1].img.src,this.imageBottom.setAttribute("draggable","false"),this.imageBottom.setAttribute("aria-hidden",!0),this.container=document.createElement("div"),this.container.classList.add("h5p-agamotto-images-container"),this.container.appendChild(this.imageTop),this.container.appendChild(this.imageBottom)}var t,e,i;return t=f,i=[{key:"loadImage",value:function(o,a){return new u.a(function(t,e){var i=new Image,n=H5P.getPath(o.params.file.path,a);i.crossOrigin=void 0!==H5P.getCrossOrigin?H5P.getCrossOrigin(n):"Anonymous",i.onload=function(){t(i)},i.onerror=function(t){e(t)},i.src=n})}}],(e=[{key:"getDOM",value:function(){return this.container}},{key:"getCurrentAltTag",value:function(){return this.imageTop.getAttribute("alt")}},{key:"setImage",value:function(t,e){var i=Math.min(this.images.length-1,t+Math.round(1-e));this.imageTop.src=this.images[t].img.src,this.imageTop.setAttribute("alt",this.images[i].alt),this.imageTop.setAttribute("title",this.images[i].title),this.imageTop.setAttribute("aria-label","".concat(this.images[i].alt,". ").concat(this.images[i].description)),this.imageTop.style.opacity=e,this.imageBottom.src=this.images[g.constrain(t+1,0,this.images.length-1)].img.src}},{key:"resize",value:function(){var t=this.container.style.height;return this.container.style.height=this.container.offsetWidth/this.ratio+"px",this.container.style.height!==t}},{key:"getRatio",value:function(){return this.ratio}}])&&s(t.prototype,e),i&&s(t,i),f}();function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t):e}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var v=function(t){function r(t,e,i){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),n=d(this,h(r).call(this)),t=g.extend({snap:!0,ticks:!1,labels:!1},t),n.params=t,n.selector=e,n.parent=i,n.trackWidth=0,n.thumbPosition=0,n.ratio=0,n.ticks=[],n.labels=[],n.mousedown=!1,n.keydown=!1,n.interactionstarted=!1,n.track=document.createElement("div"),n.track.classList.add("h5p-agamotto-slider-track"),n.thumb=document.createElement("div"),n.thumb.classList.add("h5p-agamotto-slider-thumb"),n.thumb.setAttribute("tabindex",0),n.container=document.createElement("div"),n.container.classList.add("h5p-agamotto-slider-container"),n.container.setAttribute("role","slider"),n.container.setAttribute("aria-valuenow",1),n.container.setAttribute("aria-valuemin",1),n.container.setAttribute("aria-valuemax",n.params.size+1),n.container.appendChild(n.track),n.container.appendChild(n.thumb);var o=0;if(!0===n.params.ticks){var a=function(){n.setPosition(parseInt(n.style.left)-r.TRACK_OFFSET,!0)};for(o=0;o<=n.params.size;o++)n.ticks[o]=document.createElement("div"),n.ticks[o].classList.add("h5p-agamotto-tick"),n.ticks[o].addEventListener("click",a),n.container.appendChild(n.ticks[o])}if(!0===n.params.labels)for(o=0;o<=n.params.size;o++)n.labels[o]=document.createElement("div"),n.labels[o].classList.add("h5p-agamotto-tick-label"),n.labels[o].innerHTML=n.params.labelTexts[o],n.container.appendChild(n.labels[o]);return document.addEventListener("mousemove",function(t){n.setPosition(t,!1)}),document.addEventListener("mouseup",function(){n.mousedown=!1,n.snap()}),n.track.addEventListener("mousedown",function(t){t=t||window.event,n.mousedown=!0,n.sliderdown=!0,n.setPosition(t,!1)}),n.thumb.addEventListener("mousedown",function(t){t=t||window.event,n.mousedown=!0,n.sliderdown=!0,n.setPosition(t,!1)}),n.container.addEventListener("touchstart",function(t){(t=t||window.event).preventDefault(),t.stopPropagation(),n.setPosition(t,!1),n.addEventListener("touchmove",function(t){(t=t||window.event).preventDefault(),t.stopPropagation(),n.setPosition(t,!1)})}),n.container.addEventListener("touchend",function(t){(t=t||window.event).preventDefault(),t.stopPropagation(),n.snap()}),n.thumb.addEventListener("keydown",function(t){if(!1===n.keydown){var e=(t=t||window.event).which||t.keyCode;37===e||33===e?n.handleKeyMove(t,n.getNeighborItemIds().previous):39!==e&&34!==e||n.handleKeyMove(t,n.getNeighborItemIds().next)}}),n.thumb.addEventListener("keyup",function(t){((t=t||window.event).which||t.keyCode)===n.keydown&&(n.keydown=!1,i.xAPIInteracted(),i.xAPICompleted())}),n}var e,i,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(r,H5P.EventDispatcher),e=r,(i=[{key:"handleKeyMove",value:function(t,e){t.preventDefault(),this.keydown=t.which||t.keyCode,this.setPosition(e*this.getWidth()/this.params.size,!0)}},{key:"getCurrentItemId",value:function(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=this.getPosition()/this.getWidth()*this.params.size;return t&&(e=Math.round(e)),e}},{key:"getNeighborItemIds",value:function(){var t=this.getCurrentItemId(!1),e=Math.floor(t),i=Math.ceil(t);return e===i&&(e--,i++),{previous:g.constrain(e,0,this.params.size),next:g.constrain(i,0,this.params.size)}}},{key:"getDOM",value:function(){return this.container}},{key:"disable",value:function(){this.track.classList.add("h5p-agamotto-disabled"),this.thumb.classList.add("h5p-agamotto-disabled")}},{key:"enable",value:function(){this.track.classList.remove("h5p-agamotto-disabled"),this.thumb.classList.remove("h5p-agamotto-disabled")}},{key:"setWidth",value:function(t){this.trackWidth=t,this.track.style.width="".concat(t,"px")}},{key:"getWidth",value:function(){return this.trackWidth}},{key:"setPosition",value:function(t,e,i){if(!this.thumb.classList.contains("h5p-agamotto-disabled")){if("string"==typeof t||"number"==typeof t)t=parseInt(t);else if("object"===c(t)){if(!1===this.mousedown&&"mousemove"===t.type)return;t=this.getPointerX(t)-r.TRACK_OFFSET-parseInt(window.getComputedStyle(this.container).marginLeft)-parseInt(window.getComputedStyle(document.querySelector(this.selector)).paddingLeft)-parseInt(window.getComputedStyle(document.querySelector(this.selector)).marginLeft)}else t=0;t=g.constrain(t,0,this.getWidth()),!0===e?this.thumb.classList.add("h5p-agamotto-transition"):this.thumb.classList.remove("h5p-agamotto-transition"),i||(this.ratio=t/this.getWidth()),this.thumb.style.left=t+r.THUMB_OFFSET+"px";var n=Math.round(t/this.getWidth()*100);this.container.setAttribute("aria-valuenow",(this.getCurrentItemId()||0)+1),this.trigger("update",{position:t,percentage:n})}}},{key:"getPosition",value:function(){return this.thumb.style.left?parseInt(this.thumb.style.left)-r.THUMB_OFFSET:0}},{key:"snap",value:function(){if(!0===this.params.snap){var t=Math.round(g.project(this.ratio,0,1,0,this.params.size));this.setPosition(t*this.getWidth()/this.params.size,!0)}!0===this.sliderdown&&(this.parent.xAPIInteracted(),this.parent.xAPICompleted(),this.sliderdown=!1)}},{key:"getPointerX",value:function(t){return t.touches?t.touches[0].pageX:t.clientX}},{key:"resize",value:function(){this.setWidth(parseInt(this.container.offsetWidth)-2*r.TRACK_OFFSET),this.setPosition(this.getWidth()*this.ratio,!1,!0);var t=0;if(!0===this.params.ticks)for(t=0;t<this.ticks.length;t++)this.ticks[t].style.left=r.TRACK_OFFSET+t*this.getWidth()/(this.ticks.length-1)+"px";var e=0,i=!1;if(!0===this.params.labels){for(t=0;t<this.labels.length;t++){switch(e=Math.max(e,parseInt(window.getComputedStyle(this.labels[t]).height)),t){case 0:this.labels[t].style.left=r.TRACK_OFFSET/2+"px";break;case this.labels.length-1:this.labels[t].style.right=r.TRACK_OFFSET/2+"px";break;default:var n=Math.ceil(parseInt(window.getComputedStyle(this.labels[t]).width))/2;this.labels[t].style.left=r.TRACK_OFFSET+t*this.getWidth()/(this.labels.length-1)-n+"px"}t<this.labels.length-1&&!i&&(i=this.areOverlapping(this.labels[t],this.labels[t+1]))}i?(this.labels.forEach(function(t){t.classList.add("h5p-agamotto-hidden")}),e=0):this.labels.forEach(function(t){t.classList.remove("h5p-agamotto-hidden")});var o=!0===this.params.ticks||i||0===e?0:-7;this.container.style.height=r.CONTAINER_DEFAULT_HEIGHT+e+o+"px"}}},{key:"areOverlapping",value:function(t,e){var i=t.getBoundingClientRect(),n=e.getBoundingClientRect();return!(i.right<n.left||i.left>n.right||i.bottom<n.top||i.top>n.bottom)}}])&&m(e.prototype,i),n&&m(e,n),r}();v.CONTAINER_DEFAULT_HEIGHT=36,v.TRACK_OFFSET=16,v.THUMB_OFFSET=8;var y=v;function b(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var w=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=document.createElement("div"),this.container.classList.add("".concat(t,"-container")),this.spinnerElement=document.createElement("div"),this.spinnerElement.classList.add(t),this.spinnerElement.innerHTML="<div></div><div></div><div></div><div></div>",this.container.appendChild(this.spinnerElement)}var t,i,n;return t=e,(i=[{key:"getDOM",value:function(){return this.container}},{key:"show",value:function(){this.container.classList.remove("h5p-agamotto-spinner-none")}},{key:"hide",value:function(){this.container.classList.add("h5p-agamotto-spinner-none")}}])&&b(t.prototype,i),n&&b(t,n),e}();function T(t){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function I(t,e){return!e||"object"!==T(e)&&"function"!=typeof e?x(t):e}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function x(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var O=function(t){function c(t,e,i){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),s=I(this,_(c).call(this,"agamotto")),t.items?(s.params=t,s.params.items=c.sanitizeItems(s.params.items),"string"==typeof s.params.a11y&&(s.params.a11y={imageChanged:s.params.a11y}),s.params=g.extend({transparencyReplacementColor:"#000000",a11y:{imageChanged:"Image changed"}},s.params),s.extras=i,s.maxItem=s.params.items.length-1,s.selector=".h5p-agamotto-wrapper",s.hasDescription=s.params.items.some(function(t){return""!==t.description}),s.id=e,s.imageContainer=void 0,s.position=0,s.imagesViewed=[],s.completed=!1,s.updateContent=function(t,e){s.images.setImage(t,e),s.hasDescription&&s.descriptions.setText(t,e),s.position=Math.round(t+(1-e)),!1===s.completed&&-1===s.imagesViewed.indexOf(s.position)&&s.imagesViewed.push(s.position),s.announceARIA(s.params.a11y.imageChanged)},s.registerDomElements=function(){s.setContent(s.createDOM())},s.createDOM=function(){var r=document.createElement("div");if(r.classList.add("h5p-agamotto"),!s.params.items||s.maxItem<1){var t=document.createElement("div");return t.classList.add("h5p-agamotto-warning"),t.innerHTML="I really need at least two images :-)",r.appendChild(t),r}s.spinner=new w("h5p-agamotto-spinner"),r.appendChild(s.spinner.getDOM());var e=[];return s.params.items.forEach(function(t){e.push(p.loadImage(t.image,s.id))}),u.a.all(e).then(function(t){if(s.images=t.map(function(t,e){return{img:t,alt:s.params.items[e].image.params.alt,title:s.params.items[e].image.params.title,description:s.params.items[e].description}}),s.spinner.hide(),s.wrapper=document.createElement("div"),s.wrapper.classList.add("h5p-agamotto-wrapper"),s.wrapper.classList.add("h5p-agamotto-passepartout-horizontal"),s.wrapper.classList.add("h5p-agamotto-passepartout-top"),s.wrapper.classList.add("h5p-agamotto-passepartout-bottom"),r.appendChild(s.wrapper),s.params.title){var e=document.createElement("div");e.classList.add("h5p-agamotto-title"),e.innerHTML="<h2>".concat(s.params.title,"</h2>"),s.wrapper.appendChild(e)}s.images=new p(s.images,s.params.transparencyReplacementColor),s.wrapper.appendChild(s.images.getDOM()),s.images.resize();for(var i=[],n=0;n<=s.maxItem;n++)i[n]=s.params.items[n].labelText||"";if(s.slider=new y({snap:s.params.snap,ticks:s.params.ticks,labels:s.params.labels,labelTexts:i,size:s.maxItem},s.selector,x(s)),s.wrapper.appendChild(s.slider.getDOM()),s.slider.resize(),s.hasDescription){for(var o=[],a=0;a<=s.maxItem;a++)o[a]=s.params.items[a].description;s.descriptions=new l(o,s.selector,x(s),s.contentId),s.wrapper.appendChild(s.descriptions.getDOM()),s.descriptions.adjustHeight(),s.wrapper.classList.remove("h5p-agamotto-passepartout-bottom"),s.heightDescriptions=s.descriptions.offsetHeight}else s.heightDescriptions=0;s.params.showTitle?s.wrapper.classList.remove("h5p-agamotto-passepartout-top"):s.hasDescription||(s.wrapper.classList.remove("h5p-agamotto-passepartout-horizontal"),s.wrapper.classList.remove("h5p-agamotto-passepartout-top"),s.wrapper.classList.remove("h5p-agamotto-passepartout-bottom")),s.imageContainer=s.images.getDOM(),s.xAPIExperienced(),s.slider.on("update",function(t){var e=g.project(t.data.position,5,s.slider.getWidth()-5,0,s.maxItem),i=g.constrain(Math.floor(e),0,s.maxItem),n=1-g.constrain(e-i,0,1),o=.5*(1-Math.cos(Math.PI*n));s.updateContent(i,o)}),window.addEventListener("resize",function(){if(!s.resizeCooling){if(g.isMobileDevice()&&90===Math.abs(window.orientation)){var t=/iPhone/.test(navigator.userAgent)?screen.width:screen.height;s.wrapper.style.width=Math.round(t/2*s.images.getRatio())+"px"}else s.wrapper.style.width="auto";s.images.resize(),s.slider.resize(),s.trigger("resize"),s.resizeCooling=setTimeout(function(){s.resizeCooling=null},c.RESIZE_COOLING_PERIOD)}}),s.trigger("resize")}),r},s.announceARIA=function(t){t=void 0!==t?g.htmlDecode("".concat(t," ")):"";var e="".concat(t).concat(s.images.getCurrentAltTag(),". ").concat(s.descriptions.getCurrentDescriptionText());e=g.stripHTML(e),s.read(e)},s.xAPIExperienced=function(){s.triggerXAPI("experienced")},s.xAPIInteracted=function(){s.triggerXAPI("interacted")},s.xAPICompleted=function(){s.imagesViewed.length!==s.params.items.length||s.completed||(s.triggerXAPI("completed"),s.completed=!0)},s.getTitle=function(){return H5P.createTitle(s.extras.metadata&&s.extras.metadata.title?s.extras.metadata.title:"Agamotto")},s):I(s)}var e,i,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&E(t,e)}(c,H5P.Question),e=c,n=[{key:"sanitizeItems",value:function(t){return t=t.filter(function(t){return!!(t.image&&t.image.params&&t.image.params.file)||(console.warn("An image is missing. I will continue without it, but please check your settings."),!1)}).splice(0,50).map(function(t){return t.image.params.alt=t.image.params.alt||"",t.image.params.title=t.image.params.title||"",t})}}],(i=null)&&k(e.prototype,i),n&&k(e,n),c}();O.DEFAULT_DESCRIPTION="Agamotto",O.RESIZE_COOLING_PERIOD=50;var C=O;H5P=H5P||{},H5P.Agamotto=C}]);
Close