define(['jquery','matchMedia','mage/accordion','domReady!'],function($,mediaCheck){'use strict';mediaCheck({media:'(min-width: 768px)',entry:function(){$(".tcs-store-pickup").prependTo(".header-links-wrapper");$(".search-top-content-container").prependTo(".column.main");$(".product-item .actions-secondary").each(function(){var parent=$(this).closest(".product-item");var imageWrapper=parent.find(".product-item-photo .product-image-wrapper");$(this).prependTo(imageWrapper);});$(".product.data.items").each(function(){var items=$(this);if(items.is(":mage-accordion")){items.accordion("destroy");} items.accordion({openedState:"active",collapsible:false,animate:false});});var search=$('.block-search');if($(search).hasClass('show-mobile')){$(search).removeClass('show-mobile');$(".mobile-search").removeClass('search-on')} let cpapShopDifferenceRow=$(".cpap-shop-difference-row").parent();let cpapQuizRow=$(".cpap-quiz-row").parent();if(cpapShopDifferenceRow.length>0&&cpapQuizRow.length>0){cpapShopDifferenceRow.insertBefore(cpapQuizRow);}},exit:function(){$(".tcs-store-pickup").insertAfter(".header.content .block-search");$(".search-top-content-container").prependTo(".page-main");$(".product-item .actions-secondary").each(function(){var parent=$(this).closest(".product-item");var actionsContainer=parent.find(".product-item-details .product-item-actions");$(this).appendTo(actionsContainer);});$(".product.data.items").each(function(){var items=$(this);if(items.is(":mage-accordion")){items.accordion("destroy");} items.accordion({openedState:"active",collapsible:true,active:false})});$(".mobile-search").unbind("click").click(function(){var search=$('.block-search');if($(search).hasClass('show-mobile')){$(search).removeClass('show-mobile');$(this).removeClass('search-on')}else{$(search).addClass('show-mobile');$(this).addClass('search-on')}});let cpapShopDifferenceRow=$(".cpap-shop-difference-row").parent();let productsShowCaseRow=$(".products-showcase-row").parent();if(cpapShopDifferenceRow.length>0&&productsShowCaseRow.length>0){cpapShopDifferenceRow.insertBefore(productsShowCaseRow);}}});});