@inappstory/js-sdk 3.6.2 → 3.7.0-rc.0
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 +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/appearance-manager/appearanceCommon.d.ts +69 -3
- package/dist/types/appearance-manager/appearanceManager.d.ts +69 -1
- package/dist/types/appearance-manager/gameReader.d.ts +91 -15
- package/dist/types/appearance-manager/goodsWidget.d.ts +98 -17
- package/dist/types/appearance-manager/sharePanel.d.ts +129 -2
- package/dist/types/appearance-manager/storiesList.d.ts +303 -5
- package/dist/types/appearance-manager/storyFavoriteReader.d.ts +34 -0
- package/dist/types/appearance-manager/storyReader.d.ts +260 -0
- package/dist/types/in-app-messaging/iamErrors.d.ts +49 -45
- package/dist/types/in-app-messaging/inAppMessaging.d.ts +166 -0
- package/dist/types/inAppStoryManager.d.ts +187 -3
- package/dist/types/share-page/sharePage.d.ts +4 -0
- package/dist/types/story-list/StoryList.d.ts +30 -0
- package/dist/types/story-list/UGCStoryList.d.ts +30 -0
- package/dist/types/story-list/storyListLoadStatus.ts +46 -9
- package/package.json +6 -2
- package/plugins/banners/index.esm.mjs +1 -0
- package/plugins/banners/package.json +24 -0
- package/plugins/banners/types/banner.d.ts +197 -0
- package/plugins/banners/types/bannerPlace.d.ts +186 -0
- package/plugins/banners/types/bannerPlaceAppearance.d.ts +32 -0
- package/plugins/banners/types/iasBannerPlace.d.ts +77 -0
- package/plugins/banners/types/iasBannerPreview.d.ts +58 -0
- package/plugins/banners/types/iasBannersProvider.d.ts +52 -0
- package/plugins/banners/types/index.d.ts +29 -0
- package/plugins/dotLottie/iasDotLottiePlugin.umd.js +1 -1
- package/plugins/videoOnDemand/iasVideoOnDemandPlugin.umd.js +1 -1
- package/dist/types/appearance-manager/storyReader.ts +0 -73
package/dist/index.esm.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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.2"}get sdkVersionCode(){return parseInt(30602)}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 e from"@inappstory/react-sdk";import*as t from"react/jsx-runtime";import*as r from"react-dom/client";import*as n from"react";import*as o from"react-dom";var a={432:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(935),o=r.n(n)()((function(e){return e[1]}));o.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}}",""]),o.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=o},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,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);n&&o[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,n=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 o=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,n){function o(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),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,o,{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,n){var o,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]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=l(e))>0&&i.length>o&&!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 n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function p(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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}(o):f(o,o.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),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.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 o(a){n.once&&e.removeEventListener(t,o),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||o(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||o(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 o="error"===e,a=this._events;if(void 0!==a)o=o&&void 0===a.error;else if(!o)return!1;if(o){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)n(l,this,t);else{var c=l.length,d=f(l,c);for(r=0;r<c;++r)n(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,n,o,a,i;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;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 o,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(o=a[n])&&this.removeAllListeners(o);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(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);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 n=r(942).Symbol;e.exports=n},379:(e,t,r)=>{var n=r(650),o=r(870),a=r(5),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},870:(e,t,r)=>{var n=r(650),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[s]=r:delete e[s]),o}},5:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},942:(e,t,r)=>{var n=r(967),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},655:(e,t,r)=>{var n=r(379),o=r(580);e.exports=function(e){if(!o(e))return!1;var t=n(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 n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},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={},n=[],o=0;o<e.length;o++){var a=e[o],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}),n.push(d)}return n}function c(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=r.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[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,n){var o=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var a=document.createTextNode(o),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 n=r.css,o=r.media,a=r.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var f=null,g=0;function y(e,t){var r,n,o;if(t.singleton){var a=g++;r=f||(f=c(t)),n=p.bind(null,r,a,!1),o=p.bind(null,r,a,!0)}else r=c(t),n=h.bind(null,r,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var o=s(r[n]);i[o].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:()=>V,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,StoryReaderSwipeStyle:()=>e.StoryReaderSwipeStyle,UGCFeedSlug:()=>e.UGCFeedSlug,UGCStoryList:()=>e.UGCStoryList,__IAS_INTERNAL_API__:()=>e.__IAS_INTERNAL_API__,storyManager:()=>e.storyManager});class i extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`),this.name="IasAppearanceManagerTypeofError"}}const c=e=>{if(null==e||"object"!=typeof e)throw new i(null==e?"null":typeof e)};class d extends Error{constructor(){super("[IAS]: The <StoryManager> instance has been destroyed, you must create a new instance"),this.name="IasInAppStoryManagerReferenceError"}}class u extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}var p=s(46);class h extends p.EventEmitter{constructor(e,t){super(),Object.defineProperty(this,"_mountSelector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._mountPoint=this.getMountPoint(e),this.app.addItem(this).catch(console.error)}get mountPoint(){return this._mountPoint}get mountSelector(){return this._mountSelector}destroy(){this.app.removeItem(this)}getMountPoint(e){const t=document.querySelector(e);if(!t)throw new u(e);return t}}class f extends h{constructor(e,t,r,n){super(e,r),Object.defineProperty(this,"_appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_ugcCardClickHandler",{enumerable:!0,configurable:!0,writable:!0,value:()=>{}}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c(t)}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()}}class g extends f{constructor(e,t,r,n){super(e,t,r,{feed:a.UGCFeedSlug,testKey:null==n?void 0:n.testKey,useUgcCard:null==n?void 0:n.useUgcCard}),Object.defineProperty(this,"ugcParams",{enumerable:!0,configurable:!0,writable:!0,value:n}),c(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 m=(e=>{var t={};return s.d(t,e),t})({createRoot:()=>r.createRoot});const v=(e=>{var t={};return s.d(t,e),t})({useEffect:()=>n.useEffect,useLayoutEffect:()=>n.useLayoutEffect,useRef:()=>n.useRef,useState:()=>n.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:n})=>{var o,i;(0,v.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,n,o;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!==(o=null===(n=t.bottomOffset)||void 0===n?void 0:n.toString())&&void 0!==o?o:"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(),n()},className:C["header__close-btn"],style:(()=>{var e;const r="start"===t.closeButtonPosition||"left"===t.closeButtonPosition,n=(null===(e=a.storyManager.getConfig())||void 0===e?void 0:e.dir)===w.LTR;return{[r&&n||!r&&!n?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:null!==(i=null===(o=t.closeButton)||void 0===o?void 0:o.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:()=>o.createPortal}),O=e=>{(0,v.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 n=new MutationObserver((()=>{document.body.contains(t)||(r(),n.disconnect())}));return n.observe(document.body,{childList:!0,subtree:!0}),()=>{n.disconnect()}}),[e])};var I;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(I||(I={}));const A=({storyList:e,onStoryCardClick:t,onFavoriteCardClick:r})=>{const[n,o]=(0,v.useState)(e.appearanceManager.storiesListOptions),i=(0,v.useRef)(null);return O(e),(0,v.useEffect)((()=>{e.api=i.current}),[]),(0,v.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.StoryList,{ref:i,options:n,hasFavorite:e.appearanceManager.commonOptions.hasFavorite,testKey:e.testKey,useUgcCard:e.useUgcCard,feedSlug:e.feedSlug,onLoadStart:()=>{e.emit(I.START_LOADER)},onLoadEnd:t=>{e.emit(I.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()},onFavoriteCardClick:r,onStoryCardClick:t}),e.mountPoint)};var j;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(j||(j={}));const _=({ugcStoryList:e,onStoryCardClick:t})=>{const[r,n]=(0,v.useState)(e.appearanceManager.storiesListOptions),o=(0,v.useRef)(null);return O(e),(0,v.useEffect)((()=>{e.api=o.current}),[]),(0,v.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.UGCStoryList,{ref:o,options:r,filter:e.filter,testKey:e.testKey,useUgcCard:e.useUgcCard,onStoryCardClick:t,onLoadStart:()=>{e.emit(j.START_LOADER)},onLoadEnd:t=>{e.emit(j.END_LOADER,t)},onUgcCardClick:()=>{e.ugcCardClickHandler()}}),e.mountPoint)},T=e=>{const[t,r]=(0,v.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.items.map((t=>t instanceof g?(0,y.jsx)(_,{ugcStoryList:t,onStoryCardClick:()=>{e.onAppearanceManagerChange(t.appearanceManager)}},t.mountSelector):t instanceof f?(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(){Object.defineProperty(this,"_items",{enumerable:!0,configurable:!0,writable:!0,value:[]})}get items(){return this._items}addItem(e){this._items.push(e)}removeItem(e){const t=this._items.findIndex((t=>t===e));-1!==t&&this._items.splice(t,1)}destroy(){this._items=[]}}class R{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,"appItemManager",{enumerable:!0,configurable:!0,writable:!0,value:new P}),this.createAppRoot(),this.handleAppearanceManagerUpdate=this.handleAppearanceManagerUpdate.bind(this),this.setAppearanceManager=this.setAppearanceManager.bind(this)}async addItem(e){try{this.appItemManager.addItem(e),await this.storyManager.waitStoryManagerConfig(),this.render()}catch(t){throw this.removeItem(e),t}}async removeItem(e){this.appItemManager.removeItem(e),this.render()}setStoryManagerConfig(e){this.storyManagerConfigDto=Object.assign(Object.assign({},this.storyManagerConfigDto),e),this.render()}setAppearanceManager(e){c(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)(T,{storyManagerConfigDto:this.storyManagerConfigDto,appearanceManager:this.appearanceManager,items:this.appItemManager.items.slice(),onAppearanceManagerChange:this.setAppearanceManager}))}destroy(){this.rootElement&&this.root&&(this.appItemManager.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,m.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,N=s(655),D=s.n(N);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(k||(k={}));class F extends p.EventEmitter{constructor(e,t,r,n,o){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:o}),c(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 U extends p.EventEmitter{constructor(e,t,r,n){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:n}),Object.defineProperty(this,"stackedStoryListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c(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 H=()=>{if(!V.instance)throw new d};class V{constructor(e){return Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"__IAS_INTERNAL_API__",{enumerable:!0,configurable:!0,writable:!0,value:a.__IAS_INTERNAL_API__}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new R(a.storyManager)}),Object.defineProperty(this,"StoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends f{constructor(e,t,r){H(),super(e,t,V.instance.app,r)}}}),Object.defineProperty(this,"UGCStoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends g{constructor(e,t,r){H(),super(e,t,V.instance.app,r)}}}),Object.defineProperty(this,"SharePage",{enumerable:!0,configurable:!0,writable:!0,value:class extends F{constructor(e,t,r){H(),super(e,t,a.storyManager,V.instance.app,r)}}}),Object.defineProperty(this,"StackedStoryList",{enumerable:!0,configurable:!0,writable:!0,value:class extends U{constructor(e,t){H(),super(e,a.storyManager,V.instance.app,t)}}}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:a.storyManager.inAppMessaging}),V.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),V.instance):(a.storyManager.setUserAgent(`InAppStoryJSSDK/${this.sdkVersionCode}`),V.instance=this,this.app.setStoryManagerConfig(e),V.instance)}get sdkVersionName(){return"3.7.0-rc.0"}get sdkVersionCode(){return parseInt(30700)}set storyLinkClickHandler(e){a.storyManager.storyLinkClickHandler=e}static getInstance(){return V.instance?V.instance:null}static use(e,t){e.install({INTERNAL_API:a.__IAS_INTERNAL_API__,HOST:V},t)}getConfig(){return a.storyManager.getConfig()}async showOnboardingStories(e,t){return H(),this.app.setAppearanceManager(e),a.storyManager.showOnboardingStories(t)}async showStory(e,t){H(),this.app.setAppearanceManager(t),await a.storyManager.showStory(e)}async showStoryOnce(e,t){return H(),this.app.setAppearanceManager(t),a.storyManager.showStoryOnce(e)}async showSharePage(e,t){return H(),this.app.setAppearanceManager(t),a.storyManager.showSharePage(e)}closeAllReaders(){a.storyManager.closeAllReaders()}async openGame(e,t,r={}){return H(),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){H(),this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async userLogoug(){return this.setUserId("")}setTags(e){H(),this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){H(),this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){H(),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!=V.instance&&(V.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,m=l.VS,v=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,I=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,m as IamNotFoundByIdError,v 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,I as StoryReaderSwipeStyle};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["@inappstory/react-sdk","react/jsx-runtime","react-dom/client","react","react-dom"],t);else{var r="object"==typeof exports?t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):t(e["@inappstory/react-sdk"],e["react/jsx-runtime"],e["react-dom/client"],e.react,e["react-dom"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o)=>(()=>{var i={432:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(935),o=r.n(n)()((function(e){return e[1]}));o.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}}",""]),o.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 i=o},935:e=>{"use strict";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,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&o[c[0]]||(r&&(c[2]?c[2]="".concat(r," and ").concat(c[2]):c[2]=r),t.push(c))}},t}},46:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=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 o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}g(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,a,l;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=a.length,l=d,console&&console.warn&&console.warn(l)}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 n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function p(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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}(o):h(o,o.length)}function f(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 h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.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 o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.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},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(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},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,d=h(c,l);for(r=0;r<l;++r)n(d[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;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 o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);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(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},650:(e,t,r)=>{var n=r(942).Symbol;e.exports=n},379:(e,t,r)=>{var n=r(650),o=r(870),i=r(5),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},870:(e,t,r)=>{var n=r(650),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},5:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},942:(e,t,r)=>{var n=r(967),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},655:(e,t,r)=>{var n=r(379),o=r(580);e.exports=function(e){if(!o(e))return!1;var t=n(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)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=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]}}(),a=[];function s(e){for(var t=-1,r=0;r<a.length;r++)if(a[r].identifier===e){t=r;break}return t}function c(e,t){for(var r={},n=[],o=0;o<e.length;o++){var i=e[o],c=t.base?i[0]+t.base:i[0],l=r[c]||0,d="".concat(c," ").concat(l);r[c]=l+1;var u=s(d),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(a[u].references++,a[u].updater(p)):a.push({identifier:d,updater:y(p,t),references:1}),n.push(d)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=r.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.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,n){var o=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t,r){var n=r.css,o=r.media,i=r.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var h=null,g=0;function y(e,t){var r,n,o;if(t.singleton){var i=g++;r=h||(h=l(t)),n=p.bind(null,r,i,!1),o=p.bind(null,r,i,!0)}else r=l(t),n=f.bind(null,r,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var r=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var o=s(r[n]);a[o].references--}for(var i=c(e,t),l=0;l<r.length;l++){var d=s(r[l]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}r=i}}}},494:t=>{"use strict";t.exports=e},155:e=>{"use strict";e.exports=n},514:e=>{"use strict";e.exports=o},236:e=>{"use strict";e.exports=r},272:e=>{"use strict";e.exports=t}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={id:e,exports:{}};return i[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.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0;var c={};return(()=>{"use strict";s.r(c),s.d(c,{AppearanceManager:()=>e.AppearanceManager,CloseButtonPosition:()=>e.CloseButtonPosition,GoodsWidgetRenderingType:()=>e.GoodsWidgetRenderingType,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,InAppStoryManager:()=>R,StoriesListCardCoverQuality:()=>e.StoriesListCardCoverQuality,StoriesListCardTitlePosition:()=>e.StoriesListCardTitlePosition,StoriesListCardTitleTextAlign:()=>e.StoriesListCardTitleTextAlign,StoriesListCardViewVariant:()=>e.StoriesListCardViewVariant,StoriesListDirection:()=>e.StoriesListDirection,StoryReaderSwipeStyle:()=>e.StoryReaderSwipeStyle});var e=s(494),t=s(46);class r extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`),this.name="IasAppearanceManagerTypeofError"}}const n=e=>{if(null==e||"object"!=typeof e)throw new r(null==e?"null":typeof e)};class o extends Error{constructor(){super("[IAS]: The <StoryManager> instance has been destroyed, you must create a new instance"),this.name="IasInAppStoryManagerReferenceError"}}class i extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}class a extends t.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}),n(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 e.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 i(e);return t}}class l{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 d extends a{constructor(t,r,o,i){super(t,r,o,{feed:e.UGCFeedSlug,testKey:null==i?void 0:i.testKey,useUgcCard:null==i?void 0:i.useUgcCard}),Object.defineProperty(this,"ugcParams",{enumerable:!0,configurable:!0,writable:!0,value:i}),n(r)}get type(){return e.StoryFeedType.UGC}get filter(){var e;return null===(e=this.ugcParams)||void 0===e?void 0:e.filter}}var u=s(272),p=s(236),f=s(155),h=s(591),g=s.n(h),y=s(432),v={insert:"head",singleton:!1};g()(y.A,v);const m=y.A.locals||{};var b;!function(e){e.LTR="ltr",e.RTL="rtl"}(b||(b={}));const S=({open:t,options:r,storyListOptions:n,onClose:o})=>{var i,a;(0,f.useLayoutEffect)((()=>{if(!t)return;const e=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=e}}),[t]);return t?(0,u.jsx)("div",{className:m["favorite-story-list-modal"],style:(()=>{var e,t,n,o;return{"--storiesFavoriteTitleColor":r.title.color,"--storiesFavoriteTitleFontFamily":"InternalPrimaryFont","--storiesFavoriteTitleFont":r.title.font,"--storiesFavoriteTitleBackgroundColor":r.title.backgroundColor,"--storiesFavoriteHeaderTopOffset":parseFloat(null!==(t=null===(e=r.headerTopOffset)||void 0===e?void 0:e.toString())&&void 0!==t?t:"0")+"px","--storiesFavoriteBottomOffset":parseFloat(null!==(o=null===(n=r.bottomOffset)||void 0===n?void 0:n.toString())&&void 0!==o?o:"0")+"px","--storiesFavoriteBackgroundColor":r.backgroundColor}})(),children:(0,u.jsxs)("div",{className:m.container,children:[(0,u.jsxs)("div",{className:m.header,children:[(0,u.jsx)("p",{className:m.title,children:r.title.content}),(0,u.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),o()},className:m["header__close-btn"],style:(()=>{var t;const n="start"===r.closeButtonPosition||"left"===r.closeButtonPosition,o=(null===(t=e.storyManager.getConfig())||void 0===t?void 0:t.dir)===b.LTR;return{[n&&o||!n&&!o?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:null!==(a=null===(i=r.closeButton)||void 0===i?void 0:i.svgSrc.baseState)&&void 0!==a?a:""}})]}),(0,u.jsx)("div",{className:m.content,children:(0,u.jsx)("div",{className:m["favorite-story-list"],children:(0,u.jsx)(e.FavoriteStoryList,{options:Object.assign(Object.assign(Object.assign({},n),{sidePadding:0}),{direction:e.StoriesListDirection.COLUMN,layout:{height:"auto"}})})})}),(0,u.jsx)("div",{className:m.footer}),(0,u.jsx)("div",{className:m["bottom-offset"]})]})}):null};var M=s(514);const L=e=>{(0,f.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 n=new MutationObserver((()=>{document.body.contains(t)||(r(),n.disconnect())}));return n.observe(document.body,{childList:!0,subtree:!0}),()=>{n.disconnect()}}),[e])};var w;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(w||(w={}));const x=({storyList:t,onStoryCardClick:r,onFavoriteCardClick:n})=>{const[o,i]=(0,f.useState)(t.appearanceManager.storiesListOptions),a=(0,f.useRef)(null);return L(t),(0,f.useEffect)((()=>{t.api=a.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,i),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,i)})),[t.appearanceManager]),(0,M.createPortal)((0,u.jsx)(e.StoryList,{ref:a,options:o,hasFavorite:t.appearanceManager.commonOptions.hasFavorite,testKey:t.testKey,useUgcCard:t.useUgcCard,feedSlug:t.feedSlug,onLoadStart:()=>{t.emit(w.START_LOADER)},onLoadEnd:e=>{t.emit(w.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()},onFavoriteCardClick:n,onStoryCardClick:r}),t.mountPoint)};var C;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(C||(C={}));const O=({ugcStoryList:t,onStoryCardClick:r})=>{const[n,o]=(0,f.useState)(t.appearanceManager.storiesListOptions),i=(0,f.useRef)(null);return L(t),(0,f.useEffect)((()=>{t.api=i.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o)})),[t.appearanceManager]),(0,M.createPortal)((0,u.jsx)(e.UGCStoryList,{ref:i,options:n,filter:t.filter,testKey:t.testKey,useUgcCard:t.useUgcCard,onStoryCardClick:r,onLoadStart:()=>{t.emit(C.START_LOADER)},onLoadEnd:e=>{t.emit(C.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()}}),t.mountPoint)},E=t=>{const[r,n]=(0,f.useState)(!1);return(0,u.jsxs)(e.IASContainer,{config:t.storyManagerConfigDto,storyReaderOptions:t.appearanceManager.storyReaderOptions,commonOptions:t.appearanceManager.commonOptions,gameReaderOptions:t.appearanceManager.gameReaderOptions,goodsWidgetOptions:t.appearanceManager.goodsWidgetOptions,children:[t.storyLists.map((e=>e instanceof d?(0,u.jsx)(O,{ugcStoryList:e,onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)}},e.mountSelector):e instanceof a?(0,u.jsx)(x,{onFavoriteCardClick:()=>{n(!0)},onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)},storyList:e},e.mountSelector):void 0)),(0,u.jsx)(S,{open:r,onClose:()=>n(!1),options:t.appearanceManager.storyFavoriteReaderOptions,storyListOptions:t.appearanceManager.storiesListOptions})]})};class j{constructor(t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),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 e.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 l}),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){n(e),this.unscubscribeToAppearanceManagerEvents(),this.appearanceManager=e,this.subscribeToAppearanceManagerEvents(),this.render()}render(){var e;null===(e=this.root)||void 0===e||e.render((0,u.jsx)(E,{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,p.createRoot)(this.rootElement)}subscribeToAppearanceManagerEvents(){this.appearanceManager.on(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}unscubscribeToAppearanceManagerEvents(){this.appearanceManager.off(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}handleAppearanceManagerUpdate(){this.render()}}var A,_=s(655),T=s.n(_);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(A||(A={}));class P extends t.EventEmitter{constructor(e,t,r,o,i){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:i}),n(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(A.START_LOADING),T()(null===(e=this.options)||void 0===e?void 0:e.handleStartLoad)&&this.options.handleStartLoad()}))}handleEndLoad(e){var t;this.emit(A.END_LOADING,{result:e}),T()(null===(t=this.options)||void 0===t?void 0:t.handleStopLoad)&&this.options.handleStopLoad(e)}handleCloseStoryReader(){var e,t,r;if(T()(null===(e=this.options)||void 0===e?void 0:e.handleStoryReaderClose)||this.listenerCount(A.CLOSE_STORY_READER)>0)try{T()(null===(t=this.options)||void 0===t?void 0:t.handleStoryReaderClose)&&(null===(r=this.options)||void 0===r||r.handleStoryReaderClose()),this.emit(A.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}}}class k extends t.EventEmitter{constructor(t,r,o,i){super(),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),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:i}),Object.defineProperty(this,"stackedStoryListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n(t),this.handleUpdate=this.handleUpdate.bind(this),this.stackedStoryListViewModel=new e.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 I=()=>{if(!R.instance)throw new o};class R{constructor(t){return Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new j(e.storyManager)}),Object.defineProperty(this,"StoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends a{constructor(e,t,r){I(),super(e,t,R.instance.app,r)}}}),Object.defineProperty(this,"UGCStoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends d{constructor(e,t,r){I(),super(e,t,R.instance.app,r)}}}),Object.defineProperty(this,"SharePage",{enumerable:!0,configurable:!0,writable:!0,value:class extends P{constructor(t,r,n){I(),super(t,r,e.storyManager,R.instance.app,n)}}}),Object.defineProperty(this,"StackedStoryList",{enumerable:!0,configurable:!0,writable:!0,value:class extends k{constructor(t,r){I(),super(t,e.storyManager,R.instance.app,r)}}}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:e.storyManager.inAppMessaging}),R.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),R.instance):(e.storyManager.setUserAgent(`InAppStoryJSSDK/${this.sdkVersionCode}`),R.instance=this,this.app.setStoryManagerConfig(t),R.instance)}get sdkVersionName(){return"3.6.2"}get sdkVersionCode(){return parseInt(30602)}set storyLinkClickHandler(t){e.storyManager.storyLinkClickHandler=t}static getInstance(){return R.instance?R.instance:null}static use(t,r){e.StoryManager.use(t,r)}getConfig(){return e.storyManager.getConfig()}async showOnboardingStories(t,r){return I(),this.app.setAppearanceManager(t),e.storyManager.showOnboardingStories(r)}async showStory(t,r){I(),this.app.setAppearanceManager(r),await e.storyManager.showStory(t)}async showStoryOnce(t,r){return I(),this.app.setAppearanceManager(r),e.storyManager.showStoryOnce(t)}async showSharePage(t,r){return I(),this.app.setAppearanceManager(r),e.storyManager.showSharePage(t)}closeAllReaders(){e.storyManager.closeAllReaders()}async openGame(t,r,n={}){return I(),this.app.setAppearanceManager(r),e.storyManager.openGame(t,n)}async closeGame(){return e.storyManager.closeGame()}async closeStoryReader(){return e.storyManager.closeStoryReader()}getUgcEditorConfig(){return e.storyManager.getUgcEditorConfig()}closeGoodsWidget(){e.storyManager.closeGoodsWidget()}setLang(e){this.storyManagerConfigDto.lang=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}getNonce(){return e.storyManager.getNonce()}async setUserId(e,t){I(),this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async userLogoug(){return this.setUserId("")}setTags(e){I(),this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){I(),this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){I(),this.storyManagerConfigDto.imagePlaceholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}on(t,r){return e.storyManager.on(t,r),this}once(t,r){return e.storyManager.once(t,r),this}off(t,r){return e.storyManager.off(t,r),this}destroy(){null!=R.instance&&(R.instance=null,this.closeAllReaders(),this.app.destroy())}}})(),c})()));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["@inappstory/react-sdk","react/jsx-runtime","react-dom/client","react","react-dom"],t);else{var r="object"==typeof exports?t(require("@inappstory/react-sdk"),require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):t(e["@inappstory/react-sdk"],e["react/jsx-runtime"],e["react-dom/client"],e.react,e["react-dom"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o)=>(()=>{var a={432:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(935),o=r.n(n)()((function(e){return e[1]}));o.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}}",""]),o.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=o},935:e=>{"use strict";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,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&o[c[0]]||(r&&(c[2]?c[2]="".concat(r," and ").concat(c[2]):c[2]=r),t.push(c))}},t}},46:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=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 o=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,n){function o(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),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,o,{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 c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,a,i,l;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]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=c(e))>0&&i.length>o&&!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,l=d,console&&console.warn&&console.warn(l)}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 n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function p(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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}(o):h(o,o.length)}function f(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 h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.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 o(a){n.once&&e.removeEventListener(t,o),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||o(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||o(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 c(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,a=this._events;if(void 0!==a)o=o&&void 0===a.error;else if(!o)return!1;if(o){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 c=a[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,d=h(c,l);for(r=0;r<l;++r)n(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(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,n,o,a,i;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;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 o,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(o=a[n])&&this.removeAllListeners(o);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(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);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):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},650:(e,t,r)=>{var n=r(942).Symbol;e.exports=n},379:(e,t,r)=>{var n=r(650),o=r(870),a=r(5),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},870:(e,t,r)=>{var n=r(650),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[s]=r:delete e[s]),o}},5:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},942:(e,t,r)=>{var n=r(967),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},655:(e,t,r)=>{var n=r(379),o=r(580);e.exports=function(e){if(!o(e))return!1;var t=n(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)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},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 c(e,t){for(var r={},n=[],o=0;o<e.length;o++){var a=e[o],c=t.base?a[0]+t.base:a[0],l=r[c]||0,d="".concat(c," ").concat(l);r[c]=l+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}),n.push(d)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=r.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[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,n){var o=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function f(e,t,r){var n=r.css,o=r.media,a=r.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var h=null,g=0;function y(e,t){var r,n,o;if(t.singleton){var a=g++;r=h||(h=l(t)),n=p.bind(null,r,a,!1),o=p.bind(null,r,a,!0)}else r=l(t),n=f.bind(null,r,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var r=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var o=s(r[n]);i[o].references--}for(var a=c(e,t),l=0;l<r.length;l++){var d=s(r[l]);0===i[d].references&&(i[d].updater(),i.splice(d,1))}r=a}}}},494:t=>{"use strict";t.exports=e},155:e=>{"use strict";e.exports=n},514:e=>{"use strict";e.exports=o},236:e=>{"use strict";e.exports=r},272:e=>{"use strict";e.exports=t}},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.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0;var c={};return(()=>{"use strict";s.r(c),s.d(c,{AppearanceManager:()=>e.AppearanceManager,CloseButtonPosition:()=>e.CloseButtonPosition,GoodsWidgetRenderingType:()=>e.GoodsWidgetRenderingType,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,InAppStoryManager:()=>D,StoriesListCardCoverQuality:()=>e.StoriesListCardCoverQuality,StoriesListCardTitlePosition:()=>e.StoriesListCardTitlePosition,StoriesListCardTitleTextAlign:()=>e.StoriesListCardTitleTextAlign,StoriesListCardViewVariant:()=>e.StoriesListCardViewVariant,StoriesListDirection:()=>e.StoriesListDirection,StoryReaderSwipeStyle:()=>e.StoryReaderSwipeStyle});var e=s(494);class t extends Error{constructor(e){super(`Appearance Manager must be an object, but passed ${e.toUpperCase()}. Please check your code.`),this.name="IasAppearanceManagerTypeofError"}}const r=e=>{if(null==e||"object"!=typeof e)throw new t(null==e?"null":typeof e)};class n extends Error{constructor(){super("[IAS]: The <StoryManager> instance has been destroyed, you must create a new instance"),this.name="IasInAppStoryManagerReferenceError"}}class o extends Error{constructor(e){super(`[IAS]: Mount point ${e} is not present in DOM at initialization time`),this.name="IasMountPointReferenceError"}}var a=s(46);class i extends a.EventEmitter{constructor(e,t){super(),Object.defineProperty(this,"_mountSelector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_mountPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._mountPoint=this.getMountPoint(e),this.app.addItem(this).catch(console.error)}get mountPoint(){return this._mountPoint}get mountSelector(){return this._mountSelector}destroy(){this.app.removeItem(this)}getMountPoint(e){const t=document.querySelector(e);if(!t)throw new o(e);return t}}class l extends i{constructor(e,t,n,o){super(e,n),Object.defineProperty(this,"_appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),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}),r(t)}get appearanceManager(){return this._appearanceManager}get type(){return e.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()}}class d extends l{constructor(t,n,o,a){super(t,n,o,{feed:e.UGCFeedSlug,testKey:null==a?void 0:a.testKey,useUgcCard:null==a?void 0:a.useUgcCard}),Object.defineProperty(this,"ugcParams",{enumerable:!0,configurable:!0,writable:!0,value:a}),r(n)}get type(){return e.StoryFeedType.UGC}get filter(){var e;return null===(e=this.ugcParams)||void 0===e?void 0:e.filter}}var u=s(272),p=s(236),f=s(155),h=s(591),g=s.n(h),y=s(432),v={insert:"head",singleton:!1};g()(y.A,v);const m=y.A.locals||{};var b;!function(e){e.LTR="ltr",e.RTL="rtl"}(b||(b={}));const S=({open:t,options:r,storyListOptions:n,onClose:o})=>{var a,i;(0,f.useLayoutEffect)((()=>{if(!t)return;const e=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=e}}),[t]);return t?(0,u.jsx)("div",{className:m["favorite-story-list-modal"],style:(()=>{var e,t,n,o;return{"--storiesFavoriteTitleColor":r.title.color,"--storiesFavoriteTitleFontFamily":"InternalPrimaryFont","--storiesFavoriteTitleFont":r.title.font,"--storiesFavoriteTitleBackgroundColor":r.title.backgroundColor,"--storiesFavoriteHeaderTopOffset":parseFloat(null!==(t=null===(e=r.headerTopOffset)||void 0===e?void 0:e.toString())&&void 0!==t?t:"0")+"px","--storiesFavoriteBottomOffset":parseFloat(null!==(o=null===(n=r.bottomOffset)||void 0===n?void 0:n.toString())&&void 0!==o?o:"0")+"px","--storiesFavoriteBackgroundColor":r.backgroundColor}})(),children:(0,u.jsxs)("div",{className:m.container,children:[(0,u.jsxs)("div",{className:m.header,children:[(0,u.jsx)("p",{className:m.title,children:r.title.content}),(0,u.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),o()},className:m["header__close-btn"],style:(()=>{var t;const n="start"===r.closeButtonPosition||"left"===r.closeButtonPosition,o=(null===(t=e.storyManager.getConfig())||void 0===t?void 0:t.dir)===b.LTR;return{[n&&o||!n&&!o?"left":"right"]:"10px"}})(),dangerouslySetInnerHTML:{__html:null!==(i=null===(a=r.closeButton)||void 0===a?void 0:a.svgSrc.baseState)&&void 0!==i?i:""}})]}),(0,u.jsx)("div",{className:m.content,children:(0,u.jsx)("div",{className:m["favorite-story-list"],children:(0,u.jsx)(e.FavoriteStoryList,{options:Object.assign(Object.assign(Object.assign({},n),{sidePadding:0}),{direction:e.StoriesListDirection.COLUMN,layout:{height:"auto"}})})})}),(0,u.jsx)("div",{className:m.footer}),(0,u.jsx)("div",{className:m["bottom-offset"]})]})}):null};var M=s(514);const w=e=>{(0,f.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 n=new MutationObserver((()=>{document.body.contains(t)||(r(),n.disconnect())}));return n.observe(document.body,{childList:!0,subtree:!0}),()=>{n.disconnect()}}),[e])};var x;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(x||(x={}));const C=({storyList:t,onStoryCardClick:r,onFavoriteCardClick:n})=>{const[o,a]=(0,f.useState)(t.appearanceManager.storiesListOptions),i=(0,f.useRef)(null);return w(t),(0,f.useEffect)((()=>{t.api=i.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,a),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,a)})),[t.appearanceManager]),(0,M.createPortal)((0,u.jsx)(e.StoryList,{ref:i,options:o,hasFavorite:t.appearanceManager.commonOptions.hasFavorite,testKey:t.testKey,useUgcCard:t.useUgcCard,feedSlug:t.feedSlug,onLoadStart:()=>{t.emit(x.START_LOADER)},onLoadEnd:e=>{t.emit(x.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()},onFavoriteCardClick:n,onStoryCardClick:r}),t.mountPoint)};var L;!function(e){e.START_LOADER="startLoad",e.END_LOADER="endLoad"}(L||(L={}));const E=({ugcStoryList:t,onStoryCardClick:r})=>{const[n,o]=(0,f.useState)(t.appearanceManager.storiesListOptions),a=(0,f.useRef)(null);return w(t),(0,f.useEffect)((()=>{t.api=a.current}),[]),(0,f.useEffect)((()=>(t.appearanceManager.on(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o),()=>{t.appearanceManager.off(e.AppearanceManagerEvents.EVENT_UPDATED_STORIES_LIST_OPTIONS,o)})),[t.appearanceManager]),(0,M.createPortal)((0,u.jsx)(e.UGCStoryList,{ref:a,options:n,filter:t.filter,testKey:t.testKey,useUgcCard:t.useUgcCard,onStoryCardClick:r,onLoadStart:()=>{t.emit(L.START_LOADER)},onLoadEnd:e=>{t.emit(L.END_LOADER,e)},onUgcCardClick:()=>{t.ugcCardClickHandler()}}),t.mountPoint)},O=t=>{const[r,n]=(0,f.useState)(!1);return(0,u.jsxs)(e.IASContainer,{config:t.storyManagerConfigDto,storyReaderOptions:t.appearanceManager.storyReaderOptions,commonOptions:t.appearanceManager.commonOptions,gameReaderOptions:t.appearanceManager.gameReaderOptions,goodsWidgetOptions:t.appearanceManager.goodsWidgetOptions,children:[t.items.map((e=>e instanceof d?(0,u.jsx)(E,{ugcStoryList:e,onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)}},e.mountSelector):e instanceof l?(0,u.jsx)(C,{onFavoriteCardClick:()=>{n(!0)},onStoryCardClick:()=>{t.onAppearanceManagerChange(e.appearanceManager)},storyList:e},e.mountSelector):void 0)),(0,u.jsx)(S,{open:r,onClose:()=>n(!1),options:t.appearanceManager.storyFavoriteReaderOptions,storyListOptions:t.appearanceManager.storiesListOptions})]})};class j{constructor(){Object.defineProperty(this,"_items",{enumerable:!0,configurable:!0,writable:!0,value:[]})}get items(){return this._items}addItem(e){this._items.push(e)}removeItem(e){const t=this._items.findIndex((t=>t===e));-1!==t&&this._items.splice(t,1)}destroy(){this._items=[]}}class A{constructor(t){Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),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 e.AppearanceManager}),Object.defineProperty(this,"rootElement",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"appItemManager",{enumerable:!0,configurable:!0,writable:!0,value:new j}),this.createAppRoot(),this.handleAppearanceManagerUpdate=this.handleAppearanceManagerUpdate.bind(this),this.setAppearanceManager=this.setAppearanceManager.bind(this)}async addItem(e){try{this.appItemManager.addItem(e),await this.storyManager.waitStoryManagerConfig(),this.render()}catch(t){throw this.removeItem(e),t}}async removeItem(e){this.appItemManager.removeItem(e),this.render()}setStoryManagerConfig(e){this.storyManagerConfigDto=Object.assign(Object.assign({},this.storyManagerConfigDto),e),this.render()}setAppearanceManager(e){r(e),this.unscubscribeToAppearanceManagerEvents(),this.appearanceManager=e,this.subscribeToAppearanceManagerEvents(),this.render()}render(){var e;null===(e=this.root)||void 0===e||e.render((0,u.jsx)(O,{storyManagerConfigDto:this.storyManagerConfigDto,appearanceManager:this.appearanceManager,items:this.appItemManager.items.slice(),onAppearanceManagerChange:this.setAppearanceManager}))}destroy(){this.rootElement&&this.root&&(this.appItemManager.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,p.createRoot)(this.rootElement)}subscribeToAppearanceManagerEvents(){this.appearanceManager.on(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}unscubscribeToAppearanceManagerEvents(){this.appearanceManager.off(e.AppearanceManagerEvents.UPDATE,this.handleAppearanceManagerUpdate)}handleAppearanceManagerUpdate(){this.render()}}var _,I=s(655),T=s.n(I);!function(e){e.START_LOADING="startLoading",e.END_LOADING="endLoading",e.CLOSE_STORY_READER="closeStoryReader"}(_||(_={}));class P extends a.EventEmitter{constructor(e,t,n,o,a){super(),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:a}),r(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(_.START_LOADING),T()(null===(e=this.options)||void 0===e?void 0:e.handleStartLoad)&&this.options.handleStartLoad()}))}handleEndLoad(e){var t;this.emit(_.END_LOADING,{result:e}),T()(null===(t=this.options)||void 0===t?void 0:t.handleStopLoad)&&this.options.handleStopLoad(e)}handleCloseStoryReader(){var e,t,r;if(T()(null===(e=this.options)||void 0===e?void 0:e.handleStoryReaderClose)||this.listenerCount(_.CLOSE_STORY_READER)>0)try{T()(null===(t=this.options)||void 0===t?void 0:t.handleStoryReaderClose)&&(null===(r=this.options)||void 0===r||r.handleStoryReaderClose()),this.emit(_.CLOSE_STORY_READER)}catch(e){console.error(e)}else{const e=window.location;window.open(`${e.protocol}//${e.host}`,"_parent")}}}class k extends a.EventEmitter{constructor(t,n,o,a){super(),Object.defineProperty(this,"appearanceManager",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storyManager",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"stackedStoryListViewModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r(t),this.handleUpdate=this.handleUpdate.bind(this),this.stackedStoryListViewModel=new e.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 R=()=>{if(!D.instance)throw new n};class D{constructor(t){return Object.defineProperty(this,"storyManagerConfigDto",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"__IAS_INTERNAL_API__",{enumerable:!0,configurable:!0,writable:!0,value:e.__IAS_INTERNAL_API__}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new A(e.storyManager)}),Object.defineProperty(this,"StoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends l{constructor(e,t,r){R(),super(e,t,D.instance.app,r)}}}),Object.defineProperty(this,"UGCStoriesList",{enumerable:!0,configurable:!0,writable:!0,value:class extends d{constructor(e,t,r){R(),super(e,t,D.instance.app,r)}}}),Object.defineProperty(this,"SharePage",{enumerable:!0,configurable:!0,writable:!0,value:class extends P{constructor(t,r,n){R(),super(t,r,e.storyManager,D.instance.app,n)}}}),Object.defineProperty(this,"StackedStoryList",{enumerable:!0,configurable:!0,writable:!0,value:class extends k{constructor(t,r){R(),super(t,e.storyManager,D.instance.app,r)}}}),Object.defineProperty(this,"inAppMessaging",{enumerable:!0,configurable:!0,writable:!0,value:e.storyManager.inAppMessaging}),D.instance?(console.warn("StoryManager singleton is created multiple times\nuse IAS.StoryManager.getInstance() instead"),D.instance):(e.storyManager.setUserAgent(`InAppStoryJSSDK/${this.sdkVersionCode}`),D.instance=this,this.app.setStoryManagerConfig(t),D.instance)}get sdkVersionName(){return"3.7.0-rc.0"}get sdkVersionCode(){return parseInt(30700)}set storyLinkClickHandler(t){e.storyManager.storyLinkClickHandler=t}static getInstance(){return D.instance?D.instance:null}static use(t,r){t.install({INTERNAL_API:e.__IAS_INTERNAL_API__,HOST:D},r)}getConfig(){return e.storyManager.getConfig()}async showOnboardingStories(t,r){return R(),this.app.setAppearanceManager(t),e.storyManager.showOnboardingStories(r)}async showStory(t,r){R(),this.app.setAppearanceManager(r),await e.storyManager.showStory(t)}async showStoryOnce(t,r){return R(),this.app.setAppearanceManager(r),e.storyManager.showStoryOnce(t)}async showSharePage(t,r){return R(),this.app.setAppearanceManager(r),e.storyManager.showSharePage(t)}closeAllReaders(){e.storyManager.closeAllReaders()}async openGame(t,r,n={}){return R(),this.app.setAppearanceManager(r),e.storyManager.openGame(t,n)}async closeGame(){return e.storyManager.closeGame()}async closeStoryReader(){return e.storyManager.closeStoryReader()}getUgcEditorConfig(){return e.storyManager.getUgcEditorConfig()}closeGoodsWidget(){e.storyManager.closeGoodsWidget()}setLang(e){this.storyManagerConfigDto.lang=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}getNonce(){return e.storyManager.getNonce()}async setUserId(e,t){R(),this.storyManagerConfigDto.userId=e,this.storyManagerConfigDto.userIdSign=t,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}async userLogoug(){return this.setUserId("")}setTags(e){R(),this.storyManagerConfigDto.tags=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setPlaceholders(e){R(),this.storyManagerConfigDto.placeholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}setImagePlaceholders(e){R(),this.storyManagerConfigDto.imagePlaceholders=e,this.app.setStoryManagerConfig(this.storyManagerConfigDto)}on(t,r){return e.storyManager.on(t,r),this}once(t,r){return e.storyManager.once(t,r),this}off(t,r){return e.storyManager.off(t,r),this}destroy(){null!=D.instance&&(D.instance=null,this.closeAllReaders(),this.app.destroy())}}})(),c})()));
|
|
@@ -1,28 +1,94 @@
|
|
|
1
1
|
import { RecursivePartial } from "../global"
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Enum representing possible positions for the close button.
|
|
5
|
+
*/
|
|
3
6
|
export declare enum CloseButtonPosition {
|
|
4
|
-
/** @deprecated */
|
|
7
|
+
/** @deprecated Use START instead */
|
|
5
8
|
LEFT = "left",
|
|
6
|
-
|
|
9
|
+
|
|
10
|
+
/** @deprecated Use END instead */
|
|
7
11
|
RIGHT = "right",
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Position the close button at the start of the container (left in LTR, right in RTL).
|
|
15
|
+
* @default "start"
|
|
16
|
+
*/
|
|
8
17
|
START = "start",
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Position the close button at the end of the container (right in LTR, left in RTL).
|
|
21
|
+
* @default "end"
|
|
22
|
+
*/
|
|
9
23
|
END = "end"
|
|
10
24
|
}
|
|
11
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Common appearance options for a stories
|
|
28
|
+
*/
|
|
12
29
|
export type AppearanceCommonOptions = RecursivePartial<{
|
|
30
|
+
/**
|
|
31
|
+
* Enables or disables the "favorite" button.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
13
34
|
hasFavorite: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Enables or disables the "like" button.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
14
40
|
hasLike: boolean;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Enables or disables the "share" button.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
15
46
|
hasShare: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Position of the close button.
|
|
50
|
+
*
|
|
51
|
+
* Accepts enum values or string literals for backward compatibility.
|
|
52
|
+
* @default CloseButtonPosition.END
|
|
53
|
+
*/
|
|
16
54
|
closeButtonPosition: CloseButtonPosition | "left" | "right" | "start" | "end";
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Loader configuration.
|
|
58
|
+
*/
|
|
17
59
|
loader: {
|
|
60
|
+
/**
|
|
61
|
+
* Default loader colors.
|
|
62
|
+
*/
|
|
18
63
|
default: {
|
|
64
|
+
/**
|
|
65
|
+
* Primary loader color.
|
|
66
|
+
* @default "white"
|
|
67
|
+
*/
|
|
19
68
|
color: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Accent loader color.
|
|
72
|
+
* @default "transparent"
|
|
73
|
+
*/
|
|
20
74
|
accentColor: string;
|
|
21
75
|
};
|
|
22
|
-
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Custom loader SVG or component as a string.
|
|
79
|
+
* @default null
|
|
80
|
+
*/
|
|
81
|
+
custom: string | null;
|
|
23
82
|
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Close button SVG icon configuration.
|
|
86
|
+
*/
|
|
24
87
|
closeButton: {
|
|
25
88
|
svgSrc: {
|
|
89
|
+
/**
|
|
90
|
+
* Base state SVG icon for the close button
|
|
91
|
+
*/
|
|
26
92
|
baseState: string;
|
|
27
93
|
};
|
|
28
94
|
};
|
|
@@ -4,31 +4,99 @@ import { GameReaderOptions } from "./gameReader";
|
|
|
4
4
|
import { GoodsWidgetOptions } from "./goodsWidget";
|
|
5
5
|
import { StoriesListOptions } from "./storiesList";
|
|
6
6
|
import { StoryFavoriteReaderOptions } from "./storyFavoriteReader";
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Option groups for the AppearanceManager.
|
|
9
|
+
*/
|
|
8
10
|
export type AppearanceManagerOptionGroups = {
|
|
11
|
+
/** Common appearance options. */
|
|
9
12
|
commonOptions: AppearanceCommonOptions;
|
|
13
|
+
|
|
14
|
+
/** Options for the stories list. */
|
|
10
15
|
storiesListOptions: StoriesListOptions;
|
|
16
|
+
|
|
17
|
+
/** Options for displaying a single story. */
|
|
11
18
|
storyReaderOptions: StoryReaderOptions;
|
|
19
|
+
|
|
20
|
+
/** Options for displaying favorite stories. */
|
|
12
21
|
storyFavoriteReaderOptions: StoryFavoriteReaderOptions;
|
|
22
|
+
|
|
23
|
+
/** Options for the goods widget. */
|
|
13
24
|
goodsWidgetOptions: GoodsWidgetOptions;
|
|
25
|
+
|
|
26
|
+
/** Options for displaying games. */
|
|
14
27
|
gameReaderOptions: GameReaderOptions;
|
|
15
28
|
};
|
|
16
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Manager for configuring the appearance of various application components.
|
|
32
|
+
*/
|
|
17
33
|
export declare class AppearanceManager {
|
|
34
|
+
/** Common appearance options. */
|
|
18
35
|
commonOptions: AppearanceCommonOptions;
|
|
36
|
+
|
|
37
|
+
/** Options for displaying a single story. */
|
|
19
38
|
storyReaderOptions: StoryReaderOptions;
|
|
39
|
+
|
|
40
|
+
/** Options for displaying favorite stories. */
|
|
20
41
|
storyFavoriteReaderOptions: StoryFavoriteReaderOptions;
|
|
42
|
+
|
|
43
|
+
/** Options for displaying games. */
|
|
21
44
|
gameReaderOptions: GameReaderOptions;
|
|
45
|
+
|
|
46
|
+
/** Options for the goods widget. */
|
|
22
47
|
goodsWidgetOptions: GoodsWidgetOptions;
|
|
48
|
+
|
|
49
|
+
/** Options for the stories list. */
|
|
23
50
|
storiesListOptions: StoriesListOptions;
|
|
24
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Sets common appearance options.
|
|
54
|
+
* @param options - New common options.
|
|
55
|
+
* @param withUpdateEvent - Indicates whether to dispatch an update event.
|
|
56
|
+
* @returns The AppearanceManager instance.
|
|
57
|
+
*/
|
|
25
58
|
setCommonOptions(options: AppearanceCommonOptions, withUpdateEvent?: boolean): AppearanceManager;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Sets options for the stories list.
|
|
62
|
+
* @param options - Partial options to update.
|
|
63
|
+
* @param withUpdateEvent - Indicates whether to dispatch an update event.
|
|
64
|
+
* @returns The AppearanceManager instance.
|
|
65
|
+
*/
|
|
26
66
|
setStoriesListOptions(options: Partial<StoriesListOptions>, withUpdateEvent?: boolean): AppearanceManager;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Sets options for the story reader.
|
|
70
|
+
* @param options - Partial options to update.
|
|
71
|
+
* @param withUpdateEvent - Indicates whether to dispatch an update event.
|
|
72
|
+
* @returns The AppearanceManager instance.
|
|
73
|
+
*/
|
|
27
74
|
setStoryReaderOptions(options: Partial<StoryReaderOptions>, withUpdateEvent?: boolean): AppearanceManager;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Sets options for the favorite story reader.
|
|
78
|
+
* @param options - Partial options to update.
|
|
79
|
+
* @param withUpdateEvent - Indicates whether to dispatch an update event.
|
|
80
|
+
* @returns The AppearanceManager instance.
|
|
81
|
+
*/
|
|
28
82
|
setStoryFavoriteReaderOptions(
|
|
29
83
|
options: Partial<StoryFavoriteReaderOptions>,
|
|
30
84
|
withUpdateEvent?: boolean
|
|
31
85
|
): AppearanceManager;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Sets options for the goods widget.
|
|
89
|
+
* @param options - Partial options to update.
|
|
90
|
+
* @param withUpdateEvent - Indicates whether to dispatch an update event.
|
|
91
|
+
* @returns The AppearanceManager instance.
|
|
92
|
+
*/
|
|
32
93
|
setGoodsWidgetOptions(options: Partial<GoodsWidgetOptions>, withUpdateEvent?: boolean): AppearanceManager;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Sets options for the game reader.
|
|
97
|
+
* @param options - New game reader options.
|
|
98
|
+
* @param withUpdateEvent - Indicates whether to dispatch an update event.
|
|
99
|
+
* @returns The AppearanceManager instance.
|
|
100
|
+
*/
|
|
33
101
|
setGameReaderOptions(options: GameReaderOptions, withUpdateEvent?: boolean): AppearanceManager;
|
|
34
102
|
}
|