@g9tm/lynxcontrols-commerce 0.0.0-stage → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # @g9tm/lynxcontrols-commerce
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Selling: money in the culture's digits, a sale price against its compare-at price, a cart as a reducer, and the
4
+ controls a shop page is built from. Opt-in.
5
+
6
+ ```tsx
7
+ import { cartReducer, cartTotals, emptyCart, G9MiniCartBar, G9ProductTile } from '@g9tm/lynxcontrols-commerce';
8
+
9
+ const [cart, dispatch] = useReducer(cartReducer, emptyCart);
10
+ <G9ProductTile title="Latte" price={95000} compareAt={120000} qty={cartQty(cart, 'latte')}
11
+ onQtyChange={(q) => dispatch({ type: 'set', id: 'latte', qty: q })} addText="Add" />
12
+ <G9MiniCartBar count={cartTotals(cart).count} total={cartTotals(cart).subtotal} actionText="View cart" onPress={open} />
13
+ ```
14
+
15
+ | Component | What it is |
16
+ | --- | --- |
17
+ | **`G9ProductTile`** | A product as a tile or a row: photo, badge, title, price with its sale, the quantity control; «sold out» when there is no stock. |
18
+ | **`G9PriceTag`** | The price now, the price it was struck through, and the percent off. |
19
+ | **`G9QuantityControl`** | «Add», then − quantity + within the stock. |
20
+ | **`G9MiniCartBar`** | The cart's count and total in a bar over the page, with its action. |
21
+
22
+ Model (pure, tested): `formatMoney`, `priceParts`, `cartReducer`, `cartTotals`, `cartQty`, `emptyCart`.
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/animation.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@lynx-js/types/types/common/csstype.d.ts","../../../node_modules/@lynx-js/types/types/main-thread/animation.d.ts","../../../node_modules/@lynx-js/types/types/main-thread/element.d.ts","../../../node_modules/@lynx-js/types/types/common/events.d.ts","../../../node_modules/@lynx-js/types/types/common/system-info.d.ts","../../../node_modules/@lynx-js/types/types/common/performance.d.ts","../../../node_modules/@lynx-js/types/types/main-thread/lynx.d.ts","../../../node_modules/@lynx-js/types/types/main-thread/events.d.ts","../../../node_modules/@lynx-js/types/types/main-thread/index.d.ts","../../../node_modules/@lynx-js/types/types/common/lynx.d.ts","../../../node_modules/@lynx-js/types/types/common/global.d.ts","../../../node_modules/@lynx-js/types/types/common/props.d.ts","../../../node_modules/@lynx-js/types/types/common/element/component.d.ts","../../../node_modules/@lynx-js/types/types/common/element/filter-image.d.ts","../../../node_modules/@lynx-js/types/types/common/element/image.d.ts","../../../node_modules/@lynx-js/types/types/common/element/common.d.ts","../../../node_modules/@lynx-js/types/types/common/element/inline-image.d.ts","../../../node_modules/@lynx-js/types/types/common/element/list.d.ts","../../../node_modules/@lynx-js/types/types/common/element/list-item.d.ts","../../../node_modules/@lynx-js/types/types/common/element/page.d.ts","../../../node_modules/@lynx-js/types/types/common/element/scroll-view.d.ts","../../../node_modules/@lynx-js/types/types/common/element/text.d.ts","../../../node_modules/@lynx-js/types/types/common/element/view.d.ts","../../../node_modules/@lynx-js/types/types/common/element/input.d.ts","../../../node_modules/@lynx-js/types/types/common/element/textarea.d.ts","../../../node_modules/@lynx-js/types/types/common/element/title-bar-view.d.ts","../../../node_modules/@lynx-js/types/types/common/element/svg.d.ts","../../../node_modules/@lynx-js/types/types/common/element/refresh.d.ts","../../../node_modules/@lynx-js/types/types/common/element/scroll-coordinator.d.ts","../../../node_modules/@lynx-js/types/types/common/element/viewpager.d.ts","../../../node_modules/@lynx-js/types/types/common/element/blur-view.d.ts","../../../node_modules/@lynx-js/types/types/common/element/webview.d.ts","../../../node_modules/@lynx-js/types/types/common/element/markdown.d.ts","../../../node_modules/@lynx-js/types/types/common/element/video.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/lynx-performance-entry.d.ts","../../../node_modules/@lynx-js/types/types/common/element/frame.d.ts","../../../node_modules/@lynx-js/types/types/common/element/overlay.d.ts","../../../node_modules/@lynx-js/types/types/common/element/element.d.ts","../../../node_modules/@lynx-js/types/types/common/element/methods.d.ts","../../../node_modules/@lynx-js/types/types/common/element/attributes.d.ts","../../../node_modules/@lynx-js/types/types/common/element/index.d.ts","../../../node_modules/@lynx-js/types/types/common/console.d.ts","../../../node_modules/@lynx-js/types/types/common/index.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/event.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/nodes-ref.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/app.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/performance.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/fetch.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/lynx.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/native-modules.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/text-encoder-decoder.d.ts","../../../node_modules/@lynx-js/types/types/background-thread/index.d.ts","../../../node_modules/@lynx-js/types/types/index.d.ts","../../../node_modules/@types/react/jsx-runtime.d.ts","../../../node_modules/@lynx-js/react/runtime/jsx-runtime/index.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/runtime-marker.d.ts","../../../node_modules/preact/src/jsx.d.ts","../../../node_modules/preact/src/dom.d.ts","../../../node_modules/preact/src/index.d.ts","../../../node_modules/preact/hooks/src/index.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/hooks/react.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/snapshot/lynx/runwithforce.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/lynx.d.ts","../../../node_modules/preact/compat/src/suspense.d.ts","../../../node_modules/preact/compat/src/index.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/snapshot/lynx/children.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/snapshot/lynx/element.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/snapshot/lynx/portalspending.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/snapshot/lynx/portals.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/snapshot/lynx/suspense.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/hooks/uselynxglobaleventlistener.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/globalprops.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/initdata.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/lynx-data-processors.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/background-function/run-on-background.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/snapshot/worklet/call/runonmainthread.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/worklet-runtime/api/animation/effect.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/worklet-runtime/api/animation/animation.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/worklet-runtime/api/element.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/worklet-runtime/bindings/types.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/main-thread-ref.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/core/main-thread-object.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/lynx-api.d.ts","../../../node_modules/@lynx-js/react/runtime/lib/index.d.ts","../../../node_modules/@lynx-js/react/types/react.docs.d.ts","../../../node_modules/@lynx-js/react/types/react.d.ts","../../foundation/dist/collections.d.ts","../../foundation/dist/culture/bidi.d.ts","../../foundation/dist/culture/digits.d.ts","../../foundation/dist/culture/culture.d.ts","../../foundation/dist/culture/calendar.d.ts","../../foundation/dist/culture/coordinates.d.ts","../../foundation/dist/culture/date-format.d.ts","../../foundation/dist/culture/duration.d.ts","../../foundation/dist/culture/natural-date.d.ts","../../foundation/dist/culture/numbers.d.ts","../../foundation/dist/culture/strings.d.ts","../../foundation/dist/culture/relative-time.d.ts","../../foundation/dist/culture/text.d.ts","../../foundation/dist/culture/index.d.ts","../../foundation/dist/enums/index.d.ts","../../foundation/dist/errors.d.ts","../../foundation/dist/exec/diagnostics.d.ts","../../foundation/dist/services/abort.d.ts","../../foundation/dist/exec/options.d.ts","../../foundation/dist/services/clock.d.ts","../../foundation/dist/exec/trace.d.ts","../../foundation/dist/exec/safe-executor.d.ts","../../foundation/dist/exec/index.d.ts","../../foundation/dist/icons/generated/glyph-svg.d.ts","../../foundation/dist/icons/glyph.d.ts","../../foundation/dist/icons/icon.d.ts","../../foundation/dist/icons/glyph-slots.d.ts","../../foundation/dist/icons/icon-fonts.d.ts","../../foundation/dist/icons/packs.d.ts","../../foundation/dist/icons/svg.d.ts","../../foundation/dist/icons/index.d.ts","../../foundation/dist/layout/index.d.ts","../../foundation/dist/route/address.d.ts","../../foundation/dist/route/catalogue.d.ts","../../foundation/dist/route/journey.d.ts","../../foundation/dist/route/sink.d.ts","../../foundation/dist/route/resolve.d.ts","../../foundation/dist/route/view.d.ts","../../foundation/dist/route/index.d.ts","../../foundation/dist/services/feedback.d.ts","../../foundation/dist/services/preferences.d.ts","../../foundation/dist/services/contracts.d.ts","../../foundation/dist/services/keys.d.ts","../../foundation/dist/services/motion.d.ts","../../foundation/dist/services/index.d.ts","../../foundation/dist/tokens/generated/palettes.d.ts","../../foundation/dist/theme/aliases.d.ts","../../foundation/dist/tokens/shape.d.ts","../../foundation/dist/theme/color.d.ts","../../foundation/dist/theme/theme.d.ts","../../foundation/dist/theme/brand.d.ts","../../foundation/dist/theme/appearance.d.ts","../../foundation/dist/theme/contrast.d.ts","../../foundation/dist/theme/control-colors.d.ts","../../foundation/dist/theme/css-color.d.ts","../../foundation/dist/theme/design.d.ts","../../foundation/dist/theme/oklch.d.ts","../../foundation/dist/theme/recipe.d.ts","../../foundation/dist/tokens/generated/metrics.d.ts","../../foundation/dist/tokens/layout-metrics.d.ts","../../foundation/dist/tokens/css-vars.d.ts","../../foundation/dist/tokens/derived.d.ts","../../foundation/dist/theme/variants.d.ts","../../foundation/dist/theme/index.d.ts","../../foundation/dist/tokens/index.d.ts","../../foundation/dist/index.d.ts","../../controls/dist/anchor/registry.d.ts","../../controls/dist/anchor/hooks.d.ts","../../controls/dist/base/control.d.ts","../../controls/dist/base/corner-badge.d.ts","../../controls/dist/base/disposer.d.ts","../../controls/dist/base/press.d.ts","../../controls/dist/base/pressable.d.ts","../../controls/dist/display/shimmer.d.ts","../../controls/dist/sheet/options.d.ts","../../controls/dist/guide/settings.d.ts","../../controls/dist/popup/types.d.ts","../../controls/dist/provider/settings.d.ts","../../controls/dist/icon/icon.d.ts","../../controls/dist/base/selection-item.d.ts","../../controls/dist/base/timers.d.ts","../../controls/dist/base/tone.d.ts","../../controls/dist/base/use-controllable-state.d.ts","../../controls/dist/base/use-stable-callback.d.ts","../../controls/dist/base/index.d.ts","../../controls/dist/button/visuals.d.ts","../../controls/dist/button/button.d.ts","../../controls/dist/button/header-action-button.d.ts","../../controls/dist/button/icon-button.d.ts","../../controls/dist/button/nav-card.d.ts","../../controls/dist/button/safe.d.ts","../../controls/dist/button/safe-tap.d.ts","../../controls/dist/button/vertical-icon-text-button.d.ts","../../controls/dist/button/index.d.ts","../../controls/dist/display/activity-indicator.d.ts","../../controls/dist/display/culture-date-time-label.d.ts","../../controls/dist/display/extras.d.ts","../../controls/dist/display/figures.d.ts","../../controls/dist/display/status.d.ts","../../controls/dist/display/figures-index.d.ts","../../controls/dist/display/image.d.ts","../../controls/dist/display/keycap.d.ts","../../controls/dist/display/motion-figures.d.ts","../../controls/dist/display/progress-bar.d.ts","../../controls/dist/display/separator.d.ts","../../controls/dist/display/theme-preview.d.ts","../../controls/dist/display/title-with-line.d.ts","../../controls/dist/display/index.d.ts","../../controls/dist/provider/contexts.d.ts","../../controls/dist/provider/activity.d.ts","../../controls/dist/provider/hooks.d.ts","../../controls/dist/provider/keep-alive.d.ts","../../controls/dist/provider/provider.d.ts","../../controls/dist/provider/index.d.ts","../../controls/dist/toggle/checkbox.d.ts","../../controls/dist/toggle/checkbox-math.d.ts","../../controls/dist/toggle/chip-group.d.ts","../../controls/dist/toggle/choice.d.ts","../../controls/dist/toggle/switch.d.ts","../../controls/dist/toggle/index.d.ts","../src/model.ts","../src/commerce.tsx","../src/index.ts"],"fileIdsList":[[41,96,97,129],[102,103,108,114],[41,103],[41,102,103,108,114],[41,123],[99,102,104,106,108,109,110,112,113,126],[41,114,115,116,117,118,119,124,125],[104,105],[102,108],[41,96,129],[41,96,102,111,129],[102],[120],[122],[121],[41,96,98,128,129],[41,104,126,127],[42,86,87,88],[53],[42,78,87,88,89,90,92,93,94],[42,86,87,88,90,91],[86,88],[42,86],[49,78],[43],[44],[51,55],[47],[41,51,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,79,80],[47,51,55,78],[47,51,55],[56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,79,80,81,82,83],[58,59],[47,51,55,59],[47,61,64],[46],[48,52,53,95],[44,47,48,49,51,53,54,55,84,85],[44,47],[52,86,95],[45,86],[46,47,55],[45,46,50,51],[49,86],[38,39,40],[41],[100,102,103,107],[100,101],[98,129,195,214,223,237,243,249,250],[98,250,251],[98,195],[96,129,196],[96,129,195],[96,129,196,197],[129],[198,199,200,201,202,209,210,211,212,213],[129,198,201],[195,208],[129,195,198,208,215],[129,195,198,208],[215,216,217,218,219,220,221,222],[195],[41,195,216,218],[129,195,198],[129,198,208,211],[227,228],[41,129,198,208,211],[129,198,208],[203,224,225,226,229,230,231,232,233,234,235,236],[129,198],[129,195],[195,204],[41,129,195,207],[129,195,208],[129,238],[41,195,196,207],[195,207,238],[207,238,239,240,241,242],[129,195,207],[129,195,204,205,206],[129,195,203,208],[41,195,198],[129,195,198,209],[41,129,195,198,208,211],[244,245,246,247,248],[41,129,198],[133],[132],[132,133,134],[131,132,133,134,135,136,137,138,139,140,141,142],[134],[140],[146,148,150,151],[147],[140,146,147,148,149,150],[146,149],[155],[154],[153,154,155,156,157,158,159],[130,143,144,145,152,160,161,168,174,193,194],[145],[145,162],[162,163,164,165,166,167],[163],[162,163,165],[162],[145,147,149,165,169,170],[147,149,169,170,171,172,173],[175],[175,177,179,180],[175,178,179],[178,179],[178],[177,179],[176,178,179,180,181,182,183,184,185,186,187,192],[175,178],[144,175,178,191],[175,188,189],[175,190],[175,177,188,189,190,191]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6fdd3074ba01fc8aff89a11055a33516aff7a42a3599fc0e7dce64047a5e3fd","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"035312d4945d13efa134ae482f6dc56a1a9346f7ac3be7ccbad5741058ce87f3","affectsGlobalScope":true,"impliedFormat":1},{"version":"07b03f752ae52a7130e06c5a8399d3a0dde07a1a634f8430b80cd6236c56b5c8","impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"acbac4ca6cd4b2b459debc4a274535775cb6278a8315be383fafa623ab78f18e","impliedFormat":1},{"version":"e421d0b097c78304a2597c1f33da586630e1dc665ae381c0c36e5ebc4aaf4566","impliedFormat":1},{"version":"adf624c89a0d509a789f3c0bf522969d2c47033dbeb50920b37cd89be475a65e","impliedFormat":1},{"version":"f4664d05efc95a0fb8ee228d391e5271a1c8fc9bc3452c7bd760f9ca18b5a837","impliedFormat":1},{"version":"b32b532dcbe0a91d71fd94cb780e94bdfdce10be21608d914c29fb4b8939b24a","impliedFormat":1},{"version":"eb2b64881998b562a4fe9330e55aa2466cd3a41a1a57e93feac6555218cec06f","impliedFormat":1},{"version":"6db1694d205177322d792d924335b046b80607445a45c0d2de1fcffd190b48c0","impliedFormat":1},{"version":"d5465281e0aaffe267f46382c5f014740dc16e7fd8e1c57a0b0ddf8a2eab9be4","impliedFormat":1},{"version":"f7e5c3960dd9df65d83408b9be446f7119fa1db1dd8266dd343349d90c3bf2ce","impliedFormat":1},{"version":"09c6491ed74af89a4155feafedecaf77780f5751c66d4b65b18d30fc0e053a75","impliedFormat":1},{"version":"188b01044640e5ef65f6edf0dd6e6454f02dd19f4ead66b9e03ebe26cc7298ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d34d6de13412a24e8d9252040d972edce68b4db8d8a64a3f7fd63ca1fda3a67f","impliedFormat":1},{"version":"5bf51107315834a209b08395b141e262b7d143d14f6b4e4d403d8e020cef7e32","impliedFormat":1},{"version":"db0dcbe48d5cb38315083b412c8ab6995b0d42dc73b286833e296827feb0e5b4","impliedFormat":1},{"version":"b3e4a49a3ba19463662e7b821544948b953d2f6708370d42406bda558084000c","impliedFormat":1},{"version":"7c5e49b3d96da389b07d4ae3705c9f33a03dadcd04e6c0e76edece6d636f4ce7","impliedFormat":1},{"version":"24e9add3c802e7c9431b2c99edbbda02c1899901fd955dfb2e9ee3e9cdc93c4c","impliedFormat":1},{"version":"cd6611fd8cd9d40de1bdec02a3c5027c968c4aaf7639ee88ee48b2c41edeaddc","impliedFormat":1},{"version":"32d1e153cac16ca3a3f5f6b68fae76cddcda509950fa00d038c465776359db0c","impliedFormat":1},{"version":"0d85d0fa55dd433acf924675d7e976c025c8521c91a76079844cd15e52855ccf","impliedFormat":1},{"version":"89da6ea3ee9735e712691227b0e5ee74381779f9ad8b0f4fb7ced0247b16735a","impliedFormat":1},{"version":"77fbe475cb649a3598aa8f932ab5f6fe011444d94b52d329078c1f6d63c5d3bd","impliedFormat":1},{"version":"7618f7fdf0abf7f712cefe766ac1ab7fcd1f8e753c513e57d3ada9ada3a57257","impliedFormat":1},{"version":"db0441149b37984c225e945a112713d07616b34552d64f814c5cbf8e8c95f165","impliedFormat":1},{"version":"51f5a8fa3de5f13b21ba2604b4de8f0aae3d97acadab981d536a282ea26257af","impliedFormat":1},{"version":"0e323630cbfda771430e2720f6a2f02f257becd8fb9722aa975ae773fb572210","impliedFormat":1},{"version":"56dbc770513baae28f7cfbadeba5078bb13a37a13132a5292e98a8b103312b98","impliedFormat":1},{"version":"84ff906032fe12e816bfb7441cee6726243e5a7316c4f2d6b0a6c149f1a91a16","impliedFormat":1},{"version":"446e9432c63958893f65b4f7eea86fb5b506c2e0e7dd971a1f75e361b333a3db","impliedFormat":1},{"version":"dcbbe1fb0f2c0efc12e29db8bbccb5b82513384d01d7a55342065cb0611da272","impliedFormat":1},{"version":"af209189a194cf5ad1f7b22dd680b52843fec2e30f1283be20b2977872fd4424","impliedFormat":1},{"version":"18e37ffc10db360e66b0af639e55bcc66496830994734f64a97c6751458f7f3a","impliedFormat":1},{"version":"14137199a98201c616a7ee925bfaa9809b659dfbec733f86fa5dc5348a897de6","impliedFormat":1},{"version":"f64cd565aca17df45f4666473da75e4ce51a2610e2ed1c31198e9f9325747a24","impliedFormat":1},{"version":"e415a17ab6a413d6be640457231e045541405eab1f0f370c7dd1e5567aa25999","impliedFormat":1},{"version":"8c03a41d6dc701b6648db83d71a92dc27147d7677ab5d70f32675e7e37b3795a","impliedFormat":1},{"version":"e27b62f2410bb10697800d1c09ae2c48db46cd1eca18ffdd35022b1802bfd6d5","impliedFormat":1},{"version":"2ec0bfa713f313f8b2dc2bf64c5962433722ea7b413f69428106a65584656dc9","impliedFormat":1},{"version":"b2d74af681f440a07e714ae9a33e3ea49c79870b9674058114c0404d2aa2f190","impliedFormat":1},{"version":"24f31e43eb3505e5d2946315e7b8ee8b426dfbe92c3031e435a4eb2d9dd8d69f","affectsGlobalScope":true,"impliedFormat":1},{"version":"5b6a59d1e98f908badf07f243deb42ebd926b4e3d33ec00a5f50cbb8d0464488","impliedFormat":1},{"version":"c669ee7ba01fa6a60b17c3535f96b65fa82dfd2a475a8760364f2f3952f9bcbd","impliedFormat":1},{"version":"a8b121f6a75d603075e62793ff0c109112e882dd6ca2b70bdccbd8d8f753429b","impliedFormat":1},{"version":"f378d7ed5e3ecbe382ade55127a9c98e826c76f786e06effad6fde91a7023d55","impliedFormat":1},{"version":"4e3e9539df72b3bfcc56fa13140070020dac72f1eff39237b11253482cb99847","impliedFormat":1},{"version":"5a47b3a2bbe2c9b015fe356462afe0abe391c592fffbe277126e2415e0811967","impliedFormat":1},{"version":"b1248e5931d2a49c697203e69449c58dacd3d19f12d76bf11d816600a0cf423b","impliedFormat":1},{"version":"0b02aebd8c41453aefd3b1f33b9b9862a57770f8b21e916ecc5b35c0bedcc52b","impliedFormat":1},{"version":"e52840670587e82e129c9bfc6a2f42d9c2f2e1fd6ce176fea998383a8c941ea5","impliedFormat":1},{"version":"31ca1ee726f5d7c7709913b98be76fc40fdfaaca6ad7fafc222108981e11227c","impliedFormat":1},{"version":"556db73da59f5162cdf5c7ea1bc3b063b6ccb758078ef6517ad6f6e4ae7b199a","impliedFormat":1},{"version":"0a2c8ef08611f5a5f711c7b10ba70d10dc1c6af0c9dba8168cbbf34911b74188","impliedFormat":1},{"version":"1d6ef45145a9939a43062fe18188d4f7bdfdf4547978e1f6b7c9089fe53e81e5","impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"509a86836776d5c821901abc16a2d21de674d2c8943ceb8d018049bf324bc56c","impliedFormat":99},{"version":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":99},{"version":"8a2ef120c4da7aab664148ed8d283aa0b98df4d5f15c570d830c8998ef05718b","impliedFormat":1},{"version":"4433d18f82991634feae5150a68f9b30f5b05b55416af8ff9f7251fb29431ed5","impliedFormat":1},{"version":"cc5d0b221824b7d8597e8a2bbdad2383af877eb564eaca392992049839e88c9e","impliedFormat":1},{"version":"21898d939444825cee1232af435330610b09171bea22a2f892cf2058d764b63d","impliedFormat":1},{"version":"2baebea93983e898000858daeeeb2ac29938891b6b8db72ebce294837fc9499f","impliedFormat":99},{"version":"d9d320cf31f6d63659484f6c9ca4db4ae673daefa65118dd8589838925ff1397","impliedFormat":99},{"version":"027cf2216d065a97bf5a8ea126b3ea2734fab6cfe32adaff81ab4e94a1b51bbe","impliedFormat":99},{"version":"f6e6313fad233c5141220f7d25eae120cdd6e5079fbe0aba56821a1e99d05df8","impliedFormat":1},{"version":"9534c35b4577c193e499178deb47419fdadddd5e53af5ec8cb88218848013f65","impliedFormat":1},{"version":"97f43a6558157a3abae4e32256cc74ba34f69ab30473008ffa13011bf0932986","impliedFormat":99},{"version":"45b8adde5735e97329752dd5598b7ecd85202f221a1d0e8aa90137ce5810f21c","impliedFormat":99},{"version":"dfe6945467765f8e7843442a9dfbcf6b5526b6465b07b4c75a54a750329b5f17","impliedFormat":99},{"version":"7f9f6c9fe0e48c401d855d849e28112ffe2425569eca01b08b8c6112b8200695","impliedFormat":99},{"version":"68fcdc663627d12d336b420b19b3e54258844d0cbca0879f711c22aafd853352","impliedFormat":99},{"version":"d3dd47deefa1cc5dd6f1b866132506ec8dfd678ae0ddaa44de188505df14fcc4","impliedFormat":99},{"version":"a5946bc88dac85da2afacdfa3471ff3bc2bbda7c0e34efde184cf17e6bceb6bc","impliedFormat":99},{"version":"75b68165b9bcc07579562f182d327e83583b89b91d62e76b86f4001feee699ba","impliedFormat":99},{"version":"a9d1030f6773d29b383f49e2c647a7e6e464906e1de97a6bc33d2528d957c4d7","impliedFormat":99},{"version":"37b997d60987b68ce8117da783442b4602c8a85d47680823d469fdc90d29e3b8","impliedFormat":99},{"version":"600850ecc310012e3b1a562629d97a1d78662ae8c477357513dd2e6aa704079b","impliedFormat":99},{"version":"335226d599a9382c9bea07d37e23bf998c1022c0f67e4d6d2b69633de6ac118f","impliedFormat":99},{"version":"ae430fd9bac320e71c3fe9299d90dcf67555d9a4f97ecaa35947b430ba8648ea","impliedFormat":99},{"version":"9061ff14146280f47d740b344ddd641c16df526ecaa868c348852277a9fb8686","impliedFormat":99},{"version":"49ee4555c2fafa01119cccc62436baad88ed937ff55d6a655e764ada6b0721e3","impliedFormat":99},{"version":"e059fb9064bc023bc06945ddda6b00e711c18e8657c82514b51c1c1b828642e9","impliedFormat":99},{"version":"f01b3b376946defc432893dcbbbc79472076b6a55a316b0a461a1b38d09e961c","impliedFormat":99},{"version":"da74d8af20172cfee988a2daf92c560f3fdc816fb9c0537f2cc37ef27b1552a8","impliedFormat":99},{"version":"feed66ae8815d1981ad575482766fb9a82385e75cce35ae2f13be58e50c4349f","impliedFormat":99},{"version":"21305b3c41b1e29c0f0d8f43fe227bca82493f6e4c6407a3363c6f729f1c04ba","affectsGlobalScope":true,"impliedFormat":99},{"version":"20c1041fbd4f1537686af4b707872b87c90a22201f8979e5def4554d28b46a5b","impliedFormat":99},"d533d1fe3018752aa47ee74ae5dbdca34377441b891176ad99bd33366a64372f","577287aa28cdd2976297531706a5baea4ba5171512f500731d3feba37057d851","44b82e4f46178400732ea809a906f7ffb9dd38efab331ca23e7ca4586bf903ef","d3dcff003bac57338c3e60be409d0ff167ec1ff513539a5534c7679332dbc992","16d64c89cec74fa23e8cee7c72acc7549f117dcf7845051870c40366c7522d09","706c787ed201e67534e550d765eecfb18a8c39f46e04fcec600d0bb9d1bb6231","11f9f682c02d51de68eed569f8de1e91c56df296a78f3a6c520b93d52aac2308","28b43630d8d29a300e1e5b0f5efb04c8f994d372fff1b653ce8bb70d4e011e1a","08521f5befe6ec3f1c3a881651321f875ca6fc79db15a6130283d409f5d47d1b","b06c48902c3d127098839c1a6500f41d3e21b2f07f277ba7de23ec730df7275d","946d8fa2088c22a4cbc85875ec7c700c93cf53d7b52057fe4e6730fd613c7925","a7a0e658ca429cfb5268d4bf2e2e6e9fe871ffd06b6588d65424ba4eba35338f","2dbadaab8fa70d9d874b29e23e808b0978fd2dbaf34e3caf8303508e2b88c603","54b8f865e3bea736798e54bc95b49435f472599aea762bd17bb02a18b198c7d1","5e621ae454f5ff6bfea91a558b93eb3dee64eac6f66ad8d6739a4a7c396a42f7","ccd708c3fff99b4ec315e14315dce6b9e85f4c96d10131e9fd219edb6efbdb26","abc924fce33b86b9f8588de3a5be04c609fafa6cb1dc42629b3e9e3e18f7d018","f919e3a8b2d274b631ee4fee0c50eba1d3f39ceaccba04dff915e9f61e9f153c","3ae17ae844491c7326d070c3e70a94a9239394e7a1e84eb203eb1d57470e752e","d1b2970d348eb9f89ef0f0c6730d27e9331067a28f21c8bd667ba1138d5d3e93","b2c4833e6308888c3947953770b3343deaf4276c803bb36148991a3fb90b4f6a","41b7c8204ea79a93e380a228f5c744e9c9a80183133ac62633a4c76e3fdbd7db","d0a441df587b0632c16a813117f110574d903ddd0bc4d28599cc82ff8af7c094","b24ac81f4fcff56ed9827736abcf2f92ea5f86e16d66eb2ee3ccfa0bb8143bc9","068309ff581d08c276c4a772ddf3ab9c8090e591fc9917fdc6cdffc12c95a5bf","5c1d368a451520260ebb6c06121201f18abf86d80540290df6e424d372c5d0ed","bb3ccaacf5c19a7170939b7f735c6a94537fd95ad16b4247a6ad572b23183e74","2c8b86d9d29c4ea62762c3815ffe4fdb0c5dbc0dd096b9703236010f4a17c255","7ec540fd5fb0761576c417b27ea61ec08123412487b020942c893510dce970db","f858a10d167e011155bfe5a3532f599e677bced6727c07366f380c02010650d4","465f5d53f09ac1978002bc264b8a4c0aea749c79dd2bd1917dffe57fddcb9543","cf4ef9c41637cb6995fee096890a0e6113141bcce82cc7d5754c281f03ad889e","40f34f36aba872decb7540030db33dc84f1a53d4778fd8c8ad840d68f2023f3a","10347593c1b262343845f577673e5956217a8a571c859d83e2de50a54729541f","e0a192de84052b553230c5f649307dfb49df6dce54fdc538de15078d895f5f66","228e7d711e429183ddf7fc8c331d00540557ade296fb8132d5bfc48d5c933f89","e8906c76ded4f87db27adfe3e8f9e1a729be51a6a0c2c458f31662c6278b1925","49bca6d49d9c5a525146bba60a48e448e1eabe79be789a7b5238ac10a2f620b3","08fe86bcae8e02f769d215958438d6858dc19aeed2a61c7d7327f052b0db25fc","cd3a9799c8e0996b4d31d5235a8ae105b79a7fa31ba8f660ca35b043048ef757","ee4e73f46ce2f6517e82434bd9fc63c8b6b2179d37d74525899f124a76d06669","773c827d0235c76288ab0092202c357730c5b21314241831b7dd88ef6017818e","ced97526e899f0222df6d805e008cd5bc63fee326838a9002919453f9a2a8c9b","216aa3f63d62f13b158445ff6a3bea8ccfd110f2bf219d607175518c9cc5b29d","be77edbe4d276441584b1c7b297bd8596c78913c22c590dc136d987b82a3976c","faa64d270fa523f80fd31bc7340ee7f6a21632c2ea0cea6535bf5a34bcc6adf7","931d70c96033881193232b90c39210c6cd14865f28b339843c56b5688e7fd10d","0a995ec8876b2bdf48ad2a95dbd7c38d37d2b77940cd39d6f68947e1c383d940","29e6e980f179ac2981d68954462dfd4a4545f73c021f6a4c8a5f442c0e16e56c","67fe56b931e013e9980dec2a605908d44484c7bbd81d2ee9912872c11bc76515","d4924e2b191fee9b43aaeef651c87a7084281d425a30a9a8cf50de8f92b64f6d","8fc678b640b298b07d4f52a5a4f0b3a57e07e45da7a0ad25f1ffde53a152d3be","a59554ba3751ea9ad27f6948f1c71ef57f1e28bb526a53eacb0dfa76bc1df452","ea5a5d5873c239b97d846fb8c78437e08ffd731924764f746c0ebcb7731d7648","da401323d4c96e3f5b8fa8b7ecd200d47a9e340b09cefbea553d2b2b5a345e60","ead4a7fd25e5e2b756a5e71546bd8eae855c7b0ecbffd891f7fb0b6f7d80c0c1","eaea9f8e5b90d87160a885c2afc4afcd2434e149ae5a5368d4b61eed66a6a597","cc44cf86b3ddb7d61f7de3fd32116089decb662a8b6421013bd4a8ee9a079881","ab7ed47f18899e74299db14911a028a0aaf1acae17f870a64ead7d91953d40b3","298f8d2584216932ea238927177ef343d0b8da735eb40a5ba96b1f92e3675e33","c8082c78975419ed5a9f7daa655643425cdd98fee91bb82fd92d25f908c78465","24a588d942a36d853d18dfe63711e9b180ea0448b956dadce7833f4d6455f0c8","c263cc53a55cc822c360481e94d0fe999acebf92f01f2ca84225a168a182657f","11aba4fbd2d4539d8440169f219974378731ad1e65d4656bd9d8a579b79241e6","b2792748a96701780faae92a11922b38e9e37d54b31df3df70acd32fd586c508","56cac1d8d4be53381e236d675f43c1b2342161ca45d31dfaaf340b0612d14bc5","121adbf7463954a594a796c4914376017a201d6c7bb40cb33b6b6e2f7f3c1bb8","1dd2073db39016abc797e46c711630cd39c497c28063e3a75993940c72eb9792","ad4f365726b33c965a6cf7e20ee8a7984866e08632a6c37b13bbe4d08c6e0a03","1492a06643311a66d01dc0c15259c0dbe7c4d336e7a85cb7ece67085afd2e84f","47ace7a5fa09cb19907ed7cb83a867b05ecff3e10bb229888e24f82b2c03b869","65f72380cb90b44b22370dfb07890bdd557d2e211ffb023363d8c87621c2535a","42278f72f154d26b400dcce641e8ed2227fb0102bff628f831bae44018ec4313","c1e64c51dadfcea7b7995040c64b5ac7e8f954f2a4adf4eb92e7a462ba5275e8","0cf0840523da6e63c4d0d096f3a1220da866a39314acc8d624551d4580d5567e","15e170fc85990c9cbdc7d3799b9490183b2d15202f1ccd0794abe5afb6f351eb","2f166c686866f475aee63ff5f7cf42413169d34e60c03fc5c761b2281ea49df0","40eef65c285d2b03f5c07d8455c675ecac1b90330cffd6d97f7008811ff8dd22","4f257d6caa2adab87c7532a456be55604cbd3861d81f38458812eedd84555e04","a270eff1cca84fc69223b8f4ce8db3cb4b4abf0dad0d054f7b3bcfb99ba9a343","665236eec0c0da8d3f7cdba8f01f98233425d8c065058e513b33385e417a56d2","1e771191631caaa4b5d3429c51e23c23c2f609ea1e99f4183e913c5e7fd2311b","50e8918146f4e8a9240bf867a07cf8aa0deb21fee8d4507e74ff62c8c6af42e9","666640b08e3ce76b6a8c76ce1f9f5b986923d3c76663b7fa4bc36e3af734ec46","6454e0780201a5e155d56f4fd4609a3a626d49e2c0300a2a74bf3f65e8c7fb92","ae6bf3e7fb36353315f1556fd23d00750f6a21bbc326ff00c1f1ae641375b138","46af33d573233017f5cc8af7081b8cae11b09112d1dd8ba84ae8fb52bdff3fa7","4715928125944c4c5f19d73e14b6104e192b7de6f8d1d2d16ccb5c5412716d8d","1c1fcc68382a99b15b35e193b89da169b9c3861ec4630765f62ed6ac9b9754ea","7ffdf2881f33b7f3600540883081ba83b9e50e0ce9a36417393ae3d8137d027a","09a66153ea0f485d886a8cb3fa99c6d4854d12780acde17d8798039949d5b468","12b36faab2cca51d73cf516f5b1d623d1b9aa65199112b6678db5af1c2c3c8f5","a4372188a04177bcacc9675a498e5b7db0cf1780db7a7bc54fc342e19fb31d91","bcc85da2796bd50bfcd5242d6ad8550774fcddaa0488ba1955fb9a763eda7457","cd64b34e8875a6ac5d727f237344998d529ad7a4bef401908de1587cc8c8c7ca","8aef56fa48c05b90e1342fac86649d390de81b985cc9c40c5a1024b331626344","dbf424b021c39ec2867559d8010c59cfeba8b586c8666e8bcd63d9171f62a221","54108c19c2abcb26345f6fbb94d34162ef931a08d33b7259f0487341907193fa","b6d6f48520aff9185bd814b54510f115e12bb5e15e408e38689763710e900932","91a7d42ac6f43a995eeb6cef2254610c441b759614a70432ab94953e29491365","d90a223fd9170c6d2ac39d2efb9a25416e6d1d9bac6e70a6f820b626eb1db0b6","69bf87b45bd3695dccff62d2139c5d7cec3c721e510538765f91dfe280ddd249","98c3b0d21cdc03ad12fdb52e0f8a8b00b3b11ad576663c98eda96da9f8df3c7d","7a82c7b4bfaea3d44e2241353697693daed6881743cec95d1814c23fbfb993bd","61bb1099994be652580d1ac07986a6aa7bf04643fe20ea3fd15148b0ef0f9c4c","3e4b9537242c4a29d439f4026e404cbae0cb957310f6bce728ee15b72cad1477","0f734c3a2e7c958fa9f82068c541ba3a3fd119dcfb242bbf761b49e91098ce7b","c747eeae3f3246152f6eadd5c1d41d283d522287c437acfb9ed75fae69996a47","1298eb4957af19f5d5c283d38f872953085ee4464decb1cfef669411af42c9be","bba3388b8d3c079e0f4dde365643b0a1108ecc91d4d66aca2ebbfc5beffc649e","dc3b234cbc8f5e9d6c7bdcdbef9ef0a0b83a867075751f04471c5ae9fb4e8167","b822c4e98f5d014a3e64e6c4f50cf2d09491e7eb21621114a62ee5eb9e3ec44b","039290b509ce3199d69cff5591430f2e218da1d80ddaff23c58fd193a23c7c89","2ea0ad0652a48d8f881bddef97866b2f6df74e8b628bcf22bc8cb2c8ebf46fa2","ddd478067db3e594afc28f3824c3ee74dc124dd22c9f6fc94b4f145c490fed30","18118332cf60dfe061ef415b4bdf7189ed18d66ef897e4e4fcbe7024beb0e5b5","4b55851f1b1b241b458042c96a7f700e9065598241f25b0c8d7836b6ce4e3112","c62cb0764f2ed89876d81a79343776c1c10e2e4dc8d4235f6ed0a9873c1891ed","ea50f63a80ae70cb585b62cd5e80e43a9a90c5ae75a16cae6da357d4033e4aa1","80d84fe00782eba2fefee733d00053091eb995a331cdb6d93a642860603ca3f2",{"version":"ccfde74aa5ebf56396394ee11b5cb3d621405441e68a4dbc4805ed6488961e1d","signature":"97a275ee4f31a5b594cc103b6dcbc55d59f84d55f5a08cfbb46339a89aad5e24"},{"version":"f81181de4d33d7a895ac56f754cdb9701394bb6f1c9454292e672564494e65a0","signature":"baca7cf792af68e7bda77f7d95415d89299e59b8241deda18216bb006c26469b"},{"version":"0d5cc3662ade2ac090e65bd6bb1ba7348101aba8cc4199935051b27a9401de02","signature":"820a7cf504dbe11bc3757b06640e1fcdbe629637a4cc4b5d2d5081aed7ec2231"}],"root":[[250,252]],"options":{"composite":true,"declaration":true,"declarationDir":"./","declarationMap":true,"emitDeclarationOnly":true,"exactOptionalPropertyTypes":true,"jsx":4,"jsxImportSource":"@lynx-js/react","module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":6,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true},"referencedMap":[[98,1],[115,2],[104,3],[116,4],[124,5],[127,6],[126,7],[106,8],[109,9],[110,10],[112,11],[113,12],[121,13],[120,14],[122,15],[123,14],[129,16],[128,17],[89,18],[91,19],[95,20],[92,21],[93,22],[88,23],[90,24],[44,25],[83,26],[74,27],[59,28],[56,27],[81,29],[57,27],[79,30],[58,31],[84,32],[60,33],[67,31],[62,27],[61,34],[76,31],[82,35],[80,31],[63,27],[71,31],[72,31],[64,34],[70,31],[65,34],[68,31],[69,27],[77,31],[66,27],[73,31],[75,31],[47,36],[54,37],[86,38],[55,39],[96,40],[45,36],[46,41],[51,42],[52,43],[50,44],[41,45],[97,46],[108,47],[107,12],[103,12],[101,12],[102,48],[100,12],[251,49],[252,50],[250,51],[197,52],[196,53],[198,54],[199,55],[214,56],[202,57],[209,58],[216,59],[217,60],[218,60],[223,61],[219,60],[221,62],[220,63],[222,64],[215,62],[224,55],[225,64],[226,65],[229,66],[227,67],[230,68],[237,69],[231,70],[232,67],[233,64],[234,60],[203,55],[228,65],[235,71],[236,70],[205,72],[208,73],[206,74],[239,75],[238,76],[240,77],[243,78],[241,55],[242,79],[207,80],[204,81],[244,82],[246,83],[247,84],[249,85],[248,86],[134,87],[135,88],[133,88],[136,89],[143,90],[138,91],[139,88],[141,92],[140,87],[142,88],[152,93],[148,94],[151,95],[150,96],[156,97],[157,97],[155,98],[160,99],[159,98],[195,100],[162,101],[163,102],[168,103],[164,104],[166,105],[165,106],[171,107],[174,108],[176,109],[181,110],[180,111],[178,101],[182,109],[183,112],[184,113],[185,114],[193,115],[186,113],[187,110],[179,116],[192,117],[190,118],[191,119],[194,120]],"latestChangedDtsFile":"./index.d.ts","version":"5.9.3"}
@@ -0,0 +1,185 @@
1
+ .g9-price {
2
+ flex-wrap: wrap;
3
+ align-items: center;
4
+ column-gap: 6px;
5
+ display: flex;
6
+ }
7
+
8
+ .g9-price__now {
9
+ color: var(--g9-text-primary);
10
+ font-weight: 800;
11
+ }
12
+
13
+ .g9-price__now--sm {
14
+ font-size: 13px;
15
+ }
16
+
17
+ .g9-price__now--md {
18
+ font-size: 15px;
19
+ }
20
+
21
+ .g9-price__now--lg {
22
+ font-size: 20px;
23
+ }
24
+
25
+ .g9-price__now--sale {
26
+ color: var(--g9-error);
27
+ }
28
+
29
+ .g9-price__was {
30
+ color: var(--g9-text-tertiary);
31
+ font-size: 12px;
32
+ text-decoration: line-through;
33
+ }
34
+
35
+ .g9-price__off {
36
+ background-color: var(--g9-error-container);
37
+ border-radius: 8px;
38
+ padding: 1px 6px;
39
+ display: flex;
40
+ }
41
+
42
+ .g9-price__off-text {
43
+ color: var(--g9-error);
44
+ font-size: 11px;
45
+ font-weight: 700;
46
+ }
47
+
48
+ .g9-product {
49
+ border-radius: var(--g9-radius-card);
50
+ background-color: var(--g9-surface);
51
+ border-style: solid;
52
+ border-width: 1px;
53
+ border-color: var(--g9-outline-variant);
54
+ flex-direction: column;
55
+ gap: 8px;
56
+ padding: 8px;
57
+ display: flex;
58
+ }
59
+
60
+ .g9-product--row {
61
+ align-items: center;
62
+ gap: 12px;
63
+ }
64
+
65
+ .g9-product__photo {
66
+ display: flex;
67
+ position: relative;
68
+ }
69
+
70
+ .g9-product__photo--row {
71
+ flex-shrink: 0;
72
+ }
73
+
74
+ .g9-product__badge {
75
+ background-color: var(--g9-primary);
76
+ border-radius: 10px;
77
+ padding: 2px 8px;
78
+ position: absolute;
79
+ top: 8px;
80
+ }
81
+
82
+ .g9-product__badge--ltr {
83
+ left: 8px;
84
+ }
85
+
86
+ .g9-product__badge--rtl {
87
+ right: 8px;
88
+ }
89
+
90
+ .g9-product__badge-text {
91
+ color: var(--g9-on-primary);
92
+ font-size: 11px;
93
+ font-weight: 700;
94
+ }
95
+
96
+ .g9-product__body {
97
+ flex-direction: column;
98
+ flex: 1;
99
+ gap: 6px;
100
+ min-width: 0;
101
+ display: flex;
102
+ }
103
+
104
+ .g9-product__title {
105
+ color: var(--g9-text-primary);
106
+ font-size: 14px;
107
+ font-weight: 700;
108
+ line-height: 20px;
109
+ }
110
+
111
+ .g9-product__subtitle {
112
+ color: var(--g9-text-secondary);
113
+ font-size: 12px;
114
+ }
115
+
116
+ .g9-cart-bar {
117
+ opacity: 0;
118
+ transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease-out;
119
+ display: flex;
120
+ position: absolute;
121
+ left: 12px;
122
+ right: 12px;
123
+ transform: translateY(160px);
124
+ }
125
+
126
+ .g9-cart-bar--shown {
127
+ opacity: 1;
128
+ transform: translateY(0);
129
+ }
130
+
131
+ .g9-cart-bar__inner {
132
+ background-color: var(--g9-primary);
133
+ border-radius: 20px;
134
+ flex: 1;
135
+ align-items: center;
136
+ gap: 12px;
137
+ height: 60px;
138
+ padding: 0 16px;
139
+ display: flex;
140
+ box-shadow: 0 8px 24px #0000002e;
141
+ }
142
+
143
+ .g9-cart-bar__count {
144
+ background-color: var(--g9-on-primary);
145
+ border-radius: 16px;
146
+ justify-content: center;
147
+ align-items: center;
148
+ min-width: 32px;
149
+ height: 32px;
150
+ display: flex;
151
+ }
152
+
153
+ .g9-cart-bar__count-text {
154
+ color: var(--g9-primary);
155
+ font-size: 14px;
156
+ font-weight: 800;
157
+ }
158
+
159
+ .g9-cart-bar__lines {
160
+ flex-direction: column;
161
+ flex: 1;
162
+ min-width: 0;
163
+ display: flex;
164
+ }
165
+
166
+ .g9-cart-bar__title {
167
+ color: var(--g9-on-primary);
168
+ font-size: 15px;
169
+ font-weight: 800;
170
+ }
171
+
172
+ .g9-cart-bar__sub {
173
+ color: var(--g9-on-primary);
174
+ opacity: .85;
175
+ font-size: 12px;
176
+ }
177
+
178
+ .g9-cart-bar__total {
179
+ color: var(--g9-on-primary);
180
+ font-size: 15px;
181
+ font-weight: 800;
182
+ }
183
+
184
+
185
+ /*# sourceMappingURL=commerce.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://./src/commerce.css"],"names":[],"mappings":"AACA;EAAE,eAAe;EACf,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAGA;EAAE,6BAA6B;EAC7B,gBAAgB;AAClB;;AAGA;EAAE,eAAe;AACjB;;AAGA;EAAE,eAAe;AACjB;;AAGA;EAAE,eAAe;AACjB;;AAGA;EAAE,sBAAsB;AACxB;;AAGA;EAAE,8BAA8B;EAC9B,eAAe;EACf,6BAA6B;AAC/B;;AAGA;EAAE,2CAA2C;EAC3C,kBAAkB;EAClB,gBAAgB;EAChB,aAAa;AACf;;AAGA;EAAE,sBAAsB;EACtB,eAAe;EACf,gBAAgB;AAClB;;AAGA;EAAE,oCAAoC;EACpC,mCAAmC;EACnC,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;EACvC,sBAAsB;EACtB,QAAQ;EACR,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,mBAAmB;EACnB,SAAS;AACX;;AAGA;EAAE,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,cAAc;AAChB;;AAGA;EAAE,mCAAmC;EACnC,mBAAmB;EACnB,gBAAgB;EAChB,kBAAkB;EAClB,QAAQ;AACV;;AAGA;EAAE,SAAS;AACX;;AAGA;EAAE,UAAU;AACZ;;AAGA;EAAE,2BAA2B;EAC3B,eAAe;EACf,gBAAgB;AAClB;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,QAAQ;EACR,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,6BAA6B;EAC7B,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB;;AAGA;EAAE,+BAA+B;EAC/B,eAAe;AACjB;;AAGA;EAAE,UAAU;EACV,4EAA4E;EAC5E,aAAa;EACb,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,4BAA4B;AAC9B;;AAKA;EAFE,UAAU;EACV,wBAAwB;AAC1B;;AAKA;EAFE,mCAAmC;EACnC,mBAAmB;EACnB,OAAO;EACP,mBAAmB;EACnB,SAAS;EACT,YAAY;EACZ,eAAe;EACf,aAAa;EACb,gCAAgC;AAClC;;AAKA;EAFE,sCAAsC;EACtC,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,aAAa;AACf;;AAKA;EAFE,wBAAwB;EACxB,eAAe;EACf,gBAAgB;AAClB;;AAKA;EAFE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAKA;EAFE,2BAA2B;EAC3B,eAAe;EACf,gBAAgB;AAClB;;AAKA;EAFE,2BAA2B;EAC3B,YAAY;EACZ,eAAe;AACjB;;AAKA;EAFE,2BAA2B;EAC3B,eAAe;EACf,gBAAgB;AAClB","sourcesContent":["/* Commerce controls. One class per selector; colours are theme variables. */\n.g9-price {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n column-gap: 6px;\n}\n\n.g9-price__now {\n font-weight: 800;\n color: var(--g9-text-primary);\n}\n\n.g9-price__now--sm {\n font-size: 13px;\n}\n\n.g9-price__now--md {\n font-size: 15px;\n}\n\n.g9-price__now--lg {\n font-size: 20px;\n}\n\n.g9-price__now--sale {\n color: var(--g9-error);\n}\n\n.g9-price__was {\n font-size: 12px;\n color: var(--g9-text-tertiary);\n text-decoration: line-through;\n}\n\n.g9-price__off {\n display: flex;\n padding: 1px 6px;\n border-radius: 8px;\n background-color: var(--g9-error-container);\n}\n\n.g9-price__off-text {\n font-size: 11px;\n font-weight: 700;\n color: var(--g9-error);\n}\n\n.g9-product {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px;\n border-radius: var(--g9-radius-card);\n background-color: var(--g9-surface);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-product--row {\n align-items: center;\n gap: 12px;\n}\n\n.g9-product__photo {\n position: relative;\n display: flex;\n}\n\n.g9-product__photo--row {\n flex-shrink: 0;\n}\n\n.g9-product__badge {\n position: absolute;\n top: 8px;\n padding: 2px 8px;\n border-radius: 10px;\n background-color: var(--g9-primary);\n}\n\n.g9-product__badge--ltr {\n left: 8px;\n}\n\n.g9-product__badge--rtl {\n right: 8px;\n}\n\n.g9-product__badge-text {\n font-size: 11px;\n font-weight: 700;\n color: var(--g9-on-primary);\n}\n\n.g9-product__body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n gap: 6px;\n}\n\n.g9-product__title {\n font-size: 14px;\n font-weight: 700;\n line-height: 20px;\n color: var(--g9-text-primary);\n}\n\n.g9-product__subtitle {\n font-size: 12px;\n color: var(--g9-text-secondary);\n}\n\n.g9-cart-bar {\n position: absolute;\n left: 12px;\n right: 12px;\n display: flex;\n transform: translateY(160px);\n opacity: 0;\n transition:\n transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),\n opacity 200ms ease-out;\n}\n\n.g9-cart-bar--shown {\n transform: translateY(0px);\n opacity: 1;\n}\n\n.g9-cart-bar__inner {\n display: flex;\n flex: 1;\n align-items: center;\n gap: 12px;\n height: 60px;\n padding: 0px 16px;\n border-radius: 20px;\n background-color: var(--g9-primary);\n box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.18);\n}\n\n.g9-cart-bar__count {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 32px;\n height: 32px;\n border-radius: 16px;\n background-color: var(--g9-on-primary);\n}\n\n.g9-cart-bar__count-text {\n font-size: 14px;\n font-weight: 800;\n color: var(--g9-primary);\n}\n\n.g9-cart-bar__lines {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-cart-bar__title {\n font-size: 15px;\n font-weight: 800;\n color: var(--g9-on-primary);\n}\n\n.g9-cart-bar__sub {\n font-size: 12px;\n color: var(--g9-on-primary);\n opacity: 0.85;\n}\n\n.g9-cart-bar__total {\n font-size: 15px;\n font-weight: 800;\n color: var(--g9-on-primary);\n}\n"],"sourceRoot":""}
@@ -0,0 +1,78 @@
1
+ import './commerce.css';
2
+ import { type ReactNode } from '@lynx-js/react';
3
+ import { type G9Currency } from './model.js';
4
+ interface Common {
5
+ readonly id?: string;
6
+ readonly className?: string;
7
+ }
8
+ /** Props of {@link G9PriceTag}. */
9
+ export interface G9PriceTagProps extends Common {
10
+ readonly price: number;
11
+ readonly compareAt?: number | null;
12
+ readonly currency?: G9Currency;
13
+ readonly size?: 'sm' | 'md' | 'lg';
14
+ /** Show «۲۰٪» beside a discounted price. Default true. */
15
+ readonly showPercent?: boolean;
16
+ }
17
+ /** A price in the culture's digits, the old price struck through and the percentage off when discounted. */
18
+ export declare const G9PriceTag: import("react").NamedExoticComponent<G9PriceTagProps>;
19
+ /** Props of {@link G9QuantityControl}. */
20
+ export interface G9QuantityControlProps extends Common {
21
+ readonly value: number;
22
+ readonly onChange: (qty: number) => void;
23
+ /** Units available (the + stops there). */
24
+ readonly stock?: number;
25
+ /** The collapsed «add» button's text (0 in the cart). */
26
+ readonly addText: string;
27
+ readonly outOfStockText?: string;
28
+ readonly size?: 'sm' | 'md';
29
+ readonly block?: boolean;
30
+ readonly disabled?: boolean;
31
+ }
32
+ /**
33
+ * Add, then − n + (ShopManager AddControl, SAC tray, mardomi Stepper): one tap adds, the stepper takes over, reaching
34
+ * 0 folds it back into the button. Out of stock shows a quiet disabled button.
35
+ */
36
+ export declare function G9QuantityControl(props: G9QuantityControlProps): ReactNode;
37
+ /** Props of {@link G9ProductTile}. */
38
+ export interface G9ProductTileProps extends Common {
39
+ readonly title: string;
40
+ readonly subtitle?: string;
41
+ readonly image?: string | null;
42
+ readonly price: number;
43
+ readonly compareAt?: number | null;
44
+ readonly currency?: G9Currency;
45
+ /** A ribbon on the image («جدید», «پرفروش»). */
46
+ readonly badge?: string;
47
+ readonly qty: number;
48
+ readonly onQtyChange: (qty: number) => void;
49
+ readonly stock?: number;
50
+ readonly addText: string;
51
+ readonly outOfStockText?: string;
52
+ readonly onPress?: () => void;
53
+ /** `card` (grid, image on top) or `row` (list, image at the start). Default card. */
54
+ readonly layout?: 'card' | 'row';
55
+ /** The photo's element id (a fly-to-cart starts there). */
56
+ readonly imageId?: string;
57
+ }
58
+ /** A product as a grid card or a list row: photo, title, price with discount, and the quantity control. */
59
+ export declare const G9ProductTile: import("react").NamedExoticComponent<G9ProductTileProps>;
60
+ /** Props of {@link G9MiniCartBar}. */
61
+ export interface G9MiniCartBarProps extends Common {
62
+ readonly count: number;
63
+ readonly total: number;
64
+ readonly currency?: G9Currency;
65
+ /** «۳ قلم» — the count line (receives the formatted count). */
66
+ readonly countText: (count: string) => string;
67
+ readonly actionText: string;
68
+ readonly onPress: () => void;
69
+ /** Lift it above a tab bar (dp). */
70
+ readonly bottomOffset?: number;
71
+ }
72
+ /**
73
+ * The floating cart summary at the bottom (ShopManager MiniCart, SAC tray bar): slides in when the cart has items and
74
+ * out when it empties (transform only), above the safe area and any tab bar.
75
+ */
76
+ export declare function G9MiniCartBar(props: G9MiniCartBarProps): ReactNode;
77
+ export {};
78
+ //# sourceMappingURL=commerce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commerce.d.ts","sourceRoot":"","sources":["../src/commerce.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,161 @@
1
+ import "./commerce.css";
2
+ import { g9IdProps } from "@g9tm/lynxcontrols/base";
3
+ import { G9Button } from "@g9tm/lynxcontrols/button";
4
+ import { G9Photo } from "@g9tm/lynxcontrols/display";
5
+ import { useG9Culture, useG9Direction, useG9SafeInsets } from "@g9tm/lynxcontrols/provider";
6
+ import { G9Stepper } from "@g9tm/lynxcontrols/toggle";
7
+ import { g9Haptic } from "@g9tm/lynxcontrols-foundation";
8
+ import { memo } from "@lynx-js/react";
9
+ import { formatMoney, priceParts } from "./model.jsx";
10
+ const cls = (base, extra)=>extra ? `${base} ${extra}` : base;
11
+ const rowDir = (rtl)=>({
12
+ flexDirection: rtl ? 'row-reverse' : 'row',
13
+ direction: 'ltr'
14
+ });
15
+ const G9PriceTag = memo(function(props) {
16
+ var _props_size;
17
+ const culture = useG9Culture();
18
+ const rtl = 'rtl' === useG9Direction();
19
+ const p = priceParts(props.price, props.compareAt);
20
+ const fmt = {
21
+ language: culture.language,
22
+ numberingSystem: culture.numberingSystem
23
+ };
24
+ const money = (n, bare = false)=>{
25
+ var _props_currency;
26
+ return formatMoney(n, {
27
+ currency: null != (_props_currency = props.currency) ? _props_currency : 'IRT',
28
+ ...fmt,
29
+ bare
30
+ });
31
+ };
32
+ const size = null != (_props_size = props.size) ? _props_size : 'md';
33
+ return <view className={cls(`g9-price g9-price--${size}`, props.className)} {...g9IdProps(props.id)} style={rowDir(rtl)} accessibility-element={true} accessibility-label={p.was ? `${money(p.now)} (${money(p.was)})` : money(p.now)}>
34
+ <text className={`g9-price__now g9-price__now--${size}${p.was ? ' g9-price__now--sale' : ''}`}>
35
+ {money(p.now)}
36
+ </text>
37
+ {p.was ? <text className="g9-price__was">{money(p.was, true)}</text> : null}
38
+ {p.percentOff && false !== props.showPercent ? <view className="g9-price__off">
39
+ <text className="g9-price__off-text">{`${formatMoney(p.percentOff, {
40
+ ...fmt,
41
+ bare: true
42
+ })}٪`}</text>
43
+ </view> : null}
44
+ </view>;
45
+ });
46
+ function G9QuantityControl(props) {
47
+ var _props_stock, _props_size;
48
+ const culture = useG9Culture();
49
+ if (0 === props.stock && 0 === props.value) {
50
+ var _props_outOfStockText;
51
+ return <G9Button {...props.id ? {
52
+ id: props.id
53
+ } : {}} text={null != (_props_outOfStockText = props.outOfStockText) ? _props_outOfStockText : props.addText} variant="surface" size={'sm' === props.size ? 'small' : 'medium'} disabled {...props.block ? {
54
+ block: true
55
+ } : {}}/>;
56
+ }
57
+ return <G9Stepper {...props.id ? {
58
+ id: props.id
59
+ } : {}} {...props.className ? {
60
+ className: props.className
61
+ } : {}} value={props.value} min={0} max={null != (_props_stock = props.stock) ? _props_stock : 999} collapsedAtMin={props.addText} size={null != (_props_size = props.size) ? _props_size : 'md'} format={(n)=>formatMoney(n, {
62
+ bare: true,
63
+ language: culture.language,
64
+ numberingSystem: culture.numberingSystem
65
+ })} onChange={(n)=>{
66
+ g9Haptic(n > props.value ? 'tick' : 'select');
67
+ props.onChange(n);
68
+ }} {...props.block ? {
69
+ block: true
70
+ } : {}} {...props.disabled ? {
71
+ disabled: true
72
+ } : {}}/>;
73
+ }
74
+ const G9ProductTile = memo(function(props) {
75
+ var _props_image;
76
+ const rtl = 'rtl' === useG9Direction();
77
+ const row = 'row' === props.layout;
78
+ const align = {
79
+ textAlign: rtl ? 'right' : 'left'
80
+ };
81
+ return <view className={cls(row ? 'g9-product g9-product--row' : 'g9-product', props.className)} {...g9IdProps(props.id)} style={row ? rowDir(rtl) : {}} {...props.onPress ? {
82
+ bindtap: props.onPress
83
+ } : {}}>
84
+ <view className={row ? 'g9-product__photo g9-product__photo--row' : 'g9-product__photo'} {...props.imageId ? {
85
+ id: props.imageId
86
+ } : {}}>
87
+ <G9Photo src={null != (_props_image = props.image) ? _props_image : null} {...row ? {
88
+ size: 84
89
+ } : {
90
+ width: '100%',
91
+ height: 132
92
+ }} radius={12}/>
93
+ {props.badge ? <view className={`g9-product__badge g9-product__badge--${rtl ? 'rtl' : 'ltr'}`}>
94
+ <text className="g9-product__badge-text">{props.badge}</text>
95
+ </view> : null}
96
+ </view>
97
+ <view className="g9-product__body">
98
+ <text className="g9-product__title" text-maxline="2" style={align}>
99
+ {props.title}
100
+ </text>
101
+ {props.subtitle ? <text className="g9-product__subtitle" text-maxline="1" style={align}>
102
+ {props.subtitle}
103
+ </text> : null}
104
+ <G9PriceTag price={props.price} {...null != props.compareAt ? {
105
+ compareAt: props.compareAt
106
+ } : {}} {...props.currency ? {
107
+ currency: props.currency
108
+ } : {}} size="sm"/>
109
+ <G9QuantityControl {...props.id ? {
110
+ id: `${props.id}.Qty`
111
+ } : {}} value={props.qty} onChange={props.onQtyChange} {...void 0 !== props.stock ? {
112
+ stock: props.stock
113
+ } : {}} addText={props.addText} {...props.outOfStockText ? {
114
+ outOfStockText: props.outOfStockText
115
+ } : {}} size="sm" block={!row}/>
116
+ </view>
117
+ </view>;
118
+ });
119
+ function G9MiniCartBar(props) {
120
+ var _props_currency, _props_bottomOffset;
121
+ const culture = useG9Culture();
122
+ const rtl = 'rtl' === useG9Direction();
123
+ const insets = useG9SafeInsets();
124
+ const shown = props.count > 0;
125
+ const fmt = {
126
+ language: culture.language,
127
+ numberingSystem: culture.numberingSystem
128
+ };
129
+ const n = formatMoney(props.count, {
130
+ ...fmt,
131
+ bare: true
132
+ });
133
+ const total = formatMoney(props.total, {
134
+ ...fmt,
135
+ currency: null != (_props_currency = props.currency) ? _props_currency : 'IRT'
136
+ });
137
+ const align = {
138
+ textAlign: rtl ? 'right' : 'left'
139
+ };
140
+ return <view className={cls(`g9-cart-bar${shown ? ' g9-cart-bar--shown' : ''}`, props.className)} {...g9IdProps(props.id)} style={{
141
+ bottom: `${(null != (_props_bottomOffset = props.bottomOffset) ? _props_bottomOffset : 0) + insets.bottom + 12}px`
142
+ }}>
143
+ <view className="g9-cart-bar__inner" style={rowDir(rtl)} {...shown ? {
144
+ bindtap: props.onPress
145
+ } : {}} accessibility-element={true} accessibility-traits="button" accessibility-label={`${props.actionText}: ${props.countText(n)}, ${total}`}>
146
+ <view className="g9-cart-bar__count">
147
+ <text className="g9-cart-bar__count-text">{n}</text>
148
+ </view>
149
+ <view className="g9-cart-bar__lines">
150
+ <text className="g9-cart-bar__title" style={align}>
151
+ {props.actionText}
152
+ </text>
153
+ <text className="g9-cart-bar__sub" style={align}>
154
+ {props.countText(n)}
155
+ </text>
156
+ </view>
157
+ <text className="g9-cart-bar__total">{total}</text>
158
+ </view>
159
+ </view>;
160
+ }
161
+ export { G9MiniCartBar, G9PriceTag, G9ProductTile, G9QuantityControl };
@@ -0,0 +1,3 @@
1
+ export { G9MiniCartBar, type G9MiniCartBarProps, G9PriceTag, type G9PriceTagProps, G9ProductTile, type G9ProductTileProps, G9QuantityControl, type G9QuantityControlProps, } from './commerce.js';
2
+ export * from './model.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,UAAU,EACV,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,YAAY,CAAC;AACpB,cAAc,SAAS,CAAC"}
package/dist/index.jsx ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./model.jsx";
2
+ export { G9MiniCartBar, G9PriceTag, G9ProductTile, G9QuantityControl } from "./commerce.jsx";
@@ -0,0 +1,69 @@
1
+ import { type G9NumberingSystem } from '@g9tm/lynxcontrols-foundation';
2
+ /** A currency as shown: `IRT` toman («تومان»), `IRR` rial, or any ISO code. */
3
+ export type G9Currency = 'IRT' | 'IRR' | (string & {});
4
+ /** How {@link formatMoney} writes an amount: currency, language and digits. */
5
+ export interface G9MoneyOptions {
6
+ readonly currency?: G9Currency;
7
+ readonly language?: string;
8
+ readonly numberingSystem?: G9NumberingSystem;
9
+ /** «۱٫۲ میلیون» instead of every digit. */
10
+ readonly compact?: boolean;
11
+ /** Leave the currency name out (a column headed by it). */
12
+ readonly bare?: boolean;
13
+ }
14
+ /** `1250000` → «۱٬۲۵۰٬۰۰۰ تومان» / «1,250,000 Toman» / «$12.50». */
15
+ export declare function formatMoney(amount: number, options?: G9MoneyOptions): string;
16
+ /** A price with its discount: what to show struck through and the percentage off. */
17
+ export interface G9PriceParts {
18
+ readonly now: number;
19
+ readonly was: number | null;
20
+ /** Whole percent off (rounded down so «20٪» never overstates), or null. */
21
+ readonly percentOff: number | null;
22
+ }
23
+ /** A price against its compare-at price: the price now, the price it was (or `null`), and the whole percent off. */
24
+ export declare function priceParts(price: number, compareAt?: number | null): G9PriceParts;
25
+ /** One line of a cart. */
26
+ export interface G9CartLine {
27
+ readonly id: string;
28
+ readonly title: string;
29
+ readonly price: number;
30
+ readonly qty: number;
31
+ readonly compareAt?: number | null;
32
+ /** Units available; the cart never holds more. */
33
+ readonly stock?: number;
34
+ readonly image?: string;
35
+ }
36
+ /** A cart: its lines (one per product, with the quantity). */
37
+ export interface G9Cart {
38
+ readonly lines: readonly G9CartLine[];
39
+ }
40
+ /** What {@link cartReducer} applies: add, set a quantity, remove a line, or clear the cart. */
41
+ export type G9CartAction = {
42
+ readonly type: 'add';
43
+ readonly line: Omit<G9CartLine, 'qty'>;
44
+ readonly qty?: number;
45
+ } | {
46
+ readonly type: 'set';
47
+ readonly id: string;
48
+ readonly qty: number;
49
+ } | {
50
+ readonly type: 'remove';
51
+ readonly id: string;
52
+ } | {
53
+ readonly type: 'clear';
54
+ };
55
+ /** The cart with no lines (frozen: the reducer returns new carts). */
56
+ export declare const emptyCart: G9Cart;
57
+ /** The cart after `action` (lines keep their order; quantity 0 removes; stock caps). */
58
+ export declare function cartReducer(cart: G9Cart, action: G9CartAction): G9Cart;
59
+ /** Totals of a cart: items, subtotal, what the discounts saved. */
60
+ export interface G9CartTotals {
61
+ readonly count: number;
62
+ readonly subtotal: number;
63
+ readonly saved: number;
64
+ }
65
+ /** What a cart adds up to: the item count, the subtotal and what the compare-at prices saved. */
66
+ export declare function cartTotals(cart: G9Cart): G9CartTotals;
67
+ /** The quantity of product `id` in the cart (0 when it is not in it). */
68
+ export declare const cartQty: (cart: G9Cart, id: string) => number;
69
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"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"}
package/dist/model.jsx ADDED
@@ -0,0 +1,141 @@
1
+ import { formatCompact, formatNumber } from "@g9tm/lynxcontrols-foundation";
2
+ const NAMES = {
3
+ IRT: {
4
+ fa: 'تومان',
5
+ en: 'Toman',
6
+ decimals: 0
7
+ },
8
+ IRR: {
9
+ fa: 'ریال',
10
+ en: 'Rial',
11
+ decimals: 0
12
+ },
13
+ USD: {
14
+ fa: 'دلار',
15
+ en: '$',
16
+ decimals: 2
17
+ },
18
+ EUR: {
19
+ fa: 'یورو',
20
+ en: '€',
21
+ decimals: 2
22
+ },
23
+ AED: {
24
+ fa: 'درهم',
25
+ en: 'AED',
26
+ decimals: 2
27
+ }
28
+ };
29
+ function formatMoney(amount, options = {}) {
30
+ var _options_currency, _options_language, _options_numberingSystem, _NAMES_currency;
31
+ const currency = null != (_options_currency = options.currency) ? _options_currency : 'IRT';
32
+ const fa = (null != (_options_language = options.language) ? _options_language : 'fa').startsWith('fa');
33
+ const system = null != (_options_numberingSystem = options.numberingSystem) ? _options_numberingSystem : fa ? 'persian' : 'latin';
34
+ const meta = null != (_NAMES_currency = NAMES[currency]) ? _NAMES_currency : {
35
+ fa: currency,
36
+ en: currency,
37
+ decimals: 2
38
+ };
39
+ const digits = options.compact ? formatCompact(amount, {
40
+ language: fa ? 'fa' : 'en',
41
+ numberingSystem: system
42
+ }) : formatNumber(amount, {
43
+ numberingSystem: system,
44
+ minimumFractionDigits: meta.decimals,
45
+ maximumFractionDigits: meta.decimals,
46
+ useGrouping: true
47
+ });
48
+ if (options.bare) return digits;
49
+ const name = fa ? meta.fa : meta.en;
50
+ return fa || 1 !== name.length ? `${digits} ${name}` : `${name}${digits}`;
51
+ }
52
+ function priceParts(price, compareAt) {
53
+ if (!compareAt || compareAt <= price) return {
54
+ now: price,
55
+ was: null,
56
+ percentOff: null
57
+ };
58
+ return {
59
+ now: price,
60
+ was: compareAt,
61
+ percentOff: Math.floor((compareAt - price) / compareAt * 100)
62
+ };
63
+ }
64
+ const emptyCart = Object.freeze({
65
+ lines: Object.freeze([])
66
+ });
67
+ const clampQty = (qty, stock)=>Math.max(0, Math.min(null != stock ? stock : 1 / 0, Math.floor(qty)));
68
+ function cartReducer(cart, action) {
69
+ switch(action.type){
70
+ case 'add':
71
+ {
72
+ var _action_qty;
73
+ const at = cart.lines.findIndex((l)=>l.id === action.line.id);
74
+ if (at < 0) {
75
+ var _action_qty1;
76
+ const qty = clampQty(null != (_action_qty1 = action.qty) ? _action_qty1 : 1, action.line.stock);
77
+ return qty > 0 ? {
78
+ lines: [
79
+ ...cart.lines,
80
+ {
81
+ ...action.line,
82
+ qty
83
+ }
84
+ ]
85
+ } : cart;
86
+ }
87
+ const line = cart.lines[at];
88
+ return cartReducer(cart, {
89
+ type: 'set',
90
+ id: line.id,
91
+ qty: line.qty + (null != (_action_qty = action.qty) ? _action_qty : 1)
92
+ });
93
+ }
94
+ case 'set':
95
+ {
96
+ const at = cart.lines.findIndex((l)=>l.id === action.id);
97
+ if (at < 0) return cart;
98
+ const line = cart.lines[at];
99
+ const qty = clampQty(action.qty, line.stock);
100
+ if (qty === line.qty) return cart;
101
+ if (0 === qty) return {
102
+ lines: cart.lines.filter((l)=>l.id !== action.id)
103
+ };
104
+ const lines = cart.lines.slice();
105
+ lines[at] = {
106
+ ...line,
107
+ qty
108
+ };
109
+ return {
110
+ lines
111
+ };
112
+ }
113
+ case 'remove':
114
+ return cart.lines.some((l)=>l.id === action.id) ? {
115
+ lines: cart.lines.filter((l)=>l.id !== action.id)
116
+ } : cart;
117
+ case 'clear':
118
+ return cart.lines.length ? emptyCart : cart;
119
+ }
120
+ }
121
+ function cartTotals(cart) {
122
+ let count = 0;
123
+ let subtotal = 0;
124
+ let saved = 0;
125
+ for (const l of cart.lines){
126
+ count += l.qty;
127
+ subtotal += l.price * l.qty;
128
+ if (l.compareAt && l.compareAt > l.price) saved += (l.compareAt - l.price) * l.qty;
129
+ }
130
+ return {
131
+ count,
132
+ subtotal,
133
+ saved
134
+ };
135
+ }
136
+ const cartQty = (cart, id)=>{
137
+ var _ref;
138
+ var _cart_lines_find;
139
+ return null != (_ref = null == (_cart_lines_find = cart.lines.find((l)=>l.id === id)) ? void 0 : _cart_lines_find.qty) ? _ref : 0;
140
+ };
141
+ export { cartQty, cartReducer, cartTotals, emptyCart, formatMoney, priceParts };
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@g9tm/lynxcontrols-commerce",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.1.0",
4
+ "description": "Commerce controls for G9LynxControls: money and cart model, G9PriceTag, G9QuantityControl, G9ProductTile and G9MiniCartBar (ShopManager, SAC menu, Hub store).",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": [
8
+ "**/*.css"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "source": "./src/index.ts",
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.jsx"
15
+ },
16
+ "./model": {
17
+ "source": "./src/model.ts",
18
+ "types": "./dist/model.d.ts",
19
+ "default": "./dist/model.jsx"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md"
25
+ ],
26
+ "scripts": {
27
+ "build": "rslib build"
28
+ },
29
+ "dependencies": {
30
+ "@g9tm/lynxcontrols-foundation": "2.1.0"
31
+ },
32
+ "peerDependencies": {
33
+ "@g9tm/lynxcontrols": "2.1.0",
34
+ "@lynx-js/react": ">=0.129.3 <0.130.0"
35
+ }
36
+ }