完善商品发布位置与 Docker 运行环境
This commit is contained in:
1 parent
9adc77df73
commit
7ec0b4a078
21 files changed
+431
-176
No files matched your search
@@ -35,6 +35,7 @@ ENV PLAYWRIGHT_DRIVER_PATH=/ms-playwright-go
|
||||
ENV PLAYWRIGHT_NODEJS_PATH=/usr/bin/node
|
||||
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
|
||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
WORKDIR /app
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
@@ -45,6 +46,11 @@ RUN apt-get update \
|
||||
fonts-noto-cjk \
|
||||
nodejs \
|
||||
tzdata \
|
||||
&& update-ca-certificates --fresh \
|
||||
&& test -s "$SSL_CERT_FILE" \
|
||||
&& grep -q -- '-----BEGIN CERTIFICATE-----' "$SSL_CERT_FILE" \
|
||||
&& test -x "$PLAYWRIGHT_NODEJS_PATH" \
|
||||
&& test -x "$PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH" \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=backend /out/xianyu-server /app/xianyu-server
|
||||
COPY --from=backend /out/xianyu-dbseed /app/xianyu-dbseed
|
||||
|
||||
@@ -8,10 +8,6 @@ x-app-env: &app-env
|
||||
LOG_LEVEL: ${LOG_LEVEL:-info}
|
||||
LOG_FORMAT: ${LOG_FORMAT:-json}
|
||||
BROWSER_HEADLESS: ${BROWSER_HEADLESS:-true}
|
||||
PLAYWRIGHT_DRIVER_PATH: ${PLAYWRIGHT_DRIVER_PATH:-/ms-playwright-go}
|
||||
PLAYWRIGHT_NODEJS_PATH: ${PLAYWRIGHT_NODEJS_PATH:-/usr/bin/node}
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: ${PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD:-1}
|
||||
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH: ${PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH:-/usr/bin/chromium}
|
||||
|
||||
x-app-volumes: &app-volumes
|
||||
- app_data:/app/data
|
||||
|
||||
@@ -6,10 +6,6 @@ x-app-env: &app-env
|
||||
LOG_LEVEL: ${LOG_LEVEL:-info}
|
||||
LOG_FORMAT: ${LOG_FORMAT:-json}
|
||||
BROWSER_HEADLESS: ${BROWSER_HEADLESS:-true}
|
||||
PLAYWRIGHT_DRIVER_PATH: ${PLAYWRIGHT_DRIVER_PATH:-/ms-playwright-go}
|
||||
PLAYWRIGHT_NODEJS_PATH: ${PLAYWRIGHT_NODEJS_PATH:-/usr/bin/node}
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: ${PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD:-1}
|
||||
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH: ${PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH:-/usr/bin/chromium}
|
||||
|
||||
x-app-volumes: &app-volumes
|
||||
- app_data:/app/data
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
createItem,
|
||||
publishItem,
|
||||
recommendPublishCategory,
|
||||
getPublishLocations,
|
||||
previewItemPublishBatch,
|
||||
startItemPublishBatch,
|
||||
getItemPublishBatch,
|
||||
@@ -20,7 +21,8 @@ import {
|
||||
deleteItem,
|
||||
getShippingRules
|
||||
} from '../services/api';
|
||||
import { ArrowRight, Box, CheckCircle2, CircleDashed, Edit, Filter, Link2, PackagePlus, Plus, RefreshCw, Save, Search, ShoppingBag, Trash2, UploadCloud, User, X } from 'lucide-react';
|
||||
import type { PublishLocation } from '../services/api';
|
||||
import { ArrowRight, Box, CheckCircle2, CircleDashed, Edit, Filter, Link2, LocateFixed, PackagePlus, Plus, RefreshCw, Save, Search, ShoppingBag, Trash2, UploadCloud, User, X } from 'lucide-react';
|
||||
|
||||
interface ItemListProps {
|
||||
onConfigureDelivery: (item: Item) => void;
|
||||
@@ -100,6 +102,11 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
const [batchImagesZip, setBatchImagesZip] = useState<File | null>(null);
|
||||
const [batchCategoryKeyword, setBatchCategoryKeyword] = useState('');
|
||||
const [batchCategoryLoading, setBatchCategoryLoading] = useState(false);
|
||||
const [locationLoading, setLocationLoading] = useState(false);
|
||||
const [publishLocations, setPublishLocations] = useState<PublishLocation[]>([]);
|
||||
const [publishLocation, setPublishLocation] = useState<PublishLocation | null>(null);
|
||||
const [batchLocations, setBatchLocations] = useState<PublishLocation[]>([]);
|
||||
const [batchLocation, setBatchLocation] = useState<PublishLocation | null>(null);
|
||||
const [batchFallbackCategory, setBatchFallbackCategory] = useState({
|
||||
catId: '',
|
||||
catName: '',
|
||||
@@ -133,8 +140,8 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
original_price: '',
|
||||
quantity: '1',
|
||||
postage_mode: 'free',
|
||||
postage: '',
|
||||
images: [] as File[]
|
||||
postage: '',
|
||||
images: [] as File[],
|
||||
});
|
||||
const [publishImagePreviews, setPublishImagePreviews] = useState<{ key: string; url: string }[]>([]);
|
||||
|
||||
@@ -287,10 +294,11 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
if (!publishForm.quantity || Number(publishForm.quantity) <= 0) return alert('库存数量必须大于 0');
|
||||
if (publishForm.images.length === 0) return alert('至少上传 1 张商品图片');
|
||||
if (publishForm.postage_mode === 'fixed' && !publishForm.postage.trim()) return alert('请填写一口价邮费');
|
||||
if (!publishLocation) return alert('请获取当前位置并选择发货地');
|
||||
|
||||
setPublishing(true);
|
||||
try {
|
||||
const result = await publishItem(publishForm);
|
||||
const result = await publishItem({ ...publishForm, location: publishLocation });
|
||||
await loadItems();
|
||||
setShowPublishModal(false);
|
||||
setPublishForm({
|
||||
@@ -302,8 +310,10 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
quantity: '1',
|
||||
postage_mode: 'free',
|
||||
postage: '',
|
||||
images: []
|
||||
images: [],
|
||||
});
|
||||
setPublishLocations([]);
|
||||
setPublishLocation(null);
|
||||
if (result?.item_id) {
|
||||
const publishedItem: Item = {
|
||||
id: result.item_id,
|
||||
@@ -339,6 +349,8 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
setBatchImagesZip(null);
|
||||
setBatchCategoryKeyword('');
|
||||
setBatchFallbackCategory({ catId: '', catName: '', channelCatId: '', tbCatId: '' });
|
||||
setBatchLocations([]);
|
||||
setBatchLocation(null);
|
||||
setShowBatchModal(true);
|
||||
setBatchLoading(true);
|
||||
try {
|
||||
@@ -397,6 +409,7 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
const handlePreviewBatch = async () => {
|
||||
if (!batchFile) return alert('请先上传商品表格');
|
||||
if (!selectedAccount) return alert('请先选择默认发布账号');
|
||||
if (!batchLocation) return alert('请获取当前位置并选择发货地');
|
||||
setBatchLoading(true);
|
||||
try {
|
||||
const result = await previewItemPublishBatch({
|
||||
@@ -404,6 +417,7 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
imagesZip: batchImagesZip,
|
||||
defaultCookieId: selectedAccount,
|
||||
fallbackCategory: batchFallbackCategory,
|
||||
location: batchLocation!,
|
||||
});
|
||||
setBatchPreview(result);
|
||||
setBatchDetail(null);
|
||||
@@ -517,6 +531,26 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
setShowPublishModal(true);
|
||||
};
|
||||
|
||||
const locateForPublish = async (batch: boolean) => {
|
||||
const cookieId = batch ? selectedAccount : publishForm.cookie_id;
|
||||
if (!cookieId) return alert('请先选择发布账号');
|
||||
if (!navigator.geolocation) return alert('当前浏览器不支持定位');
|
||||
setLocationLoading(true);
|
||||
navigator.geolocation.getCurrentPosition(async position => {
|
||||
try {
|
||||
const locations = await getPublishLocations(cookieId, position.coords.longitude, position.coords.latitude);
|
||||
if (!locations.length) throw new Error('当前位置没有可用的发货地');
|
||||
if (batch) { setBatchLocations(locations); setBatchLocation(locations[0]); }
|
||||
else { setPublishLocations(locations); setPublishLocation(locations[0]); }
|
||||
} catch (error: any) {
|
||||
alert(error?.message || '获取发货地失败');
|
||||
} finally { setLocationLoading(false); }
|
||||
}, error => {
|
||||
setLocationLoading(false);
|
||||
alert(error.code === error.PERMISSION_DENIED ? '定位权限被拒绝,请在浏览器设置中允许定位' : '无法获取当前位置,请稍后重试');
|
||||
}, { enableHighAccuracy: true, timeout: 15000, maximumAge: 60000 });
|
||||
};
|
||||
|
||||
const rulesForItem = (item: Item) => shippingRules.filter(rule =>
|
||||
rule.cookie_id === item.cookie_id && rule.item_id === item.item_id
|
||||
).length > 0
|
||||
@@ -822,7 +856,11 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<label className="block text-sm font-bold text-gray-700">发布账号</label>
|
||||
<select className="w-full ios-input px-4 py-3 rounded-xl" value={publishForm.cookie_id} onChange={e => setPublishForm({...publishForm, cookie_id: e.target.value})}>
|
||||
<select className="w-full ios-input px-4 py-3 rounded-xl" value={publishForm.cookie_id} onChange={e => {
|
||||
setPublishForm({...publishForm, cookie_id: e.target.value});
|
||||
setPublishLocations([]);
|
||||
setPublishLocation(null);
|
||||
}}>
|
||||
<option value="">选择账号</option>
|
||||
{accounts.map(acc => <option key={acc.id} value={acc.id}>{accountName(acc.id)}</option>)}
|
||||
</select>
|
||||
@@ -866,6 +904,17 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
<input className="w-full ios-input px-4 py-3 rounded-xl" placeholder="例如 8.00" value={publishForm.postage} onChange={e => setPublishForm({...publishForm, postage: e.target.value})} />
|
||||
</div>
|
||||
)}
|
||||
<div className="rounded-2xl border border-sky-200 bg-sky-50 p-4 space-y-3">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div><div className="text-sm font-extrabold text-gray-900">发货地</div><p className="mt-1 text-xs text-sky-800">使用当前位置向闲鱼查询可发布的行政区。</p></div>
|
||||
<button type="button" disabled={locationLoading || !publishForm.cookie_id} onClick={() => void locateForPublish(false)} className="ios-btn-primary flex items-center gap-2 rounded-xl px-4 py-2 text-sm font-bold disabled:opacity-50">
|
||||
<LocateFixed className="h-4 w-4" />{locationLoading ? '定位中...' : '获取当前位置'}
|
||||
</button>
|
||||
</div>
|
||||
{publishLocations.length > 0 && <select className="w-full ios-input rounded-xl bg-white px-4 py-3" value={String(Math.max(0, publishLocations.indexOf(publishLocation!)))} onChange={e => setPublishLocation(publishLocations[Number(e.target.value)] || null)}>
|
||||
{publishLocations.map((item, index) => <option key={`${item.division_id}-${item.poi_id}-${index}`} value={String(index)}>{[item.province, item.city, item.area, item.poi_name].filter(Boolean).join(' ')}</option>)}
|
||||
</select>}
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<label className="block text-sm font-bold text-gray-700">商品图片(1-9 张)</label>
|
||||
<label className="flex min-h-[120px] cursor-pointer flex-col items-center justify-center rounded-2xl border-2 border-dashed border-gray-200 bg-gray-50 px-4 py-6 text-center hover:border-emerald-300 hover:bg-emerald-50/50 transition-colors">
|
||||
@@ -951,7 +1000,11 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
<select
|
||||
className="w-full ios-input px-4 py-3 rounded-xl"
|
||||
value={selectedAccount}
|
||||
onChange={e => setSelectedAccount(e.target.value)}
|
||||
onChange={e => {
|
||||
setSelectedAccount(e.target.value);
|
||||
setBatchLocations([]);
|
||||
setBatchLocation(null);
|
||||
}}
|
||||
>
|
||||
<option value="">选择账号</option>
|
||||
{accounts.map(acc => <option key={acc.id} value={acc.id}>{accountName(acc.id)}</option>)}
|
||||
@@ -1012,6 +1065,18 @@ const ItemList: React.FC<ItemListProps> = ({ onConfigureDelivery }) => {
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="rounded-xl border border-sky-200 bg-sky-50 p-4 space-y-3">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div><div className="text-sm font-extrabold text-gray-900">批次发货地</div><p className="mt-1 text-xs text-sky-800">整个批次使用同一个发货地,并随任务保存用于恢复和重试。</p></div>
|
||||
<button type="button" disabled={locationLoading || !selectedAccount} onClick={() => void locateForPublish(true)} className="ios-btn-primary flex items-center gap-2 rounded-xl px-4 py-2 text-sm font-bold disabled:opacity-50">
|
||||
<LocateFixed className="h-4 w-4" />{locationLoading ? '定位中...' : '获取当前位置'}
|
||||
</button>
|
||||
</div>
|
||||
{batchLocations.length > 0 && <select className="w-full ios-input rounded-xl bg-white px-4 py-3" value={String(Math.max(0, batchLocations.indexOf(batchLocation!)))} onChange={e => setBatchLocation(batchLocations[Number(e.target.value)] || null)}>
|
||||
{batchLocations.map((item, index) => <option key={`${item.division_id}-${item.poi_id}-${index}`} value={String(index)}>{[item.province, item.city, item.area, item.poi_name].filter(Boolean).join(' ')}</option>)}
|
||||
</select>}
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<label className="flex min-h-[150px] cursor-pointer flex-col items-center justify-center rounded-2xl border-2 border-dashed border-gray-200 bg-gray-50 px-4 py-6 text-center hover:border-blue-300 hover:bg-blue-50 transition-colors">
|
||||
<UploadCloud className="w-9 h-9 text-blue-600 mb-3" />
|
||||
|
||||
@@ -522,6 +522,7 @@ export const publishItem = async (form: {
|
||||
postage_mode: string;
|
||||
postage?: string;
|
||||
images: File[];
|
||||
location: PublishLocation;
|
||||
}): Promise<any> => {
|
||||
const body = new FormData();
|
||||
body.set('cookie_id', form.cookie_id);
|
||||
@@ -532,12 +533,29 @@ export const publishItem = async (form: {
|
||||
body.set('quantity', String(form.quantity));
|
||||
body.set('postage_mode', form.postage_mode);
|
||||
body.set('postage', form.postage || '');
|
||||
body.set('location', JSON.stringify(form.location));
|
||||
for (const file of form.images) {
|
||||
body.append('images', file);
|
||||
}
|
||||
return postForm('/items/publish', body);
|
||||
}
|
||||
|
||||
export interface PublishLocation {
|
||||
area: string;
|
||||
city: string;
|
||||
division_id: string;
|
||||
longitude: number;
|
||||
latitude: number;
|
||||
poi_id: string;
|
||||
poi_name: string;
|
||||
province: string;
|
||||
}
|
||||
|
||||
export const getPublishLocations = async (cookieId: string, longitude: number, latitude: number): Promise<PublishLocation[]> => {
|
||||
const result = await post<any>('/items/publish-locations', { cookie_id: cookieId, longitude, latitude });
|
||||
return Array.isArray(result?.locations) ? result.locations : [];
|
||||
}
|
||||
|
||||
export const recommendPublishCategory = async (cookieId: string, keyword: string): Promise<{
|
||||
success: boolean;
|
||||
category: {
|
||||
@@ -560,6 +578,7 @@ export const previewItemPublishBatch = async (form: {
|
||||
channelCatId?: string;
|
||||
tbCatId?: string;
|
||||
};
|
||||
location: PublishLocation;
|
||||
}): Promise<any> => {
|
||||
const body = new FormData();
|
||||
body.set('file', form.file);
|
||||
@@ -569,6 +588,7 @@ export const previewItemPublishBatch = async (form: {
|
||||
body.set('fallback_category_name', form.fallbackCategory.catName);
|
||||
body.set('fallback_channel_category_id', form.fallbackCategory.channelCatId || '');
|
||||
body.set('fallback_tb_category_id', form.fallbackCategory.tbCatId || '');
|
||||
body.set('location', JSON.stringify(form.location));
|
||||
return postForm('/items/publish-batches/preview', body);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ type ItemPublishBatch struct {
|
||||
DefaultCookieID string // 默认发布账号(明细行未指定账号时回退到此)
|
||||
Filename string // 原始上传文件名
|
||||
UploadDir string // 图片资源目录(发布时读取商品图片的根目录)
|
||||
LocationJSON string // 批次统一使用的发货地 JSON
|
||||
Status string // 批次状态:pending/running/completed/partially_failed/failed
|
||||
TotalCount int // 明细行总数(Recount 维护)
|
||||
SuccessCount int // 成功数(Recount 维护)
|
||||
@@ -66,6 +67,9 @@ type ItemPublishBatchRow struct {
|
||||
// 明细行的 quantity/postage_mode/status/images_json/raw_json/automation_json 缺省值在此补齐。
|
||||
// total_count 取 len(rows),success/failed 初始为 0。
|
||||
func (b *ItemPublishBatches) Create(ctx context.Context, batch *ItemPublishBatch, rows []ItemPublishBatchRow) error {
|
||||
if strings.TrimSpace(batch.LocationJSON) == "" {
|
||||
batch.LocationJSON = "{}"
|
||||
}
|
||||
tx, err := b.DB.BeginTx(ctx, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -73,10 +77,10 @@ func (b *ItemPublishBatches) Create(ctx context.Context, batch *ItemPublishBatch
|
||||
defer tx.Rollback()
|
||||
if _, err := tx.ExecContext(ctx,
|
||||
`INSERT INTO item_publish_batches
|
||||
(id,user_id,default_cookie_id,filename,upload_dir,status,total_count,success_count,failed_count)
|
||||
VALUES (?,?,?,?,?,?,?,?,?)`,
|
||||
(id,user_id,default_cookie_id,filename,upload_dir,location_json,status,total_count,success_count,failed_count)
|
||||
VALUES (?,?,?,?,?,?,?,?,?,?)`,
|
||||
batch.ID, batch.UserID, batch.DefaultCookieID, batch.Filename, batch.UploadDir,
|
||||
batch.Status, len(rows), 0, 0); err != nil {
|
||||
batch.LocationJSON, batch.Status, len(rows), 0, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, row := range rows {
|
||||
@@ -119,11 +123,11 @@ func (b *ItemPublishBatches) Create(ctx context.Context, batch *ItemPublishBatch
|
||||
func (b *ItemPublishBatches) Get(ctx context.Context, userID int64, id string) (*ItemPublishBatch, error) {
|
||||
var out ItemPublishBatch
|
||||
err := b.DB.QueryRowContext(ctx,
|
||||
`SELECT id,user_id,default_cookie_id,filename,upload_dir,status,total_count,success_count,failed_count,
|
||||
`SELECT id,user_id,default_cookie_id,filename,upload_dir,COALESCE(location_json,'{}'),status,total_count,success_count,failed_count,
|
||||
COALESCE(worker_token,''),COALESCE(lease_expires_at,0),
|
||||
created_at,updated_at
|
||||
FROM item_publish_batches WHERE id=? AND user_id=?`, id, userID).Scan(
|
||||
&out.ID, &out.UserID, &out.DefaultCookieID, &out.Filename, &out.UploadDir, &out.Status,
|
||||
&out.ID, &out.UserID, &out.DefaultCookieID, &out.Filename, &out.UploadDir, &out.LocationJSON, &out.Status,
|
||||
&out.TotalCount, &out.SuccessCount, &out.FailedCount, &out.WorkerToken, &out.LeaseExpiresAt,
|
||||
&out.CreatedAt, &out.UpdatedAt)
|
||||
if err != nil {
|
||||
@@ -140,7 +144,7 @@ func (b *ItemPublishBatches) ListForUser(ctx context.Context, userID int64, limi
|
||||
if limit <= 0 || limit > 100 {
|
||||
limit = 20
|
||||
}
|
||||
rows, err := b.DB.QueryContext(ctx, `SELECT id,user_id,default_cookie_id,filename,upload_dir,status,
|
||||
rows, err := b.DB.QueryContext(ctx, `SELECT id,user_id,default_cookie_id,filename,upload_dir,COALESCE(location_json,'{}'),status,
|
||||
total_count,success_count,failed_count,COALESCE(worker_token,''),COALESCE(lease_expires_at,0),created_at,updated_at
|
||||
FROM item_publish_batches WHERE user_id=? ORDER BY created_at DESC,id DESC LIMIT ?`, userID, limit)
|
||||
if err != nil {
|
||||
@@ -150,7 +154,7 @@ func (b *ItemPublishBatches) ListForUser(ctx context.Context, userID int64, limi
|
||||
var out []ItemPublishBatch
|
||||
for rows.Next() {
|
||||
var batch ItemPublishBatch
|
||||
if err := rows.Scan(&batch.ID, &batch.UserID, &batch.DefaultCookieID, &batch.Filename, &batch.UploadDir,
|
||||
if err := rows.Scan(&batch.ID, &batch.UserID, &batch.DefaultCookieID, &batch.Filename, &batch.UploadDir, &batch.LocationJSON,
|
||||
&batch.Status, &batch.TotalCount, &batch.SuccessCount, &batch.FailedCount, &batch.WorkerToken,
|
||||
&batch.LeaseExpiresAt, &batch.CreatedAt, &batch.UpdatedAt); err != nil {
|
||||
return nil, err
|
||||
@@ -165,7 +169,7 @@ func (b *ItemPublishBatches) Recoverable(ctx context.Context, now int64, limit i
|
||||
if limit <= 0 {
|
||||
limit = 20
|
||||
}
|
||||
rows, err := b.DB.QueryContext(ctx, `SELECT id,user_id,default_cookie_id,filename,upload_dir,status,
|
||||
rows, err := b.DB.QueryContext(ctx, `SELECT id,user_id,default_cookie_id,filename,upload_dir,COALESCE(location_json,'{}'),status,
|
||||
total_count,success_count,failed_count,COALESCE(worker_token,''),COALESCE(lease_expires_at,0),created_at,updated_at
|
||||
FROM item_publish_batches b
|
||||
WHERE (b.status IN ('running','canceling') AND (b.lease_expires_at=0 OR b.lease_expires_at<?))
|
||||
@@ -179,7 +183,7 @@ func (b *ItemPublishBatches) Recoverable(ctx context.Context, now int64, limit i
|
||||
var out []ItemPublishBatch
|
||||
for rows.Next() {
|
||||
var batch ItemPublishBatch
|
||||
if err := rows.Scan(&batch.ID, &batch.UserID, &batch.DefaultCookieID, &batch.Filename, &batch.UploadDir,
|
||||
if err := rows.Scan(&batch.ID, &batch.UserID, &batch.DefaultCookieID, &batch.Filename, &batch.UploadDir, &batch.LocationJSON,
|
||||
&batch.Status, &batch.TotalCount, &batch.SuccessCount, &batch.FailedCount, &batch.WorkerToken,
|
||||
&batch.LeaseExpiresAt, &batch.CreatedAt, &batch.UpdatedAt); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -128,7 +128,7 @@ func TestLatestMigrationsDownUpSQLite(t *testing.T) {
|
||||
}
|
||||
goose.SetBaseFS(migrationsFS)
|
||||
// 依次回滚最新版本到 13,再整体升级。
|
||||
for i := 0; i < 13; i++ {
|
||||
for i := 0; i < 14; i++ {
|
||||
if err := goose.Down(d, "migrations/sqlite"); err != nil {
|
||||
t.Fatalf("down migration #%d: %v", i+1, err)
|
||||
}
|
||||
@@ -151,6 +151,9 @@ func TestLatestMigrationsDownUpSQLite(t *testing.T) {
|
||||
if columnExists(t, d, "item_info", "deleted_at") || columnExists(t, d, "automation_rules", "deleted_at") {
|
||||
t.Fatal("soft-delete columns should be removed after migration 26 down")
|
||||
}
|
||||
if columnExists(t, d, "item_publish_batches", "location_json") {
|
||||
t.Fatal("item_publish_batches.location_json should be removed after migration 27 down")
|
||||
}
|
||||
for _, table := range []string{"account_task_settings", "account_task_runs", "chat_sessions", "chat_messages"} {
|
||||
if tableExists(t, d, table) {
|
||||
t.Fatalf("table should be removed after migration 24 down: %s", table)
|
||||
@@ -174,6 +177,7 @@ func TestLatestMigrationsDownUpSQLite(t *testing.T) {
|
||||
{"default_reply_records", "text_sent"},
|
||||
{"account_tokens", "cookie_fingerprint"},
|
||||
{"item_publish_batch_rows", "category_json"},
|
||||
{"item_publish_batches", "location_json"},
|
||||
{"account_task_settings", "auto_rate_enabled"},
|
||||
{"account_task_runs", "run_key"},
|
||||
{"chat_sessions", "unread_count"},
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE item_publish_batches ADD COLUMN location_json LONGTEXT NULL;
|
||||
UPDATE item_publish_batches SET location_json='{}' WHERE location_json IS NULL;
|
||||
ALTER TABLE item_publish_batches MODIFY COLUMN location_json LONGTEXT NOT NULL;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE item_publish_batches DROP COLUMN location_json;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE item_publish_batches ADD COLUMN location_json TEXT NOT NULL DEFAULT '{}';
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE item_publish_batches DROP COLUMN location_json;
|
||||
@@ -0,0 +1,5 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE item_publish_batches ADD COLUMN location_json TEXT NOT NULL DEFAULT '{}';
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE item_publish_batches DROP COLUMN location_json;
|
||||
@@ -771,7 +771,7 @@ func TestMultiDB_LatestMigrationsDownUp(t *testing.T) {
|
||||
t.Fatalf("set goose dialect: %v", err)
|
||||
}
|
||||
goose.SetBaseFS(migrationsFS)
|
||||
for i := 0; i < 13; i++ {
|
||||
for i := 0; i < 14; i++ {
|
||||
if err := goose.Down(tg.store.DB, "migrations/"+subdir); err != nil {
|
||||
t.Fatalf("migration down #%d: %v", i+1, err)
|
||||
}
|
||||
@@ -791,6 +791,9 @@ func TestMultiDB_LatestMigrationsDownUp(t *testing.T) {
|
||||
if columnExistsForDialect(t, tg.store.DB, tg.dialect, "item_publish_batch_rows", "category_json") {
|
||||
t.Fatal("item_publish_batch_rows.category_json should be removed after down")
|
||||
}
|
||||
if columnExistsForDialect(t, tg.store.DB, tg.dialect, "item_publish_batches", "location_json") {
|
||||
t.Fatal("item_publish_batches.location_json should be removed after down")
|
||||
}
|
||||
for _, table := range []string{"account_task_settings", "account_task_runs", "chat_sessions", "chat_messages"} {
|
||||
if tableExistsForDialect(t, tg.store.DB, tg.dialect, table) {
|
||||
t.Fatalf("table should be removed after migration 24 down: %s", table)
|
||||
@@ -816,6 +819,7 @@ func TestMultiDB_LatestMigrationsDownUp(t *testing.T) {
|
||||
{"automation_runs", "action_started"},
|
||||
{"account_tokens", "cookie_fingerprint"},
|
||||
{"item_publish_batch_rows", "category_json"},
|
||||
{"item_publish_batches", "location_json"},
|
||||
{"item_info", "deleted_at"},
|
||||
{"automation_rules", "deleted_at"},
|
||||
{"account_task_settings", "auto_rate_enabled"},
|
||||
|
||||
@@ -23,6 +23,7 @@ func (s *Server) mountItemsReal(r chi.Router) {
|
||||
r.Post("/items/get-all-from-account", s.syncItemsFromAccount)
|
||||
r.Post("/items/get-by-page", s.syncItemsPageFromAccount)
|
||||
r.Post("/items/publish", s.publishItem)
|
||||
r.Post("/items/publish-locations", s.publishLocations)
|
||||
r.Post("/items/publish-categories/recommend", s.recommendItemPublishCategory)
|
||||
r.Post("/items/publish-batches/preview", s.previewItemPublishBatch)
|
||||
r.Post("/items/publish-batches", s.startItemPublishBatch)
|
||||
@@ -41,6 +42,57 @@ func (s *Server) mountItemsReal(r chi.Router) {
|
||||
r.Put("/items/{cookie_id}/{item_id}/multi-quantity-delivery", s.setItemMultiQuantity)
|
||||
}
|
||||
|
||||
func (s *Server) publishLocations(w http.ResponseWriter, r *http.Request) {
|
||||
var req struct {
|
||||
CookieID string `json:"cookie_id"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
}
|
||||
if err := decodeJSON(r, &req); err != nil || strings.TrimSpace(req.CookieID) == "" {
|
||||
writeErr(w, http.StatusBadRequest, "请选择账号并提供当前位置")
|
||||
return
|
||||
}
|
||||
_, userID, ok := s.cookieForCurrentUser(w, r, strings.TrimSpace(req.CookieID))
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
credentialUnlock := s.Store.LockAccountCredentials(req.CookieID)
|
||||
defer credentialUnlock()
|
||||
latest, err := s.Store.Cookies.GetDetails(r.Context(), req.CookieID)
|
||||
if err != nil || latest == nil || latest.UserID != userID || !hasStoredCookieCredential(latest) {
|
||||
writeErr(w, http.StatusConflict, "账号凭证已变化,请重试")
|
||||
return
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(r.Context(), 30*time.Second)
|
||||
defer cancel()
|
||||
mtopCtx, cookieSession := withMTopCookieSnapshot(ctx, latest)
|
||||
locator, ok := s.mtopClient().(interface {
|
||||
PublishLocations(context.Context, string, float64, float64) ([]mtop.PublishLocation, string, error)
|
||||
})
|
||||
if !ok {
|
||||
writeErr(w, http.StatusNotImplemented, "当前客户端不支持查询发货地")
|
||||
return
|
||||
}
|
||||
locations, updated, callErr := locator.PublishLocations(mtopCtx, latest.Value, req.Longitude, req.Latitude)
|
||||
value, changed, handled, persistErr := s.persistMTopCookieSessionLocked(r.Context(), latest, cookieSession)
|
||||
if persistErr != nil {
|
||||
writeErr(w, http.StatusInternalServerError, "保存账号登录状态失败")
|
||||
return
|
||||
}
|
||||
if !handled && updated != "" && updated != latest.Value {
|
||||
if err := s.Store.Cookies.UpdateValueOwned(r.Context(), req.CookieID, updated, userID); err == nil {
|
||||
s.updateRunningCookie(r.Context(), req.CookieID, updated)
|
||||
}
|
||||
} else if handled && changed {
|
||||
s.updateRunningCookie(r.Context(), req.CookieID, value)
|
||||
}
|
||||
if callErr != nil {
|
||||
writeErr(w, http.StatusBadGateway, callErr.Error())
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, map[string]any{"success": true, "locations": locations})
|
||||
}
|
||||
|
||||
func (s *Server) publishItem(w http.ResponseWriter, r *http.Request) {
|
||||
// 最多 9 张 10 MiB 图片,额外预留 multipart 元数据空间。
|
||||
r.Body = http.MaxBytesReader(w, r.Body, maxItemPublishBytes)
|
||||
@@ -89,6 +141,15 @@ func (s *Server) publishItem(w http.ResponseWriter, r *http.Request) {
|
||||
writeErr(w, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
var location mtop.PublishLocation
|
||||
var selectedLocation *mtop.PublishLocation
|
||||
if rawLocation := strings.TrimSpace(r.FormValue("location")); rawLocation != "" {
|
||||
if err := json.Unmarshal([]byte(rawLocation), &location); err != nil {
|
||||
writeErr(w, http.StatusBadRequest, "发货地格式错误,请重新定位")
|
||||
return
|
||||
}
|
||||
selectedLocation = &location
|
||||
}
|
||||
credentialUnlock := s.Store.LockAccountCredentials(cookieID)
|
||||
latest, err := s.Store.Cookies.GetDetails(r.Context(), cookieID)
|
||||
if err != nil || latest == nil || latest.UserID != userID || !hasStoredCookieCredential(latest) {
|
||||
@@ -110,6 +171,7 @@ func (s *Server) publishItem(w http.ResponseWriter, r *http.Request) {
|
||||
PostageMode: postageMode,
|
||||
PostageCents: postageCents,
|
||||
Virtual: true,
|
||||
Location: selectedLocation,
|
||||
Images: images,
|
||||
})
|
||||
runtimeCookie := ""
|
||||
|
||||
@@ -194,6 +194,15 @@ func (s *Server) previewItemPublishBatch(w http.ResponseWriter, r *http.Request)
|
||||
ChannelCatID: strings.TrimSpace(r.FormValue("fallback_channel_category_id")),
|
||||
TBCatID: strings.TrimSpace(r.FormValue("fallback_tb_category_id")),
|
||||
}
|
||||
var batchLocation mtop.PublishLocation
|
||||
locationJSON := strings.TrimSpace(r.FormValue("location"))
|
||||
if locationJSON != "" {
|
||||
if json.Unmarshal([]byte(locationJSON), &batchLocation) != nil {
|
||||
writeErr(w, http.StatusBadRequest, "发货地格式错误,请重新定位")
|
||||
return
|
||||
}
|
||||
}
|
||||
locationBytes, _ := json.Marshal(batchLocation)
|
||||
hasDefaultCategory := fallbackCategory.CatID != "" || fallbackCategory.CatName != "" || fallbackCategory.ChannelCatID != "" || fallbackCategory.TBCatID != ""
|
||||
if hasDefaultCategory && (fallbackCategory.CatID == "" || fallbackCategory.CatName == "" || fallbackCategory.ChannelCatID == "") {
|
||||
writeErr(w, http.StatusBadRequest, "默认类目信息不完整,请重新通过关键词获取")
|
||||
@@ -331,6 +340,7 @@ func (s *Server) previewItemPublishBatch(w http.ResponseWriter, r *http.Request)
|
||||
DefaultCookieID: defaultCookieID,
|
||||
Filename: sourceName,
|
||||
UploadDir: uploadDir,
|
||||
LocationJSON: string(locationBytes),
|
||||
Status: "preview",
|
||||
}, rows); err != nil {
|
||||
writeErr(w, http.StatusInternalServerError, "保存预检结果失败")
|
||||
@@ -854,6 +864,18 @@ func (s *Server) publishBatchRow(ctx context.Context, userID int64, client mtop.
|
||||
if err != nil {
|
||||
return errors.New("批量任务不存在")
|
||||
}
|
||||
var location mtop.PublishLocation
|
||||
locationJSON := strings.TrimSpace(batch.LocationJSON)
|
||||
if locationJSON == "" {
|
||||
locationJSON = "{}"
|
||||
}
|
||||
if err := json.Unmarshal([]byte(locationJSON), &location); err != nil {
|
||||
return errors.New("批量任务发货地配置损坏,请重新创建任务")
|
||||
}
|
||||
var selectedLocation *mtop.PublishLocation
|
||||
if strings.TrimSpace(location.DivisionID) != "" {
|
||||
selectedLocation = &location
|
||||
}
|
||||
cookieValue, err := s.cookieValueForUser(ctx, userID, row.CookieID)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -919,6 +941,7 @@ func (s *Server) publishBatchRow(ctx context.Context, userID int64, client mtop.
|
||||
PostageMode: row.PostageMode,
|
||||
PostageCents: postageCents,
|
||||
Virtual: true,
|
||||
Location: selectedLocation,
|
||||
PreferredCategory: preferredCategory,
|
||||
Images: images,
|
||||
})
|
||||
@@ -1308,6 +1331,10 @@ func (s *Server) validatePublishAutomation(ctx context.Context, userID int64, cf
|
||||
}
|
||||
|
||||
func publishBatchToMap(batch *db.ItemPublishBatch, rows []db.ItemPublishBatchRow) map[string]any {
|
||||
locationJSON := strings.TrimSpace(batch.LocationJSON)
|
||||
if locationJSON == "" {
|
||||
locationJSON = "{}"
|
||||
}
|
||||
outRows := make([]map[string]any, 0, len(rows))
|
||||
pending := 0
|
||||
running := 0
|
||||
@@ -1343,6 +1370,7 @@ func publishBatchToMap(batch *db.ItemPublishBatch, rows []db.ItemPublishBatchRow
|
||||
"id": batch.ID, "status": batch.Status, "filename": batch.Filename,
|
||||
"total": batch.TotalCount, "success": batch.SuccessCount, "failed": batch.FailedCount,
|
||||
"pending": pending, "running": running, "retryable": retryable, "rows": outRows,
|
||||
"location": json.RawMessage(locationJSON),
|
||||
"created_at": batch.CreatedAt, "updated_at": batch.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
+80
-75
@@ -1,4 +1,4 @@
|
||||
import{r as s}from"./react-vendor-C_od1ZSF.js";/**
|
||||
import{r as y}from"./react-vendor-C_od1ZSF.js";/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
@@ -13,12 +13,12 @@ import{r as s}from"./react-vendor-C_od1ZSF.js";/**
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const m=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:h,iconNode:p,...d},i)=>s.createElement("svg",{ref:i,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",y),...!h&&!x(d)&&{"aria-hidden":"true"},...d},[...p.map(([r,l])=>s.createElement(r,l)),...Array.isArray(h)?h:[h]]));/**
|
||||
*/const m=y.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:s="",children:h,iconNode:i,...d},p)=>y.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",s),...!h&&!x(d)&&{"aria-hidden":"true"},...d},[...i.map(([r,l])=>y.createElement(r,l)),...Array.isArray(h)?h:[h]]));/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const e=(t,a)=>{const c=s.forwardRef(({className:o,...y},h)=>s.createElement(m,{ref:h,iconNode:a,className:k(`lucide-${M(n(t))}`,`lucide-${t}`,o),...y}));return c.displayName=n(t),c};/**
|
||||
*/const e=(t,a)=>{const c=y.forwardRef(({className:o,...s},h)=>y.createElement(m,{ref:h,iconNode:a,className:k(`lucide-${M(n(t))}`,`lucide-${t}`,o),...s}));return c.displayName=n(t),c};/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
@@ -38,67 +38,67 @@ import{r as s}from"./react-vendor-C_od1ZSF.js";/**
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const N=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],F1=e("bot",N);/**
|
||||
*/const N=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],K1=e("bot",N);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const f=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],K1=e("box",f);/**
|
||||
*/const f=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Q1=e("box",f);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const w=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Q1=e("calendar-clock",w);/**
|
||||
*/const w=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],G1=e("calendar-clock",w);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const b=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],G1=e("check-check",b);/**
|
||||
*/const b=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],J1=e("check-check",b);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const z=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],J1=e("check",z);/**
|
||||
*/const z=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],X1=e("check",z);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],X1=e("chevron-down",q);/**
|
||||
*/const q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Y1=e("chevron-down",q);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const C=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Y1=e("chevron-left",C);/**
|
||||
*/const C=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],e2=e("chevron-left",C);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],e2=e("chevron-right",A);/**
|
||||
*/const j=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],a2=e("chevron-right",j);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],a2=e("circle-alert",j);/**
|
||||
*/const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],t2=e("circle-alert",A);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],t2=e("circle-check",H);/**
|
||||
*/const H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],c2=e("circle-check",H);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const V=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],c2=e("circle-dashed",V);/**
|
||||
*/const V=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],o2=e("circle-dashed",V);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const L=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],o2=e("clock-3",L);/**
|
||||
*/const L=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h2=e("clock-3",L);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const P=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h2=e("clock",P);/**
|
||||
*/const P=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],y2=e("clock",P);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
@@ -108,22 +108,22 @@ import{r as s}from"./react-vendor-C_od1ZSF.js";/**
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const U=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],y2=e("code",U);/**
|
||||
*/const U=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],d2=e("code",U);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const E=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],d2=e("copy",E);/**
|
||||
*/const E=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],n2=e("copy",E);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const B=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],n2=e("credit-card",B);/**
|
||||
*/const B=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],k2=e("credit-card",B);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const D=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],k2=e("database",D);/**
|
||||
*/const D=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],i2=e("database",D);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
@@ -133,274 +133,279 @@ import{r as s}from"./react-vendor-C_od1ZSF.js";/**
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const T=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],i2=e("external-link",T);/**
|
||||
*/const T=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],r2=e("external-link",T);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const W=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],r2=e("eye-off",W);/**
|
||||
*/const W=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],l2=e("eye-off",W);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const I=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],l2=e("eye",I);/**
|
||||
*/const F=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],M2=e("eye",F);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const O=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],M2=e("file-down",O);/**
|
||||
*/const I=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],_2=e("file-down",I);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Z=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_2=e("file-text",Z);/**
|
||||
*/const O=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],x2=e("file-text",O);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const F=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],x2=e("funnel",F);/**
|
||||
*/const Z=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],v2=e("funnel",Z);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const K=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],v2=e("gift",K);/**
|
||||
*/const K=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],m2=e("gift",K);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Q=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],m2=e("image-plus",Q);/**
|
||||
*/const Q=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],g2=e("image-plus",Q);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const G=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],g2=e("image",G);/**
|
||||
*/const G=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],u2=e("image",G);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const J=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],u2=e("key",J);/**
|
||||
*/const J=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],$2=e("key",J);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const X=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],$2=e("layers",X);/**
|
||||
*/const X=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],N2=e("layers",X);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const Y=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],N2=e("layout-dashboard",Y);/**
|
||||
*/const Y=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],f2=e("layout-dashboard",Y);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const e1=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],f2=e("link-2",e1);/**
|
||||
*/const e1=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],w2=e("link-2",e1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const a1=[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 19H3",key:"zzsher"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]],w2=e("list-plus",a1);/**
|
||||
*/const a1=[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 19H3",key:"zzsher"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]],b2=e("list-plus",a1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const t1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],b2=e("loader-circle",t1);/**
|
||||
*/const t1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],z2=e("loader-circle",t1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const c1=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],z2=e("lock-keyhole",c1);/**
|
||||
*/const c1=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],q2=e("locate-fixed",c1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const o1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],q2=e("lock",o1);/**
|
||||
*/const o1=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],C2=e("lock-keyhole",o1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const h1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],C2=e("log-out",h1);/**
|
||||
*/const h1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],j2=e("lock",h1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const s1=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],A2=e("mail",s1);/**
|
||||
*/const y1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],A2=e("log-out",y1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const y1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}]],j2=e("message-circle-more",y1);/**
|
||||
*/const s1=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],H2=e("mail",s1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const d1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],H2=e("message-circle",d1);/**
|
||||
*/const d1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}]],V2=e("message-circle-more",d1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const n1=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],V2=e("message-square-quote",n1);/**
|
||||
*/const n1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],L2=e("message-circle",n1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const k1=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],L2=e("package-check",k1);/**
|
||||
*/const k1=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],P2=e("message-square-quote",k1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const p1=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],P2=e("package-plus",p1);/**
|
||||
*/const i1=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],S2=e("package-check",i1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const i1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],S2=e("package",i1);/**
|
||||
*/const p1=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],U2=e("package-plus",p1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const r1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],U2=e("pen",r1);/**
|
||||
*/const r1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],E2=e("package",r1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const l1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],E2=e("play",l1);/**
|
||||
*/const l1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],B2=e("pen",l1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const M1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],B2=e("plus",M1);/**
|
||||
*/const M1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],D2=e("play",M1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const _1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],D2=e("power",_1);/**
|
||||
*/const _1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],R2=e("plus",_1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const x1=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],R2=e("qr-code",x1);/**
|
||||
*/const x1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],T2=e("power",x1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const v1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],T2=e("refresh-cw",v1);/**
|
||||
*/const v1=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],W2=e("qr-code",v1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const m1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],W2=e("save",m1);/**
|
||||
*/const m1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],F2=e("refresh-cw",m1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const g1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],I2=e("search",g1);/**
|
||||
*/const g1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],I2=e("save",g1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const u1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],O2=e("send",u1);/**
|
||||
*/const u1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],O2=e("search",u1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const $1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Z2=e("settings",$1);/**
|
||||
*/const $1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Z2=e("send",$1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const N1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],F2=e("shield-check",N1);/**
|
||||
*/const N1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],K2=e("settings",N1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const f1=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],K2=e("shopping-bag",f1);/**
|
||||
*/const f1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q2=e("shield-check",f1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const w1=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],Q2=e("shopping-cart",w1);/**
|
||||
*/const w1=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],G2=e("shopping-bag",w1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const b1=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],G2=e("sliders-horizontal",b1);/**
|
||||
*/const b1=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],J2=e("shopping-cart",b1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const z1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],J2=e("smile",z1);/**
|
||||
*/const z1=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],X2=e("sliders-horizontal",z1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const q1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],X2=e("sparkles",q1);/**
|
||||
*/const q1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],Y2=e("smile",q1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const C1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Y2=e("square-pen",C1);/**
|
||||
*/const C1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],e0=e("sparkles",C1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const A1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],e0=e("trash-2",A1);/**
|
||||
*/const j1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],a0=e("square-pen",j1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const j1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],a0=e("trending-up",j1);/**
|
||||
*/const A1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],t0=e("trash-2",A1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const H1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],t0=e("triangle-alert",H1);/**
|
||||
*/const H1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],c0=e("trending-up",H1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const V1=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],c0=e("truck",V1);/**
|
||||
*/const V1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o0=e("triangle-alert",V1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const L1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],o0=e("upload",L1);/**
|
||||
*/const L1=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],h0=e("truck",L1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const P1=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],h0=e("user-round",P1);/**
|
||||
*/const P1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],y0=e("upload",P1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const S1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],s0=e("user",S1);/**
|
||||
*/const S1=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],s0=e("user-round",S1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const U1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],y0=e("users",U1);/**
|
||||
*/const U1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],d0=e("user",U1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const E1=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],d0=e("webhook",E1);/**
|
||||
*/const E1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],n0=e("users",E1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const B1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],n0=e("wifi-off",B1);/**
|
||||
*/const B1=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],k0=e("webhook",B1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const D1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],k0=e("wifi",D1);/**
|
||||
*/const D1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],i0=e("wifi-off",D1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const R1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],p0=e("x",R1);/**
|
||||
*/const R1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],p0=e("wifi",R1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const T1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],i0=e("zap",T1);export{x2 as $,I1 as A,K1 as B,n2 as C,p2 as D,i2 as E,c0 as F,I2 as G,Y2 as H,o0 as I,G2 as J,u2 as K,N2 as L,j2 as M,d2 as N,_2 as O,S2 as P,R2 as Q,T2 as R,K2 as S,a0 as T,y0 as U,g2 as V,w2 as W,p0 as X,M2 as Y,i0 as Z,y2 as _,Z1 as a,P2 as a0,s2 as a1,t2 as a2,c2 as a3,f2 as a4,O1 as a5,k2 as a6,X1 as a7,F2 as a8,z2 as a9,h0 as aa,o2 as ab,v2 as ac,$2 as ad,O2 as ae,A2 as af,d0 as ag,k0 as ah,n0 as ai,G1 as aj,J2 as ak,m2 as al,q2 as am,Z2 as b,e2 as c,Y1 as d,C2 as e,a2 as f,Q2 as g,L2 as h,t0 as i,b2 as j,V2 as k,E2 as l,X2 as m,Q1 as n,W2 as o,s0 as p,J1 as q,F1 as r,H2 as s,h2 as t,U2 as u,D2 as v,e0 as w,r2 as x,l2 as y,B2 as z};
|
||||
*/const T1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],r0=e("x",T1);/**
|
||||
* @license lucide-react v0.562.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/const W1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],l0=e("zap",W1);export{v2 as $,I1 as A,Q1 as B,k2 as C,p2 as D,r2 as E,h0 as F,O2 as G,a0 as H,y0 as I,X2 as J,$2 as K,f2 as L,V2 as M,n2 as N,x2 as O,E2 as P,W2 as Q,F2 as R,G2 as S,c0 as T,n0 as U,u2 as V,b2 as W,r0 as X,_2 as Y,l0 as Z,d2 as _,Z1 as a,U2 as a0,s2 as a1,c2 as a2,o2 as a3,w2 as a4,O1 as a5,q2 as a6,i2 as a7,Y1 as a8,Q2 as a9,C2 as aa,s0 as ab,h2 as ac,m2 as ad,N2 as ae,Z2 as af,H2 as ag,k0 as ah,p0 as ai,i0 as aj,J1 as ak,Y2 as al,g2 as am,j2 as an,K2 as b,a2 as c,e2 as d,A2 as e,t2 as f,J2 as g,S2 as h,o0 as i,z2 as j,P2 as k,D2 as l,e0 as m,G1 as n,I2 as o,d0 as p,X1 as q,K1 as r,L2 as s,y2 as t,B2 as u,T2 as v,t0 as w,l2 as x,M2 as y,R2 as z};
|
||||
@@ -0,0 +1,19 @@
|
||||
import{j as e,r,b as Te,c as la,d as $a}from"./react-vendor-C_od1ZSF.js";import{L as Pa,U as ra,M as ts,C as ss,B as na,S as ia,Z as as,a as yt,b as us,c as hs,d as gs,e as Da,f as tt,A as ks,D as Ea,g as Cs,P as oa,h as Pt,E as ca,T as Ta,i as Fa,j as $e,X as De,k as Ma,l as qa,m as bs,n as da,o as Qe,Q as Qt,p as ct,q as Ve,r as ft,s as $t,t as Ss,R as Me,u as xa,v as Ba,w as ze,K as za,x as ot,y as et,z as He,F as Ls,G as _t,H as jt,I as Rt,J as ma,N as Ua,O as Os,V as Is,W as Wa,Y as Ja,_ as Va,$ as Qa,a0 as Gt,a1 as Et,a2 as ls,a3 as Ga,a4 as Ka,a5 as rs,a6 as As,a7 as Ha,a8 as Za,a9 as ns,aa as Rs,ab as Ut,ac as pa,ad as Ya,ae as Xa,af as Jt,ag as ua,ah as el,ai as tl,aj as sl,ak as al,al as ll,am as rl,an as nl}from"./icons-vendor-DF3hof7q.js";import{R as Tt,B as il,X as $s,Y as Ps,T as Ft,a as ol,C as Kt,A as cl,b as dl,c as xl,P as Ds,d as Es,L as ml}from"./charts-vendor-BxxJOyEX.js";import"./vendor-D-Edl3pr.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))o(x);new MutationObserver(x=>{for(const k of x)if(k.type==="childList")for(const C of k.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&o(C)}).observe(document,{childList:!0,subtree:!0});function l(x){const k={};return x.integrity&&(k.integrity=x.integrity),x.referrerPolicy&&(k.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?k.credentials="include":x.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function o(x){if(x.ep)return;x.ep=!0;const k=l(x);fetch(x.href,k)}})();const pl=({className:t="w-full h-full text-white"})=>e.jsx("svg",{className:t,viewBox:"0 0 256 256","aria-hidden":"true",children:e.jsx("g",{stroke:"none",fill:"none",fillRule:"evenodd",children:e.jsx("path",{d:"M121.73,57.0003 C138.901,57.0003 154.897,65.5053 164.52,79.7493 C166.029,81.9823 165.441,85.0143 163.209,86.5233 C160.976,88.0323 157.944,87.4433 156.436,85.2113 C148.629,73.6553 135.655,66.7563 121.73,66.7563 C104.076789,66.7563 88.6201962,77.6596007 82.5581814,93.8184545 C83.9120803,93.7133631 85.2800264,93.66 86.6602,93.66 C111.537727,93.66 132.442611,110.997575 137.926382,134.224255 L162.5425,92.109 L162.615557,91.9879406 L162.756884,91.77367 L162.911804,91.5639102 L162.98657,91.4716759 C163.351845,91.025169 163.786059,90.6571744 164.264191,90.3738733 L164.550153,90.2178351 L164.729252,90.1315693 L164.989203,90.021723 L165.230265,89.9354653 L165.542393,89.8445739 C165.666021,89.8126706 165.790834,89.7857324 165.916565,89.7637431 L166.116517,89.7342499 C166.29505,89.7098142 166.475001,89.6957386 166.655596,89.6918808 L166.7539,89.693 C196.8909,89.693 221.4079,114.21 221.4079,144.347 C221.4079,174.482 196.8909,199 166.7539,199 L125.0869,199 C122.3919,199 120.2079,196.815 120.2079,194.122 C120.2079,191.429 122.3919,189.244 125.0869,189.244 L166.7539,189.244 C191.5109,189.244 211.6519,169.104 211.6519,144.347 C211.6519,120.513406 192.985349,100.957891 169.504046,99.5322548 L112.7745,196.584 C111.8995,198.08 110.2965,199 108.5635,199 L86.6602,199 C57.6182,199 33.9902,175.373 33.9902,146.33 C33.9902,122.475163 49.9316132,102.273061 71.7206298,95.817503 L71.9446339,94.967678 C78.0600632,72.5405324 98.33054,57.0003 121.73,57.0003 Z M86.6602,103.417 C62.9972,103.417 43.7462,122.667 43.7462,146.33 C43.7462,169.992 62.9972,189.244 86.6602,189.244 L105.7645,189.244 L129.869462,148.004782 C129.678439,147.482425 129.5742,146.918336 129.5742,146.33 C129.5742,122.667 110.3232,103.417 86.6602,103.417 Z",fill:"currentColor"})})}),is=({sizeClass:t="w-12 h-12",logoClassName:s="w-full h-full text-white"})=>e.jsxs("div",{className:"relative z-10 flex items-center justify-center",children:[e.jsx("div",{className:"absolute -inset-1 bg-blue-500/20 rounded-xl blur opacity-25"}),e.jsxs("div",{className:`relative ${t} rounded-xl flex items-center justify-center group-hover:scale-105 transition-transform duration-300`,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full",viewBox:"0 0 120 120","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"login-squircle-gradient",x1:"0",y1:"0",x2:"1",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0094f7"}),e.jsx("stop",{offset:"100%",stopColor:"#287efe"})]})}),e.jsx("path",{d:"M 114.00 60.00 L 113.83 71.48 L 113.31 78.16 L 112.44 83.67 L 111.22 88.46 L 109.66 92.71 L 107.75 96.49 L 105.48 99.87 L 102.86 102.86 L 99.87 105.48 L 96.49 107.75 L 92.71 109.66 L 88.46 111.22 L 83.67 112.44 L 78.16 113.31 L 71.48 113.83 L 60.00 114.00 L 48.52 113.83 L 41.84 113.31 L 36.33 112.44 L 31.54 111.22 L 27.29 109.66 L 23.51 107.75 L 20.13 105.48 L 17.14 102.86 L 14.52 99.87 L 12.25 96.49 L 10.34 92.71 L 8.78 88.46 L 7.56 83.67 L 6.69 78.16 L 6.17 71.48 L 6.00 60.00 L 6.17 48.52 L 6.69 41.84 L 7.56 36.33 L 8.78 31.54 L 10.34 27.29 L 12.25 23.51 L 14.52 20.13 L 17.14 17.14 L 20.13 14.52 L 23.51 12.25 L 27.29 10.34 L 31.54 8.78 L 36.33 7.Line truncated
|
||||
|
||||
例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等`,className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none"})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-bold text-blue-900 mb-2 flex items-center gap-2",children:[e.jsx(us,{className:"w-4 h-4"}),"AI如何工作"]}),e.jsxs("ul",{className:"text-xs text-blue-800 space-y-1",children:[e.jsx("li",{children:"• 自动识别买家的砍价请求"}),e.jsx("li",{children:"• 根据设定的策略智能回复"}),e.jsx("li",{children:"• 在合理范围内同意降价或礼貌拒绝"}),e.jsx("li",{children:"• 保持专业友好的沟通风格"})]})]})]}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx("button",{onClick:Je,className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",disabled:V,children:"取消"}),e.jsxs("button",{onClick:Ct,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",disabled:V,children:[V?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(Qe,{className:"w-4 h-4"}),V?"保存中...":"保存"]})]})})]})}),document.body)]})},Kr=t=>({total:Number((t==null?void 0:t.total)||0),success_count:Number((t==null?void 0:t.success_count)||0),failed_count:Number((t==null?void 0:t.failed_count)||0),results:Array.isArray(t==null?void 0:t.results)?t.results.map(s=>({order_id:String((s==null?void 0:s.order_id)||"unknown"),success:(s==null?void 0:s.success)===!0,message:String((s==null?void 0:s.message)||"")})):[]}),Hr=t=>(t==null?void 0:t.results.filter(s=>!s.success))||[],Gs=({status:t})=>{const s={processing:"bg-blue-100 text-blue-800",pending_ship:"bg-[#0094f7] text-white",shipped:"bg-blue-100 text-blue-700",completed:"bg-green-100 text-green-700",cancelled:"bg-gray-100 text-gray-500",refunding:"bg-red-100 text-red-600",unknown:"bg-gray-100 text-gray-500"},l={processing:"处理中",pending_ship:"待发货",shipped:"已发货",completed:"已完成",cancelled:"已取消",refunding:"退款中",unknown:"未知"};return e.jsx("span",{className:`px-3 py-1.5 rounded-lg text-xs font-bold ${s[t]||s.cancelled}`,children:l[t]||t})},Zr=()=>{const[t,s]=r.useState([]),[l,o]=r.useState([]),[x,k]=r.useState([]),[C,R]=r.useState({}),[f,O]=r.useState("all"),[_,Q]=r.useState(""),[Y,me]=r.useState(""),[oe,v]=r.useState(""),F=r.useRef(0),[ce,K]=r.useState(1),[X,z]=r.useState(1),[be,pe]=r.useState(!1),[S,G]=r.useState(!1),[de,M]=r.useState(!1),[J,A]=r.useState(!1),[P,ae]=r.useState(null),[E,le]=r.useState(null),[Se,_e]=r.useState({}),[ue,u]=r.useState(!1),[y,B]=r.useState(""),[T,re]=r.useState(!1),[ge,fe]=r.useState(null),[Ie,ve]=r.useState(null),[c,L]=r.useState(null),[p,d]=r.useState(!1),[b,V]=r.useState(null),[U,H]=r.useState(null),ee=async()=>{const h=++F.current;pe(!0);try{const q=await Ul(_||void 0,f,ce,20,oe);if(h!==F.current)return;s(q.data),z(q.total_pages)}catch(q){console.error("加载订单失败:",q)}finally{h===F.current&&pe(!1)}},ke=(h,q,Ne)=>{if(Ne&&Ne.trim())return Ne;if(C[`${h}:${q}`])return C[`${h}:${q}`];const Oe=l.find(Ue=>{if(Ne&&Ue.item_title){const Ze=Ne.toLowerCase(),Ye=Ue.item_title.toLowerCase();return Ye.includes(Ze)||Ze.includes(Ye)}return!1});return Oe!=null&&Oe.item_title?Oe.item_title:"未知商品"},g=h=>{const q={};h.forEach(Ne=>{Ne.item_id&&(q[`${Ne.cookie_id}:${Ne.item_id}`]=Ne.item_title||Ne.item_id)}),R(q)};r.useEffect(()=>{const h=window.setTimeout(()=>{K(1),v(Y.trim())},300);return()=>window.clearTimeout(h)},[Y]),r.useEffect(()=>{ee()},[_,f,ce,oe]),r.useEffect(()=>{Promise.all([Dt(),Nt()]).then(([h,q])=>{k(h),o(q),g(q)}).catch(h=>{console.error("加载商品列表失败:",h)})},[]);const N=r.useMemo(()=>new Map(x.map(h=>[h.id,h])),[x]),D=h=>{const q=N.get(h),Ne=(q==null?void 0:q.remark)||(q==null?void 0:q.nickname);return Ne?`${Ne} · ${h.slice(0,6)}`:`账号 ${h.slice(0,8)}`},I=h=>{const q=N.get(h);return(q==null?void 0:q.remark)||(q==null?void 0:q.nickname)||"未命名账号"},he=async()=>{pe(!0);try{const h=await Vl(_||void 0,f);await ee(),h!=null&&h.message&&alert(h.message)}catch(h){console.error("同步订单失败:",h),alert((h==null?void 0:h.message)||"同步失败,请重试")}finally{pe(!1)}},W=h=>{B(h),fe(null),u(!0)},ne=async h=>{var q;re(!0),fe(null);try{const Ne=await Gl([y],h),Oe=(q=Ne==null?void 0:Ne.results)==null?void 0:q[0];Oe!=null&&Oe.success?(fe({success:!0,message:Oe.message}),ee()):fe({success:!1,message:(Oe==null?void 0:Oe.message)||"发货失败"})}catch(Ne){fe({success:!1,message:(Ne==null?void 0:Ne.message)||"请求失败"})}finally{re(!1)}},Pe=h=>{ae(h),G(!0)},xe=h=>{le({...h}),M(!0)},Re=async()=>{if(!(!E||!E.order_id))try{const h={};E.status!==void 0&&(h.order_status=E.status),E.buyer_id!==void 0&&(h.buyer_id=E.buyer_id),E.amount!==void 0&&(h.amount=E.amount),E.receiver_name!==void 0&&(h.receiver_name=E.receiver_name),E.receiver_ph
Line truncated
|
||||
VIP-MONTH-002
|
||||
VIP-MONTH-003`,"按行消费的卡密队列","是","0","否","",""],["感谢文案","text","感谢购买,如有问题联系客服~","固定文本","是","0","否","",""],["教程图","image","https://cdn.example.com/tutorial.jpg","图片URL","是","0","否","",""]]].map(U=>U.map(H=>`"${String(H).replace(/"/g,'""')}"`).join(",")).join(`
|
||||
`),d=new Blob(["\uFEFF"+p],{type:"text/csv;charset=utf-8"}),b=URL.createObjectURL(d),V=document.createElement("a");V.href=b,V.download="卡密组批量导入模板.csv",document.body.appendChild(V),V.click(),V.remove(),URL.revokeObjectURL(b)},fe=async()=>{if(F){be(!0),X(null);try{const c=await tr(F);if(X(c),c.created>0){const L=await Ke();s(L)}}catch(c){X({error:(c==null?void 0:c.message)||"上传失败"})}finally{be(!1)}}},Ie=async()=>{if(!(!pe||!G.trim())){be(!0),J(null);try{const c=await sr(pe,G);J({added:c.added}),de("");const L=await Ke();s(L)}catch(c){alert("追加失败:"+((c==null?void 0:c.message)||"未知错误"))}finally{be(!1)}}},ve=()=>{var c;v("create"),ce(null),X(null),S((c=T[0])!=null&&c.id?String(T[0].id):""),de(""),J(null),me(!0)};return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between md:items-end gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-4xl font-extrabold text-gray-900 tracking-tight",children:"卡密库存"}),e.jsx("p",{className:"text-gray-500 mt-2 font-medium",children:"管理自动发货的卡密、链接或图片资源。"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:ve,className:"px-4 py-3 bg-gray-100 hover:bg-gray-200 rounded-2xl font-bold text-gray-700 flex items-center gap-2 transition-colors",children:[e.jsx(Rt,{className:"w-5 h-5"}),"批量导入"]}),e.jsxs("button",{onClick:()=>k(!0),className:"ios-btn-primary flex items-center gap-2 px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 transition-transform hover:scale-105 active:scale-95",children:[e.jsx(He,{className:"w-5 h-5"}),"添加新卡密"]})]})]}),e.jsxs("div",{className:"ios-card rounded-xl overflow-hidden shadow-lg border-0 bg-white",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-gray-50 bg-[#FAFAFA] p-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-3 sm:flex-row",children:[e.jsxs("div",{className:"relative sm:w-48",children:[e.jsx(ma,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsxs("select",{"aria-label":"按卡密类型筛选",value:A,onChange:c=>P(c.target.value),className:"ios-input w-full rounded-xl border-none bg-white py-2.5 pl-10 pr-9 text-sm shadow-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),e.jsx("option",{value:"data",children:"批量卡密"}),e.jsx("option",{value:"text",children:"文本"}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"image",children:"图片"})]})]}),e.jsxs("div",{className:"relative w-full sm:max-w-sm",children:[e.jsx(_t,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"search","aria-label":"按卡密名称搜索",placeholder:"搜索卡密名称...",value:ae,onChange:c=>E(c.target.value),className:"ios-input w-full rounded-xl border-none bg-white py-2.5 pl-10 pr-4 text-sm shadow-sm"})]})]}),e.jsxs("div",{className:"whitespace-nowrap px-1 text-xs font-bold text-gray-400",children:["显示 ",re.length," / ",t.length," 组"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full table-fixed text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-white text-gray-400 text-xs font-bold uppercase tracking-wider border-b border-gray-50",children:[e.jsx("th",{className:"w-[23%] px-5 py-5",children:"卡密名称"}),e.jsx("th",{className:"w-[8%] px-3 py-5",children:"卡密组ID"}),e.jsx("th",{className:"w-[7%] px-2 py-5",children:"类型"}),e.jsx("th",{className:"w-[27%] px-5 py-5",children:"内容/库存"}),e.jsx("th",{className:"w-[19%] px-5 py-5",children:"描述"}),e.jsx("th",{className:"w-[7%] px-2 py-5",children:"状态"}),e.jsx("th",{className:"w-[9%] px-3 py-5 text-right",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-50",children:re.map(c=>{let L="";return c.type==="data"&&c.data_content?L=`库存: ${c.data_content.split(`
|
||||
`).filter(d=>d.trim()).length} 条`:c.type==="text"&&c.text_content?L=c.text_content:c.type==="api"&&c.api_config?L=c.api_config.url:c.type==="image"&&c.image_url&&(L="图片链接"),e.jsxs("tr",{className:"hover:bg-[#FFFDE7]/50 transition-colors group",children:[e.jsx("td",{className:"px-5 py-5 align-middle",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"shrink-0 rounded-xl bg-gray-50 p-2 transition-colors group-hover:bg-white",children:e.jsx(le,{type:c.type})}),e.jsx("span",{className:"line-clamp-3 min-w-0 text-[13px] font-bold leading-5 text-gray-900",title:c.name,children:c.name})]})}),e.jsx("td",{className:"px-3 py-5",children:e.jsxs("button",{onClick:()=>B(c.id),className:"inline-flex max-w-full items-center gap-1 rounded-lg bg-gray-100 px-2 py-1.5 font-mono text-[11px] font-extrabold text-gray-700 transition-colors hover:bg-gray-200",title:"复制卡密组ID,用于批量铺货表格",children:[e.jsx("span",{className:"truncate",children:c.id}),e.jsx(Ua,{className:"h-3 w-3 shrink-0"})]})}),e.jsx("td",{className:"px-2 py-5",children:e.jsx("span",{className:`inline-flex rounded-md px-2 py-1 text-[11px] font-bold ${c.type==="text"?"bg-blue-50 text-blue-600":c.type==="data"?"bg-purple-50 text-purple-600":c.type==="api"?"bg-blue-50 text-blue-600":"bg-pink-50 text-pink-600"}`,children:c.type==="text"?"文本":c.type==="data"?"批量":c.type==="api"?"API":"图片"})}),e.jsx("td",{className:"px-5 py-5",children:e.jsx("span",{className:"line-clamp-3 break-all font-mono text-sm leading-5 text-gray-600",title:L,children:L})}),e.jsx("td",{className:"px-5 py-5",children:e.jsx("span",{className:"block truncate text-sm text-gray-500",title:c.description||"-",children:c.description||"-"})}),e.jsx("td",{className:"px-2 py-5",children:e.jsx("button",{onClick:()=>y(c),className:`w-12 h-8 rounded-full relative transition-colors ${c.enabled?"bg-green-500":"bg-gray-300"}`,children:e.jsx("div",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-sm transition-transform ${c.enabled?"left-5":"left-1"}`})})}),e.jsx("td",{className:"px-3 py-5",children:e.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[e.jsx("button",{onClick:()=>Se(c),className:"rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-black",title:"编辑",children:e.jsx(jt,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>ue(c.id),className:"rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-red-50 hover:text-red-500",children:e.jsx(ze,{className:"h-4 w-4"})})]})})]},c.id)})})]})}),re.length===0&&e.jsxs("div",{className:"py-20 text-center text-gray-400",children:[e.jsx(oa,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),e.jsx("p",{children:t.length===0?"暂无卡密配置,请点击右上角添加。":"没有符合当前筛选条件的卡密组。"})]})]}),l&&C&&Te.createPortal(e.jsx("div",{className:"modal-overlay-centered",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"编辑卡密"}),e.jsx("button",{onClick:()=>o(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors",children:e.jsx(De,{className:"w-5 h-5 text-gray-500"})})]}),e.jsx("div",{className:"modal-body",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:["卡密名称 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:f.name||"",onChange:c=>O({...f,name:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",placeholder:"例如:游戏点卡、会员卡等"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡券类型"}),e.jsxs("select",{value:f.type||"text",onChange:c=>O({...f,type:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[e.jsx("option",{value:"",children:"请选择类型"}),e.jsx("option",{value:"text",children:"固定文字"}),e.jsx("option",{value:"data",children:"批量数据"}),(C==null?void 0:C.type)==="api"&&e.jsx("option",{value:"api",children:"API接口(仅保留现有配置)"}),e.jsx("option",{value:"image",children:"图片"})]})]})]}),f.type==="api"&&e.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 space-y-4 bg-gray-50",children:[e.jsx("h3",{className:"font-bold text-gray-900",children:"API 配置"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"API 地址"}),e.jsx("input",{type:"url",value:f.api_url||"",onChange:c=>O({...f,api_url:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://api.example.com/get-card"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsLine truncated
|
||||
卡号1:密码1
|
||||
卡号2:密码2
|
||||
或者
|
||||
兑换码1
|
||||
兑换码2`}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"支持格式:卡号:密码 或 单独的兑换码"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",e.jsx("span",{className:"font-bold text-blue-600",children:f.data_content?f.data_content.split(`
|
||||
`).filter(c=>c.trim()).length:0})," 条"]})]})]}),f.type==="image"&&e.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 bg-gray-50",children:[e.jsx("h3",{className:"font-bold text-gray-900 mb-3",children:"图片配置"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片 URL"}),e.jsx("input",{type:"url",value:f.image_url||"",onChange:c=>O({...f,image_url:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://example.com/image.png"}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"输入图片卡密的 URL 地址"})]}),f.image_url&&e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片预览"}),e.jsx("img",{src:f.image_url,alt:"预览",className:"max-w-full max-h-48 rounded-xl border border-gray-200",onError:c=>{c.currentTarget.src="https://via.placeholder.com/400x200?text=图片加载失败"}})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"延时发货时间(秒)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",value:f.delay_seconds||0,onChange:c=>O({...f,delay_seconds:parseInt(c.target.value)||0}),className:"flex-1 ios-input px-4 py-3 rounded-xl",min:"0",max:"3600",placeholder:"0"}),e.jsx("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:"秒"})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"0表示立即发货,最大3600秒(1小时)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"备注信息"}),e.jsx("textarea",{value:f.description||"",onChange:c=>O({...f,description:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none",placeholder:"可选的备注信息"})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-xl",children:[e.jsx("span",{className:"font-bold text-gray-900",children:"启用状态"}),e.jsx("button",{type:"button",onClick:()=>O({...f,enabled:!f.enabled}),className:`w-14 h-8 rounded-full transition-colors duration-300 relative ${f.enabled?"bg-[#0094f7]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 block ${f.enabled?"translate-x-7":"translate-x-1"}`})})]})]})}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx("button",{onClick:()=>o(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),e.jsxs("button",{onClick:_e,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[e.jsx(Qe,{className:"w-4 h-4"}),"保存更改"]})]})})]})}),document.body),x&&Te.createPortal(e.jsx("div",{className:"modal-overlay-centered",children:e.jsxs("div",{className:"modal-container",style:{maxWidth:"780px"},children:[e.jsxs("div",{className:"modal-header flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"添加新卡密"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"选择交付方式并录入自动发货内容"})]}),e.jsx("button",{onClick:()=>k(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors flex-shrink-0",title:"关闭",children:e.jsx(De,{className:"w-5 h-5 text-gray-500"})})]}),e.jsx("div",{className:"modal-body",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡密名称"}),e.jsx("input",{type:"text",value:_.name,onChange:c=>Q({..._,name:c.target.value}),placeholder:"例如:VIP会员卡密",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"类型"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>Q({..._,type:"data",content:""}),className:`p-3 rounded-xl font-bold transition-all ${_.type==="data"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[e.jsx(ss,{className:"w-5 h-5 mx-auto mb-1"}),"批量库存"]}),e.jsxs("button",{type:"button",onClick:()=>Q({..._,type:"text",content:""}),className:`p-3 rounded-xl font-bold transition-all ${_.type==="text"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600"}`,children:[e.jsx(Os,{className:"w-5 h-5 mx-auto mb-1"}),"文本"]}),e.jsxs("button",{type:"button",onClick:()=>Q({..._,type:"image",content:""}),className:`p-3 rounded-xl font-bold transition-all ${_.type==="image"?"bg-[#0094f7] text-white":"bg-gray-100 text-grayLine truncated
|
||||
CODE-789012
|
||||
...`:"请输入每次发货时发送的固定文字"}),_.type==="data"&&e.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",e.jsx("span",{className:"font-bold text-[#0094f7]",children:_.content.split(`
|
||||
`).filter(c=>c.trim()).length})," 条"]})]}),_.type==="api"&&e.jsxs("div",{className:"border-t border-gray-100 pt-5 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求方法"}),e.jsxs("select",{value:_.api_method,onChange:c=>Q({..._,api_method:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[e.jsx("option",{value:"GET",children:"GET"}),e.jsx("option",{value:"POST",children:"POST"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"超时时间(秒)"}),e.jsx("input",{type:"number",min:"1",max:"60",value:_.api_timeout,onChange:c=>Q({..._,api_timeout:parseInt(c.target.value)||10}),className:"w-full ios-input px-4 py-3 rounded-xl"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求头(JSON)"}),e.jsx("textarea",{value:_.api_headers,onChange:c=>Q({..._,api_headers:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"Authorization":"Bearer token"}'})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求参数(JSON)"}),e.jsx("textarea",{value:_.api_params,onChange:c=>Q({..._,api_params:c.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"order_id":"{order_id}"}'})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_180px] gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"描述"}),e.jsx("input",{value:_.description,onChange:c=>Q({..._,description:c.target.value}),placeholder:"卡密用途描述(可选)",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"延时发货(秒)"}),e.jsx("input",{type:"number",value:_.delay_seconds,onChange:c=>Q({..._,delay_seconds:parseInt(c.target.value)||0}),className:"w-full ios-input px-4 py-3 rounded-xl",min:"0",max:"3600"})]})]})]})}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx("button",{onClick:()=>k(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),e.jsxs("button",{onClick:u,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[e.jsx(He,{className:"w-4 h-4"}),"添加卡密"]})]})})]})}),document.body),Y&&Te.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",style:{maxWidth:"40rem"},children:[e.jsxs("div",{className:"px-6 py-5 border-b border-gray-100 flex items-center justify-between",children:[e.jsx("h3",{className:"text-xl font-extrabold text-gray-900",children:"批量导入卡密"}),e.jsx("button",{onClick:()=>me(!1),className:"w-10 h-10 rounded-2xl bg-gray-100 hover:bg-gray-200 flex items-center justify-center",children:e.jsx(De,{className:"w-5 h-5 text-gray-600"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-5",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 p-2 bg-gray-100/50 rounded-2xl",children:[e.jsxs("button",{onClick:()=>v("create"),className:`flex-1 inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl text-sm font-bold transition-all ${oe==="create"?"bg-[#0094f7] text-white shadow-md":"bg-white text-gray-600 hover:bg-gray-50"}`,children:[e.jsx(Wa,{className:"w-4 h-4"}),"批量创建卡密组"]}),e.jsxs("button",{onClick:()=>v("append"),className:`flex-1 inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl text-sm font-bold transition-all ${oe==="append"?"bg-[#0094f7] text-white shadow-md":"bg-white text-gray-600 hover:bg-gray-50"}`,children:[e.jsx(Rt,{className:"w-4 h-4"}),"往单个组充卡密"]})]}),oe==="create"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-xl bg-blue-50 border border-blue-100 p-4 text-xs text-blue-900 leading-5",children:["上传表格,每行一个卡密组。表头:",e.jsx("code",{className:"bg-blue-100/70 px-1.5 py-0.5 rounded",children:"名称,类型,内容,描述,启用,延迟秒,多规格,规格名,规格值"}),'。 类型填 text/data/image;data 类型的"内容"按行存卡密(CSV 单元格内换行需用引号包裹)。']}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:ge,className:"px-4 py-2.5 bg-gray-100 hover:bg-gray-200 rounded-xl font-bold text-gray-700 flex items-center gap-2 text
Line truncated
|
||||
VIP-002
|
||||
VIP-003`,className:"w-full ios-input px-4 py-3 rounded-xl text-sm font-mono h-40 resize-y"}),e.jsx("p",{className:"text-xs text-gray-500",children:"一行一个卡密号,空行自动忽略。会追加到该组现有库存末尾。"})]}),M&&e.jsxs("div",{className:"rounded-xl bg-green-50 border border-green-200 p-3 text-sm text-green-700 font-bold",children:["已追加 ",M.added," 个卡密"]})]})})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-100 flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>me(!1),className:"px-5 py-2.5 rounded-xl bg-gray-100 hover:bg-gray-200 font-bold text-gray-700 transition-colors",children:"关闭"}),oe==="create"?e.jsxs("button",{onClick:fe,disabled:!F||z,className:"ios-btn-primary px-6 py-2.5 rounded-xl font-bold flex items-center gap-2 disabled:opacity-50",children:[z?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(Rt,{className:"w-4 h-4"}),z?"处理中...":"上传创建"]}):e.jsxs("button",{onClick:Ie,disabled:!pe||!G.trim()||z||T.length===0,className:"ios-btn-primary px-6 py-2.5 rounded-xl font-bold flex items-center gap-2 disabled:opacity-50",children:[z?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(He,{className:"w-4 h-4"}),z?"处理中...":"追加卡密"]})]})]})}),document.body)]})},en=t=>t.find(s=>s.status==="running"||s.status==="canceling"),tn=t=>{const s=String(t||"").trim();return s?/^[¥¥]/.test(s)?s:`¥${s}`:"-"},sn=({onConfigureDelivery:t})=>{const[s,l]=r.useState([]),[o,x]=r.useState([]),[k,C]=r.useState([]),[R,f]=r.useState(""),[O,_]=r.useState(""),[Q,Y]=r.useState(!1),[me,oe]=r.useState(!1),[v,F]=r.useState(!1),[ce,K]=r.useState(!1),[X,z]=r.useState(!1),[be,pe]=r.useState(!1),[S,G]=r.useState(!1),[de,M]=r.useState("upload"),[J,A]=r.useState(null),[P,ae]=r.useState(null),[E,le]=r.useState(""),[Se,_e]=r.useState(!1),[ue,u]=r.useState(!1),[y,B]=r.useState([]),[T,re]=r.useState(null),[ge,fe]=r.useState([]),[Ie,ve]=r.useState(null),[c,L]=r.useState({catId:"",catName:"",channelCatId:"",tbCatId:""}),[p,d]=r.useState(null),[b,V]=r.useState(null),[U,H]=r.useState(null),ee=r.useRef(!1),[ke,g]=r.useState(null),[N,D]=r.useState({}),[I,he]=r.useState({cookie_id:"",item_id:"",item_title:"",item_price:"",item_image:""}),[W,ne]=r.useState({cookie_id:"",title:"",description:"",price:"",original_price:"",quantity:"1",postage_mode:"free",postage:"",images:[]}),[Pe,xe]=r.useState([]);r.useEffect(()=>{if(!be||W.images.length===0){xe([]);return}const n=W.images.map((w,i)=>({key:w.name+i,url:URL.createObjectURL(w)}));return xe(n),()=>{n.forEach(w=>URL.revokeObjectURL(w.url))}},[be,W.images]);const Re=async()=>{const n=await Nt();l(n)},ie=async()=>{x(await xs())};r.useEffect(()=>{Promise.all([Dt(),Nt(),xs(),zs(20)]).then(([n,w,i,a])=>{C(n),l(w),x(i);const m=a.find(j=>["running","canceling"].includes(j.status))||a.find(j=>j.status!=="preview");H(m||null)}).catch(n=>console.error("加载商品配置失败:",n))},[]),r.useEffect(()=>{if(!S||!(b!=null&&b.id)||!["running","canceling"].includes(b.status))return;const n=window.setInterval(async()=>{if(!ee.current){ee.current=!0;try{const w=await gt(b.id);V(w),H(w),["running","canceling"].includes(w.status)||(M("done"),await Re(),await ie())}catch(w){console.error("刷新批量铺货进度失败:",w)}finally{ee.current=!1}}},3e3);return()=>{window.clearInterval(n)}},[S,b==null?void 0:b.id,b==null?void 0:b.status]);const te=async()=>{if(!R)return alert("请先选择账号");Y(!0);try{const n=await ar(R);await Re(),alert((n==null?void 0:n.message)||"商品同步完成")}catch(n){console.error("同步商品失败:",n),alert((n==null?void 0:n.message)||"同步失败,请重试")}finally{Y(!1)}},Le=n=>{g(n),D({...n}),K(!0)},ye=async()=>{if(ke)try{await ur(ke.cookie_id,ke.item_id,{item_title:N.item_title||"",item_description:N.item_description||"",item_category:N.item_category||"",item_price:N.item_price||"",item_detail:N.item_detail||ke.item_detail||""}),await Re(),await ie(),K(!1),g(null)}catch(n){console.error("更新商品失败:",n),alert("更新失败,请重试")}},h=async n=>{if(confirm(`确认删除商品"${n.item_title}"吗?`))try{await lr(n.cookie_id,n.item_id),l(w=>w.filter(i=>!(i.cookie_id===n.cookie_id&&i.item_id===n.item_id)))}catch(w){console.error("删除商品失败:",w),alert("删除失败,请重试")}},q=async()=>{try{if(!I.cookie_id||!I.item_id){alert("请选择账号并填写商品ID");return}await rr(I.cookie_id,{item_id:I.item_id,item_title:I.item_title,item_price:I.item_price,item_detail:I.item_image?JSON.stringify({item_image:I.item_image}):""}),await Re(),z(!1),he({cookie_id:"",item_id:"",item_title:"",item_price:"",item_image:""})}catch(n){console.error("添加商品失败:",n),alert("添加失败,请重试")}},Ne=async()=>{if(!W.cookie_id)return alert("请选择发布账号");if(!W.title.trim())return alert("请填写商品标题");if(!W.price.trim())return alert("请填写商品价格");if(!W.quantity||Number(W.quantity)<=0)return alert("库存数量必须大
Line truncated
|
||||
`),a=new Blob(["\uFEFF"+i],{type:"text/csv;charset=utf-8"}),m=URL.createObjectURL(a),j=document.createElement("a");j.href=m,j.download="批量铺货模板.csv",document.body.appendChild(j),j.click(),j.remove(),URL.revokeObjectURL(m)},st=()=>{he(n=>({...n,cookie_id:R||n.cookie_id})),z(!0)},mt=()=>{ne(n=>({...n,cookie_id:R||n.cookie_id})),pe(!0)},pt=async n=>{const w=n?R:W.cookie_id;if(!w)return alert("请先选择发布账号");if(!navigator.geolocation)return alert("当前浏览器不支持定位");u(!0),navigator.geolocation.getCurrentPosition(async i=>{try{const a=await ir(w,i.coords.longitude,i.coords.latitude);if(!a.length)throw new Error("当前位置没有可用的发货地");n?(fe(a),ve(a[0])):(B(a),re(a[0]))}catch(a){alert((a==null?void 0:a.message)||"获取发货地失败")}finally{u(!1)}},i=>{u(!1),alert(i.code===i.PERMISSION_DENIED?"定位权限被拒绝,请在浏览器设置中允许定位":"无法获取当前位置,请稍后重试")},{enableHighAccuracy:!0,timeout:15e3,maximumAge:6e4})},Ct=n=>o.filter(w=>w.cookie_id===n.cookie_id&&w.item_id===n.item_id).length>0?o.filter(w=>w.cookie_id===n.cookie_id&&w.item_id===n.item_id):o.filter(w=>w.cookie_id===n.cookie_id&&!w.item_id),at=n=>{switch(n){case"preview":return"待确认";case"pending":return"等待中";case"running":return"发布中";case"canceling":return"正在安全取消";case"success":return"成功";case"failed":return"失败";case"completed":return"已完成";case"partially_failed":return"部分失败";case"canceled":return"已取消";default:return n||"-"}},lt=n=>{switch(n){case"success":case"completed":return"bg-emerald-50 text-emerald-700 border-emerald-100";case"partially_failed":case"failed":return"bg-red-50 text-red-700 border-red-100";case"running":return"bg-blue-50 text-blue-700 border-blue-100";case"canceled":return"bg-gray-100 text-gray-600 border-gray-200";default:return"bg-amber-50 text-amber-700 border-amber-100"}},rt=r.useMemo(()=>new Map(k.map(n=>[n.id,n])),[k]),nt=r.useMemo(()=>O?s.filter(n=>n.cookie_id===O):s,[O,s]),Je=n=>{const w=rt.get(n),i=(w==null?void 0:w.remark)||(w==null?void 0:w.nickname);return i?`${i} · ${n.slice(0,6)}`:`账号 ${n.slice(0,8)}`},ut=n=>{const w=rt.get(n);return(w==null?void 0:w.remark)||(w==null?void 0:w.nickname)||"未命名账号"};return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col xl:flex-row xl:justify-between xl:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"商品管理"}),e.jsx("p",{className:"text-gray-500 mt-2 text-sm",children:"监控并管理所有账号下的闲鱼商品。"})]}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsxs("div",{className:"flex min-w-[200px] flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"item-account-filter",className:"px-1 text-[11px] font-extrabold tracking-wide text-gray-500",children:"商品列表筛选"}),e.jsxs("div",{className:"relative",children:[e.jsx(Qa,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),e.jsxs("select",{id:"item-account-filter","aria-label":"按账号筛选商品列表",className:"ios-input w-full pl-10 pr-9 py-3 rounded-xl text-sm",value:O,onChange:n=>_(n.target.value),children:[e.jsx("option",{value:"",children:"全部账号"}),k.map(n=>e.jsx("option",{value:n.id,children:Je(n.id)},n.id))]})]})]}),e.jsxs("div",{className:"flex min-w-[200px] flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"item-sync-account",className:"px-1 text-[11px] font-extrabold tracking-wide text-gray-500",children:"同步商品账号"}),e.jsxs("div",{className:"relative",children:[e.jsx(ct,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),e.jsxs("select",{id:"item-sync-account","aria-label":"选择要同步商品的账号",className:"ios-input w-full pl-10 pr-9 py-3 rounded-xl text-sm",value:R,onChange:n=>f(n.target.value),children:[e.jsx("option",{value:"",children:"请选择账号"}),k.map(n=>e.jsx("option",{value:n.id,children:Je(n.id)},n.id))]})]})]}),e.jsxs("button",{onClick:te,disabled:Q||!R,className:"ios-btn-primary flex items-center gap-2 px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 disabled:opacity-50",children:[e.jsx(Me,{className:`w-4 h-4 ${Q?"animate-spin":""}`}),"同步商品"]}),e.jsxs("button",{onClick:st,className:"px-5 py-3 rounded-2xl font-bold bg-gray-900 text-white hover:bg-gray-800 transition-colors flex items-center gap-2 shadow-lg",children:[e.jsx(He,{className:"w-4 h-4"}),"添加商品"]}),e.jsxs("button",{onClick:mt,className:"px-5 py-3 rounded-2xl font-bold bg-emerald-600 text-white hover:bg-emerald-700 transition-colors flex items-center gap-2 shadow-lg shadow-emerald-100",children:[e.jsx(Gt,{className:"w-4 h-4"}),"发布商品"]}),e.jsxs("button",{onClick:()=>void Oe(),className:"px-5 py-3 rounded-2xl font-bold bg-blue-600 text-white hover:bg-blue-700 transiti
Line truncated
|
||||
@@ -1,19 +0,0 @@
|
||||
import{j as e,r,b as Fe,c as aa,d as Ra}from"./react-vendor-C_od1ZSF.js";import{L as $a,U as la,M as ts,C as ss,B as ra,S as na,Z as as,a as yt,b as us,c as hs,d as gs,e as Pa,f as rt,A as ks,D as Da,g as Cs,P as ia,h as At,E as oa,T as Ea,i as Ta,j as Re,X as $e,k as Fa,l as Ma,m as bs,n as ca,o as He,Q as Qt,p as ot,q as Ke,r as ft,s as It,t as Ss,R as Be,u as da,v as qa,w as Qe,K as Ba,x as it,y as lt,z as tt,F as Ls,G as _t,H as jt,I as Ot,J as xa,N as za,O as Os,V as Is,W as Ua,Y as Wa,_ as Va,$ as Ja,a0 as Gt,a1 as Dt,a2 as ls,a3 as Qa,a4 as Ga,a5 as rs,a6 as Ka,a7 as Ha,a8 as ns,a9 as As,aa as zt,ab as ma,ac as Za,ad as Ya,ae as Wt,af as pa,ag as Xa,ah as el,ai as tl,aj as sl,ak as al,al as ll,am as rl}from"./icons-vendor-DjsKcZkz.js";import{R as Et,B as nl,X as Rs,Y as $s,T as Tt,a as il,C as Kt,A as ol,b as cl,c as dl,P as Ps,d as Ds,L as xl}from"./charts-vendor-BxxJOyEX.js";import"./vendor-D-Edl3pr.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))i(x);new MutationObserver(x=>{for(const v of x)if(v.type==="childList")for(const S of v.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&i(S)}).observe(document,{childList:!0,subtree:!0});function l(x){const v={};return x.integrity&&(v.integrity=x.integrity),x.referrerPolicy&&(v.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?v.credentials="include":x.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function i(x){if(x.ep)return;x.ep=!0;const v=l(x);fetch(x.href,v)}})();const ml=({className:t="w-full h-full text-white"})=>e.jsx("svg",{className:t,viewBox:"0 0 256 256","aria-hidden":"true",children:e.jsx("g",{stroke:"none",fill:"none",fillRule:"evenodd",children:e.jsx("path",{d:"M121.73,57.0003 C138.901,57.0003 154.897,65.5053 164.52,79.7493 C166.029,81.9823 165.441,85.0143 163.209,86.5233 C160.976,88.0323 157.944,87.4433 156.436,85.2113 C148.629,73.6553 135.655,66.7563 121.73,66.7563 C104.076789,66.7563 88.6201962,77.6596007 82.5581814,93.8184545 C83.9120803,93.7133631 85.2800264,93.66 86.6602,93.66 C111.537727,93.66 132.442611,110.997575 137.926382,134.224255 L162.5425,92.109 L162.615557,91.9879406 L162.756884,91.77367 L162.911804,91.5639102 L162.98657,91.4716759 C163.351845,91.025169 163.786059,90.6571744 164.264191,90.3738733 L164.550153,90.2178351 L164.729252,90.1315693 L164.989203,90.021723 L165.230265,89.9354653 L165.542393,89.8445739 C165.666021,89.8126706 165.790834,89.7857324 165.916565,89.7637431 L166.116517,89.7342499 C166.29505,89.7098142 166.475001,89.6957386 166.655596,89.6918808 L166.7539,89.693 C196.8909,89.693 221.4079,114.21 221.4079,144.347 C221.4079,174.482 196.8909,199 166.7539,199 L125.0869,199 C122.3919,199 120.2079,196.815 120.2079,194.122 C120.2079,191.429 122.3919,189.244 125.0869,189.244 L166.7539,189.244 C191.5109,189.244 211.6519,169.104 211.6519,144.347 C211.6519,120.513406 192.985349,100.957891 169.504046,99.5322548 L112.7745,196.584 C111.8995,198.08 110.2965,199 108.5635,199 L86.6602,199 C57.6182,199 33.9902,175.373 33.9902,146.33 C33.9902,122.475163 49.9316132,102.273061 71.7206298,95.817503 L71.9446339,94.967678 C78.0600632,72.5405324 98.33054,57.0003 121.73,57.0003 Z M86.6602,103.417 C62.9972,103.417 43.7462,122.667 43.7462,146.33 C43.7462,169.992 62.9972,189.244 86.6602,189.244 L105.7645,189.244 L129.869462,148.004782 C129.678439,147.482425 129.5742,146.918336 129.5742,146.33 C129.5742,122.667 110.3232,103.417 86.6602,103.417 Z",fill:"currentColor"})})}),is=({sizeClass:t="w-12 h-12",logoClassName:s="w-full h-full text-white"})=>e.jsxs("div",{className:"relative z-10 flex items-center justify-center",children:[e.jsx("div",{className:"absolute -inset-1 bg-blue-500/20 rounded-xl blur opacity-25"}),e.jsxs("div",{className:`relative ${t} rounded-xl flex items-center justify-center group-hover:scale-105 transition-transform duration-300`,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full",viewBox:"0 0 120 120","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"login-squircle-gradient",x1:"0",y1:"0",x2:"1",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0094f7"}),e.jsx("stop",{offset:"100%",stopColor:"#287efe"})]})}),e.jsx("path",{d:"M 114.00 60.00 L 113.83 71.48 L 113.31 78.16 L 112.44 83.67 L 111.22 88.46 L 109.66 92.71 L 107.75 96.49 L 105.48 99.87 L 102.86 102.86 L 99.87 105.48 L 96.49 107.75 L 92.71 109.66 L 88.46 111.22 L 83.67 112.44 L 78.16 113.31 L 71.48 113.83 L 60.00 114.00 L 48.52 113.83 L 41.84 113.31 L 36.33 112.44 L 31.54 111.22 L 27.29 109.66 L 23.51 107.75 L 20.13 105.48 L 17.14 102.86 L 14.52 99.87 L 12.25 96.49 L 10.34 92.71 L 8.78 88.46 L 7.56 83.67 L 6.69 78.16 L 6.17 71.48 L 6.00 60.00 L 6.17 48.52 L 6.69 41.84 L 7.56 36.33 L 8.78 31.54 L 10.34 27.29 L 12.25 23.51 L 14.52 20.13 L 17.14 17.14 L 20.13 14.52 L 23.51 12.25 L 27.29 10.34 L 31.54 8.78 L 36.33 7.56 L 41.8Line truncated
|
||||
|
||||
例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等`,className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none"})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-bold text-blue-900 mb-2 flex items-center gap-2",children:[e.jsx(us,{className:"w-4 h-4"}),"AI如何工作"]}),e.jsxs("ul",{className:"text-xs text-blue-800 space-y-1",children:[e.jsx("li",{children:"• 自动识别买家的砍价请求"}),e.jsx("li",{children:"• 根据设定的策略智能回复"}),e.jsx("li",{children:"• 在合理范围内同意降价或礼貌拒绝"}),e.jsx("li",{children:"• 保持专业友好的沟通风格"})]})]})]}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx("button",{onClick:Pt,className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",disabled:R,children:"取消"}),e.jsxs("button",{onClick:Je,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",disabled:R,children:[R?e.jsx(Re,{className:"w-4 h-4 animate-spin"}):e.jsx(He,{className:"w-4 h-4"}),R?"保存中...":"保存"]})]})})]})}),document.body)]})},Qr=t=>({total:Number((t==null?void 0:t.total)||0),success_count:Number((t==null?void 0:t.success_count)||0),failed_count:Number((t==null?void 0:t.failed_count)||0),results:Array.isArray(t==null?void 0:t.results)?t.results.map(s=>({order_id:String((s==null?void 0:s.order_id)||"unknown"),success:(s==null?void 0:s.success)===!0,message:String((s==null?void 0:s.message)||"")})):[]}),Gr=t=>(t==null?void 0:t.results.filter(s=>!s.success))||[],Qs=({status:t})=>{const s={processing:"bg-blue-100 text-blue-800",pending_ship:"bg-[#0094f7] text-white",shipped:"bg-blue-100 text-blue-700",completed:"bg-green-100 text-green-700",cancelled:"bg-gray-100 text-gray-500",refunding:"bg-red-100 text-red-600",unknown:"bg-gray-100 text-gray-500"},l={processing:"处理中",pending_ship:"待发货",shipped:"已发货",completed:"已完成",cancelled:"已取消",refunding:"退款中",unknown:"未知"};return e.jsx("span",{className:`px-3 py-1.5 rounded-lg text-xs font-bold ${s[t]||s.cancelled}`,children:l[t]||t})},Kr=()=>{const[t,s]=r.useState([]),[l,i]=r.useState([]),[x,v]=r.useState([]),[S,$]=r.useState({}),[f,I]=r.useState("all"),[y,J]=r.useState(""),[H,me]=r.useState(""),[ne,N]=r.useState(""),M=r.useRef(0),[ie,G]=r.useState(1),[Z,W]=r.useState(1),[ge,ue]=r.useState(!1),[O,Q]=r.useState(!1),[ce,q]=r.useState(!1),[V,A]=r.useState(!1),[D,ae]=r.useState(null),[E,le]=r.useState(null),[Se,je]=r.useState({}),[pe,u]=r.useState(!1),[b,z]=r.useState(""),[w,Y]=r.useState(!1),[oe,he]=r.useState(null),[Ie,fe]=r.useState(null),[d,k]=r.useState(null),[p,c]=r.useState(!1),[_,R]=r.useState(null),[U,K]=r.useState(null),te=async()=>{const g=++M.current;ue(!0);try{const B=await zl(y||void 0,f,ie,20,ne);if(g!==M.current)return;s(B.data),W(B.total_pages)}catch(B){console.error("加载订单失败:",B)}finally{g===M.current&&ue(!1)}},Ne=(g,B,_e)=>{if(_e&&_e.trim())return _e;if(S[`${g}:${B}`])return S[`${g}:${B}`];const Oe=l.find(Ye=>{if(_e&&Ye.item_title){const st=_e.toLowerCase(),Xe=Ye.item_title.toLowerCase();return Xe.includes(st)||st.includes(Xe)}return!1});return Oe!=null&&Oe.item_title?Oe.item_title:"未知商品"},h=g=>{const B={};g.forEach(_e=>{_e.item_id&&(B[`${_e.cookie_id}:${_e.item_id}`]=_e.item_title||_e.item_id)}),$(B)};r.useEffect(()=>{const g=window.setTimeout(()=>{G(1),N(H.trim())},300);return()=>window.clearTimeout(g)},[H]),r.useEffect(()=>{te()},[y,f,ie,ne]),r.useEffect(()=>{Promise.all([Rt(),Nt()]).then(([g,B])=>{v(g),i(B),h(B)}).catch(g=>{console.error("加载商品列表失败:",g)})},[]);const C=r.useMemo(()=>new Map(x.map(g=>[g.id,g])),[x]),F=g=>{const B=C.get(g),_e=(B==null?void 0:B.remark)||(B==null?void 0:B.nickname);return _e?`${_e} · ${g.slice(0,6)}`:`账号 ${g.slice(0,8)}`},T=g=>{const B=C.get(g);return(B==null?void 0:B.remark)||(B==null?void 0:B.nickname)||"未命名账号"},ve=async()=>{ue(!0);try{const g=await Vl(y||void 0,f);await te(),g!=null&&g.message&&alert(g.message)}catch(g){console.error("同步订单失败:",g),alert((g==null?void 0:g.message)||"同步失败,请重试")}finally{ue(!1)}},Ee=g=>{z(g),he(null),u(!0)},we=async g=>{var B;Y(!0),he(null);try{const _e=await Ql([b],g),Oe=(B=_e==null?void 0:_e.results)==null?void 0:B[0];Oe!=null&&Oe.success?(he({success:!0,message:Oe.message}),te()):he({success:!1,message:(Oe==null?void 0:Oe.message)||"发货失败"})}catch(_e){he({success:!1,message:(_e==null?void 0:_e.message)||"请求失败"})}finally{Y(!1)}},Pe=g=>{ae(g),Q(!0)},de=g=>{le({...g}),q(!0)},Te=async()=>{if(!(!E||!E.order_id))try{const g={};E.status!==void 0&&(g.order_status=E.status),E.buyer_id!==void 0&&(g.buyer_id=E.buyer_id),E.amount!==void 0&&(g.amount=E.amount),E.receiver_name!==void 0&&(g.receiver_name=E.receiver_name),E.receiver_phon
Line truncated
|
||||
VIP-MONTH-002
|
||||
VIP-MONTH-003`,"按行消费的卡密队列","是","0","否","",""],["感谢文案","text","感谢购买,如有问题联系客服~","固定文本","是","0","否","",""],["教程图","image","https://cdn.example.com/tutorial.jpg","图片URL","是","0","否","",""]]].map(U=>U.map(K=>`"${String(K).replace(/"/g,'""')}"`).join(",")).join(`
|
||||
`),c=new Blob(["\uFEFF"+p],{type:"text/csv;charset=utf-8"}),_=URL.createObjectURL(c),R=document.createElement("a");R.href=_,R.download="卡密组批量导入模板.csv",document.body.appendChild(R),R.click(),R.remove(),URL.revokeObjectURL(_)},he=async()=>{if(M){ge(!0),Z(null);try{const d=await er(M);if(Z(d),d.created>0){const k=await et();s(k)}}catch(d){Z({error:(d==null?void 0:d.message)||"上传失败"})}finally{ge(!1)}}},Ie=async()=>{if(!(!ue||!Q.trim())){ge(!0),V(null);try{const d=await tr(ue,Q);V({added:d.added}),ce("");const k=await et();s(k)}catch(d){alert("追加失败:"+((d==null?void 0:d.message)||"未知错误"))}finally{ge(!1)}}},fe=()=>{var d;N("create"),ie(null),Z(null),O((d=w[0])!=null&&d.id?String(w[0].id):""),ce(""),V(null),me(!0)};return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between md:items-end gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-4xl font-extrabold text-gray-900 tracking-tight",children:"卡密库存"}),e.jsx("p",{className:"text-gray-500 mt-2 font-medium",children:"管理自动发货的卡密、链接或图片资源。"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:fe,className:"px-4 py-3 bg-gray-100 hover:bg-gray-200 rounded-2xl font-bold text-gray-700 flex items-center gap-2 transition-colors",children:[e.jsx(Ot,{className:"w-5 h-5"}),"批量导入"]}),e.jsxs("button",{onClick:()=>v(!0),className:"ios-btn-primary flex items-center gap-2 px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 transition-transform hover:scale-105 active:scale-95",children:[e.jsx(tt,{className:"w-5 h-5"}),"添加新卡密"]})]})]}),e.jsxs("div",{className:"ios-card rounded-xl overflow-hidden shadow-lg border-0 bg-white",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-gray-50 bg-[#FAFAFA] p-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-3 sm:flex-row",children:[e.jsxs("div",{className:"relative sm:w-48",children:[e.jsx(xa,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsxs("select",{"aria-label":"按卡密类型筛选",value:A,onChange:d=>D(d.target.value),className:"ios-input w-full rounded-xl border-none bg-white py-2.5 pl-10 pr-9 text-sm shadow-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),e.jsx("option",{value:"data",children:"批量卡密"}),e.jsx("option",{value:"text",children:"文本"}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"image",children:"图片"})]})]}),e.jsxs("div",{className:"relative w-full sm:max-w-sm",children:[e.jsx(_t,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"search","aria-label":"按卡密名称搜索",placeholder:"搜索卡密名称...",value:ae,onChange:d=>E(d.target.value),className:"ios-input w-full rounded-xl border-none bg-white py-2.5 pl-10 pr-4 text-sm shadow-sm"})]})]}),e.jsxs("div",{className:"whitespace-nowrap px-1 text-xs font-bold text-gray-400",children:["显示 ",Y.length," / ",t.length," 组"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full table-fixed text-left border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-white text-gray-400 text-xs font-bold uppercase tracking-wider border-b border-gray-50",children:[e.jsx("th",{className:"w-[23%] px-5 py-5",children:"卡密名称"}),e.jsx("th",{className:"w-[8%] px-3 py-5",children:"卡密组ID"}),e.jsx("th",{className:"w-[7%] px-2 py-5",children:"类型"}),e.jsx("th",{className:"w-[27%] px-5 py-5",children:"内容/库存"}),e.jsx("th",{className:"w-[19%] px-5 py-5",children:"描述"}),e.jsx("th",{className:"w-[7%] px-2 py-5",children:"状态"}),e.jsx("th",{className:"w-[9%] px-3 py-5 text-right",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-50",children:Y.map(d=>{let k="";return d.type==="data"&&d.data_content?k=`库存: ${d.data_content.split(`
|
||||
`).filter(c=>c.trim()).length} 条`:d.type==="text"&&d.text_content?k=d.text_content:d.type==="api"&&d.api_config?k=d.api_config.url:d.type==="image"&&d.image_url&&(k="图片链接"),e.jsxs("tr",{className:"hover:bg-[#FFFDE7]/50 transition-colors group",children:[e.jsx("td",{className:"px-5 py-5 align-middle",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"shrink-0 rounded-xl bg-gray-50 p-2 transition-colors group-hover:bg-white",children:e.jsx(le,{type:d.type})}),e.jsx("span",{className:"line-clamp-3 min-w-0 text-[13px] font-bold leading-5 text-gray-900",title:d.name,children:d.name})]})}),e.jsx("td",{className:"px-3 py-5",children:e.jsxs("button",{onClick:()=>z(d.id),className:"inline-flex max-w-full items-center gap-1 rounded-lg bg-gray-100 px-2 py-1.5 font-mono text-[11px] font-extrabold text-gray-700 transition-colors hover:bg-gray-200",title:"复制卡密组ID,用于批量铺货表格",children:[e.jsx("span",{className:"truncate",children:d.id}),e.jsx(za,{className:"h-3 w-3 shrink-0"})]})}),e.jsx("td",{className:"px-2 py-5",children:e.jsx("span",{className:`inline-flex rounded-md px-2 py-1 text-[11px] font-bold ${d.type==="text"?"bg-blue-50 text-blue-600":d.type==="data"?"bg-purple-50 text-purple-600":d.type==="api"?"bg-blue-50 text-blue-600":"bg-pink-50 text-pink-600"}`,children:d.type==="text"?"文本":d.type==="data"?"批量":d.type==="api"?"API":"图片"})}),e.jsx("td",{className:"px-5 py-5",children:e.jsx("span",{className:"line-clamp-3 break-all font-mono text-sm leading-5 text-gray-600",title:k,children:k})}),e.jsx("td",{className:"px-5 py-5",children:e.jsx("span",{className:"block truncate text-sm text-gray-500",title:d.description||"-",children:d.description||"-"})}),e.jsx("td",{className:"px-2 py-5",children:e.jsx("button",{onClick:()=>b(d),className:`w-12 h-8 rounded-full relative transition-colors ${d.enabled?"bg-green-500":"bg-gray-300"}`,children:e.jsx("div",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-sm transition-transform ${d.enabled?"left-5":"left-1"}`})})}),e.jsx("td",{className:"px-3 py-5",children:e.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[e.jsx("button",{onClick:()=>Se(d),className:"rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-black",title:"编辑",children:e.jsx(jt,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>pe(d.id),className:"rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-red-50 hover:text-red-500",children:e.jsx(Qe,{className:"h-4 w-4"})})]})})]},d.id)})})]})}),Y.length===0&&e.jsxs("div",{className:"py-20 text-center text-gray-400",children:[e.jsx(ia,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),e.jsx("p",{children:t.length===0?"暂无卡密配置,请点击右上角添加。":"没有符合当前筛选条件的卡密组。"})]})]}),l&&S&&Fe.createPortal(e.jsx("div",{className:"modal-overlay-centered",children:e.jsxs("div",{className:"modal-container",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"编辑卡密"}),e.jsx("button",{onClick:()=>i(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors",children:e.jsx($e,{className:"w-5 h-5 text-gray-500"})})]}),e.jsx("div",{className:"modal-body",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:["卡密名称 ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",value:f.name||"",onChange:d=>I({...f,name:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",placeholder:"例如:游戏点卡、会员卡等"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡券类型"}),e.jsxs("select",{value:f.type||"text",onChange:d=>I({...f,type:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[e.jsx("option",{value:"",children:"请选择类型"}),e.jsx("option",{value:"text",children:"固定文字"}),e.jsx("option",{value:"data",children:"批量数据"}),(S==null?void 0:S.type)==="api"&&e.jsx("option",{value:"api",children:"API接口(仅保留现有配置)"}),e.jsx("option",{value:"image",children:"图片"})]})]})]}),f.type==="api"&&e.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 space-y-4 bg-gray-50",children:[e.jsx("h3",{className:"font-bold text-gray-900",children:"API 配置"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"API 地址"}),e.jsx("input",{type:"url",value:f.api_url||"",onChange:d=>I({...f,api_url:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://api.example.com/get-card"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxLine truncated
|
||||
卡号1:密码1
|
||||
卡号2:密码2
|
||||
或者
|
||||
兑换码1
|
||||
兑换码2`}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"支持格式:卡号:密码 或 单独的兑换码"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",e.jsx("span",{className:"font-bold text-blue-600",children:f.data_content?f.data_content.split(`
|
||||
`).filter(d=>d.trim()).length:0})," 条"]})]})]}),f.type==="image"&&e.jsxs("div",{className:"border border-gray-200 rounded-xl p-4 bg-gray-50",children:[e.jsx("h3",{className:"font-bold text-gray-900 mb-3",children:"图片配置"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片 URL"}),e.jsx("input",{type:"url",value:f.image_url||"",onChange:d=>I({...f,image_url:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl font-mono text-sm",placeholder:"https://example.com/image.png"}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"输入图片卡密的 URL 地址"})]}),f.image_url&&e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"图片预览"}),e.jsx("img",{src:f.image_url,alt:"预览",className:"max-w-full max-h-48 rounded-xl border border-gray-200",onError:d=>{d.currentTarget.src="https://via.placeholder.com/400x200?text=图片加载失败"}})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"延时发货时间(秒)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",value:f.delay_seconds||0,onChange:d=>I({...f,delay_seconds:parseInt(d.target.value)||0}),className:"flex-1 ios-input px-4 py-3 rounded-xl",min:"0",max:"3600",placeholder:"0"}),e.jsx("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:"秒"})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"0表示立即发货,最大3600秒(1小时)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"备注信息"}),e.jsx("textarea",{value:f.description||"",onChange:d=>I({...f,description:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none",placeholder:"可选的备注信息"})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-xl",children:[e.jsx("span",{className:"font-bold text-gray-900",children:"启用状态"}),e.jsx("button",{type:"button",onClick:()=>I({...f,enabled:!f.enabled}),className:`w-14 h-8 rounded-full transition-colors duration-300 relative ${f.enabled?"bg-[#0094f7]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute top-1 w-6 h-6 bg-white rounded-full shadow-md transition-transform duration-300 block ${f.enabled?"translate-x-7":"translate-x-1"}`})})]})]})}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx("button",{onClick:()=>i(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),e.jsxs("button",{onClick:je,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[e.jsx(He,{className:"w-4 h-4"}),"保存更改"]})]})})]})}),document.body),x&&Fe.createPortal(e.jsx("div",{className:"modal-overlay-centered",children:e.jsxs("div",{className:"modal-container",style:{maxWidth:"780px"},children:[e.jsxs("div",{className:"modal-header flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"添加新卡密"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"选择交付方式并录入自动发货内容"})]}),e.jsx("button",{onClick:()=>v(!1),className:"p-2 rounded-xl hover:bg-gray-100 transition-colors flex-shrink-0",title:"关闭",children:e.jsx($e,{className:"w-5 h-5 text-gray-500"})})]}),e.jsx("div",{className:"modal-body",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"卡密名称"}),e.jsx("input",{type:"text",value:y.name,onChange:d=>J({...y,name:d.target.value}),placeholder:"例如:VIP会员卡密",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"类型"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>J({...y,type:"data",content:""}),className:`p-3 rounded-xl font-bold transition-all ${y.type==="data"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[e.jsx(ss,{className:"w-5 h-5 mx-auto mb-1"}),"批量库存"]}),e.jsxs("button",{type:"button",onClick:()=>J({...y,type:"text",content:""}),className:`p-3 rounded-xl font-bold transition-all ${y.type==="text"?"bg-[#0094f7] text-white":"bg-gray-100 text-gray-600"}`,children:[e.jsx(Os,{className:"w-5 h-5 mx-auto mb-1"}),"文本"]}),e.jsxs("button",{type:"button",onClick:()=>J({...y,type:"image",content:""}),className:`p-3 rounded-xl font-bold transition-all ${y.type==="image"?"bg-[#0094f7] text-white":"bg-gray-100 text-grayLine truncated
|
||||
CODE-789012
|
||||
...`:"请输入每次发货时发送的固定文字"}),y.type==="data"&&e.jsxs("p",{className:"text-xs text-gray-500",children:["当前库存:",e.jsx("span",{className:"font-bold text-[#0094f7]",children:y.content.split(`
|
||||
`).filter(d=>d.trim()).length})," 条"]})]}),y.type==="api"&&e.jsxs("div",{className:"border-t border-gray-100 pt-5 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求方法"}),e.jsxs("select",{value:y.api_method,onChange:d=>J({...y,api_method:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl",children:[e.jsx("option",{value:"GET",children:"GET"}),e.jsx("option",{value:"POST",children:"POST"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"超时时间(秒)"}),e.jsx("input",{type:"number",min:"1",max:"60",value:y.api_timeout,onChange:d=>J({...y,api_timeout:parseInt(d.target.value)||10}),className:"w-full ios-input px-4 py-3 rounded-xl"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求头(JSON)"}),e.jsx("textarea",{value:y.api_headers,onChange:d=>J({...y,api_headers:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"Authorization":"Bearer token"}'})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"请求参数(JSON)"}),e.jsx("textarea",{value:y.api_params,onChange:d=>J({...y,api_params:d.target.value}),className:"w-full ios-input px-4 py-3 rounded-xl h-24 resize-none font-mono text-xs",placeholder:'{"order_id":"{order_id}"}'})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_180px] gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"描述"}),e.jsx("input",{value:y.description,onChange:d=>J({...y,description:d.target.value}),placeholder:"卡密用途描述(可选)",className:"w-full ios-input px-4 py-3 rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700",children:"延时发货(秒)"}),e.jsx("input",{type:"number",value:y.delay_seconds,onChange:d=>J({...y,delay_seconds:parseInt(d.target.value)||0}),className:"w-full ios-input px-4 py-3 rounded-xl",min:"0",max:"3600"})]})]})]})}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx("button",{onClick:()=>v(!1),className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"取消"}),e.jsxs("button",{onClick:u,className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",children:[e.jsx(tt,{className:"w-4 h-4"}),"添加卡密"]})]})})]})}),document.body),H&&Fe.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",style:{maxWidth:"40rem"},children:[e.jsxs("div",{className:"px-6 py-5 border-b border-gray-100 flex items-center justify-between",children:[e.jsx("h3",{className:"text-xl font-extrabold text-gray-900",children:"批量导入卡密"}),e.jsx("button",{onClick:()=>me(!1),className:"w-10 h-10 rounded-2xl bg-gray-100 hover:bg-gray-200 flex items-center justify-center",children:e.jsx($e,{className:"w-5 h-5 text-gray-600"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-5",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 p-2 bg-gray-100/50 rounded-2xl",children:[e.jsxs("button",{onClick:()=>N("create"),className:`flex-1 inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl text-sm font-bold transition-all ${ne==="create"?"bg-[#0094f7] text-white shadow-md":"bg-white text-gray-600 hover:bg-gray-50"}`,children:[e.jsx(Ua,{className:"w-4 h-4"}),"批量创建卡密组"]}),e.jsxs("button",{onClick:()=>N("append"),className:`flex-1 inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl text-sm font-bold transition-all ${ne==="append"?"bg-[#0094f7] text-white shadow-md":"bg-white text-gray-600 hover:bg-gray-50"}`,children:[e.jsx(Ot,{className:"w-4 h-4"}),"往单个组充卡密"]})]}),ne==="create"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-xl bg-blue-50 border border-blue-100 p-4 text-xs text-blue-900 leading-5",children:["上传表格,每行一个卡密组。表头:",e.jsx("code",{className:"bg-blue-100/70 px-1.5 py-0.5 rounded",children:"名称,类型,内容,描述,启用,延迟秒,多规格,规格名,规格值"}),'。 类型填 text/data/image;data 类型的"内容"按行存卡密(CSV 单元格内换行需用引号包裹)。']}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:oe,className:"px-4 py-2.5 bg-gray-100 hover:bg-gray-200 rounded-xl font-bold text-gray-700 flex items-center gap-2 text
Line truncated
|
||||
VIP-002
|
||||
VIP-003`,className:"w-full ios-input px-4 py-3 rounded-xl text-sm font-mono h-40 resize-y"}),e.jsx("p",{className:"text-xs text-gray-500",children:"一行一个卡密号,空行自动忽略。会追加到该组现有库存末尾。"})]}),q&&e.jsxs("div",{className:"rounded-xl bg-green-50 border border-green-200 p-3 text-sm text-green-700 font-bold",children:["已追加 ",q.added," 个卡密"]})]})})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-100 flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>me(!1),className:"px-5 py-2.5 rounded-xl bg-gray-100 hover:bg-gray-200 font-bold text-gray-700 transition-colors",children:"关闭"}),ne==="create"?e.jsxs("button",{onClick:he,disabled:!M||W,className:"ios-btn-primary px-6 py-2.5 rounded-xl font-bold flex items-center gap-2 disabled:opacity-50",children:[W?e.jsx(Re,{className:"w-4 h-4 animate-spin"}):e.jsx(Ot,{className:"w-4 h-4"}),W?"处理中...":"上传创建"]}):e.jsxs("button",{onClick:Ie,disabled:!ue||!Q.trim()||W||w.length===0,className:"ios-btn-primary px-6 py-2.5 rounded-xl font-bold flex items-center gap-2 disabled:opacity-50",children:[W?e.jsx(Re,{className:"w-4 h-4 animate-spin"}):e.jsx(tt,{className:"w-4 h-4"}),W?"处理中...":"追加卡密"]})]})]})}),document.body)]})},Yr=t=>t.find(s=>s.status==="running"||s.status==="canceling"),Xr=t=>{const s=String(t||"").trim();return s?/^[¥¥]/.test(s)?s:`¥${s}`:"-"},en=({onConfigureDelivery:t})=>{const[s,l]=r.useState([]),[i,x]=r.useState([]),[v,S]=r.useState([]),[$,f]=r.useState(""),[I,y]=r.useState(""),[J,H]=r.useState(!1),[me,ne]=r.useState(!1),[N,M]=r.useState(!1),[ie,G]=r.useState(!1),[Z,W]=r.useState(!1),[ge,ue]=r.useState(!1),[O,Q]=r.useState(!1),[ce,q]=r.useState("upload"),[V,A]=r.useState(null),[D,ae]=r.useState(null),[E,le]=r.useState(""),[Se,je]=r.useState(!1),[pe,u]=r.useState({catId:"",catName:"",channelCatId:"",tbCatId:""}),[b,z]=r.useState(null),[w,Y]=r.useState(null),[oe,he]=r.useState(null),Ie=r.useRef(!1),[fe,d]=r.useState(null),[k,p]=r.useState({}),[c,_]=r.useState({cookie_id:"",item_id:"",item_title:"",item_price:"",item_image:""}),[R,U]=r.useState({cookie_id:"",title:"",description:"",price:"",original_price:"",quantity:"1",postage_mode:"free",postage:"",images:[]}),[K,te]=r.useState([]);r.useEffect(()=>{if(!ge||R.images.length===0){te([]);return}const n=R.images.map((L,re)=>({key:L.name+re,url:URL.createObjectURL(L)}));return te(n),()=>{n.forEach(L=>URL.revokeObjectURL(L.url))}},[ge,R.images]);const Ne=async()=>{const n=await Nt();l(n)},h=async()=>{x(await xs())};r.useEffect(()=>{Promise.all([Rt(),Nt(),xs(),Bs(20)]).then(([n,L,re,Ve])=>{S(n),l(L),x(re);const Je=Ve.find(qe=>["running","canceling"].includes(qe.status))||Ve.find(qe=>qe.status!=="preview");he(Je||null)}).catch(n=>console.error("加载商品配置失败:",n))},[]),r.useEffect(()=>{if(!O||!(w!=null&&w.id)||!["running","canceling"].includes(w.status))return;const n=window.setInterval(async()=>{if(!Ie.current){Ie.current=!0;try{const L=await gt(w.id);Y(L),he(L),["running","canceling"].includes(L.status)||(q("done"),await Ne(),await h())}catch(L){console.error("刷新批量铺货进度失败:",L)}finally{Ie.current=!1}}},3e3);return()=>{window.clearInterval(n)}},[O,w==null?void 0:w.id,w==null?void 0:w.status]);const C=async()=>{if(!$)return alert("请先选择账号");H(!0);try{const n=await sr($);await Ne(),alert((n==null?void 0:n.message)||"商品同步完成")}catch(n){console.error("同步商品失败:",n),alert((n==null?void 0:n.message)||"同步失败,请重试")}finally{H(!1)}},F=n=>{d(n),p({...n}),G(!0)},T=async()=>{if(fe)try{await mr(fe.cookie_id,fe.item_id,{item_title:k.item_title||"",item_description:k.item_description||"",item_category:k.item_category||"",item_price:k.item_price||"",item_detail:k.item_detail||fe.item_detail||""}),await Ne(),await h(),G(!1),d(null)}catch(n){console.error("更新商品失败:",n),alert("更新失败,请重试")}},ve=async n=>{if(confirm(`确认删除商品"${n.item_title}"吗?`))try{await ar(n.cookie_id,n.item_id),l(L=>L.filter(re=>!(re.cookie_id===n.cookie_id&&re.item_id===n.item_id)))}catch(L){console.error("删除商品失败:",L),alert("删除失败,请重试")}},Ee=async()=>{try{if(!c.cookie_id||!c.item_id){alert("请选择账号并填写商品ID");return}await lr(c.cookie_id,{item_id:c.item_id,item_title:c.item_title,item_price:c.item_price,item_detail:c.item_image?JSON.stringify({item_image:c.item_image}):""}),await Ne(),W(!1),_({cookie_id:"",item_id:"",item_title:"",item_price:"",item_image:""})}catch(n){console.error("添加商品失败:",n),alert("添加失败,请重试")}},we=async()=>{if(!R.cookie_id)return alert("请选择发布账号");if(!R.title.trim())return alert("请填写商品标题");if(!R.price.trim())return alert("请填写商品价格");if(!R.quantity||Number(R.quantity)<=0)return alert("库存数量必须大于 0");if(R.images.length===0)return alert("至少上传 1 张商品图片");if(R.postage_mode==="fixe
Line truncated
|
||||
`),Ve=new Blob(["\uFEFF"+re],{type:"text/csv;charset=utf-8"}),Je=URL.createObjectURL(Ve),qe=document.createElement("a");qe.href=Je,qe.download="批量铺货模板.csv",document.body.appendChild(qe),qe.click(),qe.remove(),URL.revokeObjectURL(Je)},Oe=()=>{_(n=>({...n,cookie_id:$||n.cookie_id})),W(!0)},Ye=()=>{U(n=>({...n,cookie_id:$||n.cookie_id})),ue(!0)},st=n=>i.filter(L=>L.cookie_id===n.cookie_id&&L.item_id===n.item_id).length>0?i.filter(L=>L.cookie_id===n.cookie_id&&L.item_id===n.item_id):i.filter(L=>L.cookie_id===n.cookie_id&&!L.item_id),Xe=n=>{switch(n){case"preview":return"待确认";case"pending":return"等待中";case"running":return"发布中";case"canceling":return"正在安全取消";case"success":return"成功";case"failed":return"失败";case"completed":return"已完成";case"partially_failed":return"部分失败";case"canceled":return"已取消";default:return n||"-"}},ze=n=>{switch(n){case"success":case"completed":return"bg-emerald-50 text-emerald-700 border-emerald-100";case"partially_failed":case"failed":return"bg-red-50 text-red-700 border-red-100";case"running":return"bg-blue-50 text-blue-700 border-blue-100";case"canceled":return"bg-gray-100 text-gray-600 border-gray-200";default:return"bg-amber-50 text-amber-700 border-amber-100"}},We=r.useMemo(()=>new Map(v.map(n=>[n.id,n])),[v]),ct=r.useMemo(()=>I?s.filter(n=>n.cookie_id===I):s,[I,s]),Ge=n=>{const L=We.get(n),re=(L==null?void 0:L.remark)||(L==null?void 0:L.nickname);return re?`${re} · ${n.slice(0,6)}`:`账号 ${n.slice(0,8)}`},dt=n=>{const L=We.get(n);return(L==null?void 0:L.remark)||(L==null?void 0:L.nickname)||"未命名账号"};return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex flex-col xl:flex-row xl:justify-between xl:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"商品管理"}),e.jsx("p",{className:"text-gray-500 mt-2 text-sm",children:"监控并管理所有账号下的闲鱼商品。"})]}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[e.jsxs("div",{className:"flex min-w-[200px] flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"item-account-filter",className:"px-1 text-[11px] font-extrabold tracking-wide text-gray-500",children:"商品列表筛选"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ja,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),e.jsxs("select",{id:"item-account-filter","aria-label":"按账号筛选商品列表",className:"ios-input w-full pl-10 pr-9 py-3 rounded-xl text-sm",value:I,onChange:n=>y(n.target.value),children:[e.jsx("option",{value:"",children:"全部账号"}),v.map(n=>e.jsx("option",{value:n.id,children:Ge(n.id)},n.id))]})]})]}),e.jsxs("div",{className:"flex min-w-[200px] flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"item-sync-account",className:"px-1 text-[11px] font-extrabold tracking-wide text-gray-500",children:"同步商品账号"}),e.jsxs("div",{className:"relative",children:[e.jsx(ot,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),e.jsxs("select",{id:"item-sync-account","aria-label":"选择要同步商品的账号",className:"ios-input w-full pl-10 pr-9 py-3 rounded-xl text-sm",value:$,onChange:n=>f(n.target.value),children:[e.jsx("option",{value:"",children:"请选择账号"}),v.map(n=>e.jsx("option",{value:n.id,children:Ge(n.id)},n.id))]})]})]}),e.jsxs("button",{onClick:C,disabled:J||!$,className:"ios-btn-primary flex items-center gap-2 px-6 py-3 rounded-2xl font-bold shadow-lg shadow-blue-200 disabled:opacity-50",children:[e.jsx(Be,{className:`w-4 h-4 ${J?"animate-spin":""}`}),"同步商品"]}),e.jsxs("button",{onClick:Oe,className:"px-5 py-3 rounded-2xl font-bold bg-gray-900 text-white hover:bg-gray-800 transition-colors flex items-center gap-2 shadow-lg",children:[e.jsx(tt,{className:"w-4 h-4"}),"添加商品"]}),e.jsxs("button",{onClick:Ye,className:"px-5 py-3 rounded-2xl font-bold bg-emerald-600 text-white hover:bg-emerald-700 transition-colors flex items-center gap-2 shadow-lg shadow-emerald-100",children:[e.jsx(Gt,{className:"w-4 h-4"}),"发布商品"]}),e.jsxs("button",{onClick:()=>void Pe(),className:"px-5 py-3 rounded-2xl font-bold bg-blue-600 text-white hover:bg-blue-700 transition-colors flex items-center gap-2 shadow-lg shadow-blue-100",children:[e.jsx(Dt,{className:"w-4 h-4"}),oe&&["running","canceling"].includes(oe.status)?"继续批量任务":"批量铺货"]}),oe&&!["running","canceling"].includes(oe.status)&&e.jsx("button",{onClick:()=>void Te(),className:"px-4 py-3 rounded-2xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",children:"最近批次结果"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4",children:[ct.map(n=>{const L=st(n),re=L.length>0;return e.jsxs("div",{className:"ios-card p-3 rounded-2xl hover:shadow-lg transition-all group r
Line truncated
|
||||
+1
-1
@@ -1 +1 @@
|
||||
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-wLine truncated
|
||||
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-wLine truncated
|
||||
@@ -6,12 +6,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Ydisks闲鱼助手 - 自动发货与管家系统</title>
|
||||
<meta name="description" content="Ydisks闲鱼助手 - 自动回复、自动发货、订单管理、AI智能议价一体化解决方案" />
|
||||
<script type="module" crossorigin src="/static/assets/index-BIyp4is6.js"></script>
|
||||
<script type="module" crossorigin src="/static/assets/index-BItFeCFs.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/static/assets/react-vendor-C_od1ZSF.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/assets/icons-vendor-DjsKcZkz.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/assets/icons-vendor-DF3hof7q.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/assets/vendor-D-Edl3pr.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/assets/charts-vendor-BxxJOyEX.js">
|
||||
<link rel="stylesheet" crossorigin href="/static/assets/index-DtBcYu3b.css">
|
||||
<link rel="stylesheet" crossorigin href="/static/assets/index-Ck_JS4rs.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -286,8 +286,8 @@ func TestPublishWorkflowUsesCookieSessionForEveryRequest(t *testing.T) {
|
||||
fmt.Fprint(w, `{"ret":["SUCCESS::调用成功"],"data":{"commonAddresses":[{"area":"X","city":"Y","divisionId":"1","longitude":118.7,"latitude":31.9,"poiId":"p1","poi":"P","prov":"Z"}]}}`)
|
||||
},
|
||||
"mtop.idle.pc.idleitem.publish": func(w http.ResponseWriter, req *http.Request) {
|
||||
assertCookies(req, "token3", "api_http_only=api")
|
||||
assertSign(req, "token3")
|
||||
assertCookies(req, "token2", "api_http_only=api")
|
||||
assertSign(req, "token2")
|
||||
rotate(w, "token4")
|
||||
fmt.Fprint(w, `{"ret":["SUCCESS::调用成功"],"data":{"itemId":"new-item"}}`)
|
||||
},
|
||||
@@ -297,12 +297,13 @@ func TestPublishWorkflowUsesCookieSessionForEveryRequest(t *testing.T) {
|
||||
Title: "T",
|
||||
PriceCents: 100,
|
||||
Quantity: 1,
|
||||
Location: &PublishLocation{Area: "X", City: "Y", DivisionID: "1", Longitude: 118.7, Latitude: 31.9, POIID: "p1", POIName: "P", Province: "Z"},
|
||||
Images: []PublishImage{{Filename: "a.png", ContentType: "image/png", Data: tinyPNG(t)}},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("PublishItem: %v", err)
|
||||
}
|
||||
if requestCount != 4 || result.ItemID != "new-item" || !strings.Contains(result.UpdatedCookies, "_m_h5_tk=token4_1") {
|
||||
if requestCount != 3 || result.ItemID != "new-item" || !strings.Contains(result.UpdatedCookies, "_m_h5_tk=token4_1") {
|
||||
t.Fatalf("requests=%d result=%+v", requestCount, result)
|
||||
}
|
||||
canonical, _, changed := session.State()
|
||||
|
||||
@@ -73,6 +73,18 @@ type PublishCategory struct {
|
||||
TBCatID string `json:"tb_cat_id,omitempty"`
|
||||
}
|
||||
|
||||
// PublishLocation 是闲鱼定位接口返回、可直接用于发布商品的发货地。
|
||||
type PublishLocation struct {
|
||||
Area string `json:"area"`
|
||||
City string `json:"city"`
|
||||
DivisionID string `json:"division_id"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
POIID string `json:"poi_id"`
|
||||
POIName string `json:"poi_name"`
|
||||
Province string `json:"province"`
|
||||
}
|
||||
|
||||
// DefaultVirtualPublishCategory 是从闲鱼类目推荐响应中核实的“电子资料”类目。
|
||||
// 该类目没有 tbCatId,发布时必须保留为空而不是伪造淘宝类目 ID。
|
||||
func DefaultVirtualPublishCategory() PublishCategory {
|
||||
@@ -91,9 +103,10 @@ type PublishItemRequest struct {
|
||||
Quantity int
|
||||
PostageMode string
|
||||
PostageCents int64
|
||||
// Virtual 表示商品只通过系统的虚拟发货流程交付,不需要实物发货地址。
|
||||
// Virtual 表示商品通过系统的虚拟发货流程交付;显式提供 Location 时仍会向闲鱼提交发货地。
|
||||
Virtual bool
|
||||
PreferredCategory *PublishCategory
|
||||
Location *PublishLocation
|
||||
Images []PublishImage
|
||||
}
|
||||
|
||||
@@ -171,17 +184,35 @@ func (c *ClientImpl) PublishItem(ctx context.Context, cookiesStr string, req Pub
|
||||
}
|
||||
}
|
||||
}
|
||||
var location map[string]any
|
||||
if !req.Virtual {
|
||||
location, updated, err = c.defaultPublishLocation(ctx, currentCookies)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if updated != "" {
|
||||
currentCookies = updated
|
||||
return c.publishItemOnce(ctx, currentCookies, req, uploaded, category)
|
||||
}
|
||||
|
||||
// PublishLocations 根据浏览器提供的真实坐标查询闲鱼可用的发货地。
|
||||
func (c *ClientImpl) PublishLocations(ctx context.Context, cookiesStr string, longitude, latitude float64) ([]PublishLocation, string, error) {
|
||||
if longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90 || (longitude == 0 && latitude == 0) {
|
||||
return nil, cookiesStr, errors.New("经纬度无效")
|
||||
}
|
||||
data := map[string]any{"longitude": longitude, "latitude": latitude}
|
||||
decoded, updated, err := c.callMTop(ctx, cookiesStr, DefaultLocationAPI, "mtop.taobao.idle.local.poi.get", "1.0", "a21ybx.publish.0.0", "a21ybx.item.sidebar.1.38262218ame5nr", "38262218ame5nr", data)
|
||||
if err != nil {
|
||||
return nil, updated, err
|
||||
}
|
||||
if !hasMTopSuccess(retFromDecoded(decoded)) {
|
||||
return nil, updated, classifyPublishError(retFromDecoded(decoded), decoded)
|
||||
}
|
||||
dataMap := mapFromAny(decoded["data"])
|
||||
addresses, _ := dataMap["commonAddresses"].([]any)
|
||||
locations := make([]PublishLocation, 0, len(addresses))
|
||||
for _, raw := range addresses {
|
||||
loc := publishLocationFromMap(mapFromAny(raw))
|
||||
if validPublishLocation(loc) {
|
||||
locations = append(locations, loc)
|
||||
}
|
||||
}
|
||||
return c.publishItemOnce(ctx, currentCookies, req, uploaded, category, location)
|
||||
if len(locations) == 0 {
|
||||
return nil, updated, errors.New("当前位置没有可用的闲鱼发货地,请在闲鱼中完善地址后重试")
|
||||
}
|
||||
return locations, updated, nil
|
||||
}
|
||||
|
||||
// RecommendPublishCategory 根据关键词调用闲鱼推荐接口,返回可直接用于发布的完整类目。
|
||||
@@ -398,28 +429,35 @@ func fallbackPublishCategory(category PublishCategory) map[string]any {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ClientImpl) defaultPublishLocation(ctx context.Context, cookiesStr string) (map[string]any, string, error) {
|
||||
data := map[string]any{"longitude": 118.78248347393424, "latitude": 31.91629189813543}
|
||||
decoded, updated, err := c.callMTop(ctx, cookiesStr, DefaultLocationAPI, "mtop.taobao.idle.local.poi.get", "1.0", "a21ybx.publish.0.0", "a21ybx.item.sidebar.1.38262218ame5nr", "38262218ame5nr", data)
|
||||
if err != nil {
|
||||
return nil, updated, err
|
||||
func publishLocationFromMap(loc map[string]any) PublishLocation {
|
||||
return PublishLocation{
|
||||
Area: strings.TrimSpace(mtopString(loc["area"])), City: strings.TrimSpace(mtopString(loc["city"])),
|
||||
DivisionID: strings.TrimSpace(mtopString(loc["divisionId"])), Longitude: numberFromAny(loc["longitude"]),
|
||||
Latitude: numberFromAny(loc["latitude"]), POIID: strings.TrimSpace(mtopString(loc["poiId"])),
|
||||
POIName: strings.TrimSpace(mtopString(loc["poi"])), Province: strings.TrimSpace(mtopString(loc["prov"])),
|
||||
}
|
||||
if !hasMTopSuccess(retFromDecoded(decoded)) {
|
||||
return nil, updated, classifyPublishError(retFromDecoded(decoded), decoded)
|
||||
}
|
||||
dataMap := mapFromAny(decoded["data"])
|
||||
addresses, _ := dataMap["commonAddresses"].([]any)
|
||||
if len(addresses) == 0 {
|
||||
return nil, updated, fmt.Errorf("账号缺少默认发货地址/定位信息,无法发布商品")
|
||||
}
|
||||
loc := mapFromAny(addresses[0])
|
||||
if loc == nil {
|
||||
return nil, updated, fmt.Errorf("默认地址格式异常,无法发布商品")
|
||||
}
|
||||
return loc, updated, nil
|
||||
}
|
||||
|
||||
func (c *ClientImpl) publishItemOnce(ctx context.Context, cookiesStr string, req PublishItemRequest, images []uploadedImage, category, location map[string]any) (*PublishItemResult, error) {
|
||||
func validPublishLocation(loc PublishLocation) bool {
|
||||
return loc.DivisionID != "" && loc.Province != "" && loc.City != "" && loc.Longitude >= -180 && loc.Longitude <= 180 && loc.Latitude >= -90 && loc.Latitude <= 90 && !(loc.Longitude == 0 && loc.Latitude == 0)
|
||||
}
|
||||
|
||||
func numberFromAny(v any) float64 {
|
||||
switch n := v.(type) {
|
||||
case float64:
|
||||
return n
|
||||
case json.Number:
|
||||
f, _ := n.Float64()
|
||||
return f
|
||||
case string:
|
||||
f, _ := strconv.ParseFloat(strings.TrimSpace(n), 64)
|
||||
return f
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ClientImpl) publishItemOnce(ctx context.Context, cookiesStr string, req PublishItemRequest, images []uploadedImage, category map[string]any) (*PublishItemResult, error) {
|
||||
imagePayloads := make([]any, 0, len(images))
|
||||
for i, img := range images {
|
||||
imagePayloads = append(imagePayloads, publishImagePayload(img, i == 0))
|
||||
@@ -450,16 +488,17 @@ func (c *ClientImpl) publishItemOnce(ctx context.Context, cookiesStr string, req
|
||||
"bizcode": "pcMainPublish",
|
||||
"publishScene": "pcMainPublish",
|
||||
}
|
||||
if !req.Virtual {
|
||||
data["itemAddrDTO"] = map[string]any{
|
||||
"area": location["area"],
|
||||
"city": location["city"],
|
||||
"divisionId": location["divisionId"],
|
||||
"gps": fmt.Sprintf("%s,%s", mtopString(location["longitude"]), mtopString(location["latitude"])),
|
||||
"poiId": location["poiId"],
|
||||
"poiName": location["poi"],
|
||||
"prov": location["prov"],
|
||||
if req.Location != nil {
|
||||
if !validPublishLocation(*req.Location) {
|
||||
return nil, errors.New("发货地信息不完整,请重新定位并选择")
|
||||
}
|
||||
data["itemAddrDTO"] = map[string]any{
|
||||
"area": req.Location.Area, "city": req.Location.City, "divisionId": req.Location.DivisionID,
|
||||
"gps": fmt.Sprintf("%s,%s", strconv.FormatFloat(req.Location.Longitude, 'f', -1, 64), strconv.FormatFloat(req.Location.Latitude, 'f', -1, 64)),
|
||||
"poiId": req.Location.POIID, "poiName": req.Location.POIName, "prov": req.Location.Province,
|
||||
}
|
||||
} else if !req.Virtual {
|
||||
return nil, errors.New("发布实物商品前必须选择发货地")
|
||||
}
|
||||
decoded, updated, err := c.callMTop(ctx, cookiesStr, PublishItemAPI, "mtop.idle.pc.idleitem.publish", "1.0", "a21ybx.publish.0.0", "a21ybx.home.sidebar.1.46413da6EPl7v5", "46413da6EPl7v5", data)
|
||||
if err != nil {
|
||||
|
||||
@@ -110,6 +110,7 @@ func TestPublishItemDescriptionDefaultsToTitle(t *testing.T) {
|
||||
Quantity: 1,
|
||||
PostageMode: "fixed",
|
||||
PostageCents: 500,
|
||||
Location: &PublishLocation{Area: "X", City: "Y", DivisionID: "1", Longitude: 118.7, Latitude: 31.9, POIID: "p1", POIName: "P", Province: "Z"},
|
||||
Images: []PublishImage{{Filename: "a.png", ContentType: "image/png", Data: png1}},
|
||||
}
|
||||
res, err := client.PublishItem(context.Background(), consignCookies, req)
|
||||
@@ -210,7 +211,7 @@ func TestPublishItemRecommendCategoryMissingDataUsesElectronicMaterials(t *testi
|
||||
}
|
||||
}
|
||||
|
||||
// TestPublishItemLocationFailure: 默认地址缺失。
|
||||
// TestPublishItemLocationFailure: 实物发布没有选择发货地。
|
||||
func TestPublishItemLocationFailure(t *testing.T) {
|
||||
png1 := tinyPNG(t)
|
||||
dt := &dispatchTransport{handlers: map[string]http.HandlerFunc{
|
||||
@@ -232,7 +233,7 @@ func TestPublishItemLocationFailure(t *testing.T) {
|
||||
Images: []PublishImage{{Filename: "a.png", ContentType: "image/png", Data: png1}},
|
||||
}
|
||||
_, err := client.PublishItem(context.Background(), consignCookies, req)
|
||||
if err == nil || !strings.Contains(err.Error(), "缺少默认发货地址") {
|
||||
if err == nil || !strings.Contains(err.Error(), "必须选择发货地") {
|
||||
t.Fatalf("err=%v", err)
|
||||
}
|
||||
}
|
||||
@@ -378,6 +379,7 @@ func TestPublishItemFinalPublishFailure(t *testing.T) {
|
||||
Quantity: 1,
|
||||
PostageMode: "fixed",
|
||||
PostageCents: 500,
|
||||
Location: &PublishLocation{Area: "X", City: "Y", DivisionID: "1", Longitude: 118.7, Latitude: 31.9, POIID: "p1", POIName: "P", Province: "Z"},
|
||||
Images: []PublishImage{{Filename: "a.png", ContentType: "image/png", Data: png1}},
|
||||
}
|
||||
_, err := client.PublishItem(context.Background(), consignCookies, req)
|
||||
@@ -412,6 +414,7 @@ func TestPublishItemStockPermissionError(t *testing.T) {
|
||||
Title: "T",
|
||||
PriceCents: 1000,
|
||||
Quantity: 1,
|
||||
Location: &PublishLocation{Area: "X", City: "Y", DivisionID: "1", Longitude: 118.7, Latitude: 31.9, POIID: "p1", POIName: "P", Province: "Z"},
|
||||
Images: []PublishImage{{Filename: "a.png", ContentType: "image/png", Data: png1}},
|
||||
}
|
||||
_, err := client.PublishItem(context.Background(), consignCookies, req)
|
||||
@@ -618,25 +621,30 @@ func TestRecommendPublishCategoryEmptyCatId(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- defaultPublishLocation 直接测试 ----
|
||||
// ---- PublishLocations 真实坐标查询测试 ----
|
||||
|
||||
func TestDefaultPublishLocationSuccess(t *testing.T) {
|
||||
func TestPublishLocationsUsesProvidedCoordinates(t *testing.T) {
|
||||
var requested map[string]any
|
||||
dt := &dispatchTransport{handlers: map[string]http.HandlerFunc{
|
||||
"mtop.taobao.idle.local.poi.get": func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, `{"ret":["SUCCESS::调用成功"],"data":{"commonAddresses":[{"area":"A","city":"C","divisionId":"1","poiId":"p","poi":"P","prov":"PR"}]}}`)
|
||||
requested, _ = parseDataURL(readBody(r))
|
||||
fmt.Fprint(w, `{"ret":["SUCCESS::调用成功"],"data":{"commonAddresses":[{"area":"A","city":"C","divisionId":"1","longitude":118.7,"latitude":31.9,"poiId":"p","poi":"P","prov":"PR"},{"area":"A","city":"C","divisionId":"1","longitude":118.71,"latitude":31.91,"poiId":"p2","poi":"P2","prov":"PR"}]}}`)
|
||||
},
|
||||
}}
|
||||
client := &ClientImpl{HTTPClient: &http.Client{Transport: dt}}
|
||||
loc, _, err := client.defaultPublishLocation(context.Background(), consignCookies)
|
||||
locations, _, err := client.PublishLocations(context.Background(), consignCookies, 118.7, 31.9)
|
||||
if err != nil {
|
||||
t.Fatalf("err=%v", err)
|
||||
}
|
||||
if loc["area"] != "A" || loc["city"] != "C" {
|
||||
t.Fatalf("loc=%+v", loc)
|
||||
if requested["longitude"] != float64(118.7) || requested["latitude"] != float64(31.9) {
|
||||
t.Fatalf("查询坐标=%+v", requested)
|
||||
}
|
||||
if len(locations) != 2 || locations[0].Area != "A" || locations[1].POIID != "p2" {
|
||||
t.Fatalf("locations=%+v", locations)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultPublishLocationMalformedAddress(t *testing.T) {
|
||||
func TestPublishLocationsMalformedAddress(t *testing.T) {
|
||||
dt := &dispatchTransport{handlers: map[string]http.HandlerFunc{
|
||||
"mtop.taobao.idle.local.poi.get": func(w http.ResponseWriter, r *http.Request) {
|
||||
// commonAddresses[0] 不是 map
|
||||
@@ -644,8 +652,8 @@ func TestDefaultPublishLocationMalformedAddress(t *testing.T) {
|
||||
},
|
||||
}}
|
||||
client := &ClientImpl{HTTPClient: &http.Client{Transport: dt}}
|
||||
_, _, err := client.defaultPublishLocation(context.Background(), consignCookies)
|
||||
if err == nil || !strings.Contains(err.Error(), "默认地址格式异常") {
|
||||
_, _, err := client.PublishLocations(context.Background(), consignCookies, 118.7, 31.9)
|
||||
if err == nil || !strings.Contains(err.Error(), "没有可用") {
|
||||
t.Fatalf("err=%v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user