Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@driplane/web

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@driplane/web - npm Package Compare versions

Comparing version 1.0.0-beta.13 to 1.0.0-beta.14

2

dist/driplane.js

@@ -1,1 +0,1 @@

import{a as Si,b as Ai}from"./chunk-NLMHZ7JJ.js";var pi=Si((M,V)=>{(function(p,d){"use strict";var F="1.0.33",k="",q="?",S="function",g="undefined",_="object",y="string",G="major",o="model",a="name",i="type",e="vendor",r="version",m="architecture",x="console",s="mobile",t="tablet",f="smarttv",A="wearable",oi="embedded",H=350,W="Amazon",z="Apple",ai="ASUS",ri="BlackBerry",E="Browser",C="Chrome",_i="Edge",U="Firefox",P="Google",ti="Huawei",Y="LG",$="Microsoft",si="Motorola",B="Opera",Z="Samsung",ni="Sharp",L="Sony",X="Xiaomi",K="Zebra",bi="Facebook",yi=function(n,l){var b={};for(var u in n)l[u]&&l[u].length%2===0?b[u]=l[u].concat(n[u]):b[u]=n[u];return b},I=function(n){for(var l={},b=0;b<n.length;b++)l[n[b].toUpperCase()]=n[b];return l},wi=function(n,l){return typeof n===y?O(l).indexOf(O(n))!==-1:!1},O=function(n){return n.toLowerCase()},Ei=function(n){return typeof n===y?n.replace(/[^\d\.]/g,k).split(".")[0]:d},J=function(n,l){if(typeof n===y)return n=n.replace(/^\s\s*/,k),typeof l===g?n:n.substring(0,H)},N=function(n,l){for(var b=0,u,w,j,c,R,v;b<l.length&&!R;){var di=l[b],ui=l[b+1];for(u=w=0;u<di.length&&!R;)if(R=di[u++].exec(n),R)for(j=0;j<ui.length;j++)v=R[++w],c=ui[j],typeof c===_&&c.length>0?c.length===2?typeof c[1]==S?this[c[0]]=c[1].call(this,v):this[c[0]]=c[1]:c.length===3?typeof c[1]===S&&!(c[1].exec&&c[1].test)?this[c[0]]=v?c[1].call(this,v,c[2]):d:this[c[0]]=v?v.replace(c[1],c[2]):d:c.length===4&&(this[c[0]]=v?c[3].call(this,v.replace(c[1],c[2])):d):this[c]=v||d;b+=2}},Q=function(n,l){for(var b in l)if(typeof l[b]===_&&l[b].length>0){for(var u=0;u<l[b].length;u++)if(wi(l[b][u],n))return b===q?d:b}else if(wi(l[b],n))return b===q?d:b;return n},Ti={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},li={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"},ci={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[a,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[a,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[a,r],[/opios[\/ ]+([\w\.]+)/i],[r,[a,B+" Mini"]],[/\bopr\/([\w\.]+)/i],[r,[a,B]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[a,r],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[a,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[r,[a,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[r,[a,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[a,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[a,"IE"]],[/yabrowser\/([\w\.]+)/i],[r,[a,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[a,/(.+)/,"$1 Secure "+E],r],[/\bfocus\/([\w\.]+)/i],[r,[a,U+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[a,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[a,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[a,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[a,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[a,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[r,[a,U]],[/\bqihu|(qi?ho?o?|360)browser/i],[[a,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[a,/(.+)/,"$1 "+E],r],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[a,r],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[a],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[a,bi],r],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[a,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[a,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[a,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[a,C+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[a,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[a,r],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[r,[a,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[r,a],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[a,[r,Q,Ti]],[/(webkit|khtml)\/([\w\.]+)/i],[a,r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[a,"Netscape"],r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[a,U+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\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|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[a,r],[/(cobalt)\/([\w\.]+)/i],[a,[r,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,O]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,k,O]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,O]]],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],[o,[e,Z],[i,t]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[o,[e,Z],[i,s]],[/\((ip(?:hone|od)[\w ]*);/i],[o,[e,z],[i,s]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[e,z],[i,t]],[/(macintosh);/i],[o,[e,z]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[o,[e,ti],[i,t]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[o,[e,ti],[i,s]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[o,/_/g," "],[e,X],[i,s]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[o,/_/g," "],[e,X],[i,t]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[o,[e,"OPPO"],[i,s]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[o,[e,"Vivo"],[i,s]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[o,[e,"Realme"],[i,s]],[/\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],[o,[e,si],[i,s]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[o,[e,si],[i,t]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[o,[e,Y],[i,t]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[o,[e,Y],[i,s]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[o,[e,"Lenovo"],[i,t]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[o,/_/g," "],[e,"Nokia"],[i,s]],[/(pixel c)\b/i],[o,[e,P],[i,t]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[o,[e,P],[i,s]],[/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],[o,[e,L],[i,s]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[o,"Xperia Tablet"],[e,L],[i,t]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[o,[e,"OnePlus"],[i,s]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[o,[e,W],[i,t]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[o,/(.+)/g,"Fire Phone $1"],[e,W],[i,s]],[/(playbook);[-\w\),; ]+(rim)/i],[o,e,[i,t]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[o,[e,ri],[i,s]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[o,[e,ai],[i,t]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[o,[e,ai],[i,s]],[/(nexus 9)/i],[o,[e,"HTC"],[i,t]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[e,[o,/_/g," "],[i,s]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[o,[e,"Acer"],[i,t]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[o,[e,"Meizu"],[i,s]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[o,[e,ni],[i,s]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[e,o,[i,s]],[/(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],[e,o,[i,t]],[/(surface duo)/i],[o,[e,$],[i,t]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[o,[e,"Fairphone"],[i,s]],[/(u304aa)/i],[o,[e,"AT&T"],[i,s]],[/\bsie-(\w*)/i],[o,[e,"Siemens"],[i,s]],[/\b(rct\w+) b/i],[o,[e,"RCA"],[i,t]],[/\b(venue[\d ]{2,7}) b/i],[o,[e,"Dell"],[i,t]],[/\b(q(?:mv|ta)\w+) b/i],[o,[e,"Verizon"],[i,t]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[o,[e,"Barnes & Noble"],[i,t]],[/\b(tm\d{3}\w+) b/i],[o,[e,"NuVision"],[i,t]],[/\b(k88) b/i],[o,[e,"ZTE"],[i,t]],[/\b(nx\d{3}j) b/i],[o,[e,"ZTE"],[i,s]],[/\b(gen\d{3}) b.+49h/i],[o,[e,"Swiss"],[i,s]],[/\b(zur\d{3}) b/i],[o,[e,"Swiss"],[i,t]],[/\b((zeki)?tb.*\b) b/i],[o,[e,"Zeki"],[i,t]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[e,"Dragon Touch"],o,[i,t]],[/\b(ns-?\w{0,9}) b/i],[o,[e,"Insignia"],[i,t]],[/\b((nxa|next)-?\w{0,9}) b/i],[o,[e,"NextBook"],[i,t]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[e,"Voice"],o,[i,s]],[/\b(lvtel\-)?(v1[12]) b/i],[[e,"LvTel"],o,[i,s]],[/\b(ph-1) /i],[o,[e,"Essential"],[i,s]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[o,[e,"Envizen"],[i,t]],[/\b(trio[-\w\. ]+) b/i],[o,[e,"MachSpeed"],[i,t]],[/\btu_(1491) b/i],[o,[e,"Rotor"],[i,t]],[/(shield[\w ]+) b/i],[o,[e,"Nvidia"],[i,t]],[/(sprint) (\w+)/i],[e,o,[i,s]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[e,$],[i,s]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[e,K],[i,t]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[e,K],[i,s]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[e,o,[i,x]],[/droid.+; (shield) bui/i],[o,[e,"Nvidia"],[i,x]],[/(playstation [345portablevi]+)/i],[o,[e,L],[i,x]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[o,[e,$],[i,x]],[/smart-tv.+(samsung)/i],[e,[i,f]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[e,Z],[i,f]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[e,Y],[i,f]],[/(apple) ?tv/i],[e,[o,z+" TV"],[i,f]],[/crkey/i],[[o,C+"cast"],[e,P],[i,f]],[/droid.+aft(\w)( bui|\))/i],[o,[e,W],[i,f]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[o,[e,ni],[i,f]],[/(bravia[\w ]+)( bui|\))/i],[o,[e,L],[i,f]],[/(mitv-\w{5}) bui/i],[o,[e,X],[i,f]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[e,J],[o,J],[i,f]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[i,f]],[/((pebble))app/i],[e,o,[i,A]],[/droid.+; (glass) \d/i],[o,[e,P],[i,A]],[/droid.+; (wt63?0{2,3})\)/i],[o,[e,K],[i,A]],[/(quest( 2)?)/i],[o,[e,bi],[i,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[e,[i,oi]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[o,[i,s]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[o,[i,t]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[i,t]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[i,s]],[/(android[-\w\. ]{0,9});.+buil/i],[o,[e,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[a,_i+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[a,"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],[a,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,a]],os:[[/microsoft (windows) (vista|xp)/i],[a,r],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[a,[r,Q,li]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[a,"Windows"],[r,Q,li]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[a,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[a,"Mac OS"],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,a],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[a,r],[/\(bb(10);/i],[r,[a,ri]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[a,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[a,U+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[a,"webOS"]],[/crkey\/([\d\.]+)/i],[r,[a,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[a,"Chromium OS"],r],[/(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],[a,r],[/(sunos) ?([\w\.\d]*)/i],[[a,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[a,r]]},h=function(n,l){if(typeof n===_&&(l=n,n=d),!(this instanceof h))return new h(n,l).getResult();var b=n||(typeof p!==g&&p.navigator&&p.navigator.userAgent?p.navigator.userAgent:k),u=l?yi(ci,l):ci;return this.getBrowser=function(){var w={};return w[a]=d,w[r]=d,N.call(w,b,u.browser),w.major=Ei(w.version),w},this.getCPU=function(){var w={};return w[m]=d,N.call(w,b,u.cpu),w},this.getDevice=function(){var w={};return w[e]=d,w[o]=d,w[i]=d,N.call(w,b,u.device),w},this.getEngine=function(){var w={};return w[a]=d,w[r]=d,N.call(w,b,u.engine),w},this.getOS=function(){var w={};return w[a]=d,w[r]=d,N.call(w,b,u.os),w},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 b},this.setUA=function(w){return b=typeof w===y&&w.length>H?J(w,H):w,this},this.setUA(b),this};h.VERSION=F,h.BROWSER=I([a,r,G]),h.CPU=I([m]),h.DEVICE=I([o,e,i,x,s,f,t,A,oi]),h.ENGINE=h.OS=I([a,r]),typeof M!==g?(typeof V!==g&&V.exports&&(M=V.exports=h),M.UAParser=h):typeof define===S&&define.amd?define(function(){return h}):typeof p!==g&&(p.UAParser=h);var T=typeof p!==g&&(p.jQuery||p.Zepto);if(T&&!T.ua){var D=new h;T.ua=D.getResult(),T.ua.get=function(){return D.getUA()},T.ua.set=function(n){D.setUA(n);var l=D.getResult();for(var b in l)T.ua[b]=l[b]}}})(typeof window=="object"?window:M)});var hi=Ai(pi()),ii=new hi.default,ei=new Headers;ei.append("Content-Type","application/json");var mi=p=>new URL(p),fi="https://data.driplane.io",Oi=p=>{fi=p},vi=p=>{let d=window.btoa(`${p}:`);ei.set("Authorization",`Basic ${d}`)},gi=async(p,d={})=>{let{href:F,host:k,pathname:q,protocol:S}=mi(location.href),{href:g,host:_}=document.referrer?mi(document.referrer):{href:"",host:""},{getClientId:y}=await import("./client-id-3VGDERJD.js"),G=await y(),{name:o,version:a}=ii.getBrowser(),{name:i,version:e}=ii.getOS(),{model:r,type:m}=ii.getDevice(),{width:x,height:s}=screen,t={ua_br:o,ua_br_v:a,ua_os:i,ua_os_v:e,ua_dv:r,ua_dv_t:m,url:F,url_host:k,url_path:q,url_prot:S,lang:navigator.language,sh:s,sw:x,ref:g,ref_host:_,ref_ext:k!==_?1:0,cid:G};return fetch(`${fi}/events/${p}`,{method:"POST",headers:ei,body:JSON.stringify({...t,...d})})},ki=async(p={})=>gi("page_view",p);var xi=document?.querySelector("script[data-driplane-token]");xi?.dataset.driplaneToken?(vi(xi?.dataset.driplaneToken),ki()):console.warn("[Driplane] No token given");export{Oi as setServer,vi as setToken,gi as trackEvent,ki as trackPageview};
var Ai=Object.create;var he=Object.defineProperty;var Li=Object.getOwnPropertyDescriptor;var Oi=Object.getOwnPropertyNames;var Pi=Object.getPrototypeOf,Ni=Object.prototype.hasOwnProperty;var Ii=(i,e)=>()=>(i&&(e=i(i=0)),e);var Mi=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ri=(i,e)=>{for(var s in e)he(i,s,{get:e[s],enumerable:!0})},Fi=(i,e,s,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Oi(e))!Ni.call(i,a)&&a!==s&&he(i,a,{get:()=>e[a],enumerable:!(u=Li(e,a))||u.enumerable});return i};var Bi=(i,e,s)=>(s=i!=null?Ai(Pi(i)):{},Fi(e||!i||!i.__esModule?he(s,"default",{value:i,enumerable:!0}):s,i));var je=Mi((j,ie)=>{(function(i,e){"use strict";var s="1.0.33",u="",a="?",l="function",m="undefined",g="object",v="string",T="major",t="model",o="name",n="type",r="vendor",c="version",E="architecture",P="console",d="mobile",b="tablet",x="smarttv",q="wearable",Oe="embedded",ue=350,le="Amazon",W="Apple",Pe="ASUS",Ne="BlackBerry",I="Browser",Y="Chrome",Ei="Edge",$="Firefox",Z="Google",Ie="Huawei",de="LG",be="Microsoft",Me="Motorola",X="Opera",pe="Samsung",Re="Sharp",K="Sony",we="Xiaomi",fe="Zebra",Fe="Facebook",Si=function(p,h){var w={};for(var k in p)h[k]&&h[k].length%2===0?w[k]=h[k].concat(p[k]):w[k]=p[k];return w},J=function(p){for(var h={},w=0;w<p.length;w++)h[p[w].toUpperCase()]=p[w];return h},Be=function(p,h){return typeof p===v?D(h).indexOf(D(p))!==-1:!1},D=function(p){return p.toLowerCase()},_i=function(p){return typeof p===v?p.replace(/[^\d\.]/g,u).split(".")[0]:e},me=function(p,h){if(typeof p===v)return p=p.replace(/^\s\s*/,u),typeof h===m?p:p.substring(0,ue)},U=function(p,h){for(var w=0,k,f,ee,y,z,A;w<h.length&&!z;){var Ue=h[w],ze=h[w+1];for(k=f=0;k<Ue.length&&!z;)if(z=Ue[k++].exec(p),z)for(ee=0;ee<ze.length;ee++)A=z[++f],y=ze[ee],typeof y===g&&y.length>0?y.length===2?typeof y[1]==l?this[y[0]]=y[1].call(this,A):this[y[0]]=y[1]:y.length===3?typeof y[1]===l&&!(y[1].exec&&y[1].test)?this[y[0]]=A?y[1].call(this,A,y[2]):e:this[y[0]]=A?A.replace(y[1],y[2]):e:y.length===4&&(this[y[0]]=A?y[3].call(this,A.replace(y[1],y[2])):e):this[y]=A||e;w+=2}},ve=function(p,h){for(var w in h)if(typeof h[w]===g&&h[w].length>0){for(var k=0;k<h[w].length;k++)if(Be(h[w][k],p))return w===a?e:w}else if(Be(h[w],p))return w===a?e:w;return p},Ci={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},qe={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"},De={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[o,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,c],[/opios[\/ ]+([\w\.]+)/i],[c,[o,X+" Mini"]],[/\bopr\/([\w\.]+)/i],[c,[o,X]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[o,c],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[o,"UC"+I]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[c,[o,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[c,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[o,"IE"]],[/yabrowser\/([\w\.]+)/i],[c,[o,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure "+I],c],[/\bfocus\/([\w\.]+)/i],[c,[o,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[o,X+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[o,X+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[o,"MIUI "+I]],[/fxios\/([-\w\.]+)/i],[c,[o,$]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360 "+I]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1 "+I],c],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[o,c],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,Fe],c],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[o,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[o,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[o,Y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Y+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[o,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,c],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[c,[o,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[c,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[c,ve,Ci]],[/(webkit|khtml)\/([\w\.]+)/i],[o,c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[o,$+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\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|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[o,c],[/(cobalt)\/([\w\.]+)/i],[o,[c,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,D]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows (ce|mobile); ppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[E,/ower/,u,D]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,D]]],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],[t,[r,pe],[n,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[t,[r,pe],[n,d]],[/\((ip(?:hone|od)[\w ]*);/i],[t,[r,W],[n,d]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[t,[r,W],[n,b]],[/(macintosh);/i],[t,[r,W]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[t,[r,Ie],[n,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[t,[r,Ie],[n,d]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[t,/_/g," "],[r,we],[n,d]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[t,/_/g," "],[r,we],[n,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[t,[r,"OPPO"],[n,d]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[t,[r,"Vivo"],[n,d]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[t,[r,"Realme"],[n,d]],[/\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],[t,[r,Me],[n,d]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[t,[r,Me],[n,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[t,[r,de],[n,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[t,[r,de],[n,d]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[t,[r,"Lenovo"],[n,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[t,/_/g," "],[r,"Nokia"],[n,d]],[/(pixel c)\b/i],[t,[r,Z],[n,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[t,[r,Z],[n,d]],[/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],[t,[r,K],[n,d]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[t,"Xperia Tablet"],[r,K],[n,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[t,[r,"OnePlus"],[n,d]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[t,[r,le],[n,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[t,/(.+)/g,"Fire Phone $1"],[r,le],[n,d]],[/(playbook);[-\w\),; ]+(rim)/i],[t,r,[n,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[t,[r,Ne],[n,d]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[t,[r,Pe],[n,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[t,[r,Pe],[n,d]],[/(nexus 9)/i],[t,[r,"HTC"],[n,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[r,[t,/_/g," "],[n,d]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[t,[r,"Acer"],[n,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[t,[r,"Meizu"],[n,d]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[t,[r,Re],[n,d]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[r,t,[n,d]],[/(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],[r,t,[n,b]],[/(surface duo)/i],[t,[r,be],[n,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[t,[r,"Fairphone"],[n,d]],[/(u304aa)/i],[t,[r,"AT&T"],[n,d]],[/\bsie-(\w*)/i],[t,[r,"Siemens"],[n,d]],[/\b(rct\w+) b/i],[t,[r,"RCA"],[n,b]],[/\b(venue[\d ]{2,7}) b/i],[t,[r,"Dell"],[n,b]],[/\b(q(?:mv|ta)\w+) b/i],[t,[r,"Verizon"],[n,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[t,[r,"Barnes & Noble"],[n,b]],[/\b(tm\d{3}\w+) b/i],[t,[r,"NuVision"],[n,b]],[/\b(k88) b/i],[t,[r,"ZTE"],[n,b]],[/\b(nx\d{3}j) b/i],[t,[r,"ZTE"],[n,d]],[/\b(gen\d{3}) b.+49h/i],[t,[r,"Swiss"],[n,d]],[/\b(zur\d{3}) b/i],[t,[r,"Swiss"],[n,b]],[/\b((zeki)?tb.*\b) b/i],[t,[r,"Zeki"],[n,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[r,"Dragon Touch"],t,[n,b]],[/\b(ns-?\w{0,9}) b/i],[t,[r,"Insignia"],[n,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[t,[r,"NextBook"],[n,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[r,"Voice"],t,[n,d]],[/\b(lvtel\-)?(v1[12]) b/i],[[r,"LvTel"],t,[n,d]],[/\b(ph-1) /i],[t,[r,"Essential"],[n,d]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[t,[r,"Envizen"],[n,b]],[/\b(trio[-\w\. ]+) b/i],[t,[r,"MachSpeed"],[n,b]],[/\btu_(1491) b/i],[t,[r,"Rotor"],[n,b]],[/(shield[\w ]+) b/i],[t,[r,"Nvidia"],[n,b]],[/(sprint) (\w+)/i],[r,t,[n,d]],[/(kin\.[onetw]{3})/i],[[t,/\./g," "],[r,be],[n,d]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[t,[r,fe],[n,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[t,[r,fe],[n,d]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[r,t,[n,P]],[/droid.+; (shield) bui/i],[t,[r,"Nvidia"],[n,P]],[/(playstation [345portablevi]+)/i],[t,[r,K],[n,P]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[t,[r,be],[n,P]],[/smart-tv.+(samsung)/i],[r,[n,x]],[/hbbtv.+maple;(\d+)/i],[[t,/^/,"SmartTV"],[r,pe],[n,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[r,de],[n,x]],[/(apple) ?tv/i],[r,[t,W+" TV"],[n,x]],[/crkey/i],[[t,Y+"cast"],[r,Z],[n,x]],[/droid.+aft(\w)( bui|\))/i],[t,[r,le],[n,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[t,[r,Re],[n,x]],[/(bravia[\w ]+)( bui|\))/i],[t,[r,K],[n,x]],[/(mitv-\w{5}) bui/i],[t,[r,we],[n,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[r,me],[t,me],[n,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[n,x]],[/((pebble))app/i],[r,t,[n,q]],[/droid.+; (glass) \d/i],[t,[r,Z],[n,q]],[/droid.+; (wt63?0{2,3})\)/i],[t,[r,fe],[n,q]],[/(quest( 2)?)/i],[t,[r,Fe],[n,q]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[r,[n,Oe]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[t,[n,d]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[t,[n,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[n,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[n,d]],[/(android[-\w\. ]{0,9});.+buil/i],[t,[r,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[o,Ei+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[o,"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],[o,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,c],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[o,[c,ve,qe]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[o,"Windows"],[c,ve,qe]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"Mac OS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,c],[/\(bb(10);/i],[c,[o,Ne]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[o,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[o,"webOS"]],[/crkey\/([\d\.]+)/i],[c,[o,Y+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[o,"Chromium OS"],c],[/(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],[o,c],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[o,c]]},S=function(p,h){if(typeof p===g&&(h=p,p=e),!(this instanceof S))return new S(p,h).getResult();var w=p||(typeof i!==m&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:u),k=h?Si(De,h):De;return this.getBrowser=function(){var f={};return f[o]=e,f[c]=e,U.call(f,w,k.browser),f.major=_i(f.version),f},this.getCPU=function(){var f={};return f[E]=e,U.call(f,w,k.cpu),f},this.getDevice=function(){var f={};return f[r]=e,f[t]=e,f[n]=e,U.call(f,w,k.device),f},this.getEngine=function(){var f={};return f[o]=e,f[c]=e,U.call(f,w,k.engine),f},this.getOS=function(){var f={};return f[o]=e,f[c]=e,U.call(f,w,k.os),f},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 w},this.setUA=function(f){return w=typeof f===v&&f.length>ue?me(f,ue):f,this},this.setUA(w),this};S.VERSION=s,S.BROWSER=J([o,c,T]),S.CPU=J([E]),S.DEVICE=J([t,r,n,P,d,x,b,q,Oe]),S.ENGINE=S.OS=J([o,c]),typeof j!==m?(typeof ie!==m&&ie.exports&&(j=ie.exports=S),j.UAParser=S):typeof define===l&&define.amd?define(function(){return S}):typeof i!==m&&(i.UAParser=S);var M=typeof i!==m&&(i.jQuery||i.Zepto);if(M&&!M.ua){var Q=new S;M.ua=Q.getResult(),M.ua.get=function(){return Q.getUA()},M.ua.set=function(p){Q.setUA(p);var h=Q.getResult();for(var w in h)M.ua[w]=h[w]}}})(typeof window=="object"?window:j)});var bi={};Ri(bi,{clientIdKey:()=>Ae,getClientId:()=>Hi});var Ae,Hi,pi=Ii(()=>{Ae="__drcid",Hi=async()=>{let i=localStorage.getItem(Ae);if(!i)try{let{default:e}=await import("https://cdn.jsdelivr.net/npm/uuid@8.3.2/dist/esm-browser/v4.js");i=e(),localStorage.setItem(Ae,`${i}`)}catch(e){return console.error("[Driplane] Error loading UUID module:",e),"0"}return i}});var fi=Bi(je());var O,H,ei,ne,ke,ii=-1,N=function(i){addEventListener("pageshow",function(e){e.persisted&&(ii=e.timeStamp,i(e))},!0)},xe=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},oe=function(){var i=xe();return i&&i.activationStart||0},_=function(i,e){var s=xe(),u="navigate";return ii>=0?u="back-forward-cache":s&&(document.prerendering||oe()>0?u="prerender":document.wasDiscarded?u="restore":s.type&&(u=s.type.replace(/_/g,"-"))),{name:i,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:u}},F=function(i,e,s){try{if(PerformanceObserver.supportedEntryTypes.includes(i)){var u=new PerformanceObserver(function(a){Promise.resolve().then(function(){e(a.getEntries())})});return u.observe(Object.assign({type:i,buffered:!0},s||{})),u}}catch{}},C=function(i,e,s,u){var a,l;return function(m){e.value>=0&&(m||u)&&((l=e.value-(a||0))||a===void 0)&&(a=e.value,e.delta=l,e.rating=function(g,v){return g>v[1]?"poor":g>v[0]?"needs-improvement":"good"}(e.value,s),i(e))}},Ee=function(i){requestAnimationFrame(function(){return requestAnimationFrame(function(){return i()})})},ae=function(i){var e=function(s){s.type!=="pagehide"&&document.visibilityState!=="hidden"||i(s)};addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)},Se=function(i){var e=!1;return function(s){e||(i(s),e=!0)}},R=-1,Ve=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},re=function(i){document.visibilityState==="hidden"&&R>-1&&(R=i.type==="visibilitychange"?i.timeStamp:0,qi())},He=function(){addEventListener("visibilitychange",re,!0),addEventListener("prerenderingchange",re,!0)},qi=function(){removeEventListener("visibilitychange",re,!0),removeEventListener("prerenderingchange",re,!0)},_e=function(){return R<0&&(R=Ve(),He(),N(function(){setTimeout(function(){R=Ve(),He()},0)})),{get firstHiddenTime(){return R}}},G=function(i){document.prerendering?addEventListener("prerenderingchange",function(){return i()},!0):i()},Ge=[1800,3e3],Ce=function(i,e){e=e||{},G(function(){var s,u=_e(),a=_("FCP"),l=F("paint",function(m){m.forEach(function(g){g.name==="first-contentful-paint"&&(l.disconnect(),g.startTime<u.firstHiddenTime&&(a.value=Math.max(g.startTime-oe(),0),a.entries.push(g),s(!0)))})});l&&(s=C(i,a,Ge,e.reportAllChanges),N(function(m){a=_("FCP"),s=C(i,a,Ge,e.reportAllChanges),Ee(function(){a.value=performance.now()-m.timeStamp,s(!0)})}))})},We=[.1,.25],ti=function(i,e){e=e||{},Ce(Se(function(){var s,u=_("CLS",0),a=0,l=[],m=function(v){v.forEach(function(T){if(!T.hadRecentInput){var t=l[0],o=l[l.length-1];a&&T.startTime-o.startTime<1e3&&T.startTime-t.startTime<5e3?(a+=T.value,l.push(T)):(a=T.value,l=[T])}}),a>u.value&&(u.value=a,u.entries=l,s())},g=F("layout-shift",m);g&&(s=C(i,u,We,e.reportAllChanges),ae(function(){m(g.takeRecords()),s(!0)}),N(function(){a=0,u=_("CLS",0),s=C(i,u,We,e.reportAllChanges),Ee(function(){return s()})}),setTimeout(s,0))}))},V={passive:!0,capture:!0},Di=new Date,Ye=function(i,e){O||(O=e,H=i,ei=new Date,ri(removeEventListener),ni())},ni=function(){if(H>=0&&H<ei-Di){var i={entryType:"first-input",name:O.type,target:O.target,cancelable:O.cancelable,startTime:O.timeStamp,processingStart:O.timeStamp+H};ne.forEach(function(e){e(i)}),ne=[]}},Ui=function(i){if(i.cancelable){var e=(i.timeStamp>1e12?new Date:performance.now())-i.timeStamp;i.type=="pointerdown"?function(s,u){var a=function(){Ye(s,u),m()},l=function(){m()},m=function(){removeEventListener("pointerup",a,V),removeEventListener("pointercancel",l,V)};addEventListener("pointerup",a,V),addEventListener("pointercancel",l,V)}(e,i):Ye(e,i)}},ri=function(i){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return i(e,Ui,V)})},$e=[100,300],oi=function(i,e){e=e||{},G(function(){var s,u=_e(),a=_("FID"),l=function(v){v.startTime<u.firstHiddenTime&&(a.value=v.processingStart-v.startTime,a.entries.push(v),s(!0))},m=function(v){v.forEach(l)},g=F("first-input",m);s=C(i,a,$e,e.reportAllChanges),g&&ae(Se(function(){m(g.takeRecords()),g.disconnect()})),g&&N(function(){var v;a=_("FID"),s=C(i,a,$e,e.reportAllChanges),ne=[],H=-1,O=null,ri(addEventListener),v=l,ne.push(v),ni()})})},ai=0,ge=1/0,te=0,zi=function(i){i.forEach(function(e){e.interactionId&&(ge=Math.min(ge,e.interactionId),te=Math.max(te,e.interactionId),ai=te?(te-ge)/7+1:0)})},si=function(){return ke?ai:performance.interactionCount||0},ji=function(){"interactionCount"in performance||ke||(ke=F("event",zi,{type:"event",buffered:!0,durationThreshold:0}))},Ze=[200,500],ci=0,Xe=function(){return si()-ci},L=[],ye={},Ke=function(i){var e=L[L.length-1],s=ye[i.interactionId];if(s||L.length<10||i.duration>e.latency){if(s)s.entries.push(i),s.latency=Math.max(s.latency,i.duration);else{var u={id:i.interactionId,latency:i.duration,entries:[i]};ye[u.id]=u,L.push(u)}L.sort(function(a,l){return l.latency-a.latency}),L.splice(10).forEach(function(a){delete ye[a.id]})}},ui=function(i,e){e=e||{},G(function(){var s;ji();var u,a=_("INP"),l=function(g){g.forEach(function(t){t.interactionId&&Ke(t),t.entryType==="first-input"&&!L.some(function(o){return o.entries.some(function(n){return t.duration===n.duration&&t.startTime===n.startTime})})&&Ke(t)});var v,T=(v=Math.min(L.length-1,Math.floor(Xe()/50)),L[v]);T&&T.latency!==a.value&&(a.value=T.latency,a.entries=T.entries,u())},m=F("event",l,{durationThreshold:(s=e.durationThreshold)!==null&&s!==void 0?s:40});u=C(i,a,Ze,e.reportAllChanges),m&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&m.observe({type:"first-input",buffered:!0}),ae(function(){l(m.takeRecords()),a.value<0&&Xe()>0&&(a.value=0,a.entries=[]),u(!0)}),N(function(){L=[],ci=si(),a=_("INP"),u=C(i,a,Ze,e.reportAllChanges)}))})},Je=[2500,4e3],Te={},li=function(i,e){e=e||{},G(function(){var s,u=_e(),a=_("LCP"),l=function(v){var T=v[v.length-1];T&&T.startTime<u.firstHiddenTime&&(a.value=Math.max(T.startTime-oe(),0),a.entries=[T],s())},m=F("largest-contentful-paint",l);if(m){s=C(i,a,Je,e.reportAllChanges);var g=Se(function(){Te[a.id]||(l(m.takeRecords()),m.disconnect(),Te[a.id]=!0,s(!0))});["keydown","click"].forEach(function(v){addEventListener(v,function(){return setTimeout(g,0)},!0)}),ae(g),N(function(v){a=_("LCP"),s=C(i,a,Je,e.reportAllChanges),Ee(function(){a.value=performance.now()-v.timeStamp,Te[a.id]=!0,s(!0)})})}})},Qe=[800,1800],Vi=function i(e){document.prerendering?G(function(){return i(e)}):document.readyState!=="complete"?addEventListener("load",function(){return i(e)},!0):setTimeout(e,0)},di=function(i,e){e=e||{};var s=_("TTFB"),u=C(i,s,Qe,e.reportAllChanges);Vi(function(){var a=xe();if(a){var l=a.responseStart;if(l<=0||l>performance.now())return;s.value=Math.max(l-oe(),0),s.entries=[a],u(!0),N(function(){s=_("TTFB",0),(u=C(i,s,Qe,e.reportAllChanges))(!0)})}})};var Le=new fi.default,wi=i=>new URL(i),mi="https://data.driplane.io",vi,hi=i=>{mi=i},gi=i=>{vi=window.btoa(`${i}:`)},yi={},B=i=>({delta:e})=>yi[i]=~~e;ti(B("cls"));Ce(B("fcp"));oi(B("fid"));li(B("lcp"));di(B("ttfb"));ui(B("inp"));var se=new Set,Ti=async(i,e={})=>{let{href:s,host:u,pathname:a,protocol:l}=wi(location.href),{href:m,host:g}=document.referrer?wi(document.referrer):{href:"",host:""},{getClientId:v}=await Promise.resolve().then(()=>(pi(),bi)),T=await v(),{name:t,version:o}=Le.getBrowser(),{name:n,version:r}=Le.getOS(),{model:c,type:E}=Le.getDevice(),{width:P,height:d}=screen,x={...{ua_br:t,ua_br_v:o,ua_os:n,ua_os_v:r,ua_dv:c,ua_dv_t:E,url:s,url_host:u,url_path:a,url_prot:l,lang:navigator.language,sh:d,sw:P,ref:m,ref_host:g,ref_ext:u!==g?1:0,cid:T},...e};se.add({event:i,body:x})},ki=async(i={})=>Ti("page_view",i);function xi(){se.size>0&&(se.forEach(({event:i,body:e})=>{let s=`${mi}/events/${i}`;Object.assign(e,yi);let u=new Headers;u.append("Content-Type","application/json"),u.set("Authorization",`Basic ${vi}`),fetch(s,{method:"POST",keepalive:!0,headers:u,body:JSON.stringify(e)})}),se.clear())}addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&xi()});addEventListener("pagehide",xi);var ce=document?.querySelector("script[data-driplane-token]");ce?.dataset.driplaneServer&&hi(ce?.dataset.driplaneServer);ce?.dataset.driplaneToken?(gi(ce?.dataset.driplaneToken),ki()):console.warn("[Driplane] No token given");console.log(import.meta);export{hi as setServer,gi as setToken,Ti as trackEvent,ki as trackPageview};
{
"name": "@driplane/web",
"version": "1.0.0-beta.13",
"version": "1.0.0-beta.14",
"description": "Driplane web tracker",

@@ -11,3 +11,3 @@ "main": "./dist/driplane.js",

"test": "jest",
"build": "esbuild src/driplane.ts --bundle --minify --splitting --format=esm --outdir=dist",
"build": "esbuild src/driplane.ts --bundle --minify --format=esm --outdir=dist",
"serve": "esbuild src/driplane.ts --bundle --splitting --format=esm --servedir=demo"

@@ -36,4 +36,5 @@ },

"ua-parser-js": "^1.0.2",
"uuid": "^8.3.2"
"uuid": "^8.3.2",
"web-vitals": "^3.5.2"
}
}
export const clientIdKey = '__drcid';
export const getClientId = async () => {
let clientId = localStorage.getItem(clientIdKey);
if (!localStorage.getItem(clientIdKey)) {
const { default: uuidv4 } = await import('https://cdn.jsdelivr.net/npm/uuid@8.3.2/dist/esm-browser/v4.js');
if (!clientId) {
try {
// Dynamically import the UUID module to reduce initial load time.
const { default: uuidv4 } = await import('https://cdn.jsdelivr.net/npm/uuid@8.3.2/dist/esm-browser/v4.js');
localStorage.setItem(clientIdKey, uuidv4());
clientId = uuidv4();
localStorage.setItem(clientIdKey, `${clientId}`);
} catch (error) {
console.error('[Driplane] Error loading UUID module:', error);
return '0';
}
}
return localStorage.getItem(clientIdKey);
}
return clientId;
};

@@ -5,2 +5,6 @@ import { setToken, setServer, trackEvent, trackPageview } from './event';

if (script?.dataset.driplaneServer) {
setServer(script?.dataset.driplaneServer);
}
if (script?.dataset.driplaneToken) {

@@ -13,2 +17,4 @@ setToken(script?.dataset.driplaneToken);

console.log(import.meta);
export { setToken, setServer, trackEvent, trackPageview };
import UAParser from 'ua-parser-js';
import { onCLS, onFCP, onFID, onINP, onLCP, onTTFB } from 'web-vitals';
const ua = new UAParser();
const headers = new Headers();
headers.append('Content-Type', 'application/json');
const parseUrl = (url) => new URL(url);
let driplaneServer = 'https://data.driplane.io';
let token;

@@ -17,6 +16,26 @@ export const setServer = (server) => {

export const setToken = (driplaneToken) => {
const token = window.btoa(`${driplaneToken}:`);
headers.set('Authorization', `Basic ${token}`);
token = window.btoa(`${driplaneToken}:`);
}
const webVitals: {
cls?: number,
fcp?: number,
fid?: number,
lcp?: number,
ttfb?: number,
inp?: number,
} = {};
const setVital = (name) => ({ delta }) => webVitals[name] = ~~delta;
onCLS(setVital('cls'));
onFCP(setVital('fcp'));
onFID(setVital('fid'));
onLCP(setVital('lcp'));
onTTFB(setVital('ttfb'));
onINP(setVital('inp'));
// const eventQueue: {event:string, body: string}[] = [];
const eventQueue = new Set<{event:string, body: Object}>();
export const trackEvent = async (event, tags = {}) => {

@@ -52,15 +71,49 @@ const { href: url, host: url_host, pathname: url_path, protocol: url_prot } = parseUrl(location.href);

ref_ext: url_host !== ref_host ? 1 : 0,
cid
cid,
};
return fetch(`${driplaneServer}/events/${event}`, {
method: 'POST',
headers,
body: JSON.stringify({
...commonTags,
...tags
})
});
const body = {
...commonTags,
...tags
};
eventQueue.add({ event, body });
}
export const trackPageview = async (tags = {}) => trackEvent('page_view', tags);
function flushQueue() {
if (eventQueue.size > 0) {
eventQueue.forEach(({ event, body }) => {
const endpoint = `${driplaneServer}/events/${event}`;
// add web vitals to the event
Object.assign(body, webVitals);
// TODO: use navigator.sendBeacon() once it's possible to set token as query param
const headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.set('Authorization', `Basic ${token}`);
fetch(endpoint, {
method: 'POST',
keepalive: true,
headers,
body: JSON.stringify(body),
});
});
eventQueue.clear();
}
}
// Report all available metrics whenever the page is backgrounded or unloaded.
addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') {
flushQueue();
}
});
// NOTE: Safari does not reliably fire the `visibilitychange` event when the
// page is being unloaded. As a workaround, we also listen for `pagehide`.
addEventListener('pagehide', flushQueue);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc