@jctrans-materials/comps-vue3 1.0.0 → 1.0.1

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.
@@ -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,7 @@ interface Props {
6
6
  collapseTags?: boolean;
7
7
  searchTypeList?: string[];
8
8
  historyKey?: string;
9
+ lang?: "" | "en" | "cn" | "en-US" | "zh-CN";
9
10
  }
10
11
  declare function __VLS_template(): {
11
12
  history?(_: {
@@ -14,6 +15,8 @@ declare function __VLS_template(): {
14
15
  id?: string | number | undefined;
15
16
  type: string;
16
17
  display?: string | undefined;
18
+ displayEn?: string | undefined;
19
+ displayCn?: string | undefined;
17
20
  name?: string | undefined;
18
21
  nameEn?: string | undefined;
19
22
  nameCn?: string | undefined;
@@ -25,6 +28,8 @@ declare function __VLS_template(): {
25
28
  id?: string | number | undefined;
26
29
  type: string;
27
30
  display?: string | undefined;
31
+ displayEn?: string | undefined;
32
+ displayCn?: string | undefined;
28
33
  name?: string | undefined;
29
34
  nameEn?: string | undefined;
30
35
  nameCn?: string | undefined;
@@ -37,7 +42,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
37
42
  multiple: boolean;
38
43
  collapseTags: boolean;
39
44
  searchTypeList: () => string[];
40
- historyKey: string;
45
+ historyKey: undefined;
46
+ lang: string;
41
47
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
42
48
  change: (...args: any[]) => void;
43
49
  select: (...args: any[]) => void;
@@ -49,7 +55,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
49
55
  multiple: boolean;
50
56
  collapseTags: boolean;
51
57
  searchTypeList: () => string[];
52
- historyKey: string;
58
+ historyKey: undefined;
59
+ lang: string;
53
60
  }>>> & Readonly<{
54
61
  onChange?: ((...args: any[]) => any) | undefined;
55
62
  onSelect?: ((...args: any[]) => any) | undefined;
@@ -62,6 +69,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
62
69
  collapseTags: boolean;
63
70
  searchTypeList: string[];
64
71
  historyKey: string;
72
+ lang: "" | "en" | "cn" | "en-US" | "zh-CN";
65
73
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
66
74
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
67
75
  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+KRN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uOXPSG21pj9p+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"),S=require("@jctrans-materials/shared"),k=require("element-plus");function ot(t){const n=e.ref([]),o="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",i=e.computed(()=>(t.value||"")+o),a=e.computed(()=>!!t.value&&t.value!==""),r=u=>{if(!u||!l)return;const c=n.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){n.value=d;try{localStorage.setItem(i.value,JSON.stringify(d))}catch(p){console.warn("LocalStorage save failed:",p)}}},s=()=>{n.value=[],l&&localStorage.removeItem(i.value)};return e.onMounted(()=>{if(l&&a.value){const u=localStorage.getItem(i.value);if(u)try{n.value=JSON.parse(u)}catch{n.value=[]}}}),{searchHistory:n,saveToHistory:r,clearHistory:s,HasHistory:a}}async function lt(t,n=["Continent","Country","City","Seaport","Airport"],o={}){return S.locationSearchV2.searchByName({keyword:t,displayInfo:n,...o})}const it=(t,n)=>S.locationSearchV2.searchByIdWithType(t,n);function rt(t,n){const o=e.ref([]),l=e.ref(!1),i=e.ref(!1),a=e.ref(1),r=e.ref(0),s=e.ref(10),u=e.computed(()=>r.value===0?!1:o.value.length>=r.value),c=e.computed(()=>{const f=[...n.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:o,loading:l,isFetchingMore:i,isFinished:u,currentPage:a,total:r,fetchData:async(f=1,m=!1)=>{if(!t.value.trim()&&!m){o.value=[],r.value=0;return}if(!(m&&(i.value||u.value))&&!(!m&&l.value)){m?i.value=!0:(l.value=!0,a.value=1);try{const g=await lt(t.value,n.value,{current:f,size:s.value}),y=g.records||[],v=d(y);m?o.value=[...o.value,...v]:o.value=v,r.value=g.total||0,a.value=f}catch(g){console.error("Failed to fetch search results:",g)}finally{l.value=!1,i.value=!1}}},filterByTypes:d}}const ee=Math.min,O=Math.max,ue=Math.round,ce=Math.floor,Q=t=>({x:t,y:t}),st={left:"right",right:"left",bottom:"top",top:"bottom"},at={start:"end",end:"start"};function Re(t,n,o){return O(t,ee(n,o))}function ie(t,n){return typeof t=="function"?t(n):t}function Y(t){return t.split("-")[0]}function re(t){return t.split("-")[1]}function Ie(t){return t==="x"?"y":"x"}function Pe(t){return t==="y"?"height":"width"}const ct=new Set(["top","bottom"]);function G(t){return ct.has(Y(t))?"y":"x"}function Qe(t){return Ie(G(t))}function ut(t,n,o){o===void 0&&(o=!1);const l=re(t),i=Qe(t),a=Pe(i);let r=i==="x"?l===(o?"end":"start")?"right":"left":l==="start"?"bottom":"top";return n.reference[a]>n.floating[a]&&(r=de(r)),[r,de(r)]}function dt(t){const n=de(t);return[Ae(t),n,Ae(n)]}function Ae(t){return t.replace(/start|end/g,n=>at[n])}const Oe=["left","right"],Be=["right","left"],ft=["top","bottom"],mt=["bottom","top"];function pt(t,n,o){switch(t){case"top":case"bottom":return o?n?Be:Oe:n?Oe:Be;case"left":case"right":return n?ft:mt;default:return[]}}function gt(t,n,o,l){const i=re(t);let a=pt(Y(t),o==="start",l);return i&&(a=a.map(r=>r+"-"+i),n&&(a=a.concat(a.map(Ae)))),a}function de(t){return t.replace(/left|right|bottom|top/g,n=>st[n])}function ht(t){return{top:0,right:0,bottom:0,left:0,...t}}function vt(t){return typeof t!="number"?ht(t):{top:t,right:t,bottom:t,left:t}}function fe(t){const{x:n,y:o,width:l,height:i}=t;return{width:l,height:i,top:o,left:n,right:n+l,bottom:o+i,x:n,y:o}}function De(t,n,o){let{reference:l,floating:i}=t;const a=G(n),r=Qe(n),s=Pe(r),u=Y(n),c=a==="y",d=l.x+l.width/2-i.width/2,p=l.y+l.height/2-i.height/2,f=l[s]/2-i[s]/2;let m;switch(u){case"top":m={x:d,y:l.y-i.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-i.width,y:p};break;default:m={x:l.x,y:l.y}}switch(re(n)){case"start":m[r]-=f*(o&&c?-1:1);break;case"end":m[r]+=f*(o&&c?-1:1);break}return m}const yt=async(t,n,o)=>{const{placement:l="bottom",strategy:i="absolute",middleware:a=[],platform:r}=o,s=a.filter(Boolean),u=await(r.isRTL==null?void 0:r.isRTL(n));let c=await r.getElementRects({reference:t,floating:n,strategy:i}),{x:d,y:p}=De(c,l,u),f=l,m={},g=0;for(let y=0;y<s.length;y++){const{name:v,fn:A}=s[y],{x:w,y:x,data:V,reset:E}=await A({x:d,y:p,initialPlacement:l,placement:f,strategy:i,middlewareData:m,rects:c,platform:r,elements:{reference:t,floating:n}});d=w??d,p=x??p,m={...m,[v]:{...m[v],...V}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await r.getElementRects({reference:t,floating:n,strategy:i}):E.rects),{x:d,y:p}=De(c,f,u)),y=-1)}return{x:d,y:p,placement:f,strategy:i,middlewareData:m}};async function xe(t,n){var o;n===void 0&&(n={});const{x:l,y:i,platform:a,rects:r,elements:s,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:f=!1,padding:m=0}=ie(n,t),g=vt(m),v=s[f?p==="floating"?"reference":"floating":p],A=fe(await a.getClippingRect({element:(o=await(a.isElement==null?void 0:a.isElement(v)))==null||o?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:u})),w=p==="floating"?{x:l,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),V=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},E=fe(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:x,strategy:u}):w);return{top:(A.top-E.top+g.top)/V.y,bottom:(E.bottom-A.bottom+g.bottom)/V.y,left:(A.left-E.left+g.left)/V.x,right:(E.right-A.right+g.right)/V.x}}const At=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,l;const{placement:i,middlewareData:a,rects:r,initialPlacement:s,platform:u,elements:c}=n,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=ie(t,n);if((o=a.arrow)!=null&&o.alignmentOffset)return{};const A=Y(i),w=G(s),x=Y(s)===s,V=await(u.isRTL==null?void 0:u.isRTL(c.floating)),E=f||(x||!y?[de(s)]:dt(s)),F=g!=="none";!f&&F&&E.push(...gt(s,y,g,V));const D=[s,...E],I=await xe(n,v),W=[];let T=((l=a.flip)==null?void 0:l.overflows)||[];if(d&&W.push(I[A]),p){const J=ut(i,r,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=a.flip)==null?void 0:X.index)||0)+1,oe=D[J];if(oe&&(!(p==="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(m){case"bestFit":{var N;const P=(N=T.filter(R=>{if(F){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:N[0];P&&(q=P);break}case"initialPlacement":q=s;break}if(i!==q)return{reset:{placement:q}}}return{}}}},wt=new Set(["left","top"]);async function xt(t,n){const{placement:o,platform:l,elements:i}=t,a=await(l.isRTL==null?void 0:l.isRTL(i.floating)),r=Y(o),s=re(o),u=G(o)==="y",c=wt.has(r)?-1:1,d=a&&u?-1:1,p=ie(n,t);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof g=="number"&&(m=s==="end"?g*-1:g),u?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const bt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,l;const{x:i,y:a,placement:r,middlewareData:s}=n,u=await xt(n,t);return r===((o=s.offset)==null?void 0:o.placement)&&(l=s.arrow)!=null&&l.alignmentOffset?{}:{x:i+u.x,y:a+u.y,data:{...u,placement:r}}}}},Ct=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:l,placement:i}=n,{mainAxis:a=!0,crossAxis:r=!1,limiter:s={fn:v=>{let{x:A,y:w}=v;return{x:A,y:w}}},...u}=ie(t,n),c={x:o,y:l},d=await xe(n,u),p=G(Y(i)),f=Ie(p);let m=c[f],g=c[p];if(a){const v=f==="y"?"top":"left",A=f==="y"?"bottom":"right",w=m+d[v],x=m-d[A];m=Re(w,m,x)}if(r){const v=p==="y"?"top":"left",A=p==="y"?"bottom":"right",w=g+d[v],x=g-d[A];g=Re(w,g,x)}const y=s.fn({...n,[f]:m,[p]:g});return{...y,data:{x:y.x-o,y:y.y-l,enabled:{[f]:a,[p]:r}}}}}},Et=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,l;const{placement:i,rects:a,platform:r,elements:s}=n,{apply:u=()=>{},...c}=ie(t,n),d=await xe(n,c),p=Y(i),f=re(i),m=G(i)==="y",{width:g,height:y}=a.floating;let v,A;p==="top"||p==="bottom"?(v=p,A=f===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(A=p,v=f==="end"?"top":"bottom");const w=y-d.top-d.bottom,x=g-d.left-d.right,V=ee(y-d[v],w),E=ee(g-d[A],x),F=!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),F&&!f){const T=O(d.left,0),X=O(d.right,0),K=O(d.top,0),N=O(d.bottom,0);m?I=g-2*(T!==0||X!==0?T+X:O(d.left,d.right)):D=y-2*(K!==0||N!==0?K+N:O(d.top,d.bottom))}await u({...n,availableWidth:I,availableHeight:D});const W=await r.getDimensions(s.floating);return g!==W.width||y!==W.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<"u"}function ne(t){return Ue(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function H(t){var n;return(n=(Ue(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Ue(t){return me()?t instanceof Node||t instanceof B(t).Node:!1}function _(t){return me()?t instanceof Element||t instanceof B(t).Element:!1}function U(t){return me()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Te(t){return!me()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const Vt=new Set(["inline","contents"]);function se(t){const{overflow:n,overflowX:o,overflowY:l,display:i}=L(t);return/auto|scroll|overlay|hidden|clip/.test(n+l+o)&&!Vt.has(i)}const kt=new Set(["table","td","th"]);function St(t){return kt.has(ne(t))}const Nt=[":popover-open",":modal"];function pe(t){return Nt.some(n=>{try{return t.matches(n)}catch{return!1}})}const Rt=["transform","translate","scale","rotate","perspective"],Ot=["transform","translate","scale","rotate","perspective","filter"],Bt=["paint","layout","strict","content"];function be(t){const n=Ce(),o=_(t)?L(t):t;return Rt.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)||Ot.some(l=>(o.willChange||"").includes(l))||Bt.some(l=>(o.contain||"").includes(l))}function Dt(t){let n=z(t);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 Tt=new Set(["html","body","#document"]);function te(t){return Tt.has(ne(t))}function L(t){return B(t).getComputedStyle(t)}function ge(t){return _(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function z(t){if(ne(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Te(t)&&t.host||H(t);return Te(n)?n.host:n}function He(t){const n=z(t);return te(n)?t.ownerDocument?t.ownerDocument.body:t.body:U(n)&&se(n)?n:He(n)}function le(t,n,o){var l;n===void 0&&(n=[]),o===void 0&&(o=!0);const i=He(t),a=i===((l=t.ownerDocument)==null?void 0:l.body),r=B(i);if(a){const s=we(r);return n.concat(r,r.visualViewport||[],se(i)?i:[],s&&o?le(s):[])}return n.concat(i,le(i,[],o))}function we(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function We(t){const n=L(t);let o=parseFloat(n.width)||0,l=parseFloat(n.height)||0;const i=U(t),a=i?t.offsetWidth:o,r=i?t.offsetHeight:l,s=ue(o)!==a||ue(l)!==r;return s&&(o=a,l=r),{width:o,height:l,$:s}}function Ee(t){return _(t)?t:t.contextElement}function Z(t){const n=Ee(t);if(!U(n))return Q(1);const o=n.getBoundingClientRect(),{width:l,height:i,$:a}=We(n);let r=(a?ue(o.width):o.width)/l,s=(a?ue(o.height):o.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const Mt=Q(0);function Je(t){const n=B(t);return!Ce()||!n.visualViewport?Mt:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function _t(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==B(t)?!1:n}function $(t,n,o,l){n===void 0&&(n=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),a=Ee(t);let r=Q(1);n&&(l?_(l)&&(r=Z(l)):r=Z(t));const s=_t(a,o,l)?Je(a):Q(0);let u=(i.left+s.x)/r.x,c=(i.top+s.y)/r.y,d=i.width/r.x,p=i.height/r.y;if(a){const f=B(a),m=l&&_(l)?B(l):l;let g=f,y=we(g);for(;y&&l&&m!==g;){const v=Z(y),A=y.getBoundingClientRect(),w=L(y),x=A.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,V=A.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;u*=v.x,c*=v.y,d*=v.x,p*=v.y,u+=x,c+=V,g=B(y),y=we(g)}}return fe({width:d,height:p,x:u,y:c})}function he(t,n){const o=ge(t).scrollLeft;return n?n.left+o:$(H(t)).left+o}function Ge(t,n){const o=t.getBoundingClientRect(),l=o.left+n.scrollLeft-he(t,o),i=o.top+n.scrollTop;return{x:l,y:i}}function Lt(t){let{elements:n,rect:o,offsetParent:l,strategy:i}=t;const a=i==="fixed",r=H(l),s=n?pe(n.floating):!1;if(l===r||s&&a)return o;let u={scrollLeft:0,scrollTop:0},c=Q(1);const d=Q(0),p=U(l);if((p||!p&&!a)&&((ne(l)!=="body"||se(r))&&(u=ge(l)),U(l))){const m=$(l);c=Z(l),d.x=m.x+l.clientLeft,d.y=m.y+l.clientTop}const f=r&&!p&&!a?Ge(r,u):Q(0);return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-u.scrollLeft*c.x+d.x+f.x,y:o.y*c.y-u.scrollTop*c.y+d.y+f.y}}function Ft(t){return Array.from(t.getClientRects())}function It(t){const n=H(t),o=ge(t),l=t.ownerDocument.body,i=O(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),a=O(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let r=-o.scrollLeft+he(t);const s=-o.scrollTop;return L(l).direction==="rtl"&&(r+=O(n.clientWidth,l.clientWidth)-i),{width:i,height:a,x:r,y:s}}const Me=25;function Pt(t,n){const o=B(t),l=H(t),i=o.visualViewport;let a=l.clientWidth,r=l.clientHeight,s=0,u=0;if(i){a=i.width,r=i.height;const d=Ce();(!d||d&&n==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}const c=he(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,g=Math.abs(l.clientWidth-p.clientWidth-m);g<=Me&&(a-=g)}else c<=Me&&(a+=c);return{width:a,height:r,x:s,y:u}}const Qt=new Set(["absolute","fixed"]);function Ut(t,n){const o=$(t,!0,n==="fixed"),l=o.top+t.clientTop,i=o.left+t.clientLeft,a=U(t)?Z(t):Q(1),r=t.clientWidth*a.x,s=t.clientHeight*a.y,u=i*a.x,c=l*a.y;return{width:r,height:s,x:u,y:c}}function _e(t,n,o){let l;if(n==="viewport")l=Pt(t,o);else if(n==="document")l=It(H(t));else if(_(n))l=Ut(n,o);else{const i=Je(t);l={x:n.x-i.x,y:n.y-i.y,width:n.width,height:n.height}}return fe(l)}function Ke(t,n){const o=z(t);return o===n||!_(o)||te(o)?!1:L(o).position==="fixed"||Ke(o,n)}function Ht(t,n){const o=n.get(t);if(o)return o;let l=le(t,[],!1).filter(s=>_(s)&&ne(s)!=="body"),i=null;const a=L(t).position==="fixed";let r=a?z(t):t;for(;_(r)&&!te(r);){const s=L(r),u=be(r);!u&&s.position==="fixed"&&(i=null),(a?!u&&!i:!u&&s.position==="static"&&!!i&&Qt.has(i.position)||se(r)&&!u&&Ke(t,r))?l=l.filter(d=>d!==r):i=s,r=z(r)}return n.set(t,l),l}function Wt(t){let{element:n,boundary:o,rootBoundary:l,strategy:i}=t;const r=[...o==="clippingAncestors"?pe(n)?[]:Ht(n,this._c):[].concat(o),l],s=r[0],u=r.reduce((c,d)=>{const p=_e(n,d,i);return c.top=O(p.top,c.top),c.right=ee(p.right,c.right),c.bottom=ee(p.bottom,c.bottom),c.left=O(p.left,c.left),c},_e(n,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Jt(t){const{width:n,height:o}=We(t);return{width:n,height:o}}function Gt(t,n,o){const l=U(n),i=H(n),a=o==="fixed",r=$(t,!0,a,n);let s={scrollLeft:0,scrollTop:0};const u=Q(0);function c(){u.x=he(i)}if(l||!l&&!a)if((ne(n)!=="body"||se(i))&&(s=ge(n)),l){const m=$(n,!0,a,n);u.x=m.x+n.clientLeft,u.y=m.y+n.clientTop}else i&&c();a&&!l&&i&&c();const d=i&&!l&&!a?Ge(i,s):Q(0),p=r.left+s.scrollLeft-u.x-d.x,f=r.top+s.scrollTop-u.y-d.y;return{x:p,y:f,width:r.width,height:r.height}}function ye(t){return L(t).position==="static"}function Le(t,n){if(!U(t)||L(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return H(t)===o&&(o=o.ownerDocument.body),o}function qe(t,n){const o=B(t);if(pe(t))return o;if(!U(t)){let i=z(t);for(;i&&!te(i);){if(_(i)&&!ye(i))return i;i=z(i)}return o}let l=Le(t,n);for(;l&&St(l)&&ye(l);)l=Le(l,n);return l&&te(l)&&ye(l)&&!be(l)?o:l||Dt(t)||o}const Kt=async function(t){const n=this.getOffsetParent||qe,o=this.getDimensions,l=await o(t.floating);return{reference:Gt(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function qt(t){return L(t).direction==="rtl"}const Yt={convertOffsetParentRelativeRectToViewportRelativeRect:Lt,getDocumentElement:H,getClippingRect:Wt,getOffsetParent:qe,getElementRects:Kt,getClientRects:Ft,getDimensions:Jt,getScale:Z,isElement:_,isRTL:qt};function Ye(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function zt(t,n){let o=null,l;const i=H(t);function a(){var s;clearTimeout(l),(s=o)==null||s.disconnect(),o=null}function r(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),a();const c=t.getBoundingClientRect(),{left:d,top:p,width:f,height:m}=c;if(s||n(),!f||!m)return;const g=ce(p),y=ce(i.clientWidth-(d+f)),v=ce(i.clientHeight-(p+m)),A=ce(d),x={rootMargin:-g+"px "+-y+"px "+-v+"px "+-A+"px",threshold:O(0,ee(1,u))||1};let V=!0;function E(F){const D=F[0].intersectionRatio;if(D!==u){if(!V)return r();D?r(!1,D):l=setTimeout(()=>{r(!1,1e-7)},1e3)}D===1&&!Ye(c,t.getBoundingClientRect())&&r(),V=!1}try{o=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{o=new IntersectionObserver(E,x)}o.observe(t)}return r(!0),a}function Xt(t,n,o,l){l===void 0&&(l={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=l,c=Ee(t),d=i||a?[...c?le(c):[],...le(n)]:[];d.forEach(A=>{i&&A.addEventListener("scroll",o,{passive:!0}),a&&A.addEventListener("resize",o)});const p=c&&s?zt(c,o):null;let f=-1,m=null;r&&(m=new ResizeObserver(A=>{let[w]=A;w&&w.target===c&&m&&(m.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(n)})),o()}),c&&!u&&m.observe(c),m.observe(n));let g,y=u?$(t):null;u&&v();function v(){const A=$(t);y&&!Ye(y,A)&&o(),y=A,g=requestAnimationFrame(v)}return o(),()=>{var A;d.forEach(w=>{i&&w.removeEventListener("scroll",o),a&&w.removeEventListener("resize",o)}),p?.(),(A=m)==null||A.disconnect(),m=null,u&&cancelAnimationFrame(g)}}const jt=bt,$t=Ct,Zt=At,en=Et,tn=(t,n,o)=>{const l=new Map,i={platform:Yt,...o},a={...i.platform,_c:l};return yt(t,n,{...i,platform:a})};function nn(t,n){const o=e.ref({position:"fixed",left:"0",top:"0",zIndex:3e3});let l=null;const i=()=>{!t.value||!n.value||tn(t.value,n.value,{placement:"bottom-start",strategy:"fixed",middleware:[jt(6),Zt(),$t({padding:10}),en({apply({rects:s,elements:u}){const c=`${s.reference.width}px`;Object.assign(u.floating.style,{width:c,minWidth:c,maxWidth:c})}})]}).then(({x:s,y:u})=>{Object.assign(o.value,{left:`${s}px`,top:`${u}px`})})},a=()=>{t.value&&n.value&&(l=Xt(t.value,n.value,i))},r=()=>{l&&(l(),l=null)};return e.onBeforeUnmount(r),{floatingStyles:o,startTrack:a,stopTrack:r}}const on="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACT0lEQVR4AaRSO2hTYRT+zn9v2g6CiktFJYoVHXQoOljM2EIEh0orbRKa5qUuDoIZAnXI4FBwcRDikMcNkoQMQjcVESo4OASsW2kLBi3oUKiD1OZx7/H811wJZFF6uOee85/H93/3nKtwQPkvgFKpdKRgVR+UrFrOsurX9N3/DJCvVPxMwx+lKcbgKzbstPhwAXSyWK7eLZZrc4VCNZDPPx/Tt+kCrTqvOrQqfu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G9O3OmJ9J1C9ABVb1rgoF1PqA/Cokw3k7stgKDvZHwHXcUYqW+J1CacejlcXoi4SvFvD2lRdxAER0s3glirS5Gyr7+FwAA//8Pj6q2AAAABklEQVQDAJPeLlNn5TR8AAAAAElFTkSuQmCC",an="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms8HjSgJctn1xIt6hxqIkdK+u8U8zT1ESmP5enUkWmqMkhG2FmxXOvR+EGD5KAhoDqsQvtiMXJQGNQJ4N8mF6PMd/wL8SxuOXPSG21pj9p+L1EOjGyAHoQQ0zWGDqx9pbPWIpwqOEkw+gGyMHoAc1ozOkVhOcZyepYndNpDpPvwAAAP//BVQJHAAAAAZJREFUAwDZWL4hub5xHQAAAABJRU5ErkJggg==",cn="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",un={class:"search-container"},dn={class:"selection-wrapper"},fn={class:"tag-text"},mn=["onClick"],pn={key:0,class:"search-tag collapse"},gn=["placeholder"],hn={class:"suffix-area"},vn={key:1,class:"loading-spinner"},yn={class:"search-icon"},An=["src"],wn={key:0,class:"history-section"},xn={class:"history-header"},bn=["onMousedown"],Cn={class:"category-tag"},En=["src"],Vn={class:"type-text"},kn={class:"result-text"},Sn={key:0,class:"status-msg"},Nn=["onMousedown"],Rn={class:"category-tag"},On=["src"],Bn={class:"type-text"},Dn={class:"result-text"},Tn={key:0,class:"load-more-msg"},Mn={key:1,class:"load-more-msg no-more"},_n={key:2,class:"status-msg"},Ln=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:""}},emits:["update:modelValue","select","change","submit-search","remove"],setup(t,{emit:n}){const o=t,l=n,i=e.ref(null),a=e.ref(null),r=e.ref(null),s=e.ref(""),u=e.ref(""),c=e.ref(!1),d=e.ref(!1);let p=null;const f=e.computed(()=>o.modelValue?Array.isArray(o.modelValue)?o.modelValue:[o.modelValue]:[]),m=e.computed(()=>o.multiple?o.collapseTags?f.value.slice(0,1):f.value:[]),g=e.computed(()=>s.value||f.value.length>0),y=e.computed(()=>o.multiple?s.value?`${s.value.length*10+20}px`:"10px":"100%"),{searchHistory:v,saveToHistory:A,clearHistory:w}=ot(e.toRef(o,"historyKey")),{searchResults:x,loading:V,isFetchingMore:E,isFinished:F,currentPage:D,fetchData:I,filterByTypes:W}=rt(s,e.toRef(o,"searchTypeList")),{floatingStyles:T,startTrack:X,stopTrack:K}=nn(a,r),N=e.computed(()=>{if(o.lang!=="")return o.lang==="en"||o.lang==="en-US";let h="";try{if(typeof useCookie=="function"){const b=useCookie("jc-language").value;if(b)return/en/.test(b)||/en-US/.test(b)}}catch{}return typeof process<"u"&&process.client?h=document.cookie||"":typeof process<"u"&&process.server&&(h=useNuxtApp?.()?.ssrContext?.event.node.req.headers.cookie||""),/jc-language=en-US/.test(h)||/jc-language=en/.test(h)}),J=e.computed(()=>o.multiple&&f.value.length>0?"":c.value&&!o.multiple?u.value:N.value?"Please enter...":"请输入..."),oe=()=>i.value?.focus(),q=h=>{if(A(h),o.multiple){if(!f.value.some(C=>C.id===h.id)){const C=[...f.value,h];l("update:modelValue",C)}s.value=""}else u.value=ae(h),c.value=!0,s.value="",d.value=!1,l("update:modelValue",h);l("select",h)},P=h=>{const b=f.value.filter(C=>C.id!==h.id);l("update:modelValue",b),l("remove",h)},R=()=>{o.multiple&&!s.value&&f.value.length>0&&P(f.value[f.value.length-1])},M=()=>{s.value="",c.value=!1,u.value="",l("update:modelValue",o.multiple?[]:null)},ve=async()=>{if(d.value=!0,!o.multiple&&c.value&&x.value.length===0){const h=o.modelValue;if(h?.id){V.value=!0;try{const b=await it(h.id,h.type);x.value=W(b.records)}finally{V.value=!1}}}},$e=()=>setTimeout(()=>d.value=!1,200),Ze=h=>{h.target.value===""&&!o.multiple&&M()},et=()=>{o.multiple?l("submit-search",f.value):c.value&&l("submit-search",o.modelValue),d.value=!1},tt=h=>{const{scrollTop:b,scrollHeight:C,clientHeight:j}=h.target;b+j>=C-20&&!V.value&&!E.value&&!F.value&&s.value&&I(D.value+1,!0)};e.watch(d,h=>{h?X():K()}),e.watch(s,h=>{if(!h.trim()){x.value=[];return}p&&clearTimeout(p),p=setTimeout(()=>I(1,!1),300)});const ke=h=>({City:an,Country:sn,Airport:on,Seaport:rn})[h]||ln,ae=h=>N.value?h.displayEn||h.display||"":h.displayCn||h.display||"",Se=h=>{const b={City:{en:"City",cn:"城市"},Country:{en:"Country",cn:"国家"},Region:{en:"Region",cn:"区域"},Airport:{en:"Airport",cn:"机场"},Seaport:{en:"Seaport",cn:"港口"}};return console.log("🍉 ~ index.vue:434 ~ getItemType ~ isEn.value:",N.value),N.value?b[h].en:b[h].cn},nt=h=>f.value.some(b=>b.id===h.id);return e.onBeforeUnmount(K),(h,b)=>(e.openBlock(),e.createElementBlock("div",un,[e.createElementVNode("div",{class:e.normalizeClass(["search-input-wrapper",{"is-multiple":t.multiple}]),ref_key:"referenceRef",ref:a,onClick:oe},[e.createElementVNode("div",dn,[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,(C,j)=>(e.openBlock(),e.createElementBlock("div",{key:C.id||j,class:"search-tag"},[e.createElementVNode("span",fn,e.toDisplayString(ae(C)),1),e.createElementVNode("span",{class:"tag-close",onClick:e.withModifiers(Ne=>P(C),["stop"])},"×",8,mn)]))),128)),t.collapseTags&&f.value.length>1?(e.openBlock(),e.createElementBlock("div",pn," + "+e.toDisplayString(f.value.length-1),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:i,class:e.normalizeClass({"is-selected-state":c.value&&!t.multiple}),"onUpdate:modelValue":b[0]||(b[0]=C=>s.value=C),type:"text",placeholder:J.value,style:e.normalizeStyle({width:y.value}),onFocus:ve,onBlur:$e,onInput:Ze,onKeydown:e.withKeys(R,["delete"])},null,46,gn),[[e.vModelText,s.value]])]),e.createElementVNode("div",hn,[g.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-icon",onMousedown:b[1]||(b[1]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(M,["stop"])},"ⓧ",32)):e.createCommentVNode("",!0),e.unref(V)&&!e.unref(E)?(e.openBlock(),e.createElementBlock("div",vn)):(e.openBlock(),e.createElementBlock("button",{key:2,class:"search-btn",onClick:e.withModifiers(et,["stop"])},[e.createElementVNode("span",yn,[e.createElementVNode("img",{src:e.unref(cn),alt:"search"},null,8,An)])]))])],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(T)),onScroll:tt},[e.renderSlot(h.$slots,"history",{searchHistory:e.unref(v)},()=>[e.unref(v).length>0&&!s.value?(e.openBlock(),e.createElementBlock("div",wn,[e.createElementVNode("div",xn,[e.createElementVNode("span",null,e.toDisplayString(N.value?"Recent search":"最近搜索"),1),e.createElementVNode("span",{class:"clear-btn",onMousedown:b[2]||(b[2]=e.withModifiers(()=>{},["prevent"])),onClick:b[3]||(b[3]=e.withModifiers((...C)=>e.unref(w)&&e.unref(w)(...C),["stop"]))},e.toDisplayString(N.value?"Clear":"清空"),33)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(C,j)=>(e.openBlock(),e.createElementBlock("div",{key:"hist-"+j,class:"dropdown-item",onMousedown:Ne=>q(C)},[e.createElementVNode("div",Cn,[e.createElementVNode("img",{class:"type-icon",src:ke(C.type),alt:""},null,8,En),e.createElementVNode("span",Vn,e.toDisplayString(Se(C.type)),1)]),e.createElementVNode("div",kn,e.toDisplayString(ae(C)),1)],40,bn))),128)),b[4]||(b[4]=e.createElementVNode("hr",{class:"divider"},null,-1))])):e.createCommentVNode("",!0)],!0),e.unref(V)&&!e.unref(E)?(e.openBlock(),e.createElementBlock("div",Sn,e.toDisplayString(N.value?"Searching...":"正在搜索中..."),1)):e.unref(x).length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(h.$slots,"results",{searchResults:e.unref(x)},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x),(C,j)=>(e.openBlock(),e.createElementBlock("div",{key:j,class:e.normalizeClass(["dropdown-item",{"is-active":nt(C)}]),onMousedown:Ne=>q(C)},[e.createElementVNode("div",Rn,[e.createElementVNode("img",{class:"type-icon",src:ke(C.type),alt:""},null,8,On),e.createElementVNode("span",Bn,e.toDisplayString(Se(C.type)),1)]),e.createElementVNode("div",Dn,e.toDisplayString(ae(C)),1)],42,Nn))),128))],!0),e.unref(E)?(e.openBlock(),e.createElementBlock("div",Tn,e.toDisplayString(N.value?"Loading more...":"正在加载更多..."),1)):e.unref(F)&&s.value?(e.openBlock(),e.createElementBlock("div",Mn,e.toDisplayString(N.value?"All results have been loaded":"已加载全部结果"),1)):e.createCommentVNode("",!0)],64)):s.value&&!e.unref(V)?(e.openBlock(),e.createElementBlock("div",_n,[e.renderSlot(h.$slots,"noData",{},()=>[e.createTextVNode(e.toDisplayString(N.value?`No results found related to "${s.value}".`:`未找到与 "${s.value}" 相关的结果`),1)],!0)])):e.createCommentVNode("",!0)],36),[[e.vShow,d.value&&(e.unref(x).length>0||e.unref(V)||s.value||e.unref(v).length>0)]])]))]))}}),ze=(t,n)=>{const o=t.__vccOpts||t;for(const[l,i]of n)o[l]=i;return o},Ve=ze(Ln,[["__scopeId","data-v-0c628f1d"]]),Fn={class:"modal-container"},In={class:"modal-header"},Pn={class:"header-title"},Qn={class:"modal-body"},Un={class:"form-item"},Hn={class:"required"},Wn={class:"input-box"},Jn={key:0,class:"error-message"},Gn={class:"form-item"},Kn={class:"required"},qn={class:"type-group"},Yn=["onClick"],zn={key:0,class:"check-mark"},Xn={class:"form-item"},jn={class:"required"},$n={key:0,class:"error-message"},Zn={class:"modal-footer"},eo={__name:"ApplyDataDialog",props:{value:{type:Boolean,default:!1},lang:{type:String,default:"en",validator:t=>["en","cn"].includes(t)}},emits:["update:value","confirm"],setup(t,{emit:n}){const o=t,l=n,i=[{typeCn:"城市",typeEn:"City",type:"City"},{typeCn:"海运港口",typeEn:"Port",type:"Seaport"},{typeCn:"机场",typeEn:"Airport",type:"Airport"}],a=e.ref(null),r=e.reactive({name:"",country:""}),s=e.reactive({name:"",type:"City"}),u=e.computed(()=>o.lang==="en"||o.lang==="en-US"),c=()=>{r.name="",r.country="",l("update:value",!1)},d=()=>{r.name="",r.country="";let p=!0;s.name.trim()||(r.name="Data name is required",p=!1),a.value||(r.country="Please select a country",p=!1),p&&(console.log("🍉 ~ ApplyDataDialog.vue:115 ~ handleConfirm ~ data:",{...s,country:a.value}),l("confirm",{...s,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",Fn,[e.createElementVNode("div",In,[e.createElementVNode("span",Pn,e.toDisplayString(u.value?"Apply for data addition":"申请补充数据"),1),e.createElementVNode("div",{class:"close-btn",onClick:c},"×")]),e.createElementVNode("div",Qn,[e.createElementVNode("div",Un,[e.createElementVNode("label",Hn,e.toDisplayString(u.value?"Data To Add":"需补充的数据"),1),e.createElementVNode("div",Wn,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=m=>s.name=m),type:"text",placeholder:"Please enter your data",class:e.normalizeClass(["custom-input",{"input-error":r.name}]),onInput:f[1]||(f[1]=m=>r.name="")},null,34),[[e.vModelText,s.name]])]),r.name?(e.openBlock(),e.createElementBlock("div",Jn,e.toDisplayString(r.name),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gn,[e.createElementVNode("label",Kn,e.toDisplayString(u.value?"Type":"所属类别"),1),e.createElementVNode("div",qn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,m=>e.createElementVNode("div",{key:m,class:e.normalizeClass(["type-btn",{active:s.type===m.type}]),onClick:g=>s.type=m.type},[e.createTextVNode(e.toDisplayString(u.value?m.typeEn:m.typeCn)+" ",1),s.type===m.type?(e.openBlock(),e.createElementBlock("div",zn)):e.createCommentVNode("",!0)],10,Yn)),64))])]),e.createElementVNode("div",Xn,[e.createElementVNode("label",jn,e.toDisplayString(u.value?"Country":"国家"),1),e.createElementVNode("div",{class:e.normalizeClass({"search-error-wrap":r.country})},[e.createVNode(Ve,{"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},null,8,["model-value","lang"])],2),r.country?(e.openBlock(),e.createElementBlock("div",$n,e.toDisplayString(r.country),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Zn,[e.createElementVNode("button",{class:"confirm-btn",onClick:d},e.toDisplayString(u.value?"Submit":"申请补充"),1)])])])):e.createCommentVNode("",!0)}},Xe=ze(eo,[["__scopeId","data-v-e8983beb"]]),to={class:"global-modal-header-custom"},no={class:"global-modal-body-custom"},oo={class:"global-modal-footer-custom"},je=e.defineComponent({__name:"GlobalModal",setup(t){const n=e.ref(),o=e.ref(!1),l=e.ref({city:"",company:"",email:"",phone:"",name:"",agreement:!1}),i=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=()=>{o.value=!1,S.emitter.emit(S.MODAL_ACTION.Close,void 0),n.value?.resetFields()},r=async()=>{n.value&&await n.value.validate(u=>{u&&(S.emitter.emit(S.MODAL_ACTION.Submit,l.value),a(),l.value={city:"",company:"",email:"",phone:"",name:"",agreement:!1})})},s=u=>{o.value=!0};return e.onMounted(()=>{S.emitter.on(S.MODAL_ACTION.Open,s)}),e.onUnmounted(()=>{S.emitter.off(S.MODAL_ACTION.Open,s)}),(u,c)=>(e.openBlock(),e.createBlock(e.unref(k.ElDialog),{modelValue:o.value,"onUpdate:modelValue":c[7]||(c[7]=d=>o.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",to,[c[9]||(c[9]=e.createElementVNode("h2",null,"即刻链接全球货代",-1)),e.createVNode(e.unref(k.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",oo,[e.createVNode(e.unref(k.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",no,[e.createVNode(e.unref(k.ElForm),{model:l.value,rules:i,ref_key:"formRef",ref:n,"label-position":"top",onSubmit:c[6]||(c[6]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElFormItem),{label:"所在地(城市)",prop:"city"},{default:e.withCtx(()=>[e.createVNode(e.unref(k.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(k.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElFormItem),{label:"公司名称",prop:"company"},{default:e.withCtx(()=>[e.createVNode(e.unref(k.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(k.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElFormItem),{label:"邮箱",prop:"email"},{default:e.withCtx(()=>[e.createVNode(e.unref(k.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(k.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElFormItem),{label:"电话",prop:"phone"},{default:e.withCtx(()=>[e.createVNode(e.unref(k.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(k.ElRow),null,{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElCol),{span:24},{default:e.withCtx(()=>[e.createVNode(e.unref(k.ElFormItem),{label:"姓名",prop:"name"},{default:e.withCtx(()=>[e.createVNode(e.unref(k.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(k.ElFormItem),{prop:"agreement",class:"agreement-item"},{default:e.withCtx(()=>[e.createVNode(e.unref(k.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"]))}});let lo={open(){S.emitter.emit(S.MODAL_ACTION.Open)},close(){S.emitter.emit(S.MODAL_ACTION.Close)},onSubmit(t){S.emitter.on(S.MODAL_ACTION.Submit,t)}};function io(){let t=!1;return{install(n){if(typeof window<"u"&&!t){const o=document.createElement("div");o.setAttribute("id","global-modal-root"),document.body.appendChild(o),e.createApp(je).mount(o),t=!0}n.config.globalProperties.$globalModal=lo}}}const Fe={ApplyDataDialog:Xe,JcSearch:Ve},ro={install(t){for(const n in Fe)t.component(n,Fe[n])}};Object.defineProperty(exports,"MODAL_ACTION",{enumerable:!0,get:()=>S.MODAL_ACTION});Object.defineProperty(exports,"emitter",{enumerable:!0,get:()=>S.emitter});exports.ApplyDataDialog=Xe;exports.GlobalModal=je;exports.JcSearch=Ve;exports.createGlobalModalPlugin=io;exports.default=ro;