enqueueScripts([function(){ (window.webpackJsonpvtex_store_resources_0_101_2=window.webpackJsonpvtex_store_resources_0_101_2||[]).push([["QueryTopSearches"],{117:function(e,n,a){"use strict";a.r(n),function(e){var n=a(0);a.p=Object(n.getPublicPath)("vtex.store-resources@0.101.2");var i=Object(n.register)((function(){return a(118)}),e,"vtex.store-resources@0.101.2","vtex.store-resources@0.x","QueryTopSearches");i.renderHotReload,i.setupHMR}.call(this,a(2)(e))},118:function(e,n,a){"use strict";a.r(n);var i=a(45),t=a.n(i);n.default=t.a},45:function(e,n){var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"topSearches"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"searchState"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.store-resources@0.101.2",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"topSearches"},arguments:[{kind:"Argument",name:{kind:"Name",value:"searchState"},value:{kind:"Variable",name:{kind:"Name",value:"searchState"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.search-graphql",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"6559a13bfe6ab36f5942860853643378e3d476cf2e78ceacf0d3955435efb4b4",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searches"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"term"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:333}};a.loc.source={body:'query topSearches($searchState: String) @context(sender: "vtex.store-resources@0.101.2") {\n topSearches(searchState: $searchState) @context(provider: "vtex.search-graphql") @runtimeMeta(hash: "6559a13bfe6ab36f5942860853643378e3d476cf2e78ceacf0d3955435efb4b4") {\n searches {\n term\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var i={};function t(e,n){for(var a=0;a0;){var c=s;s=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var i=t(e,n);i&&a.definitions.push(i)})),a}(a,"topSearches")}},[[117,"common"]]]); },function(){ !function(e){function t(t){for(var n,u,c=t[0],a=t[1],l=t[2],f=0,s=[];fe.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?s=setTimeout(a,t-u):(s=null,n||(c=e.apply(r,i),r=i=null))}null==t&&(t=100);var u=function(){r=this,i=arguments,o=Date.now();var u=n&&!s;return s||(s=setTimeout(a,t)),u&&(c=e.apply(r,i),r=i=null),c};return u.clear=function(){s&&(clearTimeout(s),s=null)},u.flush=function(){s&&(c=e.apply(r,i),r=i=null,clearTimeout(s),s=null)},u}n.debounce=n,e.exports=n},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/PixelContext"]},,function(e,t,n){"use strict";n.r(t),function(e){var t=n(2);n.p=Object(t.getPublicPath)("vtex.product-list-context@0.4.1");var s=Object(t.register)((function(){return n(9)}),e,"vtex.product-list-context@0.4.1","vtex.product-list-context@0.x","useProductImpression");s.renderHotReload,s.setupHMR}.call(this,n(4)(e))},function(e,t,n){"use strict";n.r(t);var s=n(0),i=n(5),r=n.n(i),o=n(6),c=n.n(o),a=n(3),u=n(1),l=/.+ids\/(\d+)/,d=/http:\/\//;function p(e,t,n){return e.includes("/arquivos/ids/")?"".concat(function(e){var t=l.exec(e);if(t&&t.length>0)return t[0]}(e),"-").concat(t,"-").concat(n):e}var f={imageUrl:"",imageLabel:""},m={Value:""},v={commertialOffer:{Price:0,ListPrice:0}};function x(e){return e.sellers.find((function(e){var t=e.commertialOffer;return(void 0===t?{}:t).AvailableQuantity>0}))}function I(e){var t,n,s,i=Object.assign({},e),r=i.items||[],o=r.find(x)||r[0];if(o){var c=null!==(t=null==o?void 0:o.sellers)&&void 0!==t?t:[],a=Object(u.a)(c,1)[0],l=void 0===a?v:a,I=null!==(n=o.referenceId)&&void 0!==n?n:[],b=Object(u.a)(I,1)[0],g=void 0===b?m:b,O=null!==(s=o.images)&&void 0!==s?s:[],h=Object(u.a)(O,1)[0],j=void 0===h?f:h,_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){"number"==typeof t&&(t=Math.min(t,3e3)),"number"==typeof n&&(n=Math.min(n,4e3));var s=p(e,t,n),i=s.includes("?")?"&":"?";return"".concat(s).concat(i,"width=").concat(t,"&height=").concat(n,"&aspect=true")}}(j.imageUrl.replace(d,"https://"),500),E=Object.assign(Object.assign({},j),{imageUrl:_});i.sku=Object.assign(Object.assign({},o),{seller:l,referenceId:g,image:E})}return i}var b=a.default.useProductListDispatch,g=a.default.useProductListState,O=function(e){var t=e.push,n=e.nextImpressions,s=e.dispatch,i=e.listName;!n||n.length<=0||(t({event:"productImpression",list:i||"List of products",impressions:n.filter(Boolean).map((function(e,t){var n=e.product,s=e.impressionIndex;return{product:I(n),position:null!=s?s:t}}))}),s({type:"RESET_NEXT_IMPRESSIONS"}))};t.default=function(){var e=g(),t=e.nextImpressions,n=e.listName,i=c.a.usePixel().push,o=b(),a=Object(s.useCallback)(r()(O,1e3,!1),[]);Object(s.useEffect)((function(){a({push:i,dispatch:o,listName:n,nextImpressions:t})}),[t,a,o,i,n])}}],[[8,"common"]]]); },function(){ !function(e){function t(t){for(var r,u,a=t[0],c=t[1],l=t[2],d=0,s=[];de.length)&&(t=e.length);for(var n=0,r=new Array(t);nthis.cancelTask(n,e)},resolve:void 0,reject:void 0};n.args.push(n.cancellationToken),this.queue.push(n),this.scheduler.schedule(()=>this.next());const i=new Promise((e,t)=>{n.resolve=e,n.reject=t});return i.cancel=e=>n.cancellationToken.cancel(e),i}cancel(){this.currentTask&&this.cancelTask(this.currentTask,s.cancel);const e=this.queue.splice(0);return e.length&&(e.forEach(e=>this.cancelTask(e,s.cancel)),this.emit(o)),this.wait()}indexOf(e){var t;if((null===(t=this.currentTask)||void 0===t?void 0:t.callback)===e)return 0;const n=this.queue.filter(e=>{var t;return!(null===(t=e.cancellationToken)||void 0===t?void 0:t.cancelled)}).findIndex(t=>t.callback===e);return n<0?n:n+(void 0!==this.currentTask?1:0)}close(e){return!this._isClosed&&(this._isClosed=!0,e)?this.cancel():this.wait()}async wait(){return this.currentTask||0!==this.queue.length?new Promise(e=>{this.waiters.push(e)}):Promise.resolve()}on(e,t){var n;this.events=null!==(n=this.events)&&void 0!==n?n:{},(this.events[e]||(this.events[e]=[])).push(t)}once(e,t){const n=(...i)=>{this.removeListener(e,n),t.apply(this,i)};this.on(e,n)}removeListener(e,t){if(this.events){const n=this.events[e];if(n){let e=0;for(;ee.apply(this,t))}catch(t){console.error(`${this.name}: Exception in '${e}' event handler`,t)}}next(){if(!this.currentTask){let t=this.queue.shift();for(;null==t?void 0:t.cancellationToken.cancelled;)t=this.queue.shift();if(t)try{this.currentTask=t,t.timeout&&(t.timeoutHandle=setTimeout(()=>{this.emit(l),this.cancelTask(t,s.timeout)},t.timeout));const n=t.callback.apply(void 0,t.args);n&&((e=n)&&"function"==typeof e.then)?n.then(e=>{t.result=e,this.doneTask(t)},e=>{this.doneTask(t,e)}):(t.result=n,this.doneTask(t))}catch(e){this.doneTask(t,e)}else this.callWaiters()}var e}cancelTask(e,t){e.cancellationToken.cancelled=!0,e.cancellationToken.reason=t,this.doneTask(e)}doneTask(e,t){e.timeoutHandle&&clearTimeout(e.timeoutHandle),e.cancellationToken.cancel=u,t?(this.emit(a,t),e.reject.call(void 0,t)):e.cancellationToken.cancelled?e.reject.call(void 0,e.cancellationToken.reason):e.resolve.call(void 0,e.result),this.currentTask===e&&(this.currentTask=void 0,this.queue.length?this.scheduler.schedule(()=>this.next()):(this.emit(o),this.callWaiters()))}callWaiters(){this.waiters.splice(0).forEach(e=>e())}}c.defaultScheduler={schedule:e=>setTimeout(()=>e(),0)},c.defaultScheduler={schedule:"function"==typeof e?t=>e(()=>t()):e=>setTimeout(()=>e(),0)};const d={id:"default-order-form",items:[],value:-1,totalizers:[],marketingData:{},canEditData:!1,loggedIn:!1,paymentData:{isValid:!1,installmentOptions:[],paymentSystems:[],payments:[],availableAccounts:[]},messages:{couponMessages:[],generalMessages:[]},shipping:{isValid:!1,deliveryOptions:[],pickupOptions:[]}};class f{constructor(){this.queue=new c,this.taskIdMap={},this.listeners={},this.isEmpty=!0,this.queue.on("drained",()=>{this.isEmpty=!0,this.emit("Fulfilled")})}isWaiting(e){return!!this.taskIdMap[e]}enqueue(e,t){this.isEmpty&&(this.isEmpty=!1,this.emit("Pending")),t&&this.taskIdMap[t]&&this.taskIdMap[t].promise.cancel();const n=()=>(t&&this.taskIdMap[t]&&delete this.taskIdMap[t],new Promise((t,n)=>{const i=async()=>{try{const n=await e();t(n)}catch(e){if(!navigator.onLine)return;n(e)}window.removeEventListener("online",i)};window.addEventListener("online",i),navigator.onLine&&i()})),i=this.queue.push(n),r=i.cancel;return i.cancel=()=>r({code:"TASK_CANCELLED",index:this.queue.indexOf(n)}),t&&(this.taskIdMap[t]={task:e,promise:i}),i}listen(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);return()=>{const n=this.listeners[e].indexOf(t);-1!==n&&this.listeners[e].splice(n,1)}}emit(e){this.listeners[e]&&this.listeners[e].forEach(e=>e())}}const h=Object(i.createContext)(void 0),m=()=>{const{status:e}=g();return e},v=({children:e})=>{const[t]=Object(i.useState)(()=>new f),n=Object(i.useRef)("Fulfilled");Object(i.useLayoutEffect)(()=>t.listen("Pending",()=>n.current="Pending"),[t]),Object(i.useLayoutEffect)(()=>t.listen("Fulfilled",()=>n.current="Fulfilled"),[t]);const s=Object(i.useMemo)(()=>({enqueue:t.enqueue.bind(t),listen:t.listen.bind(t),isWaiting:t.isWaiting.bind(t),status:n}),[t,n]);return r.a.createElement(h.Provider,{value:s},e)};function g(){const e=Object(i.useContext)(h);if(void 0===e)throw new Error("useOrderQueue must be used within a OrderQueueProvider");return e}var p,T,y,w,b;const k=null!==(b=!("undefined"==typeof window||!window.document||!window.document.createElement)&&(null===(w=null===(y=null===(T=null===(p=window)||void 0===p?void 0:p.__RUNTIME__)||void 0===T?void 0:T.settings)||void 0===y?void 0:y["vtex.store"])||void 0===w?void 0:w.enableOrderFormOptimization))&&void 0!==b&&b,O=Object(i.createContext)({orderForm:d,setOrderForm:()=>{},error:void 0,loading:!1});function E(){const e=Object(i.useContext)(O);if(void 0===e)throw new Error("useOrderForm must be used within a OrderFormProvider");return e}function F(){var e;return"undefined"==typeof document?null:JSON.parse(null!==(e=localStorage.getItem("orderform"))&&void 0!==e?e:"null")}function I(e,t){return"function"==typeof t?{...e,...t({...e,value:-1===e.value?0:e.value})}:{...e,...t}}function _({useOrderFormMessages:e,useGetOrderForm:t,useLogger:n,defaultOrderForm:s}){return{OrderFormProvider:({children:o})=>{var a,l;const{log:u}=null!==(a=null==n?void 0:n())&&void 0!==a?a:{},c="undefined"!=typeof document&&!navigator.onLine,[d,f]=Object(i.useReducer)(I,null!==(l=c?F():s)&&void 0!==l?l:s),{loading:h,data:v,error:g}=t({orderForm:d,setOrderForm:f}),[p,T]=Object(i.useState)(!c),y=m();Object(i.useEffect)(()=>{if(h||g||!v)return;const e=F();if(null!=e&&(!((e,t)=>-1===e.value||k&&e.id!==t.id&&"default-order-form"!==e.id)(e,v.orderForm)||"Fulfilled"!==y.current))return T(!1),void f(t=>t.id!==s.id?t:e);f(v.orderForm),T(!1)},[v,g,h,y]),Object(i.useEffect)(()=>{((e,t)=>{try{localStorage.setItem("orderform",JSON.stringify(e))}catch(e){null==t||t({type:"Error",level:"Critical",event:e,workflowType:"OrderManager",workflowInstance:"save-local-orderform"})}})(d,u)},[u,d]),e(d,f);const w=Object(i.useMemo)(()=>"default-order-form"!==d.id?{error:g,orderForm:{...d,value:-1===d.value?0:d.value,messages:{...d.messages,generalMessages:[]}},initialFetchComplete:!0,setOrderForm:f,loading:p}:{error:g,orderForm:{...d,value:-1===d.value?0:d.value,messages:{...d.messages,generalMessages:[]}},initialFetchComplete:!1,setOrderForm:f,loading:p},[g,d,p]);return r.a.createElement(O.Provider,{value:w},o)}}}function M({useToast:e,useClearOrderFormMessages:t,useGetOrderForm:n,useLogger:r,defaultOrderForm:s}){return _({useOrderFormMessages:(({useClearOrderFormMessages:e,useToast:t})=>(n,r)=>{const[s,o]=Object(i.useState)([]),{showToast:a,toastState:l}=t(),{enqueue:u}=g(),c=m(),d=e();Object(i.useEffect)(()=>{!l.isToastVisible&&s.length&&(a(s[0].text),o(e=>e.slice(1)))},[a,l.isToastVisible,s]),Object(i.useEffect)(()=>{var e,t;if(!(null===(t=null===(e=n.messages)||void 0===e?void 0:e.generalMessages)||void 0===t?void 0:t.length))return;o(e=>{var t,i;return e.concat(null!==(i=null===(t=n.messages)||void 0===t?void 0:t.generalMessages)&&void 0!==i?i:[])}),r(e=>({...e,messages:{...e.messages,generalMessages:[]}}));u(async()=>{const{data:e}=await d({orderFormId:n.id});return e.clearOrderFormMessages}).then(e=>{"Fulfilled"===c.current&&r(e)},e=>{if("TASK_CANCELLED"!==e.code)throw e})},[d,u,n.id,n.messages,c,r])})({useToast:e,useClearOrderFormMessages:t}),useGetOrderForm:n,useLogger:r,defaultOrderForm:s})}}).call(this,n(18).setImmediate)},18:function(e,t,n){var i="undefined"!=typeof global&&global||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function s(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new s(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new s(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(19),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof global&&global.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof global&&global.clearImmediate||this&&this.clearImmediate},19:function(e,t,n){(function(e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,s,o,a,l=1,u={},c=!1,d=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){m(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){m(e.data)},i=function(e){s.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(r=d.documentElement,i=function(e){var t=d.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):i=function(e){setTimeout(m,0,e)}:(o="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&m(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(o+e,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"Profile")},,,,function(e,i,n){e.exports={iconSize:"vtex-wish-list-1-x-iconSize",fill:"vtex-wish-list-1-x-fill",outline:"vtex-wish-list-1-x-outline",clearLink:"vtex-wish-list-1-x-clearLink"}},,,,,,,,function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/ProductContext"]},function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},function(e,i){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ToastContext"]},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CheckItem"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"productId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sku"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"checkList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"productId"},value:{kind:"Variable",name:{kind:"Name",value:"productId"}}},{kind:"Argument",name:{kind:"Name",value:"sku"},value:{kind:"Variable",name:{kind:"Name",value:"sku"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"b83f1b8b01e40466f97a33cbb1c32b980a4c715f4e567fb79efe5c3d2ed34baf",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"inList"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"listNames"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"listIds"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:344}};n.loc.source={body:'query CheckItem($shopperId: String!, $productId: String!, $sku: String) @context(sender: "vtex.wish-list@1.18.2") {\n checkList(shopperId: $shopperId, productId: $productId, sku: $sku) @runtimeMeta(hash: "b83f1b8b01e40466f97a33cbb1c32b980a4c715f4e567fb79efe5c3d2ed34baf") {\n inList\n listNames\n listIds\n message\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"CheckItem")},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddToList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"listItem"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ListItemInputType"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"996e55ed3e6fe9d4195c58f9491c5687226a5094396638fa88944a113ebc67ed",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addToList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"listItem"},value:{kind:"Variable",name:{kind:"Name",value:"listItem"}}},{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[]}]}}],loc:{start:0,end:289}};n.loc.source={body:'mutation AddToList($listItem: ListItemInputType!, $shopperId: String!, $name: String!) @context(sender: "vtex.wish-list@1.18.2") @runtimeMeta(hash: "996e55ed3e6fe9d4195c58f9491c5687226a5094396638fa88944a113ebc67ed") {\n addToList(listItem: $listItem, shopperId: $shopperId, name: $name)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"AddToList")},function(e,i){var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RemoveFromList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"shopperId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.wish-list@1.18.2",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"9aed358e26ce21ab217ccc495a954aca608506e22f2d2d06af6051874cda8f6e",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"removeFromList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"shopperId"},value:{kind:"Variable",name:{kind:"Name",value:"shopperId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[]}]}}],loc:{start:0,end:265}};n.loc.source={body:'mutation RemoveFromList($shopperId: String!, $id: ID!, $name: String) @context(sender: "vtex.wish-list@1.18.2") @runtimeMeta(hash: "9aed358e26ce21ab217ccc495a954aca608506e22f2d2d06af6051874cda8f6e") {\n removeFromList(id: $id, shopperId: $shopperId, name: $name)\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,i){for(var n=0;n0;){var r=s;s=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(i){var t=a(e,i);t&&n.definitions.push(t)})),n}(n,"RemoveFromList")},,,,,,,,,,,,,,,,,,function(e,i,n){"use strict";n.r(i),function(e){var i=n(2);n.p=Object(i.getPublicPath)("vtex.wish-list@1.18.2");var t=Object(i.register)((function(){return n(48)}),e,"vtex.wish-list@1.18.2","vtex.wish-list@1.x","AddProductBtn");t.renderHotReload,t.setupHMR}.call(this,n(6)(e))},function(e,i,n){"use strict";n.r(i);var t,a,d,o,s=n(1),r=n(0),l=n.n(r),u=n(3),c=n(4),m=n(24),v=n.n(m),f=n(25),k=n.n(f),p=n(26),h=n.n(p),g=n(5),b=n(8),N=n.n(b),S=n(9),I=n.n(S),w=n(10),_=n(11),y=n(27),x=n.n(y),E=n(28),O=n.n(E),D=n(12),L=n.n(D),T=n(29),V=n.n(T),A=n(16),P=n.n(A),R=Object(_.a)((function(){return sessionStorage})),j=["wishlistIconContainer","wishlistIcon"],F=null!==(t=JSON.parse(String(R.getItem("wishlist_isAuthenticated"))))&&void 0!==t&&t,C=null!==(a=R.getItem("wishlist_shopperId"))&&void 0!==a?a:null,M=null!==(d=R.getItem("wishlist_addAfterLogin"))&&void 0!==d?d:null,$=null!==(o=JSON.parse(R.getItem("wishlist_wishlisted")))&&void 0!==o?o:[],q={},W="Wishlist",z=Object(c.defineMessages)({addButton:{id:"store/wishlist.addButton"},seeLists:{id:"store/wishlist-see-lists"},productAddedToList:{id:"store/wishlist-product-added-to-list"},addProductFail:{id:"store/wishlist-add-product-fail"},listNameDefault:{id:"store/wishlist-default-list-name"},login:{id:"store/wishlist-login"},notLogged:{id:"store/wishlist-not-logged"}}),J=function(e,i){void 0===$.find((function(n){return n.productId&&n.sku&&n.productId===e&&n.sku===i}))&&$.push({productId:e,sku:i}),Q($)},Q=function(e){return R.setItem("wishlist_wishlisted",JSON.stringify(e)),e};i.default=function(e){var i,n,t,a,d,o,m,f,p,b,S,_,y,E,D,T,A,B,G,U=e.toastURL,H=void 0===U?"/account/#wishlist":U,K=Object(c.useIntl)(),X=Object(r.useState)({isLoading:!0,isWishlistPage:null}),Y=Object(s.a)(X,2),Z=Y[0],ee=Y[1],ie=Object(u.useMutation)(V.a,{onCompleted:function(){var e=String(ke.productId).split("-"),i=Object(s.a)(e,1)[0];q[i]&&(q[i]={isWishlisted:!1,wishListId:"",sku:""}),$=$.filter((function(e){return e.productId!==i&&e.sku!==Ee})),Q($),ee(Object.assign(Object.assign({},Z),{isWishlistPage:!1}))}}),ne=Object(s.a)(ie,2),te=ne[0],ae=ne[1].loading,de=Object(g.useRuntime)(),oe=de.navigate,se=de.history,re=de.route,le=de.account,ue=I()().push,ce=N()(j),me=Object(r.useContext)(h.a).showToast,ve=Object(r.useContext)(v.a),fe=ve.selectedItem,ke=ve.product,pe=(D=Object(r.useState)(),T=Object(s.a)(D,2),A=T[0],B=T[1],G=Object(w.a)(),Object(r.useEffect)((function(){G&&G.then((function(e){var i=e.response;B(i)}))}),[G]),A),he=Object(u.useLazyQuery)(x.a),ge=Object(s.a)(he,2),be=ge[0],Ne=ge[1],Se=Ne.data,Ie=Ne.loading,we=Ne.called,_e=Object(u.useQuery)(L.a,{ssr:!1}).data,ye=String(null==ke?void 0:ke.productId).split("-"),xe=Object(s.a)(ye,1)[0],Ee=null===(i=null==ke?void 0:ke.sku)||void 0===i?void 0:i.itemId;$=null!==(n=JSON.parse(R.getItem("wishlist_wishlisted")))&&void 0!==n?n:[];var Oe=function(e,i){var n;"notLogged"===e&&(n={label:K.formatMessage(z.login),onClick:function(){var e,i;return oe({page:"store.login",query:"returnUrl=".concat(encodeURIComponent(String(null===(e=null==se?void 0:se.location)||void 0===e?void 0:e.pathname)+String(null===(i=null==se?void 0:se.location)||void 0===i?void 0:i.search)))})}}),"productAddedToList"===e&&(n={label:K.formatMessage(z.seeLists),onClick:function(){return oe({to:i,fetchPage:!0})}}),me({message:K.formatMessage(z[e]),action:n})},De=Object(u.useMutation)(O.a,{onCompleted:function(e){q[xe]={wishListId:e.addToList,isWishlisted:!0,sku:Ee},J(xe,Ee),Oe("productAddedToList",H)}}),Le=Object(s.a)(De,2),Te=Le[0],Ve=Le[1],Ae=Ve.loading;Ve.error&&Oe("addProductFail",H),pe&&(F="true"===(null===(d=null===(a=null===(t=null==pe?void 0:pe.namespaces)||void 0===t?void 0:t.profile)||void 0===a?void 0:a.isAuthenticated)||void 0===d?void 0:d.value),C=(null===(o=null==_e?void 0:_e.profile)||void 0===o?void 0:o.pii)?null!==(y=null===(_=null===(S=null===(b=null==pe?void 0:pe.namespaces)||void 0===b?void 0:b.profile)||void 0===S?void 0:S.id)||void 0===_?void 0:_.value)&&void 0!==y?y:null:null===(p=null===(f=null===(m=null==pe?void 0:pe.namespaces)||void 0===m?void 0:m.profile)||void 0===f?void 0:f.email)||void 0===p?void 0:p.value,R.setItem("wishlist_isAuthenticated",JSON.stringify(F)),R.setItem("wishlist_shopperId",String(C)),F||C||R.getItem("wishlist_wishlisted")&&R.removeItem("wishlist_wishlisted"));var Pe=Z.isWishlistPage;if(!ke)return null;null===Pe&&(null==ke?void 0:ke.wishlistPage)&&ee(Object.assign(Object.assign({},Z),{isWishlistPage:!0}));F&&ke&&!we&&C&&(F&&M&&M===xe?(Te({variables:{listItem:{productId:xe,title:ke.productName,sku:fe.itemId},shopperId:C,name:W}}),M=null,R.removeItem("wishlist_addAfterLogin")):be({variables:{shopperId:String(C),productId:xe,sku:Ee}}));var Re,je,Fe,Ce=function(){var e,i,n;return"false"!==(null===(n=null===(i=null===(e=null==pe?void 0:pe.namespaces)||void 0===e?void 0:e.profile)||void 0===i?void 0:i.isAuthenticated)||void 0===n?void 0:n.value)&&void 0!==$.find((function(e){return e.productId===xe}))};if((null===(E=null==Se?void 0:Se.checkList)||void 0===E?void 0:E.inList)&&(!q[xe]||null===q[xe].wishListId)){var Me=(Re=W,je=Se.checkList,Fe=je.listNames.findIndex((function(e){return Re===e})),je.listIds[Fe]);q[xe]={isWishlisted:Se.checkList.inList,wishListId:Me,sku:Ee},Se.checkList.inList&&void 0===$.find((function(e){return e.productId===xe&&e.sku===Ee}))&&xe&&Ee&&J(xe,Ee)}return(null==Se?void 0:Se.checkList)&&!0!==Se.checkList.inList&&void 0===q[xe]&&void 0!==$.find((function(e){return e.productId===xe&&e.sku===Ee}))&&($=$.filter((function(e){return e.productId!==xe&&e.sku!==Ee})),Q($),ee(Object.assign(Object.assign({},Z),{isWishlistPage:!1}))),l.a.createElement(g.NoSSR,null,l.a.createElement("div",{className:ce.wishlistIconContainer},l.a.createElement(k.a,{variation:"tertiary",onClick:function(e){var i;if(e.preventDefault(),e.stopPropagation(),F){var n={list:null===(i=null==re?void 0:re.canonicalPath)||void 0===i?void 0:i.replace("/",""),items:{product:ke,selectedItem:fe,account:le}};Ce()&&C?(te({variables:{id:q[xe].wishListId,shopperId:C,name:W}}),n.event="removeToWishlist"):(Te({variables:{listItem:{productId:xe,title:ke.productName,sku:fe.itemId},shopperId:C,name:W}}),n.event="addToWishlist"),ue(n)}else R.setItem("wishlist_addAfterLogin",String(xe)),Oe("notLogged",H)},isLoading:Ie||Ae||ae},l.a.createElement("span",{className:"".concat(ce.wishlistIcon," ").concat(Ce()?P.a.fill:P.a.outline," ").concat(P.a.iconSize)}))))}}],[[47,"common"]]]); },function(){ !function(e){function t(t){for(var n,u,a=t[0],c=t[1],l=t[2],f=0,p=[];fe.length)&&(t=e.length);for(var r=0,n=new Array(t);re?e:t},_=function(t,e){var n=parseInt(t,10);return Number.isNaN(n)?1:y(parseInt(t,10),e)},b=["quantitySelectorDropdownMobileContainer","quantitySelectorDropdownContainer","quantitySelectorInputMobileContainer","quantitySelectorInputContainer"],f=function(t){var e=t.itemId,n=t.selectedQuantity,o=t.size,u=void 0===o?"small":o,c=t.onChange,d=t.availableQuantity,v=Object(a.useState)("dropdown"),f=Object(l.a)(v,2),h=f[0],x=f[1],E=Object(a.useState)("".concat(n)),q=Object(l.a)(E,2),N=q[0],S=q[1],w=m()().isMobile,C=r()(b),M=function(t){for(var e=Math.min(9,t),n=[],a=1;a<=e;++a)n.push({value:a,label:"".concat(a)});return t>=10&&n.push({value:10,label:"".concat(10,"+")}),n}(d),O=function(t){var e=_(t,d),n=function(t,e){var n=parseInt(t,10);return Number.isNaN(n)||n<1?"":"".concat(y(n,e))}(t,d);"dropdown"===h&&e>=Math.min(d+1,10)&&x("input"),S(n),c({value:e})};return"dropdown"===h?i.a.createElement("div",{className:w?C.quantitySelectorDropdownMobileContainer:C.quantitySelectorDropdownContainer},i.a.createElement(s.a,{id:"".concat(w?"quantity-dropdown-mobile":"quantity-dropdown","-").concat(e),testId:"".concat(w?"quantity-dropdown-mobile":"quantity-dropdown","-").concat(e),options:M,size:u,value:n,onChange:function(t){return O(t.target.value)},placeholder:" "})):i.a.createElement("div",{className:w?C.quantitySelectorInputMobileContainer:C.quantitySelectorInputContainer},i.a.createElement(p.a,{id:"".concat(w?"quantity-input-mobile":"quantity-input","-").concat(e),size:u,value:N,maxLength:5,onChange:function(t){return O(t.target.value)},onBlur:function(){""===N&&S("1");var t=_(N,d);te.length)&&(t=e.length);for(var r=0,n=new Array(t);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0?r=o[i=d]:0!==n?(i=0,r=0):e&&(r=o[i=d]),l&&l({type:"SLIDE",payload:{currentSlide:i,transform:r}}),s({type:"SLIDE",payload:{transform:r,currentSlide:i}})}}},j=function(e){var t=Object(r.useState)(!1),n=Object(g.a)(t,2),i=n[0],a=n[1],o=Object(S.useSliderGroupState)(),s=Object(S.useSliderGroupDispatch)();return Object(r.useEffect)((function(){var t=function(){null==s||s({type:"HOVER",payload:{isHovering:!0}}),a(!0)},n=function(){null==s||s({type:"HOVER",payload:{isHovering:!1}}),a(!1)};return(null==e?void 0:e.current)&&(e.current.addEventListener("mouseenter",t),e.current.addEventListener("mouseleave",n)),function(){var i=e.current;i&&(i.removeEventListener("mouseenter",t),i.removeEventListener("mouseleave",n))}}),[e,s]),(null==o?void 0:o.isHovering)?{isHovering:!0}:{isHovering:i}},T=n(14),_=n.n(T)()(X),I=_.CssHandlesProvider,M=_.useContextCssHandles,N=function(e,t){return t%e==0?"firstVisible":(t+1)%e==0?"lastVisible":""},C=function(e){return a.a.Children.toArray(a.a.Children.map(e,(function(e){return"string"==typeof e||"number"==typeof e?e:Object(r.cloneElement)(e,Object.assign(Object.assign({},e.props),{__isDuplicated:!0}))})))},D=function(e){var t=e.infinite,n=e.usePagination,o=e.centerMode,s=e.centerModeSlidesGap,l=e.totalItems,d=e.children,c=P(),u=c.slideWidth,f=c.slidesPerPage,v=c.currentSlide,p=c.isOnTouchMove,m=c.useSlidingTransitionEffect,g=c.slideTransition,y=g.speed,h=g.timing,b=g.delay,O=c.transformMap,w=c.transform,j=E(),T=Object(S.useSliderGroupDispatch)(),_=M(),I=_.handles,D=_.withModifiers,x=function(e){var t=e.currentSlide,n=e.slidesPerPage,i=e.totalItems,a=e.centerMode,o=Object(r.useRef)(new Set);Object(r.useEffect)((function(){for(var e=0;e=n&&t=n&&t+1=n&&t-1=r)}({index:e,currentSlide:t,slidesToShow:n,totalItems:i,centerMode:a})};return{shouldRenderItem:function(e){return o.current.has(e)||s(e)},isItemVisible:s}}({currentSlide:v,slidesPerPage:f,totalItems:l,centerMode:o}),R=x.shouldRenderItem,A=x.isItemVisible,L=t&&d?C(d).slice(0,f):[],k=(t&&d?C(d).slice(d.length-f):[]).concat(null!=d?d:[],L),H=f<=l?"".concat(100*k.length/f,"%"):"100%";return a.a.createElement("div",{"data-testid":"slider-track",className:"".concat(I.sliderTrack," flex ").concat("disabled"!==o?"":"justify-around"," relative pa0 ma0"),style:{transition:p||!m?void 0:"transform ".concat(y,"ms ").concat(h," ").concat(b,"ms"),transform:"translate3d(".concat(p?w:O[v],"%, 0, 0)"),width:H},onTransitionEnd:function(){j({type:"DISABLE_TRANSITION"}),v>=l&&(j({type:"ADJUST_CURRENT_SLIDE",payload:{currentSlide:0,transform:O[0]}}),null==T||T({type:"SLIDE",payload:{currentSlide:0,transform:O[0]}})),v<0&&(j({type:"ADJUST_CURRENT_SLIDE",payload:{currentSlide:v+l,transform:O[v+l]}}),null==T||T({type:"SLIDE",payload:{currentSlide:v+l,transform:O[v+l]}}))},"aria-atomic":"false","aria-live":"polite"},k.map((function(e,r){var d=r-(t?f:0),c={width:"".concat(u,"%"),marginLeft:"disabled"===o||s?void 0:"".concat(u/(8*f),"%"),marginRight:"disabled"===o||s?void 0:"".concat(u/(8*f),"%"),paddingLeft:"disabled"!==o&&s?s/2:void 0,paddingRight:"disabled"!==o&&s?s/2:void 0};return a.a.createElement("div",Object(i.a)({key:d},function(e,t,n){return t<0||t>=n?{"aria-hidden":!e,role:"none presentation"}:{"aria-hidden":!e,role:"group","aria-roledescription":"slide","aria-label":"".concat(t+1," of ").concat(n)}}(A(d),d,l),{className:"".concat(D("slide",[N(f,d),A(d)?"visible":"hidden"])," flex relative"),"data-index":d>=0&&d0?u(i):c(i)};return a.a.createElement("div",{className:"".concat(p.paginationDotsContainer," flex absolute justify-center pa0 ma0 bottom-0 left-0 right-0"),role:"group","aria-label":"Slider pagination dots"},S.map((function(e){var n=e===H(g,s,o);return a.a.createElement("div",{className:"".concat(m("paginationDot",n?"isActive":"")," ").concat(n?"bg-emphasis":"bg-muted-3"," grow dib br-100 pa2 mr2 ml2 bw0 pointer outline-0"),style:{height:"".concat(.625,"rem"),width:"".concat(.625,"rem")},key:e,tabIndex:n?0:-1,onKeyDown:function(t){return y(t,e)},onClick:function(t){return y(t,e)},role:"button","aria-controls":t,"aria-label":"Dot ".concat(e+1," of ").concat(S.length),"data-testid":"paginationDot"})})))},G=Object(r.memo)(U),W=["sliderLayoutContainer","sliderTrackContainer"].concat(Object(v.a)(["sliderTrack","slide","slideChildrenContainer"]),Object(v.a)(["sliderLeftArrow","sliderRightArrow","sliderArrows"]),Object(v.a)(["paginationDotsContainer","paginationDot"])),z=function(e){var t=e.children,n=e.totalItems,i=e.infinite,o=void 0!==i&&i,s=e.showNavigationArrows,l=e.showPaginationDots,d=e.usePagination,c=void 0===d||d,u=e.arrowSize,f=e.fullWidth,v=e.itemsPerPage,p=e.centerMode,S=e.centerModeSlidesGap,y=M().handles,h=m()().isMobile,b=P(),O=b.label,T=void 0===O?"slider":O,_=b.slidesPerPage,I=Object(r.useRef)(null),N=function(e){var t=e.infinite,n=e.centerMode,i=E(),a=P().transform,o=w(t),s=o.goForward,l=o.goBack,d=Object(r.useState)({touchStartX:0,touchInitialTransform:a}),c=Object(g.a)(d,2),u=c[0],f=c[1];return{onTouchEnd:function(e){var t=e.changedTouches[0].clientX-u.touchStartX;Math.abs(t)>75?(t>0&&l(),t<0&&s()):i({type:"TOUCH",payload:{transform:u.touchInitialTransform,isOnTouchMove:!1}}),f({touchStartX:0,touchInitialTransform:a}),i({type:"TOUCH",payload:{isOnTouchMove:!1}})},onTouchStart:function(e){var t=e.touches[0].clientX;f({touchStartX:t,touchInitialTransform:a})},onTouchMove:function(e){var t=e.touches[0].clientX-u.touchStartX,r=u.touchInitialTransform+t/(25*("disabled"!==n?2:1));i({type:"TOUCH",payload:{transform:r,isOnTouchMove:!0}})}}}({infinite:o,centerMode:p}),C=N.onTouchEnd,x=N.onTouchStart,R=N.onTouchMove;!function(e,t){var n=P().autoplay,i=j(t).isHovering,a=(null==n?void 0:n.stopOnHover)&&i,o=w(e).goForward;Object(r.useEffect)((function(){if(n){var e=setTimeout((function(){o()}),n.timeout);return a&&clearTimeout(e),function(){return clearTimeout(e)}}}),[o,a,n])}(o,I),function(e,t){var n=P(),i=n.navigationStep,a=n.isPageNavigationStep,o=n.totalItems,s=E();Object(r.useEffect)((function(){var n=o<=t?o:t,r=a?n:i,l=function(e){s({type:"ADJUST_ON_RESIZE",payload:{shouldCorrectItemPosition:e,slidesPerPage:n,navigationStep:r}})},d=function(t){l(!t||e)};return l(!1),window.addEventListener("resize",d),function(){return window.removeEventListener("resize",d)}}),[e,s,o,t,a,i])}(o,v);var A=_>=n,L="".concat(T.toLowerCase().trim().replace(/ /g,"-"),"-items-").concat(Math.random().toString(36).substring(2,9)),H=Boolean(("always"===s||"mobileOnly"===s&&h||"desktopOnly"===s&&!h)&&!A),U=Boolean(("always"===l||"mobileOnly"===l&&h||"desktopOnly"===l&&!h)&&!A);return a.a.createElement("section",{onTouchStart:function(e){return c&&!A?x(e):null},onTouchEnd:function(e){return c&&!A?C(e):null},onTouchMove:function(e){return c&&!A?R(e):null},"aria-label":T,id:L,style:{WebkitOverflowScrolling:c?void 0:"touch",paddingLeft:f?void 0:2*u,paddingRight:f?void 0:2*u,touchAction:"pan-y"},className:"w-100 flex items-center relative ".concat(y.sliderLayoutContainer)},a.a.createElement("div",{className:"w-100 ".concat(y.sliderTrackContainer," ").concat(c?"overflow-hidden":"overflow-x-scroll"),ref:I},a.a.createElement(D,{centerMode:p,centerModeSlidesGap:S,infinite:o,totalItems:n,usePagination:c},t)),H&&c&&a.a.createElement(r.Fragment,null,a.a.createElement(k,{totalItems:n,orientation:"left",controls:L,infinite:o,arrowSize:u}),a.a.createElement(k,{totalItems:n,orientation:"right",controls:L,infinite:o,arrowSize:u})),U&&c&&a.a.createElement(G,{totalItems:n,controls:L,infinite:o}))},F=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);rt.length)&&(e=t.length);for(var n=0,r=new Array(e);n");return e},c=function(e){var t=e.value,n=e.children;return o.a.createElement(a.Provider,{value:t},n)};t.default={DrawerContextProvider:c,useDrawer:i}},,function(e,t){e.exports=ReactDOM},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/applyModifiers"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconClose"]},function(e,t,n){"use strict";n.r(t);var r=n(7),o=n.n(r),a=n(4);t.default=function(e){var t,n=e.children,r=null===(t=null===window||void 0===window?void 0:window.document)||void 0===t?void 0:t.body,i=Object(a.useSSR)();return!r||i?null:o.a.createPortal(n,r)}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(2),i=n.n(a),c=n(8),s=n.n(c),l=["overlay"],u=function(e,t){var n=e.visible,r=e.onClick,a=e.zIndex,c=void 0===a?999:a,u=i()(l),d=n?"false":"true";return o.a.createElement("div",{ref:t,"aria-hidden":d,role:"presentation",onClick:r,style:{opacity:n?.5:0,pointerEvents:n?"auto":"none",zIndex:c},className:"".concat(s()(u.overlay,n?"visible":"")," bg-base--inverted z-999 fixed top-0 bottom-0 left-0 right-0")})};t.default=o.a.forwardRef(u)},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(2),i=n.n(a),c=n(9),s=n.n(c),l=n(5),u=["closeIconButton"];t.default=function(e){var t=e.size,n=void 0===t?30:t,r=e.type,a=void 0===r?"line":r,c=e.text,d=Object(l.useDrawer)().close,f=i()(u);return o.a.createElement("button",{className:"".concat(f.closeIconButton," pa4 pointer bg-transparent transparent bn pointer"),onClick:d},null!=c?c:o.a.createElement(s.a,{size:n,type:a}))}},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/usePixelEventCallback"]},,,,function(e,t){e.exports=ReactIntl},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconMenu"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.responsive-values@0.x/useResponsiveValue"]},,,,,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(1);n.p=Object(t.getPublicPath)("vtex.store-drawer@0.18.1");var r=Object(t.register)((function(){return n(36)}),e,"vtex.store-drawer@0.18.1","vtex.store-drawer@0.x","Drawer");r.renderHotReload,r.setupHMR}.call(this,n(6)(e))},,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(15),o=n(16),a=n(3),i=n(0),c=n.n(i),s=n(17),l=n(18),u=n.n(l),d=n(2),f=n.n(d),v=n(4),p=n(13),b=n.n(p),m=n(19),x=n.n(m),O=n(10),w=n(11),_=function(){var e=Object(i.useState)(!1),t=Object(a.a)(e,2),n=t[0],r=t[1],o=Object(i.useRef)("");return Object(i.useEffect)((function(){return n&&(o.current=document.body.style.overflow),document.body.style.overflow=n?"hidden":o.current,function(){n&&(document.body.style.overflow=o.current)}}),[n]),r},E=n(12),h=n(5);function g(e){return"tagName"in e}function N(e,t){if(!e||!g(e))return!1;if("A"===String(e.tagName).toUpperCase())return!0;var n=e.parentNode;return!(!n||!g(n)||"BODY"===n.tagName.toUpperCase()||t&&n===t)&&N(n,t)}var C=c.a.lazy((function(){return n.e(0).then(n.bind(null,35))})),j={isOpen:!1,hasBeenOpened:!1};function R(e,t){switch(t.type){case"open":return Object.assign(Object.assign({},e),{isOpen:!0,hasBeenOpened:!0});case"close":return Object.assign(Object.assign({},e),{isOpen:!1});default:return e}}var y=["openIconContainer","drawer","opened","closed","moving","drawerContent","childrenContainer","closeIconContainer"];function D(e){var t,n,s,l,d,p,m=e.width,g=e.header,D=e.children,I=e.customIcon,M=e.isFullWidth,P=e.maxWidth,S=void 0===P?450:P,k=e.slideDirection,z=void 0===k?"horizontal":k,B=e.backdropMode,T=void 0===B?"visible":B,W=e.renderingStrategy,U=void 0===W?"lazy":W,F=e.customPixelEventId,H=e.customPixelEventName,J=e.onVisibilityChanged,V=e.zIndex,A=void 0===V?999:V,L=f()(y),Y=x()(T),q=Boolean(Object(v.useChildBlock)({id:"drawer-trigger"})),G=Boolean(Object(v.useChildBlock)({id:"drawer-header"})),K=(t=Object(i.useReducer)(R,j),n=Object(a.a)(t,2),s=n[0],l=n[1],d=_(),p=function(e){l({type:e?"open":"close"}),d(e)},{state:s,openMenu:function(){return p(!0)},closeMenu:function(){return p(!1)}}),Q=K.state,X=K.openMenu,Z=K.closeMenu,$=Q.isOpen,ee=Q.hasBeenOpened,te=Object(i.useState)("eager"===U),ne=Object(a.a)(te,2),re=ne[0],oe=ne[1],ae=Object(i.useState)(!1),ie=Object(a.a)(ae,2),ce=ie[0],se=ie[1];b()({eventId:F,handler:X,eventName:"openDrawer"}),b()({eventId:F,handler:X,eventName:H}),Object(i.useEffect)((function(){void 0!==J&&J($)}),[J,$]);var le="horizontal"===z||"leftToRight"===z?"left":"right",ue="left"===le?"onSwipeLeft":"onSwipeRight",de=Object(i.useMemo)((function(){return{isOpen:$,open:X,close:Z}}),[$,X,Z]),fe="visible"===Y&&$;return Object(i.useEffect)((function(){($||ee||"eager"===U)&&oe(!0)}),[ee,U,oe,$]),c.a.createElement(h.DrawerContextProvider,{value:de},c.a.createElement("div",{onClick:X,role:"presentation","aria-hidden":$?"false":"true",className:"pa4 pointer ".concat(L.openIconContainer)},q?c.a.createElement(v.ExtensionPoint,{id:"drawer-trigger"}):null!=I?I:c.a.createElement(u.a,{size:20})),c.a.createElement(O.default,null,c.a.createElement(w.default,{visible:fe,onClick:Z,zIndex:A}),c.a.createElement(i.Suspense,{fallback:c.a.createElement(c.a.Fragment,null)},c.a.createElement(C,Object(r.a)({},Object(o.a)({},ue,Z),{enabled:$,position:$?"center":le,allowOutsideDrag:!0,onUpdateOffset:function(e){se(!("0%"===e||"-100%"===e))},className:"".concat(L.drawer," ").concat($?L.opened:L.closed," ").concat(ce?L.moving:""," ").concat("right"===le?"right-0":"left-0"," fixed top-0 bottom-0 bg-base z-999 flex flex-column"),style:{width:null!=m?m:M?"100%":"85%",maxWidth:S,minWidth:280,pointerEvents:$?"auto":"none",zIndex:A}}),c.a.createElement("div",{className:"".concat(L.drawerContent," overflow-y-auto"),style:{WebkitOverflowScrolling:"touch"}},G?c.a.createElement(v.ExtensionPoint,{id:"drawer-header"}):null!=g?g:c.a.createElement("div",{className:"flex ".concat(L.closeIconContainer)},c.a.createElement(E.default,null)),c.a.createElement("div",{className:"".concat(L.childrenContainer," flex flex-grow-1"),onClick:function(e){N(e.target,e.currentTarget)&&Z()}},re?D:c.a.createElement(c.a.Fragment,null)))))))}var I=Object(s.defineMessages)({title:{id:"admin/editor.drawer.title"}});D.schema={title:I.title.id};t.default=D}],[[25,"common"]]]); }], document.currentScript.dataset.index)