1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[86376],{6621:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var o=a(12115);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function r(e,t){for(var a=0;a<t.length;a++){var o=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,a){return t&&r(e.prototype,t),a&&r(e,a),e}function s(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e}).apply(this,arguments)}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},o=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),o.forEach(function(t){s(e,t,a[t])})}return e}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){return t&&("object"==typeof t||"function"==typeof t)?t:m(e)}var y={display:"inline-block",borderRadius:"50%",border:"5px double white",width:30,height:30},f={empty:u({},y,{backgroundColor:"#ccc"}),full:u({},y,{backgroundColor:"black"}),placeholder:u({},y,{backgroundColor:"red"})},b=function(e){return o.isValidElement(e)?e:"object"===l(e)&&null!==e?o.createElement("span",{style:e}):"[object String]"===Object.prototype.toString.call(e)?o.createElement("span",{className:e}):void 0},_=function(e){function t(){return n(this,t),v(this,d(t).apply(this,arguments))}return p(t,e),i(t,[{key:"render",value:function(){var e,t=this.props,a=t.index,l=t.inactiveIcon,n=t.activeIcon,r=t.percent,i=t.direction,c=t.readonly,u=t.onClick,p=t.onMouseMove,d=b(l),h=r<100,m=b(n),v=(s(e={display:"inline-block",position:"absolute",overflow:"hidden",top:0},"rtl"===i?"right":"left",0),s(e,"width","".concat(r,"%")),e);function y(e){p&&p(a,e)}function f(e){u&&(e.preventDefault(),u(a,e))}return o.createElement("span",{style:{cursor:c?"inherit":"pointer",display:"inline-block",position:"relative"},onClick:f,onMouseMove:y,onTouchMove:y,onTouchEnd:f},o.createElement("span",{style:h?{}:{visibility:"hidden"}},d),o.createElement("span",{style:v},m))}}]),t}(o.PureComponent),x=function(e){function t(e){var a;return n(this,t),(a=v(this,d(t).call(this,e))).state={displayValue:a.props.value,interacting:!1},a.onMouseLeave=a.onMouseLeave.bind(m(m(a))),a.symbolMouseMove=a.symbolMouseMove.bind(m(m(a))),a.symbolClick=a.symbolClick.bind(m(m(a))),a}return p(t,e),i(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props.value!==e.value;this.setState(function(a){return{displayValue:t?e.value:a.displayValue}})}},{key:"componentDidUpdate",value:function(e,t){if(e.value===this.props.value){if(t.interacting&&!this.state.interacting)return this.props.onHover();this.state.interacting&&this.props.onHover(this.state.displayValue)}}},{key:"symbolClick",value:function(e,t){var a=this.calculateDisplayValue(e,t);this.props.onClick(a,t)}},{key:"symbolMouseMove",value:function(e,t){var a=this.calculateDisplayValue(e,t);this.setState({interacting:!this.props.readonly,displayValue:a})}},{key:"onMouseLeave",value:function(){this.setState({displayValue:this.props.value,interacting:!1})}},{key:"calculateDisplayValue",value:function(e,t){var a=this.calculateHoverPercentage(t),o=Math.ceil(a%1*this.props.fractions)/this.props.fractions,l=e+(Math.floor(a)+Math.floor(1e3*o)/1e3);return l>0?l>this.props.totalSymbols?this.props.totalSymbols:l:1/this.props.fractions}},{key:"calculateHoverPercentage",value:function(e){var t=e.nativeEvent.type.indexOf("touch")>-1?e.nativeEvent.type.indexOf("touchend")>-1?e.changedTouches[0].clientX:e.touches[0].clientX:e.clientX,a=e.target.getBoundingClientRect(),o="rtl"===this.props.direction?a.right-t:t-a.left;return o<0?0:o/a.width}},{key:"render",value:function(){for(var e,t=this.props,a=t.readonly,l=t.quiet,n=t.totalSymbols,r=t.value,i=t.placeholderValue,s=t.direction,p=t.emptySymbol,d=t.fullSymbol,h=t.placeholderSymbol,m=t.className,v=t.id,y=t.style,f=t.tabIndex,b=this.state,x=b.displayValue,j=b.interacting,g=[],C=[].concat(p),M=[].concat(d),k=[].concat(h),w=0!==i&&0===r&&!j,S=Math.floor(e=w?i:l?r:x),R=0;R<n;R++){var N=void 0;N=R-S<0?100:R-S==0?(e-R)*100:0,g.push(o.createElement(_,c({key:R,index:R,readonly:a,inactiveIcon:C[R%C.length],activeIcon:w?k[R%M.length]:M[R%M.length],percent:N,direction:s},!a&&{onClick:this.symbolClick,onMouseMove:this.symbolMouseMove,onTouchMove:this.symbolMouseMove,onTouchEnd:this.symbolClick})))}return o.createElement("span",c({id:v,style:u({},y,{display:"inline-block",direction:s}),className:m,tabIndex:f,"aria-label":this.props["aria-label"]},!a&&{onMouseLeave:this.onMouseLeave}),g)}}]),t}
1(o.PureComponent);function j(){}j._name="react_rating_noop";var g=function(e){function t(e){var a;return n(this,t),(a=v(this,d(t).call(this,e))).state={value:e.initialRating},a.handleClick=a.handleClick.bind(m(m(a))),a.handleHover=a.handleHover.bind(m(m(a))),a}return p(t,e),i(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({value:e.initialRating})}},{key:"handleClick",value:function(e,t){var a=this,o=this.translateDisplayValueToValue(e);this.props.onClick(o),this.state.value!==o&&this.setState({value:o},function(){return a.props.onChange(a.state.value)})}},{key:"handleHover",value:function(e){var t=void 0===e?e:this.translateDisplayValueToValue(e);this.props.onHover(t)}},{key:"translateDisplayValueToValue",value:function(e){var t=e*this.props.step+this.props.start;return t===this.props.start?t+1/this.props.fractions:t}},{key:"tranlateValueToDisplayValue",value:function(e){return void 0===e?0:(e-this.props.start)/this.props.step}},{key:"render",value:function(){var e=this.props,t=e.step,a=e.emptySymbol,l=e.fullSymbol,n=e.placeholderSymbol,r=e.readonly,i=e.quiet,s=e.fractions,c=e.direction,u=e.start,p=e.stop,d=e.id,h=e.className,m=e.style,v=e.tabIndex;return o.createElement(x,{id:d,style:m,className:h,tabIndex:v,"aria-label":this.props["aria-label"],totalSymbols:Math.floor((p-u)/t),value:this.tranlateValueToDisplayValue(this.state.value),placeholderValue:this.tranlateValueToDisplayValue(this.props.placeholderRating),readonly:r,quiet:i,fractions:s,direction:c,emptySymbol:a,fullSymbol:l,placeholderSymbol:n,onClick:this.handleClick,onHover:this.handleHover})}}]),t}(o.PureComponent);g.defaultProps={start:0,stop:5,step:1,readonly:!1,quiet:!1,fractions:1,direction:"ltr",onHover:j,onClick:j,onChange:j,emptySymbol:f.empty,fullSymbol:f.full,placeholderSymbol:f.placeholder};let C=g},29486:(e,t,a)=>{"use strict";a.d(t,{b:()=>i});var o=a(12115),l=a(55897),n=a(95155),r=o.forwardRef((e,t)=>(0,n.jsx)(l.sG.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));r.displayName="Label";var i=r},46963:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});let o=a(94244).A},50910:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});var o=a(11697);function l(e,t){return function(){for(var e=arguments.length,a=Array(e),o=0;o<e;o++)a[o]=arguments[o];try{return t(...a)}catch{throw Error(void 0)}}}let n=l(0,o.c3);l(0,o.kc)},73999:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>E});var o=a(95155),l=a(12115),n=a(99003),r=a(33546),i=a(27240),s=a(6621),c=a(38434),u=a(69730),p=a.n(u),d=a(33210),h=a(94290),m=a(78697),v=a(6296),y=a(12286),f=a(38836),b=a(22620),_=a(47128),x=a(51498),j=a(82927),g=a(46963),C=a(40879),M=a(63937),k=a(77994),w=a(23388),S=a(93114),R=a.n(S);let N=i.Ik({email:i.Yj().min(1,"Email is required").email("Invalid email"),title:i.Yj().min(1,"Title is required").max(60,"Max 60 characters"),content:i.Yj().min(1,"Review is required")}),E=l.memo(function(e){let{showModal:t,closeModal:a,productCode:i,sku:u,vendorCode:S,onCreateSuccess:E}=e,{isLoggedIn:V,userProfile:A}=(0,w.n)(),[O,P]=(0,l.useState)(5),[D,I]=(0,l.useState)([]),T=(0,n.mN)({resolver:(0,r.u)(N),defaultValues:{email:A?.email??"",title:"",content:""},mode:"onTouched"}),L=async e=>{c.Ay.remove();let t=(e.email||A?.email||"").toLowerCase(),o=A?.full_name||t.split("@")[0]||"",l={email:t,name:o,title:e.title??"",content:e.content,rates:O,product_code:i||u};
1if(D.length>0){let e=await M.Ay.uploadMultipleFile(D.map(e=>e.file),!0).catch(()=>null);e&&(l.images=e.map(e=>e.file_url))}let n=S?await C.A.createReview({...l,vendor_code:S}).then(()=>!0,()=>!1):await g.A.postAnonymousProductReview({...l,status:2}).then(e=>!!e?.ok),r={name:l.name,email:l.email,title:l.title,content:l.content,rates:O,position:"Write a review",haveImage:D.length>0};n?((0,k.og)(r),c.Ay.success("Publish your review successfully.",{duration:5e3}),a(),E?.()):((0,k.R$)({...r,errorMessage:"Error"}),c.Ay.error("Can't submit your request!"))};return(0,o.jsx)(y.lG,{open:t,onOpenChange:e=>{e||a()},children:(0,o.jsxs)(y.Cf,{className:R().root,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),metadata:{title:"Write a review"},children:[(0,o.jsx)("div",{role:"presentation",className:R().closeBtn,onClick:a,children:(0,o.jsx)(d.A,{size:16,strokeWidth:1.5,"aria-hidden":!0})}),(0,o.jsx)("div",{className:R().header,children:(0,o.jsx)("div",{className:R().title,children:"Write a review"})}),(0,o.jsx)(f.lV,{...T,children:(0,o.jsxs)("form",{onSubmit:T.handleSubmit(L),noValidate:!0,children:[(0,o.jsxs)("div",{className:p()(R().field,R().mb20),children:[(0,o.jsxs)("div",{className:R().label,children:["Overall rating ",(0,o.jsx)("span",{children:"*"})]}),(0,o.jsx)("div",{className:R().input,children:(0,o.jsx)(s.A,{emptySymbol:(0,o.jsx)(h.A,{className:p()(R().star,R().starEmpty),size:28}),fullSymbol:(0,o.jsx)(h.A,{className:p()(R().star,R().starFull),size:28,fill:"currentColor",strokeWidth:0}),initialRating:O,start:0,stop:5,onChange:P})})]}),(0,o.jsx)("div",{className:R().field,children:(0,o.jsx)("div",{className:R().input,children:(0,o.jsxs)(j.A,{multiple:!0,maxNumber:5,id:"images",onFileChange:I,autoUpload:!0,children:[(0,o.jsx)(m.A,{size:20,className:R().iconPhoto}),"Add photo"]})})}),(0,o.jsx)(f.zB,{control:T.control,name:"title",render:e=>{let{field:t}=e;return(0,o.jsxs)(f.eI,{children:[(0,o.jsxs)(f.lR,{className:R().formLabel,children:["Review title ",(0,o.jsx)("span",{children:"*"})]}),(0,o.jsx)(f.MJ,{children:(0,o.jsx)(b.p,{className:R().control,maxLength:60,placeholder:"Summarize your review",...t})}),(0,o.jsx)("div",{className:R().note,children:"60 characters or less"}),(0,o.jsx)(f.C5,{})]})}}),(0,o.jsx)(f.zB,{control:T.control,name:"content",render:e=>{let{field:t}=e;return(0,o.jsxs)(f.eI,{children:[(0,o.jsxs)(f.lR,{className:R().formLabel,children:["Write your review ",(0,o.jsx)("span",{children:"*"})]}),(0,o.jsx)(f.MJ,{children:(0,o.jsx)(_.T,{className:R().control,rows:6,placeholder:"What did you like or dislike? What did you use this product for?",...t})}),(0,o.jsx)(f.C5,{})]})}}),!V&&(0,o.jsx)(f.zB,{control:T.control,name:"email",render:e=>{let{field:t}=e;return(0,o.jsxs)(f.eI,{children:[(0,o.jsxs)(f.lR,{className:R().formLabel,children:["Your email ",(0,o.jsx)("span",{children:"*"})]}),(0,o.jsx)(f.MJ,{children:(0,o.jsx)(b.p,{type:"email",className:R().control,placeholder:"[email protected]",...t})}),(0,o.jsx)(f.C5,{})]})}}),(0,o.jsx)(x.$,{type:"submit",className:R().submitBtn,disabled:T.formState.isSubmitting,children:T.formState.isSubmitting?(0,o.jsx)(v.A,{className:R().submitSpinner}):"Submit"})]})})]})})})},78697:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});let o=(0,a(12588).A)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]])},93114:e=>{e.exports={"container-extra":"CreateReviewModal_container-extra__ySi81",root:"CreateReviewModal_root__QGUM3",closeBtn:"CreateReviewModal_closeBtn__tA40u",header:"CreateReviewModal_header__pcP2g",title:"CreateReviewModal_title__ZS5lL",field:"CreateReviewModal_field__qF3ma",label:"CreateReviewModal_label__xgrr_",formLabel:"CreateReviewModal_formLabel__H7IfE",input:"CreateReviewModal_input__a_Mj3",note:"CreateReviewModal_note__RYRLd",iconPhoto:"CreateReviewModal_iconPhoto__eeYxa",star:"CreateReviewModal_star__89eu5",starEmpty:"CreateReviewModal_starEmpty__Ul4GZ",starFull:"CreateReviewModal_starFull__RxAM_",submitBtn:"CreateReviewModal_submitBtn__eOjbs",control:"CreateReviewModal_control__NDA99",submitSpinner:"CreateReviewModal_submitSpinner__CQh9R",spin:"CreateReviewModal_spin__qBbtE",mb20:"CreateReviewModal_mb20__rhixc"}}}]);
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.