skatejs-named-slots
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -63,9 +63,11 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var _debounce = __webpack_require__(1); | ||
__webpack_require__(1); | ||
var _debounce = __webpack_require__(2); | ||
var _debounce2 = _interopRequireDefault(_debounce); | ||
__webpack_require__(3); | ||
var _weakmap = __webpack_require__(4); | ||
__webpack_require__(4); | ||
var _weakmap2 = _interopRequireDefault(_weakmap); | ||
@@ -122,2 +124,5 @@ var _each = __webpack_require__(5); | ||
// TODO move into the skatejs-web-components package. | ||
var arrProto = Array.prototype; | ||
@@ -155,11 +160,11 @@ var forEach = arrProto.forEach; | ||
// Private data stores. | ||
var assignedToSlotMap = new WeakMap(); | ||
var hostToModeMap = new WeakMap(); | ||
var hostToRootMap = new WeakMap(); | ||
var nodeToChildNodesMap = new WeakMap(); | ||
var nodeToParentNodeMap = new WeakMap(); | ||
var nodeToSlotMap = new WeakMap(); | ||
var rootToHostMap = new WeakMap(); | ||
var rootToSlotMap = new WeakMap(); | ||
var slotToRootMap = new WeakMap(); | ||
var assignedToSlotMap = new _weakmap2.default(); | ||
var hostToModeMap = new _weakmap2.default(); | ||
var hostToRootMap = new _weakmap2.default(); | ||
var nodeToChildNodesMap = new _weakmap2.default(); | ||
var nodeToParentNodeMap = new _weakmap2.default(); | ||
var nodeToSlotMap = new _weakmap2.default(); | ||
var rootToHostMap = new _weakmap2.default(); | ||
var rootToSlotMap = new _weakmap2.default(); | ||
var slotToRootMap = new _weakmap2.default(); | ||
@@ -1090,2 +1095,53 @@ // Unfortunately manual DOM parsing is because of WebKit. | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
// Polyfill for creating CustomEvents on IE9/10/11 | ||
// code pulled from: | ||
// https://github.com/d4tocchini/customevent-polyfill | ||
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill | ||
try { | ||
var ce = new window.CustomEvent('test'); | ||
ce.preventDefault(); | ||
if (ce.defaultPrevented !== true) { | ||
// IE has problems with .preventDefault() on custom events | ||
// http://stackoverflow.com/questions/23349191 | ||
throw new Error('Could not prevent default'); | ||
} | ||
} catch (e) { | ||
var CustomEvent = function CustomEvent(event, params) { | ||
var evt, origPrevent; | ||
params = params || { | ||
bubbles: false, | ||
cancelable: false, | ||
detail: undefined | ||
}; | ||
evt = document.createEvent("CustomEvent"); | ||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | ||
origPrevent = evt.preventDefault; | ||
evt.preventDefault = function () { | ||
origPrevent.call(this); | ||
try { | ||
Object.defineProperty(this, 'defaultPrevented', { | ||
get: function get() { | ||
return true; | ||
} | ||
}); | ||
} catch (e) { | ||
this.defaultPrevented = true; | ||
} | ||
}; | ||
return evt; | ||
}; | ||
CustomEvent.prototype = window.Event.prototype; | ||
window.CustomEvent = CustomEvent; // expose definition to window | ||
} | ||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
@@ -1099,3 +1155,3 @@ | ||
var now = __webpack_require__(2); | ||
var now = __webpack_require__(3); | ||
@@ -1150,3 +1206,3 @@ /** | ||
/***/ }, | ||
/* 2 */ | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
@@ -1163,103 +1219,238 @@ | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports) { | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
// Polyfill for creating CustomEvents on IE9/10/11 | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
// code pulled from: | ||
// https://github.com/d4tocchini/customevent-polyfill | ||
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill | ||
/* (The MIT License) | ||
* | ||
* Copyright (c) 2012 Brandon Benvie <http://bbenvie.com> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | ||
* associated documentation files (the 'Software'), to deal in the Software without restriction, | ||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, | ||
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included with all copies or | ||
* substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING | ||
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
try { | ||
var ce = new window.CustomEvent('test'); | ||
ce.preventDefault(); | ||
if (ce.defaultPrevented !== true) { | ||
// IE has problems with .preventDefault() on custom events | ||
// http://stackoverflow.com/questions/23349191 | ||
throw new Error('Could not prevent default'); | ||
// Original WeakMap implementation by Gozala @ https://gist.github.com/1269991 | ||
// Updated and bugfixed by Raynos @ https://gist.github.com/1638059 | ||
// Expanded by Benvie @ https://github.com/Benvie/harmony-collections | ||
void function (global, undefined_, undefined) { | ||
var getProps = Object.getOwnPropertyNames, | ||
defProp = Object.defineProperty, | ||
toSource = Function.prototype.toString, | ||
create = Object.create, | ||
hasOwn = Object.prototype.hasOwnProperty, | ||
funcName = /^\n?function\s?(\w*)?_?\(/; | ||
function define(object, key, value) { | ||
if (typeof key === 'function') { | ||
value = key; | ||
key = nameOf(value).replace(/_$/, ''); | ||
} | ||
return defProp(object, key, { configurable: true, writable: true, value: value }); | ||
} | ||
} catch (e) { | ||
var CustomEvent = function CustomEvent(event, params) { | ||
var evt, origPrevent; | ||
params = params || { | ||
bubbles: false, | ||
cancelable: false, | ||
detail: undefined | ||
function nameOf(func) { | ||
return typeof func !== 'function' ? '' : 'name' in func ? func.name : toSource.call(func).match(funcName)[1]; | ||
} | ||
// ############ | ||
// ### Data ### | ||
// ############ | ||
var Data = function () { | ||
var dataDesc = { value: { writable: true, value: undefined } }, | ||
datalock = 'return function(k){if(k===s)return l}', | ||
uids = create(null), | ||
createUID = function createUID() { | ||
var key = Math.random().toString(36).slice(2); | ||
return key in uids ? createUID() : uids[key] = key; | ||
}, | ||
globalID = createUID(), | ||
storage = function storage(obj) { | ||
if (hasOwn.call(obj, globalID)) return obj[globalID]; | ||
if (!Object.isExtensible(obj)) throw new TypeError("Object must be extensible"); | ||
var store = create(null); | ||
defProp(obj, globalID, { value: store }); | ||
return store; | ||
}; | ||
evt = document.createEvent("CustomEvent"); | ||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | ||
origPrevent = evt.preventDefault; | ||
evt.preventDefault = function () { | ||
origPrevent.call(this); | ||
try { | ||
Object.defineProperty(this, 'defaultPrevented', { | ||
get: function get() { | ||
return true; | ||
} | ||
// common per-object storage area made visible by patching getOwnPropertyNames' | ||
define(Object, function getOwnPropertyNames(obj) { | ||
var props = getProps(obj); | ||
if (hasOwn.call(obj, globalID)) props.splice(props.indexOf(globalID), 1); | ||
return props; | ||
}); | ||
function Data() { | ||
var puid = createUID(), | ||
secret = {}; | ||
this.unlock = function (obj) { | ||
var store = storage(obj); | ||
if (hasOwn.call(store, puid)) return store[puid](secret); | ||
var data = create(null, dataDesc); | ||
defProp(store, puid, { | ||
value: new Function('s', 'l', datalock)(secret, data) | ||
}); | ||
} catch (e) { | ||
this.defaultPrevented = true; | ||
return data; | ||
}; | ||
} | ||
define(Data.prototype, function get(o) { | ||
return this.unlock(o).value; | ||
}); | ||
define(Data.prototype, function set(o, v) { | ||
this.unlock(o).value = v; | ||
}); | ||
return Data; | ||
}(); | ||
var WM = function (data) { | ||
var validate = function validate(key) { | ||
if (key == null || (typeof key === 'undefined' ? 'undefined' : _typeof(key)) !== 'object' && typeof key !== 'function') throw new TypeError("Invalid WeakMap key"); | ||
}; | ||
var wrap = function wrap(collection, value) { | ||
var store = data.unlock(collection); | ||
if (store.value) throw new TypeError("Object is already a WeakMap"); | ||
store.value = value; | ||
}; | ||
var unwrap = function unwrap(collection) { | ||
var storage = data.unlock(collection).value; | ||
if (!storage) throw new TypeError("WeakMap is not generic"); | ||
return storage; | ||
}; | ||
var initialize = function initialize(weakmap, iterable) { | ||
if (iterable !== null && (typeof iterable === 'undefined' ? 'undefined' : _typeof(iterable)) === 'object' && typeof iterable.forEach === 'function') { | ||
iterable.forEach(function (item, i) { | ||
if (item instanceof Array && item.length === 2) set.call(weakmap, iterable[i][0], iterable[i][1]); | ||
}); | ||
} | ||
}; | ||
return evt; | ||
}; | ||
CustomEvent.prototype = window.Event.prototype; | ||
window.CustomEvent = CustomEvent; // expose definition to window | ||
} | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports) { | ||
'use strict'; | ||
function WeakMap(iterable) { | ||
if (this === global || this == null || this === WeakMap.prototype) return new WeakMap(iterable); | ||
/** | ||
* @license | ||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
* Code distributed by Google as part of the polymer project is also | ||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
*/ | ||
wrap(this, new Data()); | ||
initialize(this, iterable); | ||
} | ||
if (typeof WeakMap === 'undefined') { | ||
(function () { | ||
var defineProperty = Object.defineProperty; | ||
var counter = Date.now() % 1e9; | ||
function get(key) { | ||
validate(key); | ||
var value = unwrap(this).get(key); | ||
return value === undefined_ ? undefined : value; | ||
} | ||
var WeakMap = function WeakMap() { | ||
this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__'); | ||
function set(key, value) { | ||
validate(key); | ||
// store a token for explicit undefined so that "has" works correctly | ||
unwrap(this).set(key, value === undefined ? undefined_ : value); | ||
} | ||
function has(key) { | ||
validate(key); | ||
return unwrap(this).get(key) !== undefined; | ||
} | ||
function delete_(key) { | ||
validate(key); | ||
var data = unwrap(this), | ||
had = data.get(key) !== undefined; | ||
data.set(key, undefined); | ||
return had; | ||
} | ||
function toString() { | ||
unwrap(this); | ||
return '[object WeakMap]'; | ||
} | ||
try { | ||
var src = ('return ' + delete_).replace('e_', '\\u0065'), | ||
del = new Function('unwrap', 'validate', src)(unwrap, validate); | ||
} catch (e) { | ||
var del = delete_; | ||
} | ||
var src = ('' + Object).split('Object'); | ||
var stringifier = function toString() { | ||
return src[0] + nameOf(this) + src[1]; | ||
}; | ||
WeakMap.prototype = { | ||
set: function set(key, value) { | ||
var entry = key[this.name]; | ||
if (entry && entry[0] === key) entry[1] = value;else defineProperty(key, this.name, { value: [key, value], writable: true }); | ||
return this; | ||
}, | ||
get: function get(key) { | ||
var entry; | ||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; | ||
}, | ||
delete: function _delete(key) { | ||
var entry = key[this.name]; | ||
if (!entry || entry[0] !== key) return false; | ||
entry[0] = entry[1] = undefined; | ||
return true; | ||
}, | ||
has: function has(key) { | ||
var entry = key[this.name]; | ||
if (!entry) return false; | ||
return entry[0] === key; | ||
} | ||
define(stringifier, stringifier); | ||
var prep = { __proto__: [] } instanceof Array ? function (f) { | ||
f.__proto__ = stringifier; | ||
} : function (f) { | ||
define(f, stringifier); | ||
}; | ||
window.WeakMap = WeakMap; | ||
})(); | ||
} | ||
prep(WeakMap); | ||
[toString, get, set, has, del].forEach(function (method) { | ||
define(WeakMap.prototype, method); | ||
prep(method); | ||
}); | ||
return WeakMap; | ||
}(new Data()); | ||
var defaultCreator = Object.create ? function () { | ||
return Object.create(null); | ||
} : function () { | ||
return {}; | ||
}; | ||
function createStorage(creator) { | ||
var weakmap = new WM(); | ||
creator || (creator = defaultCreator); | ||
function storage(object, value) { | ||
if (value || arguments.length === 2) { | ||
weakmap.set(object, value); | ||
} else { | ||
value = weakmap.get(object); | ||
if (value === undefined) { | ||
value = creator(object); | ||
weakmap.set(object, value); | ||
} | ||
} | ||
return value; | ||
} | ||
return storage; | ||
} | ||
if (true) { | ||
module.exports = WM; | ||
} else if (typeof exports !== 'undefined') { | ||
exports.WeakMap = WM; | ||
} else if (!('WeakMap' in global)) { | ||
global.WeakMap = WM; | ||
} | ||
WM.createStorage = createStorage; | ||
if (global.WeakMap) global.WeakMap.createStorage = createStorage; | ||
}((0, eval)('this')); | ||
@@ -1564,3 +1755,3 @@ /***/ }, | ||
__webpack_require__(3); | ||
__webpack_require__(1); | ||
@@ -1567,0 +1758,0 @@ var $shadowRoot = '__shadowRoot'; |
@@ -1,11 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.skatejsNamedSlots=t():e.skatejsNamedSlots=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=document.createElement("div");if(k["default"])return t.__innerHTML=e,t;for(var n=be.parseFromString("<div>"+e+"</div>","text/html").body.firstChild;n.hasChildNodes();){var r=n.firstChild;n.removeChild(r),t.appendChild(r)}return document.importNode(t,!0)}function i(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n}})}function u(e){return this[e]}function a(e){return e.item=u,e}function s(e){return!!pe.get(e)}function l(e){return s(e)?"host":(0,K["default"])(e)?"slot":(0,z["default"])(e)?"root":"node"}function d(e,t){for(;e&&e!==document;){if(t(e))return e;e=e.parentNode}}function c(e){return e.getAttribute&&e.getAttribute("name")||"default"}function f(e){return e.getAttribute&&e.getAttribute("slot")||"default"}function h(e,t,n){if(ce.indexOf(t.nodeType)!==-1){var r=e.assignedNodes(),o=0===r.length,i=r.indexOf(n);ge.set(t,e),o&&oe.call(e.childNodes,function(t){return e.__removeChild(t)}),i>-1?(e.__insertBefore(t,void 0!==n?n:null),r.splice(i,0,t)):(e.__appendChild(t),r.push(t)),e.____triggerSlotChangeEvent()}}function p(e){var t=ge.get(e);if(t){var n=t.assignedNodes(),r=n.indexOf(e);if(r>-1){var o=1===n.length;n.splice(r,1),ge.set(e,null),t.__removeChild(e),o&&oe.call(t.childNodes,function(e){return t.__appendChild(e)}),t.____triggerSlotChangeEvent()}}}function v(e,t){for(var n=e.childNodes,r=n.length,o=0;o<r;o++)if(n[o]===t)return o;return-1}function _(e,t,n,r){var o=v(e,n);(0,S.eachNodeOrFragmentNodes)(t,function(t,n){r(t,n),k["default"]?_e.set(t,e):i(t,"parentNode",e),o>-1?re.splice.call(e.childNodes,o+n,0,t):re.push.call(e.childNodes,t)})}function g(e,t,n){var r=v(e,t);r>-1&&(n(t,0),k["default"]?_e.set(t,null):i(t,"parentNode",null),re.splice.call(e.childNodes,r,1))}function m(e,t,n){_(e,t,n,function(t){e.__insertBefore(t,void 0!==n?n:null)})}function N(e,t,n){_(e,t,n,function(t){var r=pe.get(e),o=Ne.get(r),i=o[f(t)];i&&h(i,t,n)})}function y(e,t){var n=c(t);k["default"]||Array.isArray(t.childNodes)||i(t,"childNodes",(0,Z["default"])(t.childNodes)),Ne.get(e)[n]=t,ye.has(t)||ye.set(t,e),(0,S.eachChildNode)(me.get(e),function(e){e.assignedSlot||n!==f(e)||h(t,e)})}function b(e,t,n){(0,S.eachNodeOrFragmentNodes)(t,function(t){if((0,K["default"])(t))y(e,t);else{var n=(0,I["default"])(t);if(n)for(var r=n.length,o=0;o<r;o++)y(e,n[o])}}),m(e,t,n)}function C(e,t,n){var r=0===e.assignedNodes().length;_(e,t,n,function(t){r&&e.__insertBefore(t,void 0!==n?n:null)})}function E(e,t){var n=0===e.assignedNodes().length;g(e,t,function(){n&&e.__removeChild(t)})}function O(e,t){g(e,t,function(){e.__removeChild(t)})}function w(e,t){g(e,t,function(){p(t)})}function M(e,t){var n=Array.prototype.slice.call(t.assignedNodes());n.forEach(p),delete Ne.get(e)[c(t)],ye["delete"](t)}function T(e,t){g(e,t,function(){if((0,K["default"])(t))M(e,t);else{var n=(0,I["default"])(t);if(n)for(var r=0;r<n.length;r++)M(e,n[r])}e.__removeChild(t)})}function j(e){if((0,z["default"])(e))return e;if(e.parentNode)return j(e.parentNode)}function L(e,t,n){var r=l(e),o=t.parentNode,u=j(e);return k["default"]||Array.isArray(e.childNodes)||i(e,"childNodes",(0,Z["default"])(e.childNodes)),u&&"slot"===l(t)&&y(u,t),o&&"host"===l(o)&&(k["default"]?_e.set(t,null):i(t,"parentNode",null)),"node"===r?k["default"]?(_e.set(t,e),e.__insertBefore(t,void 0!==n?n:null)):m(e,t,n):"slot"===r?C(e,t,n):"host"===r?N(e,t,n):"root"===r?b(e,t,n):void 0}function A(e){if(k["default"]&&"slot"===l(e)&&e.__childNodes.length!==e.childNodes.length){for(;e.hasChildNodes();)e.removeChild(e.firstChild);oe.call(e.__childNodes,function(t){return e.appendChild(t)})}}Object.defineProperty(t,"__esModule",{value:!0});var P=n(1),x=r(P);n(3),n(4);var S=n(5),D=n(6),H=n(7),k=r(H),W=n(8),R=r(W),F=n(9),V=r(F),B=n(10),q=r(B),X=n(11),G=r(X),Y=n(12),I=r(Y),U=n(14),z=r(U),J=n(13),K=r(J),Q=n(15),Z=r(Q),$=n(16),ee=r($),te=n(17),ne=r(te),re=Array.prototype,oe=re.forEach,ie="_shadow_root_",ue=["childNodes","parentNode"],ae=["textContent"],se=["assignedSlot"],le=["textContent"],de=[],ce=[Node.ELEMENT_NODE,Node.TEXT_NODE],fe=new WeakMap,he=new WeakMap,pe=new WeakMap,ve=new WeakMap,_e=new WeakMap,ge=new WeakMap,me=new WeakMap,Ne=new WeakMap,ye=new WeakMap,be=new DOMParser,Ce={____assignedNodes:{get:function(){return this.______assignedNodes||(this.______assignedNodes=[])}},____isInFallbackMode:{get:function(){return 0===this.assignedNodes().length}},____slotChangeListeners:{get:function(){return"undefined"==typeof this.______slotChangeListeners&&(this.______slotChangeListeners=0),this.______slotChangeListeners},set:function(e){this.______slotChangeListeners=e}},____triggerSlotChangeEvent:{value:(0,x["default"])(function(){this.____slotChangeListeners&&this.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})},addEventListener:{value:function(e,t,n){return"slotchange"===e&&(0,K["default"])(this)&&this.____slotChangeListeners++,this.__addEventListener(e,t,n)}},appendChild:{value:function(e){return L(this,e),e}},assignedSlot:{get:function(){var e=ge.get(this);if(!e)return null;var t=ye.get(e),n=me.get(t),r=he.get(n);return"open"===r?e:null}},attachShadow:{value:function(e){var t=this,n=e&&e.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var r=pe.get(this);if(r)return r;var o=a([].slice.call(this.childNodes)),u=document.createElement(e.polyfillShadowRootTagName||ie);return he.set(this,n),pe.set(this,u),me.set(u,this),Ne.set(u,{}),k["default"]?ve.set(this,o):i(this,"childNodes",o),o.forEach(function(e){t.__removeChild(e),k["default"]?_e.set(e,t):i(e,"parentNode",t)}),this.__appendChild(u)}},childElementCount:{get:function(){return this.children.length}},childNodes:{get:function(){if(k["default"]&&"node"===l(this))return this.__childNodes;var e=ve.get(this);return e||ve.set(this,e=a([])),e}},children:{get:function(){var e=[];return(0,S.eachChildNode)(this,function(t){1===t.nodeType&&e.push(t)}),a(e)}},firstChild:{get:function(){return this.childNodes[0]||null}},firstElementChild:{get:function(){return this.children[0]||null}},assignedNodes:{value:function(){if((0,K["default"])(this)){var e=fe.get(this);return e||fe.set(this,e=[]),e}}},hasChildNodes:{value:function(){return this.childNodes.length>0}},innerHTML:{get:function(){function e(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName.toLowerCase()in o}var t="",n=function(e){return e.outerHTML},r={};r[Node.ELEMENT_NODE]=n,r[Node.COMMENT_NODE]=G["default"];var o={style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,noscript:!0,plaintext:!0},i=e(this);return(0,S.eachChildNode)(this,function(e){var o=void 0;o=e.nodeType===Node.TEXT_NODE?i?q["default"]:V["default"]:r[e.nodeType]||n,t+=o(e)}),t},set:function(e){for(var t=o(e);this.hasChildNodes();)this.removeChild(this.firstChild);var n=(0,I["default"])(t);for(oe.call(n,function(e){return A(e)});t.hasChildNodes();){var r=t.firstChild;t.removeChild(r),this.appendChild(r)}}},insertBefore:{value:function(e,t){return L(this,e,t),e}},lastChild:{get:function(){var e=this.childNodes;return e[e.length-1]||null}},lastElementChild:{get:function(){var e=this.children;return e[e.length-1]||null}},name:{get:function(){return this.getAttribute("name")},set:function(e){var t=this.name,n=this.__setAttribute("name",e);if(e===t)return n;if(!(0,K["default"])(this))return n;var r=ye.get(this);return r&&(M(r,this),y(r,this)),n}},nextSibling:{get:function(){var e=this;return(0,S.eachChildNode)(this.parentNode,function(t,n,r){if(e===t)return r[n+1]||null})}},nextElementSibling:{get:function(){var e=this,t=void 0;return(0,S.eachChildNode)(this.parentNode,function(n){return t&&1===n.nodeType?n:void(e===n&&(t=!0))})}},outerHTML:{get:function(){var e=this.tagName.toLowerCase(),t=Array.prototype.slice.call(this.attributes).map(function(e){return" "+e.name+(e.value?'="'+e.value+'"':"")}).join("");return"<"+e+t+">"+this.innerHTML+"</"+e+">"},set:function(e){if(this.parentNode){var t=o(e);this.parentNode.replaceChild(t.firstChild,this)}else{if(!k["default"])throw new Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");this.__outerHTML=e}}},parentElement:{get:function(){return d(this.parentNode,function(e){return 1===e.nodeType})}},parentNode:{get:function(){return _e.get(this)||this.__parentNode||null}},previousSibling:{get:function(){var e=this;return(0,S.eachChildNode)(this.parentNode,function(t,n,r){if(e===t)return r[n-1]||null})}},previousElementSibling:{get:function(){var e=this,t=void 0;return(0,S.eachChildNode)(this.parentNode,function(n){return t&&e===n?t:void(1===n.nodeType&&(t=n))})}},removeChild:{value:function(e){var t=l(this);switch(t){case"node":if(k["default"])return _e.set(e,null),this.__removeChild(e);O(this,e);break;case"slot":E(this,e);break;case"host":w(this,e);break;case"root":T(this,e)}return e}},removeEventListener:{value:function(e,t,n){return"slotchange"===e&&this.____slotChangeListeners&&(0,K["default"])(this)&&this.____slotChangeListeners--,this.__removeEventListener(e,t,n)}},replaceChild:{value:function(e,t){return this.insertBefore(e,t),this.removeChild(t)}},setAttribute:{value:function(e,t){return"slot"===e&&(this[e]=t),(0,K["default"])(this)&&"name"===e&&(this[e]=t),this.__setAttribute(e,t)}},shadowRoot:{get:function(){return"open"===he.get(this)?pe.get(this):null}},slot:{get:function(){return this.getAttribute("slot")},set:function(e){var t=this.name,n=this.__setAttribute("slot",e);if(t===e)return n;var r=ge.get(this),o=r&&ye.get(r),i=o&&me.get(o);return i&&(w(i,this),N(i,this)),n}},textContent:{get:function(){var e="";return(0,S.eachChildNode)(this,function(t){t.nodeType!==Node.COMMENT_NODE&&(e+=t.textContent)}),e},set:function(e){for(;this.hasChildNodes();)this.removeChild(this.firstChild);e&&this.appendChild(document.createTextNode(e))}}};D.shadowDomV1||(D.shadowDomV0?(0,ee["default"])():!function(){var e=Comment.prototype,t=HTMLElement.prototype,n=SVGElement.prototype,r=Text.prototype,o=document.createTextNode(""),i=document.createComment("");Object.keys(Ce).forEach(function(u){var a=Ce[u];if(a.configurable=!0,a.enumerable=!0,a.hasOwnProperty("value")&&(a.writable=!0),k["default"]||ue.indexOf(u)===-1){var s=(0,R["default"])(t,u),l=(0,R["default"])(r,u),d=(0,R["default"])(e,u),c=u in o&&ae.indexOf(u)===-1||~se.indexOf(u),f=u in i&&le.indexOf(u)===-1||~de.indexOf(u),h="__"+u;Object.defineProperty(t,u,a),Object.defineProperty(n,u,a),s&&(Object.defineProperty(t,h,s),Object.defineProperty(n,h,s)),c&&Object.defineProperty(r,u,a),c&&l&&Object.defineProperty(r,h,l),f&&Object.defineProperty(e,u,a),f&&d&&Object.defineProperty(e,h,d)}})}()),t["default"]=ne["default"]},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){function o(){var d=r()-s;d<t&&d>0?i=setTimeout(o,t-d):(i=null,n||(l=e.apply(a,u),i||(a=u=null)))}var i,u,a,s,l;return null==t&&(t=100),function(){a=this,u=arguments,s=r();var d=n&&!i;return i||(i=setTimeout(o,t)),d&&(l=e.apply(a,u),a=u=null),l}}},function(e,t){"use strict";function n(){return(new Date).getTime()}e.exports=Date.now||n},function(e,t){"use strict";try{var n=new window.CustomEvent("test");if(n.preventDefault(),n.defaultPrevented!==!0)throw new Error("Could not prevent default")}catch(r){var o=function(e,t){var n,r;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},n=document.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};o.prototype=window.Event.prototype,window.CustomEvent=o}},function(e,t){"use strict";/** | ||
* @license | ||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
* Code distributed by Google as part of the polymer project is also | ||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
*/ | ||
"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return!(!t||t[0]!==e)&&(t[0]=t[1]=void 0,!0)},has:function(e){var t=e[this.name];return!!t&&t[0]===e}},window.WeakMap=n}()},function(e,t){"use strict";function n(e,t){if(e)for(var n=e.childNodes,r=n.length,o=0;o<r;o++){var i=t(n[o],o,n);if("undefined"!=typeof i)return i}}function r(e){for(var t=[],n=e.length-1;n>=0;n--)t.push(e[n]);return t}function o(e,t){if(e instanceof DocumentFragment)for(var n=e.childNodes,o=n.length,i=o-1;i>=0;i--){var u=r(e.childNodes)[i];t(u,i)}else t(e,0)}Object.defineProperty(t,"__esModule",{value:!0}),t.eachChildNode=n,t.eachNodeOrFragmentNodes=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=document.createElement("div");t.shadowDomV0=!!n.createShadowRoot,t.shadowDomV1=!!n.attachShadow},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),u=(0,i["default"])(Element.prototype,"innerHTML");t["default"]=!!u},function(e,t){"use strict";function n(e,t){for(var n=void 0;e&&!(n=Object.getOwnPropertyDescriptor(e,t));)e=Object.getPrototypeOf(e);return n}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){e instanceof Node&&(e=r);var o=n(e,t);if(o){var i=o.get,u=o.set,a={configurable:!0,enumerable:!0};if(i)return a.get=i,a.set=u,a;if("function"==typeof e[t])return a.value=e[t],a}var s=Object.getOwnPropertyDescriptor(e,t);if(s&&s.get)return s};var r=document.createElement("div")},function(e,t){"use strict";function n(e){return e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t){"use strict";function n(e){return e.textContent}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t){"use strict";function n(e){return e.text||"<!--"+e.textContent+"-->"}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.childNodes;if(u.shadowDomV0&&!u.shadowDomV1)return[].concat(o(e.querySelectorAll("content")));if(!n||[Node.ELEMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE].indexOf(e.nodeType)===-1)return t;for(var r=n.length,a=0;a<r;a++){var l=n[a];(0,s["default"])(l)&&t.push(l),i(l,t)}return t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i;var u=n(6),a=n(13),s=r(a)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return"SLOT"===e.tagName}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return"_SHADOW_ROOT_"===e.tagName}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return Array.prototype.slice.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(3);var r="__shadowRoot";t["default"]=function(){function e(e){for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=[];t.nextNode();){var r=t.currentNode;"SLOT"===r.tagName&&n.push(r)}n.forEach(function(e){var t=e.getAttribute("name"),n=document.createElement("slot");for(t&&n.setAttribute("name",t),e.parentNode.replaceChild(n,e);e.hasChildNodes();)n.appendChild(e.firstChild)})}var t=function(e){for(var t=e.getAttribute("name"),n=e;n;){var o=n[r];if(o&&o.contains(e))break;n=n.parentNode}if(!n)return[];for(var i=n.childNodes,u=i.length,a=[],s=0;s<u;s++){var l=i[s],d=l.getAttribute?l.getAttribute("slot"):null;t===d&&a.push(l)}return a},n=HTMLElement.prototype,o=n.getAttribute,i=n.setAttribute,u=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),a=Object.getOwnPropertyDescriptor(ShadowRoot.prototype,"innerHTML"),s=function(e){return"slot"===e?"content":e},l=document.createElement.bind(document),d=document.createElementNS.bind(document);document.createElement=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return l.apply(void 0,[s(e)].concat(n))},document.createElementNS=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return d.apply(void 0,[e,s(t)].concat(r))},Object.defineProperty(Element.prototype,"innerHTML",{configurable:!0,get:u.get,set:function(t){u.set.call(this,t),e(this)}}),Object.defineProperty(ShadowRoot.prototype,"innerHTML",{configurable:!0,get:a.get,set:function(t){a.set.call(this,t),e(this)}}),Object.defineProperty(Node.prototype,"assignedSlot",{get:function(){var e=this.parentNode;if(e){var t=e.shadowRoot;if(!t)return null;for(var n=t.querySelectorAll("content"),r=0;r<n.length;r++){var o=n[r];if(o.assignedNodes().indexOf(this)>-1)return o}}return null}}),HTMLElement.prototype.attachShadow=function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var o=this.createShadowRoot();"closed"===n&&Object.defineProperty(this,"shadowRoot",{configurable:!0,get:function(){return null}}),Object.defineProperty(o,"parentNode",{get:function(){return e}});var i=new MutationObserver(function(t){var n=e[r];t.forEach(function(e){var t=e.addedNodes,r=e.removedNodes,o={},i=function(e){return o[e.getAttribute&&e.getAttribute("slot")||"__default"]=!0};if(t)for(var u=t.length,a=0;a<u;a++)i(t[a]);if(r)for(var s=r.length,l=0;l<s;l++)i(r[l]);Object.keys(o).forEach(function(e){var t="__default"===e?n.querySelector("content:not([name])")||n.querySelector('content[name=""]'):n.querySelector('content[name="'+e+'"]');t&&t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})})});return i.observe(this,{childList:!0}),this[r]=o},Object.defineProperty(HTMLContentElement.prototype,"name",{get:function(){return this.getAttribute("name")},set:function(e){return this.setAttribute("name",e)}}),Object.defineProperty(HTMLElement.prototype,"slot",{get:function(){return this.getAttribute("slot")},set:function(e){return this.setAttribute("slot",e)}}),HTMLContentElement.prototype.assignedNodes=function(){for(var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.deep,r=[],o=n?this.getDistributedNodes():t(this),i=0;i<o.length;i++){var u=o[i],a=u.nodeType;a!==Node.ELEMENT_NODE&&a!==Node.TEXT_NODE||r.push(u)}return r},HTMLContentElement.prototype.getAttribute=function(e){if("name"===e){var t=o.call(this,"select");return t?t.match(/\[slot=['"]?(.*?)['"]?\]/)[1]:null}return o.call(this,e)},HTMLContentElement.prototype.setAttribute=function(e,t){return"name"===e&&(e="select",t="[slot='"+t+"']"),i.call(this,e,t)}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]="0.0.1"}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.skatejsNamedSlots=t():e.skatejsNamedSlots=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=document.createElement("div");if(R["default"])return t.__innerHTML=e,t;for(var n=Oe.parseFromString("<div>"+e+"</div>","text/html").body.firstChild;n.hasChildNodes();){var r=n.firstChild;n.removeChild(r),t.appendChild(r)}return document.importNode(t,!0)}function i(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n}})}function u(e){return this[e]}function a(e){return e.item=u,e}function l(e){return!!_e.get(e)}function s(e){return l(e)?"host":(0,Q["default"])(e)?"slot":(0,J["default"])(e)?"root":"node"}function c(e,t){for(;e&&e!==document;){if(t(e))return e;e=e.parentNode}}function d(e){return e.getAttribute&&e.getAttribute("name")||"default"}function f(e){return e.getAttribute&&e.getAttribute("slot")||"default"}function h(e,t,n){if(he.indexOf(t.nodeType)!==-1){var r=e.assignedNodes(),o=0===r.length,i=r.indexOf(n);ye.set(t,e),o&&ue.call(e.childNodes,function(t){return e.__removeChild(t)}),i>-1?(e.__insertBefore(t,void 0!==n?n:null),r.splice(i,0,t)):(e.__appendChild(t),r.push(t)),e.____triggerSlotChangeEvent()}}function p(e){var t=ye.get(e);if(t){var n=t.assignedNodes(),r=n.indexOf(e);if(r>-1){var o=1===n.length;n.splice(r,1),ye.set(e,null),t.__removeChild(e),o&&ue.call(t.childNodes,function(e){return t.__appendChild(e)}),t.____triggerSlotChangeEvent()}}}function v(e,t){for(var n=e.childNodes,r=n.length,o=0;o<r;o++)if(n[o]===t)return o;return-1}function _(e,t,n,r){var o=v(e,n);(0,k.eachNodeOrFragmentNodes)(t,function(t,n){r(t,n),R["default"]?me.set(t,e):i(t,"parentNode",e),o>-1?ie.splice.call(e.childNodes,o+n,0,t):ie.push.call(e.childNodes,t)})}function g(e,t,n){var r=v(e,t);r>-1&&(n(t,0),R["default"]?me.set(t,null):i(t,"parentNode",null),ie.splice.call(e.childNodes,r,1))}function m(e,t,n){_(e,t,n,function(t){e.__insertBefore(t,void 0!==n?n:null)})}function y(e,t,n){_(e,t,n,function(t){var r=_e.get(e),o=be.get(r),i=o[f(t)];i&&h(i,t,n)})}function N(e,t){var n=d(t);R["default"]||Array.isArray(t.childNodes)||i(t,"childNodes",(0,ee["default"])(t.childNodes)),be.get(e)[n]=t,Ee.has(t)||Ee.set(t,e),(0,k.eachChildNode)(Ne.get(e),function(e){e.assignedSlot||n!==f(e)||h(t,e)})}function b(e,t,n){(0,k.eachNodeOrFragmentNodes)(t,function(t){if((0,Q["default"])(t))N(e,t);else{var n=(0,$["default"])(t);if(n)for(var r=n.length,o=0;o<r;o++)N(e,n[o])}}),m(e,t,n)}function E(e,t,n){var r=0===e.assignedNodes().length;_(e,t,n,function(t){r&&e.__insertBefore(t,void 0!==n?n:null)})}function O(e,t){var n=0===e.assignedNodes().length;g(e,t,function(){n&&e.__removeChild(t)})}function C(e,t){g(e,t,function(){e.__removeChild(t)})}function w(e,t){g(e,t,function(){p(t)})}function T(e,t){var n=Array.prototype.slice.call(t.assignedNodes());n.forEach(p),delete be.get(e)[d(t)],Ee["delete"](t)}function j(e,t){g(e,t,function(){if((0,Q["default"])(t))T(e,t);else{var n=(0,$["default"])(t);if(n)for(var r=0;r<n.length;r++)T(e,n[r])}e.__removeChild(t)})}function M(e){if((0,J["default"])(e))return e;if(e.parentNode)return M(e.parentNode)}function A(e,t,n){var r=s(e),o=t.parentNode,u=M(e);return R["default"]||Array.isArray(e.childNodes)||i(e,"childNodes",(0,ee["default"])(e.childNodes)),u&&"slot"===s(t)&&N(u,t),o&&"host"===s(o)&&(R["default"]?me.set(t,null):i(t,"parentNode",null)),"node"===r?R["default"]?(me.set(t,e),e.__insertBefore(t,void 0!==n?n:null)):m(e,t,n):"slot"===r?E(e,t,n):"host"===r?y(e,t,n):"root"===r?b(e,t,n):void 0}function L(e){if(R["default"]&&"slot"===s(e)&&e.__childNodes.length!==e.childNodes.length){for(;e.hasChildNodes();)e.removeChild(e.firstChild);ue.call(e.__childNodes,function(t){return e.appendChild(t)})}}Object.defineProperty(t,"__esModule",{value:!0}),n(1);var P=n(2),S=r(P),x=n(4),D=r(x),k=n(5),H=n(6),F=n(7),R=r(F),W=n(8),V=r(W),B=n(9),q=r(B),X=n(10),G=r(X),I=n(11),Y=r(I),U=n(12),$=r(U),z=n(14),J=r(z),K=n(13),Q=r(K),Z=n(15),ee=r(Z),te=n(16),ne=r(te),re=n(17),oe=r(re),ie=Array.prototype,ue=ie.forEach,ae="_shadow_root_",le=["childNodes","parentNode"],se=["textContent"],ce=["assignedSlot"],de=["textContent"],fe=[],he=[Node.ELEMENT_NODE,Node.TEXT_NODE],pe=new D["default"],ve=new D["default"],_e=new D["default"],ge=new D["default"],me=new D["default"],ye=new D["default"],Ne=new D["default"],be=new D["default"],Ee=new D["default"],Oe=new DOMParser,Ce={____assignedNodes:{get:function(){return this.______assignedNodes||(this.______assignedNodes=[])}},____isInFallbackMode:{get:function(){return 0===this.assignedNodes().length}},____slotChangeListeners:{get:function(){return"undefined"==typeof this.______slotChangeListeners&&(this.______slotChangeListeners=0),this.______slotChangeListeners},set:function(e){this.______slotChangeListeners=e}},____triggerSlotChangeEvent:{value:(0,S["default"])(function(){this.____slotChangeListeners&&this.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})},addEventListener:{value:function(e,t,n){return"slotchange"===e&&(0,Q["default"])(this)&&this.____slotChangeListeners++,this.__addEventListener(e,t,n)}},appendChild:{value:function(e){return A(this,e),e}},assignedSlot:{get:function(){var e=ye.get(this);if(!e)return null;var t=Ee.get(e),n=Ne.get(t),r=ve.get(n);return"open"===r?e:null}},attachShadow:{value:function(e){var t=this,n=e&&e.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var r=_e.get(this);if(r)return r;var o=a([].slice.call(this.childNodes)),u=document.createElement(e.polyfillShadowRootTagName||ae);return ve.set(this,n),_e.set(this,u),Ne.set(u,this),be.set(u,{}),R["default"]?ge.set(this,o):i(this,"childNodes",o),o.forEach(function(e){t.__removeChild(e),R["default"]?me.set(e,t):i(e,"parentNode",t)}),this.__appendChild(u)}},childElementCount:{get:function(){return this.children.length}},childNodes:{get:function(){if(R["default"]&&"node"===s(this))return this.__childNodes;var e=ge.get(this);return e||ge.set(this,e=a([])),e}},children:{get:function(){var e=[];return(0,k.eachChildNode)(this,function(t){1===t.nodeType&&e.push(t)}),a(e)}},firstChild:{get:function(){return this.childNodes[0]||null}},firstElementChild:{get:function(){return this.children[0]||null}},assignedNodes:{value:function(){if((0,Q["default"])(this)){var e=pe.get(this);return e||pe.set(this,e=[]),e}}},hasChildNodes:{value:function(){return this.childNodes.length>0}},innerHTML:{get:function(){function e(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName.toLowerCase()in o}var t="",n=function(e){return e.outerHTML},r={};r[Node.ELEMENT_NODE]=n,r[Node.COMMENT_NODE]=Y["default"];var o={style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,noscript:!0,plaintext:!0},i=e(this);return(0,k.eachChildNode)(this,function(e){var o=void 0;o=e.nodeType===Node.TEXT_NODE?i?G["default"]:q["default"]:r[e.nodeType]||n,t+=o(e)}),t},set:function(e){for(var t=o(e);this.hasChildNodes();)this.removeChild(this.firstChild);var n=(0,$["default"])(t);for(ue.call(n,function(e){return L(e)});t.hasChildNodes();){var r=t.firstChild;t.removeChild(r),this.appendChild(r)}}},insertBefore:{value:function(e,t){return A(this,e,t),e}},lastChild:{get:function(){var e=this.childNodes;return e[e.length-1]||null}},lastElementChild:{get:function(){var e=this.children;return e[e.length-1]||null}},name:{get:function(){return this.getAttribute("name")},set:function(e){var t=this.name,n=this.__setAttribute("name",e);if(e===t)return n;if(!(0,Q["default"])(this))return n;var r=Ee.get(this);return r&&(T(r,this),N(r,this)),n}},nextSibling:{get:function(){var e=this;return(0,k.eachChildNode)(this.parentNode,function(t,n,r){if(e===t)return r[n+1]||null})}},nextElementSibling:{get:function(){var e=this,t=void 0;return(0,k.eachChildNode)(this.parentNode,function(n){return t&&1===n.nodeType?n:void(e===n&&(t=!0))})}},outerHTML:{get:function(){var e=this.tagName.toLowerCase(),t=Array.prototype.slice.call(this.attributes).map(function(e){return" "+e.name+(e.value?'="'+e.value+'"':"")}).join("");return"<"+e+t+">"+this.innerHTML+"</"+e+">"},set:function(e){if(this.parentNode){var t=o(e);this.parentNode.replaceChild(t.firstChild,this)}else{if(!R["default"])throw new Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");this.__outerHTML=e}}},parentElement:{get:function(){return c(this.parentNode,function(e){return 1===e.nodeType})}},parentNode:{get:function(){return me.get(this)||this.__parentNode||null}},previousSibling:{get:function(){var e=this;return(0,k.eachChildNode)(this.parentNode,function(t,n,r){if(e===t)return r[n-1]||null})}},previousElementSibling:{get:function(){var e=this,t=void 0;return(0,k.eachChildNode)(this.parentNode,function(n){return t&&e===n?t:void(1===n.nodeType&&(t=n))})}},removeChild:{value:function(e){var t=s(this);switch(t){case"node":if(R["default"])return me.set(e,null),this.__removeChild(e);C(this,e);break;case"slot":O(this,e);break;case"host":w(this,e);break;case"root":j(this,e)}return e}},removeEventListener:{value:function(e,t,n){return"slotchange"===e&&this.____slotChangeListeners&&(0,Q["default"])(this)&&this.____slotChangeListeners--,this.__removeEventListener(e,t,n)}},replaceChild:{value:function(e,t){return this.insertBefore(e,t),this.removeChild(t)}},setAttribute:{value:function(e,t){return"slot"===e&&(this[e]=t),(0,Q["default"])(this)&&"name"===e&&(this[e]=t),this.__setAttribute(e,t)}},shadowRoot:{get:function(){return"open"===ve.get(this)?_e.get(this):null}},slot:{get:function(){return this.getAttribute("slot")},set:function(e){var t=this.name,n=this.__setAttribute("slot",e);if(t===e)return n;var r=ye.get(this),o=r&&Ee.get(r),i=o&&Ne.get(o);return i&&(w(i,this),y(i,this)),n}},textContent:{get:function(){var e="";return(0,k.eachChildNode)(this,function(t){t.nodeType!==Node.COMMENT_NODE&&(e+=t.textContent)}),e},set:function(e){for(;this.hasChildNodes();)this.removeChild(this.firstChild);e&&this.appendChild(document.createTextNode(e))}}};H.shadowDomV1||(H.shadowDomV0?(0,ne["default"])():!function(){var e=Comment.prototype,t=HTMLElement.prototype,n=SVGElement.prototype,r=Text.prototype,o=document.createTextNode(""),i=document.createComment("");Object.keys(Ce).forEach(function(u){var a=Ce[u];if(a.configurable=!0,a.enumerable=!0,a.hasOwnProperty("value")&&(a.writable=!0),R["default"]||le.indexOf(u)===-1){var l=(0,V["default"])(t,u),s=(0,V["default"])(r,u),c=(0,V["default"])(e,u),d=u in o&&se.indexOf(u)===-1||~ce.indexOf(u),f=u in i&&de.indexOf(u)===-1||~fe.indexOf(u),h="__"+u;Object.defineProperty(t,u,a),Object.defineProperty(n,u,a),l&&(Object.defineProperty(t,h,l),Object.defineProperty(n,h,l)),d&&Object.defineProperty(r,u,a),d&&s&&Object.defineProperty(r,h,s),f&&Object.defineProperty(e,u,a),f&&c&&Object.defineProperty(e,h,c)}})}()),t["default"]=oe["default"]},function(e,t){"use strict";try{var n=new window.CustomEvent("test");if(n.preventDefault(),n.defaultPrevented!==!0)throw new Error("Could not prevent default")}catch(r){var o=function(e,t){var n,r;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},n=document.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};o.prototype=window.Event.prototype,window.CustomEvent=o}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t,n){function o(){var c=r()-l;c<t&&c>0?i=setTimeout(o,t-c):(i=null,n||(s=e.apply(a,u),i||(a=u=null)))}var i,u,a,l,s;return null==t&&(t=100),function(){a=this,u=arguments,l=r();var c=n&&!i;return i||(i=setTimeout(o,t)),c&&(s=e.apply(a,u),a=u=null),s}}},function(e,t){"use strict";function n(){return(new Date).getTime()}e.exports=Date.now||n},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};void function(t,n,o){function i(e,t,n){return"function"==typeof t&&(n=t,t=u(n).replace(/_$/,"")),s(e,t,{configurable:!0,writable:!0,value:n})}function u(e){return"function"!=typeof e?"":"name"in e?e.name:c.call(e).match(h)[1]}function a(e){function t(t,r){return r||2===arguments.length?n.set(t,r):(r=n.get(t),r===o&&(r=e(t),n.set(t,r))),r}var n=new v;return e||(e=_),t}var l=Object.getOwnPropertyNames,s=Object.defineProperty,c=Function.prototype.toString,d=Object.create,f=Object.prototype.hasOwnProperty,h=/^\n?function\s?(\w*)?_?\(/,p=function(){function e(){var e=u(),r={};this.unlock=function(o){var i=c(o);if(f.call(i,e))return i[e](r);var u=d(null,t);return s(i,e,{value:new Function("s","l",n)(r,u)}),u}}var t={value:{writable:!0,value:o}},n="return function(k){if(k===s)return l}",r=d(null),u=function h(){var e=Math.random().toString(36).slice(2);return e in r?h():r[e]=e},a=u(),c=function(e){if(f.call(e,a))return e[a];if(!Object.isExtensible(e))throw new TypeError("Object must be extensible");var t=d(null);return s(e,a,{value:t}),t};return i(Object,function(e){var t=l(e);return f.call(e,a)&&t.splice(t.indexOf(a),1),t}),i(e.prototype,function(e){return this.unlock(e).value}),i(e.prototype,function(e,t){this.unlock(e).value=t}),e}(),v=function(e){function a(e){return this===t||null==this||this===a.prototype?new a(e):(v(this,new p),void g(this,e))}function l(e){h(e);var t=_(this).get(e);return t===n?o:t}function s(e,t){h(e),_(this).set(e,t===o?n:t)}function c(e){return h(e),_(this).get(e)!==o}function d(e){h(e);var t=_(this),n=t.get(e)!==o;return t.set(e,o),n}function f(){return _(this),"[object WeakMap]"}var h=function(e){if(null==e||"object"!==("undefined"==typeof e?"undefined":r(e))&&"function"!=typeof e)throw new TypeError("Invalid WeakMap key")},v=function(t,n){var r=e.unlock(t);if(r.value)throw new TypeError("Object is already a WeakMap");r.value=n},_=function(t){var n=e.unlock(t).value;if(!n)throw new TypeError("WeakMap is not generic");return n},g=function(e,t){null!==t&&"object"===("undefined"==typeof t?"undefined":r(t))&&"function"==typeof t.forEach&&t.forEach(function(n,r){n instanceof Array&&2===n.length&&s.call(e,t[r][0],t[r][1])})};try{var m=("return "+d).replace("e_","\\u0065"),y=new Function("unwrap","validate",m)(_,h)}catch(N){var y=d}var m=(""+Object).split("Object"),b=function(){return m[0]+u(this)+m[1]};i(b,b);var E={__proto__:[]}instanceof Array?function(e){e.__proto__=b}:function(e){i(e,b)};return E(a),[f,l,s,c,y].forEach(function(e){i(a.prototype,e),E(e)}),a}(new p),_=Object.create?function(){return Object.create(null)}:function(){return{}};e.exports=v,v.createStorage=a,t.WeakMap&&(t.WeakMap.createStorage=a)}((0,eval)("this"))},function(e,t){"use strict";function n(e,t){if(e)for(var n=e.childNodes,r=n.length,o=0;o<r;o++){var i=t(n[o],o,n);if("undefined"!=typeof i)return i}}function r(e){for(var t=[],n=e.length-1;n>=0;n--)t.push(e[n]);return t}function o(e,t){if(e instanceof DocumentFragment)for(var n=e.childNodes,o=n.length,i=o-1;i>=0;i--){var u=r(e.childNodes)[i];t(u,i)}else t(e,0)}Object.defineProperty(t,"__esModule",{value:!0}),t.eachChildNode=n,t.eachNodeOrFragmentNodes=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=document.createElement("div");t.shadowDomV0=!!n.createShadowRoot,t.shadowDomV1=!!n.attachShadow},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(8),i=r(o),u=(0,i["default"])(Element.prototype,"innerHTML");t["default"]=!!u},function(e,t){"use strict";function n(e,t){for(var n=void 0;e&&!(n=Object.getOwnPropertyDescriptor(e,t));)e=Object.getPrototypeOf(e);return n}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t){e instanceof Node&&(e=r);var o=n(e,t);if(o){var i=o.get,u=o.set,a={configurable:!0,enumerable:!0};if(i)return a.get=i,a.set=u,a;if("function"==typeof e[t])return a.value=e[t],a}var l=Object.getOwnPropertyDescriptor(e,t);if(l&&l.get)return l};var r=document.createElement("div")},function(e,t){"use strict";function n(e){return e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t){"use strict";function n(e){return e.textContent}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t){"use strict";function n(e){return e.text||"<!--"+e.textContent+"-->"}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.childNodes;if(u.shadowDomV0&&!u.shadowDomV1)return[].concat(o(e.querySelectorAll("content")));if(!n||[Node.ELEMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE].indexOf(e.nodeType)===-1)return t;for(var r=n.length,a=0;a<r;a++){var s=n[a];(0,l["default"])(s)&&t.push(s),i(s,t)}return t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i;var u=n(6),a=n(13),l=r(a)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return"SLOT"===e.tagName}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return"_SHADOW_ROOT_"===e.tagName}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return Array.prototype.slice.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1);var r="__shadowRoot";t["default"]=function(){function e(e){for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=[];t.nextNode();){var r=t.currentNode;"SLOT"===r.tagName&&n.push(r)}n.forEach(function(e){var t=e.getAttribute("name"),n=document.createElement("slot");for(t&&n.setAttribute("name",t),e.parentNode.replaceChild(n,e);e.hasChildNodes();)n.appendChild(e.firstChild)})}var t=function(e){for(var t=e.getAttribute("name"),n=e;n;){var o=n[r];if(o&&o.contains(e))break;n=n.parentNode}if(!n)return[];for(var i=n.childNodes,u=i.length,a=[],l=0;l<u;l++){var s=i[l],c=s.getAttribute?s.getAttribute("slot"):null;t===c&&a.push(s)}return a},n=HTMLElement.prototype,o=n.getAttribute,i=n.setAttribute,u=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),a=Object.getOwnPropertyDescriptor(ShadowRoot.prototype,"innerHTML"),l=function(e){return"slot"===e?"content":e},s=document.createElement.bind(document),c=document.createElementNS.bind(document);document.createElement=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return s.apply(void 0,[l(e)].concat(n))},document.createElementNS=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return c.apply(void 0,[e,l(t)].concat(r))},Object.defineProperty(Element.prototype,"innerHTML",{configurable:!0,get:u.get,set:function(t){u.set.call(this,t),e(this)}}),Object.defineProperty(ShadowRoot.prototype,"innerHTML",{configurable:!0,get:a.get,set:function(t){a.set.call(this,t),e(this)}}),Object.defineProperty(Node.prototype,"assignedSlot",{get:function(){var e=this.parentNode;if(e){var t=e.shadowRoot;if(!t)return null;for(var n=t.querySelectorAll("content"),r=0;r<n.length;r++){var o=n[r];if(o.assignedNodes().indexOf(this)>-1)return o}}return null}}),HTMLElement.prototype.attachShadow=function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var o=this.createShadowRoot();"closed"===n&&Object.defineProperty(this,"shadowRoot",{configurable:!0,get:function(){return null}}),Object.defineProperty(o,"parentNode",{get:function(){return e}});var i=new MutationObserver(function(t){var n=e[r];t.forEach(function(e){var t=e.addedNodes,r=e.removedNodes,o={},i=function(e){return o[e.getAttribute&&e.getAttribute("slot")||"__default"]=!0};if(t)for(var u=t.length,a=0;a<u;a++)i(t[a]);if(r)for(var l=r.length,s=0;s<l;s++)i(r[s]);Object.keys(o).forEach(function(e){var t="__default"===e?n.querySelector("content:not([name])")||n.querySelector('content[name=""]'):n.querySelector('content[name="'+e+'"]');t&&t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})})});return i.observe(this,{childList:!0}),this[r]=o},Object.defineProperty(HTMLContentElement.prototype,"name",{get:function(){return this.getAttribute("name")},set:function(e){return this.setAttribute("name",e)}}),Object.defineProperty(HTMLElement.prototype,"slot",{get:function(){return this.getAttribute("slot")},set:function(e){return this.setAttribute("slot",e)}}),HTMLContentElement.prototype.assignedNodes=function(){for(var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.deep,r=[],o=n?this.getDistributedNodes():t(this),i=0;i<o.length;i++){var u=o[i],a=u.nodeType;a!==Node.ELEMENT_NODE&&a!==Node.TEXT_NODE||r.push(u)}return r},HTMLContentElement.prototype.getAttribute=function(e){if("name"===e){var t=o.call(this,"select");return t?t.match(/\[slot=['"]?(.*?)['"]?\]/)[1]:null}return o.call(this,e)},HTMLContentElement.prototype.setAttribute=function(e,t){return"name"===e&&(e="select",t="[slot='"+t+"']"),i.call(this,e,t)}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]="0.0.1"}])}); | ||
//# sourceMappingURL=index-with-deps.min.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('debounce'), require('custom-event-polyfill')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'debounce', 'custom-event-polyfill'], factory) : | ||
(factory((global.skatejsNamedSlots = global.skatejsNamedSlots || {}),global.debounce,global.customEventPolyfill)); | ||
}(this, (function (exports,debounce,customEventPolyfill) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('custom-event-polyfill'), require('debounce'), require('weakmap')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'custom-event-polyfill', 'debounce', 'weakmap'], factory) : | ||
(factory((global.skatejsNamedSlots = global.skatejsNamedSlots || {}),global.customEventPolyfill,global.debounce,global.WeakMap)); | ||
}(this, (function (exports,customEventPolyfill,debounce,WeakMap) { | ||
debounce = 'default' in debounce ? debounce['default'] : debounce; | ||
WeakMap = 'default' in WeakMap ? WeakMap['default'] : WeakMap; | ||
/** | ||
* @license | ||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
* Code distributed by Google as part of the polymer project is also | ||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
*/ | ||
if (typeof WeakMap === 'undefined') { | ||
(function () { | ||
var defineProperty = Object.defineProperty; | ||
var counter = Date.now() % 1e9; | ||
var WeakMap = function WeakMap() { | ||
this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__'); | ||
}; | ||
WeakMap.prototype = { | ||
set: function set(key, value) { | ||
var entry = key[this.name]; | ||
if (entry && entry[0] === key) entry[1] = value;else defineProperty(key, this.name, { value: [key, value], writable: true }); | ||
return this; | ||
}, | ||
get: function get(key) { | ||
var entry; | ||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; | ||
}, | ||
delete: function _delete(key) { | ||
var entry = key[this.name]; | ||
if (!entry || entry[0] !== key) return false; | ||
entry[0] = entry[1] = undefined; | ||
return true; | ||
}, | ||
has: function has(key) { | ||
var entry = key[this.name]; | ||
if (!entry) return false; | ||
return entry[0] === key; | ||
} | ||
}; | ||
window.WeakMap = WeakMap; | ||
})(); | ||
} | ||
function eachChildNode(node, func) { | ||
@@ -504,2 +459,3 @@ if (!node) { | ||
// TODO move into the skatejs-web-components package. | ||
var arrProto = Array.prototype; | ||
@@ -506,0 +462,0 @@ var forEach = arrProto.forEach; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("debounce"),require("custom-event-polyfill")):"function"==typeof define&&define.amd?define(["exports","debounce","custom-event-polyfill"],t):t(e.skatejsNamedSlots=e.skatejsNamedSlots||{},e.debounce,e.customEventPolyfill)}(this,function(e,t,n){function r(e,t){if(e)for(var n=e.childNodes,r=n.length,o=0;o<r;o++){var i=t(n[o],o,n);if("undefined"!=typeof i)return i}}function o(e){for(var t=[],n=e.length-1;n>=0;n--)t.push(e[n]);return t}function i(e,t){if(e instanceof DocumentFragment)for(var n=e.childNodes,r=n.length,i=r-1;i>=0;i--){var s=o(e.childNodes)[i];t(s,i)}else t(e,0)}function s(e,t){for(var n=void 0;e&&!(n=Object.getOwnPropertyDescriptor(e,t));)e=Object.getPrototypeOf(e);return n}function a(e,t){e instanceof Node&&(e=Y);var n=s(e,t);if(n){var r=n.get,o=n.set,i={configurable:!0,enumerable:!0};if(r)return i.get=r,i.set=o,i;if("function"==typeof e[t])return i.value=e[t],i}var a=Object.getOwnPropertyDescriptor(e,t);if(a&&a.get)return a}function u(e){return e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function l(e){return e.textContent}function d(e){return e.text||"<!--"+e.textContent+"-->"}function c(e){return"SLOT"===e.tagName}function h(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.childNodes;if(X&&!G)return[].concat(V(e.querySelectorAll("content")));if(!n||[Node.ELEMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE].indexOf(e.nodeType)===-1)return t;for(var r=n.length,o=0;o<r;o++){var i=n[o];c(i)&&t.push(i),h(i,t)}return t}function f(e){return"_SHADOW_ROOT_"===e.tagName}function p(e){var t=document.createElement("div");if(U)return t.__innerHTML=e,t;for(var n=ge.parseFromString("<div>"+e+"</div>","text/html").body.firstChild;n.hasChildNodes();){var r=n.firstChild;n.removeChild(r),t.appendChild(r)}return document.importNode(t,!0)}function v(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n}})}function g(e){return this[e]}function _(e){return e.item=g,e}function m(e){return!!le.get(e)}function N(e){return m(e)?"host":c(e)?"slot":f(e)?"root":"node"}function y(e,t){for(;e&&e!==document;){if(t(e))return e;e=e.parentNode}}function b(e){return e.getAttribute&&e.getAttribute("name")||"default"}function E(e){return e.getAttribute&&e.getAttribute("slot")||"default"}function C(e,t,n){if(se.indexOf(t.nodeType)!==-1){var r=e.assignedNodes(),o=0===r.length,i=r.indexOf(n);he.set(t,e),o&&$.call(e.childNodes,function(t){return e.__removeChild(t)}),i>-1?(e.__insertBefore(t,void 0!==n?n:null),r.splice(i,0,t)):(e.__appendChild(t),r.push(t)),e.____triggerSlotChangeEvent()}}function O(e){var t=he.get(e);if(t){var n=t.assignedNodes(),r=n.indexOf(e);if(r>-1){var o=1===n.length;n.splice(r,1),he.set(e,null),t.__removeChild(e),o&&$.call(t.childNodes,function(e){return t.__appendChild(e)}),t.____triggerSlotChangeEvent()}}}function T(e,t){for(var n=e.childNodes,r=n.length,o=0;o<r;o++)if(n[o]===t)return o;return-1}function M(e,t,n,r){var o=T(e,n);i(t,function(t,n){r(t,n),U?ce.set(t,e):v(t,"parentNode",e),o>-1?Z.splice.call(e.childNodes,o+n,0,t):Z.push.call(e.childNodes,t)})}function w(e,t,n){var r=T(e,t);r>-1&&(n(t,0),U?ce.set(t,null):v(t,"parentNode",null),Z.splice.call(e.childNodes,r,1))}function L(e,t,n){M(e,t,n,function(t){e.__insertBefore(t,void 0!==n?n:null)})}function A(e,t,n){M(e,t,n,function(t){var r=le.get(e),o=pe.get(r),i=o[E(t)];i&&C(i,t,n)})}function S(e,t){var n=b(t);U||Array.isArray(t.childNodes)||v(t,"childNodes",z(t.childNodes)),pe.get(e)[n]=t,ve.has(t)||ve.set(t,e),r(fe.get(e),function(e){e.assignedSlot||n!==E(e)||C(t,e)})}function x(e,t,n){i(t,function(t){if(c(t))S(e,t);else{var n=h(t);if(n)for(var r=n.length,o=0;o<r;o++)S(e,n[o])}}),L(e,t,n)}function j(e,t,n){var r=0===e.assignedNodes().length;M(e,t,n,function(t){r&&e.__insertBefore(t,void 0!==n?n:null)})}function P(e,t){var n=0===e.assignedNodes().length;w(e,t,function(){n&&e.__removeChild(t)})}function H(e,t){w(e,t,function(){e.__removeChild(t)})}function k(e,t){w(e,t,function(){O(t)})}function D(e,t){var n=Array.prototype.slice.call(t.assignedNodes());n.forEach(O),delete pe.get(e)[b(t)],ve.delete(t)}function W(e,t){w(e,t,function(){if(c(t))D(e,t);else{var n=h(t);if(n)for(var r=0;r<n.length;r++)D(e,n[r])}e.__removeChild(t)})}function R(e){if(f(e))return e;if(e.parentNode)return R(e.parentNode)}function q(e,t,n){var r=N(e),o=t.parentNode,i=R(e);return U||Array.isArray(e.childNodes)||v(e,"childNodes",z(e.childNodes)),i&&"slot"===N(t)&&S(i,t),o&&"host"===N(o)&&(U?ce.set(t,null):v(t,"parentNode",null)),"node"===r?U?(ce.set(t,e),e.__insertBefore(t,void 0!==n?n:null)):L(e,t,n):"slot"===r?j(e,t,n):"host"===r?A(e,t,n):"root"===r?x(e,t,n):void 0}function B(e){if(U&&"slot"===N(e)&&e.__childNodes.length!==e.childNodes.length){for(;e.hasChildNodes();)e.removeChild(e.firstChild);$.call(e.__childNodes,function(t){return e.appendChild(t)})}}t="default"in t?t.default:t,"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},delete:function(e){var t=e[this.name];return!(!t||t[0]!==e)&&(t[0]=t[1]=void 0,!0)},has:function(e){var t=e[this.name];return!!t&&t[0]===e}},window.WeakMap=n}();var F=document.createElement("div"),X=!!F.createShadowRoot,G=!!F.attachShadow,Y=document.createElement("div"),I=a(Element.prototype,"innerHTML"),U=!!I,V=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},z=function(e){return Array.prototype.slice.call(e)},J="__shadowRoot",K=function(){function e(e){for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=[];t.nextNode();){var r=t.currentNode;"SLOT"===r.tagName&&n.push(r)}n.forEach(function(e){var t=e.getAttribute("name"),n=document.createElement("slot");for(t&&n.setAttribute("name",t),e.parentNode.replaceChild(n,e);e.hasChildNodes();)n.appendChild(e.firstChild)})}var t=function(e){for(var t=e.getAttribute("name"),n=e;n;){var r=n[J];if(r&&r.contains(e))break;n=n.parentNode}if(!n)return[];for(var o=n.childNodes,i=o.length,s=[],a=0;a<i;a++){var u=o[a],l=u.getAttribute?u.getAttribute("slot"):null;t===l&&s.push(u)}return s},n=HTMLElement.prototype,r=n.getAttribute,o=n.setAttribute,i=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),s=Object.getOwnPropertyDescriptor(ShadowRoot.prototype,"innerHTML"),a=function(e){return"slot"===e?"content":e},u=document.createElement.bind(document),l=document.createElementNS.bind(document);document.createElement=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u.apply(void 0,[a(e)].concat(n))},document.createElementNS=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return l.apply(void 0,[e,a(t)].concat(r))},Object.defineProperty(Element.prototype,"innerHTML",{configurable:!0,get:i.get,set:function(t){i.set.call(this,t),e(this)}}),Object.defineProperty(ShadowRoot.prototype,"innerHTML",{configurable:!0,get:s.get,set:function(t){s.set.call(this,t),e(this)}}),Object.defineProperty(Node.prototype,"assignedSlot",{get:function(){var e=this.parentNode;if(e){var t=e.shadowRoot;if(!t)return null;for(var n=t.querySelectorAll("content"),r=0;r<n.length;r++){var o=n[r];if(o.assignedNodes().indexOf(this)>-1)return o}}return null}}),HTMLElement.prototype.attachShadow=function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var r=this.createShadowRoot();"closed"===n&&Object.defineProperty(this,"shadowRoot",{configurable:!0,get:function(){return null}}),Object.defineProperty(r,"parentNode",{get:function(){return e}});var o=new MutationObserver(function(t){var n=e[J];t.forEach(function(e){var t=e.addedNodes,r=e.removedNodes,o={},i=function(e){return o[e.getAttribute&&e.getAttribute("slot")||"__default"]=!0};if(t)for(var s=t.length,a=0;a<s;a++)i(t[a]);if(r)for(var u=r.length,l=0;l<u;l++)i(r[l]);Object.keys(o).forEach(function(e){var t="__default"===e?n.querySelector("content:not([name])")||n.querySelector('content[name=""]'):n.querySelector('content[name="'+e+'"]');t&&t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})})});return o.observe(this,{childList:!0}),this[J]=r},Object.defineProperty(HTMLContentElement.prototype,"name",{get:function(){return this.getAttribute("name")},set:function(e){return this.setAttribute("name",e)}}),Object.defineProperty(HTMLElement.prototype,"slot",{get:function(){return this.getAttribute("slot")},set:function(e){return this.setAttribute("slot",e)}}),HTMLContentElement.prototype.assignedNodes=function(){for(var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.deep,r=[],o=n?this.getDistributedNodes():t(this),i=0;i<o.length;i++){var s=o[i],a=s.nodeType;a!==Node.ELEMENT_NODE&&a!==Node.TEXT_NODE||r.push(s)}return r},HTMLContentElement.prototype.getAttribute=function(e){if("name"===e){var t=r.call(this,"select");return t?t.match(/\[slot=['"]?(.*?)['"]?\]/)[1]:null}return r.call(this,e)},HTMLContentElement.prototype.setAttribute=function(e,t){return"name"===e&&(e="select",t="[slot='"+t+"']"),o.call(this,e,t)}},Q="0.0.1",Z=Array.prototype,$=Z.forEach,ee="_shadow_root_",te=["childNodes","parentNode"],ne=["textContent"],re=["assignedSlot"],oe=["textContent"],ie=[],se=[Node.ELEMENT_NODE,Node.TEXT_NODE],ae=new WeakMap,ue=new WeakMap,le=new WeakMap,de=new WeakMap,ce=new WeakMap,he=new WeakMap,fe=new WeakMap,pe=new WeakMap,ve=new WeakMap,ge=new DOMParser,_e={____assignedNodes:{get:function(){return this.______assignedNodes||(this.______assignedNodes=[])}},____isInFallbackMode:{get:function(){return 0===this.assignedNodes().length}},____slotChangeListeners:{get:function(){return"undefined"==typeof this.______slotChangeListeners&&(this.______slotChangeListeners=0),this.______slotChangeListeners},set:function(e){this.______slotChangeListeners=e}},____triggerSlotChangeEvent:{value:t(function(){this.____slotChangeListeners&&this.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})},addEventListener:{value:function(e,t,n){return"slotchange"===e&&c(this)&&this.____slotChangeListeners++,this.__addEventListener(e,t,n)}},appendChild:{value:function(e){return q(this,e),e}},assignedSlot:{get:function(){var e=he.get(this);if(!e)return null;var t=ve.get(e),n=fe.get(t),r=ue.get(n);return"open"===r?e:null}},attachShadow:{value:function(e){var t=this,n=e&&e.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var r=le.get(this);if(r)return r;var o=_([].slice.call(this.childNodes)),i=document.createElement(e.polyfillShadowRootTagName||ee);return ue.set(this,n),le.set(this,i),fe.set(i,this),pe.set(i,{}),U?de.set(this,o):v(this,"childNodes",o),o.forEach(function(e){t.__removeChild(e),U?ce.set(e,t):v(e,"parentNode",t)}),this.__appendChild(i)}},childElementCount:{get:function(){return this.children.length}},childNodes:{get:function(){if(U&&"node"===N(this))return this.__childNodes;var e=de.get(this);return e||de.set(this,e=_([])),e}},children:{get:function(){var e=[];return r(this,function(t){1===t.nodeType&&e.push(t)}),_(e)}},firstChild:{get:function(){return this.childNodes[0]||null}},firstElementChild:{get:function(){return this.children[0]||null}},assignedNodes:{value:function(){if(c(this)){var e=ae.get(this);return e||ae.set(this,e=[]),e}}},hasChildNodes:{value:function(){return this.childNodes.length>0}},innerHTML:{get:function(){function e(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName.toLowerCase()in i}var t="",n=function(e){return e.outerHTML},o={};o[Node.ELEMENT_NODE]=n,o[Node.COMMENT_NODE]=d;var i={style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,noscript:!0,plaintext:!0},s=e(this);return r(this,function(e){var r=void 0;r=e.nodeType===Node.TEXT_NODE?s?l:u:o[e.nodeType]||n,t+=r(e)}),t},set:function(e){for(var t=p(e);this.hasChildNodes();)this.removeChild(this.firstChild);var n=h(t);for($.call(n,function(e){return B(e)});t.hasChildNodes();){var r=t.firstChild;t.removeChild(r),this.appendChild(r)}}},insertBefore:{value:function(e,t){return q(this,e,t),e}},lastChild:{get:function(){var e=this.childNodes;return e[e.length-1]||null}},lastElementChild:{get:function(){var e=this.children;return e[e.length-1]||null}},name:{get:function(){return this.getAttribute("name")},set:function(e){var t=this.name,n=this.__setAttribute("name",e);if(e===t)return n;if(!c(this))return n;var r=ve.get(this);return r&&(D(r,this),S(r,this)),n}},nextSibling:{get:function(){var e=this;return r(this.parentNode,function(t,n,r){if(e===t)return r[n+1]||null})}},nextElementSibling:{get:function(){var e=this,t=void 0;return r(this.parentNode,function(n){return t&&1===n.nodeType?n:void(e===n&&(t=!0))})}},outerHTML:{get:function(){var e=this.tagName.toLowerCase(),t=Array.prototype.slice.call(this.attributes).map(function(e){return" "+e.name+(e.value?'="'+e.value+'"':"")}).join("");return"<"+e+t+">"+this.innerHTML+"</"+e+">"},set:function(e){if(this.parentNode){var t=p(e);this.parentNode.replaceChild(t.firstChild,this)}else{if(!U)throw new Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");this.__outerHTML=e}}},parentElement:{get:function(){return y(this.parentNode,function(e){return 1===e.nodeType})}},parentNode:{get:function(){return ce.get(this)||this.__parentNode||null}},previousSibling:{get:function(){var e=this;return r(this.parentNode,function(t,n,r){if(e===t)return r[n-1]||null})}},previousElementSibling:{get:function(){var e=this,t=void 0;return r(this.parentNode,function(n){return t&&e===n?t:void(1===n.nodeType&&(t=n))})}},removeChild:{value:function(e){var t=N(this);switch(t){case"node":if(U)return ce.set(e,null),this.__removeChild(e);H(this,e);break;case"slot":P(this,e);break;case"host":k(this,e);break;case"root":W(this,e)}return e}},removeEventListener:{value:function(e,t,n){return"slotchange"===e&&this.____slotChangeListeners&&c(this)&&this.____slotChangeListeners--,this.__removeEventListener(e,t,n)}},replaceChild:{value:function(e,t){return this.insertBefore(e,t),this.removeChild(t)}},setAttribute:{value:function(e,t){return"slot"===e&&(this[e]=t),c(this)&&"name"===e&&(this[e]=t),this.__setAttribute(e,t)}},shadowRoot:{get:function(){return"open"===ue.get(this)?le.get(this):null}},slot:{get:function(){return this.getAttribute("slot")},set:function(e){var t=this.name,n=this.__setAttribute("slot",e);if(t===e)return n;var r=he.get(this),o=r&&ve.get(r),i=o&&fe.get(o);return i&&(k(i,this),A(i,this)),n}},textContent:{get:function(){var e="";return r(this,function(t){t.nodeType!==Node.COMMENT_NODE&&(e+=t.textContent)}),e},set:function(e){for(;this.hasChildNodes();)this.removeChild(this.firstChild);e&&this.appendChild(document.createTextNode(e))}}};G||(X?K():!function(){var e=Comment.prototype,t=HTMLElement.prototype,n=SVGElement.prototype,r=Text.prototype,o=document.createTextNode(""),i=document.createComment("");Object.keys(_e).forEach(function(s){var u=_e[s];if(u.configurable=!0,u.enumerable=!0,u.hasOwnProperty("value")&&(u.writable=!0),U||te.indexOf(s)===-1){var l=a(t,s),d=a(r,s),c=a(e,s),h=s in o&&ne.indexOf(s)===-1||~re.indexOf(s),f=s in i&&oe.indexOf(s)===-1||~ie.indexOf(s),p="__"+s;Object.defineProperty(t,s,u),Object.defineProperty(n,s,u),l&&(Object.defineProperty(t,p,l),Object.defineProperty(n,p,l)),h&&Object.defineProperty(r,s,u),h&&d&&Object.defineProperty(r,p,d),f&&Object.defineProperty(e,s,u),f&&c&&Object.defineProperty(e,p,c)}})}()),e.default=Q,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("custom-event-polyfill"),require("debounce"),require("weakmap")):"function"==typeof define&&define.amd?define(["exports","custom-event-polyfill","debounce","weakmap"],t):t(e.skatejsNamedSlots=e.skatejsNamedSlots||{},e.customEventPolyfill,e.debounce,e.WeakMap)}(this,function(e,t,n,r){function o(e,t){if(e)for(var n=e.childNodes,r=n.length,o=0;o<r;o++){var i=t(n[o],o,n);if("undefined"!=typeof i)return i}}function i(e){for(var t=[],n=e.length-1;n>=0;n--)t.push(e[n]);return t}function s(e,t){if(e instanceof DocumentFragment)for(var n=e.childNodes,r=n.length,o=r-1;o>=0;o--){var s=i(e.childNodes)[o];t(s,o)}else t(e,0)}function u(e,t){for(var n=void 0;e&&!(n=Object.getOwnPropertyDescriptor(e,t));)e=Object.getPrototypeOf(e);return n}function a(e,t){e instanceof Node&&(e=I);var n=u(e,t);if(n){var r=n.get,o=n.set,i={configurable:!0,enumerable:!0};if(r)return i.get=r,i.set=o,i;if("function"==typeof e[t])return i.value=e[t],i}var s=Object.getOwnPropertyDescriptor(e,t);if(s&&s.get)return s}function l(e){return e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function d(e){return e.textContent}function c(e){return e.text||"<!--"+e.textContent+"-->"}function h(e){return"SLOT"===e.tagName}function f(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.childNodes;if(G&&!Y)return[].concat(z(e.querySelectorAll("content")));if(!n||[Node.ELEMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE].indexOf(e.nodeType)===-1)return t;for(var r=n.length,o=0;o<r;o++){var i=n[o];h(i)&&t.push(i),f(i,t)}return t}function p(e){return"_SHADOW_ROOT_"===e.tagName}function g(e){var t=document.createElement("div");if(V)return t.__innerHTML=e,t;for(var n=_e.parseFromString("<div>"+e+"</div>","text/html").body.firstChild;n.hasChildNodes();){var r=n.firstChild;n.removeChild(r),t.appendChild(r)}return document.importNode(t,!0)}function v(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n}})}function _(e){return this[e]}function m(e){return e.item=_,e}function N(e){return!!de.get(e)}function y(e){return N(e)?"host":h(e)?"slot":p(e)?"root":"node"}function b(e,t){for(;e&&e!==document;){if(t(e))return e;e=e.parentNode}}function E(e){return e.getAttribute&&e.getAttribute("name")||"default"}function C(e){return e.getAttribute&&e.getAttribute("slot")||"default"}function O(e,t,n){if(ue.indexOf(t.nodeType)!==-1){var r=e.assignedNodes(),o=0===r.length,i=r.indexOf(n);fe.set(t,e),o&&ee.call(e.childNodes,function(t){return e.__removeChild(t)}),i>-1?(e.__insertBefore(t,void 0!==n?n:null),r.splice(i,0,t)):(e.__appendChild(t),r.push(t)),e.____triggerSlotChangeEvent()}}function T(e){var t=fe.get(e);if(t){var n=t.assignedNodes(),r=n.indexOf(e);if(r>-1){var o=1===n.length;n.splice(r,1),fe.set(e,null),t.__removeChild(e),o&&ee.call(t.childNodes,function(e){return t.__appendChild(e)}),t.____triggerSlotChangeEvent()}}}function w(e,t){for(var n=e.childNodes,r=n.length,o=0;o<r;o++)if(n[o]===t)return o;return-1}function L(e,t,n,r){var o=w(e,n);s(t,function(t,n){r(t,n),V?he.set(t,e):v(t,"parentNode",e),o>-1?$.splice.call(e.childNodes,o+n,0,t):$.push.call(e.childNodes,t)})}function A(e,t,n){var r=w(e,t);r>-1&&(n(t,0),V?he.set(t,null):v(t,"parentNode",null),$.splice.call(e.childNodes,r,1))}function M(e,t,n){L(e,t,n,function(t){e.__insertBefore(t,void 0!==n?n:null)})}function S(e,t,n){L(e,t,n,function(t){var r=de.get(e),o=ge.get(r),i=o[C(t)];i&&O(i,t,n)})}function x(e,t){var n=E(t);V||Array.isArray(t.childNodes)||v(t,"childNodes",J(t.childNodes)),ge.get(e)[n]=t,ve.has(t)||ve.set(t,e),o(pe.get(e),function(e){e.assignedSlot||n!==C(e)||O(t,e)})}function j(e,t,n){s(t,function(t){if(h(t))x(e,t);else{var n=f(t);if(n)for(var r=n.length,o=0;o<r;o++)x(e,n[o])}}),M(e,t,n)}function P(e,t,n){var r=0===e.assignedNodes().length;L(e,t,n,function(t){r&&e.__insertBefore(t,void 0!==n?n:null)})}function H(e,t){var n=0===e.assignedNodes().length;A(e,t,function(){n&&e.__removeChild(t)})}function D(e,t){A(e,t,function(){e.__removeChild(t)})}function k(e,t){A(e,t,function(){T(t)})}function R(e,t){var n=Array.prototype.slice.call(t.assignedNodes());n.forEach(T),delete ge.get(e)[E(t)],ve.delete(t)}function q(e,t){A(e,t,function(){if(h(t))R(e,t);else{var n=f(t);if(n)for(var r=0;r<n.length;r++)R(e,n[r])}e.__removeChild(t)})}function B(e){if(p(e))return e;if(e.parentNode)return B(e.parentNode)}function F(e,t,n){var r=y(e),o=t.parentNode,i=B(e);return V||Array.isArray(e.childNodes)||v(e,"childNodes",J(e.childNodes)),i&&"slot"===y(t)&&x(i,t),o&&"host"===y(o)&&(V?he.set(t,null):v(t,"parentNode",null)),"node"===r?V?(he.set(t,e),e.__insertBefore(t,void 0!==n?n:null)):M(e,t,n):"slot"===r?P(e,t,n):"host"===r?S(e,t,n):"root"===r?j(e,t,n):void 0}function W(e){if(V&&"slot"===y(e)&&e.__childNodes.length!==e.childNodes.length){for(;e.hasChildNodes();)e.removeChild(e.firstChild);ee.call(e.__childNodes,function(t){return e.appendChild(t)})}}n="default"in n?n.default:n,r="default"in r?r.default:r;var X=document.createElement("div"),G=!!X.createShadowRoot,Y=!!X.attachShadow,I=document.createElement("div"),U=a(Element.prototype,"innerHTML"),V=!!U,z=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},J=function(e){return Array.prototype.slice.call(e)},K="__shadowRoot",Q=function(){function e(e){for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=[];t.nextNode();){var r=t.currentNode;"SLOT"===r.tagName&&n.push(r)}n.forEach(function(e){var t=e.getAttribute("name"),n=document.createElement("slot");for(t&&n.setAttribute("name",t),e.parentNode.replaceChild(n,e);e.hasChildNodes();)n.appendChild(e.firstChild)})}var t=function(e){for(var t=e.getAttribute("name"),n=e;n;){var r=n[K];if(r&&r.contains(e))break;n=n.parentNode}if(!n)return[];for(var o=n.childNodes,i=o.length,s=[],u=0;u<i;u++){var a=o[u],l=a.getAttribute?a.getAttribute("slot"):null;t===l&&s.push(a)}return s},n=HTMLElement.prototype,r=n.getAttribute,o=n.setAttribute,i=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),s=Object.getOwnPropertyDescriptor(ShadowRoot.prototype,"innerHTML"),u=function(e){return"slot"===e?"content":e},a=document.createElement.bind(document),l=document.createElementNS.bind(document);document.createElement=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return a.apply(void 0,[u(e)].concat(n))},document.createElementNS=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return l.apply(void 0,[e,u(t)].concat(r))},Object.defineProperty(Element.prototype,"innerHTML",{configurable:!0,get:i.get,set:function(t){i.set.call(this,t),e(this)}}),Object.defineProperty(ShadowRoot.prototype,"innerHTML",{configurable:!0,get:s.get,set:function(t){s.set.call(this,t),e(this)}}),Object.defineProperty(Node.prototype,"assignedSlot",{get:function(){var e=this.parentNode;if(e){var t=e.shadowRoot;if(!t)return null;for(var n=t.querySelectorAll("content"),r=0;r<n.length;r++){var o=n[r];if(o.assignedNodes().indexOf(this)>-1)return o}}return null}}),HTMLElement.prototype.attachShadow=function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var r=this.createShadowRoot();"closed"===n&&Object.defineProperty(this,"shadowRoot",{configurable:!0,get:function(){return null}}),Object.defineProperty(r,"parentNode",{get:function(){return e}});var o=new MutationObserver(function(t){var n=e[K];t.forEach(function(e){var t=e.addedNodes,r=e.removedNodes,o={},i=function(e){return o[e.getAttribute&&e.getAttribute("slot")||"__default"]=!0};if(t)for(var s=t.length,u=0;u<s;u++)i(t[u]);if(r)for(var a=r.length,l=0;l<a;l++)i(r[l]);Object.keys(o).forEach(function(e){var t="__default"===e?n.querySelector("content:not([name])")||n.querySelector('content[name=""]'):n.querySelector('content[name="'+e+'"]');t&&t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})})});return o.observe(this,{childList:!0}),this[K]=r},Object.defineProperty(HTMLContentElement.prototype,"name",{get:function(){return this.getAttribute("name")},set:function(e){return this.setAttribute("name",e)}}),Object.defineProperty(HTMLElement.prototype,"slot",{get:function(){return this.getAttribute("slot")},set:function(e){return this.setAttribute("slot",e)}}),HTMLContentElement.prototype.assignedNodes=function(){for(var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.deep,r=[],o=n?this.getDistributedNodes():t(this),i=0;i<o.length;i++){var s=o[i],u=s.nodeType;u!==Node.ELEMENT_NODE&&u!==Node.TEXT_NODE||r.push(s)}return r},HTMLContentElement.prototype.getAttribute=function(e){if("name"===e){var t=r.call(this,"select");return t?t.match(/\[slot=['"]?(.*?)['"]?\]/)[1]:null}return r.call(this,e)},HTMLContentElement.prototype.setAttribute=function(e,t){return"name"===e&&(e="select",t="[slot='"+t+"']"),o.call(this,e,t)}},Z="0.0.1",$=Array.prototype,ee=$.forEach,te="_shadow_root_",ne=["childNodes","parentNode"],re=["textContent"],oe=["assignedSlot"],ie=["textContent"],se=[],ue=[Node.ELEMENT_NODE,Node.TEXT_NODE],ae=new r,le=new r,de=new r,ce=new r,he=new r,fe=new r,pe=new r,ge=new r,ve=new r,_e=new DOMParser,me={____assignedNodes:{get:function(){return this.______assignedNodes||(this.______assignedNodes=[])}},____isInFallbackMode:{get:function(){return 0===this.assignedNodes().length}},____slotChangeListeners:{get:function(){return"undefined"==typeof this.______slotChangeListeners&&(this.______slotChangeListeners=0),this.______slotChangeListeners},set:function(e){this.______slotChangeListeners=e}},____triggerSlotChangeEvent:{value:n(function(){this.____slotChangeListeners&&this.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1}))})},addEventListener:{value:function(e,t,n){return"slotchange"===e&&h(this)&&this.____slotChangeListeners++,this.__addEventListener(e,t,n)}},appendChild:{value:function(e){return F(this,e),e}},assignedSlot:{get:function(){var e=fe.get(this);if(!e)return null;var t=ve.get(e),n=pe.get(t),r=le.get(n);return"open"===r?e:null}},attachShadow:{value:function(e){var t=this,n=e&&e.mode;if("closed"!==n&&"open"!==n)throw new Error('You must specify { mode } as "open" or "closed" to attachShadow().');var r=de.get(this);if(r)return r;var o=m([].slice.call(this.childNodes)),i=document.createElement(e.polyfillShadowRootTagName||te);return le.set(this,n),de.set(this,i),pe.set(i,this),ge.set(i,{}),V?ce.set(this,o):v(this,"childNodes",o),o.forEach(function(e){t.__removeChild(e),V?he.set(e,t):v(e,"parentNode",t)}),this.__appendChild(i)}},childElementCount:{get:function(){return this.children.length}},childNodes:{get:function(){if(V&&"node"===y(this))return this.__childNodes;var e=ce.get(this);return e||ce.set(this,e=m([])),e}},children:{get:function(){var e=[];return o(this,function(t){1===t.nodeType&&e.push(t)}),m(e)}},firstChild:{get:function(){return this.childNodes[0]||null}},firstElementChild:{get:function(){return this.children[0]||null}},assignedNodes:{value:function(){if(h(this)){var e=ae.get(this);return e||ae.set(this,e=[]),e}}},hasChildNodes:{value:function(){return this.childNodes.length>0}},innerHTML:{get:function(){function e(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName.toLowerCase()in i}var t="",n=function(e){return e.outerHTML},r={};r[Node.ELEMENT_NODE]=n,r[Node.COMMENT_NODE]=c;var i={style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,noscript:!0,plaintext:!0},s=e(this);return o(this,function(e){var o=void 0;o=e.nodeType===Node.TEXT_NODE?s?d:l:r[e.nodeType]||n,t+=o(e)}),t},set:function(e){for(var t=g(e);this.hasChildNodes();)this.removeChild(this.firstChild);var n=f(t);for(ee.call(n,function(e){return W(e)});t.hasChildNodes();){var r=t.firstChild;t.removeChild(r),this.appendChild(r)}}},insertBefore:{value:function(e,t){return F(this,e,t),e}},lastChild:{get:function(){var e=this.childNodes;return e[e.length-1]||null}},lastElementChild:{get:function(){var e=this.children;return e[e.length-1]||null}},name:{get:function(){return this.getAttribute("name")},set:function(e){var t=this.name,n=this.__setAttribute("name",e);if(e===t)return n;if(!h(this))return n;var r=ve.get(this);return r&&(R(r,this),x(r,this)),n}},nextSibling:{get:function(){var e=this;return o(this.parentNode,function(t,n,r){if(e===t)return r[n+1]||null})}},nextElementSibling:{get:function(){var e=this,t=void 0;return o(this.parentNode,function(n){return t&&1===n.nodeType?n:void(e===n&&(t=!0))})}},outerHTML:{get:function(){var e=this.tagName.toLowerCase(),t=Array.prototype.slice.call(this.attributes).map(function(e){return" "+e.name+(e.value?'="'+e.value+'"':"")}).join("");return"<"+e+t+">"+this.innerHTML+"</"+e+">"},set:function(e){if(this.parentNode){var t=g(e);this.parentNode.replaceChild(t.firstChild,this)}else{if(!V)throw new Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");this.__outerHTML=e}}},parentElement:{get:function(){return b(this.parentNode,function(e){return 1===e.nodeType})}},parentNode:{get:function(){return he.get(this)||this.__parentNode||null}},previousSibling:{get:function(){var e=this;return o(this.parentNode,function(t,n,r){if(e===t)return r[n-1]||null})}},previousElementSibling:{get:function(){var e=this,t=void 0;return o(this.parentNode,function(n){return t&&e===n?t:void(1===n.nodeType&&(t=n))})}},removeChild:{value:function(e){var t=y(this);switch(t){case"node":if(V)return he.set(e,null),this.__removeChild(e);D(this,e);break;case"slot":H(this,e);break;case"host":k(this,e);break;case"root":q(this,e)}return e}},removeEventListener:{value:function(e,t,n){return"slotchange"===e&&this.____slotChangeListeners&&h(this)&&this.____slotChangeListeners--,this.__removeEventListener(e,t,n)}},replaceChild:{value:function(e,t){return this.insertBefore(e,t),this.removeChild(t)}},setAttribute:{value:function(e,t){return"slot"===e&&(this[e]=t),h(this)&&"name"===e&&(this[e]=t),this.__setAttribute(e,t)}},shadowRoot:{get:function(){return"open"===le.get(this)?de.get(this):null}},slot:{get:function(){return this.getAttribute("slot")},set:function(e){var t=this.name,n=this.__setAttribute("slot",e);if(t===e)return n;var r=fe.get(this),o=r&&ve.get(r),i=o&&pe.get(o);return i&&(k(i,this),S(i,this)),n}},textContent:{get:function(){var e="";return o(this,function(t){t.nodeType!==Node.COMMENT_NODE&&(e+=t.textContent)}),e},set:function(e){for(;this.hasChildNodes();)this.removeChild(this.firstChild);e&&this.appendChild(document.createTextNode(e))}}};Y||(G?Q():!function(){var e=Comment.prototype,t=HTMLElement.prototype,n=SVGElement.prototype,r=Text.prototype,o=document.createTextNode(""),i=document.createComment("");Object.keys(me).forEach(function(s){var u=me[s];if(u.configurable=!0,u.enumerable=!0,u.hasOwnProperty("value")&&(u.writable=!0),V||ne.indexOf(s)===-1){var l=a(t,s),d=a(r,s),c=a(e,s),h=s in o&&re.indexOf(s)===-1||~oe.indexOf(s),f=s in i&&ie.indexOf(s)===-1||~se.indexOf(s),p="__"+s;Object.defineProperty(t,s,u),Object.defineProperty(n,s,u),l&&(Object.defineProperty(t,p,l),Object.defineProperty(n,p,l)),h&&Object.defineProperty(r,s,u),h&&d&&Object.defineProperty(r,p,d),f&&Object.defineProperty(e,s,u),f&&c&&Object.defineProperty(e,p,c)}})}()),e.default=Z,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=index.min.js.map |
@@ -13,3 +13,4 @@ { | ||
"prepublish": "sk-bundle", | ||
"commit": "sk-commit" | ||
"commit": "sk-commit", | ||
"validate": "npm ls" | ||
}, | ||
@@ -47,3 +48,3 @@ "repository": { | ||
"debounce": "^1.0.0", | ||
"webcomponents.js": "webcomponents/webcomponentsjs#b77ca74" | ||
"weakmap": "0.0.6" | ||
}, | ||
@@ -58,3 +59,3 @@ "config": { | ||
], | ||
"version": "1.2.4" | ||
"version": "1.2.5" | ||
} |
@@ -34,3 +34,3 @@ # named-slots [![Build Status](https://travis-ci.org/skatejs/named-slots.svg?branch=master)](https://travis-ci.org/skatejs/named-slots) | ||
``` | ||
https://npmcdn.com/skatejs-named-slots/dist/index-with-deps.min.js | ||
https://unpkg.com/skatejs-named-slots/dist/index-with-deps.min.js | ||
``` | ||
@@ -58,3 +58,3 @@ | ||
```html | ||
<script src="https://npmcdn.com/skatejs-named-slots/dist/index-with-deps.min.js"></script> | ||
<script src="https://unpkg.com/skatejs-named-slots/dist/index-with-deps.min.js"></script> | ||
``` | ||
@@ -61,0 +61,0 @@ |
@@ -0,4 +1,7 @@ | ||
// TODO move into the skatejs-web-components package. | ||
import 'custom-event-polyfill'; | ||
import debounce from 'debounce'; | ||
import 'custom-event-polyfill'; | ||
import 'webcomponents.js/src/WeakMap/WeakMap.js'; | ||
import WeakMap from 'weakmap'; | ||
import { eachChildNode, eachNodeOrFragmentNodes } from './util/each'; | ||
@@ -5,0 +8,0 @@ import { shadowDomV0, shadowDomV1 } from './util/support'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
548100
4255
0
0
+ Addedweakmap@0.0.6
+ Addedweakmap@0.0.6(transitive)
- Removedwebcomponents.js@webcomponents/webcomponentsjs#b77ca74