'use strict';
import { shipmentProviderTypes } from '../../common/shipment/shipment-provider-type.js';
import { createShipmentProvider, createShipment } from './shipment-db.js';
import { createBaseResourceProperties } from '../utils/base-resource-properties.js';
import { workspaceConstants } from '../../../fd-toolbox/server/constants/workspace-constants.js';
import { shipmentTrackingStatuses } from '../../common/shipment/shipment-tracking-status.js';
import { shipmentLabelTypes } from '../../common/shipment/shipment-label-type.js';
import { orderIds, orderItemIds } from '../orders/order-master-data.js';
import { fedexProviderName, shippoProviderName, shippoTrackUrl, shipmentSearchParams, fedexTrackUrl } from './shipment-constants.js';

var __defProp=Object['defineProperty'],__name=(_0x25dbf0,_0xcbe3c6)=>__defProp(_0x25dbf0,'name',{'value':_0xcbe3c6,'configurable':!![]});const shipmentIds={'shipment1':'21884fb7-6e39-4f7b-9a49-0f46d527f50c','shipment2':'e6367904-081e-479b-a8c5-5972057a261e','shipment3':'076aecd1-7fb8-5d89-baa9-e48e61048525'};const shipmentProviderIds={'fedEx':'3ae5c679-b9b5-491a-a5a6-5f9c694a36a2','shippo':'e45c3e20-08eb-456b-aec8-3ed92e1e4c78'};async function seedShipments(){await seedShipmentProvider(shipmentProviderIds['fedEx'],fedexProviderName,shipmentProviderTypes['fedEx']),await seedShipmentProvider(shipmentProviderIds['shippo'],shippoProviderName,shipmentProviderTypes['shippo']),await seedShipment(shipmentIds['shipment1'],orderIds['timFirstOrderId'],orderItemIds['phoneOrderItemId'],shipmentProviderIds['fedEx'],-0x7de+0x26f0+0x26*-0xd1+0.4499999999999993,'283597038127',shipmentTrackingStatuses['notShipped'],shipmentLabelTypes['url'],'/images/shipment/21884fb7-6e39-4f7b-9a49-0f46d527f50c.pdf'),await seedShipment(shipmentIds['shipment2'],orderIds['timSecondOrderId'],orderItemIds['tvOrderItemId'],shipmentProviderIds['shippo'],-0x48*0x2b+-0xd*0x121+0x1ada+0.5,'9300120111412246323797',shipmentTrackingStatuses['outForDelivery'],shipmentLabelTypes['url'],'/images/shipment/e6367904-081e-479b-a8c5-5972057a261e.pdf'),await seedShipment(shipmentIds['shipment3'],orderIds['workerBotOrderId'],orderItemIds['tvOrderItemId'],shipmentProviderIds['shippo'],-0x5cd*-0x3+-0x1eb+-0xf4f,'1ZK100A4YN23662164',shipmentTrackingStatuses['delivered'],shipmentLabelTypes['url'],'/images/shipment/076aecd1-7fb8-5d89-baa9-e48e61048525.pdf');}__name(seedShipments,'seedShipments');async function seedShipmentProvider(_0x3210a7,_0x4529a3,_0x5e2a72){await createShipmentProvider({...createBaseResourceProperties(_0x3210a7),'name':_0x4529a3,'type':_0x5e2a72});}__name(seedShipmentProvider,'seedShipmentProvider');async function seedShipment(_0x121d45,_0x319ee1,_0x107582,_0x519388,_0x3a07bb,_0x595eb3,_0x3c69de,_0x5494b3,_0x432159){await createShipment({...createBaseResourceProperties(_0x121d45),'workspaceId':workspaceConstants['defaultWorkspaceId'],'orderId':_0x319ee1,'orderItemId':_0x107582,'shipmentProviderId':_0x519388,'price':_0x3a07bb,'trackingNumber':_0x595eb3,'trackingUrl':getTrackUrl(_0x595eb3,_0x519388),'trackingStatus':_0x3c69de,'labelType':_0x5494b3,'labelUrl':_0x432159});}__name(seedShipment,'seedShipment');function getTrackUrl(_0x169734,_0x40de95){let _0x2e67d5;if(_0x40de95===shipmentProviderIds['shippo'])_0x2e67d5=getShippoLink(_0x169734);else {if(_0x40de95===shipmentProviderIds['fedEx'])_0x2e67d5=getFedexLink(_0x169734);}return _0x2e67d5;}__name(getTrackUrl,'getTrackUrl');function getShippoLink(_0x4ba5ec){return shippoTrackUrl+'?loc=en_US&'+shipmentSearchParams['shippoTrackNum']+'='+_0x4ba5ec;}__name(getShippoLink,'getShippoLink');function getFedexLink(_0x8398ae){return fedexTrackUrl+'?'+shipmentSearchParams['fedexTrackNum']+'='+_0x8398ae;}__name(getFedexLink,'getFedexLink');

export { seedShipments, shipmentIds, shipmentProviderIds };
