Source: infra-sk/dist/uniform-imageresolution-sk-bundle.js

/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// 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: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// 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 = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = "./modules/uniform-imageresolution-sk/uniform-imageresolution-sk-demo.ts");
/******/ })
/************************************************************************/
/******/ ({

/***/ "../node_modules/common-sk/modules/dom.js":
/*!************************************************!*\
  !*** ../node_modules/common-sk/modules/dom.js ***!
  \************************************************/
/*! exports provided: DomReady, $, $$, findParent, findParentSafe */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomReady", function() { return DomReady; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$", function() { return $; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$", function() { return $$; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findParent", function() { return findParent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findParentSafe", function() { return findParentSafe; });
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/** @module common-sk/modules/dom */
/**
 * A Promise that resolves when DOMContentLoaded has fired.
 */
const DomReady = new Promise((resolve) => {
    if (document.readyState !== 'loading') {
        // If readyState is already past loading then
        // DOMContentLoaded has already fired, so just resolve.
        resolve();
    }
    else {
        document.addEventListener('DOMContentLoaded', resolve);
    }
});
/** @function $
 *
 * @description Returns a real JS array of DOM elements that match the CSS selector.
 *
 * @param query CSS selector string.
 * @param ele The Element to start the search from.
 * @returns Array of DOM Elements that match the CSS selector.
 *
 */
function $(query, ele = document) {
    return Array.from(ele.querySelectorAll(query));
}
/** @function $$
 *
 * @description Returns the first DOM element that matches the CSS query selector.
 *
 * @param query CSS selector string.
 * @param ele The Element to start the search from.
 * @returns The first Element in DOM order that matches the CSS selector.
 */
function $$(query, ele = document) {
    return ele.querySelector(query);
}
/**
 * Find the first parent of 'ele' with the given 'nodeName'.
 *
 * @param ele - The element to start searching a.
 * @param nodeName - The node name we are looking for.
 * @returns Either 'ele' or the first parent of 'ele' that has the nodeName of 'nodeName'. Returns null if none are found.
 *
 * @example
 *
 *   findParent(ele, 'DIV')
 *
 */
function findParent(ele, nodeName) {
    while (ele !== null) {
        if (ele.nodeName === nodeName) {
            return ele;
        }
        ele = ele.parentElement;
    }
    return null;
}
/**
 * Find the first parent of 'ele' with the given 'nodeName'. Just like findParent, but TypeScript typesafe.
 *
 * @param ele - The element to start searching a.
 * @param nodeName - The lower-case node name we are looking for, e.g. 'div'.
 * @returns Either 'ele' or the first parent of 'ele' that has the nodeName of 'nodeName'. Returns null if none are found.
 *
 * @example
 *
 *   findParentSafe(ele, 'div')
 *
 */
function findParentSafe(ele, nodeName) {
    while (ele !== null) {
        if (ele.nodeName.toLowerCase() === nodeName) {
            return ele;
        }
        ele = ele.parentElement;
    }
    return null;
}
//# sourceMappingURL=dom.js.map

/***/ }),

/***/ "../node_modules/elements-sk/define.js":
/*!*********************************************!*\
  !*** ../node_modules/elements-sk/define.js ***!
  \*********************************************/
/*! exports provided: define */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "define", function() { return define; });
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/** @module elements-sk/define */
/**
 * Define a custom element definition. It will only define a tag name once
 * and will log an error if there's an attempt to define a tag name a second
 * time. This is useful for tests since you can't undefine a custom element.
 *
 * See also https://github.com/karma-runner/karma/issues/412
 *
 * @param tagName - The name of the tag.
 * @param cl - The class for the given tag.
 *
 * @example
 *
 * Instead of:
 *
 *     window.customElements.define('my-element', class extends HTMLElement {...});
 *
 * Use:
 *
 *     import { define } from 'elements-sk/define'
 *     define('my-element', class extends HTMLElement {...});
 *
 */
function define(tagName, cl) {
    if (window.customElements.get(tagName) === undefined) {
        window.customElements.define(tagName, cl);
    }
    else {
        console.log(`Multiple registration attempts for ${tagName}. ` +
            'This should only happen during testing, ' +
            'it\'s probably an error outside of testing.');
    }
}
//# sourceMappingURL=define.js.map

/***/ }),

/***/ "./modules/uniform-imageresolution-sk/index.ts":
/*!*****************************************************!*\
  !*** ./modules/uniform-imageresolution-sk/index.ts ***!
  \*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__webpack_require__(/*! ./uniform-imageresolution-sk */ "./modules/uniform-imageresolution-sk/uniform-imageresolution-sk.ts");
