@polyv/product-sdk 1.10.0 → 1.11.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/index.cjs.js +3 -3
- package/index.es.d.ts +13 -0
- package/index.es.js +221 -199
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=Object.prototype.hasOwnProperty;function e(e,r){return t.call(e,r)}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e,n,o){null==n&&(n=""),""===n&&o.ignoreEmpty||("function"==typeof o.encode&&(e=o.encode(e),n=-1!==["boolean","string","number"].indexOf(r(n))?o.encode(String(n)):""),t.push(e+"="+n))}function o(t,e,r,o){r.forEach(function(r){n(t,e,r,o)})}function i(t,r){var i,a,u=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=0;r<(arguments.length<=1?0:arguments.length-1);r++){var n=r+1<1||arguments.length<=r+1?void 0:arguments[r+1];if(null!=n)for(var o in n)"__proto__"!==o&&e(n,o)&&(t[o]=n[o])}return t}({encode:encodeURIComponent},r),c=[];for(i in t)e(t,i)&&(a=t[i],Array.isArray(a)?o(c,i,a,u):n(c,i,a,u));return c.join("&")}function a(t,e,r){if(t=String(t),null==e)return t;if(!(e="string"==typeof e?e.replace(/^[?&]/,""):i(e,r)))return t;var n=function(t){var e={leftContext:""},r=t.indexOf("#");return-1!==r&&(e.hash=t.slice(r+1),t=t.slice(0,r)),-1!==(r=t.indexOf("?"))&&(e.search=t.slice(r+1),t=t.slice(0,r)),e.leftContext=t,e}(t),o=n.search||"";return o&&"&"!==o.slice(-1)&&(o+="&"),o+=e,n.search=o,function(t){var e=t.leftContext;return null!=t.search&&(e+="?"+t.search),null!=t.hash&&(e+="#"+t.hash),e}(n)}function u(t){if("boolean"!=typeof t)throw new Error("The value argument must be a boolean type");return t?"Y":"N"}function c(t,e){var r=String(t).toUpperCase();if("Y"!==r&&"N"!==r){if(null==e)throw new Error('The value argument must be "Y" or "N"');r=String(e).toUpperCase()}return"Y"===r}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==s(e)?e:e+""}var l=function(){return p(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.__eventStore={}},[{key:"__addOnEvent",value:function(t,e,r,n){if(e&&r){var o=this.__eventStore[e];o||(o=[]),o.push({type:t,handler:r,callbackHandler:r.bind(n)}),this.__eventStore[e]=o}}},{key:"on",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("normal",t,e,r)}},{key:"once",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("once",t,e,r)}},{key:"off",value:function(t,e){var r=this.__eventStore[t];r&&(r=r.filter(function(t){return t.handler!==e}),this.__eventStore[t]=r)}},{key:"emit",value:function(t,e,r){var n=this,o=this.__eventStore[t];o&&o.forEach(function(o){try{var i=o.type,a=o.handler,u=o.callbackHandler;"function"==typeof u&&u(e,r),"once"===i&&n.off(t,a)}catch(c){console.error(c)}})}},{key:"destroy",value:function(){this.__eventStore={}}}])}(),f=function(t){return t.GetProductTagList="/live/v4/watch/channel/product/tag/list",t.GetProductListByShowId="/live/v3/sdk/watch/interactive/product/list-by-showId",t.GetProductListByTag="/live/v4/watch/channel/product/list",t.GetProductDataById="/live/v3/sdk/watch/interactive/product/get-by-product-id",t.GetOrderList="/live/v4/watch/channel/viewer/product/order/list",t.GetOrderDetail="/live/v4/watch/channel/viewer/product/order/get-detail",t.ConfirmOrder="/live/v4/watch/channel/viewer/product/order/finish",t.CreateOrder="/live/v4/watch/channel/product/order/create",t.PayOrder="/live/v4/watch/channel/product/order/pay",t.ApplyOrderRefund="/live/v4/watch/channel/product/order/refund",t.GetOrderPaymentProviders="/live/v4/watch/channel/product/order/payment-providers/get",t.GetAddressList="/live/v4/watch/channel/viewer/address/list",t.GetDefaultAddress="/live/v4/watch/channel/viewer/address/get-default",t.AddAddress="/live/v4/watch/channel/viewer/address/save",t.UpdateAddress="/live/v4/watch/channel/viewer/address/update",t.DeleteAddress="/live/v4/watch/channel/viewer/address/delete",t.GetProductListByLaunch="/live/v4/channel/product/list",t.GetProductDataByLaunch="/live/v4/channel/product/get",t.StartProductExplain="/live/v4/channel/product/product-explain/start-now",t.EndProductExplain="/live/v4/channel/product/product-explain/end-now",t.RestartProductExplain="/live/v4/channel/product/product-explain/restart-now",t.DeleteProductExplain="/live/v4/channel/product/product-explain/delete",t.GetCurrentProductExplain="/live/v4/channel/product/product-explain/get-current-product-id",t.OpenProductPrice="/live/v4/channel/product/open-price",t.HideProductPrice="/live/v4/channel/product/un-open-price",t.ProductPushRule="/live/v4/channel/product/push/rule",t.UpdateProductPushRule="/live/v4/channel/product/push/rule/save",t.PushProduct="/live/v4/channel/product/push/push",t.CancelPushProduct="/live/v4/channel/product/push/cancel-push",t.BatchDeleteProduct="/live/v4/channel/product/delete-batch",t.BatchShelfProduct="/live/v4/channel/product/shelf-batch",t.TopProduct="/live/v4/channel/product/topping",t.CancelTopProduct="/live/v4/channel/product/un-topping",t.ToggleProductSoldOut="/live/v4/channel/product/update-mark-as-soldout",t.GetProductEnabled="/live/v4/channel/product/menu/get-enabled",t.UpdateProductEnabled="/live/v4/channel/product/menu/update-enabled",t.UpdateProductSort="/live/v4/channel/product/sort-rank",t.MoveProduct="/live/v4/channel/product/sort-rank-by-type",t.CreateAiCardTask="/live/v4/channel/product/create-ai-card-task",t.GetAiCardContent="/live/v4/channel/product/get-ai-card-task-output",t.UpdateAiCardContent="/live/v4/channel/product/update-ai-card-content",t.GetLaunchProductTagList="/live/v4/channel/product/tag/list-with-stats",t.CreateProductTag="/live/v4/channel/product/tag/create",t.UpdateProductTag="/live/v4/channel/product/tag/update",t.DeleteProductTag="/live/v4/channel/product/tag/delete",t.AssociateProductTag="/live/v4/channel/product/tag/add-refs",t.CreateProduct="/live/v4/channel/product/create",t.UpdateProduct="/live/v4/channel/product/update",t}({}),v=function(t){return t.ChooseCard="chooseCard",t.BigCard="bigCard",t.SmallCard="smallCard",t}({}),h=function(t){return t.OnSaleProduct="OnSaleProduct",t.OffSaleProduct="OffSaleProduct",t.AddProduct="AddProduct",t.DeleteProduct="DeleteProduct",t.ChangeProduct="ChangeProduct",t.MoveProduct="MoveProduct",t.ChangeProductRank="ChangeProductRank",t.ProductSoldOut="ProductSoldOut",t.PushProduct="PushProduct",t.CancelPushProduct="CancelPushProduct",t.ProductListEnabled="ProductListEnabled",t.RefreshProductList="RefreshProductList",t.ProductClick="ProductClick",t.ProductClickTimes="ProductClickTimes",t}({}),y=function(t){return t.Normal="normal",t.Finance="finance",t.Position="position",t}({}),m=function(t){return t[t.Normal=10]="Normal",t[t.MultiPlatform=11]="MultiPlatform",t[t.Native=12]="Native",t}({}),b=function(t){return t.PopUp="POP_UP",t.NewWindow="NEW_WINDOW",t.CurrentWindow="CURRENT_WINDOW",t}({}),g=function(t){return t[t.OnSale=1]="OnSale",t[t.OffSale=2]="OffSale",t}({}),P=function(t){return t.Image="image",t.MaterialVideo="material-video",t}({}),w=function(t){return t.NotExplained="notExplained",t.Explaining="explaining",t.Explained="explained",t}({}),k=function(t){return t.Live="live",t.Playback="recordFile",t}({}),O=function(t){return t.Start="start",t.End="end",t.Restart="restart",t}({}),E=function(t){return t.DirectBuy="inner",t.Link="link",t}({}),S=function(t){return t.Amount="AMOUNT",t.Custom="CUSTOM",t}({}),x=function(t){return t.Express="express",t.Virtual="virtual",t}({}),T=function(t){return t.WxWorkCode="wxWorkCode",t.Custom="custom",t}({}),C=function(t){return t.Edit="edit",t.Top="top",t.MoveUp="moveUp",t.MoveDown="moveDown",t.Delete="delete",t.OnShelf="onShelf",t.OffShelf="offShelf",t.Tag="tag",t.ViewStats="viewStats",t.ViewOrder="viewOrder",t}({}),A=function(t){return t.MoveUp="moveUp",t.MoveDown="moveDown",t}({}),I=function(t){return t.Asc="ASC",t.Desc="DESC",t}({}),j=function(t){return t.None="none",t.Custom="custom",t.External="external",t.Direct="direct",t.EnterpriseWeChat="enterpriseWeChat",t}({}),L=function(t){return t.Delta="delta",t.Complete="complete",t.Error="error",t}({}),_=function(t){return t.PlatformRef="platform-ref",t.Platform="platform",t.Create="create",t}({}),D=function(t){return t.V1="v1",t.V2="v2",t.V3="v3",t.Vn="vn",t}({}),N=function(t){return t.TagNameExists="tagNameExists",t.Unknown="unknown",t}({}),R=function(t){return t.Default="DEFAULT",t.Custom="CUSTOM",t}({});function M(t,e){var r;return e.some(function(e){var n,o=!1;return e.regExp?(o=e.regExp.test(t))&&(n=RegExp.$1):e.keywords?o=function(t,e){t=t.toLowerCase();var r=/[/\s;_-]/,n=/[/\s;_-]/;return e.some(function(e){var o=t.indexOf(e.toLowerCase());if(-1!==o&&(r.test(t[o-1])||0===o)&&(n.test(t[o+e.length])||o+e.length>=t.length))return!0})}(t,e.keywords):e.modelRegExp&&(o=function(t,e){return!!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(t)&&e.test(RegExp.$1)}(t,e.modelRegExp)),o&&(r={name:e.name,version:n}),o}),r}var W=[{name:"windows",regExp:/\bWindows\s?NT\s?(([\d.]+))\b/},{name:"ios",regExp:/\bOS(?:\s([\d_.]+))?\slike\sMac\sOS\sX\b/},{name:"macos",regExp:/\bMac\sOS\sX(?:\s([\d_.]+))?/},{name:"openharmony",regExp:/\bOpenHarmony\s([\d.]+)\b/},{name:"android",regExp:/\bAndroid;?(?:[-/\s]([\d.]+))?(?:\b|_)/},{name:"android",regExp:/\bAdr\s([\d.]+)(?:\b|_)/}];function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function H(t){var e=function(t,e){if("object"!=G(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=G(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==G(e)?e:e+""}var B=function(){return U(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._ver=(e||"").replace(/_/g,".").replace(/\.+$/,""),Object.freeze(this)},[{key:"_compare",value:function(t,e){if(!this._ver||!t)return!1;var r=Array.isArray(e)?e:[e],n=function(t,e){for(var r=/(\.0+)+$/,n=String(t).replace(r,"").split("."),o=String(e).replace(r,"").split("."),i=Math.min(n.length,o.length),a=0;a<i;a++){var u=parseInt(n[a])-parseInt(o[a]);if(u)return u}return n.length-o.length}(this._ver,t);return r.some(function(t){return n*t>0||0===n&&0===t})}},{key:"gt",value:function(t){return this._compare(t,1)}},{key:"gte",value:function(t){return this._compare(t,[1,0])}},{key:"lt",value:function(t){return this._compare(t,-1)}},{key:"lte",value:function(t){return this._compare(t,[-1,0])}},{key:"eq",value:function(t){return this._compare(t,0)}},{key:"toString",value:function(){return this._ver}}])}();function F(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var z={ios:"isIOS",openharmony:"isOpenHarmony",android:"isAndroid",windows:"isWindows",macos:"isMacOS"};var V=F(function t(e,r){var n,o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isIOS=!1,this.isAndroid=!1,this.isHarmonyOS=!1,this.isOpenHarmony=!1,this.isWindows=!1,this.isMacOS=!1,null==r?void 0:r.platform){var i=function(t){switch(t){case"Android":return"android";case"iPad":case"iPhone":case"iPod":return"ios";case"MacIntel":return"macos";case"Win32":return"windows"}}(r.platform);void 0!==i&&(o={name:i,version:""})}var a=null!==(n=M(e,W))&&void 0!==n?n:o;a?(o&&o.name!==a.name&&(a=o),"macos"===a.name&&(null==r?void 0:r.maxTouchPoints)&&(a.name="ios",a.version=""),this[z[a.name]]=!0,this.version=new B(a.version),this.isAndroid&&/\bHarmonyOS\b/.test(e)&&(this.isHarmonyOS=!0),Object.freeze(this)):this.version=Object.freeze(new B(""))}),$=[{name:"ipad",regExp:/iPad/},{name:"ipod",regExp:/iPod/},{name:"iphone",regExp:/iPhone/}],J=[{name:"huawei",regExp:/\b(?:huawei|honor)/i},{name:"huawei",keywords:["ideahub","figi"]},{name:"vivo",keywords:["vivo"]},{name:"oppo",keywords:["oppo"]},{name:"mi",keywords:["redmi","hongmi","shark","Mi","MIX","POCO","POCOPHONE"]},{name:"mi",regExp:/\bxiaomi/i},{name:"samsung",keywords:["samsung","galaxy"]},{name:"oneplus",keywords:["oneplus","one"]},{name:"huawei",modelRegExp:/^Mate\s*\d{2}/i},{name:"huawei",modelRegExp:/^Nova\s\d$/},{name:"huawei",regExp:/\b(?:Hi)?MatePad/i},{name:"huawei",regExp:/\b(?:Liantong|UNICOMVSENS)VP\d{3}\b/},{name:"huawei",regExp:/\bCMDCSP\d{3}\b/},{name:"huawei",regExp:/\bTDTECH/i},{name:"huawei",modelRegExp:/^[A-Z]{3}\d?-W[0-5]9[A-Z]*$/},{name:"huawei",modelRegExp:/^[A-Z][A-Za-z]{2,3}-(?:AN|BD|BX|AL|TL)\d{2}[A-Za-z]*$/},{name:"huawei",modelRegExp:/^TYH\d+[A-Z]?$/},{name:"huawei",modelRegExp:/^H60-L0[12]$/},{name:"mi",modelRegExp:/^MI\s?(?:\d|CC|Note|MAX|PLAY|PAD)/i},{name:"mi",modelRegExp:/^(?:AWM|SKR|SKW|DLT)-/},{name:"mi",modelRegExp:/^XIG\d{2}$/},{name:"mi",modelRegExp:/^M\d{4}[A-Z]\d{1,2}[A-Z]{1,3}$/},{name:"mi",modelRegExp:/^2\d{3}[A-Z0-9]{6}$/},{name:"mi",modelRegExp:/^2\d{5}[0-9A-Z]{2}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{6}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{7}[A-Z]{2,3}$/},{name:"samsung",modelRegExp:/^S(?:M|[CGP]H)-[A-Za-z0-9]+$/},{name:"samsung",modelRegExp:/^SCV3\d$/},{name:"samsung",modelRegExp:/^SC-\d{2}[A-Z]$/},{name:"samsung",modelRegExp:/^SH[WV]-/},{name:"samsung",modelRegExp:/^GT[-_][A-Z][A-Z0-9]{3,}$/i},{name:"oppo",modelRegExp:/^(?:CPH|OPD|iPA)\d{4}$/},{name:"oppo",modelRegExp:/^OPG\d{2}$/},{name:"oppo",modelRegExp:/^A[1-5]0[1-9]OP$/},{name:"oneplus",modelRegExp:/^(?:KB|HD|IN|GM|NE|LE|MT)\d{4}$/},{name:"vivo",modelRegExp:/^V[12]\d{3}[A-Z]{0,2}$/}];function Z(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var Q={ipod:"isIPod",iphone:"isIPhone",ipad:"isIPad",huawei:"isHuawei",mi:"isMi",oppo:"isOppo",vivo:"isVivo",oneplus:"isOnePlus",samsung:"isSamsung"},q=Z(function t(e,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isHuawei=!1,this.isMi=!1,this.isOppo=!1,this.isVivo=!1,this.isOnePlus=!1,this.isSamsung=!1,this.isIPod=!1,this.isIPhone=!1,this.isIPad=!1,this.isMac=!1,this.isApple=!1,r.isIOS?(n=$,this.isApple=!0):r.isMacOS?(this.isMac=!0,this.isApple=!0):(r.isAndroid||r.isOpenHarmony)&&(n=J),n){var o=M(e,n);o?this[Q[o.name]]=!0:r.isIOS&&(this.isIPad=!0)}Object.freeze(this)}),Y=[{name:"edge",regExp:/\bEdge\/([\d.]+)/},{name:"chrome",regExp:/\b(?:Chrome|CrMo|CriOS)\/([\d.]+)/},{name:"safari",regExp:/\b(?:Version\/([\d.]+).*\s?)?Safari\b/},{name:"ie",regExp:/\bMSIE\s(\d+)/i},{name:"ie",regExp:/\bTrident\/.*;\srv:(\d+)/},{name:"firefox",regExp:/\bFirefox\/([\d.]+)/},{name:"opera-presto",regExp:/\bOpera\/([\d.]+)/}];function K(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var X={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},tt=K(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isChrome=!1,this.isSafari=!1,this.isEdge=!1,this.isIE=!1,this.isFirefox=!1,this.isPrestoOpera=!1;var r=M(e,Y);r?(this[X[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),Object.freeze(this)}),et=[{name:"wxwork",regExp:/\bwxwork\/([\d.]+)/},{name:"wx",regExp:/\bMicroMessenger\/([\d.]+)/},{name:"ding",regExp:/\bDingTalk\/([\d.]+)/},{name:"qq",regExp:/\bQQ\/([\d.]+)/},{name:"qq",regExp:/\bIPadQQ\b/},{name:"weibo",regExp:/(?:\b|_)Weibo(?:\b|_)/i},{name:"edge",regExp:/\bEdge?\/([\d.]+)/},{name:"opera-blink",regExp:/\bOPR\/([\d.]+)/},{name:"qqbrowser",regExp:/\bM?QQBrowser(?:\/([\d.]+))?/i},{name:"ucbrowser",regExp:/\b(?:UCBrowser|UCWEB)(?:-CMCC)?\/?\s?([\d.]+)/},{name:"ucbrowser",regExp:/\bUC\b/},{name:"quark",regExp:/\bQuark\/([\d.]+)/},{name:"maxthon",regExp:/\b(?:Maxthon|MxBrowser)(?:[/\s]([\d.]+))?/},{name:"theworld",regExp:/\bTheWorld(?:\s([\d.]+))?/i},{name:"baidubrowser",regExp:/\b(?:baidubrowser|bdbrowser_i18n|BIDUBrowser)(?:[/\s]([\d.]+))?/i},{name:"baidubrowser",regExp:/\bbaidubrowserpad\b/},{name:"baiduapp",regExp:/\bbaiduboxapp\b\/([\d.]+)?/i},{name:"baiduapp",regExp:/\bbaiduboxpad\b/i}];function rt(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}et=et.concat(Y);var nt={wxwork:"isWxWork",wx:"isWx",ding:"isDing",qq:"isQQ",weibo:"isWeibo",edge:"isEdge","opera-blink":"isOpera","opera-presto":"isOpera",qqbrowser:"isQQBrowser",ucbrowser:"isUCBrowser",quark:"isQuark",maxthon:"isMaxthon",theworld:"isTheWorld",baidubrowser:"isBaiduBrowser",baiduapp:"isBaiduApp",chrome:"isChrome",safari:"isSafari",ie:"isIE",firefox:"isFirefox"},ot=rt(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isWxWork=!1,this.isWx=!1,this.isWxMiniProgram=!1,this.isDing=!1,this.isQQ=!1,this.isWeibo=!1,this.isEdge=!1,this.isOpera=!1,this.isQQBrowser=!1,this.isUCBrowser=!1,this.isQuark=!1,this.isMaxthon=!1,this.isTheWorld=!1,this.isBaiduBrowser=!1,this.isBaiduApp=!1,this.isChrome=!1,this.isSafari=!1,this.isIE=!1,this.isFirefox=!1;var r=M(e,et);r?(this[nt[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),this.isWxMiniProgram=(this.isWx||this.isWxWork)&&/\bMiniProgramEnv\b/.test(e),Object.freeze(this)});function it(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var at,ut=it(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.os=Object.freeze(new V(e,r)),this.brand=Object.freeze(new q(e,this.os)),this.browser=Object.freeze(new tt(e)),this.client=Object.freeze(new ot(e)),this.isTablet=this.brand.isIPad||/\bTablet\b/i.test(e)||this.os.isAndroid&&!/\bMobile\b/i.test(e),this.os.isIOS||this.os.isAndroid||this.isTablet?this.isPortable=!0:/\(X11[;)]/i.test(e)||/\b(Windows\sNT|Macintosh)\b/.test(e)?this.isPortable=!1:this.isPortable=/mobile|android/i.test(e),Object.freeze(this)});var ct,st,pt=(at||(at=Object.freeze("undefined"!=typeof window?new ut(window.navigator.userAgent,window.navigator):new ut(""))),at);pt.os.isAndroid,pt.os.isIOS,pt.os.isOpenHarmony,pt.isPortable,(st=ct||(ct={})).PopUp="POP_UP",st.NewWindow="NEW_WINDOW",st.CurrentWindow="CURRENT_WINDOW";var dt=["productId","showId","rank","logId","productExplainNum","tags"];function lt(t){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){s=!0,o=p}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(r),!0).forEach(function(e){mt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function mt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=lt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bt(t){var e=[];if(!t)return e;try{e=JSON.parse(t).filter(function(t){return!!t})}catch(r){console.error("parseFeature error",r)}return e}function gt(t){return t?t.map(function(t){return{label:t.name,value:t.id,associatedCount:0}}):[]}function Pt(t){var e,r={productId:t.productId,cover:t.cover,coverList:[t.cover],videoList:[],mediaList:[],name:t.name,description:t.productDesc,detail:t.productDetail,status:t.status,displayNumber:null!==(e=t.showId)&&void 0!==e?e:t.rank,buttonText:t.btnShow,featureTags:bt(t.features),pushRule:t.productPushRule,pushLogId:t.logId,rank:t.rank,originalData:t,topping:c(t.toppingEnable,"N"),origin:t.productOrigin,version:t.version,tags:gt(t.tags)},n={linkType:t.linkType,jumpWay:ct.NewWindow,link:t.link,pcLink:t.pcLink,mobileLink:t.mobileLink,mobileAppLink:t.mobileAppLink,androidLink:t.androidLink,iosLink:t.iosLink,harmonyLink:"",otherLink:t.otherLink,wxMiniprogramOriginalId:t.wxMiniprogramOriginalId,wxMiniprogramAppId:t.wxMiniprogramAppId,wxMiniprogramLink:t.wxMiniprogramLink};if(t.ext)try{var o=JSON.parse(t.ext);r.coverList=o.coverList||[t.cover],r.videoList=(o.videoList||[]).map(function(t){return t.videoId}),n.jumpWay=o.jumpWay,n.harmonyLink=o.harmonyLink;var i=[];r.videoList.forEach(function(t){i.push({type:P.MaterialVideo,materialId:t})}),r.coverList.forEach(function(t){i.push({type:P.Image,url:t})}),r.mediaList=i}catch(p){console.error("filterInternlData error",p)}var a,u={explainStatus:t.explainStatus,explainType:t.explainType,explainContent:t.aiCard,explainedCount:t.productExplainNum};switch(t.productType){case y.Normal:a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Normal,priceType:t.priceType,buyType:t.buyType,realPrice:t.realPrice,originPrice:t.price||void 0,originPriceType:t.originalPriceType||S.Amount,customOriginalPrice:t.customOriginalPrice,customPrice:t.customPrice,priceVisible:c(t.openPriceEnable,"Y"),deliveryType:t.deliveryType,customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,forceShowSoldOut:c(t.markAsSoldout,"N"),stockEnabled:c(t.stockEnabled,"N"),stock:t.stock});break;case y.Finance:a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Finance,yield:t.yield});break;case y.Position:r.description="",r.detail=t.productDesc;var s="";try{s=JSON.parse(t.params).treatment}catch(p){console.error(p)}a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Position,treatment:s})}if(!a)throw new Error("generate data fail");return a}function wt(t){t.productId,t.showId,t.rank,t.logId,t.productExplainNum,t.tags;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,dt);return e}function kt(t){var e,r=new Set(null!==(e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowEmptyKeys)&&void 0!==e?e:[]),n={};return Object.entries(t).forEach(function(t){var e=ft(t,2),o=e[0],i=e[1];if(""!==i&&null!=i)n[o]=i;else if(r.has(o)){if("price"===o)return;n[o]=i}}),n}function Ot(t){switch(t.productType){case y.Normal:return["productDesc","productDetail","price","customOriginalPrice","customerServiceContact","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];case y.Finance:return["cover","coverList","productDesc","yield","tagIds","features","description","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];case y.Position:return["cover","coverList","tagIds","features","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];default:return[]}}function Et(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"update",o=t.coverList;!o.length&&t.cover&&(o=[t.cover]),[y.Finance,y.Position].includes(t.productType)&&(o=t.cover?[t.cover]:[]);var i=null!==(e=t.videoList)&&void 0!==e?e:[],a=JSON.stringify({coverList:o,videoList:i.filter(Boolean).map(function(t){return{videoId:t,videoSource:"MATERIAL_LIBRARY"}}),jumpWay:t.jumpWay,harmonyLink:t.harmonyLink}),c=t.description;t.productType===y.Position&&(c=t.detail);var s,p,d={productId:null!==(r=t.productId)&&void 0!==r?r:0,cover:t.cover||o[0]||"",name:t.name,productDesc:c,productDetail:t.detail,status:t.status,showId:t.displayNumber,rank:t.rank,btnShow:t.buttonText,features:(s=t.featureTags,p=s.filter(function(t){return!!t}),JSON.stringify(p)),ext:a,productOrigin:t.origin,version:t.version,tagIds:t.tags.map(function(t){return t.value}),explainStatus:t.explainStatus,explainType:t.explainType,explainContent:t.explainContent,explainedCount:t.explainedCount,linkType:t.linkType,jumpWay:t.jumpWay,link:t.link,pcLink:t.pcLink,mobileLink:t.mobileLink,mobileAppLink:t.mobileAppLink,androidLink:t.androidLink,iosLink:t.iosLink,harmonyLink:t.harmonyLink,otherLink:t.otherLink,wxMiniprogramOriginalId:t.wxMiniprogramOriginalId,wxMiniprogramAppId:t.wxMiniprogramAppId,wxMiniprogramLink:t.wxMiniprogramLink};switch(t.productType){case y.Normal:var l=yt(yt({},d),{},{productType:y.Normal,priceType:t.priceType,buyType:t.buyType,realPrice:t.realPrice,price:t.originPrice,originalPriceType:t.originPriceType||S.Amount,customOriginalPrice:t.customOriginalPrice,customPrice:t.customPrice,openPriceEnable:u(t.priceVisible),deliveryType:t.deliveryType,customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,markAsSoldout:u(t.forceShowSoldOut),stockEnabled:u(t.stockEnabled),stock:t.stock});return kt("create"===n?wt(l):l,{allowEmptyKeys:Ot(t)});case y.Finance:var f=yt(yt({},d),{},{productType:y.Finance,yield:t.yield});return o.length&&(f.cover=o[0]),kt("create"===n?wt(f):f,{allowEmptyKeys:Ot(t)});case y.Position:var v=yt(yt({},d),{},{productType:y.Position,productDesc:t.detail,params:JSON.stringify({treatment:t.treatment})});return o.length&&(v.cover=o[0]),kt("create"===n?wt(v):v,{allowEmptyKeys:Ot(t)})}}function St(t){return{productExplainEnabled:void 0===t.productExplainEnabled?void 0:u(t.productExplainEnabled),productExplainingAutoPushAndSticky:void 0===t.productExplainingAutoPushAndSticky?void 0:u(t.productExplainingAutoPushAndSticky),productPushRule:t.productPushRule,hideProductPriceEnabled:void 0===t.hideProductPriceEnabled?void 0:u(t.hideProductPriceEnabled),productListSortType:t.productListSortType,productTagSortType:t.productTagSortType,productTagSortOrderIds:t.productTagSortIds,productTagSortOrderIdNames:void 0===t.productTagSortNames?void 0:t.productTagSortNames.map(function(t){return{id:t.value,name:t.label}}),productLinkJumpTipEnabled:void 0===t.productLinkJumpTipEnabled?void 0:u(t.productLinkJumpTipEnabled),productLinkJumpTipDetail:void 0===t.productLinkJumpTipDetail?void 0:JSON.stringify({ordinaryProductTip:t.productLinkJumpTipDetail.clickNormalProductTip,financialProductTip:t.productLinkJumpTipDetail.clickFinancialProductTip,jobProductTip:t.productLinkJumpTipDetail.clickPositionProductTip}),productHotEffectEnabled:void 0===t.productHotEffectEnabled?void 0:u(t.productHotEffectEnabled),productAiCardEnabled:void 0===t.productAiCardEnabled?void 0:u(t.productAiCardEnabled),outLinkProductRedirectEnabled:void 0===t.outLinkProductRedirectEnabled?void 0:u(t.outLinkProductRedirectEnabled),normalProductHotEffectTips:t.normalProductHotEffectTips,financeProductHotEffectTips:t.financeProductHotEffectTips,jobProductHotEffectTips:t.positionProductHotEffectTips}}function xt(t){return(xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){s=!0,o=p}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ct(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ct(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(Object(r),!0).forEach(function(e){Rt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function jt(){
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=Object.prototype.hasOwnProperty;function e(e,r){return t.call(e,r)}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e,n,o){null==n&&(n=""),""===n&&o.ignoreEmpty||("function"==typeof o.encode&&(e=o.encode(e),n=-1!==["boolean","string","number"].indexOf(r(n))?o.encode(String(n)):""),t.push(e+"="+n))}function o(t,e,r,o){r.forEach(function(r){n(t,e,r,o)})}function i(t,r){var i,a,u=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=0;r<(arguments.length<=1?0:arguments.length-1);r++){var n=r+1<1||arguments.length<=r+1?void 0:arguments[r+1];if(null!=n)for(var o in n)"__proto__"!==o&&e(n,o)&&(t[o]=n[o])}return t}({encode:encodeURIComponent},r),c=[];for(i in t)e(t,i)&&(a=t[i],Array.isArray(a)?o(c,i,a,u):n(c,i,a,u));return c.join("&")}function a(t,e,r){if(t=String(t),null==e)return t;if(!(e="string"==typeof e?e.replace(/^[?&]/,""):i(e,r)))return t;var n=function(t){var e={leftContext:""},r=t.indexOf("#");return-1!==r&&(e.hash=t.slice(r+1),t=t.slice(0,r)),-1!==(r=t.indexOf("?"))&&(e.search=t.slice(r+1),t=t.slice(0,r)),e.leftContext=t,e}(t),o=n.search||"";return o&&"&"!==o.slice(-1)&&(o+="&"),o+=e,n.search=o,function(t){var e=t.leftContext;return null!=t.search&&(e+="?"+t.search),null!=t.hash&&(e+="#"+t.hash),e}(n)}function u(t){if("boolean"!=typeof t)throw new Error("The value argument must be a boolean type");return t?"Y":"N"}function c(t,e){var r=String(t).toUpperCase();if("Y"!==r&&"N"!==r){if(null==e)throw new Error('The value argument must be "Y" or "N"');r=String(e).toUpperCase()}return"Y"===r}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==s(e)?e:e+""}var l=function(){return p(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.__eventStore={}},[{key:"__addOnEvent",value:function(t,e,r,n){if(e&&r){var o=this.__eventStore[e];o||(o=[]),o.push({type:t,handler:r,callbackHandler:r.bind(n)}),this.__eventStore[e]=o}}},{key:"on",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("normal",t,e,r)}},{key:"once",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("once",t,e,r)}},{key:"off",value:function(t,e){var r=this.__eventStore[t];r&&(r=r.filter(function(t){return t.handler!==e}),this.__eventStore[t]=r)}},{key:"emit",value:function(t,e,r){var n=this,o=this.__eventStore[t];o&&o.forEach(function(o){try{var i=o.type,a=o.handler,u=o.callbackHandler;"function"==typeof u&&u(e,r),"once"===i&&n.off(t,a)}catch(c){console.error(c)}})}},{key:"destroy",value:function(){this.__eventStore={}}}])}(),f=function(t){return t.GetProductTagList="/live/v4/watch/channel/product/tag/list",t.GetProductListByShowId="/live/v3/sdk/watch/interactive/product/list-by-showId",t.GetProductListByTag="/live/v4/watch/channel/product/list",t.GetProductDataById="/live/v3/sdk/watch/interactive/product/get-by-product-id",t.GetOrderList="/live/v4/watch/channel/viewer/product/order/list",t.GetOrderDetail="/live/v4/watch/channel/viewer/product/order/get-detail",t.ConfirmOrder="/live/v4/watch/channel/viewer/product/order/finish",t.CreateOrder="/live/v4/watch/channel/product/order/create",t.PayOrder="/live/v4/watch/channel/product/order/pay",t.ApplyOrderRefund="/live/v4/watch/channel/product/order/refund",t.GetOrderPaymentProviders="/live/v4/watch/channel/product/order/payment-providers/get",t.GetAddressList="/live/v4/watch/channel/viewer/address/list",t.GetDefaultAddress="/live/v4/watch/channel/viewer/address/get-default",t.AddAddress="/live/v4/watch/channel/viewer/address/save",t.UpdateAddress="/live/v4/watch/channel/viewer/address/update",t.DeleteAddress="/live/v4/watch/channel/viewer/address/delete",t.GetProductListByLaunch="/live/v4/channel/product/list",t.GetProductDataByLaunch="/live/v4/channel/product/get",t.StartProductExplain="/live/v4/channel/product/product-explain/start-now",t.EndProductExplain="/live/v4/channel/product/product-explain/end-now",t.RestartProductExplain="/live/v4/channel/product/product-explain/restart-now",t.DeleteProductExplain="/live/v4/channel/product/product-explain/delete",t.GetCurrentProductExplain="/live/v4/channel/product/product-explain/get-current-product-id",t.OpenProductPrice="/live/v4/channel/product/open-price",t.HideProductPrice="/live/v4/channel/product/un-open-price",t.ProductPushRule="/live/v4/channel/product/push/rule",t.UpdateProductPushRule="/live/v4/channel/product/push/rule/save",t.PushProduct="/live/v4/channel/product/push/push",t.CancelPushProduct="/live/v4/channel/product/push/cancel-push",t.BatchDeleteProduct="/live/v4/channel/product/delete-batch",t.BatchShelfProduct="/live/v4/channel/product/shelf-batch",t.TopProduct="/live/v4/channel/product/topping",t.CancelTopProduct="/live/v4/channel/product/un-topping",t.ToggleProductSoldOut="/live/v4/channel/product/update-mark-as-soldout",t.GetProductEnabled="/live/v4/channel/product/menu/get-enabled",t.UpdateProductEnabled="/live/v4/channel/product/menu/update-enabled",t.UpdateProductSort="/live/v4/channel/product/sort-rank",t.MoveProduct="/live/v4/channel/product/sort-rank-by-type",t.CreateAiCardTask="/live/v4/channel/product/create-ai-card-task",t.GetAiCardContent="/live/v4/channel/product/get-ai-card-task-output",t.UpdateAiCardContent="/live/v4/channel/product/update-ai-card-content",t.GetLaunchProductTagList="/live/v4/channel/product/tag/list-with-stats",t.CreateProductTag="/live/v4/channel/product/tag/create",t.UpdateProductTag="/live/v4/channel/product/tag/update",t.DeleteProductTag="/live/v4/channel/product/tag/delete",t.AssociateProductTag="/live/v4/channel/product/tag/add-refs",t.CreateProduct="/live/v4/channel/product/create",t.UpdateProduct="/live/v4/channel/product/update",t}({}),v=function(t){return t.ChooseCard="chooseCard",t.BigCard="bigCard",t.SmallCard="smallCard",t}({}),h=function(t){return t.OnSaleProduct="OnSaleProduct",t.OffSaleProduct="OffSaleProduct",t.AddProduct="AddProduct",t.DeleteProduct="DeleteProduct",t.ChangeProduct="ChangeProduct",t.MoveProduct="MoveProduct",t.ChangeProductRank="ChangeProductRank",t.ProductSoldOut="ProductSoldOut",t.PushProduct="PushProduct",t.CancelPushProduct="CancelPushProduct",t.ProductListEnabled="ProductListEnabled",t.RefreshProductList="RefreshProductList",t.ProductClick="ProductClick",t.ProductClickTimes="ProductClickTimes",t}({}),y=function(t){return t.Normal="normal",t.Finance="finance",t.Position="position",t}({}),m=function(t){return t[t.Normal=10]="Normal",t[t.MultiPlatform=11]="MultiPlatform",t[t.Native=12]="Native",t}({}),b=function(t){return t.PopUp="POP_UP",t.NewWindow="NEW_WINDOW",t.CurrentWindow="CURRENT_WINDOW",t}({}),g=function(t){return t[t.OnSale=1]="OnSale",t[t.OffSale=2]="OffSale",t}({}),P=function(t){return t.Image="image",t.MaterialVideo="material-video",t}({}),w=function(t){return t.NotExplained="notExplained",t.Explaining="explaining",t.Explained="explained",t}({}),k=function(t){return t.Live="live",t.Playback="recordFile",t}({}),O=function(t){return t.Start="start",t.End="end",t.Restart="restart",t}({}),E=function(t){return t.DirectBuy="inner",t.Link="link",t}({}),S=function(t){return t.Amount="AMOUNT",t.Custom="CUSTOM",t}({}),x=function(t){return t.Express="express",t.Virtual="virtual",t}({}),T=function(t){return t.WxWorkCode="wxWorkCode",t.Custom="custom",t}({}),C=function(t){return t.Edit="edit",t.Top="top",t.MoveUp="moveUp",t.MoveDown="moveDown",t.Delete="delete",t.OnShelf="onShelf",t.OffShelf="offShelf",t.Tag="tag",t.ViewStats="viewStats",t.ViewOrder="viewOrder",t}({}),A=function(t){return t.MoveUp="moveUp",t.MoveDown="moveDown",t}({}),I=function(t){return t.Asc="ASC",t.Desc="DESC",t}({}),j=function(t){return t.None="none",t.Custom="custom",t.External="external",t.Direct="direct",t.EnterpriseWeChat="enterpriseWeChat",t}({}),L=function(t){return t.Delta="delta",t.Complete="complete",t.Error="error",t}({}),_=function(t){return t.PlatformRef="platform-ref",t.Platform="platform",t.Create="create",t}({}),D=function(t){return t.V1="v1",t.V2="v2",t.V3="v3",t.Vn="vn",t}({}),N=function(t){return t.TagNameExists="tagNameExists",t.Unknown="unknown",t}({}),R=function(t){return t.Default="DEFAULT",t.Custom="CUSTOM",t}({});function M(t,e){var r;return e.some(function(e){var n,o=!1;return e.regExp?(o=e.regExp.test(t))&&(n=RegExp.$1):e.keywords?o=function(t,e){t=t.toLowerCase();var r=/[/\s;_-]/,n=/[/\s;_-]/;return e.some(function(e){var o=t.indexOf(e.toLowerCase());if(-1!==o&&(r.test(t[o-1])||0===o)&&(n.test(t[o+e.length])||o+e.length>=t.length))return!0})}(t,e.keywords):e.modelRegExp&&(o=function(t,e){return!!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(t)&&e.test(RegExp.$1)}(t,e.modelRegExp)),o&&(r={name:e.name,version:n}),o}),r}var W=[{name:"windows",regExp:/\bWindows\s?NT\s?(([\d.]+))\b/},{name:"ios",regExp:/\bOS(?:\s([\d_.]+))?\slike\sMac\sOS\sX\b/},{name:"macos",regExp:/\bMac\sOS\sX(?:\s([\d_.]+))?/},{name:"openharmony",regExp:/\bOpenHarmony\s([\d.]+)\b/},{name:"android",regExp:/\bAndroid;?(?:[-/\s]([\d.]+))?(?:\b|_)/},{name:"android",regExp:/\bAdr\s([\d.]+)(?:\b|_)/}];function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function H(t){var e=function(t,e){if("object"!=G(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=G(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==G(e)?e:e+""}var B=function(){return U(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._ver=(e||"").replace(/_/g,".").replace(/\.+$/,""),Object.freeze(this)},[{key:"_compare",value:function(t,e){if(!this._ver||!t)return!1;var r=Array.isArray(e)?e:[e],n=function(t,e){for(var r=/(\.0+)+$/,n=String(t).replace(r,"").split("."),o=String(e).replace(r,"").split("."),i=Math.min(n.length,o.length),a=0;a<i;a++){var u=parseInt(n[a])-parseInt(o[a]);if(u)return u}return n.length-o.length}(this._ver,t);return r.some(function(t){return n*t>0||0===n&&0===t})}},{key:"gt",value:function(t){return this._compare(t,1)}},{key:"gte",value:function(t){return this._compare(t,[1,0])}},{key:"lt",value:function(t){return this._compare(t,-1)}},{key:"lte",value:function(t){return this._compare(t,[-1,0])}},{key:"eq",value:function(t){return this._compare(t,0)}},{key:"toString",value:function(){return this._ver}}])}();function F(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var z={ios:"isIOS",openharmony:"isOpenHarmony",android:"isAndroid",windows:"isWindows",macos:"isMacOS"};var V=F(function t(e,r){var n,o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isIOS=!1,this.isAndroid=!1,this.isHarmonyOS=!1,this.isOpenHarmony=!1,this.isWindows=!1,this.isMacOS=!1,null==r?void 0:r.platform){var i=function(t){switch(t){case"Android":return"android";case"iPad":case"iPhone":case"iPod":return"ios";case"MacIntel":return"macos";case"Win32":return"windows"}}(r.platform);void 0!==i&&(o={name:i,version:""})}var a=null!==(n=M(e,W))&&void 0!==n?n:o;a?(o&&o.name!==a.name&&(a=o),"macos"===a.name&&(null==r?void 0:r.maxTouchPoints)&&(a.name="ios",a.version=""),this[z[a.name]]=!0,this.version=new B(a.version),this.isAndroid&&/\bHarmonyOS\b/.test(e)&&(this.isHarmonyOS=!0),Object.freeze(this)):this.version=Object.freeze(new B(""))}),$=[{name:"ipad",regExp:/iPad/},{name:"ipod",regExp:/iPod/},{name:"iphone",regExp:/iPhone/}],J=[{name:"huawei",regExp:/\b(?:huawei|honor)/i},{name:"huawei",keywords:["ideahub","figi"]},{name:"vivo",keywords:["vivo"]},{name:"oppo",keywords:["oppo"]},{name:"mi",keywords:["redmi","hongmi","shark","Mi","MIX","POCO","POCOPHONE"]},{name:"mi",regExp:/\bxiaomi/i},{name:"samsung",keywords:["samsung","galaxy"]},{name:"oneplus",keywords:["oneplus","one"]},{name:"huawei",modelRegExp:/^Mate\s*\d{2}/i},{name:"huawei",modelRegExp:/^Nova\s\d$/},{name:"huawei",regExp:/\b(?:Hi)?MatePad/i},{name:"huawei",regExp:/\b(?:Liantong|UNICOMVSENS)VP\d{3}\b/},{name:"huawei",regExp:/\bCMDCSP\d{3}\b/},{name:"huawei",regExp:/\bTDTECH/i},{name:"huawei",modelRegExp:/^[A-Z]{3}\d?-W[0-5]9[A-Z]*$/},{name:"huawei",modelRegExp:/^[A-Z][A-Za-z]{2,3}-(?:AN|BD|BX|AL|TL)\d{2}[A-Za-z]*$/},{name:"huawei",modelRegExp:/^TYH\d+[A-Z]?$/},{name:"huawei",modelRegExp:/^H60-L0[12]$/},{name:"mi",modelRegExp:/^MI\s?(?:\d|CC|Note|MAX|PLAY|PAD)/i},{name:"mi",modelRegExp:/^(?:AWM|SKR|SKW|DLT)-/},{name:"mi",modelRegExp:/^XIG\d{2}$/},{name:"mi",modelRegExp:/^M\d{4}[A-Z]\d{1,2}[A-Z]{1,3}$/},{name:"mi",modelRegExp:/^2\d{3}[A-Z0-9]{6}$/},{name:"mi",modelRegExp:/^2\d{5}[0-9A-Z]{2}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{6}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{7}[A-Z]{2,3}$/},{name:"samsung",modelRegExp:/^S(?:M|[CGP]H)-[A-Za-z0-9]+$/},{name:"samsung",modelRegExp:/^SCV3\d$/},{name:"samsung",modelRegExp:/^SC-\d{2}[A-Z]$/},{name:"samsung",modelRegExp:/^SH[WV]-/},{name:"samsung",modelRegExp:/^GT[-_][A-Z][A-Z0-9]{3,}$/i},{name:"oppo",modelRegExp:/^(?:CPH|OPD|iPA)\d{4}$/},{name:"oppo",modelRegExp:/^OPG\d{2}$/},{name:"oppo",modelRegExp:/^A[1-5]0[1-9]OP$/},{name:"oneplus",modelRegExp:/^(?:KB|HD|IN|GM|NE|LE|MT)\d{4}$/},{name:"vivo",modelRegExp:/^V[12]\d{3}[A-Z]{0,2}$/}];function Z(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var Q={ipod:"isIPod",iphone:"isIPhone",ipad:"isIPad",huawei:"isHuawei",mi:"isMi",oppo:"isOppo",vivo:"isVivo",oneplus:"isOnePlus",samsung:"isSamsung"},q=Z(function t(e,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isHuawei=!1,this.isMi=!1,this.isOppo=!1,this.isVivo=!1,this.isOnePlus=!1,this.isSamsung=!1,this.isIPod=!1,this.isIPhone=!1,this.isIPad=!1,this.isMac=!1,this.isApple=!1,r.isIOS?(n=$,this.isApple=!0):r.isMacOS?(this.isMac=!0,this.isApple=!0):(r.isAndroid||r.isOpenHarmony)&&(n=J),n){var o=M(e,n);o?this[Q[o.name]]=!0:r.isIOS&&(this.isIPad=!0)}Object.freeze(this)}),Y=[{name:"edge",regExp:/\bEdge\/([\d.]+)/},{name:"chrome",regExp:/\b(?:Chrome|CrMo|CriOS)\/([\d.]+)/},{name:"safari",regExp:/\b(?:Version\/([\d.]+).*\s?)?Safari\b/},{name:"ie",regExp:/\bMSIE\s(\d+)/i},{name:"ie",regExp:/\bTrident\/.*;\srv:(\d+)/},{name:"firefox",regExp:/\bFirefox\/([\d.]+)/},{name:"opera-presto",regExp:/\bOpera\/([\d.]+)/}];function K(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var X={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},tt=K(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isChrome=!1,this.isSafari=!1,this.isEdge=!1,this.isIE=!1,this.isFirefox=!1,this.isPrestoOpera=!1;var r=M(e,Y);r?(this[X[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),Object.freeze(this)}),et=[{name:"wxwork",regExp:/\bwxwork\/([\d.]+)/},{name:"wx",regExp:/\bMicroMessenger\/([\d.]+)/},{name:"ding",regExp:/\bDingTalk\/([\d.]+)/},{name:"qq",regExp:/\bQQ\/([\d.]+)/},{name:"qq",regExp:/\bIPadQQ\b/},{name:"weibo",regExp:/(?:\b|_)Weibo(?:\b|_)/i},{name:"edge",regExp:/\bEdge?\/([\d.]+)/},{name:"opera-blink",regExp:/\bOPR\/([\d.]+)/},{name:"qqbrowser",regExp:/\bM?QQBrowser(?:\/([\d.]+))?/i},{name:"ucbrowser",regExp:/\b(?:UCBrowser|UCWEB)(?:-CMCC)?\/?\s?([\d.]+)/},{name:"ucbrowser",regExp:/\bUC\b/},{name:"quark",regExp:/\bQuark\/([\d.]+)/},{name:"maxthon",regExp:/\b(?:Maxthon|MxBrowser)(?:[/\s]([\d.]+))?/},{name:"theworld",regExp:/\bTheWorld(?:\s([\d.]+))?/i},{name:"baidubrowser",regExp:/\b(?:baidubrowser|bdbrowser_i18n|BIDUBrowser)(?:[/\s]([\d.]+))?/i},{name:"baidubrowser",regExp:/\bbaidubrowserpad\b/},{name:"baiduapp",regExp:/\bbaiduboxapp\b\/([\d.]+)?/i},{name:"baiduapp",regExp:/\bbaiduboxpad\b/i}];function rt(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}et=et.concat(Y);var nt={wxwork:"isWxWork",wx:"isWx",ding:"isDing",qq:"isQQ",weibo:"isWeibo",edge:"isEdge","opera-blink":"isOpera","opera-presto":"isOpera",qqbrowser:"isQQBrowser",ucbrowser:"isUCBrowser",quark:"isQuark",maxthon:"isMaxthon",theworld:"isTheWorld",baidubrowser:"isBaiduBrowser",baiduapp:"isBaiduApp",chrome:"isChrome",safari:"isSafari",ie:"isIE",firefox:"isFirefox"},ot=rt(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isWxWork=!1,this.isWx=!1,this.isWxMiniProgram=!1,this.isDing=!1,this.isQQ=!1,this.isWeibo=!1,this.isEdge=!1,this.isOpera=!1,this.isQQBrowser=!1,this.isUCBrowser=!1,this.isQuark=!1,this.isMaxthon=!1,this.isTheWorld=!1,this.isBaiduBrowser=!1,this.isBaiduApp=!1,this.isChrome=!1,this.isSafari=!1,this.isIE=!1,this.isFirefox=!1;var r=M(e,et);r?(this[nt[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),this.isWxMiniProgram=(this.isWx||this.isWxWork)&&/\bMiniProgramEnv\b/.test(e),Object.freeze(this)});function it(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var at,ut=it(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.os=Object.freeze(new V(e,r)),this.brand=Object.freeze(new q(e,this.os)),this.browser=Object.freeze(new tt(e)),this.client=Object.freeze(new ot(e)),this.isTablet=this.brand.isIPad||/\bTablet\b/i.test(e)||this.os.isAndroid&&!/\bMobile\b/i.test(e),this.os.isIOS||this.os.isAndroid||this.isTablet?this.isPortable=!0:/\(X11[;)]/i.test(e)||/\b(Windows\sNT|Macintosh)\b/.test(e)?this.isPortable=!1:this.isPortable=/mobile|android/i.test(e),Object.freeze(this)});var ct,st,pt=(at||(at=Object.freeze("undefined"!=typeof window?new ut(window.navigator.userAgent,window.navigator):new ut(""))),at);pt.os.isAndroid,pt.os.isIOS,pt.os.isOpenHarmony,pt.isPortable,(st=ct||(ct={})).PopUp="POP_UP",st.NewWindow="NEW_WINDOW",st.CurrentWindow="CURRENT_WINDOW";var dt=["productId","showId","rank","logId","productExplainNum","tags"];function lt(t){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){s=!0,o=p}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(r),!0).forEach(function(e){mt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function mt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=lt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bt(t){var e=[];if(!t)return e;try{e=JSON.parse(t).filter(function(t){return!!t})}catch(r){console.error("parseFeature error",r)}return e}function gt(t){return t?t.map(function(t){return{label:t.name,value:t.id,associatedCount:0}}):[]}function Pt(t){var e,r={productId:t.productId,cover:t.cover,coverList:[t.cover],videoList:[],mediaList:[],name:t.name,description:t.productDesc,detail:t.productDetail,status:t.status,displayNumber:null!==(e=t.showId)&&void 0!==e?e:t.rank,buttonText:t.btnShow,featureTags:bt(t.features),pushRule:t.productPushRule,pushLogId:t.logId,rank:t.rank,originalData:t,topping:c(t.toppingEnable,"N"),origin:t.productOrigin,version:t.version,tags:gt(t.tags)},n={linkType:t.linkType,jumpWay:ct.NewWindow,link:t.link,pcLink:t.pcLink,mobileLink:t.mobileLink,mobileAppLink:t.mobileAppLink,androidLink:t.androidLink,iosLink:t.iosLink,harmonyLink:"",otherLink:t.otherLink,wxMiniprogramOriginalId:t.wxMiniprogramOriginalId,wxMiniprogramAppId:t.wxMiniprogramAppId,wxMiniprogramLink:t.wxMiniprogramLink};if(t.ext)try{var o=JSON.parse(t.ext);r.coverList=o.coverList||[t.cover],r.videoList=(o.videoList||[]).map(function(t){return t.videoId}),n.jumpWay=o.jumpWay,n.harmonyLink=o.harmonyLink;var i=[];r.videoList.forEach(function(t){i.push({type:P.MaterialVideo,materialId:t})}),r.coverList.forEach(function(t){i.push({type:P.Image,url:t})}),r.mediaList=i}catch(p){console.error("filterInternlData error",p)}var a,u={explainStatus:t.explainStatus,explainType:t.explainType,explainContent:t.aiCard,explainedCount:t.productExplainNum};switch(t.productType){case y.Normal:a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Normal,priceType:t.priceType,buyType:t.buyType,realPrice:t.realPrice,originPrice:t.price||void 0,originPriceType:t.originalPriceType||S.Amount,customOriginalPrice:t.customOriginalPrice,customPrice:t.customPrice,priceVisible:c(t.openPriceEnable,"Y"),deliveryType:t.deliveryType,customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,forceShowSoldOut:c(t.markAsSoldout,"N"),stockEnabled:c(t.stockEnabled,"N"),stock:t.stock});break;case y.Finance:a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Finance,yield:t.yield});break;case y.Position:r.description="",r.detail=t.productDesc;var s="";try{s=JSON.parse(t.params).treatment}catch(p){console.error(p)}a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Position,treatment:s})}if(!a)throw new Error("generate data fail");return a}function wt(t){t.productId,t.showId,t.rank,t.logId,t.productExplainNum,t.tags;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,dt);return e}function kt(t){var e,r=new Set(null!==(e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowEmptyKeys)&&void 0!==e?e:[]),n={};return Object.entries(t).forEach(function(t){var e=ft(t,2),o=e[0],i=e[1];if(""!==i&&null!=i)n[o]=i;else if(r.has(o)){if("price"===o)return;n[o]=i}}),n}function Ot(t){switch(t.productType){case y.Normal:return["productDesc","productDetail","price","customOriginalPrice","customerServiceContact","link","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];case y.Finance:return["cover","coverList","productDesc","yield","tagIds","features","description","link","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];case y.Position:return["cover","coverList","tagIds","features","link","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];default:return[]}}function Et(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"update",o=t.coverList;!o.length&&t.cover&&(o=[t.cover]),[y.Finance,y.Position].includes(t.productType)&&(o=t.cover?[t.cover]:[]);var i=null!==(e=t.videoList)&&void 0!==e?e:[],a=JSON.stringify({coverList:o,videoList:i.filter(Boolean).map(function(t){return{videoId:t,videoSource:"MATERIAL_LIBRARY"}}),jumpWay:t.jumpWay,harmonyLink:t.harmonyLink}),c=t.description;t.productType===y.Position&&(c=t.detail);var s,p,d={productId:null!==(r=t.productId)&&void 0!==r?r:0,cover:t.cover||o[0]||"",name:t.name,productDesc:c,productDetail:t.detail,status:t.status,showId:t.displayNumber,rank:t.rank,btnShow:t.buttonText,features:(s=t.featureTags,p=s.filter(function(t){return!!t}),JSON.stringify(p)),ext:a,productOrigin:t.origin,version:t.version,tagIds:t.tags.map(function(t){return t.value}),explainStatus:t.explainStatus,explainType:t.explainType,explainContent:t.explainContent,explainedCount:t.explainedCount,linkType:t.linkType,jumpWay:t.jumpWay,link:t.link,pcLink:t.pcLink,mobileLink:t.mobileLink,mobileAppLink:t.mobileAppLink,androidLink:t.androidLink,iosLink:t.iosLink,harmonyLink:t.harmonyLink,otherLink:t.otherLink,wxMiniprogramOriginalId:t.wxMiniprogramOriginalId,wxMiniprogramAppId:t.wxMiniprogramAppId,wxMiniprogramLink:t.wxMiniprogramLink};switch(t.productType){case y.Normal:var l=yt(yt({},d),{},{productType:y.Normal,priceType:t.priceType,buyType:t.buyType,realPrice:t.realPrice,price:t.originPrice,originalPriceType:t.originPriceType||S.Amount,customOriginalPrice:t.customOriginalPrice,customPrice:t.customPrice,openPriceEnable:u(t.priceVisible),deliveryType:t.deliveryType,customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,markAsSoldout:u(t.forceShowSoldOut),stockEnabled:u(t.stockEnabled),stock:t.stock});return kt("create"===n?wt(l):l,{allowEmptyKeys:Ot(t)});case y.Finance:var f=yt(yt({},d),{},{productType:y.Finance,yield:t.yield});return o.length&&(f.cover=o[0]),kt("create"===n?wt(f):f,{allowEmptyKeys:Ot(t)});case y.Position:var v=yt(yt({},d),{},{productType:y.Position,productDesc:t.detail,params:JSON.stringify({treatment:t.treatment})});return o.length&&(v.cover=o[0]),kt("create"===n?wt(v):v,{allowEmptyKeys:Ot(t)})}}function St(t){return{productExplainEnabled:void 0===t.productExplainEnabled?void 0:u(t.productExplainEnabled),productExplainingAutoPushAndSticky:void 0===t.productExplainingAutoPushAndSticky?void 0:u(t.productExplainingAutoPushAndSticky),productPushRule:t.productPushRule,hideProductPriceEnabled:void 0===t.hideProductPriceEnabled?void 0:u(t.hideProductPriceEnabled),productListSortType:t.productListSortType,productTagSortType:t.productTagSortType,productTagSortOrderIds:t.productTagSortIds,productTagSortOrderIdNames:void 0===t.productTagSortNames?void 0:t.productTagSortNames.map(function(t){return{id:t.value,name:t.label}}),productLinkJumpTipEnabled:void 0===t.productLinkJumpTipEnabled?void 0:u(t.productLinkJumpTipEnabled),productLinkJumpTipDetail:void 0===t.productLinkJumpTipDetail?void 0:JSON.stringify({ordinaryProductTip:t.productLinkJumpTipDetail.clickNormalProductTip,financialProductTip:t.productLinkJumpTipDetail.clickFinancialProductTip,jobProductTip:t.productLinkJumpTipDetail.clickPositionProductTip}),productHotEffectEnabled:void 0===t.productHotEffectEnabled?void 0:u(t.productHotEffectEnabled),productAiCardEnabled:void 0===t.productAiCardEnabled?void 0:u(t.productAiCardEnabled),outLinkProductRedirectEnabled:void 0===t.outLinkProductRedirectEnabled?void 0:u(t.outLinkProductRedirectEnabled),normalProductHotEffectTips:t.normalProductHotEffectTips,financeProductHotEffectTips:t.financeProductHotEffectTips,jobProductHotEffectTips:t.positionProductHotEffectTips}}function xt(t){return(xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){s=!0,o=p}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ct(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ct(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(Object(r),!0).forEach(function(e){Rt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function jt(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return Lt(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(Lt(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Lt(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,Lt(d,"constructor",s),Lt(s,"constructor",c),c.displayName="GeneratorFunction",Lt(s,o,"GeneratorFunction"),Lt(d),Lt(d,o,"Generator"),Lt(d,n,function(){return this}),Lt(d,"toString",function(){return"[object Generator]"}),(jt=function(){return{w:i,m:l}})()}function Lt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Lt=function(t,e,r,n){function i(e,r){Lt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function _t(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Dt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){_t(i,n,o,a,u,"next",t)}function u(t){_t(i,n,o,a,u,"throw",t)}a(void 0)})}}function Nt(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mt(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rt(t,e,r){return(e=Mt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t){var e=function(t,e){if("object"!=xt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==xt(e)?e:e+""}var Wt="product",Gt=function(){return Nt(function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rt(this,"ProductType",y),Rt(this,"ProductLinkType",m),Rt(this,"ProductLinkJumpWay",b),Rt(this,"ProductBuyType",E),Rt(this,"ProductStatus",g),Rt(this,"ProductEvents",h),Rt(this,"ProductPriceType",S),Rt(this,"ProductExplainStatus",w),Rt(this,"ProductMediaType",P),Rt(this,"ProductDeliveryType",x),Rt(this,"ProductServiceType",T),Rt(this,"ProductPushRule",v),Rt(this,"ProductMoveOperation",A),Rt(this,"ProductSortType",I),Rt(this,"ProductMoreOperation",C),Rt(this,"ProductOrigin",_),Rt(this,"ProductVersion",D),Rt(this,"ProductTagFailReason",N),Rt(this,"ProductTagSortType",R),Rt(this,"eventEmitter",new l),Rt(this,"__isPushingProduct",!1),Rt(this,"__handleProductMessage",function(t){switch(Number(t.status)){case 1:n.eventEmitter.emit(h.OnSaleProduct,{productData:Pt(t.content)});break;case 2:n.eventEmitter.emit(h.OffSaleProduct,{productData:Pt(t.content)});break;case 3:n.__currentPushingProductId===t.content.productId&&n.__clearCurrentPushingProduct(),n.eventEmitter.emit(h.DeleteProduct,{productId:t.content.productId});break;case 4:n.eventEmitter.emit(h.AddProduct,{productData:Pt(t.content)});break;case 5:n.eventEmitter.emit(h.ChangeProduct,{productData:Pt(t.content)});break;case 6:case 7:var e=t.content,r=[Pt(e[0]),Pt(e[1])];n.eventEmitter.emit(h.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(h.ChangeProductRank,{productData:Pt(t.content)});break;case 9:var o=t.content;n.__currentPushingProductId=o.productId,n.__currentPushingProductPushRule=o.productPushRule,n.__isPushingProduct=!0,n.eventEmitter.emit(h.PushProduct,{productData:Pt(o),pushRule:o.productPushRule});break;case 10:var i=t.content;n.eventEmitter.emit(h.ProductListEnabled,{enabled:"Y"===i.enabled});break;case 11:n.__clearCurrentPushingProduct(),n.__isPushingProduct=!0,n.eventEmitter.emit(h.CancelPushProduct,{productId:t.content.productId});break;case 12:n.eventEmitter.emit(h.ProductSoldOut,{productId:t.content.productId})}}),Rt(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(h.RefreshProductList,{})}),Rt(this,"__handleProductClickEvent",function(t){n.eventEmitter.emit(h.ProductClick,{productId:t.productId,name:t.positionName,productType:t.type})}),Rt(this,"__handleProductClickTimes",function(t){n.eventEmitter.emit(h.ProductClickTimes,{productId:t.productId,name:t.positionName,productType:t.type,times:t.times})}),this.interactionCore=e,this.config=r,e.addSocketHandles(Wt,{PRODUCT_MESSAGE:this.__handleProductMessage}),e.addSocketHandles(Wt,{REFRESH_PRODUCT_LIST:this.__handleRefreshProductList,PRODUCT_CLICK:this.__handleProductClickEvent,PRODUCT_CLICK_TIMES:this.__handleProductClickTimes},"product")},[{key:"__clearCurrentPushingProduct",value:function(){this.__currentPushingProductId=void 0,this.__currentPushingProductPushRule=void 0}},{key:"getProductTagList",value:(mt=Dt(jt().m(function t(){var e,r,n,o,i,a=arguments;return jt().w(function(t){for(;;)if(0===t.n)return o=null!==(e=(n=a.length>0&&void 0!==a[0]?a[0]:{}).pageNumber)&&void 0!==e?e:1,i=null!==(r=n.pageSize)&&void 0!==r?r:10,t.a(2,this.interactionCore.polyvApi.get(f.GetProductTagList,{pageNumber:o,pageSize:i}))},t,this)})),function(){return mt.apply(this,arguments)})},{key:"getProductList",value:(yt=Dt(jt().m(function t(){var e,r,n,o,i,a,u,c,s,p,d=arguments;return jt().w(function(t){for(;;)switch(t.n){case 0:if(r=(e=d.length>0&&void 0!==d[0]?d[0]:{}).count,n=void 0===r?10:r,o=[],a=0,!e.keyword&&!e.tagId){t.n=2;break}return u=e.page,c=void 0===u?1:u,t.n=1,this.interactionCore.polyvApi.get(f.GetProductListByTag,{keyword:e.keyword,tagId:e.tagId,pageNumber:c,pageSize:n});case 1:s=t.v,o=s.contents,a=s.totalItems,t.n=4;break;case 2:return t.n=3,this.interactionCore.polyvApi.get(f.GetProductListByShowId,{count:n,showId:e.displayNumber},{useAESDecrypt:!0});case 3:p=t.v,o=p.content,i=p.toppingProduct,a=p.total;case 4:return t.a(2,{contents:o.map(function(t){return Pt(t)}),toppingProduct:i?Pt(i):void 0,total:a})}},t,this)})),function(){return yt.apply(this,arguments)})},{key:"getLaunchProductList",value:(ht=Dt(jt().m(function t(e){var r,n,o,i,a,u,c,s,p,d;return jt().w(function(t){for(;;)switch(t.n){case 0:if(n=e.pageNumber,o=void 0===n?1:n,i=e.pageSize,a=void 0===i?10:i,u=e.status,c=e.keyword,s={pageNumber:o,pageSize:a,status:u,keyword:c},!e.origin||"all"===e.origin){t.n=4;break}d=e.origin,t.n=d===_.PlatformRef?1:d===_.Platform?2:d===_.Create?3:4;break;case 1:return s.version=D.V2,t.a(3,4);case 2:return s.version=D.V3,t.a(3,4);case 3:return s.version=D.V1,t.a(3,4);case 4:return e.type&&"all"!==e.type&&(s.productType=e.type),null!==(r=e.tagIds)&&void 0!==r&&r.length&&(s.tagIds=e.tagIds),t.n=5,this.interactionCore.polyvApi.get(f.GetProductListByLaunch,s);case 5:return p=t.v,t.a(2,{pageNumber:p.pageNumber,pageSize:p.pageSize,totalItems:p.totalItems,totalPages:p.totalPages,contents:p.contents.map(function(t){return Pt(t)}),upCount:p.ext.upCount,downCount:p.ext.downCount})}},t,this)})),function(t){return ht.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(vt=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.productAiCardEnabled)&&void 0!==n&&n)}},t,this)})),function(){return vt.apply(this,arguments)})},{key:"createProductAiCardTask",value:(ft=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.CreateAiCardTask,{productId:e});case 1:return r=t.v,t.a(2,r)}},t,this)})),function(t){return ft.apply(this,arguments)})},{key:"getProductAiCardContent",value:(lt=Dt(jt().m(function t(e){var r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetAiCardContent,{taskId:e});case 1:if((r=t.v).length){t.n=2;break}return t.a(2,{error:!1,completed:!1,data:""});case 2:return n=r.reduce(function(t,e){return[L.Complete,L.Error].includes(e.event)||(t+=e.data),t},""),o=r.some(function(t){return t.event===L.Error}),i=r.some(function(t){return t.event===L.Complete}),t.a(2,{error:o,completed:i,data:n})}},t,this)})),function(t){return lt.apply(this,arguments)})},{key:"updateProductAiCardContent",value:(dt=Dt(jt().m(function t(e,r,n){var o;return jt().w(function(t){for(;;)switch(t.n){case 0:return o={productId:e,aiCardContent:r},void 0!==n&&(o.saveOnly=u(!n)),t.n=1,this.interactionCore.polyvApi.post(f.UpdateAiCardContent,o);case 1:return t.a(2)}},t,this)})),function(t,e,r){return dt.apply(this,arguments)})},{key:"getProductData",value:(pt=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductDataById,{productId:e},{useAESDecrypt:!0});case 1:if(o=t.v){t.n=2;break}return t.a(2,void 0);case 2:if(i=Pt(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){t.n=4;break}return t.n=3,this.interactionCore.otherApi.get(i.detail,{});case 3:a=t.v,i.detail=a.productDetail;case 4:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){t.n=6;break}return t.n=5,this.interactionCore.otherApi.get(i.explainContent,{});case 5:u=t.v,i.explainContent=u.aiCardContent;case 6:return t.a(2,i)}},t,this)})),function(t){return pt.apply(this,arguments)})},{key:"getLaunchProductData",value:(st=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductDataByLaunch,{productId:e},{useAESDecrypt:!0});case 1:if(o=t.v,i=Pt(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){t.n=3;break}return t.n=2,this.interactionCore.otherApi.get(i.detail,{});case 2:a=t.v,i.detail=a.productDetail;case 3:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){t.n=5;break}return t.n=4,this.interactionCore.otherApi.get(i.explainContent,{});case 4:u=t.v,i.explainContent=u.aiCardContent;case 5:return t.a(2,i)}},t,this)})),function(t){return st.apply(this,arguments)})},{key:"getLaunchProductTagList",value:(ct=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return r=e.pageNumber,n=void 0===r?1:r,o=e.pageSize,i=void 0===o?10:o,a=e.keyword,t.n=1,this.interactionCore.polyvApi.get(f.GetLaunchProductTagList,{pageNumber:n,pageSize:i,keyword:a});case 1:return u=t.v,t.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,contents:u.contents.map(function(t){var e;return{label:t.name,value:t.id,associatedCount:null!==(e=t.productCount)&&void 0!==e?e:0}}),totalItems:u.totalItems,totalPages:u.totalPages})}},t,this)})),function(t){return ct.apply(this,arguments)})},{key:"createProductTag",value:(ut=Dt(jt().m(function t(e){var r,n,o,i;return jt().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.CreateProductTag,{name:e});case 1:return n=t.v,t.a(2,{success:!0,label:n.name,value:n.id,associatedCount:null!==(r=n.productCount)&&void 0!==r?r:0});case 2:if(t.p=2,i=t.v,40009!==(o=i).code){t.n=3;break}return t.a(2,{success:!1,failReason:N.TagNameExists});case 3:return t.a(2,{success:!1,failReason:N.Unknown,failMessage:o.message})}},t,this,[[0,2]])})),function(t){return ut.apply(this,arguments)})},{key:"updateProductTag",value:(at=Dt(jt().m(function t(e,r){var n,o;return jt().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.UpdateProductTag,{id:e,name:r});case 1:return t.a(2,{success:!0});case 2:if(t.p=2,o=t.v,40009!==(n=o).code){t.n=3;break}return t.a(2,{success:!1,failReason:N.TagNameExists});case 3:return t.a(2,{success:!1,failReason:N.Unknown,failMessage:n.message})}},t,this,[[0,2]])})),function(t,e){return at.apply(this,arguments)})},{key:"deleteProductTag",value:(it=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.DeleteProductTag,{id:e}))},t,this)})),function(t){return it.apply(this,arguments)})},{key:"associateProductTag",value:(ot=Dt(jt().m(function t(e,r){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.AssociateProductTag,{productIds:e,tagIds:r}))},t,this)})),function(t,e){return ot.apply(this,arguments)})},{key:"createProduct",value:(nt=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)if(0===t.n)return r=Et(e,"create"),t.a(2,this.interactionCore.polyvApi.post(f.CreateProduct,r))},t,this)})),function(t){return nt.apply(this,arguments)})},{key:"updateProduct",value:(rt=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)if(0===t.n)return r=Et(e,"update"),t.a(2,this.interactionCore.polyvApi.post(f.UpdateProduct,r))},t,this)})),function(t){return rt.apply(this,arguments)})},{key:"sendProductClickEvent",value:(et=Dt(jt().m(function t(e){var r,n,o,i,a;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.getUserInfo();case 1:return o=t.v,t.n=2,this.interactionCore.getChannelInfo();case 2:return i=t.v,t.n=3,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 3:if(null!=(a=t.v)&&a.productHotEffectEnabled||null!=a&&a.productLinkJumpTipEnabled){t.n=4;break}return t.a(2);case 4:this.interactionCore.emitSocket({EVENT:"PRODUCT_CLICK",data:{productId:e.productId,type:e.productType,nickName:o.nick,positionName:e.name},roomId:i.channelId},"product");case 5:return t.a(2)}},t,this)})),function(t){return et.apply(this,arguments)})},{key:"closeProductPush",value:function(){this.eventEmitter.emit(h.CancelPushProduct,{})}},{key:"getProductExplainEnabled",value:(tt=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.productExplainEnabled)&&void 0!==n&&n)}},t,this)})),function(){return tt.apply(this,arguments)})},{key:"getAssistantProductOperationEnabled",value:(X=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.assistantProductOperationEnabled)&&void 0!==n&&n)}},t,this)})),function(){return X.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(K=Dt(jt().m(function t(e){var r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return r=this.interactionCore.getDomainInfo(),t.n=1,this.interactionCore.getChannelInfo();case 1:return n=t.v,o=It({channelId:n.channelId},e||{}),t.a(2,a("".concat(r.watchPageDomain,"/landing/product/explain"),o))}},t,this)})),function(t){return K.apply(this,arguments)})},{key:"getOutLinkProductRedirectEnabled",value:(Y=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.outLinkProductRedirectEnabled)&&void 0!==n&&n)}},t,this)})),function(){return Y.apply(this,arguments)})},{key:"getProductPayOrderEnabled",value:(q=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:if(o=t.v){t.n=2;break}return t.a(2,!1);case 2:return t.a(2,null!==(n=o.productPayOrderEnabled)&&void 0!==n&&n)}},t,this)})),function(){return q.apply(this,arguments)})},{key:"getProductHotSaleConfig",value:(Q=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:if(o=t.v){t.n=2;break}return t.a(2);case 2:return t.a(2,{productHotEffectEnabled:null!==(n=o.productHotEffectEnabled)&&void 0!==n&&n,productHotEffectTips:o.productHotEffectTips})}},t,this)})),function(){return Q.apply(this,arguments)})},{key:"getCurrentPushingProductId",value:function(){return this.__currentPushingProductId}},{key:"getCurrentPushingProduct",value:(Z=Dt(jt().m(function t(e){var r,n,o,i,a,u,c,s;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 1:if(o=t.v,this.__isPushingProduct?(i=this.__currentPushingProductId,a=this.__currentPushingProductPushRule):(i=null!=e?e:null==o||null===(u=o.channelProductPushingStatusVO)||void 0===u?void 0:u.productId,a=null==o||null===(c=o.channelProductPushingStatusVO)||void 0===c?void 0:c.pushRule),i){t.n=2;break}return t.a(2);case 2:return t.n=3,this.getProductData(i);case 3:if(s=t.v){t.n=4;break}return t.a(2);case 4:return t.a(2,It(It({},s),{},{pushRule:a}))}},t,this)})),function(t){return Z.apply(this,arguments)})},{key:"_explainProduct",value:(J=Dt(jt().m(function t(e,r){var n,o,i,a;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.getChannelInfo();case 1:n=t.v,o={sessionId:n.sessionId||"",productId:e},a=r,t.n=a===O.Start?2:a===O.Restart?3:4;break;case 2:return i=f.StartProductExplain,t.a(3,5);case 3:return i=f.RestartProductExplain,t.a(3,5);case 4:return i=f.EndProductExplain,o.recordType=r,t.a(3,5);case 5:return t.a(2,this.interactionCore.polyvApi.post(i,{data:o}))}},t,this)})),function(t,e){return J.apply(this,arguments)})},{key:"startExplain",value:function(t){return this._explainProduct(t,O.Start)}},{key:"restartExplain",value:function(t){return this._explainProduct(t,O.Restart)}},{key:"endExplain",value:function(t){return this._explainProduct(t,O.End)}},{key:"deleteExplain",value:($=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.DeleteProductExplain,{data:{productId:e}}))},t,this)})),function(t){return $.apply(this,arguments)})},{key:"getCurrentProductExplain",value:(V=Dt(jt().m(function t(){var e;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetCurrentProductExplain,{});case 1:return e=t.v,t.a(2,e)}},t,this)})),function(){return V.apply(this,arguments)})},{key:"openProductPrice",value:(z=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.OpenProductPrice,{productId:e}))},t,this)})),function(t){return z.apply(this,arguments)})},{key:"hideProductPrice",value:(F=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.HideProductPrice,{productId:e}))},t,this)})),function(t){return F.apply(this,arguments)})},{key:"getProductSetting",value:(B=Dt(jt().m(function t(){var e,r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.ProductPushRule,{});case 1:o=t.v;try{i=JSON.parse(o.productLinkJumpTipDetail)}catch(a){console.info("parse productLinkJumpTipDetail error",a)}return t.a(2,{pushingProduct:o.channelProductPushingStatusVO,productPushRule:o.productPushRule,productExplainEnabled:c(o.productExplainEnabled,"N"),productExplainingAutoPushAndSticky:c(o.productExplainingAutoPushAndSticky,"N"),hideProductPriceEnabled:c(o.hideProductPriceEnabled,"N"),productListSortType:o.productListSortType,productTagSortType:o.productTagSortType,productTagSortIds:o.productTagSortOrderIds,productTagSortNames:(o.productTagSortOrderIdNames||[]).map(function(t){return{label:t.name,value:t.id}}),productLinkJumpTipEnabled:c(o.productLinkJumpTipEnabled,"N"),productLinkJumpTipDetail:{clickNormalProductTip:(null===(e=i)||void 0===e?void 0:e.ordinaryProductTip)||"",clickFinancialProductTip:(null===(r=i)||void 0===r?void 0:r.financialProductTip)||"",clickPositionProductTip:(null===(n=i)||void 0===n?void 0:n.jobProductTip)||""},productHotEffectEnabled:c(o.productHotEffectEnabled,"N"),productAiCardEnabled:c(o.productAiCardEnabled,"N"),outLinkProductRedirectEnabled:c(o.outLinkProductRedirectEnabled,"N"),normalProductHotEffectTips:o.normalProductHotEffectTips,financeProductHotEffectTips:o.financeProductHotEffectTips,positionProductHotEffectTips:o.jobProductHotEffectTips})}},t,this)})),function(){return B.apply(this,arguments)})},{key:"updateProductSetting",value:(H=Dt(jt().m(function t(e){var r,n;return jt().w(function(t){for(;;)if(0===t.n)return r=St(e),n=Object.entries(r).reduce(function(t,e){var r=Tt(e,2),n=r[0],o=r[1];return void 0===o||(t[n]=o),t},{}),t.a(2,this.interactionCore.polyvApi.post(f.UpdateProductPushRule,n))},t,this)})),function(t){return H.apply(this,arguments)})},{key:"pushProduct",value:(U=Dt(jt().m(function t(e,r){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.PushProduct,{productId:e,productPushRule:r||v.SmallCard}))},t,this)})),function(t,e){return U.apply(this,arguments)})},{key:"cancelPushProduct",value:(G=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.CancelPushProduct,{productId:e}))},t,this)})),function(t){return G.apply(this,arguments)})},{key:"batchDeleteProduct",value:(W=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchDeleteProduct,{productIds:e}))},t,this)})),function(t){return W.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(M=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:e,status:g.OnSale}))},t,this)})),function(t){return M.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(k=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:e,status:g.OffSale}))},t,this)})),function(t){return k.apply(this,arguments)})},{key:"topProduct",value:(d=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.TopProduct,{productId:e}))},t,this)})),function(t){return d.apply(this,arguments)})},{key:"cancelTopProduct",value:(p=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.CancelTopProduct,{productId:e}))},t,this)})),function(t){return p.apply(this,arguments)})},{key:"setProductSoldOut",value:(s=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:e,markAsSoldout:"Y"}))},t,this)})),function(t){return s.apply(this,arguments)})},{key:"cancelProductSoldOut",value:(i=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:e,markAsSoldout:"N"}))},t,this)})),function(t){return i.apply(this,arguments)})},{key:"getProductEnabled",value:(o=Dt(jt().m(function t(){var e;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductEnabled,{});case 1:return e=t.v,t.a(2,c(e,"N"))}},t,this)})),function(){return o.apply(this,arguments)})},{key:"updateProductEnabled",value:(n=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.UpdateProductEnabled,{enabled:u(e)});case 1:return t.a(2)}},t,this)})),function(t){return n.apply(this,arguments)})},{key:"updateProductSort",value:(r=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(a(f.UpdateProductSort,e),{}))},t,this)})),function(t){return r.apply(this,arguments)})},{key:"moveProduct",value:(e=Dt(jt().m(function t(e,r){var n;return jt().w(function(t){for(;;)if(0===t.n)return n=r===A.MoveUp?10:20,t.a(2,this.interactionCore.polyvApi.post(f.MoveProduct,{productId:e,type:n}))},t,this)})),function(t,r){return e.apply(this,arguments)})},{key:"getSupportToDirectBuy",value:(t=Dt(jt().m(function t(){var e,r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getProductPayOrderEnabled();case 1:if(t.v){t.n=2;break}return t.a(2,!1);case 2:return t.n=3,this.interactionCore.getUserInfo();case 3:if((n=t.v).unionId){t.n=4;break}return t.a(2,!1);case 4:return t.n=5,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 5:if(null!=(o=t.v)&&o.directBuyEnabled){t.n=6;break}return t.a(2,!1);case 6:if((i=n.authType)&&i!==j.None){t.n=7;break}return t.a(2,!0);case 7:if(![j.Custom,j.External,j.Direct,j.EnterpriseWeChat].includes(i)){t.n=8;break}return t.a(2,!1);case 8:return t.a(2,!0)}},t,this)})),function(){return t.apply(this,arguments)})}]);var t,e,r,n,o,i,s,p,d,k,M,W,G,U,H,B,F,z,V,$,J,Z,Q,q,Y,K,X,tt,et,rt,nt,ot,it,at,ut,ct,st,pt,dt,lt,ft,vt,ht,yt,mt}(),Ut=function(t){return t.Wechat="WECHAT",t.Alipay="ALIPAY",t}({}),Ht=function(t){return t.WaitPay="wait_pay",t.WaitDelivery="wait_delivery",t.Delivering="delivering",t.Finish="finish",t.Close="close",t.Refunding="refunding",t.Refunded="refunded",t}({}),Bt=function(t){return t.WaitPay="wait_pay",t.Payed="payed",t.Free="free",t}({}),Ft=function(t){return t.Success="SUCCESS",t.Fail="FAIL",t.Processing="PROCESSING",t}({}),zt=function(t){return t.Unknown="unknown",t}({}),Vt=function(t){return t.Unknown="unknown",t}({});function $t(t){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(r),!0).forEach(function(e){Qt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Qt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=$t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$t(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t){return{customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,deliveryType:t.deliveryType,cover:t.productCover,name:t.productName,productId:t.productId,productSnapshotId:t.productSnapshotId,quantity:t.quantity,realPrice:t.amount,totalAmount:t.totalAmount}}function Yt(t){return t?{id:"",address:t.address,area:t.area,mobile:t.mobile,name:t.name}:{id:"",address:"",area:"",mobile:"",name:""}}function Kt(t){var e={amount:t.amount,channelId:t.channelId,products:t.products.map(qt),orderNo:t.orderNo,expressInfo:Yt()};switch(t.status){case Ht.WaitPay:return Zt(Zt({},e),{},{status:Ht.WaitPay,expiredAt:t.expireTime});case Ht.Close:return Zt(Zt({},e),{},{status:Ht.Close,expiredAt:t.expireTime});default:return Zt(Zt({},e),{},{status:t.status})}}function Xt(t){var e=Yt(t.addressExt),r={amount:t.amount,channelId:null,products:t.products.map(qt),orderNo:t.orderNo,createAt:t.createTime,transactionId:t.transactionId,expressEnabled:c(t.expressEnabled,"N"),expressInfo:e};switch(t.status){case Ht.WaitPay:return Zt(Zt({},r),{},{status:Ht.WaitPay,expiredAt:t.expireTime});case Ht.WaitDelivery:return Zt(Zt({},r),{},{status:Ht.WaitDelivery,payAt:t.payTime});case Ht.Delivering:return Zt(Zt({},r),{},{status:Ht.Delivering,payAt:t.payTime,deliveryAt:t.deliveryTime});case Ht.Finish:return Zt(Zt({},r),{},{status:Ht.Finish,payAt:t.payTime,deliveryAt:t.deliveryTime,finishAt:t.finishTime});case Ht.Close:return Zt(Zt({},r),{},{status:Ht.Close,expiredAt:t.expireTime});case Ht.Refunding:return Zt(Zt({},r),{},{status:Ht.Refunding,payAt:t.payTime,refundAt:t.refundTime,deliveryAt:t.deliveryTime});case Ht.Refunded:return Zt(Zt({},r),{},{status:Ht.Refunded,payAt:t.payTime,refundAt:t.refundTime,deliveryAt:t.deliveryTime,expiredAt:t.expireTime});default:return console.error("Unknown order status:".concat(t.status)),Zt(Zt({},r),{},{status:t.status})}}function te(t){return{type:t.type,aliPayLink:t.codeUrl,orderNo:t.payId,payStatus:t.payStatus,wxAppId:t.appId,nonceStr:t.nonceStr,package:t.prepayId,paySign:t.paySign,signType:t.signType,timeStamp:Number(t.timeStamp),payProvider:t.payProvider}}function ee(t){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ne(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?re(Object(r),!0).forEach(function(e){se(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function oe(){
|
|
3
|
+
var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return Lt(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(Lt(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Lt(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,Lt(d,"constructor",s),Lt(s,"constructor",c),c.displayName="GeneratorFunction",Lt(s,o,"GeneratorFunction"),Lt(d),Lt(d,o,"Generator"),Lt(d,n,function(){return this}),Lt(d,"toString",function(){return"[object Generator]"}),(jt=function(){return{w:i,m:l}})()}function Lt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Lt=function(t,e,r,n){function i(e,r){Lt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function _t(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Dt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){_t(i,n,o,a,u,"next",t)}function u(t){_t(i,n,o,a,u,"throw",t)}a(void 0)})}}function Nt(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mt(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rt(t,e,r){return(e=Mt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t){var e=function(t,e){if("object"!=xt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==xt(e)?e:e+""}var Wt="product",Gt=function(){return Nt(function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rt(this,"ProductType",y),Rt(this,"ProductLinkType",m),Rt(this,"ProductLinkJumpWay",b),Rt(this,"ProductBuyType",E),Rt(this,"ProductStatus",g),Rt(this,"ProductEvents",h),Rt(this,"ProductPriceType",S),Rt(this,"ProductExplainStatus",w),Rt(this,"ProductMediaType",P),Rt(this,"ProductDeliveryType",x),Rt(this,"ProductServiceType",T),Rt(this,"ProductPushRule",v),Rt(this,"ProductMoveOperation",A),Rt(this,"ProductSortType",I),Rt(this,"ProductMoreOperation",C),Rt(this,"ProductOrigin",_),Rt(this,"ProductVersion",D),Rt(this,"ProductTagFailReason",N),Rt(this,"ProductTagSortType",R),Rt(this,"eventEmitter",new l),Rt(this,"__isPushingProduct",!1),Rt(this,"__handleProductMessage",function(t){switch(Number(t.status)){case 1:n.eventEmitter.emit(h.OnSaleProduct,{productData:Pt(t.content)});break;case 2:n.eventEmitter.emit(h.OffSaleProduct,{productData:Pt(t.content)});break;case 3:n.__currentPushingProductId===t.content.productId&&n.__clearCurrentPushingProduct(),n.eventEmitter.emit(h.DeleteProduct,{productId:t.content.productId});break;case 4:n.eventEmitter.emit(h.AddProduct,{productData:Pt(t.content)});break;case 5:n.eventEmitter.emit(h.ChangeProduct,{productData:Pt(t.content)});break;case 6:case 7:var e=t.content,r=[Pt(e[0]),Pt(e[1])];n.eventEmitter.emit(h.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(h.ChangeProductRank,{productData:Pt(t.content)});break;case 9:var o=t.content;n.__currentPushingProductId=o.productId,n.__currentPushingProductPushRule=o.productPushRule,n.__isPushingProduct=!0,n.eventEmitter.emit(h.PushProduct,{productData:Pt(o),pushRule:o.productPushRule});break;case 10:var i=t.content;n.eventEmitter.emit(h.ProductListEnabled,{enabled:"Y"===i.enabled});break;case 11:n.__clearCurrentPushingProduct(),n.__isPushingProduct=!0,n.eventEmitter.emit(h.CancelPushProduct,{productId:t.content.productId});break;case 12:n.eventEmitter.emit(h.ProductSoldOut,{productId:t.content.productId})}}),Rt(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(h.RefreshProductList,{})}),Rt(this,"__handleProductClickEvent",function(t){n.eventEmitter.emit(h.ProductClick,{productId:t.productId,name:t.positionName,productType:t.type})}),Rt(this,"__handleProductClickTimes",function(t){n.eventEmitter.emit(h.ProductClickTimes,{productId:t.productId,name:t.positionName,productType:t.type,times:t.times})}),this.interactionCore=e,this.config=r,e.addSocketHandles(Wt,{PRODUCT_MESSAGE:this.__handleProductMessage}),e.addSocketHandles(Wt,{REFRESH_PRODUCT_LIST:this.__handleRefreshProductList,PRODUCT_CLICK:this.__handleProductClickEvent,PRODUCT_CLICK_TIMES:this.__handleProductClickTimes},"product")},[{key:"__clearCurrentPushingProduct",value:function(){this.__currentPushingProductId=void 0,this.__currentPushingProductPushRule=void 0}},{key:"getProductTagList",value:(bt=Dt(jt().m(function t(){var e,r,n,o,i,a=arguments;return jt().w(function(t){for(;;)if(0===t.n)return o=null!==(e=(n=a.length>0&&void 0!==a[0]?a[0]:{}).pageNumber)&&void 0!==e?e:1,i=null!==(r=n.pageSize)&&void 0!==r?r:10,t.a(2,this.interactionCore.polyvApi.get(f.GetProductTagList,{pageNumber:o,pageSize:i}))},t,this)})),function(){return bt.apply(this,arguments)})},{key:"getProductList",value:(mt=Dt(jt().m(function t(){var e,r,n,o,i,a,u,c,s,p,d=arguments;return jt().w(function(t){for(;;)switch(t.n){case 0:if(r=(e=d.length>0&&void 0!==d[0]?d[0]:{}).count,n=void 0===r?10:r,o=[],a=0,!e.keyword&&!e.tagId){t.n=2;break}return u=e.page,c=void 0===u?1:u,t.n=1,this.interactionCore.polyvApi.get(f.GetProductListByTag,{keyword:e.keyword,tagId:e.tagId,pageNumber:c,pageSize:n});case 1:s=t.v,o=s.contents,a=s.totalItems,t.n=4;break;case 2:return t.n=3,this.interactionCore.polyvApi.get(f.GetProductListByShowId,{count:n,showId:e.displayNumber},{useAESDecrypt:!0});case 3:p=t.v,o=p.content,i=p.toppingProduct,a=p.total;case 4:return t.a(2,{contents:o.map(function(t){return Pt(t)}),toppingProduct:i?Pt(i):void 0,total:a})}},t,this)})),function(){return mt.apply(this,arguments)})},{key:"getLaunchProductList",value:(yt=Dt(jt().m(function t(e){var r,n,o,i,a,u,c,s,p,d;return jt().w(function(t){for(;;)switch(t.n){case 0:if(n=e.pageNumber,o=void 0===n?1:n,i=e.pageSize,a=void 0===i?10:i,u=e.status,c=e.keyword,s={pageNumber:o,pageSize:a,status:u,keyword:c},!e.origin||"all"===e.origin){t.n=4;break}d=e.origin,t.n=d===_.PlatformRef?1:d===_.Platform?2:d===_.Create?3:4;break;case 1:return s.version=D.V2,t.a(3,4);case 2:return s.version=D.V3,t.a(3,4);case 3:return s.version=D.V1,t.a(3,4);case 4:return e.type&&"all"!==e.type&&(s.productType=e.type),null!==(r=e.tagIds)&&void 0!==r&&r.length&&(s.tagIds=e.tagIds),t.n=5,this.interactionCore.polyvApi.get(f.GetProductListByLaunch,s);case 5:return p=t.v,t.a(2,{pageNumber:p.pageNumber,pageSize:p.pageSize,totalItems:p.totalItems,totalPages:p.totalPages,contents:p.contents.map(function(t){return Pt(t)}),upCount:p.ext.upCount,downCount:p.ext.downCount})}},t,this)})),function(t){return yt.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(ht=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.productAiCardEnabled)&&void 0!==n&&n)}},t,this)})),function(){return ht.apply(this,arguments)})},{key:"createProductAiCardTask",value:(vt=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.CreateAiCardTask,{productId:e});case 1:return r=t.v,t.a(2,r)}},t,this)})),function(t){return vt.apply(this,arguments)})},{key:"getProductAiCardContent",value:(ft=Dt(jt().m(function t(e){var r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetAiCardContent,{taskId:e});case 1:if((r=t.v).length){t.n=2;break}return t.a(2,{error:!1,completed:!1,data:""});case 2:return n=r.reduce(function(t,e){return[L.Complete,L.Error].includes(e.event)||(t+=e.data),t},""),o=r.some(function(t){return t.event===L.Error}),i=r.some(function(t){return t.event===L.Complete}),t.a(2,{error:o,completed:i,data:n})}},t,this)})),function(t){return ft.apply(this,arguments)})},{key:"updateProductAiCardContent",value:(lt=Dt(jt().m(function t(e,r,n){var o;return jt().w(function(t){for(;;)switch(t.n){case 0:return o={productId:e,aiCardContent:r},void 0!==n&&(o.saveOnly=u(!n)),t.n=1,this.interactionCore.polyvApi.post(f.UpdateAiCardContent,o);case 1:return t.a(2)}},t,this)})),function(t,e,r){return lt.apply(this,arguments)})},{key:"getProductData",value:(dt=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductDataById,{productId:e},{useAESDecrypt:!0});case 1:if(o=t.v){t.n=2;break}return t.a(2,void 0);case 2:if(i=Pt(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){t.n=4;break}return t.n=3,this.interactionCore.otherApi.get(i.detail,{});case 3:a=t.v,i.detail=a.productDetail;case 4:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){t.n=6;break}return t.n=5,this.interactionCore.otherApi.get(i.explainContent,{});case 5:u=t.v,i.explainContent=u.aiCardContent;case 6:return t.a(2,i)}},t,this)})),function(t){return dt.apply(this,arguments)})},{key:"getLaunchProductData",value:(pt=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductDataByLaunch,{productId:e},{useAESDecrypt:!0});case 1:if(o=t.v,i=Pt(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){t.n=3;break}return t.n=2,this.interactionCore.otherApi.get(i.detail,{});case 2:a=t.v,i.detail=a.productDetail;case 3:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){t.n=5;break}return t.n=4,this.interactionCore.otherApi.get(i.explainContent,{});case 4:u=t.v,i.explainContent=u.aiCardContent;case 5:return t.a(2,i)}},t,this)})),function(t){return pt.apply(this,arguments)})},{key:"getLaunchProductTagList",value:(st=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return r=e.pageNumber,n=void 0===r?1:r,o=e.pageSize,i=void 0===o?10:o,a=e.keyword,t.n=1,this.interactionCore.polyvApi.get(f.GetLaunchProductTagList,{pageNumber:n,pageSize:i,keyword:a});case 1:return u=t.v,t.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,contents:u.contents.map(function(t){var e;return{label:t.name,value:t.id,associatedCount:null!==(e=t.productCount)&&void 0!==e?e:0}}),totalItems:u.totalItems,totalPages:u.totalPages})}},t,this)})),function(t){return st.apply(this,arguments)})},{key:"createProductTag",value:(ct=Dt(jt().m(function t(e){var r,n,o,i;return jt().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.CreateProductTag,{name:e});case 1:return n=t.v,t.a(2,{success:!0,label:n.name,value:n.id,associatedCount:null!==(r=n.productCount)&&void 0!==r?r:0});case 2:if(t.p=2,i=t.v,40009!==(o=i).code){t.n=3;break}return t.a(2,{success:!1,failReason:N.TagNameExists});case 3:return t.a(2,{success:!1,failReason:N.Unknown,failMessage:o.message})}},t,this,[[0,2]])})),function(t){return ct.apply(this,arguments)})},{key:"updateProductTag",value:(ut=Dt(jt().m(function t(e,r){var n,o;return jt().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.UpdateProductTag,{id:e,name:r});case 1:return t.a(2,{success:!0});case 2:if(t.p=2,o=t.v,40009!==(n=o).code){t.n=3;break}return t.a(2,{success:!1,failReason:N.TagNameExists});case 3:return t.a(2,{success:!1,failReason:N.Unknown,failMessage:n.message})}},t,this,[[0,2]])})),function(t,e){return ut.apply(this,arguments)})},{key:"deleteProductTag",value:(at=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.DeleteProductTag,{id:e}))},t,this)})),function(t){return at.apply(this,arguments)})},{key:"associateProductTag",value:(it=Dt(jt().m(function t(e,r){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.AssociateProductTag,{productIds:e,tagIds:r}))},t,this)})),function(t,e){return it.apply(this,arguments)})},{key:"createProduct",value:(ot=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)if(0===t.n)return r=Et(e,"create"),t.a(2,this.interactionCore.polyvApi.post(f.CreateProduct,r))},t,this)})),function(t){return ot.apply(this,arguments)})},{key:"updateProduct",value:(nt=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)if(0===t.n)return r=Et(e,"update"),t.a(2,this.interactionCore.polyvApi.post(f.UpdateProduct,r))},t,this)})),function(t){return nt.apply(this,arguments)})},{key:"sendProductClickEvent",value:(rt=Dt(jt().m(function t(e){var r,n,o,i,a;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.getUserInfo();case 1:return o=t.v,t.n=2,this.interactionCore.getChannelInfo();case 2:return i=t.v,t.n=3,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 3:if(null!=(a=t.v)&&a.productHotEffectEnabled||null!=a&&a.productLinkJumpTipEnabled){t.n=4;break}return t.a(2);case 4:this.interactionCore.emitSocket({EVENT:"PRODUCT_CLICK",data:{productId:e.productId,type:e.productType,nickName:o.nick,positionName:e.name},roomId:i.channelId},"product");case 5:return t.a(2)}},t,this)})),function(t){return rt.apply(this,arguments)})},{key:"closeProductPush",value:function(){this.eventEmitter.emit(h.CancelPushProduct,{})}},{key:"getProductExplainEnabled",value:(et=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.productExplainEnabled)&&void 0!==n&&n)}},t,this)})),function(){return et.apply(this,arguments)})},{key:"getAssistantProductOperationEnabled",value:(tt=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.assistantProductOperationEnabled)&&void 0!==n&&n)}},t,this)})),function(){return tt.apply(this,arguments)})},{key:"getMobileAnchorProductShelfEnabled",value:(X=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null===(n=null==o?void 0:o.mobileAnchorProductShelfEnabled)||void 0===n||n)}},t,this)})),function(){return X.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(K=Dt(jt().m(function t(e){var r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return r=this.interactionCore.getDomainInfo(),t.n=1,this.interactionCore.getChannelInfo();case 1:return n=t.v,o=It({channelId:n.channelId},e||{}),t.a(2,a("".concat(r.watchPageDomain,"/landing/product/explain"),o))}},t,this)})),function(t){return K.apply(this,arguments)})},{key:"getOutLinkProductRedirectEnabled",value:(Y=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.outLinkProductRedirectEnabled)&&void 0!==n&&n)}},t,this)})),function(){return Y.apply(this,arguments)})},{key:"getProductPayOrderEnabled",value:(q=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:if(o=t.v){t.n=2;break}return t.a(2,!1);case 2:return t.a(2,null!==(n=o.productPayOrderEnabled)&&void 0!==n&&n)}},t,this)})),function(){return q.apply(this,arguments)})},{key:"getProductHotSaleConfig",value:(Q=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:if(o=t.v){t.n=2;break}return t.a(2);case 2:return t.a(2,{productHotEffectEnabled:null!==(n=o.productHotEffectEnabled)&&void 0!==n&&n,productHotEffectTips:o.productHotEffectTips})}},t,this)})),function(){return Q.apply(this,arguments)})},{key:"getCurrentPushingProductId",value:function(){return this.__currentPushingProductId}},{key:"getCurrentPushingProduct",value:(Z=Dt(jt().m(function t(e){var r,n,o,i,a,u,c,s;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 1:if(o=t.v,this.__isPushingProduct?(i=this.__currentPushingProductId,a=this.__currentPushingProductPushRule):(i=null!=e?e:null==o||null===(u=o.channelProductPushingStatusVO)||void 0===u?void 0:u.productId,a=null==o||null===(c=o.channelProductPushingStatusVO)||void 0===c?void 0:c.pushRule),i){t.n=2;break}return t.a(2);case 2:return t.n=3,this.getProductData(i);case 3:if(s=t.v){t.n=4;break}return t.a(2);case 4:return t.a(2,It(It({},s),{},{pushRule:a}))}},t,this)})),function(t){return Z.apply(this,arguments)})},{key:"_explainProduct",value:(J=Dt(jt().m(function t(e,r){var n,o,i,a;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.getChannelInfo();case 1:n=t.v,o={sessionId:n.sessionId||"",productId:e},a=r,t.n=a===O.Start?2:a===O.Restart?3:4;break;case 2:return i=f.StartProductExplain,t.a(3,5);case 3:return i=f.RestartProductExplain,t.a(3,5);case 4:return i=f.EndProductExplain,o.recordType=r,t.a(3,5);case 5:return t.a(2,this.interactionCore.polyvApi.post(i,{data:o}))}},t,this)})),function(t,e){return J.apply(this,arguments)})},{key:"startExplain",value:function(t){return this._explainProduct(t,O.Start)}},{key:"restartExplain",value:function(t){return this._explainProduct(t,O.Restart)}},{key:"endExplain",value:function(t){return this._explainProduct(t,O.End)}},{key:"deleteExplain",value:($=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.DeleteProductExplain,{data:{productId:e}}))},t,this)})),function(t){return $.apply(this,arguments)})},{key:"getCurrentProductExplain",value:(V=Dt(jt().m(function t(){var e;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetCurrentProductExplain,{});case 1:return e=t.v,t.a(2,e)}},t,this)})),function(){return V.apply(this,arguments)})},{key:"openProductPrice",value:(z=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.OpenProductPrice,{productId:e}))},t,this)})),function(t){return z.apply(this,arguments)})},{key:"hideProductPrice",value:(F=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.HideProductPrice,{productId:e}))},t,this)})),function(t){return F.apply(this,arguments)})},{key:"getProductSetting",value:(B=Dt(jt().m(function t(){var e,r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.ProductPushRule,{});case 1:o=t.v;try{i=JSON.parse(o.productLinkJumpTipDetail)}catch(a){console.info("parse productLinkJumpTipDetail error",a)}return t.a(2,{pushingProduct:o.channelProductPushingStatusVO,productPushRule:o.productPushRule,productExplainEnabled:c(o.productExplainEnabled,"N"),productExplainingAutoPushAndSticky:c(o.productExplainingAutoPushAndSticky,"N"),hideProductPriceEnabled:c(o.hideProductPriceEnabled,"N"),productListSortType:o.productListSortType,productTagSortType:o.productTagSortType,productTagSortIds:o.productTagSortOrderIds,productTagSortNames:(o.productTagSortOrderIdNames||[]).map(function(t){return{label:t.name,value:t.id}}),productLinkJumpTipEnabled:c(o.productLinkJumpTipEnabled,"N"),productLinkJumpTipDetail:{clickNormalProductTip:(null===(e=i)||void 0===e?void 0:e.ordinaryProductTip)||"",clickFinancialProductTip:(null===(r=i)||void 0===r?void 0:r.financialProductTip)||"",clickPositionProductTip:(null===(n=i)||void 0===n?void 0:n.jobProductTip)||""},productHotEffectEnabled:c(o.productHotEffectEnabled,"N"),productAiCardEnabled:c(o.productAiCardEnabled,"N"),outLinkProductRedirectEnabled:c(o.outLinkProductRedirectEnabled,"N"),normalProductHotEffectTips:o.normalProductHotEffectTips,financeProductHotEffectTips:o.financeProductHotEffectTips,positionProductHotEffectTips:o.jobProductHotEffectTips})}},t,this)})),function(){return B.apply(this,arguments)})},{key:"updateProductSetting",value:(H=Dt(jt().m(function t(e){var r,n;return jt().w(function(t){for(;;)if(0===t.n)return r=St(e),n=Object.entries(r).reduce(function(t,e){var r=Tt(e,2),n=r[0],o=r[1];return void 0===o||(t[n]=o),t},{}),t.a(2,this.interactionCore.polyvApi.post(f.UpdateProductPushRule,n))},t,this)})),function(t){return H.apply(this,arguments)})},{key:"pushProduct",value:(U=Dt(jt().m(function t(e,r){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.PushProduct,{productId:e,productPushRule:r||v.SmallCard}))},t,this)})),function(t,e){return U.apply(this,arguments)})},{key:"cancelPushProduct",value:(G=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.CancelPushProduct,{productId:e}))},t,this)})),function(t){return G.apply(this,arguments)})},{key:"batchDeleteProduct",value:(W=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchDeleteProduct,{productIds:e}))},t,this)})),function(t){return W.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(M=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:e,status:g.OnSale}))},t,this)})),function(t){return M.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(k=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:e,status:g.OffSale}))},t,this)})),function(t){return k.apply(this,arguments)})},{key:"topProduct",value:(d=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.TopProduct,{productId:e}))},t,this)})),function(t){return d.apply(this,arguments)})},{key:"cancelTopProduct",value:(p=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.CancelTopProduct,{productId:e}))},t,this)})),function(t){return p.apply(this,arguments)})},{key:"setProductSoldOut",value:(s=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:e,markAsSoldout:"Y"}))},t,this)})),function(t){return s.apply(this,arguments)})},{key:"cancelProductSoldOut",value:(i=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:e,markAsSoldout:"N"}))},t,this)})),function(t){return i.apply(this,arguments)})},{key:"getProductEnabled",value:(o=Dt(jt().m(function t(){var e;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductEnabled,{});case 1:return e=t.v,t.a(2,c(e,"N"))}},t,this)})),function(){return o.apply(this,arguments)})},{key:"updateProductEnabled",value:(n=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.UpdateProductEnabled,{enabled:u(e)});case 1:return t.a(2)}},t,this)})),function(t){return n.apply(this,arguments)})},{key:"updateProductSort",value:(r=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(a(f.UpdateProductSort,e),{}))},t,this)})),function(t){return r.apply(this,arguments)})},{key:"moveProduct",value:(e=Dt(jt().m(function t(e,r){var n;return jt().w(function(t){for(;;)if(0===t.n)return n=r===A.MoveUp?10:20,t.a(2,this.interactionCore.polyvApi.post(f.MoveProduct,{productId:e,type:n}))},t,this)})),function(t,r){return e.apply(this,arguments)})},{key:"getSupportToDirectBuy",value:(t=Dt(jt().m(function t(){var e,r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getProductPayOrderEnabled();case 1:if(t.v){t.n=2;break}return t.a(2,!1);case 2:return t.n=3,this.interactionCore.getUserInfo();case 3:if((n=t.v).unionId){t.n=4;break}return t.a(2,!1);case 4:return t.n=5,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 5:if(null!=(o=t.v)&&o.directBuyEnabled){t.n=6;break}return t.a(2,!1);case 6:if((i=n.authType)&&i!==j.None){t.n=7;break}return t.a(2,!0);case 7:if(![j.Custom,j.External,j.Direct,j.EnterpriseWeChat].includes(i)){t.n=8;break}return t.a(2,!1);case 8:return t.a(2,!0)}},t,this)})),function(){return t.apply(this,arguments)})}]);var t,e,r,n,o,i,s,p,d,k,M,W,G,U,H,B,F,z,V,$,J,Z,Q,q,Y,K,X,tt,et,rt,nt,ot,it,at,ut,ct,st,pt,dt,lt,ft,vt,ht,yt,mt,bt}(),Ut=function(t){return t.Wechat="WECHAT",t.Alipay="ALIPAY",t}({}),Ht=function(t){return t.WaitPay="wait_pay",t.WaitDelivery="wait_delivery",t.Delivering="delivering",t.Finish="finish",t.Close="close",t.Refunding="refunding",t.Refunded="refunded",t}({}),Bt=function(t){return t.WaitPay="wait_pay",t.Payed="payed",t.Free="free",t}({}),Ft=function(t){return t.Success="SUCCESS",t.Fail="FAIL",t.Processing="PROCESSING",t}({}),zt=function(t){return t.Unknown="unknown",t}({}),Vt=function(t){return t.Unknown="unknown",t}({});function $t(t){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(r),!0).forEach(function(e){Qt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Qt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=$t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$t(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t){return{customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,deliveryType:t.deliveryType,cover:t.productCover,name:t.productName,productId:t.productId,productSnapshotId:t.productSnapshotId,quantity:t.quantity,realPrice:t.amount,totalAmount:t.totalAmount}}function Yt(t){return t?{id:"",address:t.address,area:t.area,mobile:t.mobile,name:t.name}:{id:"",address:"",area:"",mobile:"",name:""}}function Kt(t){var e={amount:t.amount,channelId:t.channelId,products:t.products.map(qt),orderNo:t.orderNo,expressInfo:Yt()};switch(t.status){case Ht.WaitPay:return Zt(Zt({},e),{},{status:Ht.WaitPay,expiredAt:t.expireTime});case Ht.Close:return Zt(Zt({},e),{},{status:Ht.Close,expiredAt:t.expireTime});default:return Zt(Zt({},e),{},{status:t.status})}}function Xt(t){var e=Yt(t.addressExt),r={amount:t.amount,channelId:null,products:t.products.map(qt),orderNo:t.orderNo,createAt:t.createTime,transactionId:t.transactionId,expressEnabled:c(t.expressEnabled,"N"),expressInfo:e};switch(t.status){case Ht.WaitPay:return Zt(Zt({},r),{},{status:Ht.WaitPay,expiredAt:t.expireTime});case Ht.WaitDelivery:return Zt(Zt({},r),{},{status:Ht.WaitDelivery,payAt:t.payTime});case Ht.Delivering:return Zt(Zt({},r),{},{status:Ht.Delivering,payAt:t.payTime,deliveryAt:t.deliveryTime});case Ht.Finish:return Zt(Zt({},r),{},{status:Ht.Finish,payAt:t.payTime,deliveryAt:t.deliveryTime,finishAt:t.finishTime});case Ht.Close:return Zt(Zt({},r),{},{status:Ht.Close,expiredAt:t.expireTime});case Ht.Refunding:return Zt(Zt({},r),{},{status:Ht.Refunding,payAt:t.payTime,refundAt:t.refundTime,deliveryAt:t.deliveryTime});case Ht.Refunded:return Zt(Zt({},r),{},{status:Ht.Refunded,payAt:t.payTime,refundAt:t.refundTime,deliveryAt:t.deliveryTime,expiredAt:t.expireTime});default:return console.error("Unknown order status:".concat(t.status)),Zt(Zt({},r),{},{status:t.status})}}function te(t){return{type:t.type,aliPayLink:t.codeUrl,orderNo:t.payId,payStatus:t.payStatus,wxAppId:t.appId,nonceStr:t.nonceStr,package:t.prepayId,paySign:t.paySign,signType:t.signType,timeStamp:Number(t.timeStamp),payProvider:t.payProvider}}function ee(t){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ne(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?re(Object(r),!0).forEach(function(e){se(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function oe(){
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
5
5
|
var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return ie(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(ie(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,ie(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,ie(d,"constructor",s),ie(s,"constructor",c),c.displayName="GeneratorFunction",ie(s,o,"GeneratorFunction"),ie(d),ie(d,o,"Generator"),ie(d,n,function(){return this}),ie(d,"toString",function(){return"[object Generator]"}),(oe=function(){return{w:i,m:l}})()}function ie(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(ie=function(t,e,r,n){function i(e,r){ie(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function ae(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function ue(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){ae(i,n,o,a,u,"next",t)}function u(t){ae(i,n,o,a,u,"throw",t)}a(void 0)})}}function ce(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pe(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function se(t,e,r){return(e=pe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pe(t){var e=function(t,e){if("object"!=ee(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==ee(e)?e:e+""}var de=function(){return ce(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),se(this,"OrderStatus",Ht),se(this,"PayStatus",Bt),se(this,"PaymentProvider",Ut),se(this,"ProductBuyType",E),se(this,"ProductType",y),se(this,"ProductDeliveryType",x),se(this,"RefundStatus",Ft),se(this,"CreateOrderFailReason",zt),se(this,"OrderRefundFailReason",Vt),this.interactionCore=e,this.config=r},[{key:"getOrderList",value:(o=ue(oe().m(function t(){var e,r,n,o,i,a,u,c=arguments;return oe().w(function(t){for(;;)switch(t.n){case 0:return r=(e=c.length>0&&void 0!==c[0]?c[0]:{}).pageNumber,n=void 0===r?1:r,o=e.pageSize,i=void 0===o?10:o,a=e.orderStatus,t.n=1,this.interactionCore.polyvApi.get(f.GetOrderList,{pageNumber:n,pageSize:i,orderStatus:a});case 1:return u=t.v,t.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,totalItems:u.totalItems,totalPages:u.totalPages,contents:u.contents.map(Kt)})}},t,this)})),function(){return o.apply(this,arguments)})},{key:"getOrderDetail",value:(n=ue(oe().m(function t(e){var r;return oe().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetOrderDetail,{orderNo:e.orderNo,syncPayStatus:u(e.syncPayStatus)});case 1:return r=t.v,t.a(2,Xt(r))}},t,this)})),function(t){return n.apply(this,arguments)})},{key:"createOrder",value:(r=ue(oe().m(function t(e){var r,n;return oe().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.CreateOrder,e);case 1:return r=t.v,t.a(2,ne({success:!0},te(r)));case 2:return t.p=2,n=t.v,t.a(2,{success:!1,failReason:zt.Unknown,failMessage:n instanceof Error?n.message:void 0})}},t,this,[[0,2]])})),function(t){return r.apply(this,arguments)})},{key:"confirmOrder",value:(e=ue(oe().m(function t(e){return oe().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(a(f.ConfirmOrder,{orderNo:e}),{}))},t,this)})),function(t){return e.apply(this,arguments)})},{key:"applyOrderRefund",value:(t=ue(oe().m(function t(e){var r,n;return oe().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.ApplyOrderRefund,{orderNo:e});case 1:return r=t.v,t.a(2,ne({success:!0},r));case 2:return t.p=2,n=t.v,t.a(2,{success:!1,failReason:Vt.Unknown,failMessage:n instanceof Error?n.message:void 0})}},t,this,[[0,2]])})),function(e){return t.apply(this,arguments)})}]);var t,e,r,n,o}();function le(t){return t?{id:t.id,address:t.address,area:t.area,mobile:t.mobile,name:t.name}:{id:"",address:"",area:"",mobile:"",name:""}}function fe(t){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ve(){
|
|
6
6
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
7
7
|
var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return he(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(he(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,he(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,he(d,"constructor",s),he(s,"constructor",c),c.displayName="GeneratorFunction",he(s,o,"GeneratorFunction"),he(d),he(d,o,"Generator"),he(d,n,function(){return this}),he(d,"toString",function(){return"[object Generator]"}),(ve=function(){return{w:i,m:l}})()}function he(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(he=function(t,e,r,n){function i(e,r){he(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach(function(e){be(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function be(t,e,r){return(e=ke(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ge(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Pe(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){ge(i,n,o,a,u,"next",t)}function u(t){ge(i,n,o,a,u,"throw",t)}a(void 0)})}}function we(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ke(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ke(t){var e=function(t,e){if("object"!=fe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==fe(e)?e:e+""}var Oe=function(){return we(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.interactionCore=e,this.config=r},[{key:"getAddressList",value:(o=Pe(ve().m(function t(){var e,r,n,o,i,a,u=arguments;return ve().w(function(t){for(;;)switch(t.n){case 0:return r=(e=u.length>0&&void 0!==u[0]?u[0]:{}).pageNumber,n=void 0===r?1:r,o=e.pageSize,i=void 0===o?10:o,t.n=1,this.interactionCore.polyvApi.get(f.GetAddressList,{pageNumber:n,pageSize:i});case 1:return a=t.v,t.a(2,me(me({},a),{},{contents:a.contents.map(le)}))}},t,this)})),function(){return o.apply(this,arguments)})},{key:"getDefaultAddress",value:(n=Pe(ve().m(function t(){var e;return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetDefaultAddress,{});case 1:return e=t.v,t.a(2,le(e))}},t,this)})),function(){return n.apply(this,arguments)})},{key:"addAddress",value:(r=Pe(ve().m(function t(e){var r;return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.AddAddress,e);case 1:return r=t.v,t.a(2,le(r))}},t,this)})),function(t){return r.apply(this,arguments)})},{key:"updateAddress",value:(e=Pe(ve().m(function t(e){return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.UpdateAddress,e);case 1:return t.a(2,t.v)}},t,this)})),function(t){return e.apply(this,arguments)})},{key:"deleteAddress",value:(t=Pe(ve().m(function t(e){return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.DeleteAddress,{id:e});case 1:return t.a(2,t.v)}},t,this)})),function(e){return t.apply(this,arguments)})}]);var t,e,r,n,o}();function Ee(t){return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(){
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
9
|
-
var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return xe(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(xe(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,xe(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,xe(d,"constructor",s),xe(s,"constructor",c),c.displayName="GeneratorFunction",xe(s,o,"GeneratorFunction"),xe(d),xe(d,o,"Generator"),xe(d,n,function(){return this}),xe(d,"toString",function(){return"[object Generator]"}),(Se=function(){return{w:i,m:l}})()}function xe(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(xe=function(t,e,r,n){function i(e,r){xe(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function Te(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Ce(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Te(i,n,o,a,u,"next",t)}function u(t){Te(i,n,o,a,u,"throw",t)}a(void 0)})}}function Ae(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ie(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ie(t){var e=function(t,e){if("object"!=Ee(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Ee(e)?e:e+""}var je=function(){return Ae(function t(e,r){var n,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,i=Ut,(o=Ie(o="PaymentProvider"))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,this.interactionCore=e,this.config=r},[{key:"getPayOrderParams",value:(e=Ce(Se().m(function t(e){var r;return Se().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.PayOrder,e);case 1:return r=t.v,t.a(2,te(r))}},t,this)})),function(t){return e.apply(this,arguments)})},{key:"getPayProviders",value:(t=Ce(Se().m(function t(){var e,r=this;return Se().w(function(t){for(;;)switch(t.n){case 0:if(!this.__payProviderCache){t.n=1;break}return t.a(2,this.__payProviderCache);case 1:return e=this.interactionCore.polyvApi.get(f.GetOrderPaymentProviders,{}).catch(function(t){throw r.__payProviderCache=void 0,t}),this.__payProviderCache=e,t.n=2,e;case 2:return t.a(2,t.v)}},t,this)})),function(){return t.apply(this,arguments)})}]);var t,e}();exports.Address=Oe,exports.AiCardTaskStatus=L,exports.AuthType=j,exports.CreateOrderFailReason=zt,exports.Order=de,exports.OrderRefundFailReason=Vt,exports.OrderStatus=Ht,exports.PayStatus=Bt,exports.Payment=je,exports.PaymentProvider=Ut,exports.Product=Gt,exports.ProductBuyType=E,exports.ProductDeliveryType=x,exports.ProductEvents=h,exports.ProductExplainOperation=O,exports.ProductExplainStatus=w,exports.ProductExplainType=k,exports.ProductLinkJumpWay=b,exports.ProductLinkType=m,exports.ProductMediaType=P,exports.ProductMoreOperation=C,exports.ProductMoveOperation=A,exports.ProductOrigin=_,exports.ProductPriceType=S,exports.ProductPushRule=v,exports.ProductServiceType=T,exports.ProductSortType=I,exports.ProductStatus=g,exports.ProductTagFailReason=N,exports.ProductTagSortType=R,exports.ProductType=y,exports.ProductVersion=D,exports.RefundStatus=Ft,exports.filterInternalData=Pt,exports.parseFeature=bt,exports.parseTags=gt,exports.restoreInternalData=Et,exports.restoreInternalProductSetting=St,console.log("%c@polyv/product-sdk","background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff","[version: 1.
|
|
9
|
+
var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return xe(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(xe(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,xe(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,xe(d,"constructor",s),xe(s,"constructor",c),c.displayName="GeneratorFunction",xe(s,o,"GeneratorFunction"),xe(d),xe(d,o,"Generator"),xe(d,n,function(){return this}),xe(d,"toString",function(){return"[object Generator]"}),(Se=function(){return{w:i,m:l}})()}function xe(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(xe=function(t,e,r,n){function i(e,r){xe(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function Te(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Ce(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Te(i,n,o,a,u,"next",t)}function u(t){Te(i,n,o,a,u,"throw",t)}a(void 0)})}}function Ae(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ie(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ie(t){var e=function(t,e){if("object"!=Ee(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Ee(e)?e:e+""}var je=function(){return Ae(function t(e,r){var n,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,i=Ut,(o=Ie(o="PaymentProvider"))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,this.interactionCore=e,this.config=r},[{key:"getPayOrderParams",value:(e=Ce(Se().m(function t(e){var r;return Se().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.PayOrder,e);case 1:return r=t.v,t.a(2,te(r))}},t,this)})),function(t){return e.apply(this,arguments)})},{key:"getPayProviders",value:(t=Ce(Se().m(function t(){var e,r=this;return Se().w(function(t){for(;;)switch(t.n){case 0:if(!this.__payProviderCache){t.n=1;break}return t.a(2,this.__payProviderCache);case 1:return e=this.interactionCore.polyvApi.get(f.GetOrderPaymentProviders,{}).catch(function(t){throw r.__payProviderCache=void 0,t}),this.__payProviderCache=e,t.n=2,e;case 2:return t.a(2,t.v)}},t,this)})),function(){return t.apply(this,arguments)})}]);var t,e}();exports.Address=Oe,exports.AiCardTaskStatus=L,exports.AuthType=j,exports.CreateOrderFailReason=zt,exports.Order=de,exports.OrderRefundFailReason=Vt,exports.OrderStatus=Ht,exports.PayStatus=Bt,exports.Payment=je,exports.PaymentProvider=Ut,exports.Product=Gt,exports.ProductBuyType=E,exports.ProductDeliveryType=x,exports.ProductEvents=h,exports.ProductExplainOperation=O,exports.ProductExplainStatus=w,exports.ProductExplainType=k,exports.ProductLinkJumpWay=b,exports.ProductLinkType=m,exports.ProductMediaType=P,exports.ProductMoreOperation=C,exports.ProductMoveOperation=A,exports.ProductOrigin=_,exports.ProductPriceType=S,exports.ProductPushRule=v,exports.ProductServiceType=T,exports.ProductSortType=I,exports.ProductStatus=g,exports.ProductTagFailReason=N,exports.ProductTagSortType=R,exports.ProductType=y,exports.ProductVersion=D,exports.RefundStatus=Ft,exports.filterInternalData=Pt,exports.parseFeature=bt,exports.parseTags=gt,exports.restoreInternalData=Et,exports.restoreInternalProductSetting=St,console.log("%c@polyv/product-sdk","background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff","[version: 1.11.0]","[buildTime: 2026-02-06 05:49:41]");
|
package/index.es.d.ts
CHANGED
|
@@ -1203,6 +1203,15 @@ export declare class Product {
|
|
|
1203
1203
|
* ```
|
|
1204
1204
|
*/
|
|
1205
1205
|
getAssistantProductOperationEnabled(): Promise<boolean>;
|
|
1206
|
+
/**
|
|
1207
|
+
* 获取移动开播端下架商品功能开关, 该参数针对移动端webview使用
|
|
1208
|
+
* @example
|
|
1209
|
+
* ```js
|
|
1210
|
+
* const enabled = await productTarget.getMobileAnchorProductShelfEnabled();
|
|
1211
|
+
* console.log('移动开播端下架商品功能开关', enabled);
|
|
1212
|
+
* ```
|
|
1213
|
+
*/
|
|
1214
|
+
getMobileAnchorProductShelfEnabled(): Promise<boolean>;
|
|
1206
1215
|
/**
|
|
1207
1216
|
* 生成商品讲解页面地址
|
|
1208
1217
|
* @param params url 携带参数
|
|
@@ -1668,6 +1677,10 @@ export declare interface ProductConfig {
|
|
|
1668
1677
|
* 助教页商品库增删改功能开关
|
|
1669
1678
|
*/
|
|
1670
1679
|
assistantProductOperationEnabled?: boolean;
|
|
1680
|
+
/**
|
|
1681
|
+
* 移动开播端下架商品功能开关
|
|
1682
|
+
*/
|
|
1683
|
+
mobileAnchorProductShelfEnabled?: boolean;
|
|
1671
1684
|
}
|
|
1672
1685
|
|
|
1673
1686
|
/**
|