PageSourceSearch

https://www.givelegacy.com/assets/use-active-order-BdG7gtVW.js

js givelegacy.com collected 2026-09-25 23:50:03 UTC 2,850 bytes, 1 lines download raw bytes

1import{b as l,r as d}from"./chunk-5KNZJZUH-DxTi1N3X.js";import{s as v,t as I}from"./active-order-error-BIDVfQZ7.js";import{c as s}from"./exports-wKO4F3Cc.js";function h(e){if(!v(e))return;const{error:i,captureContext:n}=I(e);s(i,n)}function x(){const e=l(),[i,n]=d.useState(null),{activeOrder:c}=e.data??{};d.useEffect(()=>{e.state==="idle"&&!e.data&&e.load("/api/active-order").catch(t=>{t.message.includes("Cannot read properties of undefined (reading 'result')")||(console.error(t),s(t))})},[e]);function m(){return["loading","submitting"].includes(e.state)}function p(){e.load("/api/active-order").catch(t=>{t.message.includes("Cannot read properties of undefined (reading 'result')")||(console.error(t),s(t))})}return{activeOrderFetcher:e,activeOrder:c,addItemToOrder:async(t,o,a)=>{await e.submit({action:"addItemToOrder",variantId:t,segmentAnonymousId:o??"",lastGclid:a??""},{method:"post",action:"/api/active-order"})},replaceLineItem:async(t,o,a,r,u)=>{await e.submit({action:"replaceOrderLine",lineId:t,variantId:o,quantity:a.toString(),segmentAnonymousId:r??"",lastGclid:u??""},{method:"post",action:"/api/active-order"})},removeItem:async t=>{await e.submit({action:"removeItem",lineId:t},{method:"post",action:"/api/active-order"})},adjustOrderLine:async(t,o,a,r)=>{await e.submit({action:"adjustItem",lineId:t,quantity:o.toString(),segmentAnonymousId:a??"",lastGclid:r??""},{method:"post",action:"/api/active-order"})},isLoading:m,refresh:p,applyCouponCode:async t=>{await e.submit({action:"applyCouponCode",couponCode:t},{method:"post",action:"/api/active-order"})},addItemsToOrder:async(t,o,a)=>{await e.submit({action:"addItemsToOrder",variantIds:t,segmentAnonymousId:o??"",lastGclid:a??""},{method:"post",action:"/api/active-order"})},removeCouponCode:async t=>{await e.submit({action:"removeCouponCode",couponCode:t},{method:"post",action:"/api/active-order"})},addItemsAndCouponToOrder:async(t,o,a,r)=>{console.log("lastGclid active order api",r),o&&await e.submit({action:"removeAllCouponsFromOrder"},{method:"post",action:"/api/active-order"}),await e.submit({action:"addItemsAndCouponToOrder",variantIds:t,couponCode:o?o.toUpperCase():"",segmentAnonymousId:a??"",lastGclid:r??""},{method:"post",action:"/api/active-order"})},removeAllItemsAndCouponsFromOrder:async()=>{await e.submit({action:"removeAllItemsFromOrder"},{method:"post",action:"/api/active-order"}),await e.submit({action:"removeAllCouponsFromOrder"},{method:"post",action:"/api/active-order"})},setIdMeVerification:async t=>{await e.submit({action:"setIdMeVerification",idMeVerification:t},{method:"post",action:"/api/active-order"})},setShippingMethod:async t=>{await e.submit({action:"setShippingMethod",shippingMethodId:t},{method:"post",action:"/api/active-order"})},setErrorHandler:async t=>{n(t),t!==null&&(console.error(t),h(t))},error:i}}export{x as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.