PageSourceSearch

https://www.chulabook.com/_next/static/chunks/pages/pre-order-ee3046c5497f5608e392.js

js chulabook.com collected 2026-10-01 11:51:06 UTC 10,860 bytes, 1 lines download raw bytes

1_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[138],{"08ds":function(e,t,a){"use strict";var o=a("ODXe"),n=a("TSYQ"),r=a.n(n),i=a("nOHt"),c=a.n(i),s=a("q1tI"),l=a.n(s),d=a("gdJV"),m=a("yzAy"),u=a("I8qh"),p=a("4JyM"),g=a("s02U"),f=l.a.createElement;t.a=Object(p.withTranslation)("mobile_card")((function(e){var t=Object(s.useContext)(d.b),a=t.user,n=(t.handleCart,t.fetchUser),i=(t.onSocket,e.t),v=e.product,b=e._class,h=void 0===b?" mr-2":b,y=e.freespace,k=function(e){return(e=parseFloat(e)).toFixed(2).replace(",",".").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")},w=Object(s.useState)("/mobile/image/product/book.png"),N=(w[0],w[1]),_=Object(s.useState)(0),x=_[0],O=_[1];Object(s.useEffect)((function(){if(v){var e=v.picture;if(e){var t=e.split("watch?v="),a=Object(o.a)(t,2),n=(a[0],a[1]);n&&O("https://www.youtube.com/embed/"+n),N(v.picture?v.picture:"/mobile/image/product/book.png")}}}),[]);var j,F=function(e,t){if(e.preventDefault(),u.a.isLoggin()){var a=u.a.getProfile().id;m.a.addOrdeleteFav(a,{product_id:t}).then((function(e){e.data;n()})).catch((function(e){console.log(e.response)}))}else{var o=window.location.pathname;c.a.push("/login?redirect=".concat(o))}},E=function(e){if(!e.preorder_start||!e.preorder_end)return 0;var t=new Date(e.preorder_start),a=new Date(e.preorder_end),o=new Date;return o<t?1:o>a?2:e.preorder_amount?4:3};encodeURIComponent(v&&v.name.trim().replace(/\//g,"-"));return y?f(l.a.Fragment,null,f("div",{className:"card-book nonecard"+h})," "):f(p.Link,g.a.getUrlProduct(v),f("a",{className:"card-book "+h},f("div",{className:"d-flex justify-content-between mb-2 align-items-center"},f("div",{className:"d-flex align-items-center"},f("img",{alt:"\u0e28\u0e39\u0e19\u0e22\u0e4c\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d\u0e08\u0e38\u0e2c\u0e32\u0e2f",src:v?"cu"!=v.seller_id?v.seller_picture:"/mobile/image/icon/icon-cu.svg":"",className:"icon-card-seller"}),f("p",{className:"text-publisher m-0 ml-2"},v?"cu"!=v.seller_id?v.shop_name:"CHULABOOK":"")),f("div",{className:"d-flex"},v&&(function(){if(!a||!v)return!1;if(0==a.favorites.length)return!1;var e=!1;return a.favorites.forEach((function(t){t.product_id==v.id&&(e=!0)})),e}()?f("img",{src:"/mobile/image/icon/icon-fav.svg",alt:"\u0e28\u0e39\u0e19\u0e22\u0e4c\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d\u0e08\u0e38\u0e2c\u0e32\u0e2f",className:"float-right img-fluid my-auto size-16",onClick:function(e){F(e,v.id)}}):f("img",{src:"/mobile/image/icon/icon-unfav.svg",alt:"\u0e28\u0e39\u0e19\u0e22\u0e4c\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d\u0e08\u0e38\u0e2c\u0e32\u0e2f",className:"float-right img-fluid my-auto size-16",onClick:function(e){F(e,v.id)}})))),f("div",{className:r()("book-image-area mb-2 card-img-mobile",v.preorder?4!=E(v)?"set-stock":"":v.stock&&v.stock>v.reserve_stock||"ebook"==v.type||"course"==v.type?"":"set-stock")},f("div",{className:r()("area-book",{"p-0":v.picture&&"non_book"==v.type})},(0==v.video_type||null==v.video_type)&&f(l.a.Fragment,null,v.preorder?f(l.a.Fragment,null,f("img",{className:"shadow-book",src:v.picture?v.picture:"/mobile/image/product/book.png",alt:v.name,width:104,height:144,loading:"lazy",lazyLoad:"ondemand"}),f("img",{src:"/mobile/image/pre_order.svg",className:"img-stock",alt:v.name,loading:"lazy",lazyLoad:"ondemand"})):"non_book"==v.type?f("img",{src:v.picture?v.picture:"/mobile/image/product/book.png",className:"mh-100 mw-100",alt:v.name,width:104,height:144,loading:"lazy",lazyLoad:"ondemand"}):f(l.a.Fragment,null,f("img",{className:"shadow-book",src:v.picture?v.picture:"/mobile/image/product/book.png",alt:v.name,width:104,height:144,loading:"lazy",lazyLoad:"ondemand"}),"ebook"==v.type&&f("img",{src:"/mobile/image/ebook.svg",className:"img-stock",alt:v.name,width:106,height:88.5,loading:"lazy",lazyLoad:"ondemand"}),"course"==v.type&&f("img",{src:"/mobile/image/course.svg",className:"img-stock",alt:v.name,width:106,height:88.5,loading:"lazy",lazyLoad:"ondemand"}),"course_ecode"==v.type&&f("img",{src:"/mobile/image/badge-course-ecode-small.svg",className:"img-stock img-w-e-code",alt:v.name,width:106,height:88.5,loading:"lazy",lazyLoad:"ondemand"}))),1==v.video_type&&f(l.a.Fragment,null,f("video",{controls:!0,className:"w-100 video"},f("source",{src:v.picture?v.picture:"/mobile/image/product/book.png",type:"video/mp4"}),f("source",{src:v.picture?v.picture:"/mobile/image/product/book.png",type:"video/ogg"})),v.preorder&&f("img",{src:"/mobile/image/pre_order.svg",className:"img-stock",alt:"\u0e28\u0e39\u0e19\u0e22\u0e4c\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d\u0e08\u0e38\u0e2c\u0e32\u0e2f",loading:"lazy"})),2==v.video_type&&f(l.a.Fragment,null,f("iframe",{className:"mh-100 w-100 video",src:x,frameborder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"}),v.preorder&&f("img",{src:"/mobile/image/pre_order.svg",className:"img-stock",alt:"\u0e28\u0e39\u0e19\u0e22\u0e4c\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d\u0e08\u0e38\u0e2c\u0e32\u0e2f",loading:"lazy"})),"Y"===v.comming?f("div",{className:"text-stock"},i("comming")):v.preorder?f(l.a.Fragment,null,4!=E(v)?0==(j=E(v))?f("div",{className:"text-stock"},i("soon")):1==j?f("div",{className:"text-stock"},i("soon")):2==j?f("div",{className:"text-stock"},i("close")):3==j?f("div",{className:"text-stock"},i("out_stock")):void 0:""):f(l.a.Fragment,null,v.stock&&v.stock>v.reserve_stock||"ebook"==v.type||"course"==v.type?"":f("div",{className:"text-stock"},i("out_stock")))),v.promotion_active||v.promotion_product_active?f("div",{className:"badge-pro"},f("img",{src:"/mobile/icon/promotion.svg"})):null),f("h3",{className:"text-name-of-book h-40px text-h3"},v.name),f("p",{className:"text-author text-h6-p "},"book"==v.type||"ebook"==v.type?"".concat(i("author")," : ").concat(v.author):""),f("p",{className:r()("text-pink font-weight-bold text-h5-p",{"text-ebook":"ebook"==v.type,"text-stationery":"non_book"==v.type,"text-course":"course"==v.type})},v.price?"\u0e3f "+k(v.price):"Free"),v.cover_price>v.price?f("p",{className:"text-disable font-weight-bold mr-2 text-h5-p"},f("s",null,f("span",null,"\u0e3f")," ",k(v.cover_price))):f("p",{className:"text-disable font-weight-bold mr-2 text-h5-p"},f("span",null,"\u0e3f")," ",k(v.cover_price))))}))},"1Tw2":function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pre-order",function(){return a("Vm7R")}])},OuSE:function(e,t,a){"use strict";var o=a("q1tI"),n=a.n(o),r=a("fJMJ"),i=a("xn8y"),c=a("Eb6y"),s=a("BgiA"),l=n.a.createElement;t.a=function(e){var t=Object(o.useState)(0),a=t[0],n=t[1],d=Object(o.useState)(!1),m=d[0],u=d[1],p=e.items,g=e.seller_banner,f=function(){if(!m){var e=a===p.length-1?0:a+1;n(e)}},v=function(){if(!m){var e=0===a?p.length-1:a-1;n(e)}},b=p.map((function(e){return l(r.a,{onExiting:function(){return u(!0)},onExited:function(){return u(!1)},key:g?e.index:e.src},l("a",{href:g?"":e.href},l("img",{src:g?e.image:e.src,className:"w-100",alt:e.altText?e.altText:"\u0e28\u0e39\u0e19\u0e22\u0e4c\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d\u0e08\u0e38\u0e2c\u0e32\u0e2f"})))}));return l(i.a,{activeIndex:a,next:f,previous:v},l(c.a,{items:p,activeIndex:a,onClickHandler:function(e){m||n(e)}}),b,l(s.a,{direction:"prev",directionText:"Previous",onClickHandler:v}),l(s.a,{direction:"next",directionText:"Next",onClickHandler:f}))}},Vm7R:function(e,t,a){"use strict";a.r(t);var o=a("q1tI"),n=a.n(o),r=a("CafY"),i=a("4JyM"),c=a("nOHt"),s=a("a+bJ"),l=a("VSVh"),d=a("yzAy"),m=n.a.createElement,u=function(e){var t=e.t,a=e.query,r=Object(o.useState)(),i=r[0],u=r[1],p=Object(o.useState)(),g=p[0],f=p[1],v=(a.text,a.field,Object(o.useState)()),b=v[0],h=v[1],y=Object(o.useState)(),k=(y[0],y[1]);Object(c.useRouter)();Object(o.useEffect)((function(){d.a.getRecByKey("pre-order").then((function(e){var t=e.data;k(t)})).catch((function(e){console.log(e.response)})),d.a.getBanner("pre-order","cu").then((function(e){var t=e.data;u(t.type),f(t.banner_images)})).catch((function(e){console.log(e.response)})),d.a.getProducts({preorder:1}).then((function(e){var t=e.data;h(t)})).catch((function(e){console.log(e.response)})),document.getElementsByClassName("main-layout")[0]&&(document.getElementsByClassName("main-layout")[0].style.backgroundColor="#FFFFFF")}),[]);var w=function(){var e=!0;function t(){return{width:e?window.innerWidth:void 0,height:e?window.innerHeight:void 0}}var a=Object(o.useState)(t),n=a[0],r=a[1];return Object(o.useEffect)((function(){if(!e)return!1;function a(){r(t())}return window.addEventListener("resize",a),function(){return window.removeEventListener("resize",a)}}),[]),n}();return m(n.a.Fragment,null,m("div",{className:"container"},m("div",{className:"row"},m("div",{className:"col-12"},m(s.a,{data:g,type:i}))),m("div",{className:"row my-5"},m("div",{className:"col-12"},m("div",{className:"text-center"},m("h2",null,t("translations:pre_order"))))),m("div",{className:"row mt-5 "},b?w.width<1200?b.rows.map((function(e){return m(l.a,{new_padding:!0,show:3,classes:"mb-5"})})):b.rows.map((function(e){return m(l.a,{product:e,show:4,new_padding:!0})}
1)):"")),m("div",{className:"end-page"}))},p=a("pAy3"),g=a("OuSE"),f=a("08ds"),v=n.a.createElement,b=function(e){var t=e.t,a=e.query,r=Object(o.useState)(),s=(r[0],r[1],Object(o.useState)()),l=s[0],m=s[1],u=(a.text,a.field,Object(o.useState)()),p=u[0],b=u[1],h=Object(o.useState)();h[0],h[1],Object(c.useRouter)();return Object(o.useEffect)((function(){d.a.getBanner("pre-order","cu").then((function(e){var t=e.data,a=[];t.banner_images.forEach((function(e){if(5!=e.index)return!0;var t={src:e.image,key:"banner"+Math.random(),href:e.link};a.push(t)})),m(a)})).catch((function(e){console.log(e.response)})),d.a.getProducts({preorder:1}).then((function(e){var t=e.data;b(t)})).catch((function(e){console.log(e.response)})),document.body.style.backgroundColor="#FFFFFF"}),[]),v(n.a.Fragment,null,v("div",{className:"cart-nav"},v("div",{className:" text-center cart-nav-title"},v("h4",null,t("mobile_translations:pre_order"))),v(i.Link,{href:"/"},v("a",{className:"btn-back cart-nav-back"},v("img",{className:"img-fluid",src:"/mobile/image/icon/icon-back.svg"})))),v("div",{className:"bg-light-less-gray min-vh-100 "},v("div",{className:"h-64px"}),l&&v(g.a,{items:l}),v("div",{className:"all-card-news mt-3"},v("div",{className:"container d-flex flex-wrap justify-content-between "},p&&p.rows.map((function(e,t){return v(f.a,{product:e,show:4,_class:"my-2",key:t})})))),v("div",{className:"footer-space"})))},h=n.a.createElement,y=function(e){var t=e.query,a=e.t,o=Object(p.a)(992);return h(r.a,{title:"".concat(a("translations:pre_order")," | \u0e28\u0e39\u0e19\u0e22\u0e4c\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d\u0e08\u0e38\u0e2c\u0e32\u0e2f"),isBanner:!0},h(o?b:u,{t:a,query:t}))};y.getInitialProps=function(e){return{query:e.query}};t.default=Object(i.withTranslation)("home")(y)}},[["1Tw2",0,2,1,3,5,4,6,7,8,9,10,12,13,14,15]]]);

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.