__webpack_require__(/*! ./uniform-imageresolution-sk.scss */ "./modules/uniform-imageresolution-sk/uniform-imageresolution-sk.scss");


/***/ }),

/***/ "./modules/uniform-imageresolution-sk/uniform-imageresolution-sk-demo.ts":
/*!*******************************************************************************!*\
  !*** ./modules/uniform-imageresolution-sk/uniform-imageresolution-sk-demo.ts ***!
  \*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const dom_1 = __webpack_require__(/*! common-sk/modules/dom */ "../node_modules/common-sk/modules/dom.js");
__webpack_require__(/*! ./index */ "./modules/uniform-imageresolution-sk/index.ts");
dom_1.$$('#apply').addEventListener('click', () => {
    const uniforms = [0, 0, 0];
    dom_1.$('uniform-imageresolution-sk').forEach((ele) => {
        ele.applyUniformValues(uniforms);
    });
    dom_1.$$('#results').innerText = uniforms.toString();
});


/***/ }),

/***/ "./modules/uniform-imageresolution-sk/uniform-imageresolution-sk.scss":
/*!****************************************************************************!*\
  !*** ./modules/uniform-imageresolution-sk/uniform-imageresolution-sk.scss ***!
  \****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

// extracted by mini-css-extract-plugin

/***/ }),

/***/ "./modules/uniform-imageresolution-sk/uniform-imageresolution-sk.ts":
/*!**************************************************************************!*\
  !*** ./modules/uniform-imageresolution-sk/uniform-imageresolution-sk.ts ***!
  \**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.UniformImageresolutionSk = exports.imageSize = void 0;
/**
 * @module modules/uniform-imageresolution-sk
 * @description <h2><code>uniform-imageresolution-sk</code></h2>
 *
 * Control to handle the input image resolution.
 *
 * Note this control doesn't display anything.
 */
const define_1 = __webpack_require__(/*! elements-sk/define */ "../node_modules/elements-sk/define.js");
// All source images are 512 x 512 px.
exports.imageSize = 512;
const defaultUniform = {
    name: 'iImageResolution',
    rows: 3,
    columns: 1,
    slot: 0,
};
class UniformImageresolutionSk extends HTMLElement {
    constructor() {
        super(...arguments);
        this._uniform = defaultUniform;
    }
    applyUniformValues(uniforms) {
        uniforms[this._uniform.slot] = exports.imageSize;
        uniforms[this._uniform.slot + 1] = exports.imageSize;
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    restoreUniformValues(uniforms) {
        // This is a noop, we don't restore predefined uniform values.
    }
    onRAF() {
        // noop
    }
    needsRAF() {
        return false;
    }
    get uniform() {
        return this._uniform;
    }
    set uniform(val) {
        if (val.columns !== 3 || val.rows !== 1) {
            throw new Error('The imageresolution uniform must be a float3.');
        }
        this._uniform = val;
    }
}
exports.UniformImageresolutionSk = UniformImageresolutionSk;
define_1.define('uniform-imageresolution-sk', UniformImageresolutionSk);


/***/ })

/******/ });
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vLy4uL25vZGVfbW9kdWxlcy9jb21tb24tc2svbW9kdWxlcy9kb20uanMiLCJ3ZWJwYWNrOi8vLy4uL25vZGVfbW9kdWxlcy9lbGVtZW50cy1zay9kZWZpbmUuanMiLCJ3ZWJwYWNrOi8vLy4vbW9kdWxlcy91bmlmb3JtLWltYWdlcmVzb2x1dGlvbi1zay9pbmRleC50cyIsIndlYnBhY2s6Ly8vLi9tb2R1bGVzL3VuaWZvcm0taW1hZ2VyZXNvbHV0aW9uLXNrL3VuaWZvcm0taW1hZ2VyZXNvbHV0aW9uLXNrLWRlbW8udHMiLCJ3ZWJwYWNrOi8vLy4vbW9kdWxlcy91bmlmb3JtLWltYWdlcmVzb2x1dGlvbi1zay91bmlmb3JtLWltYWdlcmVzb2x1dGlvbi1zay5zY3NzIiwid2VicGFjazovLy8uL21vZHVsZXMvdW5pZm9ybS1pbWFnZXJlc29sdXRpb24tc2svdW5pZm9ybS1pbWFnZXJlc29sdXRpb24tc2sudHMiXSwibmFtZ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