enqueueScripts([function(){ (window.webpackJsonpvtex_product_highlights_2_3_0=window.webpackJsonpvtex_product_highlights_2_3_0||[]).push([["ProductHighlights"],[function(t,i){t.exports=React},function(t,i){t.exports=ReactIntl},,function(t,i){t.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},function(t,i,e){"use strict";e.r(i),e.d(i,"useHighlight",(function(){return a}));var l=e(0),o=e.n(l),r=e(1),n=e(3),d=e.n(n);var h={type:"hide",highlightNames:[]};var u=o.a.createContext(null),s=function(t){var i=t.highlight,e=t.type,r=t.children,n=Object(l.useMemo)((function(){return{highlight:i,type:e}}),[i,e]);return o.a.createElement(u.Provider,{value:n},r)};function c(t){var i,e,r,n,u=t.filter,c=void 0===u?h:u,g=t.type,a=void 0===g?"collection":g,p=t.children,m=null!==(i=d()())&&void 0!==i?i:{},v=m.product,f=m.selectedItem,y=null!=f?f:null===(e=null==v?void 0:v.items)||void 0===e?void 0:e[0],H=y?function(t){var i,e,l=null===(i=null==t?void 0:t.sellers)||void 0===i?void 0:i.find((function(t){return t.sellerDefault}));return l||(null===(e=null==t?void 0:t.sellers)||void 0===e?void 0:e[0])}(y):null,_=Object(l.useMemo)((function(){var t,i,e,l,o,r=null!==(t=null==v?void 0:v.clusterHighlights)&&void 0!==t?t:[],n=null!==(e=null===(i=null==H?void 0:H.commertialOffer)||void 0===i?void 0:i.discountHighlights)&&void 0!==e?e:[],d=null!==(o=null===(l=null==H?void 0:H.commertialOffer)||void 0===l?void 0:l.teasers)&&void 0!==o?o:[],h=function(t){return function(i){var e=t.highlightNames.includes(i.name);return!("hide"===t.type&&e||"show"===t.type&&!e)}}(c);return"collection"===a?r.filter(h):"promotion"===a?n.filter(h):"teaser"===a?d.filter(h):[]}),[c,null==v?void 0:v.clusterHighlights,null===(r=null==H?void 0:H.commertialOffer)||void 0===r?void 0:r.discountHighlights,null===(n=null==H?void 0:H.commertialOffer)||void 0===n?void 0:n.teasers,a]);return v?o.a.createElement(o.a.Fragment,null,_.map((function(t,i){return o.a.createElement(s,{key:i,type:a,highlight:t},p)}))):null}var g=Object(r.defineMessages)({Filter:{id:"admin/editor.product-highlights.filter"},QueryType:{id:"admin/editor.product-highlights.type"},Collection:{id:"admin/editor.product-highlights.type.collection"},Promotion:{id:"admin/editor.product-highlights.type.promotion"},Teaser:{id:"admin/editor.product-highlights.type.teaser"},Type:{id:"admin/editor.product-highlights.filter.type"},Hide:{id:"admin/editor.product-highlights.filter.type.hide"},Show:{id:"admin/editor.product-highlights.filter.type.show"},HighlightNames:{id:"admin/editor.product-highlights.filter.highlight-names"},HighlightName:{id:"admin/editor.product-highlights.filter.highlight-names.item"}});c.schema={title:"Product Highlights",type:"object",properties:{filter:{title:g.Filter.id,type:"object",properties:{type:{title:g.Type.id,type:"string",enum:["hide","show"],enumNames:[g.Hide.id,g.Show.id]},highlightNames:{title:g.HighlightNames.id,type:"array",minItems:0,maxItems:5,items:{title:g.HighlightName.id,type:"string",default:""}}}},type:{title:"admin/editor.product-highlights.type",type:"string",enum:["collection","promotion","teaser"],enumNames:[g.Collection.id,g.Promotion.id,g.Teaser.id]}}};var a=function(){return Object(l.useContext)(u)};i.default=c},,,,,,,,,function(t,i,e){"use strict";e.r(i),function(t){var i=e(2);e.p=Object(i.getPublicPath)("vtex.product-highlights@2.3.0");var l=Object(i.register)((function(){return e(4)}),t,"vtex.product-highlights@2.3.0","vtex.product-highlights@2.x","ProductHighlights");l.renderHotReload,l.setupHMR}.call(this,e(6)(t))}],[[13,"common"]]]); },function(){ (window.webpackJsonpvtex_product_highlights_2_3_0=window.webpackJsonpvtex_product_highlights_2_3_0||[]).push([["ProductHighlightWrapper"],[function(t,i){t.exports=React},function(t,i){t.exports=ReactIntl},,function(t,i){t.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},function(t,i,e){"use strict";e.r(i),e.d(i,"useHighlight",(function(){return a}));var l=e(0),r=e.n(l),n=e(1),o=e(3),h=e.n(o);var d={type:"hide",highlightNames:[]};var u=r.a.createContext(null),s=function(t){var i=t.highlight,e=t.type,n=t.children,o=Object(l.useMemo)((function(){return{highlight:i,type:e}}),[i,e]);return r.a.createElement(u.Provider,{value:o},n)};function c(t){var i,e,n,o,u=t.filter,c=void 0===u?d:u,g=t.type,a=void 0===g?"collection":g,p=t.children,m=null!==(i=h()())&&void 0!==i?i:{},v=m.product,f=m.selectedItem,y=null!=f?f:null===(e=null==v?void 0:v.items)||void 0===e?void 0:e[0],_=y?function(t){var i,e,l=null===(i=null==t?void 0:t.sellers)||void 0===i?void 0:i.find((function(t){return t.sellerDefault}));return l||(null===(e=null==t?void 0:t.sellers)||void 0===e?void 0:e[0])}(y):null,H=Object(l.useMemo)((function(){var t,i,e,l,r,n=null!==(t=null==v?void 0:v.clusterHighlights)&&void 0!==t?t:[],o=null!==(e=null===(i=null==_?void 0:_.commertialOffer)||void 0===i?void 0:i.discountHighlights)&&void 0!==e?e:[],h=null!==(r=null===(l=null==_?void 0:_.commertialOffer)||void 0===l?void 0:l.teasers)&&void 0!==r?r:[],d=function(t){return function(i){var e=t.highlightNames.includes(i.name);return!("hide"===t.type&&e||"show"===t.type&&!e)}}(c);return"collection"===a?n.filter(d):"promotion"===a?o.filter(d):"teaser"===a?h.filter(d):[]}),[c,null==v?void 0:v.clusterHighlights,null===(n=null==_?void 0:_.commertialOffer)||void 0===n?void 0:n.discountHighlights,null===(o=null==_?void 0:_.commertialOffer)||void 0===o?void 0:o.teasers,a]);return v?r.a.createElement(r.a.Fragment,null,H.map((function(t,i){return r.a.createElement(s,{key:i,type:a,highlight:t},p)}))):null}var g=Object(n.defineMessages)({Filter:{id:"admin/editor.product-highlights.filter"},QueryType:{id:"admin/editor.product-highlights.type"},Collection:{id:"admin/editor.product-highlights.type.collection"},Promotion:{id:"admin/editor.product-highlights.type.promotion"},Teaser:{id:"admin/editor.product-highlights.type.teaser"},Type:{id:"admin/editor.product-highlights.filter.type"},Hide:{id:"admin/editor.product-highlights.filter.type.hide"},Show:{id:"admin/editor.product-highlights.filter.type.show"},HighlightNames:{id:"admin/editor.product-highlights.filter.highlight-names"},HighlightName:{id:"admin/editor.product-highlights.filter.highlight-names.item"}});c.schema={title:"Product Highlights",type:"object",properties:{filter:{title:g.Filter.id,type:"object",properties:{type:{title:g.Type.id,type:"string",enum:["hide","show"],enumNames:[g.Hide.id,g.Show.id]},highlightNames:{title:g.HighlightNames.id,type:"array",minItems:0,maxItems:5,items:{title:g.HighlightName.id,type:"string",default:""}}}},type:{title:"admin/editor.product-highlights.type",type:"string",enum:["collection","promotion","teaser"],enumNames:[g.Collection.id,g.Promotion.id,g.Teaser.id]}}};var a=function(){return Object(l.useContext)(u)};i.default=c},function(t,i){t.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},,,,,,function(t,i,e){"use strict";e.r(i),function(t){var i=e(2);e.p=Object(i.getPublicPath)("vtex.product-highlights@2.3.0");var l=Object(i.register)((function(){return e(12)}),t,"vtex.product-highlights@2.3.0","vtex.product-highlights@2.x","ProductHighlightWrapper");l.renderHotReload,l.setupHMR}.call(this,e(6)(t))},function(t,i,e){"use strict";e.r(i);var l=e(0),r=e.n(l),n=e(5),o=e.n(n),h=e(4),d=["productHighlightWrapper"];i.default=function(t){var i=t.children,e=o()(d),l=Object(h.useHighlight)();return l?r.a.createElement("div",{"data-highlight-name":l.highlight.name,"data-highlight-id":l.highlight.id,"data-highlight-type":l.type,className:e.productHighlightWrapper},i):null}}],[[11,"common"]]]); },function(){ (window.webpackJsonpvtex_product_highlights_2_3_0=window.webpackJsonpvtex_product_highlights_2_3_0||[]).push([["ProductHighlightText"],[function(t,i){t.exports=React},function(t,i){t.exports=ReactIntl},,function(t,i){t.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},function(t,i,e){"use strict";e.r(i),e.d(i,"useHighlight",(function(){return c}));var h=e(0),l=e.n(h),n=e(1),r=e(3),o=e.n(r);var d={type:"hide",highlightNames:[]};var g=l.a.createContext(null),a=function(t){var i=t.highlight,e=t.type,n=t.children,r=Object(h.useMemo)((function(){return{highlight:i,type:e}}),[i,e]);return l.a.createElement(g.Provider,{value:r},n)};function u(t){var i,e,n,r,g=t.filter,u=void 0===g?d:g,s=t.type,c=void 0===s?"collection":s,m=t.children,p=null!==(i=o()())&&void 0!==i?i:{},v=p.product,f=p.selectedItem,y=null!=f?f:null===(e=null==v?void 0:v.items)||void 0===e?void 0:e[0],_=y?function(t){var i,e,h=null===(i=null==t?void 0:t.sellers)||void 0===i?void 0:i.find((function(t){return t.sellerDefault}));return h||(null===(e=null==t?void 0:t.sellers)||void 0===e?void 0:e[0])}(y):null,x=Object(h.useMemo)((function(){var t,i,e,h,l,n=null!==(t=null==v?void 0:v.clusterHighlights)&&void 0!==t?t:[],r=null!==(e=null===(i=null==_?void 0:_.commertialOffer)||void 0===i?void 0:i.discountHighlights)&&void 0!==e?e:[],o=null!==(l=null===(h=null==_?void 0:_.commertialOffer)||void 0===h?void 0:h.teasers)&&void 0!==l?l:[],d=function(t){return function(i){var e=t.highlightNames.includes(i.name);return!("hide"===t.type&&e||"show"===t.type&&!e)}}(u);return"collection"===c?n.filter(d):"promotion"===c?r.filter(d):"teaser"===c?o.filter(d):[]}),[u,null==v?void 0:v.clusterHighlights,null===(n=null==_?void 0:_.commertialOffer)||void 0===n?void 0:n.discountHighlights,null===(r=null==_?void 0:_.commertialOffer)||void 0===r?void 0:r.teasers,c]);return v?l.a.createElement(l.a.Fragment,null,x.map((function(t,i){return l.a.createElement(a,{key:i,type:c,highlight:t},m)}))):null}var s=Object(n.defineMessages)({Filter:{id:"admin/editor.product-highlights.filter"},QueryType:{id:"admin/editor.product-highlights.type"},Collection:{id:"admin/editor.product-highlights.type.collection"},Promotion:{id:"admin/editor.product-highlights.type.promotion"},Teaser:{id:"admin/editor.product-highlights.type.teaser"},Type:{id:"admin/editor.product-highlights.filter.type"},Hide:{id:"admin/editor.product-highlights.filter.type.hide"},Show:{id:"admin/editor.product-highlights.filter.type.show"},HighlightNames:{id:"admin/editor.product-highlights.filter.highlight-names"},HighlightName:{id:"admin/editor.product-highlights.filter.highlight-names.item"}});u.schema={title:"Product Highlights",type:"object",properties:{filter:{title:s.Filter.id,type:"object",properties:{type:{title:s.Type.id,type:"string",enum:["hide","show"],enumNames:[s.Hide.id,s.Show.id]},highlightNames:{title:s.HighlightNames.id,type:"array",minItems:0,maxItems:5,items:{title:s.HighlightName.id,type:"string",default:""}}}},type:{title:"admin/editor.product-highlights.type",type:"string",enum:["collection","promotion","teaser"],enumNames:[s.Collection.id,s.Promotion.id,s.Teaser.id]}}};var c=function(){return Object(h.useContext)(g)};i.default=u},function(t,i){t.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},,function(t,i){t.exports=__RENDER_8_COMPONENTS__["vtex.native-types@0.x/IOMessageWithMarkers"]},function(t,i){t.exports=__RENDER_8_COMPONENTS__["vtex.native-types@0.x/formatIOMessage"]},function(t,i,e){"use strict";e.r(i),function(t){var i=e(2);e.p=Object(i.getPublicPath)("vtex.product-highlights@2.3.0");var h=Object(i.register)((function(){return e(10)}),t,"vtex.product-highlights@2.3.0","vtex.product-highlights@2.x","ProductHighlightText");h.renderHotReload,h.setupHMR}.call(this,e(6)(t))},function(t,i,e){"use strict";e.r(i);var h=e(0),l=e.n(h),n=e(7),r=e.n(n),o=e(8),d=e.n(o),g=e(5),a=e.n(g),u=e(1),s=e(4),c=["productHighlightText"];i.default=function(t){var i=t.message,e=void 0===i?"":i,n=t.markers,o=void 0===n?[]:n,g=t.link,m=void 0===g?"":g,p=a()(c),v=Object(s.useHighlight)(),f=Object(u.useIntl)(),y=Object(h.useMemo)((function(){var t,i={highlightName:""};if(!v)return i;if(m){var e=d()({intl:f,id:m},{highlightId:null!==(t=v.highlight.id)&&void 0!==t?t:"",highlightName:v.highlight.name});i.highlightName=l.a.createElement("a",{href:e,key:"highlightLink","data-highlight-name":v.highlight.name,"data-highlight-id":v.highlight.id,"data-highlight-type":v.type,className:p.productHighlightText},v.highlight.name)}else i.highlightName=l.a.createElement("span",{key:"highlightName","data-highlight-name":v.highlight.name,"data-highlight-id":v.highlight.id,"data-highlight-type":v.type,className:p.productHighlightText},v.highlight.name);return i}),[v,m,f,p.productHighlightText]);return v&&e?l.a.createElement(r.a,{handleBase:"productHighlightText",message:e,markers:o,values:y}):null}}],[[9,"common"]]]); },function(){ !function(e){function t(t){for(var r,c,u=t[0],a=t[1],l=t[2],p=0,w=[];pe.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0,n=(d[e[t+0]]+d[e[t+1]]+d[e[t+2]]+d[e[t+3]]+"-"+d[e[t+4]]+d[e[t+5]]+"-"+d[e[t+6]]+d[e[t+7]]+"-"+d[e[t+8]]+d[e[t+9]]+"-"+d[e[t+10]]+d[e[t+11]]+d[e[t+12]]+d[e[t+13]]+d[e[t+14]]+d[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};var f=function(e,t,n){var i=(e=e||{}).random||(e.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return m(i)},v=n(12);const h=async()=>{},p=Object(r.createContext)({addItem:h,addItems:h,updateQuantity:h,removeItem:h,setManualPrice:h}),I=()=>Object(r.useContext)(p),g={queue:[]},y=e=>{var t;let n=null;try{n=JSON.parse(null!==(t=localStorage.getItem("orderQueue"))&&void 0!==t?t:"null")}catch{}if(!n)try{localStorage.setItem("orderQueue",JSON.stringify(g))}catch(t){null==e||e({type:"Error",level:"Critical",event:t,workflowType:"OrderItems",workflowInstance:"get-local-order-queue"})}return null!=n?n:g},w=(e,t)=>{try{localStorage.setItem("orderQueue",JSON.stringify(e))}catch(e){null==t||t({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"save-local-order-queue"})}},b=(e,t)=>{const n=y(),i=n.queue.push(e);return w(n,t),i},k=(e=0,t)=>{const n=y(t),i=n.queue[e];if(i)return n.queue.splice(e,1),w(n,t),i},T="available",q=(e,t,n)=>{var i,r,a;const u=(null===(i=e.id)||void 0===i?void 0:i.toString())===t.id,s=e.seller===t.seller;if(t.isGift)return!1;if(null==e.options||!(null===(r=e.options)||void 0===r?void 0:r.length))return!(null===(a=t.attachments)||void 0===a?void 0:a.length)&&(u&&s);const o=e.options.every(e=>n.find(t=>t.id===e.id));return u&&s&&o},O=e=>{var t;return{id:+(null!==(t=e.id)&&void 0!==t?t:0),index:e.index,quantity:e.quantity,seller:e.seller,options:e.options}},M=(e,t)=>{var n,i,r,a;return{id:t.id,productId:t.productId,name:t.name,skuName:t.skuName,skuSpecifications:t.skuSpecifications,imageUrls:{at1x:t.imageUrl,at2x:t.imageUrl,at3x:t.imageUrl},price:t.price,listPrice:t.listPrice,sellingPrice:t.sellingPrice,measurementUnit:t.measurementUnit,quantity:null!==(n=t.quantity)&&void 0!==n?n:1,unitMultiplier:null!==(i=t.unitMultiplier)&&void 0!==i?i:1,uniqueId:null!==(r=e.uniqueId)&&void 0!==r?r:f(),detailUrl:t.detailUrl,availability:null!==(a=t.availability)&&void 0!==a?a:T,additionalInfo:t.additionalInfo,options:t.options,seller:t.seller,attachmentOfferings:[],attachments:[],bundleItems:[],offerings:[],priceTags:[],isGift:!1}},x=e=>void 0!==e;function C({useMutateAddItems:e,useOrderForm:t,useLogger:n}){return i=>{var a;const{setOrderForm:u}=t(),s=e(),{log:o}=null!==(a=null==n?void 0:n())&&void 0!==a?a:{};return Object(r.useCallback)(({mutationInputItems:e,mutationInputMarketingData:t,orderFormItems:n,salesChannel:r,allowedOutdatedData:a})=>({execute:async()=>{var l;const{data:d,errors:c}=await s({items:e,marketingData:t,salesChannel:r,allowedOutdatedData:a});if(!d||(null!==(l=null==c?void 0:c.length)&&void 0!==l?l:0)>0)throw null==c?void 0:c[0];return n.forEach(e=>{const t=null==d?void 0:d.items.find(t=>t.id===e.id);if(!t)return;const n=e.uniqueId;(({fakeUniqueId:e,uniqueId:t},n)=>{const i=y(n);i.queue=i.queue.map(n=>{if("update_mutation"!==n.type)return n;const i=n.variables.orderItems.findIndex(t=>"uniqueId"in t&&t.uniqueId===e);return i>-1&&(n.variables.orderItems[i]={...n.variables.orderItems[i],uniqueId:t}),n}),w(i,n)})({fakeUniqueId:n,uniqueId:t.uniqueId},o),i.current[n]=t.uniqueId}),u(n=>({...n,items:n.items.map(t=>{if(-1===e.findIndex(e=>q(e,t,n.items)))return t;const i=d.items.find(e=>e.id===t.id);return i?{...t,uniqueId:i.uniqueId}:null}).filter(e=>null!=e),marketingData:null!=t?t:n.marketingData})),d},rollback:()=>{u(t=>{const n=e.map(({id:e})=>e.toString());return{...t,items:t.items.filter(e=>!n.includes(e.id))}})}}),[i,o,s,u])}}const _=({totalizers:e,currentValue:t=0,newItem:n,oldItem:i})=>{var r,a,u,s,o;if((null==i?void 0:i.availability)!==T)return{totalizers:e,value:t};const l=(null!==(r=i.price)&&void 0!==r?r:0)*(null!==(a=i.unitMultiplier)&&void 0!==a?a:1),d=null!==(u=i.quantity)&&void 0!==u?u:0,c=null!==(s=i.sellingPrice)&&void 0!==s?s:0,m=l*d,f=n.price*(null!==(o=n.unitMultiplier)&&void 0!==o?o:1),v=f*n.quantity-m,h=(c-l)*d,p=(n.sellingPrice-f)*n.quantity-h,I=t+v+p;if(!e.length)return{totalizers:[{id:"Items",name:"Items Total",value:v},{id:"Discounts",name:"Discounts Total",value:p}],value:I};return{totalizers:e.map(e=>{switch(e.id){case"Items":return{...e,value:e.value+v};case"Discounts":return{...e,value:e.value+p};default:return e}}),value:I}},D=async()=>{};function E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}){const l=C({useMutateAddItems:e,useOrderForm:i}),d=function({useMutateSetManualPrice:e}){return()=>{const t=e();return Object(r.useCallback)((e,n)=>{if(t)return{execute:async()=>{var i;const{data:r,errors:a}=await t({itemIndex:n,price:e});if(!r||(null!==(i=null==a?void 0:a.length)&&void 0!==i?i:0)>0)throw null==a?void 0:a[0];return r}}},[t])}}({useMutateSetManualPrice:n}),c=function({useMutateUpdateQuantity:e,useOrderForm:t}){return n=>{const{setOrderForm:i}=t(),a=e();return Object(r.useCallback)(({items:e,orderFormItems:t,id:r,allowedOutdatedData:u,splitItem:s})=>({id:r,execute:async()=>{var t;const i={orderItems:e.map(e=>{if("uniqueId"in e){return{uniqueId:n.current[e.uniqueId]||e.uniqueId,quantity:e.quantity}}return e}),allowedOutdatedData:u,splitItem:s},{data:r,errors:o}=await a(i);if(!r||(null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0)>0)throw null==o?void 0:o[0];return r},rollback:()=>{const n=e.filter(({quantity:e})=>0===e),r=e.filter(({quantity:e})=>0!==e),a=n.map(e=>t.find((t,n)=>"uniqueId"in e?t.uniqueId===e.uniqueId:e.index===n)).filter(x);i(e=>({...e,items:e.items.map(e=>{const n=r.findIndex((t,n)=>"uniqueId"in t?e.uniqueId===t.uniqueId:n===t.index);if(-1!==n){const i=r[n],a=t.find((e,t)=>"uniqueId"in i?e.uniqueId===i.uniqueId:t===i.index);return{...e,quantity:a.quantity}}return e}).concat(a)}))}}),[n,a,i])}}({useMutateUpdateQuantity:t,useOrderForm:i});return{OrderItemsProvider:({children:e})=>{const{orderForm:t,setOrderForm:n}=i(),{log:m}=u(),h=function({useOrderQueue:e}){const t=Object(r.useRef)({}),{listen:n}=e();return Object(r.useEffect)(()=>n("Fulfilled",()=>{t.current={}}),[n]),t}({useOrderQueue:s}),I=(({useOrderForm:e,useLogger:t,useOrderQueue:n,useQueueStatus:i})=>{const{log:a}=t(),{enqueue:u}=n(),s=i(),{setOrderForm:o}=e();return Object(r.useCallback)(e=>u(e.execute,e.id).then(e=>{k(0,a),"Fulfilled"===s.current?o(e):o(t=>{var n;return{...t,messages:{...e.messages,generalMessages:null===(n=e.messages)||void 0===n?void 0:n.generalMessages}}})},e=>{if(!e||e.code!==v.a)throw k(0,a),a({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"enqueue-task-error"}),e;k(e.index,a)}),[u,s,o,a])})({useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}),g=l(h),w=c(h),T=d(),x=Object(r.useRef)(t.items);Object(r.useEffect)(()=>{x.current=t.items},[t.items]);const C=Object(r.useCallback)(async(e,t)=>{var i,r,a;let u,s="";const o=x.current;if(e.id?u=o.findIndex(t=>q(e,t,o)):e.uniqueId?(s=e.uniqueId,u=o.findIndex(t=>t.uniqueId===e.uniqueId)):u=null!==(i=null==e?void 0:e.index)&&void 0!==i?i:-1,u<0||u>=o.length)throw new Error(`Item ${null!==(r=e.id)&&void 0!==r?r:e.uniqueId} not found`);s||(s=o[u].uniqueId);const l=null!==(a=e.quantity)&&void 0!==a?a:1;let d;n(e=>{const t=e.items.slice(),n=t[u],i={...n,quantity:l};return l>0?t[u]=i:t.splice(u,1),{...e,..._({totalizers:e.totalizers,currentValue:e.value,newItem:i,oldItem:n}),items:t}});let c=f();if(l>0){const n=y(m).queue;let i=-1;const r=c;for(let e=1;ee.quantity>0)?(i=e,c=t.id):(i=-1,c=r)}const a=-1===i?void 0:n[i],o="update_mutation"===(null==a?void 0:a.type)?a.variables.orderItems:[],f=o.findIndex(e=>"uniqueId"in e?e.uniqueId===s:e.index===u);let v={uniqueId:s,quantity:l};"index"in e&&(v={index:u,quantity:l}),d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:f>-1?o.map((e,t)=>t===f?v:e):o.concat([v])}}else d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:[{uniqueId:s,quantity:l}]};return b({id:c,type:"update_mutation",variables:d,orderFormItems:o},m),I(w({items:d.orderItems,orderFormItems:o,id:c,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem}))},[I,m,n,w]),E=Object(r.useCallback)(async(e,t)=>{const{salesChannel:i,marketingData:r,allowedOutdatedData:a,splitItem:u}=null!=t?t:{},{newItems:s,updatedItems:o}=e.reduce((t,n)=>{var i;const{newItems:r,updatedItems:a}=t,u=n.options&&n.options.length>0?void 0:x.current.find(t=>q(n,t,e));return null==u?r.push(n):a.push({...n,quantity:(null!==(i=n.quantity)&&void 0!==i?i:1)+u.quantity}),t},{newItems:[],updatedItems:[]}),l=[];if(o.length&&o.forEach(e=>{const t=C(e,{allowedOutdatedData:a,splitItem:u});l.push(t)}),0===s.length)return Promise.all(l).then(D);const d=s.map(O),c=s.map((e,t)=>M(d[t],e));n(e=>{var t;return{...e,items:[...x.current,...c],totalizers:c.reduce((e,t)=>_({totalizers:e,newItem:t}).totalizers,null!==(t=e.totalizers)&&void 0!==t?t:[]),marketingData:null!=r?r:e.marketingData,value:e.value+c.reduce((e,t)=>e+t.sellingPrice*t.quantity,0)}}),b({type:"add_mutation",variables:{items:d,marketingData:r,salesChannel:i,allowedOutdatedData:a},orderFormItems:c},m);const f=I(g({mutationInputItems:d,mutationInputMarketingData:r,orderFormItems:c,salesChannel:i,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData}));return Promise.all([...l,f]).then(D)},[g,I,m,n,C]),F=Object(r.useCallback)((e,t,n)=>E(e,{marketingData:t,salesChannel:n}),[E]),S=Object(r.useCallback)((e,t)=>{const n=T(e,t);n&&I(n)},[I,T]),j=Object(r.useCallback)((e,t)=>C({...e,quantity:0},t),[C]),P=Object(r.useMemo)(()=>({addItem:F,addItems:E,updateQuantity:C,removeItem:j,setManualPrice:S}),[F,E,C,j,S]);return Object(r.useEffect)(()=>{y(m).queue.forEach(e=>{"add_mutation"===e.type?I(g({mutationInputItems:e.variables.items,mutationInputMarketingData:e.variables.marketingData,orderFormItems:e.orderFormItems,salesChannel:e.variables.salesChannel,allowedOutdatedData:e.variables.allowedOutdatedData})):"update_mutation"===e.type&&I(w({items:e.variables.orderItems,orderFormItems:e.orderFormItems,allowedOutdatedData:e.variables.allowedOutdatedData,splitItem:e.variables.splitItem,id:e.id}))})},[g,I,m,w]),a.a.createElement(p.Provider,{value:P},e)}}}function F({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u}){return E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u})}},,,,,,,,,,,function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(0);const r={cancel:Object.create(null),timeout:Object.create(null)},a="drained",u="error",s="timeout";function o(){}class l{constructor(e){var t,n;this.queue=[],this._isClosed=!1,this.waiters=[],e||(e={}),this.defaultTimeout=e.timeout,this.name=null!==(t=e.name)&&void 0!==t?t:"SequentialTaskQueue",this.scheduler=null!==(n=e.scheduler)&&void 0!==n?n:l.defaultScheduler}get isClosed(){return this._isClosed}push(e,t){if(this._isClosed)throw new Error(this.name+" has been previously closed");const n={callback:e,args:(null==t?void 0:t.args)?Array.isArray(t.args)?t.args.slice():[t.args]:[],timeout:void 0!==(null==t?void 0:t.timeout)?t.timeout:this.defaultTimeout,cancellationToken:{cancel:e=>this.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,r.cancel);const e=this.queue.splice(0);return e.length&&(e.forEach(e=>this.cancelTask(e,r.cancel)),this.emit(a)),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(s),this.cancelTask(t,r.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=o,t?(this.emit(u,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(a),this.callWaiters()))}callWaiters(){this.waiters.splice(0).forEach(e=>e())}}l.defaultScheduler={schedule:e=>setTimeout(()=>e(),0)},l.defaultScheduler={schedule:"function"==typeof e?t=>e(()=>t()):e=>setTimeout(()=>e(),0)};const d="TASK_CANCELLED",c={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:[]}};Object(i.createContext)(void 0);var m,f,v,h,p;p=!("undefined"==typeof window||!window.document||!window.document.createElement)&&(null===(h=null===(v=null===(f=null===(m=window)||void 0===m?void 0:m.__RUNTIME__)||void 0===f?void 0:f.settings)||void 0===v?void 0:v["vtex.store"])||void 0===h?void 0:h.enableOrderFormOptimization),Object(i.createContext)({orderForm:c,setOrderForm:()=>{},error:void 0,loading:!1})}).call(this,n(15).setImmediate)},,,function(e,t,n){var i="undefined"!=typeof global&&global||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new a(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.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(16),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},function(e,t,n){(function(e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,a,u,s,o=1,l={},d=!1,c=t.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(t);m=m&&m.setTimeout?m:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){v(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?((a=new MessageChannel).port1.onmessage=function(e){v(e.data)},i=function(e){a.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,i=function(e){var t=c.createElement("script");t.onreadystatechange=function(){v(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):i=function(e){setTimeout(v,0,e)}:(u="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(u)&&v(+e.data.slice(u.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),i=function(e){t.postMessage(u+e,"*")}),m.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;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);rt.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&"not-empty"===c||"always"===c;return o.a.createElement(_.a,{icon:o.a.createElement("span",{className:"".concat(v.minicartIconContainer," gray relative")},o.a.createElement(i,null),g&&o.a.createElement("span",{style:{userSelect:"none"},className:"".concat(v.minicartQuantityBadge," ").concat(C.a.minicartQuantityBadgeDefault," c-on-emphasis absolute t-mini bg-emphasis br4 w1 h1 pa1 flex justify-center items-center lh-solid")},N)),variation:"tertiary",onMouseEnter:"hover"===E?function(){return h({type:"OPEN_MINICART"})}:void 0,onClick:function(){if(O)return"popupWithLink"===u&&P(w),"hover"===E?void h({type:"SET_OPEN_BEHAVIOR",value:"click"}):(h({type:"CLOSE_MINICART"}),void h({type:"SET_OPEN_BEHAVIOR",value:"hover"}));h({type:x?"CLOSE_MINICART":"OPEN_MINICART"})}})},P=function(e){var t=e.children,n=e.quantityDisplay,a=e.Icon,i=e.itemCountMode,r=e.customPixelEventId,c=e.customPixelEventName,u=e.variation,l=Object(I.useMinicartState)(),s=l.open,d=l.openBehavior,p=l.hasBeenOpened,m=l.openOnHoverProp,f=Object(I.useMinicartDispatch)(),E=y().handles;x()({eventId:r,eventName:c,handler:function(){f({type:"OPEN_MINICART"})}});return o.a.createElement("div",{onMouseLeave:"hover"===d?function(){f({type:"CLOSE_MINICART"})}:void 0},o.a.createElement(w,{variation:u,Icon:a,itemCountMode:i,quantityDisplay:n}),s&&o.a.createElement(v.a,null,"click"===d&&o.a.createElement("div",{className:"fixed top-0 left-0 w-100 h-100",onClick:function(){m&&f({type:"SET_OPEN_BEHAVIOR",value:"hover"}),f({type:"CLOSE_MINICART"})}}),o.a.createElement("div",{className:"".concat(E.popupWrapper," ").concat(C.a.popupBoxPosition," absolute z-max flex flex-column")},o.a.createElement("div",{className:"".concat(E.popupContentContainer," w-100 shadow-3 bg-base")},o.a.createElement("div",{className:"".concat(E.arrowUp," ").concat(C.a.popupArrowUp," absolute top-0 bg-base h1 w1 pa4 rotate-45")}),o.a.createElement("div",{className:"".concat(E.popupChildrenContainer," mt3 bg-base relative flex flex-column ph5 pv3")},p&&t)))))},g=n(56),R=n.n(g),j=function(e){var t=e.Icon,n=e.children,a=e.maxDrawerWidth,i=e.quantityDisplay,r=e.itemCountMode,c=e.drawerSlideDirection,u=e.backdropMode,l=void 0===u?"visible":u,s=e.customPixelEventId,d=e.customPixelEventName,p=e.onVisibilityChanged,m=y().handles;return o.a.createElement(R.a,{maxWidth:a,backdropMode:l,slideDirection:c,customPixelEventId:s,customPixelEventName:d,onVisibilityChanged:p,customIcon:o.a.createElement(w,{Icon:t,itemCountMode:r,quantityDisplay:i})},o.a.createElement("div",{className:"".concat(m.minicartSideBarContentWrapper," flex flex-column w-100 h-100"),style:{height:window.innerHeight-58}},n))},D=n(33),S=n(34),k=[].concat(Object(i.a)(["popupWrapper","popupContentContainer","arrowUp","popupChildrenContainer"]),Object(i.a)(["minicartSideBarContentWrapper"]),Object(i.a)(["minicartIconContainer","minicartQuantityBadge"]),["minicartWrapperContainer","minicartContainer"]),T=function(e){var t=e.children,n=e.backdropMode,i=e.linkVariationUrl,c=e.maxDrawerWidth,d=void 0===c?400:c,m=e.MinicartIcon,v=void 0===m?u.a:m,f=e.quantityDisplay,x=void 0===f?"not-empty":f,E=e.itemCountMode,_=void 0===E?"distinct":E,O=e.drawerSlideDirection,C=void 0===O?"rightToLeft":O,h=e.customPixelEventId,b=e.customPixelEventName,y=e.classes,M=p()(k,{classes:y}),g=M.handles,R=M.withModifiers,D=Object(l.useOrderForm)().orderForm,T=Object(I.useMinicartState)(),B=T.variation,U=T.open,A=Object(r.useState)(null!=U&&U),H=Object(a.a)(A,2),W=H[0],q=H[1],L=Object(s.useCheckoutURL)().url,V=Object(r.useCallback)((function(e){q(e)}),[q]);return Object(S.a)("drawer"===B?W:U,null==D?void 0:D.items),"link"===B?o.a.createElement("aside",{className:"".concat(g.minicartWrapperContainer," relative fr flex items-center")},o.a.createElement("div",{className:"".concat(g.minicartContainer," flex flex-column")},o.a.createElement("a",{href:null!=i?i:L},o.a.createElement(N,{handles:g,withModifiers:R},o.a.createElement(w,{variation:B,Icon:v,itemCountMode:_,quantityDisplay:x}))))):"block"===B?o.a.createElement("aside",{className:"".concat(g.minicartWrapperContainer," relative fr flex items-center")},o.a.createElement("div",{className:"".concat(g.minicartContainer," flex flex-column")},t)):o.a.createElement("aside",{className:"".concat(g.minicartWrapperContainer," relative fr flex items-center")},o.a.createElement("div",{className:"".concat(g.minicartContainer," flex flex-column")},o.a.createElement(N,{handles:g,withModifiers:R},"drawer"===B?o.a.createElement(j,{Icon:v,backdropMode:n,itemCountMode:_,maxDrawerWidth:d,quantityDisplay:x,drawerSlideDirection:C,customPixelEventId:h,customPixelEventName:b,onVisibilityChanged:V},t):o.a.createElement(P,{Icon:v,itemCountMode:_,quantityDisplay:x,customPixelEventId:h,customPixelEventName:b,variation:B},t))))},B=function(){var e=Object(l.useOrderForm)(),t=e.orderForm,n=!e.loading&&t?t.id:void 0;return Object(D.a)(n),null};t.default=function(e){return o.a.createElement(I.MinicartContextProvider,{variation:e.variation,openOnHover:e.openOnHover},o.a.createElement(B,null),o.a.createElement(T,e))}},12:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/usePixel"]},14:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.order-manager@0.x/OrderForm"]},15:function(e,t,n){"use strict";n.r(t),n.d(t,"MinicartStateContext",(function(){return u})),n.d(t,"MinicartContextProvider",(function(){return p})),n.d(t,"useMinicartDispatch",(function(){return v})),n.d(t,"useMinicartState",(function(){return m}));var a=n(13),i=n(0),r=n.n(i),o=n(21),c=n.n(o),u=Object(i.createContext)(void 0),l=Object(i.createContext)(void 0);function s(e,t){switch(t.type){case"OPEN_MINICART":return Object.assign(Object.assign({},e),{open:!0,hasBeenOpened:!0});case"CLOSE_MINICART":return Object.assign(Object.assign({},e),{open:!1});case"SET_OPEN_BEHAVIOR":return Object.assign(Object.assign({},e),{openBehavior:t.value});default:return e}}var d=function(e){return"popup"===e||"popupWithLink"===e},p=function(e){var t=e.variation,n=void 0===t?"drawer":t,o=e.openOnHover,p=void 0!==o&&o,m=e.children,v=c()().isMobile,f=d(n)&&(v||window&&window.innerWidth<=480)?"drawer":n,x=Object(i.useReducer)(s,{variation:f,open:!1,hasBeenOpened:!1,openOnHoverProp:p,openBehavior:d(f)&&p?"hover":"click"}),E=Object(a.a)(x,2),_=E[0],O=E[1];return r.a.createElement(u.Provider,{value:_},r.a.createElement(l.Provider,{value:O},m))};function m(){var e=Object(i.useContext)(u);if(void 0===e)throw new Error("useMinicartState must be used within a MinicartContextProvider");return e}function v(){var e=Object(i.useContext)(l);if(void 0===e)throw new Error("useMinicartDispatch must be used within a MinicartContextProvider");return e}},19:function(e,t,n){e.exports={drawerStyles:"vtex-minicart-2-x-drawerStyles",popupStyles:"vtex-minicart-2-x-popupStyles",minicartEmptyStateContainerDefault:"vtex-minicart-2-x-minicartEmptyStateContainerDefault",minicartQuantityBadgeDefault:"vtex-minicart-2-x-minicartQuantityBadgeDefault",popupBoxPosition:"vtex-minicart-2-x-popupBoxPosition",popupArrowUp:"vtex-minicart-2-x-popupArrowUp"}},21:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/useDevice"]},22:function(e,t){function n(e,t,n){var a,i,r,o,c;function u(){var l=Date.now()-o;l=0?a=setTimeout(u,t-l):(a=null,n||(c=e.apply(r,i),r=i=null))}null==t&&(t=100);var l=function(){r=this,i=arguments,o=Date.now();var l=n&&!a;return a||(a=setTimeout(u,t)),l&&(c=e.apply(r,i),r=i=null),c};return l.clear=function(){a&&(clearTimeout(a),a=null)},l.flush=function(){a&&(c=e.apply(r,i),r=i=null,clearTimeout(a),a=null)},l}n.debounce=n,e.exports=n},24:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(6),i=n(3);function r(){var e=Object(a.useCheckoutURL)(),t=e.url,n=e.major,r=Object(i.useRuntime)(),o=r.navigate,c=r.rootPath,u=void 0===c?"":c;return function(e){n>0&&e===t?o({to:e}):window.location.href="".concat(u).concat(e)}}},26:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconCart"]},27:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-portal@0.x/Overlay"]},28:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ButtonWithIcon"]},3:function(e,t){e.exports=__RENDER_8_RUNTIME__},33:function(e,t,n){"use strict";var a=n(0),i=n(12),r=n.n(i);t.a=function(e){var t=r()().push;Object(a.useEffect)((function(){e&&t({event:"cartId",cartId:e})}),[t,e])}},34:function(e,t,n){"use strict";var a=n(0),i=n(12),r=n.n(i),o=n(22),c=n(8);t.a=function(e,t){var n=r()().push,i=Object(c.c)(t),u=Object(a.useCallback)(Object(o.debounce)((function(e){n({event:"viewCart",items:e})}),1e3),[n]);Object(a.useEffect)((function(){e&&u(i)}),[u,e,i])}},5:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},54:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/usePixelEventCallback"]},55:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/createCssHandlesContext"]},56:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-drawer@0.x/Drawer"]},6:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.checkout-resources@0.x/Utils"]},77:function(e,t,n){"use strict";n.r(t),function(e){var t=n(4);n.p=Object(t.getPublicPath)("vtex.minicart@2.68.0");var a=Object(t.register)((function(){return n(103)}),e,"vtex.minicart@2.68.0","vtex.minicart@2.x","Minicart");a.renderHotReload,a.setupHMR}.call(this,n(20)(e))},8:function(e,t,n){"use strict";function a(e){var t;return{skuId:e.id,variant:e.skuName,price:e.sellingPrice,priceIsInt:!0,name:o(e),quantity:e.quantity,productId:e.productId,productRefId:e.productRefId,brand:e.additionalInfo?e.additionalInfo.brandName:"",category:c(e),detailUrl:e.detailUrl,imageUrl:e.imageUrls?r(e.imageUrls.at3x):null!==(t=e.imageUrl)&&void 0!==t?t:"",referenceId:e.refId}}function i(e){var t=e.category?e.category.slice(1,-1):"";return{skuId:e.id,variant:e.skuName,price:e.sellingPrice,priceIsInt:!0,name:e.name,quantity:e.quantity,productId:e.productId,productRefId:e.productRefId,brand:e.brand,category:t,detailUrl:e.detailUrl,imageUrl:e.imageUrl,referenceId:e.refId}}function r(e){return e&&0!==e.indexOf("http")?"https:".concat(e):e}function o(e){if((null==e?void 0:e.name)&&!e.name.includes(e.skuName)||e.name===e.skuName)return e.name;var t=1+e.skuName.length;return e.name.slice(0,e.name.length-t)}function c(e){try{return e.productCategoryIds.split("/").filter((function(e){return e.length})).map((function(t){return e.productCategories[t]})).join("/")}catch(e){return""}}function u(e){return e&&e.length?e.map((function(e){return a(e)})):[]}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return u}))}},[[77,"common"]]]); },function(){ !function(t){function n(n){for(var r,u,c=n[0],a=n[1],f=n[2],s=0,p=[];s=0||(o[e]=t[e]);return o}e.d(n,"a",(function(){return r}))},48:function(t,n,e){t.exports=e(89)},5:function(t,n,e){"use strict";function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}e.d(n,"a",(function(){return r}))},57:function(t,n,e){"use strict";function r(t,n){if(null==t)return{};var e,r,o=function(t,n){if(null==t)return{};var e,r,o={},i=Object.keys(t);for(r=0;r=0||(o[e]=t[e]);return o}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}e.d(n,"a",(function(){return r}))},59:function(t,n,e){"use strict";function r(t,n,e,r,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void e(t)}c.done?n(a):Promise.resolve(a).then(r,o)}function o(t){return function(){var n=this,e=arguments;return new Promise((function(o,i){var u=t.apply(n,e);function c(t){r(u,o,i,c,a,"next",t)}function a(t){r(u,o,i,c,a,"throw",t)}c(void 0)}))}}e.d(n,"a",(function(){return o}))},71:function(t,n,e){"use strict";function r(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e\s]+))?)*)\s*(\/?)\s*>/,a=/^<\s*\/\s*([\w:-]+)[^>]*>/,u=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,c=/^/i,l=/^<\s*\//;t.exports=function(t,n){for(var r,d=function(){var t=[];return t.lastItem=function(){return t[t.length-1]},t}(),g=t;t;)p();function p(){r=!0,function(){"\x3c!--"===t.substr(0,4)?(i=t.indexOf("--\x3e"))>=0&&(n.comment&&n.comment(t.substring(4,i)),t=t.substring(i+3),r=!1):f.test(t)?(e=t.match(f),r=!1,t=t.substring(e[0].length)):l.test(t)?v(a,b):c.test(t)&&v(s,h);var e;var i;!function(){if(!r)return;var e,i=t.indexOf("<");i>=0?(e=t.substring(0,i),t=t.substring(i)):(e=t,t="");n.chars&&n.chars(e)}()}();var e=t===g;g=t,e&&(t="")}function v(n,e){var i=t.match(n);i&&(t=t.substring(i[0].length),i[0].replace(n,e),r=!1)}function h(t,r,s,a){var c={},f=i(r),l=o.voids[f]||!!a;s.replace(u,(function(t,n,r,i,o){c[n]=void 0===r&&void 0===i&&void 0===o?void 0:e.decode(r||i||o||"")})),l||d.push(f),n.start&&n.start(f,c,l)}function b(t,r){var e,o=0,s=i(r);if(s)for(o=d.length-1;o>=0&&d[o]!==s;o--);if(o>=0){for(e=d.length-1;e>=o;e--)n.end&&n.end(d[e]);d.length=o}}b()}},175:function(t,n,r){"use strict";var e=r(90),i=r(107),o=r(108),s=r(110);t.exports=function(t,n){var r,a=n||{};return l(),{start:function(t,n,s){var f=i(t);if(r.ignoring)return void c(f);if(-1===(a.allowedTags||[]).indexOf(f))return void c(f);if(a.filter&&!a.filter({tag:f,attrs:n}))return void c(f);u("<"),u(f),Object.keys(n).forEach((function(t){var r=n[t],s=(a.allowedClasses||{})[f]||[],c=(a.allowedAttributes||{})[f]||[];c=c.concat((a.allowedAttributes||{})["*"]||[]);var l=i(t);("class"===l&&-1===c.indexOf(l)?(r=r.split(" ").filter((function(t){return s&&-1!==s.indexOf(t)})).join(" ").trim()).length:-1!==c.indexOf(l)&&(!0!==o.uris[l]||function(t){var n=t[0];if("#"===n||"/"===n)return!0;var r=t.indexOf(":");if(-1===r)return!0;var e=t.indexOf("?");if(-1!==e&&r>e)return!0;var i=t.indexOf("#");if(-1!==i&&r>i)return!0;return a.allowedSchemes.some((function(n){return 0===t.indexOf(n+":")}))}(r)))&&(u(" "),u(t),"string"==typeof r&&(u('="'),u(e.encode(r)),u('"')))})),u(s?"/>":">")},end:function(t){var n=i(t);-1!==(a.allowedTags||[]).indexOf(n)&&!1===r.ignoring?(u("")):f(n)},chars:function(t){!1===r.ignoring&&u(a.transformText?a.transformText(t):t)}};function u(n){t.push(n)}function c(t){s.voids[t]||(!1===r.ignoring?r={ignoring:t,depth:1}:r.ignoring===t&&r.depth++)}function f(t){r.ignoring===t&&--r.depth<=0&&l()}function l(){r={ignoring:!1,depth:0}}}},176:function(t,n,r){"use strict";t.exports={allowedAttributes:{"*":["title","accesskey"],a:["href","name","target","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null}},35:function(t,n,r){"use strict";r(90);var e=r(173),i=r(174),o=r(175),s=r(176);function a(t,n,r){var a=[],u=!0===r?n:e({},s,n),c=o(a,u);return i(t,c),a.join("")}a.defaults=s,t.exports=a},90:function(t,n,r){"use strict";var e={"&":"&","<":"<",">":">",'"':""","'":"'"},i={"&":"&","<":"<",">":">",""":'"',"'":"'"},o=/(&|<|>|"|')/g,s=/[&<>"']/g;function a(t){return e[t]}function u(t){return i[t]}function c(t){return null==t?"":String(t).replace(s,a)}function f(t){return null==t?"":String(t).replace(o,u)}c.options=f.options={},t.exports={encode:c,escape:c,decode:f,unescape:f,version:"1.0.0-browser"}}}]); },function(){ (window.webpackJsonpvtex_store_components_3_176_2=window.webpackJsonpvtex_store_components_3_176_2||[]).push([["InfoCard"],{0:function(e,t){e.exports=React},1:function(e,t){e.exports=R},17:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.native-types@0.x/formatIOMessage"]},172:function(e,t,n){"use strict";n.r(t),function(e){var t=n(3);n.p=Object(t.getPublicPath)("vtex.store-components@3.176.2");var a=Object(t.register)((function(){return n(228)}),e,"vtex.store-components@3.176.2","vtex.store-components@3.x","InfoCard");a.renderHotReload,a.setupHMR}.call(this,n(15)(e))},19:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var a=n(0),i=n.n(a),o=n(35),r=n.n(o),l={allowedAttributes:{"*":["id","title","accesskey","class","style","aria-label","width","height","hidden"],a:["href","name","target"],iframe:["allow","allowfullscreen","frameborder","src"],img:["src","alt"],link:["rel","type","href"],td:["colspan","rowspan","headers"]},allowedClasses:{},allowedSchemes:["http","https","mailto","tel"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","figure","h1","h2","h3","h4","h5","h6","hr","header","footer","i","img","ins","iframe","kbd","li","main","mark","ol","p","picture","pre","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"]};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.allowedAttributes,a=t.allowedClasses,i=t.allowedTags,o=Object.assign({},l);return i&&(o.allowedTags=i),a&&(o.allowedClasses=a),n&&(o.allowedAttributes=n),r()(e,o)}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{__html:c(e,t)}}var d=function(e){var t=e.content,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.allowedAttributes,i=t.allowedClasses,o=t.allowedTags,r=Object(a.useMemo)((function(){return s(e,{allowedAttributes:n,allowedClasses:i,allowedTags:o})}),[n,i,o,e]);return r}(t,{allowedAttributes:e.allowedAttributes,allowedClasses:e.allowedClasses,allowedTags:e.allowedTags});return t?i.a.createElement("div",{style:{display:"contents"},dangerouslySetInnerHTML:n}):null}},2:function(e,t){e.exports=PropTypes},228:function(e,t,n){"use strict";n.r(t);var a,i,o,r,l=n(11),c=n(5),s=n(6),d=n.n(s),m=n(2),u=n.n(m),f=n(0),T=n.n(f),b=n(1),p=n(4),g=n(8),_=n(17),x=n.n(_),O=n(7),E=n.n(O),v=n(84),h=n.n(v),C=n(29),A=n.n(C),y="left",N="center",w="right",j="left",I="center",L="right",M="none",P="button",k={TEXT_MODE_HTML:{name:"admin/editor.info-card.textMode.html",value:"html"},TEXT_MODE_RICHTEXT:{name:"admin/editor.info-card.textMode.rich-text",value:"rich-text"}},S={TEXT_POSITION_LEFT:{name:"admin/editor.info-card.textPosition.left",value:y},TEXT_POSITION_CENTER:{name:"admin/editor.info-card.textPosition.center",value:N},TEXT_POSITION_RIGHT:{name:"admin/editor.info-card.textPosition.right",value:w}},R={TEXT_ALIGNMENT_LEFT:{name:"admin/editor.info-card.textAlignment.left",value:j},TEXT_ALIGNMENT_CENTER:{name:"admin/editor.info-card.textAlignment.center",value:I},TEXT_ALIGNMENT_RIGHT:{name:"admin/editor.info-card.textAlignment.right",value:L}},U={CALL_ACTION_NONE:{name:"admin/editor.info-card.callAction.none",value:M},CALL_ACTION_BUTTON:{name:"admin/editor.info-card.callAction.button",value:P},CALL_ACTION_LINK:{name:"admin/editor.info-card.callAction.link",value:"link"}},X=["infoCardCallActionContainer","infoCardCallActionText"],F=function(){},D=function(e){var t=e.mode,n=e.text,a=e.url,i=e.linkTarget,o=E()(X).handles;if(t===M)return null;var r=function(e){var t=e.text;return e.mode===P?T.a.createElement(A.a,{onClick:F},t):T.a.createElement("p",{className:"".concat(o.infoCardCallActionText," link t-body b underline c-action-primary")},t)};return T.a.createElement(g.Link,{className:"".concat(o.infoCardCallActionContainer," mt6 mb6"),target:i,to:a},T.a.createElement(r,{text:n,mode:t}))},H=function(e){var t=e.imageActionUrl,n=e.children,a=e.extraCondition,i=e.linkProps,o=void 0===i?{}:i;return!t||0===t.length||a?T.a.createElement(f.Fragment,null,n):T.a.createElement(g.Link,Object(l.a)({},o,{to:t}),n)},G=n(19);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function z(e){for(var t=1;t=0?o=setTimeout(l,t-a):(o=null,n||(s=e.apply(r,i),r=i=null))}null==t&&(t=100);var a=function(){r=this,i=arguments,u=Date.now();var a=n&&!o;return o||(o=setTimeout(l,t)),a&&(s=e.apply(r,i),r=i=null),s};return a.clear=function(){o&&(clearTimeout(o),o=null)},a.flush=function(){o&&(s=e.apply(r,i),r=i=null,clearTimeout(o),o=null)},a}n.debounce=n,e.exports=n},87:function(e,t,n){"use strict";var o=n(40),i=n(13),r=n(99),u=n(32),s=n(2),l=n.n(s),a=n(0);n(100);function d(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function c(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function p(e,t){if(e.clientHeightt||r>e&&u=t&&s>=n?r-e-o:u>t&&sn?u-t+i:0}var f=0;function g(e){return"function"==typeof e?e:m}function m(){}function v(e,t){null!==e&&function(e,t){var n=window,o=t.scrollMode,i=t.block,r=t.inline,u=t.boundary,s=t.skipOverflowHiddenElements,l="function"==typeof u?u:function(e){return e!==u};if(!d(e))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,c=[],f=e;d(f)&&l(f);){if((f=f.parentNode)===a){c.push(f);break}f===document.body&&p(f)&&!p(document.documentElement)||p(f,s)&&c.push(f)}for(var g=n.visualViewport?n.visualViewport.width:innerWidth,m=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,I=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),b=y.height,S=y.width,w=y.top,x=y.right,C=y.bottom,O=y.left,H="start"===i||"nearest"===i?w:"end"===i?C:w+b/2,E="center"===r?O+S/2:"end"===r?x:O,M=[],D=0;D=0&&O>=0&&C<=m&&x<=g&&w>=R&&C<=V&&O>=K&&x<=j)return M;var _=getComputedStyle(P),L=parseInt(_.borderLeftWidth,10),$=parseInt(_.borderTopWidth,10),B=parseInt(_.borderRightWidth,10),W=parseInt(_.borderBottomWidth,10),U=0,N=0,F="offsetWidth"in P?P.offsetWidth-P.clientWidth-L-B:0,z="offsetHeight"in P?P.offsetHeight-P.clientHeight-$-W:0;if(a===P)U="start"===i?H:"end"===i?H-m:"nearest"===i?h(I,I+m,m,$,W,I+H,I+H+b,b):H-m/2,N="start"===r?E:"center"===r?E-g/2:"end"===r?E-g:h(v,v+g,g,L,B,v+E,v+E+S,S),U=Math.max(0,U+I),N=Math.max(0,N+v);else{U="start"===i?H-R-$:"end"===i?H-V+W+z:"nearest"===i?h(R,V,k,$,W+z,H,H+b,b):H-(R+k/2)+z/2,N="start"===r?E-K-L:"center"===r?E-(K+A/2)+F/2:"end"===r?E-j+B+F:h(K,j,A,L,B+F,E,E+S,S);var X=P.scrollLeft,Y=P.scrollTop;H+=Y-(U=Math.max(0,Math.min(Y+U,P.scrollHeight-k+z))),E+=X-(N=Math.max(0,Math.min(X+N,P.scrollWidth-A+F)))}M.push({el:P,top:U,left:N})}return M}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o}))}function I(e,t){return e===t||e.contains&&e.contains(t)}function y(e,t){var n;function o(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,r=new Array(i),u=0;u1?n-1:0),i=1;i=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function D(e,t,n){var o=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:o+1);var i=t+e;return i<0?i=o:i>o&&(i=0),i}var P=y((function(){k().textContent=""}),500);function T(e,t){var n=k(t);e&&(n.textContent=e,P())}function k(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var A=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),R=function(){var e=function(e){function t(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(f++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var o=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==o})),e()}),t);n.timeoutIds.push(o)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=E(t),n.internalSetState(Object(i.a)({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,o){t=E(t),n.internalSetState(Object(i.a)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),o)},n.selectItemAtIndex=function(e,t,o){var i=n.items[e];null!=i&&n.selectItem(i,t,o)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var o,r,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,Object(i.a)({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var l=s?e(t):e;l=n.props.stateReducer(t,l),o=l.hasOwnProperty("selectedItem");var a={},d={};return o&&l.selectedItem!==t.selectedItem&&(r=l.selectedItem),l.type=l.type||0,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(u[e]=l[e]),"type"!==e&&(d[e]=l[e],n.isControlledProp(e)||(a[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,Object(i.a)({},n.getStateAndHelpers(),{},l)),a}),(function(){g(t)(),Object.keys(u).length>1&&n.props.onStateChange(u,n.getStateAndHelpers()),o&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==r&&n.props.onChange(r,n.getStateAndHelpers()),n.props.onUserAction(u,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,d=Object(o.a)(u,["refKey","ref"]),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var h=n.getState().isOpen;return Object(i.a)(((r={})[l]=S(a,n.rootRef),r.role="combobox",r["aria-expanded"]=h,r["aria-haspopup"]="listbox",r["aria-owns"]=h?n.menuId:null,r["aria-labelledby"]=n.labelId,r),d)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(D(1,t.getState().highlightedIndex,e),{type:4})}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(D(-1,t.getState().highlightedIndex,e),{type:4})}))},Enter:function(e){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var i=this.items[o],r=this.getItemNodeFromIndex(o);if(null==i||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=Object(i.a)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=Object(i.a)({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:7})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:8})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,u=(t.onPress,t.onKeyDown),s=t.onKeyUp,l=t.onBlur,a=Object(o.a)(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),d=n.getState().isOpen,c={onClick:b(r,n.buttonHandleClick),onKeyDown:b(u,n.buttonHandleKeyDown),onKeyUp:b(s,n.buttonHandleKeyUp),onBlur:b(l,n.buttonHandleBlur)},p=a.disabled?{}:c;return Object(i.a)({type:"button",role:"button","aria-label":d?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},p,{},a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=M(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(Object(r.a)(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return Object(i.a)({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput,a=(t.onChangeText,Object(o.a)(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),d={};var c,p=n.getState(),h=p.inputValue,f=p.isOpen,g=p.highlightedIndex;a.disabled||((c={}).onChange=b(s,l,n.inputHandleChange),c.onKeyDown=b(r,n.inputHandleKeyDown),c.onBlur=b(u,n.inputHandleBlur),d=c);return Object(i.a)({"aria-autocomplete":"list","aria-activedescendant":f&&"number"==typeof g&&g>=0?n.getItemId(g):null,"aria-controls":f?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:h,id:n.inputId},d,{},a)},n.inputHandleKeyDown=function(e){var t=M(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(Object(r.a)(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,d=Object(o.a)(u,["refKey","ref"]),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,Object(i.a)(((r={})[l]=S(a,n.menuRef),r.role="listbox",r["aria-labelledby"]=d&&d["aria-label"]?null:n.labelId,r.id=n.menuId,r),d)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,u=r.onMouseMove,s=r.onMouseDown,l=r.onClick,a=(r.onPress,r.index),d=r.item,c=void 0===d?void 0:d,p=Object(o.a)(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var h=l,f=((t={onMouseMove:b(u,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:b(s,(function(e){e.preventDefault()}))}).onClick=b(h,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:f.onMouseDown}:f;return Object(i.a)({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,{},p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var o=t.selectedItem;return Object(i.a)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(o)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var o=t.isOpen;return Object(i.a)({isOpen:!o},o&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var o=n.getState(),i=o.isOpen,r=o.highlightedIndex;i&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),g(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=y((function(){var e=n.getState(),t=n.items[e.highlightedIndex],o=n.getItemCount(),r=n.props.getA11yStatusMessage(Object(i.a)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:t},e));n.previousResultCount=o,T(r,n.props.environment.document)}),200);var u=n.props,s=u.defaultHighlightedIndex,l=u.initialHighlightedIndex,a=void 0===l?s:l,d=u.defaultIsOpen,c=u.initialIsOpen,p=void 0===c?d:c,h=u.initialInputValue,m=void 0===h?"":h,v=u.initialSelectedItem,I=void 0===v?null:v,w=n.getState({highlightedIndex:a,isOpen:p,inputValue:m,selectedItem:I});return null!=w.selectedItem&&void 0===n.props.initialInputValue&&(w.inputValue=n.props.itemToString(w.selectedItem)),n.state=w,n}Object(u.a)(t,e);var n=t.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},n.getState=function(e){var t=this;return void 0===e&&(e=this.state),Object.keys(e).reduce((function(n,o){return n[o]=t.isControlledProp(o)?t.props[o]:e[o],n}),{})},n.isControlledProp=function(e){return void 0!==this.props[e]},n.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},n.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},n.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},n.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var o=D(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(o,t)}},n.highlightFirstOrLastIndex=function(e,t,n){var o=this.getItemCount()-1;o<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:o,n))},n.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,d=this.getMenuProps,c=this.getInputProps,p=this.getItemProps,h=this.openMenu,f=this.closeMenu,g=this.toggleMenu,m=this.selectItem,v=this.selectItemAtIndex,I=this.selectHighlightedItem,y=this.setHighlightedIndex,b=this.clearSelection,S=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:h,closeMenu:f,toggleMenu:g,selectItem:m,selectItemAtIndex:v,selectHighlightedItem:I,setHighlightedIndex:y,clearSelection:b,clearItems:S,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}},n.componentDidMount=function(){var e=this;var t=function(t,n){void 0===n&&(n=!0);var o=e.props.environment.document;return[e._rootNode,e._menuNode].some((function(e){return e&&(I(e,t)||n&&I(e,o.activeElement))}))},n=function(){e.isMouseDown=!0},o=function(n){e.isMouseDown=!1,!t(n.target)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},r=function(){e.isTouchMove=!0},u=function(n){var o=t(n.target,!1);e.isTouchMove||o||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},s=this.props.environment;s.addEventListener("mousedown",n),s.addEventListener("mouseup",o),s.addEventListener("touchstart",i),s.addEventListener("touchmove",r),s.addEventListener("touchend",u),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),s.removeEventListener("mousedown",n),s.removeEventListener("mouseup",o),s.removeEventListener("touchstart",i),s.removeEventListener("touchmove",r),s.removeEventListener("touchend",u)}},n.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,o=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==o},n.componentDidUpdate=function(e,t){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var e=x(this.props.children,m);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=x(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:C(t)?Object(a.cloneElement)(t,this.getRootProps(O(t))):void 0:null},t}(a.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:w,itemToString:function(e){return null==e?"":String(e)},onStateChange:m,onInputValueChange:m,onUserAction:m,onChange:m,onSelect:m,onOuterClick:m,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:v},e.stateChangeTypes=A,e}();l.a.array.isRequired,l.a.func,l.a.func,l.a.func,l.a.bool,l.a.number,l.a.number,l.a.number,l.a.bool,l.a.bool,l.a.bool,l.a.any,l.a.any,l.a.any,l.a.string,l.a.string,l.a.string,l.a.func,l.a.string,l.a.func,l.a.func,l.a.func,l.a.func,l.a.func,l.a.shape({addEventListener:l.a.func,removeEventListener:l.a.func,document:l.a.shape({getElementById:l.a.func,activeElement:l.a.any,body:l.a.any})});"undefined"==typeof window||window;t.a=R}}]); }], document.currentScript.dataset.index)