Sindbad~EG File Manager

Current Path : /var/www/html/ceade.tocsa.com.py/lib/amd/build/
Upload File :
Current File : /var/www/html/ceade.tocsa.com.py/lib/amd/build/notification.min.js

define("core/notification",["exports","core/pending","core/log"],(function(_exports,_pending,_log){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.saveCancel=_exports.init=_exports.fetchNotifications=_exports.exception=_exports.default=_exports.confirm=_exports.alert=_exports.addNotification=void 0,_pending=_interopRequireDefault(_pending),_log=_interopRequireDefault(_log);var _systemImportTransformerGlobalIdentifier="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr,i)||function(){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 _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}var _ref,currentContextId=M.cfg.contextid,notificationTypes={success:"core/notification_success",info:"core/notification_info",warning:"core/notification_warning",error:"core/notification_error"},Selectors={notificationRegion:"#".concat("user-notifications"),fallbackRegionParents:["#region-main",'[role="main"]',"body"]},fetchNotifications=(_ref=_asyncToGenerator(regeneratorRuntime.mark((function _callee(){var Ajax;return regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.next=2,"function"==typeof _systemImportTransformerGlobalIdentifier.define&&_systemImportTransformerGlobalIdentifier.define.amd?new Promise((function(resolve,reject){_systemImportTransformerGlobalIdentifier.require(["core/ajax"],resolve,reject)})):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&_systemImportTransformerGlobalIdentifier.require&&"component"===_systemImportTransformerGlobalIdentifier.require.loader?Promise.resolve(require("core/ajax")):Promise.resolve(_systemImportTransformerGlobalIdentifier["core/ajax"]);case 2:return Ajax=_context.sent,_context.abrupt("return",Ajax.call([{methodname:"core_fetch_notifications",args:{contextid:currentContextId}}])[0].then(addNotifications));case 4:case"end":return _context.stop()}}),_callee)}))),function(){return _ref.apply(this,arguments)});_exports.fetchNotifications=fetchNotifications;var addNotifications=function(notifications){if(!notifications.length)return Promise.resolve();var pendingPromise=new _pending.default("core/notification:addNotifications");return notifications.forEach((function(notification){return renderNotification(notification.template,notification.variables)})),pendingPromise.resolve()},addNotification=function(notification){var pendingPromise=new _pending.default("core/notification:addNotifications"),template=notificationTypes.error;return notification=function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}({closebutton:!0,announce:!0,type:"error"},notification),notification.template?(template=notification.template,delete notification.template):notification.type&&(void 0!==notificationTypes[notification.type]&&(template=notificationTypes[notification.type]),delete notification.type),renderNotification(template,notification).then(pendingPromise.resolve)};_exports.addNotification=addNotification;var _ref2,_ref4,renderNotification=(_ref2=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(template,variables){var pendingPromise,Templates;return regeneratorRuntime.wrap((function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(void 0!==variables.message&&variables.message){_context2.next=3;break}return _log.default.debug("Notification received without content. Skipping."),_context2.abrupt("return");case 3:return pendingPromise=new _pending.default("core/notification:renderNotification"),_context2.next=6,"function"==typeof _systemImportTransformerGlobalIdentifier.define&&_systemImportTransformerGlobalIdentifier.define.amd?new Promise((function(resolve,reject){_systemImportTransformerGlobalIdentifier.require(["core/templates"],resolve,reject)})):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&_systemImportTransformerGlobalIdentifier.require&&"component"===_systemImportTransformerGlobalIdentifier.require.loader?Promise.resolve(require("core/templates")):Promise.resolve(_systemImportTransformerGlobalIdentifier["core/templates"]);case 6:(Templates=_context2.sent).renderForPromise(template,variables).then((function(_ref3){var html=_ref3.html,_ref3$js=_ref3.js,js=void 0===_ref3$js?"":_ref3$js;Templates.prependNodeContents(getNotificationRegion(),html,js)})).then(pendingPromise.resolve).catch(exception);case 8:case"end":return _context2.stop()}}),_callee2)}))),function(_x,_x2){return _ref2.apply(this,arguments)}),getNotificationRegion=function(){return document.querySelector(Selectors.notificationRegion)},alert=(_ref4=_asyncToGenerator(regeneratorRuntime.mark((function _callee3(title,message,cancelText){var pendingPromise,ModalFactory;return regeneratorRuntime.wrap((function(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:return pendingPromise=new _pending.default("core/notification:alert"),_context3.next=3,"function"==typeof _systemImportTransformerGlobalIdentifier.define&&_systemImportTransformerGlobalIdentifier.define.amd?new Promise((function(resolve,reject){_systemImportTransformerGlobalIdentifier.require(["core/modal_factory"],resolve,reject)})):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&_systemImportTransformerGlobalIdentifier.require&&"component"===_systemImportTransformerGlobalIdentifier.require.loader?Promise.resolve(require("core/modal_factory")):Promise.resolve(_systemImportTransformerGlobalIdentifier["core/modal_factory"]);case 3:return ModalFactory=_context3.sent,_context3.abrupt("return",ModalFactory.create({type:ModalFactory.types.ALERT,body:message,title:title,buttons:{cancel:cancelText},removeOnClose:!0}).then((function(modal){return modal.show(),pendingPromise.resolve(),modal})));case 5:case"end":return _context3.stop()}}),_callee3)}))),function(_x3,_x4,_x5){return _ref4.apply(this,arguments)});_exports.alert=alert;var confirm=function(title,question,saveLabel,noLabel,saveCallback,cancelCallback){return saveCancel(title,question,saveLabel,saveCallback,cancelCallback)};_exports.confirm=confirm;var _ref5,saveCancel=(_ref5=_asyncToGenerator(regeneratorRuntime.mark((function _callee4(title,question,saveLabel,saveCallback,cancelCallback){var pendingPromise,_yield$Promise$all,_yield$Promise$all2,ModalFactory,ModalEvents;return regeneratorRuntime.wrap((function(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:return pendingPromise=new _pending.default("core/notification:confirm"),_context4.next=3,Promise.all(["function"==typeof _systemImportTransformerGlobalIdentifier.define&&_systemImportTransformerGlobalIdentifier.define.amd?new Promise((function(resolve,reject){_systemImportTransformerGlobalIdentifier.require(["core/modal_factory"],resolve,reject)})):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&_systemImportTransformerGlobalIdentifier.require&&"component"===_systemImportTransformerGlobalIdentifier.require.loader?Promise.resolve(require("core/modal_factory")):Promise.resolve(_systemImportTransformerGlobalIdentifier["core/modal_factory"]),"function"==typeof _systemImportTransformerGlobalIdentifier.define&&_systemImportTransformerGlobalIdentifier.define.amd?new Promise((function(resolve,reject){_systemImportTransformerGlobalIdentifier.require(["core/modal_events"],resolve,reject)})):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&_systemImportTransformerGlobalIdentifier.require&&"component"===_systemImportTransformerGlobalIdentifier.require.loader?Promise.resolve(require("core/modal_events")):Promise.resolve(_systemImportTransformerGlobalIdentifier["core/modal_events"])]);case 3:return _yield$Promise$all=_context4.sent,_yield$Promise$all2=_slicedToArray(_yield$Promise$all,2),ModalFactory=_yield$Promise$all2[0],ModalEvents=_yield$Promise$all2[1],_context4.abrupt("return",ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:title,body:question,buttons:{save:saveLabel},removeOnClose:!0}).then((function(modal){return modal.show(),modal.getRoot().on(ModalEvents.save,saveCallback),modal.getRoot().on(ModalEvents.cancel,cancelCallback),pendingPromise.resolve(),modal})));case 8:case"end":return _context4.stop()}}),_callee4)}))),function(_x6,_x7,_x8,_x9,_x10){return _ref5.apply(this,arguments)});_exports.saveCancel=saveCancel;var _ref6,exception=(_ref6=_asyncToGenerator(regeneratorRuntime.mark((function _callee5(ex){var pendingPromise,ln,fn;return regeneratorRuntime.wrap((function(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:return pendingPromise=new _pending.default("core/notification:displayException"),ex.stack||(ex.stack=""),ex.debuginfo&&(ex.stack+=ex.debuginfo+"\n"),!ex.backtrace&&ex.stacktrace&&(ex.backtrace=ex.stacktrace),ex.backtrace&&(ex.stack+=ex.backtrace,ln=ex.backtrace.match(/line ([^ ]*) of/),fn=ex.backtrace.match(/ of ([^:]*): /),ln&&ln[1]&&(ex.lineNumber=ln[1]),fn&&fn[1]&&(ex.fileName=fn[1],ex.fileName.length>30&&(ex.fileName="..."+ex.fileName.substr(ex.fileName.length-27)))),void 0===ex.name&&ex.errorcode&&(ex.name=ex.errorcode),_context5.next=8,"function"==typeof _systemImportTransformerGlobalIdentifier.define&&_systemImportTransformerGlobalIdentifier.define.amd?new Promise((function(resolve,reject){_systemImportTransformerGlobalIdentifier.require(["core/yui"],resolve,reject)})):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&_systemImportTransformerGlobalIdentifier.require&&"component"===_systemImportTransformerGlobalIdentifier.require.loader?Promise.resolve(require("core/yui")):Promise.resolve(_systemImportTransformerGlobalIdentifier["core/yui"]);case 8:_context5.sent.use("moodle-core-notification-exception",(function(){new M.core.exception(ex).show(),pendingPromise.resolve()}));case 10:case"end":return _context5.stop()}}),_callee5)}))),function(_x11){return _ref6.apply(this,arguments)});_exports.exception=exception;var init=function(contextId,notificationList){currentContextId=contextId,function(){if(getNotificationRegion())return!1;var newRegion=document.createElement("span");newRegion.id="user-notifications",Selectors.fallbackRegionParents.some((function(selector){var targetRegion=document.querySelector(selector);return!!targetRegion&&(targetRegion.prepend(newRegion),!0)}))}(),addNotifications(notificationList)};_exports.init=init;var _default={init:init,fetchNotifications:fetchNotifications,addNotification:addNotification,alert:alert,confirm:confirm,saveCancel:saveCancel,exception:exception};return _exports.default=_default,_exports.default}));

//# sourceMappingURL=notification.min.js.map

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists