UNPKG

shopar-plugin

Version:

Plugin for the Web that seamlessly integrates into your webpage to create embedded virtual try-on and 3D preview capabilities.

2 lines 140 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ShopAR__DeepAR={})}(this,function(e){"use strict"; /*! For license information please see deepar.esm.js.LICENSE.txt */var t={795:function(e,t,r){var n;e=r.nmd(e),function(){var i={function:!0,object:!0},a=i[typeof window]&&window||this,o=i[typeof t]&&t,s=e&&!e.nodeType&&e,l=o&&s&&"object"==typeof r.g&&r.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(a=l);var c=Math.pow(2,53)-1,d=/\bOpera/,u=Object.prototype,f=u.hasOwnProperty,h=u.toString;function m(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function g(e){return e=y(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:m(e)}function p(e,t){for(var r in e)f.call(e,r)&&t(e[r],r,e)}function b(e){return null==e?m(e):h.call(e).slice(8,-1)}function v(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function w(e,t){var r=null;return function(e,t){var r=-1,n=e?e.length:0;if("number"==typeof n&&n>-1&&n<=c)for(;++r<n;)t(e[r],r);else p(e,t)}(e,function(n,i){r=t(r,n,i,e)}),r}function y(e){return String(e).replace(/^ +| +$/g,"")}var E=function e(t){var r=a,n=t&&"object"==typeof t&&"String"!=b(t);n&&(r=t,t=null);var i=r.navigator||{},o=i.userAgent||"";t||(t=o);var s,l,c,u,f=n?!!i.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(h.toString()),m="Object",E=n?m:"ScriptBridgingProxyObject",P=n?m:"Environment",k=n&&r.java?"JavaPackage":b(r.java),T=n?m:"RuntimeObject",x=/\bJava/.test(k)&&r.java,_=x&&b(r.environment)==P,S=x?"a":"α",j=x?"b":"β",A=r.document||{},F=r.operamini||r.opera,C=d.test(C=n&&F?F["[[Class]]"]:b(F))?C:F=null,O=t,M=[],R=null,I=t==o,L=I&&F&&"function"==typeof F.version&&F.version(),B=w([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],function(e,r){return e||RegExp("\\b"+(r.pattern||v(r))+"\\b","i").exec(t)&&(r.label||r)}),D=w(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"],function(e,r){return e||RegExp("\\b"+(r.pattern||v(r))+"\\b","i").exec(t)&&(r.label||r)}),W=G([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),U=w({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}},function(e,r,n){return e||(r[W]||r[/^[a-z]+(?: +[a-z]+\b)*/i.exec(W)]||RegExp("\\b"+v(n)+"(?:\\b|\\w*\\d)","i").exec(t))&&n}),$=w(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],function(e,r){var n=r.pattern||v(r);return!e&&(e=RegExp("\\b"+n+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(e=function(e,t,r){var n={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&r&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(n=n[/[\d.]+$/.exec(e)])&&(e="Windows "+n),e=String(e),t&&r&&(e=e.replace(RegExp(t,"i"),r)),g(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(e,n,r.label||r)),e});function G(e){return w(e,function(e,r){var n=r.pattern||v(r);return!e&&(e=RegExp("\\b"+n+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+n+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+n+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((e=String(r.label&&!RegExp(n,"i").test(r.label)?r.label:e).split("/"))[1]&&!/[\d.]+/.test(e[0])&&(e[0]+=" "+e[1]),r=r.label||r,e=g(e[0].replace(RegExp(n,"i"),r).replace(RegExp("; *(?:"+r+"[_-])?","i")," ").replace(RegExp("("+r+")[-_.]?(\\w)","i"),"$1 $2"))),e})}function N(e){return w(e,function(e,r){return e||(RegExp(r+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null})}if(B&&(B=[B]),/\bAndroid\b/.test($)&&!W&&(s=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(W=y(s[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),U&&!W?W=G([U]):U&&W&&(W=W.replace(RegExp("^("+v(U)+")[-_.\\s]","i"),U+" ").replace(RegExp("^("+v(U)+")[-_.]?(\\w)","i"),U+" $2")),(s=/\bGoogle TV\b/.exec(W))&&(W=s[0]),/\bSimulator\b/i.test(t)&&(W=(W?W+" ":"")+"Simulator"),"Opera Mini"==D&&/\bOPiOS\b/.test(t)&&M.push("running in Turbo/Uncompressed mode"),"IE"==D&&/\blike iPhone OS\b/.test(t)?(U=(s=e(t.replace(/like iPhone OS/,""))).manufacturer,W=s.product):/^iP/.test(W)?(D||(D="Safari"),$="iOS"+((s=/ OS ([\d_]+)/i.exec(t))?" "+s[1].replace(/_/g,"."):"")):"Konqueror"==D&&/^Linux\b/i.test($)?$="Kubuntu":U&&"Google"!=U&&(/Chrome/.test(D)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(W))||/\bAndroid\b/.test($)&&/^Chrome/.test(D)&&/\bVersion\//i.test(t)?(D="Android Browser",$=/\bAndroid\b/.test($)?$:"Android"):"Silk"==D?(/\bMobi/i.test(t)||($="Android",M.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&M.unshift("accelerated")):"UC Browser"==D&&/\bUCWEB\b/.test(t)?M.push("speed mode"):"PaleMoon"==D&&(s=/\bFirefox\/([\d.]+)\b/.exec(t))?M.push("identifying as Firefox "+s[1]):"Firefox"==D&&(s=/\b(Mobile|Tablet|TV)\b/i.exec(t))?($||($="Firefox OS"),W||(W=s[1])):!D||(s=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(D))?(D&&!W&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(s+"/")+8))&&(D=null),(s=W||U||$)&&(W||U||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test($))&&(D=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test($)?$:s)+" Browser")):"Electron"==D&&(s=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&M.push("Chromium "+s),L||(L=N(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",v(D),"(?:Firefox|Minefield|NetFront)"])),(s=("iCab"==B&&parseFloat(L)>3?"WebKit":/\bOpera\b/.test(D)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(B)&&"WebKit"||!B&&/\bMSIE\b/i.test(t)&&("Mac OS"==$?"Tasman":"Trident")||"WebKit"==B&&/\bPlayStation\b(?! Vita\b)/i.test(D)&&"NetFront")&&(B=[s]),"IE"==D&&(s=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(D+=" Mobile",$="Windows Phone "+(/\+$/.test(s)?s:s+".x"),M.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(D="IE Mobile",$="Windows Phone 8.x",M.unshift("desktop mode"),L||(L=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=D&&"Trident"==B&&(s=/\brv:([\d.]+)/.exec(t))&&(D&&M.push("identifying as "+D+(L?" "+L:"")),D="IE",L=s[1]),I){if(u=null!=(c=r)?typeof c.global:"number",/^(?:boolean|number|string|undefined)$/.test(u)||"object"==u&&!c.global)b(s=r.runtime)==E?(D="Adobe AIR",$=s.flash.system.Capabilities.os):b(s=r.phantom)==T?(D="PhantomJS",L=(s=s.version||null)&&s.major+"."+s.minor+"."+s.patch):"number"==typeof A.documentMode&&(s=/\bTrident\/(\d+)/i.exec(t))?(L=[L,A.documentMode],(s=+s[1]+4)!=L[1]&&(M.push("IE "+L[1]+" mode"),B&&(B[1]=""),L[1]=s),L="IE"==D?String(L[1].toFixed(1)):L[0]):"number"==typeof A.documentMode&&/^(?:Chrome|Firefox)\b/.test(D)&&(M.push("masking as "+D+" "+L),D="IE",L="11.0",B=["Trident"],$="Windows");else if(x&&(O=(s=x.lang.System).getProperty("os.arch"),$=$||s.getProperty("os.name")+" "+s.getProperty("os.version")),_){try{L=r.require("ringo/engine").version.join("."),D="RingoJS"}catch(e){(s=r.system)&&s.global.system==r.system&&(D="Narwhal",$||($=s[0].os||null))}D||(D="Rhino")}else"object"==typeof r.process&&!r.process.browser&&(s=r.process)&&("object"==typeof s.versions&&("string"==typeof s.versions.electron?(M.push("Node "+s.versions.node),D="Electron",L=s.versions.electron):"string"==typeof s.versions.nw&&(M.push("Chromium "+L,"Node "+s.versions.node),D="NW.js",L=s.versions.nw)),D||(D="Node.js",O=s.arch,$=s.platform,L=(L=/[\d.]+/.exec(s.version))?L[0]:null));$=$&&g($)}if(L&&(s=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(L)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(I&&i.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(R=/b/i.test(s)?"beta":"alpha",L=L.replace(RegExp(s+"\\+?$"),"")+("beta"==R?j:S)+(/\d+\+?/.exec(s)||"")),"Fennec"==D||"Firefox"==D&&/\b(?:Android|Firefox OS|KaiOS)\b/.test($))D="Firefox Mobile";else if("Maxthon"==D&&L)L=L.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(W))"Xbox 360"==W&&($=null),"Xbox 360"==W&&/\bIEMobile\b/.test(t)&&M.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(D)&&(!D||W||/Browser|Mobi/.test(D))||"Windows CE"!=$&&!/Mobi/i.test(t))if("IE"==D&&I)try{null===r.external&&M.unshift("platform preview")}catch(e){M.unshift("embedded")}else(/\bBlackBerry\b/.test(W)||/\bBB10\b/.test(t))&&(s=(RegExp(W.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||L)?($=((s=[s,/BB10/.test(t)])[1]?(W=null,U="BlackBerry"):"Device Software")+" "+s[0],L=null):this!=p&&"Wii"!=W&&(I&&F||/Opera/.test(D)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==D&&/\bOS X (?:\d+\.){2,}/.test($)||"IE"==D&&($&&!/^Win/.test($)&&L>5.5||/\bWindows XP\b/.test($)&&L>8||8==L&&!/\bTrident\b/.test(t)))&&!d.test(s=e.call(p,t.replace(d,"")+";"))&&s.name&&(s="ing as "+s.name+((s=s.version)?" "+s:""),d.test(D)?(/\bIE\b/.test(s)&&"Mac OS"==$&&($=null),s="identify"+s):(s="mask"+s,D=C?g(C.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(s)&&($=null),I||(L=null)),B=["Presto"],M.push(s));else D+=" Mobile";(s=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(s=[parseFloat(s.replace(/\.(\d)$/,".0$1")),s],"Safari"==D&&"+"==s[1].slice(-1)?(D="WebKit Nightly",R="alpha",L=s[1].slice(0,-1)):L!=s[1]&&L!=(s[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(L=null),s[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==s[0]&&537.36==s[2]&&parseFloat(s[1])>=28&&"WebKit"==B&&(B=["Blink"]),I&&(f||s[1])?(B&&(B[1]="like Chrome"),s=s[1]||((s=s[0])<530?1:s<532?2:s<532.05?3:s<533?4:s<534.03?5:s<534.07?6:s<534.1?7:s<534.13?8:s<534.16?9:s<534.24?10:s<534.3?11:s<535.01?12:s<535.02?"13+":s<535.07?15:s<535.11?16:s<535.19?17:s<536.05?18:s<536.1?19:s<537.01?20:s<537.11?"21+":s<537.13?23:s<537.18?24:s<537.24?25:s<537.36?26:"Blink"!=B?"27":"28")):(B&&(B[1]="like Safari"),s=(s=s[0])<400?1:s<500?2:s<526?3:s<533?4:s<534?"4+":s<535?5:s<537?6:s<538?7:s<601?8:s<602?9:s<604?10:s<606?11:s<608?12:"12"),B&&(B[1]+=" "+(s+="number"==typeof s?".x":/[.+]/.test(s)?"":"+")),"Safari"==D&&(!L||parseInt(L)>45)?L=s:"Chrome"==D&&/\bHeadlessChrome/i.test(t)&&M.unshift("headless")),"Opera"==D&&(s=/\bzbov|zvav$/.exec($))?(D+=" ",M.unshift("desktop mode"),"zvav"==s?(D+="Mini",L=null):D+="Mobile",$=$.replace(RegExp(" *"+s+"$"),"")):"Safari"==D&&/\bChrome\b/.exec(B&&B[1])?(M.unshift("desktop mode"),D="Chrome Mobile",L=null,/\bOS X\b/.test($)?(U="Apple",$="iOS 4.3+"):$=null):/\bSRWare Iron\b/.test(D)&&!L&&(L=N("Chrome")),L&&0==L.indexOf(s=/[\d.]+$/.exec($))&&t.indexOf("/"+s+"-")>-1&&($=y($.replace(s,""))),$&&-1!=$.indexOf(D)&&!RegExp(D+" OS").test($)&&($=$.replace(RegExp(" *"+v(D)+" *"),"")),B&&!/\b(?:Avant|Nook)\b/.test(D)&&(/Browser|Lunascape|Maxthon/.test(D)||"Safari"!=D&&/^iOS/.test($)&&/\bSafari\b/.test(B[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(D)&&B[1])&&(s=B[B.length-1])&&M.push(s),M.length&&(M=["("+M.join("; ")+")"]),U&&W&&W.indexOf(U)<0&&M.push("on "+U),W&&M.push((/^on /.test(M[M.length-1])?"":"on ")+W),$&&(s=/ ([\d.+]+)$/.exec($),l=s&&"/"==$.charAt($.length-s[0].length-1),$={architecture:32,family:s&&!l?$.replace(s[0],""):$,version:s?s[1]:null,toString:function(){var e=this.version;return this.family+(e&&!l?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(s=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(O))&&!/\bi686\b/i.test(O)?($&&($.architecture=64,$.family=$.family.replace(RegExp(" *"+s),"")),D&&(/\bWOW64\b/i.test(t)||I&&/\w(?:86|32)$/.test(i.cpuClass||i.platform)&&!/\bWin64; x64\b/i.test(t))&&M.unshift("32-bit")):$&&/^OS X/.test($.family)&&"Chrome"==D&&parseFloat(L)>=39&&($.architecture=64),t||(t=null);var V={};return V.description=t,V.layout=B&&B[0],V.manufacturer=U,V.name=D,V.prerelease=R,V.product=W,V.ua=t,V.version=D&&L,V.os=$||{architecture:null,family:null,version:null,toString:function(){return"null"}},V.parse=e,V.toString=function(){return this.description||""},V.version&&M.unshift(L),V.name&&M.unshift(D),$&&D&&($!=String($).split(" ")[0]||$!=D.split(" ")[0]&&!W)&&M.push(W?"("+$+")":"on "+$),M.length&&(V.description=M.join(" ")),V}();a.platform=E,void 0===(n=function(){return E}.call(t,r,t,e))||(e.exports=n)}.call(this)}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};(()=>{n.d(i,{Gv:()=>Y,R0:()=>e,j2:()=>q,i8:()=>t});var e={};n.r(e),n.d(e,{CameraPermissionDeniedError:()=>d,NoCameraError:()=>c,SwitchEffectCanceled:()=>l});const t="5.6.22-shopar-alpha-414";var r,a=(r="undefined"!=typeof document?document.currentScript?.src:void 0,function(e={}){var t,n,i=e,a=new Promise((e,r)=>{t=e,n=r});let o=null;const s=[];i.addPreRenderListener=function(e){s.push(e)},i.addPostRenderListener=function(e){s.push(e)},i.removePreRenderListener=function(e){0<=(e=s.indexOf(e))&&s.splice(e,1)},i.removePostRenderListener=function(e){0<=(e=s.indexOf(e))&&s.splice(e,1)};var l=null,c=null,d=null;const u=new ImageData(640,360);u.Hj=!0;let f,h,m,g,p,b,v,w,y,E,P,k,T,x,_,S,j,A,F=!1,C=null,O=null,M=null,R=null,I=null,L=null,B=null,D=null,W=null;i.Li=[null];let U=0;function $(e){const t=i.Li.length;return i.Li[t]=e,t}i.preinitializedWebGLContext=i.canvas.getContext("webgl2",{alpha:!1,antialias:!0,powerPreference:"high-performance"}),i.process=function(){};let G=new class{get gj(){switch(this.type){case"Timer":return this.fj;case"RAF":return this.ej;case"Oscillator":return this.dj}}constructor(){this.dj=this.ej=this.fj=!1,this.type="RAF",this.jj=1e3/63}add(e){this.Ui=e}start(){switch(this.type){case"Timer":if(!this.fj){this.fj=!0;const e=()=>{setTimeout(()=>{this.Ui&&this.Ui(),this.fj&&e()},this.jj)};e()}break;case"RAF":if(!this.ej){this.ej=!0;const e=t=>{requestAnimationFrame(r=>{r-t<=this.jj?this.ej&&e(t):this.Ui&&(this.Ui(),e(r))})};e(-this.jj-10)}break;case"Oscillator":if(!this.dj){o=o||new AudioContext,this.dj=!0;const e=o.createGain();let t;e.gain.value=0,e.connect(o.destination);const r=()=>{this.Ui&&this.Ui(),t&&t.disconnect(),this.vj=t=o.createOscillator(),t.connect(e),this.dj&&(t.onended=r,t.start(),t.stop(o.currentTime+this.jj/1e3))};r()}}}stop(){switch(this.type){case"Timer":this.fj=!1;break;case"RAF":this.ej=!1;break;case"Oscillator":this.dj=!1,this.vj&&(this.vj.onended=null,this.vj=void 0)}}};function N(){for(var e of s)e();e=i.canvas.width;const t=i.canvas.height;i.canvasWidth===e&&i.canvasHeight===t||(i.canvasWidth=e,i.canvasHeight=t,Go(e,t)),i._render();for(const e of s)e();i.apiObject.__deeparRendered&&i.apiObject.__deeparRendered(wa),i.apiObject.__deeparRendered2&&i.apiObject.__deeparRendered2(wa)}function V(){var e=!1,t=i.Li[0];if(t&&t.readyState===t.HAVE_ENOUGH_DATA)(function(){const e=Sa;if(!xa||!Oa||!Fa)return!0;switch(e.clientWaitSync(Fa,0,0)){case e.TIMEOUT_EXPIRED:case e.WAIT_FAILED:return!1;case e.CONDITION_SATISFIED:case e.ALREADY_SIGNALED:return!0}})()&&(i._processFrameVideo(0,H,U),e=F=!0);else if(!F||0<Object.entries(X).length||null!=J||null!=K){if(e=f||u,!(t=i._malloc(e.data.length)))return;he.set(e.data,t),i._processFrameRawPixels(t,e.width,e.height,e.Hj),F=!0,i._free(t),e=!0}e&&N()}function z(){V()}i.setFps=function(e){G.jj=1e3/e},G.add(z),i.startLoop=function(){G.add(z),G.start()},i.endLoop=function(){G.Ui=void 0,G.stop()},i.setVideoRotation=function(e){if(0!==e&&90!==e&&180!==e&&270!==e)throw Error(`Called setVideoRotation with ${e}. Valid values are: 0, 90, 180 and 270.`);U=e},i.processFrameRawPixels=function(e,t,r,n){var a=i._malloc(e.length);a&&(he.set(e,a),i._processFrameRawPixels(a,t,r,n),f=new ImageData(new Uint8ClampedArray(e),t,r),f.Hj=n,F=!0,G.gj||N(),i._free(a))},i.isFootTrackingInitialized=function(){return Ya},i.isFaceTrackingInitialized=function(){return Da},i.isWristTrackingInitialized=function(){return go},i.setReadPixelsAsync=function(e){Oa=e};let X={},J=null,K=null;i.switchEffectByteArray=function(e,t,r,n,a,o,s,l){if(!C)throw Error("Error in internal API: __switchEffect is null!");const c=i._malloc(r.length);if(!c)throw Error("Cannot allocate buffer for switch effect.");he.set(r,c);const d=n.length?i._malloc(n.length):0;if(n.length){if(!d)throw Error("Cannot allocate buffer for environement map.");he.set(n,d)}const u=a.length?i._malloc(a.length):0;if(a.length){if(!u)throw Error("Cannot allocate buffer for environement map.");he.set(a,u)}if(t in X)s(new i.customErrors.SwitchEffectCanceled(`Cannot switch effect on slot ${t} because switch effect already in progress on the same slot.`));else{X[t]={Ti:o,error:s,Ij:l};try{C(t,c,r.length,e,d,n.length,u,a.length),F=!1,G.gj||V()}catch(e){throw delete X[t],e}}},i.hasVar=function(e,t){return h(e,t)},i.getVarType=function(e,t){if(m(e,t))return w(e,t);throw Error("Variable named '"+e+"' does not exist.")},i.getBoolVar=function(e,t){if(g(e,t))return y(e,t);throw Error("Variable named '"+e+"' does not exist or is not a boolean.")},i.getIntVar=function(e,t){if(p(e,t))return E(e,t);throw Error("Variable named '"+e+"' does not exist or is not an integer.")},i.getDoubleVar=function(e,t){if(b(e,t))return P(e,t);throw Error("Variable named '"+e+"' does not exist or is not a double.")},i.getStringVar=function(e,t){if(v(e,t))return k(e,t);throw Error("Variable named '"+e+"' does not exist or is not a string.")},i.setBoolVar=function(e,t,r){return T(e,t,r)},i.setIntVar=function(e,t,r){return x(e,t,r)},i.setDoubleVar=function(e,t,r){return _(e,t,r)},i.setStringVar=function(e,t,r){return S(e,t,r)},i.deleteVar=function(e,t){return j(e,t)},i.clearVars=function(e){return A(e)},i.clearEffect=function(e){X[e]&&X[e].error&&(X[e].error(new i.customErrors.SwitchEffectCanceled(`Switch effect canceled by the call to clearEffect() on the same slot: ${e}.`)),delete X[e]),O&&(O(e),G.gj||V())},i.moveGameObject=function(e,t){M&&(M(e,t),G.gj||V())};let H=!0;i.setMirror=function(e){H=!!e};let q=!1;function Y(e){const t=[35,63,82,65,68,73,65,78,67,69,10];if(!e||e.length<t.length)return!1;for(let r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}i.startCamera=function(e,t,r,n,a,o){i.stopVideo(),H=!!e;let s=document.createElement("video");s.setAttribute("playsinline","playsinline"),i.Li[0]=s,t=t||{video:!0},a&&a(),navigator.mediaDevices.getUserMedia(t).then(function(e){o&&o(),s.srcObject=e,s.onloadedmetadata=()=>{s.play().then(()=>{r&&r(),s.onloadedmetadata=null})},q=!0}).catch(e=>{n&&n(e),console.error(`${e.name}: ${e.message}`)})},i.shutdown=function(){Q={},i.stopVideo(),null!=l&&l.shutdownTfjs(),s.length=0;try{$o()}catch(e){console.error(e)}finally{i.ck()}},i.setVideoElement=function(e,t){i.stopVideo(),H=!!t,i.Li[0]=e},i.stopVideo=function(){i.Li[0]&&(q&&(i.Li[0]&&i.Li[0].srcObject&&(i.Li[0].srcObject.getTracks().forEach(e=>{e.stop()}),i.Li[0].srcObject=null),q=!1),i.Li[0]=null)},i.getVideoElement=function(){return i.Li[0]},i.setOffscreenRenderingEnabled=function(e){!function(e){var t=G;if(t.type!==e){var r=t.fj|t.dj|t.ej;t.stop(),t.type=e,r&&t.start()}}(e?"Oscillator":"RAF")},i.backgroundReplacement=async function(e,t,r,n,i){if(e){K&&K.error&&K.error(""),K={Ti:n,error:i},t=await(await fetch(t,{mode:r})).blob();var a=new Image;a.onload=()=>{const t=document.createElement("canvas");var r=t.getContext("2d",{willReadFrequently:!0});t.width=a.width,t.height=a.height,r.drawImage(a,0,0),r=r.getImageData(0,0,t.width,t.height),r=new Uint8Array(r.data.buffer);const n=Xo(r.length);he.set(r,n),URL.revokeObjectURL(a.src);try{I(e,n,r.length,t.width,t.height),F=!1,G.gj||V()}catch(e){throw K=null,e}},a.src=URL.createObjectURL(t)}else I(!1,null,0,0,0),n()},i.backgroundBlur=function(e,t,r,n){if(e){J&&J.error&&J.error(""),J={Ti:r,error:n};try{R(e,t),F=!1,G.gj||V()}catch(e){throw J=null,e}}else R(!1,0),r()},i.getClosestPointOnMesh=function(e,t){if(!(e=L(e,t[0],t[1],t[2])))return null;t=new Float32Array(3);for(let r=0;3>r;++r)t[r]=i.HEAPF32[e/Float32Array.BYTES_PER_ELEMENT+r];return i._free(e),t},i.getTransformationBetween=function(e,t){if(!(e=B(e,t)))return null;t=new Float32Array(16);for(let r=0;16>r;++r)t[r]=i.HEAPF32[e/Float32Array.BYTES_PER_ELEMENT+r];return i._free(e),t},i.setEnvironmentMap=async function(e){if(Y(e)){var t=i._malloc(e.length);if(!t)throw Error("Cannot allocate buffer for environement map.");he.set(e,t),D(t,e.length)}else{const[t,r,n]=await La(e);No(t,r,n)}},i.setDiamondEnvironmentMap=async function(e){if(Y(e)){var t=i._malloc(e.length);if(!t)throw Error("Cannot allocate buffer for environement map.");he.set(e,t),W(t,e.length)}else{const[t,r,n]=await La(e);zo(t,r,n)}},i.Uj=function(e,t,r,n){if(i.apiObject.onFaceTracked){var a=[];for(let d=0;d<n;d++){let n={detected:!1,translation:[],rotation:[],poseMatrix:[],landmarks:[],landmarks2d:[],faceRect:[]};var o=t+d*r,s=o+e.translationOffset;let u=o+e.rotationOffset;var l=o+e.poseMatrixOffset,c=o+e.landmarksOffset;let f=o+e.landmarks2DOffset,h=o+e.faceRectOffset;for(n.detected=!!(255&i.HEAP32[o/Float32Array.BYTES_PER_ELEMENT]),o=0;3>o;o++)n.translation.push(i.HEAPF32[s/Float32Array.BYTES_PER_ELEMENT+o]),n.rotation.push(i.HEAPF32[u/Float32Array.BYTES_PER_ELEMENT+o]);for(s=0;16>s;s++)n.poseMatrix.push(i.HEAPF32[l/Float32Array.BYTES_PER_ELEMENT+s]);for(l=0;204>l;l++)n.landmarks.push(i.HEAPF32[c/Float32Array.BYTES_PER_ELEMENT+l]),136>l&&n.landmarks2d.push(i.HEAPF32[f/Float32Array.BYTES_PER_ELEMENT+l]);for(c=0;4>c;c++)n.faceRect.push(i.HEAPF32[h/Float32Array.BYTES_PER_ELEMENT+c]);a.push(n)}i.apiObject.onFaceTracked(a)}},i.Bk=function(){i.apiObject.onVideoStarted&&i.apiObject.onVideoStarted()},i.Zj=function(){i.apiObject.onInitialize&&i.apiObject.onInitialize()},i.Wj=function(e){i.apiObject.onFaceVisibilityChanged&&i.apiObject.onFaceVisibilityChanged(e)},i.Yj=function(e){i.apiObject.onImageVisibilityChanged&&i.apiObject.onImageVisibilityChanged(e)},i.Ak=function(){i.apiObject.onCameraPermissionGranted&&i.apiObject.onCameraPermissionGranted()},i.zk=function(){i.apiObject.onCameraPermissionDenied&&i.apiObject.onCameraPermissionDenied()},i.yk=function(){i.apiObject.onCameraPermissionAsked&&i.apiObject.onCameraPermissionAsked()},i.ak=function(e,t,r){const n=document.createElement("canvas"),i=n.getContext("2d");n.width=t,n.height=r;const a=i.getImageData(0,0,n.width,n.height),o=a.data;for(let n=0;n<r;n++)for(let i=0;i<t;i++){const a=4*((r-n-1)*t+i),s=4*(n*t+i);o[s]=he[e+a+2],o[s+1]=he[e+a+1],o[s+2]=he[e+a+0],o[s+3]=he[e+a+3]}i.putImageData(a,0,0),console.error("DeepAR screenshot taken but no registered callback.")},i.Oj=function(e){i.apiObject.onAnimationTransitionedToState&&i.apiObject.onAnimationTransitionedToState(e)},i.Tj=function(e,t){"Error"===e?console.error(t):"Debug"===e?console.debug(t):"Info"===e?console.info(t):"Warning"===e?console.warn(t):console.log(t)},i.Sj=function(e){X[e]&&X[e].Ti&&X[e].Ti(),delete X[e]},i.Qj=function(){K&&K.Ti&&K.Ti(),K={}},i.Pj=function(){J&&J.Ti&&J.Ti(),J={}},i.$j=function(e){i.apiObject.onNumberOfFacesVisibleChanged&&i.apiObject.onNumberOfFacesVisibleChanged(e)},i.ck=function(){i.apiObject.onShutdown&&i.apiObject.onShutdown()},i.Vj=function(e,t,r){i.apiObject.onFaceTrackingInitialized&&i.apiObject.onFaceTrackingInitialized(e,t,r)},i.Cj=function(e,t,r,n){i.apiObject.onFootTrackingInitialized&&i.apiObject.onFootTrackingInitialized(e,t,r,n)},i.bk=function(){i.apiObject.onSegmentationInitialized&&i.apiObject.onSegmentationInitialized()},i.Xj=function(e,t){i.apiObject.onFeetTracked&&i.apiObject.onFeetTracked(e,t),i.leftFootData=e,i.rightFootData=t},i._getFootData=function(){return i.leftFootData&&i.rightFootData?{left:i.leftFootData,right:i.rightFootData}:null},i.Dj=function(e,t,r,n){i.apiObject.onWristTrackingInitialized&&i.apiObject.onWristTrackingInitialized(e,t,r,n)},i.dk=function(e){i.apiObject.onWristTracked&&i.apiObject.onWristTracked(e)},i.Rj=function(e,t){for(let r of Object.values(X))r.Ij&&r.Ij({loaded:e,total:t})},i._useExternalTrackingData=function(e){i.useExternalTrackingData=e},i._setExternalTrackingDataFoot=function(e,t){i.externalTrackingDataFoot={left:e,right:t}},i.noInitialRun=!0,i.initializeDeepAR=async function(){c=i.platform,d=i.draco_decoder;const e=i.initializeML&&i.initializeML.faceInit;var t=va();t=180/Math.PI*Math.atan(Math.tan(Math.PI/180*t/2)/(640/360))*2,e&&Ja(t,640,360),i.initializeML&&(i.initializeML.footInit&&co(t,0,640,360),i.initializeML.wristInit&&_o(t,0,640,360)),C=jo("switchEffect",null,"string number number number number number".split(" ")),O=jo("clearEffect",null,["string"]),M=jo("moveGameObject",null,["string","string"]),R=jo("backgroundBlur",null,["boolean","number"]),I=jo("backgroundReplacement",null,["boolean","number","number","number","number"]),L=jo("getClosestPointOnMesh",null,["string","number","number","number"]),B=jo("getTransformationBetween",null,["string","string"]),D=jo("setEnvironmentMap",null,["number","number"]),W=jo("setDiamondEnvironmentMap",null,["number","number"]),h=jo("hasVar","boolean",["string","string"]),m=jo("getVarTypeStatus","boolean",["string","string"]),g=jo("getBoolVarStatus","boolean",["string","string"]),p=jo("getIntVarStatus","boolean",["string","string"]),b=jo("getDoubleVarStatus","boolean",["string","string"]),v=jo("getStringVarStatus","boolean",["string","string"]),w=jo("getVarType","int",["string","string"]),y=jo("getBoolVar","boolean",["string","string"]),E=jo("getIntVar","int",["string","string"]),P=jo("getDoubleVar","number",["string","string"]),k=jo("getStringVar","string",["string","string"]),T=jo("setBoolVar","boolean",["string","boolean","string"]),x=jo("setIntVar","boolean",["string","int","string"]),_=jo("setDoubleVar","boolean",["string","number","string"]),S=jo("setStringVar","boolean",["string","string","string"]),j=jo("deleteVar","boolean",["string","string"]),A=jo("clearVars","boolean",["string"]),i.pushConsoleLog=jo("pushConsoleLog","boolean",["string","int"]),i.changeParameterFloat=jo("changeParameterFloat",null,["string","string","string","number"]),i.changeParameterVector=jo("changeParameterVector",null,"string string string number number number number".split(" ")),i.changeParameterBool=jo("changeParameterBool",null,["string","string","string","boolean"]),i.changeParameterTexture=jo("changeParameterTexture",null,"string string string number number number number".split(" ")),i.fireTrigger=jo("fireTrigger",null,["string"]),i.setFaceDetectionSensitivity=jo("setFaceDetectionSensitivity",null,["number"]),i.showStats=jo("showStats",null,["number"]),i.simulatePhysics=jo("simulatePhysics",null,["number"]),i.showColliders=jo("showColliders",null,["number"]),i.setLicenseKey=jo("setLicenseKey",null,["string"]),i.muteSound=jo("muteSound",null,["boolean"]),i.setExposure=jo("setExposure",null,["number"]),i.setEnvironmentMapIntensity=jo("setEnvironmentMapIntensity",null,["number"]),i.setToneMapping=jo("setToneMapping",null,["number"]),i.resetEnvironmentMap=jo("resetEnvironmentMap",null,[]),i.resetToneMapping=jo("resetToneMapping",null,[]),i.resetEnvironmentMapIntensity=jo("resetEnvironmentMapIntensity",null,[]),i.resetExposure=jo("resetExposure",null,[]),i.setBloomEnabled=jo("setBloomEnabled",null,["boolean"]),i.setBloomThreshold=jo("setBloomThreshold",null,["number"]),i.setBloomStrength=jo("setBloomStrength",null,["number"]),i.setBloomRadius=jo("setBloomRadius",null,["number"]),i.split_sum=await createImageBitmap(new Blob([await i.split_sum]),{premultiplyAlpha:"none",colorSpaceConversion:"none"}),i.initialize(i.canvasWidth,i.canvasHeight,!0,!1,e,!0,!0,!1,i.onVerify)};let Q={};function Z(e,t,r){Q[e]={path:t,cj:!1,data:null,bj:!1,Yi:[],Fj:r,Kj:function(r){if(r&&this.Yi.push(r),this.data)this.Yi.forEach(e=>{e.Ti(this.data)}),0!==this.Yi.length&&(this.data=null,this.bj=this.cj=!1,this.Yi=[]);else if(!this.cj){this.bj&&this.Yi.forEach(e=>{e.error()}),this.path||(console.error(`The ${e} model was requested but the path to it is not defined.`),this.bj=!0,this.Yi.forEach(e=>{e.error()})),this.cj=!0;var n=r=>{this.data=r,this.cj=!1,this.bj=!0,async function(e){return e=await crypto.subtle.digest("SHA-256",e),Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}(r).then(r=>{this.Fj.some(e=>e===r)||console.error(`The loaded ${e} model (${t}) does not pass the validity check. DeepAR may not function as expected or it might crash. Expected digests: ${this.Fj} but got this digest ${r}.`)}),this.Yi.forEach(e=>{e.Ti(r)})},a=t=>{console.error(t),console.error(`Error downloading the ${e} model (${this.path}), could not resolve the array buffer`),this.Yi.forEach(e=>{e.error()})};null!=i.globalProgress&&i.globalProgress.isUrlTracked(t)?i.globalProgress.getFilePromises(t).then(e=>{n(e)}).catch(()=>{a()}):fetch(this.path).then(t=>{t.ok?t.arrayBuffer().then(e=>{n(e)}).catch(e=>{a(e)}):(this.cj=!1,this.bj=!0,console.error(`Error downloading the ${e} model (${this.path}), response status = ${t.status}. Effects using ${e} will not work properly or at all.`),this.Yi.forEach(e=>{e.error()}))})}},kk:function(){return this.data?this.data:this.bj||this.cj?null:void this.Kj()},Gj:function(){this.data=null,this.bj=this.cj=!1},pj:async function(){return new Promise((e,t)=>{this.Kj({Ti:e,error:t})})}}}function ee(e,t){Z(`${e}-tfjsBackendWasmPath`,t.tfjsBackendWasmPath,["fe0951aee7c0feb369aa12a65a24b871da9386fb55b40b918c2a59b24e09be83"]),Z(`${e}-tfjsBackendWasmSimdPath`,t.tfjsBackendWasmSimdPath,["3402e2b8668afb320151b4aae8080ad2136875f424aa95c95e3a4bc87d09097e"]),Z(`${e}-tfjsBackendWasmThreadedPath`,t.tfjsBackendWasmThreadedPath,["118f499abf412a285905483c91db693296c0b112cfaab04128bf54f61c141ce9"])}function te(e){if(!Q[e])throw Error(`No ML model with name ${e}.`);return Q[e].kk()}function re(e){if(!Q[e])throw Error(`No ML model with name ${e}.`);return Q[e].pj()}async function ne(e){const t={tfjsBackendWasmPath:"",tfjsBackendWasmSimdPath:"",tfjsBackendWasmThreadedPath:""};return i.WASM_HAS_SIMD_SUPPORT&&i.WASM_HAS_MULTITHREAD_SUPPORT?t.tfjsBackendWasmThreadedPath=await Q[`${e}-tfjsBackendWasmThreadedPath`].pj():i.WASM_HAS_SIMD_SUPPORT?t.tfjsBackendWasmSimdPath=await Q[`${e}-tfjsBackendWasmSimdPath`].pj():t.tfjsBackendWasmPath=await Q[`${e}-tfjsBackendWasmPath`].pj(),t}Z("rigidFaceDetector",i.rigidFaceTrackingConfig.detectorPath,["8270514ae788bc6ee67db086c9400581d17a78c18de38c878f1148dcc3a8e480"]),Z("rigidFaceTracker",i.rigidFaceTrackingConfig.trackerPath,["9ab8c04aa4294ff23c66798a4a442fd9dbef4a8f61ea6e1530e51445846b5605"]),Z("rigidFacePEW",i.rigidFaceTrackingConfig.poseEstimationWasmPath,["55e668327885970371152a98d6612f8f50579996f046479db5b943c00199494d"]),ee("rigidFaceDetector",i.rigidFaceTrackingConfig),Z("footDetector",i.footTrackingConfig.detectorPath,["6d0f65c977509cf5d93f65a3b26539ab29ec540322476f0b7adac9ee289db4bd"]),Z("footTracker",i.footTrackingConfig.trackerPath,["297c230e346d4e9e7ac1f78e9e87f4e85754338547061501eee2542e334ca7be","c72af568553b85b1f20d61fd07ba5db46a0db2b5261472099310bbc51afa967f","e5180848c0d88fe6ab483b22a4490e9db80408d2887cd165cecd5e7f2efd8555"]),Z("footObj",i.footTrackingConfig.objPath,["3b903682a513f5d96cabb8135ead157240141f0f0d5c833a77e7de91a87a2bca"]),Z("footPEW",i.footTrackingConfig.poseEstimationWasmPath,["55e668327885970371152a98d6612f8f50579996f046479db5b943c00199494d"]),ee("footDetector",i.footTrackingConfig),Z("wristDetector",i.wristTrackingConfig.detectorPath,["b4c14a6f4b7bed1bc1cb313bbad5e877c7958c25b8e47d12583404f9a611d7ff"]),Z("wristTracker",i.wristTrackingConfig.trackerPath,["8bbbc4398f33db43ef32f1615d6d11322e8dc5d1f800cb8da4a0580d6267dba0","cbb7a12bd06b28a809c914700c8cd64530a9d08d4d82f6d9c758dfc022264a6d"]),Z("wristObj",i.wristTrackingConfig.objPath,["5c763303cac33e377bbfbc3bd13475c0b99ca6412f9774ecc7a65fe72ac01732"]),Z("wristPEW",i.wristTrackingConfig.poseEstimationWasmPath,["55e668327885970371152a98d6612f8f50579996f046479db5b943c00199494d"]),ee("wristDetector",i.wristTrackingConfig),Z("default_envmap.webp",i.defaultEnvmapPath,["f822e455a5d5a3c1d5c91d9c22d3d1b511f645062fa2e4c8755d698af02b9b80"]);var ie,ae=Object.assign({},i),oe="";"undefined"!=typeof document&&document.currentScript&&(oe=document.currentScript.src),r&&(oe=r),oe=oe.startsWith("blob:")?"":oe.substr(0,oe.replace(/[?#].*/,"").lastIndexOf("/")+1),ie=e=>fetch(e,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(Error(e.status+" : "+e.url)));var se,le=console.log.bind(console),ce=console.error.bind(console);Object.assign(i,ae),ae=null,i.wasmBinary&&(se=i.wasmBinary);var de,ue,fe,he,me,ge,pe,be,ve,we,ye=!1;function Ee(){var e=de.buffer;i.HEAP8=fe=new Int8Array(e),i.HEAP16=me=new Int16Array(e),i.HEAPU8=he=new Uint8Array(e),i.HEAPU16=ge=new Uint16Array(e),i.HEAP32=pe=new Int32Array(e),i.HEAPU32=be=new Uint32Array(e),i.HEAPF32=ve=new Float32Array(e),i.HEAPF64=we=new Float64Array(e)}var Pe=[],ke=[],Te=[],xe=[],_e=!1,Se=!1,je=0,Ae=null;function Fe(e){throw i.onAbort?.(e),ce(e="Aborted("+e+")"),ye=!0,ue=1,e+=". Build with -sASSERTIONS for more info.",_e&&Zo(),e=new WebAssembly.RuntimeError(e),n(e),e}var Ce,Oe=e=>e.startsWith("data:application/octet-stream;base64,");function Me(e){if(e==Ce&&se)return new Uint8Array(se);throw"both async and sync fetching of the wasm failed"}function Re(e,t,r){return function(e){return se?Promise.resolve().then(()=>Me(e)):ie(e).then(e=>new Uint8Array(e),()=>Me(e))}(e).then(e=>WebAssembly.instantiate(e,t)).then(r,e=>{ce(`failed to asynchronously prepare wasm: ${e}`),Fe(e)})}var Ie={96932:(e,t,r,n,i,a)=>{var o=document.createElement("canvas"),s=o.getContext("2d");o.width=t,o.height=r,e=new Uint8ClampedArray(he.subarray(e,e+o.width*o.height*4)),e=new ImageData(e,o.width,o.height),s.putImageData(e,0,0),e=(s=document.createElement("canvas")).getContext("2d"),s.width=i,s.height=a,e.drawImage(o,0,0,s.width,s.height),i=e.getImageData(0,0,s.width,s.height),i=new Uint8Array(i.data.buffer),he.set(i,n)},97786:(e,t,r,n,i,a)=>{var o=document.createElement("canvas"),s=o.getContext("2d");o.width=t,o.height=r,e=new Uint8ClampedArray(he.subarray(e,e+o.width*o.height*4)),e=new ImageData(e,o.width,o.height),s.putImageData(e,0,0),e=(s=document.createElement("canvas")).getContext("2d"),s.width=i,s.height=a,e.drawImage(o,0,0,s.width,s.height),i=e.getImageData(0,0,s.width,s.height),i=new Uint8Array(i.data.buffer),he.set(i,n)},98640:()=>{var e=window.navigator.userAgent||"no user agent",t=Xo(32);for(let r=0;32>r;++r)he[t+r]=e.charCodeAt(r%e.length);return t},98878:()=>{var e=window.location.hostname||"no hostname",t=Xo(32);for(let r=0;32>r;++r)he[t+r]=e.charCodeAt(r%e.length);return t},99112:()=>{console.error("License key not valid")},99151:()=>{i.Zj()},99175:(e,t,r)=>{i.ak(e,t,r)},99218:e=>{i.$j(e)},99265:e=>{i.Sj(e?Ge(he,e):"")},99309:(e,t,r,n,a,o,s,l,c)=>{i.Uj({translationOffset:e,rotationOffset:t,poseMatrixOffset:r,landmarksOffset:n,landmarks2DOffset:a,faceRectOffset:o},s,l,c)},99493:(e,t)=>{i.Tj(e?Ge(he,e):"",t?Ge(he,t):"")},99550:()=>{i.Pj()},99588:()=>{i.Qj()},99633:(e,t,r,n)=>{i.Cj(e,t,r,n)},99688:(e,t,r,n)=>{i.Dj(e,t,r,n)},99744:(e,t,r,n)=>{function a(e,t){return{detected:e,scale:[ve[t>>=2],ve[t+1],ve[t+2]],rotation:[ve[t+3],ve[t+4],ve[t+5],ve[t+6]],position:[ve[t+7],ve[t+8],ve[t+9]]}}e=a(e,t),r=a(r,n),i.Xj(e,r)},100201:(e,t)=>{i.dk({detected:!!e,isLeft:!!t})},100266:()=>{i.bk()},100307:e=>{i.Wj(!!e)},100348:e=>{i.Yj(!!e)},100392:(e,t)=>{e=e?Ge(he,e,t):"",i.Oj(e)},100473:()=>{alert("DeepAR license not valid")},100507:()=>{i.endLoop()},100528:()=>{let e=te("face");if(!e)return 0;e=new Uint8Array(e);var t=Xo(e.length);return he.set(e,t),Q.face.Gj(),t},100771:()=>{let e=te("default_envmap.webp");if(!e)return 0;e=new Uint8Array(e);var t=Xo(e.length);return he.set(e,t),t},100981:()=>{let e=te("default_envmap.webp").byteLength;return Q["default_envmap.webp"].Gj(),e},101090:()=>i.useExternalTrackingData,101136:(e,t)=>{i.Rj(e,t)}};function Le(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var Be,De,We,Ue=e=>{for(;0<e.length;)e.shift()(i)},$e="undefined"!=typeof TextDecoder?new TextDecoder:void 0,Ge=(e,t,r)=>{var n=t+r;for(r=t;e[r]&&!(r>=n);)++r;if(16<r-t&&e.buffer&&$e)return $e.decode(e.subarray(t,r));for(n="";t<r;){var i=e[t++];if(128&i){var a=63&e[t++];if(192==(224&i))n+=String.fromCharCode((31&i)<<6|a);else{var o=63&e[t++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?n+=String.fromCharCode(i):(i-=65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else n+=String.fromCharCode(i)}return n},Ne=(e,t)=>e?Ge(he,e,t):"",Ve=e=>{for(var t="";he[e];)t+=Be[he[e++]];return t},ze={},Xe={},Je={},Ke=e=>{throw new De(e)},He=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new We("Mismatched type converter count");for(var n=0;n<e.length;++n)qe(e[n],t[n])}e.forEach(function(e){Je[e]=t});var i=Array(t.length),a=[],o=0;t.forEach((e,t)=>{Xe.hasOwnProperty(e)?i[t]=Xe[e]:(a.push(e),ze.hasOwnProperty(e)||(ze[e]=[]),ze[e].push(()=>{i[t]=Xe[e],++o===a.length&&n(i)}))}),0===a.length&&n(i)};function qe(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(!e)throw new De(`type "${n}" must have a positive integer typeid pointer`);if(Xe.hasOwnProperty(e)){if(r.nk)return;throw new De(`Cannot register type '${n}' twice`)}Xe[e]=t,delete Je[e],ze.hasOwnProperty(e)&&(t=ze[e],delete ze[e],t.forEach(e=>e()))}(e,t,r)}var Ye,Qe=e=>{throw new De(e.Ji.Ni.Ki.name+" instance already deleted")},Ze=!1,et=()=>{},tt=(e,t,r)=>t===r?e:void 0===r.Qi||null===(e=tt(e,t,r.Qi))?null:r.hk(e),rt={},nt=[],it=()=>{for(;nt.length;){var e=nt.pop();e.Ji.hj=!1,e.delete()}},at={},ot=(e,t)=>{if(!t.Ni||!t.Mi)throw new We("makeClassHandle requires ptr and ptrType");if(!!t.Ri!=!!t.Oi)throw new We("Both smartPtrType and smartPtr must be specified");return t.count={value:1},st(Object.create(e,{Ji:{value:t,writable:!0}}))},st=e=>"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Ze=new FinalizationRegistry(e=>{--(e=e.Ji).count.value,0===e.count.value&&(e.Oi?e.Ri.$i(e.Oi):e.Ni.Ki.$i(e.Mi))}),et=e=>{Ze.unregister(e)},(st=e=>{var t=e.Ji;return t.Oi&&Ze.register(e,{Ji:t},e),e})(e));function lt(){}var ct=(e,t)=>Object.defineProperty(t,"name",{value:e}),dt=(e,t,r)=>{if(void 0===e[t].Pi){var n=e[t];e[t]=function(...n){if(!e[t].Pi.hasOwnProperty(n.length))throw new De(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].Pi})!`);return e[t].Pi[n.length].apply(this,n)},e[t].Pi=[],e[t].Pi[n.oj]=n}},ut=(e,t,r)=>{if(i.hasOwnProperty(e)){if(void 0===r||void 0!==i[e].Pi&&void 0!==i[e].Pi[r])throw new De(`Cannot register public name '${e}' twice`);if(dt(i,e,e),i.hasOwnProperty(r))throw new De(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);i[e].Pi[r]=t}else i[e]=t,void 0!==r&&(i[e].Kk=r)};function ft(e,t,r,n,i,a,o,s){this.name=e,this.constructor=t,this.ij=r,this.$i=n,this.Qi=i,this.jk=a,this.mj=o,this.hk=s,this.sk=[]}var ht=(e,t,r)=>{for(;t!==r;){if(!t.mj)throw new De(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.mj(e),t=t.Qi}return e};function mt(e,t){if(null===t){if(this.xj)throw new De(`null is not a valid ${this.name}`);return 0}if(!t.Ji)throw new De(`Cannot pass "${Dt(t)}" as a ${this.name}`);if(!t.Ji.Mi)throw new De(`Cannot pass deleted object as a pointer of type ${this.name}`);return ht(t.Ji.Mi,t.Ji.Ni.Ki,this.Ki)}function gt(e,t){if(null===t){if(this.xj)throw new De(`null is not a valid ${this.name}`);if(this.rj){var r=this.tk();return null!==e&&e.push(this.$i,r),r}return 0}if(!t||!t.Ji)throw new De(`Cannot pass "${Dt(t)}" as a ${this.name}`);if(!t.Ji.Mi)throw new De(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.qj&&t.Ji.Ni.qj)throw new De(`Cannot convert argument of type ${t.Ji.Ri?t.Ji.Ri.name:t.Ji.Ni.name} to parameter type ${this.name}`);if(r=ht(t.Ji.Mi,t.Ji.Ni.Ki,this.Ki),this.rj){if(void 0===t.Ji.Oi)throw new De("Passing raw pointer to smart pointer is illegal");switch(this.vk){case 0:if(t.Ji.Ri!==this)throw new De(`Cannot convert argument of type ${t.Ji.Ri?t.Ji.Ri.name:t.Ji.Ni.name} to parameter type ${this.name}`);r=t.Ji.Oi;break;case 1:r=t.Ji.Oi;break;case 2:if(t.Ji.Ri===this)r=t.Ji.Oi;else{var n=t.clone();r=this.uk(r,Lt(()=>n.delete())),null!==e&&e.push(this.$i,r)}break;default:throw new De("Unsupporting sharing policy")}}return r}function pt(e,t){if(null===t){if(this.xj)throw new De(`null is not a valid ${this.name}`);return 0}if(!t.Ji)throw new De(`Cannot pass "${Dt(t)}" as a ${this.name}`);if(!t.Ji.Mi)throw new De(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.Ji.Ni.qj)throw new De(`Cannot convert argument of type ${t.Ji.Ni.name} to parameter type ${this.name}`);return ht(t.Ji.Mi,t.Ji.Ni.Ki,this.Ki)}function bt(e){return this.fromWireType(be[e>>2])}function vt(e,t,r,n,i,a,o,s,l,c,d){this.name=e,this.Ki=t,this.xj=r,this.qj=n,this.rj=i,this.rk=a,this.vk=o,this.Jj=s,this.tk=l,this.uk=c,this.$i=d,i||void 0!==t.Qi?this.toWireType=gt:(this.toWireType=n?mt:pt,this.Wi=null)}var wt,yt,Et=(e,t,r)=>{if(!i.hasOwnProperty(e))throw new We("Replacing nonexistent public symbol");void 0!==i[e].Pi&&void 0!==r?i[e].Pi[r]=t:(i[e]=t,i[e].oj=r)},Pt=(e,t)=>{var r=(e=Ve(e)).includes("j")?((e,t)=>(...r)=>((e,t,r=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0,i["dynCall_"+e])(t,...r)):t=wt.get(t)(...r),t))(e,t,r))(e,t):wt.get(t);if("function"!=typeof r)throw new De(`unknown function pointer with signature ${e}: ${t}`);return r},kt=e=>{e=Wo(e);var t=Ve(e);return Uo(e),t},Tt=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){n[t]||Xe[t]||(Je[t]?Je[t].forEach(e):(r.push(t),n[t]=!0))}),new yt(`${e}: `+r.map(kt).join([", "]))},xt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(be[t+4*n>>2]);return r},_t=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function St(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].Wi)return!0;return!1}function jt(e){var t=Function;if(!(t instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof t} which is not a function`);var r=ct(t.name||"unknownFunctionName",function(){});return r.prototype=t.prototype,r=new r,(e=t.apply(r,e))instanceof Object?e:r}function At(e,t,r,n,i,a){var o=t.length;if(2>o)throw new De("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,l=St(t);for(r="void"!==t[0].name,n=[e,Ke,n,i,_t,t[0],t[1]],i=0;i<o-2;++i)n.push(t[i+2]);if(!l)for(i=s?1:2;i<t.length;++i)null!==t[i].Wi&&n.push(t[i].Wi);l=St(t),i=t.length;var c="",d="";for(o=0;o<i-2;++o)c+=(0!==o?", ":"")+"arg"+o,d+=(0!==o?", ":"")+"arg"+o+"Wired";c=`\n return function (${c}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`,l&&(c+="var destructors = [];\n");var u=l?"destructors":"null",f="humanName throwBindingError invoker fn runDestructors retType classParam".split(" ");for(s&&(c+="var thisWired = classParam['toWireType']("+u+", this);\n"),o=0;o<i-2;++o)c+="var arg"+o+"Wired = argType"+o+"['toWireType']("+u+", arg"+o+");\n",f.push("argType"+o);if(s&&(d="thisWired"+(0<d.length?", ":"")+d),c+=(r||a?"var rv = ":"")+"invoker(fn"+(0<d.length?", ":"")+d+");\n",l)c+="runDestructors(destructors);\n";else for(o=s?1:2;o<t.length;++o)a=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==t[o].Wi&&(c+=`${a}_dtor(${a});\n`,f.push(`${a}_dtor`));r&&(c+="var ret = retType['fromWireType'](rv);\nreturn ret;\n");let[h,m]=[f,c+"}\n"];return h.push(m),t=jt(h)(...n),ct(e,t)}var Ft,Ct=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},Ot=[],Mt=[],Rt=e=>{9<e&&0==--Mt[e+1]&&(Mt[e]=void 0,Ot.push(e))},It=e=>{if(!e)throw new De("Cannot use deleted val. handle = "+e);return Mt[e]},Lt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=Ot.pop()||Mt.length;return Mt[t]=e,Mt[t+1]=1,t}},Bt={name:"emscripten::val",fromWireType:e=>{var t=It(e);return Rt(e),t},toWireType:(e,t)=>Lt(t),argPackAdvance:8,readValueFromPointer:bt,Wi:null},Dt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Wt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ve[e>>2])};case 8:return function(e){return this.fromWireType(we[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Ut=(e,t,r)=>{switch(t){case 1:return r?e=>fe[e]:e=>he[e];case 2:return r?e=>me[e>>1]:e=>ge[e>>1];case 4:return r?e=>pe[e>>2]:e=>be[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},$t=(e,t,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var a=0;a<e.length;++a){var o=e.charCodeAt(a);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(r>=n)break;t[r++]=o}else{if(2047>=o){if(r+1>=n)break;t[r++]=192|o>>6}else{if(65535>=o){if(r+2>=n)break;t[r++]=224|o>>12}else{if(r+3>=n)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63}t[r++]=128|o>>6&63}t[r++]=128|63&o}}return t[r]=0,r-i},Gt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);127>=n?t++:2047>=n?t+=2:55296<=n&&57343>=n?(t+=4,++r):t+=3}return t},Nt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Vt=(e,t)=>{for(var r=e>>1,n=r+t/2;!(r>=n)&&ge[r];)++r;if(32<(r<<=1)-e&&Nt)return Nt.decode(he.subarray(e,r));for(r="",n=0;!(n>=t/2);++n){var i=me[e+2*n>>1];if(0==i)break;r+=String.fromCharCode(i)}return r},zt=(e,t,r)=>{if(r??=2147483647,2>r)return 0;var n=t;r=(r-=2)<2*e.length?r/2:e.length;for(var i=0;i<r;++i)me[t>>1]=e.charCodeAt(i),t+=2;return me[t>>1]=0,t-n},Xt=e=>2*e.length,Jt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=pe[e+4*r>>2];if(0==i)break;++r,65536<=i?(i-=65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i)):n+=String.fromCharCode(i)}return n},Kt=(e,t,r)=>{if(r??=2147483647,4>r)return 0;var n=t;r=n+r-4;for(var i=0;i<e.length;++i){var a=e.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),pe[t>>2]=a,(t+=4)+4>r)break}return pe[t>>2]=0,t-n},Ht=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);55296<=n&&57343>=n&&++r,t+=4}return t},qt=(e,t)=>{var r=Xe[e];if(void 0===r)throw e=`${t} has unknown type ${kt(e)}`,new De(e);return r},Yt=(e,t,r)=>{var n=[];return e=e.toWireType(n,r),n.length&&(be[t>>2]=Lt(n)),e},Qt=[],Zt={},er=e=>{var t=Zt[e];return void 0===t?Ve(e):t},tr=0,rr=(e,t)=>{if(fr=e,hr=t,ur)if(lr||(tr+=1,lr=!0),0==e)cr=function(){var e=0|Math.max(0,nr+t-Ft());setTimeout(ir,e)};else if(1==e)cr=function(){Tr(ir)};else if(2==e){if(void 0===Ar)if("undefined"==typeof setImmediate){var r=[];addEventListener("message",e=>{"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),r.shift()())},!0),Ar=function(e){r.push(e),postMessage("setimmediate","*")}}else Ar=setImmediate;cr=function(){Ar(ir)}}};Ft=()=>performance.now();var nr,ir,ar=e=>{if(!(e instanceof Le||"unwind"==e))throw e},or=()=>{if(!(Se||0<tr))try{var e=ue;throw ue=e,0<tr||(Yo(),Ue(Te),ba(),Se=!0),ue=e,0<tr||(ye=!0),new Le(e)}catch(e){ar(e)}},sr=()=>{sr.zj||(sr.zj={}),sr.zj['Source map information is not available, emscripten_log with EM_