@smileid/web-components 10.0.2 → 10.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { D as r } from "./DocumentCaptureScreens-ChpBVvNE.js";
1
+ import { D as r } from "./DocumentCaptureScreens-CkWKSrqy.js";
2
2
  export {
3
3
  r as default
4
4
  };
package/dist/esm/main.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { List as o, Option as t, Root as a, Trigger as s } from "./combobox.js";
2
- import { D as m } from "./DocumentCaptureScreens-ChpBVvNE.js";
2
+ import { D as m } from "./DocumentCaptureScreens-CkWKSrqy.js";
3
3
  import { E as f } from "./EndUserConsent-CMHp-34-.js";
4
4
  import { N as i } from "./Navigation-juBE4qOw.js";
5
- import { S as u } from "./SelfieCaptureScreens-DMo-z-32.js";
5
+ import { S as u } from "./SelfieCaptureScreens-BF1keQ0h.js";
6
6
  import { S as g } from "./SignaturePad-C7MtmT8m.js";
7
7
  import { T as d } from "./TotpConsent-CQU5jQi4.js";
8
8
  import { default as l } from "./smart-camera-web.js";
@@ -94,7 +94,7 @@ class a {
94
94
  }
95
95
  }
96
96
  }
97
- const o = "10.0.2", i = {
97
+ const o = "10.0.3", i = {
98
98
  version: o
99
99
  };
100
100
  export {
@@ -102,4 +102,4 @@ export {
102
102
  a as S,
103
103
  i as p
104
104
  };
105
- //# sourceMappingURL=package-D_4zJ9ck.js.map
105
+ //# sourceMappingURL=package-CmYr0HUS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-D_4zJ9ck.js","sources":["../../lib/domain/constants/src/Constants.js","../../lib/domain/camera/src/SmartCamera.js"],"sourcesContent":["/**\r\n * The type of image submitted in the job request\r\n * @readonly\r\n * @enum {number}\r\n */\r\nexport const IMAGE_TYPE = {\r\n /** ID_CARD_BACK_IMAGE_BASE64 Base64 encoded back of ID card image (.jpg or .png) */\r\n ID_CARD_BACK_IMAGE_BASE64: 7,\r\n /** ID_CARD_BACK_IMAGE_FILE Back of ID card image in .png or .jpg file format */\r\n ID_CARD_BACK_IMAGE_FILE: 5,\r\n /** ID_CARD_IMAGE_BASE64 Base64 encoded ID card image (.png or .jpg) */\r\n ID_CARD_IMAGE_BASE64: 3,\r\n /** ID_CARD_IMAGE_FILE ID card image in .png or .jpg file format */\r\n ID_CARD_IMAGE_FILE: 1,\r\n /** LIVENESS_IMAGE_BASE64 Base64 encoded liveness image (.jpg or .png) */\r\n LIVENESS_IMAGE_BASE64: 6,\r\n /** LIVENESS_IMAGE_FILE Liveness image in .png or .jpg file format */\r\n LIVENESS_IMAGE_FILE: 4,\r\n /** SELFIE_IMAGE_BASE64 Base64 encoded selfie image (.png or .jpg) */\r\n SELFIE_IMAGE_BASE64: 2,\r\n /** SELFIE_IMAGE_FILE Selfie image in .png or .jpg file format */\r\n SELFIE_IMAGE_FILE: 0,\r\n};\r\n\r\nexport const DEFAULT_NO_OF_LIVENESS_FRAMES = 8;\r\nexport const PORTRAIT_ID_PREVIEW_WIDTH = 396;\r\nexport const PORTRAIT_ID_PREVIEW_HEIGHT = 527;\r\n","class SmartCamera {\r\n static stream = null;\r\n\r\n static async getMedia(constraints) {\r\n SmartCamera.stream = await navigator.mediaDevices.getUserMedia(constraints);\r\n return SmartCamera.stream;\r\n }\r\n\r\n static environmentOptions = {\r\n facingMode: 'environment',\r\n height: {\r\n ideal: 1080,\r\n max: 1440,\r\n min: 720,\r\n },\r\n width: {\r\n ideal: 1920,\r\n max: 2560,\r\n min: 1280,\r\n },\r\n // NOTE: Special case for multi-camera Samsung devices (learnt from Acuant)\r\n // \"We found out that some triple camera Samsung devices (S10, S20, Note 20, etc) capture images blurry at edges.\r\n // Zooming to 2X, matching the telephoto lens, doesn't solve it completely but mitigates it.\"\r\n zoom: SmartCamera.isSamsungMultiCameraDevice() ? 2.0 : 1.0,\r\n };\r\n\r\n static stopMedia() {\r\n if (SmartCamera.stream) {\r\n SmartCamera.stream.getTracks().forEach((track) => track.stop());\r\n SmartCamera.stream = null;\r\n }\r\n }\r\n\r\n static async supportsAgentMode() {\r\n try {\r\n const devices = await navigator.mediaDevices.enumerateDevices();\r\n const videoDevices = devices.filter(\r\n (device) => device.kind === 'videoinput',\r\n );\r\n\r\n let hasBackCamera = false;\r\n\r\n videoDevices.forEach((device) => {\r\n // Check if the device label or device ID indicates a back camera\r\n if (\r\n device.label.toLowerCase().includes('back') ||\r\n device.label.toLowerCase().includes('rear')\r\n ) {\r\n hasBackCamera = true;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n return hasBackCamera;\r\n } catch (error) {\r\n console.warn('Error accessing media devices: ', error);\r\n return false;\r\n }\r\n }\r\n\r\n static isSamsungMultiCameraDevice() {\r\n const matchedModelNumber = navigator.userAgent.match(/SM-[N|G]\\d{3}/);\r\n if (!matchedModelNumber) {\r\n return false;\r\n }\r\n\r\n const modelNumber = parseInt(matchedModelNumber[0].match(/\\d{3}/)[0], 10);\r\n const smallerModelNumber = 970; // S10e\r\n return !Number.isNaN(modelNumber) && modelNumber >= smallerModelNumber;\r\n }\r\n\r\n static handleCameraError(e) {\r\n switch (e.name) {\r\n case 'NotAllowedError':\r\n case 'SecurityError':\r\n return `\r\n Looks like camera access was not granted, or was blocked by a browser\r\n level setting / extension. Please follow the prompt from the URL bar,\r\n or extensions, and enable access.\r\n You may need to refresh to start all over again\r\n `;\r\n case 'AbortError':\r\n return `\r\n Oops! Something happened, and we lost access to your stream.\r\n Please refresh to start all over again\r\n `;\r\n case 'NotReadableError':\r\n return `\r\n There seems to be a problem with your device's camera, or its connection.\r\n Please check this, and when resolved, try again. Or try another device.\r\n `;\r\n case 'NotFoundError':\r\n return `\r\n We are unable to find a video stream.\r\n You may need to refresh to start all over again\r\n `;\r\n case 'TypeError':\r\n return `\r\n This site is insecure, and as such cannot have access to your camera.\r\n Try to navigate to a secure version of this page, or contact the owner.\r\n `;\r\n default:\r\n return e.message;\r\n }\r\n }\r\n}\r\n\r\nexport default SmartCamera;\r\n"],"names":["IMAGE_TYPE","SmartCamera","constraints","track","videoDevices","device","hasBackCamera","error","matchedModelNumber","modelNumber"],"mappings":"AAKY,MAACA,IAAa;AAAA;AAAA,EAExB,2BAA2B;AAAA;AAAA,EAE3B,yBAAyB;AAAA;AAAA,EAEzB,sBAAsB;AAAA;AAAA,EAEtB,oBAAoB;AAAA;AAAA,EAEpB,uBAAuB;AAAA;AAAA,EAEvB,qBAAqB;AAAA;AAAA,EAErB,qBAAqB;AAAA;AAAA,EAErB,mBAAmB;AACrB;ACtBA,MAAMC,EAAY;AAAA,EAChB,OAAO,SAAS;AAAA,EAEhB,aAAa,SAASC,GAAa;AACjC,WAAAD,EAAY,SAAS,MAAM,UAAU,aAAa,aAAaC,CAAW,GACnED,EAAY;AAAA,EACpB;AAAA,EAED,OAAO,qBAAqB;AAAA,IAC1B,YAAY;AAAA,IACZ,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,KAAK;AAAA,MACL,KAAK;AAAA,IACN;AAAA,IACD,OAAO;AAAA,MACL,OAAO;AAAA,MACP,KAAK;AAAA,MACL,KAAK;AAAA,IACN;AAAA;AAAA;AAAA;AAAA,IAID,MAAMA,EAAY,2BAA4B,IAAG,IAAM;AAAA,EAC3D;AAAA,EAEE,OAAO,YAAY;AACjB,IAAIA,EAAY,WACdA,EAAY,OAAO,YAAY,QAAQ,CAACE,MAAUA,EAAM,KAAI,CAAE,GAC9DF,EAAY,SAAS;AAAA,EAExB;AAAA,EAED,aAAa,oBAAoB;AAC/B,QAAI;AAEF,YAAMG,KADU,MAAM,UAAU,aAAa,iBAAgB,GAChC;AAAA,QAC3B,CAACC,MAAWA,EAAO,SAAS;AAAA,MACpC;AAEM,UAAIC,IAAgB;AAEpB,aAAAF,EAAa,QAAQ,CAACC,MAGlBA,EAAO,MAAM,cAAc,SAAS,MAAM,KAC1CA,EAAO,MAAM,cAAc,SAAS,MAAM,KAE1CC,IAAgB,IACT,MAEF,EACR,GAEMA;AAAA,IACR,SAAQC,GAAO;AACd,qBAAQ,KAAK,mCAAmCA,CAAK,GAC9C;AAAA,IACR;AAAA,EACF;AAAA,EAED,OAAO,6BAA6B;AAClC,UAAMC,IAAqB,UAAU,UAAU,MAAM,eAAe;AACpE,QAAI,CAACA;AACH,aAAO;AAGT,UAAMC,IAAc,SAASD,EAAmB,CAAC,EAAE,MAAM,OAAO,EAAE,CAAC,GAAG,EAAE;AAExE,WAAO,CAAC,OAAO,MAAMC,CAAW,KAAKA,KADV;AAAA,EAE5B;AAAA,EAED,OAAO,kBAAkB,GAAG;AAC1B,YAAQ,EAAE,MAAI;AAAA,MACZ,KAAK;AAAA,MACL,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT;AACE,eAAO,EAAE;AAAA,IACZ;AAAA,EACF;AACH;;;;"}
1
+ {"version":3,"file":"package-CmYr0HUS.js","sources":["../../lib/domain/constants/src/Constants.js","../../lib/domain/camera/src/SmartCamera.js"],"sourcesContent":["/**\r\n * The type of image submitted in the job request\r\n * @readonly\r\n * @enum {number}\r\n */\r\nexport const IMAGE_TYPE = {\r\n /** ID_CARD_BACK_IMAGE_BASE64 Base64 encoded back of ID card image (.jpg or .png) */\r\n ID_CARD_BACK_IMAGE_BASE64: 7,\r\n /** ID_CARD_BACK_IMAGE_FILE Back of ID card image in .png or .jpg file format */\r\n ID_CARD_BACK_IMAGE_FILE: 5,\r\n /** ID_CARD_IMAGE_BASE64 Base64 encoded ID card image (.png or .jpg) */\r\n ID_CARD_IMAGE_BASE64: 3,\r\n /** ID_CARD_IMAGE_FILE ID card image in .png or .jpg file format */\r\n ID_CARD_IMAGE_FILE: 1,\r\n /** LIVENESS_IMAGE_BASE64 Base64 encoded liveness image (.jpg or .png) */\r\n LIVENESS_IMAGE_BASE64: 6,\r\n /** LIVENESS_IMAGE_FILE Liveness image in .png or .jpg file format */\r\n LIVENESS_IMAGE_FILE: 4,\r\n /** SELFIE_IMAGE_BASE64 Base64 encoded selfie image (.png or .jpg) */\r\n SELFIE_IMAGE_BASE64: 2,\r\n /** SELFIE_IMAGE_FILE Selfie image in .png or .jpg file format */\r\n SELFIE_IMAGE_FILE: 0,\r\n};\r\n\r\nexport const DEFAULT_NO_OF_LIVENESS_FRAMES = 8;\r\nexport const PORTRAIT_ID_PREVIEW_WIDTH = 396;\r\nexport const PORTRAIT_ID_PREVIEW_HEIGHT = 527;\r\n","class SmartCamera {\r\n static stream = null;\r\n\r\n static async getMedia(constraints) {\r\n SmartCamera.stream = await navigator.mediaDevices.getUserMedia(constraints);\r\n return SmartCamera.stream;\r\n }\r\n\r\n static environmentOptions = {\r\n facingMode: 'environment',\r\n height: {\r\n ideal: 1080,\r\n max: 1440,\r\n min: 720,\r\n },\r\n width: {\r\n ideal: 1920,\r\n max: 2560,\r\n min: 1280,\r\n },\r\n // NOTE: Special case for multi-camera Samsung devices (learnt from Acuant)\r\n // \"We found out that some triple camera Samsung devices (S10, S20, Note 20, etc) capture images blurry at edges.\r\n // Zooming to 2X, matching the telephoto lens, doesn't solve it completely but mitigates it.\"\r\n zoom: SmartCamera.isSamsungMultiCameraDevice() ? 2.0 : 1.0,\r\n };\r\n\r\n static stopMedia() {\r\n if (SmartCamera.stream) {\r\n SmartCamera.stream.getTracks().forEach((track) => track.stop());\r\n SmartCamera.stream = null;\r\n }\r\n }\r\n\r\n static async supportsAgentMode() {\r\n try {\r\n const devices = await navigator.mediaDevices.enumerateDevices();\r\n const videoDevices = devices.filter(\r\n (device) => device.kind === 'videoinput',\r\n );\r\n\r\n let hasBackCamera = false;\r\n\r\n videoDevices.forEach((device) => {\r\n // Check if the device label or device ID indicates a back camera\r\n if (\r\n device.label.toLowerCase().includes('back') ||\r\n device.label.toLowerCase().includes('rear')\r\n ) {\r\n hasBackCamera = true;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n return hasBackCamera;\r\n } catch (error) {\r\n console.warn('Error accessing media devices: ', error);\r\n return false;\r\n }\r\n }\r\n\r\n static isSamsungMultiCameraDevice() {\r\n const matchedModelNumber = navigator.userAgent.match(/SM-[N|G]\\d{3}/);\r\n if (!matchedModelNumber) {\r\n return false;\r\n }\r\n\r\n const modelNumber = parseInt(matchedModelNumber[0].match(/\\d{3}/)[0], 10);\r\n const smallerModelNumber = 970; // S10e\r\n return !Number.isNaN(modelNumber) && modelNumber >= smallerModelNumber;\r\n }\r\n\r\n static handleCameraError(e) {\r\n switch (e.name) {\r\n case 'NotAllowedError':\r\n case 'SecurityError':\r\n return `\r\n Looks like camera access was not granted, or was blocked by a browser\r\n level setting / extension. Please follow the prompt from the URL bar,\r\n or extensions, and enable access.\r\n You may need to refresh to start all over again\r\n `;\r\n case 'AbortError':\r\n return `\r\n Oops! Something happened, and we lost access to your stream.\r\n Please refresh to start all over again\r\n `;\r\n case 'NotReadableError':\r\n return `\r\n There seems to be a problem with your device's camera, or its connection.\r\n Please check this, and when resolved, try again. Or try another device.\r\n `;\r\n case 'NotFoundError':\r\n return `\r\n We are unable to find a video stream.\r\n You may need to refresh to start all over again\r\n `;\r\n case 'TypeError':\r\n return `\r\n This site is insecure, and as such cannot have access to your camera.\r\n Try to navigate to a secure version of this page, or contact the owner.\r\n `;\r\n default:\r\n return e.message;\r\n }\r\n }\r\n}\r\n\r\nexport default SmartCamera;\r\n"],"names":["IMAGE_TYPE","SmartCamera","constraints","track","videoDevices","device","hasBackCamera","error","matchedModelNumber","modelNumber"],"mappings":"AAKY,MAACA,IAAa;AAAA;AAAA,EAExB,2BAA2B;AAAA;AAAA,EAE3B,yBAAyB;AAAA;AAAA,EAEzB,sBAAsB;AAAA;AAAA,EAEtB,oBAAoB;AAAA;AAAA,EAEpB,uBAAuB;AAAA;AAAA,EAEvB,qBAAqB;AAAA;AAAA,EAErB,qBAAqB;AAAA;AAAA,EAErB,mBAAmB;AACrB;ACtBA,MAAMC,EAAY;AAAA,EAChB,OAAO,SAAS;AAAA,EAEhB,aAAa,SAASC,GAAa;AACjC,WAAAD,EAAY,SAAS,MAAM,UAAU,aAAa,aAAaC,CAAW,GACnED,EAAY;AAAA,EACpB;AAAA,EAED,OAAO,qBAAqB;AAAA,IAC1B,YAAY;AAAA,IACZ,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,KAAK;AAAA,MACL,KAAK;AAAA,IACN;AAAA,IACD,OAAO;AAAA,MACL,OAAO;AAAA,MACP,KAAK;AAAA,MACL,KAAK;AAAA,IACN;AAAA;AAAA;AAAA;AAAA,IAID,MAAMA,EAAY,2BAA4B,IAAG,IAAM;AAAA,EAC3D;AAAA,EAEE,OAAO,YAAY;AACjB,IAAIA,EAAY,WACdA,EAAY,OAAO,YAAY,QAAQ,CAACE,MAAUA,EAAM,KAAI,CAAE,GAC9DF,EAAY,SAAS;AAAA,EAExB;AAAA,EAED,aAAa,oBAAoB;AAC/B,QAAI;AAEF,YAAMG,KADU,MAAM,UAAU,aAAa,iBAAgB,GAChC;AAAA,QAC3B,CAACC,MAAWA,EAAO,SAAS;AAAA,MACpC;AAEM,UAAIC,IAAgB;AAEpB,aAAAF,EAAa,QAAQ,CAACC,MAGlBA,EAAO,MAAM,cAAc,SAAS,MAAM,KAC1CA,EAAO,MAAM,cAAc,SAAS,MAAM,KAE1CC,IAAgB,IACT,MAEF,EACR,GAEMA;AAAA,IACR,SAAQC,GAAO;AACd,qBAAQ,KAAK,mCAAmCA,CAAK,GAC9C;AAAA,IACR;AAAA,EACF;AAAA,EAED,OAAO,6BAA6B;AAClC,UAAMC,IAAqB,UAAU,UAAU,MAAM,eAAe;AACpE,QAAI,CAACA;AACH,aAAO;AAGT,UAAMC,IAAc,SAASD,EAAmB,CAAC,EAAE,MAAM,OAAO,EAAE,CAAC,GAAG,EAAE;AAExE,WAAO,CAAC,OAAO,MAAMC,CAAW,KAAKA,KADV;AAAA,EAE5B;AAAA,EAED,OAAO,kBAAkB,GAAG;AAC1B,YAAQ,EAAE,MAAI;AAAA,MACZ,KAAK;AAAA,MACL,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT,KAAK;AACH,eAAO;AAAA;AAAA;AAAA;AAAA,MAIT;AACE,eAAO,EAAE;AAAA,IACZ;AAAA,EACF;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import { S as r } from "./SelfieCaptureScreens-DMo-z-32.js";
1
+ import { S as r } from "./SelfieCaptureScreens-BF1keQ0h.js";
2
2
  export {
3
3
  r as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import { s as a } from "./styles-D2i3GFLK.js";
2
- import { S as i, p as n } from "./package-D_4zJ9ck.js";
3
- import "./DocumentCaptureScreens-ChpBVvNE.js";
4
- import "./SelfieCaptureScreens-DMo-z-32.js";
2
+ import { S as i, p as n } from "./package-CmYr0HUS.js";
3
+ import "./DocumentCaptureScreens-CkWKSrqy.js";
4
+ import "./SelfieCaptureScreens-BF1keQ0h.js";
5
5
  import "./PoweredBySmileId-CxbaihMu.js";
6
6
  import "./Navigation-juBE4qOw.js";
7
7
  function o() {
@@ -1296,7 +1296,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
1296
1296
  </section>
1297
1297
  </div>
1298
1298
  ${qt(this.themeColor)}
1299
- `}class ll extends HTMLElement{constructor(){super(),this.templateString=cl.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.takeDocumentPhotoButton=this.shadowRoot.querySelector("#take-photo"),this.uploadDocumentPhotoButton=this.shadowRoot.querySelector("#upload-photo"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.takeDocumentPhotoButton&&this.takeDocumentPhotoButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-instructions.capture"))}),this.uploadDocumentPhotoButton&&this.uploadDocumentPhotoButton.addEventListener("change",async i=>{this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:n}=i.target,r=await sl.retrieve(n);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:r,previewImage:r}}))}catch(n){this.shadowRoot.querySelector("#error").innerHTML=n.message}})}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const e=this.documentCaptureModes;return e.includes("camera")&&e.includes("upload")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.close"))}}"customElements"in window&&!customElements.get("document-capture-instructions")&&window.customElements.define("document-capture-instructions",ll);const $i={version:"10.0.2"},hl=$i.version,Nt=document.querySelector("smart-camera-web");async function we(t){try{const e=await A.getMedia({audio:!1,video:A.environmentOptions}),n=(await navigator.mediaDevices.enumerateDevices()).find(r=>r.kind==="videoinput"&&e.getVideoTracks()[0].getSettings().deviceId===r.deviceId);Nt?.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:n?.label}})),t.removeAttribute("data-camera-error"),t.setAttribute("data-camera-ready",!0)}catch(e){t.removeAttribute("data-camera-ready"),t.setAttribute("data-camera-error",A.handleCameraError(e))}}class Bo extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),Nt?.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1299
+ `}class ll extends HTMLElement{constructor(){super(),this.templateString=cl.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.takeDocumentPhotoButton=this.shadowRoot.querySelector("#take-photo"),this.uploadDocumentPhotoButton=this.shadowRoot.querySelector("#upload-photo"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.takeDocumentPhotoButton&&this.takeDocumentPhotoButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-instructions.capture"))}),this.uploadDocumentPhotoButton&&this.uploadDocumentPhotoButton.addEventListener("change",async i=>{this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:n}=i.target,r=await sl.retrieve(n);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:r,previewImage:r}}))}catch(n){this.shadowRoot.querySelector("#error").innerHTML=n.message}})}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const e=this.documentCaptureModes;return e.includes("camera")&&e.includes("upload")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.close"))}}"customElements"in window&&!customElements.get("document-capture-instructions")&&window.customElements.define("document-capture-instructions",ll);const $i={version:"10.0.3"},hl=$i.version,Nt=document.querySelector("smart-camera-web");async function we(t){try{const e=await A.getMedia({audio:!1,video:A.environmentOptions}),n=(await navigator.mediaDevices.enumerateDevices()).find(r=>r.kind==="videoinput"&&e.getVideoTracks()[0].getSettings().deviceId===r.deviceId);Nt?.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:n?.label}})),t.removeAttribute("data-camera-error"),t.setAttribute("data-camera-ready",!0)}catch(e){t.removeAttribute("data-camera-ready"),t.setAttribute("data-camera-error",A.handleCameraError(e))}}class Bo extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),Nt?.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1300
1300
  ${qt(this.themeColor)}
1301
1301
  <div>
1302
1302
  <document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
@@ -3154,6 +3154,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
3154
3154
  id='document-capture-review-image'
3155
3155
  src='${this.imageSrc}'
3156
3156
  width='396'
3157
+ style='transform: scaleX(-1);'
3157
3158
  />`:""}
3158
3159
  </div>
3159
3160
  <div class='flow action-buttons'>
@@ -3224,7 +3225,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
3224
3225
  overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
3225
3226
  gl_FragColor = mix(defaultColor, overlayColor, confidence);
3226
3227
  }
3227
- `}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=De(this,t),t.activeTexture(t.TEXTURE2),this.B=De(this,t)}m(){super.m();const t=this.g;this.K=vt(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=vt(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=vt(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.H,0),t.uniform1i(this.K,1),t.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function ge(t,e){switch(e){case 0:return t.g.find(i=>i instanceof Uint8Array);case 1:return t.g.find(i=>i instanceof Float32Array);case 2:return t.g.find(i=>typeof WebGLTexture<"u"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function eo(t){var e=ge(t,1);if(!e){if(e=ge(t,0))e=new Float32Array(e).map(n=>n/255);else{e=new Float32Array(t.width*t.height);const n=Li(t);var i=io(t);if(lr(i,n,t2(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){i=new Float32Array(t.width*t.height*4),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,i);for(let r=0,s=0;r<e.length;++r,s+=4)e[r]=i[s]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function t2(t){let e=ge(t,2);if(!e){const i=Li(t);e=i2(t);const n=eo(t),r=e2(t);i.texImage2D(i.TEXTURE_2D,0,r,t.width,t.height,0,i.RED,i.FLOAT,n),no(t)}return e}function Li(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=vt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function e2(t){if(t=Li(t),!hr)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))hr=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");hr=t.R16F}return hr}function io(t){return t.l||(t.l=new Si),t.l}function i2(t){const e=Li(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=ge(t,2);return i||(i=De(io(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(i),t.j=!0),e.bindTexture(e.TEXTURE_2D,i),i}function no(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var hr,at=class{constructor(t,e,i,n,r,s,o){this.g=t,this.m=e,this.j=i,this.canvas=n,this.l=r,this.width=s,this.height=o,this.j&&--n2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!ge(this,0)}ja(){return!!ge(this,1)}R(){return!!ge(this,2)}ia(){return(e=ge(t=this,0))||(e=eo(t),e=new Uint8Array(e.map(i=>255*i)),t.g.push(e)),e;var t,e}ha(){return eo(this)}N(){return t2(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof Uint8Array)i=new Uint8Array(e);else if(e instanceof Float32Array)i=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const n=Li(this),r=io(this);n.activeTexture(n.TEXTURE1),i=De(r,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,i);const s=e2(this);n.texImage2D(n.TEXTURE_2D,0,s,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),lr(r,n,i),cn(r,n,!1,()=>{i2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),no(this)}),to(r),no(this)}}t.push(i)}return new at(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Li(this).deleteTexture(ge(this,2)),n2=-1}};at.prototype.close=at.prototype.close,at.prototype.clone=at.prototype.clone,at.prototype.getAsWebGLTexture=at.prototype.N,at.prototype.getAsFloat32Array=at.prototype.ha,at.prototype.getAsUint8Array=at.prototype.ia,at.prototype.hasWebGLTexture=at.prototype.R,at.prototype.hasFloat32Array=at.prototype.ja,at.prototype.hasUint8Array=at.prototype.Da;var n2=250;const b0={color:"white",lineWidth:4,radius:6};function ro(t){return{...b0,fillColor:(t=t||{}).color,...t}}function ve(t,e){return t instanceof Function?t(e):t}function r2(t,e,i){return Math.max(Math.min(e,i),Math.min(Math.max(e,i),t))}function ln(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function hn(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function s2(t,e,i){if(e.R())i(e.N());else{const n=e.ja()?e.ha():e.ia();t.m=t.m??new Si;const r=hn(t);i((t=new at([n],e.m,!1,r.canvas,t.m,e.width,e.height)).N()),t.close()}}function o2(t,e,i,n){const r=function(a){return a.g||(a.g=new g0),a.g}(t),s=hn(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;cn(r,s,!0,()=>{(function(c,l,d,h){const u=c.g;if(u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,l),u.activeTexture(u.TEXTURE1),u.bindTexture(u.TEXTURE_2D,c.B),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,d),c.H&&function(p,f){if(p!==f)return!1;p=p.entries(),f=f.entries();for(const[g,v]of p){p=g;const b=v;var m=f.next();if(m.done)return!1;const[k,S]=m.value;if(m=S,p!==k||b[0]!==m[0]||b[1]!==m[1]||b[2]!==m[2]||b[3]!==m[3])return!1}return!!f.next().done}(c.H,h))u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j);else{c.H=h;const p=Array(1024).fill(0);h.forEach((f,m)=>{if(f.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);p[4*m]=f[0],p[4*m+1]=f[1],p[4*m+2]=f[2],p[4*m+3]=f[3]}),u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,256,1,0,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array(p))}})(r,e,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);const a=r.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function a2(t,e,i,n){const r=hn(t),s=function(c){return c.h||(c.h=new v0),c.h}(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;cn(s,r,!0,()=>{var c=s.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,e),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,s.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,o),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,s.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),r.bindTexture(r.TEXTURE_2D,null),(c=s.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var bt=class{constructor(t,e){typeof CanvasRenderingContext2D<"u"&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}wa(t,e){if(t){var i=ln(this);e=ro(e),i.save();var n=i.canvas,r=0;for(const s of t)i.fillStyle=ve(e.fillColor,{index:r,from:s}),i.strokeStyle=ve(e.color,{index:r,from:s}),i.lineWidth=ve(e.lineWidth,{index:r,from:s}),(t=new Path2D).arc(s.x*n.width,s.y*n.height,ve(e.radius,{index:r,from:s}),0,2*Math.PI),i.fill(t),i.stroke(t),++r;i.restore()}}va(t,e,i){if(t&&e){var n=ln(this);i=ro(i),n.save();var r=n.canvas,s=0;for(const o of e){n.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(n.strokeStyle=ve(i.color,{index:s,from:e,to:a}),n.lineWidth=ve(i.lineWidth,{index:s,from:e,to:a}),n.moveTo(e.x*r.width,e.y*r.height),n.lineTo(a.x*r.width,a.y*r.height)),++s,n.stroke()}n.restore()}}sa(t,e){const i=ln(this);e=ro(e),i.save(),i.beginPath(),i.lineWidth=ve(e.lineWidth,{}),i.strokeStyle=ve(e.color,{}),i.fillStyle=ve(e.fillColor,{}),i.moveTo(t.originX,t.originY),i.lineTo(t.originX+t.width,t.originY),i.lineTo(t.originX+t.width,t.originY+t.height),i.lineTo(t.originX,t.originY+t.height),i.lineTo(t.originX,t.originY),i.stroke(),i.fill(),i.restore()}ta(t,e,i=[0,0,0,255]){this.l?function(n,r,s,o){const a=hn(n);s2(n,r,c=>{o2(n,c,s,o),(c=ln(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,i,e):o2(this,t.N(),i,e)}ua(t,e,i){this.l?function(n,r,s,o){const a=hn(n);s2(n,r,c=>{a2(n,c,s,o),(c=ln(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,e,i):a2(this,t.N(),e,i)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function re(t,e){switch(e){case 0:return t.g.find(i=>i instanceof ImageData);case 1:return t.g.find(i=>typeof ImageBitmap<"u"&&i instanceof ImageBitmap);case 2:return t.g.find(i=>typeof WebGLTexture<"u"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function c2(t){var e=re(t,0);if(!e){e=Mi(t);const i=ur(t),n=new Uint8Array(t.width*t.height*4);lr(i,e,dr(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),to(i),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function dr(t){let e=re(t,2);if(!e){const i=Mi(t);e=pr(t);const n=re(t,1)||c2(t);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),dn(t)}return e}function Mi(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=vt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ur(t){return t.l||(t.l=new Si),t.l}function pr(t){const e=Mi(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=re(t,2);return i||(i=De(ur(t),e),t.g.push(i),t.m=!0),e.bindTexture(e.TEXTURE_2D,i),i}function dn(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function l2(t){const e=Mi(t);return cn(ur(t),e,!0,()=>function(i,n){const r=i.canvas;if(r.width===i.width&&r.height===i.height)return n();const s=r.width,o=r.height;return r.width=i.width,r.height=i.height,i=n(),r.width=s,r.height=o,i}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}bt.prototype.close=bt.prototype.close,bt.prototype.drawConfidenceMask=bt.prototype.ua,bt.prototype.drawCategoryMask=bt.prototype.ta,bt.prototype.drawBoundingBox=bt.prototype.sa,bt.prototype.drawConnectors=bt.prototype.va,bt.prototype.drawLandmarks=bt.prototype.wa,bt.lerp=function(t,e,i,n,r){return r2(n*(1-(t-e)/(i-e))+r*(1-(i-t)/(i-e)),n,r)},bt.clamp=r2;var ct=class{constructor(t,e,i,n,r,s,o){this.g=t,this.j=e,this.m=i,this.canvas=n,this.l=r,this.width=s,this.height=o,(this.j||this.m)&&--h2===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!re(this,0)}ka(){return!!re(this,1)}R(){return!!re(this,2)}Aa(){return c2(this)}za(){var t=re(this,1);return t||(dr(this),pr(this),t=l2(this),dn(this),this.g.push(t),this.j=!0),t}N(){return dr(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof ImageData)i=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const n=Mi(this),r=ur(this);n.activeTexture(n.TEXTURE1),i=De(r,n),n.bindTexture(n.TEXTURE_2D,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindTexture(n.TEXTURE_2D,null),lr(r,n,i),cn(r,n,!1,()=>{pr(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),dn(this)}),to(r),dn(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);dr(this),pr(this),i=l2(this),dn(this)}t.push(i)}return new ct(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&re(this,1).close(),this.m&&Mi(this).deleteTexture(re(this,2)),h2=-1}};ct.prototype.close=ct.prototype.close,ct.prototype.clone=ct.prototype.clone,ct.prototype.getAsWebGLTexture=ct.prototype.N,ct.prototype.getAsImageBitmap=ct.prototype.za,ct.prototype.getAsImageData=ct.prototype.Aa,ct.prototype.hasWebGLTexture=ct.prototype.R,ct.prototype.hasImageBitmap=ct.prototype.ka,ct.prototype.hasImageData=ct.prototype.Ca;var h2=250;function Qt(...t){return t.map(([e,i])=>({start:e,end:i}))}const w0=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((d2=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",e!==void 0?this.i.canvas=e:Zc()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph(new TextEncoder().encode(t),!1)}setGraph(t,e){const i=t.length,n=this.i._malloc(i);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(i,n):this.i._changeTextGraph(i,n),this.i._free(n)}configureAudio(t,e,i,n,r){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),x(this,n||"input_audio",s=>{x(this,r=r||"audio_header",o=>{this.i._configureAudio(s,o,t,e??0,i)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){ne(this,"__graph_config__",e=>{t(e)}),x(this,"__graph_config__",e=>{this.i._getGraphConfig(e,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,i){this.addAudioToStreamWithShape(t,0,0,e,i)}addAudioToStreamWithShape(t,e,i,n,r){const s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),x(this,n,o=>{this.i._addAudioToInputStream(this.g,e,i,o,r)})}addGpuBufferToStream(t,e,i){x(this,e,n=>{const[r,s]=Xc(this,t,n);this.i._addBoundTextureToStream(n,r,s,i)})}addBoolToStream(t,e,i){x(this,e,n=>{this.i._addBoolToInputStream(t,n,i)})}addDoubleToStream(t,e,i){x(this,e,n=>{this.i._addDoubleToInputStream(t,n,i)})}addFloatToStream(t,e,i){x(this,e,n=>{this.i._addFloatToInputStream(t,n,i)})}addIntToStream(t,e,i){x(this,e,n=>{this.i._addIntToInputStream(t,n,i)})}addUintToStream(t,e,i){x(this,e,n=>{this.i._addUintToInputStream(t,n,i)})}addStringToStream(t,e,i){x(this,e,n=>{x(this,t,r=>{this.i._addStringToInputStream(r,n,i)})})}addStringRecordToStream(t,e,i){x(this,e,n=>{Yc(this,Object.keys(t),r=>{Yc(this,Object.values(t),s=>{this.i._addFlatHashMapToInputStream(r,s,Object.keys(t).length,n,i)})})})}addProtoToStream(t,e,i,n){x(this,i,r=>{x(this,e,s=>{const o=this.i._malloc(t.length);this.i.HEAPU8.set(t,o),this.i._addProtoToInputStream(o,t.length,s,r,n),this.i._free(o)})})}addEmptyPacketToStream(t,e){x(this,t,i=>{this.i._addEmptyPacketToInputStream(i,e)})}addBoolVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const s of t)this.i._addBoolVectorEntry(r,s);this.i._addBoolVectorToInputStream(r,n,i)})}addDoubleVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const s of t)this.i._addDoubleVectorEntry(r,s);this.i._addDoubleVectorToInputStream(r,n,i)})}addFloatVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const s of t)this.i._addFloatVectorEntry(r,s);this.i._addFloatVectorToInputStream(r,n,i)})}addIntVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const s of t)this.i._addIntVectorEntry(r,s);this.i._addIntVectorToInputStream(r,n,i)})}addUintVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of t)this.i._addUintVectorEntry(r,s);this.i._addUintVectorToInputStream(r,n,i)})}addStringVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const s of t)x(this,s,o=>{this.i._addStringVectorEntry(r,o)});this.i._addStringVectorToInputStream(r,n,i)})}addBoolToInputSidePacket(t,e){x(this,e,i=>{this.i._addBoolToInputSidePacket(t,i)})}addDoubleToInputSidePacket(t,e){x(this,e,i=>{this.i._addDoubleToInputSidePacket(t,i)})}addFloatToInputSidePacket(t,e){x(this,e,i=>{this.i._addFloatToInputSidePacket(t,i)})}addIntToInputSidePacket(t,e){x(this,e,i=>{this.i._addIntToInputSidePacket(t,i)})}addUintToInputSidePacket(t,e){x(this,e,i=>{this.i._addUintToInputSidePacket(t,i)})}addStringToInputSidePacket(t,e){x(this,e,i=>{x(this,t,n=>{this.i._addStringToInputSidePacket(n,i)})})}addProtoToInputSidePacket(t,e,i){x(this,i,n=>{x(this,e,r=>{const s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputSidePacket(s,t.length,r,n),this.i._free(s)})})}addBoolVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const r of t)this.i._addBoolVectorEntry(n,r);this.i._addBoolVectorToInputSidePacket(n,i)})}addDoubleVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const r of t)this.i._addDoubleVectorEntry(n,r);this.i._addDoubleVectorToInputSidePacket(n,i)})}addFloatVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const r of t)this.i._addFloatVectorEntry(n,r);this.i._addFloatVectorToInputSidePacket(n,i)})}addIntVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const r of t)this.i._addIntVectorEntry(n,r);this.i._addIntVectorToInputSidePacket(n,i)})}addUintVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const r of t)this.i._addUintVectorEntry(n,r);this.i._addUintVectorToInputSidePacket(n,i)})}addStringVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const r of t)x(this,r,s=>{this.i._addStringVectorEntry(n,s)});this.i._addStringVectorToInputSidePacket(n,i)})}attachBoolListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(t,e,i){ne(this,t,e),x(this,t,n=>{this.i._attachProtoListener(n,i||!1)})}attachProtoVectorListener(t,e,i){Fe(this,t,e),x(this,t,n=>{this.i._attachProtoVectorListener(n,i||!1)})}attachAudioListener(t,e,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ne(this,t,(n,r)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),e(n,r)}),x(this,t,n=>{this.i._attachAudioListener(n,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends d2{get ea(){return this.i}oa(t,e,i){x(this,e,n=>{const[r,s]=Xc(this,t,n);this.ea._addBoundTextureAsImageToStream(n,r,s,i)})}V(t,e){ne(this,t,e),x(this,t,i=>{this.ea._attachImageListener(i)})}ba(t,e){Fe(this,t,e),x(this,t,i=>{this.ea._attachImageVectorListener(i)})}}));var d2,jt=class extends w0{};async function M(t,e,i){return async function(n,r,s,o){return f0(n,r,s,o)}(t,i.canvas??(Zc()?void 0:document.createElement("canvas")),e,i)}function u2(t,e,i,n){if(t.U){const s=new fc;if(i?.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var r=i.regionOfInterest;if(r.left>=r.right||r.top>=r.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(r.left<0||r.top<0||r.right>1||r.bottom>1)throw Error("Expected RectF values to be in [0,1].");_(s,1,(r.left+r.right)/2),_(s,2,(r.top+r.bottom)/2),_(s,4,r.right-r.left),_(s,3,r.bottom-r.top)}else _(s,1,.5),_(s,2,.5),_(s,4,1),_(s,3,1);if(i?.rotationDegrees){if(i?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(_(s,5,-Math.PI*i.rotationDegrees/180),i?.rotationDegrees%180!=0){const[o,a]=qc(e);i=K(s,3)*a/o,r=K(s,4)*o/a,_(s,4,i),_(s,3,r)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,n)}t.g.oa(e,t.Z,n??performance.now()),t.finishProcessing()}function Gt(t,e,i){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");u2(t,e,i,t.B+1)}function se(t,e,i,n){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");u2(t,e,i,n)}function Ti(t,e,i,n){var r=e.data;const s=e.width,o=s*(e=e.height);if((r instanceof Uint8Array||r instanceof Float32Array)&&r.length!==o)throw Error("Unsupported channel count: "+r.length/o);return t=new at([r],i,!1,t.g.i.canvas,t.P,s,e),n?t.clone():t}var xt=class extends Js{constructor(t,e,i,n){super(t),this.g=t,this.Z=e,this.U=i,this.na=n,this.P=new Si}l(t,e=!0){if("runningMode"in t&&tn(this.baseOptions,2,!!t.runningMode&&t.runningMode!=="IMAGE"),t.canvas!==void 0&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};xt.prototype.close=xt.prototype.close;var zt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},E(t=this.h=new rr,0,1,e=new G),_(this.h,2,.5),_(this.h,3,.3)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&_(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&_(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}D(t,e){return this.j={detections:[]},Gt(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect_in"),B(t,"detections");const e=new Tt;Yt(e,t0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect_in"),T(i,"DETECTIONS:detections"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=dc(s),this.j.detections.push(Vc(n));w(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};zt.prototype.detectForVideo=zt.prototype.F,zt.prototype.detect=zt.prototype.D,zt.prototype.setOptions=zt.prototype.o,zt.createFromModelPath=async function(t,e){return M(zt,t,{baseOptions:{modelAssetPath:e}})},zt.createFromModelBuffer=function(t,e){return M(zt,t,{baseOptions:{modelAssetBuffer:e}})},zt.createFromOptions=function(t,e){return M(zt,t,e)};var so=Qt([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),oo=Qt([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),ao=Qt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),p2=Qt([474,475],[475,476],[476,477],[477,474]),co=Qt([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),lo=Qt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),f2=Qt([469,470],[470,471],[471,472],[472,469]),ho=Qt([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),m2=[...so,...oo,...ao,...co,...lo,...ho],g2=Qt([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function v2(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var V=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,E(t=this.h=new Cc,0,1,e=new G),this.v=new _c,E(this.h,0,3,this.v),this.s=new rr,E(this.h,0,2,this.s),ie(this.s,4,1),_(this.s,2,.5),_(this.v,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numFaces"in t&&ie(this.s,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&_(this.s,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&_(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return v2(this),Gt(this,t,e),this.j}F(t,e,i){return v2(this),se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"face_landmarks");const e=new Tt;Yt(e,i0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"NORM_LANDMARKS:face_landmarks"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("face_landmarks",(n,r)=>{for(const s of n)n=sn(s),this.j.faceLandmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{w(this,n)}),this.outputFaceBlendshapes&&(B(t,"blendshapes"),T(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,r)=>{if(this.outputFaceBlendshapes)for(const s of n)n=er(s),this.j.faceBlendshapes.push(Ys(n.g()??[]));w(this,r)}),this.g.attachEmptyPacketListener("blendshapes",n=>{w(this,n)})),this.outputFacialTransformationMatrixes&&(B(t,"face_geometry"),T(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,r)=>{if(this.outputFacialTransformationMatrixes)for(const s of n)(n=I(e0(s),Zh,2))&&this.j.facialTransformationMatrixes.push({rows:Ut(n,1)??0??0,columns:Ut(n,2)??0??0,data:ze(n,3,Ae,Ge()).slice()??[]});w(this,r)}),this.g.attachEmptyPacketListener("face_geometry",n=>{w(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};V.prototype.detectForVideo=V.prototype.F,V.prototype.detect=V.prototype.D,V.prototype.setOptions=V.prototype.o,V.createFromModelPath=function(t,e){return M(V,t,{baseOptions:{modelAssetPath:e}})},V.createFromModelBuffer=function(t,e){return M(V,t,{baseOptions:{modelAssetBuffer:e}})},V.createFromOptions=function(t,e){return M(V,t,e)},V.FACE_LANDMARKS_LIPS=so,V.FACE_LANDMARKS_LEFT_EYE=oo,V.FACE_LANDMARKS_LEFT_EYEBROW=ao,V.FACE_LANDMARKS_LEFT_IRIS=p2,V.FACE_LANDMARKS_RIGHT_EYE=co,V.FACE_LANDMARKS_RIGHT_EYEBROW=lo,V.FACE_LANDMARKS_RIGHT_IRIS=f2,V.FACE_LANDMARKS_FACE_OVAL=ho,V.FACE_LANDMARKS_CONTOURS=m2,V.FACE_LANDMARKS_TESSELATION=g2;var oe=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!0),E(t=this.j=new Ec,0,1,e=new G)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,i){const n=typeof e!="function"?e:{};if(this.h=typeof e=="function"?e:i,Gt(this,t,n??{}),!this.h)return this.s}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"stylized_image");const e=new Tt;Yt(e,n0,this.j);const i=new gt;It(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"STYLIZED_IMAGE:stylized_image"),i.o(e),Bt(t,i),this.g.V("stylized_image",(n,r)=>{var s=!this.h,o=n.data,a=n.width;const c=a*(n=n.height);if(o instanceof Uint8Array)if(o.length===3*c){const l=new Uint8ClampedArray(4*c);for(let d=0;d<c;++d)l[4*d]=o[3*d],l[4*d+1]=o[3*d+1],l[4*d+2]=o[3*d+2],l[4*d+3]=255;o=new ImageData(l,a,n)}else{if(o.length!==4*c)throw Error("Unsupported channel count: "+o.length/c);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),a,n)}else if(!(o instanceof WebGLTexture))throw Error(`Unsupported format: ${o.constructor.name}`);a=new ct([o],!1,!1,this.g.i.canvas,this.P,a,n),this.s=s=s?a.clone():a,this.h&&this.h(s),w(this,r)}),this.g.attachEmptyPacketListener("stylized_image",n=>{this.s=null,this.h&&this.h(null),w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};oe.prototype.stylize=oe.prototype.Ka,oe.prototype.setOptions=oe.prototype.o,oe.createFromModelPath=function(t,e){return M(oe,t,{baseOptions:{modelAssetPath:e}})},oe.createFromModelBuffer=function(t,e){return M(oe,t,{baseOptions:{modelAssetBuffer:e}})},oe.createFromOptions=function(t,e){return M(oe,t,e)};var uo=Qt([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function b2(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function w2(t){return t.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function y2(t,e=!0){const i=[];for(const r of t){var n=er(r);t=[];for(const s of n.g())n=e&&Ut(s,1)!=null?Ut(s,1)??0:-1,t.push({score:K(s,2)??0,index:n,categoryName:Vt(s,3)??""??"",displayName:Vt(s,4)??""??""});i.push(t)}return i}var Ft=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.j=new Sc,0,1,e=new G),this.s=new Gs,E(this.j,0,2,this.s),this.C=new js,E(this.s,0,3,this.C),this.v=new Ac,E(this.s,0,2,this.v),this.h=new r0,E(this.j,0,3,this.h),_(this.v,2,.5),_(this.s,4,.5),_(this.C,2,.5)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){if(ie(this.v,3,t.numHands??1),"minHandDetectionConfidence"in t&&_(this.v,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.s,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&_(this.C,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new ki,i=e,n=Xs(t.cannedGesturesClassifierOptions,I(this.h,ki,3)?.h());E(i,0,2,n),E(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&I(this.h,ki,3)?.g();return t.customGesturesClassifierOptions?(E(i=e=new ki,0,2,n=Xs(t.customGesturesClassifierOptions,I(this.h,ki,4)?.h())),E(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&I(this.h,ki,4)?.g(),this.l(t)}Fa(t,e){return b2(this),Gt(this,t,e),w2(this)}Ga(t,e,i){return b2(this),se(this,t,i,e),w2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"hand_gestures"),B(t,"hand_landmarks"),B(t,"world_hand_landmarks"),B(t,"handedness");const e=new Tt;Yt(e,s0,this.j);const i=new gt;It(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"HAND_GESTURES:hand_gestures"),T(i,"LANDMARKS:hand_landmarks"),T(i,"WORLD_LANDMARKS:world_hand_landmarks"),T(i,"HANDEDNESS:handedness"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n){n=sn(s);const o=[];for(const a of ue(n,pc,1))o.push({x:K(a,1)??0,y:K(a,2)??0,z:K(a,3)??0,visibility:K(a,4)??0});this.landmarks.push(o)}w(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n){n=Ei(s);const o=[];for(const a of ue(n,uc,1))o.push({x:K(a,1)??0,y:K(a,2)??0,z:K(a,3)??0,visibility:K(a,4)??0});this.worldLandmarks.push(o)}w(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,r)=>{this.gestures.push(...y2(n,!1)),w(this,r)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{w(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{this.handedness.push(...y2(n)),w(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function _2(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}Ft.prototype.recognizeForVideo=Ft.prototype.Ga,Ft.prototype.recognize=Ft.prototype.Fa,Ft.prototype.setOptions=Ft.prototype.o,Ft.createFromModelPath=function(t,e){return M(Ft,t,{baseOptions:{modelAssetPath:e}})},Ft.createFromModelBuffer=function(t,e){return M(Ft,t,{baseOptions:{modelAssetBuffer:e}})},Ft.createFromOptions=function(t,e){return M(Ft,t,e)},Ft.HAND_CONNECTIONS=uo;var Dt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.h=new Gs,0,1,e=new G),this.s=new js,E(this.h,0,3,this.s),this.j=new Ac,E(this.h,0,2,this.j),ie(this.j,3,1),_(this.j,2,.5),_(this.s,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numHands"in t&&ie(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&_(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&_(this.s,2,t.minHandPresenceConfidence??.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Gt(this,t,e),_2(this)}F(t,e,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],se(this,t,i,e),_2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"hand_landmarks"),B(t,"world_hand_landmarks"),B(t,"handedness");const e=new Tt;Yt(e,o0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"LANDMARKS:hand_landmarks"),T(i,"WORLD_LANDMARKS:world_hand_landmarks"),T(i,"HANDEDNESS:handedness"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n)n=sn(s),this.landmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n)n=Ei(s),this.worldLandmarks.push(on(n));w(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{var s=this.handedness,o=s.push;const a=[];for(const c of n){n=er(c);const l=[];for(const d of n.g())l.push({score:K(d,2)??0,index:Ut(d,1)??0??-1,categoryName:Vt(d,3)??""??"",displayName:Vt(d,4)??""??""});a.push(l)}o.call(s,...a),w(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Dt.prototype.detectForVideo=Dt.prototype.F,Dt.prototype.detect=Dt.prototype.D,Dt.prototype.setOptions=Dt.prototype.o,Dt.createFromModelPath=function(t,e){return M(Dt,t,{baseOptions:{modelAssetPath:e}})},Dt.createFromModelBuffer=function(t,e){return M(Dt,t,{baseOptions:{modelAssetBuffer:e}})},Dt.createFromOptions=function(t,e){return M(Dt,t,e)},Dt.HAND_CONNECTIONS=uo;var C2=Qt([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function x2(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function E2(t){try{if(!t.C)return t.h;t.C(t.h)}finally{cr(t)}}function fr(t,e){t=sn(t),e.push(sr(t))}var z=class extends xt{constructor(t,e){super(new jt(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,E(t=this.j=new Fc,0,1,e=new G),this.K=new js,E(this.j,0,2,this.K),this.Y=new a0,E(this.j,0,3,this.Y),this.s=new rr,E(this.j,0,4,this.s),this.H=new _c,E(this.j,0,5,this.H),this.v=new Ic,E(this.j,0,6,this.v),this.L=new Bc,E(this.j,0,7,this.L),_(this.s,2,.5),_(this.s,3,.3),_(this.H,2,.5),_(this.v,2,.5),_(this.v,3,.3),_(this.L,2,.5),_(this.K,2,.5)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&_(this.s,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&_(this.s,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&_(this.H,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&_(this.v,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&_(this.v,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&_(this.L,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&_(this.K,2,t.minHandLandmarksConfidence??.5),this.l(t)}D(t,e,i){const n=typeof e!="function"?e:{};return this.C=typeof e=="function"?e:i,x2(this),Gt(this,t,n),E2(this)}F(t,e,i,n){const r=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:n,x2(this),se(this,t,r,e),E2(this)}m(){var t=new Ct;U(t,"input_frames_image"),B(t,"pose_landmarks"),B(t,"pose_world_landmarks"),B(t,"face_landmarks"),B(t,"left_hand_landmarks"),B(t,"left_hand_world_landmarks"),B(t,"right_hand_landmarks"),B(t,"right_hand_world_landmarks");const e=new Tt,i=new X1;ds(i,1,ui("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(r,s){if(s!=null)if(Array.isArray(s))N(r,2,$n(s,as,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof le||Ue(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");ds(r,2,qr(s,!1),Ve())}}(i,this.j.g());const n=new gt;It(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Un(n,8,X1,i),H(n,"IMAGE:input_frames_image"),T(n,"POSE_LANDMARKS:pose_landmarks"),T(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),T(n,"FACE_LANDMARKS:face_landmarks"),T(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),T(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),T(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),T(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(e),Bt(t,n),ar(this,t),this.g.attachProtoListener("pose_landmarks",(r,s)=>{fr(r,this.h.poseLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("pose_world_landmarks",(r,s)=>{var o=this.h.poseWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",r=>{w(this,r)}),this.outputPoseSegmentationMasks&&(T(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Ai(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(r,s)=>{this.h.poseSegmentationMasks=[Ti(this,r,!0,!this.C)],w(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",r=>{this.h.poseSegmentationMasks=[],w(this,r)})),this.g.attachProtoListener("face_landmarks",(r,s)=>{fr(r,this.h.faceLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{w(this,r)}),this.outputFaceBlendshapes&&(B(t,"extra_blendshapes"),T(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(r,s)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(r=er(r),o.push(Ys(r.g()??[]))),w(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",r=>{w(this,r)})),this.g.attachProtoListener("left_hand_landmarks",(r,s)=>{fr(r,this.h.leftHandLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("left_hand_world_landmarks",(r,s)=>{var o=this.h.leftHandWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("right_hand_landmarks",(r,s)=>{fr(r,this.h.rightHandLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("right_hand_world_landmarks",(r,s)=>{var o=this.h.rightHandWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",r=>{w(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};z.prototype.detectForVideo=z.prototype.F,z.prototype.detect=z.prototype.D,z.prototype.setOptions=z.prototype.o,z.createFromModelPath=function(t,e){return M(z,t,{baseOptions:{modelAssetPath:e}})},z.createFromModelBuffer=function(t,e){return M(z,t,{baseOptions:{modelAssetBuffer:e}})},z.createFromOptions=function(t,e){return M(z,t,e)},z.HAND_CONNECTIONS=uo,z.POSE_CONNECTIONS=C2,z.FACE_LANDMARKS_LIPS=so,z.FACE_LANDMARKS_LEFT_EYE=oo,z.FACE_LANDMARKS_LEFT_EYEBROW=ao,z.FACE_LANDMARKS_LEFT_IRIS=p2,z.FACE_LANDMARKS_RIGHT_EYE=co,z.FACE_LANDMARKS_RIGHT_EYEBROW=lo,z.FACE_LANDMARKS_RIGHT_IRIS=f2,z.FACE_LANDMARKS_FACE_OVAL=ho,z.FACE_LANDMARKS_CONTOURS=m2,z.FACE_LANDMARKS_TESSELATION=g2;var Zt=class extends xt{constructor(t,e){super(new jt(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},E(t=this.h=new Dc,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return E(this.h,0,2,Xs(t,I(this.h,Hs,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},Gt(this,t,e),this.j}ra(t,e,i){return this.j={classifications:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"input_image"),U(t,"norm_rect"),B(t,"classifications");const e=new Tt;Yt(e,c0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),H(i,"IMAGE:input_image"),H(i,"NORM_RECT:norm_rect"),T(i,"CLASSIFICATIONS:classifications"),i.o(e),Bt(t,i),this.g.attachProtoListener("classifications",(n,r)=>{this.j=function(s){const o={classifications:ue(s,qh,1).map(a=>Ys(I(a,lc,4)?.g()??[],Ut(a,2)??0,Vt(a,3)??""))};return is(fi(s,2))!=null&&(o.timestampMs=is(fi(s,2))??0),o}(Xh(n)),w(this,r)}),this.g.attachEmptyPacketListener("classifications",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Zt.prototype.classifyForVideo=Zt.prototype.ra,Zt.prototype.classify=Zt.prototype.qa,Zt.prototype.setOptions=Zt.prototype.o,Zt.createFromModelPath=function(t,e){return M(Zt,t,{baseOptions:{modelAssetPath:e}})},Zt.createFromModelBuffer=function(t,e){return M(Zt,t,{baseOptions:{modelAssetBuffer:e}})},Zt.createFromOptions=function(t,e){return M(Zt,t,e)};var Rt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!0),this.h=new Rc,this.embeddings={embeddings:[]},E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e=this.h,i=I(this.h,bc,2);return i=i?i.clone():new bc,t.l2Normalize!==void 0?tn(i,1,t.l2Normalize):"l2Normalize"in t&&N(i,1),t.quantize!==void 0?tn(i,2,t.quantize):"quantize"in t&&N(i,2),E(e,0,2,i),this.l(t)}xa(t,e){return Gt(this,t,e),this.embeddings}ya(t,e,i){return se(this,t,i,e),this.embeddings}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"embeddings_out");const e=new Tt;Yt(e,l0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"EMBEDDINGS:embeddings_out"),i.o(e),Bt(t,i),this.g.attachProtoListener("embeddings_out",(n,r)=>{n=Jh(n),this.embeddings=function(s){return{embeddings:ue(s,Kh,1).map(o=>{const a={headIndex:Ut(o,3)??0??-1,headName:Vt(o,4)??""??""};if(g1(o,mc,us(o,1))!==void 0)o=ze(o=I(o,mc,us(o,1)),1,Ae,Ge()),a.floatEmbedding=o.slice();else{const c=new Uint8Array(0);a.quantizedEmbedding=I(o,Yh,us(o,2))?.ma()?.h()??c}return a}),timestampMs:is(fi(s,2))??0}}(n),w(this,r)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Rt.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Gc(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Gc(jc(t.quantizedEmbedding),jc(e.quantizedEmbedding))}return t},Rt.prototype.embedForVideo=Rt.prototype.ya,Rt.prototype.embed=Rt.prototype.xa,Rt.prototype.setOptions=Rt.prototype.o,Rt.createFromModelPath=function(t,e){return M(Rt,t,{baseOptions:{modelAssetPath:e}})},Rt.createFromModelBuffer=function(t,e){return M(Rt,t,{baseOptions:{modelAssetBuffer:e}})},Rt.createFromOptions=function(t,e){return M(Rt,t,e)};var po=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};function k2(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function A2(t){try{const e=new po(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{cr(t)}}po.prototype.close=po.prototype.close;var Et=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new qs,this.v=new $c,E(this.h,0,3,this.v),E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?N(this.h,2,ui(t.displayNamesLocale)):"displayNamesLocale"in t&&N(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}J(){(function(t){const e=ue(t.ca(),gt,1).filter(i=>(Vt(i,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&(I(e[0],Tt,7)?.l()?.g()??new Map).forEach((i,n)=>{t.s[Number(n)]=Vt(i,1)??""})})(this)}segment(t,e,i){const n=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:i,k2(this),Gt(this,t,n),A2(this)}Ia(t,e,i,n){const r=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:n,k2(this),se(this,t,r,e),A2(this)}Ba(){return this.s}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect");const e=new Tt;Yt(e,Nc,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),i.o(e),Bt(t,i),ar(this,t),this.outputConfidenceMasks&&(B(t,"confidence_masks"),T(i,"CONFIDENCE_MASKS:confidence_masks"),Ai(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Ti(this,s,!0,!this.j)),w(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],w(this,n)})),this.outputCategoryMask&&(B(t,"category_mask"),T(i,"CATEGORY_MASK:category_mask"),Ai(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Ti(this,n,!1,!this.j),w(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,w(this,n)})),B(t,"quality_scores"),T(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,w(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Et.prototype.getLabels=Et.prototype.Ba,Et.prototype.segmentForVideo=Et.prototype.Ia,Et.prototype.segment=Et.prototype.segment,Et.prototype.setOptions=Et.prototype.o,Et.createFromModelPath=function(t,e){return M(Et,t,{baseOptions:{modelAssetPath:e}})},Et.createFromModelBuffer=function(t,e){return M(Et,t,{baseOptions:{modelAssetBuffer:e}})},Et.createFromOptions=function(t,e){return M(Et,t,e)};var fo=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};fo.prototype.close=fo.prototype.close;var y0=class extends y{constructor(t){super(t)}},Ii=[0,X,-2],mr=[0,me,-3,j,me,-1],S2=[0,mr],L2=[0,mr,X,-1],mo=class extends y{constructor(t){super(t)}},M2=[0,me,-1,j],_0=class extends y{constructor(t){super(t)}},T2=class extends y{constructor(t){super(t)}},go=[1,2,3,4,5,6,7,8,9,10,14,15],I2=class extends y{constructor(t){super(t)}};I2.prototype.g=tr([0,ot,[0,go,$,mr,$,[0,mr,Ii],$,S2,$,[0,S2,Ii],$,M2,$,[0,me,-3,j,Mt],$,[0,me,-3,j],$,[0,R,me,-2,j,X,j,-1,2,me,Ii],$,L2,$,[0,L2,Ii],me,Ii,R,$,[0,me,-3,j,Ii,-1],$,[0,ot,M2]],R,[0,R,X,-1,j]]);var ae=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new qs,this.s=new $c,E(this.h,0,3,this.s),E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,i,n){const r=typeof i!="function"?i:{};this.j=typeof i=="function"?i:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,n=new I2;const s=new T2;var o=new y0;if(ie(o,1,255),E(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new mo;tn(a,3,!0),_(a,1,e.keypoint.x),_(a,2,e.keypoint.y),Qi(s,5,go,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new _0,e.scribble))tn(e=new mo,3,!0),_(e,1,a.x),_(e,2,a.y),Un(o,1,mo,e);Qi(s,15,go,o)}Un(n,1,T2,s),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",i),Gt(this,t,r);t:{try{const l=new fo(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break t}this.j(l)}finally{cr(this)}c=void 0}return c}m(){var t=new Ct;U(t,"image_in"),U(t,"roi_in"),U(t,"norm_rect_in");const e=new Tt;Yt(e,Nc,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),H(i,"IMAGE:image_in"),H(i,"ROI:roi_in"),H(i,"NORM_RECT:norm_rect_in"),i.o(e),Bt(t,i),ar(this,t),this.outputConfidenceMasks&&(B(t,"confidence_masks"),T(i,"CONFIDENCE_MASKS:confidence_masks"),Ai(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Ti(this,s,!0,!this.j)),w(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],w(this,n)})),this.outputCategoryMask&&(B(t,"category_mask"),T(i,"CATEGORY_MASK:category_mask"),Ai(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Ti(this,n,!1,!this.j),w(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,w(this,n)})),B(t,"quality_scores"),T(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,w(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ae.prototype.segment=ae.prototype.segment,ae.prototype.setOptions=ae.prototype.o,ae.createFromModelPath=function(t,e){return M(ae,t,{baseOptions:{modelAssetPath:e}})},ae.createFromModelBuffer=function(t,e){return M(ae,t,{baseOptions:{modelAssetBuffer:e}})},ae.createFromOptions=function(t,e){return M(ae,t,e)};var Wt=class extends xt{constructor(t,e){super(new jt(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},E(t=this.h=new Hc,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?N(this.h,2,ui(t.displayNamesLocale)):"displayNamesLocale"in t&&N(this.h,2),t.maxResults!==void 0?ie(this.h,3,t.maxResults):"maxResults"in t&&N(this.h,3),t.scoreThreshold!==void 0?_(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&N(this.h,4),t.categoryAllowlist!==void 0?Vn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&N(this.h,5),t.categoryDenylist!==void 0?Vn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&N(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},Gt(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"input_frame_gpu"),U(t,"norm_rect"),B(t,"detections");const e=new Tt;Yt(e,d0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),H(i,"IMAGE:input_frame_gpu"),H(i,"NORM_RECT:norm_rect"),T(i,"DETECTIONS:detections"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=dc(s),this.j.detections.push(Vc(n));w(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Wt.prototype.detectForVideo=Wt.prototype.F,Wt.prototype.detect=Wt.prototype.D,Wt.prototype.setOptions=Wt.prototype.o,Wt.createFromModelPath=async function(t,e){return M(Wt,t,{baseOptions:{modelAssetPath:e}})},Wt.createFromModelBuffer=function(t,e){return M(Wt,t,{baseOptions:{modelAssetBuffer:e}})},Wt.createFromOptions=function(t,e){return M(Wt,t,e)};var vo=class{constructor(t,e,i){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=i}close(){this.segmentationMasks?.forEach(t=>{t.close()})}};function B2(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function F2(t){try{const e=new vo(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{cr(t)}}vo.prototype.close=vo.prototype.close;var $t=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,E(t=this.h=new Uc,0,1,e=new G),this.v=new Bc,E(this.h,0,3,this.v),this.j=new Ic,E(this.h,0,2,this.j),ie(this.j,4,1),_(this.j,2,.5),_(this.v,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numPoses"in t&&ie(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&_(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&_(this.v,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}D(t,e,i){const n=typeof e!="function"?e:{};return this.s=typeof e=="function"?e:i,B2(this),Gt(this,t,n),F2(this)}F(t,e,i,n){const r=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:n,B2(this),se(this,t,r,e),F2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"normalized_landmarks"),B(t,"world_landmarks"),B(t,"segmentation_masks");const e=new Tt;Yt(e,u0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"NORM_LANDMARKS:normalized_landmarks"),T(i,"WORLD_LANDMARKS:world_landmarks"),i.o(e),Bt(t,i),ar(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(n,r)=>{this.landmarks=[];for(const s of n)n=sn(s),this.landmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],w(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,r)=>{this.worldLandmarks=[];for(const s of n)n=Ei(s),this.worldLandmarks.push(on(n));w(this,r)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],w(this,n)}),this.outputSegmentationMasks&&(T(i,"SEGMENTATION_MASK:segmentation_masks"),Ai(this,"segmentation_masks"),this.g.ba("segmentation_masks",(n,r)=>{this.segmentationMasks=n.map(s=>Ti(this,s,!0,!this.s)),w(this,r)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],w(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$t.prototype.detectForVideo=$t.prototype.F,$t.prototype.detect=$t.prototype.D,$t.prototype.setOptions=$t.prototype.o,$t.createFromModelPath=function(t,e){return M($t,t,{baseOptions:{modelAssetPath:e}})},$t.createFromModelBuffer=function(t,e){return M($t,t,{baseOptions:{modelAssetBuffer:e}})},$t.createFromOptions=function(t,e){return M($t,t,e)},$t.POSE_CONNECTIONS=C2;const C0=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;let i=1,n=0,r=1,s=0;e.forEach(l=>{l&&typeof l.x=="number"&&typeof l.y=="number"&&(i=Math.min(i,l.x),n=Math.max(n,l.x),r=Math.min(r,l.y),s=Math.max(s,l.y))});const o=n-i,a=s-r;return Math.max(o,a)},x0=(t,e)=>{if(!t||t.length===0)return!1;const i=t[0];let n=1,r=0,s=1,o=0;i.forEach(Q=>{n=Math.min(n,Q.x),r=Math.max(r,Q.x),s=Math.min(s,Q.y),o=Math.max(o,Q.y)});const a=.5,c=.6,l=e>1;let d,h;l?(d=.4,h=.3):(d=.35,h=.5);const u=(n+r)/2,p=(s+o)/2,f=.2,m=d*(1+f),g=h*(1+f),b=((Q,Ot)=>{const st=(Q-a)/m,Re=(Ot-c)/g;return st*st+Re*Re<=1})(u,p),k=.2,S=.1,O=d*(1+k),ut=h*(1+S),kt=(Q,Ot)=>{const st=(Q-a)/O,Re=(Ot-c)/ut;return st*st+Re*Re<=1},At=kt(n,s),wt=kt(r,s),be=kt(n,o),lt=kt(r,o);return b&&At&&wt&&be&&lt},E0=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;const i=e[13],n=e[14];if(!i||!n)return 0;const r=Math.abs(n.y-i.y),s=Math.min(...e.map(c=>c.y)),a=Math.max(...e.map(c=>c.y))-s;return a>0?r/a:0},k0=t=>{const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)return null;const n=t.videoWidth,r=t.videoHeight,s=Math.min(n,r),o=(n-s)/2,a=(r-s)/2;return e.width=s,e.height=s,i.drawImage(t,o,a,s,s,0,0,s,s),e},D2=(t,e,i,n)=>{const r=t.getContext("2d");if(!r)return;const s=t.width,o=t.height;r.clearRect(0,0,s,o);const a=new bt(r);e.forEach(c=>{if(!c||c.length===0)return;const l="rgba(162, 155, 254,0.4)",d=2;r.strokeStyle="rgba(255, 255, 255, 0.6)",r.lineWidth=d,r.lineCap="round",r.lineJoin="round",a.drawLandmarks(c,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),a.drawConnectors(c,V.FACE_LANDMARKS_FACE_OVAL,{color:l,lineWidth:d}),i>0&&i>=n&&a.drawConnectors(c,V.FACE_LANDMARKS_LIPS,{color:l,lineWidth:d})})},A0=t=>{const e=t.getContext("2d");e&&e.clearRect(0,0,t.width,t.height)},S0=(t,e=!1)=>{const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const r=t.videoHeight>t.videoWidth;e?r?(i.width=480,i.height=Math.max(640,i.width*t.videoHeight/t.videoWidth)):(i.width=640,i.height=Math.max(480,i.width*t.videoHeight/t.videoWidth)):r?(i.width=240,i.height=Math.max(320,i.width*t.videoHeight/t.videoWidth)):(i.width=320,i.height=Math.max(240,i.width*t.videoHeight/t.videoWidth));const s=t.videoHeight>720?1.3:1,o=t.videoWidth*s,a=t.videoHeight*s,c=(o-t.videoWidth)/2,l=(a-t.videoHeight)/2,d=t.videoHeight*.05;return n.drawImage(t,-c,-l-d,o,a,0,0,i.width,i.height),i.toDataURL("image/jpeg")},R2={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},$2={"multiple-faces":"Ensure only one face is visible","no-face":"Position your face in the oval","out-of-bounds":"Position your face in the oval","too-close":"Move farther away","too-far":"Move closer","neutral-expression":"Neutral expression","smile-required":"Smile!","open-mouth-smile":"Bigger smile!"},O2=async()=>{window.__smileIdentityMediapipe||(window.__smileIdentityMediapipe={instance:null,loading:null,loaded:!1});const t=window.__smileIdentityMediapipe;return t.loaded&&t.instance?t.instance:(t.loading||(t.loading=(async()=>{try{const e=await qe.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=await V.createFromOptions(e,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO",numFaces:2});return t.instance=i,t.loaded=!0,t.loading=null,i}catch(e){throw t.loading=null,e}})()),t.loading)},un=$i.version,L0=({videoRef:t,canvasRef:e,interval:i,duration:n,smileThreshold:r,mouthOpenThreshold:s,minFaceSize:o,maxFaceSize:a,smileCooldown:c})=>{const l=Xt(null),d=Xt(null),h=Xt(null),u=Xt(null),p=et(!1),f=et(!1),m=et("good"),g=et(!1),v=et(16/9),b=et([]),k=et(0),S=et(0),O=et(0),ut=et(0),kt=et(""),At=et(!1),wt=et(!1),be=et(0),lt=et([]),Q=et(null),Ot=et(1),st=et(0),Re=et(!1),Bi=$r(()=>Math.floor(Ot.value*.4)),yo=$r(()=>Math.floor(Ot.value*.2)),q0=$r(()=>p.value&&f.value&&m.value==="good"&&!g.value),X0=async()=>{try{l.current=await O2()}catch(W){console.error("Failed to initialize MediaPipe:",W)}},Pt=W=>{W&&$2[W]?kt.value=$2[W]:kt.value=""},Y0=()=>{if(t.current&&e.current){const{videoWidth:W,videoHeight:yt}=t.current;v.value=W/yt,e.current.width=W,e.current.height=yt,t.current.parentElement&&(e.current.style.left="50%",e.current.style.top="50%",e.current.style.transform="translate(-50%, -50%) scaleX(-1)")}},K0=()=>{const W=st.value<yo.value,yt=st.value>=Bi.value;W&&k.value>=r?Pt("neutral-expression"):W?kt.value="Capturing...":yt?Date.now()-ut.value>c?k.value>=r&&O.value<s?Pt("open-mouth-smile"):Pt("smile-required"):kt.value="Keep smiling!":Pt(null)},J0=()=>{g.value?Pt("multiple-faces"):p.value?m.value==="too-close"?Pt("too-close"):m.value==="too-far"?Pt("too-far"):f.value?At.value?K0():kt.value="Ready to capture":Pt("out-of-bounds"):Pt("no-face")},_o=()=>{d.current&&(cancelAnimationFrame(d.current),d.current=null)},j2=async()=>{if(!l.current||!t.current){_o();return}try{const W=k0(t.current),yt=W||t.current,ht=l.current.detectForVideo(yt,performance.now());if(b.value=ht.faceLandmarks||[],ht.faceLandmarks&&e.current&&t.current)if(W){const $e=t.current.videoWidth,Ke=t.current.videoHeight,Fi=Math.min($e,Ke),xo=($e-Fi)/(2*$e),wr=(Ke-Fi)/(2*Ke),yr=Fi/$e,Di=Fi/Ke,ed=ht.faceLandmarks.map(id=>id.map(Eo=>({x:Eo.x*yr+xo,y:Eo.y*Di+wr,z:Eo.z})));D2(e.current,ed,st.value,Bi.value)}else D2(e.current,ht.faceLandmarks,st.value,Bi.value);else e.current&&A0(e.current);const Co=ht.faceLandmarks?ht.faceLandmarks.length:0;g.value=Co>1;const br=ht.faceBlendshapes&&ht.faceBlendshapes.length>0&&Co===1;if(p.value=br,br&&ht.faceLandmarks){const $e=C0(ht.faceLandmarks);S.value=$e,$e>a?m.value="too-close":$e<o?m.value="too-far":m.value="good",f.value=x0(ht.faceLandmarks,v.value);const Ke=ht.faceBlendshapes[0].categories,Fi=Ke.find(Di=>Di.categoryName==="mouthSmileLeft")?.score||0,xo=Ke.find(Di=>Di.categoryName==="mouthSmileRight")?.score||0,wr=E0(ht.faceLandmarks),yr=(Fi+xo)/2;k.value=yr,O.value=wr,yr>=r&&wr>=s&&(ut.value=Date.now(),wt.value&&At.value&&u.current&&setTimeout(()=>{Date.now()-ut.value<=100&&wt.value&&At.value&&u.current&&u.current()},0))}else k.value=0,S.value=0,O.value=0,f.value=!1,m.value="good";J0()}catch{p.value=!1,f.value=!1,g.value=!1,m.value="good",O.value=0,At.value&&Pt("no-face")}d.current=requestAnimationFrame(j2)},Q0=()=>{d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(j2)},td=()=>{if(!t.current)return;const W=st.value===Ot.value-1,yt=S0(t.current,W);yt&&(W?Q.value=yt:lt.value=[...lt.value,yt],st.value++,be.value=Ot.value-st.value)},vr=()=>{if(h.current&&(clearInterval(h.current),h.current=null),At.value=!1,wt.value=!1,st.value>=Ot.value&&Q.value){const W=lt.value.map(br=>({image:br.split(",")[1],image_type_id:R2.LIVENESS_IMAGE_BASE64})),yt={image:Q.value.split(",")[1],image_type_id:R2.SELFIE_IMAGE_BASE64},ht={images:[...W,yt],referenceImage:Q.value,previewImage:Q.value,meta:{libraryVersion:un}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:ht})),document.querySelector("smart-camera-web")?.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),Re.value=!0}},fn=()=>{h.current&&(clearInterval(h.current),h.current=null),wt.value=!0,!g.value&&p.value&&f.value&&m.value==="good"&&Pt("smile-required")},G2=()=>{h.current&&clearInterval(h.current),h.current=setInterval(()=>{if(st.value>=Ot.value){vr();return}if(g.value){fn();return}if(!p.value)return;if(!f.value){fn();return}if(m.value!=="good"){fn();return}const W=st.value<yo.value,yt=st.value>=Bi.value;if(!(W&&k.value>=r)){if(yt&&Date.now()-ut.value>c){fn();return}td()}},i)},z2=()=>{if(p.value&&m.value==="good"&&f.value&&!g.value){if(st.value>=Bi.value&&Date.now()-ut.value>c)return;wt.value=!1,Pt(null),G2()}};return u.current=z2,{faceDetected:p,faceInBounds:f,faceProximity:m,multipleFaces:g,videoAspectRatio:v,faceLandmarks:b,currentSmileScore:k,currentFaceSize:S,currentMouthOpen:O,lastSmileTime:ut,alertTitle:kt,isReadyToCapture:q0,isCapturing:At,isPaused:wt,countdown:be,capturedImages:lt,referencePhoto:Q,totalCaptures:Ot,capturesTaken:st,hasFinishedCapture:Re,smileCheckpoint:Bi,neutralZone:yo,initializeFaceLandmarker:X0,setupCanvas:Y0,startDetectionLoop:Q0,stopDetectionLoop:_o,updateAlert:Pt,startCapture:async()=>{lt.value=[],At.value=!0,wt.value=!1,Ot.value=Math.ceil(n/i),st.value=0,be.value=Ot.value,G2()},stopCapture:vr,pauseCapture:fn,resumeCapture:z2,handleCancel:()=>{vr(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:un}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:un}}}))},handleClose:()=>{vr(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:un}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:un}}}))},cleanup:()=>{h.current&&clearInterval(h.current),_o()}}},M0=({progress:t,duration:e=1e3,themeColor:i="#001096"})=>{const n=Xt(null),r=Xt(t);return ei(()=>{const s=n.current;if(!s)return;const o=s.getTotalLength();s.style.opacity=t>0?"1":"0";const a=o*(1-r.current),c=o*(1-t);a!==c&&(s.style.transition="none",s.style.strokeDasharray=`${o} ${o}`,s.style.strokeDashoffset=`${a}`,s.getBoundingClientRect(),s.style.transition=`stroke-dashoffset ${e}ms ease-out`,s.style.strokeDashoffset=`${c}`,r.current=t)},[t,e]),L("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:L("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[L("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:L("path",{d:"M0.085 0.382 C0.087 0.357 0.092 0.294 0.131 0.236 C0.200 0.133 0.340 0.063 0.501 0.063 C0.730 0.063 0.915 0.205 0.915 0.382 C0.915 0.424 0.899 0.513 0.891 0.549 C0.882 0.588 0.871 0.626 0.857 0.664 C0.792 0.825 0.639 0.937 0.501 0.937 C0.314 0.937 0.182 0.755 0.144 0.666 C0.126 0.624 0.110 0.557 0.107 0.547 C0.092 0.485 0.081 0.439 0.085 0.382 Z"})}),L("path",{d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:i,fill:"none",style:{strokeWidth:"8"}}),L("path",{ref:n,d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:"#22c55e",style:{strokeWidth:"8"},fill:"none",strokeLinecap:"round"})]})})},T0=({videoRef:t,canvasRef:e,facingMode:i,multipleFaces:n,progress:r,interval:s,themeColor:o})=>L(ye,{children:[L("div",{className:"camera-preview-container",children:[L("div",{className:"video-wrapper",style:{clipPath:n?"none":"url(#selfie-clip-path)"},children:L("div",{className:"video-container",children:[L("video",{ref:t,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),L("canvas",{ref:e,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!n&&L(M0,{progress:r,duration:s,themeColor:o})]}),L("style",{children:`
3228
+ `}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=De(this,t),t.activeTexture(t.TEXTURE2),this.B=De(this,t)}m(){super.m();const t=this.g;this.K=vt(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=vt(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=vt(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.H,0),t.uniform1i(this.K,1),t.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function ge(t,e){switch(e){case 0:return t.g.find(i=>i instanceof Uint8Array);case 1:return t.g.find(i=>i instanceof Float32Array);case 2:return t.g.find(i=>typeof WebGLTexture<"u"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function eo(t){var e=ge(t,1);if(!e){if(e=ge(t,0))e=new Float32Array(e).map(n=>n/255);else{e=new Float32Array(t.width*t.height);const n=Li(t);var i=io(t);if(lr(i,n,t2(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){i=new Float32Array(t.width*t.height*4),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,i);for(let r=0,s=0;r<e.length;++r,s+=4)e[r]=i[s]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function t2(t){let e=ge(t,2);if(!e){const i=Li(t);e=i2(t);const n=eo(t),r=e2(t);i.texImage2D(i.TEXTURE_2D,0,r,t.width,t.height,0,i.RED,i.FLOAT,n),no(t)}return e}function Li(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=vt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function e2(t){if(t=Li(t),!hr)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))hr=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");hr=t.R16F}return hr}function io(t){return t.l||(t.l=new Si),t.l}function i2(t){const e=Li(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=ge(t,2);return i||(i=De(io(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(i),t.j=!0),e.bindTexture(e.TEXTURE_2D,i),i}function no(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var hr,at=class{constructor(t,e,i,n,r,s,o){this.g=t,this.m=e,this.j=i,this.canvas=n,this.l=r,this.width=s,this.height=o,this.j&&--n2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!ge(this,0)}ja(){return!!ge(this,1)}R(){return!!ge(this,2)}ia(){return(e=ge(t=this,0))||(e=eo(t),e=new Uint8Array(e.map(i=>255*i)),t.g.push(e)),e;var t,e}ha(){return eo(this)}N(){return t2(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof Uint8Array)i=new Uint8Array(e);else if(e instanceof Float32Array)i=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const n=Li(this),r=io(this);n.activeTexture(n.TEXTURE1),i=De(r,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,i);const s=e2(this);n.texImage2D(n.TEXTURE_2D,0,s,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),lr(r,n,i),cn(r,n,!1,()=>{i2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),no(this)}),to(r),no(this)}}t.push(i)}return new at(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Li(this).deleteTexture(ge(this,2)),n2=-1}};at.prototype.close=at.prototype.close,at.prototype.clone=at.prototype.clone,at.prototype.getAsWebGLTexture=at.prototype.N,at.prototype.getAsFloat32Array=at.prototype.ha,at.prototype.getAsUint8Array=at.prototype.ia,at.prototype.hasWebGLTexture=at.prototype.R,at.prototype.hasFloat32Array=at.prototype.ja,at.prototype.hasUint8Array=at.prototype.Da;var n2=250;const b0={color:"white",lineWidth:4,radius:6};function ro(t){return{...b0,fillColor:(t=t||{}).color,...t}}function ve(t,e){return t instanceof Function?t(e):t}function r2(t,e,i){return Math.max(Math.min(e,i),Math.min(Math.max(e,i),t))}function ln(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function hn(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function s2(t,e,i){if(e.R())i(e.N());else{const n=e.ja()?e.ha():e.ia();t.m=t.m??new Si;const r=hn(t);i((t=new at([n],e.m,!1,r.canvas,t.m,e.width,e.height)).N()),t.close()}}function o2(t,e,i,n){const r=function(a){return a.g||(a.g=new g0),a.g}(t),s=hn(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;cn(r,s,!0,()=>{(function(c,l,d,h){const u=c.g;if(u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,l),u.activeTexture(u.TEXTURE1),u.bindTexture(u.TEXTURE_2D,c.B),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,d),c.H&&function(p,f){if(p!==f)return!1;p=p.entries(),f=f.entries();for(const[g,v]of p){p=g;const b=v;var m=f.next();if(m.done)return!1;const[k,S]=m.value;if(m=S,p!==k||b[0]!==m[0]||b[1]!==m[1]||b[2]!==m[2]||b[3]!==m[3])return!1}return!!f.next().done}(c.H,h))u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j);else{c.H=h;const p=Array(1024).fill(0);h.forEach((f,m)=>{if(f.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);p[4*m]=f[0],p[4*m+1]=f[1],p[4*m+2]=f[2],p[4*m+3]=f[3]}),u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,256,1,0,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array(p))}})(r,e,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);const a=r.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function a2(t,e,i,n){const r=hn(t),s=function(c){return c.h||(c.h=new v0),c.h}(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;cn(s,r,!0,()=>{var c=s.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,e),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,s.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,o),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,s.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),r.bindTexture(r.TEXTURE_2D,null),(c=s.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var bt=class{constructor(t,e){typeof CanvasRenderingContext2D<"u"&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}wa(t,e){if(t){var i=ln(this);e=ro(e),i.save();var n=i.canvas,r=0;for(const s of t)i.fillStyle=ve(e.fillColor,{index:r,from:s}),i.strokeStyle=ve(e.color,{index:r,from:s}),i.lineWidth=ve(e.lineWidth,{index:r,from:s}),(t=new Path2D).arc(s.x*n.width,s.y*n.height,ve(e.radius,{index:r,from:s}),0,2*Math.PI),i.fill(t),i.stroke(t),++r;i.restore()}}va(t,e,i){if(t&&e){var n=ln(this);i=ro(i),n.save();var r=n.canvas,s=0;for(const o of e){n.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(n.strokeStyle=ve(i.color,{index:s,from:e,to:a}),n.lineWidth=ve(i.lineWidth,{index:s,from:e,to:a}),n.moveTo(e.x*r.width,e.y*r.height),n.lineTo(a.x*r.width,a.y*r.height)),++s,n.stroke()}n.restore()}}sa(t,e){const i=ln(this);e=ro(e),i.save(),i.beginPath(),i.lineWidth=ve(e.lineWidth,{}),i.strokeStyle=ve(e.color,{}),i.fillStyle=ve(e.fillColor,{}),i.moveTo(t.originX,t.originY),i.lineTo(t.originX+t.width,t.originY),i.lineTo(t.originX+t.width,t.originY+t.height),i.lineTo(t.originX,t.originY+t.height),i.lineTo(t.originX,t.originY),i.stroke(),i.fill(),i.restore()}ta(t,e,i=[0,0,0,255]){this.l?function(n,r,s,o){const a=hn(n);s2(n,r,c=>{o2(n,c,s,o),(c=ln(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,i,e):o2(this,t.N(),i,e)}ua(t,e,i){this.l?function(n,r,s,o){const a=hn(n);s2(n,r,c=>{a2(n,c,s,o),(c=ln(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,e,i):a2(this,t.N(),e,i)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function re(t,e){switch(e){case 0:return t.g.find(i=>i instanceof ImageData);case 1:return t.g.find(i=>typeof ImageBitmap<"u"&&i instanceof ImageBitmap);case 2:return t.g.find(i=>typeof WebGLTexture<"u"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function c2(t){var e=re(t,0);if(!e){e=Mi(t);const i=ur(t),n=new Uint8Array(t.width*t.height*4);lr(i,e,dr(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),to(i),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function dr(t){let e=re(t,2);if(!e){const i=Mi(t);e=pr(t);const n=re(t,1)||c2(t);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),dn(t)}return e}function Mi(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=vt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ur(t){return t.l||(t.l=new Si),t.l}function pr(t){const e=Mi(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=re(t,2);return i||(i=De(ur(t),e),t.g.push(i),t.m=!0),e.bindTexture(e.TEXTURE_2D,i),i}function dn(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function l2(t){const e=Mi(t);return cn(ur(t),e,!0,()=>function(i,n){const r=i.canvas;if(r.width===i.width&&r.height===i.height)return n();const s=r.width,o=r.height;return r.width=i.width,r.height=i.height,i=n(),r.width=s,r.height=o,i}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}bt.prototype.close=bt.prototype.close,bt.prototype.drawConfidenceMask=bt.prototype.ua,bt.prototype.drawCategoryMask=bt.prototype.ta,bt.prototype.drawBoundingBox=bt.prototype.sa,bt.prototype.drawConnectors=bt.prototype.va,bt.prototype.drawLandmarks=bt.prototype.wa,bt.lerp=function(t,e,i,n,r){return r2(n*(1-(t-e)/(i-e))+r*(1-(i-t)/(i-e)),n,r)},bt.clamp=r2;var ct=class{constructor(t,e,i,n,r,s,o){this.g=t,this.j=e,this.m=i,this.canvas=n,this.l=r,this.width=s,this.height=o,(this.j||this.m)&&--h2===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!re(this,0)}ka(){return!!re(this,1)}R(){return!!re(this,2)}Aa(){return c2(this)}za(){var t=re(this,1);return t||(dr(this),pr(this),t=l2(this),dn(this),this.g.push(t),this.j=!0),t}N(){return dr(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof ImageData)i=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const n=Mi(this),r=ur(this);n.activeTexture(n.TEXTURE1),i=De(r,n),n.bindTexture(n.TEXTURE_2D,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindTexture(n.TEXTURE_2D,null),lr(r,n,i),cn(r,n,!1,()=>{pr(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),dn(this)}),to(r),dn(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);dr(this),pr(this),i=l2(this),dn(this)}t.push(i)}return new ct(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&re(this,1).close(),this.m&&Mi(this).deleteTexture(re(this,2)),h2=-1}};ct.prototype.close=ct.prototype.close,ct.prototype.clone=ct.prototype.clone,ct.prototype.getAsWebGLTexture=ct.prototype.N,ct.prototype.getAsImageBitmap=ct.prototype.za,ct.prototype.getAsImageData=ct.prototype.Aa,ct.prototype.hasWebGLTexture=ct.prototype.R,ct.prototype.hasImageBitmap=ct.prototype.ka,ct.prototype.hasImageData=ct.prototype.Ca;var h2=250;function Qt(...t){return t.map(([e,i])=>({start:e,end:i}))}const w0=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((d2=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",e!==void 0?this.i.canvas=e:Zc()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph(new TextEncoder().encode(t),!1)}setGraph(t,e){const i=t.length,n=this.i._malloc(i);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(i,n):this.i._changeTextGraph(i,n),this.i._free(n)}configureAudio(t,e,i,n,r){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),x(this,n||"input_audio",s=>{x(this,r=r||"audio_header",o=>{this.i._configureAudio(s,o,t,e??0,i)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){ne(this,"__graph_config__",e=>{t(e)}),x(this,"__graph_config__",e=>{this.i._getGraphConfig(e,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,i){this.addAudioToStreamWithShape(t,0,0,e,i)}addAudioToStreamWithShape(t,e,i,n,r){const s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),x(this,n,o=>{this.i._addAudioToInputStream(this.g,e,i,o,r)})}addGpuBufferToStream(t,e,i){x(this,e,n=>{const[r,s]=Xc(this,t,n);this.i._addBoundTextureToStream(n,r,s,i)})}addBoolToStream(t,e,i){x(this,e,n=>{this.i._addBoolToInputStream(t,n,i)})}addDoubleToStream(t,e,i){x(this,e,n=>{this.i._addDoubleToInputStream(t,n,i)})}addFloatToStream(t,e,i){x(this,e,n=>{this.i._addFloatToInputStream(t,n,i)})}addIntToStream(t,e,i){x(this,e,n=>{this.i._addIntToInputStream(t,n,i)})}addUintToStream(t,e,i){x(this,e,n=>{this.i._addUintToInputStream(t,n,i)})}addStringToStream(t,e,i){x(this,e,n=>{x(this,t,r=>{this.i._addStringToInputStream(r,n,i)})})}addStringRecordToStream(t,e,i){x(this,e,n=>{Yc(this,Object.keys(t),r=>{Yc(this,Object.values(t),s=>{this.i._addFlatHashMapToInputStream(r,s,Object.keys(t).length,n,i)})})})}addProtoToStream(t,e,i,n){x(this,i,r=>{x(this,e,s=>{const o=this.i._malloc(t.length);this.i.HEAPU8.set(t,o),this.i._addProtoToInputStream(o,t.length,s,r,n),this.i._free(o)})})}addEmptyPacketToStream(t,e){x(this,t,i=>{this.i._addEmptyPacketToInputStream(i,e)})}addBoolVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const s of t)this.i._addBoolVectorEntry(r,s);this.i._addBoolVectorToInputStream(r,n,i)})}addDoubleVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const s of t)this.i._addDoubleVectorEntry(r,s);this.i._addDoubleVectorToInputStream(r,n,i)})}addFloatVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const s of t)this.i._addFloatVectorEntry(r,s);this.i._addFloatVectorToInputStream(r,n,i)})}addIntVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const s of t)this.i._addIntVectorEntry(r,s);this.i._addIntVectorToInputStream(r,n,i)})}addUintVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of t)this.i._addUintVectorEntry(r,s);this.i._addUintVectorToInputStream(r,n,i)})}addStringVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const s of t)x(this,s,o=>{this.i._addStringVectorEntry(r,o)});this.i._addStringVectorToInputStream(r,n,i)})}addBoolToInputSidePacket(t,e){x(this,e,i=>{this.i._addBoolToInputSidePacket(t,i)})}addDoubleToInputSidePacket(t,e){x(this,e,i=>{this.i._addDoubleToInputSidePacket(t,i)})}addFloatToInputSidePacket(t,e){x(this,e,i=>{this.i._addFloatToInputSidePacket(t,i)})}addIntToInputSidePacket(t,e){x(this,e,i=>{this.i._addIntToInputSidePacket(t,i)})}addUintToInputSidePacket(t,e){x(this,e,i=>{this.i._addUintToInputSidePacket(t,i)})}addStringToInputSidePacket(t,e){x(this,e,i=>{x(this,t,n=>{this.i._addStringToInputSidePacket(n,i)})})}addProtoToInputSidePacket(t,e,i){x(this,i,n=>{x(this,e,r=>{const s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputSidePacket(s,t.length,r,n),this.i._free(s)})})}addBoolVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const r of t)this.i._addBoolVectorEntry(n,r);this.i._addBoolVectorToInputSidePacket(n,i)})}addDoubleVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const r of t)this.i._addDoubleVectorEntry(n,r);this.i._addDoubleVectorToInputSidePacket(n,i)})}addFloatVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const r of t)this.i._addFloatVectorEntry(n,r);this.i._addFloatVectorToInputSidePacket(n,i)})}addIntVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const r of t)this.i._addIntVectorEntry(n,r);this.i._addIntVectorToInputSidePacket(n,i)})}addUintVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const r of t)this.i._addUintVectorEntry(n,r);this.i._addUintVectorToInputSidePacket(n,i)})}addStringVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const r of t)x(this,r,s=>{this.i._addStringVectorEntry(n,s)});this.i._addStringVectorToInputSidePacket(n,i)})}attachBoolListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(t,e,i){ne(this,t,e),x(this,t,n=>{this.i._attachProtoListener(n,i||!1)})}attachProtoVectorListener(t,e,i){Fe(this,t,e),x(this,t,n=>{this.i._attachProtoVectorListener(n,i||!1)})}attachAudioListener(t,e,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ne(this,t,(n,r)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),e(n,r)}),x(this,t,n=>{this.i._attachAudioListener(n,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends d2{get ea(){return this.i}oa(t,e,i){x(this,e,n=>{const[r,s]=Xc(this,t,n);this.ea._addBoundTextureAsImageToStream(n,r,s,i)})}V(t,e){ne(this,t,e),x(this,t,i=>{this.ea._attachImageListener(i)})}ba(t,e){Fe(this,t,e),x(this,t,i=>{this.ea._attachImageVectorListener(i)})}}));var d2,jt=class extends w0{};async function M(t,e,i){return async function(n,r,s,o){return f0(n,r,s,o)}(t,i.canvas??(Zc()?void 0:document.createElement("canvas")),e,i)}function u2(t,e,i,n){if(t.U){const s=new fc;if(i?.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var r=i.regionOfInterest;if(r.left>=r.right||r.top>=r.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(r.left<0||r.top<0||r.right>1||r.bottom>1)throw Error("Expected RectF values to be in [0,1].");_(s,1,(r.left+r.right)/2),_(s,2,(r.top+r.bottom)/2),_(s,4,r.right-r.left),_(s,3,r.bottom-r.top)}else _(s,1,.5),_(s,2,.5),_(s,4,1),_(s,3,1);if(i?.rotationDegrees){if(i?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(_(s,5,-Math.PI*i.rotationDegrees/180),i?.rotationDegrees%180!=0){const[o,a]=qc(e);i=K(s,3)*a/o,r=K(s,4)*o/a,_(s,4,i),_(s,3,r)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,n)}t.g.oa(e,t.Z,n??performance.now()),t.finishProcessing()}function Gt(t,e,i){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");u2(t,e,i,t.B+1)}function se(t,e,i,n){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");u2(t,e,i,n)}function Ti(t,e,i,n){var r=e.data;const s=e.width,o=s*(e=e.height);if((r instanceof Uint8Array||r instanceof Float32Array)&&r.length!==o)throw Error("Unsupported channel count: "+r.length/o);return t=new at([r],i,!1,t.g.i.canvas,t.P,s,e),n?t.clone():t}var xt=class extends Js{constructor(t,e,i,n){super(t),this.g=t,this.Z=e,this.U=i,this.na=n,this.P=new Si}l(t,e=!0){if("runningMode"in t&&tn(this.baseOptions,2,!!t.runningMode&&t.runningMode!=="IMAGE"),t.canvas!==void 0&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};xt.prototype.close=xt.prototype.close;var zt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},E(t=this.h=new rr,0,1,e=new G),_(this.h,2,.5),_(this.h,3,.3)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&_(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&_(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}D(t,e){return this.j={detections:[]},Gt(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect_in"),B(t,"detections");const e=new Tt;Yt(e,t0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect_in"),T(i,"DETECTIONS:detections"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=dc(s),this.j.detections.push(Vc(n));w(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};zt.prototype.detectForVideo=zt.prototype.F,zt.prototype.detect=zt.prototype.D,zt.prototype.setOptions=zt.prototype.o,zt.createFromModelPath=async function(t,e){return M(zt,t,{baseOptions:{modelAssetPath:e}})},zt.createFromModelBuffer=function(t,e){return M(zt,t,{baseOptions:{modelAssetBuffer:e}})},zt.createFromOptions=function(t,e){return M(zt,t,e)};var so=Qt([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),oo=Qt([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),ao=Qt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),p2=Qt([474,475],[475,476],[476,477],[477,474]),co=Qt([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),lo=Qt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),f2=Qt([469,470],[470,471],[471,472],[472,469]),ho=Qt([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),m2=[...so,...oo,...ao,...co,...lo,...ho],g2=Qt([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function v2(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var V=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,E(t=this.h=new Cc,0,1,e=new G),this.v=new _c,E(this.h,0,3,this.v),this.s=new rr,E(this.h,0,2,this.s),ie(this.s,4,1),_(this.s,2,.5),_(this.v,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numFaces"in t&&ie(this.s,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&_(this.s,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&_(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return v2(this),Gt(this,t,e),this.j}F(t,e,i){return v2(this),se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"face_landmarks");const e=new Tt;Yt(e,i0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"NORM_LANDMARKS:face_landmarks"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("face_landmarks",(n,r)=>{for(const s of n)n=sn(s),this.j.faceLandmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{w(this,n)}),this.outputFaceBlendshapes&&(B(t,"blendshapes"),T(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,r)=>{if(this.outputFaceBlendshapes)for(const s of n)n=er(s),this.j.faceBlendshapes.push(Ys(n.g()??[]));w(this,r)}),this.g.attachEmptyPacketListener("blendshapes",n=>{w(this,n)})),this.outputFacialTransformationMatrixes&&(B(t,"face_geometry"),T(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,r)=>{if(this.outputFacialTransformationMatrixes)for(const s of n)(n=I(e0(s),Zh,2))&&this.j.facialTransformationMatrixes.push({rows:Ut(n,1)??0??0,columns:Ut(n,2)??0??0,data:ze(n,3,Ae,Ge()).slice()??[]});w(this,r)}),this.g.attachEmptyPacketListener("face_geometry",n=>{w(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};V.prototype.detectForVideo=V.prototype.F,V.prototype.detect=V.prototype.D,V.prototype.setOptions=V.prototype.o,V.createFromModelPath=function(t,e){return M(V,t,{baseOptions:{modelAssetPath:e}})},V.createFromModelBuffer=function(t,e){return M(V,t,{baseOptions:{modelAssetBuffer:e}})},V.createFromOptions=function(t,e){return M(V,t,e)},V.FACE_LANDMARKS_LIPS=so,V.FACE_LANDMARKS_LEFT_EYE=oo,V.FACE_LANDMARKS_LEFT_EYEBROW=ao,V.FACE_LANDMARKS_LEFT_IRIS=p2,V.FACE_LANDMARKS_RIGHT_EYE=co,V.FACE_LANDMARKS_RIGHT_EYEBROW=lo,V.FACE_LANDMARKS_RIGHT_IRIS=f2,V.FACE_LANDMARKS_FACE_OVAL=ho,V.FACE_LANDMARKS_CONTOURS=m2,V.FACE_LANDMARKS_TESSELATION=g2;var oe=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!0),E(t=this.j=new Ec,0,1,e=new G)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,i){const n=typeof e!="function"?e:{};if(this.h=typeof e=="function"?e:i,Gt(this,t,n??{}),!this.h)return this.s}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"stylized_image");const e=new Tt;Yt(e,n0,this.j);const i=new gt;It(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"STYLIZED_IMAGE:stylized_image"),i.o(e),Bt(t,i),this.g.V("stylized_image",(n,r)=>{var s=!this.h,o=n.data,a=n.width;const c=a*(n=n.height);if(o instanceof Uint8Array)if(o.length===3*c){const l=new Uint8ClampedArray(4*c);for(let d=0;d<c;++d)l[4*d]=o[3*d],l[4*d+1]=o[3*d+1],l[4*d+2]=o[3*d+2],l[4*d+3]=255;o=new ImageData(l,a,n)}else{if(o.length!==4*c)throw Error("Unsupported channel count: "+o.length/c);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),a,n)}else if(!(o instanceof WebGLTexture))throw Error(`Unsupported format: ${o.constructor.name}`);a=new ct([o],!1,!1,this.g.i.canvas,this.P,a,n),this.s=s=s?a.clone():a,this.h&&this.h(s),w(this,r)}),this.g.attachEmptyPacketListener("stylized_image",n=>{this.s=null,this.h&&this.h(null),w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};oe.prototype.stylize=oe.prototype.Ka,oe.prototype.setOptions=oe.prototype.o,oe.createFromModelPath=function(t,e){return M(oe,t,{baseOptions:{modelAssetPath:e}})},oe.createFromModelBuffer=function(t,e){return M(oe,t,{baseOptions:{modelAssetBuffer:e}})},oe.createFromOptions=function(t,e){return M(oe,t,e)};var uo=Qt([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function b2(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function w2(t){return t.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function y2(t,e=!0){const i=[];for(const r of t){var n=er(r);t=[];for(const s of n.g())n=e&&Ut(s,1)!=null?Ut(s,1)??0:-1,t.push({score:K(s,2)??0,index:n,categoryName:Vt(s,3)??""??"",displayName:Vt(s,4)??""??""});i.push(t)}return i}var Ft=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.j=new Sc,0,1,e=new G),this.s=new Gs,E(this.j,0,2,this.s),this.C=new js,E(this.s,0,3,this.C),this.v=new Ac,E(this.s,0,2,this.v),this.h=new r0,E(this.j,0,3,this.h),_(this.v,2,.5),_(this.s,4,.5),_(this.C,2,.5)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){if(ie(this.v,3,t.numHands??1),"minHandDetectionConfidence"in t&&_(this.v,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.s,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&_(this.C,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new ki,i=e,n=Xs(t.cannedGesturesClassifierOptions,I(this.h,ki,3)?.h());E(i,0,2,n),E(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&I(this.h,ki,3)?.g();return t.customGesturesClassifierOptions?(E(i=e=new ki,0,2,n=Xs(t.customGesturesClassifierOptions,I(this.h,ki,4)?.h())),E(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&I(this.h,ki,4)?.g(),this.l(t)}Fa(t,e){return b2(this),Gt(this,t,e),w2(this)}Ga(t,e,i){return b2(this),se(this,t,i,e),w2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"hand_gestures"),B(t,"hand_landmarks"),B(t,"world_hand_landmarks"),B(t,"handedness");const e=new Tt;Yt(e,s0,this.j);const i=new gt;It(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"HAND_GESTURES:hand_gestures"),T(i,"LANDMARKS:hand_landmarks"),T(i,"WORLD_LANDMARKS:world_hand_landmarks"),T(i,"HANDEDNESS:handedness"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n){n=sn(s);const o=[];for(const a of ue(n,pc,1))o.push({x:K(a,1)??0,y:K(a,2)??0,z:K(a,3)??0,visibility:K(a,4)??0});this.landmarks.push(o)}w(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n){n=Ei(s);const o=[];for(const a of ue(n,uc,1))o.push({x:K(a,1)??0,y:K(a,2)??0,z:K(a,3)??0,visibility:K(a,4)??0});this.worldLandmarks.push(o)}w(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,r)=>{this.gestures.push(...y2(n,!1)),w(this,r)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{w(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{this.handedness.push(...y2(n)),w(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function _2(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}Ft.prototype.recognizeForVideo=Ft.prototype.Ga,Ft.prototype.recognize=Ft.prototype.Fa,Ft.prototype.setOptions=Ft.prototype.o,Ft.createFromModelPath=function(t,e){return M(Ft,t,{baseOptions:{modelAssetPath:e}})},Ft.createFromModelBuffer=function(t,e){return M(Ft,t,{baseOptions:{modelAssetBuffer:e}})},Ft.createFromOptions=function(t,e){return M(Ft,t,e)},Ft.HAND_CONNECTIONS=uo;var Dt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.h=new Gs,0,1,e=new G),this.s=new js,E(this.h,0,3,this.s),this.j=new Ac,E(this.h,0,2,this.j),ie(this.j,3,1),_(this.j,2,.5),_(this.s,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numHands"in t&&ie(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&_(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&_(this.s,2,t.minHandPresenceConfidence??.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Gt(this,t,e),_2(this)}F(t,e,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],se(this,t,i,e),_2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"hand_landmarks"),B(t,"world_hand_landmarks"),B(t,"handedness");const e=new Tt;Yt(e,o0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"LANDMARKS:hand_landmarks"),T(i,"WORLD_LANDMARKS:world_hand_landmarks"),T(i,"HANDEDNESS:handedness"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n)n=sn(s),this.landmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n)n=Ei(s),this.worldLandmarks.push(on(n));w(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{var s=this.handedness,o=s.push;const a=[];for(const c of n){n=er(c);const l=[];for(const d of n.g())l.push({score:K(d,2)??0,index:Ut(d,1)??0??-1,categoryName:Vt(d,3)??""??"",displayName:Vt(d,4)??""??""});a.push(l)}o.call(s,...a),w(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Dt.prototype.detectForVideo=Dt.prototype.F,Dt.prototype.detect=Dt.prototype.D,Dt.prototype.setOptions=Dt.prototype.o,Dt.createFromModelPath=function(t,e){return M(Dt,t,{baseOptions:{modelAssetPath:e}})},Dt.createFromModelBuffer=function(t,e){return M(Dt,t,{baseOptions:{modelAssetBuffer:e}})},Dt.createFromOptions=function(t,e){return M(Dt,t,e)},Dt.HAND_CONNECTIONS=uo;var C2=Qt([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function x2(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function E2(t){try{if(!t.C)return t.h;t.C(t.h)}finally{cr(t)}}function fr(t,e){t=sn(t),e.push(sr(t))}var z=class extends xt{constructor(t,e){super(new jt(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,E(t=this.j=new Fc,0,1,e=new G),this.K=new js,E(this.j,0,2,this.K),this.Y=new a0,E(this.j,0,3,this.Y),this.s=new rr,E(this.j,0,4,this.s),this.H=new _c,E(this.j,0,5,this.H),this.v=new Ic,E(this.j,0,6,this.v),this.L=new Bc,E(this.j,0,7,this.L),_(this.s,2,.5),_(this.s,3,.3),_(this.H,2,.5),_(this.v,2,.5),_(this.v,3,.3),_(this.L,2,.5),_(this.K,2,.5)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&_(this.s,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&_(this.s,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&_(this.H,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&_(this.v,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&_(this.v,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&_(this.L,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&_(this.K,2,t.minHandLandmarksConfidence??.5),this.l(t)}D(t,e,i){const n=typeof e!="function"?e:{};return this.C=typeof e=="function"?e:i,x2(this),Gt(this,t,n),E2(this)}F(t,e,i,n){const r=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:n,x2(this),se(this,t,r,e),E2(this)}m(){var t=new Ct;U(t,"input_frames_image"),B(t,"pose_landmarks"),B(t,"pose_world_landmarks"),B(t,"face_landmarks"),B(t,"left_hand_landmarks"),B(t,"left_hand_world_landmarks"),B(t,"right_hand_landmarks"),B(t,"right_hand_world_landmarks");const e=new Tt,i=new X1;ds(i,1,ui("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(r,s){if(s!=null)if(Array.isArray(s))N(r,2,$n(s,as,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof le||Ue(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");ds(r,2,qr(s,!1),Ve())}}(i,this.j.g());const n=new gt;It(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Un(n,8,X1,i),H(n,"IMAGE:input_frames_image"),T(n,"POSE_LANDMARKS:pose_landmarks"),T(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),T(n,"FACE_LANDMARKS:face_landmarks"),T(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),T(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),T(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),T(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(e),Bt(t,n),ar(this,t),this.g.attachProtoListener("pose_landmarks",(r,s)=>{fr(r,this.h.poseLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("pose_world_landmarks",(r,s)=>{var o=this.h.poseWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",r=>{w(this,r)}),this.outputPoseSegmentationMasks&&(T(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Ai(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(r,s)=>{this.h.poseSegmentationMasks=[Ti(this,r,!0,!this.C)],w(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",r=>{this.h.poseSegmentationMasks=[],w(this,r)})),this.g.attachProtoListener("face_landmarks",(r,s)=>{fr(r,this.h.faceLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{w(this,r)}),this.outputFaceBlendshapes&&(B(t,"extra_blendshapes"),T(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(r,s)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(r=er(r),o.push(Ys(r.g()??[]))),w(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",r=>{w(this,r)})),this.g.attachProtoListener("left_hand_landmarks",(r,s)=>{fr(r,this.h.leftHandLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("left_hand_world_landmarks",(r,s)=>{var o=this.h.leftHandWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("right_hand_landmarks",(r,s)=>{fr(r,this.h.rightHandLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("right_hand_world_landmarks",(r,s)=>{var o=this.h.rightHandWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",r=>{w(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};z.prototype.detectForVideo=z.prototype.F,z.prototype.detect=z.prototype.D,z.prototype.setOptions=z.prototype.o,z.createFromModelPath=function(t,e){return M(z,t,{baseOptions:{modelAssetPath:e}})},z.createFromModelBuffer=function(t,e){return M(z,t,{baseOptions:{modelAssetBuffer:e}})},z.createFromOptions=function(t,e){return M(z,t,e)},z.HAND_CONNECTIONS=uo,z.POSE_CONNECTIONS=C2,z.FACE_LANDMARKS_LIPS=so,z.FACE_LANDMARKS_LEFT_EYE=oo,z.FACE_LANDMARKS_LEFT_EYEBROW=ao,z.FACE_LANDMARKS_LEFT_IRIS=p2,z.FACE_LANDMARKS_RIGHT_EYE=co,z.FACE_LANDMARKS_RIGHT_EYEBROW=lo,z.FACE_LANDMARKS_RIGHT_IRIS=f2,z.FACE_LANDMARKS_FACE_OVAL=ho,z.FACE_LANDMARKS_CONTOURS=m2,z.FACE_LANDMARKS_TESSELATION=g2;var Zt=class extends xt{constructor(t,e){super(new jt(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},E(t=this.h=new Dc,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return E(this.h,0,2,Xs(t,I(this.h,Hs,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},Gt(this,t,e),this.j}ra(t,e,i){return this.j={classifications:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"input_image"),U(t,"norm_rect"),B(t,"classifications");const e=new Tt;Yt(e,c0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),H(i,"IMAGE:input_image"),H(i,"NORM_RECT:norm_rect"),T(i,"CLASSIFICATIONS:classifications"),i.o(e),Bt(t,i),this.g.attachProtoListener("classifications",(n,r)=>{this.j=function(s){const o={classifications:ue(s,qh,1).map(a=>Ys(I(a,lc,4)?.g()??[],Ut(a,2)??0,Vt(a,3)??""))};return is(fi(s,2))!=null&&(o.timestampMs=is(fi(s,2))??0),o}(Xh(n)),w(this,r)}),this.g.attachEmptyPacketListener("classifications",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Zt.prototype.classifyForVideo=Zt.prototype.ra,Zt.prototype.classify=Zt.prototype.qa,Zt.prototype.setOptions=Zt.prototype.o,Zt.createFromModelPath=function(t,e){return M(Zt,t,{baseOptions:{modelAssetPath:e}})},Zt.createFromModelBuffer=function(t,e){return M(Zt,t,{baseOptions:{modelAssetBuffer:e}})},Zt.createFromOptions=function(t,e){return M(Zt,t,e)};var Rt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!0),this.h=new Rc,this.embeddings={embeddings:[]},E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e=this.h,i=I(this.h,bc,2);return i=i?i.clone():new bc,t.l2Normalize!==void 0?tn(i,1,t.l2Normalize):"l2Normalize"in t&&N(i,1),t.quantize!==void 0?tn(i,2,t.quantize):"quantize"in t&&N(i,2),E(e,0,2,i),this.l(t)}xa(t,e){return Gt(this,t,e),this.embeddings}ya(t,e,i){return se(this,t,i,e),this.embeddings}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"embeddings_out");const e=new Tt;Yt(e,l0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"EMBEDDINGS:embeddings_out"),i.o(e),Bt(t,i),this.g.attachProtoListener("embeddings_out",(n,r)=>{n=Jh(n),this.embeddings=function(s){return{embeddings:ue(s,Kh,1).map(o=>{const a={headIndex:Ut(o,3)??0??-1,headName:Vt(o,4)??""??""};if(g1(o,mc,us(o,1))!==void 0)o=ze(o=I(o,mc,us(o,1)),1,Ae,Ge()),a.floatEmbedding=o.slice();else{const c=new Uint8Array(0);a.quantizedEmbedding=I(o,Yh,us(o,2))?.ma()?.h()??c}return a}),timestampMs:is(fi(s,2))??0}}(n),w(this,r)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Rt.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Gc(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Gc(jc(t.quantizedEmbedding),jc(e.quantizedEmbedding))}return t},Rt.prototype.embedForVideo=Rt.prototype.ya,Rt.prototype.embed=Rt.prototype.xa,Rt.prototype.setOptions=Rt.prototype.o,Rt.createFromModelPath=function(t,e){return M(Rt,t,{baseOptions:{modelAssetPath:e}})},Rt.createFromModelBuffer=function(t,e){return M(Rt,t,{baseOptions:{modelAssetBuffer:e}})},Rt.createFromOptions=function(t,e){return M(Rt,t,e)};var po=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};function k2(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function A2(t){try{const e=new po(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{cr(t)}}po.prototype.close=po.prototype.close;var Et=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new qs,this.v=new $c,E(this.h,0,3,this.v),E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?N(this.h,2,ui(t.displayNamesLocale)):"displayNamesLocale"in t&&N(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}J(){(function(t){const e=ue(t.ca(),gt,1).filter(i=>(Vt(i,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&(I(e[0],Tt,7)?.l()?.g()??new Map).forEach((i,n)=>{t.s[Number(n)]=Vt(i,1)??""})})(this)}segment(t,e,i){const n=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:i,k2(this),Gt(this,t,n),A2(this)}Ia(t,e,i,n){const r=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:n,k2(this),se(this,t,r,e),A2(this)}Ba(){return this.s}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect");const e=new Tt;Yt(e,Nc,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),i.o(e),Bt(t,i),ar(this,t),this.outputConfidenceMasks&&(B(t,"confidence_masks"),T(i,"CONFIDENCE_MASKS:confidence_masks"),Ai(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Ti(this,s,!0,!this.j)),w(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],w(this,n)})),this.outputCategoryMask&&(B(t,"category_mask"),T(i,"CATEGORY_MASK:category_mask"),Ai(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Ti(this,n,!1,!this.j),w(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,w(this,n)})),B(t,"quality_scores"),T(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,w(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Et.prototype.getLabels=Et.prototype.Ba,Et.prototype.segmentForVideo=Et.prototype.Ia,Et.prototype.segment=Et.prototype.segment,Et.prototype.setOptions=Et.prototype.o,Et.createFromModelPath=function(t,e){return M(Et,t,{baseOptions:{modelAssetPath:e}})},Et.createFromModelBuffer=function(t,e){return M(Et,t,{baseOptions:{modelAssetBuffer:e}})},Et.createFromOptions=function(t,e){return M(Et,t,e)};var fo=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};fo.prototype.close=fo.prototype.close;var y0=class extends y{constructor(t){super(t)}},Ii=[0,X,-2],mr=[0,me,-3,j,me,-1],S2=[0,mr],L2=[0,mr,X,-1],mo=class extends y{constructor(t){super(t)}},M2=[0,me,-1,j],_0=class extends y{constructor(t){super(t)}},T2=class extends y{constructor(t){super(t)}},go=[1,2,3,4,5,6,7,8,9,10,14,15],I2=class extends y{constructor(t){super(t)}};I2.prototype.g=tr([0,ot,[0,go,$,mr,$,[0,mr,Ii],$,S2,$,[0,S2,Ii],$,M2,$,[0,me,-3,j,Mt],$,[0,me,-3,j],$,[0,R,me,-2,j,X,j,-1,2,me,Ii],$,L2,$,[0,L2,Ii],me,Ii,R,$,[0,me,-3,j,Ii,-1],$,[0,ot,M2]],R,[0,R,X,-1,j]]);var ae=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new qs,this.s=new $c,E(this.h,0,3,this.s),E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,i,n){const r=typeof i!="function"?i:{};this.j=typeof i=="function"?i:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,n=new I2;const s=new T2;var o=new y0;if(ie(o,1,255),E(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new mo;tn(a,3,!0),_(a,1,e.keypoint.x),_(a,2,e.keypoint.y),Qi(s,5,go,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new _0,e.scribble))tn(e=new mo,3,!0),_(e,1,a.x),_(e,2,a.y),Un(o,1,mo,e);Qi(s,15,go,o)}Un(n,1,T2,s),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",i),Gt(this,t,r);t:{try{const l=new fo(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break t}this.j(l)}finally{cr(this)}c=void 0}return c}m(){var t=new Ct;U(t,"image_in"),U(t,"roi_in"),U(t,"norm_rect_in");const e=new Tt;Yt(e,Nc,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),H(i,"IMAGE:image_in"),H(i,"ROI:roi_in"),H(i,"NORM_RECT:norm_rect_in"),i.o(e),Bt(t,i),ar(this,t),this.outputConfidenceMasks&&(B(t,"confidence_masks"),T(i,"CONFIDENCE_MASKS:confidence_masks"),Ai(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Ti(this,s,!0,!this.j)),w(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],w(this,n)})),this.outputCategoryMask&&(B(t,"category_mask"),T(i,"CATEGORY_MASK:category_mask"),Ai(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Ti(this,n,!1,!this.j),w(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,w(this,n)})),B(t,"quality_scores"),T(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,w(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ae.prototype.segment=ae.prototype.segment,ae.prototype.setOptions=ae.prototype.o,ae.createFromModelPath=function(t,e){return M(ae,t,{baseOptions:{modelAssetPath:e}})},ae.createFromModelBuffer=function(t,e){return M(ae,t,{baseOptions:{modelAssetBuffer:e}})},ae.createFromOptions=function(t,e){return M(ae,t,e)};var Wt=class extends xt{constructor(t,e){super(new jt(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},E(t=this.h=new Hc,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?N(this.h,2,ui(t.displayNamesLocale)):"displayNamesLocale"in t&&N(this.h,2),t.maxResults!==void 0?ie(this.h,3,t.maxResults):"maxResults"in t&&N(this.h,3),t.scoreThreshold!==void 0?_(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&N(this.h,4),t.categoryAllowlist!==void 0?Vn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&N(this.h,5),t.categoryDenylist!==void 0?Vn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&N(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},Gt(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"input_frame_gpu"),U(t,"norm_rect"),B(t,"detections");const e=new Tt;Yt(e,d0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),H(i,"IMAGE:input_frame_gpu"),H(i,"NORM_RECT:norm_rect"),T(i,"DETECTIONS:detections"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=dc(s),this.j.detections.push(Vc(n));w(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Wt.prototype.detectForVideo=Wt.prototype.F,Wt.prototype.detect=Wt.prototype.D,Wt.prototype.setOptions=Wt.prototype.o,Wt.createFromModelPath=async function(t,e){return M(Wt,t,{baseOptions:{modelAssetPath:e}})},Wt.createFromModelBuffer=function(t,e){return M(Wt,t,{baseOptions:{modelAssetBuffer:e}})},Wt.createFromOptions=function(t,e){return M(Wt,t,e)};var vo=class{constructor(t,e,i){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=i}close(){this.segmentationMasks?.forEach(t=>{t.close()})}};function B2(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function F2(t){try{const e=new vo(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{cr(t)}}vo.prototype.close=vo.prototype.close;var $t=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,E(t=this.h=new Uc,0,1,e=new G),this.v=new Bc,E(this.h,0,3,this.v),this.j=new Ic,E(this.h,0,2,this.j),ie(this.j,4,1),_(this.j,2,.5),_(this.v,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numPoses"in t&&ie(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&_(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&_(this.v,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}D(t,e,i){const n=typeof e!="function"?e:{};return this.s=typeof e=="function"?e:i,B2(this),Gt(this,t,n),F2(this)}F(t,e,i,n){const r=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:n,B2(this),se(this,t,r,e),F2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"normalized_landmarks"),B(t,"world_landmarks"),B(t,"segmentation_masks");const e=new Tt;Yt(e,u0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"NORM_LANDMARKS:normalized_landmarks"),T(i,"WORLD_LANDMARKS:world_landmarks"),i.o(e),Bt(t,i),ar(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(n,r)=>{this.landmarks=[];for(const s of n)n=sn(s),this.landmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],w(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,r)=>{this.worldLandmarks=[];for(const s of n)n=Ei(s),this.worldLandmarks.push(on(n));w(this,r)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],w(this,n)}),this.outputSegmentationMasks&&(T(i,"SEGMENTATION_MASK:segmentation_masks"),Ai(this,"segmentation_masks"),this.g.ba("segmentation_masks",(n,r)=>{this.segmentationMasks=n.map(s=>Ti(this,s,!0,!this.s)),w(this,r)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],w(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$t.prototype.detectForVideo=$t.prototype.F,$t.prototype.detect=$t.prototype.D,$t.prototype.setOptions=$t.prototype.o,$t.createFromModelPath=function(t,e){return M($t,t,{baseOptions:{modelAssetPath:e}})},$t.createFromModelBuffer=function(t,e){return M($t,t,{baseOptions:{modelAssetBuffer:e}})},$t.createFromOptions=function(t,e){return M($t,t,e)},$t.POSE_CONNECTIONS=C2;const C0=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;let i=1,n=0,r=1,s=0;e.forEach(l=>{l&&typeof l.x=="number"&&typeof l.y=="number"&&(i=Math.min(i,l.x),n=Math.max(n,l.x),r=Math.min(r,l.y),s=Math.max(s,l.y))});const o=n-i,a=s-r;return Math.max(o,a)},x0=(t,e)=>{if(!t||t.length===0)return!1;const i=t[0];let n=1,r=0,s=1,o=0;i.forEach(Q=>{n=Math.min(n,Q.x),r=Math.max(r,Q.x),s=Math.min(s,Q.y),o=Math.max(o,Q.y)});const a=.5,c=.6,l=e>1;let d,h;l?(d=.4,h=.3):(d=.35,h=.5);const u=(n+r)/2,p=(s+o)/2,f=.2,m=d*(1+f),g=h*(1+f),b=((Q,Ot)=>{const st=(Q-a)/m,Re=(Ot-c)/g;return st*st+Re*Re<=1})(u,p),k=.2,S=.1,O=d*(1+k),ut=h*(1+S),kt=(Q,Ot)=>{const st=(Q-a)/O,Re=(Ot-c)/ut;return st*st+Re*Re<=1},At=kt(n,s),wt=kt(r,s),be=kt(n,o),lt=kt(r,o);return b&&At&&wt&&be&&lt},E0=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;const i=e[13],n=e[14];if(!i||!n)return 0;const r=Math.abs(n.y-i.y),s=Math.min(...e.map(c=>c.y)),a=Math.max(...e.map(c=>c.y))-s;return a>0?r/a:0},k0=t=>{const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)return null;const n=t.videoWidth,r=t.videoHeight,s=Math.min(n,r),o=(n-s)/2,a=(r-s)/2;return e.width=s,e.height=s,i.drawImage(t,o,a,s,s,0,0,s,s),e},D2=(t,e,i,n)=>{const r=t.getContext("2d");if(!r)return;const s=t.width,o=t.height;r.clearRect(0,0,s,o);const a=new bt(r);e.forEach(c=>{if(!c||c.length===0)return;const l="rgba(162, 155, 254,0.4)",d=2;r.strokeStyle="rgba(255, 255, 255, 0.6)",r.lineWidth=d,r.lineCap="round",r.lineJoin="round",a.drawLandmarks(c,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),a.drawConnectors(c,V.FACE_LANDMARKS_FACE_OVAL,{color:l,lineWidth:d}),i>0&&i>=n&&a.drawConnectors(c,V.FACE_LANDMARKS_LIPS,{color:l,lineWidth:d})})},A0=t=>{const e=t.getContext("2d");e&&e.clearRect(0,0,t.width,t.height)},S0=(t,e=!1)=>{const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const r=t.videoHeight>t.videoWidth;e?r?(i.width=480,i.height=Math.max(640,i.width*t.videoHeight/t.videoWidth)):(i.width=640,i.height=Math.max(480,i.width*t.videoHeight/t.videoWidth)):r?(i.width=240,i.height=Math.max(320,i.width*t.videoHeight/t.videoWidth)):(i.width=320,i.height=Math.max(240,i.width*t.videoHeight/t.videoWidth));const s=1,o=t.videoWidth*s,a=t.videoHeight*s,c=(o-t.videoWidth)/2,l=(a-t.videoHeight)/2;return n.drawImage(t,-c,-l-0,o,a,0,0,i.width,i.height),i.toDataURL("image/jpeg")},R2={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},$2={"multiple-faces":"Ensure only one face is visible","no-face":"Position your face in the oval","out-of-bounds":"Position your face in the oval","too-close":"Move farther away","too-far":"Move closer","neutral-expression":"Neutral expression","smile-required":"Smile!","open-mouth-smile":"Bigger smile!"},O2=async()=>{window.__smileIdentityMediapipe||(window.__smileIdentityMediapipe={instance:null,loading:null,loaded:!1});const t=window.__smileIdentityMediapipe;return t.loaded&&t.instance?t.instance:(t.loading||(t.loading=(async()=>{try{const e=await qe.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=await V.createFromOptions(e,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO",numFaces:2});return t.instance=i,t.loaded=!0,t.loading=null,i}catch(e){throw t.loading=null,e}})()),t.loading)},un=$i.version,L0=({videoRef:t,canvasRef:e,interval:i,duration:n,smileThreshold:r,mouthOpenThreshold:s,minFaceSize:o,maxFaceSize:a,smileCooldown:c})=>{const l=Xt(null),d=Xt(null),h=Xt(null),u=Xt(null),p=et(!1),f=et(!1),m=et("good"),g=et(!1),v=et(16/9),b=et([]),k=et(0),S=et(0),O=et(0),ut=et(0),kt=et(""),At=et(!1),wt=et(!1),be=et(0),lt=et([]),Q=et(null),Ot=et(1),st=et(0),Re=et(!1),Bi=$r(()=>Math.floor(Ot.value*.4)),yo=$r(()=>Math.floor(Ot.value*.2)),q0=$r(()=>p.value&&f.value&&m.value==="good"&&!g.value),X0=async()=>{try{l.current=await O2()}catch(W){console.error("Failed to initialize MediaPipe:",W)}},Pt=W=>{W&&$2[W]?kt.value=$2[W]:kt.value=""},Y0=()=>{if(t.current&&e.current){const{videoWidth:W,videoHeight:yt}=t.current;v.value=W/yt,e.current.width=W,e.current.height=yt,t.current.parentElement&&(e.current.style.left="50%",e.current.style.top="50%",e.current.style.transform="translate(-50%, -50%) scaleX(-1)")}},K0=()=>{const W=st.value<yo.value,yt=st.value>=Bi.value;W&&k.value>=r?Pt("neutral-expression"):W?kt.value="Capturing...":yt?Date.now()-ut.value>c?k.value>=r&&O.value<s?Pt("open-mouth-smile"):Pt("smile-required"):kt.value="Keep smiling!":Pt(null)},J0=()=>{g.value?Pt("multiple-faces"):p.value?m.value==="too-close"?Pt("too-close"):m.value==="too-far"?Pt("too-far"):f.value?At.value?K0():kt.value="Ready to capture":Pt("out-of-bounds"):Pt("no-face")},_o=()=>{d.current&&(cancelAnimationFrame(d.current),d.current=null)},j2=async()=>{if(!l.current||!t.current){_o();return}try{const W=k0(t.current),yt=W||t.current,ht=l.current.detectForVideo(yt,performance.now());if(b.value=ht.faceLandmarks||[],ht.faceLandmarks&&e.current&&t.current)if(W){const $e=t.current.videoWidth,Ke=t.current.videoHeight,Fi=Math.min($e,Ke),xo=($e-Fi)/(2*$e),wr=(Ke-Fi)/(2*Ke),yr=Fi/$e,Di=Fi/Ke,ed=ht.faceLandmarks.map(id=>id.map(Eo=>({x:Eo.x*yr+xo,y:Eo.y*Di+wr,z:Eo.z})));D2(e.current,ed,st.value,Bi.value)}else D2(e.current,ht.faceLandmarks,st.value,Bi.value);else e.current&&A0(e.current);const Co=ht.faceLandmarks?ht.faceLandmarks.length:0;g.value=Co>1;const br=ht.faceBlendshapes&&ht.faceBlendshapes.length>0&&Co===1;if(p.value=br,br&&ht.faceLandmarks){const $e=C0(ht.faceLandmarks);S.value=$e,$e>a?m.value="too-close":$e<o?m.value="too-far":m.value="good",f.value=x0(ht.faceLandmarks,v.value);const Ke=ht.faceBlendshapes[0].categories,Fi=Ke.find(Di=>Di.categoryName==="mouthSmileLeft")?.score||0,xo=Ke.find(Di=>Di.categoryName==="mouthSmileRight")?.score||0,wr=E0(ht.faceLandmarks),yr=(Fi+xo)/2;k.value=yr,O.value=wr,yr>=r&&wr>=s&&(ut.value=Date.now(),wt.value&&At.value&&u.current&&setTimeout(()=>{Date.now()-ut.value<=100&&wt.value&&At.value&&u.current&&u.current()},0))}else k.value=0,S.value=0,O.value=0,f.value=!1,m.value="good";J0()}catch{p.value=!1,f.value=!1,g.value=!1,m.value="good",O.value=0,At.value&&Pt("no-face")}d.current=requestAnimationFrame(j2)},Q0=()=>{d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(j2)},td=()=>{if(!t.current)return;const W=st.value===Ot.value-1,yt=S0(t.current,W);yt&&(W?Q.value=yt:lt.value=[...lt.value,yt],st.value++,be.value=Ot.value-st.value)},vr=()=>{if(h.current&&(clearInterval(h.current),h.current=null),At.value=!1,wt.value=!1,st.value>=Ot.value&&Q.value){const W=lt.value.map(br=>({image:br.split(",")[1],image_type_id:R2.LIVENESS_IMAGE_BASE64})),yt={image:Q.value.split(",")[1],image_type_id:R2.SELFIE_IMAGE_BASE64},ht={images:[...W,yt],referenceImage:Q.value,previewImage:Q.value,meta:{libraryVersion:un}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:ht})),document.querySelector("smart-camera-web")?.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),Re.value=!0}},fn=()=>{h.current&&(clearInterval(h.current),h.current=null),wt.value=!0,!g.value&&p.value&&f.value&&m.value==="good"&&Pt("smile-required")},G2=()=>{h.current&&clearInterval(h.current),h.current=setInterval(()=>{if(st.value>=Ot.value){vr();return}if(g.value){fn();return}if(!p.value)return;if(!f.value){fn();return}if(m.value!=="good"){fn();return}const W=st.value<yo.value,yt=st.value>=Bi.value;if(!(W&&k.value>=r)){if(yt&&Date.now()-ut.value>c){fn();return}td()}},i)},z2=()=>{if(p.value&&m.value==="good"&&f.value&&!g.value){if(st.value>=Bi.value&&Date.now()-ut.value>c)return;wt.value=!1,Pt(null),G2()}};return u.current=z2,{faceDetected:p,faceInBounds:f,faceProximity:m,multipleFaces:g,videoAspectRatio:v,faceLandmarks:b,currentSmileScore:k,currentFaceSize:S,currentMouthOpen:O,lastSmileTime:ut,alertTitle:kt,isReadyToCapture:q0,isCapturing:At,isPaused:wt,countdown:be,capturedImages:lt,referencePhoto:Q,totalCaptures:Ot,capturesTaken:st,hasFinishedCapture:Re,smileCheckpoint:Bi,neutralZone:yo,initializeFaceLandmarker:X0,setupCanvas:Y0,startDetectionLoop:Q0,stopDetectionLoop:_o,updateAlert:Pt,startCapture:async()=>{lt.value=[],At.value=!0,wt.value=!1,Ot.value=Math.ceil(n/i),st.value=0,be.value=Ot.value,G2()},stopCapture:vr,pauseCapture:fn,resumeCapture:z2,handleCancel:()=>{vr(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:un}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:un}}}))},handleClose:()=>{vr(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:un}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:un}}}))},cleanup:()=>{h.current&&clearInterval(h.current),_o()}}},M0=({progress:t,duration:e=1e3,themeColor:i="#001096"})=>{const n=Xt(null),r=Xt(t);return ei(()=>{const s=n.current;if(!s)return;const o=s.getTotalLength();s.style.opacity=t>0?"1":"0";const a=o*(1-r.current),c=o*(1-t);a!==c&&(s.style.transition="none",s.style.strokeDasharray=`${o} ${o}`,s.style.strokeDashoffset=`${a}`,s.getBoundingClientRect(),s.style.transition=`stroke-dashoffset ${e}ms ease-out`,s.style.strokeDashoffset=`${c}`,r.current=t)},[t,e]),L("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:L("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[L("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:L("path",{d:"M0.085 0.382 C0.087 0.357 0.092 0.294 0.131 0.236 C0.200 0.133 0.340 0.063 0.501 0.063 C0.730 0.063 0.915 0.205 0.915 0.382 C0.915 0.424 0.899 0.513 0.891 0.549 C0.882 0.588 0.871 0.626 0.857 0.664 C0.792 0.825 0.639 0.937 0.501 0.937 C0.314 0.937 0.182 0.755 0.144 0.666 C0.126 0.624 0.110 0.557 0.107 0.547 C0.092 0.485 0.081 0.439 0.085 0.382 Z"})}),L("path",{d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:i,fill:"none",style:{strokeWidth:"8"}}),L("path",{ref:n,d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:"#22c55e",style:{strokeWidth:"8"},fill:"none",strokeLinecap:"round"})]})})},T0=({videoRef:t,canvasRef:e,facingMode:i,multipleFaces:n,progress:r,interval:s,themeColor:o})=>L(ye,{children:[L("div",{className:"camera-preview-container",children:[L("div",{className:"video-wrapper",style:{clipPath:n?"none":"url(#selfie-clip-path)"},children:L("div",{className:"video-container",children:[L("video",{ref:t,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),L("canvas",{ref:e,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!n&&L(M0,{progress:r,duration:s,themeColor:o})]}),L("style",{children:`
3228
3229
  .camera-preview-container {
3229
3230
  position: relative;
3230
3231
  width: 100%;