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 141 kB
/*! For license information please see deepar.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepar=t():e.deepar=t()}(self,(()=>(()=>{var e={795:function(e,t,r){var n;e=r.nmd(e),function(){"use strict";var i={function:!0,object:!0},a=i[typeof window]&&window||this,o=i[typeof t]&&t,s=i.object&&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),x=n?m:"RuntimeObject",T=/\bJava/.test(k)&&r.java,S=T&&b(r.environment)==P,_=T?"a":"α",j=T?"b":"β",A=r.document||{},F=r.operamini||r.opera,C=d.test(C=n&&F?F["[[Class]]"]:b(F))?C:F=null,M=t,O=[],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=N([{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 N(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 G(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=N([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)&&O.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",O.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&O.unshift("accelerated")):"UC Browser"==D&&/\bUCWEB\b/.test(t)?O.push("speed mode"):"PaleMoon"==D&&(s=/\bFirefox\/([\d.]+)\b/.exec(t))?O.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])&&O.push("Chromium "+s),L||(L=G(["(?: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"),O.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(D="IE Mobile",$="Windows Phone 8.x",O.unshift("desktop mode"),L||(L=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=D&&"Trident"==B&&(s=/\brv:([\d.]+)/.exec(t))&&(D&&O.push("identifying as "+D+(L?" "+L:"")),D="IE",L=s[1]),I){if("global",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)==x?(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]&&(O.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)&&(O.push("masking as "+D+" "+L),D="IE",L="11.0",B=["Trident"],$="Windows");else if(T&&(M=(s=T.lang.System).getProperty("os.arch"),$=$||s.getProperty("os.name")+" "+s.getProperty("os.version")),S){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?(O.push("Node "+s.versions.node),D="Electron",L=s.versions.electron):"string"==typeof s.versions.nw&&(O.push("Chromium "+L,"Node "+s.versions.node),D="NW.js",L=s.versions.nw)),D||(D="Node.js",M=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:_)+(/\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)&&O.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&&O.unshift("platform preview")}catch(e){O.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"],O.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)&&O.unshift("headless")),"Opera"==D&&(s=/\bzbov|zvav$/.exec($))?(D+=" ",O.unshift("desktop mode"),"zvav"==s?(D+="Mini",L=null):D+="Mobile",$=$.replace(RegExp(" *"+s+"$"),"")):"Safari"==D&&/\bChrome\b/.exec(B&&B[1])?(O.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=G("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])&&O.push(s),O.length&&(O=["("+O.join("; ")+")"]),U&&W&&W.indexOf(U)<0&&O.push("on "+U),W&&O.push((/^on /.test(O[O.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(M))&&!/\bi686\b/i.test(M)?($&&($.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))&&O.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&&O.unshift(L),V.name&&O.unshift(D),$&&D&&($!=String($).split(" ")[0]||$!=D.split(" ")[0]&&!W)&&O.push(W?"("+$+")":"on "+$),O.length&&(V.description=O.join(" ")),V}();a.platform=E,void 0===(n=function(){return E}.call(t,r,t,e))||(e.exports=n)}.call(this)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.r(n),r.d(n,{DeepAR:()=>Q,errors:()=>e,initialize:()=>Y,version:()=>t});var e={};r.r(e),r.d(e,{CameraPermissionDeniedError:()=>d,NoCameraError:()=>c,SwitchEffectCanceled:()=>l});const t="5.6.22-shopar-alpha-414";var i,a=(i="undefined"!=typeof document?document.currentScript?.src:void 0,function(e={}){var t,r,n=e,a=new Promise(((e,n)=>{t=e,r=n}));let o=null;const s=[];n.addPreRenderListener=function(e){s.push(e)},n.addPostRenderListener=function(e){s.push(e)},n.removePreRenderListener=function(e){0<=(e=s.indexOf(e))&&s.splice(e,1)},n.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,x,T,S,_,j,A,F=!1,C=null,M=null,O=null,R=null,I=null,L=null,B=null,D=null,W=null;n.Li=[null];let U=0;function $(e){const t=n.Li.length;return n.Li[t]=e,t}n.preinitializedWebGLContext=n.canvas.getContext("webgl2",{alpha:!1,antialias:!0,powerPreference:"high-performance"}),n.process=function(){};let N=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 G(){for(var e of s)e();e=n.canvas.width;const t=n.canvas.height;n.canvasWidth===e&&n.canvasHeight===t||(n.canvasWidth=e,n.canvasHeight=t,Ho(e,t)),n._render();for(const e of s)e();n.apiObject.__deeparRendered&&n.apiObject.__deeparRendered(Sa),n.apiObject.__deeparRendered2&&n.apiObject.__deeparRendered2(Sa)}function V(){var e=!1,t=n.Li[0];if(t&&t.readyState===t.HAVE_ENOUGH_DATA)(function(){const e=Ra;if(!Ma||!Wa||!Ba)return!0;switch(e.clientWaitSync(Ba,0,0)){case e.TIMEOUT_EXPIRED:case e.WAIT_FAILED:return!1;case e.CONDITION_SATISFIED:case e.ALREADY_SIGNALED:return!0}})()&&(n._processFrameVideo(0,Y,U),e=F=!0);else if(!F||0<Object.entries(K).length||null!=H||null!=q){if(e=f||u,!(t=n._malloc(e.data.length)))return;ge.set(e.data,t),n._processFrameRawPixels(t,e.width,e.height,e.Hj),F=!0,n._free(t),e=!0}e&&G()}function z(){V()}n.setFps=function(e){N.jj=1e3/e},N.add(z),n.startLoop=function(){N.add(z),N.start()},n.endLoop=function(){N.Ui=void 0,N.stop()};var X=!1,J=null;n.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},n.processFrameRawPixels=function(e,t,r,i){var a=n._malloc(e.length);a&&(ge.set(e,a),n._processFrameRawPixels(a,t,r,i),f=new ImageData(new Uint8ClampedArray(e),t,r),f.Hj=i,F=!0,N.gj||G(),n._free(a))},n.isFootTrackingInitialized=function(){return io},n.isFaceTrackingInitialized=function(){return za},n.isWristTrackingInitialized=function(){return Po},n.setReadPixelsAsync=function(e){Wa=e};let K={},H=null,q=null;n.switchEffectByteArray=function(e,t,r,i,a,o,s,l){if(!C)throw Error("Error in internal API: __switchEffect is null!");const c=n._malloc(r.length);if(!c)throw Error("Cannot allocate buffer for switch effect.");ge.set(r,c);const d=i.length?n._malloc(i.length):0;if(i.length){if(!d)throw Error("Cannot allocate buffer for environement map.");ge.set(i,d)}const u=a.length?n._malloc(a.length):0;if(a.length){if(!u)throw Error("Cannot allocate buffer for environement map.");ge.set(a,u)}if(t in K)s(new n.customErrors.SwitchEffectCanceled(`Cannot switch effect on slot ${t} because switch effect already in progress on the same slot.`));else{K[t]={Ti:o,error:s,Ij:l};try{C(t,c,r.length,e,d,i.length,u,a.length),F=!1,N.gj||V()}catch(e){throw delete K[t],e}}},n.hasVar=function(e,t){return h(e,t)},n.getVarType=function(e,t){if(m(e,t))return w(e,t);throw Error("Variable named '"+e+"' does not exist.")},n.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.")},n.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.")},n.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.")},n.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.")},n.setBoolVar=function(e,t,r){return x(e,t,r)},n.setIntVar=function(e,t,r){return T(e,t,r)},n.setDoubleVar=function(e,t,r){return S(e,t,r)},n.setStringVar=function(e,t,r){return _(e,t,r)},n.deleteVar=function(e,t){return j(e,t)},n.clearVars=function(e){return A(e)},n.clearEffect=function(e){K[e]&&K[e].error&&(K[e].error(new n.customErrors.SwitchEffectCanceled(`Switch effect canceled by the call to clearEffect() on the same slot: ${e}.`)),delete K[e]),M&&(M(e),N.gj||V())},n.moveGameObject=function(e,t){O&&(O(e,t),N.gj||V())};let Y=!0;n.setMirror=function(e){Y=!!e};let Q=!1;function Z(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}n.startCamera=function(e,t,r,i,a,o){n.stopVideo(),Y=!!e;let s=document.createElement("video");s.setAttribute("playsinline","playsinline"),n.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=>{i&&i(e),console.error(`${e.name}: ${e.message}`)}))},n.shutdown=function(){ee={},n.stopVideo(),null!=l&&l.shutdownTfjs(),s.length=0;try{Ko()}catch(e){console.error(e)}finally{n.ck()}},n.setVideoElement=function(e,t){n.stopVideo(),Y=!!t,n.Li[0]=e},n.stopVideo=function(){n.Li[0]&&(Q&&(n.Li[0]&&n.Li[0].srcObject&&(n.Li[0].srcObject.getTracks().forEach((e=>{e.stop()})),n.Li[0].srcObject=null),Q=!1),n.Li[0]=null)},n.getVideoElement=function(){return n.Li[0]},n.setOffscreenRenderingEnabled=function(e){!function(e){var t=N;if(t.type!==e){var r=t.fj|t.dj|t.ej;t.stop(),t.type=e,r&&t.start()}}(e?"Oscillator":"RAF")},n.backgroundReplacement=async function(e,t,r,n,i){if(e){q&&q.error&&q.error(""),q={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=Zo(r.length);ge.set(r,n),URL.revokeObjectURL(a.src);try{I(e,n,r.length,t.width,t.height),F=!1,N.gj||V()}catch(e){throw q=null,e}},a.src=URL.createObjectURL(t)}else I(!1,null,0,0,0),n()},n.backgroundBlur=function(e,t,r,n){if(e){H&&H.error&&H.error(""),H={Ti:r,error:n};try{R(e,t),F=!1,N.gj||V()}catch(e){throw H=null,e}}else R(!1,0),r()},n.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]=n.HEAPF32[e/Float32Array.BYTES_PER_ELEMENT+r];return n._free(e),t},n.getTransformationBetween=function(e,t){if(!(e=B(e,t)))return null;t=new Float32Array(16);for(let r=0;16>r;++r)t[r]=n.HEAPF32[e/Float32Array.BYTES_PER_ELEMENT+r];return n._free(e),t},n.setEnvironmentMap=async function(e){if(Z(e)){var t=n._malloc(e.length);if(!t)throw Error("Cannot allocate buffer for environement map.");ge.set(e,t),D(t,e.length)}else{const[t,r,n]=await Ga(e);qo(t,r,n)}},n.setDiamondEnvironmentMap=async function(e){if(Z(e)){var t=n._malloc(e.length);if(!t)throw Error("Cannot allocate buffer for environement map.");ge.set(e,t),W(t,e.length)}else{const[t,r,n]=await Ga(e);Qo(t,r,n)}},n.Uj=function(e,t,r,i){if(n.apiObject.onFaceTracked){var a=[];for(let d=0;d<i;d++){let i={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(i.detected=!!(255&n.HEAP32[o/Float32Array.BYTES_PER_ELEMENT]),o=0;3>o;o++)i.translation.push(n.HEAPF32[s/Float32Array.BYTES_PER_ELEMENT+o]),i.rotation.push(n.HEAPF32[u/Float32Array.BYTES_PER_ELEMENT+o]);for(s=0;16>s;s++)i.poseMatrix.push(n.HEAPF32[l/Float32Array.BYTES_PER_ELEMENT+s]);for(l=0;204>l;l++)i.landmarks.push(n.HEAPF32[c/Float32Array.BYTES_PER_ELEMENT+l]),136>l&&i.landmarks2d.push(n.HEAPF32[f/Float32Array.BYTES_PER_ELEMENT+l]);for(c=0;4>c;c++)i.faceRect.push(n.HEAPF32[h/Float32Array.BYTES_PER_ELEMENT+c]);a.push(i)}n.apiObject.onFaceTracked(a)}},n.Bk=function(){n.apiObject.onVideoStarted&&n.apiObject.onVideoStarted()},n.Zj=function(){n.apiObject.onInitialize&&n.apiObject.onInitialize()},n.Wj=function(e){n.apiObject.onFaceVisibilityChanged&&n.apiObject.onFaceVisibilityChanged(e)},n.Yj=function(e){n.apiObject.onImageVisibilityChanged&&n.apiObject.onImageVisibilityChanged(e)},n.Ak=function(){n.apiObject.onCameraPermissionGranted&&n.apiObject.onCameraPermissionGranted()},n.zk=function(){n.apiObject.onCameraPermissionDenied&&n.apiObject.onCameraPermissionDenied()},n.yk=function(){n.apiObject.onCameraPermissionAsked&&n.apiObject.onCameraPermissionAsked()},n.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]=ge[e+a+2],o[s+1]=ge[e+a+1],o[s+2]=ge[e+a+0],o[s+3]=ge[e+a+3]}i.putImageData(a,0,0),X?(X=!1,J(n.toDataURL("image/png")),J=null):console.error("DeepAR screenshot taken but no registered callback.")},n.Oj=function(e){n.apiObject.onAnimationTransitionedToState&&n.apiObject.onAnimationTransitionedToState(e)},n.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)},n.Sj=function(e){K[e]&&K[e].Ti&&K[e].Ti(),delete K[e]},n.Qj=function(){q&&q.Ti&&q.Ti(),q={}},n.Pj=function(){H&&H.Ti&&H.Ti(),H={}},n.$j=function(e){n.apiObject.onNumberOfFacesVisibleChanged&&n.apiObject.onNumberOfFacesVisibleChanged(e)},n.ck=function(){n.apiObject.onShutdown&&n.apiObject.onShutdown()},n.Vj=function(e,t,r){n.apiObject.onFaceTrackingInitialized&&n.apiObject.onFaceTrackingInitialized(e,t,r)},n.Cj=function(e,t,r,i){n.apiObject.onFootTrackingInitialized&&n.apiObject.onFootTrackingInitialized(e,t,r,i)},n.bk=function(){n.apiObject.onSegmentationInitialized&&n.apiObject.onSegmentationInitialized()},n.Xj=function(e,t){n.apiObject.onFeetTracked&&n.apiObject.onFeetTracked(e,t),n.leftFootData=e,n.rightFootData=t},n._getFootData=function(){return n.leftFootData&&n.rightFootData?{left:n.leftFootData,right:n.rightFootData}:null},n.Dj=function(e,t,r,i){n.apiObject.onWristTrackingInitialized&&n.apiObject.onWristTrackingInitialized(e,t,r,i)},n.dk=function(e){n.apiObject.onWristTracked&&n.apiObject.onWristTracked(e)},n.Rj=function(e,t){for(let r of Object.values(K))r.Ij&&r.Ij({loaded:e,total:t})},n._useExternalTrackingData=function(e){n.useExternalTrackingData=e},n._setExternalTrackingDataFoot=function(e,t){n.externalTrackingDataFoot={left:e,right:t}},n.noInitialRun=!0,n.initializeDeepAR=async function(){c=n.platform,d=n.draco_decoder;const e=n.initializeML&&n.initializeML.faceInit;var t=Ta(),r=640/360;1>r&&(r=1/r),t=180/Math.PI*Math.atan(Math.tan(Math.PI/180*t/2)/r)*2,e&&eo(t,640,360),n.initializeML&&(n.initializeML.footInit&&bo(t,0,640,360),n.initializeML.wristInit&&Oo(t,0,640,360)),C=Io("switchEffect",null,"string number number number number number".split(" ")),M=Io("clearEffect",null,["string"]),O=Io("moveGameObject",null,["string","string"]),R=Io("backgroundBlur",null,["boolean","number"]),I=Io("backgroundReplacement",null,["boolean","number","number","number","number"]),L=Io("getClosestPointOnMesh",null,["string","number","number","number"]),B=Io("getTransformationBetween",null,["string","string"]),D=Io("setEnvironmentMap",null,["number","number"]),W=Io("setDiamondEnvironmentMap",null,["number","number"]),h=Io("hasVar","boolean",["string","string"]),m=Io("getVarTypeStatus","boolean",["string","string"]),g=Io("getBoolVarStatus","boolean",["string","string"]),p=Io("getIntVarStatus","boolean",["string","string"]),b=Io("getDoubleVarStatus","boolean",["string","string"]),v=Io("getStringVarStatus","boolean",["string","string"]),w=Io("getVarType","int",["string","string"]),y=Io("getBoolVar","boolean",["string","string"]),E=Io("getIntVar","int",["string","string"]),P=Io("getDoubleVar","number",["string","string"]),k=Io("getStringVar","string",["string","string"]),x=Io("setBoolVar","boolean",["string","boolean","string"]),T=Io("setIntVar","boolean",["string","int","string"]),S=Io("setDoubleVar","boolean",["string","number","string"]),_=Io("setStringVar","boolean",["string","string","string"]),j=Io("deleteVar","boolean",["string","string"]),A=Io("clearVars","boolean",["string"]),n.pushConsoleLog=Io("pushConsoleLog","boolean",["string","int"]),n.changeParameterFloat=Io("changeParameterFloat",null,["string","string","string","number"]),n.changeParameterVector=Io("changeParameterVector",null,"string string string number number number number".split(" ")),n.changeParameterBool=Io("changeParameterBool",null,["string","string","string","boolean"]),n.changeParameterTexture=Io("changeParameterTexture",null,"string string string number number number number".split(" ")),n.fireTrigger=Io("fireTrigger",null,["string"]),n.setFaceDetectionSensitivity=Io("setFaceDetectionSensitivity",null,["number"]),n.showStats=Io("showStats",null,["number"]),n.simulatePhysics=Io("simulatePhysics",null,["number"]),n.showColliders=Io("showColliders",null,["number"]),n.setLicenseKey=Io("setLicenseKey",null,["string"]),n.muteSound=Io("muteSound",null,["boolean"]),n.setExposure=Io("setExposure",null,["number"]),n.setEnvironmentMapIntensity=Io("setEnvironmentMapIntensity",null,["number"]),n.setToneMapping=Io("setToneMapping",null,["number"]),n.resetEnvironmentMap=Io("resetEnvironmentMap",null,[]),n.resetToneMapping=Io("resetToneMapping",null,[]),n.resetEnvironmentMapIntensity=Io("resetEnvironmentMapIntensity",null,[]),n.resetExposure=Io("resetExposure",null,[]),n.setBloomEnabled=Io("setBloomEnabled",null,["boolean"]),n.setBloomThreshold=Io("setBloomThreshold",null,["number"]),n.setBloomStrength=Io("setBloomStrength",null,["number"]),n.setBloomRadius=Io("setBloomRadius",null,["number"]),n.split_sum=await createImageBitmap(new Blob([await n.split_sum]),{premultiplyAlpha:"none",colorSpaceConversion:"none"}),n.initialize(n.canvasWidth,n.canvasHeight,!0,!1,e,!0,!0,!1,n.onVerify)};let ee={};function te(e,t,r){ee[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 i=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!=n.globalProgress&&n.globalProgress.isUrlTracked(t)?n.globalProgress.getFilePromises(t).then((e=>{i(e)})).catch((()=>{a()})):fetch(this.path).then((t=>{t.ok?t.arrayBuffer().then((e=>{i(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 re(e,t){te(`${e}-tfjsBackendWasmPath`,t.tfjsBackendWasmPath,["fe0951aee7c0feb369aa12a65a24b871da9386fb55b40b918c2a59b24e09be83"]),te(`${e}-tfjsBackendWasmSimdPath`,t.tfjsBackendWasmSimdPath,["3402e2b8668afb320151b4aae8080ad2136875f424aa95c95e3a4bc87d09097e"]),te(`${e}-tfjsBackendWasmThreadedPath`,t.tfjsBackendWasmThreadedPath,["118f499abf412a285905483c91db693296c0b112cfaab04128bf54f61c141ce9"])}function ne(e){if(!ee[e])throw Error(`No ML model with name ${e}.`);return ee[e].kk()}function ie(e){if(!ee[e])throw Error(`No ML model with name ${e}.`);return ee[e].pj()}async function ae(e){const t={tfjsBackendWasmPath:"",tfjsBackendWasmSimdPath:"",tfjsBackendWasmThreadedPath:""};return n.WASM_HAS_SIMD_SUPPORT&&n.WASM_HAS_MULTITHREAD_SUPPORT?t.tfjsBackendWasmThreadedPath=await ee[`${e}-tfjsBackendWasmThreadedPath`].pj():n.WASM_HAS_SIMD_SUPPORT?t.tfjsBackendWasmSimdPath=await ee[`${e}-tfjsBackendWasmSimdPath`].pj():t.tfjsBackendWasmPath=await ee[`${e}-tfjsBackendWasmPath`].pj(),t}te("rigidFaceDetector",n.rigidFaceTrackingConfig.detectorPath,["8270514ae788bc6ee67db086c9400581d17a78c18de38c878f1148dcc3a8e480"]),te("rigidFaceTracker",n.rigidFaceTrackingConfig.trackerPath,["9ab8c04aa4294ff23c66798a4a442fd9dbef4a8f61ea6e1530e51445846b5605"]),te("rigidFacePEW",n.rigidFaceTrackingConfig.poseEstimationWasmPath,["55e668327885970371152a98d6612f8f50579996f046479db5b943c00199494d"]),re("rigidFaceDetector",n.rigidFaceTrackingConfig),te("footDetector",n.footTrackingConfig.detectorPath,["6d0f65c977509cf5d93f65a3b26539ab29ec540322476f0b7adac9ee289db4bd"]),te("footTracker",n.footTrackingConfig.trackerPath,["297c230e346d4e9e7ac1f78e9e87f4e85754338547061501eee2542e334ca7be","c72af568553b85b1f20d61fd07ba5db46a0db2b5261472099310bbc51afa967f","e5180848c0d88fe6ab483b22a4490e9db80408d2887cd165cecd5e7f2efd8555"]),te("footObj",n.footTrackingConfig.objPath,["3b903682a513f5d96cabb8135ead157240141f0f0d5c833a77e7de91a87a2bca"]),te("footPEW",n.footTrackingConfig.poseEstimationWasmPath,["55e668327885970371152a98d6612f8f50579996f046479db5b943c00199494d"]),re("footDetector",n.footTrackingConfig),te("wristDetector",n.wristTrackingConfig.detectorPath,["b4c14a6f4b7bed1bc1cb313bbad5e877c7958c25b8e47d12583404f9a611d7ff"]),te("wristTracker",n.wristTrackingConfig.trackerPath,["8bbbc4398f33db43ef32f1615d6d11322e8dc5d1f800cb8da4a0580d6267dba0","cbb7a12bd06b28a809c914700c8cd64530a9d08d4d82f6d9c758dfc022264a6d"]),te("wristObj",n.wristTrackingConfig.objPath,["5c763303cac33e377bbfbc3bd13475c0b99ca6412f9774ecc7a65fe72ac01732"]),te("wristPEW",n.wristTrackingConfig.poseEstimationWasmPath,["55e668327885970371152a98d6612f8f50579996f046479db5b943c00199494d"]),re("wristDetector",n.wristTrackingConfig),te("default_envmap.webp",n.defaultEnvmapPath,["f822e455a5d5a3c1d5c91d9c22d3d1b511f645062fa2e4c8755d698af02b9b80"]);var oe,se=Object.assign({},n),le="";"undefined"!=typeof document&&document.currentScript&&(le=document.currentScript.src),i&&(le=i),le=le.startsWith("blob:")?"":le.substr(0,le.replace(/[?#].*/,"").lastIndexOf("/")+1),oe=e=>fetch(e,{credentials:"same-origin"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(Error(e.status+" : "+e.url))));var ce,de=console.log.bind(console),ue=console.error.bind(console);Object.assign(n,se),se=null,n.wasmBinary&&(ce=n.wasmBinary);var fe,he,me,ge,pe,be,ve,we,ye,Ee,Pe=!1;function ke(){var e=fe.buffer;n.HEAP8=me=new Int8Array(e),n.HEAP16=pe=new Int16Array(e),n.HEAPU8=ge=new Uint8Array(e),n.HEAPU16=be=new Uint16Array(e),n.HEAP32=ve=new Int32Array(e),n.HEAPU32=we=new Uint32Array(e),n.HEAPF32=ye=new Float32Array(e),n.HEAPF64=Ee=new Float64Array(e)}var xe=[],Te=[],Se=[],_e=[],je=!1,Ae=!1,Fe=0,Ce=null,Me=null;function Oe(e){throw n.onAbort?.(e),ue(e="Aborted("+e+")"),Pe=!0,he=1,e+=". Build with -sASSERTIONS for more info.",je&&os(),e=new WebAssembly.RuntimeError(e),r(e),e}var Re,Ie=e=>e.startsWith("data:application/octet-stream;base64,");function Le(e){if(e==Re&&ce)return new Uint8Array(ce);throw"both async and sync fetching of the wasm failed"}function Be(e,t,r){return function(e){return ce?Promise.resolve().then((()=>Le(e))):oe(e).then((e=>new Uint8Array(e)),(()=>Le(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then(r,(e=>{ue(`failed to asynchronously prepare wasm: ${e}`),Oe(e)}))}var De={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(ge.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),ge.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(ge.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),ge.set(i,n)},98640:()=>{var e=window.navigator.userAgent||"no user agent",t=Zo(32);for(let r=0;32>r;++r)ge[t+r]=e.charCodeAt(r%e.length);return t},98878:()=>{var e=window.location.hostname||"no hostname",t=Zo(32);for(let r=0;32>r;++r)ge[t+r]=e.charCodeAt(r%e.length);return t},99112:()=>{console.error("License key not valid")},99151:()=>{n.Zj()},99175:(e,t,r)=>{n.ak(e,t,r)},99218:e=>{n.$j(e)},99265:e=>{n.Sj(e?ze(ge,e):"")},99309:(e,t,r,i,a,o,s,l,c)=>{n.Uj({translationOffset:e,rotationOffset:t,poseMatrixOffset:r,landmarksOffset:i,landmarks2DOffset:a,faceRectOffset:o},s,l,c)},99493:(e,t)=>{n.Tj(e?ze(ge,e):"",t?ze(ge,t):"")},99550:()=>{n.Pj()},99588:()=>{n.Qj()},99633:(e,t,r,i)=>{n.Cj(e,t,r,i)},99688:(e,t,r,i)=>{n.Dj(e,t,r,i)},99744:(e,t,r,i)=>{function a(e,t){return{detected:e,scale:[ye[t>>=2],ye[t+1],ye[t+2]],rotation:[ye[t+3],ye[t+4],ye[t+5],ye[t+6]],position:[ye[t+7],ye[t+8],ye[t+9]]}}e=a(e,t),r=a(r,i),n.Xj(e,r)},100201:(e,t)=>{n.dk({detected:!!e,isLeft:!!t})},100266:()=>{n.bk()},100307:e=>{n.Wj(!!e)},100348:e=>{n.Yj(!!e)},100392:(e,t)=>{e=e?ze(ge,e,t):"",n.Oj(e)},100473:()=>{alert("DeepAR license not valid")},100507:()=>{n.endLoop()},100528:()=>{let e=ne("face");if(!e)return 0;e=new Uint8Array(e);var t=Zo(e.length);return ge.set(e,t),ee.face.Gj(),t},100771:()=>{let e=ne("default_envmap.webp");if(!e)return 0;e=new Uint8Array(e);var t=Zo(e.length);return ge.set(e,t),t},100981:()=>{let e=ne("default_envmap.webp").byteLength;return ee["default_envmap.webp"].Gj(),e},101090:()=>n.useExternalTrackingData,101136:(e,t)=>{n.Rj(e,t)}};function We(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var Ue,$e,Ne,Ge=e=>{for(;0<e.length;)e.shift()(n)},Ve="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ze=(e,t,r)=>{var n=t+r;for(r=t;e[r]&&!(r>=n);)++r;if(16<r-t&&e.buffer&&Ve)return Ve.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},Xe=(e,t)=>e?ze(ge,e,t):"",Je=e=>{for(var t="";ge[e];)t+=Ue[ge[e++]];return t},Ke={},He={},qe={},Ye=e=>{throw new $e(e)},Qe=(e,t,r)=>{function n(t){if((t=r(t)).length!==e.length)throw new Ne("Mismatched type converter count");for(var n=0;n<e.length;++n)Ze(e[n],t[n])}e.forEach((function(e){qe[e]=t}));var i=Array(t.length),a=[],o=0;t.forEach(((e,t)=>{He.hasOwnProperty(e)?i[t]=He[e]:(a.push(e),Ke.hasOwnProperty(e)||(Ke[e]=[]),Ke[e].push((()=>{i[t]=He[e],++o===a.length&&n(i)})))})),0===a.length&&n(i)};function Ze(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 $e(`type "${n}" must have a positive integer typeid pointer`);if(He.hasOwnProperty(e)){if(r.nk)return;throw new $e(`Cannot register type '${n}' twice`)}He[e]=t,delete qe[e],Ke.hasOwnProperty(e)&&(t=Ke[e],delete Ke[e],t.forEach((e=>e())))}(e,t,r)}var et,tt=e=>{throw new $e(e.Ji.Ni.Ki.name+" instance already deleted")},rt=!1,nt=()=>{},it=(e,t,r)=>t===r?e:void 0===r.Qi||null===(e=it(e,t,r.Qi))?null:r.hk(e),at={},ot=[],st=()=>{for(;ot.length;){var e=ot.pop();e.Ji.hj=!1,e.delete()}},lt={},ct=(e,t)=>{if(!t.Ni||!t.Mi)throw new Ne("makeClassHandle requires ptr and ptrType");if(!!t.Ri!=!!t.Oi)throw new Ne("Both smartPtrType and smartPtr must be specified");return t.count={value:1},dt(Object.create(e,{Ji:{value:t,writable:!0}}))},dt=e=>"undefined"==typeof FinalizationRegistry?(dt=e=>e,e):(rt=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))})),nt=e=>{rt.unregister(e)},(dt=e=>{var t=e.Ji;return t.Oi&&rt.register(e,{Ji:t},e),e})(e));function ut(){}var ft=(e,t)=>Object.defineProperty(t,"name",{value:e}),ht=(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 $e(`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}},mt=(e,t,r)=>{if(n.hasOwnProperty(e)){if(void 0===r||void 0!==n[e].Pi&&void 0!==n[e].Pi[r])throw new $e(`Cannot register public name '${e}' twice`);if(ht(n,e,e),n.hasOwnProperty(r))throw new $e(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);n[e].Pi[r]=t}else n[e]=t,void 0!==r&&(n[e].Kk=r)};function gt(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 pt=(e,t,r)=>{for(;t!==r;){if(!t.mj)throw new $e(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.mj(e),t=t.Qi}return e};function bt(e,t){if(null===t){if(this.xj)throw new $e(`null is not a valid ${this.name}`);return 0}if(!t.Ji)throw new $e(`Cannot pass "${$t(t)}" as a ${this.name}`);if(!t.Ji.Mi)throw new $e(`Cannot pass deleted object as a pointer of type ${this.name}`);return pt(t.Ji.Mi,t.Ji.Ni.Ki,this.Ki)}function vt(e,t){if(null===t){if(this.xj)throw new $e(`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 $e(`Cannot pass "${$t(t)}" as a ${this.name}`);if(!t.Ji.Mi)throw new $e(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.qj&&t.Ji.Ni.qj)throw new $e(`Cannot convert argument of type ${t.Ji.Ri?t.Ji.Ri.name:t.Ji.Ni.name} to parameter type ${this.name}`);if(r=pt(t.Ji.Mi,t.Ji.Ni.Ki,this.Ki),this.rj){if(void 0===t.Ji.Oi)throw new $e("Passing raw pointer to smart pointer is illegal");switch(this.vk){case 0:if(t.Ji.Ri!==this)throw new $e(`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,Wt((()=>n.delete()))),null!==e&&e.push(this.$i,r)}break;default:throw new $e("Unsupporting sharing policy")}}return r}function wt(e,t){if(null===t){if(this.xj)throw new $e(`null is not a valid ${this.name}`);return 0}if(!t.Ji)throw new $e(`Cannot pass "${$t(t)}" as a ${this.name}`);if(!t.Ji.Mi)throw new $e(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.Ji.Ni.qj)throw new $e(`Cannot convert argument of type ${t.Ji.Ni.name} to parameter type ${this.name}`);return pt(t.Ji.Mi,t.Ji.Ni.Ki,this.Ki)}function yt(e){return this.fromWireType(we[e>>2])}function Et(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=vt:(this.toWireType=n?bt:wt,this.Wi=null)}var Pt,kt,xt=(e,t,r)=>{if(!n.hasOwnProperty(e))throw new Ne("Replacing nonexistent public symbol");void 0!==n[e].Pi&&void 0!==r?n[e].Pi[r]=t:(n[e]=t,n[e].oj=r)},Tt=(e,t)=>{var r=(e=Je(e)).includes("j")?((e,t)=>(...r)=>((e,t,r=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0,n["dynCall_"+e])(t,...r)):t=Pt.get(t)(...r),t))(e,t,r))(e,t):Pt.get(t);if("function"!=typeof r)throw new $e(`unknown function pointer with signature ${e}: ${t}`);return r},St=e=>{e=Xo(e);var t=Je(e);return Jo(e),t},_t=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||He[t]||(qe[t]?qe[t].forEach(e):(r.push(t),n[t]=!0))})),new kt(`${e}: `+r.map(St).join([", "]))},jt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(we[t+4*n>>2]);return r},At=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Ft(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].Wi)return!0;return!1}function Ct(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=ft(t.name||"unknownFunctionName",(function(){}));return r.prototype=t.prototype,r=new r,(e=t.apply(r,e))instanceof Object?e:r}function Mt(e,t,r,n,i,a){var o=t.length;if(2>o)throw new $e("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==t[1]&&null!==r,l=Ft(t);for(r="void"!==t[0].name,n=[e,Ye,n,i,At,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=Ft(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=Ct(h)(...n),ft(e,t)}var Ot,Rt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},It=[],Lt=[],Bt=e=>{9<e&&0==--Lt[e+1]&&(Lt[e]=void 0,It.push(e))},Dt=e=>{if(!e)throw new $e("Cannot use deleted val. handle = "+e);return Lt[e]},Wt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=It.pop()||Lt.length;return Lt[t]=e,Lt[t+1]=1,t}},Ut={name:"emscripten::val",fromWireType:e=>{var t=Dt(e);return Bt(e),t},toWireType:(e,t)=>Wt(t),argPackAdvance:8,readValueFromPointer:yt,Wi:null},$t=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Nt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ye[e>>2])};case 8:return function(e){return this.fromWireType(Ee[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Gt=(e,t,r)=>{switch(t){case 1:return r?e=>me[e]:e=>ge[e];case 2:return r?e=>pe[e>>1]:e=>be[e>>1];case 4:return r?e=>ve[e>>2]:e=>we[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Vt=(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},zt=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},Xt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Jt=(e,t)=>{for(var r=e>>1,n=r+t/2;!(r>=n)&&be[r];)++r;if(32<(r<<=1)-e&&Xt)return Xt.decode(ge.subarray(e,r));for(r="",n=0;!(n>=t/2);++n){var i=pe[e+2*n>>1];if(0==i)break;r+=String.fromCharCode(i)}return r},Kt=(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)pe[t>>1]=e.charCodeAt(i),t+=2;return pe[t>>1]=0,t-n},Ht=e=>2*e.length,qt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var i=ve[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},Yt=(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)),ve[t>>2]=a,(t+=4)+4>r)break}return ve[t>>2]=0,t-n},Qt=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},Zt=(e,t)=>{var r=He[e];if(void 0===r)throw e=`${t} has unknown type ${St(e)}`,new $e(e);return r},er=(e,t,r)=>{var n=[];return e=e.toWireType(n,r),n.length&&(we[t>>2]=Wt(n)),e},tr=[],rr={},nr=e=>{var t=rr[e];return void 0===t?Je(e):t},ir=0,ar=(e,t)=>{if(pr=e,br=t,gr)if(fr||(ir+=1,fr=!0),0==e)hr=function(){var e=0|Math.max(0,or+t-Ot());setTimeout(sr,e)};else if(1==e)hr=function(){jr(sr)};else if(2==e){if(void 0===Or)if("undefined"==typeof setImmediate){var r=[];addEventListener("message",(e=>{"setimmediate"!==e.data&&"setimmediate"!==e.data.target||(e.stopPropagation(),r.shift()())}),!0),Or=function(e){r.push(e),postMessage("setimmediate","*")}}else Or=setImmediate;hr=function(){Or(sr)}}};Ot=()=>performance.now();var or,sr,lr,cr=e=>{if(!(e instanceof We||"u