Created
June 22, 2018 20:40
-
-
Save fkchang/af0c4d6e48b1032ccf17fc80976adc4a to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******/ (function(modules) { // webpackBootstrap | |
/******/ // install a JSONP callback for chunk loading | |
/******/ function webpackJsonpCallback(data) { | |
/******/ var chunkIds = data[0]; | |
/******/ var moreModules = data[1]; | |
/******/ | |
/******/ | |
/******/ // add "moreModules" to the modules object, | |
/******/ // then flag all "chunkIds" as loaded and fire callback | |
/******/ var moduleId, chunkId, i = 0, resolves = []; | |
/******/ for(;i < chunkIds.length; i++) { | |
/******/ chunkId = chunkIds[i]; | |
/******/ if(installedChunks[chunkId]) { | |
/******/ resolves.push(installedChunks[chunkId][0]); | |
/******/ } | |
/******/ installedChunks[chunkId] = 0; | |
/******/ } | |
/******/ for(moduleId in moreModules) { | |
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { | |
/******/ modules[moduleId] = moreModules[moduleId]; | |
/******/ } | |
/******/ } | |
/******/ if(parentJsonpFunction) parentJsonpFunction(data); | |
/******/ | |
/******/ while(resolves.length) { | |
/******/ resolves.shift()(); | |
/******/ } | |
/******/ | |
/******/ }; | |
/******/ | |
/******/ function hotDisposeChunk(chunkId) { | |
/******/ delete installedChunks[chunkId]; | |
/******/ } | |
/******/ var parentHotUpdateCallback = window["webpackHotUpdate"]; | |
/******/ window["webpackHotUpdate"] = // eslint-disable-next-line no-unused-vars | |
/******/ function webpackHotUpdateCallback(chunkId, moreModules) { | |
/******/ hotAddUpdateChunk(chunkId, moreModules); | |
/******/ if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); | |
/******/ } ; | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotDownloadUpdateChunk(chunkId) { | |
/******/ var head = document.getElementsByTagName("head")[0]; | |
/******/ var script = document.createElement("script"); | |
/******/ script.charset = "utf-8"; | |
/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; | |
/******/ ; | |
/******/ head.appendChild(script); | |
/******/ } | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotDownloadManifest(requestTimeout) { | |
/******/ requestTimeout = requestTimeout || 10000; | |
/******/ return new Promise(function(resolve, reject) { | |
/******/ if (typeof XMLHttpRequest === "undefined") { | |
/******/ return reject(new Error("No browser support")); | |
/******/ } | |
/******/ try { | |
/******/ var request = new XMLHttpRequest(); | |
/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; | |
/******/ request.open("GET", requestPath, true); | |
/******/ request.timeout = requestTimeout; | |
/******/ request.send(null); | |
/******/ } catch (err) { | |
/******/ return reject(err); | |
/******/ } | |
/******/ request.onreadystatechange = function() { | |
/******/ if (request.readyState !== 4) return; | |
/******/ if (request.status === 0) { | |
/******/ // timeout | |
/******/ reject( | |
/******/ new Error("Manifest request to " + requestPath + " timed out.") | |
/******/ ); | |
/******/ } else if (request.status === 404) { | |
/******/ // no update available | |
/******/ resolve(); | |
/******/ } else if (request.status !== 200 && request.status !== 304) { | |
/******/ // other failure | |
/******/ reject(new Error("Manifest request to " + requestPath + " failed.")); | |
/******/ } else { | |
/******/ // success | |
/******/ try { | |
/******/ var update = JSON.parse(request.responseText); | |
/******/ } catch (e) { | |
/******/ reject(e); | |
/******/ return; | |
/******/ } | |
/******/ resolve(update); | |
/******/ } | |
/******/ }; | |
/******/ }); | |
/******/ } | |
/******/ | |
/******/ var hotApplyOnUpdate = true; | |
/******/ var hotCurrentHash = "2c7797bcdf7121247b21"; // eslint-disable-line no-unused-vars | |
/******/ var hotRequestTimeout = 10000; | |
/******/ var hotCurrentModuleData = {}; | |
/******/ var hotCurrentChildModule; // eslint-disable-line no-unused-vars | |
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars | |
/******/ var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotCreateRequire(moduleId) { | |
/******/ var me = installedModules[moduleId]; | |
/******/ if (!me) return __webpack_require__; | |
/******/ var fn = function(request) { | |
/******/ if (me.hot.active) { | |
/******/ if (installedModules[request]) { | |
/******/ if (installedModules[request].parents.indexOf(moduleId) === -1) { | |
/******/ installedModules[request].parents.push(moduleId); | |
/******/ } | |
/******/ } else { | |
/******/ hotCurrentParents = [moduleId]; | |
/******/ hotCurrentChildModule = request; | |
/******/ } | |
/******/ if (me.children.indexOf(request) === -1) { | |
/******/ me.children.push(request); | |
/******/ } | |
/******/ } else { | |
/******/ console.warn( | |
/******/ "[HMR] unexpected require(" + | |
/******/ request + | |
/******/ ") from disposed module " + | |
/******/ moduleId | |
/******/ ); | |
/******/ hotCurrentParents = []; | |
/******/ } | |
/******/ return __webpack_require__(request); | |
/******/ }; | |
/******/ var ObjectFactory = function ObjectFactory(name) { | |
/******/ return { | |
/******/ configurable: true, | |
/******/ enumerable: true, | |
/******/ get: function() { | |
/******/ return __webpack_require__[name]; | |
/******/ }, | |
/******/ set: function(value) { | |
/******/ __webpack_require__[name] = value; | |
/******/ } | |
/******/ }; | |
/******/ }; | |
/******/ for (var name in __webpack_require__) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call(__webpack_require__, name) && | |
/******/ name !== "e" | |
/******/ ) { | |
/******/ Object.defineProperty(fn, name, ObjectFactory(name)); | |
/******/ } | |
/******/ } | |
/******/ fn.e = function(chunkId) { | |
/******/ if (hotStatus === "ready") hotSetStatus("prepare"); | |
/******/ hotChunksLoading++; | |
/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) { | |
/******/ finishChunkLoading(); | |
/******/ throw err; | |
/******/ }); | |
/******/ | |
/******/ function finishChunkLoading() { | |
/******/ hotChunksLoading--; | |
/******/ if (hotStatus === "prepare") { | |
/******/ if (!hotWaitingFilesMap[chunkId]) { | |
/******/ hotEnsureUpdateChunk(chunkId); | |
/******/ } | |
/******/ if (hotChunksLoading === 0 && hotWaitingFiles === 0) { | |
/******/ hotUpdateDownloaded(); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ }; | |
/******/ return fn; | |
/******/ } | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotCreateModule(moduleId) { | |
/******/ var hot = { | |
/******/ // private stuff | |
/******/ _acceptedDependencies: {}, | |
/******/ _declinedDependencies: {}, | |
/******/ _selfAccepted: false, | |
/******/ _selfDeclined: false, | |
/******/ _disposeHandlers: [], | |
/******/ _main: hotCurrentChildModule !== moduleId, | |
/******/ | |
/******/ // Module API | |
/******/ active: true, | |
/******/ accept: function(dep, callback) { | |
/******/ if (typeof dep === "undefined") hot._selfAccepted = true; | |
/******/ else if (typeof dep === "function") hot._selfAccepted = dep; | |
/******/ else if (typeof dep === "object") | |
/******/ for (var i = 0; i < dep.length; i++) | |
/******/ hot._acceptedDependencies[dep[i]] = callback || function() {}; | |
/******/ else hot._acceptedDependencies[dep] = callback || function() {}; | |
/******/ }, | |
/******/ decline: function(dep) { | |
/******/ if (typeof dep === "undefined") hot._selfDeclined = true; | |
/******/ else if (typeof dep === "object") | |
/******/ for (var i = 0; i < dep.length; i++) | |
/******/ hot._declinedDependencies[dep[i]] = true; | |
/******/ else hot._declinedDependencies[dep] = true; | |
/******/ }, | |
/******/ dispose: function(callback) { | |
/******/ hot._disposeHandlers.push(callback); | |
/******/ }, | |
/******/ addDisposeHandler: function(callback) { | |
/******/ hot._disposeHandlers.push(callback); | |
/******/ }, | |
/******/ removeDisposeHandler: function(callback) { | |
/******/ var idx = hot._disposeHandlers.indexOf(callback); | |
/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1); | |
/******/ }, | |
/******/ | |
/******/ // Management API | |
/******/ check: hotCheck, | |
/******/ apply: hotApply, | |
/******/ status: function(l) { | |
/******/ if (!l) return hotStatus; | |
/******/ hotStatusHandlers.push(l); | |
/******/ }, | |
/******/ addStatusHandler: function(l) { | |
/******/ hotStatusHandlers.push(l); | |
/******/ }, | |
/******/ removeStatusHandler: function(l) { | |
/******/ var idx = hotStatusHandlers.indexOf(l); | |
/******/ if (idx >= 0) hotStatusHandlers.splice(idx, 1); | |
/******/ }, | |
/******/ | |
/******/ //inherit from previous dispose call | |
/******/ data: hotCurrentModuleData[moduleId] | |
/******/ }; | |
/******/ hotCurrentChildModule = undefined; | |
/******/ return hot; | |
/******/ } | |
/******/ | |
/******/ var hotStatusHandlers = []; | |
/******/ var hotStatus = "idle"; | |
/******/ | |
/******/ function hotSetStatus(newStatus) { | |
/******/ hotStatus = newStatus; | |
/******/ for (var i = 0; i < hotStatusHandlers.length; i++) | |
/******/ hotStatusHandlers[i].call(null, newStatus); | |
/******/ } | |
/******/ | |
/******/ // while downloading | |
/******/ var hotWaitingFiles = 0; | |
/******/ var hotChunksLoading = 0; | |
/******/ var hotWaitingFilesMap = {}; | |
/******/ var hotRequestedFilesMap = {}; | |
/******/ var hotAvailableFilesMap = {}; | |
/******/ var hotDeferred; | |
/******/ | |
/******/ // The update info | |
/******/ var hotUpdate, hotUpdateNewHash; | |
/******/ | |
/******/ function toModuleId(id) { | |
/******/ var isNumber = +id + "" === id; | |
/******/ return isNumber ? +id : id; | |
/******/ } | |
/******/ | |
/******/ function hotCheck(apply) { | |
/******/ if (hotStatus !== "idle") { | |
/******/ throw new Error("check() is only allowed in idle status"); | |
/******/ } | |
/******/ hotApplyOnUpdate = apply; | |
/******/ hotSetStatus("check"); | |
/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { | |
/******/ if (!update) { | |
/******/ hotSetStatus("idle"); | |
/******/ return null; | |
/******/ } | |
/******/ hotRequestedFilesMap = {}; | |
/******/ hotWaitingFilesMap = {}; | |
/******/ hotAvailableFilesMap = update.c; | |
/******/ hotUpdateNewHash = update.h; | |
/******/ | |
/******/ hotSetStatus("prepare"); | |
/******/ var promise = new Promise(function(resolve, reject) { | |
/******/ hotDeferred = { | |
/******/ resolve: resolve, | |
/******/ reject: reject | |
/******/ }; | |
/******/ }); | |
/******/ hotUpdate = {}; | |
/******/ for(var chunkId in installedChunks) | |
/******/ { | |
/******/ // eslint-disable-line no-lone-blocks | |
/******/ /*globals chunkId */ | |
/******/ hotEnsureUpdateChunk(chunkId); | |
/******/ } | |
/******/ if ( | |
/******/ hotStatus === "prepare" && | |
/******/ hotChunksLoading === 0 && | |
/******/ hotWaitingFiles === 0 | |
/******/ ) { | |
/******/ hotUpdateDownloaded(); | |
/******/ } | |
/******/ return promise; | |
/******/ }); | |
/******/ } | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotAddUpdateChunk(chunkId, moreModules) { | |
/******/ if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) | |
/******/ return; | |
/******/ hotRequestedFilesMap[chunkId] = false; | |
/******/ for (var moduleId in moreModules) { | |
/******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { | |
/******/ hotUpdate[moduleId] = moreModules[moduleId]; | |
/******/ } | |
/******/ } | |
/******/ if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { | |
/******/ hotUpdateDownloaded(); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ function hotEnsureUpdateChunk(chunkId) { | |
/******/ if (!hotAvailableFilesMap[chunkId]) { | |
/******/ hotWaitingFilesMap[chunkId] = true; | |
/******/ } else { | |
/******/ hotRequestedFilesMap[chunkId] = true; | |
/******/ hotWaitingFiles++; | |
/******/ hotDownloadUpdateChunk(chunkId); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ function hotUpdateDownloaded() { | |
/******/ hotSetStatus("ready"); | |
/******/ var deferred = hotDeferred; | |
/******/ hotDeferred = null; | |
/******/ if (!deferred) return; | |
/******/ if (hotApplyOnUpdate) { | |
/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to | |
/******/ // avoid triggering uncaught exception warning in Chrome. | |
/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 | |
/******/ Promise.resolve() | |
/******/ .then(function() { | |
/******/ return hotApply(hotApplyOnUpdate); | |
/******/ }) | |
/******/ .then( | |
/******/ function(result) { | |
/******/ deferred.resolve(result); | |
/******/ }, | |
/******/ function(err) { | |
/******/ deferred.reject(err); | |
/******/ } | |
/******/ ); | |
/******/ } else { | |
/******/ var outdatedModules = []; | |
/******/ for (var id in hotUpdate) { | |
/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { | |
/******/ outdatedModules.push(toModuleId(id)); | |
/******/ } | |
/******/ } | |
/******/ deferred.resolve(outdatedModules); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ function hotApply(options) { | |
/******/ if (hotStatus !== "ready") | |
/******/ throw new Error("apply() is only allowed in ready status"); | |
/******/ options = options || {}; | |
/******/ | |
/******/ var cb; | |
/******/ var i; | |
/******/ var j; | |
/******/ var module; | |
/******/ var moduleId; | |
/******/ | |
/******/ function getAffectedStuff(updateModuleId) { | |
/******/ var outdatedModules = [updateModuleId]; | |
/******/ var outdatedDependencies = {}; | |
/******/ | |
/******/ var queue = outdatedModules.slice().map(function(id) { | |
/******/ return { | |
/******/ chain: [id], | |
/******/ id: id | |
/******/ }; | |
/******/ }); | |
/******/ while (queue.length > 0) { | |
/******/ var queueItem = queue.pop(); | |
/******/ var moduleId = queueItem.id; | |
/******/ var chain = queueItem.chain; | |
/******/ module = installedModules[moduleId]; | |
/******/ if (!module || module.hot._selfAccepted) continue; | |
/******/ if (module.hot._selfDeclined) { | |
/******/ return { | |
/******/ type: "self-declined", | |
/******/ chain: chain, | |
/******/ moduleId: moduleId | |
/******/ }; | |
/******/ } | |
/******/ if (module.hot._main) { | |
/******/ return { | |
/******/ type: "unaccepted", | |
/******/ chain: chain, | |
/******/ moduleId: moduleId | |
/******/ }; | |
/******/ } | |
/******/ for (var i = 0; i < module.parents.length; i++) { | |
/******/ var parentId = module.parents[i]; | |
/******/ var parent = installedModules[parentId]; | |
/******/ if (!parent) continue; | |
/******/ if (parent.hot._declinedDependencies[moduleId]) { | |
/******/ return { | |
/******/ type: "declined", | |
/******/ chain: chain.concat([parentId]), | |
/******/ moduleId: moduleId, | |
/******/ parentId: parentId | |
/******/ }; | |
/******/ } | |
/******/ if (outdatedModules.indexOf(parentId) !== -1) continue; | |
/******/ if (parent.hot._acceptedDependencies[moduleId]) { | |
/******/ if (!outdatedDependencies[parentId]) | |
/******/ outdatedDependencies[parentId] = []; | |
/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); | |
/******/ continue; | |
/******/ } | |
/******/ delete outdatedDependencies[parentId]; | |
/******/ outdatedModules.push(parentId); | |
/******/ queue.push({ | |
/******/ chain: chain.concat([parentId]), | |
/******/ id: parentId | |
/******/ }); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ return { | |
/******/ type: "accepted", | |
/******/ moduleId: updateModuleId, | |
/******/ outdatedModules: outdatedModules, | |
/******/ outdatedDependencies: outdatedDependencies | |
/******/ }; | |
/******/ } | |
/******/ | |
/******/ function addAllToSet(a, b) { | |
/******/ for (var i = 0; i < b.length; i++) { | |
/******/ var item = b[i]; | |
/******/ if (a.indexOf(item) === -1) a.push(item); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // at begin all updates modules are outdated | |
/******/ // the "outdated" status can propagate to parents if they don't accept the children | |
/******/ var outdatedDependencies = {}; | |
/******/ var outdatedModules = []; | |
/******/ var appliedUpdate = {}; | |
/******/ | |
/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() { | |
/******/ console.warn( | |
/******/ "[HMR] unexpected require(" + result.moduleId + ") to disposed module" | |
/******/ ); | |
/******/ }; | |
/******/ | |
/******/ for (var id in hotUpdate) { | |
/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { | |
/******/ moduleId = toModuleId(id); | |
/******/ /** @type {TODO} */ | |
/******/ var result; | |
/******/ if (hotUpdate[id]) { | |
/******/ result = getAffectedStuff(moduleId); | |
/******/ } else { | |
/******/ result = { | |
/******/ type: "disposed", | |
/******/ moduleId: id | |
/******/ }; | |
/******/ } | |
/******/ /** @type {Error|false} */ | |
/******/ var abortError = false; | |
/******/ var doApply = false; | |
/******/ var doDispose = false; | |
/******/ var chainInfo = ""; | |
/******/ if (result.chain) { | |
/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); | |
/******/ } | |
/******/ switch (result.type) { | |
/******/ case "self-declined": | |
/******/ if (options.onDeclined) options.onDeclined(result); | |
/******/ if (!options.ignoreDeclined) | |
/******/ abortError = new Error( | |
/******/ "Aborted because of self decline: " + | |
/******/ result.moduleId + | |
/******/ chainInfo | |
/******/ ); | |
/******/ break; | |
/******/ case "declined": | |
/******/ if (options.onDeclined) options.onDeclined(result); | |
/******/ if (!options.ignoreDeclined) | |
/******/ abortError = new Error( | |
/******/ "Aborted because of declined dependency: " + | |
/******/ result.moduleId + | |
/******/ " in " + | |
/******/ result.parentId + | |
/******/ chainInfo | |
/******/ ); | |
/******/ break; | |
/******/ case "unaccepted": | |
/******/ if (options.onUnaccepted) options.onUnaccepted(result); | |
/******/ if (!options.ignoreUnaccepted) | |
/******/ abortError = new Error( | |
/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo | |
/******/ ); | |
/******/ break; | |
/******/ case "accepted": | |
/******/ if (options.onAccepted) options.onAccepted(result); | |
/******/ doApply = true; | |
/******/ break; | |
/******/ case "disposed": | |
/******/ if (options.onDisposed) options.onDisposed(result); | |
/******/ doDispose = true; | |
/******/ break; | |
/******/ default: | |
/******/ throw new Error("Unexception type " + result.type); | |
/******/ } | |
/******/ if (abortError) { | |
/******/ hotSetStatus("abort"); | |
/******/ return Promise.reject(abortError); | |
/******/ } | |
/******/ if (doApply) { | |
/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; | |
/******/ addAllToSet(outdatedModules, result.outdatedModules); | |
/******/ for (moduleId in result.outdatedDependencies) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call( | |
/******/ result.outdatedDependencies, | |
/******/ moduleId | |
/******/ ) | |
/******/ ) { | |
/******/ if (!outdatedDependencies[moduleId]) | |
/******/ outdatedDependencies[moduleId] = []; | |
/******/ addAllToSet( | |
/******/ outdatedDependencies[moduleId], | |
/******/ result.outdatedDependencies[moduleId] | |
/******/ ); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ if (doDispose) { | |
/******/ addAllToSet(outdatedModules, [result.moduleId]); | |
/******/ appliedUpdate[moduleId] = warnUnexpectedRequire; | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // Store self accepted outdated modules to require them later by the module system | |
/******/ var outdatedSelfAcceptedModules = []; | |
/******/ for (i = 0; i < outdatedModules.length; i++) { | |
/******/ moduleId = outdatedModules[i]; | |
/******/ if ( | |
/******/ installedModules[moduleId] && | |
/******/ installedModules[moduleId].hot._selfAccepted | |
/******/ ) | |
/******/ outdatedSelfAcceptedModules.push({ | |
/******/ module: moduleId, | |
/******/ errorHandler: installedModules[moduleId].hot._selfAccepted | |
/******/ }); | |
/******/ } | |
/******/ | |
/******/ // Now in "dispose" phase | |
/******/ hotSetStatus("dispose"); | |
/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { | |
/******/ if (hotAvailableFilesMap[chunkId] === false) { | |
/******/ hotDisposeChunk(chunkId); | |
/******/ } | |
/******/ }); | |
/******/ | |
/******/ var idx; | |
/******/ var queue = outdatedModules.slice(); | |
/******/ while (queue.length > 0) { | |
/******/ moduleId = queue.pop(); | |
/******/ module = installedModules[moduleId]; | |
/******/ if (!module) continue; | |
/******/ | |
/******/ var data = {}; | |
/******/ | |
/******/ // Call dispose handlers | |
/******/ var disposeHandlers = module.hot._disposeHandlers; | |
/******/ for (j = 0; j < disposeHandlers.length; j++) { | |
/******/ cb = disposeHandlers[j]; | |
/******/ cb(data); | |
/******/ } | |
/******/ hotCurrentModuleData[moduleId] = data; | |
/******/ | |
/******/ // disable module (this disables requires from this module) | |
/******/ module.hot.active = false; | |
/******/ | |
/******/ // remove module from cache | |
/******/ delete installedModules[moduleId]; | |
/******/ | |
/******/ // when disposing there is no need to call dispose handler | |
/******/ delete outdatedDependencies[moduleId]; | |
/******/ | |
/******/ // remove "parents" references from all children | |
/******/ for (j = 0; j < module.children.length; j++) { | |
/******/ var child = installedModules[module.children[j]]; | |
/******/ if (!child) continue; | |
/******/ idx = child.parents.indexOf(moduleId); | |
/******/ if (idx >= 0) { | |
/******/ child.parents.splice(idx, 1); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // remove outdated dependency from module children | |
/******/ var dependency; | |
/******/ var moduleOutdatedDependencies; | |
/******/ for (moduleId in outdatedDependencies) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) | |
/******/ ) { | |
/******/ module = installedModules[moduleId]; | |
/******/ if (module) { | |
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; | |
/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) { | |
/******/ dependency = moduleOutdatedDependencies[j]; | |
/******/ idx = module.children.indexOf(dependency); | |
/******/ if (idx >= 0) module.children.splice(idx, 1); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // Not in "apply" phase | |
/******/ hotSetStatus("apply"); | |
/******/ | |
/******/ hotCurrentHash = hotUpdateNewHash; | |
/******/ | |
/******/ // insert new code | |
/******/ for (moduleId in appliedUpdate) { | |
/******/ if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { | |
/******/ modules[moduleId] = appliedUpdate[moduleId]; | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // call accept handlers | |
/******/ var error = null; | |
/******/ for (moduleId in outdatedDependencies) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) | |
/******/ ) { | |
/******/ module = installedModules[moduleId]; | |
/******/ if (module) { | |
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; | |
/******/ var callbacks = []; | |
/******/ for (i = 0; i < moduleOutdatedDependencies.length; i++) { | |
/******/ dependency = moduleOutdatedDependencies[i]; | |
/******/ cb = module.hot._acceptedDependencies[dependency]; | |
/******/ if (cb) { | |
/******/ if (callbacks.indexOf(cb) !== -1) continue; | |
/******/ callbacks.push(cb); | |
/******/ } | |
/******/ } | |
/******/ for (i = 0; i < callbacks.length; i++) { | |
/******/ cb = callbacks[i]; | |
/******/ try { | |
/******/ cb(moduleOutdatedDependencies); | |
/******/ } catch (err) { | |
/******/ if (options.onErrored) { | |
/******/ options.onErrored({ | |
/******/ type: "accept-errored", | |
/******/ moduleId: moduleId, | |
/******/ dependencyId: moduleOutdatedDependencies[i], | |
/******/ error: err | |
/******/ }); | |
/******/ } | |
/******/ if (!options.ignoreErrored) { | |
/******/ if (!error) error = err; | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // Load self accepted modules | |
/******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { | |
/******/ var item = outdatedSelfAcceptedModules[i]; | |
/******/ moduleId = item.module; | |
/******/ hotCurrentParents = [moduleId]; | |
/******/ try { | |
/******/ __webpack_require__(moduleId); | |
/******/ } catch (err) { | |
/******/ if (typeof item.errorHandler === "function") { | |
/******/ try { | |
/******/ item.errorHandler(err); | |
/******/ } catch (err2) { | |
/******/ if (options.onErrored) { | |
/******/ options.onErrored({ | |
/******/ type: "self-accept-error-handler-errored", | |
/******/ moduleId: moduleId, | |
/******/ error: err2, | |
/******/ originalError: err | |
/******/ }); | |
/******/ } | |
/******/ if (!options.ignoreErrored) { | |
/******/ if (!error) error = err2; | |
/******/ } | |
/******/ if (!error) error = err; | |
/******/ } | |
/******/ } else { | |
/******/ if (options.onErrored) { | |
/******/ options.onErrored({ | |
/******/ type: "self-accept-errored", | |
/******/ moduleId: moduleId, | |
/******/ error: err | |
/******/ }); | |
/******/ } | |
/******/ if (!options.ignoreErrored) { | |
/******/ if (!error) error = err; | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // handle errors in accept handlers and self accepted module load | |
/******/ if (error) { | |
/******/ hotSetStatus("fail"); | |
/******/ return Promise.reject(error); | |
/******/ } | |
/******/ | |
/******/ hotSetStatus("idle"); | |
/******/ return new Promise(function(resolve) { | |
/******/ resolve(outdatedModules); | |
/******/ }); | |
/******/ } | |
/******/ function hotDisposeChunk(chunkId) { | |
/******/ delete installedChunks[chunkId]; | |
/******/ } | |
/******/ var parentHotUpdateCallback = window["webpackHotUpdate"]; | |
/******/ window["webpackHotUpdate"] = // eslint-disable-next-line no-unused-vars | |
/******/ function webpackHotUpdateCallback(chunkId, moreModules) { | |
/******/ hotAddUpdateChunk(chunkId, moreModules); | |
/******/ if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); | |
/******/ } ; | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotDownloadUpdateChunk(chunkId) { | |
/******/ var head = document.getElementsByTagName("head")[0]; | |
/******/ var script = document.createElement("script"); | |
/******/ script.charset = "utf-8"; | |
/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; | |
/******/ ; | |
/******/ head.appendChild(script); | |
/******/ } | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotDownloadManifest(requestTimeout) { | |
/******/ requestTimeout = requestTimeout || 10000; | |
/******/ return new Promise(function(resolve, reject) { | |
/******/ if (typeof XMLHttpRequest === "undefined") { | |
/******/ return reject(new Error("No browser support")); | |
/******/ } | |
/******/ try { | |
/******/ var request = new XMLHttpRequest(); | |
/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; | |
/******/ request.open("GET", requestPath, true); | |
/******/ request.timeout = requestTimeout; | |
/******/ request.send(null); | |
/******/ } catch (err) { | |
/******/ return reject(err); | |
/******/ } | |
/******/ request.onreadystatechange = function() { | |
/******/ if (request.readyState !== 4) return; | |
/******/ if (request.status === 0) { | |
/******/ // timeout | |
/******/ reject( | |
/******/ new Error("Manifest request to " + requestPath + " timed out.") | |
/******/ ); | |
/******/ } else if (request.status === 404) { | |
/******/ // no update available | |
/******/ resolve(); | |
/******/ } else if (request.status !== 200 && request.status !== 304) { | |
/******/ // other failure | |
/******/ reject(new Error("Manifest request to " + requestPath + " failed.")); | |
/******/ } else { | |
/******/ // success | |
/******/ try { | |
/******/ var update = JSON.parse(request.responseText); | |
/******/ } catch (e) { | |
/******/ reject(e); | |
/******/ return; | |
/******/ } | |
/******/ resolve(update); | |
/******/ } | |
/******/ }; | |
/******/ }); | |
/******/ } | |
/******/ | |
/******/ var hotApplyOnUpdate = true; | |
/******/ var hotCurrentHash = "2c7797bcdf7121247b21"; // eslint-disable-line no-unused-vars | |
/******/ var hotRequestTimeout = 10000; | |
/******/ var hotCurrentModuleData = {}; | |
/******/ var hotCurrentChildModule; // eslint-disable-line no-unused-vars | |
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars | |
/******/ var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotCreateRequire(moduleId) { | |
/******/ var me = installedModules[moduleId]; | |
/******/ if (!me) return __webpack_require__; | |
/******/ var fn = function(request) { | |
/******/ if (me.hot.active) { | |
/******/ if (installedModules[request]) { | |
/******/ if (installedModules[request].parents.indexOf(moduleId) === -1) { | |
/******/ installedModules[request].parents.push(moduleId); | |
/******/ } | |
/******/ } else { | |
/******/ hotCurrentParents = [moduleId]; | |
/******/ hotCurrentChildModule = request; | |
/******/ } | |
/******/ if (me.children.indexOf(request) === -1) { | |
/******/ me.children.push(request); | |
/******/ } | |
/******/ } else { | |
/******/ console.warn( | |
/******/ "[HMR] unexpected require(" + | |
/******/ request + | |
/******/ ") from disposed module " + | |
/******/ moduleId | |
/******/ ); | |
/******/ hotCurrentParents = []; | |
/******/ } | |
/******/ return __webpack_require__(request); | |
/******/ }; | |
/******/ var ObjectFactory = function ObjectFactory(name) { | |
/******/ return { | |
/******/ configurable: true, | |
/******/ enumerable: true, | |
/******/ get: function() { | |
/******/ return __webpack_require__[name]; | |
/******/ }, | |
/******/ set: function(value) { | |
/******/ __webpack_require__[name] = value; | |
/******/ } | |
/******/ }; | |
/******/ }; | |
/******/ for (var name in __webpack_require__) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call(__webpack_require__, name) && | |
/******/ name !== "e" | |
/******/ ) { | |
/******/ Object.defineProperty(fn, name, ObjectFactory(name)); | |
/******/ } | |
/******/ } | |
/******/ fn.e = function(chunkId) { | |
/******/ if (hotStatus === "ready") hotSetStatus("prepare"); | |
/******/ hotChunksLoading++; | |
/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) { | |
/******/ finishChunkLoading(); | |
/******/ throw err; | |
/******/ }); | |
/******/ | |
/******/ function finishChunkLoading() { | |
/******/ hotChunksLoading--; | |
/******/ if (hotStatus === "prepare") { | |
/******/ if (!hotWaitingFilesMap[chunkId]) { | |
/******/ hotEnsureUpdateChunk(chunkId); | |
/******/ } | |
/******/ if (hotChunksLoading === 0 && hotWaitingFiles === 0) { | |
/******/ hotUpdateDownloaded(); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ }; | |
/******/ return fn; | |
/******/ } | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotCreateModule(moduleId) { | |
/******/ var hot = { | |
/******/ // private stuff | |
/******/ _acceptedDependencies: {}, | |
/******/ _declinedDependencies: {}, | |
/******/ _selfAccepted: false, | |
/******/ _selfDeclined: false, | |
/******/ _disposeHandlers: [], | |
/******/ _main: hotCurrentChildModule !== moduleId, | |
/******/ | |
/******/ // Module API | |
/******/ active: true, | |
/******/ accept: function(dep, callback) { | |
/******/ if (typeof dep === "undefined") hot._selfAccepted = true; | |
/******/ else if (typeof dep === "function") hot._selfAccepted = dep; | |
/******/ else if (typeof dep === "object") | |
/******/ for (var i = 0; i < dep.length; i++) | |
/******/ hot._acceptedDependencies[dep[i]] = callback || function() {}; | |
/******/ else hot._acceptedDependencies[dep] = callback || function() {}; | |
/******/ }, | |
/******/ decline: function(dep) { | |
/******/ if (typeof dep === "undefined") hot._selfDeclined = true; | |
/******/ else if (typeof dep === "object") | |
/******/ for (var i = 0; i < dep.length; i++) | |
/******/ hot._declinedDependencies[dep[i]] = true; | |
/******/ else hot._declinedDependencies[dep] = true; | |
/******/ }, | |
/******/ dispose: function(callback) { | |
/******/ hot._disposeHandlers.push(callback); | |
/******/ }, | |
/******/ addDisposeHandler: function(callback) { | |
/******/ hot._disposeHandlers.push(callback); | |
/******/ }, | |
/******/ removeDisposeHandler: function(callback) { | |
/******/ var idx = hot._disposeHandlers.indexOf(callback); | |
/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1); | |
/******/ }, | |
/******/ | |
/******/ // Management API | |
/******/ check: hotCheck, | |
/******/ apply: hotApply, | |
/******/ status: function(l) { | |
/******/ if (!l) return hotStatus; | |
/******/ hotStatusHandlers.push(l); | |
/******/ }, | |
/******/ addStatusHandler: function(l) { | |
/******/ hotStatusHandlers.push(l); | |
/******/ }, | |
/******/ removeStatusHandler: function(l) { | |
/******/ var idx = hotStatusHandlers.indexOf(l); | |
/******/ if (idx >= 0) hotStatusHandlers.splice(idx, 1); | |
/******/ }, | |
/******/ | |
/******/ //inherit from previous dispose call | |
/******/ data: hotCurrentModuleData[moduleId] | |
/******/ }; | |
/******/ hotCurrentChildModule = undefined; | |
/******/ return hot; | |
/******/ } | |
/******/ | |
/******/ var hotStatusHandlers = []; | |
/******/ var hotStatus = "idle"; | |
/******/ | |
/******/ function hotSetStatus(newStatus) { | |
/******/ hotStatus = newStatus; | |
/******/ for (var i = 0; i < hotStatusHandlers.length; i++) | |
/******/ hotStatusHandlers[i].call(null, newStatus); | |
/******/ } | |
/******/ | |
/******/ // while downloading | |
/******/ var hotWaitingFiles = 0; | |
/******/ var hotChunksLoading = 0; | |
/******/ var hotWaitingFilesMap = {}; | |
/******/ var hotRequestedFilesMap = {}; | |
/******/ var hotAvailableFilesMap = {}; | |
/******/ var hotDeferred; | |
/******/ | |
/******/ // The update info | |
/******/ var hotUpdate, hotUpdateNewHash; | |
/******/ | |
/******/ function toModuleId(id) { | |
/******/ var isNumber = +id + "" === id; | |
/******/ return isNumber ? +id : id; | |
/******/ } | |
/******/ | |
/******/ function hotCheck(apply) { | |
/******/ if (hotStatus !== "idle") { | |
/******/ throw new Error("check() is only allowed in idle status"); | |
/******/ } | |
/******/ hotApplyOnUpdate = apply; | |
/******/ hotSetStatus("check"); | |
/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { | |
/******/ if (!update) { | |
/******/ hotSetStatus("idle"); | |
/******/ return null; | |
/******/ } | |
/******/ hotRequestedFilesMap = {}; | |
/******/ hotWaitingFilesMap = {}; | |
/******/ hotAvailableFilesMap = update.c; | |
/******/ hotUpdateNewHash = update.h; | |
/******/ | |
/******/ hotSetStatus("prepare"); | |
/******/ var promise = new Promise(function(resolve, reject) { | |
/******/ hotDeferred = { | |
/******/ resolve: resolve, | |
/******/ reject: reject | |
/******/ }; | |
/******/ }); | |
/******/ hotUpdate = {}; | |
/******/ for(var chunkId in installedChunks) | |
/******/ { | |
/******/ // eslint-disable-line no-lone-blocks | |
/******/ /*globals chunkId */ | |
/******/ hotEnsureUpdateChunk(chunkId); | |
/******/ } | |
/******/ if ( | |
/******/ hotStatus === "prepare" && | |
/******/ hotChunksLoading === 0 && | |
/******/ hotWaitingFiles === 0 | |
/******/ ) { | |
/******/ hotUpdateDownloaded(); | |
/******/ } | |
/******/ return promise; | |
/******/ }); | |
/******/ } | |
/******/ | |
/******/ // eslint-disable-next-line no-unused-vars | |
/******/ function hotAddUpdateChunk(chunkId, moreModules) { | |
/******/ if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) | |
/******/ return; | |
/******/ hotRequestedFilesMap[chunkId] = false; | |
/******/ for (var moduleId in moreModules) { | |
/******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { | |
/******/ hotUpdate[moduleId] = moreModules[moduleId]; | |
/******/ } | |
/******/ } | |
/******/ if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { | |
/******/ hotUpdateDownloaded(); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ function hotEnsureUpdateChunk(chunkId) { | |
/******/ if (!hotAvailableFilesMap[chunkId]) { | |
/******/ hotWaitingFilesMap[chunkId] = true; | |
/******/ } else { | |
/******/ hotRequestedFilesMap[chunkId] = true; | |
/******/ hotWaitingFiles++; | |
/******/ hotDownloadUpdateChunk(chunkId); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ function hotUpdateDownloaded() { | |
/******/ hotSetStatus("ready"); | |
/******/ var deferred = hotDeferred; | |
/******/ hotDeferred = null; | |
/******/ if (!deferred) return; | |
/******/ if (hotApplyOnUpdate) { | |
/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to | |
/******/ // avoid triggering uncaught exception warning in Chrome. | |
/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 | |
/******/ Promise.resolve() | |
/******/ .then(function() { | |
/******/ return hotApply(hotApplyOnUpdate); | |
/******/ }) | |
/******/ .then( | |
/******/ function(result) { | |
/******/ deferred.resolve(result); | |
/******/ }, | |
/******/ function(err) { | |
/******/ deferred.reject(err); | |
/******/ } | |
/******/ ); | |
/******/ } else { | |
/******/ var outdatedModules = []; | |
/******/ for (var id in hotUpdate) { | |
/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { | |
/******/ outdatedModules.push(toModuleId(id)); | |
/******/ } | |
/******/ } | |
/******/ deferred.resolve(outdatedModules); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ function hotApply(options) { | |
/******/ if (hotStatus !== "ready") | |
/******/ throw new Error("apply() is only allowed in ready status"); | |
/******/ options = options || {}; | |
/******/ | |
/******/ var cb; | |
/******/ var i; | |
/******/ var j; | |
/******/ var module; | |
/******/ var moduleId; | |
/******/ | |
/******/ function getAffectedStuff(updateModuleId) { | |
/******/ var outdatedModules = [updateModuleId]; | |
/******/ var outdatedDependencies = {}; | |
/******/ | |
/******/ var queue = outdatedModules.slice().map(function(id) { | |
/******/ return { | |
/******/ chain: [id], | |
/******/ id: id | |
/******/ }; | |
/******/ }); | |
/******/ while (queue.length > 0) { | |
/******/ var queueItem = queue.pop(); | |
/******/ var moduleId = queueItem.id; | |
/******/ var chain = queueItem.chain; | |
/******/ module = installedModules[moduleId]; | |
/******/ if (!module || module.hot._selfAccepted) continue; | |
/******/ if (module.hot._selfDeclined) { | |
/******/ return { | |
/******/ type: "self-declined", | |
/******/ chain: chain, | |
/******/ moduleId: moduleId | |
/******/ }; | |
/******/ } | |
/******/ if (module.hot._main) { | |
/******/ return { | |
/******/ type: "unaccepted", | |
/******/ chain: chain, | |
/******/ moduleId: moduleId | |
/******/ }; | |
/******/ } | |
/******/ for (var i = 0; i < module.parents.length; i++) { | |
/******/ var parentId = module.parents[i]; | |
/******/ var parent = installedModules[parentId]; | |
/******/ if (!parent) continue; | |
/******/ if (parent.hot._declinedDependencies[moduleId]) { | |
/******/ return { | |
/******/ type: "declined", | |
/******/ chain: chain.concat([parentId]), | |
/******/ moduleId: moduleId, | |
/******/ parentId: parentId | |
/******/ }; | |
/******/ } | |
/******/ if (outdatedModules.indexOf(parentId) !== -1) continue; | |
/******/ if (parent.hot._acceptedDependencies[moduleId]) { | |
/******/ if (!outdatedDependencies[parentId]) | |
/******/ outdatedDependencies[parentId] = []; | |
/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); | |
/******/ continue; | |
/******/ } | |
/******/ delete outdatedDependencies[parentId]; | |
/******/ outdatedModules.push(parentId); | |
/******/ queue.push({ | |
/******/ chain: chain.concat([parentId]), | |
/******/ id: parentId | |
/******/ }); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ return { | |
/******/ type: "accepted", | |
/******/ moduleId: updateModuleId, | |
/******/ outdatedModules: outdatedModules, | |
/******/ outdatedDependencies: outdatedDependencies | |
/******/ }; | |
/******/ } | |
/******/ | |
/******/ function addAllToSet(a, b) { | |
/******/ for (var i = 0; i < b.length; i++) { | |
/******/ var item = b[i]; | |
/******/ if (a.indexOf(item) === -1) a.push(item); | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // at begin all updates modules are outdated | |
/******/ // the "outdated" status can propagate to parents if they don't accept the children | |
/******/ var outdatedDependencies = {}; | |
/******/ var outdatedModules = []; | |
/******/ var appliedUpdate = {}; | |
/******/ | |
/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() { | |
/******/ console.warn( | |
/******/ "[HMR] unexpected require(" + result.moduleId + ") to disposed module" | |
/******/ ); | |
/******/ }; | |
/******/ | |
/******/ for (var id in hotUpdate) { | |
/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { | |
/******/ moduleId = toModuleId(id); | |
/******/ /** @type {TODO} */ | |
/******/ var result; | |
/******/ if (hotUpdate[id]) { | |
/******/ result = getAffectedStuff(moduleId); | |
/******/ } else { | |
/******/ result = { | |
/******/ type: "disposed", | |
/******/ moduleId: id | |
/******/ }; | |
/******/ } | |
/******/ /** @type {Error|false} */ | |
/******/ var abortError = false; | |
/******/ var doApply = false; | |
/******/ var doDispose = false; | |
/******/ var chainInfo = ""; | |
/******/ if (result.chain) { | |
/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); | |
/******/ } | |
/******/ switch (result.type) { | |
/******/ case "self-declined": | |
/******/ if (options.onDeclined) options.onDeclined(result); | |
/******/ if (!options.ignoreDeclined) | |
/******/ abortError = new Error( | |
/******/ "Aborted because of self decline: " + | |
/******/ result.moduleId + | |
/******/ chainInfo | |
/******/ ); | |
/******/ break; | |
/******/ case "declined": | |
/******/ if (options.onDeclined) options.onDeclined(result); | |
/******/ if (!options.ignoreDeclined) | |
/******/ abortError = new Error( | |
/******/ "Aborted because of declined dependency: " + | |
/******/ result.moduleId + | |
/******/ " in " + | |
/******/ result.parentId + | |
/******/ chainInfo | |
/******/ ); | |
/******/ break; | |
/******/ case "unaccepted": | |
/******/ if (options.onUnaccepted) options.onUnaccepted(result); | |
/******/ if (!options.ignoreUnaccepted) | |
/******/ abortError = new Error( | |
/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo | |
/******/ ); | |
/******/ break; | |
/******/ case "accepted": | |
/******/ if (options.onAccepted) options.onAccepted(result); | |
/******/ doApply = true; | |
/******/ break; | |
/******/ case "disposed": | |
/******/ if (options.onDisposed) options.onDisposed(result); | |
/******/ doDispose = true; | |
/******/ break; | |
/******/ default: | |
/******/ throw new Error("Unexception type " + result.type); | |
/******/ } | |
/******/ if (abortError) { | |
/******/ hotSetStatus("abort"); | |
/******/ return Promise.reject(abortError); | |
/******/ } | |
/******/ if (doApply) { | |
/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; | |
/******/ addAllToSet(outdatedModules, result.outdatedModules); | |
/******/ for (moduleId in result.outdatedDependencies) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call( | |
/******/ result.outdatedDependencies, | |
/******/ moduleId | |
/******/ ) | |
/******/ ) { | |
/******/ if (!outdatedDependencies[moduleId]) | |
/******/ outdatedDependencies[moduleId] = []; | |
/******/ addAllToSet( | |
/******/ outdatedDependencies[moduleId], | |
/******/ result.outdatedDependencies[moduleId] | |
/******/ ); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ if (doDispose) { | |
/******/ addAllToSet(outdatedModules, [result.moduleId]); | |
/******/ appliedUpdate[moduleId] = warnUnexpectedRequire; | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // Store self accepted outdated modules to require them later by the module system | |
/******/ var outdatedSelfAcceptedModules = []; | |
/******/ for (i = 0; i < outdatedModules.length; i++) { | |
/******/ moduleId = outdatedModules[i]; | |
/******/ if ( | |
/******/ installedModules[moduleId] && | |
/******/ installedModules[moduleId].hot._selfAccepted | |
/******/ ) | |
/******/ outdatedSelfAcceptedModules.push({ | |
/******/ module: moduleId, | |
/******/ errorHandler: installedModules[moduleId].hot._selfAccepted | |
/******/ }); | |
/******/ } | |
/******/ | |
/******/ // Now in "dispose" phase | |
/******/ hotSetStatus("dispose"); | |
/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { | |
/******/ if (hotAvailableFilesMap[chunkId] === false) { | |
/******/ hotDisposeChunk(chunkId); | |
/******/ } | |
/******/ }); | |
/******/ | |
/******/ var idx; | |
/******/ var queue = outdatedModules.slice(); | |
/******/ while (queue.length > 0) { | |
/******/ moduleId = queue.pop(); | |
/******/ module = installedModules[moduleId]; | |
/******/ if (!module) continue; | |
/******/ | |
/******/ var data = {}; | |
/******/ | |
/******/ // Call dispose handlers | |
/******/ var disposeHandlers = module.hot._disposeHandlers; | |
/******/ for (j = 0; j < disposeHandlers.length; j++) { | |
/******/ cb = disposeHandlers[j]; | |
/******/ cb(data); | |
/******/ } | |
/******/ hotCurrentModuleData[moduleId] = data; | |
/******/ | |
/******/ // disable module (this disables requires from this module) | |
/******/ module.hot.active = false; | |
/******/ | |
/******/ // remove module from cache | |
/******/ delete installedModules[moduleId]; | |
/******/ | |
/******/ // when disposing there is no need to call dispose handler | |
/******/ delete outdatedDependencies[moduleId]; | |
/******/ | |
/******/ // remove "parents" references from all children | |
/******/ for (j = 0; j < module.children.length; j++) { | |
/******/ var child = installedModules[module.children[j]]; | |
/******/ if (!child) continue; | |
/******/ idx = child.parents.indexOf(moduleId); | |
/******/ if (idx >= 0) { | |
/******/ child.parents.splice(idx, 1); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // remove outdated dependency from module children | |
/******/ var dependency; | |
/******/ var moduleOutdatedDependencies; | |
/******/ for (moduleId in outdatedDependencies) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) | |
/******/ ) { | |
/******/ module = installedModules[moduleId]; | |
/******/ if (module) { | |
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; | |
/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) { | |
/******/ dependency = moduleOutdatedDependencies[j]; | |
/******/ idx = module.children.indexOf(dependency); | |
/******/ if (idx >= 0) module.children.splice(idx, 1); | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // Not in "apply" phase | |
/******/ hotSetStatus("apply"); | |
/******/ | |
/******/ hotCurrentHash = hotUpdateNewHash; | |
/******/ | |
/******/ // insert new code | |
/******/ for (moduleId in appliedUpdate) { | |
/******/ if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { | |
/******/ modules[moduleId] = appliedUpdate[moduleId]; | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // call accept handlers | |
/******/ var error = null; | |
/******/ for (moduleId in outdatedDependencies) { | |
/******/ if ( | |
/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) | |
/******/ ) { | |
/******/ module = installedModules[moduleId]; | |
/******/ if (module) { | |
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; | |
/******/ var callbacks = []; | |
/******/ for (i = 0; i < moduleOutdatedDependencies.length; i++) { | |
/******/ dependency = moduleOutdatedDependencies[i]; | |
/******/ cb = module.hot._acceptedDependencies[dependency]; | |
/******/ if (cb) { | |
/******/ if (callbacks.indexOf(cb) !== -1) continue; | |
/******/ callbacks.push(cb); | |
/******/ } | |
/******/ } | |
/******/ for (i = 0; i < callbacks.length; i++) { | |
/******/ cb = callbacks[i]; | |
/******/ try { | |
/******/ cb(moduleOutdatedDependencies); | |
/******/ } catch (err) { | |
/******/ if (options.onErrored) { | |
/******/ options.onErrored({ | |
/******/ type: "accept-errored", | |
/******/ moduleId: moduleId, | |
/******/ dependencyId: moduleOutdatedDependencies[i], | |
/******/ error: err | |
/******/ }); | |
/******/ } | |
/******/ if (!options.ignoreErrored) { | |
/******/ if (!error) error = err; | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // Load self accepted modules | |
/******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { | |
/******/ var item = outdatedSelfAcceptedModules[i]; | |
/******/ moduleId = item.module; | |
/******/ hotCurrentParents = [moduleId]; | |
/******/ try { | |
/******/ __webpack_require__(moduleId); | |
/******/ } catch (err) { | |
/******/ if (typeof item.errorHandler === "function") { | |
/******/ try { | |
/******/ item.errorHandler(err); | |
/******/ } catch (err2) { | |
/******/ if (options.onErrored) { | |
/******/ options.onErrored({ | |
/******/ type: "self-accept-error-handler-errored", | |
/******/ moduleId: moduleId, | |
/******/ error: err2, | |
/******/ originalError: err | |
/******/ }); | |
/******/ } | |
/******/ if (!options.ignoreErrored) { | |
/******/ if (!error) error = err2; | |
/******/ } | |
/******/ if (!error) error = err; | |
/******/ } | |
/******/ } else { | |
/******/ if (options.onErrored) { | |
/******/ options.onErrored({ | |
/******/ type: "self-accept-errored", | |
/******/ moduleId: moduleId, | |
/******/ error: err | |
/******/ }); | |
/******/ } | |
/******/ if (!options.ignoreErrored) { | |
/******/ if (!error) error = err; | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ } | |
/******/ | |
/******/ // handle errors in accept handlers and self accepted module load | |
/******/ if (error) { | |
/******/ hotSetStatus("fail"); | |
/******/ return Promise.reject(error); | |
/******/ } | |
/******/ | |
/******/ hotSetStatus("idle"); | |
/******/ return new Promise(function(resolve) { | |
/******/ resolve(outdatedModules); | |
/******/ }); | |
/******/ } | |
/******/ | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // object to store loaded and loading chunks | |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched | |
/******/ // Promise = chunk loading, 0 = chunk loaded | |
/******/ var installedChunks = { | |
/******/ "app": 0 | |
/******/ }; | |
/******/ | |
/******/ | |
/******/ | |
/******/ // script path function | |
/******/ function jsonpScriptSrc(chunkId) { | |
/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + "_development.js" | |
/******/ } | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; | |
/******/ } | |
/******/ // Create a new module (and put it into the cache) | |
/******/ var module = installedModules[moduleId] = { | |
/******/ i: moduleId, | |
/******/ l: false, | |
/******/ exports: {}, | |
/******/ hot: hotCreateModule(moduleId), | |
/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp), | |
/******/ children: [], | |
/******/ hot: hotCreateModule(moduleId), | |
/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp), | |
/******/ children: [] | |
/******/ }; | |
/******/ | |
/******/ // Execute the module function | |
/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | |
/******/ | |
/******/ // Flag the module as loaded | |
/******/ module.l = true; | |
/******/ | |
/******/ // Return the exports of the module | |
/******/ return module.exports; | |
/******/ } | |
/******/ | |
/******/ // This file contains only the entry chunk. | |
/******/ // The chunk loading function for additional chunks | |
/******/ __webpack_require__.e = function requireEnsure(chunkId) { | |
/******/ var promises = []; | |
/******/ | |
/******/ | |
/******/ // JSONP chunk loading for javascript | |
/******/ | |
/******/ var installedChunkData = installedChunks[chunkId]; | |
/******/ if(installedChunkData !== 0) { // 0 means "already installed". | |
/******/ | |
/******/ // a Promise means "currently loading". | |
/******/ if(installedChunkData) { | |
/******/ promises.push(installedChunkData[2]); | |
/******/ } else { | |
/******/ // setup Promise in chunk cache | |
/******/ var promise = new Promise(function(resolve, reject) { | |
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; | |
/******/ }); | |
/******/ promises.push(installedChunkData[2] = promise); | |
/******/ | |
/******/ // start chunk loading | |
/******/ var head = document.getElementsByTagName('head')[0]; | |
/******/ var script = document.createElement('script'); | |
/******/ var onScriptComplete; | |
/******/ | |
/******/ script.charset = 'utf-8'; | |
/******/ script.timeout = 120; | |
/******/ | |
/******/ if (__webpack_require__.nc) { | |
/******/ script.setAttribute("nonce", __webpack_require__.nc); | |
/******/ } | |
/******/ script.src = jsonpScriptSrc(chunkId); | |
/******/ onScriptComplete = function (event) { | |
/******/ // avoid mem leaks in IE. | |
/******/ script.onerror = script.onload = null; | |
/******/ clearTimeout(timeout); | |
/******/ var chunk = installedChunks[chunkId]; | |
/******/ if(chunk !== 0) { | |
/******/ if(chunk) { | |
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); | |
/******/ var realSrc = event && event.target && event.target.src; | |
/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'); | |
/******/ error.type = errorType; | |
/******/ error.request = realSrc; | |
/******/ chunk[1](error); | |
/******/ } | |
/******/ installedChunks[chunkId] = undefined; | |
/******/ } | |
/******/ }; | |
/******/ var timeout = setTimeout(function(){ | |
/******/ onScriptComplete({ type: 'timeout', target: script }); | |
/******/ }, 120000); | |
/******/ script.onerror = script.onload = onScriptComplete; | |
/******/ head.appendChild(script); | |
/******/ } | |
/******/ } | |
/******/ return Promise.all(promises); | |
/******/ }; | |
/******/ | |
/******/ // expose the modules object (__webpack_modules__) | |
/******/ __webpack_require__.m = modules; | |
/******/ | |
/******/ // expose the module cache | |
/******/ __webpack_require__.c = installedModules; | |
/******/ | |
/******/ // define getter function for harmony exports | |
/******/ __webpack_require__.d = function(exports, name, getter) { | |
/******/ if(!__webpack_require__.o(exports, name)) { | |
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | |
/******/ } | |
/******/ }; | |
/******/ | |
/******/ // define __esModule on exports | |
/******/ __webpack_require__.r = function(exports) { | |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
/******/ } | |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
/******/ }; | |
/******/ | |
/******/ // create a fake namespace object | |
/******/ // mode & 1: value is a module id, require it | |
/******/ // mode & 2: merge all properties of value into the ns | |
/******/ // mode & 4: return value when already ns object | |
/******/ // mode & 8|1: behave like require | |
/******/ __webpack_require__.t = function(value, mode) { | |
/******/ if(mode & 1) value = __webpack_require__(value); | |
/******/ if(mode & 8) return value; | |
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | |
/******/ var ns = Object.create(null); | |
/******/ __webpack_require__.r(ns); | |
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | |
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | |
/******/ return ns; | |
/******/ }; | |
/******/ | |
/******/ // getDefaultExport function for compatibility with non-harmony modules | |
/******/ __webpack_require__.n = function(module) { | |
/******/ var getter = module && module.__esModule ? | |
/******/ function getDefault() { return module['default']; } : | |
/******/ function getModuleExports() { return module; }; | |
/******/ __webpack_require__.d(getter, 'a', getter); | |
/******/ return getter; | |
/******/ }; | |
/******/ | |
/******/ // Object.prototype.hasOwnProperty.call | |
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | |
/******/ | |
/******/ // __webpack_public_path__ | |
/******/ __webpack_require__.p = "http://localhost:3035/packs/"; | |
/******/ | |
/******/ // on error function for async loading | |
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; | |
/******/ | |
/******/ // __webpack_hash__ | |
/******/ __webpack_require__.h = function() { return hotCurrentHash; }; | |
/******/ | |
/******/ // __webpack_hash__ | |
/******/ __webpack_require__.h = function() { return hotCurrentHash; }; | |
/******/ | |
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; | |
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); | |
/******/ jsonpArray.push = webpackJsonpCallback; | |
/******/ jsonpArray = jsonpArray.slice(); | |
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); | |
/******/ var parentJsonpFunction = oldJsonpFunction; | |
/******/ | |
/******/ | |
/******/ // Load entry module and return exports | |
/******/ return hotCreateRequire(6)(__webpack_require__.s = 6); | |
/******/ }) | |
/************************************************************************/ | |
/******/ ({ | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations.rb": | |
/*!*********************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations.rb ***! | |
\*********************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var active_support_core_ext_hash_indifferent_access_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! active_support/core_ext/hash/indifferent_access.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/gems/opal-activesupport-0.3.1/opal/active_support/core_ext/hash/indifferent_access.rb"); | |
/* harmony import */ var active_support_core_ext_string_inflections_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! active_support/core_ext/string/inflections.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/gems/opal-activesupport-0.3.1/opal/active_support/core_ext/string/inflections.rb"); | |
/* harmony import */ var date_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! date.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/date.rb"); | |
/* harmony import */ var time_rb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! time.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/time.rb"); | |
/* harmony import */ var bigdecimal_rb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bigdecimal.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/bigdecimal.rb"); | |
/* harmony import */ var mutations_version_rb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! mutations/version.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/version.rb"); | |
/* harmony import */ var mutations_exception_rb__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! mutations/exception.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/exception.rb"); | |
/* harmony import */ var mutations_errors_rb__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mutations/errors.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/errors.rb"); | |
/* harmony import */ var mutations_input_filter_rb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! mutations/input_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/input_filter.rb"); | |
/* harmony import */ var mutations_additional_filter_rb__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! mutations/additional_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/additional_filter.rb"); | |
/* harmony import */ var mutations_string_filter_rb__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! mutations/string_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/string_filter.rb"); | |
/* harmony import */ var mutations_integer_filter_rb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! mutations/integer_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/integer_filter.rb"); | |
/* harmony import */ var mutations_float_filter_rb__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! mutations/float_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/float_filter.rb"); | |
/* harmony import */ var mutations_boolean_filter_rb__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! mutations/boolean_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/boolean_filter.rb"); | |
/* harmony import */ var mutations_duck_filter_rb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! mutations/duck_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/duck_filter.rb"); | |
/* harmony import */ var mutations_date_filter_rb__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! mutations/date_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/date_filter.rb"); | |
/* harmony import */ var mutations_time_filter_rb__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! mutations/time_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/time_filter.rb"); | |
/* harmony import */ var mutations_file_filter_rb__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! mutations/file_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/file_filter.rb"); | |
/* harmony import */ var mutations_model_filter_rb__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! mutations/model_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/model_filter.rb"); | |
/* harmony import */ var mutations_array_filter_rb__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! mutations/array_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/array_filter.rb"); | |
/* harmony import */ var mutations_hash_filter_rb__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! mutations/hash_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/hash_filter.rb"); | |
/* harmony import */ var mutations_outcome_rb__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! mutations/outcome.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/outcome.rb"); | |
/* harmony import */ var mutations_command_rb__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! mutations/command.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/command.rb"); | |
if (typeof global.Opal.modules["active_support/core_ext/hash/indifferent_access"] === 'undefined') { | |
if (typeof active_support_core_ext_hash_indifferent_access_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(active_support_core_ext_hash_indifferent_access_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["active_support/core_ext/string/inflections"] === 'undefined') { | |
if (typeof active_support_core_ext_string_inflections_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(active_support_core_ext_string_inflections_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["date"] === 'undefined') { | |
if (typeof date_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(date_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
if (typeof global.Opal.modules["time"] === 'undefined') { | |
if (typeof time_rb__WEBPACK_IMPORTED_MODULE_3__["default"] === 'function') { Object(time_rb__WEBPACK_IMPORTED_MODULE_3__["default"])(); } | |
} | |
if (typeof global.Opal.modules["bigdecimal"] === 'undefined') { | |
if (typeof bigdecimal_rb__WEBPACK_IMPORTED_MODULE_4__["default"] === 'function') { Object(bigdecimal_rb__WEBPACK_IMPORTED_MODULE_4__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/version"] === 'undefined') { | |
if (typeof mutations_version_rb__WEBPACK_IMPORTED_MODULE_5__["default"] === 'function') { Object(mutations_version_rb__WEBPACK_IMPORTED_MODULE_5__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/exception"] === 'undefined') { | |
if (typeof mutations_exception_rb__WEBPACK_IMPORTED_MODULE_6__["default"] === 'function') { Object(mutations_exception_rb__WEBPACK_IMPORTED_MODULE_6__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/errors"] === 'undefined') { | |
if (typeof mutations_errors_rb__WEBPACK_IMPORTED_MODULE_7__["default"] === 'function') { Object(mutations_errors_rb__WEBPACK_IMPORTED_MODULE_7__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/input_filter"] === 'undefined') { | |
if (typeof mutations_input_filter_rb__WEBPACK_IMPORTED_MODULE_8__["default"] === 'function') { Object(mutations_input_filter_rb__WEBPACK_IMPORTED_MODULE_8__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/additional_filter"] === 'undefined') { | |
if (typeof mutations_additional_filter_rb__WEBPACK_IMPORTED_MODULE_9__["default"] === 'function') { Object(mutations_additional_filter_rb__WEBPACK_IMPORTED_MODULE_9__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/string_filter"] === 'undefined') { | |
if (typeof mutations_string_filter_rb__WEBPACK_IMPORTED_MODULE_10__["default"] === 'function') { Object(mutations_string_filter_rb__WEBPACK_IMPORTED_MODULE_10__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/integer_filter"] === 'undefined') { | |
if (typeof mutations_integer_filter_rb__WEBPACK_IMPORTED_MODULE_11__["default"] === 'function') { Object(mutations_integer_filter_rb__WEBPACK_IMPORTED_MODULE_11__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/float_filter"] === 'undefined') { | |
if (typeof mutations_float_filter_rb__WEBPACK_IMPORTED_MODULE_12__["default"] === 'function') { Object(mutations_float_filter_rb__WEBPACK_IMPORTED_MODULE_12__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/boolean_filter"] === 'undefined') { | |
if (typeof mutations_boolean_filter_rb__WEBPACK_IMPORTED_MODULE_13__["default"] === 'function') { Object(mutations_boolean_filter_rb__WEBPACK_IMPORTED_MODULE_13__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/duck_filter"] === 'undefined') { | |
if (typeof mutations_duck_filter_rb__WEBPACK_IMPORTED_MODULE_14__["default"] === 'function') { Object(mutations_duck_filter_rb__WEBPACK_IMPORTED_MODULE_14__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/date_filter"] === 'undefined') { | |
if (typeof mutations_date_filter_rb__WEBPACK_IMPORTED_MODULE_15__["default"] === 'function') { Object(mutations_date_filter_rb__WEBPACK_IMPORTED_MODULE_15__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/time_filter"] === 'undefined') { | |
if (typeof mutations_time_filter_rb__WEBPACK_IMPORTED_MODULE_16__["default"] === 'function') { Object(mutations_time_filter_rb__WEBPACK_IMPORTED_MODULE_16__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/file_filter"] === 'undefined') { | |
if (typeof mutations_file_filter_rb__WEBPACK_IMPORTED_MODULE_17__["default"] === 'function') { Object(mutations_file_filter_rb__WEBPACK_IMPORTED_MODULE_17__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/model_filter"] === 'undefined') { | |
if (typeof mutations_model_filter_rb__WEBPACK_IMPORTED_MODULE_18__["default"] === 'function') { Object(mutations_model_filter_rb__WEBPACK_IMPORTED_MODULE_18__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/array_filter"] === 'undefined') { | |
if (typeof mutations_array_filter_rb__WEBPACK_IMPORTED_MODULE_19__["default"] === 'function') { Object(mutations_array_filter_rb__WEBPACK_IMPORTED_MODULE_19__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/hash_filter"] === 'undefined') { | |
if (typeof mutations_hash_filter_rb__WEBPACK_IMPORTED_MODULE_20__["default"] === 'function') { Object(mutations_hash_filter_rb__WEBPACK_IMPORTED_MODULE_20__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/outcome"] === 'undefined') { | |
if (typeof mutations_outcome_rb__WEBPACK_IMPORTED_MODULE_21__["default"] === 'function') { Object(mutations_outcome_rb__WEBPACK_IMPORTED_MODULE_21__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/command"] === 'undefined') { | |
if (typeof mutations_command_rb__WEBPACK_IMPORTED_MODULE_22__["default"] === 'function') { Object(mutations_command_rb__WEBPACK_IMPORTED_MODULE_22__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $truthy = Opal.truthy, $send = Opal.send, $writer = nil; | |
Opal.add_stubs(['$require', '$new', '$cache_constants=', '$-']); | |
self.$require("active_support/core_ext/hash/indifferent_access"); | |
self.$require("active_support/core_ext/string/inflections"); | |
self.$require("date"); | |
self.$require("time"); | |
self.$require("bigdecimal"); | |
self.$require("mutations/version"); | |
self.$require("mutations/exception"); | |
self.$require("mutations/errors"); | |
self.$require("mutations/input_filter"); | |
self.$require("mutations/additional_filter"); | |
self.$require("mutations/string_filter"); | |
self.$require("mutations/integer_filter"); | |
self.$require("mutations/float_filter"); | |
self.$require("mutations/boolean_filter"); | |
self.$require("mutations/duck_filter"); | |
self.$require("mutations/date_filter"); | |
self.$require("mutations/time_filter"); | |
self.$require("mutations/file_filter"); | |
self.$require("mutations/model_filter"); | |
self.$require("mutations/array_filter"); | |
self.$require("mutations/hash_filter"); | |
self.$require("mutations/outcome"); | |
self.$require("mutations/command"); | |
(function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_error_message_creator_1, TMP_error_message_creator$eq_2, TMP_cache_constants$eq_3, TMP_cache_constants$q_4; | |
Opal.def(self, '$error_message_creator', TMP_error_message_creator_1 = function $$error_message_creator() { | |
var $a, self = this; | |
if (self.error_message_creator == null) self.error_message_creator = nil; | |
return (self.error_message_creator = ($truthy($a = self.error_message_creator) ? $a : $$($nesting, 'DefaultErrorMessageCreator').$new())) | |
}, TMP_error_message_creator_1.$$arity = 0); | |
Opal.def(self, '$error_message_creator=', TMP_error_message_creator$eq_2 = function(creator) { | |
var self = this; | |
return (self.error_message_creator = creator) | |
}, TMP_error_message_creator$eq_2.$$arity = 1); | |
Opal.def(self, '$cache_constants=', TMP_cache_constants$eq_3 = function(val) { | |
var self = this; | |
return (self.cache_constants = val) | |
}, TMP_cache_constants$eq_3.$$arity = 1); | |
return (Opal.def(self, '$cache_constants?', TMP_cache_constants$q_4 = function() { | |
var self = this; | |
if (self.cache_constants == null) self.cache_constants = nil; | |
return self.cache_constants | |
}, TMP_cache_constants$q_4.$$arity = 0), nil) && 'cache_constants?'; | |
})(Opal.get_singleton_class(self), $nesting) | |
})($nesting[0], $nesting); | |
$writer = [true]; | |
$send($$($nesting, 'Mutations'), 'cache_constants=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];; | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/additional_filter.rb": | |
/*!***************************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/additional_filter.rb ***! | |
\***************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var mutations_hash_filter_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mutations/hash_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/hash_filter.rb"); | |
/* harmony import */ var mutations_array_filter_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mutations/array_filter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/array_filter.rb"); | |
if (typeof global.Opal.modules["mutations/hash_filter"] === 'undefined') { | |
if (typeof mutations_hash_filter_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(mutations_hash_filter_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations/array_filter"] === 'undefined') { | |
if (typeof mutations_array_filter_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(mutations_array_filter_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/additional_filter"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; | |
Opal.add_stubs(['$require', '$underscore', '$[]', '$name', '$register_additional_filter']); | |
self.$require("mutations/hash_filter"); | |
self.$require("mutations/array_filter"); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $AdditionalFilter(){}; | |
var self = $AdditionalFilter = $klass($base, $super, 'AdditionalFilter', $AdditionalFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_AdditionalFilter_inherited_1; | |
return (Opal.defs(self, '$inherited', TMP_AdditionalFilter_inherited_1 = function $$inherited(subclass) { | |
var self = this, type_name = nil; | |
type_name = subclass.$name()['$[]'](/^Mutations::([a-zA-Z]*)Filter$/, 1).$underscore(); | |
$$$($$($nesting, 'Mutations'), 'HashFilter').$register_additional_filter(subclass, type_name); | |
return $$$($$($nesting, 'Mutations'), 'ArrayFilter').$register_additional_filter(subclass, type_name); | |
}, TMP_AdditionalFilter_inherited_1.$$arity = 1), nil) && 'inherited' | |
})($nesting[0], $$($nesting, 'InputFilter'), $nesting) | |
})($nesting[0], $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/array_filter.rb": | |
/*!**********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/array_filter.rb ***! | |
\**********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/array_filter"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$define_method', '$[]', '$new', '$to_proc', '$instance_eval', '$options', '$raise', '$to_sym', '$nil?', '$!', '$is_a?', '$==', '$Array', '$each_with_index', '$filter_element', '$<<', '$discard_invalid?', '$filter', '$constantize']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ArrayFilter(){}; | |
var self = $ArrayFilter = $klass($base, $super, 'ArrayFilter', $ArrayFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ArrayFilter_register_additional_filter_2, TMP_ArrayFilter_initialize_3, TMP_ArrayFilter_hash_4, TMP_ArrayFilter_model_5, TMP_ArrayFilter_array_6, TMP_ArrayFilter_filter_8, TMP_ArrayFilter_filter_element_9; | |
def.element_filter = nil; | |
Opal.defs(self, '$register_additional_filter', TMP_ArrayFilter_register_additional_filter_2 = function $$register_additional_filter(type_class, type_name) { | |
var TMP_1, self = this; | |
return $send(self, 'define_method', [type_name], (TMP_1 = function($a_rest){var self = TMP_1.$$s || this, block, args, $b, options = nil; | |
block = TMP_1.$$p || nil; | |
if (block) TMP_1.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
options = ($truthy($b = args['$[]'](0)) ? $b : $hash2([], {})); | |
return (self.element_filter = $send(type_class, 'new', [options], block.$to_proc()));}, TMP_1.$$s = self, TMP_1.$$arity = -1, TMP_1)) | |
}, TMP_ArrayFilter_register_additional_filter_2.$$arity = 2); | |
self.default_options = $hash2(["nils", "class", "arrayize"], {"nils": false, "class": nil, "arrayize": false}); | |
Opal.def(self, '$initialize', TMP_ArrayFilter_initialize_3 = function $$initialize(name, opts) { | |
var $a, self = this, $iter = TMP_ArrayFilter_initialize_3.$$p, block = $iter || nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
if ($iter) TMP_ArrayFilter_initialize_3.$$p = null; | |
$send(self, Opal.find_super_dispatcher(self, 'initialize', TMP_ArrayFilter_initialize_3, false), [opts], null); | |
self.name = name; | |
self.element_filter = nil; | |
if ((block !== nil)) { | |
$send(self, 'instance_eval', [], block.$to_proc())}; | |
if ($truthy(($truthy($a = self.element_filter) ? self.$options()['$[]']("class") : $a))) { | |
return self.$raise($$($nesting, 'ArgumentError').$new("Can't supply both a class and a filter")) | |
} else { | |
return nil | |
}; | |
}, TMP_ArrayFilter_initialize_3.$$arity = -2); | |
Opal.def(self, '$hash', TMP_ArrayFilter_hash_4 = function $$hash(options) { | |
var self = this, $iter = TMP_ArrayFilter_hash_4.$$p, block = $iter || nil; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($iter) TMP_ArrayFilter_hash_4.$$p = null; | |
return (self.element_filter = $send($$($nesting, 'HashFilter'), 'new', [options], block.$to_proc())) | |
}, TMP_ArrayFilter_hash_4.$$arity = -1); | |
Opal.def(self, '$model', TMP_ArrayFilter_model_5 = function $$model(name, options) { | |
var self = this; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
return (self.element_filter = $$($nesting, 'ModelFilter').$new(name.$to_sym(), options)) | |
}, TMP_ArrayFilter_model_5.$$arity = -2); | |
Opal.def(self, '$array', TMP_ArrayFilter_array_6 = function $$array(options) { | |
var self = this, $iter = TMP_ArrayFilter_array_6.$$p, block = $iter || nil; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($iter) TMP_ArrayFilter_array_6.$$p = null; | |
return (self.element_filter = $send($$($nesting, 'ArrayFilter'), 'new', [nil, options], block.$to_proc())) | |
}, TMP_ArrayFilter_array_6.$$arity = -1); | |
Opal.def(self, '$filter', TMP_ArrayFilter_filter_8 = function $$filter(data) { | |
var $a, TMP_7, $b, self = this, errors = nil, filtered_data = nil, found_error = nil; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if ($truthy(($truthy($a = data['$is_a?']($$($nesting, 'Array'))['$!']()) ? self.$options()['$[]']("arrayize") : $a))) { | |
if (data['$==']("")) { | |
return [[], nil]}; | |
data = self.$Array(data);}; | |
if ($truthy(data['$is_a?']($$($nesting, 'Array')))) { | |
errors = $$($nesting, 'ErrorArray').$new(); | |
filtered_data = []; | |
found_error = false; | |
$send(data, 'each_with_index', [], (TMP_7 = function(el, i){var self = TMP_7.$$s || this, $b, $c, el_filtered = nil, el_error = nil; | |
if (self.name == null) self.name = nil; | |
if (el == null) el = nil;if (i == null) i = nil; | |
$c = self.$filter_element(el), $b = Opal.to_ary($c), (el_filtered = ($b[0] == null ? nil : $b[0])), (el_error = ($b[1] == null ? nil : $b[1])), $c; | |
if ($truthy(el_error['$is_a?']($$($nesting, 'Symbol')))) { | |
el_error = $$($nesting, 'ErrorAtom').$new(self.name, el_error, $hash2(["index"], {"index": i}))}; | |
errors['$<<'](el_error); | |
if ($truthy(el_error)) { | |
return (found_error = true) | |
} else { | |
return filtered_data['$<<'](el_filtered) | |
};}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7)); | |
if ($truthy(($truthy($a = found_error) ? ($truthy($b = self.element_filter) ? self.element_filter['$discard_invalid?']() : $b)['$!']() : $a))) { | |
return [data, errors] | |
} else { | |
return [filtered_data, nil] | |
}; | |
} else { | |
return [data, "array"] | |
}; | |
}, TMP_ArrayFilter_filter_8.$$arity = 1); | |
return (Opal.def(self, '$filter_element', TMP_ArrayFilter_filter_element_9 = function $$filter_element(data) { | |
var $a, $b, self = this, el_errors = nil, class_const = nil; | |
if ($truthy(self.element_filter)) { | |
$b = self.element_filter.$filter(data), $a = Opal.to_ary($b), (data = ($a[0] == null ? nil : $a[0])), (el_errors = ($a[1] == null ? nil : $a[1])), $b; | |
if ($truthy(el_errors)) { | |
return [data, el_errors]}; | |
} else if ($truthy(self.$options()['$[]']("class"))) { | |
class_const = self.$options()['$[]']("class"); | |
if ($truthy(class_const['$is_a?']($$($nesting, 'String')))) { | |
class_const = class_const.$constantize()}; | |
if ($truthy(data['$is_a?'](class_const)['$!']())) { | |
return [data, "class"]};}; | |
return [data, nil]; | |
}, TMP_ArrayFilter_filter_element_9.$$arity = 1), nil) && 'filter_element'; | |
})($nesting[0], $$($nesting, 'InputFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/boolean_filter.rb": | |
/*!************************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/boolean_filter.rb ***! | |
\************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/boolean_filter"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$is_a?', '$to_s', '$downcase']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $BooleanFilter(){}; | |
var self = $BooleanFilter = $klass($base, $super, 'BooleanFilter', $BooleanFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_BooleanFilter_filter_1; | |
self.default_options = $hash2(["nils"], {"nils": false}); | |
Opal.const_set($nesting[0], 'BOOL_MAP', $hash2(["true", "1", "false", "0"], {"true": true, "1": true, "false": false, "0": false})); | |
return (Opal.def(self, '$filter', TMP_BooleanFilter_filter_1 = function $$filter(data) { | |
var $a, self = this, res = nil; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if (data['$==']("")) { | |
return [data, "empty"]}; | |
if ($truthy(($truthy($a = data['$=='](true)) ? $a : data['$=='](false)))) { | |
return [data, nil]}; | |
if ($truthy(data['$is_a?']($$($nesting, 'Integer')))) { | |
data = data.$to_s()}; | |
if ($truthy(data['$is_a?']($$($nesting, 'String')))) { | |
res = $$($nesting, 'BOOL_MAP')['$[]'](data.$downcase()); | |
if ($truthy(res['$nil?']())) { | |
} else { | |
return [res, nil] | |
}; | |
return [data, "boolean"]; | |
} else { | |
return [data, "boolean"] | |
}; | |
}, TMP_BooleanFilter_filter_1.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/command.rb": | |
/*!*****************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/command.rb ***! | |
\*****************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/command"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$send', '$input_filters', '$to_proc', '$each', '$define_method', '$[]', '$has_key?', '$[]=', '$-', '$private', '$create_attr_methods', '$run', '$new', '$run!', '$validation_outcome', '$==', '$superclass', '$dup', '$inject', '$with_indifferent_access', '$respond_to?', '$raise', '$merge!', '$filter', '$has_errors?', '$validate', '$class', '$!', '$nil?', '$execute', '$success?', '$result', '$errors', '$protected', '$attr_reader', '$is_a?', '$tap', '$split', '$to_s', '$pop', '$to_sym', '$any?']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Command(){}; | |
var self = $Command = $klass($base, $super, 'Command', $Command); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Command_initialize_13, TMP_Command_input_filters_14, TMP_Command_has_errors$q_15, TMP_Command_run_16, TMP_Command_run$B_17, TMP_Command_validation_outcome_18, TMP_Command_validate_19, TMP_Command_execute_20, TMP_Command_add_error_23, TMP_Command_merge_errors_24; | |
def.raw_inputs = def.errors = def.inputs = nil; | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_create_attr_methods_1, TMP_required_6, TMP_optional_7, TMP_run_8, TMP_run$B_9, TMP_validate_10, TMP_input_filters_11; | |
Opal.def(self, '$create_attr_methods', TMP_create_attr_methods_1 = function $$create_attr_methods(meth) { | |
var TMP_2, self = this, $iter = TMP_create_attr_methods_1.$$p, block = $iter || nil, keys = nil; | |
if ($iter) TMP_create_attr_methods_1.$$p = null; | |
$send(self.$input_filters(), 'send', [meth], block.$to_proc()); | |
keys = self.$input_filters().$send("" + (meth) + "_keys"); | |
return $send(keys, 'each', [], (TMP_2 = function(key){var self = TMP_2.$$s || this, TMP_3, TMP_4, TMP_5; | |
if (key == null) key = nil; | |
$send(self, 'define_method', [key], (TMP_3 = function(){var self = TMP_3.$$s || this; | |
if (self.inputs == null) self.inputs = nil; | |
return self.inputs['$[]'](key)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3)); | |
$send(self, 'define_method', ["" + (key) + "_present?"], (TMP_4 = function(){var self = TMP_4.$$s || this; | |
if (self.inputs == null) self.inputs = nil; | |
return self.inputs['$has_key?'](key)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4)); | |
return $send(self, 'define_method', ["" + (key) + "="], (TMP_5 = function(v){var self = TMP_5.$$s || this, $writer = nil; | |
if (self.inputs == null) self.inputs = nil; | |
if (v == null) v = nil; | |
$writer = [key, v]; | |
$send(self.inputs, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5));}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2)); | |
}, TMP_create_attr_methods_1.$$arity = 1); | |
self.$private("create_attr_methods"); | |
Opal.def(self, '$required', TMP_required_6 = function $$required() { | |
var self = this, $iter = TMP_required_6.$$p, block = $iter || nil; | |
if ($iter) TMP_required_6.$$p = null; | |
return $send(self, 'create_attr_methods', ["required"], block.$to_proc()) | |
}, TMP_required_6.$$arity = 0); | |
Opal.def(self, '$optional', TMP_optional_7 = function $$optional() { | |
var self = this, $iter = TMP_optional_7.$$p, block = $iter || nil; | |
if ($iter) TMP_optional_7.$$p = null; | |
return $send(self, 'create_attr_methods', ["optional"], block.$to_proc()) | |
}, TMP_optional_7.$$arity = 0); | |
Opal.def(self, '$run', TMP_run_8 = function $$run($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self, 'new', Opal.to_a(args)).$run() | |
}, TMP_run_8.$$arity = -1); | |
Opal.def(self, '$run!', TMP_run$B_9 = function($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self, 'new', Opal.to_a(args))['$run!']() | |
}, TMP_run$B_9.$$arity = -1); | |
Opal.def(self, '$validate', TMP_validate_10 = function $$validate($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self, 'new', Opal.to_a(args)).$validation_outcome() | |
}, TMP_validate_10.$$arity = -1); | |
return (Opal.def(self, '$input_filters', TMP_input_filters_11 = function $$input_filters() { | |
var $a, self = this; | |
if (self.input_filters == null) self.input_filters = nil; | |
return (self.input_filters = ($truthy($a = self.input_filters) ? $a : (function() {if ($$($nesting, 'Command')['$=='](self.$superclass())) { | |
return $$($nesting, 'HashFilter').$new() | |
} else { | |
return self.$superclass().$input_filters().$dup() | |
}; return nil; })())) | |
}, TMP_input_filters_11.$$arity = 0), nil) && 'input_filters'; | |
})(Opal.get_singleton_class(self), $nesting); | |
Opal.def(self, '$initialize', TMP_Command_initialize_13 = function $$initialize($a_rest) { | |
var TMP_12, $b, $c, self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
self.raw_inputs = $send(args, 'inject', [$hash2([], {}).$with_indifferent_access()], (TMP_12 = function(h, arg){var self = TMP_12.$$s || this; | |
if (h == null) h = nil;if (arg == null) arg = nil; | |
if ($truthy(arg['$respond_to?']("to_hash"))) { | |
} else { | |
self.$raise($$($nesting, 'ArgumentError').$new("All arguments must be hashes")) | |
}; | |
return h['$merge!'](arg);}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12)); | |
$c = self.$input_filters().$filter(self.raw_inputs), $b = Opal.to_ary($c), (self.inputs = ($b[0] == null ? nil : $b[0])), (self.errors = ($b[1] == null ? nil : $b[1])), $c; | |
if ($truthy(self['$has_errors?']())) { | |
return nil | |
} else { | |
return self.$validate() | |
}; | |
}, TMP_Command_initialize_13.$$arity = -1); | |
Opal.def(self, '$input_filters', TMP_Command_input_filters_14 = function $$input_filters() { | |
var self = this; | |
return self.$class().$input_filters() | |
}, TMP_Command_input_filters_14.$$arity = 0); | |
Opal.def(self, '$has_errors?', TMP_Command_has_errors$q_15 = function() { | |
var self = this; | |
return self.errors['$nil?']()['$!']() | |
}, TMP_Command_has_errors$q_15.$$arity = 0); | |
Opal.def(self, '$run', TMP_Command_run_16 = function $$run() { | |
var self = this; | |
if ($truthy(self['$has_errors?']())) { | |
return self.$validation_outcome()}; | |
return self.$validation_outcome(self.$execute()); | |
}, TMP_Command_run_16.$$arity = 0); | |
Opal.def(self, '$run!', TMP_Command_run$B_17 = function() { | |
var self = this, outcome = nil; | |
outcome = self.$run(); | |
if ($truthy(outcome['$success?']())) { | |
return outcome.$result() | |
} else { | |
return self.$raise($$($nesting, 'ValidationException').$new(outcome.$errors())) | |
}; | |
}, TMP_Command_run$B_17.$$arity = 0); | |
Opal.def(self, '$validation_outcome', TMP_Command_validation_outcome_18 = function $$validation_outcome(result) { | |
var self = this; | |
if (result == null) { | |
result = nil; | |
} | |
return $$($nesting, 'Outcome').$new(self['$has_errors?']()['$!'](), (function() {if ($truthy(self['$has_errors?']())) { | |
return nil | |
} else { | |
return result | |
}; return nil; })(), self.errors, self.inputs) | |
}, TMP_Command_validation_outcome_18.$$arity = -1); | |
self.$protected(); | |
self.$attr_reader("inputs", "raw_inputs"); | |
Opal.def(self, '$validate', TMP_Command_validate_19 = function $$validate() { | |
var self = this; | |
return nil | |
}, TMP_Command_validate_19.$$arity = 0); | |
Opal.def(self, '$execute', TMP_Command_execute_20 = function $$execute() { | |
var self = this; | |
return nil | |
}, TMP_Command_execute_20.$$arity = 0); | |
Opal.def(self, '$add_error', TMP_Command_add_error_23 = function $$add_error(key, kind, message) { | |
var $a, TMP_21, self = this; | |
if (message == null) { | |
message = nil; | |
} | |
if ($truthy(kind['$is_a?']($$($nesting, 'Symbol')))) { | |
} else { | |
self.$raise($$($nesting, 'ArgumentError').$new("Invalid kind")) | |
}; | |
self.errors = ($truthy($a = self.errors) ? $a : $$($nesting, 'ErrorHash').$new()); | |
return $send(self.errors, 'tap', [], (TMP_21 = function(errs){var self = TMP_21.$$s || this, TMP_22, path = nil, last = nil, inner = nil, $writer = nil; | |
if (errs == null) errs = nil; | |
path = key.$to_s().$split("."); | |
last = path.$pop(); | |
inner = $send(path, 'inject', [errs], (TMP_22 = function(cur_errors, part){var self = TMP_22.$$s || this, $b, $writer = nil; | |
if (cur_errors == null) cur_errors = nil;if (part == null) part = nil; | |
return ($truthy($b = cur_errors['$[]'](part.$to_sym())) ? $b : (($writer = [part.$to_sym(), $$($nesting, 'ErrorHash').$new()]), $send(cur_errors, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))}, TMP_22.$$s = self, TMP_22.$$arity = 2, TMP_22)); | |
$writer = [last, $$($nesting, 'ErrorAtom').$new(key, kind, $hash2(["message"], {"message": message}))]; | |
$send(inner, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21)); | |
}, TMP_Command_add_error_23.$$arity = -3); | |
return (Opal.def(self, '$merge_errors', TMP_Command_merge_errors_24 = function $$merge_errors(hash) { | |
var $a, self = this; | |
if ($truthy(hash['$any?']())) { | |
self.errors = ($truthy($a = self.errors) ? $a : $$($nesting, 'ErrorHash').$new()); | |
return self.errors['$merge!'](hash); | |
} else { | |
return nil | |
} | |
}, TMP_Command_merge_errors_24.$$arity = 1), nil) && 'merge_errors'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/date_filter.rb": | |
/*!*********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/date_filter.rb ***! | |
\*********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/date_filter"] = function(Opal) { | |
function $rb_le(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); | |
} | |
function $rb_ge(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$is_a?', '$strptime', '$parse', '$respond_to?', '$to_date', '$<=', '$>=']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $DateFilter(){}; | |
var self = $DateFilter = $klass($base, $super, 'DateFilter', $DateFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_DateFilter_filter_1; | |
self.default_options = $hash2(["nils", "format", "after", "before"], {"nils": false, "format": nil, "after": nil, "before": nil}); | |
return (Opal.def(self, '$filter', TMP_DateFilter_filter_1 = function $$filter(data) { | |
var self = this, actual_date = nil; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if (""['$=='](data)) { | |
return [data, "empty"]}; | |
if ($truthy(data['$is_a?']($$($nesting, 'Date')))) { | |
actual_date = data | |
} else if ($truthy(data['$is_a?']($$($nesting, 'String')))) { | |
try { | |
actual_date = (function() {if ($truthy(self.$options()['$[]']("format"))) { | |
return $$($nesting, 'Date').$strptime(data, self.$options()['$[]']("format")) | |
} else { | |
return $$($nesting, 'Date').$parse(data) | |
}; return nil; })() | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'ArgumentError')])) { | |
try { | |
return [nil, "date"] | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}; | |
} else if ($truthy(data['$respond_to?']("to_date"))) { | |
actual_date = data.$to_date() | |
} else { | |
return [nil, "date"] | |
}; | |
if ($truthy(self.$options()['$[]']("after"))) { | |
if ($truthy($rb_le(actual_date, self.$options()['$[]']("after")))) { | |
return [nil, "after"]}}; | |
if ($truthy(self.$options()['$[]']("before"))) { | |
if ($truthy($rb_ge(actual_date, self.$options()['$[]']("before")))) { | |
return [nil, "before"]}}; | |
return [actual_date, nil]; | |
}, TMP_DateFilter_filter_1.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/duck_filter.rb": | |
/*!*********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/duck_filter.rb ***! | |
\*********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/duck_filter"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$nil?', '$[]', '$options', '$each', '$Array', '$respond_to?']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $DuckFilter(){}; | |
var self = $DuckFilter = $klass($base, $super, 'DuckFilter', $DuckFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_DuckFilter_filter_2; | |
self.default_options = $hash2(["nils", "methods"], {"nils": false, "methods": nil}); | |
return (Opal.def(self, '$filter', TMP_DuckFilter_filter_2 = function $$filter(data) {try { | |
var TMP_1, self = this; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
$send(self.$Array(self.$options()['$[]']("methods")), 'each', [], (TMP_1 = function(method){var self = TMP_1.$$s || this; | |
if (method == null) method = nil; | |
if ($truthy(data['$respond_to?'](method))) { | |
return nil | |
} else { | |
Opal.ret([data, "duck"]) | |
}}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)); | |
return [data, nil]; | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_DuckFilter_filter_2.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/errors.rb": | |
/*!****************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/errors.rb ***! | |
\****************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/errors"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$tap', '$new', '$merge!', '$[]', '$titleize', '$to_s', '$message', '$error_message_creator', '$Array', '$each', '$symbolic', '$[]=', '$-', '$concat', '$message_list', '$map', '$flatten', '$compact']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $DefaultErrorMessageCreator(){}; | |
var self = $DefaultErrorMessageCreator = $klass($base, $super, 'DefaultErrorMessageCreator', $DefaultErrorMessageCreator); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_DefaultErrorMessageCreator_1, TMP_DefaultErrorMessageCreator_message_2; | |
Opal.const_set($nesting[0], 'MESSAGES', $send($$($nesting, 'Hash').$new("is invalid"), 'tap', [], (TMP_DefaultErrorMessageCreator_1 = function(h){var self = TMP_DefaultErrorMessageCreator_1.$$s || this; | |
if (h == null) h = nil; | |
return h['$merge!']($hash2(["nils", "required", "string", "integer", "boolean", "hash", "array", "model", "date", "before", "after", "empty", "max_length", "min_length", "matches", "in", "class", "min", "max", "new_records"], {"nils": "can't be nil", "required": "is required", "string": "isn't a string", "integer": "isn't an integer", "boolean": "isn't a boolean", "hash": "isn't a hash", "array": "isn't an array", "model": "isn't the right class", "date": "date doesn't exist", "before": "isn't before given date", "after": "isn't after given date", "empty": "can't be blank", "max_length": "is too long", "min_length": "is too short", "matches": "isn't in the right format", "in": "isn't an option", "class": "isn't the right class", "min": "is too small", "max": "is too big", "new_records": "isn't a saved model"}))}, TMP_DefaultErrorMessageCreator_1.$$s = self, TMP_DefaultErrorMessageCreator_1.$$arity = 1, TMP_DefaultErrorMessageCreator_1))); | |
return (Opal.def(self, '$message', TMP_DefaultErrorMessageCreator_message_2 = function $$message(key, error_symbol, options) { | |
var $a, self = this; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($truthy(options['$[]']("index"))) { | |
return "" + (($truthy($a = key) ? $a : "array").$to_s().$titleize()) + "[" + (options['$[]']("index")) + "] " + ($$($nesting, 'MESSAGES')['$[]'](error_symbol)) | |
} else { | |
return "" + (key.$to_s().$titleize()) + " " + ($$($nesting, 'MESSAGES')['$[]'](error_symbol)) | |
} | |
}, TMP_DefaultErrorMessageCreator_message_2.$$arity = -3), nil) && 'message'; | |
})($nesting[0], null, $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ErrorAtom(){}; | |
var self = $ErrorAtom = $klass($base, $super, 'ErrorAtom', $ErrorAtom); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ErrorAtom_initialize_3, TMP_ErrorAtom_symbolic_4, TMP_ErrorAtom_message_5, TMP_ErrorAtom_message_list_6; | |
def.symbol = def.message = def.key = def.index = nil; | |
Opal.def(self, '$initialize', TMP_ErrorAtom_initialize_3 = function $$initialize(key, error_symbol, options) { | |
var self = this; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
self.key = key; | |
self.symbol = error_symbol; | |
self.message = options['$[]']("message"); | |
return (self.index = options['$[]']("index")); | |
}, TMP_ErrorAtom_initialize_3.$$arity = -3); | |
Opal.def(self, '$symbolic', TMP_ErrorAtom_symbolic_4 = function $$symbolic() { | |
var self = this; | |
return self.symbol | |
}, TMP_ErrorAtom_symbolic_4.$$arity = 0); | |
Opal.def(self, '$message', TMP_ErrorAtom_message_5 = function $$message() { | |
var $a, self = this; | |
return (self.message = ($truthy($a = self.message) ? $a : $$($nesting, 'Mutations').$error_message_creator().$message(self.key, self.symbol, $hash2(["index"], {"index": self.index})))) | |
}, TMP_ErrorAtom_message_5.$$arity = 0); | |
return (Opal.def(self, '$message_list', TMP_ErrorAtom_message_list_6 = function $$message_list() { | |
var self = this; | |
return self.$Array(self.$message()) | |
}, TMP_ErrorAtom_message_list_6.$$arity = 0), nil) && 'message_list'; | |
})($nesting[0], null, $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ErrorHash(){}; | |
var self = $ErrorHash = $klass($base, $super, 'ErrorHash', $ErrorHash); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ErrorHash_symbolic_9, TMP_ErrorHash_message_12, TMP_ErrorHash_message_list_14; | |
Opal.def(self, '$symbolic', TMP_ErrorHash_symbolic_9 = function $$symbolic() { | |
var TMP_7, self = this; | |
return $send($$($nesting, 'HashWithIndifferentAccess').$new(), 'tap', [], (TMP_7 = function(hash){var self = TMP_7.$$s || this, TMP_8; | |
if (hash == null) hash = nil; | |
return $send(self, 'each', [], (TMP_8 = function(k, v){var self = TMP_8.$$s || this, $writer = nil; | |
if (k == null) k = nil;if (v == null) v = nil; | |
$writer = [k, v.$symbolic()]; | |
$send(hash, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8))}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7)) | |
}, TMP_ErrorHash_symbolic_9.$$arity = 0); | |
Opal.def(self, '$message', TMP_ErrorHash_message_12 = function $$message() { | |
var TMP_10, self = this; | |
return $send($$($nesting, 'HashWithIndifferentAccess').$new(), 'tap', [], (TMP_10 = function(hash){var self = TMP_10.$$s || this, TMP_11; | |
if (hash == null) hash = nil; | |
return $send(self, 'each', [], (TMP_11 = function(k, v){var self = TMP_11.$$s || this, $writer = nil; | |
if (k == null) k = nil;if (v == null) v = nil; | |
$writer = [k, v.$message()]; | |
$send(hash, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11))}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10)) | |
}, TMP_ErrorHash_message_12.$$arity = 0); | |
return (Opal.def(self, '$message_list', TMP_ErrorHash_message_list_14 = function $$message_list() { | |
var TMP_13, self = this, list = nil; | |
list = []; | |
$send(self, 'each', [], (TMP_13 = function(k, v){var self = TMP_13.$$s || this; | |
if (k == null) k = nil;if (v == null) v = nil; | |
return list.$concat(v.$message_list())}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13)); | |
return list; | |
}, TMP_ErrorHash_message_list_14.$$arity = 0), nil) && 'message_list'; | |
})($nesting[0], $$($nesting, 'Hash'), $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ErrorArray(){}; | |
var self = $ErrorArray = $klass($base, $super, 'ErrorArray', $ErrorArray); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ErrorArray_symbolic_16, TMP_ErrorArray_message_18, TMP_ErrorArray_message_list_20; | |
Opal.def(self, '$symbolic', TMP_ErrorArray_symbolic_16 = function $$symbolic() { | |
var TMP_15, self = this; | |
return $send(self, 'map', [], (TMP_15 = function(e){var self = TMP_15.$$s || this, $a; | |
if (e == null) e = nil; | |
return ($truthy($a = e) ? e.$symbolic() : $a)}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15)) | |
}, TMP_ErrorArray_symbolic_16.$$arity = 0); | |
Opal.def(self, '$message', TMP_ErrorArray_message_18 = function $$message() { | |
var TMP_17, self = this; | |
return $send(self, 'map', [], (TMP_17 = function(e){var self = TMP_17.$$s || this, $a; | |
if (e == null) e = nil; | |
return ($truthy($a = e) ? e.$message() : $a)}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17)) | |
}, TMP_ErrorArray_message_18.$$arity = 0); | |
return (Opal.def(self, '$message_list', TMP_ErrorArray_message_list_20 = function $$message_list() { | |
var TMP_19, self = this; | |
return $send(self.$compact(), 'map', [], (TMP_19 = function(e){var self = TMP_19.$$s || this; | |
if (e == null) e = nil; | |
return e.$message_list()}, TMP_19.$$s = self, TMP_19.$$arity = 1, TMP_19)).$flatten() | |
}, TMP_ErrorArray_message_list_20.$$arity = 0), nil) && 'message_list'; | |
})($nesting[0], $$($nesting, 'Array'), $nesting); | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/exception.rb": | |
/*!*******************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/exception.rb ***! | |
\*******************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/exception"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$attr_accessor', '$errors=', '$-', '$join', '$message_list', '$errors']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ValidationException(){}; | |
var self = $ValidationException = $klass($base, $super, 'ValidationException', $ValidationException); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ValidationException_initialize_1, TMP_ValidationException_to_s_2; | |
self.$attr_accessor("errors"); | |
Opal.def(self, '$initialize', TMP_ValidationException_initialize_1 = function $$initialize(errors) { | |
var self = this, $writer = nil; | |
$writer = [errors]; | |
$send(self, 'errors=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
}, TMP_ValidationException_initialize_1.$$arity = 1); | |
return (Opal.def(self, '$to_s', TMP_ValidationException_to_s_2 = function $$to_s() { | |
var self = this; | |
return "" + (self.$errors().$message_list().$join("; ")) | |
}, TMP_ValidationException_to_s_2.$$arity = 0), nil) && 'to_s'; | |
})($nesting[0], $$$('::', 'StandardError'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/file_filter.rb": | |
/*!*********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/file_filter.rb ***! | |
\*********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/file_filter"] = function(Opal) { | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$concat', '$each', '$respond_to?', '$is_a?', '$>', '$size']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $FileFilter(){}; | |
var self = $FileFilter = $klass($base, $super, 'FileFilter', $FileFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_FileFilter_filter_2; | |
self.default_options = $hash2(["nils", "upload", "size"], {"nils": false, "upload": false, "size": nil}); | |
return (Opal.def(self, '$filter', TMP_FileFilter_filter_2 = function $$filter(data) {try { | |
var TMP_1, self = this, methods = nil; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if (data['$==']("")) { | |
return [data, "empty"]}; | |
methods = ["read", "size"]; | |
if ($truthy(self.$options()['$[]']("upload"))) { | |
methods.$concat(["original_filename", "content_type"])}; | |
$send(methods, 'each', [], (TMP_1 = function(method){var self = TMP_1.$$s || this; | |
if (method == null) method = nil; | |
if ($truthy(data['$respond_to?'](method))) { | |
return nil | |
} else { | |
Opal.ret([data, "file"]) | |
}}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)); | |
if ($truthy(self.$options()['$[]']("size")['$is_a?']($$($nesting, 'Integer')))) { | |
if ($truthy($rb_gt(data.$size(), self.$options()['$[]']("size")))) { | |
return [data, "size"]}}; | |
return [data, nil]; | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_FileFilter_filter_2.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/float_filter.rb": | |
/*!**********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/float_filter.rb ***! | |
\**********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/float_filter"] = function(Opal) { | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$!', '$is_a?', '$=~', '$to_f', '$<', '$>']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $FloatFilter(){}; | |
var self = $FloatFilter = $klass($base, $super, 'FloatFilter', $FloatFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_FloatFilter_filter_1; | |
self.default_options = $hash2(["nils", "min", "max"], {"nils": false, "min": nil, "max": nil}); | |
return (Opal.def(self, '$filter', TMP_FloatFilter_filter_1 = function $$filter(data) { | |
var $a, self = this; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if (data['$==']("")) { | |
return [data, "empty"]}; | |
if ($truthy(data['$is_a?']($$($nesting, 'Float'))['$!']())) { | |
if ($truthy(($truthy($a = data['$is_a?']($$($nesting, 'String'))) ? data['$=~'](/^[-+]?\d*\.?\d+/) : $a))) { | |
data = data.$to_f() | |
} else if ($truthy(data['$is_a?']($$($nesting, 'Integer')))) { | |
data = data.$to_f() | |
} else { | |
return [data, "float"] | |
}}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("min")) ? $rb_lt(data, self.$options()['$[]']("min")) : $a))) { | |
return [data, "min"]}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("max")) ? $rb_gt(data, self.$options()['$[]']("max")) : $a))) { | |
return [data, "max"]}; | |
return [data, nil]; | |
}, TMP_FloatFilter_filter_1.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/hash_filter.rb": | |
/*!*********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/hash_filter.rb ***! | |
\*********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/hash_filter"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$define_method', '$[]', '$to_sym', '$new', '$to_proc', '$[]=', '$-', '$attr_accessor', '$instance_eval', '$each_pair', '$optional_inputs', '$required_inputs', '$keys', '$nil?', '$options', '$respond_to?', '$is_a?', '$with_indifferent_access', '$to_hash', '$each', '$==', '$has_key?', '$filter', '$!', '$discard_invalid?', '$delete', '$discard_empty?', '$discard_nils?', '$has_default?', '$default', '$any?']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $HashFilter(){}; | |
var self = $HashFilter = $klass($base, $super, 'HashFilter', $HashFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_HashFilter_register_additional_filter_2, TMP_HashFilter_initialize_3, TMP_HashFilter_dup_6, TMP_HashFilter_required_7, TMP_HashFilter_optional_8, TMP_HashFilter_required_keys_9, TMP_HashFilter_optional_keys_10, TMP_HashFilter_hash_11, TMP_HashFilter_model_12, TMP_HashFilter_array_13, TMP_HashFilter_filter_17; | |
def.required_inputs = def.optional_inputs = def.current_inputs = nil; | |
Opal.defs(self, '$register_additional_filter', TMP_HashFilter_register_additional_filter_2 = function $$register_additional_filter(type_class, type_name) { | |
var TMP_1, self = this; | |
return $send(self, 'define_method', [type_name], (TMP_1 = function($a_rest){var self = TMP_1.$$s || this, block, args, $b, name = nil, options = nil, $writer = nil; | |
if (self.current_inputs == null) self.current_inputs = nil; | |
block = TMP_1.$$p || nil; | |
if (block) TMP_1.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
name = args['$[]'](0); | |
options = ($truthy($b = args['$[]'](1)) ? $b : $hash2([], {})); | |
$writer = [name.$to_sym(), $send(type_class, 'new', [options], block.$to_proc())]; | |
$send(self.current_inputs, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;}, TMP_1.$$s = self, TMP_1.$$arity = -1, TMP_1)) | |
}, TMP_HashFilter_register_additional_filter_2.$$arity = 2); | |
self.default_options = $hash2(["nils"], {"nils": false}); | |
self.$attr_accessor("optional_inputs"); | |
self.$attr_accessor("required_inputs"); | |
Opal.def(self, '$initialize', TMP_HashFilter_initialize_3 = function $$initialize(opts) { | |
var self = this, $iter = TMP_HashFilter_initialize_3.$$p, block = $iter || nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
if ($iter) TMP_HashFilter_initialize_3.$$p = null; | |
$send(self, Opal.find_super_dispatcher(self, 'initialize', TMP_HashFilter_initialize_3, false), [opts], null); | |
self.optional_inputs = $hash2([], {}); | |
self.required_inputs = $hash2([], {}); | |
self.current_inputs = self.required_inputs; | |
if ((block !== nil)) { | |
return $send(self, 'instance_eval', [], block.$to_proc()) | |
} else { | |
return nil | |
}; | |
}, TMP_HashFilter_initialize_3.$$arity = -1); | |
Opal.def(self, '$dup', TMP_HashFilter_dup_6 = function $$dup() { | |
var TMP_4, TMP_5, self = this, dupped = nil; | |
dupped = $$($nesting, 'HashFilter').$new(); | |
$send(self.optional_inputs, 'each_pair', [], (TMP_4 = function(k, v){var self = TMP_4.$$s || this, $writer = nil; | |
if (k == null) k = nil;if (v == null) v = nil; | |
$writer = [k, v]; | |
$send(dupped.$optional_inputs(), '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_4.$$s = self, TMP_4.$$arity = 2, TMP_4)); | |
$send(self.required_inputs, 'each_pair', [], (TMP_5 = function(k, v){var self = TMP_5.$$s || this, $writer = nil; | |
if (k == null) k = nil;if (v == null) v = nil; | |
$writer = [k, v]; | |
$send(dupped.$required_inputs(), '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_5.$$s = self, TMP_5.$$arity = 2, TMP_5)); | |
return dupped; | |
}, TMP_HashFilter_dup_6.$$arity = 0); | |
Opal.def(self, '$required', TMP_HashFilter_required_7 = function $$required() { | |
var self = this, $iter = TMP_HashFilter_required_7.$$p, block = $iter || nil; | |
if ($iter) TMP_HashFilter_required_7.$$p = null; | |
self.current_inputs = self.required_inputs; | |
return $send(self, 'instance_eval', [], block.$to_proc()); | |
}, TMP_HashFilter_required_7.$$arity = 0); | |
Opal.def(self, '$optional', TMP_HashFilter_optional_8 = function $$optional() { | |
var self = this, $iter = TMP_HashFilter_optional_8.$$p, block = $iter || nil; | |
if ($iter) TMP_HashFilter_optional_8.$$p = null; | |
self.current_inputs = self.optional_inputs; | |
return $send(self, 'instance_eval', [], block.$to_proc()); | |
}, TMP_HashFilter_optional_8.$$arity = 0); | |
Opal.def(self, '$required_keys', TMP_HashFilter_required_keys_9 = function $$required_keys() { | |
var self = this; | |
return self.required_inputs.$keys() | |
}, TMP_HashFilter_required_keys_9.$$arity = 0); | |
Opal.def(self, '$optional_keys', TMP_HashFilter_optional_keys_10 = function $$optional_keys() { | |
var self = this; | |
return self.optional_inputs.$keys() | |
}, TMP_HashFilter_optional_keys_10.$$arity = 0); | |
Opal.def(self, '$hash', TMP_HashFilter_hash_11 = function $$hash(name, options) { | |
var self = this, $iter = TMP_HashFilter_hash_11.$$p, block = $iter || nil, $writer = nil; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($iter) TMP_HashFilter_hash_11.$$p = null; | |
$writer = [name.$to_sym(), $send($$($nesting, 'HashFilter'), 'new', [options], block.$to_proc())]; | |
$send(self.current_inputs, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
}, TMP_HashFilter_hash_11.$$arity = -2); | |
Opal.def(self, '$model', TMP_HashFilter_model_12 = function $$model(name, options) { | |
var self = this, $writer = nil; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
$writer = [name.$to_sym(), $$($nesting, 'ModelFilter').$new(name.$to_sym(), options)]; | |
$send(self.current_inputs, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
}, TMP_HashFilter_model_12.$$arity = -2); | |
Opal.def(self, '$array', TMP_HashFilter_array_13 = function $$array(name, options) { | |
var self = this, $iter = TMP_HashFilter_array_13.$$p, block = $iter || nil, name_sym = nil, $writer = nil; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($iter) TMP_HashFilter_array_13.$$p = null; | |
name_sym = name.$to_sym(); | |
$writer = [name.$to_sym(), $send($$($nesting, 'ArrayFilter'), 'new', [name_sym, options], block.$to_proc())]; | |
$send(self.current_inputs, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];; | |
}, TMP_HashFilter_array_13.$$arity = -2); | |
return (Opal.def(self, '$filter', TMP_HashFilter_filter_17 = function $$filter(data) { | |
var TMP_14, TMP_16, self = this, errors = nil, filtered_data = nil, wildcard_filterer = nil, filtered_keys = nil; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if ($truthy(data['$respond_to?']("to_hash"))) { | |
} else { | |
return [data, "hash"] | |
}; | |
if ($truthy(data['$is_a?']($$($nesting, 'HashWithIndifferentAccess')))) { | |
} else { | |
data = data.$to_hash().$with_indifferent_access() | |
}; | |
errors = $$($nesting, 'ErrorHash').$new(); | |
filtered_data = $$($nesting, 'HashWithIndifferentAccess').$new(); | |
wildcard_filterer = nil; | |
$send([[self.required_inputs, true], [self.optional_inputs, false]], 'each', [], (TMP_14 = function($a){var self = TMP_14.$$s || this, $a_args, inputs, is_required, TMP_15; | |
if ($a == null) { | |
$a = nil; | |
} | |
$a = Opal.to_ary($a); | |
$a_args = Opal.slice.call($a, 0, $a.length); | |
inputs = $a_args.splice(0,1)[0]; | |
if (inputs == null) { | |
inputs = nil; | |
} | |
is_required = $a_args.splice(0,1)[0]; | |
if (is_required == null) { | |
is_required = nil; | |
} | |
return $send(inputs, 'each_pair', [], (TMP_15 = function(key, filterer){var self = TMP_15.$$s || this, $a, $b, data_element = nil, sub_data = nil, sub_error = nil, $writer = nil, error_key = nil; | |
if (key == null) key = nil;if (filterer == null) filterer = nil; | |
if (key['$==']("*")) { | |
wildcard_filterer = filterer; | |
return nil;;}; | |
data_element = data['$[]'](key); | |
if ($truthy(data['$has_key?'](key))) { | |
$b = filterer.$filter(data_element), $a = Opal.to_ary($b), (sub_data = ($a[0] == null ? nil : $a[0])), (sub_error = ($a[1] == null ? nil : $a[1])), $b; | |
if ($truthy(sub_error['$nil?']())) { | |
$writer = [key, sub_data]; | |
$send(filtered_data, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
} else if ($truthy(($truthy($a = is_required['$!']()) ? filterer['$discard_invalid?']() : $a))) { | |
data.$delete(key) | |
} else if ($truthy(($truthy($a = ($truthy($b = is_required['$!']()) ? sub_error['$==']("empty") : $b)) ? filterer['$discard_empty?']() : $a))) { | |
data.$delete(key) | |
} else if ($truthy(($truthy($a = ($truthy($b = is_required['$!']()) ? sub_error['$==']("nils") : $b)) ? filterer['$discard_nils?']() : $a))) { | |
data.$delete(key) | |
} else { | |
error_key = ($truthy($a = filterer.$options()['$[]']("error_key")) ? $a : key); | |
if ($truthy(sub_error['$is_a?']($$($nesting, 'Symbol')))) { | |
sub_error = $$($nesting, 'ErrorAtom').$new(error_key, sub_error)}; | |
$writer = [key, sub_error]; | |
$send(errors, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
};}; | |
if ($truthy(data['$has_key?'](key)['$!']())) { | |
if ($truthy(filterer['$has_default?']())) { | |
$writer = [key, filterer.$default()]; | |
$send(filtered_data, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else if ($truthy(is_required)) { | |
error_key = ($truthy($a = filterer.$options()['$[]']("error_key")) ? $a : key); | |
$writer = [key, $$($nesting, 'ErrorAtom').$new(error_key, "required")]; | |
$send(errors, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];; | |
} else { | |
return nil | |
} | |
} else { | |
return nil | |
};}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15))}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14.$$has_top_level_mlhs_arg = true, TMP_14)); | |
if ($truthy(wildcard_filterer)) { | |
filtered_keys = $rb_minus(data.$keys(), filtered_data.$keys()); | |
$send(filtered_keys, 'each', [], (TMP_16 = function(key){var self = TMP_16.$$s || this, $a, $b, data_element = nil, sub_data = nil, sub_error = nil, $writer = nil; | |
if (key == null) key = nil; | |
data_element = data['$[]'](key); | |
$b = wildcard_filterer.$filter(data_element), $a = Opal.to_ary($b), (sub_data = ($a[0] == null ? nil : $a[0])), (sub_error = ($a[1] == null ? nil : $a[1])), $b; | |
if ($truthy(sub_error['$nil?']())) { | |
$writer = [key, sub_data]; | |
$send(filtered_data, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else if ($truthy(wildcard_filterer['$discard_invalid?']())) { | |
return data.$delete(key) | |
} else if ($truthy((($a = sub_error['$==']("empty")) ? wildcard_filterer['$discard_empty?']() : sub_error['$==']("empty")))) { | |
return data.$delete(key) | |
} else if ($truthy((($a = sub_error['$==']("nils")) ? wildcard_filterer['$discard_nils?']() : sub_error['$==']("nils")))) { | |
return data.$delete(key) | |
} else { | |
if ($truthy(sub_error['$is_a?']($$($nesting, 'Symbol')))) { | |
sub_error = $$($nesting, 'ErrorAtom').$new(key, sub_error)}; | |
$writer = [key, sub_error]; | |
$send(errors, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];; | |
};}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16));}; | |
if ($truthy(errors['$any?']())) { | |
return [data, errors] | |
} else { | |
return [filtered_data, nil] | |
}; | |
}, TMP_HashFilter_filter_17.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'InputFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/input_filter.rb": | |
/*!**********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/input_filter.rb ***! | |
\**********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/input_filter"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $hash2 = Opal.hash2, $send = Opal.send; | |
Opal.add_stubs(['$attr_accessor', '$merge', '$default_options', '$class', '$options=', '$-', '$has_key?', '$options', '$[]', '$!']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $InputFilter(){}; | |
var self = $InputFilter = $klass($base, $super, 'InputFilter', $InputFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_InputFilter_default_options_1, TMP_InputFilter_initialize_2, TMP_InputFilter_filter_3, TMP_InputFilter_has_default$q_4, TMP_InputFilter_default_5, TMP_InputFilter_discard_nils$q_6, TMP_InputFilter_discard_empty$q_7, TMP_InputFilter_discard_invalid$q_8; | |
Opal.defs(self, '$default_options', TMP_InputFilter_default_options_1 = function $$default_options() { | |
var $a, self = this; | |
if (self.default_options == null) self.default_options = nil; | |
return (self.default_options = ($truthy($a = self.default_options) ? $a : $hash2([], {}))) | |
}, TMP_InputFilter_default_options_1.$$arity = 0); | |
self.$attr_accessor("options"); | |
Opal.def(self, '$initialize', TMP_InputFilter_initialize_2 = function $$initialize(opts) { | |
var $a, self = this, $writer = nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
$writer = [($truthy($a = self.$class().$default_options()) ? $a : $hash2([], {})).$merge(opts)]; | |
$send(self, 'options=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
}, TMP_InputFilter_initialize_2.$$arity = -1); | |
Opal.def(self, '$filter', TMP_InputFilter_filter_3 = function $$filter(data) { | |
var self = this; | |
return [data, nil] | |
}, TMP_InputFilter_filter_3.$$arity = 1); | |
Opal.def(self, '$has_default?', TMP_InputFilter_has_default$q_4 = function() { | |
var self = this; | |
return self.$options()['$has_key?']("default") | |
}, TMP_InputFilter_has_default$q_4.$$arity = 0); | |
Opal.def(self, '$default', TMP_InputFilter_default_5 = function() { | |
var self = this; | |
return self.$options()['$[]']("default") | |
}, TMP_InputFilter_default_5.$$arity = 0); | |
Opal.def(self, '$discard_nils?', TMP_InputFilter_discard_nils$q_6 = function() { | |
var self = this; | |
return self.$options()['$[]']("nils")['$!']() | |
}, TMP_InputFilter_discard_nils$q_6.$$arity = 0); | |
Opal.def(self, '$discard_empty?', TMP_InputFilter_discard_empty$q_7 = function() { | |
var self = this; | |
return self.$options()['$[]']("discard_empty") | |
}, TMP_InputFilter_discard_empty$q_7.$$arity = 0); | |
return (Opal.def(self, '$discard_invalid?', TMP_InputFilter_discard_invalid$q_8 = function() { | |
var self = this; | |
return self.$options()['$[]']("discard_invalid") | |
}, TMP_InputFilter_discard_invalid$q_8.$$arity = 0), nil) && 'discard_invalid?'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/integer_filter.rb": | |
/*!************************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/integer_filter.rb ***! | |
\************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/integer_filter"] = function(Opal) { | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$[]', '$options', '$==', '$nil?', '$!', '$is_a?', '$=~', '$to_i', '$<', '$>', '$include?']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $IntegerFilter(){}; | |
var self = $IntegerFilter = $klass($base, $super, 'IntegerFilter', $IntegerFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_IntegerFilter_filter_1; | |
self.default_options = $hash2(["nils", "empty_is_nil", "min", "max", "in"], {"nils": false, "empty_is_nil": false, "min": nil, "max": nil, "in": nil}); | |
return (Opal.def(self, '$filter', TMP_IntegerFilter_filter_1 = function $$filter(data) { | |
var $a, self = this; | |
if ($truthy(($truthy($a = self.$options()['$[]']("empty_is_nil")) ? data['$==']("") : $a))) { | |
data = nil}; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if (data['$==']("")) { | |
return [data, "empty"]}; | |
if ($truthy(data['$is_a?']($$($nesting, 'Integer'))['$!']())) { | |
if ($truthy(($truthy($a = data['$is_a?']($$($nesting, 'String'))) ? data['$=~'](/^-?\d/) : $a))) { | |
data = data.$to_i() | |
} else { | |
return [data, "integer"] | |
}}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("min")) ? $rb_lt(data, self.$options()['$[]']("min")) : $a))) { | |
return [data, "min"]}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("max")) ? $rb_gt(data, self.$options()['$[]']("max")) : $a))) { | |
return [data, "max"]}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("in")) ? self.$options()['$[]']("in")['$include?'](data)['$!']() : $a))) { | |
return [data, "in"]}; | |
return [data, nil]; | |
}, TMP_IntegerFilter_filter_1.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/model_filter.rb": | |
/*!**********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/model_filter.rb ***! | |
\**********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/model_filter"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$[]', '$options', '$camelize', '$to_s', '$is_a?', '$constantize', '$[]=', '$-', '$cache_constants?', '$initialize_constants!', '$nil?', '$run', '$success?', '$result', '$errors', '$!', '$respond_to?', '$new_record?']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ModelFilter(){}; | |
var self = $ModelFilter = $klass($base, $super, 'ModelFilter', $ModelFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ModelFilter_initialize_1, TMP_ModelFilter_initialize_constants$B_2, TMP_ModelFilter_filter_3; | |
def.initialize_constants = def.name = nil; | |
self.default_options = $hash2(["nils", "class", "builder", "new_records"], {"nils": false, "class": nil, "builder": nil, "new_records": false}); | |
Opal.def(self, '$initialize', TMP_ModelFilter_initialize_1 = function $$initialize(name, opts) { | |
var self = this, $iter = TMP_ModelFilter_initialize_1.$$p, $yield = $iter || nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
if ($iter) TMP_ModelFilter_initialize_1.$$p = null; | |
$send(self, Opal.find_super_dispatcher(self, 'initialize', TMP_ModelFilter_initialize_1, false), [opts], null); | |
return (self.name = name); | |
}, TMP_ModelFilter_initialize_1.$$arity = -2); | |
Opal.def(self, '$initialize_constants!', TMP_ModelFilter_initialize_constants$B_2 = function() { | |
var $a, $b, self = this, class_const = nil, $writer = nil; | |
self.initialize_constants = ($truthy($a = self.initialize_constants) ? $a : ((class_const = ($truthy($b = self.$options()['$[]']("class")) ? $b : self.name.$to_s().$camelize())), (function() {if ($truthy(class_const['$is_a?']($$($nesting, 'String')))) { | |
return (class_const = class_const.$constantize()) | |
} else { | |
return nil | |
}; return nil; })(), (($writer = ["class", class_const]), $send(self.$options(), '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]), (function() {if ($truthy(self.$options()['$[]']("builder"))) { | |
if ($truthy(self.$options()['$[]']("builder")['$is_a?']($$($nesting, 'String')))) { | |
$writer = ["builder", self.$options()['$[]']("builder").$constantize()]; | |
$send(self.$options(), '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return nil | |
} | |
} else { | |
return nil | |
}; return nil; })(), true)); | |
if ($truthy($$($nesting, 'Mutations')['$cache_constants?']())) { | |
return nil | |
} else { | |
if ($truthy(self.$options()['$[]']("class"))) { | |
$writer = ["class", self.$options()['$[]']("class").$to_s().$constantize()]; | |
$send(self.$options(), '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
if ($truthy(self.$options()['$[]']("builder"))) { | |
$writer = ["builder", self.$options()['$[]']("builder").$to_s().$constantize()]; | |
$send(self.$options(), '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return nil | |
}; | |
}; | |
}, TMP_ModelFilter_initialize_constants$B_2.$$arity = 0); | |
return (Opal.def(self, '$filter', TMP_ModelFilter_filter_3 = function $$filter(data) { | |
var $a, $b, self = this, ret = nil; | |
self['$initialize_constants!'](); | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if ($truthy(($truthy($a = data['$is_a?']($$($nesting, 'Hash'))) ? self.$options()['$[]']("builder") : $a))) { | |
ret = self.$options()['$[]']("builder").$run(data); | |
if ($truthy(ret['$success?']())) { | |
data = ret.$result() | |
} else { | |
return [data, ret.$errors()] | |
};}; | |
if ($truthy(data['$is_a?'](self.$options()['$[]']("class")))) { | |
if ($truthy(($truthy($a = self.$options()['$[]']("new_records")['$!']()) ? ($truthy($b = data['$respond_to?']("new_record?")) ? data['$new_record?']() : $b) : $a))) { | |
return [data, "new_records"]}; | |
return [data, nil];}; | |
return [data, "model"]; | |
}, TMP_ModelFilter_filter_3.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'InputFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/outcome.rb": | |
/*!*****************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/outcome.rb ***! | |
\*****************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/outcome"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; | |
Opal.add_stubs(['$attr_reader']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Outcome(){}; | |
var self = $Outcome = $klass($base, $super, 'Outcome', $Outcome); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Outcome_initialize_1, TMP_Outcome_success$q_2; | |
def.success = nil; | |
self.$attr_reader("result", "errors", "inputs"); | |
Opal.def(self, '$initialize', TMP_Outcome_initialize_1 = function $$initialize(is_success, result, errors, inputs) { | |
var $a, self = this; | |
return $a = [is_success, result, errors, inputs], (self.success = $a[0]), (self.result = $a[1]), (self.errors = $a[2]), (self.inputs = $a[3]), $a | |
}, TMP_Outcome_initialize_1.$$arity = 4); | |
return (Opal.def(self, '$success?', TMP_Outcome_success$q_2 = function() { | |
var self = this; | |
return self.success | |
}, TMP_Outcome_success$q_2.$$arity = 0), nil) && 'success?'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/string_filter.rb": | |
/*!***********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/string_filter.rb ***! | |
\***********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/string_filter"] = function(Opal) { | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$nil?', '$[]', '$options', '$!', '$any?', '$is_a?', '$to_s', '$gsub', '$strip', '$==', '$<', '$length', '$>', '$include?', '$!~']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $StringFilter(){}; | |
var self = $StringFilter = $klass($base, $super, 'StringFilter', $StringFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_StringFilter_filter_2; | |
self.default_options = $hash2(["strip", "strict", "nils", "empty", "min_length", "max_length", "matches", "in", "discard_empty", "allow_control_characters"], {"strip": true, "strict": false, "nils": false, "empty": false, "min_length": nil, "max_length": nil, "matches": nil, "in": nil, "discard_empty": false, "allow_control_characters": false}); | |
return (Opal.def(self, '$filter', TMP_StringFilter_filter_2 = function $$filter(data) { | |
var $a, TMP_1, self = this; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("strict")['$!']()) ? $send([$$($nesting, 'TrueClass'), $$($nesting, 'FalseClass'), $$($nesting, 'Integer'), $$($nesting, 'Float'), $$($nesting, 'BigDecimal'), $$($nesting, 'Symbol')], 'any?', [], (TMP_1 = function(klass){var self = TMP_1.$$s || this; | |
if (klass == null) klass = nil; | |
return data['$is_a?'](klass)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)) : $a))) { | |
data = data.$to_s()}; | |
if ($truthy(data['$is_a?']($$($nesting, 'String')))) { | |
} else { | |
return [data, "string"] | |
}; | |
if ($truthy(self.$options()['$[]']("allow_control_characters"))) { | |
} else { | |
data = data.$gsub(/[^[:print:]\t\r\n]+/, " ") | |
}; | |
if ($truthy(self.$options()['$[]']("strip"))) { | |
data = data.$strip()}; | |
if (data['$==']("")) { | |
if ($truthy(self.$options()['$[]']("empty"))) { | |
return [data, nil] | |
} else { | |
return [data, "empty"] | |
}}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("min_length")) ? $rb_lt(data.$length(), self.$options()['$[]']("min_length")) : $a))) { | |
return [data, "min_length"]}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("max_length")) ? $rb_gt(data.$length(), self.$options()['$[]']("max_length")) : $a))) { | |
return [data, "max_length"]}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("in")) ? self.$options()['$[]']("in")['$include?'](data)['$!']() : $a))) { | |
return [data, "in"]}; | |
if ($truthy(($truthy($a = self.$options()['$[]']("matches")) ? self.$options()['$[]']("matches")['$!~'](data) : $a))) { | |
return [data, "matches"]}; | |
return [data, nil]; | |
}, TMP_StringFilter_filter_2.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/time_filter.rb": | |
/*!*********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/time_filter.rb ***! | |
\*********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/time_filter"] = function(Opal) { | |
function $rb_le(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); | |
} | |
function $rb_ge(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$is_a?', '$strptime', '$parse', '$respond_to?', '$to_time', '$<=', '$>=']); | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $TimeFilter(){}; | |
var self = $TimeFilter = $klass($base, $super, 'TimeFilter', $TimeFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_TimeFilter_filter_1; | |
self.default_options = $hash2(["nils", "format", "after", "before"], {"nils": false, "format": nil, "after": nil, "before": nil}); | |
return (Opal.def(self, '$filter', TMP_TimeFilter_filter_1 = function $$filter(data) { | |
var self = this, actual_time = nil; | |
if ($truthy(data['$nil?']())) { | |
if ($truthy(self.$options()['$[]']("nils"))) { | |
return [nil, nil]}; | |
return [nil, "nils"];}; | |
if (""['$=='](data)) { | |
return [data, "empty"]}; | |
if ($truthy(data['$is_a?']($$($nesting, 'Time')))) { | |
actual_time = data | |
} else if ($truthy(data['$is_a?']($$($nesting, 'String')))) { | |
try { | |
actual_time = (function() {if ($truthy(self.$options()['$[]']("format"))) { | |
return $$($nesting, 'Time').$strptime(data, self.$options()['$[]']("format")) | |
} else { | |
return $$($nesting, 'Time').$parse(data) | |
}; return nil; })() | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'ArgumentError')])) { | |
try { | |
return [nil, "time"] | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}; | |
} else if ($truthy(data['$respond_to?']("to_time"))) { | |
actual_time = data.$to_time() | |
} else { | |
return [nil, "time"] | |
}; | |
if ($truthy(self.$options()['$[]']("after"))) { | |
if ($truthy($rb_le(actual_time, self.$options()['$[]']("after")))) { | |
return [nil, "after"]}}; | |
if ($truthy(self.$options()['$[]']("before"))) { | |
if ($truthy($rb_ge(actual_time, self.$options()['$[]']("before")))) { | |
return [nil, "before"]}}; | |
return [actual_time, nil]; | |
}, TMP_TimeFilter_filter_1.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/version.rb": | |
/*!*****************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations/version.rb ***! | |
\*****************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["mutations/version"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
Opal.const_set($nesting[0], 'VERSION', "0.8.2") | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio.rb": | |
/*!***************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio.rb ***! | |
\***************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var paggio_utils_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! paggio/utils.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/utils.rb"); | |
/* harmony import */ var paggio_html_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! paggio/html.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html.rb"); | |
/* harmony import */ var paggio_css_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! paggio/css.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css.rb"); | |
/* harmony import */ var paggio_formatter_rb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! paggio/formatter.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/formatter.rb"); | |
if (typeof global.Opal.modules["paggio/utils"] === 'undefined') { | |
if (typeof paggio_utils_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(paggio_utils_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html"] === 'undefined') { | |
if (typeof paggio_html_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(paggio_html_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/css"] === 'undefined') { | |
if (typeof paggio_css_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(paggio_css_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/formatter"] === 'undefined') { | |
if (typeof paggio_formatter_rb__WEBPACK_IMPORTED_MODULE_3__["default"] === 'function') { Object(paggio_formatter_rb__WEBPACK_IMPORTED_MODULE_3__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$require', '$options', '$to_proc', '$to_s', '$format', '$new', '$tap', '$each']); | |
self.$require("paggio/utils"); | |
self.$require("paggio/html"); | |
self.$require("paggio/css"); | |
self.$require("paggio/formatter"); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Paggio_options_1, TMP_Paggio_indent_2, TMP_Paggio_css_3, TMP_Paggio_html_4, TMP_Paggio_html$B_5; | |
Opal.defs(self, '$options', TMP_Paggio_options_1 = function $$options(options) { | |
var self = this, $iter = TMP_Paggio_options_1.$$p, block = $iter || nil; | |
if ($iter) TMP_Paggio_options_1.$$p = null; | |
return $send($$($nesting, 'Formatter'), 'options', [options], block.$to_proc()) | |
}, TMP_Paggio_options_1.$$arity = 1); | |
Opal.defs(self, '$indent', TMP_Paggio_indent_2 = function $$indent(options) { | |
var self = this, $iter = TMP_Paggio_indent_2.$$p, block = $iter || nil; | |
if ($iter) TMP_Paggio_indent_2.$$p = null; | |
return $send(self, 'options', [$hash2(["indent"], {"indent": options})], block.$to_proc()) | |
}, TMP_Paggio_indent_2.$$arity = 1); | |
Opal.defs(self, '$css', TMP_Paggio_css_3 = function $$css($a_rest) { | |
var self = this, args, $iter = TMP_Paggio_css_3.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Paggio_css_3.$$p = null; | |
return $$($nesting, 'Formatter').$new().$format($send($$($nesting, 'CSS'), 'new', Opal.to_a(args), block.$to_proc())).$to_s() | |
}, TMP_Paggio_css_3.$$arity = -1); | |
Opal.defs(self, '$html', TMP_Paggio_html_4 = function $$html($a_rest) { | |
var self = this, args, $iter = TMP_Paggio_html_4.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Paggio_html_4.$$p = null; | |
return $$($nesting, 'Formatter').$new().$format($send($$($nesting, 'HTML'), 'new', Opal.to_a(args), block.$to_proc())).$to_s() | |
}, TMP_Paggio_html_4.$$arity = -1); | |
return (Opal.defs(self, '$html!', TMP_Paggio_html$B_5 = function() { | |
var TMP_6, self = this, $iter = TMP_Paggio_html$B_5.$$p, block = $iter || nil; | |
if ($iter) TMP_Paggio_html$B_5.$$p = null; | |
return $send($$($nesting, 'Formatter').$new(), 'tap', [], (TMP_6 = function(f){var self = TMP_6.$$s || this, TMP_7; | |
if (f == null) f = nil; | |
return $send($send($$($nesting, 'HTML'), 'new', [], block.$to_proc()), 'each', [], (TMP_7 = function(root){var self = TMP_7.$$s || this; | |
if (root == null) root = nil; | |
return f.$format(root)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7))}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6)).$to_s() | |
}, TMP_Paggio_html$B_5.$$arity = 0), nil) && 'html!'; | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css.rb": | |
/*!*******************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css.rb ***! | |
\*******************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var paggio_css_unit_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! paggio/css/unit.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/unit.rb"); | |
/* harmony import */ var paggio_css_color_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! paggio/css/color.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/color.rb"); | |
/* harmony import */ var paggio_css_definition_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! paggio/css/definition.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/definition.rb"); | |
/* harmony import */ var paggio_css_rule_rb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! paggio/css/rule.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/rule.rb"); | |
/* harmony import */ var paggio_css_font_rb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! paggio/css/font.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/font.rb"); | |
/* harmony import */ var paggio_css_animation_rb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! paggio/css/animation.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/animation.rb"); | |
if (typeof global.Opal.modules["paggio/css/unit"] === 'undefined') { | |
if (typeof paggio_css_unit_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(paggio_css_unit_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/css/color"] === 'undefined') { | |
if (typeof paggio_css_color_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(paggio_css_color_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/css/definition"] === 'undefined') { | |
if (typeof paggio_css_definition_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(paggio_css_definition_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/css/rule"] === 'undefined') { | |
if (typeof paggio_css_rule_rb__WEBPACK_IMPORTED_MODULE_3__["default"] === 'function') { Object(paggio_css_rule_rb__WEBPACK_IMPORTED_MODULE_3__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/css/font"] === 'undefined') { | |
if (typeof paggio_css_font_rb__WEBPACK_IMPORTED_MODULE_4__["default"] === 'function') { Object(paggio_css_font_rb__WEBPACK_IMPORTED_MODULE_4__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/css/animation"] === 'undefined') { | |
if (typeof paggio_css_animation_rb__WEBPACK_IMPORTED_MODULE_5__["default"] === 'function') { Object(paggio_css_animation_rb__WEBPACK_IMPORTED_MODULE_5__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/css"] = function(Opal) { | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $range = Opal.range; | |
Opal.add_stubs(['$require', '$each', '$start_with?', '$+', '$[]', '$==', '$attr_reader', '$raise', '$arity', '$instance_exec', '$to_proc', '$call', '$any?', '$include?', '$<<', '$new', '$selector', '$pop', '$method_missing', '$__send__', '$last']); | |
self.$require("paggio/css/unit"); | |
self.$require("paggio/css/color"); | |
self.$require("paggio/css/definition"); | |
self.$require("paggio/css/rule"); | |
self.$require("paggio/css/font"); | |
self.$require("paggio/css/animation"); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $CSS(){}; | |
var self = $CSS = $klass($base, $super, 'CSS', $CSS); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_CSS_selector_2, TMP_CSS_initialize_3, TMP_CSS_rule_4, TMP_CSS_media_7, TMP_CSS_font_8, TMP_CSS_animation_9, TMP_CSS_method_missing_10; | |
def.media = def.current = def.fonts = def.animations = nil; | |
Opal.defs(self, '$selector', TMP_CSS_selector_2 = function $$selector(list) { | |
var TMP_1, self = this, result = nil; | |
result = ""; | |
$send(list, 'each', [], (TMP_1 = function(part){var self = TMP_1.$$s || this; | |
if (part == null) part = nil; | |
if ($truthy(part['$start_with?']("&"))) { | |
return (result = $rb_plus(result, part['$[]']($range(1, -1, false)))) | |
} else { | |
return (result = $rb_plus(result, $rb_plus(" ", part))) | |
}}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)); | |
if (result['$[]'](0)['$=='](" ")) { | |
return result['$[]']($range(1, -1, false)) | |
} else { | |
return result | |
}; | |
}, TMP_CSS_selector_2.$$arity = 1); | |
self.$attr_reader("rules", "media", "fonts", "animations"); | |
Opal.def(self, '$initialize', TMP_CSS_initialize_3 = function $$initialize() { | |
var self = this, $iter = TMP_CSS_initialize_3.$$p, block = $iter || nil; | |
if ($iter) TMP_CSS_initialize_3.$$p = null; | |
if ($truthy(block)) { | |
} else { | |
$$$('::', 'Kernel').$raise($$$('::', 'ArgumentError'), "no block given") | |
}; | |
self.selector = []; | |
self.current = []; | |
self.rules = []; | |
self.fonts = []; | |
self.animations = []; | |
if (block.$arity()['$=='](0)) { | |
return $send(self, 'instance_exec', [], block.$to_proc()) | |
} else { | |
return block.$call(self) | |
}; | |
}, TMP_CSS_initialize_3.$$arity = 0); | |
Opal.def(self, '$rule', TMP_CSS_rule_4 = function $$rule($a_rest) { | |
var TMP_5, TMP_6, self = this, names, $iter = TMP_CSS_rule_4.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
names = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
names[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_CSS_rule_4.$$p = null; | |
if ($truthy(block)) { | |
} else { | |
return nil | |
}; | |
if ($truthy($send(names, 'any?', [], (TMP_5 = function(n){var self = TMP_5.$$s || this; | |
if (n == null) n = nil; | |
return n['$include?'](",")}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5)))) { | |
$$$('::', 'Kernel').$raise($$$('::', 'ArgumentError'), "selectors cannot contain commas")}; | |
return $send(names, 'each', [], (TMP_6 = function(name){var self = TMP_6.$$s || this; | |
if (self.selector == null) self.selector = nil; | |
if (self.current == null) self.current = nil; | |
if (self.media == null) self.media = nil; | |
if (self.rules == null) self.rules = nil; | |
if (name == null) name = nil; | |
self.selector['$<<'](name); | |
self.current['$<<']($$($nesting, 'Rule').$new($$($nesting, 'CSS').$selector(self.selector), self.media)); | |
block.$call(); | |
self.selector.$pop(); | |
return self.rules['$<<'](self.current.$pop());}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6)); | |
}, TMP_CSS_rule_4.$$arity = -1); | |
Opal.def(self, '$media', TMP_CSS_media_7 = function $$media(query, $a_rest) { | |
var $b, self = this, args, $iter = TMP_CSS_media_7.$$p, block = $iter || nil, old = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_CSS_media_7.$$p = null; | |
if ($truthy(block)) { | |
$b = [self.media, query], (old = $b[0]), (self.media = $b[1]), $b; | |
block.$call(); | |
return (self.media = old); | |
} else { | |
return $send(self, 'method_missing', ["media", query].concat(Opal.to_a(args))) | |
} | |
}, TMP_CSS_media_7.$$arity = -2); | |
Opal.def(self, '$font', TMP_CSS_font_8 = function $$font(name, $a_rest) { | |
var self = this, args, $iter = TMP_CSS_font_8.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_CSS_font_8.$$p = null; | |
if ($truthy(block)) { | |
self.current['$<<']($$($nesting, 'Font').$new(name)); | |
block.$call(); | |
return self.fonts['$<<'](self.current.$pop()); | |
} else { | |
return $send(self, 'method_missing', ["font", name].concat(Opal.to_a(args))) | |
} | |
}, TMP_CSS_font_8.$$arity = -2); | |
Opal.def(self, '$animation', TMP_CSS_animation_9 = function $$animation(name, $a_rest) { | |
var self = this, args, $iter = TMP_CSS_animation_9.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_CSS_animation_9.$$p = null; | |
if ($truthy(block)) { | |
self.current['$<<']($$($nesting, 'Animation').$new(name)); | |
block.$call(); | |
return self.animations['$<<'](self.current.$pop()); | |
} else { | |
return $send(self, 'method_missing', ["animation", name].concat(Opal.to_a(args))) | |
} | |
}, TMP_CSS_animation_9.$$arity = -2); | |
return (Opal.def(self, '$method_missing', TMP_CSS_method_missing_10 = function $$method_missing($a_rest) { | |
var self = this, args, $iter = TMP_CSS_method_missing_10.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_CSS_method_missing_10.$$p = null; | |
return $send(self.current.$last(), '__send__', Opal.to_a(args), block.$to_proc()) | |
}, TMP_CSS_method_missing_10.$$arity = -1), nil) && 'method_missing'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_HTML_style_11; | |
def.current = def.roots = nil; | |
return (Opal.def(self, '$style', TMP_HTML_style_11 = function $$style() { | |
var $a, self = this, $iter = TMP_HTML_style_11.$$p, block = $iter || nil; | |
if ($iter) TMP_HTML_style_11.$$p = null; | |
return ($truthy($a = self.current) ? $a : self.roots)['$<<']($send($$($nesting, 'CSS'), 'new', [], block.$to_proc())) | |
}, TMP_HTML_style_11.$$arity = 0), nil) && 'style' | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting); | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/animation.rb": | |
/*!*****************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/animation.rb ***! | |
\*****************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/css/animation"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$attr_reader', '$new', '$__send__', '$to_proc', '$<<', '$call', '$%', '$last']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $CSS(){}; | |
var self = $CSS = $klass($base, $super, 'CSS', $CSS); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Animation(){}; | |
var self = $Animation = $klass($base, $super, 'Animation', $Animation); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Animation_initialize_3, TMP_Animation_step_4, TMP_Animation_from_5, TMP_Animation_to_6, TMP_Animation_method_missing_7; | |
def.steps = nil; | |
(function($base, $super, $parent_nesting) { | |
function $Step(){}; | |
var self = $Step = $klass($base, $super, 'Step', $Step); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Step_initialize_1, TMP_Step_method_missing_2; | |
def.definition = nil; | |
self.$attr_reader("value"); | |
Opal.def(self, '$initialize', TMP_Step_initialize_1 = function $$initialize(value) { | |
var self = this; | |
self.value = value; | |
return (self.definition = $$($nesting, 'Definition').$new()); | |
}, TMP_Step_initialize_1.$$arity = 1); | |
return (Opal.def(self, '$method_missing', TMP_Step_method_missing_2 = function $$method_missing($a_rest) { | |
var self = this, args, $iter = TMP_Step_method_missing_2.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Step_method_missing_2.$$p = null; | |
return $send(self.definition, '__send__', Opal.to_a(args), block.$to_proc()) | |
}, TMP_Step_method_missing_2.$$arity = -1), nil) && 'method_missing'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting); | |
self.$attr_reader("name", "steps"); | |
Opal.def(self, '$initialize', TMP_Animation_initialize_3 = function $$initialize(name) { | |
var self = this; | |
self.name = name; | |
return (self.steps = []); | |
}, TMP_Animation_initialize_3.$$arity = 1); | |
Opal.def(self, '$step', TMP_Animation_step_4 = function $$step(value) { | |
var self = this, $iter = TMP_Animation_step_4.$$p, block = $iter || nil; | |
if ($iter) TMP_Animation_step_4.$$p = null; | |
self.steps['$<<']($$($nesting, 'Step').$new(value)); | |
return block.$call(); | |
}, TMP_Animation_step_4.$$arity = 1); | |
Opal.def(self, '$from', TMP_Animation_from_5 = function $$from(value) { | |
var self = this, $iter = TMP_Animation_from_5.$$p, block = $iter || nil; | |
if ($iter) TMP_Animation_from_5.$$p = null; | |
self.steps['$<<']($$($nesting, 'Step').$new((0)['$%']())); | |
return block.$call(); | |
}, TMP_Animation_from_5.$$arity = 1); | |
Opal.def(self, '$to', TMP_Animation_to_6 = function $$to(value) { | |
var self = this, $iter = TMP_Animation_to_6.$$p, block = $iter || nil; | |
if ($iter) TMP_Animation_to_6.$$p = null; | |
self.steps['$<<']($$($nesting, 'Step').$new((100)['$%']())); | |
return block.$call(); | |
}, TMP_Animation_to_6.$$arity = 1); | |
return (Opal.def(self, '$method_missing', TMP_Animation_method_missing_7 = function $$method_missing($a_rest) { | |
var self = this, args, $iter = TMP_Animation_method_missing_7.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Animation_method_missing_7.$$p = null; | |
return $send(self.steps.$last(), '__send__', Opal.to_a(args), block.$to_proc()) | |
}, TMP_Animation_method_missing_7.$$arity = -1), nil) && 'method_missing'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/color.rb": | |
/*!*************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/color.rb ***! | |
\*************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/css/color"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$each', '$map', '$to_proc', '$define_method', '$new']); | |
(function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $CSS(){}; | |
var self = $CSS = $klass($base, $super, 'CSS', $CSS); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Color(){}; | |
var self = $Color = $klass($base, $super, 'Color', $Color); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Color_initialize_1; | |
return (Opal.def(self, '$initialize', TMP_Color_initialize_1 = function $$initialize(value, type) { | |
var self = this; | |
self.internal = value; | |
return (self.type = type); | |
}, TMP_Color_initialize_1.$$arity = 2), nil) && 'initialize' | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $String(){}; | |
var self = $String = $klass($base, $super, 'String', $String); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_String_2; | |
return $send($send(["rgb", "rgba", "hsl", "hsla"], 'map', [], "to_sym".$to_proc()), 'each', [], (TMP_String_2 = function(name){var self = TMP_String_2.$$s || this, TMP_3; | |
if (name == null) name = nil; | |
return $send(self, 'define_method', [name], (TMP_3 = function(){var self = TMP_3.$$s || this; | |
return $$$($$$($$($nesting, 'Paggio'), 'CSS'), 'Color').$new(self, name)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3))}, TMP_String_2.$$s = self, TMP_String_2.$$arity = 1, TMP_String_2)) | |
})($nesting[0], null, $nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Array(){}; | |
var self = $Array = $klass($base, $super, 'Array', $Array); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Array_4; | |
return $send($send(["rgb", "rgba", "hsl", "hsla"], 'map', [], "to_sym".$to_proc()), 'each', [], (TMP_Array_4 = function(name){var self = TMP_Array_4.$$s || this, TMP_5; | |
if (name == null) name = nil; | |
return $send(self, 'define_method', [name], (TMP_5 = function(){var self = TMP_5.$$s || this; | |
return $$$($$$($$($nesting, 'Paggio'), 'CSS'), 'Color').$new(self, name)}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5))}, TMP_Array_4.$$s = self, TMP_Array_4.$$arity = 1, TMP_Array_4)) | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/definition.rb": | |
/*!******************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/definition.rb ***! | |
\******************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/css/definition"] = function(Opal) { | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
function $rb_times(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send, $range = Opal.range, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$new', '$==', '$arity', '$instance_exec', '$to_proc', '$call', '$empty?', '$each', '$inspect', '$to_s', '$define_method', '$a', '$===', '$first', '$>', '$length', '$raise', '$style', '$name', '$value', '$[]', '$join', '$map', '$to_i', '$*', '$end_with?', '$__send__', '$<<', '$last', '$pop', '$!', '$other', '$shift', '$horizontal?', '$private']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $CSS(){}; | |
var self = $CSS = $klass($base, $super, 'CSS', $CSS); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Definition(){}; | |
var self = $Definition = $klass($base, $super, 'Definition', $Definition); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Definition_initialize_1, TMP_Definition_empty$q_2, TMP_Definition_each_3, TMP_Definition_gradient_4, TMP_Definition_url_5, TMP_Definition_6, TMP_Definition_rgb_8, TMP_Definition_rgba_9, TMP_Definition_10, TMP_Definition_12, TMP_Definition_background_16, TMP_Definition_border_22, TMP_Definition_box_25, TMP_Definition_opacity_26, TMP_Definition_animation_28, TMP_Definition_transition_29, TMP_Definition_user_select_30, TMP_Definition_transform_31, TMP_Definition_filter_32, TMP_Definition_method_missing_33, TMP_Definition_style_35, TMP_Definition_style$B_36; | |
def.style = def.important = nil; | |
Opal.const_set($nesting[0], 'Style', $$$('::', 'Struct').$new("name", "value", "important")); | |
Opal.def(self, '$initialize', TMP_Definition_initialize_1 = function $$initialize() { | |
var self = this, $iter = TMP_Definition_initialize_1.$$p, block = $iter || nil; | |
if ($iter) TMP_Definition_initialize_1.$$p = null; | |
self.style = []; | |
if ($truthy(block)) { | |
if (block.$arity()['$=='](0)) { | |
return $send(self, 'instance_exec', [], block.$to_proc()) | |
} else { | |
return block.$call(self) | |
} | |
} else { | |
return nil | |
}; | |
}, TMP_Definition_initialize_1.$$arity = 0); | |
Opal.def(self, '$empty?', TMP_Definition_empty$q_2 = function() { | |
var self = this; | |
return self.style['$empty?']() | |
}, TMP_Definition_empty$q_2.$$arity = 0); | |
Opal.def(self, '$each', TMP_Definition_each_3 = function $$each() { | |
var self = this, $iter = TMP_Definition_each_3.$$p, block = $iter || nil; | |
if ($iter) TMP_Definition_each_3.$$p = null; | |
return $send(self.style, 'each', [], block.$to_proc()) | |
}, TMP_Definition_each_3.$$arity = 0); | |
Opal.def(self, '$gradient', TMP_Definition_gradient_4 = function $$gradient($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send($$($nesting, 'Gradient'), 'new', Opal.to_a(args)) | |
}, TMP_Definition_gradient_4.$$arity = -1); | |
Opal.def(self, '$url', TMP_Definition_url_5 = function $$url(value) { | |
var self = this; | |
return "" + "url(" + (value.$to_s().$inspect()) + ")" | |
}, TMP_Definition_url_5.$$arity = 1); | |
$send(["url", "blur", "brightness", "rotate", "contrast", "grayscale", "invert", "opacity", "saturate", "sepia"], 'each', [], (TMP_Definition_6 = function(name){var self = TMP_Definition_6.$$s || this, TMP_7; | |
if (name == null) name = nil; | |
return $send(self, 'define_method', [name], (TMP_7 = function(value){var self = TMP_7.$$s || this; | |
if (value == null) value = nil; | |
return "" + (name) + "(" + (value) + ")"}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7))}, TMP_Definition_6.$$s = self, TMP_Definition_6.$$arity = 1, TMP_Definition_6)); | |
Opal.def(self, '$rgb', TMP_Definition_rgb_8 = function $$rgb(r, g, b) { | |
var self = this; | |
return "" + "rgb(" + (r) + ", " + (g) + ", " + (b) + ", " + (self.$a()) + ")" | |
}, TMP_Definition_rgb_8.$$arity = 3); | |
Opal.def(self, '$rgba', TMP_Definition_rgba_9 = function $$rgba(r, g, b, a) { | |
var self = this; | |
return "" + "rgba(" + (r) + ", " + (g) + ", " + (b) + ", " + (a) + ")" | |
}, TMP_Definition_rgba_9.$$arity = 4); | |
$send(["scale", "skew", "translate"], 'each', [], (TMP_Definition_10 = function(name){var self = TMP_Definition_10.$$s || this, TMP_11; | |
if (name == null) name = nil; | |
return $send(self, 'define_method', [name], (TMP_11 = function(a, b){var self = TMP_11.$$s || this; | |
if (b == null) { | |
b = nil; | |
}if (a == null) a = nil; | |
if ($truthy(b)) { | |
return "" + (name) + "(" + (a) + ", " + (b) + ")" | |
} else { | |
return "" + (name) + "(" + (a) + ")" | |
}}, TMP_11.$$s = self, TMP_11.$$arity = -2, TMP_11))}, TMP_Definition_10.$$s = self, TMP_Definition_10.$$arity = 1, TMP_Definition_10)); | |
$send(["translateX", "translateY", "translateZ", "rotateX", "rotateY", "rotateZ", "skewX", "skewY", "scaleX", "scaleY"], 'each', [], (TMP_Definition_12 = function(name){var self = TMP_Definition_12.$$s || this, TMP_13; | |
if (name == null) name = nil; | |
return $send(self, 'define_method', [name], (TMP_13 = function(value){var self = TMP_13.$$s || this; | |
if (value == null) value = nil; | |
return "" + (name) + "(" + (value) + ")"}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13))}, TMP_Definition_12.$$s = self, TMP_Definition_12.$$arity = 1, TMP_Definition_12)); | |
Opal.def(self, '$background', TMP_Definition_background_16 = function $$background($a_rest) { | |
var TMP_14, TMP_15, self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($truthy($$($nesting, 'Gradient')['$==='](args.$first()))) { | |
if ($truthy($rb_gt(args.$length(), 1))) { | |
self.$raise($$($nesting, 'NotImplementedError'), "multiple gradients not implemented yet")}; | |
return $send(args.$first(), 'each', [], (TMP_14 = function(s){var self = TMP_14.$$s || this, $a; | |
if (s == null) s = nil; | |
return self.$style(($truthy($a = s.$name()) ? $a : "background-image"), s.$value())}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14)); | |
} else if ($truthy($$$('::', 'Hash')['$==='](args.$first()))) { | |
return $send(args.$first(), 'each', [], (TMP_15 = function(sub, value){var self = TMP_15.$$s || this; | |
if (sub == null) sub = nil;if (value == null) value = nil; | |
return self.$style("" + "background-" + (sub), value)}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15)) | |
} else { | |
return self.$style("background", args) | |
} | |
}, TMP_Definition_background_16.$$arity = -1); | |
Opal.def(self, '$border', TMP_Definition_border_22 = function $$border($a_rest) { | |
var TMP_17, self = this, args, options = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($truthy($$$('::', 'Hash')['$==='](args.$first()))) { | |
if (args.$length()['$=='](1)) { | |
options = args.$first()}; | |
return $send(options, 'each', [], (TMP_17 = function(name, value){var self = TMP_17.$$s || this, TMP_18, TMP_19, TMP_21, $case = nil; | |
if (name == null) name = nil;if (value == null) value = nil; | |
return (function() {$case = name; | |
if ("top"['$===']($case) || "bottom"['$===']($case) || "left"['$===']($case) || "right"['$===']($case)) {if ($truthy($$$('::', 'Hash')['$==='](value))) { | |
return $send(value, 'each', [], (TMP_18 = function(n, v){var self = TMP_18.$$s || this; | |
if (n == null) n = nil;if (v == null) v = nil; | |
return self.$style("" + "border-" + (name) + "-" + (n), v)}, TMP_18.$$s = self, TMP_18.$$arity = 2, TMP_18)) | |
} else { | |
return self.$style("" + "border-" + (name), value) | |
}} | |
else if ("radius"['$===']($case)) {if ($truthy($$$('::', 'Hash')['$==='](value))) { | |
return $send(value, 'each', [], (TMP_19 = function(horizontal, value){var self = TMP_19.$$s || this, TMP_20; | |
if (horizontal == null) horizontal = nil;if (value == null) value = nil; | |
return $send(value, 'each', [], (TMP_20 = function(vertical, value){var self = TMP_20.$$s || this; | |
if (vertical == null) vertical = nil;if (value == null) value = nil; | |
self.$style("" + "-moz-border-radius-" + (horizontal) + (vertical), value); | |
self.$style("" + "-webkit-border-" + (horizontal) + "-" + (vertical) + "-radius", value); | |
return self.$style("" + "border-" + (horizontal) + "-" + (vertical) + "-radius", value);}, TMP_20.$$s = self, TMP_20.$$arity = 2, TMP_20))}, TMP_19.$$s = self, TMP_19.$$arity = 2, TMP_19)) | |
} else { | |
self.$style("-moz-border-radius", value); | |
self.$style("-webkit-border-radius", value); | |
return self.$style("border-radius", value); | |
}} | |
else if ("color"['$===']($case)) {if ($truthy($$$('::', 'Hash')['$==='](value))) { | |
return $send(value, 'each', [], (TMP_21 = function(name, value){var self = TMP_21.$$s || this; | |
if (name == null) name = nil;if (value == null) value = nil; | |
return self.$style("" + "border-" + (name) + "-color", value)}, TMP_21.$$s = self, TMP_21.$$arity = 2, TMP_21)) | |
} else { | |
return self.$style("border-color", value) | |
}} | |
else {return self.$style("" + "border-" + (name), value)}})()}, TMP_17.$$s = self, TMP_17.$$arity = 2, TMP_17)); | |
} else { | |
return self.$style("border", args) | |
} | |
}, TMP_Definition_border_22.$$arity = -1); | |
Opal.def(self, '$box', TMP_Definition_box_25 = function $$box(options) { | |
var TMP_23, self = this; | |
if ($truthy($$$('::', 'Hash')['$==='](options))) { | |
return $send(options, 'each', [], (TMP_23 = function(name, value){var self = TMP_23.$$s || this, TMP_24, $case = nil; | |
if (name == null) name = nil;if (value == null) value = nil; | |
return (function() {$case = name; | |
if ("shadow"['$===']($case)) { | |
if ($truthy($$$('::', 'Array')['$==='](value))) { | |
if ($truthy($$$('::', 'Array')['$==='](value['$[]'](0)))) { | |
value = $send(value, 'map', [], (TMP_24 = function(v){var self = TMP_24.$$s || this; | |
if (v == null) v = nil; | |
return v.$join(" ")}, TMP_24.$$s = self, TMP_24.$$arity = 1, TMP_24)).$join(", ") | |
} else { | |
value = value.$join(" ") | |
}}; | |
self.$style("-moz-box-shadow", value); | |
self.$style("-webkit-box-shadow", value); | |
return self.$style("box-shadow", value);} | |
else {return self.$style("" + "box-" + (name), value)}})()}, TMP_23.$$s = self, TMP_23.$$arity = 2, TMP_23)) | |
} else { | |
return self.$style("box", options) | |
} | |
}, TMP_Definition_box_25.$$arity = 1); | |
Opal.def(self, '$opacity', TMP_Definition_opacity_26 = function $$opacity(value) { | |
var self = this; | |
self.$style("opacity", value); | |
self.$style("-moz-opacity", value); | |
self.$style("-ms-filter", "" + "\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + ($rb_times(value, 100).$to_i()) + ")\""); | |
return self.$style("filter", "" + "alpha(opacity=" + ($rb_times(value, 100).$to_i()) + ")"); | |
}, TMP_Definition_opacity_26.$$arity = 1); | |
Opal.def(self, '$animation', TMP_Definition_animation_28 = function $$animation($a_rest) { | |
var TMP_27, self = this, args, options = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($truthy($$($nesting, 'Hash')['$==='](args.$first()))) { | |
if (args.$length()['$=='](1)) { | |
options = args.$first()}; | |
return $send(options, 'each', [], (TMP_27 = function(name, value){var self = TMP_27.$$s || this; | |
if (name == null) name = nil;if (value == null) value = nil; | |
self.$style("" + "-webkit-animation-" + (name), value); | |
return self.$style("" + "animation-" + (name), value);}, TMP_27.$$s = self, TMP_27.$$arity = 2, TMP_27)); | |
} else { | |
self.$style("animation", args); | |
return self.$style("-webkit-animation", args); | |
} | |
}, TMP_Definition_animation_28.$$arity = -1); | |
Opal.def(self, '$transition', TMP_Definition_transition_29 = function $$transition($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
self.$style("transition", args); | |
self.$style("-webkit-transition", args); | |
return self.$style("-moz-transition", args); | |
}, TMP_Definition_transition_29.$$arity = -1); | |
Opal.def(self, '$user_select', TMP_Definition_user_select_30 = function $$user_select($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
self.$style("user-select", args); | |
self.$style("-webkit-user-select", args); | |
self.$style("-moz-user-select", args); | |
return self.$style("-ms-user-select", args); | |
}, TMP_Definition_user_select_30.$$arity = -1); | |
Opal.def(self, '$transform', TMP_Definition_transform_31 = function $$transform($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
self.$style("transform", args); | |
self.$style("-webkit-transform", args); | |
self.$style("-moz-transform", args); | |
self.$style("-ms-transform", args); | |
return self.$style("-o-transform", args); | |
}, TMP_Definition_transform_31.$$arity = -1); | |
Opal.def(self, '$filter', TMP_Definition_filter_32 = function $$filter($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
self.$style("filter", args); | |
self.$style("-webkit-filter", args); | |
self.$style("-moz-filter", args); | |
self.$style("-ms-filter", args); | |
return self.$style("-o-filter", args); | |
}, TMP_Definition_filter_32.$$arity = -1); | |
Opal.def(self, '$method_missing', TMP_Definition_method_missing_33 = function $$method_missing(name, $a_rest) { | |
var TMP_34, self = this, args, $iter = TMP_Definition_method_missing_33.$$p, block = $iter || nil, argument = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Definition_method_missing_33.$$p = null; | |
name = name.$to_s(); | |
if ($truthy(name['$end_with?']("!"))) { | |
name = name['$[]']($range(0, -2, false)); | |
self.important = true; | |
$send(self, '__send__', [name].concat(Opal.to_a(args)), block.$to_proc()); | |
self.important = false; | |
return nil;}; | |
if (args.$length()['$=='](1)) { | |
argument = args.$first(); | |
if ($truthy($$$('::', 'Hash')['$==='](argument))) { | |
$send(argument, 'each', [], (TMP_34 = function(sub, value){var self = TMP_34.$$s || this; | |
if (sub == null) sub = nil;if (value == null) value = nil; | |
return self.$style("" + (name) + "-" + (sub), value)}, TMP_34.$$s = self, TMP_34.$$arity = 2, TMP_34)) | |
} else { | |
self.$style(name, argument) | |
}; | |
} else { | |
self.$style(name, args.$join(" ")) | |
}; | |
self.important = false; | |
return self; | |
}, TMP_Definition_method_missing_33.$$arity = -2); | |
Opal.def(self, '$style', TMP_Definition_style_35 = function $$style(name, value, important) { | |
var self = this; | |
if (value == null) { | |
value = nil; | |
} | |
if (important == null) { | |
important = self.important; | |
} | |
if ($truthy($$$('::', 'Array')['$==='](value))) { | |
value = value.$join(" ")}; | |
if ($truthy($$($nesting, 'Style')['$==='](name))) { | |
return self.style['$<<'](name) | |
} else { | |
return self.style['$<<']($$($nesting, 'Style').$new(name, value, important)) | |
}; | |
}, TMP_Definition_style_35.$$arity = -2); | |
Opal.def(self, '$style!', TMP_Definition_style$B_36 = function(name, value) { | |
var self = this; | |
if (value == null) { | |
value = nil; | |
} | |
return self.$style(name, value, true) | |
}, TMP_Definition_style$B_36.$$arity = -2); | |
return (function($base, $super, $parent_nesting) { | |
function $Gradient(){}; | |
var self = $Gradient = $klass($base, $super, 'Gradient', $Gradient); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Gradient_initialize_37, TMP_Gradient_each_38, TMP_Gradient_horizontal$q_39, TMP_Gradient_vertical$q_40, TMP_Gradient_other_41, TMP_Gradient_style_42; | |
def.to = def.from = def.start = def.end = nil; | |
Opal.def(self, '$initialize', TMP_Gradient_initialize_37 = function $$initialize($a_rest) { | |
var $b, self = this, args, options = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
options = (function() {if ($truthy($$$('::', 'Hash')['$==='](args.$last()))) { | |
return args.$pop() | |
} else { | |
return $hash2([], {}) | |
}; return nil; })(); | |
self.to = options['$[]']("to"); | |
self.from = options['$[]']("from"); | |
if ($truthy(($truthy($b = self.to) ? self.from['$!']() : $b))) { | |
self.from = self.$other(self.to) | |
} else if ($truthy(($truthy($b = self.from) ? self.to['$!']() : $b))) { | |
self.to = self.$other(self.from)}; | |
self.start = args.$shift(); | |
return (self.end = args.$shift()); | |
}, TMP_Gradient_initialize_37.$$arity = -1); | |
Opal.def(self, '$each', TMP_Gradient_each_38 = function $$each() { | |
var self = this, $iter = TMP_Gradient_each_38.$$p, block = $iter || nil; | |
if ($iter) TMP_Gradient_each_38.$$p = null; | |
block.$call(self.$style("" + "-moz-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); | |
if ($truthy(self['$horizontal?']())) { | |
block.$call(self.$style("" + "-webkit-gradient(linear, " + (self.from) + " top, " + (self.to) + " top, color-stop(0%, " + (self.start) + "), color-stop(100%, " + (self.end) + "))")) | |
} else { | |
block.$call(self.$style("" + "-webkit-gradient(linear, left " + (self.from) + ", left " + (self.to) + ", color-stop(0%, " + (self.start) + "), color-stop(100%, " + (self.end) + "))")) | |
}; | |
block.$call(self.$style("" + "-webkit-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); | |
block.$call(self.$style("" + "-o-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); | |
block.$call(self.$style("" + "-ms-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); | |
return block.$call(self.$style("" + "linear-gradient(to " + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); | |
}, TMP_Gradient_each_38.$$arity = 0); | |
Opal.def(self, '$horizontal?', TMP_Gradient_horizontal$q_39 = function() { | |
var $a, self = this; | |
return ($truthy($a = self.to['$==']("left")) ? $a : self.to['$==']("right")) | |
}, TMP_Gradient_horizontal$q_39.$$arity = 0); | |
Opal.def(self, '$vertical?', TMP_Gradient_vertical$q_40 = function() { | |
var $a, self = this; | |
return ($truthy($a = self.to['$==']("top")) ? $a : self.to['$==']("bottom")) | |
}, TMP_Gradient_vertical$q_40.$$arity = 0); | |
self.$private(); | |
Opal.def(self, '$other', TMP_Gradient_other_41 = function $$other(side) { | |
var self = this, $case = nil; | |
return (function() {$case = side; | |
if ("left"['$===']($case)) {return "right"} | |
else if ("right"['$===']($case)) {return "left"} | |
else if ("top"['$===']($case)) {return "bottom"} | |
else if ("bottom"['$===']($case)) {return "top"} | |
else { return nil }})() | |
}, TMP_Gradient_other_41.$$arity = 1); | |
return (Opal.def(self, '$style', TMP_Gradient_style_42 = function $$style($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if (args.$length()['$=='](1)) { | |
return $$($nesting, 'Style').$new(nil, args.$first()) | |
} else { | |
return $send($$($nesting, 'Style'), 'new', Opal.to_a(args)) | |
} | |
}, TMP_Gradient_style_42.$$arity = -1), nil) && 'style'; | |
})($nesting[0], null, $nesting); | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/font.rb": | |
/*!************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/font.rb ***! | |
\************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/css/font"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2, $send = Opal.send; | |
Opal.add_stubs(['$attr_reader', '$new', '$font', '$__send__', '$to_proc']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $CSS(){}; | |
var self = $CSS = $klass($base, $super, 'CSS', $CSS); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Font(){}; | |
var self = $Font = $klass($base, $super, 'Font', $Font); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Font_initialize_1, TMP_Font_method_missing_2; | |
def.definition = nil; | |
self.$attr_reader("name"); | |
Opal.def(self, '$initialize', TMP_Font_initialize_1 = function $$initialize(name) { | |
var self = this; | |
self.name = name; | |
self.definition = $$($nesting, 'Definition').$new(); | |
return self.$font($hash2(["family"], {"family": name})); | |
}, TMP_Font_initialize_1.$$arity = 1); | |
return (Opal.def(self, '$method_missing', TMP_Font_method_missing_2 = function $$method_missing($a_rest) { | |
var self = this, args, $iter = TMP_Font_method_missing_2.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Font_method_missing_2.$$p = null; | |
return $send(self.definition, '__send__', Opal.to_a(args), block.$to_proc()) | |
}, TMP_Font_method_missing_2.$$arity = -1), nil) && 'method_missing'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/rule.rb": | |
/*!************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/rule.rb ***! | |
\************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/css/rule"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$attr_reader', '$new', '$__send__', '$to_proc']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $CSS(){}; | |
var self = $CSS = $klass($base, $super, 'CSS', $CSS); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Rule(){}; | |
var self = $Rule = $klass($base, $super, 'Rule', $Rule); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Rule_initialize_1, TMP_Rule_method_missing_2; | |
def.definition = nil; | |
self.$attr_reader("selector", "media"); | |
Opal.def(self, '$initialize', TMP_Rule_initialize_1 = function $$initialize(selector, media) { | |
var self = this; | |
self.selector = selector; | |
self.media = media; | |
return (self.definition = $$($nesting, 'Definition').$new()); | |
}, TMP_Rule_initialize_1.$$arity = 2); | |
return (Opal.def(self, '$method_missing', TMP_Rule_method_missing_2 = function $$method_missing($a_rest) { | |
var self = this, args, $iter = TMP_Rule_method_missing_2.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Rule_method_missing_2.$$p = null; | |
return $send(self.definition, '__send__', Opal.to_a(args), block.$to_proc()) | |
}, TMP_Rule_method_missing_2.$$arity = -1), nil) && 'method_missing'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/unit.rb": | |
/*!************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/css/unit.rb ***! | |
\************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/css/unit"] = function(Opal) { | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_times(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); | |
} | |
function $rb_divide(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); | |
} | |
var TMP_23, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$map', '$to_proc', '$attr_reader', '$===', '$respond_to?', '$raise', '$class', '$to_u', '$new', '$==', '$convert', '$type', '$number', '$hash', '$each', '$define_method', '$+', '$compatible?', '$-', '$*', '$/', '$to_i', '$to_f', '$private', '$include?', '$class_eval', '$old_percent', '$match', '$[]', '$__send__', '$downcase']); | |
(function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $CSS(){}; | |
var self = $CSS = $klass($base, $super, 'CSS', $CSS); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Unit(){}; | |
var self = $Unit = $klass($base, $super, 'Unit', $Unit); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Unit_initialize_1, TMP_Unit_coerce_2, TMP_Unit_$eq$eq_3, TMP_Unit_$eq$eq$eq_4, TMP_Unit_hash_5, TMP_Unit_6, TMP_Unit_$_8, TMP_Unit_$_9, TMP_Unit_$_10, TMP_Unit_$_11, TMP_Unit_$$_12, TMP_Unit_$$_13, TMP_Unit_to_i_14, TMP_Unit_to_f_15, TMP_Unit_to_u_16, TMP_Unit_to_s_17, TMP_Unit_compatible$q_18, TMP_Unit_convert_19; | |
def.type = def.number = nil; | |
Opal.const_set($nesting[0], 'TYPES', $send(["em", "ex", "ch", "rem", "vh", "vw", "vmin", "vmax", "px", "mm", "cm", "in", "pt", "pc", "s", "deg"], 'map', [], "to_sym".$to_proc())); | |
Opal.const_set($nesting[0], 'COMPATIBLE', $send(["in", "pt", "mm", "cm", "px", "pc"], 'map', [], "to_sym".$to_proc())); | |
self.$attr_reader("type", "number"); | |
Opal.def(self, '$initialize', TMP_Unit_initialize_1 = function $$initialize(number, type) { | |
var self = this; | |
self.number = number; | |
return (self.type = type); | |
}, TMP_Unit_initialize_1.$$arity = 2); | |
Opal.def(self, '$coerce', TMP_Unit_coerce_2 = function $$coerce(other) { | |
var self = this; | |
return [self, other] | |
}, TMP_Unit_coerce_2.$$arity = 1); | |
Opal.def(self, '$==', TMP_Unit_$eq$eq_3 = function(other) { | |
var self = this; | |
if ($truthy($$($nesting, 'Unit')['$==='](other))) { | |
} else { | |
if ($truthy(other['$respond_to?']("to_u"))) { | |
} else { | |
self.$raise($$($nesting, 'TypeError'), "" + "no implicit conversion of " + (other.$class()) + " into Unit") | |
}; | |
other = other.$to_u(); | |
}; | |
if ($truthy($$($nesting, 'Unit')['$==='](other))) { | |
} else { | |
other = $$($nesting, 'Unit').$new(other, self.type) | |
}; | |
return self.number['$=='](self.$convert(other, self.type)); | |
}, TMP_Unit_$eq$eq_3.$$arity = 1); | |
Opal.def(self, '$===', TMP_Unit_$eq$eq$eq_4 = function(other) { | |
var $a, self = this; | |
return (($a = self.type['$=='](other.$type())) ? self.number['$=='](other.$number()) : self.type['$=='](other.$type())) | |
}, TMP_Unit_$eq$eq$eq_4.$$arity = 1); | |
Opal.alias(self, "eql?", "=="); | |
Opal.def(self, '$hash', TMP_Unit_hash_5 = function $$hash() { | |
var self = this; | |
return [self.number, self.type].$hash() | |
}, TMP_Unit_hash_5.$$arity = 0); | |
$send($$($nesting, 'TYPES'), 'each', [], (TMP_Unit_6 = function(name){var self = TMP_Unit_6.$$s || this, TMP_7; | |
if (name == null) name = nil; | |
return $send(self, 'define_method', [name], (TMP_7 = function(){var self = TMP_7.$$s || this; | |
return $$($nesting, 'Unit').$new(self.$convert(self, name), name)}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7))}, TMP_Unit_6.$$s = self, TMP_Unit_6.$$arity = 1, TMP_Unit_6)); | |
Opal.def(self, '$+', TMP_Unit_$_8 = function(other) { | |
var $a, self = this; | |
if ($truthy($$($nesting, 'Unit')['$==='](other))) { | |
} else { | |
return $$($nesting, 'Unit').$new($rb_plus(self.number, other), self.type) | |
}; | |
if (self.type['$=='](other.$type())) { | |
return $$($nesting, 'Unit').$new($rb_plus(self.number, other.$number()), self.type) | |
} else if ($truthy(($truthy($a = self['$compatible?'](self)) ? self['$compatible?'](other) : $a))) { | |
return $$($nesting, 'Unit').$new($rb_plus(self.number, self.$convert(other, self.type)), self.type) | |
} else { | |
return self.$raise($$($nesting, 'ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) | |
}; | |
}, TMP_Unit_$_8.$$arity = 1); | |
Opal.def(self, '$-', TMP_Unit_$_9 = function(other) { | |
var $a, self = this; | |
if ($truthy($$($nesting, 'Unit')['$==='](other))) { | |
} else { | |
return $$($nesting, 'Unit').$new($rb_minus(self.number, other), self.type) | |
}; | |
if (self.type['$=='](other.$type())) { | |
return $$($nesting, 'Unit').$new($rb_minus(self.number, other.$number()), self.type) | |
} else if ($truthy(($truthy($a = self['$compatible?'](self)) ? self['$compatible?'](other) : $a))) { | |
return $$($nesting, 'Unit').$new($rb_minus(self.number, self.$convert(other, self.type)), self.type) | |
} else { | |
return self.$raise($$($nesting, 'ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) | |
}; | |
}, TMP_Unit_$_9.$$arity = 1); | |
Opal.def(self, '$*', TMP_Unit_$_10 = function(other) { | |
var $a, self = this; | |
if ($truthy($$($nesting, 'Unit')['$==='](other))) { | |
} else { | |
return $$($nesting, 'Unit').$new($rb_times(self.number, other), self.type) | |
}; | |
if (self.type['$=='](other.$type())) { | |
return $$($nesting, 'Unit').$new($rb_times(self.number, other.$number()), self.type) | |
} else if ($truthy(($truthy($a = self['$compatible?'](self)) ? self['$compatible?'](other) : $a))) { | |
return $$($nesting, 'Unit').$new($rb_times(self.number, self.$convert(other, self.type)), self.type) | |
} else { | |
return self.$raise($$($nesting, 'ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) | |
}; | |
}, TMP_Unit_$_10.$$arity = 1); | |
Opal.def(self, '$/', TMP_Unit_$_11 = function(other) { | |
var $a, self = this; | |
if ($truthy($$($nesting, 'Unit')['$==='](other))) { | |
} else { | |
return $$($nesting, 'Unit').$new($rb_divide(self.number, other), self.type) | |
}; | |
if (self.type['$=='](other.$type())) { | |
return $$($nesting, 'Unit').$new($rb_divide(self.number, other.$number()), self.type) | |
} else if ($truthy(($truthy($a = self['$compatible?'](self)) ? self['$compatible?'](other) : $a))) { | |
return $$($nesting, 'Unit').$new($rb_divide(self.number, self.$convert(other, self.type)), self.type) | |
} else { | |
return self.$raise($$($nesting, 'ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) | |
}; | |
}, TMP_Unit_$_11.$$arity = 1); | |
Opal.def(self, '$-@', TMP_Unit_$$_12 = function() { | |
var self = this; | |
return $$($nesting, 'Unit').$new($rb_times(self.number, -1), self.type) | |
}, TMP_Unit_$$_12.$$arity = 0); | |
Opal.def(self, '$+@', TMP_Unit_$$_13 = function() { | |
var self = this; | |
return $$($nesting, 'Unit').$new(self.number, self.type) | |
}, TMP_Unit_$$_13.$$arity = 0); | |
Opal.def(self, '$to_i', TMP_Unit_to_i_14 = function $$to_i() { | |
var self = this; | |
return self.number.$to_i() | |
}, TMP_Unit_to_i_14.$$arity = 0); | |
Opal.def(self, '$to_f', TMP_Unit_to_f_15 = function $$to_f() { | |
var self = this; | |
return self.number.$to_f() | |
}, TMP_Unit_to_f_15.$$arity = 0); | |
Opal.def(self, '$to_u', TMP_Unit_to_u_16 = function $$to_u() { | |
var self = this; | |
return self | |
}, TMP_Unit_to_u_16.$$arity = 0); | |
Opal.def(self, '$to_s', TMP_Unit_to_s_17 = function $$to_s() { | |
var self = this; | |
return "" + (self.number) + (self.type) | |
}, TMP_Unit_to_s_17.$$arity = 0); | |
Opal.alias(self, "to_str", "to_s"); | |
Opal.alias(self, "inspect", "to_s"); | |
self.$private(); | |
Opal.def(self, '$compatible?', TMP_Unit_compatible$q_18 = function(unit) { | |
var self = this; | |
return $$($nesting, 'COMPATIBLE')['$include?'](unit.$type()) | |
}, TMP_Unit_compatible$q_18.$$arity = 1); | |
return (Opal.def(self, '$convert', TMP_Unit_convert_19 = function $$convert(unit, type) { | |
var self = this, value = nil, px = nil, $case = nil; | |
value = unit.$number(); | |
if (unit.$type()['$=='](type)) { | |
return value}; | |
px = (function() {$case = unit.$type(); | |
if ("in"['$===']($case)) {return $rb_times(value, 96)} | |
else if ("pt"['$===']($case)) {return $rb_divide($rb_times(value, 4.0), 3.0)} | |
else if ("pc"['$===']($case)) {return $rb_divide($rb_times($rb_divide(value, 12), 4.0), 3.0)} | |
else if ("mm"['$===']($case)) {return $rb_times(value, 3.77953)} | |
else if ("cm"['$===']($case)) {return $rb_times($rb_times(value, 10), 3.77953)} | |
else if ("px"['$===']($case)) {return value} | |
else { return nil }})(); | |
return (function() {$case = type; | |
if ("in"['$===']($case)) {return $rb_divide(px, 96.0)} | |
else if ("pt"['$===']($case)) {return $rb_divide($rb_divide(px, 4.0), 3.0)} | |
else if ("pc"['$===']($case)) {return $rb_divide($rb_divide($rb_times(px, 12), 4.0), 3.0)} | |
else if ("mm"['$===']($case)) {return $rb_divide(px, 3.77953)} | |
else if ("cm"['$===']($case)) {return $rb_divide($rb_divide(px, 10), 3.77953)} | |
else if ("px"['$===']($case)) {return px} | |
else { return nil }})(); | |
}, TMP_Unit_convert_19.$$arity = 2), nil) && 'convert'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Numeric(){}; | |
var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Numeric_20, TMP_Numeric_to_u_22; | |
$send($$$($$$($$$($$($nesting, 'Paggio'), 'CSS'), 'Unit'), 'TYPES'), 'each', [], (TMP_Numeric_20 = function(name){var self = TMP_Numeric_20.$$s || this, TMP_21; | |
if (name == null) name = nil; | |
return $send(self, 'define_method', [name], (TMP_21 = function(){var self = TMP_21.$$s || this; | |
return $$$($$$($$($nesting, 'Paggio'), 'CSS'), 'Unit').$new(self, name)}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21))}, TMP_Numeric_20.$$s = self, TMP_Numeric_20.$$arity = 1, TMP_Numeric_20)); | |
return (Opal.def(self, '$to_u', TMP_Numeric_to_u_22 = function $$to_u() { | |
var self = this; | |
return self | |
}, TMP_Numeric_to_u_22.$$arity = 0), nil) && 'to_u'; | |
})($nesting[0], null, $nesting); | |
$send([$$($nesting, 'Fixnum'), $$($nesting, 'Float')], 'each', [], (TMP_23 = function(klass){var self = TMP_23.$$s || this, TMP_24; | |
if (klass == null) klass = nil; | |
return $send(klass, 'class_eval', [], (TMP_24 = function(){var self = TMP_24.$$s || this, TMP_$_25; | |
Opal.alias(self, "old_percent", "%"); | |
return (Opal.def(self, '$%', TMP_$_25 = function(other) { | |
var self = this; | |
if (other == null) { | |
other = nil; | |
} | |
if ($truthy(other)) { | |
return self.$old_percent(other) | |
} else { | |
return $$$($$$($$($nesting, 'Paggio'), 'CSS'), 'Unit').$new(self, "%") | |
} | |
}, TMP_$_25.$$arity = -1), nil) && '%';}, TMP_24.$$s = self, TMP_24.$$arity = 0, TMP_24))}, TMP_23.$$s = self, TMP_23.$$arity = 1, TMP_23)); | |
(function($base, $super, $parent_nesting) { | |
function $String(){}; | |
var self = $String = $klass($base, $super, 'String', $String); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_String_to_u_26; | |
return (Opal.def(self, '$to_u', TMP_String_to_u_26 = function $$to_u() { | |
var self = this, matches = nil, value = nil, unit = nil; | |
if ($truthy((matches = self.$match(/^([\d+.]+)(.+)?$/)))) { | |
value = matches['$[]'](1).$to_f(); | |
if ($truthy((unit = matches['$[]'](2)))) { | |
return value.$__send__(unit.$downcase()) | |
} else { | |
return value | |
}; | |
} else { | |
return 0 | |
} | |
}, TMP_String_to_u_26.$$arity = 0), nil) && 'to_u' | |
})($nesting[0], null, $nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $NilClass(){}; | |
var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_NilClass_to_u_27; | |
return (Opal.def(self, '$to_u', TMP_NilClass_to_u_27 = function $$to_u() { | |
var self = this; | |
return 0 | |
}, TMP_NilClass_to_u_27.$$arity = 0), nil) && 'to_u' | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/formatter.rb": | |
/*!*************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/formatter.rb ***! | |
\*************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var stringio_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stringio.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/stringio.rb"); | |
if (typeof global.Opal.modules["stringio"] === 'undefined') { | |
if (typeof stringio_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(stringio_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/formatter"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
function $rb_times(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $truthy = Opal.truthy, $hash2 = Opal.hash2, $send = Opal.send; | |
Opal.add_stubs(['$require', '$[]=', '$to_h', '$-', '$[]', '$dup', '$deep_merge!', '$call', '$replace', '$===', '$new', '$merge', '$each', '$string', '$indent?', '$+', '$lines', '$puts', '$*', '$chomp', '$print', '$gsub', '$to_s', '$for', '$version', '$indent', '$format', '$instance_eval', '$empty?', '$map', '$escape', '$<<', '$join', '$include?', '$downcase', '$name', '$value', '$important', '$fonts', '$animations', '$steps', '$reverse', '$rules', '$media', '$selector', '$deindent']); | |
self.$require("stringio"); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Paggio_14, TMP_Paggio_17, TMP_Paggio_24, TMP_Paggio_25; | |
(function($base, $super, $parent_nesting) { | |
function $Formatter(){}; | |
var self = $Formatter = $klass($base, $super, 'Formatter', $Formatter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Formatter_to_h_1, TMP_Formatter_for_2, TMP_Formatter_options_3, TMP_Formatter_initialize_4, TMP_Formatter_format_6, TMP_Formatter_to_s_7, TMP_Formatter_indent$q_8, TMP_Formatter_indent_9, TMP_Formatter_deindent_10, TMP_Formatter_print_12, TMP_Formatter_escape_13; | |
def.options = def.io = nil; | |
Opal.defs(self, '$to_h', TMP_Formatter_to_h_1 = function $$to_h() { | |
var $a, self = this; | |
if (self.formatters == null) self.formatters = nil; | |
return (self.formatters = ($truthy($a = self.formatters) ? $a : $hash2([], {}))) | |
}, TMP_Formatter_to_h_1.$$arity = 0); | |
Opal.defs(self, '$for', TMP_Formatter_for_2 = function(klass) { | |
var self = this, $iter = TMP_Formatter_for_2.$$p, block = $iter || nil, $writer = nil; | |
if ($iter) TMP_Formatter_for_2.$$p = null; | |
if ($truthy(block)) { | |
$writer = [klass, block]; | |
$send(self.$to_h(), '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return self.$to_h()['$[]'](klass) | |
} | |
}, TMP_Formatter_for_2.$$arity = 1); | |
Opal.defs(self, '$options', TMP_Formatter_options_3 = function $$options(options) { | |
var self = this, $iter = TMP_Formatter_options_3.$$p, block = $iter || nil, old = nil, result = nil; | |
if ($iter) TMP_Formatter_options_3.$$p = null; | |
old = $$($nesting, 'OPTIONS').$dup(); | |
$$($nesting, 'Utils')['$deep_merge!']($$($nesting, 'OPTIONS'), options); | |
result = block.$call(); | |
$$($nesting, 'OPTIONS').$replace(old); | |
return result; | |
}, TMP_Formatter_options_3.$$arity = 1); | |
Opal.const_set($nesting[0], 'OPTIONS', $hash2(["indent"], {"indent": $hash2(["level", "with"], {"level": 0, "with": "\t"})})); | |
Opal.def(self, '$initialize', TMP_Formatter_initialize_4 = function $$initialize(io, options) { | |
var $a, self = this; | |
if (io == null) { | |
io = nil; | |
} | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($truthy($$($nesting, 'Hash')['$==='](io))) { | |
self.io = $$($nesting, 'StringIO').$new(); | |
self.options = io; | |
} else { | |
self.io = ($truthy($a = io) ? $a : $$($nesting, 'StringIO').$new()); | |
self.options = options; | |
}; | |
return (self.options = $$($nesting, 'OPTIONS').$merge(self.options)); | |
}, TMP_Formatter_initialize_4.$$arity = -1); | |
Opal.def(self, '$format', TMP_Formatter_format_6 = function $$format(item) { | |
var TMP_5, self = this; | |
(function(){var $brk = Opal.new_brk(); try {return $send($$($nesting, 'Formatter').$to_h(), 'each', [], (TMP_5 = function(klass, block){var self = TMP_5.$$s || this; | |
if (klass == null) klass = nil;if (block == null) block = nil; | |
if ($truthy(klass['$==='](item))) { | |
block.$call(self, item); | |
Opal.brk(nil, $brk); | |
} else { | |
return nil | |
}}, TMP_5.$$s = self, TMP_5.$$brk = $brk, TMP_5.$$arity = 2, TMP_5)) | |
} catch (err) { if (err === $brk) { return err.$v } else { throw err } }})(); | |
return self; | |
}, TMP_Formatter_format_6.$$arity = 1); | |
Opal.def(self, '$to_s', TMP_Formatter_to_s_7 = function $$to_s() { | |
var self = this; | |
return self.io.$string() | |
}, TMP_Formatter_to_s_7.$$arity = 0); | |
Opal.def(self, '$indent?', TMP_Formatter_indent$q_8 = function() { | |
var self = this, $iter = TMP_Formatter_indent$q_8.$$p, block = $iter || nil; | |
if ($iter) TMP_Formatter_indent$q_8.$$p = null; | |
try { | |
return self.options['$[]']("indent")['$[]']("level") | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return false | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_Formatter_indent$q_8.$$arity = 0); | |
Opal.def(self, '$indent', TMP_Formatter_indent_9 = function $$indent() { | |
var self = this, $iter = TMP_Formatter_indent_9.$$p, block = $iter || nil, $binary_op_recvr_tmp_1 = nil, $writer = nil, $binary_op_recvr_tmp_2 = nil, $binary_op_recvr_tmp_3 = nil; | |
if ($iter) TMP_Formatter_indent_9.$$p = null; | |
if ($truthy(self['$indent?']())) { | |
if ($truthy(block)) { | |
$binary_op_recvr_tmp_1 = self.options['$[]']("indent"); | |
$writer = ["level", $rb_plus($binary_op_recvr_tmp_1['$[]']("level"), 1)]; | |
$send($binary_op_recvr_tmp_1, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];;; | |
block.$call(); | |
$binary_op_recvr_tmp_2 = self.options['$[]']("indent"); | |
$writer = ["level", $rb_minus($binary_op_recvr_tmp_2['$[]']("level"), 1)]; | |
$send($binary_op_recvr_tmp_2, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;; | |
} else { | |
$binary_op_recvr_tmp_3 = self.options['$[]']("indent"); | |
$writer = ["level", $rb_plus($binary_op_recvr_tmp_3['$[]']("level"), 1)]; | |
$send($binary_op_recvr_tmp_3, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];; | |
} | |
} else if ($truthy(block)) { | |
return block.$call() | |
} else { | |
return nil | |
} | |
}, TMP_Formatter_indent_9.$$arity = 0); | |
Opal.def(self, '$deindent', TMP_Formatter_deindent_10 = function $$deindent() { | |
var self = this, $binary_op_recvr_tmp_4 = nil, $writer = nil; | |
if ($truthy(self['$indent?']())) { | |
$binary_op_recvr_tmp_4 = self.options['$[]']("indent"); | |
$writer = ["level", $rb_minus($binary_op_recvr_tmp_4['$[]']("level"), 1)]; | |
$send($binary_op_recvr_tmp_4, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];; | |
} else { | |
return nil | |
} | |
}, TMP_Formatter_deindent_10.$$arity = 0); | |
Opal.def(self, '$print', TMP_Formatter_print_12 = function $$print(text) { | |
var TMP_11, self = this, level = nil; | |
if ($truthy((level = self['$indent?']()))) { | |
return $send(text.$lines(), 'each', [], (TMP_11 = function(line){var self = TMP_11.$$s || this; | |
if (self.io == null) self.io = nil; | |
if (self.options == null) self.options = nil; | |
if (line == null) line = nil; | |
return self.io.$puts("" + ($rb_times(self.options['$[]']("indent")['$[]']("with"), level)) + (line.$chomp()))}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11)) | |
} else { | |
return self.io.$print(text) | |
} | |
}, TMP_Formatter_print_12.$$arity = 1); | |
return (Opal.def(self, '$escape', TMP_Formatter_escape_13 = function $$escape(string) { | |
var self = this; | |
return string.$to_s().$gsub(/["><']|&(?!([a-zA-Z]+|(#\d+));)/, $hash2(["&", ">", "<", "\"", "'"], {"&": "&", ">": ">", "<": "<", "\"": """, "'": "'"})) | |
}, TMP_Formatter_escape_13.$$arity = 1), nil) && 'escape'; | |
})($nesting[0], null, $nesting); | |
$send($$($nesting, 'Formatter'), 'for', [$$($nesting, 'HTML')], (TMP_Paggio_14 = function(f, item){var self = TMP_Paggio_14.$$s || this, TMP_15, $case = nil; | |
if (f == null) f = nil;if (item == null) item = nil; | |
$case = item.$version(); | |
if ((5)['$===']($case)) {f.$print("<!DOCTYPE html>")}; | |
f.$print("<html>"); | |
$send(f, 'indent', [], (TMP_15 = function(){var self = TMP_15.$$s || this, TMP_16; | |
return $send(item, 'each', [], (TMP_16 = function(root){var self = TMP_16.$$s || this; | |
if (root == null) root = nil; | |
return f.$format(root)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16))}, TMP_15.$$s = self, TMP_15.$$arity = 0, TMP_15)); | |
return f.$print("</html>");}, TMP_Paggio_14.$$s = self, TMP_Paggio_14.$$arity = 2, TMP_Paggio_14)); | |
$send($$($nesting, 'Formatter'), 'for', [$$$($$($nesting, 'HTML'), 'Element')], (TMP_Paggio_17 = function(f, item){var self = TMP_Paggio_17.$$s || this, $a, $b, TMP_18, TMP_19, TMP_20, name = nil, attributes = nil, class_names = nil, attrs = nil; | |
if (f == null) f = nil;if (item == null) item = nil; | |
$b = $send(item, 'instance_eval', [], (TMP_18 = function(){var self = TMP_18.$$s || this; | |
if (self.name == null) self.name = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (self.class_names == null) self.class_names = nil; | |
return [self.name, self.attributes, self.class_names]}, TMP_18.$$s = self, TMP_18.$$arity = 0, TMP_18)), $a = Opal.to_ary($b), (name = ($a[0] == null ? nil : $a[0])), (attributes = ($a[1] == null ? nil : $a[1])), (class_names = ($a[2] == null ? nil : $a[2])), $b; | |
if ($truthy(($truthy($a = attributes['$empty?']()) ? class_names['$empty?']() : $a))) { | |
f.$print("" + "<" + (name) + ">") | |
} else { | |
attrs = $send(attributes, 'map', [], (TMP_19 = function(key, value){var self = TMP_19.$$s || this; | |
if (key == null) key = nil;if (value == null) value = nil; | |
return "" + (f.$escape(key)) + "=\"" + (f.$escape(value)) + "\""}, TMP_19.$$s = self, TMP_19.$$arity = 2, TMP_19)); | |
if ($truthy(class_names['$empty?']())) { | |
} else { | |
attrs['$<<']("" + "class=\"" + (f.$escape(class_names.$join(" "))) + "\"") | |
}; | |
f.$print("" + "<" + (name) + " " + (attrs.$join(" ")) + ">"); | |
}; | |
if ($truthy(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"]['$include?'](name.$to_s().$downcase()))) { | |
return nil;}; | |
$send(f, 'indent', [], (TMP_20 = function(){var self = TMP_20.$$s || this, TMP_21, TMP_22, inner = nil; | |
if ($truthy((inner = $send(item, 'instance_eval', [], (TMP_21 = function(){var self = TMP_21.$$s || this; | |
if (self.inner_html == null) self.inner_html = nil; | |
return self.inner_html}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21))))) { | |
return f.$print(inner) | |
} else { | |
return $send(item, 'each', [], (TMP_22 = function(child){var self = TMP_22.$$s || this, TMP_23, $case = nil; | |
if (child == null) child = nil; | |
return (function() {$case = child; | |
if ($$($nesting, 'String')['$===']($case)) {return f.$print(f.$escape(child))} | |
else if ($$($nesting, 'CSS')['$===']($case)) { | |
f.$print("<style>"); | |
$send(f, 'indent', [], (TMP_23 = function(){var self = TMP_23.$$s || this; | |
return f.$format(child)}, TMP_23.$$s = self, TMP_23.$$arity = 0, TMP_23)); | |
return f.$print("</style>");} | |
else {return f.$format(child)}})()}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22)) | |
}}, TMP_20.$$s = self, TMP_20.$$arity = 0, TMP_20)); | |
return f.$print("" + "</" + (name) + ">");}, TMP_Paggio_17.$$s = self, TMP_Paggio_17.$$arity = 2, TMP_Paggio_17)); | |
$send($$($nesting, 'Formatter'), 'for', [$$$($$$($$($nesting, 'CSS'), 'Definition'), 'Style')], (TMP_Paggio_24 = function(f, style){var self = TMP_Paggio_24.$$s || this; | |
if (f == null) f = nil;if (style == null) style = nil; | |
return f.$print("" + (style.$name()) + ": " + (style.$value()) + ((function() {if ($truthy(style.$important())) { | |
return " !important" | |
} else { | |
return nil | |
}; return nil; })()) + ";")}, TMP_Paggio_24.$$s = self, TMP_Paggio_24.$$arity = 2, TMP_Paggio_24)); | |
return $send($$($nesting, 'Formatter'), 'for', [$$($nesting, 'CSS')], (TMP_Paggio_25 = function(f, item){var self = TMP_Paggio_25.$$s || this, TMP_26, TMP_29, TMP_33; | |
if (f == null) f = nil;if (item == null) item = nil; | |
$send(item.$fonts(), 'each', [], (TMP_26 = function(font){var self = TMP_26.$$s || this, TMP_27; | |
if (font == null) font = nil; | |
f.$print("@font-face {"); | |
$send(f, 'indent', [], (TMP_27 = function(){var self = TMP_27.$$s || this, TMP_28; | |
return $send(font, 'each', [], (TMP_28 = function(style){var self = TMP_28.$$s || this; | |
if (style == null) style = nil; | |
return f.$format(style)}, TMP_28.$$s = self, TMP_28.$$arity = 1, TMP_28))}, TMP_27.$$s = self, TMP_27.$$arity = 0, TMP_27)); | |
return f.$print("}");}, TMP_26.$$s = self, TMP_26.$$arity = 1, TMP_26)); | |
$send(item.$animations(), 'each', [], (TMP_29 = function(animation){var self = TMP_29.$$s || this, TMP_30; | |
if (animation == null) animation = nil; | |
return $send(["", "-webkit-", "-moz-", "-o-"], 'each', [], (TMP_30 = function(platform){var self = TMP_30.$$s || this, TMP_31; | |
if (platform == null) platform = nil; | |
f.$print("" + "@" + (platform) + "keyframes " + (animation.$name()) + " {"); | |
$send(animation.$steps(), 'each', [], (TMP_31 = function(step){var self = TMP_31.$$s || this, TMP_32; | |
if (step == null) step = nil; | |
f.$print("" + (step.$value()) + " {"); | |
$send(step, 'each', [], (TMP_32 = function(style){var self = TMP_32.$$s || this; | |
if (style == null) style = nil; | |
return f.$format(style)}, TMP_32.$$s = self, TMP_32.$$arity = 1, TMP_32)); | |
return f.$print("}");}, TMP_31.$$s = self, TMP_31.$$arity = 1, TMP_31)); | |
return f.$print("}");}, TMP_30.$$s = self, TMP_30.$$arity = 1, TMP_30))}, TMP_29.$$s = self, TMP_29.$$arity = 1, TMP_29)); | |
return $send(item.$rules().$reverse(), 'each', [], (TMP_33 = function(rule){var self = TMP_33.$$s || this, TMP_34, m = nil; | |
if (rule == null) rule = nil; | |
if ($truthy(rule['$empty?']())) { | |
return nil;}; | |
if ($truthy((m = rule.$media()))) { | |
f.$print("" + "@media " + (m) + " {"); | |
f.$indent();}; | |
f.$print("" + (rule.$selector()) + " {"); | |
$send(f, 'indent', [], (TMP_34 = function(){var self = TMP_34.$$s || this, TMP_35; | |
return $send(rule, 'each', [], (TMP_35 = function(style){var self = TMP_35.$$s || this; | |
if (style == null) style = nil; | |
return f.$format(style)}, TMP_35.$$s = self, TMP_35.$$arity = 1, TMP_35))}, TMP_34.$$s = self, TMP_34.$$arity = 0, TMP_34)); | |
f.$print("}"); | |
if ($truthy(rule.$media())) { | |
f.$print("}"); | |
return f.$deindent(); | |
} else { | |
return nil | |
};}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33));}, TMP_Paggio_25.$$s = self, TMP_Paggio_25.$$arity = 2, TMP_Paggio_25)); | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html.rb": | |
/*!********************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html.rb ***! | |
\********************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var paggio_html_helpers_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! paggio/html/helpers.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/helpers.rb"); | |
/* harmony import */ var paggio_html_element_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! paggio/html/element.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element.rb"); | |
if (typeof global.Opal.modules["paggio/html/helpers"] === 'undefined') { | |
if (typeof paggio_html_helpers_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(paggio_html_helpers_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element"] === 'undefined') { | |
if (typeof paggio_html_element_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(paggio_html_element_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send, $range = Opal.range; | |
Opal.add_stubs(['$require', '$attr_reader', '$raise', '$==', '$arity', '$instance_exec', '$to_proc', '$call', '$<<', '$first', '$===', '$instance_eval', '$each', '$end_with?', '$to_s', '$empty?', '$heredoc', '$shift', '$new', '$[]', '$inspect']); | |
self.$require("paggio/html/helpers"); | |
self.$require("paggio/html/element"); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_HTML_initialize_1, TMP_HTML_$lt$lt_2, TMP_HTML_root$B_3, TMP_HTML_roots$B_4, TMP_HTML_element$B_5, TMP_HTML_extend$B_6, TMP_HTML_each_8, TMP_HTML_method_missing_9, TMP_HTML_inspect_11; | |
def.current = def.roots = def.version = nil; | |
self.$attr_reader("version"); | |
Opal.def(self, '$initialize', TMP_HTML_initialize_1 = function $$initialize(version) { | |
var self = this, $iter = TMP_HTML_initialize_1.$$p, block = $iter || nil; | |
if (version == null) { | |
version = 5; | |
} | |
if ($iter) TMP_HTML_initialize_1.$$p = null; | |
if ($truthy(block)) { | |
} else { | |
$$$('::', 'Kernel').$raise($$$('::', 'ArgumentError'), "no block given") | |
}; | |
self.version = version; | |
self.roots = []; | |
self.current = nil; | |
if (block.$arity()['$=='](0)) { | |
return $send(self, 'instance_exec', [], block.$to_proc()) | |
} else { | |
return block.$call(self) | |
}; | |
}, TMP_HTML_initialize_1.$$arity = -1); | |
Opal.def(self, '$<<', TMP_HTML_$lt$lt_2 = function(what) { | |
var $a, self = this; | |
return ($truthy($a = self.current) ? $a : self.roots)['$<<'](what) | |
}, TMP_HTML_$lt$lt_2.$$arity = 1); | |
Opal.def(self, '$root!', TMP_HTML_root$B_3 = function() { | |
var self = this; | |
return self.roots.$first() | |
}, TMP_HTML_root$B_3.$$arity = 0); | |
Opal.def(self, '$roots!', TMP_HTML_roots$B_4 = function() { | |
var self = this; | |
return self.roots | |
}, TMP_HTML_roots$B_4.$$arity = 0); | |
Opal.def(self, '$element!', TMP_HTML_element$B_5 = function() { | |
var self = this; | |
return self.current | |
}, TMP_HTML_element$B_5.$$arity = 0); | |
Opal.def(self, '$extend!', TMP_HTML_extend$B_6 = function(element) { | |
var $a, TMP_7, self = this, $iter = TMP_HTML_extend$B_6.$$p, block = $iter || nil, old = nil, result = nil; | |
if (element == null) { | |
element = nil; | |
} | |
if ($iter) TMP_HTML_extend$B_6.$$p = null; | |
$a = [self.current, element], (old = $a[0]), (self.current = $a[1]), $a; | |
result = block.$call(self); | |
if ($truthy($$$('::', 'String')['$==='](result))) { | |
$send(self.current, 'instance_eval', [], (TMP_7 = function(){var self = TMP_7.$$s || this; | |
return (self.inner_html = result)}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7))}; | |
self.current = old; | |
return self; | |
}, TMP_HTML_extend$B_6.$$arity = -1); | |
Opal.def(self, '$each', TMP_HTML_each_8 = function $$each() { | |
var self = this, $iter = TMP_HTML_each_8.$$p, block = $iter || nil; | |
if ($iter) TMP_HTML_each_8.$$p = null; | |
return $send(self.roots, 'each', [], block.$to_proc()) | |
}, TMP_HTML_each_8.$$arity = 0); | |
Opal.def(self, '$method_missing', TMP_HTML_method_missing_9 = function $$method_missing(name, $a_rest) { | |
var $b, TMP_10, self = this, args, $iter = TMP_HTML_method_missing_9.$$p, block = $iter || nil, content = nil, element = nil, parent = nil, result = nil, $zuper = nil, $zuper_i = nil, $zuper_ii = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_HTML_method_missing_9.$$p = null; | |
// Prepare super implicit arguments | |
for($zuper_i = 0, $zuper_ii = arguments.length, $zuper = new Array($zuper_ii); $zuper_i < $zuper_ii; $zuper_i++) { | |
$zuper[$zuper_i] = arguments[$zuper_i]; | |
} | |
if ($truthy(name.$to_s()['$end_with?']("!"))) { | |
return $send(self, Opal.find_super_dispatcher(self, 'method_missing', TMP_HTML_method_missing_9, false), $zuper, $iter)}; | |
if ($truthy(($truthy($b = args['$empty?']()) ? $b : $$$('::', 'Hash')['$==='](args.$first())))) { | |
} else { | |
content = $$$($$$('::', 'Paggio'), 'Utils').$heredoc(args.$shift().$to_s()) | |
}; | |
element = $send($$($nesting, 'Element'), 'new', [self, name].concat(Opal.to_a(args))); | |
if ($truthy(content)) { | |
element['$<<'](content)}; | |
if ($truthy(block)) { | |
parent = self.current; | |
self.current = element; | |
result = block.$call(self); | |
self.current = parent; | |
if ($truthy($$$('::', 'String')['$==='](result))) { | |
$send(element, 'instance_eval', [], (TMP_10 = function(){var self = TMP_10.$$s || this; | |
return (self.inner_html = result)}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10))};}; | |
self['$<<'](element); | |
return element; | |
}, TMP_HTML_method_missing_9.$$arity = -2); | |
return (Opal.def(self, '$inspect', TMP_HTML_inspect_11 = function $$inspect() { | |
var self = this; | |
if ($truthy(self.roots['$empty?']())) { | |
return "" + "#<HTML(" + (self.version) + ")>" | |
} else { | |
return "" + "#<HTML(" + (self.version) + "): " + (self.roots.$inspect()['$[]']($range(1, -2, false))) + ">" | |
} | |
}, TMP_HTML_inspect_11.$$arity = 0), nil) && 'inspect'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element.rb": | |
/*!****************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element.rb ***! | |
\****************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var paggio_html_element_a_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! paggio/html/element/a.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/a.rb"); | |
/* harmony import */ var paggio_html_element_base_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! paggio/html/element/base.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/base.rb"); | |
/* harmony import */ var paggio_html_element_blockquote_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! paggio/html/element/blockquote.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/blockquote.rb"); | |
/* harmony import */ var paggio_html_element_button_rb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! paggio/html/element/button.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/button.rb"); | |
/* harmony import */ var paggio_html_element_canvas_rb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! paggio/html/element/canvas.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/canvas.rb"); | |
/* harmony import */ var paggio_html_element_embed_rb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! paggio/html/element/embed.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/embed.rb"); | |
/* harmony import */ var paggio_html_element_img_rb__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! paggio/html/element/img.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/img.rb"); | |
/* harmony import */ var paggio_html_element_input_rb__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! paggio/html/element/input.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/input.rb"); | |
/* harmony import */ var paggio_html_element_link_rb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! paggio/html/element/link.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/link.rb"); | |
/* harmony import */ var paggio_html_element_object_rb__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! paggio/html/element/object.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/object.rb"); | |
/* harmony import */ var paggio_html_element_option_rb__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! paggio/html/element/option.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/option.rb"); | |
/* harmony import */ var paggio_html_element_optgroup_rb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! paggio/html/element/optgroup.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/optgroup.rb"); | |
/* harmony import */ var paggio_html_element_select_rb__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! paggio/html/element/select.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/select.rb"); | |
/* harmony import */ var paggio_html_element_td_rb__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! paggio/html/element/td.rb */ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/td.rb"); | |
if (typeof global.Opal.modules["paggio/html/element/a"] === 'undefined') { | |
if (typeof paggio_html_element_a_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(paggio_html_element_a_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/base"] === 'undefined') { | |
if (typeof paggio_html_element_base_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(paggio_html_element_base_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/blockquote"] === 'undefined') { | |
if (typeof paggio_html_element_blockquote_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(paggio_html_element_blockquote_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/button"] === 'undefined') { | |
if (typeof paggio_html_element_button_rb__WEBPACK_IMPORTED_MODULE_3__["default"] === 'function') { Object(paggio_html_element_button_rb__WEBPACK_IMPORTED_MODULE_3__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/canvas"] === 'undefined') { | |
if (typeof paggio_html_element_canvas_rb__WEBPACK_IMPORTED_MODULE_4__["default"] === 'function') { Object(paggio_html_element_canvas_rb__WEBPACK_IMPORTED_MODULE_4__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/embed"] === 'undefined') { | |
if (typeof paggio_html_element_embed_rb__WEBPACK_IMPORTED_MODULE_5__["default"] === 'function') { Object(paggio_html_element_embed_rb__WEBPACK_IMPORTED_MODULE_5__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/img"] === 'undefined') { | |
if (typeof paggio_html_element_img_rb__WEBPACK_IMPORTED_MODULE_6__["default"] === 'function') { Object(paggio_html_element_img_rb__WEBPACK_IMPORTED_MODULE_6__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/input"] === 'undefined') { | |
if (typeof paggio_html_element_input_rb__WEBPACK_IMPORTED_MODULE_7__["default"] === 'function') { Object(paggio_html_element_input_rb__WEBPACK_IMPORTED_MODULE_7__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/link"] === 'undefined') { | |
if (typeof paggio_html_element_link_rb__WEBPACK_IMPORTED_MODULE_8__["default"] === 'function') { Object(paggio_html_element_link_rb__WEBPACK_IMPORTED_MODULE_8__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/object"] === 'undefined') { | |
if (typeof paggio_html_element_object_rb__WEBPACK_IMPORTED_MODULE_9__["default"] === 'function') { Object(paggio_html_element_object_rb__WEBPACK_IMPORTED_MODULE_9__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/option"] === 'undefined') { | |
if (typeof paggio_html_element_option_rb__WEBPACK_IMPORTED_MODULE_10__["default"] === 'function') { Object(paggio_html_element_option_rb__WEBPACK_IMPORTED_MODULE_10__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/optgroup"] === 'undefined') { | |
if (typeof paggio_html_element_optgroup_rb__WEBPACK_IMPORTED_MODULE_11__["default"] === 'function') { Object(paggio_html_element_optgroup_rb__WEBPACK_IMPORTED_MODULE_11__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/select"] === 'undefined') { | |
if (typeof paggio_html_element_select_rb__WEBPACK_IMPORTED_MODULE_12__["default"] === 'function') { Object(paggio_html_element_select_rb__WEBPACK_IMPORTED_MODULE_12__["default"])(); } | |
} | |
if (typeof global.Opal.modules["paggio/html/element/td"] === 'undefined') { | |
if (typeof paggio_html_element_td_rb__WEBPACK_IMPORTED_MODULE_13__["default"] === 'function') { Object(paggio_html_element_td_rb__WEBPACK_IMPORTED_MODULE_13__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2, $range = Opal.range; | |
Opal.add_stubs(['$require', '$==', '$capitalize', '$const_defined?', '$new', '$const_get', '$each', '$to_proc', '$<<', '$end_with?', '$to_s', '$[]', '$[]=', '$-', '$===', '$has_key?', '$unshift', '$|', '$split', '$delete', '$to_a', '$deep_merge!', '$>>', '$extend!', '$pop', '$join', '$heredoc', '$defhelper', '$map', '$empty?', '$upcase', '$inspect']); | |
self.$require("paggio/html/element/a"); | |
self.$require("paggio/html/element/base"); | |
self.$require("paggio/html/element/blockquote"); | |
self.$require("paggio/html/element/button"); | |
self.$require("paggio/html/element/canvas"); | |
self.$require("paggio/html/element/embed"); | |
self.$require("paggio/html/element/img"); | |
self.$require("paggio/html/element/input"); | |
self.$require("paggio/html/element/link"); | |
self.$require("paggio/html/element/object"); | |
self.$require("paggio/html/element/option"); | |
self.$require("paggio/html/element/optgroup"); | |
self.$require("paggio/html/element/select"); | |
self.$require("paggio/html/element/td"); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Element_new_1, TMP_Element_initialize_2, TMP_Element_each_3, TMP_Element_$lt$lt_4, TMP_Element_method_missing_5, TMP_Element_$$_6, TMP_Element_do_7, TMP_Element_$gt$gt_8, TMP_Element_9, TMP_Element_11, TMP_Element_inspect_13; | |
def.children = def.attributes = def.class_names = def.owner = def.name = nil; | |
Opal.defs(self, '$new', TMP_Element_new_1 = function(owner, name, attributes) { | |
var self = this, $iter = TMP_Element_new_1.$$p, $yield = $iter || nil, const$ = nil, $zuper = nil, $zuper_i = nil, $zuper_ii = nil; | |
if (attributes == null) { | |
attributes = $hash2([], {}); | |
} | |
if ($iter) TMP_Element_new_1.$$p = null; | |
// Prepare super implicit arguments | |
for($zuper_i = 0, $zuper_ii = arguments.length, $zuper = new Array($zuper_ii); $zuper_i < $zuper_ii; $zuper_i++) { | |
$zuper[$zuper_i] = arguments[$zuper_i]; | |
} | |
if (self['$==']($$($nesting, 'Element'))) { | |
} else { | |
return $send(self, Opal.find_super_dispatcher(self, 'new', TMP_Element_new_1, false, $Element), $zuper, $iter) | |
}; | |
const$ = name.$capitalize(); | |
if ($truthy(self['$const_defined?'](const$))) { | |
return self.$const_get(const$).$new(owner, name, attributes) | |
} else { | |
return $send(self, Opal.find_super_dispatcher(self, 'new', TMP_Element_new_1, false, $Element), $zuper, $iter) | |
}; | |
}, TMP_Element_new_1.$$arity = -3); | |
Opal.def(self, '$initialize', TMP_Element_initialize_2 = function $$initialize(owner, name, attributes) { | |
var self = this; | |
if (attributes == null) { | |
attributes = $hash2([], {}); | |
} | |
self.owner = owner; | |
self.name = name; | |
self.attributes = attributes; | |
self.children = []; | |
return (self.class_names = []); | |
}, TMP_Element_initialize_2.$$arity = -3); | |
Opal.def(self, '$each', TMP_Element_each_3 = function $$each() { | |
var self = this, $iter = TMP_Element_each_3.$$p, block = $iter || nil; | |
if ($iter) TMP_Element_each_3.$$p = null; | |
return $send(self.children, 'each', [], block.$to_proc()) | |
}, TMP_Element_each_3.$$arity = 0); | |
Opal.def(self, '$<<', TMP_Element_$lt$lt_4 = function(what) { | |
var self = this; | |
self.children['$<<'](what); | |
return self; | |
}, TMP_Element_$lt$lt_4.$$arity = 1); | |
Opal.def(self, '$method_missing', TMP_Element_method_missing_5 = function $$method_missing(name, content) { | |
var $a, self = this, $iter = TMP_Element_method_missing_5.$$p, block = $iter || nil, $writer = nil; | |
if (content == null) { | |
content = nil; | |
} | |
if ($iter) TMP_Element_method_missing_5.$$p = null; | |
if ($truthy(name.$to_s()['$end_with?']("!"))) { | |
$writer = ["id", name['$[]']($range(0, -2, false))]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
self.class_names['$<<'](name) | |
}; | |
if ($truthy($$$('::', 'Hash')['$==='](content))) { | |
if ($truthy(($truthy($a = content['$has_key?']("class")) ? $a : content['$has_key?']("classes")))) { | |
$send(self.class_names, 'unshift', Opal.to_a(content.$delete("class").$to_s().$split()['$|'](content.$delete("classes").$to_a())))}; | |
$$$($$$('::', 'Paggio'), 'Utils')['$deep_merge!'](self.attributes, content); | |
} else if ($truthy(content)) { | |
self['$>>'](content)}; | |
if ($truthy(block)) { | |
$send(self.owner, 'extend!', [self], block.$to_proc())}; | |
return self; | |
}, TMP_Element_method_missing_5.$$arity = -2); | |
Opal.def(self, '$[]', TMP_Element_$$_6 = function($a_rest) { | |
var self = this, names, last = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
names = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
names[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($truthy((last = self.class_names.$pop()))) { | |
self.class_names['$<<']([last].concat(Opal.to_a(names)).$join("-"))}; | |
return self; | |
}, TMP_Element_$$_6.$$arity = -1); | |
Opal.def(self, '$do', TMP_Element_do_7 = function() { | |
var self = this, $iter = TMP_Element_do_7.$$p, block = $iter || nil; | |
if ($iter) TMP_Element_do_7.$$p = null; | |
$send(self.owner, 'extend!', [self], block.$to_proc()); | |
return self; | |
}, TMP_Element_do_7.$$arity = 0); | |
Opal.def(self, '$>>', TMP_Element_$gt$gt_8 = function(content) { | |
var self = this; | |
self['$<<']($$$($$$('::', 'Paggio'), 'Utils').$heredoc(content.$to_s())); | |
return self; | |
}, TMP_Element_$gt$gt_8.$$arity = 1); | |
$send(self, 'defhelper', ["style"], (TMP_Element_9 = function(hash){var self = TMP_Element_9.$$s || this, TMP_10, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (hash == null) hash = nil; | |
$writer = ["style", $send(hash, 'map', [], (TMP_10 = function(name, value){var self = TMP_10.$$s || this; | |
if (name == null) name = nil;if (value == null) value = nil; | |
return "" + (name) + ": " + (value)}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10)).$join(";")]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_Element_9.$$s = self, TMP_Element_9.$$arity = 1, TMP_Element_9)); | |
$send(self, 'defhelper', ["data"], (TMP_Element_11 = function(hash){var self = TMP_Element_11.$$s || this, TMP_12; | |
if (hash == null) hash = nil; | |
return $send(hash, 'each', [], (TMP_12 = function(name, value){var self = TMP_12.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (name == null) name = nil;if (value == null) value = nil; | |
$writer = ["" + "data-" + (name), value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12))}, TMP_Element_11.$$s = self, TMP_Element_11.$$arity = 1, TMP_Element_11)); | |
return (Opal.def(self, '$inspect', TMP_Element_inspect_13 = function $$inspect() { | |
var self = this; | |
if ($truthy(self.children['$empty?']())) { | |
return "" + "#<HTML::Element(" + (self.name.$upcase()) + ")>" | |
} else { | |
return "" + "#<HTML::Element(" + (self.name.$upcase()) + "): " + (self.children.$inspect()['$[]']($range(1, -2, false))) + ">" | |
} | |
}, TMP_Element_inspect_13.$$arity = 0), nil) && 'inspect'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/a.rb": | |
/*!******************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/a.rb ***! | |
\******************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/a"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$to_s', '$[]=', '$-', '$defhelper!', '$<<']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $A(){}; | |
var self = $A = $klass($base, $super, 'A', $A); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_A_1, TMP_A_3; | |
$send($hash2(["href", "url", "rel", "relative", "target", "type", "lang", "language", "media"], {"href": "href", "url": "href", "rel": "rel", "relative": "rel", "target": "target", "type": "type", "lang": "hreflang", "language": "hreflang", "media": "media"}), 'each', [], (TMP_A_1 = function(name, attribute){var self = TMP_A_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_A_1.$$s = self, TMP_A_1.$$arity = 2, TMP_A_1)); | |
self['$defhelper!']("download"); | |
self['$defhelper!']("ping"); | |
return $send(self, 'defhelper', ["text"], (TMP_A_3 = function(string){var self = TMP_A_3.$$s || this; | |
if (string == null) string = nil; | |
return self['$<<'](string)}, TMP_A_3.$$s = self, TMP_A_3.$$arity = 1, TMP_A_3)); | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/base.rb": | |
/*!*********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/base.rb ***! | |
\*********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/base"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$to_s', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_1; | |
return $send($hash2(["href", "url", "target"], {"href": "href", "url": "href", "target": "target"}), 'each', [], (TMP_Base_1 = function(name, attribute){var self = TMP_Base_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Base_1.$$s = self, TMP_Base_1.$$arity = 2, TMP_Base_1)) | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/blockquote.rb": | |
/*!***************************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/blockquote.rb ***! | |
\***************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/blockquote"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$defhelper', '$to_s', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Blockquote(){}; | |
var self = $Blockquote = $klass($base, $super, 'Blockquote', $Blockquote); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Blockquote_1; | |
return $send(self, 'defhelper', ["cite"], (TMP_Blockquote_1 = function(value){var self = TMP_Blockquote_1.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = ["cite", value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_Blockquote_1.$$s = self, TMP_Blockquote_1.$$arity = 1, TMP_Blockquote_1)) | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/button.rb": | |
/*!***********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/button.rb ***! | |
\***********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/button"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$to_s', '$[]=', '$-', '$defhelper!']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Button(){}; | |
var self = $Button = $klass($base, $super, 'Button', $Button); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Button_1; | |
$send($hash2(["form", "name", "type", "value", "action", "encoding", "method", "target"], {"form": "form", "name": "name", "type": "type", "value": "value", "action": "formaction", "encoding": "formenctype", "method": "formmethod", "target": "formtarget"}), 'each', [], (TMP_Button_1 = function(name, attributes){var self = TMP_Button_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attributes == null) attributes = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Button_1.$$s = self, TMP_Button_1.$$arity = 2, TMP_Button_1)); | |
self['$defhelper!']("autofocus"); | |
return self['$defhelper!']("disabled"); | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/canvas.rb": | |
/*!***********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/canvas.rb ***! | |
\***********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/canvas"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$to_s', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Canvas(){}; | |
var self = $Canvas = $klass($base, $super, 'Canvas', $Canvas); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Canvas_1; | |
return $send($hash2(["width", "height"], {"width": "width", "height": "height"}), 'each', [], (TMP_Canvas_1 = function(name, attribute){var self = TMP_Canvas_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Canvas_1.$$s = self, TMP_Canvas_1.$$arity = 2, TMP_Canvas_1)) | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/embed.rb": | |
/*!**********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/embed.rb ***! | |
\**********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/embed"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Embed(){}; | |
var self = $Embed = $klass($base, $super, 'Embed', $Embed); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Embed_1; | |
return $send($hash2(["type", "height", "width"], {"type": "type", "height": "height", "width": "width"}), 'each', [], (TMP_Embed_1 = function(name, attribute){var self = TMP_Embed_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Embed_1.$$s = self, TMP_Embed_1.$$arity = 2, TMP_Embed_1)) | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/img.rb": | |
/*!********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/img.rb ***! | |
\********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/img"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$to_s', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Img(){}; | |
var self = $Img = $klass($base, $super, 'Img', $Img); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Img_1, TMP_Img_3; | |
$send($hash2(["src", "url", "alt", "description", "height", "width", "map"], {"src": "src", "url": "src", "alt": "alt", "description": "alt", "height": "height", "width": "width", "map": "usemap"}), 'each', [], (TMP_Img_1 = function(name, attribute){var self = TMP_Img_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Img_1.$$s = self, TMP_Img_1.$$arity = 2, TMP_Img_1)); | |
return $send(self, 'defhelper', ["map!"], (TMP_Img_3 = function(){var self = TMP_Img_3.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
$writer = ["ismap", true]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_Img_3.$$s = self, TMP_Img_3.$$arity = 0, TMP_Img_3)); | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/input.rb": | |
/*!**********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/input.rb ***! | |
\**********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/input"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Input(){}; | |
var self = $Input = $klass($base, $super, 'Input', $Input); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Input_1; | |
return $send($hash2(["type", "name", "value", "size", "place_holder", "read_only", "required", "limit"], {"type": "type", "name": "name", "value": "value", "size": "size", "place_holder": "placeholder", "read_only": "readonly", "required": "required", "limit": "maxlength"}), 'each', [], (TMP_Input_1 = function(name, attribute){var self = TMP_Input_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Input_1.$$s = self, TMP_Input_1.$$arity = 2, TMP_Input_1)) | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/link.rb": | |
/*!*********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/link.rb ***! | |
\*********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/link"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$to_s', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Link(){}; | |
var self = $Link = $klass($base, $super, 'Link', $Link); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Link_1; | |
return $send($hash2(["cross_origin", "href", "href_lang", "media", "rel", "sizes", "type"], {"cross_origin": "crossorigin", "href": "href", "href_lang": "hreflang", "media": "media", "rel": "rel", "sizes": "sizes", "type": "type"}), 'each', [], (TMP_Link_1 = function(name, attribute){var self = TMP_Link_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Link_1.$$s = self, TMP_Link_1.$$arity = 2, TMP_Link_1)) | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/object.rb": | |
/*!***********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/object.rb ***! | |
\***********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/object"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$each', '$defhelper', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Object(){}; | |
var self = $Object = $klass($base, $super, 'Object', $Object); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Object_1; | |
return $send($hash2(["type", "data", "name", "height", "width"], {"type": "type", "data": "data", "name": "name", "height": "height", "width": "width"}), 'each', [], (TMP_Object_1 = function(name, attribute){var self = TMP_Object_1.$$s || this, TMP_2; | |
if (name == null) name = nil;if (attribute == null) attribute = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Object_1.$$s = self, TMP_Object_1.$$arity = 2, TMP_Object_1)) | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/optgroup.rb": | |
/*!*************************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/optgroup.rb ***! | |
\*************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/optgroup"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$each', '$defhelper', '$[]=', '$-', '$defhelper!']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Optgroup(){}; | |
var self = $Optgroup = $klass($base, $super, 'Optgroup', $Optgroup); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Optgroup_1; | |
$send(["label", "value"], 'each', [], (TMP_Optgroup_1 = function(name){var self = TMP_Optgroup_1.$$s || this, TMP_2; | |
if (name == null) name = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Optgroup_1.$$s = self, TMP_Optgroup_1.$$arity = 1, TMP_Optgroup_1)); | |
self['$defhelper!']("disabled"); | |
return self['$defhelper!']("selected"); | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/option.rb": | |
/*!***********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/option.rb ***! | |
\***********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/option"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$each', '$defhelper', '$[]=', '$-', '$defhelper!']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Option(){}; | |
var self = $Option = $klass($base, $super, 'Option', $Option); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Option_1; | |
$send(["label", "value"], 'each', [], (TMP_Option_1 = function(name){var self = TMP_Option_1.$$s || this, TMP_2; | |
if (name == null) name = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Option_1.$$s = self, TMP_Option_1.$$arity = 1, TMP_Option_1)); | |
self['$defhelper!']("disabled"); | |
return self['$defhelper!']("selected"); | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/select.rb": | |
/*!***********************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/select.rb ***! | |
\***********************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/select"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$each', '$defhelper', '$[]=', '$-', '$defhelper!']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Select(){}; | |
var self = $Select = $klass($base, $super, 'Select', $Select); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Select_1; | |
$send(["form", "name", "size"], 'each', [], (TMP_Select_1 = function(name){var self = TMP_Select_1.$$s || this, TMP_2; | |
if (name == null) name = nil; | |
return $send(self, 'defhelper', [name], (TMP_2 = function(value){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = [name, value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Select_1.$$s = self, TMP_Select_1.$$arity = 1, TMP_Select_1)); | |
self['$defhelper!']("auto_focus", "autofocus"); | |
self['$defhelper!']("disabled"); | |
return self['$defhelper!']("required"); | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/td.rb": | |
/*!*******************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/element/td.rb ***! | |
\*******************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/element/td"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$defhelper', '$to_s', '$[]=', '$-', '$join']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Td(){}; | |
var self = $Td = $klass($base, $super, 'Td', $Td); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Td_1, TMP_Td_2, TMP_Td_3; | |
$send(self, 'defhelper', ["columns"], (TMP_Td_1 = function(value){var self = TMP_Td_1.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = ["colspan", value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_Td_1.$$s = self, TMP_Td_1.$$arity = 1, TMP_Td_1)); | |
$send(self, 'defhelper', ["rows"], (TMP_Td_2 = function(value){var self = TMP_Td_2.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil; | |
$writer = ["rowspan", value.$to_s()]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_Td_2.$$s = self, TMP_Td_2.$$arity = 1, TMP_Td_2)); | |
return $send(self, 'defhelper', ["headers"], (TMP_Td_3 = function($a_rest){var self = TMP_Td_3.$$s || this, args, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
$writer = ["headers", args.$join(" ")]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_Td_3.$$s = self, TMP_Td_3.$$arity = -1, TMP_Td_3)); | |
})($nesting[0], self, $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/helpers.rb": | |
/*!****************************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/html/helpers.rb ***! | |
\****************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/html/helpers"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$define_method', '$instance_exec', '$to_proc', '$do', '$defhelper', '$[]=', '$-']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $HTML(){}; | |
var self = $HTML = $klass($base, $super, 'HTML', $HTML); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Element_defhelper_1, TMP_Element_defhelper$B_4; | |
Opal.defs(self, '$defhelper', TMP_Element_defhelper_1 = function $$defhelper(name) { | |
var TMP_2, self = this, $iter = TMP_Element_defhelper_1.$$p, block = $iter || nil; | |
if ($iter) TMP_Element_defhelper_1.$$p = null; | |
return $send(self, 'define_method', [name], (TMP_2 = function($a_rest){var self = TMP_2.$$s || this, body, args; | |
body = TMP_2.$$p || nil; | |
if (body) TMP_2.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
$send(self, 'instance_exec', Opal.to_a(args), block.$to_proc()); | |
if ($truthy(body)) { | |
$send(self, 'do', [], body.$to_proc())}; | |
return self;}, TMP_2.$$s = self, TMP_2.$$arity = -1, TMP_2)) | |
}, TMP_Element_defhelper_1.$$arity = 1); | |
return (Opal.defs(self, '$defhelper!', TMP_Element_defhelper$B_4 = function(name, attribute) { | |
var TMP_3, self = this; | |
if (attribute == null) { | |
attribute = name; | |
} | |
return $send(self, 'defhelper', ["" + (name) + "!"], (TMP_3 = function(){var self = TMP_3.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
$writer = [attribute, true]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3)) | |
}, TMP_Element_defhelper$B_4.$$arity = -2), nil) && 'defhelper!'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/utils.rb": | |
/*!*********************************************************************************!*\ | |
!*** /Users/fkchang/.rvm/gems/ruby-2.5.1/gems/paggio-0.2.6/lib/paggio/utils.rb ***! | |
\*********************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["paggio/utils"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$size', '$min', '$scan', '$gsub', '$proc', '$===', '$merge', '$to_proc', '$merge!']); | |
return (function($base, $super, $parent_nesting) { | |
function $Paggio(){}; | |
var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $parent_nesting) { | |
function $Utils() {}; | |
var self = $Utils = $module($base, 'Utils', $Utils); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Utils_heredoc_1, TMP_Utils_deep_merge_3, TMP_Utils_deep_merge$B_5; | |
Opal.defs(self, '$heredoc', TMP_Utils_heredoc_1 = function $$heredoc(string) { | |
var self = this, indent = nil; | |
indent = (function() { try { | |
return string.$scan(/^[ \t]*(?=\S)/).$min().$size() | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return 0 | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}})(); | |
return string.$gsub(new RegExp("" + "^[ \\t]{" + (indent) + "}"), ""); | |
}, TMP_Utils_heredoc_1.$$arity = 1); | |
Opal.defs(self, '$deep_merge', TMP_Utils_deep_merge_3 = function $$deep_merge(a, b) { | |
var TMP_2, self = this, merger = nil; | |
merger = $send(self, 'proc', [], (TMP_2 = function(key, v1, v2){var self = TMP_2.$$s || this, $a; | |
if (key == null) key = nil;if (v1 == null) v1 = nil;if (v2 == null) v2 = nil; | |
if ($truthy(($truthy($a = $$($nesting, 'Hash')['$==='](v1)) ? $$($nesting, 'Hash')['$==='](v2) : $a))) { | |
return $send(v1, 'merge', [v2], merger.$to_proc()) | |
} else { | |
return v2 | |
}}, TMP_2.$$s = self, TMP_2.$$arity = 3, TMP_2)); | |
return $send(a, 'merge', [b], merger.$to_proc()); | |
}, TMP_Utils_deep_merge_3.$$arity = 2); | |
Opal.defs(self, '$deep_merge!', TMP_Utils_deep_merge$B_5 = function(a, b) { | |
var TMP_4, self = this, merger = nil; | |
merger = $send(self, 'proc', [], (TMP_4 = function(key, v1, v2){var self = TMP_4.$$s || this, $a; | |
if (key == null) key = nil;if (v1 == null) v1 = nil;if (v2 == null) v2 = nil; | |
if ($truthy(($truthy($a = $$($nesting, 'Hash')['$==='](v1)) ? $$($nesting, 'Hash')['$==='](v2) : $a))) { | |
$send(v1, 'merge!', [v2], merger.$to_proc()); | |
return v1; | |
} else { | |
return v2 | |
}}, TMP_4.$$s = self, TMP_4.$$arity = 3, TMP_4)); | |
return $send(a, 'merge!', [b], merger.$to_proc()); | |
}, TMP_Utils_deep_merge$B_5.$$arity = 2); | |
})($nesting[0], $nesting) | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-component-60d2525454e3/lib/hyper-component.rb": | |
/*!**********************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-component-60d2525454e3/lib/hyper-component.rb ***! | |
\**********************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var hyperloop_component_version_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hyperloop/component/version.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-component-60d2525454e3/lib/hyperloop/component/version.rb"); | |
/* harmony import */ var hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! hyperloop-config.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyperloop-config-4886523adb38/lib/hyperloop-config.rb"); | |
/* harmony import */ var hyper_react_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! hyper-react.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-react-5883fc0ccc70/lib/hyper-react.rb"); | |
if (typeof global.Opal.modules["hyperloop/component/version"] === 'undefined') { | |
if (typeof hyperloop_component_version_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(hyperloop_component_version_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyperloop-config"] === 'undefined') { | |
if (typeof hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-react"] === 'undefined') { | |
if (typeof hyper_react_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(hyper_react_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-component"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; | |
Opal.add_stubs(['$require', '$import', '$==']); | |
self.$require("hyperloop/component/version"); | |
self.$require("hyperloop-config"); | |
$$($nesting, 'Hyperloop').$import("hyper-component"); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
(function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Component(){}; | |
var self = $Component = $klass($base, $super, 'Component', $Component); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return nil | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
return self.$require("hyper-react"); | |
} else { | |
return nil | |
}; | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-component-60d2525454e3/lib/hyperloop/component/version.rb": | |
/*!**********************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-component-60d2525454e3/lib/hyperloop/component/version.rb ***! | |
\**********************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyperloop/component/version"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Component(){}; | |
var self = $Component = $klass($base, $super, 'Component', $Component); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return Opal.const_set($nesting[0], 'VERSION', "1.0.0.lap28") | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/active_record_base.rb": | |
/*!********************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/active_record_base.rb ***! | |
\********************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["active_record_base"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$==', '$count', '$is_a?', '$[]', '$merge', '$respond_to?', '$raise', '$!=', '$do_not_synchronize']); | |
return (function($base, $parent_nesting) { | |
function $ActiveRecord() {}; | |
var self = $ActiveRecord = $module($base, 'ActiveRecord', $ActiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), $a; | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base__synchromesh_scope_args_check_1; | |
return (Opal.defs(self, '$_synchromesh_scope_args_check', TMP_Base__synchromesh_scope_args_check_1 = function $$_synchromesh_scope_args_check(args) { | |
var $a, self = this, opts = nil; | |
opts = (function() {if ($truthy((($a = args.$count()['$=='](2)) ? args['$[]'](1)['$is_a?']($$($nesting, 'Hash')) : args.$count()['$=='](2)))) { | |
return args['$[]'](1).$merge($hash2(["server"], {"server": args['$[]'](0)})) | |
} else if ($truthy(args['$[]'](0)['$is_a?']($$($nesting, 'Hash')))) { | |
return args['$[]'](0) | |
} else { | |
return $hash2(["server"], {"server": args['$[]'](0)}) | |
}; return nil; })(); | |
if ($truthy(($truthy($a = opts) ? opts['$[]']("server")['$respond_to?']("call") : $a))) { | |
return opts}; | |
return self.$raise("" + "must provide either a proc as the first arg or by the " + "`:server` option to scope and default_scope methods"); | |
}, TMP_Base__synchromesh_scope_args_check_1.$$arity = 1), nil) && '_synchromesh_scope_args_check' | |
})($nesting[0], null, $nesting); | |
if ($truthy($$($nesting, 'RUBY_ENGINE')['$!=']("opal"))) { | |
nil}; | |
if ($truthy((($a = $$($nesting, 'InternalMetadata', 'skip_raise')) ? 'constant' : nil))) { | |
$$($nesting, 'InternalMetadata').$do_not_synchronize()}; | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/enumerable/pluck.rb": | |
/*!******************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/enumerable/pluck.rb ***! | |
\******************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["enumerable/pluck"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $truthy = Opal.truthy, $module = Opal.module, $send = Opal.send; | |
Opal.add_stubs(['$method_defined?', '$map', '$[]']); | |
if ($truthy($$($nesting, 'Enumerable')['$method_defined?']("pluck"))) { | |
return nil | |
} else { | |
return (function($base, $parent_nesting) { | |
function $Enumerable() {}; | |
var self = $Enumerable = $module($base, 'Enumerable', $Enumerable); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Enumerable_pluck_2; | |
Opal.def(self, '$pluck', TMP_Enumerable_pluck_2 = function $$pluck(key) { | |
var TMP_1, self = this; | |
return $send(self, 'map', [], (TMP_1 = function(element){var self = TMP_1.$$s || this; | |
if (element == null) element = nil; | |
return element['$[]'](key)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)) | |
}, TMP_Enumerable_pluck_2.$$arity = 1) | |
})($nesting[0], $nesting) | |
} | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/hyper-mesh.rb": | |
/*!************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/hyper-mesh.rb ***! | |
\************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var set_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! set.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/set.rb"); | |
/* harmony import */ var hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! hyperloop-config.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyperloop-config-4886523adb38/lib/hyperloop-config.rb"); | |
/* harmony import */ var hyper_component_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! hyper-component.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-component-60d2525454e3/lib/hyper-component.rb"); | |
/* harmony import */ var hyper_operation_rb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! hyper-operation.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation.rb"); | |
/* harmony import */ var active_support_rb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! active_support.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/gems/opal-activesupport-0.3.1/opal/active_support.rb"); | |
/* harmony import */ var time_rb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! time.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/time.rb"); | |
/* harmony import */ var date_rb__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! date.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/date.rb"); | |
/* harmony import */ var kernel_itself_rb__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! kernel/itself.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/kernel/itself.rb"); | |
/* harmony import */ var object_tap_rb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! object/tap.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/object/tap.rb"); | |
/* harmony import */ var reactive_record_active_record_error_rb__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! reactive_record/active_record_error.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record_error.rb"); | |
/* harmony import */ var reactive_record_active_record_errors_rb__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! reactive_record/active_record/errors.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/errors.rb"); | |
/* harmony import */ var reactive_record_active_record_error_rb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! reactive_record/active_record/error.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/error.rb"); | |
/* harmony import */ var reactive_record_server_data_cache_rb__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! reactive_record/server_data_cache.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/server_data_cache.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_while_loading_rb__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/while_loading.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/while_loading.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_operations_rb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/operations.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/operations.rb"); | |
/* harmony import */ var reactive_record_broadcast_rb__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! reactive_record/broadcast.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/broadcast.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_isomorphic_base_rb__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/isomorphic_base.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_dummy_value_rb__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/dummy_value.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/dummy_value.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_column_types_rb__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/column_types.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/column_types.rb"); | |
/* harmony import */ var reactive_record_active_record_aggregations_rb__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! reactive_record/active_record/aggregations.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/aggregations.rb"); | |
/* harmony import */ var reactive_record_active_record_associations_rb__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! reactive_record/active_record/associations.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/associations.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_backing_record_inspector_rb__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/backing_record_inspector.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/backing_record_inspector.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_getters_rb__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/getters.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/getters.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_setters_rb__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/setters.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/setters.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_lookup_tables_rb__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/lookup_tables.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/lookup_tables.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_base_rb__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/base.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/base.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_collection_rb__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/collection.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/collection.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_scoped_collection_rb__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/scoped_collection.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/scoped_collection.rb"); | |
/* harmony import */ var reactive_record_active_record_reactive_record_unscoped_collection_rb__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! reactive_record/active_record/reactive_record/unscoped_collection.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/unscoped_collection.rb"); | |
/* harmony import */ var reactive_record_interval_rb__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! reactive_record/interval.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/interval.rb"); | |
/* harmony import */ var _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_active_record_base_rb__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/active_record_base.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/active_record_base.rb"); | |
/* harmony import */ var _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_reactive_record_scope_description_rb__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/scope_description.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/scope_description.rb"); | |
/* harmony import */ var reactive_record_active_record_class_methods_rb__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! reactive_record/active_record/class_methods.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/class_methods.rb"); | |
/* harmony import */ var reactive_record_active_record_instance_methods_rb__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! reactive_record/active_record/instance_methods.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/instance_methods.rb"); | |
/* harmony import */ var reactive_record_active_record_base_rb__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! reactive_record/active_record/base.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/base.rb"); | |
/* harmony import */ var _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_hypermesh_version_rb__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/hypermesh/version.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/hypermesh/version.rb"); | |
/* harmony import */ var _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_parse_patch_rb__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/parse_patch.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/parse_patch.rb"); | |
/* harmony import */ var _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_set_patches_rb__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/set_patches.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/set_patches.rb"); | |
/* harmony import */ var _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_equality_patches_rb__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/equality_patches.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/equality_patches.rb"); | |
/* harmony import */ var enumerable_pluck_rb__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! enumerable/pluck.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/enumerable/pluck.rb"); | |
if (typeof global.Opal.modules["set"] === 'undefined') { | |
if (typeof set_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(set_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyperloop-config"] === 'undefined') { | |
if (typeof hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-component"] === 'undefined') { | |
if (typeof hyper_component_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(hyper_component_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation"] === 'undefined') { | |
if (typeof hyper_operation_rb__WEBPACK_IMPORTED_MODULE_3__["default"] === 'function') { Object(hyper_operation_rb__WEBPACK_IMPORTED_MODULE_3__["default"])(); } | |
} | |
if (typeof global.Opal.modules["active_support"] === 'undefined') { | |
if (typeof active_support_rb__WEBPACK_IMPORTED_MODULE_4__["default"] === 'function') { Object(active_support_rb__WEBPACK_IMPORTED_MODULE_4__["default"])(); } | |
} | |
if (typeof global.Opal.modules["time"] === 'undefined') { | |
if (typeof time_rb__WEBPACK_IMPORTED_MODULE_5__["default"] === 'function') { Object(time_rb__WEBPACK_IMPORTED_MODULE_5__["default"])(); } | |
} | |
if (typeof global.Opal.modules["date"] === 'undefined') { | |
if (typeof date_rb__WEBPACK_IMPORTED_MODULE_6__["default"] === 'function') { Object(date_rb__WEBPACK_IMPORTED_MODULE_6__["default"])(); } | |
} | |
if (typeof global.Opal.modules["kernel/itself"] === 'undefined') { | |
if (typeof kernel_itself_rb__WEBPACK_IMPORTED_MODULE_7__["default"] === 'function') { Object(kernel_itself_rb__WEBPACK_IMPORTED_MODULE_7__["default"])(); } | |
} | |
if (typeof global.Opal.modules["object/tap"] === 'undefined') { | |
if (typeof object_tap_rb__WEBPACK_IMPORTED_MODULE_8__["default"] === 'function') { Object(object_tap_rb__WEBPACK_IMPORTED_MODULE_8__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record_error"] === 'undefined') { | |
if (typeof reactive_record_active_record_error_rb__WEBPACK_IMPORTED_MODULE_9__["default"] === 'function') { Object(reactive_record_active_record_error_rb__WEBPACK_IMPORTED_MODULE_9__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/errors"] === 'undefined') { | |
if (typeof reactive_record_active_record_errors_rb__WEBPACK_IMPORTED_MODULE_10__["default"] === 'function') { Object(reactive_record_active_record_errors_rb__WEBPACK_IMPORTED_MODULE_10__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/error"] === 'undefined') { | |
if (typeof reactive_record_active_record_error_rb__WEBPACK_IMPORTED_MODULE_11__["default"] === 'function') { Object(reactive_record_active_record_error_rb__WEBPACK_IMPORTED_MODULE_11__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/server_data_cache"] === 'undefined') { | |
if (typeof reactive_record_server_data_cache_rb__WEBPACK_IMPORTED_MODULE_12__["default"] === 'function') { Object(reactive_record_server_data_cache_rb__WEBPACK_IMPORTED_MODULE_12__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/while_loading"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_while_loading_rb__WEBPACK_IMPORTED_MODULE_13__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_while_loading_rb__WEBPACK_IMPORTED_MODULE_13__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/operations"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_operations_rb__WEBPACK_IMPORTED_MODULE_14__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_operations_rb__WEBPACK_IMPORTED_MODULE_14__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/broadcast"] === 'undefined') { | |
if (typeof reactive_record_broadcast_rb__WEBPACK_IMPORTED_MODULE_15__["default"] === 'function') { Object(reactive_record_broadcast_rb__WEBPACK_IMPORTED_MODULE_15__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/isomorphic_base"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_isomorphic_base_rb__WEBPACK_IMPORTED_MODULE_16__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_isomorphic_base_rb__WEBPACK_IMPORTED_MODULE_16__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/dummy_value"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_dummy_value_rb__WEBPACK_IMPORTED_MODULE_17__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_dummy_value_rb__WEBPACK_IMPORTED_MODULE_17__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/column_types"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_column_types_rb__WEBPACK_IMPORTED_MODULE_18__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_column_types_rb__WEBPACK_IMPORTED_MODULE_18__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/aggregations"] === 'undefined') { | |
if (typeof reactive_record_active_record_aggregations_rb__WEBPACK_IMPORTED_MODULE_19__["default"] === 'function') { Object(reactive_record_active_record_aggregations_rb__WEBPACK_IMPORTED_MODULE_19__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/associations"] === 'undefined') { | |
if (typeof reactive_record_active_record_associations_rb__WEBPACK_IMPORTED_MODULE_20__["default"] === 'function') { Object(reactive_record_active_record_associations_rb__WEBPACK_IMPORTED_MODULE_20__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/backing_record_inspector"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_backing_record_inspector_rb__WEBPACK_IMPORTED_MODULE_21__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_backing_record_inspector_rb__WEBPACK_IMPORTED_MODULE_21__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/getters"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_getters_rb__WEBPACK_IMPORTED_MODULE_22__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_getters_rb__WEBPACK_IMPORTED_MODULE_22__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/setters"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_setters_rb__WEBPACK_IMPORTED_MODULE_23__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_setters_rb__WEBPACK_IMPORTED_MODULE_23__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/lookup_tables"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_lookup_tables_rb__WEBPACK_IMPORTED_MODULE_24__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_lookup_tables_rb__WEBPACK_IMPORTED_MODULE_24__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/base"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_base_rb__WEBPACK_IMPORTED_MODULE_25__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_base_rb__WEBPACK_IMPORTED_MODULE_25__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/collection"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_collection_rb__WEBPACK_IMPORTED_MODULE_26__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_collection_rb__WEBPACK_IMPORTED_MODULE_26__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/scoped_collection"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_scoped_collection_rb__WEBPACK_IMPORTED_MODULE_27__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_scoped_collection_rb__WEBPACK_IMPORTED_MODULE_27__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/reactive_record/unscoped_collection"] === 'undefined') { | |
if (typeof reactive_record_active_record_reactive_record_unscoped_collection_rb__WEBPACK_IMPORTED_MODULE_28__["default"] === 'function') { Object(reactive_record_active_record_reactive_record_unscoped_collection_rb__WEBPACK_IMPORTED_MODULE_28__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/interval"] === 'undefined') { | |
if (typeof reactive_record_interval_rb__WEBPACK_IMPORTED_MODULE_29__["default"] === 'function') { Object(reactive_record_interval_rb__WEBPACK_IMPORTED_MODULE_29__["default"])(); } | |
} | |
if (typeof global.Opal.modules["active_record_base"] === 'undefined') { | |
if (typeof _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_active_record_base_rb__WEBPACK_IMPORTED_MODULE_30__["default"] === 'function') { Object(_Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_active_record_base_rb__WEBPACK_IMPORTED_MODULE_30__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/scope_description"] === 'undefined') { | |
if (typeof _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_reactive_record_scope_description_rb__WEBPACK_IMPORTED_MODULE_31__["default"] === 'function') { Object(_Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_reactive_record_scope_description_rb__WEBPACK_IMPORTED_MODULE_31__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/class_methods"] === 'undefined') { | |
if (typeof reactive_record_active_record_class_methods_rb__WEBPACK_IMPORTED_MODULE_32__["default"] === 'function') { Object(reactive_record_active_record_class_methods_rb__WEBPACK_IMPORTED_MODULE_32__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/instance_methods"] === 'undefined') { | |
if (typeof reactive_record_active_record_instance_methods_rb__WEBPACK_IMPORTED_MODULE_33__["default"] === 'function') { Object(reactive_record_active_record_instance_methods_rb__WEBPACK_IMPORTED_MODULE_33__["default"])(); } | |
} | |
if (typeof global.Opal.modules["reactive_record/active_record/base"] === 'undefined') { | |
if (typeof reactive_record_active_record_base_rb__WEBPACK_IMPORTED_MODULE_34__["default"] === 'function') { Object(reactive_record_active_record_base_rb__WEBPACK_IMPORTED_MODULE_34__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hypermesh/version"] === 'undefined') { | |
if (typeof _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_hypermesh_version_rb__WEBPACK_IMPORTED_MODULE_35__["default"] === 'function') { Object(_Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_hypermesh_version_rb__WEBPACK_IMPORTED_MODULE_35__["default"])(); } | |
} | |
if (typeof global.Opal.modules["opal/parse_patch"] === 'undefined') { | |
if (typeof _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_parse_patch_rb__WEBPACK_IMPORTED_MODULE_36__["default"] === 'function') { Object(_Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_parse_patch_rb__WEBPACK_IMPORTED_MODULE_36__["default"])(); } | |
} | |
if (typeof global.Opal.modules["opal/set_patches"] === 'undefined') { | |
if (typeof _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_set_patches_rb__WEBPACK_IMPORTED_MODULE_37__["default"] === 'function') { Object(_Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_set_patches_rb__WEBPACK_IMPORTED_MODULE_37__["default"])(); } | |
} | |
if (typeof global.Opal.modules["opal/equality_patches"] === 'undefined') { | |
if (typeof _Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_equality_patches_rb__WEBPACK_IMPORTED_MODULE_38__["default"] === 'function') { Object(_Users_fkchang_Developer_rvm_gems_ruby_2_5_1_bundler_gems_hyper_mesh_7e5cfb908a0c_lib_opal_equality_patches_rb__WEBPACK_IMPORTED_MODULE_38__["default"])(); } | |
} | |
if (typeof global.Opal.modules["enumerable/pluck"] === 'undefined') { | |
if (typeof enumerable_pluck_rb__WEBPACK_IMPORTED_MODULE_39__["default"] === 'function') { Object(enumerable_pluck_rb__WEBPACK_IMPORTED_MODULE_39__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-mesh"] = function(Opal) { | |
var $a, $b, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $truthy = Opal.truthy; | |
Opal.add_stubs(['$require', '$==', '$include?', '$instance_methods', '$log']); | |
self.$require("set"); | |
self.$require("hyperloop-config"); | |
self.$require("hyper-component"); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
self.$require("hyper-operation"); | |
self.$require("active_support"); | |
self.$require("time"); | |
self.$require("date"); | |
if ($truthy($$($nesting, 'Object').$instance_methods()['$include?']("itself"))) { | |
} else { | |
self.$require("kernel/itself") | |
}; | |
self.$require("object/tap"); | |
self.$require("reactive_record/active_record_error"); | |
self.$require("reactive_record/active_record/errors"); | |
self.$require("reactive_record/active_record/error"); | |
self.$require("reactive_record/server_data_cache"); | |
self.$require("reactive_record/active_record/reactive_record/while_loading"); | |
self.$require("reactive_record/active_record/reactive_record/operations"); | |
self.$require("reactive_record/broadcast"); | |
self.$require("reactive_record/active_record/reactive_record/isomorphic_base"); | |
self.$require("reactive_record/active_record/reactive_record/dummy_value"); | |
self.$require("reactive_record/active_record/reactive_record/column_types"); | |
self.$require("reactive_record/active_record/aggregations"); | |
self.$require("reactive_record/active_record/associations"); | |
self.$require("reactive_record/active_record/reactive_record/backing_record_inspector"); | |
self.$require("reactive_record/active_record/reactive_record/getters"); | |
self.$require("reactive_record/active_record/reactive_record/setters"); | |
self.$require("reactive_record/active_record/reactive_record/lookup_tables"); | |
self.$require("reactive_record/active_record/reactive_record/base"); | |
self.$require("reactive_record/active_record/reactive_record/collection"); | |
self.$require("reactive_record/active_record/reactive_record/scoped_collection"); | |
self.$require("reactive_record/active_record/reactive_record/unscoped_collection"); | |
self.$require("reactive_record/interval"); | |
self.$require("active_record_base"); | |
self.$require("reactive_record/scope_description"); | |
self.$require("reactive_record/active_record/class_methods"); | |
self.$require("reactive_record/active_record/instance_methods"); | |
self.$require("reactive_record/active_record/base"); | |
self.$require("hypermesh/version"); | |
self.$require("opal/parse_patch"); | |
self.$require("opal/set_patches"); | |
self.$require("opal/equality_patches"); | |
if ($truthy((($b = $$($nesting, 'Hyperloop', 'skip_raise')) && ($a = $$$($b, 'Model', 'skip_raise')) ? 'constant' : nil))) { | |
} else { | |
$$$($$($nesting, 'React'), 'IsomorphicHelpers').$log("The gem 'hyper-mesh' is deprecated. Use gem 'hyper-model' instead.", "warning") | |
}; | |
} else { | |
nil | |
}; | |
return self.$require("enumerable/pluck"); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/hypermesh/version.rb": | |
/*!*******************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/hypermesh/version.rb ***! | |
\*******************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hypermesh/version"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; | |
return (function($base, $parent_nesting) { | |
function $Hypermesh() {}; | |
var self = $Hypermesh = $module($base, 'Hypermesh', $Hypermesh); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
Opal.const_set($nesting[0], 'VERSION', "1.0.0.lap28") | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/kernel/itself.rb": | |
/*!***************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/kernel/itself.rb ***! | |
\***************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["kernel/itself"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; | |
return (function($base, $parent_nesting) { | |
function $Kernel() {}; | |
var self = $Kernel = $module($base, 'Kernel', $Kernel); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Kernel_itself_1; | |
Opal.def(self, '$itself', TMP_Kernel_itself_1 = function $$itself() { | |
var self = this; | |
return self | |
}, TMP_Kernel_itself_1.$$arity = 0) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/object/tap.rb": | |
/*!************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/object/tap.rb ***! | |
\************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["object/tap"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $truthy = Opal.truthy; | |
Opal.add_stubs(['$==']); | |
return (function($base, $super, $parent_nesting) { | |
function $Object(){}; | |
var self = $Object = $klass($base, $super, 'Object', $Object); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Object_tap_1; | |
return (Opal.def(self, '$tap', TMP_Object_tap_1 = function $$tap() { | |
var self = this, $iter = TMP_Object_tap_1.$$p, $yield = $iter || nil, val = nil; | |
if ($iter) TMP_Object_tap_1.$$p = null; | |
val = (function() {if ($truthy(self.$$is_boolean)) { | |
return self['$=='](true) | |
} else { | |
return self | |
}; return nil; })(); | |
Opal.yield1($yield, val); | |
return val; | |
}, TMP_Object_tap_1.$$arity = 0), nil) && 'tap' | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/equality_patches.rb": | |
/*!***********************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/equality_patches.rb ***! | |
\***********************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["opal/equality_patches"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $truthy = Opal.truthy; | |
Opal.add_stubs(['$is_a?', '$broken_equals']); | |
(function($base, $super, $parent_nesting) { | |
function $Date(){}; | |
var self = $Date = $klass($base, $super, 'Date', $Date); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Date_$eq$eq_1; | |
Opal.alias(self, "broken_equals", "=="); | |
return (Opal.def(self, '$==', TMP_Date_$eq$eq_1 = function(other) { | |
var self = this; | |
if ($truthy(other['$is_a?']($$($nesting, 'Date')))) { | |
} else { | |
return false | |
}; | |
return self.$broken_equals(other); | |
}, TMP_Date_$eq$eq_1.$$arity = 1), nil) && '=='; | |
})($nesting[0], null, $nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Time(){}; | |
var self = $Time = $klass($base, $super, 'Time', $Time); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Time_$eq$eq_2; | |
Opal.alias(self, "broken_equals", "=="); | |
return (Opal.def(self, '$==', TMP_Time_$eq$eq_2 = function(other) { | |
var self = this; | |
if ($truthy(other['$is_a?']($$($nesting, 'Time')))) { | |
} else { | |
return false | |
}; | |
return self.$broken_equals(other); | |
}, TMP_Time_$eq$eq_2.$$arity = 1), nil) && '=='; | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/parse_patch.rb": | |
/*!******************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/parse_patch.rb ***! | |
\******************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["opal/parse_patch"] = function(Opal) { | |
var TMP_1, self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $truthy = Opal.truthy, $send = Opal.send, e = nil; | |
Opal.add_stubs(['$parse', '$is_a?', '$class_eval', '$old_parse', '$to_proc', '$raise', '$new', '$message']); | |
try { | |
return $$($nesting, 'JSON').$parse("test") | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
if ($truthy(e['$is_a?']($$($nesting, 'StandardError')))) { | |
return nil | |
} else { | |
return $send($$($nesting, 'JSON'), 'class_eval', [], (TMP_1 = function(){var self = TMP_1.$$s || this, TMP_parse_2; | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return Opal.alias(self, "old_parse", "parse") | |
})(Opal.get_singleton_class(self), $nesting); | |
return (Opal.defs(self, '$parse', TMP_parse_2 = function $$parse($a_rest) { | |
var self = this, args, $iter = TMP_parse_2.$$p, block = $iter || nil, e = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_parse_2.$$p = null; | |
try { | |
return $send(self, 'old_parse', Opal.to_a(args), block.$to_proc()) | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
return self.$raise($$($nesting, 'StandardError').$new(e.$message())) | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_parse_2.$$arity = -1), nil) && 'parse';}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1)) | |
} | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}; | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/set_patches.rb": | |
/*!******************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/opal/set_patches.rb ***! | |
\******************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["opal/set_patches"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $truthy = Opal.truthy, $klass = Opal.klass, $send = Opal.send; | |
Opal.add_stubs(['$method_defined?', '$new', '$class', '$each', '$include?', '$add']); | |
if ($truthy($$($nesting, 'Set')['$method_defined?']("intersection"))) { | |
return nil | |
} else { | |
return (function($base, $super, $parent_nesting) { | |
function $Set(){}; | |
var self = $Set = $klass($base, $super, 'Set', $Set); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Set_$_2; | |
Opal.def(self, '$&', TMP_Set_$_2 = function(enum$) { | |
var TMP_1, self = this, n = nil; | |
n = self.$class().$new(); | |
$send(enum$, 'each', [], (TMP_1 = function(o){var self = TMP_1.$$s || this; | |
if (o == null) o = nil; | |
if ($truthy(self['$include?'](o))) { | |
return n.$add(o) | |
} else { | |
return nil | |
}}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)); | |
return n; | |
}, TMP_Set_$_2.$$arity = 1); | |
return Opal.alias(self, "intersection", "&"); | |
})($nesting[0], null, $nesting) | |
} | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/aggregations.rb": | |
/*!********************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/aggregations.rb ***! | |
\********************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/aggregations"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$instance_eval', '$base_class', '$detect', '$reflect_on_all_aggregations', '$==', '$attribute', '$attr_reader', '$<<', '$[]', '$camelize', '$respond_to?', '$collect', '$to_proc', '$log', '$const_get', '$nil?', '$send', '$call', '$klass']); | |
return (function($base, $parent_nesting) { | |
function $ActiveRecord() {}; | |
var self = $ActiveRecord = $module($base, 'ActiveRecord', $ActiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_reflect_on_all_aggregations_2, TMP_Base_reflect_on_aggregation_4; | |
Opal.defs(self, '$reflect_on_all_aggregations', TMP_Base_reflect_on_all_aggregations_2 = function $$reflect_on_all_aggregations() { | |
var TMP_1, self = this; | |
return $send(self.$base_class(), 'instance_eval', [], (TMP_1 = function(){var self = TMP_1.$$s || this, $a; | |
if (self.aggregations == null) self.aggregations = nil; | |
return (self.aggregations = ($truthy($a = self.aggregations) ? $a : []))}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1)) | |
}, TMP_Base_reflect_on_all_aggregations_2.$$arity = 0); | |
return (Opal.defs(self, '$reflect_on_aggregation', TMP_Base_reflect_on_aggregation_4 = function $$reflect_on_aggregation(attribute) { | |
var TMP_3, self = this; | |
return $send(self.$reflect_on_all_aggregations(), 'detect', [], (TMP_3 = function(aggregation){var self = TMP_3.$$s || this; | |
if (aggregation == null) aggregation = nil; | |
return aggregation.$attribute()['$=='](attribute)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3)) | |
}, TMP_Base_reflect_on_aggregation_4.$$arity = 1), nil) && 'reflect_on_aggregation'; | |
})($nesting[0], null, $nesting); | |
(function($base, $parent_nesting) { | |
function $Aggregations() {}; | |
var self = $Aggregations = $module($base, 'Aggregations', $Aggregations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $AggregationReflection(){}; | |
var self = $AggregationReflection = $klass($base, $super, 'AggregationReflection', $AggregationReflection); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_AggregationReflection_construct_5, TMP_AggregationReflection_initialize_6, TMP_AggregationReflection_klass_7, TMP_AggregationReflection_serialize_9, TMP_AggregationReflection_deserialize_10; | |
def.owner_class = def.klass_name = def.klass = def.mapped_attributes = def.constructor$ = nil; | |
self.$attr_reader("klass_name"); | |
self.$attr_reader("attribute"); | |
self.$attr_reader("mapped_attributes"); | |
self.$attr_reader("constructor"); | |
Opal.def(self, '$construct', TMP_AggregationReflection_construct_5 = function $$construct(args) { | |
var self = this; | |
return nil | |
}, TMP_AggregationReflection_construct_5.$$arity = 1); | |
Opal.def(self, '$initialize', TMP_AggregationReflection_initialize_6 = function $$initialize(owner_class, macro, name, options) { | |
var $a, self = this; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
owner_class.$reflect_on_all_aggregations()['$<<'](self); | |
self.owner_class = owner_class; | |
self.constructor$ = ($truthy($a = options['$[]']("constructor")) ? $a : "new"); | |
self.klass_name = ($truthy($a = options['$[]']("class_name")) ? $a : name.$camelize()); | |
self.attribute = name; | |
if ($truthy(options['$[]']("mapping")['$respond_to?']("collect"))) { | |
return (self.mapped_attributes = $send(options['$[]']("mapping"), 'collect', [], "last".$to_proc())) | |
} else { | |
$$$($$($nesting, 'ReactiveRecord'), 'Base').$log("" + "improper aggregate definition " + (self.owner_class) + ", :" + (name) + ", class_name: " + (self.klass_name) + " - missing mapping", "error"); | |
return (self.mapped_attributes = []); | |
}; | |
}, TMP_AggregationReflection_initialize_6.$$arity = -4); | |
Opal.def(self, '$klass', TMP_AggregationReflection_klass_7 = function $$klass() { | |
var $a, self = this; | |
return (self.klass = ($truthy($a = self.klass) ? $a : $$($nesting, 'Object').$const_get(self.klass_name))) | |
}, TMP_AggregationReflection_klass_7.$$arity = 0); | |
Opal.def(self, '$serialize', TMP_AggregationReflection_serialize_9 = function $$serialize(object) { | |
var TMP_8, self = this; | |
if ($truthy(object['$nil?']())) { | |
return object | |
} else { | |
return $send(self.mapped_attributes, 'collect', [], (TMP_8 = function(attr){var self = TMP_8.$$s || this; | |
if (attr == null) attr = nil; | |
return object.$send(attr)}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8)) | |
} | |
}, TMP_AggregationReflection_serialize_9.$$arity = 1); | |
return (Opal.def(self, '$deserialize', TMP_AggregationReflection_deserialize_10 = function $$deserialize(array) { | |
var self = this; | |
if ($truthy(array['$nil?']())) { | |
return array | |
} else if ($truthy(self.constructor$['$respond_to?']("call"))) { | |
return $send(self.constructor$, 'call', Opal.to_a(array)) | |
} else { | |
return $send(self.$klass(), 'send', [self.constructor$].concat(Opal.to_a(array))) | |
} | |
}, TMP_AggregationReflection_deserialize_10.$$arity = 1), nil) && 'deserialize'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/associations.rb": | |
/*!********************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/associations.rb ***! | |
\********************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/associations"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$instance_eval', '$base_class', '$superclass', '$dup', '$reflection_finder', '$==', '$attribute', '$association_foreign_key', '$detect', '$reflect_on_all_associations', '$owner_class', '$to_proc', '$attr_reader', '$<<', '$[]', '$collection?', '$sub', '$camelize', '$underscore', '$name', '$raise', '$select', '$klass', '$through_association', '$inverse', '$flatten', '$collect', '$source', '$find_inverse', '$each', '$!=', '$const_get', '$include?']); | |
return (function($base, $parent_nesting) { | |
function $ActiveRecord() {}; | |
var self = $ActiveRecord = $module($base, 'ActiveRecord', $ActiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_reflect_on_all_associations_3, TMP_Base_reflect_on_association_5, TMP_Base_reflect_on_association_by_foreign_key_7, TMP_Base_reflection_finder_8; | |
Opal.defs(self, '$reflect_on_all_associations', TMP_Base_reflect_on_all_associations_3 = function $$reflect_on_all_associations() { | |
var TMP_1, self = this; | |
return $send(self.$base_class(), 'instance_eval', [], (TMP_1 = function(){var self = TMP_1.$$s || this, $a, TMP_2; | |
if (self.associations == null) self.associations = nil; | |
return (self.associations = ($truthy($a = self.associations) ? $a : $send(self.$superclass(), 'instance_eval', [], (TMP_2 = function(){var self = TMP_2.$$s || this, $b, $c; | |
if (self.associations == null) self.associations = nil; | |
return ($truthy($b = ($truthy($c = self.associations) ? self.associations.$dup() : $c)) ? $b : [])}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2))))}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1)) | |
}, TMP_Base_reflect_on_all_associations_3.$$arity = 0); | |
Opal.defs(self, '$reflect_on_association', TMP_Base_reflect_on_association_5 = function $$reflect_on_association(attr) { | |
var TMP_4, self = this; | |
return $send(self, 'reflection_finder', [], (TMP_4 = function(assoc){var self = TMP_4.$$s || this; | |
if (assoc == null) assoc = nil; | |
return assoc.$attribute()['$=='](attr)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4)) | |
}, TMP_Base_reflect_on_association_5.$$arity = 1); | |
Opal.defs(self, '$reflect_on_association_by_foreign_key', TMP_Base_reflect_on_association_by_foreign_key_7 = function $$reflect_on_association_by_foreign_key(key) { | |
var TMP_6, self = this; | |
return $send(self, 'reflection_finder', [], (TMP_6 = function(assoc){var self = TMP_6.$$s || this; | |
if (assoc == null) assoc = nil; | |
return assoc.$association_foreign_key()['$=='](key)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6)) | |
}, TMP_Base_reflect_on_association_by_foreign_key_7.$$arity = 1); | |
return (Opal.defs(self, '$reflection_finder', TMP_Base_reflection_finder_8 = function $$reflection_finder() { | |
var TMP_9, self = this, $iter = TMP_Base_reflection_finder_8.$$p, block = $iter || nil, found = nil; | |
if ($iter) TMP_Base_reflection_finder_8.$$p = null; | |
found = $send(self.$reflect_on_all_associations(), 'detect', [], (TMP_9 = function(assoc){var self = TMP_9.$$s || this, $a; | |
if (assoc == null) assoc = nil; | |
return (($a = assoc.$owner_class()['$=='](self)) ? Opal.yield1(block, assoc) : assoc.$owner_class()['$=='](self))}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9)); | |
if ($truthy(found)) { | |
return found | |
} else if (self.$superclass()['$==']($$($nesting, 'Base'))) { | |
return nil | |
} else { | |
return $send(self.$superclass(), 'reflection_finder', [], block.$to_proc()) | |
}; | |
}, TMP_Base_reflection_finder_8.$$arity = 0), nil) && 'reflection_finder'; | |
})($nesting[0], null, $nesting); | |
(function($base, $parent_nesting) { | |
function $Associations() {}; | |
var self = $Associations = $module($base, 'Associations', $Associations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $AssociationReflection(){}; | |
var self = $AssociationReflection = $klass($base, $super, 'AssociationReflection', $AssociationReflection); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_AssociationReflection_initialize_10, TMP_AssociationReflection_through_association_12, TMP_AssociationReflection_through_associations_14, TMP_AssociationReflection_source_associations_17, TMP_AssociationReflection_inverse_18, TMP_AssociationReflection_inverse_of_19, TMP_AssociationReflection_find_inverse_21, TMP_AssociationReflection_klass_22, TMP_AssociationReflection_collection$q_23; | |
def.owner_class = def.klass_name = def.options = def.through_association = def.through_associations = def.source_associations = def.inverse = def.inverse_of = def.association_foreign_key = def.klass = def.macro = nil; | |
self.$attr_reader("association_foreign_key"); | |
self.$attr_reader("attribute"); | |
self.$attr_reader("macro"); | |
self.$attr_reader("owner_class"); | |
self.$attr_reader("source"); | |
Opal.def(self, '$initialize', TMP_AssociationReflection_initialize_10 = function $$initialize(owner_class, macro, name, options) { | |
var $a, $b, $c, self = this; | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
owner_class.$reflect_on_all_associations()['$<<'](self); | |
self.owner_class = owner_class; | |
self.macro = macro; | |
self.options = options; | |
self.klass_name = ($truthy($a = ($truthy($b = options['$[]']("class_name")) ? $b : ($truthy($c = self['$collection?']()) ? name.$camelize().$sub(/s$/, "") : $c))) ? $a : name.$camelize()); | |
self.association_foreign_key = ($truthy($a = ($truthy($b = options['$[]']("foreign_key")) ? $b : (($c = macro['$==']("belongs_to")) ? "" + (name) + "_id" : macro['$==']("belongs_to")))) ? $a : "" + (self.owner_class.$name().$underscore()) + "_id"); | |
if ($truthy(options['$[]']("through"))) { | |
self.source = ($truthy($a = options['$[]']("source")) ? $a : self.klass_name.$underscore())}; | |
return (self.attribute = name); | |
}, TMP_AssociationReflection_initialize_10.$$arity = -4); | |
Opal.def(self, '$through_association', TMP_AssociationReflection_through_association_12 = function $$through_association() { | |
var $a, TMP_11, self = this; | |
if ($truthy(self.options['$[]']("through"))) { | |
} else { | |
return nil | |
}; | |
self.through_association = ($truthy($a = self.through_association) ? $a : $send(self.owner_class.$reflect_on_all_associations(), 'detect', [], (TMP_11 = function(association){var self = TMP_11.$$s || this; | |
if (self.options == null) self.options = nil; | |
if (association == null) association = nil; | |
return association.$attribute()['$=='](self.options['$[]']("through"))}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11))); | |
if ($truthy(self.through_association)) { | |
} else { | |
self.$raise("" + ("" + "Through association " + (self.options['$[]']("through")) + " for ") + ("" + (self.owner_class) + "." + (self.$attribute()) + " not found.")) | |
}; | |
return self.through_association; | |
}, TMP_AssociationReflection_through_association_12.$$arity = 0); | |
Opal.alias(self, "through_association?", "through_association"); | |
Opal.def(self, '$through_associations', TMP_AssociationReflection_through_associations_14 = function $$through_associations() { | |
var $a, TMP_13, self = this; | |
return (self.through_associations = ($truthy($a = self.through_associations) ? $a : $send(self.$klass().$reflect_on_all_associations(), 'select', [], (TMP_13 = function(assoc){var self = TMP_13.$$s || this, $b; | |
if (assoc == null) assoc = nil; | |
return ($truthy($b = assoc.$through_association()) ? assoc.$inverse()['$=='](self) : $b)}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13)))) | |
}, TMP_AssociationReflection_through_associations_14.$$arity = 0); | |
Opal.def(self, '$source_associations', TMP_AssociationReflection_source_associations_17 = function $$source_associations() { | |
var $a, TMP_15, self = this; | |
return (self.source_associations = ($truthy($a = self.source_associations) ? $a : $send(self.$owner_class().$reflect_on_all_associations(), 'collect', [], (TMP_15 = function(sibling){var self = TMP_15.$$s || this, TMP_16; | |
if (sibling == null) sibling = nil; | |
return $send(sibling.$klass().$reflect_on_all_associations(), 'select', [], (TMP_16 = function(assoc){var self = TMP_16.$$s || this; | |
if (assoc == null) assoc = nil; | |
return assoc.$source()['$=='](self.$attribute())}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16))}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15)).$flatten())) | |
}, TMP_AssociationReflection_source_associations_17.$$arity = 0); | |
Opal.def(self, '$inverse', TMP_AssociationReflection_inverse_18 = function $$inverse() { | |
var $a, self = this; | |
return (self.inverse = ($truthy($a = self.inverse) ? $a : (function() {if ($truthy(self.$through_association())) { | |
return self.$through_association().$inverse() | |
} else { | |
return self.$find_inverse() | |
}; return nil; })())) | |
}, TMP_AssociationReflection_inverse_18.$$arity = 0); | |
Opal.def(self, '$inverse_of', TMP_AssociationReflection_inverse_of_19 = function $$inverse_of() { | |
var $a, self = this; | |
return (self.inverse_of = ($truthy($a = self.inverse_of) ? $a : self.$inverse().$attribute())) | |
}, TMP_AssociationReflection_inverse_of_19.$$arity = 0); | |
Opal.def(self, '$find_inverse', TMP_AssociationReflection_find_inverse_21 = function $$find_inverse() {try { | |
var TMP_20, self = this; | |
$send(self.$klass().$reflect_on_all_associations(), 'each', [], (TMP_20 = function(association){var self = TMP_20.$$s || this; | |
if (self.association_foreign_key == null) self.association_foreign_key = nil; | |
if (self.owner_class == null) self.owner_class = nil; | |
if (association == null) association = nil; | |
if ($truthy(association.$association_foreign_key()['$!='](self.association_foreign_key))) { | |
return nil;}; | |
if ($truthy(association.$klass()['$!='](self.owner_class))) { | |
return nil;}; | |
if (association.$attribute()['$=='](self.$attribute())) { | |
return nil;}; | |
if (self.$klass()['$=='](association.$owner_class())) { | |
Opal.ret(association) | |
} else { | |
return nil | |
};}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20)); | |
return self.$raise("" + ("" + "Association " + (self.owner_class) + "." + (self.$attribute()) + " ") + ("" + "(foreign_key: " + (self.association_foreign_key) + ") ") + ("" + "has no inverse in " + (self.klass_name))); | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_AssociationReflection_find_inverse_21.$$arity = 0); | |
Opal.def(self, '$klass', TMP_AssociationReflection_klass_22 = function $$klass() { | |
var $a, self = this; | |
return (self.klass = ($truthy($a = self.klass) ? $a : $$($nesting, 'Object').$const_get(self.klass_name))) | |
}, TMP_AssociationReflection_klass_22.$$arity = 0); | |
return (Opal.def(self, '$collection?', TMP_AssociationReflection_collection$q_23 = function() { | |
var self = this; | |
return ["has_many"]['$include?'](self.macro) | |
}, TMP_AssociationReflection_collection$q_23.$$arity = 0), nil) && 'collection?'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/base.rb": | |
/*!************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/base.rb ***! | |
\************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/base"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $lambda = Opal.lambda; | |
Opal.add_stubs(['$include', '$extend', '$scope']); | |
return (function($base, $parent_nesting) { | |
function $ActiveRecord() {}; | |
var self = $ActiveRecord = $module($base, 'ActiveRecord', $ActiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_1, TMP_Base_2; | |
self.$include($$($nesting, 'InstanceMethods')); | |
self.$extend($$($nesting, 'ClassMethods')); | |
self.$scope("limit", $lambda((TMP_Base_1 = function(){var self = TMP_Base_1.$$s || this; | |
return nil}, TMP_Base_1.$$s = self, TMP_Base_1.$$arity = 0, TMP_Base_1))); | |
return self.$scope("offset", $lambda((TMP_Base_2 = function(){var self = TMP_Base_2.$$s || this; | |
return nil}, TMP_Base_2.$$s = self, TMP_Base_2.$$arity = 0, TMP_Base_2))); | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/class_methods.rb": | |
/*!*********************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/class_methods.rb ***! | |
\*********************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/class_methods"] = function(Opal) { | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $truthy = Opal.truthy, $send = Opal.send, $hash = Opal.hash, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$method_defined?', '$cast_to_current_sti_type', '$_new_without_sti_type_cast', '$to_proc', '$<', '$raise', '$name', '$==', '$superclass', '$abstract_class?', '$base_class', '$primary_key', '$to_s', '$tap', '$inheritance_column', '$!', '$find', '$each', '$_dealias_attribute', '$[]=', '$-', '$[]', '$serialized?', '$_attribute_aliases', '$define_method', '$send', '$count', '$start_with?', '$find_by', '$sub', '$respond_to?', '$all', '$end_with?', '$chop', '$include?', '$save', '$new', '$_synchromesh_scope_args_check', '$singleton_class', '$build_child_scope', '$<<', '$default_scope', '$extend', '$inject', '$_all_filter', '$model_name', '$lambda', '$class', '$unscoped', '$first', '$apply_scope', '$>', '$is_a?', '$last', '$get_has_many', '$set_has_many', '$get_belongs_to', '$set_belongs_to', '$klass', '$get_ar_aggregate', '$set_ar_aggregate', '$get_non_ar_aggregate', '$set_non_ar_aggregate', '$keys', '$public_columns_hash', '$server_methods', '$zero?', '$+', '$get_server_method', '$columns_hash', '$get_attr_value', '$set_attr_value', '$changed?', '$present?', '$key?', '$inheritance_column=', '$Native', '$from_object', '$to_n', '$infer_type_from_hash', '$reflect_on_all_associations', '$collect', '$detect', '$association_foreign_key', '$attribute', '$load_data', '$load_from_json']); | |
return (function($base, $parent_nesting) { | |
function $ActiveRecord() {}; | |
var self = $ActiveRecord = $module($base, 'ActiveRecord', $ActiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $ClassMethods() {}; | |
var self = $ClassMethods = $module($base, 'ClassMethods', $ClassMethods); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ClassMethods_new_1, TMP_ClassMethods_base_class_2, TMP_ClassMethods_abstract_class$q_3, TMP_ClassMethods_primary_key_4, TMP_ClassMethods_primary_key$eq_5, TMP_ClassMethods_inheritance_column_7, TMP_ClassMethods_inheritance_column$eq_8, TMP_ClassMethods_model_name_9, TMP_ClassMethods_find_10, TMP_ClassMethods_find_by_12, TMP_ClassMethods_enum_13, TMP_ClassMethods_serialize_14, TMP_ClassMethods__dealias_attribute_15, TMP_ClassMethods__attribute_aliases_16, TMP_ClassMethods_alias_attribute_19, TMP_ClassMethods_method_missing_20, TMP_ClassMethods_create_21, TMP_ClassMethods_scope_23, TMP_ClassMethods_default_scope_24, TMP_ClassMethods_all_26, TMP_ClassMethods__all_filter_28, TMP_ClassMethods_unscoped_29, TMP_ClassMethods_finder_method_32, TMP_ClassMethods_abstract_class$eq_33, TMP_ClassMethods_34, TMP_ClassMethods_composed_of_44, TMP_ClassMethods_column_names_45, TMP_ClassMethods_columns_hash_46, TMP_ClassMethods_server_methods_47, TMP_ClassMethods_server_method_50, TMP_ClassMethods_define_attribute_methods_57, TMP_ClassMethods__react_param_conversion_61; | |
if ($truthy(self['$method_defined?']("new"))) { | |
Opal.alias(self, "_new_without_sti_type_cast", "new"); | |
Opal.def(self, '$new', TMP_ClassMethods_new_1 = function($a_rest) { | |
var self = this, args, $iter = TMP_ClassMethods_new_1.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_ClassMethods_new_1.$$p = null; | |
return $send(self, '_new_without_sti_type_cast', Opal.to_a(args), block.$to_proc()).$cast_to_current_sti_type() | |
}, TMP_ClassMethods_new_1.$$arity = -1);}; | |
Opal.def(self, '$base_class', TMP_ClassMethods_base_class_2 = function $$base_class() { | |
var $a, self = this; | |
if ($rb_lt(self, $$($nesting, 'Base'))) { | |
} else { | |
self.$raise($$($nesting, 'ActiveRecordError'), "" + (self.$name()) + " doesn't descend from ActiveRecord") | |
}; | |
if ($truthy(($truthy($a = self.$superclass()['$==']($$($nesting, 'Base'))) ? $a : self.$superclass()['$abstract_class?']()))) { | |
return self | |
} else { | |
return self.$superclass().$base_class() | |
}; | |
}, TMP_ClassMethods_base_class_2.$$arity = 0); | |
Opal.def(self, '$abstract_class?', TMP_ClassMethods_abstract_class$q_3 = function() { | |
var $a, $b, self = this; | |
if (self.abstract_class == null) self.abstract_class = nil; | |
return ($truthy($a = (($b = self['abstract_class'], $b != null && $b !== nil) ? 'instance-variable' : nil)) ? self.abstract_class['$=='](true) : $a) | |
}, TMP_ClassMethods_abstract_class$q_3.$$arity = 0); | |
Opal.def(self, '$primary_key', TMP_ClassMethods_primary_key_4 = function $$primary_key() { | |
var $a, self = this; | |
if (self.primary_key_value == null) self.primary_key_value = nil; | |
return (self.primary_key_value = ($truthy($a = self.primary_key_value) ? $a : (function() {if ($truthy(self['$=='](self.$base_class()))) { | |
return "id" | |
} else { | |
return self.$base_class().$primary_key() | |
}; return nil; })())) | |
}, TMP_ClassMethods_primary_key_4.$$arity = 0); | |
Opal.def(self, '$primary_key=', TMP_ClassMethods_primary_key$eq_5 = function(val) { | |
var self = this; | |
return (self.primary_key_value = val.$to_s()) | |
}, TMP_ClassMethods_primary_key$eq_5.$$arity = 1); | |
Opal.def(self, '$inheritance_column', TMP_ClassMethods_inheritance_column_7 = function $$inheritance_column() { | |
var $a, $b, TMP_6, self = this; | |
if (self.no_inheritance_column == null) self.no_inheritance_column = nil; | |
if (self.inheritance_column_value == null) self.inheritance_column_value = nil; | |
if ($truthy(self.no_inheritance_column)) { | |
return nil}; | |
return (self.inheritance_column_value = ($truthy($a = self.inheritance_column_value) ? $a : (function() {if (self['$=='](self.$base_class())) { | |
return ($truthy($b = self.inheritance_column_value) ? $b : "type") | |
} else { | |
return $send(self.$superclass().$inheritance_column(), 'tap', [], (TMP_6 = function(v){var self = TMP_6.$$s || this; | |
if (v == null) v = nil; | |
return (self.no_inheritance_column = v['$!']())}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6)) | |
}; return nil; })())); | |
}, TMP_ClassMethods_inheritance_column_7.$$arity = 0); | |
Opal.def(self, '$inheritance_column=', TMP_ClassMethods_inheritance_column$eq_8 = function(name) { | |
var self = this; | |
self.no_inheritance_column = name['$!'](); | |
return (self.inheritance_column_value = name); | |
}, TMP_ClassMethods_inheritance_column$eq_8.$$arity = 1); | |
Opal.def(self, '$model_name', TMP_ClassMethods_model_name_9 = function $$model_name() { | |
var self = this; | |
return self.$name() | |
}, TMP_ClassMethods_model_name_9.$$arity = 0); | |
Opal.def(self, '$find', TMP_ClassMethods_find_10 = function $$find(id) { | |
var self = this; | |
return $$$($$($nesting, 'ReactiveRecord'), 'Base').$find(self, $hash(self.$primary_key(), id)) | |
}, TMP_ClassMethods_find_10.$$arity = 1); | |
Opal.def(self, '$find_by', TMP_ClassMethods_find_by_12 = function $$find_by(opts) { | |
var TMP_11, self = this, dealiased_opts = nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
dealiased_opts = $hash2([], {}); | |
$send(opts, 'each', [], (TMP_11 = function(attr, value){var self = TMP_11.$$s || this, $writer = nil; | |
if (attr == null) attr = nil;if (value == null) value = nil; | |
$writer = [self.$_dealias_attribute(attr), value]; | |
$send(dealiased_opts, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11)); | |
return $$$($$($nesting, 'ReactiveRecord'), 'Base').$find(self, dealiased_opts); | |
}, TMP_ClassMethods_find_by_12.$$arity = -1); | |
Opal.def(self, '$enum', TMP_ClassMethods_enum_13 = function($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return nil | |
}, TMP_ClassMethods_enum_13.$$arity = -1); | |
Opal.def(self, '$serialize', TMP_ClassMethods_serialize_14 = function $$serialize(attr, $a_rest) { | |
var self = this, args, $writer = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
$writer = [attr, true]; | |
$send($$$($$($nesting, 'ReactiveRecord'), 'Base')['$serialized?']()['$[]'](self), '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
}, TMP_ClassMethods_serialize_14.$$arity = -2); | |
Opal.def(self, '$_dealias_attribute', TMP_ClassMethods__dealias_attribute_15 = function $$_dealias_attribute(new$) { | |
var $a, self = this, $logical_op_recvr_tmp_1 = nil, $writer = nil; | |
if (self['$=='](self.$base_class())) { | |
return ($truthy($a = self.$_attribute_aliases()['$[]'](new$)) ? $a : new$) | |
} else { | |
$logical_op_recvr_tmp_1 = self.$_attribute_aliases(); | |
return ($truthy($a = $logical_op_recvr_tmp_1['$[]'](new$)) ? $a : (($writer = [new$, self.$superclass().$_dealias_attribute(new$)]), $send($logical_op_recvr_tmp_1, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])); | |
} | |
}, TMP_ClassMethods__dealias_attribute_15.$$arity = 1); | |
Opal.def(self, '$_attribute_aliases', TMP_ClassMethods__attribute_aliases_16 = function $$_attribute_aliases() { | |
var $a, self = this; | |
if (self._attribute_aliases == null) self._attribute_aliases = nil; | |
return (self._attribute_aliases = ($truthy($a = self._attribute_aliases) ? $a : $hash2([], {}))) | |
}, TMP_ClassMethods__attribute_aliases_16.$$arity = 0); | |
Opal.def(self, '$alias_attribute', TMP_ClassMethods_alias_attribute_19 = function $$alias_attribute(new_name, old_name) { | |
var TMP_17, self = this, $writer = nil; | |
$send(["", "=", "_changed?"], 'each', [], (TMP_17 = function(variant){var self = TMP_17.$$s || this, TMP_18; | |
if (variant == null) variant = nil; | |
return $send(self, 'define_method', ["" + (new_name) + (variant)], (TMP_18 = function($a_rest){var self = TMP_18.$$s || this, block, args; | |
block = TMP_18.$$p || nil; | |
if (block) TMP_18.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self, 'send', ["" + (old_name) + (variant)].concat(Opal.to_a(args)), block.$to_proc())}, TMP_18.$$s = self, TMP_18.$$arity = -1, TMP_18))}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17)); | |
$writer = [new_name, old_name]; | |
$send(self.$_attribute_aliases(), '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];; | |
}, TMP_ClassMethods_alias_attribute_19.$$arity = 2); | |
Opal.const_set($nesting[0], 'SERVER_METHODS', ["regulate_relationship", "regulate_scope", "attribute_type_decorations", "defined_enums", "_validators", "timestamped_migrations", "lock_optimistically", "lock_optimistically=", "local_stored_attributes=", "lock_optimistically?", "attribute_aliases?", "attribute_method_matchers?", "defined_enums?", "has_many_without_reactive_record_add_changed_method", "has_many_with_reactive_record_add_changed_method", "belongs_to_without_reactive_record_add_changed_method", "belongs_to_with_reactive_record_add_changed_method", "cache_timestamp_format", "composed_of_with_reactive_record_add_changed_method", "schema_format", "schema_format=", "error_on_ignored_order_or_limit", "error_on_ignored_order_or_limit=", "timestamped_migrations=", "dump_schema_after_migration", "dump_schema_after_migration=", "dump_schemas", "dump_schemas=", "warn_on_records_fetched_greater_than=", "belongs_to_required_by_default", "default_connection_handler", "connection_handler=", "default_connection_handler=", "skip_time_zone_conversion_for_attributes", "skip_time_zone_conversion_for_attributes=", "time_zone_aware_types", "time_zone_aware_types=", "protected_environments", "skip_time_zone_conversion_for_attributes?", "time_zone_aware_types?", "partial_writes", "partial_writes=", "composed_of_without_reactive_record_add_changed_method", "logger", "partial_writes?", "after_initialize", "record_timestamps", "record_timestamps=", "after_find", "after_touch", "before_save", "around_save", "belongs_to_required_by_default=", "default_connection_handler?", "before_create", "around_create", "before_update", "around_update", "after_save", "before_destroy", "around_destroy", "after_create", "after_destroy", "after_update", "_validation_callbacks", "_validation_callbacks?", "_validation_callbacks=", "_initialize_callbacks", "_initialize_callbacks?", "_initialize_callbacks=", "_find_callbacks", "_find_callbacks?", "_find_callbacks=", "_touch_callbacks", "_touch_callbacks?", "_touch_callbacks=", "_save_callbacks", "_save_callbacks?", "_save_callbacks=", "_create_callbacks", "_create_callbacks?", "_create_callbacks=", "_update_callbacks", "_update_callbacks?", "_update_callbacks=", "_destroy_callbacks", "_destroy_callbacks?", "_destroy_callbacks=", "record_timestamps?", "pre_synchromesh_scope", "pre_synchromesh_default_scope", "do_not_synchronize", "do_not_synchronize?", "logger=", "maintain_test_schema", "maintain_test_schema=", "scope", "time_zone_aware_attributes", "time_zone_aware_attributes=", "default_timezone", "default_timezone=", "_attr_readonly", "warn_on_records_fetched_greater_than", "configurations", "configurations=", "_attr_readonly?", "table_name_prefix=", "table_name_suffix=", "schema_migrations_table_name=", "internal_metadata_table_name", "internal_metadata_table_name=", "primary_key_prefix_type", "_attr_readonly=", "pluralize_table_names=", "protected_environments=", "ignored_columns=", "ignored_columns", "index_nested_attribute_errors", "index_nested_attribute_errors=", "primary_key_prefix_type=", "table_name_prefix?", "table_name_suffix?", "schema_migrations_table_name?", "internal_metadata_table_name?", "protected_environments?", "pluralize_table_names?", "ignored_columns?", "store_full_sti_class", "store_full_sti_class=", "nested_attributes_options", "nested_attributes_options=", "store_full_sti_class?", "default_scopes", "default_scope_override", "default_scopes=", "default_scope_override=", "nested_attributes_options?", "cache_timestamp_format=", "cache_timestamp_format?", "reactive_record_association_keys", "_validators=", "has_many", "belongs_to", "composed_of", "belongs_to_without_reactive_record_add_is_method", "_rollback_callbacks", "_commit_callbacks", "_before_commit_callbacks", "attribute_type_decorations=", "_commit_callbacks=", "_commit_callbacks?", "_before_commit_callbacks?", "_before_commit_callbacks=", "_rollback_callbacks=", "_before_commit_without_transaction_enrollment_callbacks?", "_before_commit_without_transaction_enrollment_callbacks=", "_commit_without_transaction_enrollment_callbacks", "_commit_without_transaction_enrollment_callbacks?", "_commit_without_transaction_enrollment_callbacks=", "_rollback_callbacks?", "_rollback_without_transaction_enrollment_callbacks?", "_rollback_without_transaction_enrollment_callbacks=", "_rollback_without_transaction_enrollment_callbacks", "_before_commit_without_transaction_enrollment_callbacks", "aggregate_reflections", "_reflections=", "aggregate_reflections=", "pluralize_table_names", "public_columns_hash", "attributes_to_define_after_schema_loads", "attributes_to_define_after_schema_loads=", "table_name_suffix", "schema_migrations_table_name", "attribute_aliases", "attribute_method_matchers", "connection_handler", "attribute_aliases=", "attribute_method_matchers=", "_validate_callbacks", "_validate_callbacks?", "_validate_callbacks=", "_validators?", "_reflections?", "aggregate_reflections?", "include_root_in_json", "_reflections", "include_root_in_json=", "include_root_in_json?", "local_stored_attributes", "default_scope", "table_name_prefix", "attributes_to_define_after_schema_loads?", "attribute_type_decorations?", "defined_enums=", "suppress", "has_secure_token", "generate_unique_secure_token", "store", "store_accessor", "_store_accessors_module", "stored_attributes", "reflect_on_aggregation", "reflect_on_all_aggregations", "_reflect_on_association", "reflect_on_all_associations", "clear_reflections_cache", "reflections", "reflect_on_association", "reflect_on_all_autosave_associations", "no_touching", "transaction", "after_commit", "after_rollback", "before_commit", "before_commit_without_transaction_enrollment", "after_create_commit", "after_update_commit", "after_destroy_commit", "after_commit_without_transaction_enrollment", "after_rollback_without_transaction_enrollment", "raise_in_transactional_callbacks", "raise_in_transactional_callbacks=", "accepts_nested_attributes_for", "has_secure_password", "has_one", "has_and_belongs_to_many", "before_validation", "after_validation", "serialize", "primary_key", "dangerous_attribute_method?", "get_primary_key", "quoted_primary_key", "define_method_attribute", "reset_primary_key", "primary_key=", "define_method_attribute=", "attribute_names", "initialize_generated_modules", "column_for_attribute", "define_attribute_methods", "undefine_attribute_methods", "instance_method_already_implemented?", "method_defined_within?", "dangerous_class_method?", "class_method_defined_within?", "attribute_method?", "has_attribute?", "generated_attribute_methods", "attribute_method_prefix", "attribute_method_suffix", "attribute_method_affix", "attribute_alias?", "attribute_alias", "define_attribute_method", "update_counters", "locking_enabled?", "locking_column", "locking_column=", "reset_locking_column", "decorate_attribute_type", "decorate_matching_attribute_types", "attribute", "define_attribute", "reset_counters", "increment_counter", "decrement_counter", "validates_absence_of", "validates_length_of", "validates_size_of", "validates_presence_of", "validates_associated", "validates_uniqueness_of", "validates_acceptance_of", "validates_confirmation_of", "validates_exclusion_of", "validates_format_of", "validates_inclusion_of", "validates_numericality_of", "define_callbacks", "normalize_callback_params", "__update_callbacks", "get_callbacks", "set_callback", "set_callbacks", "skip_callback", "reset_callbacks", "deprecated_false_terminator", "define_model_callbacks", "validate", "validators", "validates_each", "validates_with", "clear_validators!", "validators_on", "validates", "_validates_default_keys", "_parse_validates_options", "validates!", "_to_partial_path", "sanitize", "sanitize_sql", "sanitize_conditions", "quote_value", "sanitize_sql_for_conditions", "sanitize_sql_array", "sanitize_sql_for_assignment", "sanitize_sql_hash_for_assignment", "sanitize_sql_for_order", "expand_hash_conditions_for_aggregates", "sanitize_sql_like", "replace_named_bind_variables", "replace_bind_variables", "raise_if_bind_arity_mismatch", "replace_bind_variable", "quote_bound_value", "all", "default_scoped", "valid_scope_name?", "scope_attributes?", "before_remove_const", "ignore_default_scope?", "unscoped", "build_default_scope", "evaluate_default_scope", "ignore_default_scope=", "current_scope", "current_scope=", "scope_attributes", "base_class", "abstract_class?", "finder_needs_type_condition?", "sti_name", "descends_from_active_record?", "abstract_class", "compute_type", "abstract_class=", "table_name", "columns", "table_exists?", "columns_hash", "column_names", "attribute_types", "prefetch_primary_key?", "sequence_name", "quoted_table_name", "_default_attributes", "type_for_attribute", "inheritance_column", "attributes_builder", "inheritance_column=", "reset_table_name", "table_name=", "reset_column_information", "full_table_name_prefix", "full_table_name_suffix", "reset_sequence_name", "sequence_name=", "next_sequence_value", "column_defaults", "content_columns", "readonly_attributes", "attr_readonly", "create", "create!", "instantiate", "find", "type_caster", "arel_table", "find_by", "find_by!", "initialize_find_by_cache", "generated_association_methods", "arel_engine", "arel_attribute", "predicate_builder", "collection_cache_key", "relation_delegate_class", "initialize_relation_delegate_cache", "enum", "collecting_queries_for_explain", "exec_explain", "i18n_scope", "lookup_ancestors", "human_attribute_name", "references", "uniq", "maximum", "none", "exists?", "second", "limit", "order", "eager_load", "update", "delete_all", "destroy", "ids", "many?", "pluck", "third", "delete", "fourth", "fifth", "forty_two", "second_to_last", "third_to_last", "preload", "sum", "take!", "first!", "last!", "second!", "offset", "select", "fourth!", "third!", "third_to_last!", "fifth!", "where", "first_or_create", "second_to_last!", "forty_two!", "first", "having", "any?", "one?", "none?", "find_or_create_by", "from", "first_or_create!", "first_or_initialize", "except", "find_or_create_by!", "find_or_initialize_by", "includes", "destroy_all", "update_all", "or", "find_in_batches", "take", "joins", "find_each", "last", "in_batches", "reorder", "group", "left_joins", "left_outer_joins", "rewhere", "readonly", "create_with", "distinct", "unscope", "calculate", "average", "count_by_sql", "minimum", "lock", "find_by_sql", "count", "cache", "uncached", "connection", "connection_pool", "establish_connection", "connected?", "clear_cache!", "clear_reloadable_connections!", "connection_id", "connection_config", "clear_all_connections!", "remove_connection", "connection_specification_name", "connection_specification_name=", "retrieve_connection", "connection_id=", "clear_active_connections!", "sqlite3_connection", "direct_descendants", "benchmark", "model_name", "with_options", "attr_protected", "attr_accessible"]); | |
Opal.def(self, '$method_missing', TMP_ClassMethods_method_missing_20 = function $$method_missing(name, $a_rest) { | |
var $b, $c, self = this, args, $iter = TMP_ClassMethods_method_missing_20.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_ClassMethods_method_missing_20.$$p = null; | |
if ($truthy(($truthy($b = (($c = args.$count()['$=='](1)) ? name['$start_with?']("find_by_") : args.$count()['$=='](1))) ? block['$!']() : $b))) { | |
return self.$find_by($hash(self.$_dealias_attribute(name.$sub(/^find_by_/, "")), args['$[]'](0))) | |
} else if ($truthy([]['$respond_to?'](name))) { | |
return $send(self.$all(), 'send', [name].concat(Opal.to_a(args)), block.$to_proc()) | |
} else if ($truthy(name['$end_with?']("!"))) { | |
try { | |
return $send(self, 'send', [name.$chop()].concat(Opal.to_a(args)), block.$to_proc()).$send("reload_from_db") | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return nil | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
} else if ($truthy($$($nesting, 'SERVER_METHODS')['$include?'](name)['$!']())) { | |
return self.$raise("" + (self.$name()) + "." + (name) + "(" + (args) + ") (called class method missing)") | |
} else { | |
return nil | |
} | |
}, TMP_ClassMethods_method_missing_20.$$arity = -2); | |
Opal.def(self, '$create', TMP_ClassMethods_create_21 = function $$create($a_rest) { | |
var self = this, args, $iter = TMP_ClassMethods_create_21.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_ClassMethods_create_21.$$p = null; | |
return $send($send(self, 'new', Opal.to_a(args)), 'save', [], block.$to_proc()) | |
}, TMP_ClassMethods_create_21.$$arity = -1); | |
Opal.def(self, '$scope', TMP_ClassMethods_scope_23 = function $$scope(name, $a_rest) { | |
var TMP_22, self = this, args, opts = nil, scope_description = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
opts = self.$_synchromesh_scope_args_check(args); | |
scope_description = $$$($$($nesting, 'ReactiveRecord'), 'ScopeDescription').$new(self, name, opts); | |
return $send(self.$singleton_class(), 'send', ["define_method", name], (TMP_22 = function($a_rest){var self = TMP_22.$$s || this, vargs; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
vargs = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
vargs[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$all(), 'build_child_scope', [scope_description].concat(Opal.to_a(name)).concat(Opal.to_a(vargs)))}, TMP_22.$$s = self, TMP_22.$$arity = -1, TMP_22)); | |
}, TMP_ClassMethods_scope_23.$$arity = -2); | |
Opal.def(self, '$default_scope', TMP_ClassMethods_default_scope_24 = function $$default_scope($a_rest) { | |
var $b, self = this, args, $iter = TMP_ClassMethods_default_scope_24.$$p, block = $iter || nil, opts = nil; | |
if (self._default_scopes == null) self._default_scopes = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_ClassMethods_default_scope_24.$$p = null; | |
opts = self.$_synchromesh_scope_args_check([].concat(Opal.to_a(block)).concat(Opal.to_a(args))); | |
self._default_scopes = ($truthy($b = self._default_scopes) ? $b : []); | |
return self._default_scopes['$<<'](opts); | |
}, TMP_ClassMethods_default_scope_24.$$arity = -1); | |
Opal.def(self, '$all', TMP_ClassMethods_all_26 = function $$all() { | |
var $a, $b, TMP_25, self = this, $logical_op_recvr_tmp_2 = nil, $writer = nil, root = nil; | |
if (self._default_scopes == null) self._default_scopes = nil; | |
$logical_op_recvr_tmp_2 = $$$($$($nesting, 'ReactiveRecord'), 'Base').$default_scope(); | |
return ($truthy($a = $logical_op_recvr_tmp_2['$[]'](self)) ? $a : (($writer = [self, ((root = $$$($$($nesting, 'ReactiveRecord'), 'Collection').$new(self, nil, nil, self, "all").$extend($$$($$($nesting, 'ReactiveRecord'), 'UnscopedCollection'))), $send(($truthy($b = self._default_scopes) ? $b : [$hash2(["client"], {"client": self.$_all_filter()})]), 'inject', [root], (TMP_25 = function(scope, opts){var self = TMP_25.$$s || this; | |
if (scope == null) scope = nil;if (opts == null) opts = nil; | |
return scope.$build_child_scope($$$($$($nesting, 'ReactiveRecord'), 'ScopeDescription').$new(self, "all", opts))}, TMP_25.$$s = self, TMP_25.$$arity = 2, TMP_25)))]), $send($logical_op_recvr_tmp_2, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])); | |
}, TMP_ClassMethods_all_26.$$arity = 0); | |
Opal.def(self, '$_all_filter', TMP_ClassMethods__all_filter_28 = function $$_all_filter() { | |
var TMP_27, self = this, defining_class_is_base_class = nil, defining_model_name = nil; | |
defining_class_is_base_class = self.$base_class()['$=='](self); | |
defining_model_name = self.$model_name(); | |
return $send(self, 'lambda', [], (TMP_27 = function(){var self = TMP_27.$$s || this, $a, $b, ic = nil; | |
ic = self.$class().$inheritance_column(); | |
return ($truthy($a = ($truthy($b = defining_class_is_base_class) ? $b : ic['$!']())) ? $a : self['$[]'](ic)['$=='](defining_model_name));}, TMP_27.$$s = self, TMP_27.$$arity = 0, TMP_27)); | |
}, TMP_ClassMethods__all_filter_28.$$arity = 0); | |
Opal.def(self, '$unscoped', TMP_ClassMethods_unscoped_29 = function $$unscoped() { | |
var $a, self = this, $logical_op_recvr_tmp_3 = nil, $writer = nil; | |
$logical_op_recvr_tmp_3 = $$$($$($nesting, 'ReactiveRecord'), 'Base').$unscoped(); | |
return ($truthy($a = $logical_op_recvr_tmp_3['$[]'](self)) ? $a : (($writer = [self, $$$($$($nesting, 'ReactiveRecord'), 'Collection').$new(self, nil, nil, self, "unscoped").$extend($$$($$($nesting, 'ReactiveRecord'), 'UnscopedCollection'))]), $send($logical_op_recvr_tmp_3, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])); | |
}, TMP_ClassMethods_unscoped_29.$$arity = 0); | |
Opal.def(self, '$finder_method', TMP_ClassMethods_finder_method_32 = function $$finder_method(name) { | |
var TMP_30, self = this; | |
$$$($$($nesting, 'ReactiveRecord'), 'ScopeDescription').$new(self, "" + "_" + (name), $hash2([], {})); | |
return $send([name, "" + (name) + "!"], 'each', [], (TMP_30 = function(method){var self = TMP_30.$$s || this, TMP_31; | |
if (method == null) method = nil; | |
return $send(self.$singleton_class(), 'send', ["define_method", method], (TMP_31 = function($a_rest){var self = TMP_31.$$s || this, vargs; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
vargs = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
vargs[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$all(), 'apply_scope', ["" + "_" + (method)].concat(Opal.to_a(vargs))).$first()}, TMP_31.$$s = self, TMP_31.$$arity = -1, TMP_31))}, TMP_30.$$s = self, TMP_30.$$arity = 1, TMP_30)); | |
}, TMP_ClassMethods_finder_method_32.$$arity = 1); | |
Opal.def(self, '$abstract_class=', TMP_ClassMethods_abstract_class$eq_33 = function(val) { | |
var self = this; | |
return (self.abstract_class = val) | |
}, TMP_ClassMethods_abstract_class$eq_33.$$arity = 1); | |
$send(["belongs_to", "has_many", "has_one"], 'each', [], (TMP_ClassMethods_34 = function(macro){var self = TMP_ClassMethods_34.$$s || this, TMP_35; | |
if (macro == null) macro = nil; | |
return $send(self, 'define_method', [macro], (TMP_35 = function($a_rest){var self = TMP_35.$$s || this, args, $b, TMP_36, TMP_37, TMP_38, TMP_39, name = nil, opts = nil, assoc = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
name = args.$first(); | |
opts = (function() {if ($truthy(($truthy($b = $rb_gt(args.$count(), 1)) ? args.$last()['$is_a?']($$($nesting, 'Hash')) : $b))) { | |
return args.$last() | |
} else { | |
return $hash2([], {}) | |
}; return nil; })(); | |
assoc = $$$($$($nesting, 'Associations'), 'AssociationReflection').$new(self, macro, name, opts); | |
if (macro['$==']("has_many")) { | |
$send(self, 'define_method', [name], (TMP_36 = function(){var self = TMP_36.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_has_many(assoc, nil)}, TMP_36.$$s = self, TMP_36.$$arity = 0, TMP_36)); | |
$send(self, 'define_method', ["" + (name) + "="], (TMP_37 = function(val){var self = TMP_37.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (val == null) val = nil; | |
return self.backing_record.$set_has_many(assoc, val)}, TMP_37.$$s = self, TMP_37.$$arity = 1, TMP_37)); | |
} else { | |
$send(self, 'define_method', [name], (TMP_38 = function(){var self = TMP_38.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_belongs_to(assoc, nil)}, TMP_38.$$s = self, TMP_38.$$arity = 0, TMP_38)); | |
$send(self, 'define_method', ["" + (name) + "="], (TMP_39 = function(val){var self = TMP_39.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (val == null) val = nil; | |
return self.backing_record.$set_belongs_to(assoc, val)}, TMP_39.$$s = self, TMP_39.$$arity = 1, TMP_39)); | |
}; | |
return assoc;}, TMP_35.$$s = self, TMP_35.$$arity = -1, TMP_35))}, TMP_ClassMethods_34.$$s = self, TMP_ClassMethods_34.$$arity = 1, TMP_ClassMethods_34)); | |
Opal.def(self, '$composed_of', TMP_ClassMethods_composed_of_44 = function $$composed_of(name, opts) { | |
var TMP_40, TMP_41, TMP_42, TMP_43, self = this, reflection = nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
reflection = $$$($$($nesting, 'Aggregations'), 'AggregationReflection').$new(self.$base_class(), "composed_of", name, opts); | |
if ($truthy($rb_lt(reflection.$klass(), $$$($$($nesting, 'ActiveRecord'), 'Base')))) { | |
$send(self, 'define_method', [name], (TMP_40 = function(){var self = TMP_40.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_ar_aggregate(reflection, nil)}, TMP_40.$$s = self, TMP_40.$$arity = 0, TMP_40)); | |
return $send(self, 'define_method', ["" + (name) + "="], (TMP_41 = function(val){var self = TMP_41.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (val == null) val = nil; | |
return self.backing_record.$set_ar_aggregate(reflection, val)}, TMP_41.$$s = self, TMP_41.$$arity = 1, TMP_41)); | |
} else { | |
$send(self, 'define_method', [name], (TMP_42 = function(){var self = TMP_42.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_non_ar_aggregate(name, nil)}, TMP_42.$$s = self, TMP_42.$$arity = 0, TMP_42)); | |
return $send(self, 'define_method', ["" + (name) + "="], (TMP_43 = function(val){var self = TMP_43.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (val == null) val = nil; | |
return self.backing_record.$set_non_ar_aggregate(reflection, val)}, TMP_43.$$s = self, TMP_43.$$arity = 1, TMP_43)); | |
}; | |
}, TMP_ClassMethods_composed_of_44.$$arity = -2); | |
Opal.def(self, '$column_names', TMP_ClassMethods_column_names_45 = function $$column_names() { | |
var self = this; | |
return $$$($$($nesting, 'ReactiveRecord'), 'Base').$public_columns_hash().$keys() | |
}, TMP_ClassMethods_column_names_45.$$arity = 0); | |
Opal.def(self, '$columns_hash', TMP_ClassMethods_columns_hash_46 = function $$columns_hash() { | |
var $a, self = this; | |
return ($truthy($a = $$$($$($nesting, 'ReactiveRecord'), 'Base').$public_columns_hash()['$[]'](self.$name())) ? $a : $hash2([], {})) | |
}, TMP_ClassMethods_columns_hash_46.$$arity = 0); | |
Opal.def(self, '$server_methods', TMP_ClassMethods_server_methods_47 = function $$server_methods() { | |
var $a, self = this; | |
if (self.server_methods == null) self.server_methods = nil; | |
return (self.server_methods = ($truthy($a = self.server_methods) ? $a : $hash2([], {}))) | |
}, TMP_ClassMethods_server_methods_47.$$arity = 0); | |
Opal.def(self, '$server_method', TMP_ClassMethods_server_method_50 = function $$server_method(name, $kwargs) { | |
var TMP_48, TMP_49, self = this, default$, $writer = nil; | |
if ($kwargs == null || !$kwargs.$$is_hash) { | |
if ($kwargs == null) { | |
$kwargs = $hash2([], {}); | |
} else { | |
throw Opal.ArgumentError.$new('expected kwargs'); | |
} | |
} | |
default$ = $kwargs.$$smap["default"]; | |
if (default$ == null) { | |
default$ = nil | |
} | |
$writer = [name, $hash2(["default"], {"default": default$})]; | |
$send(self.$server_methods(), '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$send(self, 'define_method', [name], (TMP_48 = function($a_rest){var self = TMP_48.$$s || this, args, vector = nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
vector = (function() {if ($truthy(args.$count()['$zero?']())) { | |
return name | |
} else { | |
return [$rb_plus([name], args)] | |
}; return nil; })(); | |
return self.backing_record.$get_server_method(vector, nil);}, TMP_48.$$s = self, TMP_48.$$arity = -1, TMP_48)); | |
return $send(self, 'define_method', ["" + (name) + "!"], (TMP_49 = function($a_rest){var self = TMP_49.$$s || this, args, vector = nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
vector = (function() {if ($truthy(args.$count()['$zero?']())) { | |
return name | |
} else { | |
return [$rb_plus([name], args)] | |
}; return nil; })(); | |
return self.backing_record.$get_server_method(vector, true);}, TMP_49.$$s = self, TMP_49.$$arity = -1, TMP_49)); | |
}, TMP_ClassMethods_server_method_50.$$arity = -2); | |
Opal.def(self, '$define_attribute_methods', TMP_ClassMethods_define_attribute_methods_57 = function $$define_attribute_methods() { | |
var TMP_51, $a, self = this, $writer = nil; | |
$send(self.$columns_hash(), 'each', [], (TMP_51 = function(name, column_hash){var self = TMP_51.$$s || this, TMP_52, TMP_53, TMP_54, TMP_55, TMP_56; | |
if (name == null) name = nil;if (column_hash == null) column_hash = nil; | |
if (name['$=='](self.$primary_key())) { | |
return nil;}; | |
$send(self, 'define_method', [name], (TMP_52 = function(){var self = TMP_52.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_attr_value(name, nil)}, TMP_52.$$s = self, TMP_52.$$arity = 0, TMP_52)); | |
$send(self, 'define_method', ["" + (name) + "!"], (TMP_53 = function(){var self = TMP_53.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_attr_value(name, true)}, TMP_53.$$s = self, TMP_53.$$arity = 0, TMP_53)); | |
$send(self, 'define_method', ["" + (name) + "="], (TMP_54 = function(val){var self = TMP_54.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (val == null) val = nil; | |
return self.backing_record.$set_attr_value(name, val)}, TMP_54.$$s = self, TMP_54.$$arity = 1, TMP_54)); | |
$send(self, 'define_method', ["" + (name) + "_changed?"], (TMP_55 = function(){var self = TMP_55.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record['$changed?'](name)}, TMP_55.$$s = self, TMP_55.$$arity = 0, TMP_55)); | |
return $send(self, 'define_method', ["" + (name) + "?"], (TMP_56 = function(){var self = TMP_56.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_attr_value(name, nil)['$present?']()}, TMP_56.$$s = self, TMP_56.$$arity = 0, TMP_56));}, TMP_51.$$s = self, TMP_51.$$arity = 2, TMP_51)); | |
if ($truthy(($truthy($a = self.$inheritance_column()) ? self.$columns_hash()['$key?'](self.$inheritance_column())['$!']() : $a))) { | |
$writer = [nil]; | |
$send(self, 'inheritance_column=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return nil | |
}; | |
}, TMP_ClassMethods_define_attribute_methods_57.$$arity = 0); | |
Opal.def(self, '$_react_param_conversion', TMP_ClassMethods__react_param_conversion_61 = function $$_react_param_conversion(param, opt) { | |
var $a, TMP_58, TMP_60, self = this, result = nil, klass = nil, target = nil, associations = nil; | |
if (opt == null) { | |
opt = nil; | |
} | |
param = self.$Native(param); | |
if ($truthy(param['$is_a?']($$$($$($nesting, 'Native'), 'Object')))) { | |
param = $$($nesting, 'JSON').$from_object(param.$to_n())}; | |
result = (function() {if ($truthy(param['$is_a?'](self))) { | |
return param | |
} else if ($truthy(param['$is_a?']($$($nesting, 'Hash')))) { | |
if (opt['$==']("validate_only")) { | |
klass = $$$($$($nesting, 'ReactiveRecord'), 'Base').$infer_type_from_hash(self, param); | |
return ($truthy($a = klass['$=='](self)) ? $a : $rb_lt(klass, self)); | |
} else { | |
target = (function() {if ($truthy(param['$[]'](self.$primary_key()))) { | |
return self.$find(param['$[]'](self.$primary_key())) | |
} else { | |
return self.$new() | |
}; return nil; })(); | |
associations = self.$reflect_on_all_associations(); | |
param = $send(param, 'collect', [], (TMP_58 = function(key, value){var self = TMP_58.$$s || this, TMP_59, assoc = nil; | |
if (key == null) key = nil;if (value == null) value = nil; | |
assoc = $send(associations, 'detect', [], (TMP_59 = function(association){var self = TMP_59.$$s || this; | |
if (association == null) association = nil; | |
return association.$association_foreign_key()['$=='](key)}, TMP_59.$$s = self, TMP_59.$$arity = 1, TMP_59)); | |
if ($truthy(assoc)) { | |
if ($truthy(value)) { | |
return [assoc.$attribute(), $hash2(["id"], {"id": [value]})] | |
} else { | |
return [assoc.$attribute(), [nil]] | |
} | |
} else { | |
return [key, [value]] | |
};}, TMP_58.$$s = self, TMP_58.$$arity = 2, TMP_58)); | |
$send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'load_data', [], (TMP_60 = function(){var self = TMP_60.$$s || this; | |
return $$$($$($nesting, 'ReactiveRecord'), 'ServerDataCache').$load_from_json($$($nesting, 'Hash')['$[]'](param), target)}, TMP_60.$$s = self, TMP_60.$$arity = 0, TMP_60)); | |
return target.$cast_to_current_sti_type(); | |
} | |
} else { | |
return nil | |
}; return nil; })(); | |
return result; | |
}, TMP_ClassMethods__react_param_conversion_61.$$arity = -2); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/error.rb": | |
/*!*************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/error.rb ***! | |
\*************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/error"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$attr_reader', '$new', '$[]=', '$-', '$each', '$uniq', '$[]', '$messages', '$delete', '$empty?', '$clear', '$include?', '$<<']); | |
return (function($base, $parent_nesting) { | |
function $ActiveModel() {}; | |
var self = $ActiveModel = $module($base, 'ActiveModel', $ActiveModel); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Error(){}; | |
var self = $Error = $klass($base, $super, 'Error', $Error); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Error_initialize_3, TMP_Error_$$_4, TMP_Error_delete_5, TMP_Error_empty$q_6, TMP_Error_clear_7, TMP_Error_add_8; | |
def.messages = nil; | |
self.$attr_reader("messages"); | |
Opal.def(self, '$initialize', TMP_Error_initialize_3 = function $$initialize(initial_msgs) { | |
var TMP_1, TMP_2, self = this; | |
if (initial_msgs == null) { | |
initial_msgs = $hash2([], {}); | |
} | |
self.messages = $send($$($nesting, 'Hash'), 'new', [], (TMP_1 = function(h, k){var self = TMP_1.$$s || this, $writer = nil; | |
if (h == null) h = nil;if (k == null) k = nil; | |
$writer = [k, []]; | |
$send(h, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1)); | |
return $send(initial_msgs, 'each', [], (TMP_2 = function(attr, msgs){var self = TMP_2.$$s || this, $writer = nil; | |
if (self.messages == null) self.messages = nil; | |
if (attr == null) attr = nil;if (msgs == null) msgs = nil; | |
$writer = [attr, msgs.$uniq()]; | |
$send(self.messages, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2)); | |
}, TMP_Error_initialize_3.$$arity = -1); | |
Opal.def(self, '$[]', TMP_Error_$$_4 = function(attribute) { | |
var self = this; | |
return self.$messages()['$[]'](attribute) | |
}, TMP_Error_$$_4.$$arity = 1); | |
Opal.def(self, '$delete', TMP_Error_delete_5 = function(attribute) { | |
var self = this; | |
return self.$messages().$delete(attribute) | |
}, TMP_Error_delete_5.$$arity = 1); | |
Opal.def(self, '$empty?', TMP_Error_empty$q_6 = function() { | |
var self = this; | |
return self.$messages()['$empty?']() | |
}, TMP_Error_empty$q_6.$$arity = 0); | |
Opal.def(self, '$clear', TMP_Error_clear_7 = function $$clear() { | |
var self = this; | |
return self.messages.$clear() | |
}, TMP_Error_clear_7.$$arity = 0); | |
return (Opal.def(self, '$add', TMP_Error_add_8 = function $$add(attribute, $kwargs) { | |
var self = this, message; | |
if ($kwargs == null || !$kwargs.$$is_hash) { | |
if ($kwargs == null) { | |
$kwargs = $hash2([], {}); | |
} else { | |
throw Opal.ArgumentError.$new('expected kwargs'); | |
} | |
} | |
if (!Opal.hasOwnProperty.call($kwargs.$$smap, 'message')) { | |
throw Opal.ArgumentError.$new('missing keyword: message'); | |
} | |
message = $kwargs.$$smap["message"]; | |
if ($truthy(self.messages['$[]'](attribute)['$include?'](message))) { | |
return nil | |
} else { | |
return self.messages['$[]'](attribute)['$<<'](message) | |
} | |
}, TMP_Error_add_8.$$arity = 2), nil) && 'add'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/errors.rb": | |
/*!**************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/errors.rb ***! | |
\**************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var active_support_core_ext_string_inflections_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! active_support/core_ext/string/inflections.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/gems/opal-activesupport-0.3.1/opal/active_support/core_ext/string/inflections.rb"); | |
if (typeof global.Opal.modules["active_support/core_ext/string/inflections"] === 'undefined') { | |
if (typeof active_support_core_ext_string_inflections_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(active_support_core_ext_string_inflections_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/errors"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$require', '$include', '$attr_reader', '$apply_default_array', '$reactive_empty!', '$[]', '$messages', '$each_key', '$each', '$delete', '$details', '$size', '$flatten', '$values', '$keys', '$select', '$!', '$empty?', '$==', '$capitalize', '$gsub', '$tr', '$to_s', '$human_attribute_name', '$class', '$map', '$full_message', '$each_with_object', '$[]=', '$-', '$without_default_proc', '$to_hash', '$zero?', '$get_state', '$clear', '$tap', '$merge!', '$+', '$to_sym', '$key?', '$present?', '$respond_to?', '$call', '$normalize_detail', '$normalize_message', '$<<', '$include?', '$private', '$proc', '$default_proc=', '$generate_message', '$reject', '$merge', '$dup', '$data_loading?', '$set_state']); | |
self.$require("active_support/core_ext/string/inflections"); | |
return (function($base, $parent_nesting) { | |
function $ActiveModel() {}; | |
var self = $ActiveModel = $module($base, 'ActiveModel', $ActiveModel); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Errors(){}; | |
var self = $Errors = $klass($base, $super, 'Errors', $Errors); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Errors_initialize_1, TMP_Errors_$$_2, TMP_Errors_each_5, TMP_Errors_delete_6, TMP_Errors_size_7, TMP_Errors_keys_9, TMP_Errors_values_11, TMP_Errors_full_message_12, TMP_Errors_full_messages_14, TMP_Errors_full_messages_for_16, TMP_Errors_to_hash_19, TMP_Errors_as_json_20, TMP_Errors_generate_message_21, TMP_Errors_empty$q_22, TMP_Errors_reactive_empty$q_23, TMP_Errors_clear_25, TMP_Errors_merge$B_29, TMP_Errors_include$q_30, TMP_Errors_add_32, TMP_Errors_added$q_34, TMP_Errors_apply_default_array_36, TMP_Errors_normalize_message_38, TMP_Errors_normalize_detail_40, TMP_Errors_without_default_proc_42, TMP_Errors_reactive_empty$B_43; | |
def.base = def.messages = def.details = nil; | |
self.$include($$($nesting, 'Enumerable')); | |
Opal.const_set($nesting[0], 'CALLBACKS_OPTIONS', ["if", "unless", "on", "allow_nil", "allow_blank", "strict"]); | |
Opal.const_set($nesting[0], 'MESSAGE_OPTIONS', ["message"]); | |
self.$attr_reader("messages", "details"); | |
Opal.def(self, '$initialize', TMP_Errors_initialize_1 = function $$initialize(base) { | |
var self = this; | |
if (base == null) { | |
base = $hash2([], {}); | |
} | |
self.base = base; | |
self.messages = self.$apply_default_array($hash2([], {})); | |
self.details = self.$apply_default_array($hash2([], {})); | |
return self['$reactive_empty!'](true); | |
}, TMP_Errors_initialize_1.$$arity = -1); | |
Opal.def(self, '$[]', TMP_Errors_$$_2 = function(attribute) { | |
var self = this; | |
return self.$messages()['$[]'](attribute) | |
}, TMP_Errors_$$_2.$$arity = 1); | |
Opal.def(self, '$each', TMP_Errors_each_5 = function $$each() { | |
var TMP_3, self = this, $iter = TMP_Errors_each_5.$$p, $yield = $iter || nil; | |
if ($iter) TMP_Errors_each_5.$$p = null; | |
return $send(self.$messages(), 'each_key', [], (TMP_3 = function(attribute){var self = TMP_3.$$s || this, TMP_4; | |
if (attribute == null) attribute = nil; | |
return $send(self.$messages()['$[]'](attribute), 'each', [], (TMP_4 = function(error){var self = TMP_4.$$s || this; | |
if (error == null) error = nil; | |
return Opal.yieldX($yield, [attribute, error]);}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4))}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3)) | |
}, TMP_Errors_each_5.$$arity = 0); | |
Opal.def(self, '$delete', TMP_Errors_delete_6 = function(attribute) { | |
var self = this; | |
self.$details().$delete(attribute); | |
return self.$messages().$delete(attribute); | |
}, TMP_Errors_delete_6.$$arity = 1); | |
Opal.def(self, '$size', TMP_Errors_size_7 = function $$size() { | |
var self = this; | |
return self.$values().$flatten().$size() | |
}, TMP_Errors_size_7.$$arity = 0); | |
Opal.alias(self, "count", "size"); | |
Opal.def(self, '$keys', TMP_Errors_keys_9 = function $$keys() { | |
var TMP_8, self = this; | |
return $send(self.$messages(), 'select', [], (TMP_8 = function(key, value){var self = TMP_8.$$s || this; | |
if (key == null) key = nil;if (value == null) value = nil; | |
return value['$empty?']()['$!']()}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8)).$keys() | |
}, TMP_Errors_keys_9.$$arity = 0); | |
Opal.def(self, '$values', TMP_Errors_values_11 = function $$values() { | |
var TMP_10, self = this; | |
return $send(self.$messages(), 'select', [], (TMP_10 = function(key, value){var self = TMP_10.$$s || this; | |
if (key == null) key = nil;if (value == null) value = nil; | |
return value['$empty?']()['$!']()}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10)).$values() | |
}, TMP_Errors_values_11.$$arity = 0); | |
Opal.def(self, '$full_message', TMP_Errors_full_message_12 = function $$full_message(attribute, message) { | |
var self = this, attr_name = nil; | |
if (attribute['$==']("base")) { | |
return message}; | |
attr_name = attribute.$to_s().$tr(".", "_").$tr("_", " ").$gsub(/_id$/, "").$capitalize(); | |
attr_name = self.base.$class().$human_attribute_name(attribute, $hash2(["default"], {"default": attr_name})); | |
return "" + (attr_name) + " " + (message); | |
}, TMP_Errors_full_message_12.$$arity = 2); | |
Opal.def(self, '$full_messages', TMP_Errors_full_messages_14 = function $$full_messages() { | |
var TMP_13, self = this; | |
return $send(self, 'map', [], (TMP_13 = function(attribute, message){var self = TMP_13.$$s || this; | |
if (attribute == null) attribute = nil;if (message == null) message = nil; | |
return self.$full_message(attribute, message)}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13)) | |
}, TMP_Errors_full_messages_14.$$arity = 0); | |
Opal.alias(self, "to_a", "full_messages"); | |
Opal.def(self, '$full_messages_for', TMP_Errors_full_messages_for_16 = function $$full_messages_for(attribute) { | |
var TMP_15, self = this; | |
return $send(self.$messages()['$[]'](attribute), 'map', [], (TMP_15 = function(message){var self = TMP_15.$$s || this; | |
if (message == null) message = nil; | |
return self.$full_message(attribute, message)}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15)) | |
}, TMP_Errors_full_messages_for_16.$$arity = 1); | |
Opal.def(self, '$to_hash', TMP_Errors_to_hash_19 = function $$to_hash(full_messages) { | |
var TMP_17, self = this; | |
if (full_messages == null) { | |
full_messages = false; | |
} | |
if ($truthy(full_messages)) { | |
return $send(self.$messages(), 'each_with_object', [$hash2([], {})], (TMP_17 = function($a, messages){var self = TMP_17.$$s || this, $a_args, attribute, array, TMP_18, $writer = nil; | |
if ($a == null) { | |
$a = nil; | |
} | |
$a = Opal.to_ary($a); | |
$a_args = Opal.slice.call($a, 0, $a.length); | |
attribute = $a_args.splice(0,1)[0]; | |
if (attribute == null) { | |
attribute = nil; | |
} | |
array = $a_args.splice(0,1)[0]; | |
if (array == null) { | |
array = nil; | |
}if (messages == null) messages = nil; | |
$writer = [attribute, $send(array, 'map', [], (TMP_18 = function(message){var self = TMP_18.$$s || this; | |
if (message == null) message = nil; | |
return self.$full_message(attribute, message)}, TMP_18.$$s = self, TMP_18.$$arity = 1, TMP_18))]; | |
$send(messages, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_17.$$s = self, TMP_17.$$arity = 2, TMP_17.$$has_top_level_mlhs_arg = true, TMP_17)) | |
} else { | |
return self.$without_default_proc(self.$messages()) | |
} | |
}, TMP_Errors_to_hash_19.$$arity = -1); | |
Opal.def(self, '$as_json', TMP_Errors_as_json_20 = function $$as_json(options) { | |
var $a, self = this; | |
if (options == null) { | |
options = nil; | |
} | |
return self.$to_hash(($truthy($a = options) ? options['$[]']("full_messages") : $a)) | |
}, TMP_Errors_as_json_20.$$arity = -1); | |
Opal.def(self, '$generate_message', TMP_Errors_generate_message_21 = function $$generate_message(attribute, type, options) { | |
var $a, self = this; | |
if (type == null) { | |
type = "invalid"; | |
} | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
return ($truthy($a = options.$delete("message")) ? $a : type) | |
}, TMP_Errors_generate_message_21.$$arity = -2); | |
Opal.def(self, '$empty?', TMP_Errors_empty$q_22 = function() { | |
var self = this; | |
return self.$size()['$zero?']() | |
}, TMP_Errors_empty$q_22.$$arity = 0); | |
Opal.alias(self, "blank?", "empty?"); | |
Opal.def(self, '$reactive_empty?', TMP_Errors_reactive_empty$q_23 = function() { | |
var self = this; | |
return $$$($$($nesting, 'React'), 'State').$get_state(self, "ERRORS?") | |
}, TMP_Errors_reactive_empty$q_23.$$arity = 0); | |
Opal.def(self, '$clear', TMP_Errors_clear_25 = function $$clear() { | |
var TMP_24, self = this; | |
self.$messages().$clear(); | |
return $send(self.$details().$clear(), 'tap', [], (TMP_24 = function(){var self = TMP_24.$$s || this; | |
return self['$reactive_empty!'](true)}, TMP_24.$$s = self, TMP_24.$$arity = 0, TMP_24)); | |
}, TMP_Errors_clear_25.$$arity = 0); | |
Opal.def(self, '$merge!', TMP_Errors_merge$B_29 = function(other) { | |
var TMP_26, TMP_27, TMP_28, self = this; | |
$send(self.messages, 'merge!', [other.$messages()], (TMP_26 = function(_, ary1, ary2){var self = TMP_26.$$s || this; | |
if (_ == null) _ = nil;if (ary1 == null) ary1 = nil;if (ary2 == null) ary2 = nil; | |
return $rb_plus(ary1, ary2)}, TMP_26.$$s = self, TMP_26.$$arity = 3, TMP_26)); | |
return $send($send(self.details, 'merge!', [other.$details()], (TMP_27 = function(_, ary1, ary2){var self = TMP_27.$$s || this; | |
if (_ == null) _ = nil;if (ary1 == null) ary1 = nil;if (ary2 == null) ary2 = nil; | |
return $rb_plus(ary1, ary2)}, TMP_27.$$s = self, TMP_27.$$arity = 3, TMP_27)), 'tap', [], (TMP_28 = function(){var self = TMP_28.$$s || this; | |
return self['$reactive_empty!']()}, TMP_28.$$s = self, TMP_28.$$arity = 0, TMP_28)); | |
}, TMP_Errors_merge$B_29.$$arity = 1); | |
Opal.def(self, '$include?', TMP_Errors_include$q_30 = function(attribute) { | |
var $a, self = this; | |
attribute = attribute.$to_sym(); | |
return ($truthy($a = self.$messages()['$key?'](attribute)) ? self.$messages()['$[]'](attribute)['$present?']() : $a); | |
}, TMP_Errors_include$q_30.$$arity = 1); | |
Opal.alias(self, "has_key?", "include?"); | |
Opal.alias(self, "key?", "include?"); | |
Opal.def(self, '$add', TMP_Errors_add_32 = function $$add(attribute, message, options) { | |
var TMP_31, self = this, detail = nil; | |
if (message == null) { | |
message = "invalid"; | |
} | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($truthy(message['$respond_to?']("call"))) { | |
message = message.$call()}; | |
detail = self.$normalize_detail(message, options); | |
message = self.$normalize_message(attribute, message, options); | |
self.$details()['$[]'](attribute.$to_sym())['$<<'](detail); | |
return $send(self.$messages()['$[]'](attribute.$to_sym())['$<<'](message), 'tap', [], (TMP_31 = function(){var self = TMP_31.$$s || this; | |
return self['$reactive_empty!'](false)}, TMP_31.$$s = self, TMP_31.$$arity = 0, TMP_31)); | |
}, TMP_Errors_add_32.$$arity = -2); | |
Opal.def(self, '$added?', TMP_Errors_added$q_34 = function(attribute, message, options) { | |
var TMP_33, self = this; | |
if (message == null) { | |
message = "invalid"; | |
} | |
if (options == null) { | |
options = $hash2([], {}); | |
} | |
if ($truthy($send(self.$details()['$[]'](attribute), 'map', [], (TMP_33 = function(e){var self = TMP_33.$$s || this; | |
if (e == null) e = nil; | |
return e['$[]']("error")}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33))['$include?'](message))) { | |
return true}; | |
if ($truthy(message['$respond_to?']("call"))) { | |
message = message.$call()}; | |
message = self.$normalize_message(attribute, message, options); | |
return self['$[]'](attribute)['$include?'](message); | |
}, TMP_Errors_added$q_34.$$arity = -2); | |
self.$private(); | |
Opal.def(self, '$apply_default_array', TMP_Errors_apply_default_array_36 = function $$apply_default_array(hash) { | |
var TMP_35, self = this, $writer = nil; | |
$writer = [$send(self, 'proc', [], (TMP_35 = function(h, key){var self = TMP_35.$$s || this; | |
if (h == null) h = nil;if (key == null) key = nil; | |
$writer = [key, []]; | |
$send(h, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_35.$$s = self, TMP_35.$$arity = 2, TMP_35))]; | |
$send(hash, 'default_proc=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
return hash; | |
}, TMP_Errors_apply_default_array_36.$$arity = 1); | |
Opal.def(self, '$normalize_message', TMP_Errors_normalize_message_38 = function $$normalize_message(attribute, message, options) { | |
var TMP_37, self = this; | |
return self.$generate_message(attribute, message, $send(options, 'reject', [], (TMP_37 = function(k, _){var self = TMP_37.$$s || this; | |
if (k == null) k = nil;if (_ == null) _ = nil; | |
return $$($nesting, 'CALLBACKS_OPTIONS')['$include?'](k)}, TMP_37.$$s = self, TMP_37.$$arity = 2, TMP_37))) | |
}, TMP_Errors_normalize_message_38.$$arity = 3); | |
Opal.def(self, '$normalize_detail', TMP_Errors_normalize_detail_40 = function $$normalize_detail(message, options) { | |
var TMP_39, self = this, ignore = nil; | |
ignore = $rb_plus($$($nesting, 'CALLBACKS_OPTIONS'), $$($nesting, 'MESSAGE_OPTIONS')); | |
return $hash2(["error"], {"error": message}).$merge($send(options, 'reject', [], (TMP_39 = function(k, _){var self = TMP_39.$$s || this; | |
if (k == null) k = nil;if (_ == null) _ = nil; | |
return ignore['$include?'](k)}, TMP_39.$$s = self, TMP_39.$$arity = 2, TMP_39))); | |
}, TMP_Errors_normalize_detail_40.$$arity = 2); | |
Opal.def(self, '$without_default_proc', TMP_Errors_without_default_proc_42 = function $$without_default_proc(hash) { | |
var TMP_41, self = this; | |
return $send(hash.$dup(), 'tap', [], (TMP_41 = function(new_h){var self = TMP_41.$$s || this, $writer = nil; | |
if (new_h == null) new_h = nil; | |
$writer = [nil]; | |
$send(new_h, 'default_proc=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_41.$$s = self, TMP_41.$$arity = 1, TMP_41)) | |
}, TMP_Errors_without_default_proc_42.$$arity = 1); | |
return (Opal.def(self, '$reactive_empty!', TMP_Errors_reactive_empty$B_43 = function(state) { | |
var self = this; | |
if (state == null) { | |
state = self['$empty?'](); | |
} | |
if ($truthy($$$($$($nesting, 'ReactiveRecord'), 'Base')['$data_loading?']())) { | |
return nil | |
} else { | |
return $$$($$($nesting, 'React'), 'State').$set_state(self, "ERRORS?", state) | |
} | |
}, TMP_Errors_reactive_empty$B_43.$$arity = -1), nil) && 'reactive_empty!'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/instance_methods.rb": | |
/*!************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/instance_methods.rb ***! | |
\************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/instance_methods"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $truthy = Opal.truthy, $hash2 = Opal.hash2, $send = Opal.send; | |
Opal.add_stubs(['$model_name', '$%', '$to_key', '$object_id', '$inspection_details', '$backing_record', '$attr_reader', '$attributes', '$changed_attributes_and_values', '$changes', '$is_a?', '$new', '$class', '$inheritance_column', '$!', '$key?', '$name', '$[]=', '$-', '$instance_eval', '$each', '$_dealias_attribute', '$model', '$itself', '$convert', '$load_data', '$==', '$primary_key', '$<<', '$changed_attributes', '$get_primary_key_value', '$id=', '$present?', '$id', '$revert', '$changed?', '$send', '$load', '$collect', '$nil?', '$count', '$first', '$save_or_validate', '$has_key?', '$[]', '$to_proc', '$then', '$ar_instance', '$reactive_empty?', '$errors', '$saving?', '$destroy', '$destroyed', '$new?', '$get_state', '$save', '$<=>', '$to_i', '$_new_without_sti_type_cast', '$becomes', '$set_ar_instance!']); | |
return (function($base, $parent_nesting) { | |
function $ActiveRecord() {}; | |
var self = $ActiveRecord = $module($base, 'ActiveRecord', $ActiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $InstanceMethods() {}; | |
var self = $InstanceMethods = $module($base, 'InstanceMethods', $InstanceMethods); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_InstanceMethods_inspect_1, TMP_InstanceMethods_attributes_2, TMP_InstanceMethods_changed_attributes_3, TMP_InstanceMethods_changes_4, TMP_InstanceMethods_initialize_9, TMP_InstanceMethods_primary_key_10, TMP_InstanceMethods_id_11, TMP_InstanceMethods_id$eq_12, TMP_InstanceMethods_id$q_13, TMP_InstanceMethods_model_name_14, TMP_InstanceMethods_revert_15, TMP_InstanceMethods_changed$q_16, TMP_InstanceMethods_dup_17, TMP_InstanceMethods_$eq$eq_19, TMP_InstanceMethods_$$_20, TMP_InstanceMethods_$$$eq_21, TMP_InstanceMethods_itself_22, TMP_InstanceMethods_load_23, TMP_InstanceMethods_save_26, TMP_InstanceMethods_validate_27, TMP_InstanceMethods_valid$q_29, TMP_InstanceMethods_saving$q_30, TMP_InstanceMethods_destroy_31, TMP_InstanceMethods_destroyed$q_32, TMP_InstanceMethods_new$q_33, TMP_InstanceMethods_errors_34, TMP_InstanceMethods_to_key_35, TMP_InstanceMethods_update_attribute_36, TMP_InstanceMethods_update_37, TMP_InstanceMethods_$lt$eq$gt_39, TMP_InstanceMethods_becomes_40, TMP_InstanceMethods_becomes$B_41, TMP_InstanceMethods_cast_to_current_sti_type_42; | |
Opal.def(self, '$inspect', TMP_InstanceMethods_inspect_1 = function $$inspect() { | |
var self = this; | |
return "" + ("" + "<" + (self.$model_name()) + ":" + ($$$($$$($$$($$($nesting, 'ReactiveRecord'), 'Operations'), 'Base'), 'FORMAT')['$%'](self.$to_key())) + " ") + ("" + "(" + ($$$($$$($$$($$($nesting, 'ReactiveRecord'), 'Operations'), 'Base'), 'FORMAT')['$%'](self.$object_id())) + ") ") + ("" + (self.$backing_record().$inspection_details()) + " >") | |
}, TMP_InstanceMethods_inspect_1.$$arity = 0); | |
self.$attr_reader("backing_record"); | |
Opal.def(self, '$attributes', TMP_InstanceMethods_attributes_2 = function $$attributes() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$attributes() | |
}, TMP_InstanceMethods_attributes_2.$$arity = 0); | |
Opal.def(self, '$changed_attributes', TMP_InstanceMethods_changed_attributes_3 = function $$changed_attributes() { | |
var self = this; | |
return self.$backing_record().$changed_attributes_and_values() | |
}, TMP_InstanceMethods_changed_attributes_3.$$arity = 0); | |
Opal.def(self, '$changes', TMP_InstanceMethods_changes_4 = function $$changes() { | |
var self = this; | |
return self.$backing_record().$changes() | |
}, TMP_InstanceMethods_changes_4.$$arity = 0); | |
Opal.def(self, '$initialize', TMP_InstanceMethods_initialize_9 = function $$initialize(hash) { | |
var $a, TMP_5, self = this, $writer = nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (hash == null) { | |
hash = $hash2([], {}); | |
} | |
if ($truthy(hash['$is_a?']($$$($$($nesting, 'ReactiveRecord'), 'Base')))) { | |
return (self.backing_record = hash) | |
} else { | |
self.backing_record = $$$($$($nesting, 'ReactiveRecord'), 'Base').$new(self.$class(), $hash2([], {}), self); | |
if ($truthy(($truthy($a = self.$class().$inheritance_column()) ? hash['$key?'](self.$class().$inheritance_column())['$!']() : $a))) { | |
$writer = [self.$class().$inheritance_column(), self.$class().$name()]; | |
$send(hash, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
return $send(self.backing_record, 'instance_eval', [], (TMP_5 = function(){var self = TMP_5.$$s || this, TMP_6, TMP_7, h = nil; | |
h = $hash2([], {}); | |
$send(hash, 'each', [], (TMP_6 = function(a, v){var self = TMP_6.$$s || this; | |
if (a == null) a = nil;if (v == null) v = nil; | |
a = self.$model().$_dealias_attribute(a); | |
$writer = [a, self.$convert(a, v).$itself()]; | |
$send(h, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;}, TMP_6.$$s = self, TMP_6.$$arity = 2, TMP_6)); | |
return $send(self.$class(), 'load_data', [], (TMP_7 = function(){var self = TMP_7.$$s || this, TMP_8; | |
return $send(h, 'each', [], (TMP_8 = function(attribute, value){var self = TMP_8.$$s || this; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
if (attribute == null) attribute = nil;if (value == null) value = nil; | |
if (attribute['$=='](self.$primary_key())) { | |
return nil;}; | |
$writer = [attribute, value]; | |
$send(self.ar_instance, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
return self.$changed_attributes()['$<<'](attribute);}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8))}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7));}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5)); | |
} | |
}, TMP_InstanceMethods_initialize_9.$$arity = -1); | |
Opal.def(self, '$primary_key', TMP_InstanceMethods_primary_key_10 = function $$primary_key() { | |
var self = this; | |
return self.$class().$primary_key() | |
}, TMP_InstanceMethods_primary_key_10.$$arity = 0); | |
Opal.def(self, '$id', TMP_InstanceMethods_id_11 = function $$id() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$get_primary_key_value() | |
}, TMP_InstanceMethods_id_11.$$arity = 0); | |
Opal.def(self, '$id=', TMP_InstanceMethods_id$eq_12 = function(value) { | |
var self = this, $writer = nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
$writer = [value]; | |
$send(self.backing_record, 'id=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
}, TMP_InstanceMethods_id$eq_12.$$arity = 1); | |
Opal.def(self, '$id?', TMP_InstanceMethods_id$q_13 = function() { | |
var self = this; | |
return self.$id()['$present?']() | |
}, TMP_InstanceMethods_id$q_13.$$arity = 0); | |
Opal.def(self, '$model_name', TMP_InstanceMethods_model_name_14 = function $$model_name() { | |
var self = this; | |
return self.$class().$model_name() | |
}, TMP_InstanceMethods_model_name_14.$$arity = 0); | |
Opal.def(self, '$revert', TMP_InstanceMethods_revert_15 = function $$revert() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$revert() | |
}, TMP_InstanceMethods_revert_15.$$arity = 0); | |
Opal.def(self, '$changed?', TMP_InstanceMethods_changed$q_16 = function() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record['$changed?']() | |
}, TMP_InstanceMethods_changed$q_16.$$arity = 0); | |
Opal.def(self, '$dup', TMP_InstanceMethods_dup_17 = function $$dup() { | |
var self = this; | |
return self.$class().$new(self.$attributes()) | |
}, TMP_InstanceMethods_dup_17.$$arity = 0); | |
Opal.def(self, '$==', TMP_InstanceMethods_$eq$eq_19 = function(ar_instance) { | |
var TMP_18, self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record['$==']($send(ar_instance, 'instance_eval', [], (TMP_18 = function(){var self = TMP_18.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record}, TMP_18.$$s = self, TMP_18.$$arity = 0, TMP_18))) | |
}, TMP_InstanceMethods_$eq$eq_19.$$arity = 1); | |
Opal.def(self, '$[]', TMP_InstanceMethods_$$_20 = function(attr) { | |
var self = this; | |
return self.$send(attr) | |
}, TMP_InstanceMethods_$$_20.$$arity = 1); | |
Opal.def(self, '$[]=', TMP_InstanceMethods_$$$eq_21 = function(attr, val) { | |
var self = this; | |
return self.$send("" + (attr) + "=", val) | |
}, TMP_InstanceMethods_$$$eq_21.$$arity = 2); | |
Opal.def(self, '$itself', TMP_InstanceMethods_itself_22 = function $$itself() { | |
var self = this; | |
self.$id(); | |
return self; | |
}, TMP_InstanceMethods_itself_22.$$arity = 0); | |
Opal.def(self, '$load', TMP_InstanceMethods_load_23 = function $$load($a_rest) { | |
var TMP_24, self = this, attributes, $iter = TMP_InstanceMethods_load_23.$$p, block = $iter || nil, first_time = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
attributes = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
attributes[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_InstanceMethods_load_23.$$p = null; | |
first_time = true; | |
return $send($$($nesting, 'ReactiveRecord'), 'load', [], (TMP_24 = function(){var self = TMP_24.$$s || this, TMP_25, $a, results = nil; | |
results = $send(attributes, 'collect', [], (TMP_25 = function(attr){var self = TMP_25.$$s || this; | |
if (attr == null) attr = nil; | |
return self.$send("" + (attr) + ((function() {if ($truthy(first_time)) { | |
return "!" | |
} else { | |
return nil | |
}; return nil; })()))}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25)); | |
if ($truthy(block)) { | |
results = Opal.yieldX(block, Opal.to_a(results))}; | |
first_time = false; | |
if ($truthy(($truthy($a = block['$nil?']()) ? results.$count()['$=='](1) : $a))) { | |
return results.$first() | |
} else { | |
return results | |
};}, TMP_24.$$s = self, TMP_24.$$arity = 0, TMP_24)); | |
}, TMP_InstanceMethods_load_23.$$arity = -1); | |
Opal.def(self, '$save', TMP_InstanceMethods_save_26 = function $$save(opts) { | |
var self = this, $iter = TMP_InstanceMethods_save_26.$$p, block = $iter || nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
if ($iter) TMP_InstanceMethods_save_26.$$p = null; | |
return $send(self.backing_record, 'save_or_validate', [true, (function() {if ($truthy(opts['$has_key?']("validate"))) { | |
return opts['$[]']("validate") | |
} else { | |
return true | |
}; return nil; })(), opts['$[]']("force")], block.$to_proc()) | |
}, TMP_InstanceMethods_save_26.$$arity = -1); | |
Opal.def(self, '$validate', TMP_InstanceMethods_validate_27 = function $$validate(opts) { | |
var TMP_28, self = this, $iter = TMP_InstanceMethods_validate_27.$$p, block = $iter || nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (opts == null) { | |
opts = $hash2([], {}); | |
} | |
if ($iter) TMP_InstanceMethods_validate_27.$$p = null; | |
return $send(self.backing_record.$save_or_validate(false, true, opts['$[]']("force")), 'then', [], (TMP_28 = function(){var self = TMP_28.$$s || this; | |
if (self.backing_record == null) self.backing_record = nil; | |
if ($truthy(block)) { | |
return Opal.yield1(block, self.backing_record.$ar_instance()); | |
} else { | |
return self.backing_record.$ar_instance() | |
}}, TMP_28.$$s = self, TMP_28.$$arity = 0, TMP_28)) | |
}, TMP_InstanceMethods_validate_27.$$arity = -1); | |
Opal.def(self, '$valid?', TMP_InstanceMethods_valid$q_29 = function() { | |
var self = this; | |
return self.$errors()['$reactive_empty?']() | |
}, TMP_InstanceMethods_valid$q_29.$$arity = 0); | |
Opal.def(self, '$saving?', TMP_InstanceMethods_saving$q_30 = function() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record['$saving?']() | |
}, TMP_InstanceMethods_saving$q_30.$$arity = 0); | |
Opal.def(self, '$destroy', TMP_InstanceMethods_destroy_31 = function $$destroy() { | |
var self = this, $iter = TMP_InstanceMethods_destroy_31.$$p, block = $iter || nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
if ($iter) TMP_InstanceMethods_destroy_31.$$p = null; | |
return $send(self.backing_record, 'destroy', [], block.$to_proc()) | |
}, TMP_InstanceMethods_destroy_31.$$arity = 0); | |
Opal.def(self, '$destroyed?', TMP_InstanceMethods_destroyed$q_32 = function() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$destroyed() | |
}, TMP_InstanceMethods_destroyed$q_32.$$arity = 0); | |
Opal.def(self, '$new?', TMP_InstanceMethods_new$q_33 = function() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record['$new?']() | |
}, TMP_InstanceMethods_new$q_33.$$arity = 0); | |
Opal.def(self, '$errors', TMP_InstanceMethods_errors_34 = function $$errors() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
$$$($$($nesting, 'React'), 'State').$get_state(self.backing_record, self.backing_record); | |
return self.backing_record.$errors(); | |
}, TMP_InstanceMethods_errors_34.$$arity = 0); | |
Opal.def(self, '$to_key', TMP_InstanceMethods_to_key_35 = function $$to_key() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record.$object_id() | |
}, TMP_InstanceMethods_to_key_35.$$arity = 0); | |
Opal.def(self, '$update_attribute', TMP_InstanceMethods_update_attribute_36 = function $$update_attribute(attr, value) { | |
var self = this, $iter = TMP_InstanceMethods_update_attribute_36.$$p, block = $iter || nil; | |
if ($iter) TMP_InstanceMethods_update_attribute_36.$$p = null; | |
self.$send("" + (attr) + "=", value); | |
return $send(self, 'save', [$hash2(["validate"], {"validate": false})], block.$to_proc()); | |
}, TMP_InstanceMethods_update_attribute_36.$$arity = 2); | |
Opal.def(self, '$update', TMP_InstanceMethods_update_37 = function $$update(attrs) { | |
var TMP_38, self = this, $iter = TMP_InstanceMethods_update_37.$$p, block = $iter || nil; | |
if (attrs == null) { | |
attrs = $hash2([], {}); | |
} | |
if ($iter) TMP_InstanceMethods_update_37.$$p = null; | |
$send(attrs, 'each', [], (TMP_38 = function(attr, value){var self = TMP_38.$$s || this; | |
if (attr == null) attr = nil;if (value == null) value = nil; | |
return self.$send("" + (attr) + "=", value)}, TMP_38.$$s = self, TMP_38.$$arity = 2, TMP_38)); | |
return $send(self, 'save', [], block.$to_proc()); | |
}, TMP_InstanceMethods_update_37.$$arity = -1); | |
Opal.def(self, '$<=>', TMP_InstanceMethods_$lt$eq$gt_39 = function(other) { | |
var self = this; | |
return self.$id().$to_i()['$<=>'](other.$id().$to_i()) | |
}, TMP_InstanceMethods_$lt$eq$gt_39.$$arity = 1); | |
Opal.def(self, '$becomes', TMP_InstanceMethods_becomes_40 = function $$becomes(klass) { | |
var self = this; | |
return klass.$_new_without_sti_type_cast(self.$backing_record()) | |
}, TMP_InstanceMethods_becomes_40.$$arity = 1); | |
Opal.def(self, '$becomes!', TMP_InstanceMethods_becomes$B_41 = function(klass) { | |
var self = this, $writer = nil; | |
$writer = [self.$class().$inheritance_column(), klass.$name()]; | |
$send(self, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
return self.$becomes(klass); | |
}, TMP_InstanceMethods_becomes$B_41.$$arity = 1); | |
Opal.def(self, '$cast_to_current_sti_type', TMP_InstanceMethods_cast_to_current_sti_type_42 = function $$cast_to_current_sti_type() { | |
var self = this; | |
if (self.backing_record == null) self.backing_record = nil; | |
return self.backing_record['$set_ar_instance!']() | |
}, TMP_InstanceMethods_cast_to_current_sti_type_42.$$arity = 0); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/backing_record_inspector.rb": | |
/*!************************************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/backing_record_inspector.rb ***! | |
\************************************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/backing_record_inspector"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$empty?', '$errors', '$error_details', '$new?', '$new_details', '$destroyed', '$destroyed_details', '$key?', '$primary_key', '$loading_details', '$changed_attributes', '$dirty_details', '$id', '$messages', '$select', '$attributes', '$column_type', '$vector', '$changes']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $BackingRecordInspector() {}; | |
var self = $BackingRecordInspector = $module($base, 'BackingRecordInspector', $BackingRecordInspector); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_BackingRecordInspector_inspection_details_1, TMP_BackingRecordInspector_error_details_2, TMP_BackingRecordInspector_new_details_4, TMP_BackingRecordInspector_destroyed_details_5, TMP_BackingRecordInspector_loading_details_6, TMP_BackingRecordInspector_dirty_details_7; | |
Opal.def(self, '$inspection_details', TMP_BackingRecordInspector_inspection_details_1 = function $$inspection_details() { | |
var self = this; | |
if (self.attributes == null) self.attributes = nil; | |
if ($truthy(self.$errors()['$empty?']())) { | |
} else { | |
return self.$error_details() | |
}; | |
if ($truthy(self['$new?']())) { | |
return self.$new_details()}; | |
if ($truthy(self.$destroyed())) { | |
return self.$destroyed_details()}; | |
if ($truthy(self.attributes['$key?'](self.$primary_key()))) { | |
} else { | |
return self.$loading_details() | |
}; | |
if ($truthy(self.$changed_attributes()['$empty?']())) { | |
} else { | |
return self.$dirty_details() | |
}; | |
return "" + "[loaded id: " + (self.$id()) + "]"; | |
}, TMP_BackingRecordInspector_inspection_details_1.$$arity = 0); | |
Opal.def(self, '$error_details', TMP_BackingRecordInspector_error_details_2 = function $$error_details() { | |
var self = this, id_str = nil; | |
if ($truthy(self['$new?']())) { | |
} else { | |
id_str = "" + "id: " + (self.$id()) + " " | |
}; | |
return "" + "[errors " + (id_str) + (self.$errors().$messages()) + "]"; | |
}, TMP_BackingRecordInspector_error_details_2.$$arity = 0); | |
Opal.def(self, '$new_details', TMP_BackingRecordInspector_new_details_4 = function $$new_details() { | |
var TMP_3, self = this; | |
return "" + "[new " + ($send(self.$attributes(), 'select', [], (TMP_3 = function(attr){var self = TMP_3.$$s || this; | |
if (attr == null) attr = nil; | |
return self.$column_type(attr)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3))) + "]" | |
}, TMP_BackingRecordInspector_new_details_4.$$arity = 0); | |
Opal.def(self, '$destroyed_details', TMP_BackingRecordInspector_destroyed_details_5 = function $$destroyed_details() { | |
var self = this; | |
return "" + "[destroyed id: " + (self.$id()) + "]" | |
}, TMP_BackingRecordInspector_destroyed_details_5.$$arity = 0); | |
Opal.def(self, '$loading_details', TMP_BackingRecordInspector_loading_details_6 = function $$loading_details() { | |
var self = this; | |
return "" + "[loading " + (self.$vector()) + "]" | |
}, TMP_BackingRecordInspector_loading_details_6.$$arity = 0); | |
Opal.def(self, '$dirty_details', TMP_BackingRecordInspector_dirty_details_7 = function $$dirty_details() { | |
var self = this; | |
return "" + "[changed id: " + (self.$id()) + " " + (self.$changes()) + "]" | |
}, TMP_BackingRecordInspector_dirty_details_7.$$arity = 0); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/base.rb": | |
/*!****************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/base.rb ***! | |
\****************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/base"] = function(Opal) { | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash = Opal.hash, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$include', '$extend', '$attr_accessor', '$attr_reader', '$data_loading?', '$class', '$load_data', '$load_from_json', '$inheritance_column', '$<', '$base_class', '$!', '$key?', '$merge', '$model_name', '$primary_key', '$[]', '$lookup_by_id', '$detect', '$!=', '$synced_attributes', '$find_in_db', '$set_vector_lookup', '$new', '$each', '$sync_attribute', '$set_ar_instance!', '$lookup_by_vector', '$aggregate_owner=', '$-', '$last', '$aggregate_attribute=', '$ar_instance', '$[]=', '$attributes', '$<<', '$records', '$set_object_id_lookup', '$find', '$new_from_vector', '$model', '$set_id_lookup', '$instance_variable_set', '$merge!', '$==', '$count', '$get_state', '$empty?', '$changed_attributes', '$include?', '$compact', '$collect', '$column_type', '$vector', '$id', '$reflect_on_all_associations', '$collection?', '$attribute', '$send', '$convert', '$clear', '$errors', '$initialize_collections', '$destroyed', '$unscoped', '$is_a?', '$dup_for_sync', '$reflect_on_aggregation', '$klass', '$sync!', '$backing_record', '$deserialize', '$serialize', '$reflect_on_association', '$parse', '$to_json', '$delete', '$dup', '$set_state', '$notify_waiting_for_save', '$add', '$to_proc', '$wait_for_save', '$waiting_for_save', '$call', '$clear_waiting_for_save', '$infer_type_from_hash', '$_new_without_sti_type_cast', '$const_get', '$log', '$message', '$raise', '$pre_synchromesh_load_from_db', '$replace']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_data_loading$q_1, TMP_Base_data_loading$q_2, TMP_Base_load_data_3, TMP_Base_load_from_json_5, TMP_Base_find_9, TMP_Base_new_from_vector_10, TMP_Base_initialize_11, TMP_Base_find_12, TMP_Base_new_from_vector_13, TMP_Base_primary_key_14, TMP_Base_id_15, TMP_Base_id$eq_17, TMP_Base_changed$q_18, TMP_Base_changed_attributes_and_values_20, TMP_Base_changes_22, TMP_Base_errors_23, TMP_Base_initialize_collections_26, TMP_Base_sync$B_28, TMP_Base_sync_unscoped_collection$B_29, TMP_Base_sync_attribute_30, TMP_Base_exists$q_31, TMP_Base_revert_33, TMP_Base_saving$B_34, TMP_Base_errors$B_37, TMP_Base_saved$B_38, TMP_Base_when_not_saving_39, TMP_Base_notify_waiting_for_save_40, TMP_Base_notify_waiting_for_save_42, TMP_Base_saving$q_43, TMP_Base_new$q_44, TMP_Base_set_ar_instance$B_45, TMP_Base_destroy_associations_53; | |
def.model = def.attributes = def.ar_instance = def.errors = def.destroy_sync = def.create_sync = def.synced_with_unscoped = def.synced_attributes = def.changed_attributes = def.saving = nil; | |
self.$include($$($nesting, 'BackingRecordInspector')); | |
self.$include($$($nesting, 'Setters')); | |
self.$include($$($nesting, 'Getters')); | |
self.$extend($$($nesting, 'LookupTables')); | |
self.$attr_accessor("ar_instance"); | |
self.$attr_accessor("vector"); | |
self.$attr_accessor("model"); | |
self.$attr_accessor("changed_attributes"); | |
self.$attr_accessor("aggregate_owner"); | |
self.$attr_accessor("aggregate_attribute"); | |
self.$attr_accessor("destroyed"); | |
self.$attr_accessor("updated_during"); | |
self.$attr_accessor("synced_attributes"); | |
self.$attr_accessor("virgin"); | |
self.$attr_reader("attributes"); | |
Opal.defs(self, '$data_loading?', TMP_Base_data_loading$q_1 = function() { | |
var self = this; | |
if (self.data_loading == null) self.data_loading = nil; | |
return self.data_loading | |
}, TMP_Base_data_loading$q_1.$$arity = 0); | |
Opal.def(self, '$data_loading?', TMP_Base_data_loading$q_2 = function() { | |
var self = this; | |
return self.$class()['$data_loading?']() | |
}, TMP_Base_data_loading$q_2.$$arity = 0); | |
Opal.defs(self, '$load_data', TMP_Base_load_data_3 = function $$load_data() { | |
var $a, self = this, $iter = TMP_Base_load_data_3.$$p, block = $iter || nil, current_data_loading = nil; | |
if (self.data_loading == null) self.data_loading = nil; | |
if ($iter) TMP_Base_load_data_3.$$p = null; | |
return (function() { try { | |
$a = [self.data_loading, true], (current_data_loading = $a[0]), (self.data_loading = $a[1]), $a; | |
return Opal.yieldX(block, []);; | |
} finally { | |
(self.data_loading = current_data_loading) | |
}; })() | |
}, TMP_Base_load_data_3.$$arity = 0); | |
Opal.defs(self, '$load_from_json', TMP_Base_load_from_json_5 = function $$load_from_json(json, target) { | |
var TMP_4, self = this; | |
if (target == null) { | |
target = nil; | |
} | |
return $send(self, 'load_data', [], (TMP_4 = function(){var self = TMP_4.$$s || this; | |
return $$($nesting, 'ServerDataCache').$load_from_json(json, target)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4)) | |
}, TMP_Base_load_from_json_5.$$arity = -2); | |
Opal.defs(self, '$find', TMP_Base_find_9 = function $$find(model, attrs) { | |
var $a, $b, TMP_6, TMP_8, self = this, inher_col = nil, primary_key = nil, record = nil, id_to_find = nil, id = nil; | |
if (self.records == null) self.records = nil; | |
inher_col = model.$inheritance_column(); | |
if ($truthy(($truthy($a = ($truthy($b = inher_col) ? $rb_lt(model, model.$base_class()) : $b)) ? attrs['$key?'](inher_col)['$!']() : $a))) { | |
attrs = attrs.$merge($hash(inher_col, model.$model_name()))}; | |
model = model.$base_class(); | |
primary_key = model.$primary_key(); | |
record = (function() {if ($truthy((id_to_find = attrs['$[]'](primary_key)))) { | |
return self.$lookup_by_id(model, id_to_find) | |
} else { | |
return $send(self.records['$[]'](model), 'detect', [], (TMP_6 = function(r){var self = TMP_6.$$s || this, TMP_7; | |
if (r == null) r = nil; | |
return $send(attrs, 'detect', [], (TMP_7 = function(attr, value){var self = TMP_7.$$s || this; | |
if (attr == null) attr = nil;if (value == null) value = nil; | |
return r.$synced_attributes()['$[]'](attr)['$!='](value)}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7))['$!']()}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6)) | |
}; return nil; })(); | |
if ($truthy(record)) { | |
} else { | |
if ($truthy(($truthy($a = attrs['$key?'](primary_key)['$!']()) ? (id = self.$find_in_db(model, attrs)) : $a))) { | |
record = self.$lookup_by_id(model, id); | |
attrs = attrs.$merge($hash(primary_key, id));}; | |
record = ($truthy($a = record) ? $a : self.$set_vector_lookup(self.$new(model), [model, ["find_by", attrs]])); | |
$send(attrs, 'each', [], (TMP_8 = function(attr, value){var self = TMP_8.$$s || this; | |
if (attr == null) attr = nil;if (value == null) value = nil; | |
return record.$sync_attribute(attr, value)}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8)); | |
}; | |
return record['$set_ar_instance!'](); | |
}, TMP_Base_find_9.$$arity = 2); | |
Opal.defs(self, '$new_from_vector', TMP_Base_new_from_vector_10 = function $$new_from_vector(model, aggregate_owner, $a_rest) { | |
var self = this, vector, record = nil, $writer = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 2; | |
if ($rest_len < 0) { $rest_len = 0; } | |
vector = new Array($rest_len); | |
for (var $arg_idx = 2; $arg_idx < $args_len; $arg_idx++) { | |
vector[$arg_idx - 2] = arguments[$arg_idx]; | |
} | |
model = model.$base_class(); | |
record = self.$lookup_by_vector(vector); | |
if ($truthy(record)) { | |
} else { | |
record = self.$new(model); | |
self.$set_vector_lookup(record, vector); | |
}; | |
record['$set_ar_instance!'](); | |
if ($truthy(aggregate_owner)) { | |
$writer = [aggregate_owner]; | |
$send(record, 'aggregate_owner=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$writer = [vector.$last()]; | |
$send(record, 'aggregate_attribute=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$writer = [vector.$last(), record.$ar_instance()]; | |
$send(aggregate_owner.$attributes(), '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];;}; | |
return record.$ar_instance(); | |
}, TMP_Base_new_from_vector_10.$$arity = -3); | |
Opal.def(self, '$initialize', TMP_Base_initialize_11 = function $$initialize(model, hash, ar_instance) { | |
var self = this; | |
if (hash == null) { | |
hash = $hash2([], {}); | |
} | |
if (ar_instance == null) { | |
ar_instance = nil; | |
} | |
self.model = model; | |
self.ar_instance = ar_instance; | |
self.synced_attributes = $hash2([], {}); | |
self.attributes = $hash2([], {}); | |
self.changed_attributes = []; | |
self.virgin = true; | |
self.$records()['$[]'](model)['$<<'](self); | |
return $$($nesting, 'Base').$set_object_id_lookup(self); | |
}, TMP_Base_initialize_11.$$arity = -2); | |
Opal.def(self, '$find', TMP_Base_find_12 = function $$find($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$class(), 'find', Opal.to_a(args)) | |
}, TMP_Base_find_12.$$arity = -1); | |
Opal.def(self, '$new_from_vector', TMP_Base_new_from_vector_13 = function $$new_from_vector($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$class(), 'new_from_vector', Opal.to_a(args)) | |
}, TMP_Base_new_from_vector_13.$$arity = -1); | |
Opal.def(self, '$primary_key', TMP_Base_primary_key_14 = function $$primary_key() { | |
var self = this; | |
return self.model.$primary_key() | |
}, TMP_Base_primary_key_14.$$arity = 0); | |
Opal.def(self, '$id', TMP_Base_id_15 = function $$id() { | |
var self = this; | |
return self.attributes['$[]'](self.$primary_key()) | |
}, TMP_Base_id_15.$$arity = 0); | |
Opal.def(self, '$id=', TMP_Base_id$eq_17 = function(value) { | |
var $a, TMP_16, self = this, existing_record = nil, $writer = nil; | |
if ($truthy(($truthy($a = value) ? (existing_record = $$($nesting, 'Base').$lookup_by_id(self.$model(), value)) : $a)['$!']())) { | |
$writer = [self.$primary_key(), value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$$($nesting, 'Base').$set_id_lookup(self); | |
} else { | |
self.ar_instance.$instance_variable_set("@backing_record", existing_record); | |
$send(existing_record.$attributes(), 'merge!', [self.$attributes()], (TMP_16 = function(key, v1, v2){var self = TMP_16.$$s || this; | |
if (key == null) key = nil;if (v1 == null) v1 = nil;if (v2 == null) v2 = nil; | |
return v1}, TMP_16.$$s = self, TMP_16.$$arity = 3, TMP_16)); | |
}; | |
return value; | |
}, TMP_Base_id$eq_17.$$arity = 1); | |
Opal.def(self, '$changed?', TMP_Base_changed$q_18 = function($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if (args.$count()['$=='](0)) { | |
$$$($$($nesting, 'React'), 'State').$get_state(self, "!CHANGED!"); | |
return self.$changed_attributes()['$empty?']()['$!'](); | |
} else { | |
$$$($$($nesting, 'React'), 'State').$get_state(self, args['$[]'](0)); | |
return self.$changed_attributes()['$include?'](args['$[]'](0)); | |
} | |
}, TMP_Base_changed$q_18.$$arity = -1); | |
Opal.def(self, '$changed_attributes_and_values', TMP_Base_changed_attributes_and_values_20 = function $$changed_attributes_and_values() { | |
var TMP_19, self = this; | |
return $$($nesting, 'Hash')['$[]']($send(self.$changed_attributes(), 'collect', [], (TMP_19 = function(attr){var self = TMP_19.$$s || this; | |
if (self.attributes == null) self.attributes = nil; | |
if (attr == null) attr = nil; | |
if ($truthy(self.$column_type(attr))) { | |
return [attr, self.attributes['$[]'](attr)] | |
} else { | |
return nil | |
}}, TMP_19.$$s = self, TMP_19.$$arity = 1, TMP_19)).$compact()) | |
}, TMP_Base_changed_attributes_and_values_20.$$arity = 0); | |
Opal.def(self, '$changes', TMP_Base_changes_22 = function $$changes() { | |
var TMP_21, self = this; | |
return $$($nesting, 'Hash')['$[]']($send(self.$changed_attributes(), 'collect', [], (TMP_21 = function(attr){var self = TMP_21.$$s || this; | |
if (self.synced_attributes == null) self.synced_attributes = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (attr == null) attr = nil; | |
if ($truthy(self.$column_type(attr))) { | |
return [attr, [self.synced_attributes['$[]'](attr), self.attributes['$[]'](attr)]] | |
} else { | |
return nil | |
}}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21)).$compact()) | |
}, TMP_Base_changes_22.$$arity = 0); | |
Opal.def(self, '$errors', TMP_Base_errors_23 = function $$errors() { | |
var $a, self = this; | |
return (self.errors = ($truthy($a = self.errors) ? $a : $$$($$($nesting, 'ActiveModel'), 'Errors').$new(self))) | |
}, TMP_Base_errors_23.$$arity = 0); | |
Opal.def(self, '$initialize_collections', TMP_Base_initialize_collections_26 = function $$initialize_collections() { | |
var $a, $b, $c, TMP_24, self = this; | |
if ($truthy(($truthy($a = ($truthy($b = ($truthy($c = self.$vector()['$!']()) ? $c : self.$vector()['$empty?']())) ? self.$id() : $b)) ? self.$id()['$!=']("") : $a))) { | |
$$($nesting, 'Base').$set_vector_lookup(self, [self.model, ["find_by", $hash(self.model.$primary_key(), self.$id())]])}; | |
return $send($$($nesting, 'Base'), 'load_data', [], (TMP_24 = function(){var self = TMP_24.$$s || this, TMP_25; | |
if (self.model == null) self.model = nil; | |
return $send(self.model.$reflect_on_all_associations(), 'each', [], (TMP_25 = function(assoc){var self = TMP_25.$$s || this, $d; | |
if (self.attributes == null) self.attributes = nil; | |
if (assoc == null) assoc = nil; | |
if ($truthy(($truthy($d = assoc['$collection?']()['$!']()) ? $d : self.attributes['$[]'](assoc.$attribute())))) { | |
return nil;}; | |
return self.$ar_instance().$send("" + (assoc.$attribute()) + "=", []);}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25))}, TMP_24.$$s = self, TMP_24.$$arity = 0, TMP_24)); | |
}, TMP_Base_initialize_collections_26.$$arity = 0); | |
Opal.def(self, '$sync!', TMP_Base_sync$B_28 = function(hash) { | |
var TMP_27, $a, $b, $c, self = this; | |
if (hash == null) { | |
hash = $hash2([], {}); | |
} | |
self.synced_attributes = $hash2([], {}); | |
$send(hash, 'each', [], (TMP_27 = function(attr, value){var self = TMP_27.$$s || this; | |
if (attr == null) attr = nil;if (value == null) value = nil; | |
return self.$sync_attribute(attr, self.$convert(attr, value))}, TMP_27.$$s = self, TMP_27.$$arity = 2, TMP_27)); | |
self.changed_attributes = []; | |
self.saving = false; | |
self.$errors().$clear(); | |
if ($truthy(($truthy($a = ($truthy($b = ($truthy($c = self.$vector()['$!']()) ? $c : self.$vector()['$empty?']())) ? self.$id() : $b)) ? self.$id()['$!=']("") : $a))) { | |
self.$initialize_collections()}; | |
return self; | |
}, TMP_Base_sync$B_28.$$arity = -1); | |
Opal.def(self, '$sync_unscoped_collection!', TMP_Base_sync_unscoped_collection$B_29 = function() { | |
var self = this; | |
if ($truthy(self.$destroyed())) { | |
if ($truthy(self.destroy_sync)) { | |
return nil}; | |
self.destroy_sync = true; | |
} else { | |
if ($truthy(self.create_sync)) { | |
return nil}; | |
self.create_sync = true; | |
}; | |
self.$model().$unscoped()['$<<'](self.$ar_instance()); | |
return (self.synced_with_unscoped = self.synced_with_unscoped['$!']()); | |
}, TMP_Base_sync_unscoped_collection$B_29.$$arity = 0); | |
Opal.def(self, '$sync_attribute', TMP_Base_sync_attribute_30 = function $$sync_attribute(attribute, value) { | |
var $a, self = this, $writer = nil, aggregation = nil; | |
$writer = [attribute, (($writer = [attribute, value]), $send(self.attributes, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])]; | |
$send(self.synced_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
if (attribute['$=='](self.$primary_key())) { | |
$$($nesting, 'Base').$set_id_lookup(self)}; | |
if ($truthy(value['$is_a?']($$($nesting, 'Collection')))) { | |
$writer = [attribute, value.$dup_for_sync()]; | |
$send(self.synced_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
} else if ($truthy(($truthy($a = (aggregation = self.$model().$reflect_on_aggregation(attribute))) ? $rb_lt(aggregation.$klass(), $$$($$($nesting, 'ActiveRecord'), 'Base')) : $a))) { | |
value.$backing_record()['$sync!']() | |
} else if ($truthy(aggregation)) { | |
$writer = [attribute, aggregation.$deserialize(aggregation.$serialize(value))]; | |
$send(self.synced_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
} else if ($truthy(self.$model().$reflect_on_association(attribute)['$!']())) { | |
$writer = [attribute, $$($nesting, 'JSON').$parse(value.$to_json())]; | |
$send(self.synced_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
self.changed_attributes.$delete(attribute); | |
return value; | |
}, TMP_Base_sync_attribute_30.$$arity = 2); | |
Opal.defs(self, '$exists?', TMP_Base_exists$q_31 = function(model, id) { | |
var self = this; | |
return $$($nesting, 'Base').$lookup_by_id(model, id) | |
}, TMP_Base_exists$q_31.$$arity = 2); | |
Opal.def(self, '$revert', TMP_Base_revert_33 = function $$revert() { | |
var TMP_32, self = this; | |
$send(self.changed_attributes.$dup(), 'each', [], (TMP_32 = function(attribute){var self = TMP_32.$$s || this; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
if (self.synced_attributes == null) self.synced_attributes = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (attribute == null) attribute = nil; | |
self.ar_instance.$send("" + (attribute) + "=", self.synced_attributes['$[]'](attribute)); | |
if ($truthy(self.synced_attributes['$key?'](attribute))) { | |
return nil | |
} else { | |
return self.attributes.$delete(attribute) | |
};}, TMP_32.$$s = self, TMP_32.$$arity = 1, TMP_32)); | |
self.changed_attributes = []; | |
return self.$errors().$clear(); | |
}, TMP_Base_revert_33.$$arity = 0); | |
Opal.def(self, '$saving!', TMP_Base_saving$B_34 = function() { | |
var self = this; | |
if ($truthy(self['$data_loading?']())) { | |
} else { | |
$$$($$($nesting, 'React'), 'State').$set_state(self, self, "saving") | |
}; | |
return (self.saving = true); | |
}, TMP_Base_saving$B_34.$$arity = 0); | |
Opal.def(self, '$errors!', TMP_Base_errors$B_37 = function(hash) {try { | |
var $a, TMP_35, self = this; | |
self.$notify_waiting_for_save(); | |
if ($truthy(hash)) { | |
} else { | |
($truthy($a = self.$errors().$clear()) ? Opal.ret(nil) : $a) | |
}; | |
return $send(hash, 'each', [], (TMP_35 = function(attribute, messages){var self = TMP_35.$$s || this, TMP_36; | |
if (attribute == null) attribute = nil;if (messages == null) messages = nil; | |
return $send(messages, 'each', [], (TMP_36 = function(message){var self = TMP_36.$$s || this; | |
if (message == null) message = nil; | |
return self.$errors().$add(attribute, $hash2(["message"], {"message": message}))}, TMP_36.$$s = self, TMP_36.$$arity = 1, TMP_36))}, TMP_35.$$s = self, TMP_35.$$arity = 2, TMP_35)); | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_Base_errors$B_37.$$arity = 1); | |
Opal.def(self, '$saved!', TMP_Base_saved$B_38 = function(save_only) { | |
var self = this; | |
if (save_only == null) { | |
save_only = nil; | |
} | |
self.$notify_waiting_for_save(); | |
if ($truthy(save_only)) { | |
return self}; | |
if ($truthy(self.$errors()['$empty?']())) { | |
$$$($$($nesting, 'React'), 'State').$set_state(self, self, "saved") | |
} else if ($truthy(self['$data_loading?']()['$!']())) { | |
$$$($$($nesting, 'React'), 'State').$set_state(self, self, "error")}; | |
return self; | |
}, TMP_Base_saved$B_38.$$arity = -1); | |
Opal.defs(self, '$when_not_saving', TMP_Base_when_not_saving_39 = function $$when_not_saving(model) { | |
var self = this, $iter = TMP_Base_when_not_saving_39.$$p, block = $iter || nil; | |
if (self.records == null) self.records = nil; | |
if ($iter) TMP_Base_when_not_saving_39.$$p = null; | |
if ($truthy($send(self.records['$[]'](model), 'detect', [], "saving?".$to_proc()))) { | |
return $send(self, 'wait_for_save', [model], block.$to_proc()) | |
} else { | |
return Opal.yield1(block, model); | |
} | |
}, TMP_Base_when_not_saving_39.$$arity = 1); | |
Opal.def(self, '$notify_waiting_for_save', TMP_Base_notify_waiting_for_save_40 = function $$notify_waiting_for_save() { | |
var self = this; | |
self.saving = false; | |
return self.$class().$notify_waiting_for_save(self.$model()); | |
}, TMP_Base_notify_waiting_for_save_40.$$arity = 0); | |
Opal.defs(self, '$notify_waiting_for_save', TMP_Base_notify_waiting_for_save_42 = function $$notify_waiting_for_save(model) { | |
var $a, TMP_41, self = this, waiters = nil; | |
if (self.records == null) self.records = nil; | |
waiters = self.$waiting_for_save(model); | |
if ($truthy(($truthy($a = waiters['$empty?']()) ? $a : $send(self.records['$[]'](model), 'detect', [], "saving?".$to_proc())))) { | |
return nil}; | |
$send(waiters, 'each', [], (TMP_41 = function(waiter){var self = TMP_41.$$s || this; | |
if (waiter == null) waiter = nil; | |
return waiter.$call(model)}, TMP_41.$$s = self, TMP_41.$$arity = 1, TMP_41)); | |
return self.$clear_waiting_for_save(model); | |
}, TMP_Base_notify_waiting_for_save_42.$$arity = 1); | |
Opal.def(self, '$saving?', TMP_Base_saving$q_43 = function() { | |
var self = this; | |
$$$($$($nesting, 'React'), 'State').$get_state(self, self); | |
return self.saving; | |
}, TMP_Base_saving$q_43.$$arity = 0); | |
Opal.def(self, '$new?', TMP_Base_new$q_44 = function() { | |
var $a, self = this; | |
return ($truthy($a = self.$id()['$!']()) ? self.$vector()['$!']() : $a) | |
}, TMP_Base_new$q_44.$$arity = 0); | |
Opal.def(self, '$set_ar_instance!', TMP_Base_set_ar_instance$B_45 = function() { | |
var self = this, klass = nil; | |
klass = self.$class().$infer_type_from_hash(self.$model(), self.attributes); | |
if (self.ar_instance.$class()['$=='](klass)) { | |
} else { | |
self.ar_instance = klass.$_new_without_sti_type_cast(self) | |
}; | |
return self.ar_instance; | |
}, TMP_Base_set_ar_instance$B_45.$$arity = 0); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_infer_type_from_hash_46, TMP_default_scope_47, TMP_unscoped_48, TMP_add_to_outer_scopes_49, TMP_catch_db_requests_50, TMP_load_from_db_51; | |
Opal.def(self, '$infer_type_from_hash', TMP_infer_type_from_hash_46 = function $$infer_type_from_hash(klass, hash) { | |
var $a, self = this, type = nil, e = nil, message = nil; | |
klass = klass.$base_class(); | |
if ($truthy(hash)) { | |
} else { | |
return klass | |
}; | |
type = hash['$[]'](klass.$inheritance_column()); | |
if ($truthy(($truthy($a = type['$!']()) ? $a : type['$==']("")))) { | |
} else { | |
try { | |
return $$($nesting, 'Object').$const_get(type) | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
message = "" + "Could not subclass " + (klass) + " as " + (type) + ". Perhaps " + (type) + " class has not been required. Exception: " + (e); | |
console.error(message); | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}; | |
}; | |
return klass; | |
}, TMP_infer_type_from_hash_46.$$arity = 2); | |
self.$attr_reader("outer_scopes"); | |
Opal.def(self, '$default_scope', TMP_default_scope_47 = function $$default_scope() { | |
var self = this; | |
if (self.class_scopes == null) self.class_scopes = nil; | |
return self.class_scopes['$[]']("default_scope") | |
}, TMP_default_scope_47.$$arity = 0); | |
Opal.def(self, '$unscoped', TMP_unscoped_48 = function $$unscoped() { | |
var self = this; | |
if (self.class_scopes == null) self.class_scopes = nil; | |
return self.class_scopes['$[]']("unscoped") | |
}, TMP_unscoped_48.$$arity = 0); | |
Opal.def(self, '$add_to_outer_scopes', TMP_add_to_outer_scopes_49 = function $$add_to_outer_scopes(item) { | |
var self = this; | |
if (self.outer_scopes == null) self.outer_scopes = nil; | |
return self.outer_scopes['$<<'](item) | |
}, TMP_add_to_outer_scopes_49.$$arity = 1); | |
(function($base, $super, $parent_nesting) { | |
function $DbRequestMade(){}; | |
var self = $DbRequestMade = $klass($base, $super, 'DbRequestMade', $DbRequestMade); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return nil | |
})($nesting[0], $$($nesting, 'RuntimeError'), $nesting); | |
Opal.def(self, '$catch_db_requests', TMP_catch_db_requests_50 = function $$catch_db_requests(return_val) { | |
var self = this, $iter = TMP_catch_db_requests_50.$$p, $yield = $iter || nil, e = nil; | |
if (return_val == null) { | |
return_val = nil; | |
} | |
if ($iter) TMP_catch_db_requests_50.$$p = null; | |
return (function() { try { | |
try { | |
self.catch_db_requests = true; | |
return Opal.yieldX($yield, []);; | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'DbRequestMade')])) {e = $err; | |
try { | |
$$$($$($nesting, 'React'), 'IsomorphicHelpers').$log("" + "Warning: request for server side data during scope evaluation: " + (e.$message()), "warning"); | |
return return_val; | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
} finally { | |
(self.catch_db_requests = false) | |
}; })() | |
}, TMP_catch_db_requests_50.$$arity = -1); | |
Opal.alias(self, "pre_synchromesh_load_from_db", "load_from_db"); | |
return (Opal.def(self, '$load_from_db', TMP_load_from_db_51 = function $$load_from_db($a_rest) { | |
var self = this, args; | |
if (self.catch_db_requests == null) self.catch_db_requests = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($truthy(self.catch_db_requests)) { | |
self.$raise($$($nesting, 'DbRequestMade'), args)}; | |
return $send(self, 'pre_synchromesh_load_from_db', Opal.to_a(args)); | |
}, TMP_load_from_db_51.$$arity = -1), nil) && 'load_from_db'; | |
})(Opal.get_singleton_class(self), $nesting); | |
return (Opal.def(self, '$destroy_associations', TMP_Base_destroy_associations_53 = function $$destroy_associations() { | |
var TMP_52, self = this; | |
self.destroyed = false; | |
$send(self.$model().$reflect_on_all_associations(), 'each', [], (TMP_52 = function(association){var self = TMP_52.$$s || this; | |
if (self.attributes == null) self.attributes = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
if (association == null) association = nil; | |
if ($truthy(association['$collection?']())) { | |
if ($truthy(self.attributes['$[]'](association.$attribute()))) { | |
return self.attributes['$[]'](association.$attribute()).$replace([]) | |
} else { | |
return nil | |
} | |
} else { | |
return self.ar_instance.$send("" + (association.$attribute()) + "=", nil) | |
}}, TMP_52.$$s = self, TMP_52.$$arity = 1, TMP_52)); | |
return (self.destroyed = true); | |
}, TMP_Base_destroy_associations_53.$$arity = 0), nil) && 'destroy_associations'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/collection.rb": | |
/*!**********************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/collection.rb ***! | |
\**********************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/collection"] = function(Opal) { | |
function $rb_le(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); | |
} | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send, $hash2 = Opal.hash2, $hash = Opal.hash, $range = Opal.range; | |
Opal.add_stubs(['$new', '$!', '$id', '$<=', '$length', '$>', '$+', '$vector', '$backing_record', '$attribute', '$instance_eval', '$dup', '$observed', '$notify', '$fetch_from_db', '$each', '$<<', '$find_by', '$primary_key', '$load_from_db', '$[]', '$all', '$new_from_vector', '$through_association?', '$inverse_of', '$[]=', '$attributes', '$-', '$is_a?', '$select', '$!=', '$collection', '$dummy_record', '$==', '$to_a', '$unsaved_children', '$empty?', '$attr_reader', '$attr_writer', '$object_id', '$bulk_update', '$record_with_current_values', '$apply_to_all_collections', '$new?', '$record_with_new_values', '$destroyed?', '$sync_unscoped_collection!', '$outer_scopes', '$gather_related_records', '$send', '$merge_related_records', '$live_scopes', '$filter?', '$joins_with?', '$merge', '$related_records_for', '$class', '$through_association', '$klass', '$inheritance_column', '$base_class', '$<', '$source', '$last', '$filter_records', '$set_pre_sync_related_records', '$sync_scopes', '$notify_of_change', '$find', '$build_child_scope', '$name', '$reload_from_db', '$child_scopes', '$nil?', '$scope_description=', '$parent=', '$extend', '$link_child', '$sync_collection_with_parent', '$add_to_outer_scopes', '$collector?', '$link_to_parent', '$zero?', '$_count_internal', '$has_observers?', '$data_loading?', '$get_state', '$set_state', '$count', '$alias_method', '$collect', '$to_proc', '$proxy_association', '$push', '$set_belongs_to', '$virgin=', '$update_belongs_to', '$delete', '$sync_has_many', '$itself', '$force_push', '$update_child', '$replace', '$sort', '$include?', '$id=', '$reject', '$detect', '$=~', '$define_method', '$apply_scope', '$clear', '$load_data', '$internal_replace', '$each_with_index', '$dummy_collection', '$delete_internal', '$loading?', '$respond_to?', '$start_with?', '$sub', '$first', '$protected']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Collection(){}; | |
var self = $Collection = $klass($base, $super, 'Collection', $Collection); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Collection_unsaved_children_3, TMP_Collection_initialize_4, TMP_Collection_dup_for_sync_6, TMP_Collection_all_8, TMP_Collection_$$_10, TMP_Collection_$eq$eq_13, TMP_Collection_to_s_14, TMP_Collection_gather_related_records_20, TMP_Collection_merge_related_records_21, TMP_Collection_filter$q_22, TMP_Collection_joins_with$q_23, TMP_Collection_related_records_for_24, TMP_Collection_collector$q_25, TMP_Collection_filter_records_26, TMP_Collection_live_scopes_27, TMP_Collection_set_pre_sync_related_records_29, TMP_Collection_sync_scopes_31, TMP_Collection_apply_scope_32, TMP_Collection_child_scopes_33, TMP_Collection_build_child_scope_34, TMP_Collection_link_to_parent_35, TMP_Collection_link_child_36, TMP_Collection_sync_collection_with_parent_37, TMP_Collection_reload_from_db_38, TMP_Collection_observed_39, TMP_Collection_set_count_state_40, TMP_Collection__count_internal_41, TMP_Collection_count_42, TMP_Collection_collect_43, TMP_Collection_proxy_association_44, TMP_Collection_klass_45, TMP_Collection_push_and_update_belongs_to_46, TMP_Collection_set_belongs_to_47, TMP_Collection_update_child_48, TMP_Collection_push_49, TMP_Collection_sort$B_50, TMP_Collection_force_push_53, TMP_Collection_54, TMP_Collection_replace_57, TMP_Collection_internal_replace_62, TMP_Collection_delete_64, TMP_Collection_delete_internal_65, TMP_Collection_loading$q_66, TMP_Collection_empty$q_67, TMP_Collection_method_missing_68, TMP_Collection_dummy_record_69, TMP_Collection_collection_70, TMP_Collection_dummy_collection_71, TMP_Collection_notify_of_change_72; | |
def.uc_already_being_called = def.owner = def.association = def.unsaved_children = def.dummy_collection = def.collection = def.vector = def.parent = def.target_klass = def.target_class = def.scope_description = def.live_scopes = def.child_scopes = def.linked = def.observing = def.out_of_date = def.count = def.dummy_record = nil; | |
(function($base, $super, $parent_nesting) { | |
function $DummySet(){}; | |
var self = $DummySet = $klass($base, $super, 'DummySet', $DummySet); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_DummySet_new_1, TMP_DummySet_method_missing_2; | |
def.master = nil; | |
Opal.def(self, '$new', TMP_DummySet_new_1 = function() { | |
var $a, self = this, $iter = TMP_DummySet_new_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_i = nil, $zuper_ii = nil; | |
if ($iter) TMP_DummySet_new_1.$$p = null; | |
// Prepare super implicit arguments | |
for($zuper_i = 0, $zuper_ii = arguments.length, $zuper = new Array($zuper_ii); $zuper_i < $zuper_ii; $zuper_i++) { | |
$zuper[$zuper_i] = arguments[$zuper_i]; | |
} | |
return (self.master = ($truthy($a = self.master) ? $a : $send(self, Opal.find_super_dispatcher(self, 'new', TMP_DummySet_new_1, false), $zuper, $iter))) | |
}, TMP_DummySet_new_1.$$arity = 0); | |
return (Opal.def(self, '$method_missing', TMP_DummySet_method_missing_2 = function $$method_missing($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return nil | |
}, TMP_DummySet_method_missing_2.$$arity = -1), nil) && 'method_missing'; | |
})($nesting[0], null, $nesting); | |
Opal.def(self, '$unsaved_children', TMP_Collection_unsaved_children_3 = function $$unsaved_children() { | |
var $a, self = this, old_uc_already_being_called = nil; | |
return (function() { try { | |
old_uc_already_being_called = self.uc_already_being_called; | |
if ($truthy(($truthy($a = self.owner) ? self.association : $a))) { | |
self.unsaved_children = ($truthy($a = self.unsaved_children) ? $a : $$($nesting, 'Set').$new()); | |
if ($truthy(self.uc_already_being_called)) { | |
} else { | |
self.uc_already_being_called = true | |
}; | |
} else { | |
self.unsaved_children = ($truthy($a = self.unsaved_children) ? $a : $$($nesting, 'DummySet').$new()) | |
}; | |
return self.unsaved_children; | |
} finally { | |
(self.uc_already_being_called = old_uc_already_being_called) | |
}; })() | |
}, TMP_Collection_unsaved_children_3.$$arity = 0); | |
Opal.def(self, '$initialize', TMP_Collection_initialize_4 = function $$initialize(target_klass, owner, association, $a_rest) { | |
var $b, $c, self = this, vector; | |
if (owner == null) { | |
owner = nil; | |
} | |
if (association == null) { | |
association = nil; | |
} | |
var $args_len = arguments.length, $rest_len = $args_len - 3; | |
if ($rest_len < 0) { $rest_len = 0; } | |
vector = new Array($rest_len); | |
for (var $arg_idx = 3; $arg_idx < $args_len; $arg_idx++) { | |
vector[$arg_idx - 3] = arguments[$arg_idx]; | |
} | |
self.owner = owner; | |
self.association = association; | |
self.target_klass = target_klass; | |
if ($truthy(($truthy($b = ($truthy($c = owner) ? owner.$id()['$!']() : $c)) ? $rb_le(vector.$length(), 1) : $b))) { | |
self.collection = [] | |
} else if ($truthy($rb_gt(vector.$length(), 0))) { | |
self.vector = vector | |
} else if ($truthy(owner)) { | |
self.vector = $rb_plus(owner.$backing_record().$vector(), [association.$attribute()]) | |
} else { | |
self.vector = [target_klass] | |
}; | |
return (self.scopes = $hash2([], {})); | |
}, TMP_Collection_initialize_4.$$arity = -2); | |
Opal.def(self, '$dup_for_sync', TMP_Collection_dup_for_sync_6 = function $$dup_for_sync() { | |
var TMP_5, self = this; | |
return $send(self.$dup(), 'instance_eval', [], (TMP_5 = function(){var self = TMP_5.$$s || this; | |
if (self.collection == null) self.collection = nil; | |
if (self.scopes == null) self.scopes = nil; | |
if ($truthy(self.collection)) { | |
self.collection = self.collection.$dup()}; | |
self.scopes = self.scopes.$dup(); | |
return self;}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5)) | |
}, TMP_Collection_dup_for_sync_6.$$arity = 0); | |
Opal.def(self, '$all', TMP_Collection_all_8 = function $$all() { | |
var TMP_7, self = this, ids = nil; | |
self.$observed(); | |
if ($truthy(self.dummy_collection)) { | |
self.dummy_collection.$notify()}; | |
if ($truthy(self.collection)) { | |
} else { | |
self.collection = []; | |
if ($truthy((ids = $$$($$($nesting, 'ReactiveRecord'), 'Base').$fetch_from_db([].concat(Opal.to_a(self.vector)).concat(["*all"]))))) { | |
$send(ids, 'each', [], (TMP_7 = function(id){var self = TMP_7.$$s || this; | |
if (self.collection == null) self.collection = nil; | |
if (self.target_klass == null) self.target_klass = nil; | |
if (id == null) id = nil; | |
return self.collection['$<<'](self.target_klass.$find_by($hash(self.target_klass.$primary_key(), id)))}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7)) | |
} else { | |
self.dummy_collection = $send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'load_from_db', [nil].concat(Opal.to_a(self.vector)).concat(["*all"])); | |
self.dummy_record = self['$[]'](0); | |
}; | |
}; | |
return self.collection; | |
}, TMP_Collection_all_8.$$arity = 0); | |
Opal.def(self, '$[]', TMP_Collection_$$_10 = function(index) { | |
var $a, $b, TMP_9, self = this; | |
self.$observed(); | |
if ($truthy(($truthy($a = $rb_le(($truthy($b = self.collection) ? $b : self.$all()).$length(), index)) ? self.dummy_collection : $a))) { | |
$send(Opal.Range.$new(self.collection.$length(), index, false), 'each', [], (TMP_9 = function(i){var self = TMP_9.$$s || this, $c, new_dummy_record = nil, $writer = nil; | |
if (self.target_klass == null) self.target_klass = nil; | |
if (self.vector == null) self.vector = nil; | |
if (self.association == null) self.association = nil; | |
if (self.owner == null) self.owner = nil; | |
if (self.collection == null) self.collection = nil; | |
if (i == null) i = nil; | |
new_dummy_record = $send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'new_from_vector', [self.target_klass, nil].concat(Opal.to_a(self.vector)).concat(["" + "*" + (i)])); | |
if ($truthy(($truthy($c = self.association) ? self.association['$through_association?']()['$!']() : $c))) { | |
$writer = [self.association.$inverse_of(), self.owner]; | |
$send(new_dummy_record.$attributes(), '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
return self.collection['$<<'](new_dummy_record);}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9))}; | |
return self.collection['$[]'](index); | |
}, TMP_Collection_$$_10.$$arity = 1); | |
Opal.def(self, '$==', TMP_Collection_$eq$eq_13 = function(other_collection) { | |
var $a, TMP_11, TMP_12, self = this, my_children = nil, other_children = nil; | |
self.$observed(); | |
if ($truthy(other_collection['$is_a?']($$($nesting, 'Collection')))) { | |
} else { | |
return self.collection['$!']() | |
}; | |
other_collection.$observed(); | |
my_children = $send(($truthy($a = self.collection) ? $a : []), 'select', [], (TMP_11 = function(target){var self = TMP_11.$$s || this; | |
if (self.dummy_record == null) self.dummy_record = nil; | |
if (target == null) target = nil; | |
return target['$!='](self.dummy_record)}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11)); | |
if ($truthy(other_collection)) { | |
other_children = $send(($truthy($a = other_collection.$collection()) ? $a : []), 'select', [], (TMP_12 = function(target){var self = TMP_12.$$s || this; | |
if (target == null) target = nil; | |
return target['$!='](other_collection.$dummy_record())}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12)); | |
if (my_children['$=='](other_children)) { | |
} else { | |
return false | |
}; | |
return self.$unsaved_children().$to_a()['$=='](other_collection.$unsaved_children().$to_a()); | |
} else { | |
return ($truthy($a = my_children['$empty?']()) ? self.$unsaved_children()['$empty?']() : $a) | |
}; | |
}, TMP_Collection_$eq$eq_13.$$arity = 1); | |
self.$attr_reader("vector"); | |
self.$attr_writer("scope_description"); | |
self.$attr_writer("parent"); | |
self.$attr_reader("pre_sync_related_records"); | |
Opal.def(self, '$to_s', TMP_Collection_to_s_14 = function $$to_s() { | |
var self = this; | |
return "" + "<Coll-" + (self.$object_id()) + " owner: " + (self.owner) + ", parent: " + (self.parent) + " - " + (self.$vector()) + ">" | |
}, TMP_Collection_to_s_14.$$arity = 0); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_sync_scopes_16, TMP_apply_to_all_collections_18; | |
Opal.def(self, '$sync_scopes', TMP_sync_scopes_16 = function $$sync_scopes(broadcast) { | |
var TMP_15, self = this; | |
return $send($$$($$($nesting, 'React'), 'State'), 'bulk_update', [], (TMP_15 = function(){var self = TMP_15.$$s || this, $a, record = nil; | |
record = broadcast.$record_with_current_values(); | |
if ($truthy(record)) { | |
self.$apply_to_all_collections("set_pre_sync_related_records", record, broadcast['$new?']())}; | |
record = broadcast.$record_with_new_values(); | |
self.$apply_to_all_collections("sync_scopes", record, record['$destroyed?']()); | |
if ($truthy(($truthy($a = record['$destroyed?']()) ? $a : broadcast['$new?']()))) { | |
return record.$backing_record()['$sync_unscoped_collection!']() | |
} else { | |
return nil | |
};}, TMP_15.$$s = self, TMP_15.$$arity = 0, TMP_15)) | |
}, TMP_sync_scopes_16.$$arity = 1); | |
return (Opal.def(self, '$apply_to_all_collections', TMP_apply_to_all_collections_18 = function $$apply_to_all_collections(method, record, dont_gather) { | |
var TMP_17, self = this, related_records = nil; | |
if ($truthy(dont_gather)) { | |
related_records = $$($nesting, 'Set').$new()}; | |
return $send($$($nesting, 'Base').$outer_scopes(), 'each', [], (TMP_17 = function(collection){var self = TMP_17.$$s || this; | |
if (collection == null) collection = nil; | |
if ($truthy(dont_gather)) { | |
} else { | |
related_records = collection.$gather_related_records(record) | |
}; | |
return collection.$send(method, related_records, record);}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17)); | |
}, TMP_apply_to_all_collections_18.$$arity = 3), nil) && 'apply_to_all_collections'; | |
})(Opal.get_singleton_class(self), $nesting); | |
Opal.def(self, '$gather_related_records', TMP_Collection_gather_related_records_20 = function $$gather_related_records(record, related_records) { | |
var TMP_19, self = this; | |
if (related_records == null) { | |
related_records = $$($nesting, 'Set').$new(); | |
} | |
self.$merge_related_records(record, related_records); | |
$send(self.$live_scopes(), 'each', [], (TMP_19 = function(collection){var self = TMP_19.$$s || this; | |
if (collection == null) collection = nil; | |
return collection.$gather_related_records(record, related_records)}, TMP_19.$$s = self, TMP_19.$$arity = 1, TMP_19)); | |
return related_records; | |
}, TMP_Collection_gather_related_records_20.$$arity = -2); | |
Opal.def(self, '$merge_related_records', TMP_Collection_merge_related_records_21 = function $$merge_related_records(record, related_records) { | |
var $a, self = this; | |
if ($truthy(($truthy($a = self['$filter?']()) ? self['$joins_with?'](record) : $a))) { | |
related_records.$merge(self.$related_records_for(record))}; | |
return related_records; | |
}, TMP_Collection_merge_related_records_21.$$arity = 2); | |
Opal.def(self, '$filter?', TMP_Collection_filter$q_22 = function() { | |
var self = this; | |
return true | |
}, TMP_Collection_filter$q_22.$$arity = 0); | |
Opal.def(self, '$joins_with?', TMP_Collection_joins_with$q_23 = function(record) { | |
var $a, self = this, klass = nil; | |
klass = record.$class(); | |
if ($truthy(($a = self.association, ($a === nil || $a == null) ? nil : $send($a, 'through_association', [])))) { | |
return self.association.$through_association().$klass()['$=='](record.$class()) | |
} else if (self.target_klass['$=='](klass)) { | |
return true | |
} else if ($truthy(klass.$inheritance_column()['$!']())) { | |
return false | |
} else if (klass.$base_class()['$=='](self.target_class)) { | |
return $rb_lt(klass, self.target_klass) | |
} else if (klass.$base_class()['$=='](klass)) { | |
return $rb_lt(self.target_klass, klass) | |
} else { | |
return nil | |
}; | |
}, TMP_Collection_joins_with$q_23.$$arity = 1); | |
Opal.def(self, '$related_records_for', TMP_Collection_related_records_for_24 = function $$related_records_for(record) { | |
var self = this, attrs = nil, source = nil; | |
if ($truthy(self.association)) { | |
} else { | |
return [] | |
}; | |
attrs = record.$attributes(); | |
if (attrs['$[]'](self.association.$inverse_of())['$=='](self.owner)) { | |
} else { | |
return [] | |
}; | |
if ($truthy(self.association.$through_association()['$!']())) { | |
return [record] | |
} else if ($truthy((source = attrs['$[]'](self.association.$source())))) { | |
return [source] | |
} else { | |
return [] | |
}; | |
}, TMP_Collection_related_records_for_24.$$arity = 1); | |
Opal.def(self, '$collector?', TMP_Collection_collector$q_25 = function() { | |
var self = this; | |
return false | |
}, TMP_Collection_collector$q_25.$$arity = 0); | |
Opal.def(self, '$filter_records', TMP_Collection_filter_records_26 = function $$filter_records(related_records) { | |
var self = this, scope_args = nil; | |
scope_args = (function() {if ($truthy(self.vector.$last()['$is_a?']($$($nesting, 'Array')))) { | |
return self.vector.$last()['$[]']($range(1, -1, false)) | |
} else { | |
return [] | |
}; return nil; })(); | |
return self.scope_description.$filter_records(related_records, scope_args); | |
}, TMP_Collection_filter_records_26.$$arity = 1); | |
Opal.def(self, '$live_scopes', TMP_Collection_live_scopes_27 = function $$live_scopes() { | |
var $a, self = this; | |
return (self.live_scopes = ($truthy($a = self.live_scopes) ? $a : $$($nesting, 'Set').$new())) | |
}, TMP_Collection_live_scopes_27.$$arity = 0); | |
Opal.def(self, '$set_pre_sync_related_records', TMP_Collection_set_pre_sync_related_records_29 = function $$set_pre_sync_related_records(related_records, _record) { | |
var TMP_28, self = this; | |
if (_record == null) { | |
_record = nil; | |
} | |
self.pre_sync_related_records = related_records; | |
return $send(self.$live_scopes(), 'each', [], (TMP_28 = function(scope){var self = TMP_28.$$s || this; | |
if (self.pre_sync_related_records == null) self.pre_sync_related_records = nil; | |
if (scope == null) scope = nil; | |
return scope.$set_pre_sync_related_records(self.pre_sync_related_records)}, TMP_28.$$s = self, TMP_28.$$arity = 1, TMP_28)); | |
}, TMP_Collection_set_pre_sync_related_records_29.$$arity = -2); | |
Opal.def(self, '$sync_scopes', TMP_Collection_sync_scopes_31 = function $$sync_scopes(related_records, record, filtering) { | |
var TMP_30, self = this; | |
if (filtering == null) { | |
filtering = true; | |
} | |
return (function() { try { | |
$send(self.$live_scopes(), 'each', [], (TMP_30 = function(scope){var self = TMP_30.$$s || this; | |
if (scope == null) scope = nil; | |
return scope.$sync_scopes(related_records, record, filtering)}, TMP_30.$$s = self, TMP_30.$$arity = 1, TMP_30)); | |
if ($truthy(related_records['$empty?']())) { | |
return nil | |
} else { | |
return self.$notify_of_change() | |
}; | |
} finally { | |
(self.pre_sync_related_records = nil) | |
}; })() | |
}, TMP_Collection_sync_scopes_31.$$arity = -3); | |
Opal.def(self, '$apply_scope', TMP_Collection_apply_scope_32 = function $$apply_scope(name, $a_rest) { | |
var self = this, vector, description = nil, collection = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
vector = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
vector[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
description = $$($nesting, 'ScopeDescription').$find(self.target_klass, name); | |
collection = $send(self, 'build_child_scope', [description].concat(Opal.to_a(description.$name())).concat(Opal.to_a(vector))); | |
if (name['$==']("" + (description.$name()) + "!")) { | |
collection.$reload_from_db()}; | |
return collection; | |
}, TMP_Collection_apply_scope_32.$$arity = -2); | |
Opal.def(self, '$child_scopes', TMP_Collection_child_scopes_33 = function $$child_scopes() { | |
var $a, self = this; | |
return (self.child_scopes = ($truthy($a = self.child_scopes) ? $a : $hash2([], {}))) | |
}, TMP_Collection_child_scopes_33.$$arity = 0); | |
Opal.def(self, '$build_child_scope', TMP_Collection_build_child_scope_34 = function $$build_child_scope(scope_description, $a_rest) { | |
var $b, $c, self = this, scope_vector, $logical_op_recvr_tmp_6 = nil, $writer = nil, new_vector = nil, child_scope = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
scope_vector = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
scope_vector[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
$logical_op_recvr_tmp_6 = self.$child_scopes(); | |
return ($truthy($b = $logical_op_recvr_tmp_6['$[]'](scope_vector)) ? $b : (($writer = [scope_vector, ((new_vector = self.vector), (function() {if ($truthy(($truthy($c = new_vector['$nil?']()) ? $c : scope_vector['$empty?']()))) { | |
return nil | |
} else { | |
return (new_vector = $rb_plus(new_vector, [scope_vector])) | |
}; return nil; })(), (child_scope = $send($$($nesting, 'Collection'), 'new', [self.target_klass, nil, nil].concat(Opal.to_a(new_vector)))), (($writer = [scope_description]), $send(child_scope, 'scope_description=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]), (($writer = [self]), $send(child_scope, 'parent=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]), child_scope.$extend($$($nesting, 'ScopedCollection')), child_scope)]), $send($logical_op_recvr_tmp_6, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])); | |
}, TMP_Collection_build_child_scope_34.$$arity = -2); | |
Opal.def(self, '$link_to_parent', TMP_Collection_link_to_parent_35 = function $$link_to_parent() { | |
var self = this; | |
if ($truthy(self.linked)) { | |
return nil}; | |
self.linked = true; | |
if ($truthy(self.parent)) { | |
self.parent.$link_child(self); | |
if ($truthy(self.$collection())) { | |
} else { | |
self.$sync_collection_with_parent() | |
}; | |
} else { | |
$$$($$($nesting, 'ReactiveRecord'), 'Base').$add_to_outer_scopes(self) | |
}; | |
if ($truthy(self['$collector?']())) { | |
return self.$all() | |
} else { | |
return nil | |
}; | |
}, TMP_Collection_link_to_parent_35.$$arity = 0); | |
Opal.def(self, '$link_child', TMP_Collection_link_child_36 = function $$link_child(child) { | |
var self = this; | |
self.$live_scopes()['$<<'](child); | |
return self.$link_to_parent(); | |
}, TMP_Collection_link_child_36.$$arity = 1); | |
Opal.def(self, '$sync_collection_with_parent', TMP_Collection_sync_collection_with_parent_37 = function $$sync_collection_with_parent() { | |
var self = this; | |
if ($truthy(self.parent.$collection())) { | |
if ($truthy(self.parent.$collection()['$empty?']())) { | |
return (self.collection = []) | |
} else if ($truthy(self['$filter?']())) { | |
return (self.collection = self.$filter_records(self.parent.$collection())) | |
} else { | |
return nil | |
} | |
} else if ($truthy(self.parent.$_count_internal(false)['$zero?']())) { | |
return (self.count = 0) | |
} else { | |
return nil | |
} | |
}, TMP_Collection_sync_collection_with_parent_37.$$arity = 0); | |
Opal.def(self, '$reload_from_db', TMP_Collection_reload_from_db_38 = function $$reload_from_db(force) { | |
var $a, self = this; | |
if (force == null) { | |
force = nil; | |
} | |
if ($truthy(($truthy($a = force) ? $a : $$$($$($nesting, 'React'), 'State')['$has_observers?'](self, "collection")))) { | |
self.out_of_date = false; | |
if ($truthy(self.collection)) { | |
$send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'load_from_db', [nil].concat(Opal.to_a(self.vector)).concat(["*all"]))}; | |
$send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'load_from_db', [nil].concat(Opal.to_a(self.vector)).concat(["*count"])); | |
} else { | |
self.out_of_date = true | |
}; | |
return self; | |
}, TMP_Collection_reload_from_db_38.$$arity = -1); | |
Opal.def(self, '$observed', TMP_Collection_observed_39 = function $$observed() { | |
var $a, self = this; | |
if ($truthy(($truthy($a = self.observing) ? $a : $$$($$($nesting, 'ReactiveRecord'), 'Base')['$data_loading?']()))) { | |
return nil}; | |
return (function() { try { | |
self.observing = true; | |
self.$link_to_parent(); | |
if ($truthy(self.out_of_date)) { | |
self.$reload_from_db(true)}; | |
return $$$($$($nesting, 'React'), 'State').$get_state(self, "collection"); | |
} finally { | |
(self.observing = false) | |
}; })();; | |
}, TMP_Collection_observed_39.$$arity = 0); | |
Opal.def(self, '$set_count_state', TMP_Collection_set_count_state_40 = function $$set_count_state(val) { | |
var self = this; | |
if ($truthy($$$($$($nesting, 'ReactiveRecord'), 'WhileLoading')['$has_observers?']())) { | |
} else { | |
$$$($$($nesting, 'React'), 'State').$set_state(self, "collection", self.$collection(), true) | |
}; | |
return (self.count = val); | |
}, TMP_Collection_set_count_state_40.$$arity = 1); | |
Opal.def(self, '$_count_internal', TMP_Collection__count_internal_41 = function $$_count_internal(load_from_client) { | |
var $a, self = this; | |
self.$observed(); | |
if ($truthy(self.collection)) { | |
return self.collection.$count() | |
} else if ($truthy((self.count = ($truthy($a = self.count) ? $a : $$$($$($nesting, 'ReactiveRecord'), 'Base').$fetch_from_db([].concat(Opal.to_a(self.vector)).concat(["*count"])))))) { | |
return self.count | |
} else { | |
if ($truthy(load_from_client)) { | |
$send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'load_from_db', [nil].concat(Opal.to_a(self.vector)).concat(["*count"]))}; | |
return (self.count = 1); | |
}; | |
}, TMP_Collection__count_internal_41.$$arity = 1); | |
Opal.def(self, '$count', TMP_Collection_count_42 = function $$count() { | |
var self = this; | |
return self.$_count_internal(true) | |
}, TMP_Collection_count_42.$$arity = 0); | |
self.$alias_method("length", "count"); | |
Opal.def(self, '$collect', TMP_Collection_collect_43 = function $$collect($a_rest) { | |
var self = this, args, $iter = TMP_Collection_collect_43.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Collection_collect_43.$$p = null; | |
return $send(self.$all(), 'collect', Opal.to_a(args), block.$to_proc()) | |
}, TMP_Collection_collect_43.$$arity = -1); | |
Opal.def(self, '$proxy_association', TMP_Collection_proxy_association_44 = function $$proxy_association() { | |
var $a, self = this; | |
return ($truthy($a = self.association) ? $a : self) | |
}, TMP_Collection_proxy_association_44.$$arity = 0); | |
Opal.def(self, '$klass', TMP_Collection_klass_45 = function $$klass() { | |
var self = this; | |
return self.target_klass | |
}, TMP_Collection_klass_45.$$arity = 0); | |
Opal.def(self, '$push_and_update_belongs_to', TMP_Collection_push_and_update_belongs_to_46 = function $$push_and_update_belongs_to(id) { | |
var self = this, child = nil; | |
child = self.$proxy_association().$klass().$find(id); | |
self.$push(child); | |
return self.$set_belongs_to(child); | |
}, TMP_Collection_push_and_update_belongs_to_46.$$arity = 1); | |
Opal.def(self, '$set_belongs_to', TMP_Collection_set_belongs_to_47 = function $$set_belongs_to(child) { | |
var $a, self = this; | |
if ($truthy(self.owner)) { | |
if ($truthy(($truthy($a = self.association) ? self.association.$through_association()['$!']() : $a))) { | |
child.$send("" + (self.association.$inverse_of()) + "=", self.owner)} | |
} else if ($truthy(self.parent)) { | |
self.parent.$set_belongs_to(child)}; | |
return child; | |
}, TMP_Collection_set_belongs_to_47.$$arity = 1); | |
self.$attr_reader("client_collection"); | |
Opal.def(self, '$update_child', TMP_Collection_update_child_48 = function $$update_child(item) { | |
var $a, $b, $c, $d, self = this, backing_record = nil, inverse_of = nil, current_association = nil, $writer = nil; | |
backing_record = item.$backing_record(); | |
if ($truthy(($truthy($a = ($truthy($b = ($truthy($c = ($truthy($d = backing_record) ? self.owner : $d)) ? self.association : $c)) ? self.association['$through_association?']()['$!']() : $b)) ? item.$attributes()['$[]'](self.association.$inverse_of())['$!='](self.owner) : $a))) { | |
inverse_of = self.association.$inverse_of(); | |
current_association = item.$attributes()['$[]'](inverse_of); | |
if ($truthy(backing_record['$data_loading?']())) { | |
} else { | |
$writer = [false]; | |
$send(backing_record, 'virgin=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
}; | |
backing_record.$update_belongs_to(inverse_of, self.owner); | |
if ($truthy(($truthy($a = current_association) ? current_association.$attributes()['$[]'](self.association.$attribute()) : $a))) { | |
current_association.$attributes()['$[]'](self.association.$attribute()).$delete(item)}; | |
return self.owner.$backing_record().$sync_has_many(self.association.$attribute()); | |
} else { | |
return nil | |
}; | |
}, TMP_Collection_update_child_48.$$arity = 1); | |
Opal.def(self, '$push', TMP_Collection_push_49 = function $$push(item) { | |
var $a, self = this; | |
item.$itself(); | |
if ($truthy(self.$collection())) { | |
self.$force_push(item) | |
} else { | |
self.$unsaved_children()['$<<'](item); | |
self.$update_child(item); | |
if ($truthy(($truthy($a = self.owner) ? self.association : $a))) { | |
self.owner.$backing_record().$sync_has_many(self.association.$attribute())}; | |
if ($truthy(self.count['$nil?']()['$!']())) { | |
self.count = $rb_plus(self.count, (function() {if ($truthy(item['$destroyed?']())) { | |
return -1 | |
} else { | |
return 1 | |
}; return nil; })()); | |
self.$notify_of_change(self);}; | |
}; | |
return self; | |
}, TMP_Collection_push_49.$$arity = 1); | |
Opal.alias(self, "<<", "push"); | |
Opal.def(self, '$sort!', TMP_Collection_sort$B_50 = function($a_rest) { | |
var self = this, args, $iter = TMP_Collection_sort$B_50.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Collection_sort$B_50.$$p = null; | |
return self.$replace($send(self, 'sort', Opal.to_a(args), block.$to_proc())) | |
}, TMP_Collection_sort$B_50.$$arity = -1); | |
Opal.def(self, '$force_push', TMP_Collection_force_push_53 = function $$force_push(item) { | |
var $a, TMP_51, TMP_52, self = this, $writer = nil; | |
if ($truthy(item['$destroyed?']())) { | |
return self.$delete(item)}; | |
if ($truthy(self.$all()['$include?'](item))) { | |
} else { | |
self.$all()['$<<'](item) | |
}; | |
self.$update_child(item); | |
if ($truthy(($truthy($a = item.$id()) ? self.dummy_record : $a))) { | |
$writer = [item.$id()]; | |
$send(self.dummy_record, 'id=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$send(self.collection, 'reject', [], (TMP_51 = function(i){var self = TMP_51.$$s || this; | |
if (self.dummy_record == null) self.dummy_record = nil; | |
if (i == null) i = nil; | |
return i.$object_id()['$=='](self.dummy_record.$object_id())}, TMP_51.$$s = self, TMP_51.$$arity = 1, TMP_51)); | |
self.dummy_record = $send(self.collection, 'detect', [], (TMP_52 = function(r){var self = TMP_52.$$s || this; | |
if (r == null) r = nil; | |
return r.$backing_record().$vector().$last()['$=~'](/^\*[0-9]+$/)}, TMP_52.$$s = self, TMP_52.$$arity = 1, TMP_52)); | |
self.dummy_collection = nil;}; | |
return self.$notify_of_change(self); | |
}, TMP_Collection_force_push_53.$$arity = 1); | |
$send(["first", "last"], 'each', [], (TMP_Collection_54 = function(method){var self = TMP_Collection_54.$$s || this, TMP_55; | |
if (method == null) method = nil; | |
return $send(self, 'define_method', [method], (TMP_55 = function($a_rest){var self = TMP_55.$$s || this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if (args.$count()['$=='](0)) { | |
return self.$all().$send(method) | |
} else { | |
return $send(self, 'apply_scope', [method].concat(Opal.to_a(args))) | |
}}, TMP_55.$$s = self, TMP_55.$$arity = -1, TMP_55))}, TMP_Collection_54.$$s = self, TMP_Collection_54.$$arity = 1, TMP_Collection_54)); | |
Opal.def(self, '$replace', TMP_Collection_replace_57 = function $$replace(new_array) { | |
var TMP_56, self = this; | |
self.$unsaved_children().$clear(); | |
new_array = new_array.$to_a(); | |
if (new_array['$=='](self.collection)) { | |
return self}; | |
$send($$($nesting, 'Base'), 'load_data', [], (TMP_56 = function(){var self = TMP_56.$$s || this; | |
return self.$internal_replace(new_array)}, TMP_56.$$s = self, TMP_56.$$arity = 0, TMP_56)); | |
return self.$notify_of_change(new_array); | |
}, TMP_Collection_replace_57.$$arity = 1); | |
Opal.def(self, '$internal_replace', TMP_Collection_internal_replace_62 = function $$internal_replace(new_array) { | |
var TMP_58, TMP_59, TMP_60, TMP_61, self = this, array = nil; | |
if ($truthy(self.dummy_collection)) { | |
self.dummy_collection.$notify(); | |
array = (function() {if ($truthy(new_array['$is_a?']($$($nesting, 'Collection')))) { | |
return new_array.$collection() | |
} else { | |
return new_array | |
}; return nil; })(); | |
$send(self.collection, 'each_with_index', [], (TMP_58 = function(r, i){var self = TMP_58.$$s || this, $a, $b, $c, $writer = nil; | |
if (r == null) r = nil;if (i == null) i = nil; | |
if ($truthy(($truthy($a = ($truthy($b = ($truthy($c = array['$[]'](i)) ? array['$[]'](i).$id() : $c)) ? r['$new?']()['$!']() : $b)) ? r.$backing_record().$vector().$last()['$=~'](/^\*[0-9]+$/) : $a))) { | |
$writer = [new_array['$[]'](i).$id()]; | |
$send(r, 'id=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return nil | |
}}, TMP_58.$$s = self, TMP_58.$$arity = 2, TMP_58));}; | |
if ($truthy(self.collection)) { | |
$send(self.collection.$dup(), 'each', [], (TMP_59 = function(item){var self = TMP_59.$$s || this; | |
if (item == null) item = nil; | |
return self.$delete(item)}, TMP_59.$$s = self, TMP_59.$$arity = 1, TMP_59))}; | |
self.collection = []; | |
if ($truthy(new_array['$is_a?']($$($nesting, 'Collection')))) { | |
self.dummy_collection = new_array.$dummy_collection(); | |
self.dummy_record = new_array.$dummy_record(); | |
if ($truthy(new_array.$collection())) { | |
$send(new_array.$collection(), 'each', [], (TMP_60 = function(item){var self = TMP_60.$$s || this; | |
if (item == null) item = nil; | |
return self['$<<'](item)}, TMP_60.$$s = self, TMP_60.$$arity = 1, TMP_60))}; | |
} else { | |
self.dummy_collection = (self.dummy_record = nil); | |
$send(new_array, 'each', [], (TMP_61 = function(item){var self = TMP_61.$$s || this; | |
if (item == null) item = nil; | |
return self['$<<'](item)}, TMP_61.$$s = self, TMP_61.$$arity = 1, TMP_61)); | |
}; | |
return self.$notify_of_change(new_array); | |
}, TMP_Collection_internal_replace_62.$$arity = 1); | |
Opal.def(self, '$delete', TMP_Collection_delete_64 = function(item) { | |
var $a, $b, TMP_63, self = this, inverse_of = nil, backing_record = nil; | |
self.$unsaved_children().$delete(item); | |
return self.$notify_of_change((function() {if ($truthy(($truthy($a = ($truthy($b = self.owner) ? self.association : $b)) ? self.association['$through_association?']()['$!']() : $a))) { | |
inverse_of = self.association.$inverse_of(); | |
if ($truthy(($truthy($a = (backing_record = item.$backing_record())) ? item.$attributes()['$[]'](inverse_of)['$=='](self.owner) : $a))) { | |
backing_record.$update_belongs_to(inverse_of, nil)}; | |
return $send(self, 'delete_internal', [item], (TMP_63 = function(){var self = TMP_63.$$s || this; | |
if (self.owner == null) self.owner = nil; | |
if (self.association == null) self.association = nil; | |
return self.owner.$backing_record().$sync_has_many(self.association.$attribute())}, TMP_63.$$s = self, TMP_63.$$arity = 0, TMP_63)); | |
} else { | |
return self.$delete_internal(item) | |
}; return nil; })()); | |
}, TMP_Collection_delete_64.$$arity = 1); | |
Opal.def(self, '$delete_internal', TMP_Collection_delete_internal_65 = function $$delete_internal(item) { | |
var self = this, $iter = TMP_Collection_delete_internal_65.$$p, $yield = $iter || nil; | |
if ($iter) TMP_Collection_delete_internal_65.$$p = null; | |
if ($truthy(self.$collection())) { | |
self.$all().$delete(item) | |
} else if ($truthy(self.count['$nil?']()['$!']())) { | |
self.count = $rb_minus(self.count, 1)}; | |
if (($yield !== nil)) { | |
Opal.yieldX($yield, [])}; | |
return item; | |
}, TMP_Collection_delete_internal_65.$$arity = 1); | |
Opal.def(self, '$loading?', TMP_Collection_loading$q_66 = function() { | |
var self = this; | |
self.$all(); | |
return self.dummy_collection['$loading?'](); | |
}, TMP_Collection_loading$q_66.$$arity = 0); | |
Opal.def(self, '$empty?', TMP_Collection_empty$q_67 = function() { | |
var self = this; | |
return self.$all()['$empty?']() | |
}, TMP_Collection_empty$q_67.$$arity = 0); | |
Opal.def(self, '$method_missing', TMP_Collection_method_missing_68 = function $$method_missing(method, $a_rest) { | |
var $b, self = this, args, $iter = TMP_Collection_method_missing_68.$$p, block = $iter || nil, $zuper = nil, $zuper_i = nil, $zuper_ii = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Collection_method_missing_68.$$p = null; | |
// Prepare super implicit arguments | |
for($zuper_i = 0, $zuper_ii = arguments.length, $zuper = new Array($zuper_ii); $zuper_i < $zuper_ii; $zuper_i++) { | |
$zuper[$zuper_i] = arguments[$zuper_i]; | |
} | |
if ($truthy([]['$respond_to?'](method))) { | |
return $send(self.$all(), 'send', [method].concat(Opal.to_a(args)), block.$to_proc()) | |
} else if ($truthy($$($nesting, 'ScopeDescription').$find(self.target_klass, method))) { | |
return $send(self, 'apply_scope', [method].concat(Opal.to_a(args))) | |
} else if ($truthy((($b = args.$count()['$=='](1)) ? method['$start_with?']("find_by_") : args.$count()['$=='](1)))) { | |
return self.$apply_scope("find_by", $hash(method.$sub(/^find_by_/, ""), args.$first())) | |
} else if ($truthy(($truthy($b = self.target_klass['$respond_to?'](method)) ? $$($nesting, 'ScopeDescription').$find(self.target_klass, "" + "_" + (method)) : $b))) { | |
return $send(self, 'apply_scope', ["" + "_" + (method)].concat(Opal.to_a(args))).$first() | |
} else { | |
return $send(self, Opal.find_super_dispatcher(self, 'method_missing', TMP_Collection_method_missing_68, false), $zuper, $iter) | |
} | |
}, TMP_Collection_method_missing_68.$$arity = -2); | |
self.$protected(); | |
Opal.def(self, '$dummy_record', TMP_Collection_dummy_record_69 = function $$dummy_record() { | |
var self = this; | |
return self.dummy_record | |
}, TMP_Collection_dummy_record_69.$$arity = 0); | |
Opal.def(self, '$collection', TMP_Collection_collection_70 = function $$collection() { | |
var self = this; | |
return self.collection | |
}, TMP_Collection_collection_70.$$arity = 0); | |
Opal.def(self, '$dummy_collection', TMP_Collection_dummy_collection_71 = function $$dummy_collection() { | |
var self = this; | |
return self.dummy_collection | |
}, TMP_Collection_dummy_collection_71.$$arity = 0); | |
return (Opal.def(self, '$notify_of_change', TMP_Collection_notify_of_change_72 = function $$notify_of_change(value) { | |
var self = this; | |
if (value == null) { | |
value = nil; | |
} | |
if ($truthy($$$($$($nesting, 'ReactiveRecord'), 'Base')['$data_loading?']())) { | |
} else { | |
$$$($$($nesting, 'React'), 'State').$set_state(self, "collection", self.$collection()) | |
}; | |
return value; | |
}, TMP_Collection_notify_of_change_72.$$arity = -1), nil) && 'notify_of_change'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/column_types.rb": | |
/*!************************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/column_types.rb ***! | |
\************************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/column_types"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$columns_hash', '$model', '$[]', '$column_type', '$is_a?', '$at', '$parse', '$strftime', '$!', '$include?', '$Integer', '$Float', '$to_s', '$new', '$[]=', '$-', '$serialized?', '$class', '$loading?', '$!=', '$respond_to?', '$send']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_columns_hash_1, TMP_Base_column_type_2, TMP_Base_column_type_3, TMP_Base_convert_datetime_4, TMP_Base_convert_date_5, TMP_Base_convert_boolean_6, TMP_Base_convert_integer_7, TMP_Base_convert_float_8, TMP_Base_convert_text_9, TMP_Base_serialized$q_11, TMP_Base_convert_12; | |
Opal.def(self, '$columns_hash', TMP_Base_columns_hash_1 = function $$columns_hash() { | |
var self = this; | |
return self.$model().$columns_hash() | |
}, TMP_Base_columns_hash_1.$$arity = 0); | |
Opal.defs(self, '$column_type', TMP_Base_column_type_2 = function $$column_type(column_hash) { | |
var $a, $b, self = this; | |
return ($truthy($a = ($truthy($b = column_hash) ? column_hash['$[]']("sql_type_metadata") : $b)) ? column_hash['$[]']("sql_type_metadata")['$[]']("type") : $a) | |
}, TMP_Base_column_type_2.$$arity = 1); | |
Opal.def(self, '$column_type', TMP_Base_column_type_3 = function $$column_type(attr) { | |
var self = this; | |
return $$($nesting, 'Base').$column_type(self.$columns_hash()['$[]'](attr)) | |
}, TMP_Base_column_type_3.$$arity = 1); | |
Opal.def(self, '$convert_datetime', TMP_Base_convert_datetime_4 = function $$convert_datetime(val) { | |
var self = this; | |
if ($truthy(val['$is_a?']($$($nesting, 'Numeric')))) { | |
return $$($nesting, 'Time').$at(val) | |
} else if ($truthy(val['$is_a?']($$($nesting, 'Time')))) { | |
return val | |
} else { | |
return $$($nesting, 'Time').$parse(val) | |
} | |
}, TMP_Base_convert_datetime_4.$$arity = 1); | |
Opal.alias(self, "convert_time", "convert_datetime"); | |
Opal.alias(self, "convert_timestamp", "convert_datetime"); | |
Opal.def(self, '$convert_date', TMP_Base_convert_date_5 = function $$convert_date(val) { | |
var self = this; | |
if ($truthy(val['$is_a?']($$($nesting, 'Time')))) { | |
return $$($nesting, 'Date').$parse(val.$strftime("%d/%m/%Y")) | |
} else if ($truthy(val['$is_a?']($$($nesting, 'Date')))) { | |
return val | |
} else { | |
return $$($nesting, 'Date').$parse(val) | |
} | |
}, TMP_Base_convert_date_5.$$arity = 1); | |
Opal.def(self, '$convert_boolean', TMP_Base_convert_boolean_6 = function $$convert_boolean(val) { | |
var self = this; | |
return ["false", false, nil, 0]['$include?'](val)['$!']() | |
}, TMP_Base_convert_boolean_6.$$arity = 1); | |
Opal.def(self, '$convert_integer', TMP_Base_convert_integer_7 = function $$convert_integer(val) { | |
var self = this; | |
return self.$Integer(parseInt(val)) | |
}, TMP_Base_convert_integer_7.$$arity = 1); | |
Opal.alias(self, "convert_bigint", "convert_integer"); | |
Opal.def(self, '$convert_float', TMP_Base_convert_float_8 = function $$convert_float(val) { | |
var self = this; | |
return self.$Float(val) | |
}, TMP_Base_convert_float_8.$$arity = 1); | |
Opal.alias(self, "convert_decimal", "convert_float"); | |
Opal.def(self, '$convert_text', TMP_Base_convert_text_9 = function $$convert_text(val) { | |
var self = this; | |
return val.$to_s() | |
}, TMP_Base_convert_text_9.$$arity = 1); | |
Opal.alias(self, "convert_string", "convert_text"); | |
Opal.defs(self, '$serialized?', TMP_Base_serialized$q_11 = function() { | |
var $a, TMP_10, self = this; | |
if (self.serialized_attrs == null) self.serialized_attrs = nil; | |
return (self.serialized_attrs = ($truthy($a = self.serialized_attrs) ? $a : $send($$($nesting, 'Hash'), 'new', [], (TMP_10 = function(h, k){var self = TMP_10.$$s || this, $writer = nil; | |
if (h == null) h = nil;if (k == null) k = nil; | |
$writer = [k, $$($nesting, 'Hash').$new()]; | |
$send(h, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10)))) | |
}, TMP_Base_serialized$q_11.$$arity = 0); | |
return (Opal.def(self, '$convert', TMP_Base_convert_12 = function $$convert(attr, val) { | |
var $a, $b, $c, self = this, column_type = nil, conversion_method = nil; | |
column_type = self.$column_type(attr); | |
if ($truthy(($truthy($a = ($truthy($b = ($truthy($c = self.$class()['$serialized?']()['$[]'](self.$model())['$[]'](attr)) ? $c : column_type['$!']())) ? $b : val['$loading?']())) ? $a : ($truthy($b = val['$!']()) ? column_type['$!=']("boolean") : $b)))) { | |
return val}; | |
conversion_method = "" + "convert_" + (column_type); | |
if ($truthy(self['$respond_to?'](conversion_method))) { | |
return self.$send(conversion_method, val)}; | |
return val; | |
}, TMP_Base_convert_12.$$arity = 2), nil) && 'convert'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/dummy_value.rb": | |
/*!***********************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/dummy_value.rb ***! | |
\***********************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/dummy_value"] = function(Opal) { | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module, $truthy = Opal.truthy, $hash2 = Opal.hash2, $send = Opal.send; | |
Opal.add_stubs(['$!', '$loading?', '$notify', '$column_type', '$__send__', '$[]', '$parse', '$+', '$gsub', '$dummy_time', '$dummy_date', '$Float', '$Integer', '$data_loading?', '$loads_pending!', '$loading!', '$start_with?', '$respond_to?', '$send', '$to_proc', '$coerce', '$downcase', '$name', '$class', '$==', '$object_id', '$zero?', '$to_s', '$to_f', '$to_i', '$to_numeric', '$to_number', '$to_date', '$to_time', '$is_a?', '$acts_as_string?', '$include?', '$empty?']); | |
(function($base, $super, $parent_nesting) { | |
function $Object(){}; | |
var self = $Object = $klass($base, $super, 'Object', $Object); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Object_loaded$q_1, TMP_Object_loading$q_2, TMP_Object_present$q_3; | |
Opal.def(self, '$loaded?', TMP_Object_loaded$q_1 = function() { | |
var self = this; | |
return self['$loading?']()['$!']() | |
}, TMP_Object_loaded$q_1.$$arity = 0); | |
Opal.def(self, '$loading?', TMP_Object_loading$q_2 = function() { | |
var self = this; | |
return false | |
}, TMP_Object_loading$q_2.$$arity = 0); | |
return (Opal.def(self, '$present?', TMP_Object_present$q_3 = function() { | |
var self = this; | |
return self['$!']()['$!']() | |
}, TMP_Object_present$q_3.$$arity = 0), nil) && 'present?'; | |
})($nesting[0], null, $nesting); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $DummyValue(){}; | |
var self = $DummyValue = $klass($base, $super, 'DummyValue', $DummyValue); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_DummyValue_initialize_4, TMP_DummyValue_build_default_value_for_nil_5, TMP_DummyValue_build_default_value_for_datetime_6, TMP_DummyValue_build_default_value_for_date_7, TMP_DummyValue_build_default_value_for_boolean_8, TMP_DummyValue_build_default_value_for_float_9, TMP_DummyValue_build_default_value_for_integer_10, TMP_DummyValue_build_default_value_for_string_11, TMP_DummyValue_notify_12, TMP_DummyValue_loading$q_13, TMP_DummyValue_loaded$q_14, TMP_DummyValue_present$q_15, TMP_DummyValue_nil$q_16, TMP_DummyValue_$B_17, TMP_DummyValue_method_missing_18, TMP_DummyValue_coerce_19, TMP_DummyValue_$eq$eq_20, TMP_DummyValue_object_id_21, TMP_DummyValue_is_a$q_22, TMP_DummyValue_zero$q_23, TMP_DummyValue_to_s_24, TMP_DummyValue_tap_25, TMP_DummyValue_to_f_26, TMP_DummyValue_to_i_27, TMP_DummyValue_to_numeric_28, TMP_DummyValue_to_number_29, TMP_DummyValue_dummy_time_30, TMP_DummyValue_dummy_date_31, TMP_DummyValue_to_date_32, TMP_DummyValue_to_time_33, TMP_DummyValue_acts_as_string$q_34, TMP_DummyValue_respond_to$q_35, TMP_DummyValue_try_36; | |
def.column_hash = def.object = nil; | |
Opal.def(self, '$initialize', TMP_DummyValue_initialize_4 = function $$initialize(column_hash) { | |
var $a, self = this, column_type = nil, default_value_method = nil; | |
if (column_hash == null) { | |
column_hash = nil; | |
} | |
try { | |
column_hash = ($truthy($a = column_hash) ? $a : $hash2([], {})); | |
self.$notify(); | |
self.column_hash = column_hash; | |
column_type = ($truthy($a = $$($nesting, 'Base').$column_type(self.column_hash)) ? $a : "nil"); | |
default_value_method = "" + "build_default_value_for_" + (column_type); | |
return (self.object = self.$__send__(default_value_method)); | |
} catch ($err) { | |
if (Opal.rescue($err, [$$$('::', 'Exception')])) { | |
try { | |
return nil | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_DummyValue_initialize_4.$$arity = -1); | |
Opal.def(self, '$build_default_value_for_nil', TMP_DummyValue_build_default_value_for_nil_5 = function $$build_default_value_for_nil() { | |
var $a, self = this; | |
return ($truthy($a = self.column_hash['$[]']("default")) ? $a : nil) | |
}, TMP_DummyValue_build_default_value_for_nil_5.$$arity = 0); | |
Opal.def(self, '$build_default_value_for_datetime', TMP_DummyValue_build_default_value_for_datetime_6 = function $$build_default_value_for_datetime() { | |
var self = this; | |
if ($truthy(self.column_hash['$[]']("default"))) { | |
return $$$('::', 'Time').$parse($rb_plus(self.column_hash['$[]']("default").$gsub(" ", "T"), "+00:00")) | |
} else { | |
return $$$($$$($$$('::', 'ReactiveRecord'), 'Base'), 'DummyValue').$dummy_time() | |
} | |
}, TMP_DummyValue_build_default_value_for_datetime_6.$$arity = 0); | |
Opal.alias(self, "build_default_value_for_time", "build_default_value_for_datetime"); | |
Opal.alias(self, "build_default_value_for_timestamp", "build_default_value_for_datetime"); | |
Opal.def(self, '$build_default_value_for_date', TMP_DummyValue_build_default_value_for_date_7 = function $$build_default_value_for_date() { | |
var self = this; | |
if ($truthy(self.column_hash['$[]']("default"))) { | |
return $$$('::', 'Date').$parse(self.column_hash['$[]']("default")) | |
} else { | |
return $$$($$$($$$('::', 'ReactiveRecord'), 'Base'), 'DummyValue').$dummy_date() | |
} | |
}, TMP_DummyValue_build_default_value_for_date_7.$$arity = 0); | |
Opal.def(self, '$build_default_value_for_boolean', TMP_DummyValue_build_default_value_for_boolean_8 = function $$build_default_value_for_boolean() { | |
var $a, self = this; | |
return ($truthy($a = self.column_hash['$[]']("default")) ? $a : false) | |
}, TMP_DummyValue_build_default_value_for_boolean_8.$$arity = 0); | |
Opal.def(self, '$build_default_value_for_float', TMP_DummyValue_build_default_value_for_float_9 = function $$build_default_value_for_float() { | |
var $a, self = this; | |
return ($truthy($a = self.column_hash['$[]']("default")) ? $a : self.$Float(0.0)) | |
}, TMP_DummyValue_build_default_value_for_float_9.$$arity = 0); | |
Opal.alias(self, "build_default_value_for_decimal", "build_default_value_for_float"); | |
Opal.def(self, '$build_default_value_for_integer', TMP_DummyValue_build_default_value_for_integer_10 = function $$build_default_value_for_integer() { | |
var $a, self = this; | |
return ($truthy($a = self.column_hash['$[]']("default")) ? $a : self.$Integer(0)) | |
}, TMP_DummyValue_build_default_value_for_integer_10.$$arity = 0); | |
Opal.alias(self, "build_default_value_for_bigint", "build_default_value_for_integer"); | |
Opal.def(self, '$build_default_value_for_string', TMP_DummyValue_build_default_value_for_string_11 = function $$build_default_value_for_string() { | |
var $a, self = this; | |
return ($truthy($a = self.column_hash['$[]']("default")) ? $a : "") | |
}, TMP_DummyValue_build_default_value_for_string_11.$$arity = 0); | |
Opal.alias(self, "build_default_value_for_text", "build_default_value_for_string"); | |
Opal.def(self, '$notify', TMP_DummyValue_notify_12 = function $$notify() { | |
var self = this; | |
if ($truthy($$$($$$('::', 'ReactiveRecord'), 'Base')['$data_loading?']())) { | |
return nil}; | |
$$$('::', 'ReactiveRecord')['$loads_pending!'](); | |
return $$$($$$('::', 'ReactiveRecord'), 'WhileLoading')['$loading!'](); | |
}, TMP_DummyValue_notify_12.$$arity = 0); | |
Opal.def(self, '$loading?', TMP_DummyValue_loading$q_13 = function() { | |
var self = this; | |
return true | |
}, TMP_DummyValue_loading$q_13.$$arity = 0); | |
Opal.def(self, '$loaded?', TMP_DummyValue_loaded$q_14 = function() { | |
var self = this; | |
return false | |
}, TMP_DummyValue_loaded$q_14.$$arity = 0); | |
Opal.def(self, '$present?', TMP_DummyValue_present$q_15 = function() { | |
var self = this; | |
return false | |
}, TMP_DummyValue_present$q_15.$$arity = 0); | |
Opal.def(self, '$nil?', TMP_DummyValue_nil$q_16 = function() { | |
var self = this; | |
return true | |
}, TMP_DummyValue_nil$q_16.$$arity = 0); | |
Opal.def(self, '$!', TMP_DummyValue_$B_17 = function() { | |
var self = this; | |
return true | |
}, TMP_DummyValue_$B_17.$$arity = 0); | |
Opal.def(self, '$method_missing', TMP_DummyValue_method_missing_18 = function $$method_missing(method, $a_rest) { | |
var $b, self = this, args, $iter = TMP_DummyValue_method_missing_18.$$p, block = $iter || nil, $zuper = nil, $zuper_i = nil, $zuper_ii = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_DummyValue_method_missing_18.$$p = null; | |
// Prepare super implicit arguments | |
for($zuper_i = 0, $zuper_ii = arguments.length, $zuper = new Array($zuper_ii); $zuper_i < $zuper_ii; $zuper_i++) { | |
$zuper[$zuper_i] = arguments[$zuper_i]; | |
} | |
if ($truthy(method['$start_with?']("build_default_value_for_"))) { | |
return nil | |
} else if ($truthy(($truthy($b = self.object) ? $b : self.object['$respond_to?'](method)))) { | |
self.$notify(); | |
return $send(self.object, 'send', [method].concat(Opal.to_a(args)), block.$to_proc()); | |
} else if ($truthy((0)['$respond_to?'](method))) { | |
self.$notify(); | |
return $send((0), 'send', [method].concat(Opal.to_a(args)), block.$to_proc()); | |
} else if ($truthy(""['$respond_to?'](method))) { | |
self.$notify(); | |
return $send("", 'send', [method].concat(Opal.to_a(args)), block.$to_proc()); | |
} else { | |
return $send(self, Opal.find_super_dispatcher(self, 'method_missing', TMP_DummyValue_method_missing_18, false), $zuper, $iter) | |
} | |
}, TMP_DummyValue_method_missing_18.$$arity = -2); | |
Opal.def(self, '$coerce', TMP_DummyValue_coerce_19 = function $$coerce(s) { | |
var self = this; | |
if ($truthy(self.object)) { | |
return self.object.$coerce(s)}; | |
return [self.$__send__("" + "to_" + (s.$class().$name().$downcase())), s]; | |
}, TMP_DummyValue_coerce_19.$$arity = 1); | |
Opal.def(self, '$==', TMP_DummyValue_$eq$eq_20 = function(other) { | |
var self = this; | |
return other.$object_id()['$=='](self.$object_id()) | |
}, TMP_DummyValue_$eq$eq_20.$$arity = 1); | |
Opal.def(self, '$object_id', TMP_DummyValue_object_id_21 = function $$object_id() { | |
var self = this; | |
return self.$$id; | |
}, TMP_DummyValue_object_id_21.$$arity = 0); | |
Opal.def(self, '$is_a?', TMP_DummyValue_is_a$q_22 = function(klass) { | |
var self = this; | |
return klass['$==']($$$($$$($$$('::', 'ReactiveRecord'), 'Base'), 'DummyValue')) | |
}, TMP_DummyValue_is_a$q_22.$$arity = 1); | |
Opal.def(self, '$zero?', TMP_DummyValue_zero$q_23 = function() { | |
var self = this; | |
if ($truthy(self.object)) { | |
return self.object['$zero?']()}; | |
return false; | |
}, TMP_DummyValue_zero$q_23.$$arity = 0); | |
Opal.def(self, '$to_s', TMP_DummyValue_to_s_24 = function $$to_s() { | |
var self = this; | |
self.$notify(); | |
if ($truthy(self.object)) { | |
return self.object.$to_s()}; | |
return ""; | |
}, TMP_DummyValue_to_s_24.$$arity = 0); | |
Opal.def(self, '$tap', TMP_DummyValue_tap_25 = function $$tap() { | |
var self = this, $iter = TMP_DummyValue_tap_25.$$p, $yield = $iter || nil; | |
if ($iter) TMP_DummyValue_tap_25.$$p = null; | |
Opal.yield1($yield, self); | |
return self; | |
}, TMP_DummyValue_tap_25.$$arity = 0); | |
Opal.alias(self, "inspect", "to_s"); | |
self.prototype.toString = Opal.Object.prototype.toString; | |
Opal.def(self, '$to_f', TMP_DummyValue_to_f_26 = function $$to_f() { | |
var self = this; | |
self.$notify(); | |
if ($truthy(self.object)) { | |
return self.object.$to_f()}; | |
return 0.0; | |
}, TMP_DummyValue_to_f_26.$$arity = 0); | |
Opal.def(self, '$to_i', TMP_DummyValue_to_i_27 = function $$to_i() { | |
var self = this; | |
self.$notify(); | |
if ($truthy(self.object)) { | |
return self.object.$to_i()}; | |
return 0; | |
}, TMP_DummyValue_to_i_27.$$arity = 0); | |
Opal.def(self, '$to_numeric', TMP_DummyValue_to_numeric_28 = function $$to_numeric() { | |
var self = this; | |
self.$notify(); | |
if ($truthy(self.object)) { | |
return self.object.$to_numeric()}; | |
return 0; | |
}, TMP_DummyValue_to_numeric_28.$$arity = 0); | |
Opal.def(self, '$to_number', TMP_DummyValue_to_number_29 = function $$to_number() { | |
var self = this; | |
self.$notify(); | |
if ($truthy(self.object)) { | |
return self.object.$to_number()}; | |
return 0; | |
}, TMP_DummyValue_to_number_29.$$arity = 0); | |
Opal.defs(self, '$dummy_time', TMP_DummyValue_dummy_time_30 = function $$dummy_time() { | |
var $a, self = this; | |
if (self.dummy_time == null) self.dummy_time = nil; | |
return (self.dummy_time = ($truthy($a = self.dummy_time) ? $a : $$$('::', 'Time').$parse("2001-01-01T00:00:00.000-00:00"))) | |
}, TMP_DummyValue_dummy_time_30.$$arity = 0); | |
Opal.defs(self, '$dummy_date', TMP_DummyValue_dummy_date_31 = function $$dummy_date() { | |
var $a, self = this; | |
if (self.dummy_date == null) self.dummy_date = nil; | |
return (self.dummy_date = ($truthy($a = self.dummy_date) ? $a : $$$('::', 'Date').$parse("1/1/2001"))) | |
}, TMP_DummyValue_dummy_date_31.$$arity = 0); | |
Opal.def(self, '$to_date', TMP_DummyValue_to_date_32 = function $$to_date() { | |
var self = this; | |
self.$notify(); | |
if ($truthy(self.object)) { | |
return self.object.$to_date()}; | |
return $$$($$$($$$('::', 'ReactiveRecord'), 'Base'), 'DummyValue').$dummy_date(); | |
}, TMP_DummyValue_to_date_32.$$arity = 0); | |
Opal.def(self, '$to_time', TMP_DummyValue_to_time_33 = function $$to_time() { | |
var self = this; | |
self.$notify(); | |
if ($truthy(self.object)) { | |
return self.object.$to_time()}; | |
return $$$($$$($$$('::', 'ReactiveRecord'), 'Base'), 'DummyValue').$dummy_time(); | |
}, TMP_DummyValue_to_time_33.$$arity = 0); | |
Opal.def(self, '$acts_as_string?', TMP_DummyValue_acts_as_string$q_34 = function() { | |
var $a, self = this; | |
if ($truthy(self.object['$is_a?']($$$('::', 'String')))) { | |
return true}; | |
if ($truthy(($truthy($a = self.object) ? self.object['$respond_to?']("acts_as_string?") : $a))) { | |
return self.object['$acts_as_string?']()}; | |
return true; | |
}, TMP_DummyValue_acts_as_string$q_34.$$arity = 0); | |
Opal.def(self, '$respond_to?', TMP_DummyValue_respond_to$q_35 = function(method) { | |
var self = this; | |
if (method['$==']("acts_as_string?")) { | |
return true}; | |
if ($truthy(["inspect", "to_date", "to_f", "to_i", "to_numeric", "to_number", "to_s", "to_time"]['$include?'](method))) { | |
return true}; | |
if ($truthy(self.object)) { | |
return self.object['$respond_to?']()}; | |
return false; | |
}, TMP_DummyValue_respond_to$q_35.$$arity = 1); | |
return (Opal.def(self, '$try', TMP_DummyValue_try_36 = function($a_rest) { | |
var $b, self = this, args, $iter = TMP_DummyValue_try_36.$$p, b = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_DummyValue_try_36.$$p = null; | |
try { | |
if ($truthy(($truthy($b = args['$empty?']()) ? (b !== nil) : $b))) { | |
return Opal.yield1(b, self); | |
} else { | |
return $send(self, '__send__', Opal.to_a(args), b.$to_proc()) | |
} | |
} catch ($err) { | |
if (Opal.rescue($err, [$$$('::', 'Exception')])) { | |
try { | |
return nil | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_DummyValue_try_36.$$arity = -1), nil) && 'try'; | |
})($nesting[0], $$($nesting, 'BasicObject'), $nesting) | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/getters.rb": | |
/*!*******************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/getters.rb ***! | |
\*******************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/getters"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $send = Opal.send, $truthy = Opal.truthy, $hash = Opal.hash; | |
Opal.add_stubs(['$cast_to_current_sti_type', '$getter_common', '$attribute', '$new?', '$present?', '$id', '$fetch_from_db', '$primary_key', '$find_association', '$sync_ignore_dummy', '$new', '$klass', '$[]=', '$-', '$sync_attribute', '$vector', '$non_relationship_getter_common', '$convert', '$[]', '$columns_hash', '$model', '$load_from_db', '$link_aggregate', '$backing_record', '$new_from_vector', '$private', '$log', '$name', '$is_a?', '$on_opal_client?', '$data_loading?', '$tap', '$key?', '$notify', '$on_opal_server?', '$changed?', '$virtual_fetch_on_server_warning', '$get_state', '$inverse_of', '$find', '$attributes', '$reflect_on_association', '$through_association?', '$collection?', '$!=', '$replace', '$aggregate_owner=', '$aggregate_attribute=']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $Getters() {}; | |
var self = $Getters = $module($base, 'Getters', $Getters); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Getters_get_belongs_to_2, TMP_Getters_get_has_many_4, TMP_Getters_get_attr_value_6, TMP_Getters_get_primary_key_value_7, TMP_Getters_get_server_method_9, TMP_Getters_get_ar_aggregate_11, TMP_Getters_get_non_ar_aggregate_12, TMP_Getters_virtual_fetch_on_server_warning_13, TMP_Getters_sync_ignore_dummy_14, TMP_Getters_non_relationship_getter_common_15, TMP_Getters_getter_common_17, TMP_Getters_find_association_19, TMP_Getters_link_aggregate_20; | |
Opal.def(self, '$get_belongs_to', TMP_Getters_get_belongs_to_2 = function $$get_belongs_to(assoc, reload) {try { | |
var TMP_1, $a, self = this; | |
if (reload == null) { | |
reload = nil; | |
} | |
return ($a = $send(self, 'getter_common', [assoc.$attribute(), reload], (TMP_1 = function(has_key, attr){var self = TMP_1.$$s || this, value = nil; | |
if (self.model == null) self.model = nil; | |
if (has_key == null) has_key = nil;if (attr == null) attr = nil; | |
if ($truthy(self['$new?']())) { | |
Opal.ret(nil)}; | |
if ($truthy(self.$id()['$present?']())) { | |
value = $$($nesting, 'Base').$fetch_from_db([self.model, ["find", self.$id()], attr, self.model.$primary_key()])}; | |
value = self.$find_association(assoc, value); | |
return self.$sync_ignore_dummy(attr, value, has_key);}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1)), ($a === nil || $a == null) ? nil : $send($a, 'cast_to_current_sti_type', [])) | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_Getters_get_belongs_to_2.$$arity = -2); | |
Opal.def(self, '$get_has_many', TMP_Getters_get_has_many_4 = function $$get_has_many(assoc, reload) { | |
var TMP_3, self = this; | |
if (reload == null) { | |
reload = nil; | |
} | |
return $send(self, 'getter_common', [assoc.$attribute(), reload], (TMP_3 = function(_has_key, attr){var self = TMP_3.$$s || this, $writer = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (_has_key == null) _has_key = nil;if (attr == null) attr = nil; | |
if ($truthy(self['$new?']())) { | |
$writer = [attr, $$($nesting, 'Collection').$new(assoc.$klass(), self.ar_instance, assoc)]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return self.$sync_attribute(attr, $send($$($nesting, 'Collection'), 'new', [assoc.$klass(), self.ar_instance, assoc].concat(Opal.to_a(self.$vector())).concat([attr]))) | |
}}, TMP_3.$$s = self, TMP_3.$$arity = 2, TMP_3)) | |
}, TMP_Getters_get_has_many_4.$$arity = -2); | |
Opal.def(self, '$get_attr_value', TMP_Getters_get_attr_value_6 = function $$get_attr_value(attr, reload) { | |
var TMP_5, self = this; | |
if (reload == null) { | |
reload = nil; | |
} | |
return $send(self, 'non_relationship_getter_common', [attr, reload], (TMP_5 = function(){var self = TMP_5.$$s || this; | |
return self.$sync_attribute(attr, self.$convert(attr, self.$model().$columns_hash()['$[]'](attr)['$[]']("default")))}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5)) | |
}, TMP_Getters_get_attr_value_6.$$arity = -2); | |
Opal.def(self, '$get_primary_key_value', TMP_Getters_get_primary_key_value_7 = function $$get_primary_key_value() { | |
var self = this; | |
return self.$non_relationship_getter_common(self.$model().$primary_key(), false) | |
}, TMP_Getters_get_primary_key_value_7.$$arity = 0); | |
Opal.def(self, '$get_server_method', TMP_Getters_get_server_method_9 = function $$get_server_method(attr, reload) { | |
var TMP_8, self = this; | |
if (reload == null) { | |
reload = nil; | |
} | |
return $send(self, 'non_relationship_getter_common', [attr, reload], (TMP_8 = function(has_key){var self = TMP_8.$$s || this; | |
if (has_key == null) has_key = nil; | |
return self.$sync_ignore_dummy(attr, $send($$($nesting, 'Base'), 'load_from_db', [self].concat(Opal.to_a((function() {if ($truthy(self.$vector())) { | |
return self.$vector() | |
} else { | |
return [nil] | |
}; return nil; })())).concat([attr])), has_key)}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8)) | |
}, TMP_Getters_get_server_method_9.$$arity = -2); | |
Opal.def(self, '$get_ar_aggregate', TMP_Getters_get_ar_aggregate_11 = function $$get_ar_aggregate(aggr, reload) { | |
var TMP_10, self = this; | |
if (reload == null) { | |
reload = nil; | |
} | |
return $send(self, 'getter_common', [aggr.$attribute(), reload], (TMP_10 = function(has_key, attr){var self = TMP_10.$$s || this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (has_key == null) has_key = nil;if (attr == null) attr = nil; | |
if ($truthy(self['$new?']())) { | |
$writer = [attr, aggr.$klass().$new().$backing_record().$link_aggregate(attr, self)]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return self.$sync_ignore_dummy(attr, $send(self, 'new_from_vector', [aggr.$klass(), self].concat(Opal.to_a(self.$vector())).concat([attr])), has_key) | |
}}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10)) | |
}, TMP_Getters_get_ar_aggregate_11.$$arity = -2); | |
Opal.def(self, '$get_non_ar_aggregate', TMP_Getters_get_non_ar_aggregate_12 = function $$get_non_ar_aggregate(attr, reload) { | |
var self = this; | |
if (reload == null) { | |
reload = nil; | |
} | |
return self.$non_relationship_getter_common(attr, reload) | |
}, TMP_Getters_get_non_ar_aggregate_12.$$arity = -2); | |
self.$private(); | |
Opal.def(self, '$virtual_fetch_on_server_warning', TMP_Getters_virtual_fetch_on_server_warning_13 = function $$virtual_fetch_on_server_warning(attr) { | |
var self = this; | |
return self.$log("" + ("" + "Warning fetching virtual attributes (" + (self.$model().$name()) + "." + (attr) + ") during prerendering ") + "on a changed or new model is not implemented.", "warning") | |
}, TMP_Getters_virtual_fetch_on_server_warning_13.$$arity = 1); | |
Opal.def(self, '$sync_ignore_dummy', TMP_Getters_sync_ignore_dummy_14 = function $$sync_ignore_dummy(attr, value, has_key) { | |
var $a, self = this; | |
if (self.attributes == null) self.attributes = nil; | |
if ($truthy(($truthy($a = has_key) ? value['$is_a?']($$$($$($nesting, 'Base'), 'DummyValue')) : $a))) { | |
value = self.attributes['$[]'](attr)}; | |
return self.$sync_attribute(attr, value); | |
}, TMP_Getters_sync_ignore_dummy_14.$$arity = 3); | |
Opal.def(self, '$non_relationship_getter_common', TMP_Getters_non_relationship_getter_common_15 = function $$non_relationship_getter_common(attr, reload) { | |
var TMP_16, self = this, $iter = TMP_Getters_non_relationship_getter_common_15.$$p, block = $iter || nil; | |
if ($iter) TMP_Getters_non_relationship_getter_common_15.$$p = null; | |
return $send(self, 'getter_common', [attr, reload], (TMP_16 = function(has_key){var self = TMP_16.$$s || this; | |
if (self.model == null) self.model = nil; | |
if (has_key == null) has_key = nil; | |
if ($truthy(self['$new?']())) { | |
if ($truthy(block)) { | |
return Opal.yield1(block, has_key); | |
} else { | |
return nil | |
} | |
} else if ($truthy(self['$on_opal_client?']())) { | |
return self.$sync_ignore_dummy(attr, $send($$($nesting, 'Base'), 'load_from_db', [self].concat(Opal.to_a((function() {if ($truthy(self.$vector())) { | |
return self.$vector() | |
} else { | |
return [nil] | |
}; return nil; })())).concat([attr])), has_key) | |
} else if ($truthy(self.$id()['$present?']())) { | |
return self.$sync_attribute(attr, $$($nesting, 'Base').$fetch_from_db([self.model, ["find", self.$id()], attr])) | |
} else { | |
return self.$sync_attribute(attr, $$($nesting, 'Base').$fetch_from_db([].concat(Opal.to_a(self.$vector())).concat([attr]))) | |
}}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16)) | |
}, TMP_Getters_non_relationship_getter_common_15.$$arity = 2); | |
Opal.def(self, '$getter_common', TMP_Getters_getter_common_17 = function $$getter_common(attribute, reload) { | |
var $a, TMP_18, self = this, $iter = TMP_Getters_getter_common_17.$$p, $yield = $iter || nil, current_value = nil; | |
if (self.destroyed == null) self.destroyed = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if ($iter) TMP_Getters_getter_common_17.$$p = null; | |
if ($truthy(self['$data_loading?']())) { | |
} else { | |
self.virgin = false | |
}; | |
if ($truthy(self.destroyed)) { | |
return nil}; | |
return $send((function() {if ($truthy(self.attributes['$key?'](attribute))) { | |
current_value = self.attributes['$[]'](attribute); | |
if ($truthy(current_value['$is_a?']($$$($$($nesting, 'Base'), 'DummyValue')))) { | |
current_value.$notify()}; | |
if ($truthy(reload)) { | |
if ($truthy(($truthy($a = self['$on_opal_server?']()) ? self['$changed?']() : $a))) { | |
self.$virtual_fetch_on_server_warning(attribute)}; | |
return Opal.yieldX($yield, [true, attribute]);; | |
} else { | |
return current_value | |
}; | |
} else { | |
if ($truthy(($truthy($a = self['$on_opal_server?']()) ? self['$changed?']() : $a))) { | |
self.$virtual_fetch_on_server_warning(attribute)}; | |
return Opal.yieldX($yield, [false, attribute]);; | |
}; return nil; })(), 'tap', [], (TMP_18 = function(value){var self = TMP_18.$$s || this; | |
if (value == null) value = nil; | |
if ($truthy(self['$data_loading?']())) { | |
return nil | |
} else { | |
return $$$($$($nesting, 'React'), 'State').$get_state(self, attribute) | |
}}, TMP_18.$$s = self, TMP_18.$$arity = 1, TMP_18)); | |
}, TMP_Getters_getter_common_17.$$arity = 2); | |
Opal.def(self, '$find_association', TMP_Getters_find_association_19 = function $$find_association(association, id) { | |
var $a, self = this, inverse_of = nil, instance = nil, instance_backing_record_attributes = nil, inverse_association = nil, $writer = nil; | |
if (self.model == null) self.model = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
inverse_of = association.$inverse_of(); | |
instance = (function() {if ($truthy(id)) { | |
return self.$find(association.$klass(), $hash(association.$klass().$primary_key(), id)) | |
} else { | |
return $send(self, 'new_from_vector', [association.$klass(), nil].concat(Opal.to_a(self.$vector())).concat([association.$attribute()])) | |
}; return nil; })(); | |
instance_backing_record_attributes = instance.$attributes(); | |
inverse_association = association.$klass().$reflect_on_association(inverse_of); | |
if ($truthy(($truthy($a = association['$through_association?']()) ? $a : instance_backing_record_attributes['$key?'](inverse_of)))) { | |
} else if ($truthy(inverse_association['$collection?']())) { | |
if ($truthy(instance_backing_record_attributes['$[]'](inverse_of))) { | |
} else { | |
$writer = [inverse_of, (function() {if ($truthy(($truthy($a = id) ? id['$!=']("") : $a))) { | |
return $$($nesting, 'Collection').$new(self.model, instance, inverse_association, association.$klass(), ["find", id], inverse_of) | |
} else { | |
return $send($$($nesting, 'Collection'), 'new', [self.model, instance, inverse_association].concat(Opal.to_a(self.$vector())).concat([association.$attribute(), inverse_of])) | |
}; return nil; })()]; | |
$send(instance_backing_record_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
}; | |
instance_backing_record_attributes['$[]'](inverse_of).$replace([self.ar_instance]); | |
} else { | |
$writer = [inverse_of, self.ar_instance]; | |
$send(instance_backing_record_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
}; | |
return instance; | |
}, TMP_Getters_find_association_19.$$arity = 2); | |
Opal.def(self, '$link_aggregate', TMP_Getters_link_aggregate_20 = function $$link_aggregate(attr, parent) { | |
var self = this, $writer = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
$writer = [parent]; | |
$send(self, 'aggregate_owner=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$writer = [attr]; | |
$send(self, 'aggregate_attribute=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
return self.ar_instance; | |
}, TMP_Getters_link_aggregate_20.$$arity = 2); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb": | |
/*!***************************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb ***! | |
\***************************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var json_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! json.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/json.rb"); | |
if (typeof global.Opal.modules["json"] === 'undefined') { | |
if (typeof json_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(json_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/isomorphic_base"] = function(Opal) { | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $range = Opal.range, $hash2 = Opal.hash2, $hash = Opal.hash; | |
Opal.add_stubs(['$require', '$include', '$before_first_mount', '$!=', '$get_public_columns_hash', '$define_attribute_methods', '$new', '$initialize_lookup_tables', '$on_opal_client?', '$log', '$each', '$from_object', '$load_from_json', '$include?', '$<<', '$deprecation_warning', '$class', '$model', '$instance_variable_get', '$isomorphic_method', '$==', '$send_to_server', '$name', '$shift', '$when_on_server', '$[]', '$attr_reader', '$keys', '$public_columns_hash', '$const_get', '$when_on_client', '$parse', '$raise', '$nil?', '$+', '$model_name', '$object_id', '$data_loading?', '$schedule_fetch', '$get_columns_info_for_vector', '$last', '$is_a?', '$first', '$columns_hash', '$server_methods', '$set_state', '$now', '$after', '$>', '$count', '$uniq', '$gather_records', '$to_n', '$fail', '$then', '$run', '$run_blocks_to_load', '$loaded_at', '$empty?', '$quiet!', '$inheritance_column', '$flatten', '$collect', '$lambda', '$[]=', '$-', '$<', '$loading?', '$id', '$to_s', '$primary_key', '$vector', '$new?', '$changed?', '$attributes', '$reflect_on_association', '$collection?', '$collection', '$unsaved_children', '$inverse_of', '$call', '$backing_record', '$reflect_on_aggregation', '$klass', '$serialize', '$synced_attributes', '$sync!', '$load', '$pending_fetches', '$loads_pending!', '$send_save_to_server', '$to_proc', '$resolve', '$saving!', '$ar_instance', '$to_self', '$sync_unscoped_collection!', '$errors!', '$saved!', '$message', '$!', '$destroy_associations']); | |
self.$require("json"); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_1, TMP_Base_deprecation_warning_3, TMP_Base_deprecation_warning_4, TMP_Base_records_5, TMP_Base_6, TMP_Base_8, TMP_Base_define_attribute_methods_11, TMP_Base_12, TMP_Base_load_from_db_15, TMP_Base_get_columns_info_for_vector_16, TMP_Base_schedule_fetch_21, TMP_Base_get_type_hash_22, TMP_Base_gather_records_27, TMP_Base_save_or_validate_28, TMP_Base_send_save_to_server_31, TMP_Base_destroy_40; | |
def.destroyed = nil; | |
self.$include($$$($$($nesting, 'React'), 'IsomorphicHelpers')); | |
$send(self, 'before_first_mount', [], (TMP_Base_1 = function(context){var self = TMP_Base_1.$$s || this, TMP_2; | |
if (context == null) context = nil; | |
if ($truthy($$($nesting, 'RUBY_ENGINE')['$!=']("opal"))) { | |
return nil | |
} else { | |
self.public_columns_hash = self.$get_public_columns_hash(); | |
self.$define_attribute_methods(); | |
self.outer_scopes = $$($nesting, 'Set').$new(); | |
self.fetch_scheduled = nil; | |
self.$initialize_lookup_tables(); | |
if ($truthy(self['$on_opal_client?']())) { | |
self.pending_fetches = []; | |
self.pending_records = []; | |
if ($truthy(typeof window.ReactiveRecordInitialData === 'undefined')) { | |
return nil | |
} else { | |
self.$log(["Reactive record prerendered data being loaded: %o", window.ReactiveRecordInitialData]); | |
return $send($$($nesting, 'JSON').$from_object(window.ReactiveRecordInitialData), 'each', [], (TMP_2 = function(hash){var self = TMP_2.$$s || this; | |
if (hash == null) hash = nil; | |
return self.$load_from_json(hash)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2)); | |
}; | |
} else { | |
return nil | |
}; | |
}}, TMP_Base_1.$$s = self, TMP_Base_1.$$arity = 1, TMP_Base_1)); | |
Opal.defs(self, '$deprecation_warning', TMP_Base_deprecation_warning_3 = function $$deprecation_warning(model, message) { | |
var $a, self = this; | |
if (self.deprecation_messages == null) self.deprecation_messages = nil; | |
self.deprecation_messages = ($truthy($a = self.deprecation_messages) ? $a : []); | |
message = "" + "Warning: Deprecated feature used in " + (model) + ". " + (message); | |
if ($truthy(self.deprecation_messages['$include?'](message))) { | |
return nil | |
} else { | |
self.deprecation_messages['$<<'](message); | |
return self.$log(message, "warning"); | |
}; | |
}, TMP_Base_deprecation_warning_3.$$arity = 2); | |
Opal.def(self, '$deprecation_warning', TMP_Base_deprecation_warning_4 = function $$deprecation_warning(message) { | |
var self = this; | |
return self.$class().$deprecation_warning(self.$model(), message) | |
}, TMP_Base_deprecation_warning_4.$$arity = 1); | |
Opal.def(self, '$records', TMP_Base_records_5 = function $$records() { | |
var self = this; | |
return self.$class().$instance_variable_get("@records") | |
}, TMP_Base_records_5.$$arity = 0); | |
$send(self, 'isomorphic_method', ["fetch_from_db"], (TMP_Base_6 = function(f, vector){var self = TMP_Base_6.$$s || this, TMP_7; | |
if (f == null) f = nil;if (vector == null) vector = nil; | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
f.$send_to_server([vector.$shift().$name()].concat(Opal.to_a(vector))) | |
} else { | |
nil | |
}; | |
return $send(f, 'when_on_server', [], (TMP_7 = function(){var self = TMP_7.$$s || this; | |
if (self.server_data_cache == null) self.server_data_cache = nil; | |
return $send(self.server_data_cache, '[]', Opal.to_a(vector))}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7));}, TMP_Base_6.$$s = self, TMP_Base_6.$$arity = 2, TMP_Base_6)); | |
$send(self, 'isomorphic_method', ["find_in_db"], (TMP_Base_8 = function(f, klass, attrs){var self = TMP_Base_8.$$s || this, TMP_9; | |
if (f == null) f = nil;if (klass == null) klass = nil;if (attrs == null) attrs = nil; | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
f.$send_to_server(klass.$name(), attrs) | |
} else { | |
nil | |
}; | |
return $send(f, 'when_on_server', [], (TMP_9 = function(){var self = TMP_9.$$s || this; | |
if (self.server_data_cache == null) self.server_data_cache = nil; | |
return self.server_data_cache['$[]'](klass, ["find_by", attrs], "id")}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9));}, TMP_Base_8.$$s = self, TMP_Base_8.$$arity = 3, TMP_Base_8)); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return self.$attr_reader("public_columns_hash") | |
})(Opal.get_singleton_class(self), $nesting); | |
Opal.defs(self, '$define_attribute_methods', TMP_Base_define_attribute_methods_11 = function $$define_attribute_methods() { | |
var TMP_10, self = this; | |
return $send(self.$public_columns_hash().$keys(), 'each', [], (TMP_10 = function(model){var self = TMP_10.$$s || this; | |
if (model == null) model = nil; | |
try { | |
return $$($nesting, 'Object').$const_get(model).$define_attribute_methods() | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return nil | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10)) | |
}, TMP_Base_define_attribute_methods_11.$$arity = 0); | |
$send(self, 'isomorphic_method', ["get_public_columns_hash"], (TMP_Base_12 = function(f){var self = TMP_Base_12.$$s || this, TMP_13, TMP_14; | |
if (f == null) f = nil; | |
$send(f, 'when_on_client', [], (TMP_13 = function(){var self = TMP_13.$$s || this; | |
return $$($nesting, 'JSON').$parse(JSON.stringify(window.ReactiveRecordPublicColumnsHash))}, TMP_13.$$s = self, TMP_13.$$arity = 0, TMP_13)); | |
f.$send_to_server(); | |
return $send(f, 'when_on_server', [], (TMP_14 = function(){var self = TMP_14.$$s || this; | |
return $$$($$($nesting, 'ActiveRecord'), 'Base').$public_columns_hash()}, TMP_14.$$s = self, TMP_14.$$arity = 0, TMP_14));}, TMP_Base_12.$$s = self, TMP_Base_12.$$arity = 1, TMP_Base_12)); | |
if ($truthy($$($nesting, 'RUBY_ENGINE')['$!=']("opal"))) { | |
nil}; | |
Opal.defs(self, '$load_from_db', TMP_Base_load_from_db_15 = function $$load_from_db(record, $a_rest) { | |
var $b, self = this, vector; | |
if (self.pending_fetches == null) self.pending_fetches = nil; | |
if (self.pending_records == null) self.pending_records = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 1; | |
if ($rest_len < 0) { $rest_len = 0; } | |
vector = new Array($rest_len); | |
for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { | |
vector[$arg_idx - 1] = arguments[$arg_idx]; | |
} | |
if ($truthy(self['$on_opal_client?']())) { | |
} else { | |
return nil | |
}; | |
if (vector['$[]'](1)['$=='](["find_by_id", nil])) { | |
self.$raise("attempt to do a find_by_id of nil. This will return all records, and is not allowed")}; | |
if ($truthy(vector['$[]'](0)['$nil?']())) { | |
vector = $rb_plus([record.$model().$model_name(), ["new", record.$object_id()]], vector['$[]']($range(1, -1, false)))}; | |
if ($truthy(self['$data_loading?']())) { | |
} else { | |
self.pending_fetches['$<<'](vector); | |
if ($truthy(record)) { | |
self.pending_records['$<<'](record)}; | |
self.$schedule_fetch(); | |
}; | |
return $$($nesting, 'DummyValue').$new(($truthy($b = record) ? record.$get_columns_info_for_vector(vector) : $b)); | |
}, TMP_Base_load_from_db_15.$$arity = -2); | |
Opal.def(self, '$get_columns_info_for_vector', TMP_Base_get_columns_info_for_vector_16 = function $$get_columns_info_for_vector(vector) { | |
var $a, self = this, method_name = nil; | |
method_name = vector.$last(); | |
if ($truthy(method_name['$is_a?']($$($nesting, 'Array')))) { | |
method_name = method_name.$first()}; | |
return ($truthy($a = self.$model().$columns_hash()['$[]'](method_name)) ? $a : self.$model().$server_methods()['$[]'](method_name)); | |
}, TMP_Base_get_columns_info_for_vector_16.$$arity = 1); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
self.$attr_reader("pending_fetches"); | |
return self.$attr_reader("current_fetch_id"); | |
})(Opal.get_singleton_class(self), $nesting); | |
Opal.defs(self, '$schedule_fetch', TMP_Base_schedule_fetch_21 = function $$schedule_fetch() { | |
var TMP_17, self = this; | |
if (self.fetch_scheduled == null) self.fetch_scheduled = nil; | |
$$$($$($nesting, 'React'), 'State').$set_state($$($nesting, 'WhileLoading'), "quiet", false); | |
if ($truthy(self.fetch_scheduled)) { | |
return nil}; | |
self.current_fetch_id = $$($nesting, 'Time').$now(); | |
return (self.fetch_scheduled = $send(self, 'after', [0], (TMP_17 = function(){var self = TMP_17.$$s || this, $a, $b, TMP_18, TMP_20, saved_current_fetch_id = nil, saved_pending_fetches = nil, models = nil, associations = nil, start_time = nil; | |
if (self.pending_fetches == null) self.pending_fetches = nil; | |
if (self.current_fetch_id == null) self.current_fetch_id = nil; | |
if (self.pending_records == null) self.pending_records = nil; | |
if ($truthy($rb_gt(self.pending_fetches.$count(), 0))) { | |
} else { | |
return nil; | |
}; | |
saved_current_fetch_id = self.current_fetch_id; | |
saved_pending_fetches = self.pending_fetches.$uniq(); | |
$b = self.$gather_records(self.pending_records, false, nil), $a = Opal.to_ary($b), (models = ($a[0] == null ? nil : $a[0])), (associations = ($a[1] == null ? nil : $a[1])), $b; | |
self.$log(["Server Fetching: %o", saved_pending_fetches.$to_n()]); | |
start_time = Date.now(); | |
$send($send($$$($$($nesting, 'Operations'), 'Fetch').$run($hash2(["models", "associations", "pending_fetches"], {"models": models, "associations": associations, "pending_fetches": saved_pending_fetches})), 'then', [], (TMP_18 = function(response){var self = TMP_18.$$s || this, TMP_19, fetch_time = nil, timer = nil, e = nil; | |
if (self.pending_fetches == null) self.pending_fetches = nil; | |
if (response == null) response = nil; | |
return (function() { try { | |
fetch_time = Date.now(); | |
self.$log("" + " Fetched in: " + ((fetch_time - start_time)/ 1000) + "s"); | |
timer = $send(self, 'after', [0], (TMP_19 = function(){var self = TMP_19.$$s || this; | |
self.$log("" + " Processed in: " + ((Date.now() - fetch_time) / 1000) + "s"); | |
return self.$log([" Returned: %o", response.$to_n()]);}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19)); | |
try { | |
$$$($$($nesting, 'ReactiveRecord'), 'Base').$load_from_json(response) | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
clearTimeout(timer); | |
self.$log("" + "Unexpected exception raised while loading json from server: " + (e), "error"); | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
};; | |
return $$($nesting, 'ReactiveRecord').$run_blocks_to_load(saved_current_fetch_id); | |
} finally { | |
($$$($$($nesting, 'ReactiveRecord'), 'WhileLoading').$loaded_at(saved_current_fetch_id), (function() {if ($truthy(self.pending_fetches['$empty?']())) { | |
return $$$($$($nesting, 'ReactiveRecord'), 'WhileLoading')['$quiet!']() | |
} else { | |
return nil | |
}; return nil; })()) | |
}; })();}, TMP_18.$$s = self, TMP_18.$$arity = 1, TMP_18)), 'fail', [], (TMP_20 = function(response){var self = TMP_20.$$s || this; | |
if (self.pending_fetches == null) self.pending_fetches = nil; | |
if (response == null) response = nil; | |
self.$log("Fetch failed", "error"); | |
return (function() { try { | |
return $$($nesting, 'ReactiveRecord').$run_blocks_to_load(saved_current_fetch_id, response) | |
} finally { | |
(function() {if ($truthy(self.pending_fetches['$empty?']())) { | |
return $$$($$($nesting, 'ReactiveRecord'), 'WhileLoading')['$quiet!']() | |
} else { | |
return nil | |
}; return nil; })() | |
}; })();;}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20)); | |
self.pending_fetches = []; | |
self.pending_records = []; | |
return (self.fetch_scheduled = nil);}, TMP_17.$$s = self, TMP_17.$$arity = 0, TMP_17))); | |
}, TMP_Base_schedule_fetch_21.$$arity = 0); | |
Opal.defs(self, '$get_type_hash', TMP_Base_get_type_hash_22 = function $$get_type_hash(record) { | |
var self = this; | |
return $hash(record.$class().$inheritance_column(), record['$[]'](record.$class().$inheritance_column())) | |
}, TMP_Base_get_type_hash_22.$$arity = 1); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
Opal.defs(self, '$gather_records', TMP_Base_gather_records_27 = function $$gather_records(records_to_process, force, record_being_saved) { | |
var TMP_23, TMP_24, $a, $b, $c, TMP_25, self = this, models = nil, associations = nil, backing_records = nil, add_new_association = nil, record_index = nil, record = nil, output_attributes = nil, vector = nil; | |
models = []; | |
associations = []; | |
records_to_process = records_to_process.$uniq(); | |
backing_records = $send($$($nesting, 'Hash'), '[]', Opal.to_a($send(records_to_process, 'collect', [], (TMP_23 = function(record){var self = TMP_23.$$s || this; | |
if (record == null) record = nil; | |
return [record.$object_id(), record]}, TMP_23.$$s = self, TMP_23.$$arity = 1, TMP_23)).$flatten(1))); | |
add_new_association = $send(self, 'lambda', [], (TMP_24 = function(record, attribute, assoc_record){var self = TMP_24.$$s || this, $writer = nil; | |
if (record == null) record = nil;if (attribute == null) attribute = nil;if (assoc_record == null) assoc_record = nil; | |
if ($truthy(backing_records['$[]'](assoc_record.$object_id()))) { | |
} else { | |
records_to_process['$<<'](assoc_record); | |
$writer = [assoc_record.$object_id(), assoc_record]; | |
$send(backing_records, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
}; | |
return associations['$<<']($hash2(["parent_id", "attribute", "child_id"], {"parent_id": record.$object_id(), "attribute": attribute, "child_id": assoc_record.$object_id()}));}, TMP_24.$$s = self, TMP_24.$$arity = 3, TMP_24)); | |
record_index = 0; | |
while ($truthy($rb_lt(record_index, records_to_process.$count()))) { | |
record = records_to_process['$[]'](record_index); | |
if ($truthy(($truthy($b = record.$id()['$loading?']()) ? record_being_saved : $b))) { | |
self.$raise("" + "Attempt to save a model while it or an associated model is still loading: model being saved: " + (record_being_saved.$model()) + ":" + (record_being_saved.$id()) + ((function() {if ($truthy(record['$!='](record_being_saved))) { | |
return $rb_plus(", associated model: ", record.$model().$to_s()) | |
} else { | |
return nil | |
}; return nil; })()))}; | |
output_attributes = $hash(record.$model().$primary_key(), (function() {if ($truthy(record.$id()['$loading?']())) { | |
return nil | |
} else { | |
return record.$id() | |
}; return nil; })()); | |
vector = ($truthy($b = record.$vector()) ? $b : [record.$model().$model_name(), ["new", record.$object_id()]]); | |
models['$<<']($hash2(["id", "model", "attributes", "vector"], {"id": record.$object_id(), "model": record.$model().$model_name(), "attributes": output_attributes, "vector": vector})); | |
if ($truthy(($truthy($b = ($truthy($c = record['$new?']()) ? $c : record['$changed?']())) ? $b : (($c = record['$=='](record_being_saved)) ? force : record['$=='](record_being_saved))))) { | |
$send(record.$attributes(), 'each', [], (TMP_25 = function(attribute, value){var self = TMP_25.$$s || this, TMP_26, $d, $e, association = nil, $writer = nil, aggregation = nil, new_value = nil; | |
if (attribute == null) attribute = nil;if (value == null) value = nil; | |
if ($truthy((association = record.$model().$reflect_on_association(attribute)))) { | |
if ($truthy(association['$collection?']())) { | |
return $send([].concat(Opal.to_a(value.$collection())).concat(Opal.to_a(value.$unsaved_children())), 'each', [], (TMP_26 = function(assoc){var self = TMP_26.$$s || this, $d; | |
if (assoc == null) assoc = nil; | |
if ($truthy(($truthy($d = assoc['$changed?'](association.$inverse_of())) ? $d : assoc['$new?']()))) { | |
return add_new_association.$call(record, attribute, assoc.$backing_record()) | |
} else { | |
return nil | |
}}, TMP_26.$$s = self, TMP_26.$$arity = 1, TMP_26)) | |
} else if ($truthy(($truthy($d = ($truthy($e = record['$new?']()) ? $e : record['$changed?'](attribute))) ? $d : (($e = record['$=='](record_being_saved)) ? force : record['$=='](record_being_saved))))) { | |
if ($truthy(value['$nil?']())) { | |
$writer = [attribute, nil]; | |
$send(output_attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return add_new_association.$call(record, attribute, value.$backing_record()) | |
} | |
} else { | |
return nil | |
} | |
} else if ($truthy(($truthy($d = (aggregation = record.$model().$reflect_on_aggregation(attribute))) ? $rb_lt(aggregation.$klass(), $$$($$($nesting, 'ActiveRecord'), 'Base')) : $d))) { | |
if ($truthy(value['$nil?']())) { | |
return nil | |
} else { | |
return add_new_association.$call(record, attribute, value.$backing_record()) | |
} | |
} else if ($truthy(aggregation)) { | |
new_value = aggregation.$serialize(value); | |
if ($truthy(($truthy($d = record['$changed?'](attribute)) ? $d : new_value['$!='](aggregation.$serialize(record.$synced_attributes()['$[]'](attribute)))))) { | |
$writer = [attribute, new_value]; | |
$send(output_attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return nil | |
}; | |
} else if ($truthy(($truthy($d = record['$new?']()) ? $d : record['$changed?'](attribute)))) { | |
$writer = [attribute, value]; | |
$send(output_attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return nil | |
}}, TMP_25.$$s = self, TMP_25.$$arity = 2, TMP_25))}; | |
record_index = $rb_plus(record_index, 1); | |
}; | |
return [models, associations, backing_records]; | |
}, TMP_Base_gather_records_27.$$arity = 3); | |
Opal.def(self, '$save_or_validate', TMP_Base_save_or_validate_28 = function $$save_or_validate(save, validate, force) { | |
var $a, TMP_29, TMP_30, self = this, $iter = TMP_Base_save_or_validate_28.$$p, block = $iter || nil, promise = nil; | |
if ($iter) TMP_Base_save_or_validate_28.$$p = null; | |
if ($truthy(self['$data_loading?']())) { | |
return self['$sync!']() | |
} else if ($truthy(($truthy($a = force) ? $a : self['$changed?']()))) { | |
return $send($send($$($nesting, 'HyperMesh'), 'load', [], (TMP_29 = function(){var self = TMP_29.$$s || this; | |
if ($truthy(self.$class().$pending_fetches()['$empty?']())) { | |
return nil | |
} else { | |
return $$($nesting, 'ReactiveRecord')['$loads_pending!']() | |
}}, TMP_29.$$s = self, TMP_29.$$arity = 0, TMP_29)), 'then', [], (TMP_30 = function(){var self = TMP_30.$$s || this; | |
return $send(self, 'send_save_to_server', [save, validate, force], block.$to_proc())}, TMP_30.$$s = self, TMP_30.$$arity = 0, TMP_30)) | |
} else { | |
promise = $$($nesting, 'Promise').$new(); | |
if ($truthy(block)) { | |
Opal.yieldX(block, [true, nil, []])}; | |
promise.$resolve($hash2(["success"], {"success": true})); | |
return promise; | |
} | |
}, TMP_Base_save_or_validate_28.$$arity = 3); | |
Opal.def(self, '$send_save_to_server', TMP_Base_send_save_to_server_31 = function $$send_save_to_server(save, validate, force) { | |
var $a, $b, TMP_32, TMP_33, TMP_39, self = this, $iter = TMP_Base_send_save_to_server_31.$$p, block = $iter || nil, models = nil, associations = nil, backing_records = nil, promise = nil, e = nil; | |
if ($iter) TMP_Base_send_save_to_server_31.$$p = null; | |
try { | |
$b = self.$class().$gather_records([self], force, self), $a = Opal.to_ary($b), (models = ($a[0] == null ? nil : $a[0])), (associations = ($a[1] == null ? nil : $a[1])), (backing_records = ($a[2] == null ? nil : $a[2])), $b; | |
try { | |
if ($truthy(save)) { | |
$send(backing_records, 'each', [], (TMP_32 = function(id, record){var self = TMP_32.$$s || this; | |
if (id == null) id = nil;if (record == null) record = nil; | |
return record['$saving!']()}, TMP_32.$$s = self, TMP_32.$$arity = 2, TMP_32))}; | |
promise = $$($nesting, 'Promise').$new(); | |
$send($$$($$($nesting, 'Operations'), 'Save').$run($hash2(["models", "associations", "save", "validate"], {"models": models, "associations": associations, "save": save, "validate": validate})), 'then', [], (TMP_33 = function(response){var self = TMP_33.$$s || this, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, $writer = nil, e = nil; | |
if (response == null) response = nil; | |
return (function() { try { | |
try { | |
$writer = ["models", $send(response['$[]']("saved_models"), 'collect', [], (TMP_34 = function(item){var self = TMP_34.$$s || this; | |
if (item == null) item = nil; | |
return backing_records['$[]'](item['$[]'](0)).$ar_instance()}, TMP_34.$$s = self, TMP_34.$$arity = 1, TMP_34))]; | |
$send(response, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
if ($truthy(save)) { | |
if ($truthy(response['$[]']("success"))) { | |
$send(response['$[]']("saved_models"), 'each', [], (TMP_35 = function(item){var self = TMP_35.$$s || this; | |
if (item == null) item = nil; | |
return $$($nesting, 'Broadcast').$to_self(backing_records['$[]'](item['$[]'](0)).$ar_instance(), item['$[]'](2))}, TMP_35.$$s = self, TMP_35.$$arity = 1, TMP_35)) | |
} else { | |
self.$log("" + "Reactive Record Save Failed: " + (response['$[]']("message")), "error"); | |
$send(response['$[]']("saved_models"), 'each', [], (TMP_36 = function(item){var self = TMP_36.$$s || this; | |
if (item == null) item = nil; | |
if ($truthy(item['$[]'](3))) { | |
return self.$log("" + " Model: " + (item['$[]'](1)) + "[" + (item['$[]'](0)) + "] Attributes: " + (item['$[]'](2)) + " Errors: " + (item['$[]'](3)), "error") | |
} else { | |
return nil | |
}}, TMP_36.$$s = self, TMP_36.$$arity = 1, TMP_36)); | |
}}; | |
$send(response['$[]']("saved_models"), 'each', [], (TMP_37 = function(item){var self = TMP_37.$$s || this; | |
if (item == null) item = nil; | |
if ($truthy(save)) { | |
backing_records['$[]'](item['$[]'](0))['$sync_unscoped_collection!']()}; | |
return backing_records['$[]'](item['$[]'](0))['$errors!'](item['$[]'](3));}, TMP_37.$$s = self, TMP_37.$$arity = 1, TMP_37)); | |
if ($truthy(block)) { | |
Opal.yieldX(block, [response['$[]']("success"), response['$[]']("message"), response['$[]']("models")])}; | |
return promise.$resolve(response); | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
return self.$log("" + "Exception raised while saving - " + (e), "error") | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
} finally { | |
(function() {if ($truthy(save)) { | |
return $send(backing_records, 'each', [], (TMP_38 = function(_id, record){var self = TMP_38.$$s || this; | |
if (_id == null) _id = nil;if (record == null) record = nil; | |
try { | |
return record['$saved!']() | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return nil | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}}, TMP_38.$$s = self, TMP_38.$$arity = 2, TMP_38)) | |
} else { | |
return nil | |
}; return nil; })() | |
}; })();}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33)); | |
return promise; | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
if ($truthy(save)) { | |
return $send(backing_records, 'each', [], (TMP_39 = function(_id, record){var self = TMP_39.$$s || this; | |
if (_id == null) _id = nil;if (record == null) record = nil; | |
try { | |
return record['$saved!'](true) | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return nil | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}}, TMP_39.$$s = self, TMP_39.$$arity = 2, TMP_39)) | |
} else { | |
return nil | |
} | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
};; | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
self.$log("" + "Exception raised while saving - " + (e), "error"); | |
if ($truthy(block)) { | |
Opal.yieldX(block, [false, e.$message(), []])}; | |
promise.$resolve($hash2(["success", "message", "models"], {"success": false, "message": e.$message(), "models": []})); | |
return promise; | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_Base_send_save_to_server_31.$$arity = 3); | |
} else { | |
nil | |
}; | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
return (Opal.def(self, '$destroy', TMP_Base_destroy_40 = function $$destroy() { | |
var $a, $b, TMP_41, self = this, $iter = TMP_Base_destroy_40.$$p, block = $iter || nil, promise = nil; | |
if ($iter) TMP_Base_destroy_40.$$p = null; | |
if ($truthy(self.destroyed)) { | |
return nil}; | |
promise = $$($nesting, 'Promise').$new(); | |
if ($truthy(($truthy($a = self['$data_loading?']()['$!']()) ? ($truthy($b = self.$id()) ? $b : self.$vector()) : $a))) { | |
$send($$$($$($nesting, 'Operations'), 'Destroy').$run($hash2(["model", "id", "vector"], {"model": self.$ar_instance().$model_name(), "id": self.$id(), "vector": self.$vector()})), 'then', [], (TMP_41 = function(response){var self = TMP_41.$$s || this; | |
if (response == null) response = nil; | |
$$($nesting, 'Broadcast').$to_self(self.$ar_instance()); | |
if ($truthy(block)) { | |
Opal.yieldX(block, [response['$[]']("success"), response['$[]']("message")])}; | |
return promise.$resolve(response);}, TMP_41.$$s = self, TMP_41.$$arity = 1, TMP_41)) | |
} else { | |
self.$destroy_associations(); | |
if ($truthy(block)) { | |
Opal.yieldX(block, [true, nil])}; | |
promise.$resolve($hash2(["success"], {"success": true})); | |
}; | |
self.destroyed = true; | |
return promise; | |
}, TMP_Base_destroy_40.$$arity = 0), nil) && 'destroy' | |
} else { | |
return nil | |
}; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/lookup_tables.rb": | |
/*!*************************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/lookup_tables.rb ***! | |
\*************************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/lookup_tables"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $send = Opal.send, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$new', '$[]=', '$-', '$[]', '$base_class', '$<<', '$ar_instance', '$object_id', '$model', '$id', '$vector=', '$vector']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $LookupTables() {}; | |
var self = $LookupTables = $module($base, 'LookupTables', $LookupTables); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_LookupTables_initialize_lookup_tables_4, TMP_LookupTables_class_scopes_5, TMP_LookupTables_waiting_for_save_6, TMP_LookupTables_wait_for_save_7, TMP_LookupTables_clear_waiting_for_save_8, TMP_LookupTables_lookup_by_object_id_9, TMP_LookupTables_set_object_id_lookup_10, TMP_LookupTables_lookup_by_id_11, TMP_LookupTables_set_id_lookup_12, TMP_LookupTables_lookup_by_vector_13, TMP_LookupTables_set_vector_lookup_14; | |
Opal.def(self, '$initialize_lookup_tables', TMP_LookupTables_initialize_lookup_tables_4 = function $$initialize_lookup_tables() { | |
var TMP_1, TMP_2, TMP_3, self = this; | |
self.records = $send($$($nesting, 'Hash'), 'new', [], (TMP_1 = function(hash, key){var self = TMP_1.$$s || this, $writer = nil; | |
if (hash == null) hash = nil;if (key == null) key = nil; | |
$writer = [key, []]; | |
$send(hash, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1)); | |
self.records_by_id = {}; | |
self.records_by_vector = {}; | |
self.records_by_object_id = {}; | |
self.class_scopes = $send($$($nesting, 'Hash'), 'new', [], (TMP_2 = function(hash, key){var self = TMP_2.$$s || this, $writer = nil; | |
if (hash == null) hash = nil;if (key == null) key = nil; | |
$writer = [key, $hash2([], {})]; | |
$send(hash, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2)); | |
return (self.waiting_for_save = $send($$($nesting, 'Hash'), 'new', [], (TMP_3 = function(hash, key){var self = TMP_3.$$s || this, $writer = nil; | |
if (hash == null) hash = nil;if (key == null) key = nil; | |
$writer = [key, []]; | |
$send(hash, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_3.$$s = self, TMP_3.$$arity = 2, TMP_3))); | |
}, TMP_LookupTables_initialize_lookup_tables_4.$$arity = 0); | |
Opal.def(self, '$class_scopes', TMP_LookupTables_class_scopes_5 = function $$class_scopes(model) { | |
var self = this; | |
if (self.class_scopes == null) self.class_scopes = nil; | |
return self.class_scopes['$[]'](model.$base_class()) | |
}, TMP_LookupTables_class_scopes_5.$$arity = 1); | |
Opal.def(self, '$waiting_for_save', TMP_LookupTables_waiting_for_save_6 = function $$waiting_for_save(model) { | |
var self = this; | |
if (self.waiting_for_save == null) self.waiting_for_save = nil; | |
return self.waiting_for_save['$[]'](model) | |
}, TMP_LookupTables_waiting_for_save_6.$$arity = 1); | |
Opal.def(self, '$wait_for_save', TMP_LookupTables_wait_for_save_7 = function $$wait_for_save(model) { | |
var self = this, $iter = TMP_LookupTables_wait_for_save_7.$$p, block = $iter || nil; | |
if (self.waiting_for_save == null) self.waiting_for_save = nil; | |
if ($iter) TMP_LookupTables_wait_for_save_7.$$p = null; | |
return self.waiting_for_save['$[]'](model)['$<<'](block) | |
}, TMP_LookupTables_wait_for_save_7.$$arity = 1); | |
Opal.def(self, '$clear_waiting_for_save', TMP_LookupTables_clear_waiting_for_save_8 = function $$clear_waiting_for_save(model) { | |
var self = this, $writer = nil; | |
if (self.waiting_for_save == null) self.waiting_for_save = nil; | |
$writer = [model, []]; | |
$send(self.waiting_for_save, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
}, TMP_LookupTables_clear_waiting_for_save_8.$$arity = 1); | |
Opal.def(self, '$lookup_by_object_id', TMP_LookupTables_lookup_by_object_id_9 = function $$lookup_by_object_id(object_id) { | |
var self = this; | |
if (self.records_by_object_id == null) self.records_by_object_id = nil; | |
return (self.records_by_object_id[object_id]).$ar_instance() | |
}, TMP_LookupTables_lookup_by_object_id_9.$$arity = 1); | |
Opal.def(self, '$set_object_id_lookup', TMP_LookupTables_set_object_id_lookup_10 = function $$set_object_id_lookup(record) { | |
var self = this; | |
if (self.records_by_object_id == null) self.records_by_object_id = nil; | |
return self.records_by_object_id[record.$object_id()] = record | |
}, TMP_LookupTables_set_object_id_lookup_10.$$arity = 1); | |
Opal.def(self, '$lookup_by_id', TMP_LookupTables_lookup_by_id_11 = function $$lookup_by_id($a_rest) { | |
var $b, self = this, args; | |
if (self.records_by_id == null) self.records_by_id = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return ($truthy($b = self.records_by_id[args]) ? $b : nil) | |
}, TMP_LookupTables_lookup_by_id_11.$$arity = -1); | |
Opal.def(self, '$set_id_lookup', TMP_LookupTables_set_id_lookup_12 = function $$set_id_lookup(record) { | |
var self = this; | |
if (self.records_by_id == null) self.records_by_id = nil; | |
return self.records_by_id[[record.$model(), record.$id()]] = record | |
}, TMP_LookupTables_set_id_lookup_12.$$arity = 1); | |
Opal.def(self, '$lookup_by_vector', TMP_LookupTables_lookup_by_vector_13 = function $$lookup_by_vector(vector) { | |
var $a, self = this; | |
if (self.records_by_vector == null) self.records_by_vector = nil; | |
return ($truthy($a = self.records_by_vector[vector]) ? $a : nil) | |
}, TMP_LookupTables_lookup_by_vector_13.$$arity = 1); | |
Opal.def(self, '$set_vector_lookup', TMP_LookupTables_set_vector_lookup_14 = function $$set_vector_lookup(record, vector) { | |
var self = this, $writer = nil; | |
if (self.records_by_vector == null) self.records_by_vector = nil; | |
$writer = [vector]; | |
$send(record, 'vector=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
delete self.records_by_vector[record.$vector()]; | |
return self.records_by_vector[vector] = record; | |
}, TMP_LookupTables_set_vector_lookup_14.$$arity = 2); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/operations.rb": | |
/*!**********************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/operations.rb ***! | |
\**********************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/operations"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$param', '$[]', '$each', '$%', '$[]=', '$-', '$to_i', '$is_a?', '$step', '$map', '$models', '$params', '$to_proc', '$associations', '$pending_fetches', '$acting_user', '$failed', '$on_error', '$to_h', '$raise', '$save_records', '$validate', '$save', '$destroy_record', '$model', '$id', '$vector']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ReactiveRecord_on_fetch_error_1; | |
Opal.defs(self, '$on_fetch_error', TMP_ReactiveRecord_on_fetch_error_1 = function $$on_fetch_error(e, params) { | |
var self = this; | |
return nil | |
}, TMP_ReactiveRecord_on_fetch_error_1.$$arity = 2); | |
(function($base, $parent_nesting) { | |
function $Operations() {}; | |
var self = $Operations = $module($base, 'Operations', $Operations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Base(){}; | |
var self = $Base = $klass($base, $super, 'Base', $Base); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Base_serialize_params_4, TMP_Base_deserialize_params_7, TMP_Base_serialize_response_9, TMP_Base_deserialize_response_11; | |
self.$param("acting_user", $hash2(["nils"], {"nils": true})); | |
Opal.const_set($nesting[0], 'FORMAT', "0x%x"); | |
Opal.defs(self, '$serialize_params', TMP_Base_serialize_params_4 = function $$serialize_params(hash) { | |
var TMP_2, TMP_3, self = this; | |
if ($truthy(hash['$[]']("associations"))) { | |
$send(hash['$[]']("associations"), 'each', [], (TMP_2 = function(assoc){var self = TMP_2.$$s || this, $writer = nil; | |
if (assoc == null) assoc = nil; | |
$writer = ["parent_id", $$($nesting, 'FORMAT')['$%'](assoc['$[]']("parent_id"))]; | |
$send(assoc, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$writer = ["child_id", $$($nesting, 'FORMAT')['$%'](assoc['$[]']("child_id"))]; | |
$send(assoc, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}; | |
if ($truthy(hash['$[]']("models"))) { | |
$send(hash['$[]']("models"), 'each', [], (TMP_3 = function(assoc){var self = TMP_3.$$s || this, $writer = nil; | |
if (assoc == null) assoc = nil; | |
$writer = ["id", $$($nesting, 'FORMAT')['$%'](assoc['$[]']("id"))]; | |
$send(assoc, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3))}; | |
return hash; | |
}, TMP_Base_serialize_params_4.$$arity = 1); | |
Opal.defs(self, '$deserialize_params', TMP_Base_deserialize_params_7 = function $$deserialize_params(hash) { | |
var TMP_5, TMP_6, self = this; | |
if ($truthy(hash['$[]']("associations"))) { | |
$send(hash['$[]']("associations"), 'each', [], (TMP_5 = function(assoc){var self = TMP_5.$$s || this, $writer = nil; | |
if (assoc == null) assoc = nil; | |
$writer = ["parent_id", assoc['$[]']("parent_id").$to_i(16)]; | |
$send(assoc, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$writer = ["child_id", assoc['$[]']("child_id").$to_i(16)]; | |
$send(assoc, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5))}; | |
if ($truthy(hash['$[]']("models"))) { | |
$send(hash['$[]']("models"), 'each', [], (TMP_6 = function(assoc){var self = TMP_6.$$s || this, $writer = nil; | |
if (assoc == null) assoc = nil; | |
$writer = ["id", assoc['$[]']("id").$to_i(16)]; | |
$send(assoc, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6))}; | |
return hash; | |
}, TMP_Base_deserialize_params_7.$$arity = 1); | |
Opal.defs(self, '$serialize_response', TMP_Base_serialize_response_9 = function $$serialize_response(response) { | |
var $a, TMP_8, self = this; | |
if ($truthy(($truthy($a = response['$is_a?']($$($nesting, 'Hash'))) ? response['$[]']("saved_models") : $a))) { | |
$send(response['$[]']("saved_models"), 'each', [], (TMP_8 = function(saved_model){var self = TMP_8.$$s || this, $writer = nil; | |
if (saved_model == null) saved_model = nil; | |
$writer = [0, $$($nesting, 'FORMAT')['$%'](saved_model['$[]'](0))]; | |
$send(saved_model, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8))}; | |
return response; | |
}, TMP_Base_serialize_response_9.$$arity = 1); | |
return (Opal.defs(self, '$deserialize_response', TMP_Base_deserialize_response_11 = function $$deserialize_response(response) { | |
var $a, TMP_10, self = this; | |
if ($truthy(($truthy($a = response['$is_a?']($$($nesting, 'Hash'))) ? response['$[]']("saved_models") : $a))) { | |
$send(response['$[]']("saved_models"), 'each', [], (TMP_10 = function(saved_model){var self = TMP_10.$$s || this, $writer = nil; | |
if (saved_model == null) saved_model = nil; | |
$writer = [0, saved_model['$[]'](0).$to_i(16)]; | |
$send(saved_model, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10))}; | |
return response; | |
}, TMP_Base_deserialize_response_11.$$arity = 1), nil) && 'deserialize_response'; | |
})($nesting[0], $$$($$($nesting, 'Hyperloop'), 'ControllerOp'), $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Fetch(){}; | |
var self = $Fetch = $klass($base, $super, 'Fetch', $Fetch); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Fetch_12, TMP_Fetch_13; | |
self.$param("acting_user", $hash2(["nils"], {"nils": true})); | |
self.$param($hash2(["models"], {"models": []})); | |
self.$param($hash2(["associations"], {"associations": []})); | |
self.$param("pending_fetches"); | |
$send(self, 'step', [], (TMP_Fetch_12 = function(){var self = TMP_Fetch_12.$$s || this; | |
return $$$($$($nesting, 'ReactiveRecord'), 'ServerDataCache')['$[]']($send(self.$params().$models(), 'map', [], "with_indifferent_access".$to_proc()), $send(self.$params().$associations(), 'map', [], "with_indifferent_access".$to_proc()), self.$params().$pending_fetches(), self.$params().$acting_user())}, TMP_Fetch_12.$$s = self, TMP_Fetch_12.$$arity = 0, TMP_Fetch_12)); | |
return $send(self, 'failed', [], (TMP_Fetch_13 = function(e){var self = TMP_Fetch_13.$$s || this; | |
if (e == null) e = nil; | |
if ($truthy(e['$is_a?']($$$($$($nesting, 'Hyperloop'), 'AccessViolation')))) { | |
} else { | |
$$($nesting, 'Hyperloop').$on_error(e, "fetch_error", self.$params().$to_h()) | |
}; | |
return self.$raise(e);}, TMP_Fetch_13.$$s = self, TMP_Fetch_13.$$arity = 1, TMP_Fetch_13)); | |
})($nesting[0], $$($nesting, 'Base'), $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Save(){}; | |
var self = $Save = $klass($base, $super, 'Save', $Save); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Save_14; | |
self.$param("acting_user", $hash2(["nils"], {"nils": true})); | |
self.$param($hash2(["models"], {"models": []})); | |
self.$param($hash2(["associations"], {"associations": []})); | |
self.$param("save", $hash2(["type"], {"type": "boolean"})); | |
self.$param("validate", $hash2(["type"], {"type": "boolean"})); | |
return $send(self, 'step', [], (TMP_Save_14 = function(){var self = TMP_Save_14.$$s || this; | |
return $$$($$($nesting, 'ReactiveRecord'), 'Base').$save_records($send(self.$params().$models(), 'map', [], "with_indifferent_access".$to_proc()), $send(self.$params().$associations(), 'map', [], "with_indifferent_access".$to_proc()), self.$params().$acting_user(), self.$params().$validate(), self.$params().$save())}, TMP_Save_14.$$s = self, TMP_Save_14.$$arity = 0, TMP_Save_14)); | |
})($nesting[0], $$($nesting, 'Base'), $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Destroy(){}; | |
var self = $Destroy = $klass($base, $super, 'Destroy', $Destroy); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Destroy_15; | |
self.$param("acting_user", $hash2(["nils"], {"nils": true})); | |
self.$param("model"); | |
self.$param("id"); | |
self.$param("vector"); | |
return $send(self, 'step', [], (TMP_Destroy_15 = function(){var self = TMP_Destroy_15.$$s || this; | |
return $$$($$($nesting, 'ReactiveRecord'), 'Base').$destroy_record(self.$params().$model(), self.$params().$id(), self.$params().$vector(), self.$params().$acting_user())}, TMP_Destroy_15.$$s = self, TMP_Destroy_15.$$arity = 0, TMP_Destroy_15)); | |
})($nesting[0], $$($nesting, 'Base'), $nesting); | |
})($nesting[0], $nesting); | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/scoped_collection.rb": | |
/*!*****************************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/scoped_collection.rb ***! | |
\*****************************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/scoped_collection"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$each', '$define_method', '$send', '$filter?', '$catch_db_requests', '$filter_records', '$live_scopes', '$set_pre_sync_related_records', '$update_collection', '$!', '$joins_with?', '$reload_from_db', '$sync_scopes', '$collector?', '$update_collector_scope', '$update_filter_scope', '$new', '$-', '$<<', '$delete', '$replace', '$collection', '$nil?', '$!=', '$push', '$+', '$count', '$notify_of_change']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $ScopedCollection() {}; | |
var self = $ScopedCollection = $module($base, 'ScopedCollection', $ScopedCollection); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ScopedCollection_1, TMP_ScopedCollection_set_pre_sync_related_records_5, TMP_ScopedCollection_sync_scopes_8, TMP_ScopedCollection_update_collection_9, TMP_ScopedCollection_update_collector_scope_12, TMP_ScopedCollection_update_filter_scope_15; | |
$send(["filter?", "collector?", "joins_with?", "related_records_for"], 'each', [], (TMP_ScopedCollection_1 = function(method){var self = TMP_ScopedCollection_1.$$s || this, TMP_2; | |
if (method == null) method = nil; | |
return $send(self, 'define_method', [method], (TMP_2 = function($a_rest){var self = TMP_2.$$s || this, args; | |
if (self.scope_description == null) self.scope_description = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.scope_description, 'send', [method].concat(Opal.to_a(args)))}, TMP_2.$$s = self, TMP_2.$$arity = -1, TMP_2))}, TMP_ScopedCollection_1.$$s = self, TMP_ScopedCollection_1.$$arity = 1, TMP_ScopedCollection_1)); | |
Opal.def(self, '$set_pre_sync_related_records', TMP_ScopedCollection_set_pre_sync_related_records_5 = function $$set_pre_sync_related_records(related_records, _record) { | |
var TMP_3, self = this; | |
if (_record == null) { | |
_record = nil; | |
} | |
self.pre_sync_related_records = nil; | |
if ($truthy(self['$filter?']())) { | |
return $send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'catch_db_requests', [], (TMP_3 = function(){var self = TMP_3.$$s || this, TMP_4; | |
self.pre_sync_related_records = self.$filter_records(related_records); | |
return $send(self.$live_scopes(), 'each', [], (TMP_4 = function(scope){var self = TMP_4.$$s || this; | |
if (self.pre_sync_related_records == null) self.pre_sync_related_records = nil; | |
if (scope == null) scope = nil; | |
return scope.$set_pre_sync_related_records(self.pre_sync_related_records)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4));}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3)) | |
} else { | |
return nil | |
}; | |
}, TMP_ScopedCollection_set_pre_sync_related_records_5.$$arity = -2); | |
Opal.def(self, '$sync_scopes', TMP_ScopedCollection_sync_scopes_8 = function $$sync_scopes(related_records, record, filtering) { | |
var $a, $b, TMP_6, TMP_7, self = this; | |
if (self.pre_sync_related_records == null) self.pre_sync_related_records = nil; | |
if (filtering == null) { | |
filtering = true; | |
} | |
return (function() { try { | |
filtering = ($truthy($a = ($truthy($b = self.pre_sync_related_records) ? filtering : $b)) ? $send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'catch_db_requests', [], (TMP_6 = function(){var self = TMP_6.$$s || this; | |
return (related_records = self.$update_collection(related_records))}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6)) : $a); | |
if ($truthy(($truthy($a = filtering['$!']()) ? self['$joins_with?'](record) : $a))) { | |
self.$reload_from_db()}; | |
return $send(self.$live_scopes(), 'each', [], (TMP_7 = function(scope){var self = TMP_7.$$s || this; | |
if (scope == null) scope = nil; | |
return scope.$sync_scopes(related_records, record, filtering)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7)); | |
} finally { | |
(self.pre_sync_related_records = nil) | |
}; })() | |
}, TMP_ScopedCollection_sync_scopes_8.$$arity = -3); | |
Opal.def(self, '$update_collection', TMP_ScopedCollection_update_collection_9 = function $$update_collection(related_records) { | |
var self = this; | |
if (self.pre_sync_related_records == null) self.pre_sync_related_records = nil; | |
if ($truthy(self['$collector?']())) { | |
return self.$update_collector_scope(related_records) | |
} else { | |
related_records = self.$filter_records(related_records); | |
return self.$update_filter_scope(self.pre_sync_related_records, related_records); | |
} | |
}, TMP_ScopedCollection_update_collection_9.$$arity = 1); | |
Opal.def(self, '$update_collector_scope', TMP_ScopedCollection_update_collector_scope_12 = function $$update_collector_scope(related_records) { | |
var TMP_10, TMP_11, self = this, current = nil; | |
if (self.collection == null) self.collection = nil; | |
if (self.pre_sync_related_records == null) self.pre_sync_related_records = nil; | |
current = $$($nesting, 'Set').$new([].concat(Opal.to_a(self.collection))); | |
$send($rb_minus(related_records, self.pre_sync_related_records), 'each', [], (TMP_10 = function(r){var self = TMP_10.$$s || this; | |
if (r == null) r = nil; | |
return current['$<<'](r)}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10)); | |
$send($rb_minus(self.pre_sync_related_records, related_records), 'each', [], (TMP_11 = function(r){var self = TMP_11.$$s || this; | |
if (r == null) r = nil; | |
return current.$delete(r)}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11)); | |
self.$replace(self.$filter_records(current)); | |
return $$($nesting, 'Set').$new([].concat(Opal.to_a(self.collection))); | |
}, TMP_ScopedCollection_update_collector_scope_12.$$arity = 1); | |
Opal.def(self, '$update_filter_scope', TMP_ScopedCollection_update_filter_scope_15 = function $$update_filter_scope(before, after) { | |
var $a, $b, TMP_13, TMP_14, self = this; | |
if (self.count == null) self.count = nil; | |
if ($truthy(($truthy($a = ($truthy($b = self.$collection()) ? $b : self.count['$nil?']()['$!']())) ? before['$!='](after) : $a))) { | |
if ($truthy(self.$collection())) { | |
$send($rb_minus(after, before), 'each', [], (TMP_13 = function(r){var self = TMP_13.$$s || this; | |
if (r == null) r = nil; | |
return self.$push(r)}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13)); | |
$send($rb_minus(before, after), 'each', [], (TMP_14 = function(r){var self = TMP_14.$$s || this; | |
if (r == null) r = nil; | |
return self.$delete(r)}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14)); | |
} else { | |
self.count = $rb_plus(self.count, $rb_minus(after, before).$count()); | |
self.count = $rb_minus(self.count, $rb_minus(before, after).$count()); | |
self.$notify_of_change(self); | |
}}; | |
return after; | |
}, TMP_ScopedCollection_update_filter_scope_15.$$arity = 2); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/setters.rb": | |
/*!*******************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/setters.rb ***! | |
\*******************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/setters"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$set_common', '$update_simple_attribute', '$attribute', '$new?', '$[]', '$new', '$klass', '$[]=', '$-', '$backing_record', '$virgin=', '$attributes', '$each', '$mapped_attributes', '$update_aggregate_attribute', '$data_loading?', '$deserialize', '$serialize', '$!', '$key?', '$!=', '$set_attribute_change_status_and_notify', '$replace', '$collection?', '$inverse', '$update_has_many_through_associations', '$update_inverse_collections', '$update_inverse_attribute', '$update_belongs_to', '$itself', '$set_change_status_and_notify_only', '$private', '$convert', '$is_a?', '$change_status_and_notify_helper', '$on_opal_client?', '$loaded?', '$set_state', '$empty?', '$changed_attributes', '$delete', '$include?', '$<<', '$aggregate_owner', '$nil?', '$push_onto_collection', '$through_associations', '$update_through_association', '$source_associations', '$update_source_association', '$source']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $Setters() {}; | |
var self = $Setters = $module($base, 'Setters', $Setters); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Setters_set_attr_value_2, TMP_Setters_set_ar_aggregate_5, TMP_Setters_set_non_ar_aggregate_7, TMP_Setters_set_has_many_9, TMP_Setters_set_belongs_to_11, TMP_Setters_sync_has_many_12, TMP_Setters_update_simple_attribute_13, TMP_Setters_set_common_14, TMP_Setters_set_attribute_change_status_and_notify_16, TMP_Setters_set_change_status_and_notify_only_18, TMP_Setters_change_status_and_notify_helper_19, TMP_Setters_update_inverse_attribute_20, TMP_Setters_update_inverse_collections_21, TMP_Setters_push_onto_collection_22, TMP_Setters_update_has_many_through_associations_25, TMP_Setters_update_through_association_26, TMP_Setters_update_source_association_27; | |
Opal.def(self, '$set_attr_value', TMP_Setters_set_attr_value_2 = function $$set_attr_value(attr, raw_value) { | |
var TMP_1, self = this; | |
return $send(self, 'set_common', [attr, raw_value], (TMP_1 = function(value){var self = TMP_1.$$s || this; | |
if (value == null) value = nil; | |
return self.$update_simple_attribute(attr, value)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)) | |
}, TMP_Setters_set_attr_value_2.$$arity = 2); | |
Opal.def(self, '$set_ar_aggregate', TMP_Setters_set_ar_aggregate_5 = function $$set_ar_aggregate(aggr, raw_value) {try { | |
var TMP_3, self = this; | |
return $send(self, 'set_common', [aggr.$attribute(), raw_value], (TMP_3 = function(value, attr){var self = TMP_3.$$s || this, $a, TMP_4, $writer = nil, abr = nil, map = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (value == null) value = nil;if (attr == null) attr = nil; | |
if ($truthy(self['$new?']())) { | |
($truthy($a = self.attributes['$[]'](attr)) ? $a : (($writer = [attr, aggr.$klass().$new()]), $send(self.attributes, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))}; | |
abr = self.attributes['$[]'](attr).$backing_record(); | |
$writer = [false]; | |
$send(abr, 'virgin=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
if ($truthy(value)) { | |
map = value.$attributes()}; | |
$send(aggr.$mapped_attributes(), 'each', [], (TMP_4 = function(mapped_attr){var self = TMP_4.$$s || this, $b; | |
if (mapped_attr == null) mapped_attr = nil; | |
return abr.$update_aggregate_attribute(mapped_attr, ($truthy($b = map) ? map['$[]'](mapped_attr) : $b))}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4)); | |
Opal.ret(self.attributes['$[]'](attr));}, TMP_3.$$s = self, TMP_3.$$arity = 2, TMP_3)) | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_Setters_set_ar_aggregate_5.$$arity = 2); | |
Opal.def(self, '$set_non_ar_aggregate', TMP_Setters_set_non_ar_aggregate_7 = function $$set_non_ar_aggregate(aggregation, raw_value) { | |
var TMP_6, self = this; | |
return $send(self, 'set_common', [aggregation.$attribute(), raw_value], (TMP_6 = function(value, attr){var self = TMP_6.$$s || this, $a, $writer = nil, changed = nil; | |
if (self.synced_attributes == null) self.synced_attributes = nil; | |
if (value == null) value = nil;if (attr == null) attr = nil; | |
if ($truthy(self['$data_loading?']())) { | |
$writer = [attr, aggregation.$deserialize(aggregation.$serialize(value))]; | |
$send(self.synced_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
changed = ($truthy($a = self.synced_attributes['$key?'](attr)['$!']()) ? $a : self.synced_attributes['$[]'](attr)['$!='](value)) | |
}; | |
return self.$set_attribute_change_status_and_notify(attr, changed, value);}, TMP_6.$$s = self, TMP_6.$$arity = 2, TMP_6)) | |
}, TMP_Setters_set_non_ar_aggregate_7.$$arity = 2); | |
Opal.def(self, '$set_has_many', TMP_Setters_set_has_many_9 = function $$set_has_many(assoc, raw_value) {try { | |
var TMP_8, self = this; | |
return $send(self, 'set_common', [assoc.$attribute(), raw_value], (TMP_8 = function(value, attr){var self = TMP_8.$$s || this, $a, collection = nil, $writer = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
if (self.synced_attributes == null) self.synced_attributes = nil; | |
if (value == null) value = nil;if (attr == null) attr = nil; | |
collection = $$($nesting, 'Collection').$new(assoc.$klass(), self.ar_instance, assoc); | |
collection.$replace(($truthy($a = value) ? $a : [])); | |
if ($truthy(self['$data_loading?']())) { | |
$writer = [attr, value]; | |
$send(self.synced_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
self.$set_attribute_change_status_and_notify(attr, value['$!='](self.synced_attributes['$[]'](attr)), collection); | |
Opal.ret(collection);}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8)) | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_Setters_set_has_many_9.$$arity = 2); | |
Opal.def(self, '$set_belongs_to', TMP_Setters_set_belongs_to_11 = function $$set_belongs_to(assoc, raw_value) { | |
var TMP_10, self = this; | |
return $send(self, 'set_common', [assoc.$attribute(), raw_value], (TMP_10 = function(value, attr){var self = TMP_10.$$s || this; | |
if (value == null) value = nil;if (attr == null) attr = nil; | |
if ($truthy(assoc.$inverse()['$collection?']())) { | |
self.$update_has_many_through_associations(assoc, value); | |
self.$update_inverse_collections(assoc, value); | |
} else { | |
self.$update_inverse_attribute(assoc, value) | |
}; | |
return self.$update_belongs_to(attr, value.$itself());}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10)) | |
}, TMP_Setters_set_belongs_to_11.$$arity = 2); | |
Opal.def(self, '$sync_has_many', TMP_Setters_sync_has_many_12 = function $$sync_has_many(attr) { | |
var self = this; | |
if (self.attributes == null) self.attributes = nil; | |
if (self.synced_attributes == null) self.synced_attributes = nil; | |
return self.$set_change_status_and_notify_only(attr, self.attributes['$[]'](attr)['$!='](self.synced_attributes['$[]'](attr))) | |
}, TMP_Setters_sync_has_many_12.$$arity = 1); | |
Opal.def(self, '$update_simple_attribute', TMP_Setters_update_simple_attribute_13 = function $$update_simple_attribute(attr, value) { | |
var $a, self = this, $writer = nil, changed = nil; | |
if (self.synced_attributes == null) self.synced_attributes = nil; | |
if ($truthy(self['$data_loading?']())) { | |
$writer = [attr, value]; | |
$send(self.synced_attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
changed = ($truthy($a = self.synced_attributes['$key?'](attr)['$!']()) ? $a : self.synced_attributes['$[]'](attr)['$!='](value)) | |
}; | |
return self.$set_attribute_change_status_and_notify(attr, changed, value); | |
}, TMP_Setters_update_simple_attribute_13.$$arity = 2); | |
Opal.alias(self, "update_belongs_to", "update_simple_attribute"); | |
Opal.alias(self, "update_aggregate_attribute", "update_simple_attribute"); | |
self.$private(); | |
Opal.def(self, '$set_common', TMP_Setters_set_common_14 = function $$set_common(attr, value) { | |
var $a, $b, $c, self = this, $iter = TMP_Setters_set_common_14.$$p, $yield = $iter || nil; | |
if (self.destroyed == null) self.destroyed = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if ($iter) TMP_Setters_set_common_14.$$p = null; | |
value = self.$convert(attr, value); | |
if ($truthy(self['$data_loading?']())) { | |
} else { | |
self.virgin = false | |
}; | |
if ($truthy(($truthy($a = self.destroyed['$!']()) ? ($truthy($b = ($truthy($c = self.attributes['$key?'](attr)['$!']()) ? $c : self.attributes['$[]'](attr)['$is_a?']($$$($$($nesting, 'Base'), 'DummyValue')))) ? $b : self.attributes['$[]'](attr)['$!='](value)) : $a))) { | |
Opal.yieldX($yield, [value, attr])}; | |
return value; | |
}, TMP_Setters_set_common_14.$$arity = 2); | |
Opal.def(self, '$set_attribute_change_status_and_notify', TMP_Setters_set_attribute_change_status_and_notify_16 = function $$set_attribute_change_status_and_notify(attr, changed, new_value) { | |
var TMP_15, self = this, $writer = nil; | |
if (self.virgin == null) self.virgin = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if ($truthy(self.virgin)) { | |
$writer = [attr, new_value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)]; | |
} else { | |
return $send(self, 'change_status_and_notify_helper', [attr, changed], (TMP_15 = function(had_key, current_value){var self = TMP_15.$$s || this, $a, $b, $c, $d; | |
if (self.attributes == null) self.attributes = nil; | |
if (had_key == null) had_key = nil;if (current_value == null) current_value = nil; | |
$writer = [attr, new_value]; | |
$send(self.attributes, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
if ($truthy(($truthy($a = self['$data_loading?']()['$!']()) ? $a : ($truthy($b = ($truthy($c = ($truthy($d = self['$on_opal_client?']()) ? had_key : $d)) ? current_value['$loaded?']() : $c)) ? current_value['$!='](new_value) : $b)))) { | |
return $$$($$($nesting, 'React'), 'State').$set_state(self, attr, new_value, self['$data_loading?']()) | |
} else { | |
return nil | |
};}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15)) | |
} | |
}, TMP_Setters_set_attribute_change_status_and_notify_16.$$arity = 3); | |
Opal.def(self, '$set_change_status_and_notify_only', TMP_Setters_set_change_status_and_notify_only_18 = function $$set_change_status_and_notify_only(attr, changed) { | |
var TMP_17, self = this; | |
if (self.virgin == null) self.virgin = nil; | |
if ($truthy(self.virgin)) { | |
return nil}; | |
return $send(self, 'change_status_and_notify_helper', [attr, changed], (TMP_17 = function(){var self = TMP_17.$$s || this; | |
if ($truthy(self['$data_loading?']())) { | |
return nil | |
} else { | |
return $$$($$($nesting, 'React'), 'State').$set_state(self, attr, nil) | |
}}, TMP_17.$$s = self, TMP_17.$$arity = 0, TMP_17)); | |
}, TMP_Setters_set_change_status_and_notify_only_18.$$arity = 2); | |
Opal.def(self, '$change_status_and_notify_helper', TMP_Setters_change_status_and_notify_helper_19 = function $$change_status_and_notify_helper(attr, changed) { | |
var $a, self = this, $iter = TMP_Setters_change_status_and_notify_helper_19.$$p, $yield = $iter || nil, empty_before = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if ($iter) TMP_Setters_change_status_and_notify_helper_19.$$p = null; | |
empty_before = self.$changed_attributes()['$empty?'](); | |
if ($truthy(($truthy($a = changed['$!']()) ? $a : self['$data_loading?']()))) { | |
self.$changed_attributes().$delete(attr) | |
} else if ($truthy(self.$changed_attributes()['$include?'](attr)['$!']())) { | |
self.$changed_attributes()['$<<'](attr)}; | |
Opal.yieldX($yield, [self.attributes['$key?'](attr), self.attributes['$[]'](attr)]); | |
if ($truthy(empty_before['$!='](self.$changed_attributes()['$empty?']()))) { | |
} else { | |
return nil | |
}; | |
if ($truthy(($truthy($a = self['$on_opal_client?']()) ? self['$data_loading?']()['$!']() : $a))) { | |
$$$($$($nesting, 'React'), 'State').$set_state(self, "!CHANGED!", self.$changed_attributes()['$empty?']()['$!'](), true)}; | |
if ($truthy(self.$aggregate_owner())) { | |
} else { | |
return nil | |
}; | |
return self.$aggregate_owner().$set_change_status_and_notify_only(attr, self.attributes['$[]'](attr).$backing_record().$changed_attributes()['$empty?']()['$!']()); | |
}, TMP_Setters_change_status_and_notify_helper_19.$$arity = 2); | |
Opal.def(self, '$update_inverse_attribute', TMP_Setters_update_inverse_attribute_20 = function $$update_inverse_attribute(association, value) { | |
var self = this, current_value = nil, inverse_attr = nil, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
current_value = self.attributes['$[]'](association.$attribute()); | |
inverse_attr = association.$inverse().$attribute(); | |
if ($truthy(current_value['$nil?']())) { | |
} else { | |
$writer = [inverse_attr, nil]; | |
$send(current_value.$attributes(), '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)]; | |
}; | |
if ($truthy(value['$nil?']())) { | |
return nil}; | |
$writer = [inverse_attr, self.ar_instance]; | |
$send(value.$attributes(), '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
if ($truthy(self['$data_loading?']())) { | |
return nil}; | |
return $$$($$($nesting, 'React'), 'State').$set_state(value.$backing_record(), inverse_attr, self.ar_instance); | |
}, TMP_Setters_update_inverse_attribute_20.$$arity = 2); | |
Opal.def(self, '$update_inverse_collections', TMP_Setters_update_inverse_collections_21 = function $$update_inverse_collections(association, value) { | |
var self = this, current_value = nil, inverse_attr = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
if (self.model == null) self.model = nil; | |
current_value = self.attributes['$[]'](association.$attribute()); | |
inverse_attr = association.$inverse().$attribute(); | |
if ($truthy(value['$nil?']())) { | |
if ($truthy(current_value['$nil?']())) { | |
return nil | |
} else { | |
return current_value.$attributes()['$[]'](inverse_attr).$delete(self.ar_instance) | |
} | |
} else { | |
return value.$backing_record().$push_onto_collection(self.model, association.$inverse(), self.ar_instance) | |
}; | |
}, TMP_Setters_update_inverse_collections_21.$$arity = 2); | |
Opal.def(self, '$push_onto_collection', TMP_Setters_push_onto_collection_22 = function $$push_onto_collection(model, association, ar_instance) { | |
var $a, self = this, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
if (self.ar_instance == null) self.ar_instance = nil; | |
($truthy($a = self.attributes['$[]'](association.$attribute())) ? $a : (($writer = [association.$attribute(), $$($nesting, 'Collection').$new(model, self.ar_instance, association)]), $send(self.attributes, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])); | |
return self.attributes['$[]'](association.$attribute())['$<<'](ar_instance); | |
}, TMP_Setters_push_onto_collection_22.$$arity = 3); | |
Opal.def(self, '$update_has_many_through_associations', TMP_Setters_update_has_many_through_associations_25 = function $$update_has_many_through_associations(association, value) { | |
var TMP_23, TMP_24, self = this; | |
$send(association.$through_associations(), 'each', [], (TMP_23 = function(ta){var self = TMP_23.$$s || this; | |
if (ta == null) ta = nil; | |
return self.$update_through_association(ta, value)}, TMP_23.$$s = self, TMP_23.$$arity = 1, TMP_23)); | |
return $send(association.$source_associations(), 'each', [], (TMP_24 = function(sa){var self = TMP_24.$$s || this; | |
if (sa == null) sa = nil; | |
return self.$update_source_association(sa, value)}, TMP_24.$$s = self, TMP_24.$$arity = 1, TMP_24)); | |
}, TMP_Setters_update_has_many_through_associations_25.$$arity = 2); | |
Opal.def(self, '$update_through_association', TMP_Setters_update_through_association_26 = function $$update_through_association(ta, new_belongs_to_value) { | |
var $a, self = this, source_value = nil, current_belongs_to_value = nil, $logical_op_recvr_tmp_4 = nil, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
source_value = self.attributes['$[]'](ta.$source()); | |
current_belongs_to_value = self.attributes['$[]'](ta.$inverse().$attribute()); | |
if ($truthy(source_value)) { | |
} else { | |
return nil | |
}; | |
if ($truthy(($truthy($a = current_belongs_to_value['$nil?']()) ? $a : current_belongs_to_value.$attributes()['$[]'](ta.$attribute())['$nil?']()))) { | |
} else { | |
current_belongs_to_value.$attributes()['$[]'](ta.$attribute()).$delete(source_value) | |
}; | |
if ($truthy(new_belongs_to_value)) { | |
} else { | |
return nil | |
}; | |
$logical_op_recvr_tmp_4 = new_belongs_to_value.$attributes(); | |
($truthy($a = $logical_op_recvr_tmp_4['$[]'](ta.$attribute())) ? $a : (($writer = [ta.$attribute(), $$($nesting, 'Collection').$new(ta.$klass(), new_belongs_to_value, ta)]), $send($logical_op_recvr_tmp_4, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));; | |
return new_belongs_to_value.$attributes()['$[]'](ta.$attribute())['$<<'](source_value); | |
}, TMP_Setters_update_through_association_26.$$arity = 2); | |
Opal.def(self, '$update_source_association', TMP_Setters_update_source_association_27 = function $$update_source_association(sa, new_source_value) { | |
var $a, self = this, belongs_to_value = nil, current_source_value = nil, $logical_op_recvr_tmp_5 = nil, $writer = nil; | |
if (self.attributes == null) self.attributes = nil; | |
belongs_to_value = self.attributes['$[]'](sa.$inverse().$attribute()); | |
current_source_value = self.attributes['$[]'](sa.$source()); | |
if ($truthy(belongs_to_value)) { | |
} else { | |
return nil | |
}; | |
if ($truthy(($truthy($a = belongs_to_value.$attributes()['$[]'](sa.$attribute())['$nil?']()) ? $a : current_source_value['$nil?']()))) { | |
} else { | |
belongs_to_value.$attributes()['$[]'](sa.$attribute()).$delete(current_source_value) | |
}; | |
if ($truthy(new_source_value)) { | |
} else { | |
return nil | |
}; | |
$logical_op_recvr_tmp_5 = belongs_to_value.$attributes(); | |
($truthy($a = $logical_op_recvr_tmp_5['$[]'](sa.$attribute())) ? $a : (($writer = [sa.$attribute(), $$($nesting, 'Collection').$new(sa.$klass(), belongs_to_value, sa)]), $send($logical_op_recvr_tmp_5, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));; | |
return belongs_to_value.$attributes()['$[]'](sa.$attribute())['$<<'](new_source_value); | |
}, TMP_Setters_update_source_association_27.$$arity = 2); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/unscoped_collection.rb": | |
/*!*******************************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/unscoped_collection.rb ***! | |
\*******************************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/unscoped_collection"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $send = Opal.send; | |
Opal.add_stubs(['$each', '$live_scopes', '$set_pre_sync_related_records', '$sync_scopes']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $UnscopedCollection() {}; | |
var self = $UnscopedCollection = $module($base, 'UnscopedCollection', $UnscopedCollection); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_UnscopedCollection_set_pre_sync_related_records_2, TMP_UnscopedCollection_sync_scopes_4; | |
Opal.def(self, '$set_pre_sync_related_records', TMP_UnscopedCollection_set_pre_sync_related_records_2 = function $$set_pre_sync_related_records(related_records, _record) { | |
var TMP_1, self = this; | |
if (_record == null) { | |
_record = nil; | |
} | |
self.pre_sync_related_records = related_records; | |
return $send(self.$live_scopes(), 'each', [], (TMP_1 = function(scope){var self = TMP_1.$$s || this; | |
if (self.pre_sync_related_records == null) self.pre_sync_related_records = nil; | |
if (scope == null) scope = nil; | |
return scope.$set_pre_sync_related_records(self.pre_sync_related_records)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)); | |
}, TMP_UnscopedCollection_set_pre_sync_related_records_2.$$arity = -2); | |
Opal.def(self, '$sync_scopes', TMP_UnscopedCollection_sync_scopes_4 = function $$sync_scopes(related_records, record, filtering) { | |
var TMP_3, self = this; | |
if (filtering == null) { | |
filtering = true; | |
} | |
return (function() { try { | |
return $send(self.$live_scopes(), 'each', [], (TMP_3 = function(scope){var self = TMP_3.$$s || this; | |
if (scope == null) scope = nil; | |
return scope.$sync_scopes(related_records, record, filtering)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3)) | |
} finally { | |
(self.pre_sync_related_records = nil) | |
}; })() | |
}, TMP_UnscopedCollection_sync_scopes_4.$$arity = -3); | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/while_loading.rb": | |
/*!*************************************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record/reactive_record/while_loading.rb ***! | |
\*************************************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record/reactive_record/while_loading"] = function(Opal) { | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $send = Opal.send, $truthy = Opal.truthy, $klass = Opal.klass, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$load', '$to_proc', '$new', '$<<', '$itself', '$call', '$current_fetch_id', '$resolve', '$pop', '$log', '$>', '$count', '$pending_fetches', '$loaded_at', '$quiet!', '$select', '$==', '$first', '$reject', '$each', '$check_loads_pending', '$!', '$include', '$before_first_mount', '$+', '$has_observers?', '$prerender_footer', '$tap', '$param', '$waiting_on_resources=', '$-', '$get_state', '$set_state', '$on_opal_server?', '$after', '$before_mount', '$get_next_while_loading_counter', '$preload_css', '$loaded_children', '$params', '$after_mount', '$loading', '$add_style_sheet', '$dom_node', '$after_update', '$dup', '$element_props', '$join', '$compact', '$[]', '$merge!', '$create_element', '$element_type', '$loading_children', '$block', '$respond_to?', '$as_node', '$lambda', '$render', '$build', '$try', '$to_s', '$is_a?', '$span', '$waiting_on_resources', '$type', '$properties', '$replace', '$while_loading', '$alias_method', '$original_component_did_mount', '$reactive_record_link_to_enclosing_while_loading_container', '$reactive_record_link_set_while_loading_container_class', '$original_component_did_update']); | |
(function($base, $parent_nesting) { | |
function $HyperMesh() {}; | |
var self = $HyperMesh = $module($base, 'HyperMesh', $HyperMesh); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_HyperMesh_load_1; | |
Opal.defs(self, '$load', TMP_HyperMesh_load_1 = function $$load() { | |
var self = this, $iter = TMP_HyperMesh_load_1.$$p, block = $iter || nil; | |
if ($iter) TMP_HyperMesh_load_1.$$p = null; | |
return $send($$($nesting, 'ReactiveRecord'), 'load', [], block.$to_proc()) | |
}, TMP_HyperMesh_load_1.$$arity = 0) | |
})($nesting[0], $nesting); | |
(function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ReactiveRecord_load_2, TMP_ReactiveRecord_loads_pending$B_3, TMP_ReactiveRecord_check_loads_pending_4, TMP_ReactiveRecord_run_blocks_to_load_8; | |
Opal.defs(self, '$load', TMP_ReactiveRecord_load_2 = function $$load() { | |
var $a, self = this, $iter = TMP_ReactiveRecord_load_2.$$p, block = $iter || nil, promise = nil, result = nil, e = nil; | |
if (self.load_stack == null) self.load_stack = nil; | |
if (self.loads_pending == null) self.loads_pending = nil; | |
if (self.blocks_to_load == null) self.blocks_to_load = nil; | |
if ($iter) TMP_ReactiveRecord_load_2.$$p = null; | |
try { | |
promise = $$($nesting, 'Promise').$new(); | |
self.load_stack = ($truthy($a = self.load_stack) ? $a : []); | |
self.load_stack['$<<'](self.loads_pending); | |
self.loads_pending = nil; | |
result = block.$call().$itself(); | |
if ($truthy(self.loads_pending)) { | |
self.blocks_to_load = ($truthy($a = self.blocks_to_load) ? $a : []); | |
self.blocks_to_load['$<<']([$$($nesting, 'Base').$current_fetch_id(), promise, block]); | |
} else { | |
promise.$resolve(result) | |
}; | |
self.loads_pending = self.load_stack.$pop(); | |
return promise; | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
return $$$($$($nesting, 'React'), 'IsomorphicHelpers').$log("" + "ReactiveRecord.load exception raised during initial load: " + (e), "error") | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_ReactiveRecord_load_2.$$arity = 0); | |
Opal.defs(self, '$loads_pending!', TMP_ReactiveRecord_loads_pending$B_3 = function() { | |
var self = this; | |
return (self.loads_pending = true) | |
}, TMP_ReactiveRecord_loads_pending$B_3.$$arity = 0); | |
Opal.defs(self, '$check_loads_pending', TMP_ReactiveRecord_check_loads_pending_4 = function $$check_loads_pending() { | |
var self = this; | |
if (self.loads_pending == null) self.loads_pending = nil; | |
if ($truthy(self.loads_pending)) { | |
if ($truthy($rb_gt($$($nesting, 'Base').$pending_fetches().$count(), 0))) { | |
return true | |
} else { | |
$$$($$($nesting, 'ReactiveRecord'), 'WhileLoading').$loaded_at($$($nesting, 'Base').$current_fetch_id()); | |
$$$($$($nesting, 'ReactiveRecord'), 'WhileLoading')['$quiet!'](); | |
return false; | |
} | |
} else { | |
return nil | |
} | |
}, TMP_ReactiveRecord_check_loads_pending_4.$$arity = 0); | |
Opal.defs(self, '$run_blocks_to_load', TMP_ReactiveRecord_run_blocks_to_load_8 = function $$run_blocks_to_load(fetch_id, failure) { | |
var TMP_5, TMP_6, $a, TMP_7, self = this, blocks_to_load_now = nil, e = nil; | |
if (self.blocks_to_load == null) self.blocks_to_load = nil; | |
if (self.load_stack == null) self.load_stack = nil; | |
if (failure == null) { | |
failure = nil; | |
} | |
try { | |
if ($truthy(self.blocks_to_load)) { | |
blocks_to_load_now = $send(self.blocks_to_load, 'select', [], (TMP_5 = function(data){var self = TMP_5.$$s || this; | |
if (data == null) data = nil; | |
return data.$first()['$=='](fetch_id)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5)); | |
self.blocks_to_load = $send(self.blocks_to_load, 'reject', [], (TMP_6 = function(data){var self = TMP_6.$$s || this; | |
if (data == null) data = nil; | |
return data.$first()['$=='](fetch_id)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6)); | |
self.load_stack = ($truthy($a = self.load_stack) ? $a : []); | |
return $send(blocks_to_load_now, 'each', [], (TMP_7 = function(data){var self = TMP_7.$$s || this, $b, $c, id = nil, promise = nil, block = nil, result = nil; | |
if (self.load_stack == null) self.load_stack = nil; | |
if (self.loads_pending == null) self.loads_pending = nil; | |
if (self.blocks_to_load == null) self.blocks_to_load = nil; | |
if (data == null) data = nil; | |
$c = data, $b = Opal.to_ary($c), (id = ($b[0] == null ? nil : $b[0])), (promise = ($b[1] == null ? nil : $b[1])), (block = ($b[2] == null ? nil : $b[2])), $c; | |
self.load_stack['$<<'](self.loads_pending); | |
self.loads_pending = nil; | |
result = block.$call(failure); | |
if ($truthy(($truthy($b = self.$check_loads_pending()) ? failure['$!']() : $b))) { | |
self.blocks_to_load['$<<']([$$($nesting, 'Base').$current_fetch_id(), promise, block]) | |
} else { | |
promise.$resolve(result) | |
}; | |
return (self.loads_pending = self.load_stack.$pop());}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7)); | |
} else { | |
return nil | |
} | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
return $$$($$($nesting, 'React'), 'IsomorphicHelpers').$log("" + "ReactiveRecord.load exception raised during retry: " + (e), "error") | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_ReactiveRecord_run_blocks_to_load_8.$$arity = -2); | |
(function($base, $super, $parent_nesting) { | |
function $WhileLoading(){}; | |
var self = $WhileLoading = $klass($base, $super, 'WhileLoading', $WhileLoading); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_WhileLoading_9, TMP_WhileLoading_get_next_while_loading_counter_10, TMP_WhileLoading_preload_css_11, TMP_WhileLoading_has_observers$q_12, TMP_WhileLoading_13, TMP_WhileLoading_23, TMP_WhileLoading_24, TMP_WhileLoading_25, TMP_WhileLoading_render_28; | |
def.uniq_id = nil; | |
self.$include($$$($$($nesting, 'React'), 'IsomorphicHelpers')); | |
$send(self, 'before_first_mount', [], (TMP_WhileLoading_9 = function(){var self = TMP_WhileLoading_9.$$s || this; | |
self.css_to_preload = ""; | |
return (self.while_loading_counter = 0);}, TMP_WhileLoading_9.$$s = self, TMP_WhileLoading_9.$$arity = 0, TMP_WhileLoading_9)); | |
Opal.defs(self, '$get_next_while_loading_counter', TMP_WhileLoading_get_next_while_loading_counter_10 = function $$get_next_while_loading_counter() { | |
var self = this; | |
if (self.while_loading_counter == null) self.while_loading_counter = nil; | |
return (self.while_loading_counter = $rb_plus(self.while_loading_counter, 1)) | |
}, TMP_WhileLoading_get_next_while_loading_counter_10.$$arity = 0); | |
Opal.defs(self, '$preload_css', TMP_WhileLoading_preload_css_11 = function $$preload_css(css) { | |
var self = this; | |
if (self.css_to_preload == null) self.css_to_preload = nil; | |
return (self.css_to_preload = $rb_plus(self.css_to_preload, "" + (css) + "\n")) | |
}, TMP_WhileLoading_preload_css_11.$$arity = 1); | |
Opal.defs(self, '$has_observers?', TMP_WhileLoading_has_observers$q_12 = function() { | |
var self = this; | |
return $$$($$($nesting, 'React'), 'State')['$has_observers?'](self, "loaded_at") | |
}, TMP_WhileLoading_has_observers$q_12.$$arity = 0); | |
$send(self, 'prerender_footer', [], (TMP_WhileLoading_13 = function(){var self = TMP_WhileLoading_13.$$s || this, TMP_14; | |
if (self.css_to_preload == null) self.css_to_preload = nil; | |
return $send(((("" + "<style>\n") + (self.css_to_preload)) + "\n</style>"), 'tap', [], (TMP_14 = function(){var self = TMP_14.$$s || this; | |
return (self.css_to_preload = "")}, TMP_14.$$s = self, TMP_14.$$arity = 0, TMP_14))}, TMP_WhileLoading_13.$$s = self, TMP_WhileLoading_13.$$arity = 0, TMP_WhileLoading_13)); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
self.$include($$$($$$($$($nesting, 'Hyperloop'), 'Component'), 'Mixin')); | |
self.$param("loading"); | |
self.$param("loaded_children"); | |
self.$param("loading_children"); | |
self.$param("element_type"); | |
self.$param("element_props"); | |
self.$param("display", $hash2(["default"], {"default": ""})); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_loading$q_15, TMP_loading$B_16, TMP_loaded_at_17, TMP_quiet$q_18, TMP_page_loaded$q_19, TMP_quiet$B_21, TMP_add_style_sheet_22; | |
Opal.def(self, '$loading?', TMP_loading$q_15 = function() { | |
var self = this; | |
if (self.is_loading == null) self.is_loading = nil; | |
return self.is_loading | |
}, TMP_loading$q_15.$$arity = 0); | |
Opal.def(self, '$loading!', TMP_loading$B_16 = function() { | |
var self = this, $writer = nil; | |
$writer = [true]; | |
$send($$$($$($nesting, 'React'), 'RenderingContext'), 'waiting_on_resources=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
$$$($$($nesting, 'React'), 'State').$get_state(self, "loaded_at"); | |
return (self.is_loading = true); | |
}, TMP_loading$B_16.$$arity = 0); | |
Opal.def(self, '$loaded_at', TMP_loaded_at_17 = function $$loaded_at(loaded_at) { | |
var self = this; | |
$$$($$($nesting, 'React'), 'State').$set_state(self, "loaded_at", loaded_at); | |
return (self.is_loading = false); | |
}, TMP_loaded_at_17.$$arity = 1); | |
Opal.def(self, '$quiet?', TMP_quiet$q_18 = function() { | |
var self = this; | |
return $$$($$($nesting, 'React'), 'State').$get_state(self, "quiet") | |
}, TMP_quiet$q_18.$$arity = 0); | |
Opal.def(self, '$page_loaded?', TMP_page_loaded$q_19 = function() { | |
var self = this; | |
return $$$($$($nesting, 'React'), 'State').$get_state(self, "page_loaded") | |
}, TMP_page_loaded$q_19.$$arity = 0); | |
Opal.def(self, '$quiet!', TMP_quiet$B_21 = function() { | |
var $a, TMP_20, self = this; | |
if (self.page_loaded == null) self.page_loaded = nil; | |
$$$($$($nesting, 'React'), 'State').$set_state(self, "quiet", true); | |
if ($truthy(($truthy($a = self['$on_opal_server?']()) ? $a : self.page_loaded))) { | |
} else { | |
$send(self, 'after', [1], (TMP_20 = function(){var self = TMP_20.$$s || this; | |
return $$$($$($nesting, 'React'), 'State').$set_state(self, "page_loaded", true)}, TMP_20.$$s = self, TMP_20.$$arity = 0, TMP_20)) | |
}; | |
return (self.page_loaded = true); | |
}, TMP_quiet$B_21.$$arity = 0); | |
return (Opal.def(self, '$add_style_sheet', TMP_add_style_sheet_22 = function $$add_style_sheet() { | |
var self = this; | |
if (self.style_sheet_added == null) self.style_sheet_added = nil; | |
if ($truthy(self.style_sheet_added)) { | |
return nil | |
} else { | |
var style_el = document.createElement("style"); | |
style_el.setAttribute("type", "text/css"); | |
style_el.innerHTML = ".reactive_record_is_loading > .reactive_record_show_when_loaded { display: none; }\n" + | |
".reactive_record_is_loaded > .reactive_record_show_while_loading { display: none; }"; | |
document.head.append(style_el); | |
; | |
return (self.style_sheet_added = true); | |
} | |
}, TMP_add_style_sheet_22.$$arity = 0), nil) && 'add_style_sheet'; | |
})(Opal.get_singleton_class(self), $nesting); | |
$send(self, 'before_mount', [], (TMP_WhileLoading_23 = function(){var self = TMP_WhileLoading_23.$$s || this; | |
if (self.uniq_id == null) self.uniq_id = nil; | |
self.uniq_id = $$($nesting, 'WhileLoading').$get_next_while_loading_counter(); | |
return $$($nesting, 'WhileLoading').$preload_css($rb_plus($rb_plus("" + ".reactive_record_while_loading_container_" + (self.uniq_id) + " > :nth-child(1n+" + ($rb_plus(self.$params().$loaded_children().$count(), 1)) + ") {\n", " display: none;\n"), "}\n"));}, TMP_WhileLoading_23.$$s = self, TMP_WhileLoading_23.$$arity = 0, TMP_WhileLoading_23)); | |
$send(self, 'after_mount', [], (TMP_WhileLoading_24 = function(){var self = TMP_WhileLoading_24.$$s || this, node = nil; | |
self.waiting_on_resources = self.$params().$loading(); | |
$$($nesting, 'WhileLoading').$add_style_sheet(); | |
node = self.$dom_node(); | |
var nodes = node.querySelectorAll(':nth-child(-1n+'+self.$params().$loaded_children().$count()+')'); | |
nodes.forEach( | |
function(current_node, current_index, list_obj) { | |
if (current_node.className.indexOf('reactive_record_show_when_loaded') === -1) { | |
current_node.className = current_node.className + ' reactive_record_show_when_loaded'; | |
} | |
} | |
); | |
nodes = node.querySelectorAll(':nth-child(1n+'+$rb_plus(self.$params().$loaded_children().$count(), 1)+')'); | |
nodes.forEach( | |
function(current_node, current_index, list_obj) { | |
if (current_node.className.indexOf('reactive_record_show_while_loading') === -1) { | |
current_node.className = current_node.className + ' reactive_record_show_while_loading'; | |
} | |
} | |
); | |
;}, TMP_WhileLoading_24.$$s = self, TMP_WhileLoading_24.$$arity = 0, TMP_WhileLoading_24)); | |
$send(self, 'after_update', [], (TMP_WhileLoading_25 = function(){var self = TMP_WhileLoading_25.$$s || this; | |
return (self.waiting_on_resources = self.$params().$loading())}, TMP_WhileLoading_25.$$s = self, TMP_WhileLoading_25.$$arity = 0, TMP_WhileLoading_25)); | |
return (Opal.def(self, '$render', TMP_WhileLoading_render_28 = function $$render() { | |
var TMP_26, TMP_27, self = this, props = nil, classes = nil; | |
props = self.$params().$element_props().$dup(); | |
classes = [props['$[]']("class"), props['$[]']("className"), "" + "reactive_record_while_loading_container_" + (self.uniq_id)].$compact().$join(" "); | |
props['$merge!']($hash2(["data-reactive_record_while_loading_container_id", "data-reactive_record_enclosing_while_loading_container_id", "class"], {"data-reactive_record_while_loading_container_id": self.uniq_id, "data-reactive_record_enclosing_while_loading_container_id": self.uniq_id, "class": classes})); | |
return $send($send($$($nesting, 'React'), 'create_element', [self.$params().$element_type()['$[]'](0), props], (TMP_26 = function(){var self = TMP_26.$$s || this; | |
return $rb_plus(self.$params().$loaded_children(), self.$params().$loading_children())}, TMP_26.$$s = self, TMP_26.$$arity = 0, TMP_26)), 'tap', [], (TMP_27 = function(e){var self = TMP_27.$$s || this, $writer = nil; | |
if (e == null) e = nil; | |
$writer = [self.$params().$loading()]; | |
$send(e, 'waiting_on_resources=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_27.$$s = self, TMP_27.$$arity = 1, TMP_27)); | |
}, TMP_WhileLoading_render_28.$$arity = 0), nil) && 'render'; | |
} else { | |
return nil | |
}; | |
})($nesting[0], null, $nesting); | |
})($nesting[0], $nesting); | |
(function($base, $parent_nesting) { | |
function $React() {}; | |
var self = $React = $module($base, 'React', $React); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Element(){}; | |
var self = $Element = $klass($base, $super, 'Element', $Element); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Element_while_loading_29, TMP_Element_hide_while_loading_34; | |
Opal.def(self, '$while_loading', TMP_Element_while_loading_29 = function $$while_loading(display) { | |
var TMP_30, TMP_31, TMP_32, self = this, $iter = TMP_Element_while_loading_29.$$p, loading_display_block = $iter || nil, loaded_children = nil, loading_children = nil, new_element = nil; | |
if (display == null) { | |
display = ""; | |
} | |
if ($iter) TMP_Element_while_loading_29.$$p = null; | |
loaded_children = []; | |
if ($truthy(self.$block())) { | |
loaded_children = self.$block().$call().$dup()}; | |
if ($truthy(display['$respond_to?']("as_node"))) { | |
display = display.$as_node(); | |
loading_display_block = $send(self, 'lambda', [], (TMP_30 = function(){var self = TMP_30.$$s || this; | |
return display.$render()}, TMP_30.$$s = self, TMP_30.$$arity = 0, TMP_30)); | |
} else if ($truthy(loading_display_block['$!']())) { | |
loading_display_block = $send(self, 'lambda', [], (TMP_31 = function(){var self = TMP_31.$$s || this; | |
return display}, TMP_31.$$s = self, TMP_31.$$arity = 0, TMP_31))}; | |
loading_children = $send($$($nesting, 'RenderingContext'), 'build', [], (TMP_32 = function(buffer){var self = TMP_32.$$s || this, TMP_33, result = nil; | |
if (buffer == null) buffer = nil; | |
result = loading_display_block.$call(); | |
if ($truthy(result.$try("acts_as_string?"))) { | |
result = result.$to_s()}; | |
if ($truthy(result['$is_a?']($$($nesting, 'String')))) { | |
$send(result.$span(), 'tap', [], (TMP_33 = function(e){var self = TMP_33.$$s || this, $writer = nil; | |
if (e == null) e = nil; | |
$writer = [$$($nesting, 'RenderingContext').$waiting_on_resources()]; | |
$send(e, 'waiting_on_resources=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33))}; | |
return buffer.$dup();}, TMP_32.$$s = self, TMP_32.$$arity = 1, TMP_32)); | |
new_element = $$($nesting, 'React').$create_element($$$($$($nesting, 'ReactiveRecord'), 'WhileLoading'), $hash2(["loading", "loading_children", "loaded_children", "element_type", "element_props"], {"loading": self.$waiting_on_resources(), "loading_children": loading_children, "loaded_children": loaded_children, "element_type": [self.$type()], "element_props": self.$properties()})); | |
return $$($nesting, 'RenderingContext').$replace(self, new_element); | |
}, TMP_Element_while_loading_29.$$arity = -1); | |
return (Opal.def(self, '$hide_while_loading', TMP_Element_hide_while_loading_34 = function $$hide_while_loading() { | |
var self = this; | |
return self.$while_loading() | |
}, TMP_Element_hide_while_loading_34.$$arity = 0), nil) && 'hide_while_loading'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Component(){}; | |
var self = $Component = $klass($base, $super, 'Component', $Component); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $parent_nesting) { | |
function $Mixin() {}; | |
var self = $Mixin = $module($base, 'Mixin', $Mixin); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Mixin_component_did_mount_35, TMP_Mixin_component_did_update_36, TMP_Mixin_reactive_record_link_to_enclosing_while_loading_container_37, TMP_Mixin_reactive_record_link_set_while_loading_container_class_38; | |
self.$alias_method("original_component_did_mount", "component_did_mount"); | |
Opal.def(self, '$component_did_mount', TMP_Mixin_component_did_mount_35 = function $$component_did_mount($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
$send(self, 'original_component_did_mount', Opal.to_a(args)); | |
self.$reactive_record_link_to_enclosing_while_loading_container(); | |
return self.$reactive_record_link_set_while_loading_container_class(); | |
}, TMP_Mixin_component_did_mount_35.$$arity = -1); | |
self.$alias_method("original_component_did_update", "component_did_update"); | |
Opal.def(self, '$component_did_update', TMP_Mixin_component_did_update_36 = function $$component_did_update($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
$send(self, 'original_component_did_update', Opal.to_a(args)); | |
return self.$reactive_record_link_set_while_loading_container_class(); | |
}, TMP_Mixin_component_did_update_36.$$arity = -1); | |
Opal.def(self, '$reactive_record_link_to_enclosing_while_loading_container', TMP_Mixin_reactive_record_link_to_enclosing_while_loading_container_37 = function $$reactive_record_link_to_enclosing_while_loading_container() { | |
var self = this, node = nil; | |
node = self.$dom_node(); | |
if (typeof node === "undefined" || node === null) return; | |
var node_wl_attr = node.getAttribute('data-reactive_record_enclosing_while_loading_container_id'); | |
if (node_wl_attr === null || node_wl_attr === "") { | |
var while_loading_container = node.closest('[data-reactive_record_while_loading_container_id]'); | |
if (while_loading_container !== null) { | |
var container_id = while_loading_container.getAttribute('data-reactive_record_while_loading_container_id'); | |
node.setAttribute('data-reactive_record_enclosing_while_loading_container_id', container_id); | |
} | |
} | |
; | |
}, TMP_Mixin_reactive_record_link_to_enclosing_while_loading_container_37.$$arity = 0); | |
Opal.def(self, '$reactive_record_link_set_while_loading_container_class', TMP_Mixin_reactive_record_link_set_while_loading_container_class_38 = function $$reactive_record_link_set_while_loading_container_class() { | |
var self = this, node = nil, loading = nil; | |
node = self.$dom_node(); | |
loading = (function() {if ($truthy(self.$waiting_on_resources())) { | |
return true; | |
} else { | |
return false; | |
}; return nil; })(); | |
if (typeof node === "undefined" || node === null) return; | |
var while_loading_container_id = node.getAttribute('data-reactive_record_while_loading_container_id'); | |
if (self['$is_a?']($$$($$($nesting, 'ReactiveRecord'), 'WhileLoading'))['$!']() && while_loading_container_id !== null && while_loading_container_id !== "") { | |
return; | |
} | |
var enc_while_loading_container_id = node.getAttribute('data-reactive_record_enclosing_while_loading_container_id'); | |
if (enc_while_loading_container_id !== null && enc_while_loading_container_id !== "") { | |
var while_loading_container = document.body.querySelector('[data-reactive_record_while_loading_container_id="'+enc_while_loading_container_id+'"]'); | |
if (loading) { | |
node.className = node.className.replace(/reactive_record_is_loaded/g, '').replace(/ /g, ' '); | |
if (node.className.indexOf('reactive_record_is_loading') === -1) { | |
node.className = node.className + ' reactive_record_is_loading'; | |
} | |
if (while_loading_container !== null) { | |
while_loading_container.className = while_loading_container.className.replace(/reactive_record_is_loaded/g, '').replace(/ /g, ' '); | |
if (while_loading_container.className.indexOf('reactive_record_is_loading') === -1) { | |
while_loading_container.className = while_loading_container.className + ' reactive_record_is_loading'; | |
} | |
} | |
} else if (node.className.indexOf('reactive_record_is_loaded') === -1) { | |
if (while_loading_container_id === null || while_loading_container_id === "") { | |
node.className = node.className.replace(/reactive_record_is_loading/g, '').replace(/ /g, ' '); | |
if (node.className.indexOf('reactive_record_is_loaded') === -1) { | |
node.className = node.className + ' reactive_record_is_loaded'; | |
} | |
} | |
if (while_loading_container.className.indexOf('reactive_record_is_loaded') === -1) { | |
var loading_children = while_loading_container.querySelectorAll('[data-reactive_record_enclosing_while_loading_container_id="'+enc_while_loading_container_id+'"].reactive_record_is_loading'); | |
if (loading_children.length === 0) { | |
while_loading_container.className = while_loading_container.className.replace(/reactive_record_is_loading/g, '').replace(/ /g, ' '); | |
if (while_loading_container.className.indexOf('reactive_record_is_loaded') === -1) { | |
while_loading_container.className = while_loading_container.className + ' reactive_record_is_loaded'; | |
} | |
} | |
} | |
} | |
} | |
; | |
}, TMP_Mixin_reactive_record_link_set_while_loading_container_class_38.$$arity = 0); | |
})($nesting[0], $nesting) | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} else { | |
return nil | |
}; | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record_error.rb": | |
/*!*************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/active_record_error.rb ***! | |
\*************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/active_record_error"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; | |
return (function($base, $parent_nesting) { | |
function $ActiveRecord() {}; | |
var self = $ActiveRecord = $module($base, 'ActiveRecord', $ActiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ActiveRecordError(){}; | |
var self = $ActiveRecordError = $klass($base, $super, 'ActiveRecordError', $ActiveRecordError); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return nil | |
})($nesting[0], $$($nesting, 'StandardError'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/broadcast.rb": | |
/*!***************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/broadcast.rb ***! | |
\***************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/broadcast"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$==', '$param', '$on_dispatch', '$receive', '$[]', '$in_transit', '$broadcast_id', '$operation', '$sync_scopes', '$process_previous_changes', '$new?', '$destroyed?', '$local', '$new', '$sync!', '$backing_record', '$load_data', '$find', '$klass', '$record', '$ar_instance', '$merge_current_values', '$tap', '$_react_param_conversion', '$destroy_associations', '$initialize_collections', '$const_get', '$attr_reader', '$[]=', '$-', '$name', '$class', '$destroyed=', '$id', '$changes', '$intersection', '$open_channels', '$channels', '$<<', '$channel', '$merge!', '$previous_changes', '$when_not_saving', '$exists?', '$!', '$complete!', '$delete', '$synced_attributes', '$primary_key', '$key?', '$!=', '$convert', '$reflect_on_association_by_foreign_key', '$attribute', '$each', '$last', '$log', '$raise', '$integrity_check', '$dup', '$value_changed?', '$flatten', '$compact', '$collect', '$first', '$attributes', '$merge']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Broadcast(){}; | |
var self = $Broadcast = $klass($base, $super, 'Broadcast', $Broadcast); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Broadcast_1, TMP_Broadcast_to_self_3, TMP_Broadcast_record_with_current_values_5, TMP_Broadcast_record_with_new_values_7, TMP_Broadcast_new$q_8, TMP_Broadcast_destroyed$q_9, TMP_Broadcast_klass_10, TMP_Broadcast_to_s_11, TMP_Broadcast_open_channels_12, TMP_Broadcast_in_transit_14, TMP_Broadcast_initialize_15, TMP_Broadcast_local_16, TMP_Broadcast_receive_18, TMP_Broadcast_complete$B_19, TMP_Broadcast_value_changed$q_20, TMP_Broadcast_integrity_check_22, TMP_Broadcast_process_previous_changes_24, TMP_Broadcast_merge_current_values_26; | |
def.is_new = def.destroyed = def.klass = def.record = def.channels = def.received = def.previous_changes = def.id = def.backing_record = nil; | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
} else { | |
nil | |
}; | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
} else { | |
nil | |
}; | |
(function($base, $super, $parent_nesting) { | |
function $SendPacket(){}; | |
var self = $SendPacket = $klass($base, $super, 'SendPacket', $SendPacket); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
self.$param($hash2(["authorization", "nils"], {"authorization": nil, "nils": true})); | |
self.$param($hash2(["salt"], {"salt": nil})); | |
self.$param("operation"); | |
self.$param("broadcast_id"); | |
self.$param("channel"); | |
self.$param("channels"); | |
self.$param("klass"); | |
self.$param("record"); | |
self.$param("operation"); | |
self.$param("previous_changes"); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
return nil | |
} else { | |
return nil | |
}; | |
})($nesting[0], $$$($$($nesting, 'Hyperloop'), 'ServerOp'), $nesting); | |
$send($$($nesting, 'SendPacket'), 'on_dispatch', [], (TMP_Broadcast_1 = function(params){var self = TMP_Broadcast_1.$$s || this, TMP_2; | |
if (params == null) params = nil; | |
return $send(self.$in_transit()['$[]'](params.$broadcast_id()), 'receive', [params], (TMP_2 = function(broadcast){var self = TMP_2.$$s || this; | |
if (broadcast == null) broadcast = nil; | |
if (params.$operation()['$==']("destroy")) { | |
return $$$($$($nesting, 'ReactiveRecord'), 'Collection').$sync_scopes(broadcast) | |
} else { | |
return $$$($$($nesting, 'ReactiveRecord'), 'Collection').$sync_scopes(broadcast.$process_previous_changes()) | |
}}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2))}, TMP_Broadcast_1.$$s = self, TMP_Broadcast_1.$$arity = 1, TMP_Broadcast_1)); | |
Opal.defs(self, '$to_self', TMP_Broadcast_to_self_3 = function $$to_self(record, data) { | |
var self = this, operation = nil, dummy_broadcast = nil; | |
if (data == null) { | |
data = $hash2([], {}); | |
} | |
operation = (function() {if ($truthy(record['$new?']())) { | |
return "create" | |
} else if ($truthy(record['$destroyed?']())) { | |
return "destroy" | |
} else { | |
return "change" | |
}; return nil; })(); | |
dummy_broadcast = self.$new().$local(operation, record, data); | |
if (operation['$==']("destroy")) { | |
} else { | |
record.$backing_record()['$sync!'](data) | |
}; | |
return $$$($$($nesting, 'ReactiveRecord'), 'Collection').$sync_scopes(dummy_broadcast); | |
}, TMP_Broadcast_to_self_3.$$arity = -2); | |
Opal.def(self, '$record_with_current_values', TMP_Broadcast_record_with_current_values_5 = function $$record_with_current_values() { | |
var TMP_4, self = this; | |
return $send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'load_data', [], (TMP_4 = function(){var self = TMP_4.$$s || this, $a, backing_record = nil; | |
if (self.backing_record == null) self.backing_record = nil; | |
backing_record = ($truthy($a = self.backing_record) ? $a : self.$klass().$find(self.$record()['$[]']("id")).$backing_record()); | |
if ($truthy(self['$destroyed?']())) { | |
return backing_record.$ar_instance() | |
} else { | |
return self.$merge_current_values(backing_record) | |
};}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4)) | |
}, TMP_Broadcast_record_with_current_values_5.$$arity = 0); | |
Opal.def(self, '$record_with_new_values', TMP_Broadcast_record_with_new_values_7 = function $$record_with_new_values() { | |
var TMP_6, self = this; | |
return $send(self.$klass().$_react_param_conversion(self.$record()), 'tap', [], (TMP_6 = function(ar_instance){var self = TMP_6.$$s || this; | |
if (ar_instance == null) ar_instance = nil; | |
if ($truthy(self['$destroyed?']())) { | |
return ar_instance.$backing_record().$destroy_associations() | |
} else if ($truthy(self['$new?']())) { | |
return ar_instance.$backing_record().$initialize_collections() | |
} else { | |
return nil | |
}}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6)) | |
}, TMP_Broadcast_record_with_new_values_7.$$arity = 0); | |
Opal.def(self, '$new?', TMP_Broadcast_new$q_8 = function() { | |
var self = this; | |
return self.is_new | |
}, TMP_Broadcast_new$q_8.$$arity = 0); | |
Opal.def(self, '$destroyed?', TMP_Broadcast_destroyed$q_9 = function() { | |
var self = this; | |
return self.destroyed | |
}, TMP_Broadcast_destroyed$q_9.$$arity = 0); | |
Opal.def(self, '$klass', TMP_Broadcast_klass_10 = function $$klass() { | |
var self = this; | |
return $$($nesting, 'Object').$const_get(self.klass) | |
}, TMP_Broadcast_klass_10.$$arity = 0); | |
Opal.def(self, '$to_s', TMP_Broadcast_to_s_11 = function $$to_s() { | |
var self = this; | |
return "" + "klass: " + (self.$klass()) + " record: " + (self.$record()) + " new?: " + (self['$new?']()) + " destroyed?: " + (self['$destroyed?']()) | |
}, TMP_Broadcast_to_s_11.$$arity = 0); | |
self.$attr_reader("record"); | |
Opal.defs(self, '$open_channels', TMP_Broadcast_open_channels_12 = function $$open_channels() { | |
var $a, self = this; | |
if (self.open_channels == null) self.open_channels = nil; | |
return (self.open_channels = ($truthy($a = self.open_channels) ? $a : $$($nesting, 'Set').$new())) | |
}, TMP_Broadcast_open_channels_12.$$arity = 0); | |
Opal.defs(self, '$in_transit', TMP_Broadcast_in_transit_14 = function $$in_transit() { | |
var $a, TMP_13, self = this; | |
if (self.in_transit == null) self.in_transit = nil; | |
return (self.in_transit = ($truthy($a = self.in_transit) ? $a : $send($$($nesting, 'Hash'), 'new', [], (TMP_13 = function(h, k){var self = TMP_13.$$s || this, $writer = nil; | |
if (h == null) h = nil;if (k == null) k = nil; | |
$writer = [k, self.$new(k)]; | |
$send(h, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13)))) | |
}, TMP_Broadcast_in_transit_14.$$arity = 0); | |
Opal.def(self, '$initialize', TMP_Broadcast_initialize_15 = function $$initialize(id) { | |
var self = this; | |
self.id = id; | |
self.received = $$($nesting, 'Set').$new(); | |
self.record = $hash2([], {}); | |
return (self.previous_changes = $hash2([], {})); | |
}, TMP_Broadcast_initialize_15.$$arity = 1); | |
Opal.def(self, '$local', TMP_Broadcast_local_16 = function $$local(operation, record, data) { | |
var self = this, $writer = nil; | |
self.destroyed = operation['$==']("destroy"); | |
self.is_new = operation['$==']("create"); | |
self.klass = record.$class().$name(); | |
self.record = data; | |
$writer = [false]; | |
$send(record.$backing_record(), 'destroyed=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
if ($truthy(record.$id())) { | |
$writer = ["id", record.$id()]; | |
$send(self.record, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
$writer = [self.destroyed]; | |
$send(record.$backing_record(), 'destroyed=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
self.backing_record = record.$backing_record(); | |
self.previous_changes = record.$changes(); | |
return self; | |
}, TMP_Broadcast_local_16.$$arity = 3); | |
Opal.def(self, '$receive', TMP_Broadcast_receive_18 = function $$receive(params) { | |
var $a, TMP_17, self = this, $iter = TMP_Broadcast_receive_18.$$p, $yield = $iter || nil; | |
if ($iter) TMP_Broadcast_receive_18.$$p = null; | |
self.destroyed = params.$operation()['$==']("destroy"); | |
self.channels = ($truthy($a = self.channels) ? $a : $$$($$($nesting, 'Hyperloop'), 'IncomingBroadcast').$open_channels().$intersection(params.$channels())); | |
self.received['$<<'](params.$channel()); | |
self.klass = ($truthy($a = self.klass) ? $a : params.$klass()); | |
self.record['$merge!'](params.$record()); | |
self.previous_changes['$merge!'](params.$previous_changes()); | |
return $send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'when_not_saving', [self.$klass()], (TMP_17 = function(){var self = TMP_17.$$s || this, $b; | |
if (self.backing_record == null) self.backing_record = nil; | |
if (self.channels == null) self.channels = nil; | |
if (self.received == null) self.received = nil; | |
self.backing_record = $$$($$($nesting, 'ReactiveRecord'), 'Base')['$exists?'](self.$klass(), params.$record()['$[]']("id")); | |
self.is_new = (($b = params.$operation()['$==']("create")) ? self.backing_record['$!']() : params.$operation()['$==']("create")); | |
if (self.channels['$=='](self.received)) { | |
return Opal.yield1($yield, self['$complete!']()); | |
} else { | |
return nil | |
};}, TMP_17.$$s = self, TMP_17.$$arity = 0, TMP_17)); | |
}, TMP_Broadcast_receive_18.$$arity = 1); | |
Opal.def(self, '$complete!', TMP_Broadcast_complete$B_19 = function() { | |
var self = this; | |
return self.$class().$in_transit().$delete(self.id) | |
}, TMP_Broadcast_complete$B_19.$$arity = 0); | |
Opal.def(self, '$value_changed?', TMP_Broadcast_value_changed$q_20 = function(attr, value) { | |
var self = this, attrs = nil, assoc = nil, child = nil; | |
attrs = self.backing_record.$synced_attributes(); | |
if (attr['$=='](self.backing_record.$primary_key())) { | |
return true}; | |
if ($truthy(attrs['$key?'](attr))) { | |
return attrs['$[]'](attr)['$!='](self.backing_record.$convert(attr, value))}; | |
assoc = self.$klass().$reflect_on_association_by_foreign_key(attr); | |
if ($truthy(assoc)) { | |
} else { | |
return value | |
}; | |
child = attrs['$[]'](assoc.$attribute()); | |
if ($truthy(child)) { | |
return value['$!='](child.$id())}; | |
return value; | |
}, TMP_Broadcast_value_changed$q_20.$$arity = 2); | |
Opal.def(self, '$integrity_check', TMP_Broadcast_integrity_check_22 = function $$integrity_check() { | |
var TMP_21, self = this; | |
return $send(self.previous_changes, 'each', [], (TMP_21 = function(attr, value){var self = TMP_21.$$s || this, $a; | |
if (self.record == null) self.record = nil; | |
if (attr == null) attr = nil;if (value == null) value = nil; | |
if ($truthy(($truthy($a = self.record['$key?'](attr)) ? self.record['$[]'](attr)['$=='](value.$last()) : $a))) { | |
return nil;}; | |
$$$($$($nesting, 'React'), 'IsomorphicHelpers').$log("" + ("" + "Broadcast contained change to " + (attr) + " -> " + (value.$last()) + " ") + ("" + "without corresponding value in attributes (" + (self.record) + ").\n"), "error"); | |
return self.$raise("Broadcast Integrity Error");}, TMP_21.$$s = self, TMP_21.$$arity = 2, TMP_21)) | |
}, TMP_Broadcast_integrity_check_22.$$arity = 0); | |
Opal.def(self, '$process_previous_changes', TMP_Broadcast_process_previous_changes_24 = function $$process_previous_changes() { | |
var TMP_23, self = this; | |
if ($truthy(self.backing_record)) { | |
} else { | |
return self | |
}; | |
self.$integrity_check(); | |
if ($truthy(self['$destroyed?']())) { | |
return self}; | |
$send(self.record.$dup(), 'each', [], (TMP_23 = function(attr, value){var self = TMP_23.$$s || this; | |
if (self.record == null) self.record = nil; | |
if (self.previous_changes == null) self.previous_changes = nil; | |
if (attr == null) attr = nil;if (value == null) value = nil; | |
if ($truthy(self['$value_changed?'](attr, value))) { | |
return nil;}; | |
self.record.$delete(attr); | |
return self.previous_changes.$delete(attr);}, TMP_23.$$s = self, TMP_23.$$arity = 2, TMP_23)); | |
return self; | |
}, TMP_Broadcast_process_previous_changes_24.$$arity = 0); | |
return (Opal.def(self, '$merge_current_values', TMP_Broadcast_merge_current_values_26 = function $$merge_current_values(br) {try { | |
var TMP_25, self = this, current_values = nil; | |
current_values = $send($$($nesting, 'Hash'), '[]', Opal.to_a($send(self.previous_changes, 'collect', [], (TMP_25 = function(attr, values){var self = TMP_25.$$s || this, $a, $b, value = nil; | |
if (attr == null) attr = nil;if (values == null) values = nil; | |
value = (function() {if (attr['$==']("id")) { | |
return self.$record()['$[]']("id") | |
} else { | |
return values.$first() | |
}; return nil; })(); | |
if ($truthy(($truthy($a = ($truthy($b = br.$attributes()['$key?'](attr)) ? br.$attributes()['$[]'](attr)['$!='](br.$convert(attr, value)) : $b)) ? br.$attributes()['$[]'](attr)['$!='](br.$convert(attr, values.$last())) : $a))) { | |
$$$($$($nesting, 'React'), 'IsomorphicHelpers').$log("" + ("" + "warning " + (attr) + " has changed locally - will force a reload.\n") + ("" + "local value: " + (br.$attributes()['$[]'](attr)) + " remote value: " + (br.$convert(attr, value)) + "->" + (br.$convert(attr, values.$last()))), "warning"); | |
Opal.ret(nil);}; | |
return [attr, value];}, TMP_25.$$s = self, TMP_25.$$arity = 2, TMP_25)).$compact().$flatten())); | |
return self.$klass().$_react_param_conversion(br.$attributes().$merge(current_values)); | |
} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } | |
}, TMP_Broadcast_merge_current_values_26.$$arity = 1), nil) && 'merge_current_values'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/interval.rb": | |
/*!**************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/interval.rb ***! | |
\**************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/interval"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send, $gvars = Opal.gvars; | |
Opal.add_stubs(['$attr_reader', '$convert', '$nil?', '$stopped?', '$aborted?', '$raise', '$call', '$tap', '$new', '$to_proc', '$every', '$every!', '$to_n', '$after', '$after!']); | |
(function($base, $parent_nesting) { | |
function $Browser() {}; | |
var self = $Browser = $module($base, 'Browser', $Browser); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Interval(){}; | |
var self = $Interval = $klass($base, $super, 'Interval', $Interval); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Interval_initialize_1, TMP_Interval_stopped$q_2, TMP_Interval_aborted$q_3, TMP_Interval_abort_4, TMP_Interval_stop_5, TMP_Interval_start_6, TMP_Interval_call_7; | |
def.id = def.aborted = def.window = def.block = def.every = nil; | |
self.$attr_reader("every"); | |
Opal.def(self, '$initialize', TMP_Interval_initialize_1 = function $$initialize(window, time) { | |
var self = this, $iter = TMP_Interval_initialize_1.$$p, block = $iter || nil; | |
if ($iter) TMP_Interval_initialize_1.$$p = null; | |
self.window = $$($nesting, 'Native').$convert(window); | |
self.every = time; | |
self.block = block; | |
return (self.aborted = false); | |
}, TMP_Interval_initialize_1.$$arity = 2); | |
Opal.def(self, '$stopped?', TMP_Interval_stopped$q_2 = function() { | |
var self = this; | |
return self.id['$nil?']() | |
}, TMP_Interval_stopped$q_2.$$arity = 0); | |
Opal.def(self, '$aborted?', TMP_Interval_aborted$q_3 = function() { | |
var self = this; | |
return self.aborted | |
}, TMP_Interval_aborted$q_3.$$arity = 0); | |
Opal.def(self, '$abort', TMP_Interval_abort_4 = function $$abort() { | |
var self = this; | |
self.window.clearInterval(self.id); | |
self.aborted = true; | |
return (self.id = nil); | |
}, TMP_Interval_abort_4.$$arity = 0); | |
Opal.def(self, '$stop', TMP_Interval_stop_5 = function $$stop() { | |
var self = this; | |
if ($truthy(self['$stopped?']())) { | |
return nil}; | |
self.window.clearInterval(self.id); | |
self.stopped = true; | |
return (self.id = nil); | |
}, TMP_Interval_stop_5.$$arity = 0); | |
Opal.def(self, '$start', TMP_Interval_start_6 = function $$start() { | |
var self = this; | |
if ($truthy(self['$aborted?']())) { | |
self.$raise("the interval has been aborted")}; | |
if ($truthy(self['$stopped?']())) { | |
} else { | |
return nil | |
}; | |
return (self.id = self.window.setInterval(self.block, self.every * 1000)); | |
}, TMP_Interval_start_6.$$arity = 0); | |
return (Opal.def(self, '$call', TMP_Interval_call_7 = function $$call() { | |
var self = this; | |
return self.block.$call() | |
}, TMP_Interval_call_7.$$arity = 0), nil) && 'call'; | |
})($nesting[0], null, $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Window(){}; | |
var self = $Window = $klass($base, $super, 'Window', $Window); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Window_every_8, TMP_Window_every$B_9; | |
def["native"] = nil; | |
Opal.def(self, '$every', TMP_Window_every_8 = function $$every(time) { | |
var self = this, $iter = TMP_Window_every_8.$$p, block = $iter || nil; | |
if ($iter) TMP_Window_every_8.$$p = null; | |
return $send($send($$($nesting, 'Interval'), 'new', [self["native"], time], block.$to_proc()), 'tap', [], "start".$to_proc()) | |
}, TMP_Window_every_8.$$arity = 1); | |
return (Opal.def(self, '$every!', TMP_Window_every$B_9 = function(time) { | |
var self = this, $iter = TMP_Window_every$B_9.$$p, block = $iter || nil; | |
if ($iter) TMP_Window_every$B_9.$$p = null; | |
return $send($$($nesting, 'Interval'), 'new', [self["native"], time], block.$to_proc()) | |
}, TMP_Window_every$B_9.$$arity = 1), nil) && 'every!'; | |
})($nesting[0], null, $nesting); | |
})($nesting[0], $nesting); | |
(function($base, $parent_nesting) { | |
function $Kernel() {}; | |
var self = $Kernel = $module($base, 'Kernel', $Kernel); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Kernel_every_10, TMP_Kernel_every$B_11; | |
Opal.def(self, '$every', TMP_Kernel_every_10 = function $$every(time) { | |
var self = this, $iter = TMP_Kernel_every_10.$$p, block = $iter || nil; | |
if ($gvars.window == null) $gvars.window = nil; | |
if ($iter) TMP_Kernel_every_10.$$p = null; | |
return $send($gvars.window, 'every', [time], block.$to_proc()) | |
}, TMP_Kernel_every_10.$$arity = 1); | |
Opal.def(self, '$every!', TMP_Kernel_every$B_11 = function(time) { | |
var self = this, $iter = TMP_Kernel_every$B_11.$$p, block = $iter || nil; | |
if ($gvars.window == null) $gvars.window = nil; | |
if ($iter) TMP_Kernel_every$B_11.$$p = null; | |
return $send($gvars.window, 'every!', [time], block.$to_proc()) | |
}, TMP_Kernel_every$B_11.$$arity = 1); | |
})($nesting[0], $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Proc(){}; | |
var self = $Proc = $klass($base, $super, 'Proc', $Proc); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Proc_every_12, TMP_Proc_every$B_13; | |
Opal.def(self, '$every', TMP_Proc_every_12 = function $$every(time) { | |
var self = this; | |
if ($gvars.window == null) $gvars.window = nil; | |
return $send($gvars.window, 'every', [time], self.$to_proc()) | |
}, TMP_Proc_every_12.$$arity = 1); | |
return (Opal.def(self, '$every!', TMP_Proc_every$B_13 = function(time) { | |
var self = this; | |
if ($gvars.window == null) $gvars.window = nil; | |
return $send($gvars.window, 'every!', [time], self.$to_proc()) | |
}, TMP_Proc_every$B_13.$$arity = 1), nil) && 'every!'; | |
})($nesting[0], null, $nesting); | |
(function($base, $parent_nesting) { | |
function $Browser() {}; | |
var self = $Browser = $module($base, 'Browser', $Browser); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Delay(){}; | |
var self = $Delay = $klass($base, $super, 'Delay', $Delay); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Delay_initialize_14, TMP_Delay_abort_15, TMP_Delay_start_16; | |
def.window = def.id = def.block = def.after = nil; | |
self.$attr_reader("after"); | |
Opal.def(self, '$initialize', TMP_Delay_initialize_14 = function $$initialize(window, time) { | |
var self = this, $iter = TMP_Delay_initialize_14.$$p, block = $iter || nil; | |
if ($iter) TMP_Delay_initialize_14.$$p = null; | |
self.window = $$($nesting, 'Native').$convert(window); | |
self.after = time; | |
return (self.block = block); | |
}, TMP_Delay_initialize_14.$$arity = 2); | |
Opal.def(self, '$abort', TMP_Delay_abort_15 = function $$abort() { | |
var self = this; | |
return self.window.clearTimeout(self.id) | |
}, TMP_Delay_abort_15.$$arity = 0); | |
return (Opal.def(self, '$start', TMP_Delay_start_16 = function $$start() { | |
var self = this; | |
return (self.id = self.window.setTimeout(self.block.$to_n(), self.after * 1000)) | |
}, TMP_Delay_start_16.$$arity = 0), nil) && 'start'; | |
})($nesting[0], null, $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Window(){}; | |
var self = $Window = $klass($base, $super, 'Window', $Window); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Window_after_17, TMP_Window_after$B_18; | |
def["native"] = nil; | |
Opal.def(self, '$after', TMP_Window_after_17 = function $$after(time) { | |
var self = this, $iter = TMP_Window_after_17.$$p, block = $iter || nil; | |
if ($iter) TMP_Window_after_17.$$p = null; | |
return $send($send($$($nesting, 'Delay'), 'new', [self["native"], time], block.$to_proc()), 'tap', [], "start".$to_proc()) | |
}, TMP_Window_after_17.$$arity = 1); | |
return (Opal.def(self, '$after!', TMP_Window_after$B_18 = function(time) { | |
var self = this, $iter = TMP_Window_after$B_18.$$p, block = $iter || nil; | |
if ($iter) TMP_Window_after$B_18.$$p = null; | |
return $send($$($nesting, 'Delay'), 'new', [self["native"], time], block.$to_proc()) | |
}, TMP_Window_after$B_18.$$arity = 1), nil) && 'after!'; | |
})($nesting[0], null, $nesting); | |
})($nesting[0], $nesting); | |
(function($base, $parent_nesting) { | |
function $Kernel() {}; | |
var self = $Kernel = $module($base, 'Kernel', $Kernel); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Kernel_after_19, TMP_Kernel_after$B_20; | |
Opal.def(self, '$after', TMP_Kernel_after_19 = function $$after(time) { | |
var self = this, $iter = TMP_Kernel_after_19.$$p, block = $iter || nil; | |
if ($iter) TMP_Kernel_after_19.$$p = null; | |
return setTimeout(block.$to_n(), time * 1000) | |
}, TMP_Kernel_after_19.$$arity = 1); | |
Opal.def(self, '$after!', TMP_Kernel_after$B_20 = function(time) { | |
var self = this, $iter = TMP_Kernel_after$B_20.$$p, block = $iter || nil; | |
if ($iter) TMP_Kernel_after$B_20.$$p = null; | |
return setTimeout(block.$to_n(), time * 1000) | |
}, TMP_Kernel_after$B_20.$$arity = 1); | |
})($nesting[0], $nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Proc(){}; | |
var self = $Proc = $klass($base, $super, 'Proc', $Proc); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Proc_after_21, TMP_Proc_after$B_22; | |
Opal.def(self, '$after', TMP_Proc_after_21 = function $$after(time) { | |
var self = this; | |
if ($gvars.window == null) $gvars.window = nil; | |
return $send($gvars.window, 'after', [time], self.$to_proc()) | |
}, TMP_Proc_after_21.$$arity = 1); | |
return (Opal.def(self, '$after!', TMP_Proc_after$B_22 = function(time) { | |
var self = this; | |
if ($gvars.window == null) $gvars.window = nil; | |
return $send($gvars.window, 'after!', [time], self.$to_proc()) | |
}, TMP_Proc_after$B_22.$$arity = 1), nil) && 'after!'; | |
})($nesting[0], null, $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/scope_description.rb": | |
/*!***********************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/scope_description.rb ***! | |
\***********************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/scope_description"] = function(Opal) { | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2, $hash = Opal.hash; | |
Opal.add_stubs(['$filter_proc', '$send', '$singleton_class', '$build_joins', '$[]', '$attr_reader', '$gsub', '$respond_to?', '$detect', '$any?', '$==', '$class', '$<', '$key?', '$base_class', '$catch_db_requests', '$compact', '$flatten', '$collect', '$get_joins', '$crawl', '$collector?', '$new', '$instance_exec', '$to_a', '$to_proc', '$select', '$!', '$raise', '$nil?', '$is_a?', '$map_joins_path', '$merge', '$[]=', '$-', '$each', '$inject', '$split', '$reflect_on_association', '$build_error', '$inverse_of', '$<<', '$klass', '$name', '$all']); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ScopeDescription(){}; | |
var self = $ScopeDescription = $klass($base, $super, 'ScopeDescription', $ScopeDescription); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ScopeDescription_initialize_2, TMP_ScopeDescription_find_3, TMP_ScopeDescription_filter$q_4, TMP_ScopeDescription_collector$q_5, TMP_ScopeDescription_joins_with$q_7, TMP_ScopeDescription_get_joins_8, TMP_ScopeDescription_related_records_for_11, TMP_ScopeDescription_filter_records_13, TMP_ScopeDescription_filter_proc_14, TMP_ScopeDescription_build_joins_15, TMP_ScopeDescription_map_joins_path_19, TMP_ScopeDescription_build_error_20, TMP_ScopeDescription_crawl_22; | |
def.name = def.filter_proc = def.is_collector = def.joins = def.model = nil; | |
Opal.def(self, '$initialize', TMP_ScopeDescription_initialize_2 = function $$initialize(model, name, opts) { | |
var TMP_1, self = this, sself = nil; | |
sself = self; | |
self.filter_proc = self.$filter_proc(opts); | |
self.name = name; | |
$send(model.$singleton_class(), 'send', ["define_method", "" + "_" + (self.name) + "_synchromesh_scope_description_"], (TMP_1 = function(){var self = TMP_1.$$s || this; | |
return sself}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1)); | |
self.model = model; | |
return self.$build_joins(opts['$[]']("joins")); | |
}, TMP_ScopeDescription_initialize_2.$$arity = 3); | |
self.$attr_reader("name"); | |
Opal.defs(self, '$find', TMP_ScopeDescription_find_3 = function $$find(target_model, name) { | |
var self = this; | |
try { | |
name = name.$gsub(/!$/, ""); | |
return target_model.$send("" + "_" + (name) + "_synchromesh_scope_description_"); | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return nil | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_ScopeDescription_find_3.$$arity = 2); | |
Opal.def(self, '$filter?', TMP_ScopeDescription_filter$q_4 = function() { | |
var self = this; | |
return self.filter_proc['$respond_to?']("call") | |
}, TMP_ScopeDescription_filter$q_4.$$arity = 0); | |
Opal.def(self, '$collector?', TMP_ScopeDescription_collector$q_5 = function() { | |
var self = this; | |
return self.is_collector | |
}, TMP_ScopeDescription_collector$q_5.$$arity = 0); | |
Opal.def(self, '$joins_with?', TMP_ScopeDescription_joins_with$q_7 = function(record) { | |
var TMP_6, self = this; | |
return $send(self.joins, 'detect', [], (TMP_6 = function(klass, vector){var self = TMP_6.$$s || this, $a, $b, $c; | |
if (klass == null) klass = nil;if (vector == null) vector = nil; | |
if ($truthy(vector['$any?']())) { | |
} else { | |
return nil; | |
}; | |
return ($truthy($a = ($truthy($b = ($truthy($c = klass['$==']("all")) ? $c : record.$class()['$=='](klass))) ? $b : $rb_lt(record.$class(), klass))) ? $a : $rb_lt(klass, record.$class()));;}, TMP_6.$$s = self, TMP_6.$$arity = 2, TMP_6)) | |
}, TMP_ScopeDescription_joins_with$q_7.$$arity = 1); | |
Opal.def(self, '$get_joins', TMP_ScopeDescription_get_joins_8 = function $$get_joins(klass) { | |
var $a, self = this, joins = nil; | |
if ($truthy(self.joins['$key?'](klass))) { | |
joins = self.joins['$[]'](klass)}; | |
if ($truthy(self.joins['$key?'](klass.$base_class()))) { | |
joins = ($truthy($a = joins) ? $a : self.joins['$[]'](klass.$base_class()))}; | |
return ($truthy($a = joins) ? $a : self.joins['$[]']("all")); | |
}, TMP_ScopeDescription_get_joins_8.$$arity = 1); | |
Opal.def(self, '$related_records_for', TMP_ScopeDescription_related_records_for_11 = function $$related_records_for(record) { | |
var TMP_9, self = this; | |
return $send($$$($$($nesting, 'ReactiveRecord'), 'Base'), 'catch_db_requests', [[]], (TMP_9 = function(){var self = TMP_9.$$s || this, TMP_10; | |
return $send(self.$get_joins(record.$class()), 'collect', [], (TMP_10 = function(vector){var self = TMP_10.$$s || this; | |
if (vector == null) vector = nil; | |
return $send(self, 'crawl', [record].concat(Opal.to_a(vector)))}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10)).$flatten().$compact()}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9)) | |
}, TMP_ScopeDescription_related_records_for_11.$$arity = 1); | |
Opal.def(self, '$filter_records', TMP_ScopeDescription_filter_records_13 = function $$filter_records(related_records, args) { | |
var TMP_12, self = this; | |
if ($truthy(self['$collector?']())) { | |
return $$($nesting, 'Set').$new($send(related_records.$to_a(), 'instance_exec', Opal.to_a(args), self.filter_proc.$to_proc())) | |
} else { | |
return $$($nesting, 'Set').$new($send(related_records, 'select', [], (TMP_12 = function(r){var self = TMP_12.$$s || this; | |
if (self.filter_proc == null) self.filter_proc = nil; | |
if (r == null) r = nil; | |
return $send(r, 'instance_exec', Opal.to_a(args), self.filter_proc.$to_proc())}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12))) | |
} | |
}, TMP_ScopeDescription_filter_records_13.$$arity = 2); | |
Opal.def(self, '$filter_proc', TMP_ScopeDescription_filter_proc_14 = function $$filter_proc(opts) { | |
var $a, self = this, client_opt = nil; | |
if ($truthy(($truthy($a = opts['$key?']("client")) ? $a : opts['$key?']("select")))) { | |
} else { | |
return true | |
}; | |
client_opt = ($truthy($a = opts['$[]']("client")) ? $a : opts['$[]']("select")); | |
self.is_collector = opts['$key?']("select"); | |
if ($truthy(($truthy($a = client_opt['$!']()) ? $a : client_opt['$respond_to?']("call")))) { | |
return client_opt}; | |
return self.$raise("Scope option :client or :select must be a proc, false, or nil"); | |
}, TMP_ScopeDescription_filter_proc_14.$$arity = 1); | |
Opal.def(self, '$build_joins', TMP_ScopeDescription_build_joins_15 = function $$build_joins(joins_list) { | |
var $a, self = this, klass = nil; | |
if ($truthy(($truthy($a = self.filter_proc['$!']()) ? $a : joins_list['$==']([])))) { | |
return (self.joins = $hash2(["all"], {"all": []})) | |
} else if ($truthy(joins_list['$nil?']())) { | |
klass = (function() {if ($truthy($rb_lt(self.model, $$$($$($nesting, 'ActiveRecord'), 'Base')))) { | |
return self.model.$base_class() | |
} else { | |
return self.model | |
}; return nil; })(); | |
return (self.joins = $hash(klass, [[]], "all", [])); | |
} else if (joins_list['$==']("all")) { | |
return (self.joins = $hash2(["all"], {"all": [[]]})) | |
} else { | |
if ($truthy(joins_list['$is_a?']($$($nesting, 'Array')))) { | |
} else { | |
joins_list = [joins_list] | |
}; | |
return self.$map_joins_path(joins_list); | |
} | |
}, TMP_ScopeDescription_build_joins_15.$$arity = 1); | |
Opal.def(self, '$map_joins_path', TMP_ScopeDescription_map_joins_path_19 = function $$map_joins_path(paths) { | |
var TMP_16, TMP_17, self = this; | |
self.joins = $send($$($nesting, 'Hash'), 'new', [], (TMP_16 = function(h, k){var self = TMP_16.$$s || this, $writer = nil; | |
if (h == null) h = nil;if (k == null) k = nil; | |
$writer = [k, $$($nesting, 'Array').$new()]; | |
$send(h, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];}, TMP_16.$$s = self, TMP_16.$$arity = 2, TMP_16)).$merge($hash(self.model, [[]])); | |
return $send(paths, 'each', [], (TMP_17 = function(path){var self = TMP_17.$$s || this, TMP_18, vector = nil; | |
if (self.model == null) self.model = nil; | |
if (path == null) path = nil; | |
vector = []; | |
return $send(path.$split("."), 'inject', [self.model], (TMP_18 = function(model, attribute){var self = TMP_18.$$s || this, association = nil; | |
if (self.joins == null) self.joins = nil; | |
if (model == null) model = nil;if (attribute == null) attribute = nil; | |
association = model.$reflect_on_association(attribute); | |
if ($truthy(association)) { | |
} else { | |
self.$raise(self.$build_error(path, model, attribute)) | |
}; | |
vector = [association.$inverse_of()].concat(Opal.to_a(vector)); | |
self.joins['$[]'](association.$klass())['$<<'](vector); | |
return association.$klass();}, TMP_18.$$s = self, TMP_18.$$arity = 2, TMP_18));}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17)); | |
}, TMP_ScopeDescription_map_joins_path_19.$$arity = 1); | |
Opal.def(self, '$build_error', TMP_ScopeDescription_build_error_20 = function $$build_error(path, model, attribute) { | |
var self = this; | |
return "" + ("" + "Could not find joins association '" + (model.$name()) + "." + (attribute) + "' ") + ("" + "for '" + (path) + "' while processing scope " + (self.model.$name()) + "." + (self.name) + ".") | |
}, TMP_ScopeDescription_build_error_20.$$arity = 3); | |
return (Opal.def(self, '$crawl', TMP_ScopeDescription_crawl_22 = function $$crawl(item, method, $a_rest) { | |
var $b, TMP_21, self = this, vector; | |
if (method == null) { | |
method = nil; | |
} | |
var $args_len = arguments.length, $rest_len = $args_len - 2; | |
if ($rest_len < 0) { $rest_len = 0; } | |
vector = new Array($rest_len); | |
for (var $arg_idx = 2; $arg_idx < $args_len; $arg_idx++) { | |
vector[$arg_idx - 2] = arguments[$arg_idx]; | |
} | |
if ($truthy(($truthy($b = method['$!']()) ? item['$is_a?']($$($nesting, 'Collection')) : $b))) { | |
return item.$all() | |
} else if ($truthy(method['$!']())) { | |
return item | |
} else if ($truthy(item['$respond_to?']("collect"))) { | |
return $send(item, 'collect', [], (TMP_21 = function(record){var self = TMP_21.$$s || this; | |
if (record == null) record = nil; | |
return $send(self, 'crawl', [record.$send(method)].concat(Opal.to_a(vector)))}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21)) | |
} else { | |
return $send(self, 'crawl', [item.$send(method)].concat(Opal.to_a(vector))) | |
} | |
}, TMP_ScopeDescription_crawl_22.$$arity = -2), nil) && 'crawl'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/server_data_cache.rb": | |
/*!***********************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/reactive_record/server_data_cache.rb ***! | |
\***********************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var set_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! set.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/opal-4abc31d211ab/stdlib/set.rb"); | |
if (typeof global.Opal.modules["set"] === 'undefined') { | |
if (typeof set_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(set_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["reactive_record/server_data_cache"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $send = Opal.send, $truthy = Opal.truthy; | |
Opal.add_stubs(['$require', '$new', '$attr_reader', '$<<', '$cache', '$vector', '$[]=', '$cache_reps', '$-', '$requested_cache_items', '$!=', '$[]', '$replace', '$collect', '$find', '$klass', '$proxy_association', '$is_a?', '$first', '$id=', '$each', '$parse', '$==', '$!', '$load_from_json', '$const_get', '$set_count_state', '$=~', '$push_and_update_belongs_to', '$lookup_by_object_id', '$<', '$class', '$send', '$destroy', '$update_simple_attribute', '$backing_record', '$convert', '$respond_to?', '$reflect_on_aggregation', '$deserialize', '$set_attr_value', '$reflect_on_association', '$raise']); | |
self.$require("set"); | |
return (function($base, $parent_nesting) { | |
function $ReactiveRecord() {}; | |
var self = $ReactiveRecord = $module($base, 'ReactiveRecord', $ReactiveRecord); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ServerDataCache(){}; | |
var self = $ServerDataCache = $klass($base, $super, 'ServerDataCache', $ServerDataCache); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ServerDataCache_initialize_1, TMP_ServerDataCache_add_item_to_cache_2, TMP_ServerDataCache_load_from_json_5; | |
Opal.def(self, '$initialize', TMP_ServerDataCache_initialize_1 = function $$initialize(acting_user, preloaded_records) { | |
var self = this; | |
self.acting_user = acting_user; | |
self.cache = []; | |
self.cache_reps = $hash2([], {}); | |
self.requested_cache_items = $$($nesting, 'Set').$new(); | |
return (self.preloaded_records = preloaded_records); | |
}, TMP_ServerDataCache_initialize_1.$$arity = 2); | |
self.$attr_reader("cache"); | |
self.$attr_reader("cache_reps"); | |
self.$attr_reader("requested_cache_items"); | |
Opal.def(self, '$add_item_to_cache', TMP_ServerDataCache_add_item_to_cache_2 = function $$add_item_to_cache(item) { | |
var self = this, $writer = nil; | |
self.$cache()['$<<'](item); | |
$writer = [item.$vector(), item]; | |
$send(self.$cache_reps(), '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];; | |
return self.$requested_cache_items()['$<<'](item); | |
}, TMP_ServerDataCache_add_item_to_cache_2.$$arity = 1); | |
if ($truthy($$($nesting, 'RUBY_ENGINE')['$!=']("opal"))) { | |
nil}; | |
return (Opal.defs(self, '$load_from_json', TMP_ServerDataCache_load_from_json_5 = function $$load_from_json(tree, target) { | |
var TMP_3, $a, TMP_4, self = this, sorted_collection = nil, id_value = nil, $writer = nil, e = nil; | |
if (target == null) { | |
target = nil; | |
} | |
try { | |
if ($truthy((sorted_collection = tree['$[]']("*all")))) { | |
target.$replace($send(sorted_collection, 'collect', [], (TMP_3 = function(id){var self = TMP_3.$$s || this; | |
if (id == null) id = nil; | |
return target.$proxy_association().$klass().$find(id)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3)))}; | |
if ($truthy(($truthy($a = (id_value = tree['$[]']("id"))) ? id_value['$is_a?']($$($nesting, 'Array')) : $a))) { | |
$writer = [id_value.$first()]; | |
$send(target, 'id=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
return $send(tree, 'each', [], (TMP_4 = function(method, value){var self = TMP_4.$$s || this, $b, $c, $d, new_target = nil, aggregation = nil, association = nil; | |
if (method == null) method = nil;if (value == null) value = nil; | |
method = (function() { try { | |
return $$($nesting, 'JSON').$parse(method) | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'StandardError')])) { | |
try { | |
return method | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
}})(); | |
new_target = nil; | |
if (method['$==']("*all")) { | |
return nil; | |
} else if ($truthy(target['$!']())) { | |
self.$load_from_json(value, $$($nesting, 'Object').$const_get(method)) | |
} else if (method['$==']("*count")) { | |
target.$set_count_state(value.$first()) | |
} else if ($truthy(($truthy($b = method['$is_a?']($$($nesting, 'Integer'))) ? $b : method['$=~'](/^[0-9]+$/)))) { | |
new_target = target.$push_and_update_belongs_to(method) | |
} else if ($truthy(method['$is_a?']($$($nesting, 'Array')))) { | |
if (method['$[]'](0)['$==']("new")) { | |
new_target = $$$($$($nesting, 'ReactiveRecord'), 'Base').$lookup_by_object_id(method['$[]'](1)) | |
} else if ($truthy($rb_lt(target.$class(), $$$($$($nesting, 'ActiveRecord'), 'Base'))['$!']())) { | |
new_target = $send(target, 'send', Opal.to_a(method)); | |
if ($truthy(value['$is_a?']($$($nesting, 'Array')))) { | |
($truthy($b = new_target.$destroy()) ? (new_target = nil) : $b)}; | |
} else { | |
target.$backing_record().$update_simple_attribute([method], target.$backing_record().$convert(method, value.$first())) | |
} | |
} else if ($truthy(($truthy($b = ($truthy($c = target.$class()['$respond_to?']("reflect_on_aggregation")) ? (aggregation = target.$class().$reflect_on_aggregation(method)) : $c)) ? $rb_lt(aggregation.$klass(), $$$($$($nesting, 'ActiveRecord'), 'Base'))['$!']() : $b))) { | |
if ($truthy(value.$first()['$is_a?'](aggregation.$klass()))) { | |
} else { | |
value = [aggregation.$deserialize(value.$first())] | |
}; | |
target.$send("" + (method) + "=", value.$first()); | |
} else if ($truthy(value['$is_a?']($$($nesting, 'Array')))) { | |
if (method['$==']("id")) { | |
} else { | |
target.$backing_record().$set_attr_value(method, value.$first()) | |
} | |
} else if ($truthy(($truthy($b = ($truthy($c = ($truthy($d = value['$is_a?']($$($nesting, 'Hash'))) ? value['$[]']("id") : $d)) ? value['$[]']("id").$first() : $c)) ? (association = target.$class().$reflect_on_association(method)) : $b))) { | |
new_target = association.$klass().$find(value['$[]']("id").$first()); | |
target.$send("" + (method) + "=", new_target); | |
} else if ($truthy($rb_lt(target.$class(), $$$($$($nesting, 'ActiveRecord'), 'Base'))['$!']())) { | |
new_target = $send(target, 'send', Opal.to_a(method)); | |
if ($truthy(value['$is_a?']($$($nesting, 'Array')))) { | |
($truthy($b = new_target.$destroy()) ? (new_target = nil) : $b)}; | |
} else { | |
new_target = target.$send("" + (method) + "=", target.$send(method)) | |
}; | |
if ($truthy(new_target)) { | |
return self.$load_from_json(value, new_target) | |
} else { | |
return nil | |
};}, TMP_4.$$s = self, TMP_4.$$arity = 2, TMP_4)); | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
return self.$raise(e) | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
} | |
}, TMP_ServerDataCache_load_from_json_5.$$arity = -2), nil) && 'load_from_json'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting); | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyper-model.rb": | |
/*!**************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyper-model.rb ***! | |
\**************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var hyperloop_model_version_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hyperloop/model/version.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyperloop/model/version.rb"); | |
/* harmony import */ var hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! hyperloop-config.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyperloop-config-4886523adb38/lib/hyperloop-config.rb"); | |
/* harmony import */ var hyper_mesh_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! hyper-mesh.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-mesh-7e5cfb908a0c/lib/hyper-mesh.rb"); | |
/* harmony import */ var hyperloop_model_load_rb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! hyperloop/model/load.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyperloop/model/load.rb"); | |
if (typeof global.Opal.modules["hyperloop/model/version"] === 'undefined') { | |
if (typeof hyperloop_model_version_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(hyperloop_model_version_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyperloop-config"] === 'undefined') { | |
if (typeof hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-mesh"] === 'undefined') { | |
if (typeof hyper_mesh_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(hyper_mesh_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyperloop/model/load"] === 'undefined') { | |
if (typeof hyperloop_model_load_rb__WEBPACK_IMPORTED_MODULE_3__["default"] === 'function') { Object(hyperloop_model_load_rb__WEBPACK_IMPORTED_MODULE_3__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-model"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice; | |
Opal.add_stubs(['$require', '$import', '$==']); | |
self.$require("hyperloop/model/version"); | |
self.$require("hyperloop-config"); | |
$$($nesting, 'Hyperloop').$import("hyper-component"); | |
$$($nesting, 'Hyperloop').$import("hyper-model"); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
self.$require("hyper-mesh"); | |
return self.$require("hyperloop/model/load"); | |
} else { | |
return nil | |
}; | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyperloop/model/load.rb": | |
/*!***********************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyperloop/model/load.rb ***! | |
\***********************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyperloop/model/load"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $send = Opal.send; | |
Opal.add_stubs(['$load', '$to_proc']); | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $Model() {}; | |
var self = $Model = $module($base, 'Model', $Model); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Model_load_1; | |
Opal.defs(self, '$load', TMP_Model_load_1 = function $$load() { | |
var self = this, $iter = TMP_Model_load_1.$$p, block = $iter || nil; | |
if ($iter) TMP_Model_load_1.$$p = null; | |
return $send($$($nesting, 'ReactiveRecord'), 'load', [], block.$to_proc()) | |
}, TMP_Model_load_1.$$arity = 0) | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyperloop/model/version.rb": | |
/*!**************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-model-b1d1f96022aa/lib/hyperloop/model/version.rb ***! | |
\**************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyperloop/model/version"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $parent_nesting) { | |
function $Model() {}; | |
var self = $Model = $module($base, 'Model', $Model); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
Opal.const_set($nesting[0], 'VERSION', "1.0.0.lap28") | |
})($nesting[0], $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation.rb": | |
/*!**********************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation.rb ***! | |
\**********************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var hyper_operation_version_rb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hyper-operation/version.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/version.rb"); | |
/* harmony import */ var hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! hyperloop-config.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyperloop-config-4886523adb38/lib/hyperloop-config.rb"); | |
/* harmony import */ var active_support_core_ext_string_rb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! active_support/core_ext/string.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/gems/opal-activesupport-0.3.1/opal/active_support/core_ext/string.rb"); | |
/* harmony import */ var mutations_rb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mutations.rb */ "../../.rvm/gems/ruby-2.5.1/gems/mutations-0.8.2/lib/mutations.rb"); | |
/* harmony import */ var hyper_operation_filters_outbound_filter_rb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! hyper-operation/filters/outbound_filter.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/filters/outbound_filter.rb"); | |
/* harmony import */ var hyper_component_rb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! hyper-component.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-component-60d2525454e3/lib/hyper-component.rb"); | |
/* harmony import */ var hyper_operation_http_rb__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! hyper-operation/http.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/http.rb"); | |
/* harmony import */ var hyper_operation_transport_client_drivers_rb__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! hyper-operation/transport/client_drivers.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/transport/client_drivers.rb"); | |
/* harmony import */ var hyper_operation_exception_rb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! hyper-operation/exception.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/exception.rb"); | |
/* harmony import */ var hyper_operation_promise_rb__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! hyper-operation/promise.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/promise.rb"); | |
/* harmony import */ var hyper_operation_railway_rb__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! hyper-operation/railway.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway.rb"); | |
/* harmony import */ var hyper_operation_api_rb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! hyper-operation/api.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/api.rb"); | |
/* harmony import */ var hyper_operation_railway_dispatcher_rb__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! hyper-operation/railway/dispatcher.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/dispatcher.rb"); | |
/* harmony import */ var hyper_operation_railway_params_wrapper_rb__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! hyper-operation/railway/params_wrapper.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/params_wrapper.rb"); | |
/* harmony import */ var hyper_operation_railway_run_rb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! hyper-operation/railway/run.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/run.rb"); | |
/* harmony import */ var hyper_operation_railway_validations_rb__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! hyper-operation/railway/validations.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/validations.rb"); | |
/* harmony import */ var hyper_operation_server_op_rb__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! hyper-operation/server_op.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/server_op.rb"); | |
/* harmony import */ var hyper_operation_boot_rb__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! hyper-operation/boot.rb */ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/boot.rb"); | |
if (typeof global.Opal.modules["hyper-operation/version"] === 'undefined') { | |
if (typeof hyper_operation_version_rb__WEBPACK_IMPORTED_MODULE_0__["default"] === 'function') { Object(hyper_operation_version_rb__WEBPACK_IMPORTED_MODULE_0__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyperloop-config"] === 'undefined') { | |
if (typeof hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"] === 'function') { Object(hyperloop_config_rb__WEBPACK_IMPORTED_MODULE_1__["default"])(); } | |
} | |
if (typeof global.Opal.modules["active_support/core_ext/string"] === 'undefined') { | |
if (typeof active_support_core_ext_string_rb__WEBPACK_IMPORTED_MODULE_2__["default"] === 'function') { Object(active_support_core_ext_string_rb__WEBPACK_IMPORTED_MODULE_2__["default"])(); } | |
} | |
if (typeof global.Opal.modules["mutations"] === 'undefined') { | |
if (typeof mutations_rb__WEBPACK_IMPORTED_MODULE_3__["default"] === 'function') { Object(mutations_rb__WEBPACK_IMPORTED_MODULE_3__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/filters/outbound_filter"] === 'undefined') { | |
if (typeof hyper_operation_filters_outbound_filter_rb__WEBPACK_IMPORTED_MODULE_4__["default"] === 'function') { Object(hyper_operation_filters_outbound_filter_rb__WEBPACK_IMPORTED_MODULE_4__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-component"] === 'undefined') { | |
if (typeof hyper_component_rb__WEBPACK_IMPORTED_MODULE_5__["default"] === 'function') { Object(hyper_component_rb__WEBPACK_IMPORTED_MODULE_5__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/http"] === 'undefined') { | |
if (typeof hyper_operation_http_rb__WEBPACK_IMPORTED_MODULE_6__["default"] === 'function') { Object(hyper_operation_http_rb__WEBPACK_IMPORTED_MODULE_6__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/transport/client_drivers"] === 'undefined') { | |
if (typeof hyper_operation_transport_client_drivers_rb__WEBPACK_IMPORTED_MODULE_7__["default"] === 'function') { Object(hyper_operation_transport_client_drivers_rb__WEBPACK_IMPORTED_MODULE_7__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/exception"] === 'undefined') { | |
if (typeof hyper_operation_exception_rb__WEBPACK_IMPORTED_MODULE_8__["default"] === 'function') { Object(hyper_operation_exception_rb__WEBPACK_IMPORTED_MODULE_8__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/promise"] === 'undefined') { | |
if (typeof hyper_operation_promise_rb__WEBPACK_IMPORTED_MODULE_9__["default"] === 'function') { Object(hyper_operation_promise_rb__WEBPACK_IMPORTED_MODULE_9__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/railway"] === 'undefined') { | |
if (typeof hyper_operation_railway_rb__WEBPACK_IMPORTED_MODULE_10__["default"] === 'function') { Object(hyper_operation_railway_rb__WEBPACK_IMPORTED_MODULE_10__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/api"] === 'undefined') { | |
if (typeof hyper_operation_api_rb__WEBPACK_IMPORTED_MODULE_11__["default"] === 'function') { Object(hyper_operation_api_rb__WEBPACK_IMPORTED_MODULE_11__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/railway/dispatcher"] === 'undefined') { | |
if (typeof hyper_operation_railway_dispatcher_rb__WEBPACK_IMPORTED_MODULE_12__["default"] === 'function') { Object(hyper_operation_railway_dispatcher_rb__WEBPACK_IMPORTED_MODULE_12__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/railway/params_wrapper"] === 'undefined') { | |
if (typeof hyper_operation_railway_params_wrapper_rb__WEBPACK_IMPORTED_MODULE_13__["default"] === 'function') { Object(hyper_operation_railway_params_wrapper_rb__WEBPACK_IMPORTED_MODULE_13__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/railway/run"] === 'undefined') { | |
if (typeof hyper_operation_railway_run_rb__WEBPACK_IMPORTED_MODULE_14__["default"] === 'function') { Object(hyper_operation_railway_run_rb__WEBPACK_IMPORTED_MODULE_14__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/railway/validations"] === 'undefined') { | |
if (typeof hyper_operation_railway_validations_rb__WEBPACK_IMPORTED_MODULE_15__["default"] === 'function') { Object(hyper_operation_railway_validations_rb__WEBPACK_IMPORTED_MODULE_15__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/server_op"] === 'undefined') { | |
if (typeof hyper_operation_server_op_rb__WEBPACK_IMPORTED_MODULE_16__["default"] === 'function') { Object(hyper_operation_server_op_rb__WEBPACK_IMPORTED_MODULE_16__["default"])(); } | |
} | |
if (typeof global.Opal.modules["hyper-operation/boot"] === 'undefined') { | |
if (typeof hyper_operation_boot_rb__WEBPACK_IMPORTED_MODULE_17__["default"] === 'function') { Object(hyper_operation_boot_rb__WEBPACK_IMPORTED_MODULE_17__["default"])(); } | |
} | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; | |
Opal.add_stubs(['$require', '$import', '$==', '$register_additional_filter']); | |
self.$require("hyper-operation/version"); | |
self.$require("hyperloop-config"); | |
$$($nesting, 'Hyperloop').$import("hyper-operation"); | |
if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) { | |
self.$require("active_support/core_ext/string"); | |
self.$require("mutations"); | |
$$$($$($nesting, 'Mutations'), 'HashFilter').$register_additional_filter($$$($$($nesting, 'Mutations'), 'DuckFilter'), "duck"); | |
self.$require("hyper-operation/filters/outbound_filter"); | |
self.$require("hyper-component"); | |
self.$require("hyper-operation/http"); | |
self.$require("hyper-operation/transport/client_drivers"); | |
(function($base, $super, $parent_nesting) { | |
function $HashWithIndifferentAccess(){}; | |
var self = $HashWithIndifferentAccess = $klass($base, $super, 'HashWithIndifferentAccess', $HashWithIndifferentAccess); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return nil | |
})($nesting[0], $$($nesting, 'Hash'), $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $String(){}; | |
var self = $String = $klass($base, $super, 'String', $String); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_String_titleize_1; | |
return (Opal.def(self, '$titleize', TMP_String_titleize_1 = function $$titleize() { | |
var self = this; | |
return self | |
}, TMP_String_titleize_1.$$arity = 0), nil) && 'titleize' | |
})($nesting[0], null, $nesting); | |
self.$require("hyper-operation/exception"); | |
self.$require("hyper-operation/promise"); | |
self.$require("hyper-operation/railway"); | |
self.$require("hyper-operation/api"); | |
self.$require("hyper-operation/railway/dispatcher"); | |
self.$require("hyper-operation/railway/params_wrapper"); | |
self.$require("hyper-operation/railway/run"); | |
self.$require("hyper-operation/railway/validations"); | |
self.$require("hyper-operation/server_op"); | |
return self.$require("hyper-operation/boot"); | |
} else { | |
return nil | |
}; | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/api.rb": | |
/*!**************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/api.rb ***! | |
\**************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/api"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send, $hash2 = Opal.hash2, $hash = Opal.hash; | |
Opal.add_stubs(['$is_a?', '$raise', '$new', '$tap', '$split', '$to_s', '$pop', '$inject', '$[]', '$to_sym', '$[]=', '$-', '$!', '$nil?', '$abort!', '$succeed!', '$_Railway', '$class', '$_run', '$instance_eval', '$process_params', '$process_validations', '$run', '$dispatch', '$result', '$then', '$to_proc', '$fail', '$add_param', '$get_name_and_opts', '$merge', '$each', '$add_validation', '$add_error', '$add_step', '$add_failed', '$add_async', '$add_receiver', '$singleton_class', '$define_singleton_method', '$set_var', '$superclass', '$==', '$instance_variable_get', '$instance_variable_set', '$dup']); | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Operation(){}; | |
var self = $Operation = $klass($base, $super, 'Operation', $Operation); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Operation_add_error_3, TMP_Operation_has_errors$q_4, TMP_Operation_params_5, TMP_Operation_abort$B_6, TMP_Operation_succeed$B_7, TMP_Operation_initialize_8; | |
def.errors = def.params = nil; | |
Opal.def(self, '$add_error', TMP_Operation_add_error_3 = function $$add_error(key, kind, message) { | |
var $a, TMP_1, self = this; | |
if (message == null) { | |
message = nil; | |
} | |
if ($truthy(kind['$is_a?']($$($nesting, 'Symbol')))) { | |
} else { | |
self.$raise($$($nesting, 'ArgumentError').$new("Invalid kind")) | |
}; | |
self.errors = ($truthy($a = self.errors) ? $a : $$$($$($nesting, 'Mutations'), 'ErrorHash').$new()); | |
return $send(self.errors, 'tap', [], (TMP_1 = function(errs){var self = TMP_1.$$s || this, TMP_2, path = nil, last = nil, inner = nil, $writer = nil; | |
if (errs == null) errs = nil; | |
path = key.$to_s().$split("."); | |
last = path.$pop(); | |
inner = $send(path, 'inject', [errs], (TMP_2 = function(cur_errors, part){var self = TMP_2.$$s || this, $b, $writer = nil; | |
if (cur_errors == null) cur_errors = nil;if (part == null) part = nil; | |
return ($truthy($b = cur_errors['$[]'](part.$to_sym())) ? $b : (($writer = [part.$to_sym(), $$$($$($nesting, 'Mutations'), 'ErrorHash').$new()]), $send(cur_errors, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2)); | |
$writer = [last, $$$($$($nesting, 'Mutations'), 'ErrorAtom').$new(key, kind, $hash2(["message"], {"message": message}))]; | |
$send(inner, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1)); | |
}, TMP_Operation_add_error_3.$$arity = -3); | |
Opal.def(self, '$has_errors?', TMP_Operation_has_errors$q_4 = function() { | |
var self = this; | |
return self.errors['$nil?']()['$!']() | |
}, TMP_Operation_has_errors$q_4.$$arity = 0); | |
Opal.def(self, '$params', TMP_Operation_params_5 = function $$params() { | |
var self = this; | |
return self.params | |
}, TMP_Operation_params_5.$$arity = 0); | |
Opal.def(self, '$abort!', TMP_Operation_abort$B_6 = function(arg) { | |
var self = this; | |
if (arg == null) { | |
arg = nil; | |
} | |
return $$($nesting, 'Railway')['$abort!'](arg) | |
}, TMP_Operation_abort$B_6.$$arity = -1); | |
Opal.def(self, '$succeed!', TMP_Operation_succeed$B_7 = function(arg) { | |
var self = this; | |
if (arg == null) { | |
arg = nil; | |
} | |
return $$($nesting, 'Railway')['$succeed!'](arg) | |
}, TMP_Operation_succeed$B_7.$$arity = -1); | |
Opal.def(self, '$initialize', TMP_Operation_initialize_8 = function $$initialize() { | |
var self = this; | |
return (self._railway = self.$class().$_Railway().$new(self)) | |
}, TMP_Operation_initialize_8.$$arity = 0); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_run_9, TMP__run_11, TMP_then_12, TMP_fail_13, TMP_param_14, TMP_inbound_15, TMP_outbound_17, TMP_validate_18, TMP_add_error_19, TMP_step_20, TMP_failed_21, TMP_async_22, TMP_on_dispatch_23, TMP__Railway_24, TMP_inherited_38; | |
Opal.def(self, '$run', TMP_run_9 = function $$run($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self, '_run', Opal.to_a(args)) | |
}, TMP_run_9.$$arity = -1); | |
Opal.def(self, '$_run', TMP__run_11 = function $$_run($a_rest) { | |
var TMP_10, self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$new(), 'instance_eval', [], (TMP_10 = function(){var self = TMP_10.$$s || this; | |
if (self._railway == null) self._railway = nil; | |
self._railway.$process_params(args); | |
self._railway.$process_validations(); | |
self._railway.$run(); | |
self._railway.$dispatch(); | |
return self._railway.$result();}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10)) | |
}, TMP__run_11.$$arity = -1); | |
Opal.def(self, '$then', TMP_then_12 = function $$then($a_rest) { | |
var self = this, args, $iter = TMP_then_12.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_then_12.$$p = null; | |
return $send($send(self, 'run', Opal.to_a(args)), 'then', [], block.$to_proc()) | |
}, TMP_then_12.$$arity = -1); | |
Opal.def(self, '$fail', TMP_fail_13 = function $$fail($a_rest) { | |
var self = this, args, $iter = TMP_fail_13.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_fail_13.$$p = null; | |
return $send($send(self, 'run', Opal.to_a(args)), 'fail', [], block.$to_proc()) | |
}, TMP_fail_13.$$arity = -1); | |
Opal.def(self, '$param', TMP_param_14 = function $$param($a_rest) { | |
var self = this, args, $iter = TMP_param_14.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_param_14.$$p = null; | |
return $send(self.$_Railway(), 'add_param', Opal.to_a(args), block.$to_proc()) | |
}, TMP_param_14.$$arity = -1); | |
Opal.def(self, '$inbound', TMP_inbound_15 = function $$inbound($a_rest) { | |
var $b, $c, self = this, args, $iter = TMP_inbound_15.$$p, block = $iter || nil, name = nil, opts = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_inbound_15.$$p = null; | |
$c = $send($$($nesting, 'ParamsWrapper'), 'get_name_and_opts', Opal.to_a(args)), $b = Opal.to_ary($c), (name = ($b[0] == null ? nil : $b[0])), (opts = ($b[1] == null ? nil : $b[1])), $c; | |
return $send(self.$_Railway(), 'add_param', [name, opts.$merge($hash2(["inbound"], {"inbound": "true"}))], block.$to_proc()); | |
}, TMP_inbound_15.$$arity = -1); | |
Opal.def(self, '$outbound', TMP_outbound_17 = function $$outbound($a_rest) { | |
var TMP_16, self = this, keys; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
keys = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
keys[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(keys, 'each', [], (TMP_16 = function(key){var self = TMP_16.$$s || this; | |
if (key == null) key = nil; | |
return self.$_Railway().$add_param($hash(key, nil, "type", "outbound"))}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16)) | |
}, TMP_outbound_17.$$arity = -1); | |
Opal.def(self, '$validate', TMP_validate_18 = function $$validate($a_rest) { | |
var self = this, args, $iter = TMP_validate_18.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_validate_18.$$p = null; | |
return $send(self.$_Railway(), 'add_validation', Opal.to_a(args), block.$to_proc()) | |
}, TMP_validate_18.$$arity = -1); | |
Opal.def(self, '$add_error', TMP_add_error_19 = function $$add_error(param, symbol, message, $a_rest) { | |
var self = this, args, $iter = TMP_add_error_19.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 3; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 3; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 3] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_add_error_19.$$p = null; | |
return $send(self.$_Railway(), 'add_error', [param, symbol, message].concat(Opal.to_a(args)), block.$to_proc()) | |
}, TMP_add_error_19.$$arity = -4); | |
Opal.def(self, '$step', TMP_step_20 = function $$step($a_rest) { | |
var self = this, args, $iter = TMP_step_20.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_step_20.$$p = null; | |
return $send(self.$_Railway(), 'add_step', Opal.to_a(args), block.$to_proc()) | |
}, TMP_step_20.$$arity = -1); | |
Opal.def(self, '$failed', TMP_failed_21 = function $$failed($a_rest) { | |
var self = this, args, $iter = TMP_failed_21.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_failed_21.$$p = null; | |
return $send(self.$_Railway(), 'add_failed', Opal.to_a(args), block.$to_proc()) | |
}, TMP_failed_21.$$arity = -1); | |
Opal.def(self, '$async', TMP_async_22 = function $$async($a_rest) { | |
var self = this, args, $iter = TMP_async_22.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_async_22.$$p = null; | |
return $send(self.$_Railway(), 'add_async', Opal.to_a(args), block.$to_proc()) | |
}, TMP_async_22.$$arity = -1); | |
Opal.def(self, '$on_dispatch', TMP_on_dispatch_23 = function $$on_dispatch() { | |
var self = this, $iter = TMP_on_dispatch_23.$$p, block = $iter || nil; | |
if ($iter) TMP_on_dispatch_23.$$p = null; | |
return $send(self.$_Railway(), 'add_receiver', [], block.$to_proc()) | |
}, TMP_on_dispatch_23.$$arity = 0); | |
Opal.def(self, '$_Railway', TMP__Railway_24 = function $$_Railway() { | |
var self = this; | |
return self.$singleton_class().$_Railway() | |
}, TMP__Railway_24.$$arity = 0); | |
return (Opal.def(self, '$inherited', TMP_inherited_38 = function $$inherited(child) { | |
var TMP_25, TMP_26, TMP_27, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, self = this; | |
$send(child.$singleton_class(), 'define_singleton_method', ["param"], (TMP_25 = function($a_rest){var self = TMP_25.$$s || this, block, args; | |
block = TMP_25.$$p || nil; | |
if (block) TMP_25.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$_Railway(), 'add_param', Opal.to_a(args), block.$to_proc())}, TMP_25.$$s = self, TMP_25.$$arity = -1, TMP_25)); | |
$send(child.$singleton_class(), 'define_singleton_method', ["inbound"], (TMP_26 = function($a_rest){var self = TMP_26.$$s || this, block, args, $b, $c, name = nil, opts = nil; | |
block = TMP_26.$$p || nil; | |
if (block) TMP_26.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
$c = $send($$($nesting, 'ParamsWrapper'), 'get_name_and_opts', Opal.to_a(args)), $b = Opal.to_ary($c), (name = ($b[0] == null ? nil : $b[0])), (opts = ($b[1] == null ? nil : $b[1])), $c; | |
return $send(self.$_Railway(), 'add_param', [name, opts.$merge($hash2(["inbound"], {"inbound": "true"}))], block.$to_proc());}, TMP_26.$$s = self, TMP_26.$$arity = -1, TMP_26)); | |
$send(child.$singleton_class(), 'define_singleton_method', ["outbound"], (TMP_27 = function($a_rest){var self = TMP_27.$$s || this, keys, TMP_28; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
keys = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
keys[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(keys, 'each', [], (TMP_28 = function(key){var self = TMP_28.$$s || this; | |
if (key == null) key = nil; | |
return self.$_Railway().$add_param($hash(key, nil, "type", "outbound"))}, TMP_28.$$s = self, TMP_28.$$arity = 1, TMP_28))}, TMP_27.$$s = self, TMP_27.$$arity = -1, TMP_27)); | |
$send(child.$singleton_class(), 'define_singleton_method', ["validate"], (TMP_29 = function($a_rest){var self = TMP_29.$$s || this, block, args; | |
block = TMP_29.$$p || nil; | |
if (block) TMP_29.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$_Railway(), 'add_validation', Opal.to_a(args), block.$to_proc())}, TMP_29.$$s = self, TMP_29.$$arity = -1, TMP_29)); | |
$send(child.$singleton_class(), 'define_singleton_method', ["add_error"], (TMP_30 = function(param, symbol, message, $a_rest){var self = TMP_30.$$s || this, block, args; | |
block = TMP_30.$$p || nil; | |
if (block) TMP_30.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 3; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 3; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 3] = arguments[$arg_idx]; | |
}if (param == null) param = nil;if (symbol == null) symbol = nil;if (message == null) message = nil; | |
return $send(self.$_Railway(), 'add_error', [param, symbol, message].concat(Opal.to_a(args)), block.$to_proc())}, TMP_30.$$s = self, TMP_30.$$arity = -4, TMP_30)); | |
$send(child.$singleton_class(), 'define_singleton_method', ["step"], (TMP_31 = function($a_rest){var self = TMP_31.$$s || this, block, args; | |
block = TMP_31.$$p || nil; | |
if (block) TMP_31.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$_Railway(), 'add_step', [$hash2(["scope"], {"scope": "class"})].concat(Opal.to_a(args)), block.$to_proc())}, TMP_31.$$s = self, TMP_31.$$arity = -1, TMP_31)); | |
$send(child.$singleton_class(), 'define_singleton_method', ["failed"], (TMP_32 = function($a_rest){var self = TMP_32.$$s || this, block, args; | |
block = TMP_32.$$p || nil; | |
if (block) TMP_32.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$_Railway(), 'add_failed', [$hash2(["scope"], {"scope": "class"})].concat(Opal.to_a(args)), block.$to_proc())}, TMP_32.$$s = self, TMP_32.$$arity = -1, TMP_32)); | |
$send(child.$singleton_class(), 'define_singleton_method', ["async"], (TMP_33 = function($a_rest){var self = TMP_33.$$s || this, block, args; | |
block = TMP_33.$$p || nil; | |
if (block) TMP_33.$$p = null; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $send(self.$_Railway(), 'add_async', [$hash2(["scope"], {"scope": "class"})].concat(Opal.to_a(args)), block.$to_proc())}, TMP_33.$$s = self, TMP_33.$$arity = -1, TMP_33)); | |
return $send(child.$singleton_class(), 'define_singleton_method', ["_Railway"], (TMP_34 = function(){var self = TMP_34.$$s || this, TMP_35; | |
return $send($$$($$($nesting, 'Hyperloop'), 'Context'), 'set_var', [self, "@_railway"], (TMP_35 = function(){var self = TMP_35.$$s || this, $a, TMP_36, my_super = nil; | |
my_super = ($truthy($a = self.$superclass()) ? $a : (self.$$singleton_of).$superclass().$singleton_class()); | |
if (my_super['$==']($$($nesting, 'Operation').$singleton_class())) { | |
return $$($nesting, 'Class').$new($$($nesting, 'Railway')) | |
} else { | |
return $send($$($nesting, 'Class').$new(my_super.$_Railway()), 'tap', [], (TMP_36 = function(wrapper){var self = TMP_36.$$s || this, TMP_37; | |
if (wrapper == null) wrapper = nil; | |
return $send(["@validations", "@tracks", "@receivers"], 'each', [], (TMP_37 = function(var$){var self = TMP_37.$$s || this, $b, value = nil; | |
if (var$ == null) var$ = nil; | |
value = my_super.$_Railway().$instance_variable_get(var$); | |
return wrapper.$instance_variable_set(var$, ($truthy($b = value) ? value.$dup() : $b));}, TMP_37.$$s = self, TMP_37.$$arity = 1, TMP_37))}, TMP_36.$$s = self, TMP_36.$$arity = 1, TMP_36)) | |
};}, TMP_35.$$s = self, TMP_35.$$arity = 0, TMP_35))}, TMP_34.$$s = self, TMP_34.$$arity = 0, TMP_34)); | |
}, TMP_inherited_38.$$arity = 1), nil) && 'inherited'; | |
})(Opal.get_singleton_class(self), $nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Railway(){}; | |
var self = $Railway = $klass($base, $super, 'Railway', $Railway); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Railway_initialize_39; | |
return (Opal.def(self, '$initialize', TMP_Railway_initialize_39 = function $$initialize(operation) { | |
var self = this; | |
return (self.operation = operation) | |
}, TMP_Railway_initialize_39.$$arity = 1), nil) && 'initialize' | |
})($nesting[0], null, $nesting); | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/boot.rb": | |
/*!***************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/boot.rb ***! | |
\***************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/boot"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$inherited', '$add_receiver', '$_Railway', '$to_proc', '$initialize_client_drivers_on_boot', '$_run', '$respond_to?', '$each', '$receivers', '$on_dispatch']); | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Application(){}; | |
var self = $Application = $klass($base, $super, 'Application', $Application); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), $a, TMP_Application_3; | |
if ($truthy((($a = $$($nesting, 'Boot', 'skip_raise')) ? 'constant' : nil))) { | |
$$($nesting, 'Operation').$inherited($$($nesting, 'Boot'))}; | |
(function($base, $super, $parent_nesting) { | |
function $Boot(){}; | |
var self = $Boot = $klass($base, $super, 'Boot', $Boot); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Boot_on_dispatch_1, TMP_Boot_run_2; | |
Opal.defs(self, '$on_dispatch', TMP_Boot_on_dispatch_1 = function $$on_dispatch() { | |
var self = this, $iter = TMP_Boot_on_dispatch_1.$$p, block = $iter || nil; | |
if ($iter) TMP_Boot_on_dispatch_1.$$p = null; | |
return $send(self.$_Railway(), 'add_receiver', [], block.$to_proc()) | |
}, TMP_Boot_on_dispatch_1.$$arity = 0); | |
return (Opal.defs(self, '$run', TMP_Boot_run_2 = function $$run($a_rest) { | |
var self = this, args; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
$$($nesting, 'ClientDrivers').$initialize_client_drivers_on_boot(); | |
return $send(self, '_run', Opal.to_a(args)); | |
}, TMP_Boot_run_2.$$arity = -1), nil) && 'run'; | |
})($nesting[0], $$($nesting, 'Operation'), $nesting); | |
if ($truthy($$($nesting, 'Boot')['$respond_to?']("receivers"))) { | |
return $send($$($nesting, 'Boot').$receivers(), 'each', [], (TMP_Application_3 = function(r){var self = TMP_Application_3.$$s || this; | |
if (r == null) r = nil; | |
return $send($$($nesting, 'Boot'), 'on_dispatch', [], r.$to_proc())}, TMP_Application_3.$$s = self, TMP_Application_3.$$arity = 1, TMP_Application_3)) | |
} else { | |
return nil | |
}; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/exception.rb": | |
/*!********************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/exception.rb ***! | |
\********************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/exception"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send; | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $AccessViolation(){}; | |
var self = $AccessViolation = $klass($base, $super, 'AccessViolation', $AccessViolation); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_AccessViolation_message_1; | |
return (Opal.def(self, '$message', TMP_AccessViolation_message_1 = function $$message() { | |
var self = this, $iter = TMP_AccessViolation_message_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_i = nil, $zuper_ii = nil; | |
if ($iter) TMP_AccessViolation_message_1.$$p = null; | |
// Prepare super implicit arguments | |
for($zuper_i = 0, $zuper_ii = arguments.length, $zuper = new Array($zuper_ii); $zuper_i < $zuper_ii; $zuper_i++) { | |
$zuper[$zuper_i] = arguments[$zuper_i]; | |
} | |
return "" + "Hyperloop::Operation::AccessViolation: " + ($send(self, Opal.find_super_dispatcher(self, 'message', TMP_AccessViolation_message_1, false), $zuper, $iter)) | |
}, TMP_AccessViolation_message_1.$$arity = 0), nil) && 'message' | |
})($nesting[0], $$($nesting, 'StandardError'), $nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Operation(){}; | |
var self = $Operation = $klass($base, $super, 'Operation', $Operation); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $ValidationException(){}; | |
var self = $ValidationException = $klass($base, $super, 'ValidationException', $ValidationException); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return nil | |
})($nesting[0], $$$($$($nesting, 'Mutations'), 'ValidationException'), $nesting) | |
})($nesting[0], null, $nesting); | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/filters/outbound_filter.rb": | |
/*!**********************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/filters/outbound_filter.rb ***! | |
\**********************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/filters/outbound_filter"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; | |
return (function($base, $parent_nesting) { | |
function $Mutations() {}; | |
var self = $Mutations = $module($base, 'Mutations', $Mutations); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $OutboundFilter(){}; | |
var self = $OutboundFilter = $klass($base, $super, 'OutboundFilter', $OutboundFilter); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_OutboundFilter_filter_1; | |
self.default_options = $hash2([], {}); | |
return (Opal.def(self, '$filter', TMP_OutboundFilter_filter_1 = function $$filter(data) { | |
var self = this; | |
return [data, "outbound"] | |
}, TMP_OutboundFilter_filter_1.$$arity = 1), nil) && 'filter'; | |
})($nesting[0], $$($nesting, 'AdditionalFilter'), $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/http.rb": | |
/*!***************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/http.rb ***! | |
\***************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/http"] = function(Opal) { | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_lt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2, $truthy = Opal.truthy; | |
Opal.add_stubs(['$each', '$define_singleton_method', '$send', '$new', '$define_method', '$attr_reader', '$>', '$+', '$-', '$<', '$delete', '$succeed', '$fail', '$promise', '$parse', '$private', '$tap', '$proc', '$ok?', '$resolve', '$reject', '$from_object', '$call']); | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $HTTP(){}; | |
var self = $HTTP = $klass($base, $super, 'HTTP', $HTTP); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_HTTP_1, TMP_HTTP_initialize_4, TMP_HTTP_active$q_5, TMP_HTTP_active_requests_6, TMP_HTTP_incr_active_requests_7, TMP_HTTP_decr_active_requests_8, TMP_HTTP_send_9, TMP_HTTP_json_10, TMP_HTTP_ok$q_11, TMP_HTTP_get_header_12, TMP_HTTP_inspect_13, TMP_HTTP_promise_16, TMP_HTTP_succeed_17, TMP_HTTP_fail_18; | |
def.handler = def.json = def.body = def.ok = def.xhr = def.url = def.method = def.promise = def.status_code = nil; | |
Opal.const_set($nesting[0], 'ACTIONS', ["get", "post", "put", "delete", "patch", "head"]); | |
$send($$($nesting, 'ACTIONS'), 'each', [], (TMP_HTTP_1 = function(action){var self = TMP_HTTP_1.$$s || this, TMP_2, TMP_3; | |
if (action == null) action = nil; | |
$send(self, 'define_singleton_method', [action], (TMP_2 = function(url, options){var self = TMP_2.$$s || this, block; | |
block = TMP_2.$$p || nil; | |
if (block) TMP_2.$$p = null; | |
if (options == null) { | |
options = $hash2([], {}); | |
}if (url == null) url = nil; | |
return self.$new().$send(action, url, options, block)}, TMP_2.$$s = self, TMP_2.$$arity = -2, TMP_2)); | |
return $send(self, 'define_method', [action], (TMP_3 = function(url, options){var self = TMP_3.$$s || this, block; | |
block = TMP_3.$$p || nil; | |
if (block) TMP_3.$$p = null; | |
if (options == null) { | |
options = $hash2([], {}); | |
}if (url == null) url = nil; | |
return self.$send(action, url, options, block)}, TMP_3.$$s = self, TMP_3.$$arity = -2, TMP_3));}, TMP_HTTP_1.$$s = self, TMP_HTTP_1.$$arity = 1, TMP_HTTP_1)); | |
self.$attr_reader("body", "error_message", "method", "status_code", "url", "xhr"); | |
Opal.def(self, '$initialize', TMP_HTTP_initialize_4 = function $$initialize() { | |
var self = this; | |
return (self.ok = true) | |
}, TMP_HTTP_initialize_4.$$arity = 0); | |
Opal.defs(self, '$active?', TMP_HTTP_active$q_5 = function() { | |
var self = this, jquery_active_requests = nil; | |
if (self.active_requests == null) self.active_requests = nil; | |
jquery_active_requests = 0; | |
if (typeof jQuery !== "undefined" && typeof jQuery.active !== "undefined" && jQuery.active !== null) { | |
jquery_active_requests = jQuery.active; | |
} | |
; | |
return $rb_gt($rb_plus(jquery_active_requests, self.active_requests), 0); | |
}, TMP_HTTP_active$q_5.$$arity = 0); | |
Opal.defs(self, '$active_requests', TMP_HTTP_active_requests_6 = function $$active_requests() { | |
var $a, self = this; | |
if (self.active_requests == null) self.active_requests = nil; | |
self.active_requests = ($truthy($a = self.active_requests) ? $a : 0); | |
return self.active_requests; | |
}, TMP_HTTP_active_requests_6.$$arity = 0); | |
Opal.defs(self, '$incr_active_requests', TMP_HTTP_incr_active_requests_7 = function $$incr_active_requests() { | |
var $a, self = this; | |
if (self.active_requests == null) self.active_requests = nil; | |
self.active_requests = ($truthy($a = self.active_requests) ? $a : 0); | |
return (self.active_requests = $rb_plus(self.active_requests, 1)); | |
}, TMP_HTTP_incr_active_requests_7.$$arity = 0); | |
Opal.defs(self, '$decr_active_requests', TMP_HTTP_decr_active_requests_8 = function $$decr_active_requests() { | |
var $a, self = this; | |
if (self.active_requests == null) self.active_requests = nil; | |
self.active_requests = ($truthy($a = self.active_requests) ? $a : 0); | |
self.active_requests = $rb_minus(self.active_requests, 1); | |
if ($truthy($rb_lt(self.active_requests, 0))) { | |
console.log("Ooops, Hyperloop::HTTP active_requests out of sync!"); | |
return (self.active_requests = 0); | |
} else { | |
return nil | |
}; | |
}, TMP_HTTP_decr_active_requests_8.$$arity = 0); | |
Opal.def(self, '$send', TMP_HTTP_send_9 = function $$send(method, url, options, block) { | |
var self = this; | |
self.method = method; | |
self.url = url; | |
self.payload = options.$delete("payload"); | |
self.handler = block; | |
var payload_to_send = null; | |
var content_type = null; | |
if (typeof(this.payload) === 'string') { | |
payload_to_send = this.payload; | |
} | |
else if (this.payload != nil) { | |
payload_to_send = this.payload.$to_json(); | |
content_type = 'application/json'; | |
} | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = function() { | |
if(xhr.readyState === XMLHttpRequest.DONE) { | |
self.$class().$decr_active_requests(); | |
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) { | |
return self.$succeed(xhr.responseText, xhr.status, xhr); | |
} else { | |
return self.$fail(xhr, xhr.status, xhr.statusText); | |
} | |
} | |
} | |
xhr.open(this.method.toUpperCase(), this.url); | |
if (payload_to_send !== null && content_type !== null) { | |
xhr.setRequestHeader("Content-Type", content_type); | |
} | |
if (options["$has_key?"]("headers")) { | |
var headers = options['$[]']("headers"); | |
var keys = headers.$keys(); | |
var keys_length = keys.length; | |
for (var i=0; i < keys_length; i++) { | |
xhr.setRequestHeader( keys[i], headers['$[]'](keys[i]) ); | |
} | |
} | |
if (payload_to_send !== null) { | |
self.$class().$incr_active_requests(); | |
xhr.send(payload_to_send); | |
} else { | |
self.$class().$incr_active_requests(); | |
xhr.send(); | |
} | |
; | |
if ($truthy(self.handler)) { | |
return self | |
} else { | |
return self.$promise() | |
}; | |
}, TMP_HTTP_send_9.$$arity = 4); | |
Opal.def(self, '$json', TMP_HTTP_json_10 = function $$json() { | |
var $a, self = this; | |
return (self.json = ($truthy($a = self.json) ? $a : $$($nesting, 'JSON').$parse(self.body))) | |
}, TMP_HTTP_json_10.$$arity = 0); | |
Opal.def(self, '$ok?', TMP_HTTP_ok$q_11 = function() { | |
var self = this; | |
return self.ok | |
}, TMP_HTTP_ok$q_11.$$arity = 0); | |
Opal.def(self, '$get_header', TMP_HTTP_get_header_12 = function $$get_header(key) { | |
var self = this; | |
var value = self.xhr.getResponseHeader(key); | |
return (value === null) ? nil : value; | |
}, TMP_HTTP_get_header_12.$$arity = 1); | |
Opal.def(self, '$inspect', TMP_HTTP_inspect_13 = function $$inspect() { | |
var self = this; | |
return "" + "#<HTTP @url=" + (self.url) + " @method=" + (self.method) + ">" | |
}, TMP_HTTP_inspect_13.$$arity = 0); | |
self.$private(); | |
Opal.def(self, '$promise', TMP_HTTP_promise_16 = function $$promise() { | |
var TMP_14, self = this; | |
if ($truthy(self.promise)) { | |
return self.promise}; | |
return (self.promise = $send($$($nesting, 'Promise').$new(), 'tap', [], (TMP_14 = function(promise){var self = TMP_14.$$s || this, TMP_15; | |
if (promise == null) promise = nil; | |
return (self.handler = $send(self, 'proc', [], (TMP_15 = function(res){var self = TMP_15.$$s || this; | |
if (res == null) res = nil; | |
if ($truthy(res['$ok?']())) { | |
return promise.$resolve(res) | |
} else { | |
return promise.$reject(res) | |
}}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15)))}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14))); | |
}, TMP_HTTP_promise_16.$$arity = 0); | |
Opal.def(self, '$succeed', TMP_HTTP_succeed_17 = function $$succeed(data, status, xhr) { | |
var self = this; | |
self.body = data; | |
self.xhr = xhr; | |
self.status_code = xhr.status; | |
if (typeof(data) === 'object') { | |
self.json = $$($nesting, 'JSON').$from_object(data); | |
} | |
; | |
if ($truthy(self.handler)) { | |
return self.handler.$call(self) | |
} else { | |
return nil | |
}; | |
}, TMP_HTTP_succeed_17.$$arity = 3); | |
return (Opal.def(self, '$fail', TMP_HTTP_fail_18 = function $$fail(xhr, status, error) { | |
var self = this; | |
self.body = xhr.responseText; | |
self.xhr = xhr; | |
self.status_code = xhr.status; | |
; | |
self.ok = false; | |
if ($truthy(self.handler)) { | |
return self.handler.$call(self) | |
} else { | |
return nil | |
}; | |
}, TMP_HTTP_fail_18.$$arity = 3), nil) && 'fail'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/promise.rb": | |
/*!******************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/promise.rb ***! | |
\******************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/promise"] = function(Opal) { | |
function $rb_plus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); | |
} | |
function $rb_le(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); | |
} | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send; | |
Opal.add_stubs(['$resolve', '$new', '$reject', '$attr_reader', '$===', '$value', '$has_key?', '$keys', '$!', '$==', '$realized?', '$<<', '$>>', '$exception?', '$[]', '$resolved?', '$rejected?', '$error', '$include?', '$action', '$raise', '$^', '$call', '$resolve!', '$exception!', '$any?', '$each', '$reject!', '$there_can_be_only_one!', '$then', '$to_proc', '$fail', '$always', '$trace', '$class', '$object_id', '$+', '$inspect', '$act?', '$nil?', '$prev', '$push', '$concat', '$it', '$proc', '$reverse', '$pop', '$<=', '$length', '$shift', '$-', '$wait', '$map', '$reduce', '$try', '$tap', '$all?', '$find']); | |
return (function($base, $super, $parent_nesting) { | |
function $Promise(){}; | |
var self = $Promise = $klass($base, $super, 'Promise', $Promise); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Promise_value_1, TMP_Promise_error_2, TMP_Promise_when_3, TMP_Promise_initialize_4, TMP_Promise_value_5, TMP_Promise_act$q_6, TMP_Promise_action_7, TMP_Promise_exception$q_8, TMP_Promise_realized$q_9, TMP_Promise_resolved$q_10, TMP_Promise_rejected$q_11, TMP_Promise_pending$q_12, TMP_Promise_$_13, TMP_Promise_$lt$lt_14, TMP_Promise_$gt$gt_15, TMP_Promise_resolve_16, TMP_Promise_resolve$B_18, TMP_Promise_reject_19, TMP_Promise_reject$B_21, TMP_Promise_exception$B_22, TMP_Promise_then_23, TMP_Promise_then$B_24, TMP_Promise_fail_25, TMP_Promise_fail$B_26, TMP_Promise_always_27, TMP_Promise_always$B_28, TMP_Promise_trace_29, TMP_Promise_trace$B_30, TMP_Promise_there_can_be_only_one$B_31, TMP_Promise_inspect_32; | |
def.value = def.action = def.exception = def.realized = def.next = def.delayed = def.error = def.prev = nil; | |
Opal.defs(self, '$value', TMP_Promise_value_1 = function $$value(value) { | |
var self = this; | |
return self.$new().$resolve(value) | |
}, TMP_Promise_value_1.$$arity = 1); | |
Opal.defs(self, '$error', TMP_Promise_error_2 = function $$error(value) { | |
var self = this; | |
return self.$new().$reject(value) | |
}, TMP_Promise_error_2.$$arity = 1); | |
Opal.defs(self, '$when', TMP_Promise_when_3 = function $$when($a_rest) { | |
var self = this, promises; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
promises = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
promises[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
return $$($nesting, 'When').$new(promises) | |
}, TMP_Promise_when_3.$$arity = -1); | |
self.$attr_reader("error", "prev", "next"); | |
Opal.def(self, '$initialize', TMP_Promise_initialize_4 = function $$initialize(action) { | |
var self = this; | |
if (action == null) { | |
action = $hash2([], {}); | |
} | |
self.action = action; | |
self.realized = false; | |
self.exception = false; | |
self.value = nil; | |
self.error = nil; | |
self.delayed = false; | |
self.prev = nil; | |
return (self.next = []); | |
}, TMP_Promise_initialize_4.$$arity = -1); | |
Opal.def(self, '$value', TMP_Promise_value_5 = function $$value() { | |
var self = this; | |
if ($truthy($$($nesting, 'Promise')['$==='](self.value))) { | |
return self.value.$value() | |
} else { | |
return self.value | |
} | |
}, TMP_Promise_value_5.$$arity = 0); | |
Opal.def(self, '$act?', TMP_Promise_act$q_6 = function() { | |
var $a, self = this; | |
return ($truthy($a = self.action['$has_key?']("success")) ? $a : self.action['$has_key?']("always")) | |
}, TMP_Promise_act$q_6.$$arity = 0); | |
Opal.def(self, '$action', TMP_Promise_action_7 = function $$action() { | |
var self = this; | |
return self.action.$keys() | |
}, TMP_Promise_action_7.$$arity = 0); | |
Opal.def(self, '$exception?', TMP_Promise_exception$q_8 = function() { | |
var self = this; | |
return self.exception | |
}, TMP_Promise_exception$q_8.$$arity = 0); | |
Opal.def(self, '$realized?', TMP_Promise_realized$q_9 = function() { | |
var self = this; | |
return self.realized['$!']()['$!']() | |
}, TMP_Promise_realized$q_9.$$arity = 0); | |
Opal.def(self, '$resolved?', TMP_Promise_resolved$q_10 = function() { | |
var self = this; | |
return self.realized['$==']("resolve") | |
}, TMP_Promise_resolved$q_10.$$arity = 0); | |
Opal.def(self, '$rejected?', TMP_Promise_rejected$q_11 = function() { | |
var self = this; | |
return self.realized['$==']("reject") | |
}, TMP_Promise_rejected$q_11.$$arity = 0); | |
Opal.def(self, '$pending?', TMP_Promise_pending$q_12 = function() { | |
var self = this; | |
return self['$realized?']()['$!']() | |
}, TMP_Promise_pending$q_12.$$arity = 0); | |
Opal.def(self, '$^', TMP_Promise_$_13 = function(promise) { | |
var self = this; | |
promise['$<<'](self); | |
self['$>>'](promise); | |
return promise; | |
}, TMP_Promise_$_13.$$arity = 1); | |
Opal.def(self, '$<<', TMP_Promise_$lt$lt_14 = function(promise) { | |
var self = this; | |
self.prev = promise; | |
return self; | |
}, TMP_Promise_$lt$lt_14.$$arity = 1); | |
Opal.def(self, '$>>', TMP_Promise_$gt$gt_15 = function(promise) { | |
var $a, self = this; | |
self.next['$<<'](promise); | |
if ($truthy(self['$exception?']())) { | |
promise.$reject(self.delayed['$[]'](0)) | |
} else if ($truthy(self['$resolved?']())) { | |
promise.$resolve((function() {if ($truthy(self.delayed)) { | |
return self.delayed['$[]'](0) | |
} else { | |
return self.$value() | |
}; return nil; })()) | |
} else if ($truthy(self['$rejected?']())) { | |
if ($truthy(($truthy($a = self.action['$has_key?']("failure")['$!']()) ? $a : $$($nesting, 'Promise')['$===']((function() {if ($truthy(self.delayed)) { | |
return self.delayed['$[]'](0) | |
} else { | |
return self.error | |
}; return nil; })())))) { | |
promise.$reject((function() {if ($truthy(self.delayed)) { | |
return self.delayed['$[]'](0) | |
} else { | |
return self.$error() | |
}; return nil; })()) | |
} else if ($truthy(promise.$action()['$include?']("always"))) { | |
promise.$reject((function() {if ($truthy(self.delayed)) { | |
return self.delayed['$[]'](0) | |
} else { | |
return self.$error() | |
}; return nil; })())}}; | |
return self; | |
}, TMP_Promise_$gt$gt_15.$$arity = 1); | |
Opal.def(self, '$resolve', TMP_Promise_resolve_16 = function $$resolve(value) { | |
var $a, self = this, block = nil, e = nil; | |
if (value == null) { | |
value = nil; | |
} | |
if ($truthy(self['$realized?']())) { | |
self.$raise($$($nesting, 'ArgumentError'), "the promise has already been realized")}; | |
if ($truthy($$($nesting, 'Promise')['$==='](value))) { | |
return value['$<<'](self.prev)['$^'](self)}; | |
try { | |
if ($truthy((block = ($truthy($a = self.action['$[]']("success")) ? $a : self.action['$[]']("always"))))) { | |
value = block.$call(value)}; | |
self['$resolve!'](value); | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
self['$exception!'](e) | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
};; | |
return self; | |
}, TMP_Promise_resolve_16.$$arity = -1); | |
Opal.def(self, '$resolve!', TMP_Promise_resolve$B_18 = function(value) { | |
var TMP_17, self = this; | |
self.realized = "resolve"; | |
self.value = value; | |
if ($truthy(self.next['$any?']())) { | |
return $send(self.next, 'each', [], (TMP_17 = function(p){var self = TMP_17.$$s || this; | |
if (p == null) p = nil; | |
return p.$resolve(value)}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17)) | |
} else { | |
return (self.delayed = [value]) | |
}; | |
}, TMP_Promise_resolve$B_18.$$arity = 1); | |
Opal.def(self, '$reject', TMP_Promise_reject_19 = function $$reject(value) { | |
var $a, self = this, block = nil, e = nil; | |
if (value == null) { | |
value = nil; | |
} | |
if ($truthy(self['$realized?']())) { | |
self.$raise($$($nesting, 'ArgumentError'), "the promise has already been realized")}; | |
if ($truthy($$($nesting, 'Promise')['$==='](value))) { | |
return value['$<<'](self.prev)['$^'](self)}; | |
try { | |
if ($truthy((block = ($truthy($a = self.action['$[]']("failure")) ? $a : self.action['$[]']("always"))))) { | |
value = block.$call(value)}; | |
if ($truthy(self.action['$has_key?']("always"))) { | |
self['$resolve!'](value) | |
} else { | |
self['$reject!'](value) | |
}; | |
} catch ($err) { | |
if (Opal.rescue($err, [$$($nesting, 'Exception')])) {e = $err; | |
try { | |
self['$exception!'](e) | |
} finally { Opal.pop_exception() } | |
} else { throw $err; } | |
};; | |
return self; | |
}, TMP_Promise_reject_19.$$arity = -1); | |
Opal.def(self, '$reject!', TMP_Promise_reject$B_21 = function(value) { | |
var TMP_20, self = this; | |
self.realized = "reject"; | |
self.error = value; | |
if ($truthy(self.next['$any?']())) { | |
return $send(self.next, 'each', [], (TMP_20 = function(p){var self = TMP_20.$$s || this; | |
if (p == null) p = nil; | |
return p.$reject(value)}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20)) | |
} else { | |
return (self.delayed = [value]) | |
}; | |
}, TMP_Promise_reject$B_21.$$arity = 1); | |
Opal.def(self, '$exception!', TMP_Promise_exception$B_22 = function(error) { | |
var self = this; | |
self.exception = true; | |
return self['$reject!'](error); | |
}, TMP_Promise_exception$B_22.$$arity = 1); | |
Opal.def(self, '$then', TMP_Promise_then_23 = function $$then() { | |
var self = this, $iter = TMP_Promise_then_23.$$p, block = $iter || nil; | |
if ($iter) TMP_Promise_then_23.$$p = null; | |
return self['$^']($$($nesting, 'Promise').$new($hash2(["success"], {"success": block}))) | |
}, TMP_Promise_then_23.$$arity = 0); | |
Opal.def(self, '$then!', TMP_Promise_then$B_24 = function() { | |
var self = this, $iter = TMP_Promise_then$B_24.$$p, block = $iter || nil; | |
if ($iter) TMP_Promise_then$B_24.$$p = null; | |
self['$there_can_be_only_one!'](); | |
return $send(self, 'then', [], block.$to_proc()); | |
}, TMP_Promise_then$B_24.$$arity = 0); | |
Opal.alias(self, "do", "then"); | |
Opal.alias(self, "do!", "then!"); | |
Opal.def(self, '$fail', TMP_Promise_fail_25 = function $$fail() { | |
var self = this, $iter = TMP_Promise_fail_25.$$p, block = $iter || nil; | |
if ($iter) TMP_Promise_fail_25.$$p = null; | |
return self['$^']($$($nesting, 'Promise').$new($hash2(["failure"], {"failure": block}))) | |
}, TMP_Promise_fail_25.$$arity = 0); | |
Opal.def(self, '$fail!', TMP_Promise_fail$B_26 = function() { | |
var self = this, $iter = TMP_Promise_fail$B_26.$$p, block = $iter || nil; | |
if ($iter) TMP_Promise_fail$B_26.$$p = null; | |
self['$there_can_be_only_one!'](); | |
return $send(self, 'fail', [], block.$to_proc()); | |
}, TMP_Promise_fail$B_26.$$arity = 0); | |
Opal.alias(self, "rescue", "fail"); | |
Opal.alias(self, "catch", "fail"); | |
Opal.alias(self, "rescue!", "fail!"); | |
Opal.alias(self, "catch!", "fail!"); | |
Opal.def(self, '$always', TMP_Promise_always_27 = function $$always() { | |
var self = this, $iter = TMP_Promise_always_27.$$p, block = $iter || nil; | |
if ($iter) TMP_Promise_always_27.$$p = null; | |
return self['$^']($$($nesting, 'Promise').$new($hash2(["always"], {"always": block}))) | |
}, TMP_Promise_always_27.$$arity = 0); | |
Opal.def(self, '$always!', TMP_Promise_always$B_28 = function() { | |
var self = this, $iter = TMP_Promise_always$B_28.$$p, block = $iter || nil; | |
if ($iter) TMP_Promise_always$B_28.$$p = null; | |
self['$there_can_be_only_one!'](); | |
return $send(self, 'always', [], block.$to_proc()); | |
}, TMP_Promise_always$B_28.$$arity = 0); | |
Opal.alias(self, "finally", "always"); | |
Opal.alias(self, "ensure", "always"); | |
Opal.alias(self, "finally!", "always!"); | |
Opal.alias(self, "ensure!", "always!"); | |
Opal.def(self, '$trace', TMP_Promise_trace_29 = function $$trace(depth) { | |
var self = this, $iter = TMP_Promise_trace_29.$$p, block = $iter || nil; | |
if (depth == null) { | |
depth = nil; | |
} | |
if ($iter) TMP_Promise_trace_29.$$p = null; | |
return self['$^']($$($nesting, 'Trace').$new(depth, block)) | |
}, TMP_Promise_trace_29.$$arity = -1); | |
Opal.def(self, '$trace!', TMP_Promise_trace$B_30 = function($a_rest) { | |
var self = this, args, $iter = TMP_Promise_trace$B_30.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_Promise_trace$B_30.$$p = null; | |
self['$there_can_be_only_one!'](); | |
return $send(self, 'trace', Opal.to_a(args), block.$to_proc()); | |
}, TMP_Promise_trace$B_30.$$arity = -1); | |
Opal.def(self, '$there_can_be_only_one!', TMP_Promise_there_can_be_only_one$B_31 = function() { | |
var self = this; | |
if ($truthy(self.next['$any?']())) { | |
return self.$raise($$($nesting, 'ArgumentError'), "a promise has already been chained") | |
} else { | |
return nil | |
} | |
}, TMP_Promise_there_can_be_only_one$B_31.$$arity = 0); | |
Opal.def(self, '$inspect', TMP_Promise_inspect_32 = function $$inspect() { | |
var $a, self = this, result = nil; | |
result = "" + "#<" + (self.$class()) + "(" + (self.$object_id()) + ")"; | |
if ($truthy(self.next['$any?']())) { | |
result = $rb_plus(result, "" + " >> " + (self.next.$inspect()))}; | |
if ($truthy(self['$realized?']())) { | |
result = $rb_plus(result, "" + ": " + (($truthy($a = self.value) ? $a : self.error).$inspect()) + ">") | |
} else { | |
result = $rb_plus(result, ">") | |
}; | |
return result; | |
}, TMP_Promise_inspect_32.$$arity = 0); | |
(function($base, $super, $parent_nesting) { | |
function $Trace(){}; | |
var self = $Trace = $klass($base, $super, 'Trace', $Trace); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Trace_it_33, TMP_Trace_initialize_34; | |
Opal.defs(self, '$it', TMP_Trace_it_33 = function $$it(promise) { | |
var $a, self = this, current = nil, prev = nil; | |
current = []; | |
if ($truthy(($truthy($a = promise['$act?']()) ? $a : promise.$prev()['$nil?']()))) { | |
current.$push(promise.$value())}; | |
if ($truthy((prev = promise.$prev()))) { | |
return current.$concat(self.$it(prev)) | |
} else { | |
return current | |
}; | |
}, TMP_Trace_it_33.$$arity = 1); | |
return (Opal.def(self, '$initialize', TMP_Trace_initialize_34 = function $$initialize(depth, block) { | |
var TMP_35, self = this, $iter = TMP_Trace_initialize_34.$$p, $yield = $iter || nil; | |
if ($iter) TMP_Trace_initialize_34.$$p = null; | |
self.depth = depth; | |
return $send(self, Opal.find_super_dispatcher(self, 'initialize', TMP_Trace_initialize_34, false), [$hash2(["success"], {"success": $send(self, 'proc', [], (TMP_35 = function(){var self = TMP_35.$$s || this, $a, trace = nil; | |
trace = $$($nesting, 'Trace').$it(self).$reverse(); | |
trace.$pop(); | |
if ($truthy(($truthy($a = depth) ? $rb_le(depth, trace.$length()) : $a))) { | |
trace.$shift($rb_minus(trace.$length(), depth))}; | |
return $send(block, 'call', Opal.to_a(trace));}, TMP_35.$$s = self, TMP_35.$$arity = 0, TMP_35))})], null); | |
}, TMP_Trace_initialize_34.$$arity = 2), nil) && 'initialize'; | |
})($nesting[0], self, $nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $When(){}; | |
var self = $When = $klass($base, $super, 'When', $When); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_When_initialize_36, TMP_When_each_38, TMP_When_collect_40, TMP_When_inject_42, TMP_When_wait_45, TMP_When_$gt$gt_46, TMP_When_try_48; | |
def.wait = nil; | |
Opal.def(self, '$initialize', TMP_When_initialize_36 = function $$initialize(promises) { | |
var TMP_37, self = this, $iter = TMP_When_initialize_36.$$p, $yield = $iter || nil; | |
if (promises == null) { | |
promises = []; | |
} | |
if ($iter) TMP_When_initialize_36.$$p = null; | |
$send(self, Opal.find_super_dispatcher(self, 'initialize', TMP_When_initialize_36, false), [], null); | |
self.wait = []; | |
return $send(promises, 'each', [], (TMP_37 = function(promise){var self = TMP_37.$$s || this; | |
if (promise == null) promise = nil; | |
return self.$wait(promise)}, TMP_37.$$s = self, TMP_37.$$arity = 1, TMP_37)); | |
}, TMP_When_initialize_36.$$arity = -1); | |
Opal.def(self, '$each', TMP_When_each_38 = function $$each() { | |
var TMP_39, self = this, $iter = TMP_When_each_38.$$p, block = $iter || nil; | |
if ($iter) TMP_When_each_38.$$p = null; | |
if ($truthy(block)) { | |
} else { | |
self.$raise($$($nesting, 'ArgumentError'), "no block given") | |
}; | |
return $send(self, 'then', [], (TMP_39 = function(values){var self = TMP_39.$$s || this; | |
if (values == null) values = nil; | |
return $send(values, 'each', [], block.$to_proc())}, TMP_39.$$s = self, TMP_39.$$arity = 1, TMP_39)); | |
}, TMP_When_each_38.$$arity = 0); | |
Opal.def(self, '$collect', TMP_When_collect_40 = function $$collect() { | |
var TMP_41, self = this, $iter = TMP_When_collect_40.$$p, block = $iter || nil; | |
if ($iter) TMP_When_collect_40.$$p = null; | |
if ($truthy(block)) { | |
} else { | |
self.$raise($$($nesting, 'ArgumentError'), "no block given") | |
}; | |
return $send(self, 'then', [], (TMP_41 = function(values){var self = TMP_41.$$s || this; | |
if (values == null) values = nil; | |
return $$($nesting, 'When').$new($send(values, 'map', [], block.$to_proc()))}, TMP_41.$$s = self, TMP_41.$$arity = 1, TMP_41)); | |
}, TMP_When_collect_40.$$arity = 0); | |
Opal.def(self, '$inject', TMP_When_inject_42 = function $$inject($a_rest) { | |
var TMP_43, self = this, args, $iter = TMP_When_inject_42.$$p, block = $iter || nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_When_inject_42.$$p = null; | |
return $send(self, 'then', [], (TMP_43 = function(values){var self = TMP_43.$$s || this; | |
if (values == null) values = nil; | |
return $send(values, 'reduce', Opal.to_a(args), block.$to_proc())}, TMP_43.$$s = self, TMP_43.$$arity = 1, TMP_43)) | |
}, TMP_When_inject_42.$$arity = -1); | |
Opal.alias(self, "map", "collect"); | |
Opal.alias(self, "reduce", "inject"); | |
Opal.def(self, '$wait', TMP_When_wait_45 = function $$wait(promise) { | |
var TMP_44, self = this; | |
if ($truthy($$($nesting, 'Promise')['$==='](promise))) { | |
} else { | |
promise = $$($nesting, 'Promise').$value(promise) | |
}; | |
if ($truthy(promise['$act?']())) { | |
promise = promise.$then()}; | |
self.wait['$<<'](promise); | |
$send(promise, 'always', [], (TMP_44 = function(){var self = TMP_44.$$s || this; | |
if (self.next == null) self.next = nil; | |
if ($truthy(self.next['$any?']())) { | |
return self.$try() | |
} else { | |
return nil | |
}}, TMP_44.$$s = self, TMP_44.$$arity = 0, TMP_44)); | |
return self; | |
}, TMP_When_wait_45.$$arity = 1); | |
Opal.alias(self, "and", "wait"); | |
Opal.def(self, '$>>', TMP_When_$gt$gt_46 = function($a_rest) { | |
var TMP_47, self = this, $iter = TMP_When_$gt$gt_46.$$p, $yield = $iter || nil, $zuper = nil, $zuper_i = nil, $zuper_ii = nil; | |
if ($iter) TMP_When_$gt$gt_46.$$p = null; | |
// Prepare super implicit arguments | |
for($zuper_i = 0, $zuper_ii = arguments.length, $zuper = new Array($zuper_ii); $zuper_i < $zuper_ii; $zuper_i++) { | |
$zuper[$zuper_i] = arguments[$zuper_i]; | |
} | |
return $send($send(self, Opal.find_super_dispatcher(self, '>>', TMP_When_$gt$gt_46, false), $zuper, $iter), 'tap', [], (TMP_47 = function(){var self = TMP_47.$$s || this; | |
return self.$try()}, TMP_47.$$s = self, TMP_47.$$arity = 0, TMP_47)) | |
}, TMP_When_$gt$gt_46.$$arity = -1); | |
return (Opal.def(self, '$try', TMP_When_try_48 = function() { | |
var self = this, promise = nil; | |
if ($truthy($send(self.wait, 'all?', [], "realized?".$to_proc()))) { | |
if ($truthy((promise = $send(self.wait, 'find', [], "rejected?".$to_proc())))) { | |
return self.$reject(promise.$error()) | |
} else { | |
return self.$resolve($send(self.wait, 'map', [], "value".$to_proc())) | |
} | |
} else { | |
return nil | |
} | |
}, TMP_When_try_48.$$arity = 0), nil) && 'try'; | |
})($nesting[0], self, $nesting); | |
})($nesting[0], null, $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway.rb": | |
/*!******************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway.rb ***! | |
\******************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/railway"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Operation(){}; | |
var self = $Operation = $klass($base, $super, 'Operation', $Operation); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return nil | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/dispatcher.rb": | |
/*!*****************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/dispatcher.rb ***! | |
\*****************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/railway/dispatcher"] = function(Opal) { | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$receivers', '$class', '$set_var', '$<<', '$then', '$result', '$each', '$call', '$dispatch_params', '$params_wrapper', '$params']); | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Operation(){}; | |
var self = $Operation = $klass($base, $super, 'Operation', $Operation); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
return (function($base, $super, $parent_nesting) { | |
function $Railway(){}; | |
var self = $Railway = $klass($base, $super, 'Railway', $Railway); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_Railway_receivers_1, TMP_Railway_dispatch_7; | |
Opal.def(self, '$receivers', TMP_Railway_receivers_1 = function $$receivers() { | |
var self = this; | |
return self.$class().$receivers() | |
}, TMP_Railway_receivers_1.$$arity = 0); | |
(function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_receivers_3, TMP_add_receiver_4; | |
Opal.def(self, '$receivers', TMP_receivers_3 = function $$receivers() { | |
var TMP_2, self = this; | |
return $send($$$($$($nesting, 'Hyperloop'), 'Context'), 'set_var', [self, "@receivers", $hash2(["force"], {"force": true})], (TMP_2 = function(){var self = TMP_2.$$s || this; | |
return []}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2)) | |
}, TMP_receivers_3.$$arity = 0); | |
return (Opal.def(self, '$add_receiver', TMP_add_receiver_4 = function $$add_receiver() { | |
var self = this, $iter = TMP_add_receiver_4.$$p, block = $iter || nil; | |
if ($iter) TMP_add_receiver_4.$$p = null; | |
return self.$receivers()['$<<'](block) | |
}, TMP_add_receiver_4.$$arity = 0), nil) && 'add_receiver'; | |
})(Opal.get_singleton_class(self), $nesting); | |
return (Opal.def(self, '$dispatch', TMP_Railway_dispatch_7 = function $$dispatch() { | |
var TMP_5, self = this; | |
return $send(self.$result(), 'then', [], (TMP_5 = function(){var self = TMP_5.$$s || this, TMP_6; | |
return $send(self.$receivers(), 'each', [], (TMP_6 = function(receiver){var self = TMP_6.$$s || this; | |
if (self.operation == null) self.operation = nil; | |
if (receiver == null) receiver = nil; | |
return receiver.$call(self.$class().$params_wrapper().$dispatch_params(self.operation.$params()), self.operation)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6))}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5)) | |
}, TMP_Railway_dispatch_7.$$arity = 0), nil) && 'dispatch'; | |
})($nesting[0], null, $nesting) | |
})($nesting[0], null, $nesting) | |
})($nesting[0], $nesting) | |
} | |
}); | |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../src/opal-webpack-loader-example-app/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js?cd00"))) | |
/***/ }), | |
/***/ "../../Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/params_wrapper.rb": | |
/*!*********************************************************************************************************************************************!*\ | |
!*** /Users/fkchang/Developer/.rvm/gems/ruby-2.5.1/bundler/gems/hyper-operation-e84d5b3e9f62/lib/hyper-operation/railway/params_wrapper.rb ***! | |
\*********************************************************************************************************************************************/ | |
/*! exports provided: default */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
__webpack_require__.r(__webpack_exports__); | |
/* WEBPACK VAR INJECTION */(function(global) {/* Generated by Opal 0.11.1.dev */ | |
/* harmony default export */ __webpack_exports__["default"] = (function() { | |
global.Opal.modules["hyper-operation/railway/params_wrapper"] = function(Opal) { | |
function $rb_minus(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); | |
} | |
function $rb_gt(lhs, rhs) { | |
return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); | |
} | |
var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $send = Opal.send, $hash2 = Opal.hash2; | |
Opal.add_stubs(['$dup', '$each', '$inbound_params', '$class', '$delete', '$with_indifferent_access', '$to_s', '$to_h', '$inject', '$respond_to?', '$raise', '$new', '$merge!', '$combine_arg_array', '$filter', '$hash_filter', '$instance_eval', '$translate_args', '$to_proc', '$<<', '$key?', '$optional', '$send', '$required', '$define_method', '$[]', '$method_missing', '$[]=', '$-', '$lock', '$get_name_and_opts', '$is_a?', '$>', '$count', '$first', '$==', '$proc', '$duck', '$underscore', '$last', '$process_params', '$params_wrapper', '$add_param', '$set_var', '$superclass', '$tap', '$instance_variable_set']); | |
return (function($base, $parent_nesting) { | |
function $Hyperloop() {}; | |
var self = $Hyperloop = $module($base, 'Hyperloop', $Hyperloop); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $Operation(){}; | |
var self = $Operation = $klass($base, $super, 'Operation', $Operation); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting); | |
(function($base, $super, $parent_nesting) { | |
function $ParamsWrapper(){}; | |
var self = $ParamsWrapper = $klass($base, $super, 'ParamsWrapper', $ParamsWrapper); | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_ParamsWrapper_initialize_1, TMP_ParamsWrapper_lock_2, TMP_ParamsWrapper_to_h_4, TMP_ParamsWrapper_to_s_5; | |
def.inputs = def.locked = nil; | |
Opal.def(self, '$initialize', TMP_ParamsWrapper_initialize_1 = function $$initialize(inputs) { | |
var self = this; | |
return (self.inputs = inputs) | |
}, TMP_ParamsWrapper_initialize_1.$$arity = 1); | |
Opal.def(self, '$lock', TMP_ParamsWrapper_lock_2 = function $$lock() { | |
var self = this; | |
self.locked = true; | |
return self; | |
}, TMP_ParamsWrapper_lock_2.$$arity = 0); | |
Opal.def(self, '$to_h', TMP_ParamsWrapper_to_h_4 = function $$to_h() { | |
var TMP_3, self = this, inputs = nil; | |
inputs = self.inputs; | |
if ($truthy(self.locked)) { | |
inputs = inputs.$dup(); | |
$send(self.$class().$inbound_params(), 'each', [], (TMP_3 = function(name){var self = TMP_3.$$s || this; | |
if (name == null) name = nil; | |
return inputs.$delete("" + (name))}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3));}; | |
return inputs.$with_indifferent_access(); | |
}, TMP_ParamsWrapper_to_h_4.$$arity = 0); | |
Opal.def(self, '$to_s', TMP_ParamsWrapper_to_s_5 = function $$to_s() { | |
var self = this; | |
return self.$to_h().$to_s() | |
}, TMP_ParamsWrapper_to_s_5.$$arity = 0); | |
return (function(self, $parent_nesting) { | |
var def = self.prototype, $nesting = [self].concat($parent_nesting), TMP_combine_arg_array_7, TMP_process_params_9, TMP_add_param_10, TMP_dispatch_params_17, TMP_hash_filter_18, TMP_inbound_params_19, TMP_translate_args_20, TMP_get_name_and_opts_23; | |
Opal.def(self, '$combine_arg_array', TMP_combine_arg_array_7 = function $$combine_arg_array(args) { | |
var TMP_6, self = this, hash = nil; | |
return (hash = $send(args, 'inject', [$hash2([], {}).$with_indifferent_access()], (TMP_6 = function(h, arg){var self = TMP_6.$$s || this; | |
if (h == null) h = nil;if (arg == null) arg = nil; | |
if ($truthy(arg['$respond_to?']("to_h"))) { | |
} else { | |
self.$raise($$($nesting, 'ArgumentError').$new("All arguments must be hashes")) | |
}; | |
return h['$merge!'](arg.$to_h());}, TMP_6.$$s = self, TMP_6.$$arity = 2, TMP_6))) | |
}, TMP_combine_arg_array_7.$$arity = 1); | |
Opal.def(self, '$process_params', TMP_process_params_9 = function $$process_params(operation, args) { | |
var $a, $b, TMP_8, self = this, raw_inputs = nil, inputs = nil, errors = nil, params_wrapper = nil; | |
raw_inputs = self.$combine_arg_array(args); | |
$b = self.$hash_filter().$filter(raw_inputs), $a = Opal.to_ary($b), (inputs = ($a[0] == null ? nil : $a[0])), (errors = ($a[1] == null ? nil : $a[1])), $b; | |
params_wrapper = self.$new(inputs); | |
return $send(operation, 'instance_eval', [], (TMP_8 = function(){var self = TMP_8.$$s || this, $c; | |
return $c = [raw_inputs, params_wrapper, errors], (self.raw_inputs = $c[0]), (self.params = $c[1]), (self.errors = $c[2]), $c}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8)); | |
}, TMP_process_params_9.$$arity = 2); | |
Opal.def(self, '$add_param', TMP_add_param_10 = function $$add_param($a_rest) { | |
var $b, $c, TMP_11, TMP_12, TMP_13, TMP_14, self = this, args, $iter = TMP_add_param_10.$$p, block = $iter || nil, type_method = nil, name = nil, opts = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_add_param_10.$$p = null; | |
$c = $send(self, 'translate_args', Opal.to_a(args), block.$to_proc()), $b = Opal.to_ary($c), (type_method = ($b[0] == null ? nil : $b[0])), (name = ($b[1] == null ? nil : $b[1])), (opts = ($b[2] == null ? nil : $b[2])), (block = ($b[3] == null ? nil : $b[3])), $c; | |
if ($truthy(opts.$delete("inbound"))) { | |
self.$inbound_params()['$<<']("" + (name))}; | |
if ($truthy(opts['$key?']("default"))) { | |
$send(self.$hash_filter(), 'optional', [], (TMP_11 = function(){var self = TMP_11.$$s || this; | |
return $send(self, 'send', [type_method, name, opts], block.$to_proc())}, TMP_11.$$s = self, TMP_11.$$arity = 0, TMP_11)) | |
} else { | |
$send(self.$hash_filter(), 'required', [], (TMP_12 = function(){var self = TMP_12.$$s || this; | |
return $send(self, 'send', [type_method, name, opts], block.$to_proc())}, TMP_12.$$s = self, TMP_12.$$arity = 0, TMP_12)) | |
}; | |
$send(self, 'define_method', [name], (TMP_13 = function(){var self = TMP_13.$$s || this; | |
if (self.inputs == null) self.inputs = nil; | |
return self.inputs['$[]'](name)}, TMP_13.$$s = self, TMP_13.$$arity = 0, TMP_13)); | |
return $send(self, 'define_method', ["" + (name) + "="], (TMP_14 = function(x){var self = TMP_14.$$s || this, $writer = nil; | |
if (self.locked == null) self.locked = nil; | |
if (self.inputs == null) self.inputs = nil; | |
if (x == null) x = nil; | |
if ($truthy(self.locked)) { | |
self.$method_missing("" + (name) + "=", x)}; | |
$writer = [name, x]; | |
$send(self.inputs, '[]=', Opal.to_a($writer)); | |
return $writer[$rb_minus($writer["length"], 1)];;}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14)); | |
}, TMP_add_param_10.$$arity = -1); | |
Opal.def(self, '$dispatch_params', TMP_dispatch_params_17 = function $$dispatch_params(params, hashes) { | |
var TMP_15, self = this; | |
if (hashes == null) { | |
hashes = $hash2([], {}); | |
} | |
params = params.$dup(); | |
$send(hashes, 'each', [], (TMP_15 = function(hash){var self = TMP_15.$$s || this, TMP_16; | |
if (hash == null) hash = nil; | |
return $send(hash, 'each', [], (TMP_16 = function(k, v){var self = TMP_16.$$s || this; | |
if (k == null) k = nil;if (v == null) v = nil; | |
return params.$send("" + (k) + "=", v)}, TMP_16.$$s = self, TMP_16.$$arity = 2, TMP_16))}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15)); | |
return params.$lock(); | |
}, TMP_dispatch_params_17.$$arity = -2); | |
Opal.def(self, '$hash_filter', TMP_hash_filter_18 = function $$hash_filter() { | |
var $a, self = this; | |
if (self.hash_filter == null) self.hash_filter = nil; | |
return (self.hash_filter = ($truthy($a = self.hash_filter) ? $a : $$$($$($nesting, 'Mutations'), 'HashFilter').$new())) | |
}, TMP_hash_filter_18.$$arity = 0); | |
Opal.def(self, '$inbound_params', TMP_inbound_params_19 = function $$inbound_params() { | |
var $a, self = this; | |
if (self.inbound_params == null) self.inbound_params = nil; | |
return (self.inbound_params = ($truthy($a = self.inbound_params) ? $a : $$($nesting, 'Set').$new())) | |
}, TMP_inbound_params_19.$$arity = 0); | |
Opal.def(self, '$translate_args', TMP_translate_args_20 = function $$translate_args($a_rest) { | |
var $b, $c, TMP_21, TMP_22, self = this, args, $iter = TMP_translate_args_20.$$p, block = $iter || nil, name = nil, opts = nil, type_method = nil, $writer = nil; | |
var $args_len = arguments.length, $rest_len = $args_len - 0; | |
if ($rest_len < 0) { $rest_len = 0; } | |
args = new Array($rest_len); | |
for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { | |
args[$arg_idx - 0] = arguments[$arg_idx]; | |
} | |
if ($iter) TMP_translate_args_20.$$p = null; | |
$c = $send(self, 'get_name_and_opts', Opal.to_a(args)), $b = Opal.to_ary($c), (name = ($b[0] == null ? nil : $b[0])), (opts = ($b[1] == null ? nil : $b[1])), $c; | |
if ($truthy(opts['$key?']("type"))) { | |
type_method = opts.$delete("type"); | |
if ($truthy(type_method['$is_a?']($$($nesting, 'Array')))) { | |
if ($truthy($rb_gt(type_method.$count(), 0))) { | |
$writer = ["class", type_method.$first()]; | |
$send(opts, '[]=', Opal.to_a($writer)); | |
$writer[$rb_minus($writer["length"], 1)];}; | |
type_method = $$($nesting, 'Array'); | |
} else if ($truthy(($truthy($b = type_method['$is_a?']($$($nesting, 'Hash'))) ? $b : type_method['$==']($$($nesting, 'Hash'))))) { | |
type_method = $$($nesting, 'Hash'); | |
block = ($truthy($b = block) ? $b : $send(self, 'proc', [], (TMP_21 = funct |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment