@jctrans-materials/comps-vue3 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/H5/mSearch/common.d.ts +16 -0
- package/dist/components/H5/mSearch/hooks/useFloating.d.ts +8 -0
- package/dist/components/H5/mSearch/hooks/useSearchHistory.d.ts +29 -0
- package/dist/components/H5/mSearch/hooks/useSearchLogic.d.ts +30 -0
- package/dist/components/H5/mSearch/index.d.ts +41 -0
- package/dist/components/search/hooks/useSearchHistory.d.ts +6 -2
- package/dist/components/search/hooks/useSearchLogic.d.ts +4 -0
- package/dist/components/search/index.d.ts +20 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.esm.js +1231 -859
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LocationType } from '@jctrans-materials/shared';
|
|
2
|
+
|
|
3
|
+
export declare function getCountryApi(key: string): Promise<import('@jctrans-materials/shared').BaseResponse<import('@jctrans-materials/shared').UnifiedItem>>;
|
|
4
|
+
export declare function searchAllApi(key: string, types: LocationType[]): Promise<import('@jctrans-materials/shared').BaseResponse<import('@jctrans-materials/shared').UnifiedItem>>;
|
|
5
|
+
export declare function searchByNameApi(key: string, types?: LocationType[], other?: {}): Promise<{
|
|
6
|
+
records: import('@jctrans-materials/shared').LocationUnifiedItem[];
|
|
7
|
+
total: number;
|
|
8
|
+
current: number;
|
|
9
|
+
size: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const searchByIdWithTypeApi: (id: string | number, type: LocationType) => Promise<{
|
|
12
|
+
records: import('@jctrans-materials/shared').LocationUnifiedItem[];
|
|
13
|
+
total: number;
|
|
14
|
+
current: number;
|
|
15
|
+
size: number;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties, Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface UseFloatingReturn {
|
|
4
|
+
floatingStyles: Ref<CSSProperties>;
|
|
5
|
+
startTrack: () => void;
|
|
6
|
+
stopTrack: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useFloating(reference: Ref<HTMLElement | null>, floating: Ref<HTMLElement | null>): UseFloatingReturn;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SearchItem } from '../type';
|
|
3
|
+
|
|
4
|
+
export declare function useSearchHistory(historyKey: Ref<string | undefined>): {
|
|
5
|
+
searchHistory: Ref<{
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
id?: string | number | undefined;
|
|
8
|
+
type: string;
|
|
9
|
+
display?: string | undefined;
|
|
10
|
+
displayEn?: string | undefined;
|
|
11
|
+
displayCn?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
nameEn?: string | undefined;
|
|
14
|
+
nameCn?: string | undefined;
|
|
15
|
+
}[], SearchItem[] | {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
id?: string | number | undefined;
|
|
18
|
+
type: string;
|
|
19
|
+
display?: string | undefined;
|
|
20
|
+
displayEn?: string | undefined;
|
|
21
|
+
displayCn?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
nameEn?: string | undefined;
|
|
24
|
+
nameCn?: string | undefined;
|
|
25
|
+
}[]>;
|
|
26
|
+
saveToHistory: (item: SearchItem) => void;
|
|
27
|
+
clearHistory: () => void;
|
|
28
|
+
HasHistory: import('vue').ComputedRef<boolean>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SearchItem } from '../type';
|
|
3
|
+
|
|
4
|
+
export declare function useSearchLogic(query: Ref<string>, searchTypeList: Ref<string[]>): {
|
|
5
|
+
searchResults: Ref<{
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
id?: string | number | undefined;
|
|
8
|
+
type: string;
|
|
9
|
+
display?: string | undefined;
|
|
10
|
+
displayEn?: string | undefined;
|
|
11
|
+
displayCn?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
nameEn?: string | undefined;
|
|
14
|
+
nameCn?: string | undefined;
|
|
15
|
+
}[], SearchItem[] | {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
id?: string | number | undefined;
|
|
18
|
+
type: string;
|
|
19
|
+
display?: string | undefined;
|
|
20
|
+
displayEn?: string | undefined;
|
|
21
|
+
displayCn?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
nameEn?: string | undefined;
|
|
24
|
+
nameCn?: string | undefined;
|
|
25
|
+
}[]>;
|
|
26
|
+
loading: Ref<boolean, boolean>;
|
|
27
|
+
isFetchingMore: Ref<boolean, boolean>;
|
|
28
|
+
isFinished: Ref<boolean, boolean>;
|
|
29
|
+
fetchData: (append?: boolean) => Promise<void>;
|
|
30
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
modelValue?: any;
|
|
3
|
+
multiple?: boolean;
|
|
4
|
+
lang?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
historyKey?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
9
|
+
lang: string;
|
|
10
|
+
multiple: boolean;
|
|
11
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
select: (...args: any[]) => void;
|
|
13
|
+
"update:modelValue": (...args: any[]) => void;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
15
|
+
lang: string;
|
|
16
|
+
multiple: boolean;
|
|
17
|
+
}>>> & Readonly<{
|
|
18
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
multiple: boolean;
|
|
22
|
+
lang: string;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
27
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
+
} : {
|
|
30
|
+
type: import('vue').PropType<T[K]>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Prettify<T> = {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} & {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { SearchItem } from '../type';
|
|
3
3
|
|
|
4
|
-
export declare function useSearchHistory(historyKey: Ref<string>): {
|
|
4
|
+
export declare function useSearchHistory(historyKey: Ref<string | undefined>): {
|
|
5
5
|
searchHistory: Ref<{
|
|
6
6
|
[x: string]: any;
|
|
7
7
|
id?: string | number | undefined;
|
|
8
8
|
type: string;
|
|
9
9
|
display?: string | undefined;
|
|
10
|
+
displayEn?: string | undefined;
|
|
11
|
+
displayCn?: string | undefined;
|
|
10
12
|
name?: string | undefined;
|
|
11
13
|
nameEn?: string | undefined;
|
|
12
14
|
nameCn?: string | undefined;
|
|
@@ -15,11 +17,13 @@ export declare function useSearchHistory(historyKey: Ref<string>): {
|
|
|
15
17
|
id?: string | number | undefined;
|
|
16
18
|
type: string;
|
|
17
19
|
display?: string | undefined;
|
|
20
|
+
displayEn?: string | undefined;
|
|
21
|
+
displayCn?: string | undefined;
|
|
18
22
|
name?: string | undefined;
|
|
19
23
|
nameEn?: string | undefined;
|
|
20
24
|
nameCn?: string | undefined;
|
|
21
25
|
}[]>;
|
|
22
26
|
saveToHistory: (item: SearchItem) => void;
|
|
23
27
|
clearHistory: () => void;
|
|
24
|
-
HasHistory: import('vue').ComputedRef<boolean
|
|
28
|
+
HasHistory: import('vue').ComputedRef<boolean>;
|
|
25
29
|
};
|
|
@@ -7,6 +7,8 @@ export declare function useSearchLogic(query: Ref<string>, searchTypeList: Ref<s
|
|
|
7
7
|
id?: string | number | undefined;
|
|
8
8
|
type: string;
|
|
9
9
|
display?: string | undefined;
|
|
10
|
+
displayEn?: string | undefined;
|
|
11
|
+
displayCn?: string | undefined;
|
|
10
12
|
name?: string | undefined;
|
|
11
13
|
nameEn?: string | undefined;
|
|
12
14
|
nameCn?: string | undefined;
|
|
@@ -15,6 +17,8 @@ export declare function useSearchLogic(query: Ref<string>, searchTypeList: Ref<s
|
|
|
15
17
|
id?: string | number | undefined;
|
|
16
18
|
type: string;
|
|
17
19
|
display?: string | undefined;
|
|
20
|
+
displayEn?: string | undefined;
|
|
21
|
+
displayCn?: string | undefined;
|
|
18
22
|
name?: string | undefined;
|
|
19
23
|
nameEn?: string | undefined;
|
|
20
24
|
nameCn?: string | undefined;
|
|
@@ -6,6 +6,10 @@ interface Props {
|
|
|
6
6
|
collapseTags?: boolean;
|
|
7
7
|
searchTypeList?: string[];
|
|
8
8
|
historyKey?: string;
|
|
9
|
+
lang?: "" | "en" | "cn" | "en-US" | "zh-CN";
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
showSearchIcon?: boolean;
|
|
12
|
+
showItemTag?: boolean;
|
|
9
13
|
}
|
|
10
14
|
declare function __VLS_template(): {
|
|
11
15
|
history?(_: {
|
|
@@ -14,6 +18,8 @@ declare function __VLS_template(): {
|
|
|
14
18
|
id?: string | number | undefined;
|
|
15
19
|
type: string;
|
|
16
20
|
display?: string | undefined;
|
|
21
|
+
displayEn?: string | undefined;
|
|
22
|
+
displayCn?: string | undefined;
|
|
17
23
|
name?: string | undefined;
|
|
18
24
|
nameEn?: string | undefined;
|
|
19
25
|
nameCn?: string | undefined;
|
|
@@ -25,6 +31,8 @@ declare function __VLS_template(): {
|
|
|
25
31
|
id?: string | number | undefined;
|
|
26
32
|
type: string;
|
|
27
33
|
display?: string | undefined;
|
|
34
|
+
displayEn?: string | undefined;
|
|
35
|
+
displayCn?: string | undefined;
|
|
28
36
|
name?: string | undefined;
|
|
29
37
|
nameEn?: string | undefined;
|
|
30
38
|
nameCn?: string | undefined;
|
|
@@ -37,7 +45,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
37
45
|
multiple: boolean;
|
|
38
46
|
collapseTags: boolean;
|
|
39
47
|
searchTypeList: () => string[];
|
|
40
|
-
historyKey:
|
|
48
|
+
historyKey: undefined;
|
|
49
|
+
lang: string;
|
|
50
|
+
showSearchIcon: boolean;
|
|
51
|
+
showItemTag: boolean;
|
|
41
52
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
42
53
|
change: (...args: any[]) => void;
|
|
43
54
|
select: (...args: any[]) => void;
|
|
@@ -49,7 +60,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
49
60
|
multiple: boolean;
|
|
50
61
|
collapseTags: boolean;
|
|
51
62
|
searchTypeList: () => string[];
|
|
52
|
-
historyKey:
|
|
63
|
+
historyKey: undefined;
|
|
64
|
+
lang: string;
|
|
65
|
+
showSearchIcon: boolean;
|
|
66
|
+
showItemTag: boolean;
|
|
53
67
|
}>>> & Readonly<{
|
|
54
68
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
55
69
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
@@ -59,9 +73,12 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
59
73
|
}>, {
|
|
60
74
|
modelValue: SearchItem | SearchItem[] | null;
|
|
61
75
|
multiple: boolean;
|
|
76
|
+
lang: "" | "en" | "cn" | "en-US" | "zh-CN";
|
|
77
|
+
historyKey: string;
|
|
62
78
|
collapseTags: boolean;
|
|
63
79
|
searchTypeList: string[];
|
|
64
|
-
|
|
80
|
+
showSearchIcon: boolean;
|
|
81
|
+
showItemTag: boolean;
|
|
65
82
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
66
83
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
67
84
|
export default _default;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),N=require("@jctrans-materials/shared"),k=require("element-plus");function nt(e){const n=t.ref([]),o="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",i=t.computed(()=>(e.value||"")+o),s=t.computed(()=>e.value&&e.value!==""),a=f=>{if(!f||!l)return;const r=n.value.filter(m=>m.id&&m.id!==f.id||m.display!==f.display);r.unshift(f);const u=r.slice(0,4);if(n.value=u,s.value)try{localStorage.setItem(i.value,JSON.stringify(u))}catch(m){console.warn("LocalStorage save failed:",m)}},c=()=>{n.value=[],l&&localStorage.removeItem(i.value)};return t.onMounted(()=>{if(l&&s.value){const f=localStorage.getItem(i.value);if(f)try{n.value=JSON.parse(f)}catch{n.value=[]}}}),{searchHistory:n,saveToHistory:a,clearHistory:c,HasHistory:s}}async function ot(e,n=["Continent","Country","City","Seaport","Airport"],o={}){return N.locationSearchV2.searchByName({keyword:e,displayInfo:n,...o})}const lt=(e,n)=>N.locationSearchV2.searchByIdWithType(e,n);function it(e,n){const o=t.ref([]),l=t.ref(!1),i=t.ref(!1),s=t.ref(1),a=t.ref(0),c=t.ref(10),f=t.computed(()=>a.value===0?!1:o.value.length>=a.value),r=t.computed(()=>{const d=[...n.value];return d.includes("Country")&&!d.includes("Region")&&d.push("Region"),d}),u=d=>!d||!Array.isArray(d)?[]:d.filter(p=>r.value.includes(p.type));return{searchResults:o,loading:l,isFetchingMore:i,isFinished:f,currentPage:s,total:a,fetchData:async(d=1,p=!1)=>{if(!e.value.trim()&&!p){o.value=[],a.value=0;return}if(!(p&&(i.value||f.value))&&!(!p&&l.value)){p?i.value=!0:(l.value=!0,s.value=1);try{const h=await ot(e.value,n.value,{current:d,size:c.value}),y=h.records||[],g=u(y);p?o.value=[...o.value,...g]:o.value=g,a.value=h.total||0,s.value=d}catch(h){console.error("Failed to fetch search results:",h)}finally{l.value=!1,i.value=!1}}},filterByTypes:u}}const ee=Math.min,O=Math.max,ue=Math.round,ce=Math.floor,Q=e=>({x:e,y:e}),rt={left:"right",right:"left",bottom:"top",top:"bottom"},st={start:"end",end:"start"};function Se(e,n,o){return O(e,ee(n,o))}function ie(e,n){return typeof e=="function"?e(n):e}function Y(e){return e.split("-")[0]}function re(e){return e.split("-")[1]}function _e(e){return e==="x"?"y":"x"}function Ie(e){return e==="y"?"height":"width"}const at=new Set(["top","bottom"]);function G(e){return at.has(Y(e))?"y":"x"}function Pe(e){return _e(G(e))}function ct(e,n,o){o===void 0&&(o=!1);const l=re(e),i=Pe(e),s=Ie(i);let a=i==="x"?l===(o?"end":"start")?"right":"left":l==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(a=fe(a)),[a,fe(a)]}function ut(e){const n=fe(e);return[Ae(e),n,Ae(n)]}function Ae(e){return e.replace(/start|end/g,n=>st[n])}const Re=["left","right"],Oe=["right","left"],ft=["top","bottom"],dt=["bottom","top"];function mt(e,n,o){switch(e){case"top":case"bottom":return o?n?Oe:Re:n?Re:Oe;case"left":case"right":return n?ft:dt;default:return[]}}function pt(e,n,o,l){const i=re(e);let s=mt(Y(e),o==="start",l);return i&&(s=s.map(a=>a+"-"+i),n&&(s=s.concat(s.map(Ae)))),s}function fe(e){return e.replace(/left|right|bottom|top/g,n=>rt[n])}function ht(e){return{top:0,right:0,bottom:0,left:0,...e}}function gt(e){return typeof e!="number"?ht(e):{top:e,right:e,bottom:e,left:e}}function de(e){const{x:n,y:o,width:l,height:i}=e;return{width:l,height:i,top:o,left:n,right:n+l,bottom:o+i,x:n,y:o}}function Be(e,n,o){let{reference:l,floating:i}=e;const s=G(n),a=Pe(n),c=Ie(a),f=Y(n),r=s==="y",u=l.x+l.width/2-i.width/2,m=l.y+l.height/2-i.height/2,d=l[c]/2-i[c]/2;let p;switch(f){case"top":p={x:u,y:l.y-i.height};break;case"bottom":p={x:u,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:m};break;case"left":p={x:l.x-i.width,y:m};break;default:p={x:l.x,y:l.y}}switch(re(n)){case"start":p[a]-=d*(o&&r?-1:1);break;case"end":p[a]+=d*(o&&r?-1:1);break}return p}const vt=async(e,n,o)=>{const{placement:l="bottom",strategy:i="absolute",middleware:s=[],platform:a}=o,c=s.filter(Boolean),f=await(a.isRTL==null?void 0:a.isRTL(n));let r=await a.getElementRects({reference:e,floating:n,strategy:i}),{x:u,y:m}=Be(r,l,f),d=l,p={},h=0;for(let y=0;y<c.length;y++){const{name:g,fn:A}=c[y],{x:w,y:x,data:V,reset:E}=await A({x:u,y:m,initialPlacement:l,placement:d,strategy:i,middlewareData:p,rects:r,platform:a,elements:{reference:e,floating:n}});u=w??u,m=x??m,p={...p,[g]:{...p[g],...V}},E&&h<=50&&(h++,typeof E=="object"&&(E.placement&&(d=E.placement),E.rects&&(r=E.rects===!0?await a.getElementRects({reference:e,floating:n,strategy:i}):E.rects),{x:u,y:m}=Be(r,d,f)),y=-1)}return{x:u,y:m,placement:d,strategy:i,middlewareData:p}};async function xe(e,n){var o;n===void 0&&(n={});const{x:l,y:i,platform:s,rects:a,elements:c,strategy:f}=e,{boundary:r="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:d=!1,padding:p=0}=ie(n,e),h=gt(p),g=c[d?m==="floating"?"reference":"floating":m],A=de(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(g)))==null||o?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:r,rootBoundary:u,strategy:f})),w=m==="floating"?{x:l,y:i,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),V=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=de(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:f}):w);return{top:(A.top-E.top+h.top)/V.y,bottom:(E.bottom-A.bottom+h.bottom)/V.y,left:(A.left-E.left+h.left)/V.x,right:(E.right-A.right+h.right)/V.x}}const yt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var o,l;const{placement:i,middlewareData:s,rects:a,initialPlacement:c,platform:f,elements:r}=n,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...g}=ie(e,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const A=Y(i),w=G(c),x=Y(c)===c,V=await(f.isRTL==null?void 0:f.isRTL(r.floating)),E=d||(x||!y?[fe(c)]:ut(c)),_=h!=="none";!d&&_&&E.push(...pt(c,y,h,V));const D=[c,...E],I=await xe(n,g),W=[];let T=((l=s.flip)==null?void 0:l.overflows)||[];if(u&&W.push(I[A]),m){const J=ct(i,a,V);W.push(I[J[0]],I[J[1]])}if(T=[...T,{placement:i,overflows:W}],!W.every(J=>J<=0)){var X,K;const J=(((X=s.flip)==null?void 0:X.index)||0)+1,oe=D[J];if(oe&&(!(m==="alignment"?w!==G(oe):!1)||T.every(R=>G(R.placement)===w?R.overflows[0]>0:!0)))return{data:{index:J,overflows:T},reset:{placement:oe}};let q=(K=T.filter(P=>P.overflows[0]<=0).sort((P,R)=>P.overflows[1]-R.overflows[1])[0])==null?void 0:K.placement;if(!q)switch(p){case"bestFit":{var S;const P=(S=T.filter(R=>{if(_){const M=G(R.placement);return M===w||M==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(M=>M>0).reduce((M,ve)=>M+ve,0)]).sort((R,M)=>R[1]-M[1])[0])==null?void 0:S[0];P&&(q=P);break}case"initialPlacement":q=c;break}if(i!==q)return{reset:{placement:q}}}return{}}}},At=new Set(["left","top"]);async function wt(e,n){const{placement:o,platform:l,elements:i}=e,s=await(l.isRTL==null?void 0:l.isRTL(i.floating)),a=Y(o),c=re(o),f=G(o)==="y",r=At.has(a)?-1:1,u=s&&f?-1:1,m=ie(n,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof h=="number"&&(p=c==="end"?h*-1:h),f?{x:p*u,y:d*r}:{x:d*r,y:p*u}}const xt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var o,l;const{x:i,y:s,placement:a,middlewareData:c}=n,f=await wt(n,e);return a===((o=c.offset)==null?void 0:o.placement)&&(l=c.arrow)!=null&&l.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:a}}}}},bt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:o,y:l,placement:i}=n,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:g=>{let{x:A,y:w}=g;return{x:A,y:w}}},...f}=ie(e,n),r={x:o,y:l},u=await xe(n,f),m=G(Y(i)),d=_e(m);let p=r[d],h=r[m];if(s){const g=d==="y"?"top":"left",A=d==="y"?"bottom":"right",w=p+u[g],x=p-u[A];p=Se(w,p,x)}if(a){const g=m==="y"?"top":"left",A=m==="y"?"bottom":"right",w=h+u[g],x=h-u[A];h=Se(w,h,x)}const y=c.fn({...n,[d]:p,[m]:h});return{...y,data:{x:y.x-o,y:y.y-l,enabled:{[d]:s,[m]:a}}}}}},Ct=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var o,l;const{placement:i,rects:s,platform:a,elements:c}=n,{apply:f=()=>{},...r}=ie(e,n),u=await xe(n,r),m=Y(i),d=re(i),p=G(i)==="y",{width:h,height:y}=s.floating;let g,A;m==="top"||m==="bottom"?(g=m,A=d===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(A=m,g=d==="end"?"top":"bottom");const w=y-u.top-u.bottom,x=h-u.left-u.right,V=ee(y-u[g],w),E=ee(h-u[A],x),_=!n.middlewareData.shift;let D=V,I=E;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(I=x),(l=n.middlewareData.shift)!=null&&l.enabled.y&&(D=w),_&&!d){const T=O(u.left,0),X=O(u.right,0),K=O(u.top,0),S=O(u.bottom,0);p?I=h-2*(T!==0||X!==0?T+X:O(u.left,u.right)):D=y-2*(K!==0||S!==0?K+S:O(u.top,u.bottom))}await f({...n,availableWidth:I,availableHeight:D});const W=await a.getDimensions(c.floating);return h!==W.width||y!==W.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<"u"}function ne(e){return Qe(e)?(e.nodeName||"").toLowerCase():"#document"}function B(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function H(e){var n;return(n=(Qe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Qe(e){return me()?e instanceof Node||e instanceof B(e).Node:!1}function L(e){return me()?e instanceof Element||e instanceof B(e).Element:!1}function U(e){return me()?e instanceof HTMLElement||e instanceof B(e).HTMLElement:!1}function De(e){return!me()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}const Et=new Set(["inline","contents"]);function se(e){const{overflow:n,overflowX:o,overflowY:l,display:i}=F(e);return/auto|scroll|overlay|hidden|clip/.test(n+l+o)&&!Et.has(i)}const Vt=new Set(["table","td","th"]);function kt(e){return Vt.has(ne(e))}const Nt=[":popover-open",":modal"];function pe(e){return Nt.some(n=>{try{return e.matches(n)}catch{return!1}})}const St=["transform","translate","scale","rotate","perspective"],Rt=["transform","translate","scale","rotate","perspective","filter"],Ot=["paint","layout","strict","content"];function be(e){const n=Ce(),o=L(e)?F(e):e;return St.some(l=>o[l]?o[l]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!n&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!n&&(o.filter?o.filter!=="none":!1)||Rt.some(l=>(o.willChange||"").includes(l))||Ot.some(l=>(o.contain||"").includes(l))}function Bt(e){let n=z(e);for(;U(n)&&!te(n);){if(be(n))return n;if(pe(n))return null;n=z(n)}return null}function Ce(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dt=new Set(["html","body","#document"]);function te(e){return Dt.has(ne(e))}function F(e){return B(e).getComputedStyle(e)}function he(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function z(e){if(ne(e)==="html")return e;const n=e.assignedSlot||e.parentNode||De(e)&&e.host||H(e);return De(n)?n.host:n}function Ue(e){const n=z(e);return te(n)?e.ownerDocument?e.ownerDocument.body:e.body:U(n)&&se(n)?n:Ue(n)}function le(e,n,o){var l;n===void 0&&(n=[]),o===void 0&&(o=!0);const i=Ue(e),s=i===((l=e.ownerDocument)==null?void 0:l.body),a=B(i);if(s){const c=we(a);return n.concat(a,a.visualViewport||[],se(i)?i:[],c&&o?le(c):[])}return n.concat(i,le(i,[],o))}function we(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function He(e){const n=F(e);let o=parseFloat(n.width)||0,l=parseFloat(n.height)||0;const i=U(e),s=i?e.offsetWidth:o,a=i?e.offsetHeight:l,c=ue(o)!==s||ue(l)!==a;return c&&(o=s,l=a),{width:o,height:l,$:c}}function Ee(e){return L(e)?e:e.contextElement}function $(e){const n=Ee(e);if(!U(n))return Q(1);const o=n.getBoundingClientRect(),{width:l,height:i,$:s}=He(n);let a=(s?ue(o.width):o.width)/l,c=(s?ue(o.height):o.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Tt=Q(0);function We(e){const n=B(e);return!Ce()||!n.visualViewport?Tt:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Mt(e,n,o){return n===void 0&&(n=!1),!o||n&&o!==B(e)?!1:n}function Z(e,n,o,l){n===void 0&&(n=!1),o===void 0&&(o=!1);const i=e.getBoundingClientRect(),s=Ee(e);let a=Q(1);n&&(l?L(l)&&(a=$(l)):a=$(e));const c=Mt(s,o,l)?We(s):Q(0);let f=(i.left+c.x)/a.x,r=(i.top+c.y)/a.y,u=i.width/a.x,m=i.height/a.y;if(s){const d=B(s),p=l&&L(l)?B(l):l;let h=d,y=we(h);for(;y&&l&&p!==h;){const g=$(y),A=y.getBoundingClientRect(),w=F(y),x=A.left+(y.clientLeft+parseFloat(w.paddingLeft))*g.x,V=A.top+(y.clientTop+parseFloat(w.paddingTop))*g.y;f*=g.x,r*=g.y,u*=g.x,m*=g.y,f+=x,r+=V,h=B(y),y=we(h)}}return de({width:u,height:m,x:f,y:r})}function ge(e,n){const o=he(e).scrollLeft;return n?n.left+o:Z(H(e)).left+o}function Je(e,n){const o=e.getBoundingClientRect(),l=o.left+n.scrollLeft-ge(e,o),i=o.top+n.scrollTop;return{x:l,y:i}}function Lt(e){let{elements:n,rect:o,offsetParent:l,strategy:i}=e;const s=i==="fixed",a=H(l),c=n?pe(n.floating):!1;if(l===a||c&&s)return o;let f={scrollLeft:0,scrollTop:0},r=Q(1);const u=Q(0),m=U(l);if((m||!m&&!s)&&((ne(l)!=="body"||se(a))&&(f=he(l)),U(l))){const p=Z(l);r=$(l),u.x=p.x+l.clientLeft,u.y=p.y+l.clientTop}const d=a&&!m&&!s?Je(a,f):Q(0);return{width:o.width*r.x,height:o.height*r.y,x:o.x*r.x-f.scrollLeft*r.x+u.x+d.x,y:o.y*r.y-f.scrollTop*r.y+u.y+d.y}}function Ft(e){return Array.from(e.getClientRects())}function _t(e){const n=H(e),o=he(e),l=e.ownerDocument.body,i=O(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),s=O(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let a=-o.scrollLeft+ge(e);const c=-o.scrollTop;return F(l).direction==="rtl"&&(a+=O(n.clientWidth,l.clientWidth)-i),{width:i,height:s,x:a,y:c}}const Te=25;function It(e,n){const o=B(e),l=H(e),i=o.visualViewport;let s=l.clientWidth,a=l.clientHeight,c=0,f=0;if(i){s=i.width,a=i.height;const u=Ce();(!u||u&&n==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}const r=ge(l);if(r<=0){const u=l.ownerDocument,m=u.body,d=getComputedStyle(m),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(l.clientWidth-m.clientWidth-p);h<=Te&&(s-=h)}else r<=Te&&(s+=r);return{width:s,height:a,x:c,y:f}}const Pt=new Set(["absolute","fixed"]);function Qt(e,n){const o=Z(e,!0,n==="fixed"),l=o.top+e.clientTop,i=o.left+e.clientLeft,s=U(e)?$(e):Q(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,f=i*s.x,r=l*s.y;return{width:a,height:c,x:f,y:r}}function Me(e,n,o){let l;if(n==="viewport")l=It(e,o);else if(n==="document")l=_t(H(e));else if(L(n))l=Qt(n,o);else{const i=We(e);l={x:n.x-i.x,y:n.y-i.y,width:n.width,height:n.height}}return de(l)}function Ge(e,n){const o=z(e);return o===n||!L(o)||te(o)?!1:F(o).position==="fixed"||Ge(o,n)}function Ut(e,n){const o=n.get(e);if(o)return o;let l=le(e,[],!1).filter(c=>L(c)&&ne(c)!=="body"),i=null;const s=F(e).position==="fixed";let a=s?z(e):e;for(;L(a)&&!te(a);){const c=F(a),f=be(a);!f&&c.position==="fixed"&&(i=null),(s?!f&&!i:!f&&c.position==="static"&&!!i&&Pt.has(i.position)||se(a)&&!f&&Ge(e,a))?l=l.filter(u=>u!==a):i=c,a=z(a)}return n.set(e,l),l}function Ht(e){let{element:n,boundary:o,rootBoundary:l,strategy:i}=e;const a=[...o==="clippingAncestors"?pe(n)?[]:Ut(n,this._c):[].concat(o),l],c=a[0],f=a.reduce((r,u)=>{const m=Me(n,u,i);return r.top=O(m.top,r.top),r.right=ee(m.right,r.right),r.bottom=ee(m.bottom,r.bottom),r.left=O(m.left,r.left),r},Me(n,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Wt(e){const{width:n,height:o}=He(e);return{width:n,height:o}}function Jt(e,n,o){const l=U(n),i=H(n),s=o==="fixed",a=Z(e,!0,s,n);let c={scrollLeft:0,scrollTop:0};const f=Q(0);function r(){f.x=ge(i)}if(l||!l&&!s)if((ne(n)!=="body"||se(i))&&(c=he(n)),l){const p=Z(n,!0,s,n);f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}else i&&r();s&&!l&&i&&r();const u=i&&!l&&!s?Je(i,c):Q(0),m=a.left+c.scrollLeft-f.x-u.x,d=a.top+c.scrollTop-f.y-u.y;return{x:m,y:d,width:a.width,height:a.height}}function ye(e){return F(e).position==="static"}function Le(e,n){if(!U(e)||F(e).position==="fixed")return null;if(n)return n(e);let o=e.offsetParent;return H(e)===o&&(o=o.ownerDocument.body),o}function Ke(e,n){const o=B(e);if(pe(e))return o;if(!U(e)){let i=z(e);for(;i&&!te(i);){if(L(i)&&!ye(i))return i;i=z(i)}return o}let l=Le(e,n);for(;l&&kt(l)&&ye(l);)l=Le(l,n);return l&&te(l)&&ye(l)&&!be(l)?o:l||Bt(e)||o}const Gt=async function(e){const n=this.getOffsetParent||Ke,o=this.getDimensions,l=await o(e.floating);return{reference:Jt(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function Kt(e){return F(e).direction==="rtl"}const qt={convertOffsetParentRelativeRectToViewportRelativeRect:Lt,getDocumentElement:H,getClippingRect:Ht,getOffsetParent:Ke,getElementRects:Gt,getClientRects:Ft,getDimensions:Wt,getScale:$,isElement:L,isRTL:Kt};function qe(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Yt(e,n){let o=null,l;const i=H(e);function s(){var c;clearTimeout(l),(c=o)==null||c.disconnect(),o=null}function a(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();const r=e.getBoundingClientRect(),{left:u,top:m,width:d,height:p}=r;if(c||n(),!d||!p)return;const h=ce(m),y=ce(i.clientWidth-(u+d)),g=ce(i.clientHeight-(m+p)),A=ce(u),x={rootMargin:-h+"px "+-y+"px "+-g+"px "+-A+"px",threshold:O(0,ee(1,f))||1};let V=!0;function E(_){const D=_[0].intersectionRatio;if(D!==f){if(!V)return a();D?a(!1,D):l=setTimeout(()=>{a(!1,1e-7)},1e3)}D===1&&!qe(r,e.getBoundingClientRect())&&a(),V=!1}try{o=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{o=new IntersectionObserver(E,x)}o.observe(e)}return a(!0),s}function zt(e,n,o,l){l===void 0&&(l={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=l,r=Ee(e),u=i||s?[...r?le(r):[],...le(n)]:[];u.forEach(A=>{i&&A.addEventListener("scroll",o,{passive:!0}),s&&A.addEventListener("resize",o)});const m=r&&c?Yt(r,o):null;let d=-1,p=null;a&&(p=new ResizeObserver(A=>{let[w]=A;w&&w.target===r&&p&&(p.unobserve(n),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(n)})),o()}),r&&!f&&p.observe(r),p.observe(n));let h,y=f?Z(e):null;f&&g();function g(){const A=Z(e);y&&!qe(y,A)&&o(),y=A,h=requestAnimationFrame(g)}return o(),()=>{var A;u.forEach(w=>{i&&w.removeEventListener("scroll",o),s&&w.removeEventListener("resize",o)}),m?.(),(A=p)==null||A.disconnect(),p=null,f&&cancelAnimationFrame(h)}}const Xt=xt,jt=bt,Zt=yt,$t=Ct,en=(e,n,o)=>{const l=new Map,i={platform:qt,...o},s={...i.platform,_c:l};return vt(e,n,{...i,platform:s})};function tn(e,n){const o=t.ref({position:"fixed",left:"0",top:"0",zIndex:3e3});let l=null;const i=()=>{!e.value||!n.value||en(e.value,n.value,{placement:"bottom-start",strategy:"fixed",middleware:[Xt(6),Zt(),jt({padding:10}),$t({apply({rects:c,elements:f}){const r=`${c.reference.width}px`;Object.assign(f.floating.style,{width:r,minWidth:r,maxWidth:r})}})]}).then(({x:c,y:f})=>{Object.assign(o.value,{left:`${c}px`,top:`${f}px`})})},s=()=>{e.value&&n.value&&(l=zt(e.value,n.value,i))},a=()=>{l&&(l(),l=null)};return t.onBeforeUnmount(a),{floatingStyles:o,startTrack:s,stopTrack:a}}const nn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACT0lEQVR4AaRSO2hTYRT+zn9v2g6CiktFJYoVHXQoOljM2EIEh0orbRKa5qUuDoIZAnXI4FBwcRDikMcNkoQMQjcVESo4OASsW2kLBi3oUKiD1OZx7/H811wJZFF6uOee85/H93/3nKtwQPkvgFKpdKRgVR+UrFrOsurX9N3/DJCvVPxMwx+lKcbgKzbstPhwAXSyWK7eLZZrc4VCNZDPPx/Tt+kCrTqvOrQqfuNrc2OcgW0CduQM9TfJyIB5mQy8UaaxKbftFq3qL9HP1KGGFDe+NDdC/jPnlwgcZEM9lRiU2VFjgngI4FGxa0IvZXecU07XPsc2pkCUIULaa2Z2MsJ7Orkw/8kFiMVCb4XWcQV14w8temL4aJNM47Fh0OHEYqieWAyXT/jPBhzmh7o5EY28Rk/cGWSz2a4GSsTCt3tgs5qmDc726sTQvsS6/c0SFDz97lO/329K4z2Amm1u3ZK11SyrOmNC/ZDYSElWiT5R2resymUZ1pIUv2Qa+iafcrrFretDNJwTf94GUnt7u9u6to3hUW09dQEcIC+BR0LxqgztPnFrotd8wWHclNykaR4dYeCngj0IQNyekOQshLas8hmzLyA3B2UTU6l4eEX8Ld8IZsTu+Mg4hj5xGcTj8f1kLPxChjgO0AdWlAOwnkotbImFrHGFGdOy6u82aJAB+kUZywQ6KaH3ou7TcbguziRApiLWOXjiMvAO2iaic3rH6wxe1Wetd+KRNQKEDV9kwisd83QAQCfkr7uUjEUq2vdUgdJQFExEw++8mLa/AQAA//9h0VsEAAAABklEQVQDAKhs6Pxd3K8TAAAAAElFTkSuQmCC",on="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgUlEQVR4AXRST0hUYRD/zbfbrqahQpAHlQ3dSurYoaBAwWNQkIT7J/ve09DQsOigkNCha4ckl4Lct0/S3QI7REFEBB08FBHRIYLwIJEodOlUurnfNN+6mq9weMPM+818v2/mm1HYQXK5XH02mz9h1fo7pOE/gkwmU+v5+fuGot8phJdWmSLLnl+4I0RV/xIFCGxCdU3DUwaOkULX18Uve1ydrC4xdwLcwRR9bnO2kwQIoCIDEowpXjsZ4vBCSyx+w/Nnb1KElkkwG4OqGhG79QUImEkT0T2JrpZ4fV5sF0Ad6je9BrBKxLeZuVv8rS9IAG4qGf5oTPSolNxIXOyUNjqlpb0W4xI+Cd62dVqcAAGBVqSCVmPMIoPCttzm2MEBAoeLir4hRK2AWPyVIAHRHMH0Ly0tCBF3M5t+Aq6A0HPJSSyCeZAIz7BNAgQwqxNyc1NL7MCoeyH1xNWpuKsTcet7fv46QI0/zdoEtkmAwHGcHyFQj/Q57vuPzm7m+X5efB6HYj3kOCubuLVlApltfdbPX5uaetCmdeKVAqUN1mdy04XR3PTsqAHPWMztTb24myvEBBuRM+WlUnbzDEXeya2D4XC0zrJqnXwsO3pG3mCMGWMK6lQZk2A0hH2GMSxL9VlI6lVkd90RgGKkVFrrc+9REXubjLH9FxfbbVUVGG5v4i2p8LD8x9ax65C66KTfKGCSDc97fv6DJzuf9QtDtm+iqsM1ot70w9O+YDbmSQ6bkkyCJitnAUcnryqmuExgSsZYKypvgFvS+5xVsJk0MGlps97mFCVXpnNZqoBcbo2QyJz7dCLj6JTj6tRxVyf3izZUtNndwM73SU55JzaO4Q8AAAD//54At5MAAAAGSURBVAMAh2IbMAJQAZQAAAAASUVORK5CYII=",ln="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACC0lEQVR4AXxRv2tTURT+zk1iIjgoOMShkIJVNwf/gQYULOjQwaGvGl8TBMEMDg4ODgF17likvL4HIYm4OLg61K2CooWKDoKCDoJDHASb9N17POf5Enwk6eN+9/z+3nfvNZjxbYS9ymbYXlQ8CbvnZrRhKoEOFMl9zFHuuaJA/E4Jp5FMJTCwZWner/veCYX6ecQVsRNrKsFE1yGJDMFW1Hm4FXX7hnIvADquvkJ9zYn/U3vw35chYOA2Ebcc26uWbVWwnKKqOak9ktmmYLwyBATkY+d2b63d2FYgps9umNtTX6G18WTqmNRmTNB+djaIOqEpmC+FIn8Lom4vaD89n2lKgwkCebYNsvEnAlXI4CIMXSagTNa9l9p6Ojc2CUEYhiW5oE3IxQH4AYNFeb5qvea9SuB7Vc1J7ReDjomidZ2RWNKysyneFHNFovGgxIiizoWR9BGRqiKw76i0qj2JAo7jtwycJDvY1eQIDNM0lu+OYrUHf/BBbEmI9sTKP2VvNGpvAP4Kc1SVSGb2OlLiVQa+12srr7UrUZA6Lx27e0HUu6PnU/kOXGbwaT1Gq9XKa80xmgTa1hlFQiBP1hNWn4AdOd8DpmLfgnakYV/yv/UF5ipn+qLyvgGp2us6I/V/R+DYPiYenpKbv0Y8mGeLS0OmhYbvLQuWiGkeFkuGBwtrvrdyMKA5nVGCvwAAAP//q4xnOgAAAAZJREFUAwCH2O8KfEWHWQAAAABJRU5ErkJggg==",rn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACmklEQVR4AXRTT0jUQRT+3uyqGxgYeCiy1JAo6JBUp4Q81EEiKKiDa+H+/ENGHgPpZtChQ4EHL+Ku+9t0V7EkQSGPBYGHBIU6RAqt2cFDBw9C+3de3yy7hobDvHm/+d4337x58xuDQ9r4+FRDLJZqG49PtrvvQ2j4TyDmJ7sm/NRqoMpsIYD3RgIL7pvY54lEqvug0J5APB4PxfzUOwFGRWReVJp7I+GjW+nvxxQo0DagOjLhJxcctyK0J6BS/UaAc1nNtXrdnc88rzPtSMPDwwXiM7R2WNwDpMVKzTTKrSRQTq0tq9mOR55XWliOY2wsVQ+RRWZQiyACjiPQ9pg/0+U4JQEoBkXMi4OLmWpdsEZXofY5yYtSzH10HHJHBPYJMZhyhS8X84U5B+y36iaBNPxMr59nPTo9z8uU4jaToL8Yj88eN2xNTG+3r+/BBncMuSLRln1/+iZgdkhEY2NjvfMVo1DarbG20GIqoPMaqL5G38Zb+GBh36roMufpzc3N3xSvi0ZfX6APEYNAg86bjMluCFDr+7OX1JoWQNJed/ipaK6Z6oOi2dbTZ85eVan+YYLBL7yBdRb9IXkha23aPPa8bQBrFoUVqo4qMMU5mOZ2JBKeo98RiwHi8xQ7Qo6vCsdb6e+//4ubgJegLzlmDOQ6i/XKCVQskZg9aaFtRrBGsYytQpQiu+SPOI5xQ2+kK6mQJRJHo8lko8MqxswGhceCzY25mMnLEmOf3Br6f2/BaLaTqhuSl6/xxPRQNDrJehBRrSWxABMaMnmsKfCN9eEfSZS9lAG9O3OmJ9J1C9ABVb1rgoF1PqA/Cokw3k7stgKDvZHwHXcUYqW+J1CacejlcXoi4SvFvD2lRdxAER0s3glirS5Gyr7+FwAA//8Pj6q2AAAABklEQVQDAJPeLlNn5TR8AAAAAElFTkSuQmCC",sn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms8HjSgJctn1xIt6hxqIkdK+u8U8zT1ESmP5enUkWmqMkhG2FmxXOvR+EGD5KAhoDqsQvtiMXJQGNQJ4N8mF6PMd/wL8SxuOXPSG21pj9p+L1EOjGyAHoQQ0zWGDqx9pbPWIpwqOEkw+gGyMHoAc1ozOkVhOcZyepYndNpDpPvwAAAP//BVQJHAAAAAZJREFUAwDZWL4hub5xHQAAAABJRU5ErkJggg==",an="data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2534'%20width='200'%20height='200'%3e%3cpath%20d='M448%2085.333333a362.666667%20362.666667%200%201%200%20224.512%20647.509334l155.818667%20155.818666a42.666667%2042.666667%200%200%200%2060.330666-60.330666l-155.818666-155.818667A362.666667%20362.666667%200%200%200%20448%2085.333333zM170.666667%20448a277.333333%20277.333333%200%201%201%20554.666666%200%20277.333333%20277.333333%200%200%201-554.666666%200z'%20p-id='2535'%3e%3c/path%3e%3c/svg%3e",cn={class:"search-container"},un={class:"selection-wrapper"},fn={class:"tag-text"},dn=["onClick"],mn={key:0,class:"search-tag collapse"},pn=["placeholder"],hn={class:"suffix-area"},gn={key:1,class:"loading-spinner"},vn={class:"search-icon"},yn=["src"],An={key:0,class:"history-section"},wn={class:"history-header"},xn=["onMousedown"],bn={class:"category-tag"},Cn=["src"],En={class:"type-text"},Vn={class:"result-text"},kn={key:0,class:"status-msg"},Nn=["onMousedown"],Sn={class:"category-tag"},Rn=["src"],On={class:"type-text"},Bn={class:"result-text"},Dn={key:0,class:"load-more-msg"},Tn={key:1,class:"load-more-msg no-more"},Mn={key:2,class:"status-msg"},Ln=t.defineComponent({__name:"index",props:{modelValue:{default:null},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},searchTypeList:{default:()=>["Continent","Country","Region","City","Seaport","Airport"]},historyKey:{default:""}},emits:["update:modelValue","select","change","submit-search","remove"],setup(e,{emit:n}){const o=e,l=n,i=t.ref(null),s=t.ref(null),a=t.ref(null),c=t.ref(""),f=t.ref(""),r=t.ref(!1),u=t.ref(!1);let m=null;const d=t.computed(()=>o.modelValue?Array.isArray(o.modelValue)?o.modelValue:[o.modelValue]:[]),p=t.computed(()=>o.multiple?o.collapseTags?d.value.slice(0,1):d.value:[]),h=t.computed(()=>c.value||d.value.length>0),y=t.computed(()=>o.multiple?c.value?`${c.value.length*10+20}px`:"10px":"100%"),{searchHistory:g,saveToHistory:A,clearHistory:w}=nt(t.toRef(o,"historyKey")),{searchResults:x,loading:V,isFetchingMore:E,isFinished:_,currentPage:D,fetchData:I,filterByTypes:W}=it(c,t.toRef(o,"searchTypeList")),{floatingStyles:T,startTrack:X,stopTrack:K}=tn(s,a),S=t.computed(()=>{let v="";try{if(typeof useCookie=="function"){const b=useCookie("jc-language").value;if(b)return/en/.test(b)||/en-US/.test(b)}}catch{}return process.client?v=document.cookie||"":process.server&&(v=useNuxtApp?.()?.ssrContext?.event.node.req.headers.cookie||""),/jc-language=en-US/.test(v)||/jc-language=en/.test(v)}),J=t.computed(()=>o.multiple&&d.value.length>0?"":r.value&&!o.multiple?f.value:S.value?"Please enter...":"请输入..."),oe=()=>i.value?.focus(),q=v=>{if(A(v),o.multiple){if(!d.value.some(C=>C.id===v.id)){const C=[...d.value,v];l("update:modelValue",C)}c.value=""}else f.value=ae(v),r.value=!0,c.value="",u.value=!1,l("update:modelValue",v);l("select",v)},P=v=>{const b=d.value.filter(C=>C.id!==v.id);l("update:modelValue",b),l("remove",v)},R=()=>{o.multiple&&!c.value&&d.value.length>0&&P(d.value[d.value.length-1])},M=()=>{c.value="",r.value=!1,f.value="",l("update:modelValue",o.multiple?[]:null)},ve=async()=>{if(u.value=!0,!o.multiple&&r.value&&x.value.length===0){const v=o.modelValue;if(v?.id){V.value=!0;try{const b=await lt(v.id,v.type);x.value=W(b.records)}finally{V.value=!1}}}},je=()=>setTimeout(()=>u.value=!1,200),Ze=v=>{v.target.value===""&&!o.multiple&&M()},$e=()=>{o.multiple?l("submit-search",d.value):r.value?l("submit-search",o.modelValue):l("submit-search",{nameCn:c.value,type:"Manual"}),u.value=!1},et=v=>{const{scrollTop:b,scrollHeight:C,clientHeight:j}=v.target;b+j>=C-20&&!V.value&&!E.value&&!_.value&&c.value&&I(D.value+1,!0)};t.watch(u,v=>{v?X():K()}),t.watch(c,v=>{if(!v.trim()){x.value=[];return}m&&clearTimeout(m),m=setTimeout(()=>I(1,!1),300)});const ke=v=>({City:sn,Country:rn,Airport:nn,Seaport:ln})[v]||on,ae=v=>v.display||v.nameEn||v.nameCn||"",tt=v=>d.value.some(b=>b.id===v.id);return t.onBeforeUnmount(K),(v,b)=>(t.openBlock(),t.createElementBlock("div",cn,[t.createElementVNode("div",{class:t.normalizeClass(["search-input-wrapper",{"is-multiple":e.multiple}]),ref_key:"referenceRef",ref:s,onClick:oe},[t.createElementVNode("div",un,[e.multiple&&d.value.length>0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,(C,j)=>(t.openBlock(),t.createElementBlock("div",{key:C.id||j,class:"search-tag"},[t.createElementVNode("span",fn,t.toDisplayString(ae(C)),1),t.createElementVNode("span",{class:"tag-close",onClick:t.withModifiers(Ne=>P(C),["stop"])},"×",8,dn)]))),128)),e.collapseTags&&d.value.length>1?(t.openBlock(),t.createElementBlock("div",mn," + "+t.toDisplayString(d.value.length-1),1)):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("input",{ref_key:"inputRef",ref:i,class:t.normalizeClass({"is-selected-state":r.value&&!e.multiple}),"onUpdate:modelValue":b[0]||(b[0]=C=>c.value=C),type:"text",placeholder:J.value,style:t.normalizeStyle({width:y.value}),onFocus:ve,onBlur:je,onInput:Ze,onKeydown:t.withKeys(R,["delete"])},null,46,pn),[[t.vModelText,c.value]])]),t.createElementVNode("div",hn,[h.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"clear-icon",onMousedown:b[1]||(b[1]=t.withModifiers(()=>{},["prevent"])),onClick:t.withModifiers(M,["stop"])},"ⓧ",32)):t.createCommentVNode("",!0),t.unref(V)&&!t.unref(E)?(t.openBlock(),t.createElementBlock("div",gn)):(t.openBlock(),t.createElementBlock("button",{key:2,class:"search-btn",onClick:$e},[t.createElementVNode("span",vn,[t.createElementVNode("img",{src:t.unref(an),alt:"search"},null,8,yn)])]))])],2),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.withDirectives(t.createElementVNode("div",{ref_key:"floatingRef",ref:a,class:"dropdown-list",style:t.normalizeStyle(t.unref(T)),onScroll:et},[t.renderSlot(v.$slots,"history",{searchHistory:t.unref(g)},()=>[t.unref(g).length>0&&!c.value?(t.openBlock(),t.createElementBlock("div",An,[t.createElementVNode("div",wn,[t.createElementVNode("span",null,t.toDisplayString(S.value?"Recent search":"最近搜索"),1),t.createElementVNode("span",{class:"clear-btn",onMousedown:b[2]||(b[2]=t.withModifiers(()=>{},["prevent"])),onClick:b[3]||(b[3]=t.withModifiers((...C)=>t.unref(w)&&t.unref(w)(...C),["stop"]))},t.toDisplayString(S.value?"Clear":"清空"),33)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(g),(C,j)=>(t.openBlock(),t.createElementBlock("div",{key:"hist-"+j,class:"dropdown-item",onMousedown:Ne=>q(C)},[t.createElementVNode("div",bn,[t.createElementVNode("img",{class:"type-icon",src:ke(C.type),alt:""},null,8,Cn),t.createElementVNode("span",En,t.toDisplayString(C.type),1)]),t.createElementVNode("div",Vn,t.toDisplayString(ae(C)),1)],40,xn))),128)),b[4]||(b[4]=t.createElementVNode("hr",{class:"divider"},null,-1))])):t.createCommentVNode("",!0)],!0),t.unref(V)&&!t.unref(E)?(t.openBlock(),t.createElementBlock("div",kn,t.toDisplayString(S.value?"Searching...":"正在搜索中..."),1)):t.unref(x).length>0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.renderSlot(v.$slots,"results",{searchResults:t.unref(x)},()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(x),(C,j)=>(t.openBlock(),t.createElementBlock("div",{key:j,class:t.normalizeClass(["dropdown-item",{"is-active":tt(C)}]),onMousedown:Ne=>q(C)},[t.createElementVNode("div",Sn,[t.createElementVNode("img",{class:"type-icon",src:ke(C.type),alt:""},null,8,Rn),t.createElementVNode("span",On,t.toDisplayString(C.type),1)]),t.createElementVNode("div",Bn,t.toDisplayString(ae(C)),1)],42,Nn))),128))],!0),t.unref(E)?(t.openBlock(),t.createElementBlock("div",Dn,t.toDisplayString(S.value?"Loading more...":"正在加载更多..."),1)):t.unref(_)&&c.value?(t.openBlock(),t.createElementBlock("div",Tn,t.toDisplayString(S.value?"All results have been loaded":"已加载全部结果"),1)):t.createCommentVNode("",!0)],64)):c.value&&!t.unref(V)?(t.openBlock(),t.createElementBlock("div",Mn,[t.renderSlot(v.$slots,"noData",{},()=>[t.createTextVNode(t.toDisplayString(S.value?`No results found related to "${c.value}".`:`未找到与 "${c.value}" 相关的结果`),1)],!0)])):t.createCommentVNode("",!0)],36),[[t.vShow,u.value&&(t.unref(x).length>0||t.unref(V)||c.value||t.unref(g).length>0)]])]))]))}}),Ye=(e,n)=>{const o=e.__vccOpts||e;for(const[l,i]of n)o[l]=i;return o},Ve=Ye(Ln,[["__scopeId","data-v-b4ec2a47"]]),Fn={class:"modal-container"},_n={class:"modal-body"},In={class:"form-item"},Pn={class:"input-box"},Qn={class:"form-item"},Un={class:"type-group"},Hn=["onClick"],Wn={key:0,class:"check-mark"},Jn={class:"form-item"},Gn={__name:"ApplyDataDialog",props:{value:Boolean},emits:["update:value","confirm"],setup(e,{emit:n}){const o=n,l=["City","Port","Airport"],i=t.ref(null),s=t.reactive({name:"",type:"City",selectedCountry:null}),a=()=>{o("update:value",!1)},c=()=>{if(!s.name||!i.value){alert("Please fill in all fields");return}o("confirm",{...s,country:i.value})};return(f,r)=>e.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"modal-mask",onClick:t.withModifiers(a,["self"])},[t.createElementVNode("div",Fn,[t.createElementVNode("div",{class:"modal-header"},[r[2]||(r[2]=t.createElementVNode("span",{class:"header-title"},"Apply for data addition",-1)),t.createElementVNode("div",{class:"close-btn",onClick:a},"×")]),t.createElementVNode("div",_n,[t.createElementVNode("div",In,[r[3]||(r[3]=t.createElementVNode("label",{class:"required"},"Data To Add",-1)),t.createElementVNode("div",Pn,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=u=>s.name=u),type:"text",placeholder:"Please enter your data",class:"custom-input"},null,512),[[t.vModelText,s.name]])])]),t.createElementVNode("div",Qn,[r[4]||(r[4]=t.createElementVNode("label",{class:"required"},"Type",-1)),t.createElementVNode("div",Un,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,u=>t.createElementVNode("div",{key:u,class:t.normalizeClass(["type-btn",{active:s.type===u}]),onClick:m=>s.type=u},[t.createTextVNode(t.toDisplayString(u)+" ",1),s.type===u?(t.openBlock(),t.createElementBlock("div",Wn)):t.createCommentVNode("",!0)],10,Hn)),64))])]),t.createElementVNode("div",Jn,[r[5]||(r[5]=t.createElementVNode("label",{class:"required"},"Country",-1)),t.createVNode(Ve,{"search-type-list":["Country"],"model-value":i.value,"onUpdate:modelValue":r[1]||(r[1]=u=>i.value=u),style:{margin:"0 auto"}},null,8,["model-value"])])]),t.createElementVNode("div",{class:"modal-footer"},[t.createElementVNode("button",{class:"confirm-btn",onClick:c},"Confirm")])])])):t.createCommentVNode("",!0)}},ze=Ye(Gn,[["__scopeId","data-v-6ca2ec8d"]]),Kn={class:"global-modal-header-custom"},qn={class:"global-modal-body-custom"},Yn={class:"global-modal-footer-custom"},Xe=t.defineComponent({__name:"GlobalModal",setup(e){const n=t.ref(),o=t.ref(!1),l=t.ref({city:"",company:"",email:"",phone:"",name:"",agreement:!1}),i=t.reactive({city:[{required:!0,message:"请输入所在地城市",trigger:"blur"}],company:[{required:!0,message:"请输入公司名称",trigger:"blur"}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"},{type:"email",message:"请输入有效的邮箱地址",trigger:"blur"}],agreement:[{validator:(f,r,u)=>{r?u():u(new Error("请同意隐私政策"))},trigger:"change"}]}),s=()=>{o.value=!1,N.emitter.emit(N.MODAL_ACTION.Close,void 0),n.value?.resetFields()},a=async()=>{n.value&&await n.value.validate(f=>{f&&(N.emitter.emit(N.MODAL_ACTION.Submit,l.value),s(),l.value={city:"",company:"",email:"",phone:"",name:"",agreement:!1})})},c=f=>{o.value=!0};return t.onMounted(()=>{N.emitter.on(N.MODAL_ACTION.Open,c)}),t.onUnmounted(()=>{N.emitter.off(N.MODAL_ACTION.Open,c)}),(f,r)=>(t.openBlock(),t.createBlock(t.unref(k.ElDialog),{modelValue:o.value,"onUpdate:modelValue":r[7]||(r[7]=u=>o.value=u),"before-close":s,"show-close":!1,"close-on-click-modal":!0,width:500,class:"global-modal-custom"},{header:t.withCtx(()=>[t.createElementVNode("div",Kn,[r[9]||(r[9]=t.createElementVNode("h2",null,"即刻链接全球货代",-1)),t.createVNode(t.unref(k.ElButton),{link:"",onClick:s,class:"close-button-custom","aria-label":"Close"},{default:t.withCtx(()=>[...r[8]||(r[8]=[t.createElementVNode("span",{style:{"font-size":"2rem"}},"×",-1)])]),_:1})])]),footer:t.withCtx(()=>[t.createElementVNode("div",Yn,[t.createVNode(t.unref(k.ElButton),{type:"primary",class:"submit-button-custom",onClick:a},{default:t.withCtx(()=>[...r[11]||(r[11]=[t.createTextVNode(" 加入会员 ",-1)])]),_:1})])]),default:t.withCtx(()=>[t.createElementVNode("div",qn,[t.createVNode(t.unref(k.ElForm),{model:l.value,rules:i,ref_key:"formRef",ref:n,"label-position":"top",onSubmit:r[6]||(r[6]=t.withModifiers(()=>{},["prevent"]))},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElRow),{gutter:20},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElCol),{span:12},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElFormItem),{label:"所在地(城市)",prop:"city"},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElInput),{modelValue:l.value.city,"onUpdate:modelValue":r[0]||(r[0]=u=>l.value.city=u),placeholder:"请输入城市"},null,8,["modelValue"])]),_:1})]),_:1}),t.createVNode(t.unref(k.ElCol),{span:12},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElFormItem),{label:"公司名称",prop:"company"},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElInput),{modelValue:l.value.company,"onUpdate:modelValue":r[1]||(r[1]=u=>l.value.company=u),placeholder:"请输入公司名称"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t.createVNode(t.unref(k.ElRow),{gutter:20},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElCol),{span:12},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElFormItem),{label:"邮箱",prop:"email"},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElInput),{modelValue:l.value.email,"onUpdate:modelValue":r[2]||(r[2]=u=>l.value.email=u),placeholder:"请输入邮箱"},null,8,["modelValue"])]),_:1})]),_:1}),t.createVNode(t.unref(k.ElCol),{span:12},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElFormItem),{label:"电话",prop:"phone"},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElInput),{modelValue:l.value.phone,"onUpdate:modelValue":r[3]||(r[3]=u=>l.value.phone=u),placeholder:"请输入电话"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t.createVNode(t.unref(k.ElRow),null,{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElCol),{span:24},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElFormItem),{label:"姓名",prop:"name"},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElInput),{modelValue:l.value.name,"onUpdate:modelValue":r[4]||(r[4]=u=>l.value.name=u),placeholder:"请输入您的全名"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t.createVNode(t.unref(k.ElFormItem),{prop:"agreement",class:"agreement-item"},{default:t.withCtx(()=>[t.createVNode(t.unref(k.ElCheckbox),{modelValue:l.value.agreement,"onUpdate:modelValue":r[5]||(r[5]=u=>l.value.agreement=u),label:"我同意"},null,8,["modelValue"]),r[10]||(r[10]=t.createElementVNode("a",{href:"#",class:"privacy-link"},"隐私政策",-1))]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"]))}});let zn={open(){N.emitter.emit(N.MODAL_ACTION.Open)},close(){N.emitter.emit(N.MODAL_ACTION.Close)},onSubmit(e){N.emitter.on(N.MODAL_ACTION.Submit,e)}};function Xn(){let e=!1;return{install(n){if(typeof window<"u"&&!e){const o=document.createElement("div");o.setAttribute("id","global-modal-root"),document.body.appendChild(o),t.createApp(Xe).mount(o),e=!0}n.config.globalProperties.$globalModal=zn}}}const Fe={ApplyDataDialog:ze,JcSearch:Ve},jn={install(e){for(const n in Fe)e.component(n,Fe[n])}};Object.defineProperty(exports,"MODAL_ACTION",{enumerable:!0,get:()=>N.MODAL_ACTION});Object.defineProperty(exports,"emitter",{enumerable:!0,get:()=>N.emitter});exports.ApplyDataDialog=ze;exports.GlobalModal=Xe;exports.JcSearch=Ve;exports.createGlobalModalPlugin=Xn;exports.default=jn;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("@jctrans-materials/shared"),B=require("element-plus");function rt(t){const o=e.ref([]),n="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",s=e.computed(()=>(t.value||"")+n),a=e.computed(()=>!!t.value&&t.value!==""),r=u=>{if(!u||!l)return;const c=o.value.filter(p=>p.id&&p.id!==u.id||p.display!==u.display);c.unshift(u);const d=c.slice(0,4);if(a.value){o.value=d;try{localStorage.setItem(s.value,JSON.stringify(d))}catch(p){console.warn("LocalStorage save failed:",p)}}},i=()=>{o.value=[],l&&localStorage.removeItem(s.value)};return e.onMounted(()=>{if(l&&a.value){const u=localStorage.getItem(s.value);if(u)try{o.value=JSON.parse(u)}catch{o.value=[]}}}),{searchHistory:o,saveToHistory:r,clearHistory:i,HasHistory:a}}async function at(t,o=["Continent","Country","City","Seaport","Airport"],n={}){return R.locationSearchV2.searchByName({keyword:t,displayInfo:o,...n})}const it=(t,o)=>R.locationSearchV2.searchByIdWithType(t,o);function ct(t,o){const n=e.ref([]),l=e.ref(!1),s=e.ref(!1),a=e.ref(1),r=e.ref(0),i=e.ref(10),u=e.computed(()=>r.value===0?!1:n.value.length>=r.value),c=e.computed(()=>{const f=[...o.value];return f.includes("Country")&&!f.includes("Region")&&f.push("Region"),f}),d=f=>!f||!Array.isArray(f)?[]:f.filter(m=>c.value.includes(m.type));return{searchResults:n,loading:l,isFetchingMore:s,isFinished:u,currentPage:a,total:r,fetchData:async(f=1,m=!1)=>{if(!t.value.trim()&&!m){n.value=[],r.value=0;return}if(!(m&&(s.value||u.value))&&!(!m&&l.value)){m?s.value=!0:(l.value=!0,a.value=1);try{const h=await at(t.value,o.value,{current:f,size:i.value}),g=h.records||[],y=d(g);m?n.value=[...n.value,...y]:n.value=y,r.value=h.total||0,a.value=f}catch(h){console.error("Failed to fetch search results:",h)}finally{l.value=!1,s.value=!1}}},filterByTypes:d}}const te=Math.min,M=Math.max,de=Math.round,ue=Math.floor,J=t=>({x:t,y:t}),ut={left:"right",right:"left",bottom:"top",top:"bottom"},dt={start:"end",end:"start"};function De(t,o,n){return M(t,te(o,n))}function re(t,o){return typeof t=="function"?t(o):t}function z(t){return t.split("-")[0]}function ae(t){return t.split("-")[1]}function Qe(t){return t==="x"?"y":"x"}function Ue(t){return t==="y"?"height":"width"}const ft=new Set(["top","bottom"]);function G(t){return ft.has(z(t))?"y":"x"}function $e(t){return Qe(G(t))}function mt(t,o,n){n===void 0&&(n=!1);const l=ae(t),s=$e(t),a=Ue(s);let r=s==="x"?l===(n?"end":"start")?"right":"left":l==="start"?"bottom":"top";return o.reference[a]>o.floating[a]&&(r=fe(r)),[r,fe(r)]}function pt(t){const o=fe(t);return[Ae(t),o,Ae(o)]}function Ae(t){return t.replace(/start|end/g,o=>dt[o])}const Oe=["left","right"],_e=["right","left"],ht=["top","bottom"],vt=["bottom","top"];function gt(t,o,n){switch(t){case"top":case"bottom":return n?o?_e:Oe:o?Oe:_e;case"left":case"right":return o?ht:vt;default:return[]}}function yt(t,o,n,l){const s=ae(t);let a=gt(z(t),n==="start",l);return s&&(a=a.map(r=>r+"-"+s),o&&(a=a.concat(a.map(Ae)))),a}function fe(t){return t.replace(/left|right|bottom|top/g,o=>ut[o])}function At(t){return{top:0,right:0,bottom:0,left:0,...t}}function wt(t){return typeof t!="number"?At(t):{top:t,right:t,bottom:t,left:t}}function me(t){const{x:o,y:n,width:l,height:s}=t;return{width:l,height:s,top:n,left:o,right:o+l,bottom:n+s,x:o,y:n}}function Te(t,o,n){let{reference:l,floating:s}=t;const a=G(o),r=$e(o),i=Ue(r),u=z(o),c=a==="y",d=l.x+l.width/2-s.width/2,p=l.y+l.height/2-s.height/2,f=l[i]/2-s[i]/2;let m;switch(u){case"top":m={x:d,y:l.y-s.height};break;case"bottom":m={x:d,y:l.y+l.height};break;case"right":m={x:l.x+l.width,y:p};break;case"left":m={x:l.x-s.width,y:p};break;default:m={x:l.x,y:l.y}}switch(ae(o)){case"start":m[r]-=f*(n&&c?-1:1);break;case"end":m[r]+=f*(n&&c?-1:1);break}return m}const Ct=async(t,o,n)=>{const{placement:l="bottom",strategy:s="absolute",middleware:a=[],platform:r}=n,i=a.filter(Boolean),u=await(r.isRTL==null?void 0:r.isRTL(o));let c=await r.getElementRects({reference:t,floating:o,strategy:s}),{x:d,y:p}=Te(c,l,u),f=l,m={},h=0;for(let g=0;g<i.length;g++){const{name:y,fn:v}=i[g],{x:w,y:C,data:b,reset:S}=await v({x:d,y:p,initialPlacement:l,placement:f,strategy:s,middlewareData:m,rects:c,platform:r,elements:{reference:t,floating:o}});d=w??d,p=C??p,m={...m,[y]:{...m[y],...b}},S&&h<=50&&(h++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await r.getElementRects({reference:t,floating:o,strategy:s}):S.rects),{x:d,y:p}=Te(c,f,u)),g=-1)}return{x:d,y:p,placement:f,strategy:s,middlewareData:m}};async function xe(t,o){var n;o===void 0&&(o={});const{x:l,y:s,platform:a,rects:r,elements:i,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:f=!1,padding:m=0}=re(o,t),h=wt(m),y=i[f?p==="floating"?"reference":"floating":p],v=me(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:u})),w=p==="floating"?{x:l,y:s,width:r.floating.width,height:r.floating.height}:r.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),b=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},S=me(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:C,strategy:u}):w);return{top:(v.top-S.top+h.top)/b.y,bottom:(S.bottom-v.bottom+h.bottom)/b.y,left:(v.left-S.left+h.left)/b.x,right:(S.right-v.right+h.right)/b.x}}const xt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var n,l;const{placement:s,middlewareData:a,rects:r,initialPlacement:i,platform:u,elements:c}=o,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...y}=re(t,o);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=z(s),w=G(i),C=z(i)===i,b=await(u.isRTL==null?void 0:u.isRTL(c.floating)),S=f||(C||!g?[fe(i)]:pt(i)),F=h!=="none";!f&&F&&S.push(...yt(i,g,h,b));const O=[i,...S],L=await xe(o,y),P=[];let _=((l=a.flip)==null?void 0:l.overflows)||[];if(d&&P.push(L[v]),p){const H=mt(s,r,b);P.push(L[H[0]],L[H[1]])}if(_=[..._,{placement:s,overflows:P}],!P.every(H=>H<=0)){var q,$;const H=(((q=a.flip)==null?void 0:q.index)||0)+1,X=O[H];if(X&&(!(p==="alignment"?w!==G(X):!1)||_.every(x=>G(x.placement)===w?x.overflows[0]>0:!0)))return{data:{index:H,overflows:_},reset:{placement:X}};let k=($=_.filter(E=>E.overflows[0]<=0).sort((E,x)=>E.overflows[1]-x.overflows[1])[0])==null?void 0:$.placement;if(!k)switch(m){case"bestFit":{var D;const E=(D=_.filter(x=>{if(F){const T=G(x.placement);return T===w||T==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(T=>T>0).reduce((T,le)=>T+le,0)]).sort((x,T)=>x[1]-T[1])[0])==null?void 0:D[0];E&&(k=E);break}case"initialPlacement":k=i;break}if(s!==k)return{reset:{placement:k}}}return{}}}},Et=new Set(["left","top"]);async function kt(t,o){const{placement:n,platform:l,elements:s}=t,a=await(l.isRTL==null?void 0:l.isRTL(s.floating)),r=z(n),i=ae(n),u=G(n)==="y",c=Et.has(r)?-1:1,d=a&&u?-1:1,p=re(o,t);let{mainAxis:f,crossAxis:m,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof h=="number"&&(m=i==="end"?h*-1:h),u?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const Vt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var n,l;const{x:s,y:a,placement:r,middlewareData:i}=o,u=await kt(o,t);return r===((n=i.offset)==null?void 0:n.placement)&&(l=i.arrow)!=null&&l.alignmentOffset?{}:{x:s+u.x,y:a+u.y,data:{...u,placement:r}}}}},bt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){const{x:n,y:l,placement:s}=o,{mainAxis:a=!0,crossAxis:r=!1,limiter:i={fn:y=>{let{x:v,y:w}=y;return{x:v,y:w}}},...u}=re(t,o),c={x:n,y:l},d=await xe(o,u),p=G(z(s)),f=Qe(p);let m=c[f],h=c[p];if(a){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=m+d[y],C=m-d[v];m=De(w,m,C)}if(r){const y=p==="y"?"top":"left",v=p==="y"?"bottom":"right",w=h+d[y],C=h-d[v];h=De(w,h,C)}const g=i.fn({...o,[f]:m,[p]:h});return{...g,data:{x:g.x-n,y:g.y-l,enabled:{[f]:a,[p]:r}}}}}},St=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(o){var n,l;const{placement:s,rects:a,platform:r,elements:i}=o,{apply:u=()=>{},...c}=re(t,o),d=await xe(o,c),p=z(s),f=ae(s),m=G(s)==="y",{width:h,height:g}=a.floating;let y,v;p==="top"||p==="bottom"?(y=p,v=f===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(v=p,y=f==="end"?"top":"bottom");const w=g-d.top-d.bottom,C=h-d.left-d.right,b=te(g-d[y],w),S=te(h-d[v],C),F=!o.middlewareData.shift;let O=b,L=S;if((n=o.middlewareData.shift)!=null&&n.enabled.x&&(L=C),(l=o.middlewareData.shift)!=null&&l.enabled.y&&(O=w),F&&!f){const _=M(d.left,0),q=M(d.right,0),$=M(d.top,0),D=M(d.bottom,0);m?L=h-2*(_!==0||q!==0?_+q:M(d.left,d.right)):O=g-2*($!==0||D!==0?$+D:M(d.top,d.bottom))}await u({...o,availableWidth:L,availableHeight:O});const P=await r.getDimensions(i.floating);return h!==P.width||g!==P.height?{reset:{rects:!0}}:{}}}};function pe(){return typeof window<"u"}function ne(t){return Je(t)?(t.nodeName||"").toLowerCase():"#document"}function I(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function K(t){var o;return(o=(Je(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function Je(t){return pe()?t instanceof Node||t instanceof I(t).Node:!1}function Q(t){return pe()?t instanceof Element||t instanceof I(t).Element:!1}function W(t){return pe()?t instanceof HTMLElement||t instanceof I(t).HTMLElement:!1}function Le(t){return!pe()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof I(t).ShadowRoot}const Nt=new Set(["inline","contents"]);function ie(t){const{overflow:o,overflowX:n,overflowY:l,display:s}=U(t);return/auto|scroll|overlay|hidden|clip/.test(o+l+n)&&!Nt.has(s)}const Bt=new Set(["table","td","th"]);function Rt(t){return Bt.has(ne(t))}const Dt=[":popover-open",":modal"];function he(t){return Dt.some(o=>{try{return t.matches(o)}catch{return!1}})}const Ot=["transform","translate","scale","rotate","perspective"],_t=["transform","translate","scale","rotate","perspective","filter"],Tt=["paint","layout","strict","content"];function Ee(t){const o=ke(),n=Q(t)?U(t):t;return Ot.some(l=>n[l]?n[l]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||_t.some(l=>(n.willChange||"").includes(l))||Tt.some(l=>(n.contain||"").includes(l))}function Lt(t){let o=Y(t);for(;W(o)&&!oe(o);){if(Ee(o))return o;if(he(o))return null;o=Y(o)}return null}function ke(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Mt=new Set(["html","body","#document"]);function oe(t){return Mt.has(ne(t))}function U(t){return I(t).getComputedStyle(t)}function ve(t){return Q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Y(t){if(ne(t)==="html")return t;const o=t.assignedSlot||t.parentNode||Le(t)&&t.host||K(t);return Le(o)?o.host:o}function We(t){const o=Y(t);return oe(o)?t.ownerDocument?t.ownerDocument.body:t.body:W(o)&&ie(o)?o:We(o)}function se(t,o,n){var l;o===void 0&&(o=[]),n===void 0&&(n=!0);const s=We(t),a=s===((l=t.ownerDocument)==null?void 0:l.body),r=I(s);if(a){const i=we(r);return o.concat(r,r.visualViewport||[],ie(s)?s:[],i&&n?se(i):[])}return o.concat(s,se(s,[],n))}function we(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ke(t){const o=U(t);let n=parseFloat(o.width)||0,l=parseFloat(o.height)||0;const s=W(t),a=s?t.offsetWidth:n,r=s?t.offsetHeight:l,i=de(n)!==a||de(l)!==r;return i&&(n=a,l=r),{width:n,height:l,$:i}}function Ve(t){return Q(t)?t:t.contextElement}function ee(t){const o=Ve(t);if(!W(o))return J(1);const n=o.getBoundingClientRect(),{width:l,height:s,$:a}=Ke(o);let r=(a?de(n.width):n.width)/l,i=(a?de(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!i||!Number.isFinite(i))&&(i=1),{x:r,y:i}}const It=J(0);function qe(t){const o=I(t);return!ke()||!o.visualViewport?It:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Ft(t,o,n){return o===void 0&&(o=!1),!n||o&&n!==I(t)?!1:o}function Z(t,o,n,l){o===void 0&&(o=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),a=Ve(t);let r=J(1);o&&(l?Q(l)&&(r=ee(l)):r=ee(t));const i=Ft(a,n,l)?qe(a):J(0);let u=(s.left+i.x)/r.x,c=(s.top+i.y)/r.y,d=s.width/r.x,p=s.height/r.y;if(a){const f=I(a),m=l&&Q(l)?I(l):l;let h=f,g=we(h);for(;g&&l&&m!==h;){const y=ee(g),v=g.getBoundingClientRect(),w=U(g),C=v.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,b=v.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;u*=y.x,c*=y.y,d*=y.x,p*=y.y,u+=C,c+=b,h=I(g),g=we(h)}}return me({width:d,height:p,x:u,y:c})}function ge(t,o){const n=ve(t).scrollLeft;return o?o.left+n:Z(K(t)).left+n}function Ge(t,o){const n=t.getBoundingClientRect(),l=n.left+o.scrollLeft-ge(t,n),s=n.top+o.scrollTop;return{x:l,y:s}}function Pt(t){let{elements:o,rect:n,offsetParent:l,strategy:s}=t;const a=s==="fixed",r=K(l),i=o?he(o.floating):!1;if(l===r||i&&a)return n;let u={scrollLeft:0,scrollTop:0},c=J(1);const d=J(0),p=W(l);if((p||!p&&!a)&&((ne(l)!=="body"||ie(r))&&(u=ve(l)),W(l))){const m=Z(l);c=ee(l),d.x=m.x+l.clientLeft,d.y=m.y+l.clientTop}const f=r&&!p&&!a?Ge(r,u):J(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-u.scrollTop*c.y+d.y+f.y}}function Ht(t){return Array.from(t.getClientRects())}function Qt(t){const o=K(t),n=ve(t),l=t.ownerDocument.body,s=M(o.scrollWidth,o.clientWidth,l.scrollWidth,l.clientWidth),a=M(o.scrollHeight,o.clientHeight,l.scrollHeight,l.clientHeight);let r=-n.scrollLeft+ge(t);const i=-n.scrollTop;return U(l).direction==="rtl"&&(r+=M(o.clientWidth,l.clientWidth)-s),{width:s,height:a,x:r,y:i}}const Me=25;function Ut(t,o){const n=I(t),l=K(t),s=n.visualViewport;let a=l.clientWidth,r=l.clientHeight,i=0,u=0;if(s){a=s.width,r=s.height;const d=ke();(!d||d&&o==="fixed")&&(i=s.offsetLeft,u=s.offsetTop)}const c=ge(l);if(c<=0){const d=l.ownerDocument,p=d.body,f=getComputedStyle(p),m=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(l.clientWidth-p.clientWidth-m);h<=Me&&(a-=h)}else c<=Me&&(a+=c);return{width:a,height:r,x:i,y:u}}const $t=new Set(["absolute","fixed"]);function Jt(t,o){const n=Z(t,!0,o==="fixed"),l=n.top+t.clientTop,s=n.left+t.clientLeft,a=W(t)?ee(t):J(1),r=t.clientWidth*a.x,i=t.clientHeight*a.y,u=s*a.x,c=l*a.y;return{width:r,height:i,x:u,y:c}}function Ie(t,o,n){let l;if(o==="viewport")l=Ut(t,n);else if(o==="document")l=Qt(K(t));else if(Q(o))l=Jt(o,n);else{const s=qe(t);l={x:o.x-s.x,y:o.y-s.y,width:o.width,height:o.height}}return me(l)}function ze(t,o){const n=Y(t);return n===o||!Q(n)||oe(n)?!1:U(n).position==="fixed"||ze(n,o)}function Wt(t,o){const n=o.get(t);if(n)return n;let l=se(t,[],!1).filter(i=>Q(i)&&ne(i)!=="body"),s=null;const a=U(t).position==="fixed";let r=a?Y(t):t;for(;Q(r)&&!oe(r);){const i=U(r),u=Ee(r);!u&&i.position==="fixed"&&(s=null),(a?!u&&!s:!u&&i.position==="static"&&!!s&&$t.has(s.position)||ie(r)&&!u&&ze(t,r))?l=l.filter(d=>d!==r):s=i,r=Y(r)}return o.set(t,l),l}function Kt(t){let{element:o,boundary:n,rootBoundary:l,strategy:s}=t;const r=[...n==="clippingAncestors"?he(o)?[]:Wt(o,this._c):[].concat(n),l],i=r[0],u=r.reduce((c,d)=>{const p=Ie(o,d,s);return c.top=M(p.top,c.top),c.right=te(p.right,c.right),c.bottom=te(p.bottom,c.bottom),c.left=M(p.left,c.left),c},Ie(o,i,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function qt(t){const{width:o,height:n}=Ke(t);return{width:o,height:n}}function Gt(t,o,n){const l=W(o),s=K(o),a=n==="fixed",r=Z(t,!0,a,o);let i={scrollLeft:0,scrollTop:0};const u=J(0);function c(){u.x=ge(s)}if(l||!l&&!a)if((ne(o)!=="body"||ie(s))&&(i=ve(o)),l){const m=Z(o,!0,a,o);u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}else s&&c();a&&!l&&s&&c();const d=s&&!l&&!a?Ge(s,i):J(0),p=r.left+i.scrollLeft-u.x-d.x,f=r.top+i.scrollTop-u.y-d.y;return{x:p,y:f,width:r.width,height:r.height}}function ye(t){return U(t).position==="static"}function Fe(t,o){if(!W(t)||U(t).position==="fixed")return null;if(o)return o(t);let n=t.offsetParent;return K(t)===n&&(n=n.ownerDocument.body),n}function Ye(t,o){const n=I(t);if(he(t))return n;if(!W(t)){let s=Y(t);for(;s&&!oe(s);){if(Q(s)&&!ye(s))return s;s=Y(s)}return n}let l=Fe(t,o);for(;l&&Rt(l)&&ye(l);)l=Fe(l,o);return l&&oe(l)&&ye(l)&&!Ee(l)?n:l||Lt(t)||n}const zt=async function(t){const o=this.getOffsetParent||Ye,n=this.getDimensions,l=await n(t.floating);return{reference:Gt(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function Yt(t){return U(t).direction==="rtl"}const Xt={convertOffsetParentRelativeRectToViewportRelativeRect:Pt,getDocumentElement:K,getClippingRect:Kt,getOffsetParent:Ye,getElementRects:zt,getClientRects:Ht,getDimensions:qt,getScale:ee,isElement:Q,isRTL:Yt};function Xe(t,o){return t.x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height}function jt(t,o){let n=null,l;const s=K(t);function a(){var i;clearTimeout(l),(i=n)==null||i.disconnect(),n=null}function r(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),a();const c=t.getBoundingClientRect(),{left:d,top:p,width:f,height:m}=c;if(i||o(),!f||!m)return;const h=ue(p),g=ue(s.clientWidth-(d+f)),y=ue(s.clientHeight-(p+m)),v=ue(d),C={rootMargin:-h+"px "+-g+"px "+-y+"px "+-v+"px",threshold:M(0,te(1,u))||1};let b=!0;function S(F){const O=F[0].intersectionRatio;if(O!==u){if(!b)return r();O?r(!1,O):l=setTimeout(()=>{r(!1,1e-7)},1e3)}O===1&&!Xe(c,t.getBoundingClientRect())&&r(),b=!1}try{n=new IntersectionObserver(S,{...C,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,C)}n.observe(t)}return r(!0),a}function Zt(t,o,n,l){l===void 0&&(l={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=l,c=Ve(t),d=s||a?[...c?se(c):[],...se(o)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const p=c&&i?jt(c,n):null;let f=-1,m=null;r&&(m=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&m&&(m.unobserve(o),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(o)})),n()}),c&&!u&&m.observe(c),m.observe(o));let h,g=u?Z(t):null;u&&y();function y(){const v=Z(t);g&&!Xe(g,v)&&n(),g=v,h=requestAnimationFrame(y)}return n(),()=>{var v;d.forEach(w=>{s&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),p?.(),(v=m)==null||v.disconnect(),m=null,u&&cancelAnimationFrame(h)}}const eo=Vt,to=bt,oo=xt,no=St,lo=(t,o,n)=>{const l=new Map,s={platform:Xt,...n},a={...s.platform,_c:l};return Ct(t,o,{...s,platform:a})};function so(t,o){const n=e.ref({position:"fixed",left:"0",top:"0",zIndex:3e3});let l=null;const s=()=>{!t.value||!o.value||lo(t.value,o.value,{placement:"bottom-start",strategy:"fixed",middleware:[eo(6),oo(),to({padding:10}),no({apply({rects:i,elements:u}){const c=`${i.reference.width}px`;Object.assign(u.floating.style,{width:c,minWidth:c,maxWidth:c})}})]}).then(({x:i,y:u})=>{Object.assign(n.value,{left:`${i}px`,top:`${u}px`})})},a=()=>{t.value&&o.value&&(l=Zt(t.value,o.value,s))},r=()=>{l&&(l(),l=null)};return e.onBeforeUnmount(r),{floatingStyles:n,startTrack:a,stopTrack:r}}const ro="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACT0lEQVR4AaRSO2hTYRT+zn9v2g6CiktFJYoVHXQoOljM2EIEh0orbRKa5qUuDoIZAnXI4FBwcRDikMcNkoQMQjcVESo4OASsW2kLBi3oUKiD1OZx7/H811wJZFF6uOee85/H93/3nKtwQPkvgFKpdKRgVR+UrFrOsurX9N3/DJCvVPxMwx+lKcbgKzbstPhwAXSyWK7eLZZrc4VCNZDPPx/Tt+kCrTqvOrQqfuNrc2OcgW0CduQM9TfJyIB5mQy8UaaxKbftFq3qL9HP1KGGFDe+NDdC/jPnlwgcZEM9lRiU2VFjgngI4FGxa0IvZXecU07XPsc2pkCUIULaa2Z2MsJ7Orkw/8kFiMVCb4XWcQV14w8temL4aJNM47Fh0OHEYqieWAyXT/jPBhzmh7o5EY28Rk/cGWSz2a4GSsTCt3tgs5qmDc726sTQvsS6/c0SFDz97lO/329K4z2Amm1u3ZK11SyrOmNC/ZDYSElWiT5R2resymUZ1pIUv2Qa+iafcrrFretDNJwTf94GUnt7u9u6to3hUW09dQEcIC+BR0LxqgztPnFrotd8wWHclNykaR4dYeCngj0IQNyekOQshLas8hmzLyA3B2UTU6l4eEX8Ld8IZsTu+Mg4hj5xGcTj8f1kLPxChjgO0AdWlAOwnkotbImFrHGFGdOy6u82aJAB+kUZywQ6KaH3ou7TcbguziRApiLWOXjiMvAO2iaic3rH6wxe1Wetd+KRNQKEDV9kwisd83QAQCfkr7uUjEUq2vdUgdJQFExEw++8mLa/AQAA//9h0VsEAAAABklEQVQDAKhs6Pxd3K8TAAAAAElFTkSuQmCC",ao="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgUlEQVR4AXRST0hUYRD/zbfbrqahQpAHlQ3dSurYoaBAwWNQkIT7J/ve09DQsOigkNCha4ckl4Lct0/S3QI7REFEBB08FBHRIYLwIJEodOlUurnfNN+6mq9weMPM+818v2/mm1HYQXK5XH02mz9h1fo7pOE/gkwmU+v5+fuGot8phJdWmSLLnl+4I0RV/xIFCGxCdU3DUwaOkULX18Uve1ydrC4xdwLcwRR9bnO2kwQIoCIDEowpXjsZ4vBCSyx+w/Nnb1KElkkwG4OqGhG79QUImEkT0T2JrpZ4fV5sF0Ad6je9BrBKxLeZuVv8rS9IAG4qGf5oTPSolNxIXOyUNjqlpb0W4xI+Cd62dVqcAAGBVqSCVmPMIoPCttzm2MEBAoeLir4hRK2AWPyVIAHRHMH0Ly0tCBF3M5t+Aq6A0HPJSSyCeZAIz7BNAgQwqxNyc1NL7MCoeyH1xNWpuKsTcet7fv46QI0/zdoEtkmAwHGcHyFQj/Q57vuPzm7m+X5efB6HYj3kOCubuLVlApltfdbPX5uaetCmdeKVAqUN1mdy04XR3PTsqAHPWMztTb24myvEBBuRM+WlUnbzDEXeya2D4XC0zrJqnXwsO3pG3mCMGWMK6lQZk2A0hH2GMSxL9VlI6lVkd90RgGKkVFrrc+9REXubjLH9FxfbbVUVGG5v4i2p8LD8x9ax65C66KTfKGCSDc97fv6DJzuf9QtDtm+iqsM1ot70w9O+YDbmSQ6bkkyCJitnAUcnryqmuExgSsZYKypvgFvS+5xVsJk0MGlps97mFCVXpnNZqoBcbo2QyJz7dCLj6JTj6tRxVyf3izZUtNndwM73SU55JzaO4Q8AAAD//54At5MAAAAGSURBVAMAh2IbMAJQAZQAAAAASUVORK5CYII=",io="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACC0lEQVR4AXxRv2tTURT+zk1iIjgoOMShkIJVNwf/gQYULOjQwaGvGl8TBMEMDg4ODgF17likvL4HIYm4OLg61K2CooWKDoKCDoJDHASb9N17POf5Enwk6eN+9/z+3nfvNZjxbYS9ymbYXlQ8CbvnZrRhKoEOFMl9zFHuuaJA/E4Jp5FMJTCwZWner/veCYX6ecQVsRNrKsFE1yGJDMFW1Hm4FXX7hnIvADquvkJ9zYn/U3vw35chYOA2Ebcc26uWbVWwnKKqOak9ktmmYLwyBATkY+d2b63d2FYgps9umNtTX6G18WTqmNRmTNB+djaIOqEpmC+FIn8Lom4vaD89n2lKgwkCebYNsvEnAlXI4CIMXSagTNa9l9p6Ojc2CUEYhiW5oE3IxQH4AYNFeb5qvea9SuB7Vc1J7ReDjomidZ2RWNKysyneFHNFovGgxIiizoWR9BGRqiKw76i0qj2JAo7jtwycJDvY1eQIDNM0lu+OYrUHf/BBbEmI9sTKP2VvNGpvAP4Kc1SVSGb2OlLiVQa+12srr7UrUZA6Lx27e0HUu6PnU/kOXGbwaT1Gq9XKa80xmgTa1hlFQiBP1hNWn4AdOd8DpmLfgnakYV/yv/UF5ipn+qLyvgGp2us6I/V/R+DYPiYenpKbv0Y8mGeLS0OmhYbvLQuWiGkeFkuGBwtrvrdyMKA5nVGCvwAAAP//q4xnOgAAAAZJREFUAwCH2O8KfEWHWQAAAABJRU5ErkJggg==",co="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACmklEQVR4AXRTT0jUQRT+3uyqGxgYeCiy1JAo6JBUp4Q81EEiKKiDa+H+/ENGHgPpZtChQ4EHL+Ku+9t0V7EkQSGPBYGHBIU6RAqt2cFDBw9C+3de3yy7hobDvHm/+d4337x58xuDQ9r4+FRDLJZqG49PtrvvQ2j4TyDmJ7sm/NRqoMpsIYD3RgIL7pvY54lEqvug0J5APB4PxfzUOwFGRWReVJp7I+GjW+nvxxQo0DagOjLhJxcctyK0J6BS/UaAc1nNtXrdnc88rzPtSMPDwwXiM7R2WNwDpMVKzTTKrSRQTq0tq9mOR55XWliOY2wsVQ+RRWZQiyACjiPQ9pg/0+U4JQEoBkXMi4OLmWpdsEZXofY5yYtSzH10HHJHBPYJMZhyhS8X84U5B+y36iaBNPxMr59nPTo9z8uU4jaToL8Yj88eN2xNTG+3r+/BBncMuSLRln1/+iZgdkhEY2NjvfMVo1DarbG20GIqoPMaqL5G38Zb+GBh36roMufpzc3N3xSvi0ZfX6APEYNAg86bjMluCFDr+7OX1JoWQNJed/ipaK6Z6oOi2dbTZ85eVan+YYLBL7yBdRb9IXkha23aPPa8bQBrFoUVqo4qMMU5mOZ2JBKeo98RiwHi8xQ7Qo6vCsdb6e+//4ubgJegLzlmDOQ6i/XKCVQskZg9aaFtRrBGsYytQpQiu+SPOI5xQ2+kK6mQJRJHo8lko8MqxswGhceCzY25mMnLEmOf3Br6f2/BaLaTqhuSl6/xxPRQNDrJehBRrSWxABMaMnmsKfCN9eEfSZS9lAG9O3OmJ9J1C9ABVb1rgoF1PqA/Cokw3k7stgKDvZHwHXcUYqW+J1CacejlcXoi4SvFvD2lRdxAER0s3glirS5Gyr7+FwAA//8Pj6q2AAAABklEQVQDAJPeLlNn5TR8AAAAAElFTkSuQmCC",uo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms8HjSgJctn1xIt6hxqIkdK+u8U8zT1ESmP5enUkWmqMkhG2FmxXOvR+EGD5KAhoDqsQvtiMXJQGNQJ4N8mF6PMd/wL8SxuOXPSG21pj9p+L1EOjGyAHoQQ0zWGDqx9pbPWIpwqOEkw+gGyMHoAc1ozOkVhOcZyepYndNpDpPvwAAAP//BVQJHAAAAAZJREFUAwDZWL4hub5xHQAAAABJRU5ErkJggg==",Ce="data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2534'%20width='200'%20height='200'%3e%3cpath%20d='M448%2085.333333a362.666667%20362.666667%200%201%200%20224.512%20647.509334l155.818667%20155.818666a42.666667%2042.666667%200%200%200%2060.330666-60.330666l-155.818666-155.818667A362.666667%20362.666667%200%200%200%20448%2085.333333zM170.666667%20448a277.333333%20277.333333%200%201%201%20554.666666%200%20277.333333%20277.333333%200%200%201-554.666666%200z'%20p-id='2535'%3e%3c/path%3e%3c/svg%3e",fo={class:"search-container"},mo={class:"selection-wrapper"},po={class:"tag-text"},ho=["onClick"],vo={key:0,class:"search-tag collapse"},go=["placeholder"],yo={class:"suffix-area"},Ao={key:1,class:"loading-spinner"},wo={class:"search-icon"},Co=["src"],xo={key:0,class:"history-section"},Eo={class:"history-header"},ko=["onMousedown"],Vo=["src"],bo={class:"type-text"},So={class:"result-text"},No={key:0,class:"status-msg"},Bo=["onMousedown"],Ro=["src"],Do={class:"type-text"},Oo={class:"result-text"},_o={key:0,class:"load-more-msg"},To={key:1,class:"load-more-msg no-more"},Lo={key:2,class:"status-msg"},Mo=e.defineComponent({__name:"index",props:{modelValue:{default:null},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},searchTypeList:{default:()=>["Continent","Country","Region","City","Seaport","Airport"]},historyKey:{default:void 0},lang:{default:""},placeholder:{},showSearchIcon:{type:Boolean,default:!0},showItemTag:{type:Boolean,default:!0}},emits:["update:modelValue","select","change","submit-search","remove"],setup(t,{emit:o}){const n=t,l=o,s=e.ref(null),a=e.ref(null),r=e.ref(null),i=e.ref(""),u=e.ref(""),c=e.ref(!1),d=e.ref(!1);let p=null;const f=e.computed(()=>n.modelValue?Array.isArray(n.modelValue)?n.modelValue:[n.modelValue]:[]),m=e.computed(()=>n.multiple?n.collapseTags?f.value.slice(0,1):f.value:[]),h=e.computed(()=>i.value||f.value.length>0),g=e.computed(()=>n.multiple?i.value?`${i.value.length*10+20}px`:"10px":"100%"),{searchHistory:y,saveToHistory:v,clearHistory:w}=rt(e.toRef(n,"historyKey")),{searchResults:C,loading:b,isFetchingMore:S,isFinished:F,currentPage:O,fetchData:L,filterByTypes:P}=ct(i,e.toRef(n,"searchTypeList")),{floatingStyles:_,startTrack:q,stopTrack:$}=so(a,r),D=e.computed(()=>{if(n.lang!=="")return n.lang==="en"||n.lang==="en-US";let A="";try{if(typeof useCookie=="function"){const V=useCookie("jc-language").value;if(V)return/en/.test(V)||/en-US/.test(V)}}catch{}return typeof process<"u"&&process.client?A=document.cookie||"":typeof process<"u"&&process.server&&(A=useNuxtApp?.()?.ssrContext?.event.node.req.headers.cookie||""),/jc-language=en-US/.test(A)||/jc-language=en/.test(A)}),H=e.computed(()=>n.multiple&&f.value.length>0?"":c.value&&!n.multiple?u.value:n.placeholder||D.value?"Please enter...":"请输入..."),X=()=>s.value?.focus(),k=A=>{if(v(A),n.multiple){if(!f.value.some(N=>N.id===A.id)){const N=[...f.value,A];l("update:modelValue",N)}i.value=""}else u.value=ce(A),c.value=!0,i.value="",d.value=!1,l("update:modelValue",A);l("select",A)},E=A=>{const V=f.value.filter(N=>N.id!==A.id);l("update:modelValue",V),l("remove",A)},x=()=>{n.multiple&&!i.value&&f.value.length>0&&E(f.value[f.value.length-1])},T=()=>{i.value="",c.value=!1,u.value="",l("update:modelValue",n.multiple?[]:null)},le=async()=>{if(d.value=!0,!n.multiple&&c.value&&C.value.length===0){const A=n.modelValue;if(A?.id){b.value=!0;try{const V=await it(A.id,A.type);C.value=P(V.records)}finally{b.value=!1}}}},tt=()=>setTimeout(()=>d.value=!1,200),ot=A=>{A.target.value===""&&!n.multiple&&T()},nt=()=>{n.multiple?l("submit-search",f.value):c.value&&l("submit-search",n.modelValue),d.value=!1},lt=A=>{const{scrollTop:V,scrollHeight:N,clientHeight:j}=A.target;V+j>=N-20&&!b.value&&!S.value&&!F.value&&i.value&&L(O.value+1,!0)};e.watch(d,A=>{A?q():$()}),e.watch(i,A=>{if(!A.trim()){C.value=[];return}p&&clearTimeout(p),p=setTimeout(()=>L(1,!1),300)});const Ne=A=>({City:uo,Country:co,Airport:ro,Seaport:io})[A]||ao,ce=A=>D.value?A.displayEn||A.display||"":A.displayCn||A.display||"",Be=A=>{const V={City:{en:"City",cn:"城市"},Country:{en:"Country",cn:"国家"},Region:{en:"Region",cn:"区域"},Airport:{en:"Airport",cn:"机场"},Seaport:{en:"Seaport",cn:"港口"}};return D.value?V[A].en:V[A].cn},st=A=>f.value.some(V=>V.id===A.id);return e.onBeforeUnmount($),(A,V)=>(e.openBlock(),e.createElementBlock("div",fo,[e.createElementVNode("div",{class:e.normalizeClass(["search-input-wrapper",{"is-multiple":t.multiple}]),ref_key:"referenceRef",ref:a,onClick:X},[e.createElementVNode("div",mo,[t.multiple&&f.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(N,j)=>(e.openBlock(),e.createElementBlock("div",{key:N.id||j,class:"search-tag"},[e.createElementVNode("span",po,e.toDisplayString(ce(N)),1),e.createElementVNode("span",{class:"tag-close",onClick:e.withModifiers(Re=>E(N),["stop"])},"×",8,ho)]))),128)),t.collapseTags&&f.value.length>1?(e.openBlock(),e.createElementBlock("div",vo," + "+e.toDisplayString(f.value.length-1),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:s,class:e.normalizeClass({"is-selected-state":c.value&&!t.multiple}),"onUpdate:modelValue":V[0]||(V[0]=N=>i.value=N),type:"text",placeholder:H.value,style:e.normalizeStyle({width:g.value}),onFocus:le,onBlur:tt,onInput:ot,onKeydown:e.withKeys(x,["delete"])},null,46,go),[[e.vModelText,i.value]])]),e.createElementVNode("div",yo,[h.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-icon",onMousedown:V[1]||(V[1]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(T,["stop"])},"ⓧ",32)):e.createCommentVNode("",!0),e.unref(b)&&!e.unref(S)?(e.openBlock(),e.createElementBlock("div",Ao)):!e.unref(b)&&t.showSearchIcon?(e.openBlock(),e.createElementBlock("button",{key:2,class:"search-btn",onClick:e.withModifiers(nt,["stop"])},[e.createElementVNode("span",wo,[e.createElementVNode("img",{src:e.unref(Ce),alt:"search"},null,8,Co)])])):e.createCommentVNode("",!0)])],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingRef",ref:r,class:"dropdown-list",style:e.normalizeStyle(e.unref(_)),onScroll:lt},[e.renderSlot(A.$slots,"history",{searchHistory:e.unref(y)},()=>[e.unref(y).length>0&&!i.value?(e.openBlock(),e.createElementBlock("div",xo,[e.createElementVNode("div",Eo,[e.createElementVNode("span",null,e.toDisplayString(D.value?"Recent search":"最近搜索"),1),e.createElementVNode("span",{class:"clear-btn",onMousedown:V[2]||(V[2]=e.withModifiers(()=>{},["prevent"])),onClick:V[3]||(V[3]=e.withModifiers((...N)=>e.unref(w)&&e.unref(w)(...N),["stop"]))},e.toDisplayString(D.value?"Clear":"清空"),33)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(N,j)=>(e.openBlock(),e.createElementBlock("div",{key:"hist-"+j,class:"dropdown-item",onMousedown:Re=>k(N)},[e.createElementVNode("div",{class:"category-tag",style:e.normalizeStyle(t.showItemTag?{}:{display:"none"})},[e.createElementVNode("img",{class:"type-icon",src:Ne(N.type),alt:""},null,8,Vo),e.createElementVNode("span",bo,e.toDisplayString(Be(N.type)),1)],4),e.createElementVNode("div",So,e.toDisplayString(ce(N)),1)],40,ko))),128)),V[4]||(V[4]=e.createElementVNode("hr",{class:"divider"},null,-1))])):e.createCommentVNode("",!0)],!0),e.unref(b)&&!e.unref(S)?(e.openBlock(),e.createElementBlock("div",No,e.toDisplayString(D.value?"Searching...":"正在搜索中..."),1)):e.unref(C).length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(A.$slots,"results",{searchResults:e.unref(C)},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C),(N,j)=>(e.openBlock(),e.createElementBlock("div",{key:j,class:e.normalizeClass(["dropdown-item",{"is-active":st(N)}]),onMousedown:Re=>k(N)},[e.createElementVNode("div",{class:"category-tag",style:e.normalizeStyle(t.showItemTag?{}:{display:"none"})},[e.createElementVNode("img",{class:"type-icon",src:Ne(N.type),alt:""},null,8,Ro),e.createElementVNode("span",Do,e.toDisplayString(Be(N.type)),1)],4),e.createElementVNode("div",Oo,e.toDisplayString(ce(N)),1)],42,Bo))),128))],!0),e.unref(S)?(e.openBlock(),e.createElementBlock("div",_o,e.toDisplayString(D.value?"Loading more...":"正在加载更多..."),1)):e.unref(F)&&i.value?(e.openBlock(),e.createElementBlock("div",To,e.toDisplayString(D.value?"All results have been loaded":"已加载全部结果"),1)):e.createCommentVNode("",!0)],64)):i.value&&!e.unref(b)?(e.openBlock(),e.createElementBlock("div",Lo,[e.renderSlot(A.$slots,"noData",{},()=>[e.createTextVNode(e.toDisplayString(D.value?`No results found related to "${i.value}".`:`未找到与 "${i.value}" 相关的结果`),1)],!0)])):e.createCommentVNode("",!0)],36),[[e.vShow,d.value&&(e.unref(C).length>0||e.unref(b)||i.value||e.unref(y).length>0)]])]))]))}}),be=(t,o)=>{const n=t.__vccOpts||t;for(const[l,s]of o)n[l]=s;return n},Se=be(Mo,[["__scopeId","data-v-e158c7a1"]]),Io={class:"modal-container"},Fo={class:"modal-header"},Po={class:"header-title"},Ho={class:"modal-body"},Qo={class:"form-item"},Uo={class:"required"},$o={class:"input-box"},Jo=["placeholder"],Wo={key:0,class:"error-message"},Ko={class:"form-item"},qo={class:"required"},Go={class:"type-group"},zo=["onClick"],Yo={key:0,class:"check-mark"},Xo={class:"form-item"},jo={class:"required"},Zo={key:0,class:"error-message"},en={class:"modal-footer"},tn={__name:"ApplyDataDialog",props:{value:{type:Boolean,default:!1},lang:{type:String,default:"en",validator:t=>["en","cn"].includes(t)},placeholder:{type:String,default:""}},emits:["update:value","confirm"],setup(t,{emit:o}){const n=t,l=o,s=[{typeCn:"城市",typeEn:"City",type:"City"},{typeCn:"海运港口",typeEn:"Port",type:"Seaport"},{typeCn:"机场",typeEn:"Airport",type:"Airport"}],a=e.ref(null),r=e.reactive({name:"",country:""}),i=e.reactive({name:"",type:"City"}),u=e.computed(()=>n.lang==="en"||n.lang==="en-US"),c=()=>{r.name="",r.country="",l("update:value",!1)},d=()=>{r.name="",r.country="";let p=!0;i.name.trim()||(r.name="Data name is required",p=!1),a.value||(r.country="Please select a country",p=!1),p&&l("confirm",{...i,country:a.value})};return(p,f)=>t.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-mask",onClick:e.withModifiers(c,["self"])},[e.createElementVNode("div",Io,[e.createElementVNode("div",Fo,[e.createElementVNode("span",Po,e.toDisplayString(u.value?"Apply for data addition":"申请补充数据"),1),e.createElementVNode("div",{class:"close-btn",onClick:c},"×")]),e.createElementVNode("div",Ho,[e.createElementVNode("div",Qo,[e.createElementVNode("label",Uo,e.toDisplayString(u.value?"Data To Add":"需补充的数据"),1),e.createElementVNode("div",$o,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=m=>i.name=m),type:"text",placeholder:t.placeholder??(u.value?" Please enter":"请输入"),class:e.normalizeClass(["custom-input",{"input-error":r.name}]),onInput:f[1]||(f[1]=m=>r.name="")},null,42,Jo),[[e.vModelText,i.name]])]),r.name?(e.openBlock(),e.createElementBlock("div",Wo,e.toDisplayString(r.name),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ko,[e.createElementVNode("label",qo,e.toDisplayString(u.value?"Type":"所属类别"),1),e.createElementVNode("div",Go,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,m=>e.createElementVNode("div",{key:m.type,class:e.normalizeClass(["type-btn",{active:i.type===m.type}]),onClick:h=>i.type=m.type},[e.createTextVNode(e.toDisplayString(u.value?m.typeEn:m.typeCn)+" ",1),i.type===m.type?(e.openBlock(),e.createElementBlock("div",Yo)):e.createCommentVNode("",!0)],10,zo)),64))])]),e.createElementVNode("div",Xo,[e.createElementVNode("label",jo,e.toDisplayString(u.value?"Country":"国家"),1),e.createElementVNode("div",{class:e.normalizeClass({"search-error-wrap":r.country})},[e.createVNode(Se,{"search-type-list":["Country"],"model-value":a.value,"onUpdate:modelValue":[f[2]||(f[2]=m=>a.value=m),f[3]||(f[3]=m=>r.country="")],style:{margin:"0 auto"},lang:t.lang,placeholder:t.placeholder??(u.value?" Please enter":"请输入")},null,8,["model-value","lang","placeholder"])],2),r.country?(e.openBlock(),e.createElementBlock("div",Zo,e.toDisplayString(r.country),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",en,[e.createElementVNode("button",{class:"confirm-btn",onClick:d},e.toDisplayString(u.value?"Submit":"申请补充"),1)])])])):e.createCommentVNode("",!0)}},je=be(tn,[["__scopeId","data-v-257bbed9"]]),on={class:"global-modal-header-custom"},nn={class:"global-modal-body-custom"},ln={class:"global-modal-footer-custom"},Ze=e.defineComponent({__name:"GlobalModal",setup(t){const o=e.ref(),n=e.ref(!1),l=e.ref({city:"",company:"",email:"",phone:"",name:"",agreement:!1}),s=e.reactive({city:[{required:!0,message:"请输入所在地城市",trigger:"blur"}],company:[{required:!0,message:"请输入公司名称",trigger:"blur"}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"},{type:"email",message:"请输入有效的邮箱地址",trigger:"blur"}],agreement:[{validator:(u,c,d)=>{c?d():d(new Error("请同意隐私政策"))},trigger:"change"}]}),a=()=>{n.value=!1,R.emitter.emit(R.MODAL_ACTION.Close,void 0),o.value?.resetFields()},r=async()=>{o.value&&await o.value.validate(u=>{u&&(R.emitter.emit(R.MODAL_ACTION.Submit,l.value),a(),l.value={city:"",company:"",email:"",phone:"",name:"",agreement:!1})})},i=u=>{n.value=!0};return e.onMounted(()=>{R.emitter.on(R.MODAL_ACTION.Open,i)}),e.onUnmounted(()=>{R.emitter.off(R.MODAL_ACTION.Open,i)}),(u,c)=>(e.openBlock(),e.createBlock(e.unref(B.ElDialog),{modelValue:n.value,"onUpdate:modelValue":c[7]||(c[7]=d=>n.value=d),"before-close":a,"show-close":!1,"close-on-click-modal":!0,width:500,class:"global-modal-custom"},{header:e.withCtx(()=>[e.createElementVNode("div",on,[c[9]||(c[9]=e.createElementVNode("h2",null,"即刻链接全球货代",-1)),e.createVNode(e.unref(B.ElButton),{link:"",onClick:a,class:"close-button-custom","aria-label":"Close"},{default:e.withCtx(()=>[...c[8]||(c[8]=[e.createElementVNode("span",{style:{"font-size":"2rem"}},"×",-1)])]),_:1})])]),footer:e.withCtx(()=>[e.createElementVNode("div",ln,[e.createVNode(e.unref(B.ElButton),{type:"primary",class:"submit-button-custom",onClick:r},{default:e.withCtx(()=>[...c[11]||(c[11]=[e.createTextVNode(" 加入会员 ",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",nn,[e.createVNode(e.unref(B.ElForm),{model:l.value,rules:s,ref_key:"formRef",ref:o,"label-position":"top",onSubmit:c[6]||(c[6]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"所在地(城市)",prop:"city"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.city,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value.city=d),placeholder:"请输入城市"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"公司名称",prop:"company"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.company,"onUpdate:modelValue":c[1]||(c[1]=d=>l.value.company=d),placeholder:"请输入公司名称"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"邮箱",prop:"email"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.email,"onUpdate:modelValue":c[2]||(c[2]=d=>l.value.email=d),placeholder:"请输入邮箱"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"电话",prop:"phone"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.phone,"onUpdate:modelValue":c[3]||(c[3]=d=>l.value.phone=d),placeholder:"请输入电话"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElRow),null,{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:24},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"姓名",prop:"name"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.name,"onUpdate:modelValue":c[4]||(c[4]=d=>l.value.name=d),placeholder:"请输入您的全名"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElFormItem),{prop:"agreement",class:"agreement-item"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCheckbox),{modelValue:l.value.agreement,"onUpdate:modelValue":c[5]||(c[5]=d=>l.value.agreement=d),label:"我同意"},null,8,["modelValue"]),c[10]||(c[10]=e.createElementVNode("a",{href:"#",class:"privacy-link"},"隐私政策",-1))]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"]))}});function sn(t){const o=e.ref([]),n="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",s=e.computed(()=>(t.value||"")+n),a=e.computed(()=>!!t.value&&t.value!==""),r=u=>{if(!u||!l)return;const c=o.value.filter(p=>p.id&&p.id!==u.id||p.display!==u.display);c.unshift(u);const d=c.slice(0,4);if(a.value){o.value=d;try{localStorage.setItem(s.value,JSON.stringify(d))}catch(p){console.warn("LocalStorage save failed:",p)}}},i=()=>{o.value=[],l&&localStorage.removeItem(s.value)};return e.onMounted(()=>{if(l&&a.value){const u=localStorage.getItem(s.value);if(u)try{o.value=JSON.parse(u)}catch{o.value=[]}}}),{searchHistory:o,saveToHistory:r,clearHistory:i,HasHistory:a}}async function rn(t,o=["Continent","Country","City","Seaport","Airport"],n={}){return R.locationSearchV2.searchByName({keyword:t,displayInfo:o,...n})}function an(t,o){const n=e.ref([]),l=e.ref(!1),s=e.ref(!1),a=e.ref(!1),r=e.ref(1),i=10,u=e.ref(0),c=e.computed(()=>{const f=[...o.value];return f.includes("Country")&&!f.includes("Region")&&f.push("Region"),f}),d=f=>Array.isArray(f)?f.filter(m=>c.value.includes(m.type)):[];return{searchResults:n,loading:l,isFetchingMore:s,isFinished:a,fetchData:async(f=!1)=>{const m=t.value.trim();if(!m){n.value=[],u.value=0,a.value=!1;return}if(f){if(s.value||a.value)return;s.value=!0,r.value+=1}else{if(l.value)return;l.value=!0,r.value=1,a.value=!1}try{const h=await rn(m,o.value,{current:r.value,size:i}),g=d(h.records||[]);f?n.value.push(...g):n.value=g,u.value=h.total||0,(n.value.length>=u.value||g.length<i)&&(a.value=!0)}catch(h){console.error("Search request failed:",h),f&&(r.value-=1)}finally{l.value=!1,s.value=!1}}}}const cn={class:"h5-search-container"},un={class:"trigger-content"},dn=["src"],fn={class:"placeholder-text"},mn={key:0,class:"selected-count"},pn={key:1,class:"selected-val"},hn={key:2,class:"placeholder-gray"},vn={key:0,class:"h5-modal-root"},gn={class:"h5-drawer-card"},yn={class:"h5-header"},An={class:"h5-input-wrapper"},wn=["src"],Cn=["placeholder"],xn={key:0,class:"h5-spinner-box"},En={key:1,class:"h5-section"},kn={class:"h5-section-hd"},Vn={class:"h5-history-grid"},bn=["onClick"],Sn={key:2,class:"h5-result-list"},Nn=["onClick"],Bn={class:"item-info"},Rn={class:"item-name"},Dn={key:0,class:"item-sub"},On={class:"h5-load-status"},_n={key:1,class:"no-more"},Tn={key:3,class:"h5-empty"},Ln=e.defineComponent({__name:"index",props:{modelValue:{},multiple:{type:Boolean,default:!1},lang:{default:"zh-CN"},placeholder:{},historyKey:{}},emits:["update:modelValue","select"],setup(t,{emit:o}){const n=t,l=o,s=e.ref(!1),a=e.ref(""),r=e.ref(null),i=e.ref(null);let u=null;const{searchHistory:c,saveToHistory:d,clearHistory:p}=sn(e.toRef(n,"historyKey")),{searchResults:f,loading:m,isFetchingMore:h,isFinished:g,fetchData:y}=an(a,e.ref(["City","Seaport","Airport"])),v=e.computed(()=>n.lang.includes("en")),w=e.computed(()=>Array.isArray(n.modelValue)?n.modelValue:n.modelValue?[n.modelValue]:[]),C=e.computed(()=>!n.multiple&&!!n.modelValue),b=e.computed(()=>C.value?D(n.modelValue):""),S=e.computed(()=>w.value.length>0),F=()=>{s.value=!0,e.nextTick(()=>{r.value?.focus()})},O=()=>{s.value=!1,a.value=""},L=k=>{d(k),n.multiple?w.value.some(x=>x.id===k.id)||l("update:modelValue",[...w.value,k]):(l("update:modelValue",k),O()),l("select",k)},P=()=>{l("update:modelValue",n.multiple?[]:null)},_=e.ref(!1),q=k=>{const E=k.target;if(!E)return;E.scrollTop+E.clientHeight>=E.scrollHeight-80&&a.value&&!m.value&&!h.value&&!g.value&&!_.value&&(_.value=!0,y(!0))};e.watch(h,k=>{k||(_.value=!1)});const $=()=>{u&&clearTimeout(u),u=setTimeout(()=>{_.value=!1,i.value?.scrollTo({top:0}),console.log("🍉 ~ index.vue:279 ~ onInput ~ fetchData:",y),y(!1)},300)},D=k=>v.value?k.displayEn||k.display:k.displayCn||k.display,H=k=>{const E={City:"城市",Seaport:"港口",Airport:"机场"};return v.value?k:E[k]||k},X=k=>w.value.some(E=>E.id===k.id);return(k,E)=>(e.openBlock(),e.createElementBlock("div",cn,[e.createElementVNode("div",{class:"search-trigger",onClick:F},[e.createElementVNode("div",un,[e.createElementVNode("img",{src:e.unref(Ce),class:"search-icon-m"},null,8,dn),e.createElementVNode("div",fn,[t.multiple&&w.value.length>0?(e.openBlock(),e.createElementBlock("span",mn,e.toDisplayString(v.value?"Selected":"已选")+" ("+e.toDisplayString(w.value.length)+")",1)):!t.multiple&&C.value?(e.openBlock(),e.createElementBlock("span",pn,e.toDisplayString(b.value),1)):(e.openBlock(),e.createElementBlock("span",hn,e.toDisplayString(t.placeholder||(v.value?"Search":"搜索")),1))])]),S.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-trigger",onClick:e.withModifiers(P,["stop"])},"ⓧ")):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[s.value?(e.openBlock(),e.createElementBlock("div",vn,[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"h5-mask",onClick:O})]),_:1}),e.createVNode(e.Transition,{name:"slide-up"},{default:e.withCtx(()=>[e.createElementVNode("div",gn,[e.createElementVNode("div",{class:"drawer-handle",onClick:O}),e.createElementVNode("div",yn,[e.createElementVNode("div",An,[e.createElementVNode("img",{src:e.unref(Ce),class:"inner-icon"},null,8,wn),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:r,"onUpdate:modelValue":E[0]||(E[0]=x=>a.value=x),placeholder:v.value?"City/Port/Airport":"搜索城市/港口/机场",onInput:$},null,40,Cn),[[e.vModelText,a.value]]),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"h5-clear-btn",onClick:E[1]||(E[1]=x=>a.value="")}," ✕ ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"h5-cancel-btn",onClick:O},e.toDisplayString(v.value?"Cancel":"取消"),1)]),e.createElementVNode("div",{class:"h5-main-content",ref_key:"scrollContainer",ref:i,onScroll:q},[e.unref(m)&&!e.unref(h)?(e.openBlock(),e.createElementBlock("div",xn,[...E[3]||(E[3]=[e.createElementVNode("div",{class:"h5-spinner"},null,-1)])])):e.createCommentVNode("",!0),!a.value&&e.unref(c).length>0?(e.openBlock(),e.createElementBlock("div",En,[e.createElementVNode("div",kn,[e.createElementVNode("span",null,e.toDisplayString(v.value?"Recent":"最近搜索"),1),e.createElementVNode("span",{class:"h5-clear-history",onClick:E[2]||(E[2]=(...x)=>e.unref(p)&&e.unref(p)(...x))},e.toDisplayString(v.value?"Clear":"清空"),1)]),e.createElementVNode("div",Vn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(x,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"h5-history-tag",onClick:le=>L(x)},e.toDisplayString(D(x)),9,bn))),128))])])):e.createCommentVNode("",!0),e.unref(f).length>0?(e.openBlock(),e.createElementBlock("div",Sn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(x,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:e.normalizeClass(["h5-result-item",{"is-active":X(x)}]),onClick:le=>L(x)},[e.createElementVNode("div",{class:e.normalizeClass(["item-type",x.type.toLowerCase()])},e.toDisplayString(H(x.type)),3),e.createElementVNode("div",Bn,[e.createElementVNode("div",Rn,e.toDisplayString(D(x)),1),x.parentName?(e.openBlock(),e.createElementBlock("div",Dn,e.toDisplayString(x.parentName),1)):e.createCommentVNode("",!0)])],10,Nn))),128)),e.createElementVNode("div",On,[e.unref(h)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E[4]||(E[4]=e.createElementVNode("div",{class:"mini-spinner"},null,-1)),e.createElementVNode("span",null,e.toDisplayString(v.value?"Loading...":"加载中..."),1)],64)):e.unref(g)&&a.value?(e.openBlock(),e.createElementBlock("span",_n,e.toDisplayString(v.value?"No more results":"没有更多结果了"),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),a.value&&!e.unref(m)&&e.unref(f).length===0?(e.openBlock(),e.createElementBlock("div",Tn,e.toDisplayString(v.value?"No Results Found":"未找到相关结果"),1)):e.createCommentVNode("",!0)],544)])]),_:1})])):e.createCommentVNode("",!0)]))]))}}),et=be(Ln,[["__scopeId","data-v-95bd2748"]]);let Mn={open(){R.emitter.emit(R.MODAL_ACTION.Open)},close(){R.emitter.emit(R.MODAL_ACTION.Close)},onSubmit(t){R.emitter.on(R.MODAL_ACTION.Submit,t)}};function In(){let t=!1;return{install(o){if(typeof window<"u"&&!t){const n=document.createElement("div");n.setAttribute("id","global-modal-root"),document.body.appendChild(n),e.createApp(Ze).mount(n),t=!0}o.config.globalProperties.$globalModal=Mn}}}const Pe={ApplyDataDialog:je,JcSearch:Se,JCMSearch:et};let He=!1;const Fn={install(t,o){if(!He){He=!0,o?.sharedConfig&&R.initSharedConfig(o.sharedConfig);for(const n in Pe)t.component(n,Pe[n])}}};Object.defineProperty(exports,"MODAL_ACTION",{enumerable:!0,get:()=>R.MODAL_ACTION});Object.defineProperty(exports,"emitter",{enumerable:!0,get:()=>R.emitter});exports.ApplyDataDialog=je;exports.GlobalModal=Ze;exports.JCMSearch=et;exports.JcSearch=Se;exports.createGlobalModalPlugin=In;exports.default=Fn;
|