whoami7 - Manager
:
/
home
/
dataiclx
/
vielorbe.com
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
components
/
Upload File:
files >> //home/dataiclx/vielorbe.com/wp-content/plugins/surecart/dist/components/components/sc-cart.js.map
{"file":"sc-cart.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,SAAS,GAAG,kvBAAkvB,CAAC;AACrwB,qBAAe,SAAS;;MCgBXA,QAAM;;;;;oBAIQ,IAAI;;;;;oBAcG,MAAM;;;mCASC,IAAI;uBAGoB,MAAM;;IAGrE,gBAAgB;;QACdC,KAAO,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,GAAGA,KAAO,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvE,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE;YACtB,IAAI,CAAC,UAAU,EAAE,CAAC;SACnB;aAAM;YACL,MAAC,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,CAAC,cAAc,CAAC,0CAAE,UAAU,0CAAE,aAAa,CAAC,OAAO,CAAiB,0CAAE,KAAK,EAAE,CAAC;SACvG;KACF;IAED,KAAK;QACH,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;KAC5C;IAED,WAAW,CAAC,IAAI;QACd,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;KAChC;;;;;IAMD,WAAW;QACT,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;KAChD;;IAGD,aAAa;;QACX,MAAM,KAAK,GAAG,MAAA,MAAAC,KAAa,CAAC,QAAQ,0CAAE,UAAU,0CAAE,IAAI,CAAC;QACvD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,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AAC,aAAa,GAAG,EAC3B,iEAAU,KAAK,EAAE,EAAE,0BAA0B,EAAE,GAAG,EAAE,EAAE,IAAI,EAAC,QAAQ,GAAY,CAC3E,EACN,8DAAQ,CACC,CACZ,EACA,QAAQ,EAAE,IAAI,+EAAsB,CAAC,GAAgB,CAC5C,CACa,EAC3B;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ScCart","uiStore","checkoutState"],"sources":["src/components/controllers/cart/sc-cart/sc-cart.scss?tag=sc-cart&encapsulation=shadow","src/components/controllers/cart/sc-cart/sc-cart.tsx"],"sourcesContent":[":host {\n --sc-drawer-header-spacing: var(--sc-spacing-large);\n --sc-drawer-body-spacing: var(--sc-spacing-large);\n --sc-drawer-footer-spacing: var(--sc-spacing-large);\n}\n\n.cart {\n font-size: 16px;\n}\n\n.cart__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n font-size: 1em;\n}\n.cart__close {\n opacity: 0.75;\n transition: opacity 0.25s ease;\n cursor: pointer;\n\n &:hover {\n opacity: 1;\n }\n}\n::slotted(*) {\n padding: var(--sc-drawer-header-spacing);\n background: var(--sc-panel-background-color);\n position: relative;\n}\n\n::slotted(sc-line-items) {\n flex: 1 1 auto;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n min-height: 200px;\n}\n::slotted(:last-child) {\n border-bottom: 0 !important;\n}\n\nsc-drawer::part(body) {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding:0;\n overflow: hidden;\n}\n","import { Component, Fragment, h, Listen, Prop, State, Watch, Element } from '@stencil/core';\nimport apiFetch from '../../../../functions/fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { baseUrl } from '../../../../services/session';\nimport { getCheckout, setCheckout, clearCheckout } from '@store/checkouts/mutations';\nimport { state as checkoutState } from '@store/checkout';\nimport uiStore from '@store/ui';\nimport { expand } from '../../../../services/session';\nimport { Checkout } from '../../../../types';\nimport { createErrorNotice } from '@store/notices/mutations';\nimport { updateFormState } from '@store/form/mutations';\nimport { formBusy } from '@store/form/getters';\n@Component({\n tag: 'sc-cart',\n styleUrl: 'sc-cart.scss',\n shadow: true,\n})\nexport class ScCart {\n @Element() el: HTMLScCartElement;\n\n /** Is this open or closed? */\n @State() open: boolean = null;\n\n /** The form id to use for the cart. */\n @Prop({ reflect: true }) formId: string;\n\n /** The header for the popout. */\n @Prop() header: string;\n\n @Prop() checkoutLink: string;\n\n /** The template for the cart to inject when opened. */\n @Prop() cartTemplate: string;\n\n /** Are we in test or live mode. */\n @Prop() mode: 'test' | 'live' = 'live';\n\n /** The checkout url for the button. */\n @Prop() checkoutUrl: string;\n\n /** Should we force show the cart, even if there's a form on the page? */\n @Prop() alwaysShow: boolean;\n\n /** Whether the floating button should be visible */\n @Prop() floatingIconEnabled: boolean = true;\n\n /** The current UI state. */\n @State() uiState: 'loading' | 'busy' | 'navigating' | 'idle' = 'idle';\n\n @Watch('open')\n handleOpenChange() {\n uiStore.set('cart', { ...uiStore.state.cart, ...{ open: this.open } });\n if (this.open === true) {\n this.fetchOrder();\n } else {\n (document?.querySelector('sc-cart-icon')?.shadowRoot?.querySelector('.cart') as HTMLElement)?.focus();\n }\n }\n\n order() {\n return getCheckout(this.formId, this.mode);\n }\n\n setCheckout(data) {\n setCheckout(data, this.formId);\n }\n\n /**\n * Search for the sc-checkout component on a page to make sure\n * we don't show the cart on a checkout page.\n */\n pageHasForm() {\n return !!document.querySelector('sc-checkout');\n }\n\n /** Count the number of items in the cart. */\n getItemsCount() {\n const items = checkoutState.checkout?.line_items?.data;\n let count = 0;\n (items || []).forEach(item => {\n count = count + item?.quantity;\n });\n return count;\n }\n\n @Listen('scSetState')\n handleSetState(e) {\n this.uiState = e.detail;\n }\n\n @Listen('scCloseCart')\n handleCloseCart() {\n this.open = false;\n }\n\n /** Fetch the order */\n async fetchOrder() {\n if (!checkoutState.checkout?.id) {\n return;\n }\n\n try {\n updateFormState('FETCH');\n checkoutState.checkout = (await apiFetch({\n method: 'GET', // create or update\n path: addQueryArgs(`${baseUrl}${checkoutState.checkout?.id}`, {\n expand,\n }),\n })) as Checkout;\n updateFormState('RESOLVE');\n } catch (e) {\n console.error(e);\n updateFormState('REJECT');\n createErrorNotice(e);\n\n if(e?.code === 'checkout.not_found') {\n clearCheckout(this.formId, this.mode);\n }\n }\n }\n\n componentWillLoad() {\n this.open = !!uiStore.state.cart.open;\n uiStore.onChange('cart', cart => {\n this.open = cart.open;\n });\n }\n\n state() {\n return {\n uiState: this.uiState,\n checkoutLink: this.checkoutLink,\n loading: this.uiState === 'loading',\n busy: this.uiState === 'busy',\n navigating: this.uiState === 'navigating',\n empty: !checkoutState.checkout?.line_items?.pagination?.count,\n order: checkoutState.checkout,\n lineItems: checkoutState.checkout?.line_items?.data || [],\n tax_status: checkoutState.checkout?.tax_status,\n customerShippingAddress: typeof checkoutState.checkout?.customer !== 'string' ? checkoutState.checkout?.customer?.shipping_address : {},\n shippingAddress: checkoutState.checkout?.shipping_address,\n taxStatus: checkoutState.checkout?.tax_status,\n formId: this.formId,\n };\n }\n\n render() {\n return (\n <sc-cart-session-provider>\n <sc-drawer\n open={this.open}\n onScAfterShow={() => (this.open = true)}\n onScAfterHide={() => {\n this.open = false;\n }}\n >\n {this.open === true && (\n <Fragment>\n <div class=\"cart__header-suffix\" slot=\"header\">\n <slot name=\"cart-header\" />\n <sc-error style={{ '--sc-alert-border-radius': '0' }} slot=\"header\"></sc-error>\n </div>\n <slot />\n </Fragment>\n )}\n {formBusy() && <sc-block-ui z-index={9}></sc-block-ui>}\n </sc-drawer>\n </sc-cart-session-provider>\n );\n }\n}\n"],"version":3}
Copyright ©2021 || Defacer Indonesia