keyring-chatbot-agent-sdk-test 1.0.4 → 1.0.5
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.
|
@@ -18,7 +18,7 @@ return g.jsx(g.Fragment,{children:Nh(e||"")&&/* @__PURE__ */g.jsxs("div",{classN
|
|
|
18
18
|
/* @__PURE__ */g.jsx("button",{type:"button",className:"action-form-pct-btn action-form-max-btn",onClick:()=>b("amount",o.balanceFormatted),disabled:i||s,children:l("formMax")})]}),"amount"===t.key&&"send_nft"===e&&a&&/* @__PURE__ */g.jsx("div",{className:"action-form-pct-btns",children:/* @__PURE__ */g.jsx("button",{type:"button",className:"action-form-pct-btn action-form-max-btn",onClick:()=>b("amount",n.maxAmount||""),disabled:i||s,children:l("formMax")})})]}),(()=>{const e=!1===t.editable&&!!n[t.key]||s,r=i||e,o=[p[t.key]?"error":"",e?"readonly":""].filter(Boolean).join(" ");return"address"===t.type?/* @__PURE__ */g.jsx("textarea",{rows:2,placeholder:t.placeholder,value:f[t.key]||"",onChange:e=>b(t.key,e.target.value),className:o,disabled:r||s}):/* @__PURE__ */g.jsx("input",{type:"number"===t.type?"number":"text",placeholder:t.placeholder,value:f[t.key]||"",onChange:e=>b(t.key,e.target.value),className:o,disabled:r||s})})(),p[t.key]&&/* @__PURE__ */g.jsx("span",{className:"field-error",children:p[t.key]})]},t.key))}),!s&&/* @__PURE__ */g.jsxs("div",{className:"action-form-actions",children:[
|
|
19
19
|
/* @__PURE__ */g.jsx("button",{className:"message-button",onClick:r,type:"button",disabled:i,children:l("formCancel")}),
|
|
20
20
|
/* @__PURE__ */g.jsx("button",{className:"message-button",onClick:y,type:"button",disabled:i,children:l(i?"formProcessing":"formExecute")})]})]}):null},Ep=({scrollContainerRef:e,threshold:n=200})=>{const[t,r]=j.useState(!1);return j.useEffect(()=>{const t=e.current;if(!t)return;const i=()=>{const{scrollTop:e,scrollHeight:i,clientHeight:o}=t;r(i-e-o>n)};return t.addEventListener("scroll",i,{passive:!0}),i(),()=>{t.removeEventListener("scroll",i)}},[e,n]),t?/* @__PURE__ */g.jsx("button",{className:"scroll-to-bottom-btn",onClick:()=>{e.current?.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})},"aria-label":"Scroll to bottom",type:"button",children:/* @__PURE__ */g.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:/* @__PURE__ */g.jsx("path",{d:"M9 3V15M9 15L4 10M9 15L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}):null},Sp=e=>e?`**CRITICAL - LANGUAGE**: Respond in the specified language: "${e||"detect from current question"}". Do NOT follow language from conversation history.`:"**CRITICAL - LANGUAGE**: You MUST detect the language of the user's CURRENT question and respond ONLY in that exact language. Ignore the language of previous messages in conversation history — only the current question matters. If the current question is in English, respond in English. If in Vietnamese, respond in Vietnamese. NEVER default to Chinese or any other language.",Cp={1:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",10:"0x4200000000000000000000000000000000000006",56:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",137:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",8453:"0x4200000000000000000000000000000000000006",42161:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},Tp=[{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"approve",type:"function",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],Ip=[{name:"deposit",type:"function",stateMutability:"payable",inputs:[],outputs:[]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{name:"wad",type:"uint256"}],outputs:[]}],Mp=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],Op=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"amount",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]}];function Np(e,n){if(n)return n;const t=ur[e];return t?.rpcUrls?.default?.http?.[0]}async function Rp(e){const{transactionHash:n,chainId:t,pollingInterval:r=3e3,timeout:i=12e4,rpcUrl:o}=e,a=Np(t,o);if(!a)throw new Error(`No RPC endpoint for chain ${t}`);const s=Date.now();for(;Date.now()-s<i;){try{const e=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getTransactionReceipt",params:[n]})}),t=await e.json();if(t.result){const e=t.result;return{status:"0x1"===e.status?"success":"fail",blockNumber:e.blockNumber,gasUsed:e.gasUsed,effectiveGasPrice:e.effectiveGasPrice}}}catch(l){}await new Promise(e=>setTimeout(e,r))}throw new Error(`Transaction ${n} was not mined within ${i/1e3}s`)}async function Bp(e){const{tokenAddress:n,ownerAddress:t,spenderAddress:r,chainId:i,rpcUrl:o}=e,a=Np(i,o);if(!a)return BigInt(0);try{const e=Ln({abi:Tp,functionName:"allowance",args:[t,r]}),i=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_call",params:[{to:n,data:e},"latest"]})}),o=await i.json();return o.result&&"0x"!==o.result?BigInt(o.result):BigInt(0)}catch(s){return BigInt(0)}}function Fp(e){const{tokenAddress:n,spenderAddress:t,fromAddress:r,chainId:i,tokenSymbol:o,amount:a}=e,s=a&&BigInt(a)>0n?BigInt(a):vt;return{from:r,to:n,data:Ln({abi:Tp,functionName:"approve",args:[t,s]}),value:"0",chainId:i,description:`Approve ${o||"token"} for swap`}}async function Lp(e){const{address:n,chainId:t,rpcUrl:r}=e,i=Np(t,r);if(!i)return new up(0);try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getBalance",params:[n,"latest"]})}),t=await e.json();return t.result&&"0x"!==t.result?new up(BigInt(t.result).toString()):new up(0)}catch(o){return new up(0)}}async function Dp(e){const{from:n,to:t,data:r,value:i,chainId:o,rpcUrl:a}=e,s=Np(o,a);if(!s)return new up(0);try{const[e,o]=await Promise.all([fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_estimateGas",params:[{from:n,to:t,data:r,...i&&"0"!==i?{value:i}:{}}]})}),fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:2,method:"eth_gasPrice",params:[]})})]),[a,l]=await Promise.all([e.json(),o.json()]),u=a.result?new up(BigInt(a.result).toString()):new up(0),c=l.result?new up(BigInt(l.result).toString()):new up(0);return u.times(c).times(1.1)}catch(l){return new up(0)}}async function Up(e){const{chainId:n,rpcUrl:t}=e,r=Np(n,t);if(!r)return new up(0);try{const e=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_gasPrice",params:[]})}),n=await e.json();return n.result&&"0x"!==n.result?new up(BigInt(n.result).toString()):new up(0)}catch(i){return new up(0)}}var Pp,jp,Hp={},Vp={exports:{}},zp=Vp.exports;var Wp=function(){if(jp)return Hp;jp=1,Object.defineProperty(Hp,"i",{value:!0});var e,n,t,r=b(),i=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,o=(Pp||(Pp=1,n=Vp,t=Vp.exports,function(e,r){var i="function",o="undefined",a="object",s="string",l="major",u="model",c="name",f="type",d="vendor",h="version",p="architecture",m="console",b="mobile",v="tablet",y="smarttv",w="wearable",g="embedded",k="Amazon",A="Apple",x="ASUS",E="BlackBerry",S="Browser",C="Chrome",T="Firefox",I="Google",M="Huawei",O="LG",N="Microsoft",R="Motorola",B="Opera",F="Samsung",L="Sharp",D="Sony",U="Xiaomi",P="Zebra",j="Facebook",H="Chromium OS",V="Mac OS",z=" Browser",W=function(e){for(var n={},t=0;t<e.length;t++)n[e[t].toUpperCase()]=e[t];return n},q=function(e,n){return typeof e===s&&-1!==G(n).indexOf(G(e))},G=function(e){return e.toLowerCase()},Y=function(e,n){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof n===o?e:e.substring(0,500)},J=function(e,n){for(var t,o,s,l,u,c,f=0;f<n.length&&!u;){var d=n[f],h=n[f+1];for(t=o=0;t<d.length&&!u&&d[t];)if(u=d[t++].exec(e))for(s=0;s<h.length;s++)c=u[++o],typeof(l=h[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;f+=2}},K=function(e,n){for(var t in n)if(typeof n[t]===a&&n[t].length>0){for(var i=0;i<n[t].length;i++)if(q(n[t][i],e))return"?"===t?r:t}else if(q(n[t],e))return"?"===t?r:t;return n.hasOwnProperty("*")?n["*"]:e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Q={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,h],[/opios[\/ ]+([\w\.]+)/i],[h,[c,B+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[h,[c,B+" GX"]],[/\bopr\/([\w\.]+)/i],[h,[c,B]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[h,[c,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,h],[/quark(?:pc)?\/([-\w\.]+)/i],[h,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[h,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[c,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[h,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[h,[c,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+S],h],[/\bfocus\/([\w\.]+)/i],[h,[c,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[c,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[c,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[c,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[h,[c,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360"+z]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],h],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+z],h],[/samsungbrowser\/([\w\.]+)/i],[h,[c,F+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],h],[/metasr[\/ ]?([\d\.]+)/i],[h,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[c,h],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,j],h],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[c,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,C+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[c,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[h,K,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],h],[/(wolvic)\/([\w\.]+)/i],[c,h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[c,T+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,[h,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,G]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,F],[f,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,F],[f,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,A],[f,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,A],[f,v]],[/(macintosh);/i],[u,[d,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,L],[f,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,M],[f,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,M],[f,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[u,/_/g," "],[d,U],[f,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,U],[f,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[f,b]],[/\b(opd2\d{3}a?) bui/i],[u,[d,"OPPO"],[f,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[f,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[f,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,R],[f,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,R],[f,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,O],[f,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,O],[f,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[f,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[f,b]],[/(pixel c)\b/i],[u,[d,I],[f,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,I],[f,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,D],[f,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,D],[f,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[f,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,k],[f,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,k],[f,b]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[f,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,E],[f,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,x],[f,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,x],[f,b]],[/(nexus 9)/i],[u,[d,"HTC"],[f,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[f,b]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[u,[d,"TCL"],[f,v]],[/(itel) ((\w+))/i],[[d,G],u,[f,K,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[f,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[f,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[d,"Ulefone"],[f,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[d,"Nothing"],[f,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[f,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[f,v]],[/(surface duo)/i],[u,[d,N],[f,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[f,b]],[/(u304aa)/i],[u,[d,"AT&T"],[f,b]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[f,b]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[f,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[f,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[f,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[f,v]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[f,v]],[/\b(k88) b/i],[u,[d,"ZTE"],[f,v]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[f,b]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[f,b]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[f,v]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[f,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[f,v]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[f,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[f,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[f,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[f,b]],[/\b(ph-1) /i],[u,[d,"Essential"],[f,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[f,v]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[f,v]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[f,v]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[f,v]],[/(sprint) (\w+)/i],[d,u,[f,b]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,N],[f,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,P],[f,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,P],[f,b]],[/smart-tv.+(samsung)/i],[d,[f,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,F],[f,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,O],[f,y]],[/(apple) ?tv/i],[d,[u,A+" TV"],[f,y]],[/crkey/i],[[u,C+"cast"],[d,I],[f,y]],[/droid.+aft(\w+)( bui|\))/i],[u,[d,k],[f,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,L],[f,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,D],[f,y]],[/(mitv-\w{5}) bui/i],[u,[d,U],[f,y]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[f,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,Y],[u,Y],[f,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[f,m]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[f,m]],[/(playstation [345portablevi]+)/i],[u,[d,D],[f,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,N],[f,m]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[u,[d,F],[f,w]],[/((pebble))app/i],[d,u,[f,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,A],[f,w]],[/droid.+; (glass) \d/i],[u,[d,I],[f,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,P],[f,w]],[/(quest( \d| pro)?)/i],[u,[d,j],[f,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[f,g]],[/(aeobc)\b/i],[u,[d,k],[f,g]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[f,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[f,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,b]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,h],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[h,K,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,K,X],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,V],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,h],[/\(bb(10);/i],[h,[c,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[c,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[h,[c,C+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,H],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,h],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,h]]},Z=function(n,t){if(typeof n===a&&(t=n,n=r),!(this instanceof Z))return new Z(n,t).getResult();var m=typeof e!==o&&e.navigator?e.navigator:r,y=n||(m&&m.userAgent?m.userAgent:""),w=m&&m.userAgentData?m.userAgentData:r,g=t?function(e,n){var t={};for(var r in e)n[r]&&n[r].length%2==0?t[r]=n[r].concat(e[r]):t[r]=e[r];return t}(Q,t):Q,k=m&&m.userAgent==y;return this.getBrowser=function(){var e,n={};return n[c]=r,n[h]=r,J.call(n,y,g.browser),n[l]=typeof(e=n[h])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r,k&&m&&m.brave&&typeof m.brave.isBrave==i&&(n[c]="Brave"),n},this.getCPU=function(){var e={};return e[p]=r,J.call(e,y,g.cpu),e},this.getDevice=function(){var e={};return e[d]=r,e[u]=r,e[f]=r,J.call(e,y,g.device),k&&!e[f]&&w&&w.mobile&&(e[f]=b),k&&"Macintosh"==e[u]&&m&&typeof m.standalone!==o&&m.maxTouchPoints&&m.maxTouchPoints>2&&(e[u]="iPad",e[f]=v),e},this.getEngine=function(){var e={};return e[c]=r,e[h]=r,J.call(e,y,g.engine),e},this.getOS=function(){var e={};return e[c]=r,e[h]=r,J.call(e,y,g.os),k&&!e[c]&&w&&w.platform&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,H).replace(/macos/i,V)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(e){return y=typeof e===s&&e.length>500?Y(e,500):e,this},this.setUA(y),this};Z.VERSION="1.0.39",Z.BROWSER=W([c,h,l]),Z.CPU=W([p]),Z.DEVICE=W([u,d,f,m,b,y,v,w,g]),Z.ENGINE=Z.OS=W([c,h]),n.exports&&(t=n.exports=Z),t.UAParser=Z;var _=typeof e!==o&&(e.jQuery||e.Zepto);if(_&&!_.ua){var $=new Z;_.ua=$.getResult(),_.ua.get=function(){return $.getUA()},_.ua.set=function(e){$.setUA(e);var n=$.getResult();for(var t in n)_.ua[t]=n[t]}}}("object"==typeof window?window:zp)),Vp.exports),a=new o,s=a.getBrowser(),l=a.getCPU(),u=a.getDevice(),c=a.getEngine(),f=a.getOS(),d=a.getUA(),h=function(e){return a.setUA(e)},p=function(e){if(e){var n=new o(e);return{UA:n,browser:n.getBrowser(),cpu:n.getCPU(),device:n.getDevice(),engine:n.getEngine(),os:n.getOS(),ua:n.getUA(),setUserAgent:function(e){return n.setUA(e)}}}},m=/* @__PURE__ */Object.freeze({ClientUAInstance:a,browser:s,cpu:l,device:u,engine:c,os:f,ua:d,setUa:h,parseUserAgent:p});function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function g(){return g=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},g.apply(this,arguments)}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,n){return(A=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function x(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var C="mobile",T="tablet",I="smarttv",M="console",O="wearable",N="embedded",R=void 0,B={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},F={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},L={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},D=function(e){return e||(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none")},U=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},P=function(e){var n=U();return n&&n.platform&&(-1!==n.platform.indexOf(e)||"MacIntel"===n.platform&&n.maxTouchPoints>1&&!window.MSStream)},j=function(e){return e.type===C},H=function(e){return e.type===T},V=function(e){var n=e.type;return n===C||n===T},z=function(e){return e.type===I},W=function(e){return e.type===R},q=function(e){return e.type===O},G=function(e){return e.type===M},Y=function(e){return e.type===N},J=function(e){var n=e.vendor;return D(n)},K=function(e){var n=e.model;return D(n)},X=function(e){var n=e.type;return D(n,"browser")},Q=function(e){return e.name===F.Android},Z=function(e){return e.name===F.Windows},_=function(e){return e.name===F.MAC_OS},$=function(e){return e.name===F.WindowsPhone},ee=function(e){return e.name===F.IOS},ne=function(e){var n=e.version;return D(n)},te=function(e){var n=e.name;return D(n)},re=function(e){return e.name===B.Chrome},ie=function(e){return e.name===B.Firefox},oe=function(e){return e.name===B.Chromium},ae=function(e){return e.name===B.Edge},se=function(e){return e.name===B.Yandex},le=function(e){var n=e.name;return n===B.Safari||n===B.MobileSafari},ue=function(e){return e.name===B.MobileSafari},ce=function(e){return e.name===B.Opera},fe=function(e){var n=e.name;return n===B.InternetExplorer||n===B.Ie},de=function(e){return e.name===B.MIUI},he=function(e){return e.name===B.SamsungBrowser},pe=function(e){var n=e.version;return D(n)},me=function(e){var n=e.major;return D(n)},be=function(e){var n=e.name;return D(n)},ve=function(e){var n=e.name;return D(n)},ye=function(e){var n=e.version;return D(n)},we=function(){var e=U(),n=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof n&&/electron/.test(n)},ge=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},ke=function(){var e=U();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},Ae=function(){return P("iPad")},xe=function(){return P("iPhone")},Ee=function(){return P("iPod")},Se=function(e){return D(e)};function Ce(e){var n=e||m,t=n.device,r=n.browser,i=n.os,o=n.engine,a=n.ua;return{isSmartTV:z(t),isConsole:G(t),isWearable:q(t),isEmbedded:Y(t),isMobileSafari:ue(r)||Ae(),isChromium:oe(r),isMobile:V(t)||Ae(),isMobileOnly:j(t),isTablet:H(t)||Ae(),isBrowser:W(t),isDesktop:W(t),isAndroid:Q(i),isWinPhone:$(i),isIOS:ee(i)||Ae(),isChrome:re(r),isFirefox:ie(r),isSafari:le(r),isOpera:ce(r),isIE:fe(r),osVersion:ne(i),osName:te(i),fullBrowserVersion:pe(r),browserVersion:me(r),browserName:be(r),mobileVendor:J(t),mobileModel:K(t),engineName:ve(o),engineVersion:ye(o),getUA:Se(a),isEdge:ae(r)||ge(a),isYandex:se(r),deviceType:X(t),isIOS13:ke(),isIPad13:Ae(),isIPhone13:xe(),isIPod13:Ee(),isElectron:we(),isEdgeChromium:ge(a),isLegacyEdge:ae(r)&&!ge(a),isWindows:Z(i),isMacOs:_(i),isMIUI:de(r),isSamsungBrowser:he(r)}}var Te=z(u),Ie=G(u),Me=q(u),Oe=Y(u),Ne=ue(s)||Ae(),Re=oe(s),Be=V(u)||Ae(),Fe=j(u),Le=H(u)||Ae(),De=W(u),Ue=W(u),Pe=Q(f),je=$(f),He=ee(f)||Ae(),Ve=re(s),ze=ie(s),We=le(s),qe=ce(s),Ge=fe(s),Ye=ne(f),Je=te(f),Ke=pe(s),Xe=me(s),Qe=be(s),Ze=J(u),_e=K(u),$e=ve(c),en=ye(c),nn=Se(d),tn=ae(s)||ge(d),rn=se(s),on=X(u),an=ke(),sn=Ae(),ln=xe(),un=Ee(),cn=we(),fn=ge(d),dn=ae(s)&&!ge(d),hn=Z(f),pn=_(f),mn=de(s),bn=he(s);function vn(e){var n=e||window.navigator.userAgent;return p(n)}return Hp.AndroidView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return Pe?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.BrowserTypes=B,Hp.BrowserView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return De?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.ConsoleView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return Ie?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.CustomView=function(e){var n=e.renderWithFragment,t=e.children;e.viewClassName,e.style;var o=e.condition,a=x(e,["renderWithFragment","children","viewClassName","style","condition"]);return o?n?i.createElement(r.Fragment,null,t):i.createElement("div",a,t):null},Hp.IEView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return Ge?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.IOSView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return He?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.MobileOnlyView=function(e){var n=e.renderWithFragment,t=e.children;e.viewClassName,e.style;var o=x(e,["renderWithFragment","children","viewClassName","style"]);return Fe?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.MobileView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return Be?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.OsTypes=F,Hp.SmartTVView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return Te?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.TabletView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return Le?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.WearableView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return Me?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.WinPhoneView=function(e){var n=e.renderWithFragment,t=e.children,o=x(e,["renderWithFragment","children"]);return je?n?i.createElement(r.Fragment,null,t):i.createElement("div",o,t):null},Hp.browserName=Qe,Hp.browserVersion=Xe,Hp.deviceDetect=function(e){var n=e?p(e):m,t=n.device,r=n.browser,i=n.engine,o=n.os,a=n.ua,s=function(e){switch(e){case C:return{isMobile:!0};case T:return{isTablet:!0};case I:return{isSmartTV:!0};case M:return{isConsole:!0};case O:return{isWearable:!0};case R:return{isBrowser:!0};case N:return{isEmbedded:!0};default:return L}}(t.type),l=s.isBrowser,u=s.isMobile,c=s.isTablet,f=s.isSmartTV,d=s.isConsole,h=s.isWearable,b=s.isEmbedded;return l?function(e,n,t,r,i){return{isBrowser:e,browserMajorVersion:D(n.major),browserFullVersion:D(n.version),browserName:D(n.name),engineName:D(t.name),engineVersion:D(t.version),osName:D(r.name),osVersion:D(r.version),userAgent:D(i)}}(l,r,i,o,a):f?function(e,n,t,r){return{isSmartTV:e,engineName:D(n.name),engineVersion:D(n.version),osName:D(t.name),osVersion:D(t.version),userAgent:D(r)}}(f,i,o,a):d?function(e,n,t,r){return{isConsole:e,engineName:D(n.name),engineVersion:D(n.version),osName:D(t.name),osVersion:D(t.version),userAgent:D(r)}}(d,i,o,a):u||c?function(e,n,t,r){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach(function(n){w(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({},e,{vendor:D(n.vendor),model:D(n.model),os:D(t.name),osVersion:D(t.version),ua:D(r)})}(s,t,o,a):h?function(e,n,t,r){return{isWearable:e,engineName:D(n.name),engineVersion:D(n.version),osName:D(t.name),osVersion:D(t.version),userAgent:D(r)}}(h,i,o,a):b?function(e,n,t,r,i){return{isEmbedded:e,vendor:D(n.vendor),model:D(n.model),engineName:D(t.name),engineVersion:D(t.version),osName:D(r.name),osVersion:D(r.version),userAgent:D(i)}}(b,t,i,o,a):void 0},Hp.deviceType=on,Hp.engineName=$e,Hp.engineVersion=en,Hp.fullBrowserVersion=Ke,Hp.getSelectorsByUserAgent=function(e){if(e&&"string"==typeof e){var n=p(e);return Ce({device:n.device,browser:n.browser,os:n.os,engine:n.engine,ua:n.ua})}},Hp.getUA=nn,Hp.isAndroid=Pe,Hp.isBrowser=De,Hp.isChrome=Ve,Hp.isChromium=Re,Hp.isConsole=Ie,Hp.isDesktop=Ue,Hp.isEdge=tn,Hp.isEdgeChromium=fn,Hp.isElectron=cn,Hp.isEmbedded=Oe,Hp.isFirefox=ze,Hp.isIE=Ge,Hp.isIOS=He,Hp.isIOS13=an,Hp.isIPad13=sn,Hp.isIPhone13=ln,Hp.isIPod13=un,Hp.isLegacyEdge=dn,Hp.isMIUI=mn,Hp.isMacOs=pn,Hp.isMobile=Be,Hp.isMobileOnly=Fe,Hp.isMobileSafari=Ne,Hp.isOpera=qe,Hp.isSafari=We,Hp.isSamsungBrowser=bn,Hp.isSmartTV=Te,Hp.isTablet=Le,Hp.isWearable=Me,Hp.isWinPhone=je,Hp.isWindows=hn,Hp.isYandex=rn,Hp.mobileModel=_e,Hp.mobileVendor=Ze,Hp.osName=Je,Hp.osVersion=Ye,Hp.parseUserAgent=p,Hp.setUserAgent=function(e){return h(e)},Hp.useDeviceData=vn,Hp.useDeviceSelectors=function(e){var n=vn(e||window.navigator.userAgent);return[Ce(n),n]},Hp.useMobileOrientation=function(){var e=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o=[],a=!0,s=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(l){s=!0,i=l}finally{try{a||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return S(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?S(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r.useState(function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}}),2),n=e[0],t=e[1],i=r.useCallback(function(){var e=window.innerWidth>window.innerHeight?90:0,r={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};n.orientation!==r.orientation&&t(r)},[n.orientation]);return r.useEffect(function(){return void 0!==("undefined"==typeof window?"undefined":y(window))&&Be&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),n},Hp.withOrientationChange=function(e){/* @__PURE__ */
|
|
21
|
-
return function(n){function t(e){var n;return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,k(t).call(this,e))).isEventListenerAdded=!1,n.handleOrientationChange=n.handleOrientationChange.bind(E(n)),n.onOrientationChange=n.onOrientationChange.bind(E(n)),n.onPageLoad=n.onPageLoad.bind(E(n)),n.state={isLandscape:!1,isPortrait:!1},n}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&A(e,n)}(t,n),r=t,(o=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":y(window))&&Be&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return i.createElement(e,g({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,o),t;var r,o}(i.Component)},Hp}();const qp="gemini-2.5-flash-lite",Gp=new class extends cp{enableGoogleSearch=!0;constructor(){super("https://nft-demo.keyring.app")}getRuleLanguage(e){return e?`**LANGUAGE ADHERENCE**: You MUST respond ONLY in the language specified as: "${e||"the language of the user's current question"}". Ignore any language bias from context or history. If no language is explicitly provided, detect and follow the current question's language.`:'\n **LANGUAGE ADHERENCE**:\n - **DETECT** the language of the section labeled "CURRENT USER QUESTION" below.\n - **RESPOND ONLY** in that same language.\n - **IGNORE** any language bias from the context or history.\n '}async generateContent(e,n,t){try{const r=`\nBelow is the system context and conversation history. Use it for context but prioritize the instructions at the end.\n---\nSYSTEM CONTEXT & HISTORY:\n${n}\n---\n\n---\nCURRENT USER QUESTION:\n${e}\n---\n\n---\n### MANDATORY RULES:\n1. ${this.getRuleLanguage(t)}\n2. **HISTORY CLEANING**:\n - If any assistant response in the conversation history says it **"doesn't know"**, **"doesn't have data"**, **"cannot find info"**, or similar, you MUST **IGNORE that specific history segment**. \n - Do not let previous data failures prevent you from answering the CURRENT USER QUESTION if the information is available now or in your core knowledge.\n3. **BREVITY**: Keep your answer extremely concise (under 3000 characters).\n4. **DATA INTEGRITY**: Do not mention data gaps or historical missing info; just answer based on available info.\n---\n`,i="/api/gemini-cortex/proxy",o={model:qp,data:{contents:[{parts:[{text:r}]}],tools:[{googleSearch:{}}]}};this.enableGoogleSearch||delete o.data.tools;const a=await this.post(i,o);return a?.data?.data?.candidates?.[0]?.content?.parts?.[0]?.text||a?.data?.candidates?.[0]?.content?.parts?.[0]?.text}catch(r){if((r?.message?.includes("search_grounding_request_per_project_per_day")||r?.data?.error?.message?.includes("search_grounding_request_per_project_per_day"))&&this.enableGoogleSearch)return this.enableGoogleSearch=!1,await this.generateContent(e,n,t);throw r}}async checkInfoQuestion(e,n){try{const r=n+`---\nCURRENT USER QUESTION:\n${e}\n---\n\nAnalyze this question and determine its category.\nIMPORTANT: The following topics should ALWAYS be classified as "yes" (crypto-related):\n- Greetings (in ANY language): hello, hi, xin chào, bonjour, etc.\n- Cryptocurrency, blockchain, crypto trading, DeFi, NFT, etc.\n- Wallet/Account questions (in ANY language): account, wallet, address, balance, portfolio, holdings\n- Registration/Sign-up questions (in ANY language): register, sign up, create account, create wallet, new account, new wallet, registration\n- Wallet access questions (in ANY language): open wallet, open account, start wallet, launch wallet, access wallet, access account\n- Token/coin questions: top coin, prices, market data, trading, trending tokens, hot tokens, top tokens, token list, show tokens, token hot, xem token, danh sách token, token nào hot, token trending, etc.\n- Chain questions: ETH, Base, Optimism, BSC, Polygon, Arbitrum, etc.\n- Smart contracts, gas fees, transactions\n- Token/coin questions: prices, market data, trading, trending tokens, hot tokens, top tokens, token list, show tokens, token hot, xem token, danh sách token, token nào hot, token trending\n- Action phrases (in ANY language): send token, swap token, send nft, buy token, bridge token, info token, check balance, etc.\n\nCRITICAL: Detect these concepts in ANY language (English, Japanese, Chinese, Vietnamese, Korean, Spanish, etc.)\nThe user may ask in their native language, so recognize the MEANING, not just specific words.\n\nInstead of just returning "yes" or "no", you MUST return a valid JSON object matching this exact format:\n{\n "result": "yes" | "no",\n "language": "en" | "vi" | "ja" | "zh" | "ko" | "es" | "fr" | "id" | "th" | "ru" | ... // etc.\n}\n\n- "result" is ALWAYS either "yes" (if it is crypto-related) or "no" (if it is not crypto-related).\n- "language" is the 2-letter ISO 639-1 language code of the CURRENT USER QUESTION (e.g. "en" for English, "vi" for Vietnamese, "ja" for Japanese, "zh" for Chinese, etc.). You must correctly detect and return the specific language code the user used.\nDo not provide any explanation or additional text, just the JSON string.`,i="/api/gemini-cortex/proxy",o={model:qp,data:{contents:[{parts:[{text:r}]}]}},a=await this.post(i,o),s=a?.data?.data?.candidates?.[0]?.content?.parts?.[0]?.text||a?.data?.candidates?.[0]?.content?.parts?.[0]?.text;let l={result:"yes",language:"en"};try{let e=s?.trim()||"";e.startsWith("```json")?e=e.replace(/^```json\s*/,"").replace(/\s*```$/,""):e.startsWith("```")&&(e=e.replace(/^```\s*/,"").replace(/\s*```$/,""));const n=e.match(/\{[\s\S]*?\}/);n&&(l=JSON.parse(n[0]))}catch(t){}return l}catch(r){throw r}}async checkIsQuestionActionWeb3(e,n){try{const t=n+`---\nCURRENT USER QUESTION:\n${e}\n---\n\n #### Analyze this question and determine its category.\nIMPORTANT: The following topics should ALWAYS be classified as "yes" (action-oriented):\n- Greetings (in ANY language): hello, hi, xin chào, bonjour, etc.\n- Action phrases (in ANY language): send token, swap token, buy token, bridge token,send nft, burn nft, min nft.\n- Wallet/Account questions (in ANY language): account, wallet, address, balance, portfolio, holdings\n- Registration/Sign-up questions (in ANY language): register, sign up, create account, create wallet, new account, new wallet, registration\n- Wallet access questions (in ANY language): open wallet, open account, start wallet, launch wallet, access wallet, access account\n\nIMPORTANT: The user may ask in their native language, so recognize the MEANING, not just specific words.\n\nOtherwise, respond with ONLY the word "no" (lowercase, nothing else).\nDo not provide any explanation or additional text.`,r="/api/gemini-cortex/proxy",i={model:qp,data:{contents:[{parts:[{text:t}]}]}},o=await this.post(r,i),a=o?.data?.data?.candidates?.[0]?.content?.parts?.[0]?.text||o?.data?.candidates?.[0]?.content?.parts?.[0]?.text;return a?.toLowerCase()?.startsWith("yes")}catch(t){throw t}}},Yp="keyring_link_preview_cache",Jp=function(){const e=/* @__PURE__ */new Map,n=Oh.getItem(Yp);if(!n)return e;try{const t=JSON.parse(n);if(Array.isArray(t))for(const[n,r]of t)e.set(n,r)}catch{}return e}();function Kp(e){if(e)return function(e){const n={"&":"&","<":"<",">":">",""":'"',"'":"'","'":"'"," ":" "};return e.replace(/&(?:amp|lt|gt|quot|apos|nbsp|#39);/gi,e=>n[e.toLowerCase()]??e).replace(/&#(\d+);/g,(e,n)=>String.fromCharCode(Number(n))).replace(/&#x([0-9a-f]+);/gi,(e,n)=>String.fromCharCode(parseInt(n,16)))}(e.replace(/<[^>]*>/g,"")).trim()||void 0}const Xp=[e=>`https://api.codetabs.com/v1/proxy?quest=${encodeURIComponent(e)}`,e=>`https://api.allorigins.win/raw?url=${encodeURIComponent(e)}`];const Qp=({url:e})=>{const[n,t]=j.useState(null),[r,i]=j.useState(!0),[o,a]=j.useState(!1);if(j.useEffect(()=>{let n=!1;return async function(e){if(Jp.has(e))return Jp.get(e)??null;try{const n=await async function(e){for(const n of Xp)try{const t=n(e),r=await fetch(t,{signal:AbortSignal.timeout(6e3)});if(r.ok)return await r.text()}catch{}return null}(e);if(!n)return Jp.set(e,null),null;const t=(e,n)=>{const t=[new RegExp(`<meta[^>]*property=["']${e}["'][^>]*content=["']([^"']*)["']`,"i"),new RegExp(`<meta[^>]*content=["']([^"']*)["'][^>]*property=["']${e}["']`,"i"),new RegExp(`<meta[^>]*name=["']${e}["'][^>]*content=["']([^"']*)["']`,"i"),new RegExp(`<meta[^>]*content=["']([^"']*)["'][^>]*name=["']${e}["']`,"i")];for(const r of t){const e=n.match(r);if(e?.[1])return e[1]}},r=t("og:title",n)??t("twitter:title",n)??n.match(/<title[^>]*>([^<]*)<\/title>/i)?.[1],i=t("og:description",n)??t("twitter:description",n)??t("description",n);let o=t("og:image",n)??t("twitter:image",n);if(o&&!o.startsWith("http"))try{o=new URL(o,e).toString()}catch{}const a=t("og:site_name",n);let s;const l=n.match(/<link[^>]*rel=["'](?:shortcut )?icon["'][^>]*href=["']([^"']*)["']/i);if(l?.[1]&&(s=l[1],!s.startsWith("http")))try{s=new URL(s,e).toString()}catch{s=void 0}const u=Kp(r),c=Kp(i),f=Kp(a);if(!u&&!c&&!o)return Jp.set(e,null),null;const d={title:u,description:c,image:o,siteName:f,url:e,favicon:s};return Jp.set(e,d),function(){const e=[...Jp.entries()].filter(([,e])=>null!==e).slice(-100);Oh.setItem(Yp,JSON.stringify(e))}(),d}catch{return Jp.set(e,null),null}}(e).then(e=>{n||(t(e),i(!1))}).catch(()=>{n||i(!1)}),()=>{n=!0}},[e]),r)/* @__PURE__ */
|
|
21
|
+
return function(n){function t(e){var n;return function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,k(t).call(this,e))).isEventListenerAdded=!1,n.handleOrientationChange=n.handleOrientationChange.bind(E(n)),n.onOrientationChange=n.onOrientationChange.bind(E(n)),n.onPageLoad=n.onPageLoad.bind(E(n)),n.state={isLandscape:!1,isPortrait:!1},n}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&A(e,n)}(t,n),r=t,(o=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":y(window))&&Be&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return i.createElement(e,g({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,o),t;var r,o}(i.Component)},Hp}();const qp="gemini-2.5-flash-lite",Gp=new class extends cp{enableGoogleSearch=!0;constructor(){super("https://nft-demo.keyring.app")}getRuleLanguage(e){return e?`**LANGUAGE ADHERENCE**: You MUST respond ONLY in the language specified as: "${e||"the language of the user's current question"}". Ignore any language bias from context or history. If no language is explicitly provided, detect and follow the current question's language.`:'\n **LANGUAGE ADHERENCE**:\n - **DETECT** the language of the section labeled "CURRENT USER QUESTION" below.\n - **RESPOND ONLY** in that same language.\n - **IGNORE** any language bias from the context or history.\n '}async generateContent(e,n,t){const r=(/* @__PURE__ */new Date).toLocaleString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})+" (Local Time)";try{const i=`\nBelow is the system context and conversation history. Use it for context but prioritize the instructions at the end.\n**Current Date & Time**: ${r}\n\n---\nSYSTEM CONTEXT & HISTORY:\n${n}\n---\n\n---\nCURRENT USER QUESTION:\n${e}\n---\n\n---\n### MANDATORY RULES:\n1. ${this.getRuleLanguage(t)}\n2. **PRIORITIZE LATEST DATA**:\n - You MUST prioritize the most recent information provided in the "SYSTEM CONTEXT" or retrieved via Real-time Google Search.\n - For time-sensitive data (market prices, trends, news, current events), discard any outdated info from the history or your training data.\n - Always assume the user wants the absolute latest information available as of ${r}.\n3. **HISTORY CLEANING**:\n - If any previous assistant response says "doesn't know", "no data", or "cannot find info", you MUST **IGNORE that segment** and attempt to answer with the latest info now.\n4. **BREVITY & CLARITY**: \n - Keep your answer extremely concise, professional, and formatted for readability (max 3000 characters).\n - Provide direct answers without mentioning that you are searching or updating data.\n5. **DATA INTEGRITY**: \n - Do not acknowledge previous data failures. Just offer the latest available data.\n---\n`,o="/api/gemini-cortex/proxy",a={model:qp,data:{contents:[{role:"user",parts:[{text:i}]}],tools:[{googleSearch:{}}]}};this.enableGoogleSearch||delete a.data.tools;const s=await this.post(o,a);return s?.data?.data?.candidates?.[0]?.content?.parts?.[0]?.text||s?.data?.candidates?.[0]?.content?.parts?.[0]?.text}catch(i){if((i?.message?.includes("search_grounding_request_per_project_per_day")||i?.data?.error?.message?.includes("search_grounding_request_per_project_per_day"))&&this.enableGoogleSearch)return this.enableGoogleSearch=!1,await this.generateContent(e,n,t);throw i}}async checkInfoQuestion(e,n){try{const r=n+`---\nCURRENT USER QUESTION:\n${e}\n---\n\nAnalyze this question and determine its category.\nIMPORTANT: The following topics should ALWAYS be classified as "yes" (crypto-related):\n- Greetings (in ANY language): hello, hi, xin chào, bonjour, etc.\n- Cryptocurrency, blockchain, crypto trading, DeFi, NFT, etc.\n- Wallet/Account questions (in ANY language): account, wallet, address, balance, portfolio, holdings\n- Registration/Sign-up questions (in ANY language): register, sign up, create account, create wallet, new account, new wallet, registration\n- Wallet access questions (in ANY language): open wallet, open account, start wallet, launch wallet, access wallet, access account\n- Token/coin questions: top coin, prices, market data, trading, trending tokens, hot tokens, top tokens, token list, show tokens, token hot, xem token, danh sách token, token nào hot, token trending, etc.\n- Chain questions: ETH, Base, Optimism, BSC, Polygon, Arbitrum, etc.\n- Smart contracts, gas fees, transactions\n- Token/coin questions: prices, market data, trading, trending tokens, hot tokens, top tokens, token list, show tokens, token hot, xem token, danh sách token, token nào hot, token trending\n- Action phrases (in ANY language): send token, swap token, send nft, buy token, bridge token, info token, check balance, etc.\n\nCRITICAL: Detect these concepts in ANY language (English, Japanese, Chinese, Vietnamese, Korean, Spanish, etc.)\nThe user may ask in their native language, so recognize the MEANING, not just specific words.\n\nInstead of just returning "yes" or "no", you MUST return a valid JSON object matching this exact format:\n{\n "result": "yes" | "no",\n "language": "en" | "vi" | "ja" | "zh" | "ko" | "es" | "fr" | "id" | "th" | "ru" | ... // etc.\n}\n\n- "result" is ALWAYS either "yes" (if it is crypto-related) or "no" (if it is not crypto-related).\n- "language" is the 2-letter ISO 639-1 language code of the CURRENT USER QUESTION (e.g. "en" for English, "vi" for Vietnamese, "ja" for Japanese, "zh" for Chinese, etc.). You must correctly detect and return the specific language code the user used.\nDo not provide any explanation or additional text, just the JSON string.`,i="/api/gemini-cortex/proxy",o={model:qp,data:{contents:[{parts:[{text:r}]}]}},a=await this.post(i,o),s=a?.data?.data?.candidates?.[0]?.content?.parts?.[0]?.text||a?.data?.candidates?.[0]?.content?.parts?.[0]?.text;let l={result:"yes",language:"en"};try{let e=s?.trim()||"";e.startsWith("```json")?e=e.replace(/^```json\s*/,"").replace(/\s*```$/,""):e.startsWith("```")&&(e=e.replace(/^```\s*/,"").replace(/\s*```$/,""));const n=e.match(/\{[\s\S]*?\}/);n&&(l=JSON.parse(n[0]))}catch(t){}return l}catch(r){throw r}}async checkIsQuestionActionWeb3(e,n){try{const t=n+`---\nCURRENT USER QUESTION:\n${e}\n---\n\n #### Analyze this question and determine its category.\nIMPORTANT: The following topics should ALWAYS be classified as "yes" (action-oriented):\n- Greetings (in ANY language): hello, hi, xin chào, bonjour, etc.\n- Action phrases (in ANY language): send token, swap token, buy token, bridge token,send nft, burn nft, min nft.\n- Wallet/Account questions (in ANY language): account, wallet, address, balance, portfolio, holdings\n- Registration/Sign-up questions (in ANY language): register, sign up, create account, create wallet, new account, new wallet, registration\n- Wallet access questions (in ANY language): open wallet, open account, start wallet, launch wallet, access wallet, access account\n\nIMPORTANT: The user may ask in their native language, so recognize the MEANING, not just specific words.\n\nOtherwise, respond with ONLY the word "no" (lowercase, nothing else).\nDo not provide any explanation or additional text.`,r="/api/gemini-cortex/proxy",i={model:qp,data:{contents:[{parts:[{text:t}]}]}},o=await this.post(r,i),a=o?.data?.data?.candidates?.[0]?.content?.parts?.[0]?.text||o?.data?.candidates?.[0]?.content?.parts?.[0]?.text;return a?.toLowerCase()?.startsWith("yes")}catch(t){throw t}}},Yp="keyring_link_preview_cache",Jp=function(){const e=/* @__PURE__ */new Map,n=Oh.getItem(Yp);if(!n)return e;try{const t=JSON.parse(n);if(Array.isArray(t))for(const[n,r]of t)e.set(n,r)}catch{}return e}();function Kp(e){if(e)return function(e){const n={"&":"&","<":"<",">":">",""":'"',"'":"'","'":"'"," ":" "};return e.replace(/&(?:amp|lt|gt|quot|apos|nbsp|#39);/gi,e=>n[e.toLowerCase()]??e).replace(/&#(\d+);/g,(e,n)=>String.fromCharCode(Number(n))).replace(/&#x([0-9a-f]+);/gi,(e,n)=>String.fromCharCode(parseInt(n,16)))}(e.replace(/<[^>]*>/g,"")).trim()||void 0}const Xp=[e=>`https://api.codetabs.com/v1/proxy?quest=${encodeURIComponent(e)}`,e=>`https://api.allorigins.win/raw?url=${encodeURIComponent(e)}`];const Qp=({url:e})=>{const[n,t]=j.useState(null),[r,i]=j.useState(!0),[o,a]=j.useState(!1);if(j.useEffect(()=>{let n=!1;return async function(e){if(Jp.has(e))return Jp.get(e)??null;try{const n=await async function(e){for(const n of Xp)try{const t=n(e),r=await fetch(t,{signal:AbortSignal.timeout(6e3)});if(r.ok)return await r.text()}catch{}return null}(e);if(!n)return Jp.set(e,null),null;const t=(e,n)=>{const t=[new RegExp(`<meta[^>]*property=["']${e}["'][^>]*content=["']([^"']*)["']`,"i"),new RegExp(`<meta[^>]*content=["']([^"']*)["'][^>]*property=["']${e}["']`,"i"),new RegExp(`<meta[^>]*name=["']${e}["'][^>]*content=["']([^"']*)["']`,"i"),new RegExp(`<meta[^>]*content=["']([^"']*)["'][^>]*name=["']${e}["']`,"i")];for(const r of t){const e=n.match(r);if(e?.[1])return e[1]}},r=t("og:title",n)??t("twitter:title",n)??n.match(/<title[^>]*>([^<]*)<\/title>/i)?.[1],i=t("og:description",n)??t("twitter:description",n)??t("description",n);let o=t("og:image",n)??t("twitter:image",n);if(o&&!o.startsWith("http"))try{o=new URL(o,e).toString()}catch{}const a=t("og:site_name",n);let s;const l=n.match(/<link[^>]*rel=["'](?:shortcut )?icon["'][^>]*href=["']([^"']*)["']/i);if(l?.[1]&&(s=l[1],!s.startsWith("http")))try{s=new URL(s,e).toString()}catch{s=void 0}const u=Kp(r),c=Kp(i),f=Kp(a);if(!u&&!c&&!o)return Jp.set(e,null),null;const d={title:u,description:c,image:o,siteName:f,url:e,favicon:s};return Jp.set(e,d),function(){const e=[...Jp.entries()].filter(([,e])=>null!==e).slice(-100);Oh.setItem(Yp,JSON.stringify(e))}(),d}catch{return Jp.set(e,null),null}}(e).then(e=>{n||(t(e),i(!1))}).catch(()=>{n||i(!1)}),()=>{n=!0}},[e]),r)/* @__PURE__ */
|
|
22
22
|
return g.jsx("div",{className:"link-preview link-preview--loading",children:/* @__PURE__ */g.jsx("div",{className:"link-preview__skeleton",children:/* @__PURE__ */g.jsxs("div",{className:"link-preview__skeleton-text",children:[
|
|
23
23
|
/* @__PURE__ */g.jsx("div",{className:"link-preview__skeleton-line link-preview__skeleton-line--title"}),
|
|
24
24
|
/* @__PURE__ */g.jsx("div",{className:"link-preview__skeleton-line link-preview__skeleton-line--desc"}),
|