PageSourceSearch

https://shop.wordup.com.tw/_next/static/chunks/pages/bg-eba4ba4c798ad28a.js

js wordup.com.tw collected 2026-10-01 12:03:25 UTC 32,921 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c7185f23-f895-45c3-8da2-4bf3c5813559",e._sentryDebugIdIdentifier="sentry-dbid-c7185f23-f895-45c3-8da2-4bf3c5813559")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6361],{3388:(e,t,r)=>{"use strict";r.d(t,{V:()=>y});var n=r(60640),a=r(10764),o=r(74395),i=r(32678),l=r(76277),u=r(83855),d=r(42011),c=r(90310),s=r(42874);let p=["newebpay_cvs","newebpay_vacc"],y=async e=>{let{lineItems:t,paymentMethod:r,paymentDetails:y,address:m,taxIdNumber:_,companyName:g,couponCode:v,totalPrice:b,guestEmail:f,guestMobile:h,tracking:I}=e,w=f?(e=>{let{guestEmail:t,guestMobile:r,lineItems:n,couponCode:u,currency:d="TWD",paymentMethod:c,paymentDetails:s={},b2bReceipt:p={},utm:y={}}=e;return{url:"/v1/shop/guest_checkouts",method:"POST",data:{data:{guest:{email:t,mobile:r},line_items:n,coupon_code:u,currency:d,payment_method:c,payment_details:s,b2b_receipt:{address:null==p?void 0:p.address,tax_id_number:null==p?void 0:p.taxIdNumber,company_name:null==p?void 0:p.companyName},utm:y,wu_referral:window.sessionStorage.getItem(a.aO),event_meta:{utm:y,fbp:l.A.get("_fbp",void 0,!1),fbc:l.A.get("_fbc",void 0,!1)||l.A.get(o.PIXEL_CONVERSION_API_PARAMS),event_source_url:`https://shop.wordup.com.tw${window.location.pathname}`,...l.A.get(i.GOOGLE_CONVERSION_API.KEY,!0)}}}}})({guestEmail:f,guestMobile:h,lineItems:t,paymentMethod:r,paymentDetails:y,b2bReceipt:{address:m,taxIdNumber:_,companyName:g},couponCode:v,utm:d.$d.getFromCookie()}):(0,n.Pt)({lineItems:t,paymentMethod:r,paymentDetails:y,b2bReceipt:{address:m,taxIdNumber:_,companyName:g},couponCode:v,utm:d.$d.getFromCookie()}),{data:G}=await (0,u.A)(w),{meta:{lineItemsSummary:A,eventId:E,externalId:N},data:{id:T}}=G;if(await i.default.ec.purchase({orderId:T,totalPrice:b,currency:"TWD",coupon:v,extras:I,lineItems:A}),!p.includes(r)){let e={content_type:"product",currency:"TWD",value:b,contents:A.map(e=>({id:e.productId,quantity:e.qty})),content_ids:A.map(e=>e.productId),collection_offer_ids:[...new Set(A.filter(e=>e.collectionOfferId).map(e=>e.collectionOfferId))]};E&&N?(e.external_id=N,o.default.internal.trackSingle("Purchase",e,{eventID:E,test_event_code:"TEST4423"})):o.default.internal.trackSingle("Purchase",e,{test_event_code:"TEST4423"})}return(e=>{let{orderId:t,lineItems:r}=e;(e=>{let{lineItems:t}=e;Object.entries((0,c.A)(t.filter(e=>e.extraTrackingPixel),e=>e.extraTrackingPixel)).forEach(e=>{let[t,r]=e,n={content_ids:r.map(e=>e.productId),content_type:"product",contents:r.map(e=>({id:e.productId,quantity:e.qty})),currency:"TWD",value:r.reduce((e,t)=>e+parseInt(t.revenue,10),0)};o.default.initPixel(t),o.default.external.trackSingle(t,"Purchase",n)})})({lineItems:r}),(e=>{let{orderId:t,lineItems:r}=e;Object.entries((0,c.A)(r.filter(e=>{var t;return null==(t=e.extraTrackingGoogleAds)?void 0:t.purchase}),e=>{var t;return null==(t=e.extraTrackingGoogleAds)?void 0:t.purchase})).forEach(e=>{let[r,n]=e;(0,i.adsConversionTracking)({transactionId:t,trackingId:r,isThirdParty:!0,items:n,value:n.reduce((e,t)=>e+parseInt(t.revenue,10),0)})})})({lineItems:r,orderId:t}),(e=>{let{orderId:t,lineItems:r}=e;Object.entries((0,c.A)(r.filter(e=>e.extraTrackingGa),e=>e.extraTrackingGa)).forEach(e=>{let[r,n]=e;i.default.ec.purchase({orderId:t,totalPrice:n.reduce((e,t)=>e+parseInt(t.revenue,10),0),currency:"TWD",coupon:void 0,lineItems:n,thirdPartyTrackingId:r})})})({lineItems:r,orderId:t})})({lineItems:A,orderId:T}),(0,s.sendDcardAdsPurchaseEvent)({payload:{contentType:"product",currency:"NTD",value:b,numItems:A.length,contentIds:A.map(e=>`${e.productId}`),contents:A.map(e=>({[e.productId]:e.qty}))}}),G}},10764:(e,t,r)=>{"use strict";r.d(t,{G6:()=>i,aO:()=>n,tV:()=>a,zV:()=>o});let n="wu_referral",a="product-id",o="variant-id",i="coupon-code"},13768:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(2860),a=r(55729),o=r(98986),i=r(47126),l=r(49511),u=r(84660),d=r(41090),c=r(96848);function s(e){let{className:t,showWarningDescription:r,isGuestCheckout:s,onLoginClick:p}=e,{t:y}=(0,o.Bd)(),{userInfo:m,isLoggedIn:_,logout:g,openAuthModal:v}=(0,c.As)(),b=(0,a.useMemo)(()=>(0,l.Al)(),[]),f=async e=>{e.preventDefault(),_&&await g(),p?p():v({layout:"sign-in"})},h=y(_?"common:auth.switch_account":"common:auth.login_or_signup");return(0,n.FD)("div",{className:(0,u.Q)("flex flex-col gap-y-300",t),children:[(0,n.Y)("h5",{className:"text-heading-s text-content-primary",children:y("common:auth.account_info")}),_?(0,n.FD)(n.FK,{children:[(0,n.FD)("p",{className:"text-body-s text-content-primary",children:[y("common:auth.current_account"),m.email]}),r?(0,n.FD)("p",{className:"bg-background-secondary flex items-center gap-x-200 rounded-500 px-300 py-200 text-body-s text-content-primary",children:[(0,n.Y)(i.I,{type:"error"}),y("cart:warning_text.send_to_account")]}):null]}):s?(0,n.Y)("p",{className:"text-body-s text-content-secondary",children:y("crowdin:guest-checkout.guest-description","免註冊即可購買,完成付款後將寄送教材兌換碼至您的信箱。")}):(0,n.FD)("p",{className:"text-body-s text-content-primary",children:[y("common:auth.current_account"),y("common:auth.not_logged_in")]}),b?null:(0,n.Y)(d.$n,{variant:"outlined",color:"primary",size:"lg",fullWidth:!0,"aria-label":"cart-login-button",onClick:f,children:h})]})}},14755:(e,t,r)=>{"use strict";r.d(t,{K:()=>i,R:()=>o});
1var n=r(55729),a=r(43504);let o=(0,n.createContext)({state:a.G,allowCheckout:!1,joinedStatus:"NO_BUYING_GROUP",isValidBuyingGroup:!0,isFull:!1,canJoin:!1,allowQuit:!1,dispatch:()=>{},onSubmit:()=>Promise.resolve(),createNewBuyingGroup:()=>Promise.resolve(),handleQuit:()=>Promise.resolve(),toJoinedBuyingGroup:()=>{}}),i=()=>(0,n.useContext)(o)},16385:(e,t,r)=>{"use strict";r.d(t,{A:()=>o,Q:()=>a});var n=r(55729);let a=(0,n.createContext)({paymentRef:null});function o(){let e=(0,n.useContext)(a);if(void 0===e)throw Error("PaymentContext must be used within a PaymentProvider");return{paymentRef:e.paymentRef}}},18099:(e,t,r)=>{"use strict";r.d(t,{BK:()=>d,Cy:()=>u,d$:()=>c,oo:()=>s,pn:()=>l,yj:()=>i});var n=r(83855),a=r(43904),o=r(79516);let i=e=>({url:`/v1/shop/products/${e}`,method:"GET"}),l=e=>({url:`/v1/shop/products/${e}/subscription_purchase_preview`,method:"GET"}),u=e=>{let{productId:t,variantId:r}=e;return{url:"/v1/shop/collection_offers",method:"GET",params:{product_id:t,product_variant_id:r}}},d=e=>{let{productId:t,referralCode:r}=e;return{url:"/v1/shop/free_download",method:"POST",data:{data:{product_id:t,referral_code:r}},requiresLogin:!0}},c=e=>(0,n.A)({url:"/v1/shop/products",method:"GET",params:e}),s=(e,t)=>(0,n.A)({url:`/v1/shop/products/${e}`,method:"GET",params:(0,a.A)({org_id:t},o.A)})},19240:(e,t,r)=>{"use strict";r.d(t,{HL:()=>n,d3:()=>o,nZ:()=>a});let n="course_already_redeemed",a="already_trial",o="subscription_already_renewing"},21712:(e,t,r)=>{"use strict";r.d(t,{qq:()=>l,SN:()=>i,VT:()=>n.V,a8:()=>u,BI:()=>o});var n=r(3388),a=r(19240);let o=e=>!!e&&["already_claimed","already_trial","course_already_redeemed","payment_gateway_failed","subscription_already_renewing"].includes(e),i=e=>{let{errorCode:t,fallbackMessage:r,t:n}=e;return t===a.d3?n("crowdin:subscription-purchase.already-renewing-error","你已訂閱此方案且將自動續約,無需重複購買。如需變更方案,請前往帳戶頁。"):r},l=e=>Error("CHECKOUT_TOAST_ONLY_ERROR",e?{cause:e}:void 0),u=e=>"CHECKOUT_TOAST_ONLY_ERROR"===e.message},24042:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(2860),a=r(84660);let o=e=>{let{title:t,titleClassName:r,tag:o="div",className:i,desc:l,descNode:u,children:d}=e;return(0,n.FD)(o,{className:(0,a.Q)("flex flex-col gap-y-300",i),children:[(0,n.FD)("div",{className:(0,a.Q)(l||u?"flex flex-col gap-y-050":""),children:[(0,n.Y)("h5",{className:(0,a.Q)("text-heading-s text-content-primary",r),children:t}),l?(0,n.Y)("span",{className:"text-caption-l text-content-secondary",dangerouslySetInnerHTML:{__html:l}}):null,u||null]}),d]})}},33136:(e,t,r)=>{"use strict";r.d(t,{E:()=>a});var n=r(69195);let a=e=>(n.O_?["1207"]:["403"]).includes(e)},34675:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(2860),a=r(84660),o=r(49511);let i=e=>{let{children:t,isVisible:r,className:i}=e;return(0,n.Y)("header",{className:(0,a.Q)("transition-[opacity,top] duration-200 ease-linear","z-navbar sticky left-0 text-center opacity-0",(0,o.Al)()?"top-[var(--app-nav-height,44px)]":"top-[var(--nav-top,var(--browser-main-nav-height))]",r?"opacity-100":"hidden"),children:(0,n.Y)("div",{className:(0,a.Q)("bg-grayscale-50",i),children:t})})}},43504:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,G:()=>i});
1var n=r(78004),a=r(79516),o=r(50970);let i={mode:"legacy",productId:"",variantId:"",product:null,listPrice:"",salePrice:"",qtyOptions:[],targetQty:null,qty:1,ensurePurchase:!1,buyingGroupId:null,buyingGroupInfo:null,prevCard:null},l=(0,n.jM)((e,t)=>{switch(t.type){case"CHANGE_QTY":{let r,{qty:n,targetQty:o,buyingGroupInfo:i}=e;if((0,a.A)(o))return e;return(r="minus"===t.payload.type?n-1:n+1)<=1?r=1:"legacy"===e.mode&&(r>o?r=o-((null==i?void 0:i.currentQty)||0):i&&r>o-i.currentQty&&(r=o-i.currentQty)),e.qty=r,e}case"CHANGE_TARGET_QTY":return e.targetQty=t.payload.qty,e.qty=t.payload.qty<e.qty?t.payload.qty:e.qty,e;case"SET_ENSURE_PURCHASE":return e.ensurePurchase=t.payload.ensurePurchase,e;case"SET_BUYING_GROUP_ID":return e.buyingGroupId=t.payload.buyingGroupId,e;case"SET_BUYING_GROUP_INFO":return e.buyingGroupInfo=t.payload.buyingGroupInfo,e.buyingGroupId=t.payload.buyingGroupId,e.productId=t.payload.productId,e.targetQty=t.payload.targetQty,e.mode=t.payload.mode,e;case"SET_PRODUCT":{let n=t.payload.productAttributes,a={...e,product:n},o=""!==e.variantId?n.variants.find(t=>t.id===e.variantId):n.variants.find(e=>"redeem_code"===e.key)||n.variants.find(e=>"enrollment"===e.key);if((null==o?void 0:o.buyingGroup)&&(a.listPrice=o.listPrice,a.salePrice=o.salesPrice,a.qtyOptions=o.buyingGroup.qtyOptions.map(e=>({qty:Array.isArray(e.qtyMatchValue)?e.qtyMatchValue[0]:e.qtyMatchValue,price:e.price,endsAt:`${e.endsInDays}`})),!e.targetQty)){var r;a.targetQty=null==(r=a.qtyOptions[0])?void 0:r.qty}return a}case"SET_PRODUCT_ID":return e.productId=t.payload.productId,e;case"SET_PRODUCT_ID_AND_VARIANT_ID":return e.productId=t.payload.productId,e.variantId=t.payload.variantId,e;case"CREATE_NEW_BUYING_GROUP":return e.qty=1,e.buyingGroupId=null,e.buyingGroupInfo=null,e;case"RESET_BUYING_GROUP":return e.buyingGroupId=null,e.buyingGroupInfo=null,e;case"RESET_JOINED_INFO":if((0,o.A)(e.buyingGroupInfo))return e;return e.buyingGroupInfo.joined=!1,e.buyingGroupInfo.joinedActiveBuyingGroupId=null,e;default:return e}})},46693:(e,t,r)=>{"use strict";r.d(t,{aM:()=>a,xv:()=>o});let n="border-0 border-b border-solid border-border-subtle",a=`${n} py-500`,o=`${n} pb-500`},60640:(e,t,r)=>{"use strict";r.d(t,{$W:()=>d,Pt:()=>u,y3:()=>c});var n=r(50970),a=r(10764),o=r(74395),i=r(32678),l=r(76277);let u=e=>{let{lineItems:t,couponCode:r,currency:u="TWD",paymentMethod:d,paymentDetails:c={},b2bReceipt:s={},b2bOrderInfo:p,utm:y={},usermobile:m}=e,_={line_items:t,coupon_code:r,currency:u,payment_method:d,payment_details:c,b2b_receipt:{address:null==s?void 0:s.address,tax_id_number:null==s?void 0:s.taxIdNumber,company_name:null==s?void 0:s.companyName},utm:y,user_mobile:m,[a.aO]:window.sessionStorage.getItem(a.aO),event_meta:{utm:y,fbp:l.A.get("_fbp",void 0,!1),fbc:l.A.get("_fbc",void 0,!1)||l.A.get(o.PIXEL_CONVERSION_API_PARAMS),event_source_url:`https://shop.wordup.com.tw${window.location.pathname}`,...l.A.get(i.GOOGLE_CONVERSION_API.KEY,!0)}};return(0,n.A)(p)||(_.b2b_order_info={org_id:p.orgId,staff_code:p.staffCode,staff_name:p.staffName,department_name:p.departmentName,mobile:p.mobile}),{url:"/v1/shop/checkout",method:"POST",data:{data:_}}},d=()=>({url:"/v1/payment_methods/default",method:"GET"}),c=e=>{let{materialId:t}=e;return{url:"/v1/shop/checkout",method:"POST",data:{data:{material_id:t,payment_method:"free"}}}}},65970:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(2860),a=r(55729),o=r(47126);let i=e=>{let{children:t,maxNumber:r}=e,i="number"==typeof r?r+1:a.Children.count(t);return(0,n.FD)("ul",{className:"relative m-0 flex list-none flex-col gap-y-300 p-0",children:[(0,n.Y)("div",{className:"border-grayscale-100 absolute bottom-[18px] left-[11px] top-[11px] z-[1] border-l-[1px] border-r-0 border-dashed"}),a.Children.map(t,(e,t)=>(0,n.Y)("li",{children:(0,n.FD)("div",{className:"flex gap-x-200",children:[(0,n.Y)("div",{className:"bg-grayscale-100 z-[2] flex size-[22px] flex-shrink-0 items-center justify-center rounded-300 text-label-s font-medium",children:i<=t+1?(0,n.Y)(o.I,{type:"star_filled",size:14}):t+1}),e]})}))]})}},67789:(e,t,r)=>{"use strict";r.d(t,{rV:()=>_,gr:()=>d,rl:()=>w,O4:()=>A,LT:()=>E,zI:()=>b,jY:()=>f,Gr:()=>G,VY:()=>I,cV:()=>g,wt:()=>m,k7:()=>y,NX:()=>p,_j:()=>h});var n=r(32678),a=r(42011),o=r(42874),i=r(33136),l=r(75185),u=r(54980);let d=e=>{let{product:t}=e;try{(e=>{let{product:t}=e,r=t.id,n="collection_offer"===t.type,{name:o,salePrice:i,extraTrackingPixel:l,currency:u}=t.attributes,d={content_ids:[`${r}`],content_name:o,content_type:n?"product_group":"product",contents:n?t.attributes.products.map(e=>{let{id:t}=e;return{id:t,quantity:1}}):[{id:r,quantity:1}],currency:u,value:n?t.attributes.totalSalePrice-t.attributes.discount:i};a.Lw.internal.trackSingle("ViewContent",d),l&&(a.Lw.initPixel(l),a.Lw.external.trackSingle(l,"ViewContent",d),a.Lw.external.pageView(l))})({product:t}),(e=>{let{product:t}=e,r="collection_offer"===t.type,n=t.id,{name:o,salePrice:i,extraTrackingGa:l,extraTrackingGoogleAds:d,currency:c,publisherName:s,examName:p}=t.attributes,y=r?void 0:t.attributes.copiesSold,m=(0,u.cZ)(y);a.w6.ec.viewItem({productId:n,name:o,publisherName:s,examName:r?"collection_offer":p,salePrice:r?+t.attributes.totalSalePrice:+i,currency:c,copiesSoldTier:m},"visit"),l&&a.w6.external.pageView(l),(null==d?void 0:d.pageView)&&a.w6.external.sendEvent({name:"conversion",params:{page_location:window.location.href},gtagID:d.pageView})})({product:t}),(e=>{let{product:t}=e,r=t.id,n="collection_offer"===t.type,{name:a,salePrice:i}=t.attributes;(0,o.sendDcardAdsViewContentEvent)({payload:{currency:"NTD",value:n?t.attributes.totalSalePrice-t.attributes.discount:+i,contentType:n?"product_group":"product",contentIds:[r],contentName:a,contents:n?t.attributes.products.map(e=>{let{id:t}=e;return{[t]:1}}):[{[r]:1}]}})})({product:t}),(e=>{let{product:t}=e,r=a.$d.getFromCookie();a.wu.trafficTracking({productId:t.id,utmCampaign:null==r?void 0:r.utm_campaign,utmSource:null==r?void 0:r.utm_source,utmMedium:null==r?void 0:r.utm_medium,utmContent:null==r?void 0:r.utm_content,utmAdSet:null==r?void 0:r.utm_ad_set})})({product:t}),(0,i.E)(t.id)&&(0,l.h)("Conversion"),(0,l.N)("Conversion"),(0,l.N)("ViewItemDetail")}catch{}};var c=r(15599),s=r.n(c);let p=async e=>{n.default.internal.sendEvent({name:"detail_page_toc_trial_unit_clicked",params:s()(e)}),(0,i.E)(e.materialId)&&e.unitPreviewable&&(0,l.h)("trial")},y=async e=>{n.default.internal.sendEvent({name:"detail_page_toc_trial_section_clicked",params:s()(e)})},m=async e=>{n.default.internal.sendEvent({name:"detail_page_toc_app_download_clicked",params:s()(e)})},_=e=>async t=>{let{tocSectionName:r,isOpened:a}=t;n.default.internal.sendEvent({name:"detail_page_toc_section_clicked",params:{product_id:e,toc_section_name:r,is_opened:a}})},g=async()=>{n.default.internal.sendEvent({name:"detail_page_intro_showcases_item_clicked"})};var v=r(74395);let b=e=>{let{t,id:r,isCollectionOffer:a}=e,o=Number(t("crowdin:product-detail-page.duration-event.interval-second"))||30;if(!r||!Number.isFinite(o))return;let i=1,l=window.setInterval(()=>{if("hidden"===document.visibilityState)return;let e=a?{collection_offer_id:r,duration_in_s:o*i}:{product_id:r,duration_in_s:o*i};v.default.internal.trackSingle("DetailPageDuration",e),n.default.internal.sendEvent({name:"detail_page_duration",params:e}),i++},1e3*o);return()=>{l&&window.clearInterval(l)}},f=e=>{let t,r=new Set,a=(e,n)=>{r.delete(e),(n||!r.size)&&(t&&clearTimeout(t),t=null),n&&r.clear()};return o=>{let{userName:i,name:l,createdAt:u}=o,d=`${i},${l},${u}`;return r.has(d)||r.add(d),t||(t=setTimeout(()=>{n.default.internal.sendEvent({name:"low_rating_feedback_visible",params:{material_id:e}}),a(d,!0)},3e3)),()=>a(d,!1)}},h=async e=>{n.default.internal.sendEvent({name:"to_app_store",params:e})},I=async e=>{n.default.internal.sendEvent({name:"popup_duration",params:e})},w=async e=>{let{adUrl:t}=e;n.default.internal.sendEvent({name:"banner_click",params:{url:t}})},G=async e=>{n.default.internal.sendEvent({name:"mobile_fixed_footer_button_click",params:e})},A=async e=>{n.default.internal.sendEvent({name:"collection_offers_tab_clicked",params:e})},E=async e=>{n.default.internal.sendEvent({name:"create_buying_group_clicked",params:e})}},73713:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/bg",function(){return r(90939)}])},75185:(e,t,r)=>{"use strict";r.d(t,{N:()=>a,h:()=>n});let n=e=>{var t;(null==(t=window)?void 0:t._lt)&&window._lt("send","cv",{type:e}
1,["a59d9ecc-1c26-4d22-99a4-9c9d61a2a776"])},a=e=>{var t;(null==(t=window)?void 0:t._lt)&&window._lt("send","cv",{type:e},["bf5e656b-93b5-45ca-9512-0c9c5b7cde74"])}},88697:(e,t,r)=>{"use strict";r.d(t,{$O:()=>i,RX:()=>d,UP:()=>u,YB:()=>o,ax:()=>l,ku:()=>n,o$:()=>a});let n=e=>null!=e&&Array.isArray(e.data),a=e=>Array.isArray(e)&&0!==e.length?[...e].sort((e,t)=>e.minQty-t.minQty).reduce((e,t,r)=>(0===r?e.push(t):e[e.length-1].minQty===t.minQty?e[e.length-1].unitPrice=Math.min(parseInt(e[e.length-1].unitPrice),parseInt(t.unitPrice)).toString():parseInt(e[e.length-1].unitPrice)>parseInt(t.unitPrice)&&e.push(t),e),[]):[],o=(e,t)=>{if(!n(t)||!(null==t?void 0:t.data.length))return null;let r=a(t.data),o=null;for(let t of r)if(e>=t.minQty)o=t;else break;return o},i=e=>n(e)&&(null==e?void 0:e.data.length)&&a(e.data)[0]||null,l=(e,t)=>{if(!n(t)||!(null==t?void 0:t.data.length))return null;let r=a(t.data),i=o(e,t);return i?r.find(e=>e.minQty>i.minQty)||null:r[0]||null},u=e=>{var t;return n(e)&&(null==e?void 0:e.data.length)&&(null==(t=a(e.data)[0])?void 0:t.minQty)||null},d=e=>{let t=u(e);return null===t||t>1}},90939:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>J,default:()=>Z});var n=r(2860),a=r(98986),o=r(81278),i=r(71024),l=r.n(i),u=r(50970),d=r(1909),c=r(55729),s=r(5415),p=r(15553),y=r(15599),m=r.n(y),_=r(18099),g=r(83855),v=r(37674),b=r(86528),f=r(10764),h=r(96848),I=r(14755),w=r(94656),G=r(43504),A=r(16385),E=r(21712),N=r(97289),T=r(23261),x=r(42011),P=r(74395),O=r(32678),R=r(41642),S=r(76277),Y=r(13768),k=r(84660),C=r(34675);let D=e=>{let{buyingGroupId:t,isValidBuyingGroup:r,isFull:o}=e,{t:i}=(0,a.Bd)();return(0,n.Y)(C.A,{isVisible:!0,className:(0,k.Q)("py-200",t&&r?"bg-background-accent-light text-content-accent":t&&!r&&o?"bg-background-positive-light text-content-positive":(t,"bg-background-secondary text-content-primary")),children:(0,n.Y)("span",{className:"text-label-s font-medium",children:t?i(r?"group_buying.group_is_active":"group_buying.group_ended",{groupId:t}):i("group_buying.product_information")})})};var U=r(77903),B=r(65970);let Q=e=>{let{subject:t="english",mode:r="legacy"}=e,{t:o}=(0,a.Bd)(),i=(0,c.useMemo)(()=>{if("legacy"===r){var e;let r=(null==(e=(0,U.A)(o("crowdin:group_buying.steps-step2-description"),null))?void 0:e[t])||"";return(0,U.A)(o("crowdin:group_buying.steps",{links:r}),[])}return"tier"===r?(0,U.A)(o("crowdin:group_buying.steps_tier"),[]):[]},[o,t]);return(0,n.Y)(B.A,{maxNumber:"tier"===r?2:void 0,children:i.map(e=>(0,n.Y)("span",{className:"text-body-s text-content-primary",dangerouslySetInnerHTML:{__html:e}},e))})},q=e=>{let{mode:t="legacy",endAt:r}=e,{t:o}=(0,a.Bd)();return(0,n.Y)("ol",{className:"m-0 list-decimal pl-500",children:(0,U.A)(o("tier"===t?"crowdin:group_buying.disclaimer-rules_tier":"crowdin:group_buying.disclaimer-rules",{endAt:r}),[]).map(e=>(0,n.Y)("li",{className:"text-body-s text-content-primary",children:(0,n.Y)("span",{dangerouslySetInnerHTML:{__html:e}})},e))})};var V=r(68552),M=r(24042),$=r(51652);let F=e=>{var t,r,a,i,l,u;let{product:d,buyingGroupInfo:c}=e,s=(0,o.useRouter)(),p=`一起團購學習!"${(null==c||null==(r=c.data)||null==(t=r.attributes)?void 0:t.productName)??(null==d?void 0:d.name)??""}"`,y=`${(null==c||null==(i=c.data)||null==(a=i.attributes)?void 0:a.description)??(null==d?void 0:d.description)??""} | 分享連結,快速又安全揪團`;return(0,n.Y)($.bV,{title:p,titleTemplate:"%s | 聰明學習",description:y,openGraph:{type:"website",title:p,description:y,url:`https://shop.wordup.com.tw${s.asPath}`,images:(null==c||null==(u=c.data)||null==(l=u.attributes)?void 0:l.ogImageUrl)?[{url:c.data.attributes.ogImageUrl,alt:`${p}-cover`}]:(null==d?void 0:d.ogImageUrl)?[{url:d.ogImageUrl,alt:`${p}-cover`}]:void 0}})};var j=r(88697),L=r(99412),H=r(2185),K=r(46693);let W=l()(()=>r.e(7691).then(r.bind(r,7691)),{loadableGenerated:{webpack:()=>[7691]},ssr:!1,loading:()=>(0,n.Y)("div",{className:"h-[350px]"})}),z=l()(()=>r.e(741).then(r.bind(r,80741)),{loadableGenerated:{webpack:()=>[80741]},ssr:!1,loading:()=>(0,n.Y)("div",{className:"h-[350px]"})}),X=l()(()=>r.e(8190).then(r.bind(r,88190)),{loadableGenerated:{webpack:()=>[88190]},ssr:!1,loading:()=>(0,n.Y)("div",{className:"h-[81px] w-full"})});var J=!0;let Z=e=>{var t,r,i,l,y,k;let{buyingGroupInfo:C,product:U,productId:B,variantId:$}=e,J=(0,o.useRouter)(),{t:Z}=(0,a.Bd)(),{isLoggedIn:ee}=(0,h.As)(),et=(0,c.useRef)(null),[er,en]=(0,c.useReducer)(G.A,G.G),{startLoading:ea,stopLoading:eo}=(0,T.A)(),[ei,el]=(0,c.useState)(null),[eu,ed]=(0,c.useState)(!0),{joinedStatus:ec,isValidBu
1yingGroup:es,isFull:ep,canJoin:ey,allowQuit:em}=(0,w.do)({buyingGroupInfo:er.buyingGroupInfo}),e_=(0,c.useRef)(null),eg=(0,d.mN)({defaultValues:{paymentMethod:"tappay_prime",receiptType:"duplicate",taxIdNumber:"",companyName:"",email:"",address:""}}),{trigger:ev,formState:eb,getValues:ef}=eg,eh=(0,c.useCallback)(e=>{J.push({pathname:"/bg",query:e},void 0,{shallow:!0})},[J]);(0,c.useEffect)(()=>{var e;let t=null==(e=J.query)?void 0:e.bgId;t&&en({type:"SET_BUYING_GROUP_ID",payload:{buyingGroupId:t}})},[J.query]),(0,c.useEffect)(()=>{var e,t;let r=null==(e=J.query)?void 0:e.productId,n=null==(t=J.query)?void 0:t.variantId;(r||B)&&($?en({type:"SET_PRODUCT_ID_AND_VARIANT_ID",payload:{productId:r??B,variantId:n??$}}):en({type:"SET_PRODUCT_ID",payload:{productId:r??B}}))},[B,J,$]);let eI=(0,c.useCallback)(async e=>{let{productId:t,variantId:r}=e;try{var n;ea();let e=await (0,g.A)((e=>{let{productId:t}=e;return{url:"/v1/shop/buying_groups",method:"GET",params:{product_id:t}}})({productId:t})),a=e.data;if(200!==e.status)throw Error("get joined buying group error");(null==a||null==(n=a.meta)?void 0:n.announcement)&&el(a.meta.announcement);let o=a.data.find(e=>r?e.attributes.productId===t&&e.attributes.variantId===r:e.attributes.productId===t);if(!o)return;let i=o.id;er.buyingGroupId||(en({type:"SET_BUYING_GROUP_ID",payload:{buyingGroupId:i}}),eh({bgId:i,productId:t}))}catch(e){b.oR.error({message:Z("common.error_happened")})}finally{eo()}},[ea,eo,eh,Z,er.buyingGroupId]),ew=(0,c.useCallback)(async e=>{let{buyingGroupId:t,shouldShowInValidModal:r}=e;try{ea();let e=await (0,g.A)({...{url:`/v1/shop/buying_groups/${t}`,method:"GET",errorContext:{key:"get_buying_group_info_error"}},ignoreThrowError:!1}),n=e.data.data.attributes,a=(0,j.ku)(n.priceTiers)?"tier":"legacy";if(en({type:"SET_BUYING_GROUP_INFO",payload:{mode:a,buyingGroupId:e.data.data.id,buyingGroupInfo:n,productId:n.productId,targetQty:n.targetQty}}),(0,w.qH)(n))return void eh({bgId:t,productId:n.productId});if(eo(),r&&"legacy"===a){let e=n.currentQty>=n.targetQty?"full":"expired";(await v.A.fire({icon:"warning",text:Z(`group_buying.invalid_buying_group_${e}`),showCancelButton:!0,cancelButtonText:Z("common.cancel"),confirmButtonColor:"peach-500",confirmButtonText:Z("group_buying.i_want_to_initiate")})).isConfirmed&&(en({type:"CREATE_NEW_BUYING_GROUP"}),eh({productId:n.productId,variantId:n.variantId}))}}catch(e){var n;en({type:"RESET_BUYING_GROUP"}),eo(),await v.A.fire({icon:"error",title:Z("group_buying.buying_group_not_found"),text:Z("group_buying.check_link_or_create_new_group"),confirmButtonText:Z("common.confirm")}),(null==(n=J.query)?void 0:n.productId)?eh({productId:J.query.productId,variantId:J.query.variantId}):J.push(R.H.HOME((0,s.Gy)("pageKey")))}finally{eo()}},[eh,ea,eo,J,Z]),eG=(0,c.useCallback)(async e=>{let{productId:t}=e;try{let e=await (0,g.A)((0,_.yj)(t));if(200!==e.status)throw Error("get product error");let r=e.data.data.attributes;en({type:"SET_PRODUCT",payload:{productAttributes:r}})}catch(e){b.oR.error({message:Z("common.error_happened")})}},[Z]);(0,c.useEffect)(()=>{if(B){if(ee)return void eI({productId:B,variantId:$});en({type:"RESET_JOINED_INFO"})}},[ee,B,eI,$]),(0,c.useEffect)(()=>{er.buyingGroupId&&(0,u.A)(er.buyingGroupInfo)&&ew({buyingGroupId:er.buyingGroupId,shouldShowInValidModal:!0})},[er.buyingGroupInfo,er.buyingGroupId,ew]),(0,c.useEffect)(()=>{(0,u.A)(er.product)&&B&&eG({productId:B})},[U,B,eG,er.product]);let eA=(0,c.useCallback)(async e=>{let{type:t}=e;if(!ee){b.oR.error({message:Z("group_buying.login_or_signup")}),et.current&&et.current.scrollIntoView({behavior:"smooth"});return}try{if(!e_.current)return;let e=await e_.current.onSubmit();if(!e)return;if(await ev(),!(0,u.A)(eb.errors))return void Object.values(eb.errors).forEach(e=>{(null==e?void 0:e.message)&&b.oR.error({message:e.message})});ea();let{address:a,companyName:o,taxIdNumber:i,receiptType:l}=ef(),d=x.$d.getFromCookie(),c=null,s={productId:B,targetQty:er.targetQty,qty:er.qty,ensurePurchase:er.ensurePurchase,paymentMethod:e.paymentMethod,paymentDetails:e.paymentDetails,variantId:$,b2bReceipt:"duplicate"===l?null:{taxIdNumber:i,companyName:o,address:a},utm:d,eventMeta:{utm:d,fbp:S.A.get("_fbp",void 0,!1),fbc:S.A.get("_fbc",void 0,!1)||S.A.get(P.PIXEL_CONVERSION_API_PARAMS),event_source_url:`https://shop.wordup.com.tw${window.location.pathname}`,ga_client_id:S.A.get("_ga",void 0,!1),...S.A.get(O.GOOGLE_CONVERSION_API.KEY,!0)}};switch(t){case"join":c=await (0,g.A)((e=>{let{buyingGroupId:t,params:r}=e;return{url:`/v1/shop/buying_groups/${t}/join`,method:"POST",data:{data:m()(r)}}})({buyingGroupId:(null==C?void 0:C.data.id)??"",params:s}));break;case"create":{let e=window.sessionStorage.getItem(f.aO);e&&(s.wuReferral=e),c=await (0,g.A)((e=>{let{params:t}=e;return{url:"/v1/shop/buying_groups",method:"POST",data:{data:m()(t)}}})({params:s}))}}let p=null==c?void 0:c.data.data.id;if(!p)throw Error("buying group id not found");if((null==c?void 0:c.status)===200){var r,n;if(!((null==(n=e_.current)||null==(r=n.onSuccess)?void 0:r.call(n,c.data))??!0))return;ew({buyingGroupId:p}),setTimeout(()=>{eh({productId:B,bgId:p})},2e3)}}catch(t){let e=t instanceof Error&&(0,E.a8)(t)&&"string"==typeof t.cause;v.A.fire({icon:"error",text:e?t.cause:(null==t?void 0:t.message)??Z("common.error_happened")})}finally{eo()}},[Z,ee,B,null==C?void 0:C.data.id,eb.errors,er.ensurePurchase,er.qty,er.targetQty,ev,ea,eo,eh,ew,ef,$]),eE=(0,c.useCallback)(async()=>{(await v.A.fire({title:Z("group_buying.initiate_new_group"),text:Z("group_buying.same_product_warning"),icon:"info",showCancelButton:!0,cancelButtonColor:"peach-500",confirmButtonText:Z("common.confirm"),cancelButtonText:Z("common.cancel")})).isConfirmed&&(en({type:"CREATE_NEW_BUYING_GROUP"}),eh({productId:er.productId,variantId:er.variantId}))},[eh,er.productId,er.variantId,Z]),eN=(0,c.useCallback)(async()=>
1{if(er.buyingGroupId&&(await v.A.fire({icon:"warning",title:(0,n.Y)(p.E,{variant:"body_m_500",children:Z("group_buying.leave.leave_this_group")}),html:(0,n.Y)(p.E,{variant:"body_m_400",color:"grayscale-500",children:Z("group_buying.leave.service_fee_no_refund")}),showCancelButton:!0,cancelButtonColor:"grayscale-100",confirmButtonColor:"peach-500",confirmButtonText:Z("group_buying.leave.confirm"),cancelButtonText:Z("common.cancel"),customClass:{popup:"w-[296px]!",actions:"px-6! gap-x-1!",cancelButton:"text-grayscale-800! w-1/2! m-0! py-0! min-h-[2rem]!",confirmButton:"w-1/2! m-0! py-0! min-h-[2rem]!"}})).isConfirmed)try{ea();let e=await (0,g.A)((e=>{let{buyingGroupId:t,params:r}=e;return{url:`/v1/shop/buying_groups/${t}`,method:"PATCH",data:{data:r}}})({buyingGroupId:er.buyingGroupId,params:{qty:0}}));if(200===e.status){let t=e.data.data.attributes.currentQty;0===t?(eh({productId:er.productId,variantId:er.variantId}),en({type:"RESET_BUYING_GROUP"})):ew({buyingGroupId:er.buyingGroupId})}}catch(e){b.oR.error({message:(null==e?void 0:e.message)??Z("common.error_happened")})}finally{eo()}},[Z,eh,ea,eo,ew,er.buyingGroupId,er.productId,er.variantId]);return(0,n.FD)(n.FK,{children:[(0,n.Y)(F,{product:U,buyingGroupInfo:C}),(0,n.FD)(n.FK,{children:[(0,n.Y)(D,{buyingGroupId:er.buyingGroupId,isValidBuyingGroup:es,isFull:ep}),ei&&eu?(0,n.Y)(X,{data:ei,setVis:ed}):null,(0,n.FD)("main",{className:"mx-auto max-w-[720px] px-400 pt-layout-section-padding-y-default pb-1000 mobileUp:px-0",children:[er.product?(0,n.Y)("section",{className:K.xv,children:(0,n.Y)(N.A,{name:er.product.name,productUrl:R.H.DETAIL({productId:B}),productCardThumbnailUrl:er.product.productCardThumbnailUrl,factsLabelsV2:er.product.factsLabelsV2})}):null,er.product?(0,n.Y)(M.A,{tag:"section",className:K.aM,title:"tier"===er.mode?Z("group_buying.steps.process_tier"):Z("group_buying.steps.process"),children:(0,n.Y)(Q,{subject:null==(l=er.product)||null==(i=l.categories)||null==(r=i[0])||null==(t=r.path)?void 0:t[0],mode:er.mode})}):null,(0,n.Y)(M.A,{tag:"section",className:K.aM,title:Z("crowdin:common.notice"),children:(0,n.Y)(q,{mode:er.mode,endAt:(null==(y=er.buyingGroupInfo)?void 0:y.endsAt)?(0,L.AD)((0,H.H)(null==(k=er.buyingGroupInfo)?void 0:k.endsAt),"yyyy/MM/dd HH:mm:ss"):void 0})}),(0,n.Y)("section",{ref:et,className:K.aM,children:(0,n.Y)(Y.A,{})}),(0,n.Y)(I.R.Provider,{value:{state:er,dispatch:en,allowCheckout:(null==ei?void 0:ei.allowCheckout)??!0,joinedStatus:ec,isValidBu
1yingGroup:es,isFull:ep,onSubmit:eA,canJoin:ey,allowQuit:em,createNewBuyingGroup:eE,handleQuit:eN,toJoinedBuyingGroup:()=>{var e;(null==er||null==(e=er.buyingGroupInfo)?void 0:e.joinedActiveBuyingGroupId)&&(en({type:"SET_BUYING_GROUP_ID",payload:{buyingGroupId:er.buyingGroupInfo.joinedActiveBuyingGroupId}}),eh({bgId:er.buyingGroupInfo.joinedActiveBuyingGroupId}),ew({buyingGroupId:er.buyingGroupInfo.joinedActiveBuyingGroupId}))}},children:(0,n.Y)(A.Q.Provider,{value:{paymentRef:e_},children:(0,n.Y)(d.Op,{...eg,children:(0,u.A)(er.buyingGroupInfo)?(0,n.Y)(W,{}):(0,n.Y)(z,{})})})})]}),(0,n.Y)(V.wi,{})]})]})}},94656:(e,t,r)=>{"use strict";r.d(t,{H5:()=>p,do:()=>s,qH:()=>c});var n=r(55729),a=r(81278),o=r(79516),i=r(50970),l=r(41642),u=r(67789),d=r(88697);let c=e=>(null==e?void 0:e.groupActive)&&0!==e.currentQty,s=e=>{let{buyingGroupInfo:t}=e,r=(0,n.useMemo)(()=>(null==t?void 0:t.joined)?"THIS_BUYING_GROUP":(null==t?void 0:t.joinedActiveBuyingGroupId)?"OTHER_BUYING_GROUP":"NO_BUYING_GROUP",[null==t?void 0:t.joined,null==t?void 0:t.joinedActiveBuyingGroupId]),a=(0,n.useMemo)(()=>(0,d.ku)(null==t?void 0:t.priceTiers),[null==t?void 0:t.priceTiers]),l=(0,n.useMemo)(()=>!(!t||(0,o.A)(null==t?void 0:t.targetQty))&&!a&&t.currentQty>=t.targetQty,[t,a]),u=(0,n.useMemo)(()=>!!(0,i.A)(t)||c(t),[t]),s=(0,n.useMemo)(()=>u&&"NO_BUYING_GROUP"===r,[r,u]),p=(0,n.useMemo)(()=>a?u&&"THIS_BUYING_GROUP"===r:u&&"THIS_BUYING_GROUP"===r&&!l,[u,l,r,a]);return{joinedStatus:r,isFull:l,isValidBuyingGroup:u,canJoin:s,allowQuit:p}},p=e=>{let t=(0,a.useRouter)();return(0,n.useCallback)(r=>{(0,u.LT)({productId:e,variantId:r}),t.push({pathname:l.H.BUYING_GROUP_TEMPLATE,query:{productId:e,variantId:r}})},[e,t])}},97289:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(2860),a=r(71024),o=r.n(a),i=r(82203),l=r.n(i),u=r(98986),d=r(53031);let c=o()(()=>Promise.resolve().then(r.bind(r,50463)).then(e=>e.QuantifiedMeasureCard),{loadableGenerated:{webpack:()=>[50463]}}),s=e=>{let{className:t,productUrl:r,productCardThumbnailUrl:a,name:o,factsLabelsV2:i}=e,{i18n:s}=(0,u.Bd)();return(0,n.FD)("div",{className:t,children:[(0,n.FD)(l(),{href:r,className:"flex h-[88px] items-start gap-200 overflow-hidden rounded-500 bg-gradient-to-r from-[#f3f3f4] to-[#fbfbfc] p-400 no-underline",children:[(0,n.Y)(d._,{src:a,alt:"cover image",width:"75",height:"56",className:"h-[56px] w-[75px] shrink-0 rounded-300 object-cover"}),(0,n.Y)("span",{className:"line-clamp-2 text-heading-2xs text-content-primary",children:o})]}),(null==i?void 0:i.length)>0?(0,n.Y)("div",{className:"mt-400 flex flex-col gap-y-300",children:(0,n.Y)(c,{hasTitle:!1,factsLabels:i,lang:s.resolvedLanguage})}):null]})}}},e=>{e.O(0,[8004,2079,4980,636,6593,8792],()=>e(e.s=73713)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.