(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["/js/stories"],{ /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/assets/js/components/StoryViewer.vue?vue&type=script&lang=js&": /*!*****************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/assets/js/components/StoryViewer.vue?vue&type=script&lang=js& ***! \*****************************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["default"] = ({ props: { pid: { type: String }, selfProfile: { type: Object }, redirectUrl: { type: String, "default": '/' } }, data: function data() { return { loading: true, profile: null, account: { local: false }, owner: false, stories: [], username: 'loading...', avatar: '/storage/avatars/default.jpg', storyIndex: 0, progress: 0, constInterval: 383, progressInterval: undefined, composeText: null, paused: false, muted: true, reactionEmoji: ["❤️", "🔥", "💯", "😂", "😎", "👀"], activeReactionEmoji: false, activeReply: false, showProgress: false, redirectOnEnd: '/', viewerSid: false, viewerPage: 1, loadingViewers: false, viewersHasMore: true, viewers: [], viewWarning: false, showingPollResults: false, loadingPollResults: false, pollResults: [], pollTotalVotes: 0 }; }, watch: { composeText: function composeText(val) { if (val.length == 0) { if (this.paused) { this.pause(); } } else { if (!this.paused) { this.pause(); } } event.currentTarget.focus(); } }, beforeMount: function beforeMount() { this.redirectOnEnd = this.redirectUrl; }, mounted: function mounted() { var _this = this; var u = new URLSearchParams(window.location.search); if (u.has('t')) { switch (u.get('t')) { case '1': this.redirectOnEnd = '/'; break; case '2': this.redirectOnEnd = '/timeline/public'; break; case '3': this.redirectOnEnd = '/timeline/network'; break; case '4': this.redirectOnEnd = '/' + window.location.pathname.split('/').slice(-1).pop(); break; } } else { this.viewWarning = true; } if (!this.selfProfile || !this.selfProfile.hasOwnProperty('avatar')) { axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(function (res) { _this.profile = res.data; _this.fetchStories(); }); } else { this.profile = this.selfProfile; } var el = document.querySelector('body'); el.style.width = '100%'; el.style.height = '100vh !important'; el.style.overflow = 'hidden'; el.style.backgroundColor = '#262626'; }, methods: { init: function init() { var _this2 = this; clearInterval(this.progressInterval); this.loading = false; this.constInterval = Math.ceil(this.stories[this.storyIndex].duration * 38.3); this.progressInterval = setInterval(function () { _this2["do"](); }, this.constInterval); }, "do": function _do() { this.loading = false; if (this.stories[this.storyIndex].progress != 100) { this.stories[this.storyIndex].progress = this.stories[this.storyIndex].progress + 4; } else { clearInterval(this.progressInterval); this.next(); } }, prev: function prev() { if (this.storyIndex == 0) { return; } this.pollResults = []; this.progress = 0; this.gotoSlide(this.storyIndex - 1); }, next: function next() { axios.post('/api/web/stories/v1/viewed', { id: this.stories[this.storyIndex].id }); this.stories[this.storyIndex].progress = 100; if (this.storyIndex == this.stories.length - 1) { if (this.composeText && this.composeText.length) { return; } window.location.href = this.redirectOnEnd; return; } this.pollResults = []; this.progress = 0; this.muted = true; this.storyIndex = this.storyIndex + 1; this.init(); }, pause: function pause() { if (event) { event.currentTarget.blur(); } if (this.paused) { this.paused = false; if (this.stories[this.storyIndex].type == 'video') { var el = document.getElementById('playr'); el.play(); } this.init(); } else { clearInterval(this.progressInterval); if (this.stories[this.storyIndex].type == 'video') { var _el = document.getElementById('playr'); _el.pause(); } this.paused = true; } }, toggleMute: function toggleMute() { if (event) { event.currentTarget.blur(); } if (this.stories[this.storyIndex].type == 'video') { this.muted = !this.muted; var el = document.getElementById('playr'); el.muted = this.muted; } }, gotoSlide: function gotoSlide(index) { this.paused = false; clearInterval(this.progressInterval); this.progressInterval = null; this.stories = this.stories.map(function (s, k) { if (k < index) { s.progress = 100; } else { s.progress = 0; } return s; }); this.storyIndex = index; this.stories[index].progress = 0; this.init(); }, showMenu: function showMenu() { if (!this.paused) { this.pause(); } event.currentTarget.blur(); this.$refs.ctxMenu.show(); }, react: function react(emoji) { var _this3 = this; this.$refs.ctxMenu.hide(); this.activeReactionEmoji = true; axios.post('/api/web/stories/v1/react', { sid: this.stories[this.storyIndex].id, reaction: emoji }).then(function (res) { setTimeout(function () { _this3.activeReactionEmoji = false; _this3.pause(); }, 2000); })["catch"](function (err) { _this3.activeReactionEmoji = false; swal('Error', 'An error occured when attempting to react to this story. Please try again later.', 'error'); }); }, comment: function comment() { var _this4 = this; if (this.composeText.length < 2) { return; } if (!this.paused) { this.pause(); } this.activeReply = true; axios.post('/api/web/stories/v1/comment', { sid: this.stories[this.storyIndex].id, caption: this.composeText }).then(function (res) { _this4.composeText = null; setTimeout(function () { _this4.activeReply = false; _this4.pause(); }, 2000); })["catch"](function (err) { _this4.activeReply = false; swal('Error', 'An error occured when attempting to reply to this story. Please try again later.', 'error'); }); }, closeCtxMenu: function closeCtxMenu() { this.$refs.ctxMenu.hide(); }, backToFeed: function backToFeed() { var _this5 = this; if (this.composeText) { swal('Are you sure you want to leave without sending this reply?').then(function (confirm) { if (confirm) { window.location.href = _this5.redirectOnEnd; } }); return; } else { window.location.href = this.redirectOnEnd; } }, timeago: function timeago(ts) { return App.util.format.timeAgo(ts); }, timeahead: function timeahead(ts) { var d = new Date(ts); return App.util.format.timeAhead(d.toUTCString()); }, fetchStories: function fetchStories() { var _this6 = this; var self = this; axios.get('/api/web/stories/v1/profile/' + this.pid).then(function (res) { if (res.data.length == 0) { window.location.href = _this6.redirectOnEnd; } self.account = res.data[0].account; if (self.account.local == false) { self.account.domain = self.account.acct.split('@')[1]; } self.stories = res.data[0].nodes.map(function (i, k) { var r = { id: i.id, created_at: i.created_at, expires_at: i.expires_at, progress: i.progress, view_count: i.view_count, url: i.src, type: i.type, duration: i.duration, can_reply: i.can_reply, can_react: i.can_react }; if (r.type == 'poll') { r.question = i.question; r.options = i.options; r.voted = i.voted; r.voted_index = i.voted_index; } return r; }); self.username = res.data[0].account.username; self.avatar = res.data[0].account.avatar; if (self.profile.id == res.data[0].account.id) { _this6.viewWarning = false; } if (_this6.viewWarning) { _this6.loading = false; return; } var seen = res.data[0].nodes.filter(function (i, k) { return i.seen == true; }).map(function (i, k) { return k; }); if (seen.length && _this6.pid != _this6.profile.id) { var n = seen[seen.length - 1] + 1 == self.stories.length ? seen[seen.length - 1] : seen[seen.length - 1] + 1; self.gotoSlide(n); } if (_this6.pid == _this6.profile.id) { self.gotoSlide(self.stories.length - 1); } self.showProgress = true; if (self.profile.id == self.account.id) { self.owner = true; } if (res.data.length == 0) { window.location.href = _this6.redirectOnEnd; return; } _this6.init(); })["catch"](function (err) { return; }); }, fetchViewers: function fetchViewers() { var _this7 = this; this.closeCtxMenu(); this.$refs.viewersModal.show(); if (this.stories[this.storyIndex].id == this.viewerSid) { return; } this.loadingViewers = true; axios.get('/api/web/stories/v1/viewers', { params: { sid: this.stories[this.storyIndex].id } }).then(function (res) { _this7.viewerSid = _this7.stories[_this7.storyIndex].id; _this7.viewers = res.data; _this7.loadingViewers = false; _this7.viewerPage = 2; if (_this7.viewers.length == 10) { _this7.viewersHasMore = true; } else { _this7.viewersHasMore = false; } })["catch"](function (err) { swal('Cannot load viewers', 'Cannot load viewers of this story, please try again later.', 'error'); }); }, viewersLoadMore: function viewersLoadMore() { var _this8 = this; axios.get('/api/web/stories/v1/viewers', { params: { sid: this.stories[this.storyIndex].id, page: this.viewerPage } }).then(function (res) { var _this8$viewers; if (!res.data || res.data.length == 0) { _this8.viewersHasMore = false; return; } if (res.data.length != 10) { _this8.viewersHasMore = false; } (_this8$viewers = _this8.viewers).push.apply(_this8$viewers, _toConsumableArray(res.data)); _this8.viewerPage++; })["catch"](function (err) { swal('Cannot load viewers', 'Cannot load viewers of this story, please try again later.', 'error'); }); }, closeViewersModal: function closeViewersModal() { this.$refs.viewersModal.hide(); }, deleteStory: function deleteStory() { var _this9 = this; this.closeCtxMenu(); if (!window.confirm('Are you sure you want to delete this story?')) { this.pause(); return; } axios["delete"]('/api/web/stories/v1/delete/' + this.stories[this.storyIndex].id).then(function (res) { var i = _this9.storyIndex; var c = _this9.stories.length; if (c == 1) { window.location.href = '/'; return; } window.location.reload(); }); }, selectPollOption: function selectPollOption(index) { var _this10 = this; if (!this.paused) { this.pause(); } axios.post('/i/stories/viewed', { id: this.stories[this.storyIndex].id }); axios.post('/api/web/stories/v1/poll/vote', { sid: this.stories[this.storyIndex].id, ci: index }).then(function (res) { _this10.stories[_this10.storyIndex].voted = true; _this10.stories[_this10.storyIndex].voted_index = index; _this10.next(); }); }, ctxMenuReport: function ctxMenuReport() { this.$refs.ctxMenu.hide(); this.$refs.ctxReport.show(); }, openCtxReportOtherMenu: function openCtxReportOtherMenu() { this.closeCtxMenu(); this.$refs.ctxReport.hide(); this.$refs.ctxReportOther.show(); }, ctxReportMenuGoBack: function ctxReportMenuGoBack() { this.closeMenus(); }, ctxReportOtherMenuGoBack: function ctxReportOtherMenuGoBack() { this.closeMenus(); }, closeMenus: function closeMenus() { this.$refs.ctxReportOther.hide(); this.$refs.ctxReport.hide(); this.$refs.ctxMenu.hide(); }, sendReport: function sendReport(type) { var _this11 = this; var id = this.stories[this.storyIndex].id; swal({ 'title': 'Confirm Report', 'text': 'Are you sure you want to report this post?', 'icon': 'warning', 'buttons': true, 'dangerMode': true }).then(function (res) { if (res) { axios.post('/api/web/stories/v1/report', { 'type': type, 'id': id }).then(function (res) { _this11.closeMenus(); swal('Report Sent!', 'We have successfully received your report', 'success'); })["catch"](function (err) { if (err.response.status === 409) { swal('Already reported', 'You have already reported this story', 'info'); } else { swal('Oops!', 'There was an issue reporting this story', 'error'); } }); } else { _this11.closeMenus(); } }); }, confirmViewStory: function confirmViewStory() { var self = this; var seen = this.stories.filter(function (i, k) { return i.seen == true; }).map(function (i, k) { return k; }); if (seen.length && this.pid != this.profile.id) { var n = seen[seen.length - 1] + 1 == self.stories.length ? seen[seen.length - 1] : seen[seen.length - 1] + 1; self.gotoSlide(n); } if (this.pid == this.profile.id) { self.gotoSlide(self.stories.length - 1); } self.showProgress = true; if (self.profile.username == self.username) { self.owner = true; } this.viewWarning = false; this.init(); }, showPollResults: function showPollResults() { var _this12 = this; this.loadingPollResults = true; if (!this.paused) { this.pause(); } axios.get('/api/web/stories/v1/poll/results', { params: { sid: this.stories[this.storyIndex].id } }).then(function (res) { _this12.loadingPollResults = false; _this12.pollResults = res.data; var sum = function sum(a, b) { return a + b; }; _this12.pollTotalVotes = _this12.pollResults.reduce(sum); }); }, addToStory: function addToStory() { window.location.href = '/i/stories/new'; }, pollPercent: function pollPercent(index) { return this.pollTotalVotes == 0 ? 0 : Math.round(this.pollResults[index] / this.pollTotalVotes * 100); } } }); /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./resources/assets/js/components/StoryViewer.vue?vue&type=style&index=0&id=be0d9900&lang=scss&scoped=true&": /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--9-2!./node_modules/sass-loader/dist/cjs.js??ref--9-3!./node_modules/vue-loader/lib??vue-loader-options!./resources/assets/js/components/StoryViewer.vue?vue&type=style&index=0&id=be0d9900&lang=scss&scoped=true& ***! \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, "#content[data-v-be0d9900] {\n width: 100%;\n height: 100vh !important;\n overflow: hidden;\n background-color: #262626;\n}\n.story-viewer-component-card[data-v-be0d9900] {\n height: 100vh;\n}\n@media (min-width: 768px) {\n.story-viewer-component-card[data-v-be0d9900] {\n height: 90vh;\n}\n}\n.story-viewer-component.bg-black[data-v-be0d9900] {\n background-color: #262626;\n}\n.story-viewer-component .option-green[data-v-be0d9900] {\n font-size: 20px;\n font-weight: 600;\n background: #11998e;\n /* fallback for old browsers */\n background: linear-gradient(180deg, #38ef7d, #11998e);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n.story-viewer-component .option-red[data-v-be0d9900] {\n font-weight: 600;\n background: linear-gradient(to right, #F27121, #E94057, #8A2387);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n.story-viewer-component .bg-black[data-v-be0d9900] {\n background-color: #262626;\n}\n.story-viewer-component .fade-enter-active[data-v-be0d9900], .story-viewer-component .fade-leave-active[data-v-be0d9900] {\n transition: opacity 0.5s;\n}\n.story-viewer-component .fade-enter[data-v-be0d9900], .story-viewer-component .fade-leave-to[data-v-be0d9900] {\n opacity: 0;\n}\n.story-viewer-component .progress[data-v-be0d9900] {\n background-color: #979a9a;\n}\n.story-viewer-component .media-slot[data-v-be0d9900] {\n border-radius: 0;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n background: #000;\n background-size: cover !important;\n z-index: 0;\n}\n.story-viewer-component .card-body .top-overlay[data-v-be0d9900] {\n height: 100px;\n margin-left: -35px;\n margin-right: -35px;\n margin-top: -20px;\n padding-bottom: 20px;\n border-radius: 5px;\n background: linear-gradient(180deg, rgba(38, 38, 38, 0.8) 0%, rgba(38, 38, 38, 0) 100%);\n}\n.story-viewer-component .card-footer[data-v-be0d9900] ::-moz-placeholder {\n color: #fff;\n opacity: 1;\n}\n.story-viewer-component .card-footer[data-v-be0d9900] :-ms-input-placeholder {\n color: #fff;\n opacity: 1;\n}\n.story-viewer-component .card-footer[data-v-be0d9900] ::placeholder {\n color: #fff;\n opacity: 1;\n}\n.story-viewer-component .card-footer .bottom-overlay[data-v-be0d9900] {\n margin-left: -35px;\n margin-right: -35px;\n margin-bottom: -20px;\n border-radius: 5px;\n background: linear-gradient(0deg, rgba(38, 38, 38, 0.8) 0%, rgba(38, 38, 38, 0) 100%);\n}\n.story-viewer-component .card-footer .bottom-overlay .form-group[data-v-be0d9900] {\n padding-top: 40px;\n padding-bottom: 20px;\n margin-bottom: 0;\n}", ""]); // exports /***/ }), /***/ "./node_modules/css-loader/lib/css-base.js": /*!*************************************************!*\ !*** ./node_modules/css-loader/lib/css-base.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function(useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if(item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") alreadyImportedModules[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./resources/assets/js/components/StoryViewer.vue?vue&type=style&index=0&id=be0d9900&lang=scss&scoped=true&": /*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/style-loader!./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--9-2!./node_modules/sass-loader/dist/cjs.js??ref--9-3!./node_modules/vue-loader/lib??vue-loader-options!./resources/assets/js/components/StoryViewer.vue?vue&type=style&index=0&id=be0d9900&lang=scss&scoped=true& ***! \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../../node_modules/css-loader!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--9-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-3!../../../../node_modules/vue-loader/lib??vue-loader-options!./StoryViewer.vue?vue&type=style&index=0&id=be0d9900&lang=scss&scoped=true& */ "./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./resources/assets/js/components/StoryViewer.vue?vue&type=style&index=0&id=be0d9900&lang=scss&scoped=true&"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./node_modules/style-loader/lib/addStyles.js": /*!****************************************************!*\ !*** ./node_modules/style-loader/lib/addStyles.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var stylesInDom = {}; var memoize = function (fn) { var memo; return function () { if (typeof memo === "undefined") memo = fn.apply(this, arguments); return memo; }; }; var isOldIE = memoize(function () { // Test for IE <= 9 as proposed by Browserhacks // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 // Tests for existence of standard globals is to allow style-loader // to operate correctly into non-standard environments // @see https://github.com/webpack-contrib/style-loader/issues/177 return window && document && document.all && !window.atob; }); var getTarget = function (target, parent) { if (parent){ return parent.querySelector(target); } return document.querySelector(target); }; var getElement = (function (fn) { var memo = {}; return function(target, parent) { // If passing function in options, then use it for resolve "head" element. // Useful for Shadow Root style i.e // { // insertInto: function () { return document.querySelector("#foo").shadowRoot } // } if (typeof target === 'function') { return target(); } if (typeof memo[target] === "undefined") { var styleTarget = getTarget.call(this, target, parent); // Special case to return head of iframe instead of iframe itself if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { try { // This will throw an exception if access to iframe is blocked // due to cross-origin restrictions styleTarget = styleTarget.contentDocument.head; } catch(e) { styleTarget = null; } } memo[target] = styleTarget; } return memo[target] }; })(); var singleton = null; var singletonCounter = 0; var stylesInsertedAtTop = []; var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js"); module.exports = function(list, options) { if (typeof DEBUG !== "undefined" && DEBUG) { if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } options = options || {}; options.attrs = typeof options.attrs === "object" ? options.attrs : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of