@inappstory/js-sdk 3.6.3 → 3.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.mjs +2233 -1
- package/dist/index.esm.mjs.map +1 -0
- package/dist/index.umd.js +1 -1
- package/package.json +2 -2
package/dist/index.esm.mjs
CHANGED
|
@@ -1 +1,2233 @@
|
|
|
1
|
-
import*as e from"@inappstory/react-sdk";import*as t from"react/jsx-runtime";import*as r from"react-dom/client";import*as o from"react";import*as n from"react-dom";var a={432:(e,t,r)=>{r.d(t,{A:()=>a});var o=r(935),n=r.n(o)()((function(e){return e[1]}));n.push([e.id,".favorite-story-list-modal--xWjHA{position:fixed;inset:0px;z-index:1090}.favorite-story-list-modal--xWjHA .container--GZBjv{width:100%;height:100%;background:var(--storiesFavoriteBackgroundColor, #333333);display:flex;flex-direction:column;position:relative;overflow-y:auto}.favorite-story-list-modal--xWjHA .header--TjHMD{display:flex;align-content:center;justify-content:center;align-items:center;flex-shrink:0;position:-webkit-sticky;position:sticky;top:0;z-index:100;background:var(--storiesFavoriteTitleBackgroundColor, #333333);box-shadow:0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12),0 1px 3px 0 rgba(0,0,0,.2);padding-top:var(--storiesFavoriteHeaderTopOffset, 0px);margin-bottom:25px}.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:1rem;margin-bottom:1rem;font-size:1.2em;color:var(--storiesFavoriteTitleColor, white);font-family:var(--storiesFavoriteTitleFontFamily);font-weight:normal;font-size:1.4rem;line-height:normal;font:var(--storiesFavoriteTitleFont, normal)}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:25px;margin-bottom:25px}}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD{margin-bottom:50px}}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:50%;transform:translateY(-50%);z-index:1140;pointer-events:all;cursor:pointer;outline:none;right:10px;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-:focus{outline:none}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm- svg{overflow:visible}.favorite-story-list-modal--xWjHA .footer--edEpn{width:100%;height:25px}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .footer--edEpn{height:50px}}.favorite-story-list-modal--xWjHA .bottom-offset--baiTh{position:-webkit-sticky;position:sticky;z-index:100;background:inherit;bottom:0;width:100%;height:var(--storiesFavoriteBottomOffset, 0px)}.favorite-story-list-modal--xWjHA .content--qCPkX{display:flex;justify-content:center;width:100%;padding:0 25px 25px;box-sizing:border-box}.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{width:100%}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:640px}}@media(min-width: 768px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:768px}}@media(min-width: 1024px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1024px}}@media(min-width: 1280px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1280px}}",""]),n.locals={"favorite-story-list-modal":"favorite-story-list-modal--xWjHA",container:"container--GZBjv",header:"header--TjHMD",title:"title--Dk04x","header__close-btn":"header__close-btn--Jojm-",footer:"footer--edEpn","bottom-offset":"bottom-offset--baiTh",content:"content--qCPkX","favorite-story-list":"favorite-story-list--MISMx"};const a=n},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,o){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(o)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(n[i]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);o&&n[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},46:e=>{var t,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,o){function n(r){e.removeListener(t,a),o(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,n,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var i=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,o){var n,a,i,c;if(s(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),i=a[t]),void 0===i)i=a[t]=r,++e._eventsCount;else if("function"==typeof i?i=a[t]=o?[r,i]:[i,r]:o?i.unshift(r):i.push(r),(n=l(e))>0&&i.length>n&&!i.warned){i.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=i.length,c=d,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=d.bind(o);return n.listener=r,o.wrapFn=n,n}function p(e,t,r){var o=e._events;if(void 0===o)return[];var n=o[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):f(n,n.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),o=0;o<t;++o)r[o]=e[o];return r}function g(e,t,r,o){if("function"==typeof e.on)o.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(a){o.once&&e.removeEventListener(t,n),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,d=f(l,c);for(r=0;r<c;++r)o(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return c(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return c(this,e,t,!0)},a.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,o,n,a,i;if(s(t),void 0===(o=this._events))return this;if(void 0===(r=o[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,n=a;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(o[e]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",e,i||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,a=Object.keys(r);for(o=0;o<a.length;++o)"removeListener"!==(n=a[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},650:(e,t,r)=>{var o=r(942).Symbol;e.exports=o},379:(e,t,r)=>{var o=r(650),n=r(870),a=r(5),i=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?n(e):a(e)}},967:(e,t,r)=>{var o="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=o},870:(e,t,r)=>{var o=r(650),n=Object.prototype,a=n.hasOwnProperty,i=n.toString,s=o?o.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var o=!0}catch(e){}var n=i.call(e);return o&&(t?e[s]=r:delete e[s]),n}},5:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},942:(e,t,r)=>{var o=r(967),n="object"==typeof self&&self&&self.Object===Object&&self,a=o||n||Function("return this")();e.exports=a},655:(e,t,r)=>{var o=r(379),n=r(580);e.exports=function(e){if(!n(e))return!1;var t=o(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},591:(e,t,r)=>{var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},a=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),i=[];function s(e){for(var t=-1,r=0;r<i.length;r++)if(i[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},o=[],n=0;n<e.length;n++){var a=e[n],l=t.base?a[0]+t.base:a[0],c=r[l]||0,d="".concat(l," ").concat(c);r[l]=c+1;var u=s(d),p={css:a[1],media:a[2],sourceMap:a[3]};-1!==u?(i[u].references++,i[u].updater(p)):i.push({identifier:d,updater:y(p,t),references:1}),o.push(d)}return o}function c(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var n=r.nc;n&&(o.nonce=n)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function p(e,t,r,o){var n=r?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=u(t,n);else{var a=document.createTextNode(n),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function h(e,t,r){var o=r.css,n=r.media,a=r.sourceMap;if(n?e.setAttribute("media",n):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var f=null,g=0;function y(e,t){var r,o,n;if(t.singleton){var a=g++;r=f||(f=c(t)),o=p.bind(null,r,a,!1),n=p.bind(null,r,a,!0)}else r=c(t),o=h.bind(null,r,t),n=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else n()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=n());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<r.length;o++){var n=s(r[o]);i[n].references--}for(var a=l(e,t),c=0;c<r.length;c++){var d=s(r[c]);0===i[d].references&&(i[d].updater(),i.splice(d,1))}r=a}}}}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,exports:{}};return a[e](r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.nc=void 0;var l={};(()=>{s.d(l,{KL:()=>a.AppearanceManager,Yb:()=>a.CloseButtonPosition,lV:()=>a.GoodsWidgetRenderingType,IV:()=>a.IamCheckDisplayTimeRangeError,tP:()=>a.IamFrequencyLimitError,h8:()=>a.IamMessageLimitExceededError,Xz:()=>a.IamMessageOpenError,wS:()=>a.IamNotFoundByEventError,VS:()=>a.IamNotFoundByIdError,oC:()=>a.IamNotFoundLimitError,L8:()=>a.IamOtherReaderIsOpenError,NL:()=>a.IamShowOnlyIfLoadedError,Ez:()=>a.IasNetworkError,Hp:()=>H,SK:()=>a.StoriesListCardCoverQuality,tI:()=>a.StoriesListCardTitlePosition,Uy:()=>a.StoriesListCardTitleTextAlign,SP:()=>a.StoriesListCardViewVariant,Jj:()=>a.StoriesListDirection,qz:()=>a.StoryReaderSwipeStyle});const a=(e=>{var t={};return s.d(t,e),t})({AppearanceManager:()=>e.AppearanceManager,AppearanceManagerEvents:()=>e.AppearanceManagerEvents,CloseButtonPosition:()=>e.CloseButtonPosition,FavoriteStoryList:()=>e.FavoriteStoryList,GoodsWidgetRenderingType:()=>e.GoodsWidgetRenderingType,IASContainer:()=>e.IASContainer,IamCheckDisplayTimeRangeError:()=>e.IamCheckDisplayTimeRangeError,IamFrequencyLimitError:()=>e.IamFrequencyLimitError,IamMessageLimitExceededError:()=>e.IamMessageLimitExceededError,IamMessageOpenError:()=>e.IamMessageOpenError,IamNotFoundByEventError:()=>e.IamNotFoundByEventError,IamNotFoundByIdError:()=>e.IamNotFoundByIdError,IamNotFoundLimitError:()=>e.IamNotFoundLimitError,IamOtherReaderIsOpenError:()=>e.IamOtherReaderIsOpenError,IamShowOnlyIfLoadedError:()=>e.IamShowOnlyIfLoadedError,IasNetworkError:()=>e.IasNetworkError,StackedStoryListViewModel:()=>e.StackedStoryListViewModel,StoriesListCardCoverQuality:()=>e.StoriesListCardCoverQuality,StoriesListCardTitlePosition:()=>e.StoriesListCardTitlePosition,StoriesListCardTitleTextAlign:()=>e.StoriesListCardTitleTextAlign,StoriesListCardViewVariant:()=>e.StoriesListCardViewVariant,StoriesListDirection:()=>e.StoriesListDirection,StoryFeedType:()=>e.StoryFeedType,StoryList:()=>e.StoryList,StoryManager:()=>e.StoryManager,StoryReaderSwipeStyle:()=>e.StoryReaderSwipeStyle,UGCFeedSlug:()=>e.UGCFeedSlug,UGCStoryList:()=>e.UGCStoryList,storyManager:()=>e.storyManager});var i=s(46);class c extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`),this.name="IasAppearanceManagerTypeofError"}}const d=e=>{if(null==e||"object"!=typeof e)throw new c(null==e?"null":typeof e)};class u extends Error{constructor(){super("[IAS]: The <StoryManager> instance has been destroyed, you must create a new instance"),this.name="IasInAppStoryManagerReferenceError"}}class p extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class h extends i.EventEmitter{constructor(e,t,r,o){super(),Object.defineProperty(this,"_mountSelector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_ugcCardClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(t),this._mountPoint=this.getMountPoint(e),this.app.addStoryList(this).catch(console.error)}get mountPoint(){return this._mountPoint}get mountSelector(){return this._mountSelector}get appearanceManager(){return this._appearanceManager}get type(){return a.StoryFeedType.DEFAULT}get identityFields(){return{feedSlug:this.feedSlug}}get feedSlug(){var e;return null===(e=this.params)||void 0===e?void 0:e.feed}get testKey(){var e;return null===(e=this.params)||void 0===e?void 0:e.testKey}get useUgcCard(){var e;return Boolean(null===(e=this.params)||void 0===e?void 0:e.useUgcCard)}set ugcCardClickHandler(e){this._ugcCardClickHandler=e}get ugcCardClickHandler(){return this._ugcCardClickHandler}set api(e){this._api=e}async reload(){var e;return null===(e=this._api)||void 0===e?void 0:e.reload()}destroy(){this.app.removeStoryList(this)}getMountPoint(e){const t=document.querySelector(e);if(!t)throw new p(e);return t}}class f{constructor(){Object.defineProperty(this,"_storyLists",{enumerable:!0,configurable:!0,writable:!0,value:[]})}get storyLists(){return this._storyLists}addStoryList(e){this._storyLists.push(e)}removeStoryList(e){const t=this._storyLists.findIndex((t=>t===e));-1!==t&&this._storyLists.splice(t,1)}destroy(){this._storyLists=[]}}class g extends h{constructor(e,t,r,o){super(e,t,r,{feed:a.UGCFeedSlug,testKey:null==o?void 0:o.testKey,useUgcCard:null==o?void 0:o.useUgcCard}),Object.defineProperty(this,"ugcParams",{enumerable:!0,configurable:!0,writable:!0,value:o}),d(t)}get type(){return a.StoryFeedType.UGC}get filter(){var e;return null===(e=this.ugcParams)||void 0===e?void 0:e.filter}}const y=(e=>{var t={};return s.d(t,e),t})({jsx:()=>t.jsx,jsxs:()=>t.jsxs});const v=(e=>{var t={};return s.d(t,e),t})({createRoot:()=>r.createRoot});const m=(e=>{var t={};return s.d(t,e),t})({useEffect:()=>o.useEffect,useLayoutEffect:()=>o.useLayoutEffect,useRef:()=>o.useRef,useState:()=>o.useState});var b=s(591),S=s.n(b),M=s(432),L={insert:"head",singleton:!1};S()(M.A,L);const C=M.A.locals||{};var w;!function(e){e.LTR="ltr",e.RTL="rtl"}(w||(w={}));const E=({open:e,options:t,storyListOptions:r,onClose:o})=>{var n,i;(0,m.useLayoutEffect)((()=>{if(!e)return;const t=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=t}}),[e]);return e?(0,y.jsx)("div",{className:C["favorite-story-list-modal"],style:(()=>{var e,r,o,n;return{"--storiesFavoriteTitleColor":t.title.color,"--storiesFavoriteTitleFontFamily":"InternalPrimaryFont","--storiesFavoriteTitleFont":t.title.font,"--storiesFavoriteTitleBackgroundColor":t.title.backgroundColor,"--storiesFavoriteHeaderTopOffset":parseFloat(null!==(r=null===(e=t.headerTopOffset)||void 0===e?void 0:e.toString())&&void 0!==r?r:"0")+"px","--storiesFavoriteBottomOffset":parseFloat(null!==(n=null===(o=t.bottomOffset)||void 0===o?void 0:o.toString())&&void 0!==n?n:"0")+"px","--storiesFavoriteBackgroundColor":t.backgroundColor}})(),children:(0,y.jsxs)("div",{className:C.container,children:[(0,y.jsxs)("div",{className:C.header,children:[(0,y.jsx)("p",{className:C.title,children:t.title.content}),(0,y.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),o()},className:C["header__close-btn"],style:(()=>{var e;const r="start"===t.closeButtonPosition||"left"===t.closeButtonPosition,o=(null===(e=a.storyManager.getConfig())||void 0===e?void 0:e.dir)===w.LTR;return{[r&&o||!r&&!o?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:null!==(i=null===(n=t.closeButton)||void 0===n?void 0:n.svgSrc.baseState)&&void 0!==i?i:""}})]}),(0,y.jsx)("div",{className:C.content,children:(0,y.jsx)("div",{className:C["favorite-story-list"],children:(0,y.jsx)(a.FavoriteStoryList,{options:Object.assign(Object.assign(Object.assign({},r),{sidePadding:0}),{direction:a.StoriesListDirection.COLUMN,layout:{height:"auto"}})})})}),(0,y.jsx)("div",{className:C.footer}),(0,y.jsx)("div",{className:C["bottom-offset"]})]})}):null};const x=(e=>{var t={};return s.d(t,e),t})({createPortal:()=>n.createPortal}),O=e=>{(0,m.useEffect)((()=>{const t=e.mountPoint,r=()=>{console.warn(`[IAS]: The node has been removed from DOM. Unsafe destruction of story feed ${e.mountSelector}`),e.destroy()};if(!document.body.contains(t))return void r();const o=new MutationObserver((()=>{document.body.contains(t)||(r(),o.disconnect())}));return o.observe(document.body,{childList:!0,subtree:!0}),()=>{o.disconnect()}}),[e])};var j;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(j||(j={}));const A=({storyList:e,onStoryCardClick:t,onFavoriteCardClick:r})=>{const[o,n]=(0,m.useState)(e.appearanceManager.storiesListOptions),i=(0,m.useRef)(null);return O(e),(0,m.useEffect)((()=>{e.api=i.current}),[]),(0,m.useEffect)((()=>(e.appearanceManager.on(a.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,n),()=>{e.appearanceManager.off(a.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,n)})),[e.appearanceManager]),(0,x.createPortal)((0,y.jsx)(a.StoryList,{ref:i,options:o,hasFavorite:e.appearanceManager.commonOptions.hasFavorite,testKey:e.testKey,useUgcCard:e.useUgcCard,feedSlug:e.feedSlug,onLoadStart:()=>{e.emit(j.START_LOADER)},onLoadEnd:t=>{e.emit(j.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()},onFavoriteCardClick:r,onStoryCardClick:t}),e.mountPoint)};var I;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(I||(I={}));const T=({ugcStoryList:e,onStoryCardClick:t})=>{const[r,o]=(0,m.useState)(e.appearanceManager.storiesListOptions),n=(0,m.useRef)(null);return O(e),(0,m.useEffect)((()=>{e.api=n.current}),[]),(0,m.useEffect)((()=>(e.appearanceManager.on(a.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o),()=>{e.appearanceManager.off(a.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o)})),[e.appearanceManager]),(0,x.createPortal)((0,y.jsx)(a.UGCStoryList,{ref:n,options:r,filter:e.filter,testKey:e.testKey,useUgcCard:e.useUgcCard,onStoryCardClick:t,onLoadStart:()=>{e.emit(I.START_LOADER)},onLoadEnd:t=>{e.emit(I.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()}}),e.mountPoint)},_=e=>{const[t,r]=(0,m.useState)(!1);return(0,y.jsxs)(a.IASContainer,{config:e.storyManagerConfigDto,storyReaderOptions:e.appearanceManager.storyReaderOptions,commonOptions:e.appearanceManager.commonOptions,gameReaderOptions:e.appearanceManager.gameReaderOptions,goodsWidgetOptions:e.appearanceManager.goodsWidgetOptions,children:[e.storyLists.map((t=>t instanceof g?(0,y.jsx)(T,{ugcStoryList:t,onStoryCardClick:()=>{e.onAppearanceManagerChange(t.appearanceManager)}},t.mountSelector):t instanceof h?(0,y.jsx)(A,{onFavoriteCardClick:()=>{r(!0)},onStoryCardClick:()=>{e.onAppearanceManagerChange(t.appearanceManager)},storyList:t},t.mountSelector):void 0)),(0,y.jsx)(E,{open:t,onClose:()=>r(!1),options:e.appearanceManager.storyFavoriteReaderOptions,storyListOptions:e.appearanceManager.storiesListOptions})]})};class P{constructor(e){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"root",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:new a.AppearanceManager}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"storyListManager",{enumerable:!0,configurable:!0,writable:!0,value:new f}),this.createAppRoot(),this.handleAppearanceManagerUpdate=this.handleAppearanceManagerUpdate.bind(this),this.setAppearanceManager=this.setAppearanceManager.bind(this)}async addStoryList(e){try{this.storyListManager.addStoryList(e),await this.storyManager.waitStoryManagerConfig(),this.render()}catch(t){throw this.removeStoryList(e),t}}removeStoryList(e){this.storyListManager.removeStoryList(e),this.render()}setStoryManagerConfig(e){this.storyManagerConfigDto=Object.assign(Object.assign({},this.storyManagerConfigDto),e),this.render()}setAppearanceManager(e){d(e),this.unscubscribeToAppearanceManagerEvents(),this.appearanceManager=e,this.subscribeToAppearanceManagerEvents(),this.render()}render(){var e;null===(e=this.root)||void 0===e||e.render((0,y.jsx)(_,{storyManagerConfigDto:this.storyManagerConfigDto,appearanceManager:this.appearanceManager,storyLists:this.storyListManager.storyLists.slice(),onAppearanceManagerChange:this.setAppearanceManager}))}destroy(){this.rootElement&&this.root&&(this.storyListManager.destroy(),this.unscubscribeToAppearanceManagerEvents(),this.root.unmount(),document.body.removeChild(this.rootElement),this.rootElement=null,this.root=null)}createAppRoot(){this.rootElement=document.createElement("div"),this.rootElement.id="ias-app",document.body.append(this.rootElement),this.root=(0,v.createRoot)(this.rootElement)}subscribeToAppearanceManagerEvents(){this.appearanceManager.on(a.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}unscubscribeToAppearanceManagerEvents(){this.appearanceManager.off(a.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}handleAppearanceManagerUpdate(){this.render()}}var k,R=s(655),D=s.n(R);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(k||(k={}));class F extends i.EventEmitter{constructor(e,t,r,o,n){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),d(t),this.handleCloseStoryReader=this.handleCloseStoryReader.bind(this),this.showSharePage(e,t)}async showSharePage(e,t){try{this.app.setAppearanceManager(t),this.handleStartLoad(),await this.storyManager.showSharePage(e),this.storyManager.once("closeStoryReader",this.handleCloseStoryReader),this.handleEndLoad(!0)}catch(e){this.handleEndLoad(!1)}}async closeStoryReader(){this.storyManager.closeStoryReader()}handleStartLoad(){setTimeout((()=>{var e;this.emit(k.START_LOADING),D()(null===(e=this.options)||void 0===e?void 0:e.handleStartLoad)&&this.options.handleStartLoad()}))}handleEndLoad(e){var t;this.emit(k.END_LOADING,{result:e}),D()(null===(t=this.options)||void 0===t?void 0:t.handleStopLoad)&&this.options.handleStopLoad(e)}handleCloseStoryReader(){var e,t,r;if(D()(null===(e=this.options)||void 0===e?void 0:e.handleStoryReaderClose)||this.listenerCount(k.CLOSE_STORY_READER)>0)try{D()(null===(t=this.options)||void 0===t?void 0:t.handleStoryReaderClose)&&(null===(r=this.options)||void 0===r||r.handleStoryReaderClose()),this.emit(k.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}}}class N extends i.EventEmitter{constructor(e,t,r,o){super(),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"stackedStoryListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(e),this.handleUpdate=this.handleUpdate.bind(this),this.stackedStoryListViewModel=new a.StackedStoryListViewModel(this.options),this.stackedStoryListViewModel.on("update",this.handleUpdate),this.loadStories().catch(console.error)}get stories(){return this.stackedStoryListViewModel.stories}get length(){return this.stackedStoryListViewModel.length}get activeIndex(){return this.stackedStoryListViewModel.activeIndex}get feedCoverSrc(){return this.stackedStoryListViewModel.feedCoverSrc}get top(){return this.stackedStoryListViewModel.top}async reload(){return this.stackedStoryListViewModel.reload()}destroy(){this.stackedStoryListViewModel.destroy(),this.stackedStoryListViewModel.removeAllListeners()}showStory(e){this.app.setAppearanceManager(this.appearanceManager),this.stackedStoryListViewModel.showStory(e)}on(e,t){return"update"===e?super.on(e,t):(this.stackedStoryListViewModel.on(e,t),this)}once(e,t){return this.stackedStoryListViewModel.once(e,t),this}off(e,t){return this.stackedStoryListViewModel.off(e,t),this}handleUpdate(e){this.emit("update",{id:e.id,title:e.title,titleColor:e.titleColor,hasAudio:e.hasAudio,hasSwipeUp:e.hasSwipeUp,isOpened:e.isOpened,deeplink:e.deeplink,gameInstanceId:e.gameInstanceId,hideInReader:e.hideInReader,hide_timeline:e.hideTimeline,cover:e.getCover(this.appearanceManager.storiesListOptions.card.coverQuality)})}async loadStories(){await this.storyManager.waitStoryManagerConfig(),this.stackedStoryListViewModel.loadStories()}}const U=()=>{if(!H.instance)throw new u};class H{constructor(e){return Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new P(a.storyManager)}),Object.defineProperty(this,"StoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends h{constructor(e,t,r){U(),super(e,t,H.instance.app,r)}}}),Object.defineProperty(this,"UGCStoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends g{constructor(e,t,r){U(),super(e,t,H.instance.app,r)}}}),Object.defineProperty(this,"SharePage",{enumerable:!0,configurable:!0,writable:!0,value:class extends F{constructor(e,t,r){U(),super(e,t,a.storyManager,H.instance.app,r)}}}),Object.defineProperty(this,"StackedStoryList",{enumerable:!0,configurable:!0,writable:!0,value:class extends N{constructor(e,t){U(),super(e,a.storyManager,H.instance.app,t)}}}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:a.storyManager.inAppMessaging}),H.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),H.instance):(a.storyManager.setUserAgent(`InAppStoryJSSDK/${this.sdkVersionCode}`),H.instance=this,this.app.setStoryManagerConfig(e),H.instance)}get sdkVersionName(){return"3.6.3"}get sdkVersionCode(){return parseInt(30603)}set storyLinkClickHandler(e){a.storyManager.storyLinkClickHandler=e}static getInstance(){return H.instance?H.instance:null}static use(e,t){a.StoryManager.use(e,t)}getConfig(){return a.storyManager.getConfig()}async showOnboardingStories(e,t){return U(),this.app.setAppearanceManager(e),a.storyManager.showOnboardingStories(t)}async showStory(e,t){U(),this.app.setAppearanceManager(t),await a.storyManager.showStory(e)}async showStoryOnce(e,t){return U(),this.app.setAppearanceManager(t),a.storyManager.showStoryOnce(e)}async showSharePage(e,t){return U(),this.app.setAppearanceManager(t),a.storyManager.showSharePage(e)}closeAllReaders(){a.storyManager.closeAllReaders()}async openGame(e,t,r={}){return U(),this.app.setAppearanceManager(t),a.storyManager.openGame(e,r)}async closeGame(){return a.storyManager.closeGame()}async closeStoryReader(){return a.storyManager.closeStoryReader()}getUgcEditorConfig(){return a.storyManager.getUgcEditorConfig()}closeGoodsWidget(){a.storyManager.closeGoodsWidget()}setLang(e){this.storyManagerConfigDto.lang=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}getNonce(){return a.storyManager.getNonce()}async setUserId(e,t){U(),this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async userLogoug(){return this.setUserId("")}setTags(e){U(),this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){U(),this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){U(),this.storyManagerConfigDto.imagePlaceholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}on(e,t){return a.storyManager.on(e,t),this}once(e,t){return a.storyManager.once(e,t),this}off(e,t){return a.storyManager.off(e,t),this}destroy(){null!=H.instance&&(H.instance=null,this.closeAllReaders(),this.app.destroy())}}})();var c=l.KL,d=l.Yb,u=l.lV,p=l.IV,h=l.tP,f=l.h8,g=l.Xz,y=l.wS,v=l.VS,m=l.oC,b=l.L8,S=l.NL,M=l.Ez,L=l.Hp,C=l.SK,w=l.tI,E=l.Uy,x=l.SP,O=l.Jj,j=l.qz;export{c as AppearanceManager,d as CloseButtonPosition,u as GoodsWidgetRenderingType,p as IamCheckDisplayTimeRangeError,h as IamFrequencyLimitError,f as IamMessageLimitExceededError,g as IamMessageOpenError,y as IamNotFoundByEventError,v as IamNotFoundByIdError,m as IamNotFoundLimitError,b as IamOtherReaderIsOpenError,S as IamShowOnlyIfLoadedError,M as IasNetworkError,L as InAppStoryManager,C as StoriesListCardCoverQuality,w as StoriesListCardTitlePosition,E as StoriesListCardTitleTextAlign,x as StoriesListCardViewVariant,O as StoriesListDirection,j as StoryReaderSwipeStyle};
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__ from "@inappstory/react-sdk";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_179142b8__ from "react/jsx-runtime";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_client_4cb20cd7__ from "react-dom/client";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__ from "react-dom";
|
|
6
|
+
/******/ var __webpack_modules__ = ({
|
|
7
|
+
|
|
8
|
+
/***/ 432:
|
|
9
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
10
|
+
|
|
11
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
13
|
+
/* harmony export */ });
|
|
14
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(372);
|
|
15
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
16
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(935);
|
|
17
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
18
|
+
// Imports
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
22
|
+
// Module
|
|
23
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".favorite-story-list-modal--xWjHA{position:fixed;inset:0px;z-index:1090}.favorite-story-list-modal--xWjHA .container--GZBjv{width:100%;height:100%;background:var(--storiesFavoriteBackgroundColor, #333333);display:flex;flex-direction:column;position:relative;overflow-y:auto}.favorite-story-list-modal--xWjHA .header--TjHMD{display:flex;align-content:center;justify-content:center;align-items:center;flex-shrink:0;position:-webkit-sticky;position:sticky;top:0;z-index:100;background:var(--storiesFavoriteTitleBackgroundColor, #333333);box-shadow:0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12),0 1px 3px 0 rgba(0,0,0,.2);padding-top:var(--storiesFavoriteHeaderTopOffset, 0px);margin-bottom:25px}.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:1rem;margin-bottom:1rem;font-size:1.2em;color:var(--storiesFavoriteTitleColor, white);font-family:var(--storiesFavoriteTitleFontFamily);font-weight:normal;font-size:1.4rem;line-height:normal;font:var(--storiesFavoriteTitleFont, normal)}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD .title--Dk04x{margin-top:25px;margin-bottom:25px}}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .header--TjHMD{margin-bottom:50px}}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-{border:0;padding:0;background:rgba(0,0,0,0);position:absolute;top:50%;transform:translateY(-50%);z-index:1140;pointer-events:all;cursor:pointer;outline:none;right:10px;width:30px;height:30px;display:flex;justify-content:center;align-items:center}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm-:focus{outline:none}.favorite-story-list-modal--xWjHA .header__close-btn--Jojm- svg{overflow:visible}.favorite-story-list-modal--xWjHA .footer--edEpn{width:100%;height:25px}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .footer--edEpn{height:50px}}.favorite-story-list-modal--xWjHA .bottom-offset--baiTh{position:-webkit-sticky;position:sticky;z-index:100;background:inherit;bottom:0;width:100%;height:var(--storiesFavoriteBottomOffset, 0px)}.favorite-story-list-modal--xWjHA .content--qCPkX{display:flex;justify-content:center;width:100%;padding:0 25px 25px;box-sizing:border-box}.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{width:100%}@media(min-width: 640px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:640px}}@media(min-width: 768px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:768px}}@media(min-width: 1024px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1024px}}@media(min-width: 1280px){.favorite-story-list-modal--xWjHA .content--qCPkX .favorite-story-list--MISMx{max-width:1280px}}", "",{"version":3,"sources":["webpack://./src/appRuntime/FavoriteStoryListModal/favoriteStoryListModal.module.scss"],"names":[],"mappings":"AAAA,kCACI,cAAA,CACA,SAAA,CACA,YAAA,CAEA,oDACI,UAAA,CACA,WAAA,CACA,yDAAA,CACA,YAAA,CACA,qBAAA,CACA,iBAAA,CACA,eAAA,CAGJ,iDACI,YAAA,CACA,oBAAA,CACA,sBAAA,CACA,kBAAA,CACA,aAAA,CACA,uBAAA,CACA,eAAA,CACA,KAAA,CACA,WAAA,CACA,8DAAA,CACA,gGAAA,CA4BA,sDAAA,CACA,kBAAA,CA3BA,+DAEQ,eAAA,CACA,kBAAA,CAIJ,eAAA,CAWA,6CAAA,CACA,iDAAA,CACA,kBAAA,CACA,gBAAA,CACA,kBAAA,CACA,4CAAA,CAdA,yBATJ,+DAWY,eAAA,CACA,kBAAA,CAAA,CAiBZ,yBA1CJ,iDA2CQ,kBAAA,CAAA,CAIR,4DACI,QAAA,CACA,SAAA,CACA,wBAAA,CACA,iBAAA,CACA,OAAA,CACA,0BAAA,CACA,YAAA,CACA,kBAAA,CACA,cAAA,CACA,YAAA,CACA,UAAA,CAMA,UAAA,CACA,WAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CARA,kEACI,YAAA,CASJ,gEACI,gBAAA,CAIR,iDACI,UAAA,CACA,WAAA,CAEA,yBAJJ,iDAKQ,WAAA,CAAA,CAIR,wDACI,uBAAA,CACA,eAAA,CACA,WAAA,CACA,kBAAA,CACA,QAAA,CACA,UAAA,CACA,8CAAA,CAIJ,kDACI,YAAA,CACA,sBAAA,CACA,UAAA,CACA,mBAAA,CACA,qBAAA,CAEA,8EACI,UAAA,CAEA,yBAHJ,8EAIQ,eAAA,CAAA,CAGJ,yBAPJ,8EAQQ,eAAA,CAAA,CAGJ,0BAXJ,8EAYQ,gBAAA,CAAA,CAGJ,0BAfJ,8EAgBQ,gBAAA,CAAA","sourcesContent":[".favorite-story-list-modal {\n position: fixed;\n inset: 0px;\n z-index: 1090;\n\n .container {\n width: 100%;\n height: 100%;\n background: var(--storiesFavoriteBackgroundColor, #333333);\n display: flex;\n flex-direction: column;\n position: relative;\n overflow-y: auto;\n }\n\n .header {\n display: flex;\n align-content: center;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 100;\n background: var(--storiesFavoriteTitleBackgroundColor, #333333);\n box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .14), 0 2px 1px -1px rgba(0, 0, 0, .12), 0 1px 3px 0 rgba(0, 0, 0, .2);\n\n .title {\n margin: {\n top: 1rem;\n bottom: 1rem;\n }\n\n ;\n font-size: 1.2em;\n\n @media (min-width: 640px) {\n margin: {\n top: 25px;\n bottom: 25px;\n }\n\n ;\n }\n\n color: var(--storiesFavoriteTitleColor, white);\n font-family: var(--storiesFavoriteTitleFontFamily);\n font-weight: normal;\n font-size: 1.4rem;\n line-height: normal;\n font: var(--storiesFavoriteTitleFont, normal);\n }\n\n padding-top: var(--storiesFavoriteHeaderTopOffset, 0px);\n margin-bottom: 25px;\n\n @media (min-width: 640px) {\n margin-bottom: 50px;\n }\n }\n\n .header__close-btn {\n border: 0;\n padding: 0;\n background: transparent;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1140;\n pointer-events: all;\n cursor: pointer;\n outline: none;\n right: 10px;\n\n &:focus {\n outline: none;\n }\n\n width: 30px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n overflow: visible;\n }\n }\n\n .footer {\n width: 100%;\n height: 25px;\n\n @media (min-width: 640px) {\n height: 50px;\n }\n }\n\n .bottom-offset {\n position: -webkit-sticky;\n position: sticky;\n z-index: 100;\n background: inherit;\n bottom: 0;\n width: 100%;\n height: var(--storiesFavoriteBottomOffset, 0px);\n }\n\n\n .content {\n display: flex;\n justify-content: center;\n width: 100%;\n padding: 0 25px 25px;\n box-sizing: border-box;\n\n .favorite-story-list {\n width: 100%;\n\n @media (min-width: 640px) {\n max-width: 640px;\n }\n\n @media (min-width: 768px) {\n max-width: 768px;\n }\n\n @media (min-width: 1024px) {\n max-width: 1024px;\n }\n\n @media (min-width: 1280px) {\n max-width: 1280px;\n }\n }\n }\n}"],"sourceRoot":""}]);
|
|
24
|
+
// Exports
|
|
25
|
+
___CSS_LOADER_EXPORT___.locals = {
|
|
26
|
+
"favorite-story-list-modal": "favorite-story-list-modal--xWjHA",
|
|
27
|
+
"container": "container--GZBjv",
|
|
28
|
+
"header": "header--TjHMD",
|
|
29
|
+
"title": "title--Dk04x",
|
|
30
|
+
"header__close-btn": "header__close-btn--Jojm-",
|
|
31
|
+
"footer": "footer--edEpn",
|
|
32
|
+
"bottom-offset": "bottom-offset--baiTh",
|
|
33
|
+
"content": "content--qCPkX",
|
|
34
|
+
"favorite-story-list": "favorite-story-list--MISMx"
|
|
35
|
+
};
|
|
36
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/***/ }),
|
|
40
|
+
|
|
41
|
+
/***/ 935:
|
|
42
|
+
/***/ ((module) => {
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
48
|
+
Author Tobias Koppers @sokra
|
|
49
|
+
*/
|
|
50
|
+
// css base code, injected by the css-loader
|
|
51
|
+
// eslint-disable-next-line func-names
|
|
52
|
+
module.exports = function (cssWithMappingToString) {
|
|
53
|
+
var list = []; // return the list of modules as css string
|
|
54
|
+
|
|
55
|
+
list.toString = function toString() {
|
|
56
|
+
return this.map(function (item) {
|
|
57
|
+
var content = cssWithMappingToString(item);
|
|
58
|
+
|
|
59
|
+
if (item[2]) {
|
|
60
|
+
return "@media ".concat(item[2], " {").concat(content, "}");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return content;
|
|
64
|
+
}).join("");
|
|
65
|
+
}; // import a list of modules into the list
|
|
66
|
+
// eslint-disable-next-line func-names
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
list.i = function (modules, mediaQuery, dedupe) {
|
|
70
|
+
if (typeof modules === "string") {
|
|
71
|
+
// eslint-disable-next-line no-param-reassign
|
|
72
|
+
modules = [[null, modules, ""]];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var alreadyImportedModules = {};
|
|
76
|
+
|
|
77
|
+
if (dedupe) {
|
|
78
|
+
for (var i = 0; i < this.length; i++) {
|
|
79
|
+
// eslint-disable-next-line prefer-destructuring
|
|
80
|
+
var id = this[i][0];
|
|
81
|
+
|
|
82
|
+
if (id != null) {
|
|
83
|
+
alreadyImportedModules[id] = true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
for (var _i = 0; _i < modules.length; _i++) {
|
|
89
|
+
var item = [].concat(modules[_i]);
|
|
90
|
+
|
|
91
|
+
if (dedupe && alreadyImportedModules[item[0]]) {
|
|
92
|
+
// eslint-disable-next-line no-continue
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (mediaQuery) {
|
|
97
|
+
if (!item[2]) {
|
|
98
|
+
item[2] = mediaQuery;
|
|
99
|
+
} else {
|
|
100
|
+
item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
list.push(item);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return list;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/***/ }),
|
|
112
|
+
|
|
113
|
+
/***/ 372:
|
|
114
|
+
/***/ ((module) => {
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
119
|
+
|
|
120
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
121
|
+
|
|
122
|
+
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); }
|
|
123
|
+
|
|
124
|
+
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; }
|
|
125
|
+
|
|
126
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
127
|
+
|
|
128
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
129
|
+
|
|
130
|
+
module.exports = function cssWithMappingToString(item) {
|
|
131
|
+
var _item = _slicedToArray(item, 4),
|
|
132
|
+
content = _item[1],
|
|
133
|
+
cssMapping = _item[3];
|
|
134
|
+
|
|
135
|
+
if (!cssMapping) {
|
|
136
|
+
return content;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (typeof btoa === "function") {
|
|
140
|
+
// eslint-disable-next-line no-undef
|
|
141
|
+
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
|
|
142
|
+
var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
|
|
143
|
+
var sourceMapping = "/*# ".concat(data, " */");
|
|
144
|
+
var sourceURLs = cssMapping.sources.map(function (source) {
|
|
145
|
+
return "/*# sourceURL=".concat(cssMapping.sourceRoot || "").concat(source, " */");
|
|
146
|
+
});
|
|
147
|
+
return [content].concat(sourceURLs).concat([sourceMapping]).join("\n");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return [content].join("\n");
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/***/ }),
|
|
154
|
+
|
|
155
|
+
/***/ 46:
|
|
156
|
+
/***/ ((module) => {
|
|
157
|
+
|
|
158
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
159
|
+
//
|
|
160
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
161
|
+
// copy of this software and associated documentation files (the
|
|
162
|
+
// "Software"), to deal in the Software without restriction, including
|
|
163
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
164
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
165
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
166
|
+
// following conditions:
|
|
167
|
+
//
|
|
168
|
+
// The above copyright notice and this permission notice shall be included
|
|
169
|
+
// in all copies or substantial portions of the Software.
|
|
170
|
+
//
|
|
171
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
172
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
173
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
174
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
175
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
176
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
177
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
var R = typeof Reflect === 'object' ? Reflect : null
|
|
182
|
+
var ReflectApply = R && typeof R.apply === 'function'
|
|
183
|
+
? R.apply
|
|
184
|
+
: function ReflectApply(target, receiver, args) {
|
|
185
|
+
return Function.prototype.apply.call(target, receiver, args);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
var ReflectOwnKeys
|
|
189
|
+
if (R && typeof R.ownKeys === 'function') {
|
|
190
|
+
ReflectOwnKeys = R.ownKeys
|
|
191
|
+
} else if (Object.getOwnPropertySymbols) {
|
|
192
|
+
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
193
|
+
return Object.getOwnPropertyNames(target)
|
|
194
|
+
.concat(Object.getOwnPropertySymbols(target));
|
|
195
|
+
};
|
|
196
|
+
} else {
|
|
197
|
+
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
198
|
+
return Object.getOwnPropertyNames(target);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function ProcessEmitWarning(warning) {
|
|
203
|
+
if (console && console.warn) console.warn(warning);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
|
|
207
|
+
return value !== value;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function EventEmitter() {
|
|
211
|
+
EventEmitter.init.call(this);
|
|
212
|
+
}
|
|
213
|
+
module.exports = EventEmitter;
|
|
214
|
+
module.exports.once = once;
|
|
215
|
+
|
|
216
|
+
// Backwards-compat with node 0.10.x
|
|
217
|
+
EventEmitter.EventEmitter = EventEmitter;
|
|
218
|
+
|
|
219
|
+
EventEmitter.prototype._events = undefined;
|
|
220
|
+
EventEmitter.prototype._eventsCount = 0;
|
|
221
|
+
EventEmitter.prototype._maxListeners = undefined;
|
|
222
|
+
|
|
223
|
+
// By default EventEmitters will print a warning if more than 10 listeners are
|
|
224
|
+
// added to it. This is a useful default which helps finding memory leaks.
|
|
225
|
+
var defaultMaxListeners = 10;
|
|
226
|
+
|
|
227
|
+
function checkListener(listener) {
|
|
228
|
+
if (typeof listener !== 'function') {
|
|
229
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function() {
|
|
236
|
+
return defaultMaxListeners;
|
|
237
|
+
},
|
|
238
|
+
set: function(arg) {
|
|
239
|
+
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
|
|
240
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
|
|
241
|
+
}
|
|
242
|
+
defaultMaxListeners = arg;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
EventEmitter.init = function() {
|
|
247
|
+
|
|
248
|
+
if (this._events === undefined ||
|
|
249
|
+
this._events === Object.getPrototypeOf(this)._events) {
|
|
250
|
+
this._events = Object.create(null);
|
|
251
|
+
this._eventsCount = 0;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
this._maxListeners = this._maxListeners || undefined;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// Obviously not all Emitters should be limited to 10. This function allows
|
|
258
|
+
// that to be increased. Set to zero for unlimited.
|
|
259
|
+
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
|
|
260
|
+
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
|
|
261
|
+
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
|
|
262
|
+
}
|
|
263
|
+
this._maxListeners = n;
|
|
264
|
+
return this;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
function _getMaxListeners(that) {
|
|
268
|
+
if (that._maxListeners === undefined)
|
|
269
|
+
return EventEmitter.defaultMaxListeners;
|
|
270
|
+
return that._maxListeners;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
|
|
274
|
+
return _getMaxListeners(this);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
EventEmitter.prototype.emit = function emit(type) {
|
|
278
|
+
var args = [];
|
|
279
|
+
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
|
|
280
|
+
var doError = (type === 'error');
|
|
281
|
+
|
|
282
|
+
var events = this._events;
|
|
283
|
+
if (events !== undefined)
|
|
284
|
+
doError = (doError && events.error === undefined);
|
|
285
|
+
else if (!doError)
|
|
286
|
+
return false;
|
|
287
|
+
|
|
288
|
+
// If there is no 'error' event listener then throw.
|
|
289
|
+
if (doError) {
|
|
290
|
+
var er;
|
|
291
|
+
if (args.length > 0)
|
|
292
|
+
er = args[0];
|
|
293
|
+
if (er instanceof Error) {
|
|
294
|
+
// Note: The comments on the `throw` lines are intentional, they show
|
|
295
|
+
// up in Node's output if this results in an unhandled exception.
|
|
296
|
+
throw er; // Unhandled 'error' event
|
|
297
|
+
}
|
|
298
|
+
// At least give some kind of context to the user
|
|
299
|
+
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
|
|
300
|
+
err.context = er;
|
|
301
|
+
throw err; // Unhandled 'error' event
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
var handler = events[type];
|
|
305
|
+
|
|
306
|
+
if (handler === undefined)
|
|
307
|
+
return false;
|
|
308
|
+
|
|
309
|
+
if (typeof handler === 'function') {
|
|
310
|
+
ReflectApply(handler, this, args);
|
|
311
|
+
} else {
|
|
312
|
+
var len = handler.length;
|
|
313
|
+
var listeners = arrayClone(handler, len);
|
|
314
|
+
for (var i = 0; i < len; ++i)
|
|
315
|
+
ReflectApply(listeners[i], this, args);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return true;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
function _addListener(target, type, listener, prepend) {
|
|
322
|
+
var m;
|
|
323
|
+
var events;
|
|
324
|
+
var existing;
|
|
325
|
+
|
|
326
|
+
checkListener(listener);
|
|
327
|
+
|
|
328
|
+
events = target._events;
|
|
329
|
+
if (events === undefined) {
|
|
330
|
+
events = target._events = Object.create(null);
|
|
331
|
+
target._eventsCount = 0;
|
|
332
|
+
} else {
|
|
333
|
+
// To avoid recursion in the case that type === "newListener"! Before
|
|
334
|
+
// adding it to the listeners, first emit "newListener".
|
|
335
|
+
if (events.newListener !== undefined) {
|
|
336
|
+
target.emit('newListener', type,
|
|
337
|
+
listener.listener ? listener.listener : listener);
|
|
338
|
+
|
|
339
|
+
// Re-assign `events` because a newListener handler could have caused the
|
|
340
|
+
// this._events to be assigned to a new object
|
|
341
|
+
events = target._events;
|
|
342
|
+
}
|
|
343
|
+
existing = events[type];
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (existing === undefined) {
|
|
347
|
+
// Optimize the case of one listener. Don't need the extra array object.
|
|
348
|
+
existing = events[type] = listener;
|
|
349
|
+
++target._eventsCount;
|
|
350
|
+
} else {
|
|
351
|
+
if (typeof existing === 'function') {
|
|
352
|
+
// Adding the second element, need to change to array.
|
|
353
|
+
existing = events[type] =
|
|
354
|
+
prepend ? [listener, existing] : [existing, listener];
|
|
355
|
+
// If we've already got an array, just append.
|
|
356
|
+
} else if (prepend) {
|
|
357
|
+
existing.unshift(listener);
|
|
358
|
+
} else {
|
|
359
|
+
existing.push(listener);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Check for listener leak
|
|
363
|
+
m = _getMaxListeners(target);
|
|
364
|
+
if (m > 0 && existing.length > m && !existing.warned) {
|
|
365
|
+
existing.warned = true;
|
|
366
|
+
// No error code for this since it is a Warning
|
|
367
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
368
|
+
var w = new Error('Possible EventEmitter memory leak detected. ' +
|
|
369
|
+
existing.length + ' ' + String(type) + ' listeners ' +
|
|
370
|
+
'added. Use emitter.setMaxListeners() to ' +
|
|
371
|
+
'increase limit');
|
|
372
|
+
w.name = 'MaxListenersExceededWarning';
|
|
373
|
+
w.emitter = target;
|
|
374
|
+
w.type = type;
|
|
375
|
+
w.count = existing.length;
|
|
376
|
+
ProcessEmitWarning(w);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return target;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
EventEmitter.prototype.addListener = function addListener(type, listener) {
|
|
384
|
+
return _addListener(this, type, listener, false);
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
388
|
+
|
|
389
|
+
EventEmitter.prototype.prependListener =
|
|
390
|
+
function prependListener(type, listener) {
|
|
391
|
+
return _addListener(this, type, listener, true);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
function onceWrapper() {
|
|
395
|
+
if (!this.fired) {
|
|
396
|
+
this.target.removeListener(this.type, this.wrapFn);
|
|
397
|
+
this.fired = true;
|
|
398
|
+
if (arguments.length === 0)
|
|
399
|
+
return this.listener.call(this.target);
|
|
400
|
+
return this.listener.apply(this.target, arguments);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function _onceWrap(target, type, listener) {
|
|
405
|
+
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
|
|
406
|
+
var wrapped = onceWrapper.bind(state);
|
|
407
|
+
wrapped.listener = listener;
|
|
408
|
+
state.wrapFn = wrapped;
|
|
409
|
+
return wrapped;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
EventEmitter.prototype.once = function once(type, listener) {
|
|
413
|
+
checkListener(listener);
|
|
414
|
+
this.on(type, _onceWrap(this, type, listener));
|
|
415
|
+
return this;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
EventEmitter.prototype.prependOnceListener =
|
|
419
|
+
function prependOnceListener(type, listener) {
|
|
420
|
+
checkListener(listener);
|
|
421
|
+
this.prependListener(type, _onceWrap(this, type, listener));
|
|
422
|
+
return this;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
// Emits a 'removeListener' event if and only if the listener was removed.
|
|
426
|
+
EventEmitter.prototype.removeListener =
|
|
427
|
+
function removeListener(type, listener) {
|
|
428
|
+
var list, events, position, i, originalListener;
|
|
429
|
+
|
|
430
|
+
checkListener(listener);
|
|
431
|
+
|
|
432
|
+
events = this._events;
|
|
433
|
+
if (events === undefined)
|
|
434
|
+
return this;
|
|
435
|
+
|
|
436
|
+
list = events[type];
|
|
437
|
+
if (list === undefined)
|
|
438
|
+
return this;
|
|
439
|
+
|
|
440
|
+
if (list === listener || list.listener === listener) {
|
|
441
|
+
if (--this._eventsCount === 0)
|
|
442
|
+
this._events = Object.create(null);
|
|
443
|
+
else {
|
|
444
|
+
delete events[type];
|
|
445
|
+
if (events.removeListener)
|
|
446
|
+
this.emit('removeListener', type, list.listener || listener);
|
|
447
|
+
}
|
|
448
|
+
} else if (typeof list !== 'function') {
|
|
449
|
+
position = -1;
|
|
450
|
+
|
|
451
|
+
for (i = list.length - 1; i >= 0; i--) {
|
|
452
|
+
if (list[i] === listener || list[i].listener === listener) {
|
|
453
|
+
originalListener = list[i].listener;
|
|
454
|
+
position = i;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (position < 0)
|
|
460
|
+
return this;
|
|
461
|
+
|
|
462
|
+
if (position === 0)
|
|
463
|
+
list.shift();
|
|
464
|
+
else {
|
|
465
|
+
spliceOne(list, position);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if (list.length === 1)
|
|
469
|
+
events[type] = list[0];
|
|
470
|
+
|
|
471
|
+
if (events.removeListener !== undefined)
|
|
472
|
+
this.emit('removeListener', type, originalListener || listener);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return this;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
479
|
+
|
|
480
|
+
EventEmitter.prototype.removeAllListeners =
|
|
481
|
+
function removeAllListeners(type) {
|
|
482
|
+
var listeners, events, i;
|
|
483
|
+
|
|
484
|
+
events = this._events;
|
|
485
|
+
if (events === undefined)
|
|
486
|
+
return this;
|
|
487
|
+
|
|
488
|
+
// not listening for removeListener, no need to emit
|
|
489
|
+
if (events.removeListener === undefined) {
|
|
490
|
+
if (arguments.length === 0) {
|
|
491
|
+
this._events = Object.create(null);
|
|
492
|
+
this._eventsCount = 0;
|
|
493
|
+
} else if (events[type] !== undefined) {
|
|
494
|
+
if (--this._eventsCount === 0)
|
|
495
|
+
this._events = Object.create(null);
|
|
496
|
+
else
|
|
497
|
+
delete events[type];
|
|
498
|
+
}
|
|
499
|
+
return this;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// emit removeListener for all listeners on all events
|
|
503
|
+
if (arguments.length === 0) {
|
|
504
|
+
var keys = Object.keys(events);
|
|
505
|
+
var key;
|
|
506
|
+
for (i = 0; i < keys.length; ++i) {
|
|
507
|
+
key = keys[i];
|
|
508
|
+
if (key === 'removeListener') continue;
|
|
509
|
+
this.removeAllListeners(key);
|
|
510
|
+
}
|
|
511
|
+
this.removeAllListeners('removeListener');
|
|
512
|
+
this._events = Object.create(null);
|
|
513
|
+
this._eventsCount = 0;
|
|
514
|
+
return this;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
listeners = events[type];
|
|
518
|
+
|
|
519
|
+
if (typeof listeners === 'function') {
|
|
520
|
+
this.removeListener(type, listeners);
|
|
521
|
+
} else if (listeners !== undefined) {
|
|
522
|
+
// LIFO order
|
|
523
|
+
for (i = listeners.length - 1; i >= 0; i--) {
|
|
524
|
+
this.removeListener(type, listeners[i]);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
return this;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
function _listeners(target, type, unwrap) {
|
|
532
|
+
var events = target._events;
|
|
533
|
+
|
|
534
|
+
if (events === undefined)
|
|
535
|
+
return [];
|
|
536
|
+
|
|
537
|
+
var evlistener = events[type];
|
|
538
|
+
if (evlistener === undefined)
|
|
539
|
+
return [];
|
|
540
|
+
|
|
541
|
+
if (typeof evlistener === 'function')
|
|
542
|
+
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
|
543
|
+
|
|
544
|
+
return unwrap ?
|
|
545
|
+
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
EventEmitter.prototype.listeners = function listeners(type) {
|
|
549
|
+
return _listeners(this, type, true);
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
EventEmitter.prototype.rawListeners = function rawListeners(type) {
|
|
553
|
+
return _listeners(this, type, false);
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
EventEmitter.listenerCount = function(emitter, type) {
|
|
557
|
+
if (typeof emitter.listenerCount === 'function') {
|
|
558
|
+
return emitter.listenerCount(type);
|
|
559
|
+
} else {
|
|
560
|
+
return listenerCount.call(emitter, type);
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
EventEmitter.prototype.listenerCount = listenerCount;
|
|
565
|
+
function listenerCount(type) {
|
|
566
|
+
var events = this._events;
|
|
567
|
+
|
|
568
|
+
if (events !== undefined) {
|
|
569
|
+
var evlistener = events[type];
|
|
570
|
+
|
|
571
|
+
if (typeof evlistener === 'function') {
|
|
572
|
+
return 1;
|
|
573
|
+
} else if (evlistener !== undefined) {
|
|
574
|
+
return evlistener.length;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return 0;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
EventEmitter.prototype.eventNames = function eventNames() {
|
|
582
|
+
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
function arrayClone(arr, n) {
|
|
586
|
+
var copy = new Array(n);
|
|
587
|
+
for (var i = 0; i < n; ++i)
|
|
588
|
+
copy[i] = arr[i];
|
|
589
|
+
return copy;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
function spliceOne(list, index) {
|
|
593
|
+
for (; index + 1 < list.length; index++)
|
|
594
|
+
list[index] = list[index + 1];
|
|
595
|
+
list.pop();
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
function unwrapListeners(arr) {
|
|
599
|
+
var ret = new Array(arr.length);
|
|
600
|
+
for (var i = 0; i < ret.length; ++i) {
|
|
601
|
+
ret[i] = arr[i].listener || arr[i];
|
|
602
|
+
}
|
|
603
|
+
return ret;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
function once(emitter, name) {
|
|
607
|
+
return new Promise(function (resolve, reject) {
|
|
608
|
+
function errorListener(err) {
|
|
609
|
+
emitter.removeListener(name, resolver);
|
|
610
|
+
reject(err);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
function resolver() {
|
|
614
|
+
if (typeof emitter.removeListener === 'function') {
|
|
615
|
+
emitter.removeListener('error', errorListener);
|
|
616
|
+
}
|
|
617
|
+
resolve([].slice.call(arguments));
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
|
|
621
|
+
if (name !== 'error') {
|
|
622
|
+
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
|
|
628
|
+
if (typeof emitter.on === 'function') {
|
|
629
|
+
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
634
|
+
if (typeof emitter.on === 'function') {
|
|
635
|
+
if (flags.once) {
|
|
636
|
+
emitter.once(name, listener);
|
|
637
|
+
} else {
|
|
638
|
+
emitter.on(name, listener);
|
|
639
|
+
}
|
|
640
|
+
} else if (typeof emitter.addEventListener === 'function') {
|
|
641
|
+
// EventTarget does not have `error` event semantics like Node
|
|
642
|
+
// EventEmitters, we do not listen for `error` events here.
|
|
643
|
+
emitter.addEventListener(name, function wrapListener(arg) {
|
|
644
|
+
// IE does not have builtin `{ once: true }` support so we
|
|
645
|
+
// have to do it manually.
|
|
646
|
+
if (flags.once) {
|
|
647
|
+
emitter.removeEventListener(name, wrapListener);
|
|
648
|
+
}
|
|
649
|
+
listener(arg);
|
|
650
|
+
});
|
|
651
|
+
} else {
|
|
652
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
/***/ }),
|
|
658
|
+
|
|
659
|
+
/***/ 650:
|
|
660
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
661
|
+
|
|
662
|
+
var root = __webpack_require__(942);
|
|
663
|
+
|
|
664
|
+
/** Built-in value references. */
|
|
665
|
+
var Symbol = root.Symbol;
|
|
666
|
+
|
|
667
|
+
module.exports = Symbol;
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
/***/ }),
|
|
671
|
+
|
|
672
|
+
/***/ 379:
|
|
673
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
674
|
+
|
|
675
|
+
var Symbol = __webpack_require__(650),
|
|
676
|
+
getRawTag = __webpack_require__(870),
|
|
677
|
+
objectToString = __webpack_require__(5);
|
|
678
|
+
|
|
679
|
+
/** `Object#toString` result references. */
|
|
680
|
+
var nullTag = '[object Null]',
|
|
681
|
+
undefinedTag = '[object Undefined]';
|
|
682
|
+
|
|
683
|
+
/** Built-in value references. */
|
|
684
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
688
|
+
*
|
|
689
|
+
* @private
|
|
690
|
+
* @param {*} value The value to query.
|
|
691
|
+
* @returns {string} Returns the `toStringTag`.
|
|
692
|
+
*/
|
|
693
|
+
function baseGetTag(value) {
|
|
694
|
+
if (value == null) {
|
|
695
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
696
|
+
}
|
|
697
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
698
|
+
? getRawTag(value)
|
|
699
|
+
: objectToString(value);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
module.exports = baseGetTag;
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
/***/ }),
|
|
706
|
+
|
|
707
|
+
/***/ 967:
|
|
708
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
709
|
+
|
|
710
|
+
/** Detect free variable `global` from Node.js. */
|
|
711
|
+
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
|
|
712
|
+
|
|
713
|
+
module.exports = freeGlobal;
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
/***/ }),
|
|
717
|
+
|
|
718
|
+
/***/ 870:
|
|
719
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
720
|
+
|
|
721
|
+
var Symbol = __webpack_require__(650);
|
|
722
|
+
|
|
723
|
+
/** Used for built-in method references. */
|
|
724
|
+
var objectProto = Object.prototype;
|
|
725
|
+
|
|
726
|
+
/** Used to check objects for own properties. */
|
|
727
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Used to resolve the
|
|
731
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
732
|
+
* of values.
|
|
733
|
+
*/
|
|
734
|
+
var nativeObjectToString = objectProto.toString;
|
|
735
|
+
|
|
736
|
+
/** Built-in value references. */
|
|
737
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
741
|
+
*
|
|
742
|
+
* @private
|
|
743
|
+
* @param {*} value The value to query.
|
|
744
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
745
|
+
*/
|
|
746
|
+
function getRawTag(value) {
|
|
747
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
|
748
|
+
tag = value[symToStringTag];
|
|
749
|
+
|
|
750
|
+
try {
|
|
751
|
+
value[symToStringTag] = undefined;
|
|
752
|
+
var unmasked = true;
|
|
753
|
+
} catch (e) {}
|
|
754
|
+
|
|
755
|
+
var result = nativeObjectToString.call(value);
|
|
756
|
+
if (unmasked) {
|
|
757
|
+
if (isOwn) {
|
|
758
|
+
value[symToStringTag] = tag;
|
|
759
|
+
} else {
|
|
760
|
+
delete value[symToStringTag];
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
return result;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
module.exports = getRawTag;
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
/***/ }),
|
|
770
|
+
|
|
771
|
+
/***/ 5:
|
|
772
|
+
/***/ ((module) => {
|
|
773
|
+
|
|
774
|
+
/** Used for built-in method references. */
|
|
775
|
+
var objectProto = Object.prototype;
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* Used to resolve the
|
|
779
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
780
|
+
* of values.
|
|
781
|
+
*/
|
|
782
|
+
var nativeObjectToString = objectProto.toString;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
786
|
+
*
|
|
787
|
+
* @private
|
|
788
|
+
* @param {*} value The value to convert.
|
|
789
|
+
* @returns {string} Returns the converted string.
|
|
790
|
+
*/
|
|
791
|
+
function objectToString(value) {
|
|
792
|
+
return nativeObjectToString.call(value);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
module.exports = objectToString;
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
/***/ }),
|
|
799
|
+
|
|
800
|
+
/***/ 942:
|
|
801
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
802
|
+
|
|
803
|
+
var freeGlobal = __webpack_require__(967);
|
|
804
|
+
|
|
805
|
+
/** Detect free variable `self`. */
|
|
806
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
807
|
+
|
|
808
|
+
/** Used as a reference to the global object. */
|
|
809
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
810
|
+
|
|
811
|
+
module.exports = root;
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
/***/ }),
|
|
815
|
+
|
|
816
|
+
/***/ 655:
|
|
817
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
818
|
+
|
|
819
|
+
var baseGetTag = __webpack_require__(379),
|
|
820
|
+
isObject = __webpack_require__(580);
|
|
821
|
+
|
|
822
|
+
/** `Object#toString` result references. */
|
|
823
|
+
var asyncTag = '[object AsyncFunction]',
|
|
824
|
+
funcTag = '[object Function]',
|
|
825
|
+
genTag = '[object GeneratorFunction]',
|
|
826
|
+
proxyTag = '[object Proxy]';
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Checks if `value` is classified as a `Function` object.
|
|
830
|
+
*
|
|
831
|
+
* @static
|
|
832
|
+
* @memberOf _
|
|
833
|
+
* @since 0.1.0
|
|
834
|
+
* @category Lang
|
|
835
|
+
* @param {*} value The value to check.
|
|
836
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
837
|
+
* @example
|
|
838
|
+
*
|
|
839
|
+
* _.isFunction(_);
|
|
840
|
+
* // => true
|
|
841
|
+
*
|
|
842
|
+
* _.isFunction(/abc/);
|
|
843
|
+
* // => false
|
|
844
|
+
*/
|
|
845
|
+
function isFunction(value) {
|
|
846
|
+
if (!isObject(value)) {
|
|
847
|
+
return false;
|
|
848
|
+
}
|
|
849
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
850
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
851
|
+
var tag = baseGetTag(value);
|
|
852
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
module.exports = isFunction;
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
/***/ }),
|
|
859
|
+
|
|
860
|
+
/***/ 580:
|
|
861
|
+
/***/ ((module) => {
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Checks if `value` is the
|
|
865
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
866
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
867
|
+
*
|
|
868
|
+
* @static
|
|
869
|
+
* @memberOf _
|
|
870
|
+
* @since 0.1.0
|
|
871
|
+
* @category Lang
|
|
872
|
+
* @param {*} value The value to check.
|
|
873
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
874
|
+
* @example
|
|
875
|
+
*
|
|
876
|
+
* _.isObject({});
|
|
877
|
+
* // => true
|
|
878
|
+
*
|
|
879
|
+
* _.isObject([1, 2, 3]);
|
|
880
|
+
* // => true
|
|
881
|
+
*
|
|
882
|
+
* _.isObject(_.noop);
|
|
883
|
+
* // => true
|
|
884
|
+
*
|
|
885
|
+
* _.isObject(null);
|
|
886
|
+
* // => false
|
|
887
|
+
*/
|
|
888
|
+
function isObject(value) {
|
|
889
|
+
var type = typeof value;
|
|
890
|
+
return value != null && (type == 'object' || type == 'function');
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
module.exports = isObject;
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
/***/ }),
|
|
897
|
+
|
|
898
|
+
/***/ 591:
|
|
899
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
var isOldIE = function isOldIE() {
|
|
904
|
+
var memo;
|
|
905
|
+
return function memorize() {
|
|
906
|
+
if (typeof memo === 'undefined') {
|
|
907
|
+
// Test for IE <= 9 as proposed by Browserhacks
|
|
908
|
+
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
|
|
909
|
+
// Tests for existence of standard globals is to allow style-loader
|
|
910
|
+
// to operate correctly into non-standard environments
|
|
911
|
+
// @see https://github.com/webpack-contrib/style-loader/issues/177
|
|
912
|
+
memo = Boolean(window && document && document.all && !window.atob);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
return memo;
|
|
916
|
+
};
|
|
917
|
+
}();
|
|
918
|
+
|
|
919
|
+
var getTarget = function getTarget() {
|
|
920
|
+
var memo = {};
|
|
921
|
+
return function memorize(target) {
|
|
922
|
+
if (typeof memo[target] === 'undefined') {
|
|
923
|
+
var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
|
|
924
|
+
|
|
925
|
+
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
|
926
|
+
try {
|
|
927
|
+
// This will throw an exception if access to iframe is blocked
|
|
928
|
+
// due to cross-origin restrictions
|
|
929
|
+
styleTarget = styleTarget.contentDocument.head;
|
|
930
|
+
} catch (e) {
|
|
931
|
+
// istanbul ignore next
|
|
932
|
+
styleTarget = null;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
memo[target] = styleTarget;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
return memo[target];
|
|
940
|
+
};
|
|
941
|
+
}();
|
|
942
|
+
|
|
943
|
+
var stylesInDom = [];
|
|
944
|
+
|
|
945
|
+
function getIndexByIdentifier(identifier) {
|
|
946
|
+
var result = -1;
|
|
947
|
+
|
|
948
|
+
for (var i = 0; i < stylesInDom.length; i++) {
|
|
949
|
+
if (stylesInDom[i].identifier === identifier) {
|
|
950
|
+
result = i;
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
return result;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
function modulesToDom(list, options) {
|
|
959
|
+
var idCountMap = {};
|
|
960
|
+
var identifiers = [];
|
|
961
|
+
|
|
962
|
+
for (var i = 0; i < list.length; i++) {
|
|
963
|
+
var item = list[i];
|
|
964
|
+
var id = options.base ? item[0] + options.base : item[0];
|
|
965
|
+
var count = idCountMap[id] || 0;
|
|
966
|
+
var identifier = "".concat(id, " ").concat(count);
|
|
967
|
+
idCountMap[id] = count + 1;
|
|
968
|
+
var index = getIndexByIdentifier(identifier);
|
|
969
|
+
var obj = {
|
|
970
|
+
css: item[1],
|
|
971
|
+
media: item[2],
|
|
972
|
+
sourceMap: item[3]
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
if (index !== -1) {
|
|
976
|
+
stylesInDom[index].references++;
|
|
977
|
+
stylesInDom[index].updater(obj);
|
|
978
|
+
} else {
|
|
979
|
+
stylesInDom.push({
|
|
980
|
+
identifier: identifier,
|
|
981
|
+
updater: addStyle(obj, options),
|
|
982
|
+
references: 1
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
identifiers.push(identifier);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
return identifiers;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function insertStyleElement(options) {
|
|
993
|
+
var style = document.createElement('style');
|
|
994
|
+
var attributes = options.attributes || {};
|
|
995
|
+
|
|
996
|
+
if (typeof attributes.nonce === 'undefined') {
|
|
997
|
+
var nonce = true ? __webpack_require__.nc : 0;
|
|
998
|
+
|
|
999
|
+
if (nonce) {
|
|
1000
|
+
attributes.nonce = nonce;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
Object.keys(attributes).forEach(function (key) {
|
|
1005
|
+
style.setAttribute(key, attributes[key]);
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
if (typeof options.insert === 'function') {
|
|
1009
|
+
options.insert(style);
|
|
1010
|
+
} else {
|
|
1011
|
+
var target = getTarget(options.insert || 'head');
|
|
1012
|
+
|
|
1013
|
+
if (!target) {
|
|
1014
|
+
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
target.appendChild(style);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
return style;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
function removeStyleElement(style) {
|
|
1024
|
+
// istanbul ignore if
|
|
1025
|
+
if (style.parentNode === null) {
|
|
1026
|
+
return false;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
style.parentNode.removeChild(style);
|
|
1030
|
+
}
|
|
1031
|
+
/* istanbul ignore next */
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
var replaceText = function replaceText() {
|
|
1035
|
+
var textStore = [];
|
|
1036
|
+
return function replace(index, replacement) {
|
|
1037
|
+
textStore[index] = replacement;
|
|
1038
|
+
return textStore.filter(Boolean).join('\n');
|
|
1039
|
+
};
|
|
1040
|
+
}();
|
|
1041
|
+
|
|
1042
|
+
function applyToSingletonTag(style, index, remove, obj) {
|
|
1043
|
+
var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
|
|
1044
|
+
|
|
1045
|
+
/* istanbul ignore if */
|
|
1046
|
+
|
|
1047
|
+
if (style.styleSheet) {
|
|
1048
|
+
style.styleSheet.cssText = replaceText(index, css);
|
|
1049
|
+
} else {
|
|
1050
|
+
var cssNode = document.createTextNode(css);
|
|
1051
|
+
var childNodes = style.childNodes;
|
|
1052
|
+
|
|
1053
|
+
if (childNodes[index]) {
|
|
1054
|
+
style.removeChild(childNodes[index]);
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
if (childNodes.length) {
|
|
1058
|
+
style.insertBefore(cssNode, childNodes[index]);
|
|
1059
|
+
} else {
|
|
1060
|
+
style.appendChild(cssNode);
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
function applyToTag(style, options, obj) {
|
|
1066
|
+
var css = obj.css;
|
|
1067
|
+
var media = obj.media;
|
|
1068
|
+
var sourceMap = obj.sourceMap;
|
|
1069
|
+
|
|
1070
|
+
if (media) {
|
|
1071
|
+
style.setAttribute('media', media);
|
|
1072
|
+
} else {
|
|
1073
|
+
style.removeAttribute('media');
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
if (sourceMap && typeof btoa !== 'undefined') {
|
|
1077
|
+
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
|
|
1078
|
+
} // For old IE
|
|
1079
|
+
|
|
1080
|
+
/* istanbul ignore if */
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
if (style.styleSheet) {
|
|
1084
|
+
style.styleSheet.cssText = css;
|
|
1085
|
+
} else {
|
|
1086
|
+
while (style.firstChild) {
|
|
1087
|
+
style.removeChild(style.firstChild);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
style.appendChild(document.createTextNode(css));
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
var singleton = null;
|
|
1095
|
+
var singletonCounter = 0;
|
|
1096
|
+
|
|
1097
|
+
function addStyle(obj, options) {
|
|
1098
|
+
var style;
|
|
1099
|
+
var update;
|
|
1100
|
+
var remove;
|
|
1101
|
+
|
|
1102
|
+
if (options.singleton) {
|
|
1103
|
+
var styleIndex = singletonCounter++;
|
|
1104
|
+
style = singleton || (singleton = insertStyleElement(options));
|
|
1105
|
+
update = applyToSingletonTag.bind(null, style, styleIndex, false);
|
|
1106
|
+
remove = applyToSingletonTag.bind(null, style, styleIndex, true);
|
|
1107
|
+
} else {
|
|
1108
|
+
style = insertStyleElement(options);
|
|
1109
|
+
update = applyToTag.bind(null, style, options);
|
|
1110
|
+
|
|
1111
|
+
remove = function remove() {
|
|
1112
|
+
removeStyleElement(style);
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
update(obj);
|
|
1117
|
+
return function updateStyle(newObj) {
|
|
1118
|
+
if (newObj) {
|
|
1119
|
+
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
update(obj = newObj);
|
|
1124
|
+
} else {
|
|
1125
|
+
remove();
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
module.exports = function (list, options) {
|
|
1131
|
+
options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
|
1132
|
+
// tags it will allow on a page
|
|
1133
|
+
|
|
1134
|
+
if (!options.singleton && typeof options.singleton !== 'boolean') {
|
|
1135
|
+
options.singleton = isOldIE();
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
list = list || [];
|
|
1139
|
+
var lastIdentifiers = modulesToDom(list, options);
|
|
1140
|
+
return function update(newList) {
|
|
1141
|
+
newList = newList || [];
|
|
1142
|
+
|
|
1143
|
+
if (Object.prototype.toString.call(newList) !== '[object Array]') {
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
for (var i = 0; i < lastIdentifiers.length; i++) {
|
|
1148
|
+
var identifier = lastIdentifiers[i];
|
|
1149
|
+
var index = getIndexByIdentifier(identifier);
|
|
1150
|
+
stylesInDom[index].references--;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
var newLastIdentifiers = modulesToDom(newList, options);
|
|
1154
|
+
|
|
1155
|
+
for (var _i = 0; _i < lastIdentifiers.length; _i++) {
|
|
1156
|
+
var _identifier = lastIdentifiers[_i];
|
|
1157
|
+
|
|
1158
|
+
var _index = getIndexByIdentifier(_identifier);
|
|
1159
|
+
|
|
1160
|
+
if (stylesInDom[_index].references === 0) {
|
|
1161
|
+
stylesInDom[_index].updater();
|
|
1162
|
+
|
|
1163
|
+
stylesInDom.splice(_index, 1);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
lastIdentifiers = newLastIdentifiers;
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
/***/ })
|
|
1172
|
+
|
|
1173
|
+
/******/ });
|
|
1174
|
+
/************************************************************************/
|
|
1175
|
+
/******/ // The module cache
|
|
1176
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1177
|
+
/******/
|
|
1178
|
+
/******/ // The require function
|
|
1179
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1180
|
+
/******/ // Check if module is in cache
|
|
1181
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1182
|
+
/******/ if (cachedModule !== undefined) {
|
|
1183
|
+
/******/ return cachedModule.exports;
|
|
1184
|
+
/******/ }
|
|
1185
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1186
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1187
|
+
/******/ id: moduleId,
|
|
1188
|
+
/******/ // no module.loaded needed
|
|
1189
|
+
/******/ exports: {}
|
|
1190
|
+
/******/ };
|
|
1191
|
+
/******/
|
|
1192
|
+
/******/ // Execute the module function
|
|
1193
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
1194
|
+
/******/
|
|
1195
|
+
/******/ // Return the exports of the module
|
|
1196
|
+
/******/ return module.exports;
|
|
1197
|
+
/******/ }
|
|
1198
|
+
/******/
|
|
1199
|
+
/************************************************************************/
|
|
1200
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1201
|
+
/******/ (() => {
|
|
1202
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1203
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1204
|
+
/******/ var getter = module && module.__esModule ?
|
|
1205
|
+
/******/ () => (module['default']) :
|
|
1206
|
+
/******/ () => (module);
|
|
1207
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1208
|
+
/******/ return getter;
|
|
1209
|
+
/******/ };
|
|
1210
|
+
/******/ })();
|
|
1211
|
+
/******/
|
|
1212
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1213
|
+
/******/ (() => {
|
|
1214
|
+
/******/ // define getter functions for harmony exports
|
|
1215
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1216
|
+
/******/ for(var key in definition) {
|
|
1217
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1218
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1219
|
+
/******/ }
|
|
1220
|
+
/******/ }
|
|
1221
|
+
/******/ };
|
|
1222
|
+
/******/ })();
|
|
1223
|
+
/******/
|
|
1224
|
+
/******/ /* webpack/runtime/global */
|
|
1225
|
+
/******/ (() => {
|
|
1226
|
+
/******/ __webpack_require__.g = (function() {
|
|
1227
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
1228
|
+
/******/ try {
|
|
1229
|
+
/******/ return this || new Function('return this')();
|
|
1230
|
+
/******/ } catch (e) {
|
|
1231
|
+
/******/ if (typeof window === 'object') return window;
|
|
1232
|
+
/******/ }
|
|
1233
|
+
/******/ })();
|
|
1234
|
+
/******/ })();
|
|
1235
|
+
/******/
|
|
1236
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1237
|
+
/******/ (() => {
|
|
1238
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1239
|
+
/******/ })();
|
|
1240
|
+
/******/
|
|
1241
|
+
/******/ /* webpack/runtime/nonce */
|
|
1242
|
+
/******/ (() => {
|
|
1243
|
+
/******/ __webpack_require__.nc = undefined;
|
|
1244
|
+
/******/ })();
|
|
1245
|
+
/******/
|
|
1246
|
+
/************************************************************************/
|
|
1247
|
+
var __webpack_exports__ = {};
|
|
1248
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
1249
|
+
(() => {
|
|
1250
|
+
|
|
1251
|
+
// EXPORTS
|
|
1252
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1253
|
+
KL: () => (/* reexport */ react_sdk_namespaceObject.AppearanceManager),
|
|
1254
|
+
Yb: () => (/* reexport */ react_sdk_namespaceObject.CloseButtonPosition),
|
|
1255
|
+
lV: () => (/* reexport */ react_sdk_namespaceObject.GoodsWidgetRenderingType),
|
|
1256
|
+
IV: () => (/* reexport */ react_sdk_namespaceObject.IamCheckDisplayTimeRangeError),
|
|
1257
|
+
tP: () => (/* reexport */ react_sdk_namespaceObject.IamFrequencyLimitError),
|
|
1258
|
+
h8: () => (/* reexport */ react_sdk_namespaceObject.IamMessageLimitExceededError),
|
|
1259
|
+
Xz: () => (/* reexport */ react_sdk_namespaceObject.IamMessageOpenError),
|
|
1260
|
+
wS: () => (/* reexport */ react_sdk_namespaceObject.IamNotFoundByEventError),
|
|
1261
|
+
VS: () => (/* reexport */ react_sdk_namespaceObject.IamNotFoundByIdError),
|
|
1262
|
+
oC: () => (/* reexport */ react_sdk_namespaceObject.IamNotFoundLimitError),
|
|
1263
|
+
L8: () => (/* reexport */ react_sdk_namespaceObject.IamOtherReaderIsOpenError),
|
|
1264
|
+
NL: () => (/* reexport */ react_sdk_namespaceObject.IamShowOnlyIfLoadedError),
|
|
1265
|
+
Ez: () => (/* reexport */ react_sdk_namespaceObject.IasNetworkError),
|
|
1266
|
+
Hp: () => (/* reexport */ StoryManagerAdapter),
|
|
1267
|
+
SK: () => (/* reexport */ react_sdk_namespaceObject.StoriesListCardCoverQuality),
|
|
1268
|
+
tI: () => (/* reexport */ react_sdk_namespaceObject.StoriesListCardTitlePosition),
|
|
1269
|
+
Uy: () => (/* reexport */ react_sdk_namespaceObject.StoriesListCardTitleTextAlign),
|
|
1270
|
+
SP: () => (/* reexport */ react_sdk_namespaceObject.StoriesListCardViewVariant),
|
|
1271
|
+
Jj: () => (/* reexport */ react_sdk_namespaceObject.StoriesListDirection),
|
|
1272
|
+
qz: () => (/* reexport */ react_sdk_namespaceObject.StoryReaderSwipeStyle)
|
|
1273
|
+
});
|
|
1274
|
+
|
|
1275
|
+
;// CONCATENATED MODULE: external "@inappstory/react-sdk"
|
|
1276
|
+
var x = (y) => {
|
|
1277
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
1278
|
+
}
|
|
1279
|
+
var y = (x) => (() => (x))
|
|
1280
|
+
const react_sdk_namespaceObject = x({ ["AppearanceManager"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.AppearanceManager), ["AppearanceManagerEvents"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.AppearanceManagerEvents), ["CloseButtonPosition"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.CloseButtonPosition), ["FavoriteStoryList"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.FavoriteStoryList), ["GoodsWidgetRenderingType"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.GoodsWidgetRenderingType), ["IASContainer"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IASContainer), ["IamCheckDisplayTimeRangeError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamCheckDisplayTimeRangeError), ["IamFrequencyLimitError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamFrequencyLimitError), ["IamMessageLimitExceededError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamMessageLimitExceededError), ["IamMessageOpenError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamMessageOpenError), ["IamNotFoundByEventError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamNotFoundByEventError), ["IamNotFoundByIdError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamNotFoundByIdError), ["IamNotFoundLimitError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamNotFoundLimitError), ["IamOtherReaderIsOpenError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamOtherReaderIsOpenError), ["IamShowOnlyIfLoadedError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IamShowOnlyIfLoadedError), ["IasNetworkError"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.IasNetworkError), ["StackedStoryListViewModel"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StackedStoryListViewModel), ["StoriesListCardCoverQuality"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoriesListCardCoverQuality), ["StoriesListCardTitlePosition"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoriesListCardTitlePosition), ["StoriesListCardTitleTextAlign"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoriesListCardTitleTextAlign), ["StoriesListCardViewVariant"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoriesListCardViewVariant), ["StoriesListDirection"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoriesListDirection), ["StoryFeedType"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoryFeedType), ["StoryList"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoryList), ["StoryManager"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoryManager), ["StoryReaderSwipeStyle"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.StoryReaderSwipeStyle), ["UGCFeedSlug"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.UGCFeedSlug), ["UGCStoryList"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.UGCStoryList), ["storyManager"]: () => (__WEBPACK_EXTERNAL_MODULE__inappstory_react_sdk_b7aa7f3b__.storyManager) });
|
|
1281
|
+
// EXTERNAL MODULE: ../../node_modules/events/events.js
|
|
1282
|
+
var events = __webpack_require__(46);
|
|
1283
|
+
;// CONCATENATED MODULE: ./src/utils/assertAppearanceManagerIsObject.ts
|
|
1284
|
+
class IasAppearanceManagerTypeofError extends Error {
|
|
1285
|
+
constructor(type) {
|
|
1286
|
+
super(`Appearance Manager must be an object, but passed ${type.toUpperCase()}. Please check your code.`);
|
|
1287
|
+
this.name = `IasAppearanceManagerTypeofError`;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
const assertAppearanceManagerIsObject = (appearanceManager) => {
|
|
1291
|
+
if (appearanceManager == null || typeof appearanceManager !== "object")
|
|
1292
|
+
throw new IasAppearanceManagerTypeofError(appearanceManager == null ? "null" : typeof appearanceManager);
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
;// CONCATENATED MODULE: ./src/utils/index.ts
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
;// CONCATENATED MODULE: ./src/exceptions/iasInAppStoryManagerReferenceError.ts
|
|
1299
|
+
class IasInAppStoryManagerReferenceError extends Error {
|
|
1300
|
+
constructor() {
|
|
1301
|
+
super(`[IAS]: The <StoryManager> instance has been destroyed, you must create a new instance`);
|
|
1302
|
+
this.name = `IasInAppStoryManagerReferenceError`;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
;// CONCATENATED MODULE: ./src/exceptions/iasMountPointReferenceError.ts
|
|
1307
|
+
class IasMountPointReferenceError extends Error {
|
|
1308
|
+
constructor(mountSelector) {
|
|
1309
|
+
super(`[IAS]: Mount point ${mountSelector} is not present in DOM at initialization time`);
|
|
1310
|
+
this.name = `IasMountPointReferenceError`;
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
;// CONCATENATED MODULE: ./src/exceptions/index.ts
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
;// CONCATENATED MODULE: ./src/storyList/storiesList.ts
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
class StoriesList extends events.EventEmitter {
|
|
1324
|
+
constructor(_mountSelector, _appearanceManager, app, params) {
|
|
1325
|
+
super();
|
|
1326
|
+
Object.defineProperty(this, "_mountSelector", {
|
|
1327
|
+
enumerable: true,
|
|
1328
|
+
configurable: true,
|
|
1329
|
+
writable: true,
|
|
1330
|
+
value: _mountSelector
|
|
1331
|
+
});
|
|
1332
|
+
Object.defineProperty(this, "_appearanceManager", {
|
|
1333
|
+
enumerable: true,
|
|
1334
|
+
configurable: true,
|
|
1335
|
+
writable: true,
|
|
1336
|
+
value: _appearanceManager
|
|
1337
|
+
});
|
|
1338
|
+
Object.defineProperty(this, "app", {
|
|
1339
|
+
enumerable: true,
|
|
1340
|
+
configurable: true,
|
|
1341
|
+
writable: true,
|
|
1342
|
+
value: app
|
|
1343
|
+
});
|
|
1344
|
+
Object.defineProperty(this, "params", {
|
|
1345
|
+
enumerable: true,
|
|
1346
|
+
configurable: true,
|
|
1347
|
+
writable: true,
|
|
1348
|
+
value: params
|
|
1349
|
+
});
|
|
1350
|
+
Object.defineProperty(this, "_ugcCardClickHandler", {
|
|
1351
|
+
enumerable: true,
|
|
1352
|
+
configurable: true,
|
|
1353
|
+
writable: true,
|
|
1354
|
+
value: () => { }
|
|
1355
|
+
});
|
|
1356
|
+
Object.defineProperty(this, "_api", {
|
|
1357
|
+
enumerable: true,
|
|
1358
|
+
configurable: true,
|
|
1359
|
+
writable: true,
|
|
1360
|
+
value: void 0
|
|
1361
|
+
});
|
|
1362
|
+
Object.defineProperty(this, "_mountPoint", {
|
|
1363
|
+
enumerable: true,
|
|
1364
|
+
configurable: true,
|
|
1365
|
+
writable: true,
|
|
1366
|
+
value: void 0
|
|
1367
|
+
});
|
|
1368
|
+
assertAppearanceManagerIsObject(_appearanceManager);
|
|
1369
|
+
this._mountPoint = this.getMountPoint(_mountSelector);
|
|
1370
|
+
this.app.addStoryList(this).catch(console.error);
|
|
1371
|
+
}
|
|
1372
|
+
get mountPoint() {
|
|
1373
|
+
return this._mountPoint;
|
|
1374
|
+
}
|
|
1375
|
+
get mountSelector() {
|
|
1376
|
+
return this._mountSelector;
|
|
1377
|
+
}
|
|
1378
|
+
get appearanceManager() {
|
|
1379
|
+
return this._appearanceManager;
|
|
1380
|
+
}
|
|
1381
|
+
get type() {
|
|
1382
|
+
return react_sdk_namespaceObject.StoryFeedType.DEFAULT;
|
|
1383
|
+
}
|
|
1384
|
+
get identityFields() {
|
|
1385
|
+
return {
|
|
1386
|
+
feedSlug: this.feedSlug
|
|
1387
|
+
};
|
|
1388
|
+
}
|
|
1389
|
+
get feedSlug() {
|
|
1390
|
+
var _a;
|
|
1391
|
+
return (_a = this.params) === null || _a === void 0 ? void 0 : _a.feed;
|
|
1392
|
+
}
|
|
1393
|
+
get testKey() {
|
|
1394
|
+
var _a;
|
|
1395
|
+
return (_a = this.params) === null || _a === void 0 ? void 0 : _a.testKey;
|
|
1396
|
+
}
|
|
1397
|
+
get useUgcCard() {
|
|
1398
|
+
var _a;
|
|
1399
|
+
return Boolean((_a = this.params) === null || _a === void 0 ? void 0 : _a.useUgcCard);
|
|
1400
|
+
}
|
|
1401
|
+
set ugcCardClickHandler(value) {
|
|
1402
|
+
this._ugcCardClickHandler = value;
|
|
1403
|
+
}
|
|
1404
|
+
get ugcCardClickHandler() {
|
|
1405
|
+
return this._ugcCardClickHandler;
|
|
1406
|
+
}
|
|
1407
|
+
set api(api) {
|
|
1408
|
+
this._api = api;
|
|
1409
|
+
}
|
|
1410
|
+
async reload() {
|
|
1411
|
+
var _a;
|
|
1412
|
+
return (_a = this._api) === null || _a === void 0 ? void 0 : _a.reload();
|
|
1413
|
+
}
|
|
1414
|
+
destroy() {
|
|
1415
|
+
this.app.removeStoryList(this);
|
|
1416
|
+
}
|
|
1417
|
+
getMountPoint(mountSelector) {
|
|
1418
|
+
const mountPoint = document.querySelector(mountSelector);
|
|
1419
|
+
if (!mountPoint)
|
|
1420
|
+
throw new IasMountPointReferenceError(mountSelector);
|
|
1421
|
+
return mountPoint;
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
;// CONCATENATED MODULE: ./src/storyList/storyListManager.ts
|
|
1426
|
+
class StoryListManager {
|
|
1427
|
+
constructor() {
|
|
1428
|
+
Object.defineProperty(this, "_storyLists", {
|
|
1429
|
+
enumerable: true,
|
|
1430
|
+
configurable: true,
|
|
1431
|
+
writable: true,
|
|
1432
|
+
value: []
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
get storyLists() {
|
|
1436
|
+
return this._storyLists;
|
|
1437
|
+
}
|
|
1438
|
+
addStoryList(storyList) {
|
|
1439
|
+
this._storyLists.push(storyList);
|
|
1440
|
+
}
|
|
1441
|
+
removeStoryList(storyList) {
|
|
1442
|
+
const index = this._storyLists.findIndex(_storyList => _storyList === storyList);
|
|
1443
|
+
if (index === -1)
|
|
1444
|
+
return;
|
|
1445
|
+
this._storyLists.splice(index, 1);
|
|
1446
|
+
}
|
|
1447
|
+
destroy() {
|
|
1448
|
+
this._storyLists = [];
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
;// CONCATENATED MODULE: ./src/storyList/index.ts
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
;// CONCATENATED MODULE: ./src/storyList/ugcStoriesList.ts
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
class UGCStoriesList extends StoriesList {
|
|
1462
|
+
constructor(_mountSelector, _appearanceManager, app, ugcParams) {
|
|
1463
|
+
super(_mountSelector, _appearanceManager, app, {
|
|
1464
|
+
feed: react_sdk_namespaceObject.UGCFeedSlug,
|
|
1465
|
+
testKey: ugcParams === null || ugcParams === void 0 ? void 0 : ugcParams.testKey,
|
|
1466
|
+
useUgcCard: ugcParams === null || ugcParams === void 0 ? void 0 : ugcParams.useUgcCard
|
|
1467
|
+
});
|
|
1468
|
+
Object.defineProperty(this, "ugcParams", {
|
|
1469
|
+
enumerable: true,
|
|
1470
|
+
configurable: true,
|
|
1471
|
+
writable: true,
|
|
1472
|
+
value: ugcParams
|
|
1473
|
+
});
|
|
1474
|
+
assertAppearanceManagerIsObject(_appearanceManager);
|
|
1475
|
+
}
|
|
1476
|
+
get type() {
|
|
1477
|
+
return react_sdk_namespaceObject.StoryFeedType.UGC;
|
|
1478
|
+
}
|
|
1479
|
+
get filter() {
|
|
1480
|
+
var _a;
|
|
1481
|
+
return (_a = this.ugcParams) === null || _a === void 0 ? void 0 : _a.filter;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
1486
|
+
var jsx_runtime_x = (y) => {
|
|
1487
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
1488
|
+
}
|
|
1489
|
+
var jsx_runtime_y = (x) => (() => (x))
|
|
1490
|
+
const jsx_runtime_namespaceObject = jsx_runtime_x({ ["jsx"]: () => (__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_179142b8__.jsx), ["jsxs"]: () => (__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_179142b8__.jsxs) });
|
|
1491
|
+
;// CONCATENATED MODULE: external "react-dom/client"
|
|
1492
|
+
var client_x = (y) => {
|
|
1493
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
1494
|
+
}
|
|
1495
|
+
var client_y = (x) => (() => (x))
|
|
1496
|
+
const client_namespaceObject = client_x({ ["createRoot"]: () => (__WEBPACK_EXTERNAL_MODULE_react_dom_client_4cb20cd7__.createRoot) });
|
|
1497
|
+
;// CONCATENATED MODULE: external "react"
|
|
1498
|
+
var external_react_x = (y) => {
|
|
1499
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
1500
|
+
}
|
|
1501
|
+
var external_react_y = (x) => (() => (x))
|
|
1502
|
+
const external_react_namespaceObject = external_react_x({ ["useEffect"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useEffect), ["useLayoutEffect"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useLayoutEffect), ["useRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef), ["useState"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useState) });
|
|
1503
|
+
// EXTERNAL MODULE: ../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
|
|
1504
|
+
var injectStylesIntoStyleTag = __webpack_require__(591);
|
|
1505
|
+
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
|
|
1506
|
+
// EXTERNAL MODULE: ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./src/appRuntime/FavoriteStoryListModal/favoriteStoryListModal.module.scss
|
|
1507
|
+
var favoriteStoryListModal_module = __webpack_require__(432);
|
|
1508
|
+
;// CONCATENATED MODULE: ./src/appRuntime/FavoriteStoryListModal/favoriteStoryListModal.module.scss
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
|
|
1512
|
+
var options = {};
|
|
1513
|
+
|
|
1514
|
+
options.insert = "head";
|
|
1515
|
+
options.singleton = false;
|
|
1516
|
+
|
|
1517
|
+
var update = injectStylesIntoStyleTag_default()(favoriteStoryListModal_module/* default */.A, options);
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
/* harmony default export */ const FavoriteStoryListModal_favoriteStoryListModal_module = (favoriteStoryListModal_module/* default */.A.locals || {});
|
|
1522
|
+
;// CONCATENATED MODULE: ./src/appRuntime/FavoriteStoryListModal/FavoriteStoryListModal.tsx
|
|
1523
|
+
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
var TextDir;
|
|
1528
|
+
(function (TextDir) {
|
|
1529
|
+
TextDir["LTR"] = "ltr";
|
|
1530
|
+
TextDir["RTL"] = "rtl";
|
|
1531
|
+
})(TextDir || (TextDir = {}));
|
|
1532
|
+
const FavoriteStoryListModal = ({ open, options, storyListOptions: baseStoryListOptions, onClose }) => {
|
|
1533
|
+
var _a, _b;
|
|
1534
|
+
(0,external_react_namespaceObject.useLayoutEffect)(() => {
|
|
1535
|
+
if (!open)
|
|
1536
|
+
return;
|
|
1537
|
+
const prevOverflow = document.documentElement.style.overflow;
|
|
1538
|
+
document.documentElement.style.overflow = "hidden";
|
|
1539
|
+
return () => {
|
|
1540
|
+
document.documentElement.style.overflow = prevOverflow;
|
|
1541
|
+
};
|
|
1542
|
+
}, [open]);
|
|
1543
|
+
const getStyleRootVars = () => {
|
|
1544
|
+
var _a, _b, _c, _d;
|
|
1545
|
+
return {
|
|
1546
|
+
"--storiesFavoriteTitleColor": options.title.color,
|
|
1547
|
+
"--storiesFavoriteTitleFontFamily": "InternalPrimaryFont",
|
|
1548
|
+
"--storiesFavoriteTitleFont": options.title.font,
|
|
1549
|
+
"--storiesFavoriteTitleBackgroundColor": options.title.backgroundColor,
|
|
1550
|
+
"--storiesFavoriteHeaderTopOffset": parseFloat((_b = (_a = options.headerTopOffset) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "0") + "px",
|
|
1551
|
+
"--storiesFavoriteBottomOffset": parseFloat((_d = (_c = options.bottomOffset) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : "0") + "px",
|
|
1552
|
+
"--storiesFavoriteBackgroundColor": options.backgroundColor
|
|
1553
|
+
};
|
|
1554
|
+
};
|
|
1555
|
+
const getCloseButtonStyle = () => {
|
|
1556
|
+
var _a;
|
|
1557
|
+
const isStart = options.closeButtonPosition === "start" || options.closeButtonPosition === "left";
|
|
1558
|
+
const isLtr = ((_a = react_sdk_namespaceObject.storyManager.getConfig()) === null || _a === void 0 ? void 0 : _a.dir) === TextDir.LTR;
|
|
1559
|
+
const position = (isStart && isLtr) || (!isStart && !isLtr) ? "left" : "right";
|
|
1560
|
+
return { [position]: "10px" };
|
|
1561
|
+
};
|
|
1562
|
+
return open ? ((0,jsx_runtime_namespaceObject.jsx)("div", { className: FavoriteStoryListModal_favoriteStoryListModal_module["favorite-story-list-modal"], style: getStyleRootVars(), children: (0,jsx_runtime_namespaceObject.jsxs)("div", { className: FavoriteStoryListModal_favoriteStoryListModal_module["container"], children: [(0,jsx_runtime_namespaceObject.jsxs)("div", { className: FavoriteStoryListModal_favoriteStoryListModal_module["header"], children: [(0,jsx_runtime_namespaceObject.jsx)("p", { className: FavoriteStoryListModal_favoriteStoryListModal_module["title"], children: options.title.content }), (0,jsx_runtime_namespaceObject.jsx)("button", { onClick: e => {
|
|
1563
|
+
e.preventDefault();
|
|
1564
|
+
e.stopPropagation();
|
|
1565
|
+
onClose();
|
|
1566
|
+
}, className: FavoriteStoryListModal_favoriteStoryListModal_module["header__close-btn"], style: getCloseButtonStyle(), dangerouslySetInnerHTML: { __html: (_b = (_a = options.closeButton) === null || _a === void 0 ? void 0 : _a.svgSrc.baseState) !== null && _b !== void 0 ? _b : "" } })] }), (0,jsx_runtime_namespaceObject.jsx)("div", { className: FavoriteStoryListModal_favoriteStoryListModal_module["content"], children: (0,jsx_runtime_namespaceObject.jsx)("div", { className: FavoriteStoryListModal_favoriteStoryListModal_module["favorite-story-list"], children: (0,jsx_runtime_namespaceObject.jsx)(react_sdk_namespaceObject.FavoriteStoryList, { options: Object.assign(Object.assign(Object.assign({}, baseStoryListOptions), { sidePadding: 0 }), {
|
|
1567
|
+
direction: react_sdk_namespaceObject.StoriesListDirection.COLUMN,
|
|
1568
|
+
layout: { height: "auto" }
|
|
1569
|
+
}) }) }) }), (0,jsx_runtime_namespaceObject.jsx)("div", { className: FavoriteStoryListModal_favoriteStoryListModal_module["footer"] }), (0,jsx_runtime_namespaceObject.jsx)("div", { className: FavoriteStoryListModal_favoriteStoryListModal_module["bottom-offset"] })] }) })) : null;
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1572
|
+
;// CONCATENATED MODULE: external "react-dom"
|
|
1573
|
+
var external_react_dom_x = (y) => {
|
|
1574
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
1575
|
+
}
|
|
1576
|
+
var external_react_dom_y = (x) => (() => (x))
|
|
1577
|
+
const external_react_dom_namespaceObject = external_react_dom_x({ ["createPortal"]: () => (__WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__.createPortal) });
|
|
1578
|
+
;// CONCATENATED MODULE: ./src/appRuntime/hooks/useMountPointObserver.ts
|
|
1579
|
+
|
|
1580
|
+
const useMountPointObserver = (storyList) => {
|
|
1581
|
+
(0,external_react_namespaceObject.useEffect)(() => {
|
|
1582
|
+
const mountPoint = storyList.mountPoint;
|
|
1583
|
+
const handleDestruction = () => {
|
|
1584
|
+
console.warn(`[IAS]: The node has been removed from DOM. Unsafe destruction of story feed ${storyList.mountSelector}`);
|
|
1585
|
+
storyList.destroy();
|
|
1586
|
+
};
|
|
1587
|
+
if (!document.body.contains(mountPoint)) {
|
|
1588
|
+
handleDestruction();
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
const observer = new MutationObserver(() => {
|
|
1592
|
+
// Analog https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected
|
|
1593
|
+
if (!document.body.contains(mountPoint)) {
|
|
1594
|
+
handleDestruction();
|
|
1595
|
+
observer.disconnect();
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
1599
|
+
return () => {
|
|
1600
|
+
observer.disconnect();
|
|
1601
|
+
};
|
|
1602
|
+
}, [storyList]);
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1605
|
+
;// CONCATENATED MODULE: ./src/appRuntime/hooks/index.ts
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
;// CONCATENATED MODULE: ./src/appRuntime/StoryListWrapper.tsx
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
|
|
1614
|
+
var StoriesListEvents;
|
|
1615
|
+
(function (StoriesListEvents) {
|
|
1616
|
+
StoriesListEvents["START_LOADER"] = "startLoad";
|
|
1617
|
+
StoriesListEvents["END_LOADER"] = "endLoad";
|
|
1618
|
+
})(StoriesListEvents || (StoriesListEvents = {}));
|
|
1619
|
+
const StoryListWrapper = ({ storyList, onStoryCardClick, onFavoriteCardClick }) => {
|
|
1620
|
+
const [options, setOptions] = (0,external_react_namespaceObject.useState)(storyList.appearanceManager.storiesListOptions);
|
|
1621
|
+
const storyListApiRef = (0,external_react_namespaceObject.useRef)(null);
|
|
1622
|
+
useMountPointObserver(storyList);
|
|
1623
|
+
(0,external_react_namespaceObject.useEffect)(() => {
|
|
1624
|
+
storyList.api = storyListApiRef.current;
|
|
1625
|
+
}, []);
|
|
1626
|
+
(0,external_react_namespaceObject.useEffect)(() => {
|
|
1627
|
+
storyList.appearanceManager.on(react_sdk_namespaceObject.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS, setOptions);
|
|
1628
|
+
return () => {
|
|
1629
|
+
storyList.appearanceManager.off(react_sdk_namespaceObject.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS, setOptions);
|
|
1630
|
+
};
|
|
1631
|
+
}, [storyList.appearanceManager]);
|
|
1632
|
+
return (0,external_react_dom_namespaceObject.createPortal)((0,jsx_runtime_namespaceObject.jsx)(react_sdk_namespaceObject.StoryList, { ref: storyListApiRef, options: options, hasFavorite: storyList.appearanceManager.commonOptions.hasFavorite, testKey: storyList.testKey, useUgcCard: storyList.useUgcCard, feedSlug: storyList.feedSlug, onLoadStart: () => {
|
|
1633
|
+
storyList.emit(StoriesListEvents.START_LOADER);
|
|
1634
|
+
}, onLoadEnd: status => {
|
|
1635
|
+
storyList.emit(StoriesListEvents.END_LOADER, status);
|
|
1636
|
+
}, onUgcCardClick: () => {
|
|
1637
|
+
storyList.ugcCardClickHandler();
|
|
1638
|
+
}, onFavoriteCardClick: onFavoriteCardClick, onStoryCardClick: onStoryCardClick }), storyList.mountPoint);
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
;// CONCATENATED MODULE: ./src/appRuntime/UGCStoryListWrapper.tsx
|
|
1642
|
+
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
|
|
1647
|
+
var UGCStoryListWrapper_StoriesListEvents;
|
|
1648
|
+
(function (StoriesListEvents) {
|
|
1649
|
+
StoriesListEvents["START_LOADER"] = "startLoad";
|
|
1650
|
+
StoriesListEvents["END_LOADER"] = "endLoad";
|
|
1651
|
+
})(UGCStoryListWrapper_StoriesListEvents || (UGCStoryListWrapper_StoriesListEvents = {}));
|
|
1652
|
+
const UGCStoryListWrapper = ({ ugcStoryList, onStoryCardClick }) => {
|
|
1653
|
+
const [options, setOptions] = (0,external_react_namespaceObject.useState)(ugcStoryList.appearanceManager.storiesListOptions);
|
|
1654
|
+
const storyListApiRef = (0,external_react_namespaceObject.useRef)(null);
|
|
1655
|
+
useMountPointObserver(ugcStoryList);
|
|
1656
|
+
(0,external_react_namespaceObject.useEffect)(() => {
|
|
1657
|
+
ugcStoryList.api = storyListApiRef.current;
|
|
1658
|
+
}, []);
|
|
1659
|
+
(0,external_react_namespaceObject.useEffect)(() => {
|
|
1660
|
+
ugcStoryList.appearanceManager.on(react_sdk_namespaceObject.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS, setOptions);
|
|
1661
|
+
return () => {
|
|
1662
|
+
ugcStoryList.appearanceManager.off(react_sdk_namespaceObject.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS, setOptions);
|
|
1663
|
+
};
|
|
1664
|
+
}, [ugcStoryList.appearanceManager]);
|
|
1665
|
+
return (0,external_react_dom_namespaceObject.createPortal)((0,jsx_runtime_namespaceObject.jsx)(react_sdk_namespaceObject.UGCStoryList, { ref: storyListApiRef, options: options, filter: ugcStoryList.filter, testKey: ugcStoryList.testKey, useUgcCard: ugcStoryList.useUgcCard, onStoryCardClick: onStoryCardClick, onLoadStart: () => {
|
|
1666
|
+
ugcStoryList.emit(UGCStoryListWrapper_StoriesListEvents.START_LOADER);
|
|
1667
|
+
}, onLoadEnd: status => {
|
|
1668
|
+
ugcStoryList.emit(UGCStoryListWrapper_StoriesListEvents.END_LOADER, status);
|
|
1669
|
+
}, onUgcCardClick: () => {
|
|
1670
|
+
ugcStoryList.ugcCardClickHandler();
|
|
1671
|
+
} }), ugcStoryList.mountPoint);
|
|
1672
|
+
};
|
|
1673
|
+
|
|
1674
|
+
;// CONCATENATED MODULE: ./src/appRuntime/App.tsx
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
const App = (props) => {
|
|
1684
|
+
const [showFavoriteList, setShowFavoriteList] = (0,external_react_namespaceObject.useState)(false);
|
|
1685
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)(react_sdk_namespaceObject.IASContainer, { config: props.storyManagerConfigDto, storyReaderOptions: props.appearanceManager.storyReaderOptions, commonOptions: props.appearanceManager.commonOptions, gameReaderOptions: props.appearanceManager.gameReaderOptions, goodsWidgetOptions: props.appearanceManager.goodsWidgetOptions, children: [props.storyLists.map(storyList => {
|
|
1686
|
+
if (storyList instanceof UGCStoriesList)
|
|
1687
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(UGCStoryListWrapper, { ugcStoryList: storyList, onStoryCardClick: () => {
|
|
1688
|
+
props.onAppearanceManagerChange(storyList.appearanceManager);
|
|
1689
|
+
} }, storyList.mountSelector));
|
|
1690
|
+
if (storyList instanceof StoriesList)
|
|
1691
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(StoryListWrapper, { onFavoriteCardClick: () => {
|
|
1692
|
+
setShowFavoriteList(true);
|
|
1693
|
+
}, onStoryCardClick: () => {
|
|
1694
|
+
props.onAppearanceManagerChange(storyList.appearanceManager);
|
|
1695
|
+
}, storyList: storyList }, storyList.mountSelector));
|
|
1696
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(FavoriteStoryListModal, { open: showFavoriteList, onClose: () => setShowFavoriteList(false), options: props.appearanceManager.storyFavoriteReaderOptions, storyListOptions: props.appearanceManager.storiesListOptions })] }));
|
|
1697
|
+
};
|
|
1698
|
+
|
|
1699
|
+
;// CONCATENATED MODULE: ./src/appRuntime/appRuntime.tsx
|
|
1700
|
+
|
|
1701
|
+
|
|
1702
|
+
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
class AppRuntime {
|
|
1707
|
+
constructor(storyManager) {
|
|
1708
|
+
Object.defineProperty(this, "storyManager", {
|
|
1709
|
+
enumerable: true,
|
|
1710
|
+
configurable: true,
|
|
1711
|
+
writable: true,
|
|
1712
|
+
value: storyManager
|
|
1713
|
+
});
|
|
1714
|
+
Object.defineProperty(this, "root", {
|
|
1715
|
+
enumerable: true,
|
|
1716
|
+
configurable: true,
|
|
1717
|
+
writable: true,
|
|
1718
|
+
value: null
|
|
1719
|
+
});
|
|
1720
|
+
Object.defineProperty(this, "storyManagerConfigDto", {
|
|
1721
|
+
enumerable: true,
|
|
1722
|
+
configurable: true,
|
|
1723
|
+
writable: true,
|
|
1724
|
+
value: void 0
|
|
1725
|
+
});
|
|
1726
|
+
Object.defineProperty(this, "appearanceManager", {
|
|
1727
|
+
enumerable: true,
|
|
1728
|
+
configurable: true,
|
|
1729
|
+
writable: true,
|
|
1730
|
+
value: new react_sdk_namespaceObject.AppearanceManager()
|
|
1731
|
+
});
|
|
1732
|
+
Object.defineProperty(this, "rootElement", {
|
|
1733
|
+
enumerable: true,
|
|
1734
|
+
configurable: true,
|
|
1735
|
+
writable: true,
|
|
1736
|
+
value: null
|
|
1737
|
+
});
|
|
1738
|
+
Object.defineProperty(this, "storyListManager", {
|
|
1739
|
+
enumerable: true,
|
|
1740
|
+
configurable: true,
|
|
1741
|
+
writable: true,
|
|
1742
|
+
value: new StoryListManager()
|
|
1743
|
+
});
|
|
1744
|
+
this.createAppRoot();
|
|
1745
|
+
this.handleAppearanceManagerUpdate = this.handleAppearanceManagerUpdate.bind(this);
|
|
1746
|
+
this.setAppearanceManager = this.setAppearanceManager.bind(this);
|
|
1747
|
+
}
|
|
1748
|
+
async addStoryList(storyList) {
|
|
1749
|
+
try {
|
|
1750
|
+
this.storyListManager.addStoryList(storyList);
|
|
1751
|
+
await this.storyManager.waitStoryManagerConfig();
|
|
1752
|
+
this.render();
|
|
1753
|
+
}
|
|
1754
|
+
catch (error) {
|
|
1755
|
+
this.removeStoryList(storyList);
|
|
1756
|
+
throw error;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
removeStoryList(storyList) {
|
|
1760
|
+
this.storyListManager.removeStoryList(storyList);
|
|
1761
|
+
this.render();
|
|
1762
|
+
}
|
|
1763
|
+
setStoryManagerConfig(storyManagerConfigDto) {
|
|
1764
|
+
this.storyManagerConfigDto = Object.assign(Object.assign({}, this.storyManagerConfigDto), storyManagerConfigDto);
|
|
1765
|
+
this.render();
|
|
1766
|
+
}
|
|
1767
|
+
setAppearanceManager(appearanceManager) {
|
|
1768
|
+
assertAppearanceManagerIsObject(appearanceManager);
|
|
1769
|
+
this.unscubscribeToAppearanceManagerEvents();
|
|
1770
|
+
this.appearanceManager = appearanceManager;
|
|
1771
|
+
this.subscribeToAppearanceManagerEvents();
|
|
1772
|
+
this.render();
|
|
1773
|
+
}
|
|
1774
|
+
render() {
|
|
1775
|
+
var _a;
|
|
1776
|
+
(_a = this.root) === null || _a === void 0 ? void 0 : _a.render((0,jsx_runtime_namespaceObject.jsx)(App, { storyManagerConfigDto: this.storyManagerConfigDto, appearanceManager: this.appearanceManager, storyLists: this.storyListManager.storyLists.slice(), onAppearanceManagerChange: this.setAppearanceManager }));
|
|
1777
|
+
}
|
|
1778
|
+
destroy() {
|
|
1779
|
+
if (!this.rootElement || !this.root)
|
|
1780
|
+
return;
|
|
1781
|
+
this.storyListManager.destroy();
|
|
1782
|
+
this.unscubscribeToAppearanceManagerEvents();
|
|
1783
|
+
this.root.unmount();
|
|
1784
|
+
document.body.removeChild(this.rootElement);
|
|
1785
|
+
this.rootElement = null;
|
|
1786
|
+
this.root = null;
|
|
1787
|
+
}
|
|
1788
|
+
createAppRoot() {
|
|
1789
|
+
this.rootElement = document.createElement("div");
|
|
1790
|
+
this.rootElement.id = "ias-app";
|
|
1791
|
+
document.body.append(this.rootElement);
|
|
1792
|
+
this.root = (0,client_namespaceObject.createRoot)(this.rootElement);
|
|
1793
|
+
}
|
|
1794
|
+
subscribeToAppearanceManagerEvents() {
|
|
1795
|
+
this.appearanceManager.on(react_sdk_namespaceObject.AppearanceManagerEvents.UPDATE, this.handleAppearanceManagerUpdate);
|
|
1796
|
+
}
|
|
1797
|
+
unscubscribeToAppearanceManagerEvents() {
|
|
1798
|
+
this.appearanceManager.off(react_sdk_namespaceObject.AppearanceManagerEvents.UPDATE, this.handleAppearanceManagerUpdate);
|
|
1799
|
+
}
|
|
1800
|
+
handleAppearanceManagerUpdate() {
|
|
1801
|
+
this.render();
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
// EXTERNAL MODULE: ../../node_modules/lodash/isFunction.js
|
|
1806
|
+
var isFunction = __webpack_require__(655);
|
|
1807
|
+
var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction);
|
|
1808
|
+
;// CONCATENATED MODULE: ./src/sharePage/sharePageAdapter.ts
|
|
1809
|
+
|
|
1810
|
+
|
|
1811
|
+
|
|
1812
|
+
var SharePageEvents;
|
|
1813
|
+
(function (SharePageEvents) {
|
|
1814
|
+
SharePageEvents["START_LOADING"] = "startLoading";
|
|
1815
|
+
SharePageEvents["END_LOADING"] = "endLoading";
|
|
1816
|
+
SharePageEvents["CLOSE_STORY_READER"] = "closeStoryReader";
|
|
1817
|
+
})(SharePageEvents || (SharePageEvents = {}));
|
|
1818
|
+
class SharePageAdapter extends events.EventEmitter {
|
|
1819
|
+
constructor(storyId, appearanceManager, storyManager, app, options) {
|
|
1820
|
+
super();
|
|
1821
|
+
Object.defineProperty(this, "storyManager", {
|
|
1822
|
+
enumerable: true,
|
|
1823
|
+
configurable: true,
|
|
1824
|
+
writable: true,
|
|
1825
|
+
value: storyManager
|
|
1826
|
+
});
|
|
1827
|
+
Object.defineProperty(this, "app", {
|
|
1828
|
+
enumerable: true,
|
|
1829
|
+
configurable: true,
|
|
1830
|
+
writable: true,
|
|
1831
|
+
value: app
|
|
1832
|
+
});
|
|
1833
|
+
Object.defineProperty(this, "options", {
|
|
1834
|
+
enumerable: true,
|
|
1835
|
+
configurable: true,
|
|
1836
|
+
writable: true,
|
|
1837
|
+
value: options
|
|
1838
|
+
});
|
|
1839
|
+
assertAppearanceManagerIsObject(appearanceManager);
|
|
1840
|
+
this.handleCloseStoryReader = this.handleCloseStoryReader.bind(this);
|
|
1841
|
+
this.showSharePage(storyId, appearanceManager);
|
|
1842
|
+
}
|
|
1843
|
+
async showSharePage(storyId, appearanceManager) {
|
|
1844
|
+
try {
|
|
1845
|
+
this.app.setAppearanceManager(appearanceManager);
|
|
1846
|
+
this.handleStartLoad();
|
|
1847
|
+
await this.storyManager.showSharePage(storyId);
|
|
1848
|
+
this.storyManager.once("closeStoryReader", this.handleCloseStoryReader);
|
|
1849
|
+
this.handleEndLoad(true);
|
|
1850
|
+
}
|
|
1851
|
+
catch (error) {
|
|
1852
|
+
this.handleEndLoad(false);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
async closeStoryReader() {
|
|
1856
|
+
this.storyManager.closeStoryReader();
|
|
1857
|
+
}
|
|
1858
|
+
handleStartLoad() {
|
|
1859
|
+
setTimeout(() => {
|
|
1860
|
+
var _a;
|
|
1861
|
+
this.emit(SharePageEvents.START_LOADING);
|
|
1862
|
+
if (isFunction_default()((_a = this.options) === null || _a === void 0 ? void 0 : _a.handleStartLoad))
|
|
1863
|
+
this.options.handleStartLoad();
|
|
1864
|
+
});
|
|
1865
|
+
}
|
|
1866
|
+
handleEndLoad(result) {
|
|
1867
|
+
var _a;
|
|
1868
|
+
this.emit(SharePageEvents.END_LOADING, { result });
|
|
1869
|
+
if (isFunction_default()((_a = this.options) === null || _a === void 0 ? void 0 : _a.handleStopLoad))
|
|
1870
|
+
this.options.handleStopLoad(result);
|
|
1871
|
+
}
|
|
1872
|
+
handleCloseStoryReader() {
|
|
1873
|
+
var _a, _b, _c;
|
|
1874
|
+
if (isFunction_default()((_a = this.options) === null || _a === void 0 ? void 0 : _a.handleStoryReaderClose) ||
|
|
1875
|
+
this.listenerCount(SharePageEvents.CLOSE_STORY_READER) > 0) {
|
|
1876
|
+
try {
|
|
1877
|
+
if (isFunction_default()((_b = this.options) === null || _b === void 0 ? void 0 : _b.handleStoryReaderClose)) {
|
|
1878
|
+
(_c = this.options) === null || _c === void 0 ? void 0 : _c.handleStoryReaderClose();
|
|
1879
|
+
}
|
|
1880
|
+
this.emit(SharePageEvents.CLOSE_STORY_READER);
|
|
1881
|
+
}
|
|
1882
|
+
catch (e) {
|
|
1883
|
+
console.error(e);
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
else {
|
|
1887
|
+
const location = window.location;
|
|
1888
|
+
window.open(`${location.protocol}//${location.host}`, "_parent");
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
;// CONCATENATED MODULE: ./src/sharePage/index.ts
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+
;// CONCATENATED MODULE: ./src/stackedStoryList/StackedStoryList.ts
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
|
|
1900
|
+
class StackedStoryList extends events.EventEmitter {
|
|
1901
|
+
constructor(appearanceManager, storyManager, app, options) {
|
|
1902
|
+
super();
|
|
1903
|
+
Object.defineProperty(this, "appearanceManager", {
|
|
1904
|
+
enumerable: true,
|
|
1905
|
+
configurable: true,
|
|
1906
|
+
writable: true,
|
|
1907
|
+
value: appearanceManager
|
|
1908
|
+
});
|
|
1909
|
+
Object.defineProperty(this, "storyManager", {
|
|
1910
|
+
enumerable: true,
|
|
1911
|
+
configurable: true,
|
|
1912
|
+
writable: true,
|
|
1913
|
+
value: storyManager
|
|
1914
|
+
});
|
|
1915
|
+
Object.defineProperty(this, "app", {
|
|
1916
|
+
enumerable: true,
|
|
1917
|
+
configurable: true,
|
|
1918
|
+
writable: true,
|
|
1919
|
+
value: app
|
|
1920
|
+
});
|
|
1921
|
+
Object.defineProperty(this, "options", {
|
|
1922
|
+
enumerable: true,
|
|
1923
|
+
configurable: true,
|
|
1924
|
+
writable: true,
|
|
1925
|
+
value: options
|
|
1926
|
+
});
|
|
1927
|
+
Object.defineProperty(this, "stackedStoryListViewModel", {
|
|
1928
|
+
enumerable: true,
|
|
1929
|
+
configurable: true,
|
|
1930
|
+
writable: true,
|
|
1931
|
+
value: void 0
|
|
1932
|
+
});
|
|
1933
|
+
assertAppearanceManagerIsObject(appearanceManager);
|
|
1934
|
+
this.handleUpdate = this.handleUpdate.bind(this);
|
|
1935
|
+
this.stackedStoryListViewModel = new react_sdk_namespaceObject.StackedStoryListViewModel(this.options);
|
|
1936
|
+
this.stackedStoryListViewModel.on("update", this.handleUpdate);
|
|
1937
|
+
this.loadStories().catch(console.error);
|
|
1938
|
+
}
|
|
1939
|
+
get stories() {
|
|
1940
|
+
return this.stackedStoryListViewModel.stories;
|
|
1941
|
+
}
|
|
1942
|
+
get length() {
|
|
1943
|
+
return this.stackedStoryListViewModel.length;
|
|
1944
|
+
}
|
|
1945
|
+
get activeIndex() {
|
|
1946
|
+
return this.stackedStoryListViewModel.activeIndex;
|
|
1947
|
+
}
|
|
1948
|
+
get feedCoverSrc() {
|
|
1949
|
+
return this.stackedStoryListViewModel.feedCoverSrc;
|
|
1950
|
+
}
|
|
1951
|
+
get top() {
|
|
1952
|
+
return this.stackedStoryListViewModel.top;
|
|
1953
|
+
}
|
|
1954
|
+
async reload() {
|
|
1955
|
+
return this.stackedStoryListViewModel.reload();
|
|
1956
|
+
}
|
|
1957
|
+
destroy() {
|
|
1958
|
+
this.stackedStoryListViewModel.destroy();
|
|
1959
|
+
this.stackedStoryListViewModel.removeAllListeners();
|
|
1960
|
+
}
|
|
1961
|
+
showStory(story) {
|
|
1962
|
+
this.app.setAppearanceManager(this.appearanceManager);
|
|
1963
|
+
this.stackedStoryListViewModel.showStory(story);
|
|
1964
|
+
}
|
|
1965
|
+
on(eventName, listener) {
|
|
1966
|
+
if (eventName === "update") {
|
|
1967
|
+
return super.on(eventName, listener);
|
|
1968
|
+
}
|
|
1969
|
+
this.stackedStoryListViewModel.on(eventName, listener);
|
|
1970
|
+
return this;
|
|
1971
|
+
}
|
|
1972
|
+
once(eventName, listener) {
|
|
1973
|
+
this.stackedStoryListViewModel.once(eventName, listener);
|
|
1974
|
+
return this;
|
|
1975
|
+
}
|
|
1976
|
+
off(eventName, listener) {
|
|
1977
|
+
this.stackedStoryListViewModel.off(eventName, listener);
|
|
1978
|
+
return this;
|
|
1979
|
+
}
|
|
1980
|
+
handleUpdate(stackFeedStory) {
|
|
1981
|
+
this.emit("update", {
|
|
1982
|
+
id: stackFeedStory.id,
|
|
1983
|
+
title: stackFeedStory.title,
|
|
1984
|
+
titleColor: stackFeedStory.titleColor,
|
|
1985
|
+
hasAudio: stackFeedStory.hasAudio,
|
|
1986
|
+
hasSwipeUp: stackFeedStory.hasSwipeUp,
|
|
1987
|
+
isOpened: stackFeedStory.isOpened,
|
|
1988
|
+
deeplink: stackFeedStory.deeplink,
|
|
1989
|
+
gameInstanceId: stackFeedStory.gameInstanceId,
|
|
1990
|
+
hideInReader: stackFeedStory.hideInReader,
|
|
1991
|
+
hide_timeline: stackFeedStory.hideTimeline,
|
|
1992
|
+
cover: stackFeedStory.getCover(this.appearanceManager.storiesListOptions.card.coverQuality)
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
async loadStories() {
|
|
1996
|
+
await this.storyManager.waitStoryManagerConfig();
|
|
1997
|
+
this.stackedStoryListViewModel.loadStories();
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
;// CONCATENATED MODULE: ./src/stackedStoryList/index.ts
|
|
2002
|
+
|
|
2003
|
+
|
|
2004
|
+
;// CONCATENATED MODULE: ./src/storyManagerAdapter.ts
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
|
|
2008
|
+
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
const assertStoryManagerInstanceExist = () => {
|
|
2013
|
+
if (!StoryManagerAdapter.instance)
|
|
2014
|
+
throw new IasInAppStoryManagerReferenceError();
|
|
2015
|
+
};
|
|
2016
|
+
class StoryManagerAdapter {
|
|
2017
|
+
constructor(storyManagerConfigDto) {
|
|
2018
|
+
Object.defineProperty(this, "storyManagerConfigDto", {
|
|
2019
|
+
enumerable: true,
|
|
2020
|
+
configurable: true,
|
|
2021
|
+
writable: true,
|
|
2022
|
+
value: storyManagerConfigDto
|
|
2023
|
+
});
|
|
2024
|
+
Object.defineProperty(this, "app", {
|
|
2025
|
+
enumerable: true,
|
|
2026
|
+
configurable: true,
|
|
2027
|
+
writable: true,
|
|
2028
|
+
value: new AppRuntime(react_sdk_namespaceObject.storyManager)
|
|
2029
|
+
});
|
|
2030
|
+
Object.defineProperty(this, "StoriesList", {
|
|
2031
|
+
enumerable: true,
|
|
2032
|
+
configurable: true,
|
|
2033
|
+
writable: true,
|
|
2034
|
+
value: class extends StoriesList {
|
|
2035
|
+
constructor(mountSelector, appearanceManager, params) {
|
|
2036
|
+
assertStoryManagerInstanceExist();
|
|
2037
|
+
super(mountSelector, appearanceManager, StoryManagerAdapter.instance.app, params);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
});
|
|
2041
|
+
Object.defineProperty(this, "UGCStoriesList", {
|
|
2042
|
+
enumerable: true,
|
|
2043
|
+
configurable: true,
|
|
2044
|
+
writable: true,
|
|
2045
|
+
value: class extends UGCStoriesList {
|
|
2046
|
+
constructor(mountSelector, appearanceManager, params) {
|
|
2047
|
+
assertStoryManagerInstanceExist();
|
|
2048
|
+
super(mountSelector, appearanceManager, StoryManagerAdapter.instance.app, params);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
Object.defineProperty(this, "SharePage", {
|
|
2053
|
+
enumerable: true,
|
|
2054
|
+
configurable: true,
|
|
2055
|
+
writable: true,
|
|
2056
|
+
value: class extends SharePageAdapter {
|
|
2057
|
+
constructor(storyId, appearanceManager, options) {
|
|
2058
|
+
assertStoryManagerInstanceExist();
|
|
2059
|
+
super(storyId, appearanceManager, react_sdk_namespaceObject.storyManager, StoryManagerAdapter.instance.app, options);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
});
|
|
2063
|
+
Object.defineProperty(this, "StackedStoryList", {
|
|
2064
|
+
enumerable: true,
|
|
2065
|
+
configurable: true,
|
|
2066
|
+
writable: true,
|
|
2067
|
+
value: class extends StackedStoryList {
|
|
2068
|
+
constructor(appearanceManager, options) {
|
|
2069
|
+
assertStoryManagerInstanceExist();
|
|
2070
|
+
super(appearanceManager, react_sdk_namespaceObject.storyManager, StoryManagerAdapter.instance.app, options);
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2074
|
+
Object.defineProperty(this, "inAppMessaging", {
|
|
2075
|
+
enumerable: true,
|
|
2076
|
+
configurable: true,
|
|
2077
|
+
writable: true,
|
|
2078
|
+
value: react_sdk_namespaceObject.storyManager.inAppMessaging
|
|
2079
|
+
});
|
|
2080
|
+
if (StoryManagerAdapter.instance) {
|
|
2081
|
+
console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead");
|
|
2082
|
+
return StoryManagerAdapter.instance;
|
|
2083
|
+
}
|
|
2084
|
+
react_sdk_namespaceObject.storyManager.setUserAgent(`InAppStoryJSSDK/${this.sdkVersionCode}`);
|
|
2085
|
+
StoryManagerAdapter.instance = this;
|
|
2086
|
+
this.app.setStoryManagerConfig(storyManagerConfigDto);
|
|
2087
|
+
return StoryManagerAdapter.instance;
|
|
2088
|
+
}
|
|
2089
|
+
get sdkVersionName() {
|
|
2090
|
+
const sdkVersionName = "3.6.4";
|
|
2091
|
+
return sdkVersionName || "0.0.0";
|
|
2092
|
+
}
|
|
2093
|
+
get sdkVersionCode() {
|
|
2094
|
+
const sdkVersionCode = 30604;
|
|
2095
|
+
return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
2096
|
+
}
|
|
2097
|
+
set storyLinkClickHandler(callback) {
|
|
2098
|
+
react_sdk_namespaceObject.storyManager.storyLinkClickHandler = callback;
|
|
2099
|
+
}
|
|
2100
|
+
static getInstance() {
|
|
2101
|
+
if (!StoryManagerAdapter.instance) {
|
|
2102
|
+
return null;
|
|
2103
|
+
}
|
|
2104
|
+
return StoryManagerAdapter.instance;
|
|
2105
|
+
}
|
|
2106
|
+
static use(plugin, options) {
|
|
2107
|
+
react_sdk_namespaceObject.StoryManager.use(plugin, options);
|
|
2108
|
+
}
|
|
2109
|
+
getConfig() {
|
|
2110
|
+
return react_sdk_namespaceObject.storyManager.getConfig();
|
|
2111
|
+
}
|
|
2112
|
+
async showOnboardingStories(appearanceManager, options) {
|
|
2113
|
+
assertStoryManagerInstanceExist();
|
|
2114
|
+
this.app.setAppearanceManager(appearanceManager);
|
|
2115
|
+
return react_sdk_namespaceObject.storyManager.showOnboardingStories(options);
|
|
2116
|
+
}
|
|
2117
|
+
async showStory(storyId, appearanceManager) {
|
|
2118
|
+
assertStoryManagerInstanceExist();
|
|
2119
|
+
this.app.setAppearanceManager(appearanceManager);
|
|
2120
|
+
await react_sdk_namespaceObject.storyManager.showStory(storyId);
|
|
2121
|
+
}
|
|
2122
|
+
async showStoryOnce(storyId, appearanceManager) {
|
|
2123
|
+
assertStoryManagerInstanceExist();
|
|
2124
|
+
this.app.setAppearanceManager(appearanceManager);
|
|
2125
|
+
return react_sdk_namespaceObject.storyManager.showStoryOnce(storyId);
|
|
2126
|
+
}
|
|
2127
|
+
async showSharePage(storyId, appearanceManager) {
|
|
2128
|
+
assertStoryManagerInstanceExist();
|
|
2129
|
+
this.app.setAppearanceManager(appearanceManager);
|
|
2130
|
+
return react_sdk_namespaceObject.storyManager.showSharePage(storyId);
|
|
2131
|
+
}
|
|
2132
|
+
closeAllReaders() {
|
|
2133
|
+
react_sdk_namespaceObject.storyManager.closeAllReaders();
|
|
2134
|
+
}
|
|
2135
|
+
async openGame(gameInstanceId, appearanceManager, gameOptions = {}) {
|
|
2136
|
+
assertStoryManagerInstanceExist();
|
|
2137
|
+
this.app.setAppearanceManager(appearanceManager);
|
|
2138
|
+
return react_sdk_namespaceObject.storyManager.openGame(gameInstanceId, gameOptions);
|
|
2139
|
+
}
|
|
2140
|
+
async closeGame() {
|
|
2141
|
+
return react_sdk_namespaceObject.storyManager.closeGame();
|
|
2142
|
+
}
|
|
2143
|
+
async closeStoryReader() {
|
|
2144
|
+
return react_sdk_namespaceObject.storyManager.closeStoryReader();
|
|
2145
|
+
}
|
|
2146
|
+
getUgcEditorConfig() {
|
|
2147
|
+
return react_sdk_namespaceObject.storyManager.getUgcEditorConfig();
|
|
2148
|
+
}
|
|
2149
|
+
closeGoodsWidget() {
|
|
2150
|
+
react_sdk_namespaceObject.storyManager.closeGoodsWidget();
|
|
2151
|
+
}
|
|
2152
|
+
setLang(lang) {
|
|
2153
|
+
this.storyManagerConfigDto.lang = lang;
|
|
2154
|
+
this.app.setStoryManagerConfig(this.storyManagerConfigDto);
|
|
2155
|
+
}
|
|
2156
|
+
getNonce() {
|
|
2157
|
+
return react_sdk_namespaceObject.storyManager.getNonce();
|
|
2158
|
+
}
|
|
2159
|
+
async setUserId(userId, sign) {
|
|
2160
|
+
assertStoryManagerInstanceExist();
|
|
2161
|
+
this.storyManagerConfigDto.userId = userId;
|
|
2162
|
+
this.storyManagerConfigDto.userIdSign = sign;
|
|
2163
|
+
this.app.setStoryManagerConfig(this.storyManagerConfigDto);
|
|
2164
|
+
}
|
|
2165
|
+
async userLogoug() {
|
|
2166
|
+
return this.setUserId("");
|
|
2167
|
+
}
|
|
2168
|
+
setTags(tags) {
|
|
2169
|
+
assertStoryManagerInstanceExist();
|
|
2170
|
+
this.storyManagerConfigDto.tags = tags;
|
|
2171
|
+
this.app.setStoryManagerConfig(this.storyManagerConfigDto);
|
|
2172
|
+
}
|
|
2173
|
+
setPlaceholders(placeholders) {
|
|
2174
|
+
assertStoryManagerInstanceExist();
|
|
2175
|
+
this.storyManagerConfigDto.placeholders = placeholders;
|
|
2176
|
+
this.app.setStoryManagerConfig(this.storyManagerConfigDto);
|
|
2177
|
+
}
|
|
2178
|
+
setImagePlaceholders(imagePlaceholders) {
|
|
2179
|
+
assertStoryManagerInstanceExist();
|
|
2180
|
+
this.storyManagerConfigDto.imagePlaceholders = imagePlaceholders;
|
|
2181
|
+
this.app.setStoryManagerConfig(this.storyManagerConfigDto);
|
|
2182
|
+
}
|
|
2183
|
+
on(eventName, listener) {
|
|
2184
|
+
react_sdk_namespaceObject.storyManager.on(eventName, listener);
|
|
2185
|
+
return this;
|
|
2186
|
+
}
|
|
2187
|
+
once(eventName, listener) {
|
|
2188
|
+
react_sdk_namespaceObject.storyManager.once(eventName, listener);
|
|
2189
|
+
return this;
|
|
2190
|
+
}
|
|
2191
|
+
off(eventName, listener) {
|
|
2192
|
+
react_sdk_namespaceObject.storyManager.off(eventName, listener);
|
|
2193
|
+
return this;
|
|
2194
|
+
}
|
|
2195
|
+
destroy() {
|
|
2196
|
+
if (StoryManagerAdapter.instance == null)
|
|
2197
|
+
return;
|
|
2198
|
+
//@ts-ignore
|
|
2199
|
+
StoryManagerAdapter.instance = null;
|
|
2200
|
+
this.closeAllReaders();
|
|
2201
|
+
this.app.destroy();
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
;// CONCATENATED MODULE: ./src/index.ts
|
|
2206
|
+
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
})();
|
|
2210
|
+
|
|
2211
|
+
var __webpack_exports__AppearanceManager = __webpack_exports__.KL;
|
|
2212
|
+
var __webpack_exports__CloseButtonPosition = __webpack_exports__.Yb;
|
|
2213
|
+
var __webpack_exports__GoodsWidgetRenderingType = __webpack_exports__.lV;
|
|
2214
|
+
var __webpack_exports__IamCheckDisplayTimeRangeError = __webpack_exports__.IV;
|
|
2215
|
+
var __webpack_exports__IamFrequencyLimitError = __webpack_exports__.tP;
|
|
2216
|
+
var __webpack_exports__IamMessageLimitExceededError = __webpack_exports__.h8;
|
|
2217
|
+
var __webpack_exports__IamMessageOpenError = __webpack_exports__.Xz;
|
|
2218
|
+
var __webpack_exports__IamNotFoundByEventError = __webpack_exports__.wS;
|
|
2219
|
+
var __webpack_exports__IamNotFoundByIdError = __webpack_exports__.VS;
|
|
2220
|
+
var __webpack_exports__IamNotFoundLimitError = __webpack_exports__.oC;
|
|
2221
|
+
var __webpack_exports__IamOtherReaderIsOpenError = __webpack_exports__.L8;
|
|
2222
|
+
var __webpack_exports__IamShowOnlyIfLoadedError = __webpack_exports__.NL;
|
|
2223
|
+
var __webpack_exports__IasNetworkError = __webpack_exports__.Ez;
|
|
2224
|
+
var __webpack_exports__InAppStoryManager = __webpack_exports__.Hp;
|
|
2225
|
+
var __webpack_exports__StoriesListCardCoverQuality = __webpack_exports__.SK;
|
|
2226
|
+
var __webpack_exports__StoriesListCardTitlePosition = __webpack_exports__.tI;
|
|
2227
|
+
var __webpack_exports__StoriesListCardTitleTextAlign = __webpack_exports__.Uy;
|
|
2228
|
+
var __webpack_exports__StoriesListCardViewVariant = __webpack_exports__.SP;
|
|
2229
|
+
var __webpack_exports__StoriesListDirection = __webpack_exports__.Jj;
|
|
2230
|
+
var __webpack_exports__StoryReaderSwipeStyle = __webpack_exports__.qz;
|
|
2231
|
+
export { __webpack_exports__AppearanceManager as AppearanceManager, __webpack_exports__CloseButtonPosition as CloseButtonPosition, __webpack_exports__GoodsWidgetRenderingType as GoodsWidgetRenderingType, __webpack_exports__IamCheckDisplayTimeRangeError as IamCheckDisplayTimeRangeError, __webpack_exports__IamFrequencyLimitError as IamFrequencyLimitError, __webpack_exports__IamMessageLimitExceededError as IamMessageLimitExceededError, __webpack_exports__IamMessageOpenError as IamMessageOpenError, __webpack_exports__IamNotFoundByEventError as IamNotFoundByEventError, __webpack_exports__IamNotFoundByIdError as IamNotFoundByIdError, __webpack_exports__IamNotFoundLimitError as IamNotFoundLimitError, __webpack_exports__IamOtherReaderIsOpenError as IamOtherReaderIsOpenError, __webpack_exports__IamShowOnlyIfLoadedError as IamShowOnlyIfLoadedError, __webpack_exports__IasNetworkError as IasNetworkError, __webpack_exports__InAppStoryManager as InAppStoryManager, __webpack_exports__StoriesListCardCoverQuality as StoriesListCardCoverQuality, __webpack_exports__StoriesListCardTitlePosition as StoriesListCardTitlePosition, __webpack_exports__StoriesListCardTitleTextAlign as StoriesListCardTitleTextAlign, __webpack_exports__StoriesListCardViewVariant as StoriesListCardViewVariant, __webpack_exports__StoriesListDirection as StoriesListDirection, __webpack_exports__StoryReaderSwipeStyle as StoryReaderSwipeStyle };
|
|
2232
|
+
|
|
2233
|
+
//# sourceMappingURL=index.esm.mjs.map
|