Build 555975stable
Module 872472
1,305 characters · in 1ab2d0b4471f679c.jsDependencies
Source Raw
function(t,e,r){r.d(e,{A:()=>S}),r(321073);var i=r(575593),l=r(898461),s=r(474012),n=r(837015),u=r(203632),o=r(166886),a=r(32731),d=r(520606),c=r(652215);let p=t=>{switch(t.type){case i.R.AVATAR_DECORATION:return l.A.fromServer(t);case i.R.PROFILE_EFFECT:return u.Ay.fromServer(t);case i.R.NAMEPLATE:return n.A.fromServer(t);case i.R.PROFILE_FRAME:return o.A.fromServer(t);default:return null}};class S extends d.A{collectiblesItem;bundleItems;constructor(t){if(super(t),this.skuProductLine=c.EZt.COLLECTIBLES,null!=t.bundle_items){const e=[];for(const r of t.bundle_items){const t=p(r);null!=t&&e.push(t)}if(0===e.length)throw Error("Bundle has no valid items");this.bundleItems=e}else if(null!=t.collectibles_item){const e=p(t.collectibles_item);if(null==e)throw Error("Collectibles item not found");this.collectiblesItem=e}else if(!t.skipValidation)throw Error("Collectibles wishlist item missing both collectibles_item and bundle_items")}static fromServer(t){return new S({...t,sku:null!=t.sku?a.A.createFromServer(t.sku):void 0})}static fromSKU(t){let e=(0,s.T)(t);if(null==e)return null;let r=new S({sku_id:t.id,sku_product_line:c.EZt.COLLECTIBLES,sku_name:t.name,sku:t,skipValidation:!0});return r.collectiblesItem="single"===e.type?e.item:void 0,r.bundleItems="bundle"===e.type?e.items:void 0,r}}}