Liferay.Loader.define("commerce-frontend-js@4.0.52/components/mini_cart/util/index",["module","exports","require","./constants"],(function(e,a,t){window;Object.defineProperty(a,"__esModule",{value:!0}),a.parseOptions=function(e){let a;try{a=JSON.parse(e)||""}catch(e){a=""}return Array.isArray(a)?a.map((({value:e})=>"".concat(e))).join(", "):a},a.regenerateOrderDetailURL=function(e,a){if(!e||!a)throw new Error('Cannot generate a new Order Detail URL. Invalid "'.concat(a?"orderUUID":"siteDefaultURL",'"'));const t=new URL("".concat(a).concat(r.ORDER_DETAILS_ENDPOINT));return t.searchParams.append("p_p_id",r.DEFAULT_ORDER_DETAILS_PORTLET_ID),t.searchParams.append("p_p_lifecycle","0"),t.searchParams.append("_".concat(r.DEFAULT_ORDER_DETAILS_PORTLET_ID,"_mvcRenderCommandName"),"/commerce_open_order_content/edit_commerce_order"),t.searchParams.append("_".concat(r.DEFAULT_ORDER_DETAILS_PORTLET_ID,"_").concat(r.ORDER_UUID_PARAMETER),e),t.toString()},a.generateProductPageURL=function(e,a,t){const r=themeDisplay.getLanguageId();let n=a[r];if(!n){const e=themeDisplay.getDefaultLanguageId();n=a[e]}return[e,t,n].map((e=>e.replace(/^\//,"").replace(/\/$/,""))).join("/")},a.summaryDataMapper=function({itemsQuantity:e,subtotalDiscountValueFormatted:a,subtotalFormatted:t,totalDiscountValueFormatted:r,totalFormatted:n}){return[{label:Liferay.Language.get("quantity"),value:e},{label:Liferay.Language.get("subtotal"),value:t},{label:Liferay.Language.get("subtotal-discount"),value:a},{label:Liferay.Language.get("order-discount"),value:r},{label:Liferay.Language.get("total"),style:"big",value:n}]},a.hasErrors=function(e){return e.some((({errorMessages:e})=>Boolean(null==e?void 0:e.length)))};var r=t("./constants")}));
//# sourceMappingURL=index.js.map