@smileid/web-components 10.0.3 → 10.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/{DocumentCaptureScreens-CkWKSrqy.js → DocumentCaptureScreens-BIJUlWLB.js} +98 -56
- package/dist/esm/DocumentCaptureScreens-BIJUlWLB.js.map +1 -0
- package/dist/esm/{EndUserConsent-CMHp-34-.js → EndUserConsent-D4fd1ovG.js} +2 -2
- package/dist/esm/{EndUserConsent-CMHp-34-.js.map → EndUserConsent-D4fd1ovG.js.map} +1 -1
- package/dist/esm/{Navigation-juBE4qOw.js → Navigation-CTjK6tLU.js} +6 -6
- package/dist/esm/{Navigation-juBE4qOw.js.map → Navigation-CTjK6tLU.js.map} +1 -1
- package/dist/esm/SelfieCaptureScreens-CnMaKUmP.js +11361 -0
- package/dist/esm/SelfieCaptureScreens-CnMaKUmP.js.map +1 -0
- package/dist/esm/document.js +1 -1
- package/dist/esm/end-user-consent.js +1 -1
- package/dist/esm/main.js +4 -4
- package/dist/esm/navigation.js +1 -1
- package/dist/esm/{package-CmYr0HUS.js → package-PZvRbm5J.js} +2 -2
- package/dist/esm/{package-CmYr0HUS.js.map → package-PZvRbm5J.js.map} +1 -1
- package/dist/esm/selfie.js +1 -1
- package/dist/esm/smart-camera-web.js +12 -6
- package/dist/esm/smart-camera-web.js.map +1 -1
- package/dist/esm/{styles-D2i3GFLK.js → styles-BOEZtbuc.js} +19 -5
- package/dist/esm/{styles-D2i3GFLK.js.map → styles-BOEZtbuc.js.map} +1 -1
- package/dist/smart-camera-web.js +278 -290
- package/dist/smart-camera-web.js.map +1 -1
- package/lib/components/document/src/DocumentCaptureScreens.js +1 -1
- package/lib/components/document/src/document-capture/DocumentCapture.js +2 -1
- package/lib/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +54 -8
- package/lib/components/document/src/document-capture-review/DocumentCaptureReview.js +2 -3
- package/lib/components/navigation/src/Navigation.js +5 -5
- package/lib/components/selfie/src/SelfieCaptureScreens.js +116 -118
- package/lib/components/selfie/src/selfie-capture/SelfieCapture.js +54 -10
- package/lib/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +91 -58
- package/lib/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +23 -154
- package/lib/components/selfie/src/selfie-capture-wrapper/SelfieCaptureWrapper.tsx +13 -0
- package/lib/components/selfie/src/smartselfie-capture/SmartSelfieCapture.tsx +66 -6
- package/lib/components/selfie/src/smartselfie-capture/components/CaptureControls.tsx +2 -0
- package/lib/components/selfie/src/smartselfie-capture/hooks/useCamera.ts +165 -21
- package/lib/components/selfie/src/smartselfie-capture/hooks/useFaceCapture.ts +82 -23
- package/lib/components/selfie/src/smartselfie-capture/utils/alertMessages.ts +2 -1
- package/lib/components/selfie/src/smartselfie-capture/utils/mediapipeManager.ts +18 -1
- package/lib/components/signature-pad/package.json +1 -1
- package/lib/components/smart-camera-web/src/SmartCameraWeb.js +7 -1
- package/lib/styles/src/styles.js +18 -4
- package/package.json +3 -1
- package/dist/esm/DocumentCaptureScreens-CkWKSrqy.js.map +0 -1
- package/dist/esm/SelfieCaptureScreens-BF1keQ0h.js +0 -7619
- package/dist/esm/SelfieCaptureScreens-BF1keQ0h.js.map +0 -1
package/dist/smart-camera-web.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var SmartCameraWeb=function(
|
|
1
|
+
var SmartCameraWeb=function(ht){"use strict";var hw=Object.defineProperty,dw=Object.defineProperties;var fw=Object.getOwnPropertyDescriptors;var vc=Object.getOwnPropertySymbols;var B4=Object.prototype.hasOwnProperty,R4=Object.prototype.propertyIsEnumerable;var Uu=Math.pow,Pu=(ht,Dt,Nt)=>Dt in ht?hw(ht,Dt,{enumerable:!0,configurable:!0,writable:!0,value:Nt}):ht[Dt]=Nt,Fe=(ht,Dt)=>{for(var Nt in Dt||(Dt={}))B4.call(Dt,Nt)&&Pu(ht,Nt,Dt[Nt]);if(vc)for(var Nt of vc(Dt))R4.call(Dt,Nt)&&Pu(ht,Nt,Dt[Nt]);return ht},ys=(ht,Dt)=>dw(ht,fw(Dt));var $u=(ht,Dt)=>{var Nt={};for(var We in ht)B4.call(ht,We)&&Dt.indexOf(We)<0&&(Nt[We]=ht[We]);if(ht!=null&&vc)for(var We of vc(ht))Dt.indexOf(We)<0&&R4.call(ht,We)&&(Nt[We]=ht[We]);return Nt};var xr=(ht,Dt,Nt)=>Pu(ht,typeof Dt!="symbol"?Dt+"":Dt,Nt);var q=(ht,Dt,Nt)=>new Promise((We,bo)=>{var _c=Ji=>{try{Cs(Nt.next(Ji))}catch(Er){bo(Er)}},wc=Ji=>{try{Cs(Nt.throw(Ji))}catch(Er){bo(Er)}},Cs=Ji=>Ji.done?We(Ji.value):Promise.resolve(Ji.value).then(_c,wc);Cs((Nt=Nt.apply(ht,Dt)).next())});var mi;function Dt(t){const e=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${t}-${e}`}function Nt(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function We(t){return t&&t.clientHeight<t.scrollHeight}function bo(t,e){const{offsetHeight:i,offsetTop:s}=t,{offsetHeight:o,scrollTop:c}=e,l=s<c,u=s+i>c+o;l?e.scrollTo(0,s):u&&e.scrollTo(0,s-o+i)}class _c extends HTMLElement{constructor(){super(),this.handleRoaming=this.handleRoaming.bind(this)}connectedCallback(){this.trigger=this.querySelector("smileid-combobox-trigger"),document.addEventListener("click",this.handleRoaming),this.addEventListener("focusout",this.handleRoaming),this.addEventListener("blur",this.handleRoaming)}disconnectedCallback(){document.removeEventListener("click",this.handleRoaming),this.removeEventListener("focusout",this.handleRoaming),this.removeEventListener("blur",this.handleRoaming)}handleRoaming(e){const i=e.relatedTarget||e.target;this.contains(i)||this.trigger.getAttribute("expanded")==="true"&&this.trigger.setAttribute("expanded","false")}}class wc extends HTMLElement{constructor(){super(),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleSelection=this.handleSelection.bind(this),this.toggleExpansionState=this.toggleExpansionState.bind(this)}get type(){return this.getAttribute("type")||"text"}get label(){return this.getAttribute("label")||""}get value(){return this.getAttribute("value")||""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){if(!this.label)throw new Error("<combobox-trigger>: a label attribute is required");this.innerHTML=`${this.type==="text"?`
|
|
2
2
|
<div>
|
|
3
3
|
<input ${this.value?`value="${this.value}" `:""}${this.disabled?" disabled ":""}type="text" placeholder="${this.label}" />
|
|
4
4
|
<button ${this.disabled?"disabled ":""}tabindex='-1' type='button'>
|
|
5
5
|
<span class="visually-hidden">Toggle</span>
|
|
6
6
|
</button>
|
|
7
7
|
</div>
|
|
8
|
-
`:`<button ${this.disabled?"disabled ":""}type="button">${this.value||this.label}</button>`}`,this.setAttribute("expanded",!1),this.inputTrigger=this.querySelector("input"),this.buttonTrigger=this.querySelector("button"),this.buttonTrigger.setAttribute("aria-expanded",!1),this.buttonTrigger.setAttribute("role","combobox"),this.buttonTrigger.addEventListener("keydown",this.handleKeyDown),this.buttonTrigger.addEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.setAttribute("aria-expanded",!1),this.inputTrigger.setAttribute("role","combobox"),this.inputTrigger.addEventListener("keydown",this.handleKeyDown),this.inputTrigger.addEventListener("keyup",this.handleKeyUp),this.inputTrigger.addEventListener("change",e=>e.stopPropagation())),this.listbox=this.parentElement.querySelector("smileid-combobox-listbox"),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.options.forEach(e=>{e.addEventListener("combobox.option.select",this.handleSelection)})}disconnectedCallback(){this.buttonTrigger.removeEventListener("keydown",this.handleKeyDown),this.buttonTrigger.removeEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.removeEventListener("keydown",this.handleKeyDown),this.inputTrigger.removeEventListener("keyup",this.handleKeyUp),this.inputTrigger.removeEventListener("change",e=>e.stopPropagation())),this.options&&this.options.forEach(e=>{e.removeEventListener("combobox.option.select",this.handleSelection)})}handleKeyDown(e){if(e.ctrlKey||e.shiftKey)return;const{key:i}=e;switch(i){case"Enter":case"Space":case" ":if(this.getAttribute("expanded")==="true")if(this.inputTrigger&&(i==="Space"||i===" "))this.resetListbox();else{e.preventDefault();const
|
|
8
|
+
`:`<button ${this.disabled?"disabled ":""}type="button">${this.value||this.label}</button>`}`,this.setAttribute("expanded",!1),this.inputTrigger=this.querySelector("input"),this.buttonTrigger=this.querySelector("button"),this.buttonTrigger.setAttribute("aria-expanded",!1),this.buttonTrigger.setAttribute("role","combobox"),this.buttonTrigger.addEventListener("keydown",this.handleKeyDown),this.buttonTrigger.addEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.setAttribute("aria-expanded",!1),this.inputTrigger.setAttribute("role","combobox"),this.inputTrigger.addEventListener("keydown",this.handleKeyDown),this.inputTrigger.addEventListener("keyup",this.handleKeyUp),this.inputTrigger.addEventListener("change",e=>e.stopPropagation())),this.listbox=this.parentElement.querySelector("smileid-combobox-listbox"),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.options.forEach(e=>{e.addEventListener("combobox.option.select",this.handleSelection)})}disconnectedCallback(){this.buttonTrigger.removeEventListener("keydown",this.handleKeyDown),this.buttonTrigger.removeEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.removeEventListener("keydown",this.handleKeyDown),this.inputTrigger.removeEventListener("keyup",this.handleKeyUp),this.inputTrigger.removeEventListener("change",e=>e.stopPropagation())),this.options&&this.options.forEach(e=>{e.removeEventListener("combobox.option.select",this.handleSelection)})}handleKeyDown(e){if(e.ctrlKey||e.shiftKey)return;const{key:i}=e;switch(i){case"Enter":case"Space":case" ":if(this.getAttribute("expanded")==="true")if(this.inputTrigger&&(i==="Space"||i===" "))this.resetListbox();else{e.preventDefault();const s=this.buttonTrigger.getAttribute("aria-activedescendant");s&&document.getElementById(s).click()}else e.preventDefault(),this.toggleExpansionState();break;case"Esc":case"Escape":e.preventDefault(),this.getAttribute("expanded")==="true"&&this.toggleExpansionState();break;case"Down":case"ArrowDown":e.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("First")):this.focusListbox("Down");break;case"Up":case"ArrowUp":e.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("Last")):this.focusListbox("Up");break;case"Left":case"ArrowLeft":case"Right":case"ArrowRight":case"Home":case"End":this.resetListbox();break}}handleKeyUp(e){const{key:i}=e,s=o=>o.length===1&&o.match(/\S| /);(e.key==="Escape"||e.key==="Esc")&&(e.preventDefault(),this.getAttribute("expanded")==="true"?this.toggleExpansionState():this.inputTrigger&&(this.inputTrigger.value="",this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:""})))),(s(i)||i==="Backspace")&&(this.resetListbox(),this.filterListbox(e.target.value))}toggleExpansionState(){const e=this.getAttribute("expanded")==="true";this.setAttribute("expanded",!e),this.buttonTrigger.setAttribute("aria-expanded",!e),this.inputTrigger&&this.inputTrigger.setAttribute("aria-expanded",!e)}handleSelection(e){this.inputTrigger?this.inputTrigger.value=e.detail.label:this.buttonTrigger.textContent=e.detail.label,this.toggleExpansionState(),this.parentElement.dispatchEvent(new CustomEvent("combobox.change",{detail:{value:e.detail.value}}))}filterListbox(e){this.getAttribute("expanded")!=="true"&&this.toggleExpansionState(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:e}))}focusListbox(e){this.resetListbox(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.focus",{detail:{direction:e}}))}resetListbox(){this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.reset"))}}class Cs extends HTMLElement{constructor(){super(),this.handleFilter=this.handleFilter.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleReset=this.handleReset.bind(this),this.handleOptionSelection=this.handleOptionSelection.bind(this)}get emptyLabel(){return this.getAttribute("empty-label")}get emptyState(){return`
|
|
9
9
|
<p id='empty-state' style="text-align: center;">
|
|
10
10
|
${this.emptyLabel||"No items"}
|
|
11
11
|
</p>
|
|
12
|
-
`}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",
|
|
12
|
+
`}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",Dt("listbox")),this.addEventListener("combobox.listbox.filter",this.handleFilter),this.addEventListener("combobox.listbox.focus",this.handleFocus),this.addEventListener("combobox.listbox.reset",this.handleReset),this.triggers=Array.from(this.parentElement.querySelectorAll("smileid-combobox-trigger input, smileid-combobox-trigger button")),this.triggers.forEach(e=>e.setAttribute("aria-controls",this.getAttribute("id"))),this.optionNodes=Array.from(this.querySelectorAll("smileid-combobox-option")),this.selectedNode=this.optionNodes.find(e=>!e.hasAttribute("hidden")&&e.hasAttribute("aria-selected"))||this.optionNodes.filter(e=>!e.hasAttribute("hidden"))[0],this.selectedNode.setAttribute("tabindex","0"),this.optionNodes.forEach(e=>{e.addEventListener("combobox.option.select",this.handleOptionSelection)}),this.optionNodes.length===0&&(this.innerHTML=this.emptyState)}disconnectedCallback(){this.removeEventListener("combobox.listbox.filter",this.handleFilter),this.removeEventListener("combobox.listbox.focus",this.handleFocus),this.removeEventListener("combobox.listbox.reset",this.handleReset),this.optionNodes.forEach(e=>{e.removeEventListener("combobox.option.select",this.handleOptionSelection)})}static get observedAttributes(){return["search-term"]}attributeChangedCallback(e,i,s){switch(e){case"search-term":i&&!s?this.optionNodes.forEach(o=>{o.removeAttribute("hidden")}):s&&this.filterNodes(s);break}}filterNodes(e){this.optionNodes.forEach(o=>{const c=o.getAttribute("value").toLowerCase(),l=o.getAttribute("label").toLowerCase();c.includes(e.toLowerCase())||l.includes(e.toLowerCase())?o.removeAttribute("hidden"):o.setAttribute("hidden",!0)});const i=this.optionNodes.find(o=>!o.hasAttribute("hidden")),s=this.querySelector("#empty-state");!i&&!s?this.insertAdjacentHTML("afterbegin",this.emptyState):i&&s&&this.removeChild(s)}handleFilter(e){const i=e.detail;this.setAttribute("search-term",i)}handleFocus(e){this.setSelected(e.detail.direction)}handleReset(){this.optionNodes.forEach(e=>e.setAttribute("tabindex","-1"))}handleOptionSelection(e){this.triggers.filter(s=>s.tagName==="INPUT")[0]&&this.setAttribute("search-term",e.detail.label)}setSelected(e){const i=this.optionNodes.filter(l=>!l.hasAttribute("hidden"));this.selectedNode.setAttribute("tabindex","0");const s=i.findIndex(l=>l===this.selectedNode),o=i.length-1;let c;switch(e){case"First":c=0;break;case"Last":c=o;break;case"Up":s===0?c=o:c=s-1;break;default:s===o?c=0:c=s+1;break}s!==c&&this.swapSelected(this.selectedNode,i[c])}swapSelected(e,i){e.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.selectedNode=i,We(this)&&bo(this.selectedNode,this),Nt(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(s=>s.setAttribute("aria-activedescendant",i.id))}}class Ji extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",Dt("option")),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.addEventListener("click",this.select)}disconnectedCallback(){this.removeEventListener("click",this.select)}get value(){return this.getAttribute("value")}get label(){return this.getAttribute("label")}select(){const e=this.options.find(i=>i.getAttribute("aria-selected"));e&&e.removeAttribute("aria-selected"),this.setAttribute("aria-selected",!0),this.dispatchEvent(new CustomEvent("combobox.option.select",{detail:{id:this.getAttribute("id"),label:this.label,value:this.value}}))}}const Er=_c,Hu=wc,Vu=Cs,Gu=Ji;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",Er),window.customElements.define("smileid-combobox-trigger",Hu),window.customElements.define("smileid-combobox-listbox",Vu),window.customElements.define("smileid-combobox-option",Gu));const Ar={ID_CARD_BACK_IMAGE_BASE64:7,ID_CARD_BACK_IMAGE_FILE:5,ID_CARD_IMAGE_BASE64:3,ID_CARD_IMAGE_FILE:1,LIVENESS_IMAGE_BASE64:6,LIVENESS_IMAGE_FILE:4,SELFIE_IMAGE_BASE64:2,SELFIE_IMAGE_FILE:0},D4=`
|
|
13
13
|
.text-xs {
|
|
14
14
|
font-size: 0.75rem;
|
|
15
15
|
line-height: 1rem;
|
|
@@ -58,14 +58,14 @@ var SmartCameraWeb=function(St){"use strict";function Ao(t){const e=[...Array(30
|
|
|
58
58
|
.font-normal {
|
|
59
59
|
font-weight: 400;
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,Ai=t=>`<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
62
62
|
<link
|
|
63
63
|
href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"
|
|
64
64
|
rel="stylesheet"
|
|
65
65
|
as="style"
|
|
66
66
|
/>
|
|
67
67
|
<style>
|
|
68
|
-
${
|
|
68
|
+
${D4}
|
|
69
69
|
:host {
|
|
70
70
|
--theme-color: ${t||"#001096"};
|
|
71
71
|
--color-active: #001096;
|
|
@@ -316,6 +316,9 @@ ${Q2}
|
|
|
316
316
|
|
|
317
317
|
#document-capture-instructions-screen,
|
|
318
318
|
#back-of-document-capture-instructions-screen {
|
|
319
|
+
box-sizing: border-box;
|
|
320
|
+
height: 100%;
|
|
321
|
+
padding: 1rem;
|
|
319
322
|
display: flex;
|
|
320
323
|
flex-direction: column;
|
|
321
324
|
max-block-size: 100%;
|
|
@@ -343,22 +346,33 @@ ${Q2}
|
|
|
343
346
|
padding-bottom: 2rem;
|
|
344
347
|
}
|
|
345
348
|
|
|
349
|
+
smart-camera-web, selfie-capture-screens, selfie-capture-instructions, document-capture-screens, document-capture-instructions {
|
|
350
|
+
height: 100%;
|
|
351
|
+
display: block;
|
|
352
|
+
}
|
|
353
|
+
|
|
346
354
|
.instructions-wrapper {
|
|
347
355
|
display: inline-flex;
|
|
348
356
|
flex-direction: column;
|
|
349
|
-
gap:
|
|
350
|
-
|
|
351
|
-
|
|
357
|
+
gap: 1rem;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@media (min-width: 40rem) {
|
|
361
|
+
.instructions-wrapper {
|
|
362
|
+
gap: 1.75rem;
|
|
363
|
+
}
|
|
352
364
|
}
|
|
365
|
+
|
|
353
366
|
.instructions {
|
|
354
367
|
display: flex;
|
|
355
368
|
align-items: center;
|
|
356
369
|
text-align: initial;
|
|
370
|
+
gap: 0.5rem;
|
|
357
371
|
}
|
|
358
372
|
|
|
359
373
|
.instructions svg {
|
|
360
374
|
flex-shrink: 0;
|
|
361
|
-
margin-inline-end:
|
|
375
|
+
margin-inline-end: 0.25rem;
|
|
362
376
|
}
|
|
363
377
|
|
|
364
378
|
.instructions p {
|
|
@@ -409,7 +423,7 @@ ${Q2}
|
|
|
409
423
|
left: 1.25rem;
|
|
410
424
|
}
|
|
411
425
|
|
|
412
|
-
</style
|
|
426
|
+
</style>`,zi=class zi{static getMedia(e){return q(this,null,function*(){return zi.stream=yield navigator.mediaDevices.getUserMedia(e),zi.stream})}static stopMedia(){zi.stream&&(zi.stream.getTracks().forEach(e=>e.stop()),zi.stream=null)}static supportsAgentMode(){return q(this,null,function*(){try{const i=(yield navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput");let s=!1;return i.forEach(o=>o.label.toLowerCase().includes("back")||o.label.toLowerCase().includes("rear")?(s=!0,!0):!1),s}catch(e){return console.warn("Error accessing media devices: ",e),!1}})}static isSamsungMultiCameraDevice(){const e=navigator.userAgent.match(/SM-[N|G]\d{3}/);if(!e)return!1;const i=parseInt(e[0].match(/\d{3}/)[0],10);return!Number.isNaN(i)&&i>=970}static handleCameraError(e){switch(e.name){case"NotAllowedError":case"SecurityError":return`
|
|
413
427
|
Looks like camera access was not granted, or was blocked by a browser
|
|
414
428
|
level setting / extension. Please follow the prompt from the URL bar,
|
|
415
429
|
or extensions, and enable access.
|
|
@@ -426,7 +440,7 @@ ${Q2}
|
|
|
426
440
|
`;case"TypeError":return`
|
|
427
441
|
This site is insecure, and as such cannot have access to your camera.
|
|
428
442
|
Try to navigate to a secure version of this page, or contact the owner.
|
|
429
|
-
`;default:return e.message}}}class
|
|
443
|
+
`;default:return e.message}}};xr(zi,"stream",null),xr(zi,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:zi.isSamsungMultiCameraDevice()?2:1});let et=zi;class zu extends HTMLElement{connectedCallback(){const e=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
430
444
|
:host {
|
|
431
445
|
display: flex;
|
|
432
446
|
max-inline-size: 100%;
|
|
@@ -446,7 +460,7 @@ button {
|
|
|
446
460
|
color: #ffffff;
|
|
447
461
|
cursor: pointer;
|
|
448
462
|
display: inline-flex;
|
|
449
|
-
font-size:
|
|
463
|
+
font-size: 1rem;
|
|
450
464
|
font-weight: 500;
|
|
451
465
|
inline-size: 100%;
|
|
452
466
|
justify-content: center;
|
|
@@ -489,11 +503,11 @@ button[data-type="icon"] {
|
|
|
489
503
|
white-space: nowrap;
|
|
490
504
|
inline-size: 1px;
|
|
491
505
|
}
|
|
492
|
-
`;const
|
|
506
|
+
`;const s=document.createElement("button");s.setAttribute("class","back-button"),s.setAttribute("data-type","icon"),s.setAttribute("part","back-button"),s.setAttribute("type","button"),s.innerHTML=`
|
|
493
507
|
<svg
|
|
494
508
|
xmlns="http://www.w3.org/2000/svg"
|
|
495
|
-
width="
|
|
496
|
-
height="
|
|
509
|
+
width="24"
|
|
510
|
+
height="24"
|
|
497
511
|
viewBox="0 0 24 24"
|
|
498
512
|
fill="none"
|
|
499
513
|
>
|
|
@@ -508,12 +522,12 @@ button[data-type="icon"] {
|
|
|
508
522
|
/>
|
|
509
523
|
</svg>
|
|
510
524
|
<span part="back-button-text">Back</span>
|
|
511
|
-
`;const
|
|
525
|
+
`;const o=document.createElement("button");o.setAttribute("class","close-button"),o.setAttribute("data-type","icon"),o.setAttribute("part","close-button"),o.setAttribute("type","button"),o.innerHTML=`
|
|
512
526
|
<svg
|
|
513
527
|
xmlns="http://www.w3.org/2000/svg"
|
|
514
528
|
viewBox="0 0 24 24"
|
|
515
|
-
width="
|
|
516
|
-
height="
|
|
529
|
+
width="24"
|
|
530
|
+
height="24"
|
|
517
531
|
fill="none"
|
|
518
532
|
>
|
|
519
533
|
<path
|
|
@@ -529,7 +543,7 @@ button[data-type="icon"] {
|
|
|
529
543
|
<span class="visually-hidden"
|
|
530
544
|
>Close SmileIdentity Verification frame</span
|
|
531
545
|
>
|
|
532
|
-
`,e.appendChild(i),this.showBackButton&&e.appendChild(
|
|
546
|
+
`,e.appendChild(i),this.showBackButton&&e.appendChild(s),e.appendChild(o),this.backButton=s,this.backButton.addEventListener("click",()=>this.handleBack()),this.closeButton=o,this.closeButton.addEventListener("click",()=>this.handleClose())}disconnectedCallback(){this.backButton.removeEventListener("click",()=>this.handleBack()),this.closeButton.removeEventListener("click",()=>this.handleClose())}handleBack(){this.dispatchEvent(new CustomEvent("navigation.back"))}handleClose(){this.dispatchEvent(new CustomEvent("navigation.close"))}get showBackButton(){return!this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hasThemeColor(){var e;return(e=this.getAttribute("theme-color"))==null?void 0:e.trim()}}"customElements"in window&&!window.customElements.get("smileid-navigation")&&window.customElements.define("smileid-navigation",zu);function O4(t,e=16){const i=new Set;for(let s=0;s<Math.min(t.length,1e4);s+=4)if(i.add(t[s]<<16|t[s+1]<<8|t[s+2]),i.size>e)return!0;return!1}function P4(){return`
|
|
533
547
|
<style>
|
|
534
548
|
.visually-hidden {
|
|
535
549
|
border: 0;
|
|
@@ -574,11 +588,11 @@ button[data-type="icon"] {
|
|
|
574
588
|
|
|
575
589
|
#document-capture-screen,
|
|
576
590
|
#back-of-document-capture-screen {
|
|
577
|
-
block-size: 45rem;
|
|
578
591
|
display: flex;
|
|
579
592
|
flex-direction: column;
|
|
580
593
|
max-block-size: 100%;
|
|
581
594
|
max-inline-size: 40ch;
|
|
595
|
+
padding: 1rem;
|
|
582
596
|
}
|
|
583
597
|
|
|
584
598
|
#document-capture-screen header p {
|
|
@@ -635,6 +649,7 @@ button[data-type="icon"] {
|
|
|
635
649
|
inset: -1px;
|
|
636
650
|
}
|
|
637
651
|
canvas {
|
|
652
|
+
width: 100%;
|
|
638
653
|
border-width: 0.25rem;
|
|
639
654
|
border-color: #9394ab;
|
|
640
655
|
border-style: solid;
|
|
@@ -673,7 +688,7 @@ button[data-type="icon"] {
|
|
|
673
688
|
padding-top: 10px;
|
|
674
689
|
}
|
|
675
690
|
</style>
|
|
676
|
-
${
|
|
691
|
+
${Ai(this.themeColor)}
|
|
677
692
|
<div id='document-capture-screen' class='flow center flex-column'>
|
|
678
693
|
<smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
|
|
679
694
|
<h2 class='text-base font-bold title-color'>${this.documentName}</h2>
|
|
@@ -701,7 +716,7 @@ button[data-type="icon"] {
|
|
|
701
716
|
</div>
|
|
702
717
|
</div>
|
|
703
718
|
</div>
|
|
704
|
-
`}const
|
|
719
|
+
`}const Sr=.6;class U4 extends HTMLElement{constructor(){super(),this.templateString=P4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.IdSides={back:"Back",front:"Front"}}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}getUserMedia(){return q(this,null,function*(){if(!et.stream&&this.hasAttribute("data-camera-error")){try{yield et.getMedia({audio:!1,video:ys(Fe({},et.environmentOptions),{aspectRatio:{ideal:1.7777777777777777}})})}catch(e){console.error(e.constraint),console.error(e.message)}this.handleIDStream(et.stream)}})}_captureIDImage(){const e=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:Fe({},e)}))}_drawIDImage(e=this._IDVideo){const i=document.createElement("canvas");if(this.isPortraitCaptureView){i.width=e.videoWidth,i.height=i.width*16/9;const h=document.createElement("canvas");h.width=i.width,h.height=i.height,this.updatePortraitId(i,e,1,1),this.updatePortraitId(h,e);const f=i.toDataURL("image/jpeg"),_=h.toDataURL("image/jpeg");return Fe({image:f,originalHeight:i.height,originalWidth:i.width,previewImage:_},this.idCardRegion)}i.width=2240,i.height=1260;const s=i.width/(e.videoWidth/e.videoHeight);i.height=s;const o=document.createElement("canvas");if(o.height=i.height,o.width=i.width,e.videoWidth<e.videoHeight){const h=document.createElement("canvas");o.height=i.width/1.75,i.width=2240,i.height=i.width/1.77,this._capturePortraitToLandscapeImage(h,e),this._drawLandscapeImageFromCanvas(i,h,1,1),this._drawLandscapeImageFromCanvas(o,h)}else this._drawLandscapeImage(i,e,1,1),this._drawLandscapeImage(o,e);const l=i.toDataURL("image/jpeg"),u=o.toDataURL("image/jpeg");return Fe({image:l,originalHeight:i.height,originalWidth:i.width,previewImage:u},this.idCardRegion)}_drawImage(e,i=!0,s=et.stream){this.resetErrorMessage();const o=e.getContext("2d");if(o.drawImage(s,0,0,s.videoWidth,s.videoHeight,0,0,e.width,e.height),i){const c=o.getImageData(0,0,e.width,e.height);if(O4(c.data))return o;throw new Error("Unable to capture webcam images - Please try another device")}else return o}handleIDStream(e){try{const i=this.shadowRoot.querySelector("canvas");i&&i.remove();let s=null,o=null;s=document.createElement("video"),o=document.createElement("canvas");const c=this.shadowRoot.querySelector(".id-video-container");s.muted=!0,s.setAttribute("muted","true"),s.autoplay=!0,s.playsInline=!0,"srcObject"in s?s.srcObject=e:s.src=window.URL.createObjectURL(e),o.width=c.clientWidth,o.height=c.clientWidth*9/16,this.isPortraitCaptureView&&(o.height=c.clientWidth*16/9),s.onloadedmetadata=()=>{s.play(),this.shadowRoot.querySelector("#loader").hidden=!0,this.shadowRoot.querySelector(".id-video").hidden=!1,this.shadowRoot.querySelector(".actions").hidden=!1,i||c.prepend(o)};const l=()=>{if(s.paused||s.ended)return;s.removeEventListener("playing",l);const h=s.videoWidth/s.videoHeight<1;if(this.isPortraitCaptureView){this.updatePortraitId(o,s),requestAnimationFrame(l);return}if(h){c.classList.add("mobile-camera-screen");const f=document.createElement("canvas");this._capturePortraitToLandscapeImage(f,s),this._drawLandscapeImageFromCanvas(o,f)}else this._drawLandscapeImage(o,s);requestAnimationFrame(l)};s.addEventListener("playing",l),this._IDStream=e,this._IDVideo=s}catch(i){this.setAttribute("data-camera-error",et.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),et.stopMedia()}}_drawLandscapeImage(e,i=this._IDVideo,s=Sr,o=Sr){const c=this.height?this.height/i.videoHeight:s,l=this.width?this.width/i.videoWidth:o,u=(1-s)/2,h=(1-o)/2,f=i.videoWidth*l,_=i.videoHeight*c,m=i.videoWidth*h,b=i.videoHeight*u;e.getContext("2d").drawImage(i,m,b,f,_,0,0,e.width,e.height)}_capturePortraitToLandscapeImage(e,i=this._IDVideo){const{videoHeight:s,videoWidth:o}=i,c=o,l=o*9/16,u=0,h=(s-l)/2;e.width=c,e.height=l,e.getContext("2d").drawImage(i,u,h,c,l,0,0,e.width,e.height)}_drawLandscapeImageFromCanvas(e,i,s=Sr,o=Sr){const c=this.height?this.height/i.height:s,l=this.width?this.width/i.width:o,u=(1-s)/2,h=(1-o)/2,f=i.width*l,_=i.height*c,m=i.width*h,b=i.height*u;e.getContext("2d").drawImage(i,m,b,f,_,0,0,e.width,e.height)}_drawPortraitToLandscapeImage(e,i=this._IDVideo){const{videoHeight:s,videoWidth:o}=i,c=600,l=400;e.width=c,e.height=l;const u=(o-c)/2,h=(s-l)/2;e.getContext("2d").drawImage(i,u,h,c,l,0,0,e.width,e.height)}updatePortraitId(e,i=this._IDVideo,s=Sr,o=Sr){const{videoWidth:c,videoHeight:l}=i;if(c&&l){const u=document.createElement("canvas"),h=9/16;let f,_,m,b;c/l>h?(_=l,f=_*h,m=(c-f)/2,b=0):(f=c,_=f,m=0,b=0),u.height=_,u.width=f,u.getContext("2d").drawImage(i,m,b,f,_,0,0,u.width,u.height);const E=this.height?this.height/f:s,A=this.width?this.width/_:o,k=(1-s)/2,F=(1-o)/2,M=f*A,D=_*E,R=f*F,$=_*k;e.getContext("2d").drawImage(u,R,$,M,D,0,0,e.width,e.height)}}_stopIDVideoStream(e=this._IDStream){e.getTracks().forEach(i=>i.stop())}setUpEventListeners(){this.captureIDImage=this.shadowRoot.querySelector("#capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),et.stream&&this.handleIDStream(et.stream),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.captureIDImage.addEventListener("click",()=>{this._captureIDImage()}),this.getUserMedia()}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")||`${this.IdSides[this.sideOfId]} of ${this.documentName}`}get height(){return this.getAttribute("height")}get width(){return this.getAttribute("width")}get hidden(){return this.getAttribute("hidden")}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}get documentType(){return this.getAttribute("document-type")||""}get documentName(){return this.getAttribute("document-name")||"Document"}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get cameraError(){return this.getAttribute("data-camera-error")}static get observedAttributes(){return["data-camera-error","data-camera-ready","document-name","document-type","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(e){switch(e){case"data-camera-error":case"data-camera-ready":case"document-name":case"document-type":case"hidden":case"title":this.connectedCallback();break}}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture.cancelled")),et.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),et.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",U4);function $4(){return`
|
|
705
720
|
<style>
|
|
706
721
|
.retake-photo.button[data-variant~="ghost"] {
|
|
707
722
|
color: #FF5805;
|
|
@@ -716,7 +731,6 @@ button[data-type="icon"] {
|
|
|
716
731
|
|
|
717
732
|
.section {
|
|
718
733
|
width: 100%;
|
|
719
|
-
height: 100vh;
|
|
720
734
|
justify-content: center;
|
|
721
735
|
}
|
|
722
736
|
}
|
|
@@ -824,11 +838,11 @@ button[data-type="icon"] {
|
|
|
824
838
|
}
|
|
825
839
|
|
|
826
840
|
#document-capture-review-screen {
|
|
827
|
-
block-size: 45rem;
|
|
828
841
|
display: flex;
|
|
829
842
|
flex-direction: column;
|
|
830
843
|
max-block-size: 100%;
|
|
831
844
|
max-inline-size: 40ch;
|
|
845
|
+
padding: 1rem;
|
|
832
846
|
}
|
|
833
847
|
|
|
834
848
|
#document-capture-review-screen .id-image-container.landscape {
|
|
@@ -893,7 +907,7 @@ button[data-type="icon"] {
|
|
|
893
907
|
text-align: center;
|
|
894
908
|
|
|
895
909
|
/* h1 */
|
|
896
|
-
font-size: 1.
|
|
910
|
+
font-size: 1.25rem;
|
|
897
911
|
font-style: normal;
|
|
898
912
|
font-weight: 700;
|
|
899
913
|
line-height: 36px; /* 150% */
|
|
@@ -917,7 +931,7 @@ button[data-type="icon"] {
|
|
|
917
931
|
line-height: 1.5rem;
|
|
918
932
|
}
|
|
919
933
|
</style>
|
|
920
|
-
${
|
|
934
|
+
${Ai(this.themeColor)}
|
|
921
935
|
<div id='document-capture-review-screen' class='flow center'>
|
|
922
936
|
<smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
|
|
923
937
|
<h1 class="header-title title-color">
|
|
@@ -946,7 +960,7 @@ button[data-type="icon"] {
|
|
|
946
960
|
`}
|
|
947
961
|
</div>
|
|
948
962
|
</div>
|
|
949
|
-
`}class
|
|
963
|
+
`}class N4 extends HTMLElement{constructor(){super(),this.templateString=$4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image"]}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 imageSrc(){return this.getAttribute("data-image")}get title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.close"))}attributeChangedCallback(e){switch(e){case"data-image":case"hide-back-to-host":case"show-navigation":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectIDImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureIDImage=this.shadowRoot.querySelector("#re-capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.accepted",{detail:{}}))}),this.reCaptureIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("document-capture-review")&&window.customElements.define("document-capture-review",N4);let H4=(mi=class{static getHumanSize(e){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1),o=e/Uu(1024,s);return s===0?`${e} bytes`:`${o.toFixed(0)} ${i[s]}`}static getData(e){return new Promise((i,s)=>{const o=new FileReader;o.onload=c=>{i(c.target.result)},o.onerror=()=>{s(new Error("An error occurred reading the file. Please check the file, and try again"))},o.readAsDataURL(e)})}static retrieve(e){return q(this,null,function*(){if(e.length>1)throw new Error("Only one file upload is permitted at a time");const i=e[0];if(!mi.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG or PNG image");if(i.size>mi.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${mi.getHumanSize(mi.memoryLimit)}.`);return yield mi.getData(i)})}},xr(mi,"memoryLimit",1024e4),xr(mi,"supportedTypes",["image/jpeg","image/png"]),mi);function V4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
|
|
950
964
|
<path d="M15.3799 21.2759C15.3799 16.8576 18.9616 13.2759 23.3799 13.2759H64.2764C68.6947 13.2759 72.2764 16.8576 72.2764 21.2759V73.5517C72.2764 77.97 68.6947 81.5517 64.2764 81.5517H23.3799C18.9616 81.5517 15.3799 77.97 15.3799 73.5517V21.2759Z" fill="#F6C969"/>
|
|
951
965
|
<g filter="url(#filter0_d_1281_4127)">
|
|
952
966
|
<path d="M60.2117 80.8741C60.2117 80.8741 49.3661 81.5134 44.1952 81.5134C39.0242 81.5134 28.1787 80.8741 28.1787 80.8741C28.1787 80.8741 34.6256 78.4515 35.3307 76.8701C35.7001 76.0962 35.8344 73.2362 35.9015 70.578C35.9687 67.9199 35.9015 65.5646 35.9015 65.5646L44.1952 65.6992L52.4888 65.5646C52.4888 65.5646 52.3881 72.0921 52.7575 75.3223C52.7813 75.8503 52.8832 76.372 53.0597 76.8701C53.7984 78.4515 60.2117 80.8741 60.2117 80.8741Z" fill="url(#paint0_linear_1281_4127)"/>
|
|
@@ -1054,7 +1068,7 @@ button[data-type="icon"] {
|
|
|
1054
1068
|
<stop offset="0.71" stop-color="#FF766A"/>
|
|
1055
1069
|
</linearGradient>
|
|
1056
1070
|
</defs>
|
|
1057
|
-
</svg>`}function
|
|
1071
|
+
</svg>`}function G4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="182" height="108" viewBox="0 0 182 108" fill="none">
|
|
1058
1072
|
<path d="M143 68C143 65.7909 144.791 64 147 64H164C166.209 64 168 65.7909 168 68V89C168 91.2091 166.209 93 164 93H147C144.791 93 143 91.2091 143 89V68Z" fill="#F6C969"/>
|
|
1059
1073
|
<g filter="url(#filter0_d_1281_4284)">
|
|
1060
1074
|
<mask id="path-2-inside-1_1281_4284" fill="white">
|
|
@@ -1089,13 +1103,52 @@ button[data-type="icon"] {
|
|
|
1089
1103
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1281_4284" result="shape"/>
|
|
1090
1104
|
</filter>
|
|
1091
1105
|
</defs>
|
|
1092
|
-
</svg>`}function
|
|
1106
|
+
</svg>`}function z4(){return`
|
|
1107
|
+
<style>
|
|
1108
|
+
h1 {
|
|
1109
|
+
font-size: 1.25rem;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
.controls {
|
|
1113
|
+
width: 100%;
|
|
1114
|
+
margin-top: 1rem;
|
|
1115
|
+
display: flex;
|
|
1116
|
+
flex-direction: column;
|
|
1117
|
+
gap: 0.5rem;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
.content-root {
|
|
1121
|
+
height: 100%;
|
|
1122
|
+
display: flex;
|
|
1123
|
+
align-items: center;
|
|
1124
|
+
flex-direction: column;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
.content-header, .content-body, .content-footer {
|
|
1128
|
+
width: 100%;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
.content-body {
|
|
1132
|
+
height: 100%;
|
|
1133
|
+
display: flex;
|
|
1134
|
+
flex-direction: column;
|
|
1135
|
+
align-items: center;
|
|
1136
|
+
justify-content: space-between;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
.content-body header {
|
|
1140
|
+
margin-top: 1rem;
|
|
1141
|
+
}
|
|
1142
|
+
</style>
|
|
1093
1143
|
<div id="document-capture-instructions-screen" class="flow center">
|
|
1094
|
-
<
|
|
1144
|
+
<div class="content-root">
|
|
1145
|
+
<div class="content-header">
|
|
1095
1146
|
<smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
|
|
1147
|
+
</div>
|
|
1148
|
+
<div class="content-body">
|
|
1096
1149
|
<header>
|
|
1097
|
-
${this.isFrontOfId?
|
|
1098
|
-
<h1 class='
|
|
1150
|
+
${this.isFrontOfId?V4():G4()}
|
|
1151
|
+
<h1 class='title-color font-bold'>${this.title}</h1>
|
|
1099
1152
|
<p class="description text-sm font-normal">
|
|
1100
1153
|
We'll use it to verify your identity.
|
|
1101
1154
|
</p>
|
|
@@ -1103,7 +1156,7 @@ button[data-type="icon"] {
|
|
|
1103
1156
|
Please follow the instructions below.
|
|
1104
1157
|
</p>
|
|
1105
1158
|
</header>
|
|
1106
|
-
<div class="
|
|
1159
|
+
<div class="instructions-wrapper">
|
|
1107
1160
|
<div class="instructions">
|
|
1108
1161
|
<svg
|
|
1109
1162
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1277,9 +1330,7 @@ button[data-type="icon"] {
|
|
|
1277
1330
|
<div id="error" class='color-red'>
|
|
1278
1331
|
</div>
|
|
1279
1332
|
</div>
|
|
1280
|
-
|
|
1281
|
-
<section className="footer">
|
|
1282
|
-
<div class='flow'>
|
|
1333
|
+
<div class='controls'>
|
|
1283
1334
|
${this.supportBothCaptureModes||this.documentCaptureModes==="camera"?`
|
|
1284
1335
|
<button data-variant='solid full-width' class='button' type='button' id='take-photo'>
|
|
1285
1336
|
Take Photo
|
|
@@ -1292,13 +1343,18 @@ button[data-type="icon"] {
|
|
|
1292
1343
|
</label>
|
|
1293
1344
|
`:""}
|
|
1294
1345
|
</div>
|
|
1295
|
-
${this.hideAttribution?""
|
|
1296
|
-
|
|
1346
|
+
${this.hideAttribution?"":`
|
|
1347
|
+
<div class="content-footer">
|
|
1348
|
+
<powered-by-smile-id></powered-by-smile-id>
|
|
1349
|
+
</div>
|
|
1350
|
+
`}
|
|
1351
|
+
</div>
|
|
1297
1352
|
</div>
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1353
|
+
</div>
|
|
1354
|
+
${Ai(this.themeColor)}
|
|
1355
|
+
`}class W4 extends HTMLElement{constructor(){super(),this.templateString=z4.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",i=>q(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:s}=i.target,o=yield H4.retrieve(s);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:o,previewImage:o}}))}catch(s){this.shadowRoot.querySelector("#error").innerHTML=s.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",W4);const xs={version:"10.0.5"},Z4=xs.version,at=document.querySelector("smart-camera-web");function Cn(t){return q(this,null,function*(){try{const e=yield et.getMedia({audio:!1,video:et.environmentOptions}),s=(yield navigator.mediaDevices.enumerateDevices()).find(o=>o.kind==="videoinput"&&e.getVideoTracks()[0].getSettings().deviceId===o.deviceId);at==null||at.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:s==null?void 0:s.label}})),t.removeAttribute("data-camera-error"),t.setAttribute("data-camera-ready",!0)}catch(e){t.removeAttribute("data-camera-ready"),t.setAttribute("data-camera-error",et.handleCameraError(e))}})}class Wu extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),at==null||at.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
|
|
1356
|
+
${Ai(this.themeColor)}
|
|
1357
|
+
<div style="height: 100%;">
|
|
1302
1358
|
<document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
|
|
1303
1359
|
${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions?"hidden":""}
|
|
1304
1360
|
${this.hideAttribution}
|
|
@@ -1317,14 +1373,14 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
1317
1373
|
<document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
|
|
1318
1374
|
<document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
|
|
1319
1375
|
</div>
|
|
1320
|
-
`,this._data={images:[],meta:{libraryVersion:
|
|
1376
|
+
`,this._data={images:[],meta:{libraryVersion:Z4}},this.documentInstruction=this.querySelector("document-capture-instructions"),this.documentInstructionBack=this.querySelector("#document-capture-instructions-back"),this.idCapture=this.querySelector("#document-capture-front"),this.idReview=this.querySelector("#front-of-document-capture-review"),this.idCaptureBack=this.querySelector("#document-capture-back"),this.backOfIdReview=this.querySelector("#back-of-document-capture-review"),this.thankYouScreen=this.querySelector("thank-you"),this.hideInstructions?(Cn(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){et.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.documentInstruction.addEventListener("document-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.documentInstruction.addEventListener("document-capture-instructions.capture",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)})),this.documentInstruction.addEventListener("document-capture-instructions.upload",i=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"gallery"}})),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ar.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-capture-end")),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ar.ID_CARD_IMAGE_BASE64}),et.stopMedia(),this.setActiveScreen(this.idReview)}),this.idCapture.addEventListener("document-capture.cancelled",()=>{this.hideInstructions?this.handleBackEvents():this.setActiveScreen(this.documentInstruction)}),this.idReview.addEventListener("document-capture-review.rejected",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.idReview.addEventListener("document-capture-review.accepted",()=>q(this,null,function*(){this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Cn(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),yield Cn(this.idCaptureBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",()=>q(this,null,function*(){this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",i=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"gallery"}})),this.backOfIdReview.setAttribute("data-image",i.detail.image),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ar.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-capture-end")),this.backOfIdReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:Ar.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),et.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",()=>q(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Cn(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.accepted",()=>{this._publishSelectedImages()}),[this.documentInstruction,this.idCapture,this.documentInstructionBack,this.idCaptureBack,this.idReview,this.backOfIdReview].forEach(i=>{i.addEventListener(`${i.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvents())})}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("document-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get documentType(){return this.hasAttribute("document-type")?`document-type='${this.getAttribute("document-type")}'`:""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.close"))}setActiveScreen(e){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),e.removeAttribute("hidden"),this.activeScreen=e}static get observedAttributes(){return["document-capture-modes","document-type","hide-back-to-host","show-navigation","hide-back-of-id"]}attributeChangedCallback(e){switch(e){case"document-capture-modes":case"document-type":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("document-capture-screens")&&customElements.define("document-capture-screens",Wu);var yo=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function q4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Es={exports:{}};/*!
|
|
1321
1377
|
* validate.js 0.13.1
|
|
1322
1378
|
*
|
|
1323
1379
|
* (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
|
|
1324
1380
|
* Validate.js may be freely distributed under the MIT license.
|
|
1325
1381
|
* For all details and documentation:
|
|
1326
1382
|
* http://validatejs.org/
|
|
1327
|
-
*/var ul=Oi.exports,Fo;function pl(){return Fo||(Fo=1,function(t,e){(function(i,n,r){var s=function(a,c,l){l=o.extend({},o.options,l);var d=o.runValidations(a,c,l);if(d.some(function(h){return o.isPromise(h.error)}))throw new Error("Use validate.async if you want support for promises");return s.processValidationResults(d,l)},o=s;o.extend=function(a){return[].slice.call(arguments,1).forEach(function(c){for(var l in c)a[l]=c[l]}),a},o.extend(s,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var a=o.format("%{major}.%{minor}.%{patch}",o.version);return o.isEmpty(o.version.metadata)||(a+="+"+o.version.metadata),a}},Promise:typeof Promise<"u"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(a,c,l){var d=[],h,u,p,f,m,g,v;(o.isDomElement(a)||o.isJqueryElement(a))&&(a=o.collectFormValues(a));for(h in c){p=o.getDeepObjectValue(a,h),f=o.result(c[h],p,a,h,l,c);for(u in f){if(m=o.validators[u],!m)throw v=o.format("Unknown validator %{name}",{name:u}),new Error(v);g=f[u],g=o.result(g,p,a,h,l,c),g&&d.push({attribute:h,value:p,validator:u,globalOptions:l,attributes:a,options:g,error:m.call(m,p,g,h,a,l)})}}return d},processValidationResults:function(a,c){a=o.pruneEmptyErrors(a,c),a=o.expandMultipleErrors(a,c),a=o.convertErrorMessages(a,c);var l=c.format||"grouped";if(typeof o.formatters[l]=="function")a=o.formatters[l](a);else throw new Error(o.format("Unknown format %{format}",c));return o.isEmpty(a)?void 0:a},async:function(a,c,l){l=o.extend({},o.async.options,l);var d=l.wrapErrors||function(u){return u};l.cleanAttributes!==!1&&(a=o.cleanAttributes(a,c));var h=o.runValidations(a,c,l);return new o.Promise(function(u,p){o.waitForResults(h).then(function(){var f=o.processValidationResults(h,l);f?p(new d(f,l,a,c)):u(a)},function(f){p(f)})})},single:function(a,c,l){return l=o.extend({},o.single.options,l,{format:"flat",fullMessages:!1}),o({single:a},{single:c},l)},waitForResults:function(a){return a.reduce(function(c,l){return o.isPromise(l.error)?c.then(function(){return l.error.then(function(d){l.error=d||null})}):c},new o.Promise(function(c){c()}))},result:function(a){var c=[].slice.call(arguments,1);return typeof a=="function"&&(a=a.apply(null,c)),a},isNumber:function(a){return typeof a=="number"&&!isNaN(a)},isFunction:function(a){return typeof a=="function"},isInteger:function(a){return o.isNumber(a)&&a%1===0},isBoolean:function(a){return typeof a=="boolean"},isObject:function(a){return a===Object(a)},isDate:function(a){return a instanceof Date},isDefined:function(a){return a!=null},isPromise:function(a){return!!a&&o.isFunction(a.then)},isJqueryElement:function(a){return a&&o.isString(a.jquery)},isDomElement:function(a){return!a||!a.querySelectorAll||!a.querySelector?!1:o.isObject(document)&&a===document?!0:typeof HTMLElement=="object"?a instanceof HTMLElement:a&&typeof a=="object"&&a!==null&&a.nodeType===1&&typeof a.nodeName=="string"},isEmpty:function(a){var c;if(!o.isDefined(a))return!0;if(o.isFunction(a))return!1;if(o.isString(a))return o.EMPTY_STRING_REGEXP.test(a);if(o.isArray(a))return a.length===0;if(o.isDate(a))return!1;if(o.isObject(a)){for(c in a)return!1;return!0}return!1},format:o.extend(function(a,c){return o.isString(a)?a.replace(o.format.FORMAT_REGEXP,function(l,d,h){return d==="%"?"%{"+h+"}":String(c[h])}):a},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(a){return o.isNumber(a)?a*100%1===0?""+a:parseFloat(Math.round(a*100)/100).toFixed(2):o.isArray(a)?a.map(function(c){return o.prettify(c)}).join(", "):o.isObject(a)?o.isDefined(a.toString)?a.toString():JSON.stringify(a):(a=""+a,a.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(c,l,d){return""+l+" "+d.toLowerCase()}).toLowerCase())},stringifyValue:function(a,c){var l=c&&c.prettify||o.prettify;return l(a)},isString:function(a){return typeof a=="string"},isArray:function(a){return{}.toString.call(a)==="[object Array]"},isHash:function(a){return o.isObject(a)&&!o.isArray(a)&&!o.isFunction(a)},contains:function(a,c){return o.isDefined(a)?o.isArray(a)?a.indexOf(c)!==-1:c in a:!1},unique:function(a){return o.isArray(a)?a.filter(function(c,l,d){return d.indexOf(c)==l}):a},forEachKeyInKeypath:function(a,c,l){if(o.isString(c)){var d="",h,u=!1;for(h=0;h<c.length;++h)switch(c[h]){case".":u?(u=!1,d+="."):(a=l(a,d,!1),d="");break;case"\\":u?(u=!1,d+="\\"):u=!0;break;default:u=!1,d+=c[h];break}return l(a,d,!0)}},getDeepObjectValue:function(a,c){if(o.isObject(a))return o.forEachKeyInKeypath(a,c,function(l,d){if(o.isObject(l))return l[d]})},collectFormValues:function(a,c){var l={},d,h,u,p,f,m;if(o.isJqueryElement(a)&&(a=a[0]),!a)return l;for(c=c||{},p=a.querySelectorAll("input[name], textarea[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){var g=u.name.replace(/\./g,"\\\\.");m=o.sanitizeFormValue(u.value,c),u.type==="number"?m=m?+m:null:u.type==="checkbox"?u.attributes.value?u.checked||(m=l[g]||null):m=u.checked:u.type==="radio"&&(u.checked||(m=l[g]||null)),l[g]=m}for(p=a.querySelectorAll("select[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){if(u.multiple){m=[];for(h in u.options)f=u.options[h],f&&f.selected&&m.push(o.sanitizeFormValue(f.value,c))}else{var v=typeof u.options[u.selectedIndex]<"u"?u.options[u.selectedIndex].value:"";m=o.sanitizeFormValue(v,c)}l[u.name]=m}return l},sanitizeFormValue:function(a,c){return c.trim&&o.isString(a)&&(a=a.trim()),c.nullify!==!1&&a===""?null:a},capitalize:function(a){return o.isString(a)?a[0].toUpperCase()+a.slice(1):a},pruneEmptyErrors:function(a){return a.filter(function(c){return!o.isEmpty(c.error)})},expandMultipleErrors:function(a){var c=[];return a.forEach(function(l){o.isArray(l.error)?l.error.forEach(function(d){c.push(o.extend({},l,{error:d}))}):c.push(l)}),c},convertErrorMessages:function(a,c){c=c||{};var l=[],d=c.prettify||o.prettify;return a.forEach(function(h){var u=o.result(h.error,h.value,h.attribute,h.options,h.attributes,h.globalOptions);if(!o.isString(u)){l.push(h);return}u[0]==="^"?u=u.slice(1):c.fullMessages!==!1&&(u=o.capitalize(d(h.attribute))+" "+u),u=u.replace(/\\\^/g,"^"),u=o.format(u,{value:o.stringifyValue(h.value,c)}),l.push(o.extend({},h,{error:u}))}),l},groupErrorsByAttribute:function(a){var c={};return a.forEach(function(l){var d=c[l.attribute];d?d.push(l):c[l.attribute]=[l]}),c},flattenErrorsToArray:function(a){return a.map(function(c){return c.error}).filter(function(c,l,d){return d.indexOf(c)===l})},cleanAttributes:function(a,c){function l(u,p,f){return o.isObject(u[p])?u[p]:u[p]=f?!0:{}}function d(u){var p={},f;for(f in u)u[f]&&o.forEachKeyInKeypath(p,f,l);return p}function h(u,p){if(!o.isObject(u))return u;var f=o.extend({},u),m,g;for(g in u)m=p[g],o.isObject(m)?f[g]=h(f[g],m):m||delete f[g];return f}return!o.isObject(c)||!o.isObject(a)?{}:(c=d(c),h(a,c))},exposeModule:function(a,c,l,d,h){l?(d&&d.exports&&(l=d.exports=a),l.validate=a):(c.validate=a,a.isFunction(h)&&h.amd&&h([],function(){return a}))},warn:function(a){typeof console<"u"&&console.warn&&console.warn("[validate.js] "+a)},error:function(a){typeof console<"u"&&console.error&&console.error("[validate.js] "+a)}}),s.validators={presence:function(a,c){if(c=o.extend({},this.options,c),c.allowEmpty!==!1?!o.isDefined(a):o.isEmpty(a))return c.message||this.message||"can't be blank"},length:function(a,c,l){if(o.isDefined(a)){c=o.extend({},this.options,c);var d=c.is,h=c.maximum,u=c.minimum,p=c.tokenizer||function(v){return v},f,m=[];a=p(a);var g=a.length;if(!o.isNumber(g))return c.message||this.notValid||"has an incorrect length";if(o.isNumber(d)&&g!==d&&(f=c.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",m.push(o.format(f,{count:d}))),o.isNumber(u)&&g<u&&(f=c.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",m.push(o.format(f,{count:u}))),o.isNumber(h)&&g>h&&(f=c.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",m.push(o.format(f,{count:h}))),m.length>0)return c.message||m}},numericality:function(a,c,l,d,h){if(o.isDefined(a)){c=o.extend({},this.options,c);var u=[],p,f,m={greaterThan:function(S,O){return S>O},greaterThanOrEqualTo:function(S,O){return S>=O},equalTo:function(S,O){return S===O},lessThan:function(S,O){return S<O},lessThanOrEqualTo:function(S,O){return S<=O},divisibleBy:function(S,O){return S%O===0}},g=c.prettify||h&&h.prettify||o.prettify;if(o.isString(a)&&c.strict){var v="^-?(0|[1-9]\\d*)";if(c.onlyInteger||(v+="(\\.\\d+)?"),v+="$",!new RegExp(v).test(a))return c.message||c.notValid||this.notValid||this.message||"must be a valid number"}if(c.noStrings!==!0&&o.isString(a)&&!o.isEmpty(a)&&(a=+a),!o.isNumber(a))return c.message||c.notValid||this.notValid||this.message||"is not a number";if(c.onlyInteger&&!o.isInteger(a))return c.message||c.notInteger||this.notInteger||this.message||"must be an integer";for(p in m)if(f=c[p],o.isNumber(f)&&!m[p](a,f)){var b="not"+o.capitalize(p),k=c[b]||this[b]||this.message||"must be %{type} %{count}";u.push(o.format(k,{count:f,type:g(p)}))}if(c.odd&&a%2!==1&&u.push(c.notOdd||this.notOdd||this.message||"must be odd"),c.even&&a%2!==0&&u.push(c.notEven||this.notEven||this.message||"must be even"),u.length)return c.message||u}},datetime:o.extend(function(a,c){if(!o.isFunction(this.parse)||!o.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(o.isDefined(a)){c=o.extend({},this.options,c);var l,d=[],h=c.earliest?this.parse(c.earliest,c):NaN,u=c.latest?this.parse(c.latest,c):NaN;if(a=this.parse(a,c),isNaN(a)||c.dateOnly&&a%864e5!==0)return l=c.notValid||c.message||this.notValid||"must be a valid date",o.format(l,{value:arguments[0]});if(!isNaN(h)&&a<h&&(l=c.tooEarly||c.message||this.tooEarly||"must be no earlier than %{date}",l=o.format(l,{value:this.format(a,c),date:this.format(h,c)}),d.push(l)),!isNaN(u)&&a>u&&(l=c.tooLate||c.message||this.tooLate||"must be no later than %{date}",l=o.format(l,{date:this.format(u,c),value:this.format(a,c)}),d.push(l)),d.length)return o.unique(d)}},{parse:null,format:null}),date:function(a,c){return c=o.extend({},c,{dateOnly:!0}),o.validators.datetime.call(o.validators.datetime,a,c)},format:function(a,c){(o.isString(c)||c instanceof RegExp)&&(c={pattern:c}),c=o.extend({},this.options,c);var l=c.message||this.message||"is invalid",d=c.pattern,h;if(o.isDefined(a)&&(!o.isString(a)||(o.isString(d)&&(d=new RegExp(c.pattern,c.flags)),h=d.exec(a),!h||h[0].length!=a.length)))return l},inclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is not included in the list";return o.format(l,{value:a})}},exclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is restricted";return o.isString(c.within[a])&&(a=c.within[a]),o.format(l,{value:a})}},email:o.extend(function(a,c){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid email";if(o.isDefined(a)&&(!o.isString(a)||!this.PATTERN.exec(a)))return l},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(a,c,l,d,h){if(o.isDefined(a)){o.isString(c)&&(c={attribute:c}),c=o.extend({},this.options,c);var u=c.message||this.message||"is not equal to %{attribute}";if(o.isEmpty(c.attribute)||!o.isString(c.attribute))throw new Error("The attribute must be a non empty string");var p=o.getDeepObjectValue(d,c.attribute),f=c.comparator||function(g,v){return g===v},m=c.prettify||h&&h.prettify||o.prettify;if(!f(a,p,c,l,d))return o.format(u,{attribute:m(c.attribute)})}},url:function(a,c){if(o.isDefined(a)){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid url",d=c.schemes||this.schemes||["http","https"],h=c.allowLocal||this.allowLocal||!1,u=c.allowDataUrl||this.allowDataUrl||!1;if(!o.isString(a))return l;var p="^(?:(?:"+d.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",f="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(h?f+="?":p+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",p+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+f+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",u){var m="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",g="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",v="data:(?:"+m+")?(?:;base64)?,"+g;p="(?:"+p+")|(?:^"+v+"$)"}var b=new RegExp(p,"i");if(!b.exec(a))return l}},type:o.extend(function(a,c,l,d,h){if(o.isString(c)&&(c={type:c}),!!o.isDefined(a)){var u=o.extend({},this.options,c),p=u.type;if(!o.isDefined(p))throw new Error("No type was specified");var f;if(o.isFunction(p)?f=p:f=this.types[p],!o.isFunction(f))throw new Error("validate.validators.type.types."+p+" must be a function.");if(!f(a,u,l,d,h)){var m=c.message||this.messages[p]||this.message||u.message||(o.isFunction(p)?"must be of the correct type":"must be of type %{type}");return o.isFunction(m)&&(m=m(a,c,l,d,h)),o.format(m,{attribute:o.prettify(l),type:p})}}},{types:{object:function(a){return o.isObject(a)&&!o.isArray(a)},array:o.isArray,integer:o.isInteger,number:o.isNumber,string:o.isString,date:o.isDate,boolean:o.isBoolean},messages:{}})},s.formatters={detailed:function(a){return a},flat:o.flattenErrorsToArray,grouped:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=o.flattenErrorsToArray(a[c]);return a},constraint:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=a[c].map(function(l){return l.validator}).sort();return a}},s.exposeModule(s,this,i,n,r)}).call(ul,e,t,null)}(Oi,Oi.exports)),Oi.exports}var fl=pl();const ml=dl(fl);function _r(t,e){return fetch(t,{body:JSON.stringify(e),cache:"no-cache",headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",mode:"cors"})}function gl(){return`
|
|
1383
|
+
*/var j4=Es.exports,Zu;function X4(){return Zu||(Zu=1,function(t,e){(function(i,s,o){var c=function(u,h,f){f=l.extend({},l.options,f);var _=l.runValidations(u,h,f);if(_.some(function(m){return l.isPromise(m.error)}))throw new Error("Use validate.async if you want support for promises");return c.processValidationResults(_,f)},l=c;l.extend=function(u){return[].slice.call(arguments,1).forEach(function(h){for(var f in h)u[f]=h[f]}),u},l.extend(c,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var u=l.format("%{major}.%{minor}.%{patch}",l.version);return l.isEmpty(l.version.metadata)||(u+="+"+l.version.metadata),u}},Promise:typeof Promise!="undefined"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(u,h,f){var _=[],m,b,E,A,k,F,M;(l.isDomElement(u)||l.isJqueryElement(u))&&(u=l.collectFormValues(u));for(m in h){E=l.getDeepObjectValue(u,m),A=l.result(h[m],E,u,m,f,h);for(b in A){if(k=l.validators[b],!k)throw M=l.format("Unknown validator %{name}",{name:b}),new Error(M);F=A[b],F=l.result(F,E,u,m,f,h),F&&_.push({attribute:m,value:E,validator:b,globalOptions:f,attributes:u,options:F,error:k.call(k,E,F,m,u,f)})}}return _},processValidationResults:function(u,h){u=l.pruneEmptyErrors(u,h),u=l.expandMultipleErrors(u,h),u=l.convertErrorMessages(u,h);var f=h.format||"grouped";if(typeof l.formatters[f]=="function")u=l.formatters[f](u);else throw new Error(l.format("Unknown format %{format}",h));return l.isEmpty(u)?void 0:u},async:function(u,h,f){f=l.extend({},l.async.options,f);var _=f.wrapErrors||function(b){return b};f.cleanAttributes!==!1&&(u=l.cleanAttributes(u,h));var m=l.runValidations(u,h,f);return new l.Promise(function(b,E){l.waitForResults(m).then(function(){var A=l.processValidationResults(m,f);A?E(new _(A,f,u,h)):b(u)},function(A){E(A)})})},single:function(u,h,f){return f=l.extend({},l.single.options,f,{format:"flat",fullMessages:!1}),l({single:u},{single:h},f)},waitForResults:function(u){return u.reduce(function(h,f){return l.isPromise(f.error)?h.then(function(){return f.error.then(function(_){f.error=_||null})}):h},new l.Promise(function(h){h()}))},result:function(u){var h=[].slice.call(arguments,1);return typeof u=="function"&&(u=u.apply(null,h)),u},isNumber:function(u){return typeof u=="number"&&!isNaN(u)},isFunction:function(u){return typeof u=="function"},isInteger:function(u){return l.isNumber(u)&&u%1===0},isBoolean:function(u){return typeof u=="boolean"},isObject:function(u){return u===Object(u)},isDate:function(u){return u instanceof Date},isDefined:function(u){return u!=null},isPromise:function(u){return!!u&&l.isFunction(u.then)},isJqueryElement:function(u){return u&&l.isString(u.jquery)},isDomElement:function(u){return!u||!u.querySelectorAll||!u.querySelector?!1:l.isObject(document)&&u===document?!0:typeof HTMLElement=="object"?u instanceof HTMLElement:u&&typeof u=="object"&&u!==null&&u.nodeType===1&&typeof u.nodeName=="string"},isEmpty:function(u){var h;if(!l.isDefined(u))return!0;if(l.isFunction(u))return!1;if(l.isString(u))return l.EMPTY_STRING_REGEXP.test(u);if(l.isArray(u))return u.length===0;if(l.isDate(u))return!1;if(l.isObject(u)){for(h in u)return!1;return!0}return!1},format:l.extend(function(u,h){return l.isString(u)?u.replace(l.format.FORMAT_REGEXP,function(f,_,m){return _==="%"?"%{"+m+"}":String(h[m])}):u},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(u){return l.isNumber(u)?u*100%1===0?""+u:parseFloat(Math.round(u*100)/100).toFixed(2):l.isArray(u)?u.map(function(h){return l.prettify(h)}).join(", "):l.isObject(u)?l.isDefined(u.toString)?u.toString():JSON.stringify(u):(u=""+u,u.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(h,f,_){return""+f+" "+_.toLowerCase()}).toLowerCase())},stringifyValue:function(u,h){var f=h&&h.prettify||l.prettify;return f(u)},isString:function(u){return typeof u=="string"},isArray:function(u){return{}.toString.call(u)==="[object Array]"},isHash:function(u){return l.isObject(u)&&!l.isArray(u)&&!l.isFunction(u)},contains:function(u,h){return l.isDefined(u)?l.isArray(u)?u.indexOf(h)!==-1:h in u:!1},unique:function(u){return l.isArray(u)?u.filter(function(h,f,_){return _.indexOf(h)==f}):u},forEachKeyInKeypath:function(u,h,f){if(l.isString(h)){var _="",m,b=!1;for(m=0;m<h.length;++m)switch(h[m]){case".":b?(b=!1,_+="."):(u=f(u,_,!1),_="");break;case"\\":b?(b=!1,_+="\\"):b=!0;break;default:b=!1,_+=h[m];break}return f(u,_,!0)}},getDeepObjectValue:function(u,h){if(l.isObject(u))return l.forEachKeyInKeypath(u,h,function(f,_){if(l.isObject(f))return f[_]})},collectFormValues:function(u,h){var f={},_,m,b,E,A,k;if(l.isJqueryElement(u)&&(u=u[0]),!u)return f;for(h=h||{},E=u.querySelectorAll("input[name], textarea[name]"),_=0;_<E.length;++_)if(b=E.item(_),!l.isDefined(b.getAttribute("data-ignored"))){var F=b.name.replace(/\./g,"\\\\.");k=l.sanitizeFormValue(b.value,h),b.type==="number"?k=k?+k:null:b.type==="checkbox"?b.attributes.value?b.checked||(k=f[F]||null):k=b.checked:b.type==="radio"&&(b.checked||(k=f[F]||null)),f[F]=k}for(E=u.querySelectorAll("select[name]"),_=0;_<E.length;++_)if(b=E.item(_),!l.isDefined(b.getAttribute("data-ignored"))){if(b.multiple){k=[];for(m in b.options)A=b.options[m],A&&A.selected&&k.push(l.sanitizeFormValue(A.value,h))}else{var M=typeof b.options[b.selectedIndex]!="undefined"?b.options[b.selectedIndex].value:"";k=l.sanitizeFormValue(M,h)}f[b.name]=k}return f},sanitizeFormValue:function(u,h){return h.trim&&l.isString(u)&&(u=u.trim()),h.nullify!==!1&&u===""?null:u},capitalize:function(u){return l.isString(u)?u[0].toUpperCase()+u.slice(1):u},pruneEmptyErrors:function(u){return u.filter(function(h){return!l.isEmpty(h.error)})},expandMultipleErrors:function(u){var h=[];return u.forEach(function(f){l.isArray(f.error)?f.error.forEach(function(_){h.push(l.extend({},f,{error:_}))}):h.push(f)}),h},convertErrorMessages:function(u,h){h=h||{};var f=[],_=h.prettify||l.prettify;return u.forEach(function(m){var b=l.result(m.error,m.value,m.attribute,m.options,m.attributes,m.globalOptions);if(!l.isString(b)){f.push(m);return}b[0]==="^"?b=b.slice(1):h.fullMessages!==!1&&(b=l.capitalize(_(m.attribute))+" "+b),b=b.replace(/\\\^/g,"^"),b=l.format(b,{value:l.stringifyValue(m.value,h)}),f.push(l.extend({},m,{error:b}))}),f},groupErrorsByAttribute:function(u){var h={};return u.forEach(function(f){var _=h[f.attribute];_?_.push(f):h[f.attribute]=[f]}),h},flattenErrorsToArray:function(u){return u.map(function(h){return h.error}).filter(function(h,f,_){return _.indexOf(h)===f})},cleanAttributes:function(u,h){function f(b,E,A){return l.isObject(b[E])?b[E]:b[E]=A?!0:{}}function _(b){var E={},A;for(A in b)b[A]&&l.forEachKeyInKeypath(E,A,f);return E}function m(b,E){if(!l.isObject(b))return b;var A=l.extend({},b),k,F;for(F in b)k=E[F],l.isObject(k)?A[F]=m(A[F],k):k||delete A[F];return A}return!l.isObject(h)||!l.isObject(u)?{}:(h=_(h),m(u,h))},exposeModule:function(u,h,f,_,m){f?(_&&_.exports&&(f=_.exports=u),f.validate=u):(h.validate=u,u.isFunction(m)&&m.amd&&m([],function(){return u}))},warn:function(u){typeof console!="undefined"&&console.warn&&console.warn("[validate.js] "+u)},error:function(u){typeof console!="undefined"&&console.error&&console.error("[validate.js] "+u)}}),c.validators={presence:function(u,h){if(h=l.extend({},this.options,h),h.allowEmpty!==!1?!l.isDefined(u):l.isEmpty(u))return h.message||this.message||"can't be blank"},length:function(u,h,f){if(l.isDefined(u)){h=l.extend({},this.options,h);var _=h.is,m=h.maximum,b=h.minimum,E=h.tokenizer||function(M){return M},A,k=[];u=E(u);var F=u.length;if(!l.isNumber(F))return h.message||this.notValid||"has an incorrect length";if(l.isNumber(_)&&F!==_&&(A=h.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",k.push(l.format(A,{count:_}))),l.isNumber(b)&&F<b&&(A=h.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",k.push(l.format(A,{count:b}))),l.isNumber(m)&&F>m&&(A=h.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",k.push(l.format(A,{count:m}))),k.length>0)return h.message||k}},numericality:function(u,h,f,_,m){if(l.isDefined(u)){h=l.extend({},this.options,h);var b=[],E,A,k={greaterThan:function($,X){return $>X},greaterThanOrEqualTo:function($,X){return $>=X},equalTo:function($,X){return $===X},lessThan:function($,X){return $<X},lessThanOrEqualTo:function($,X){return $<=X},divisibleBy:function($,X){return $%X===0}},F=h.prettify||m&&m.prettify||l.prettify;if(l.isString(u)&&h.strict){var M="^-?(0|[1-9]\\d*)";if(h.onlyInteger||(M+="(\\.\\d+)?"),M+="$",!new RegExp(M).test(u))return h.message||h.notValid||this.notValid||this.message||"must be a valid number"}if(h.noStrings!==!0&&l.isString(u)&&!l.isEmpty(u)&&(u=+u),!l.isNumber(u))return h.message||h.notValid||this.notValid||this.message||"is not a number";if(h.onlyInteger&&!l.isInteger(u))return h.message||h.notInteger||this.notInteger||this.message||"must be an integer";for(E in k)if(A=h[E],l.isNumber(A)&&!k[E](u,A)){var D="not"+l.capitalize(E),R=h[D]||this[D]||this.message||"must be %{type} %{count}";b.push(l.format(R,{count:A,type:F(E)}))}if(h.odd&&u%2!==1&&b.push(h.notOdd||this.notOdd||this.message||"must be odd"),h.even&&u%2!==0&&b.push(h.notEven||this.notEven||this.message||"must be even"),b.length)return h.message||b}},datetime:l.extend(function(u,h){if(!l.isFunction(this.parse)||!l.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(l.isDefined(u)){h=l.extend({},this.options,h);var f,_=[],m=h.earliest?this.parse(h.earliest,h):NaN,b=h.latest?this.parse(h.latest,h):NaN;if(u=this.parse(u,h),isNaN(u)||h.dateOnly&&u%864e5!==0)return f=h.notValid||h.message||this.notValid||"must be a valid date",l.format(f,{value:arguments[0]});if(!isNaN(m)&&u<m&&(f=h.tooEarly||h.message||this.tooEarly||"must be no earlier than %{date}",f=l.format(f,{value:this.format(u,h),date:this.format(m,h)}),_.push(f)),!isNaN(b)&&u>b&&(f=h.tooLate||h.message||this.tooLate||"must be no later than %{date}",f=l.format(f,{date:this.format(b,h),value:this.format(u,h)}),_.push(f)),_.length)return l.unique(_)}},{parse:null,format:null}),date:function(u,h){return h=l.extend({},h,{dateOnly:!0}),l.validators.datetime.call(l.validators.datetime,u,h)},format:function(u,h){(l.isString(h)||h instanceof RegExp)&&(h={pattern:h}),h=l.extend({},this.options,h);var f=h.message||this.message||"is invalid",_=h.pattern,m;if(l.isDefined(u)&&(!l.isString(u)||(l.isString(_)&&(_=new RegExp(h.pattern,h.flags)),m=_.exec(u),!m||m[0].length!=u.length)))return f},inclusion:function(u,h){if(l.isDefined(u)&&(l.isArray(h)&&(h={within:h}),h=l.extend({},this.options,h),!l.contains(h.within,u))){var f=h.message||this.message||"^%{value} is not included in the list";return l.format(f,{value:u})}},exclusion:function(u,h){if(l.isDefined(u)&&(l.isArray(h)&&(h={within:h}),h=l.extend({},this.options,h),!!l.contains(h.within,u))){var f=h.message||this.message||"^%{value} is restricted";return l.isString(h.within[u])&&(u=h.within[u]),l.format(f,{value:u})}},email:l.extend(function(u,h){h=l.extend({},this.options,h);var f=h.message||this.message||"is not a valid email";if(l.isDefined(u)&&(!l.isString(u)||!this.PATTERN.exec(u)))return f},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(u,h,f,_,m){if(l.isDefined(u)){l.isString(h)&&(h={attribute:h}),h=l.extend({},this.options,h);var b=h.message||this.message||"is not equal to %{attribute}";if(l.isEmpty(h.attribute)||!l.isString(h.attribute))throw new Error("The attribute must be a non empty string");var E=l.getDeepObjectValue(_,h.attribute),A=h.comparator||function(F,M){return F===M},k=h.prettify||m&&m.prettify||l.prettify;if(!A(u,E,h,f,_))return l.format(b,{attribute:k(h.attribute)})}},url:function(u,h){if(l.isDefined(u)){h=l.extend({},this.options,h);var f=h.message||this.message||"is not a valid url",_=h.schemes||this.schemes||["http","https"],m=h.allowLocal||this.allowLocal||!1,b=h.allowDataUrl||this.allowDataUrl||!1;if(!l.isString(u))return f;var E="^(?:(?:"+_.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",A="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(m?A+="?":E+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",E+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+A+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",b){var k="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",F="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",M="data:(?:"+k+")?(?:;base64)?,"+F;E="(?:"+E+")|(?:^"+M+"$)"}var D=new RegExp(E,"i");if(!D.exec(u))return f}},type:l.extend(function(u,h,f,_,m){if(l.isString(h)&&(h={type:h}),!!l.isDefined(u)){var b=l.extend({},this.options,h),E=b.type;if(!l.isDefined(E))throw new Error("No type was specified");var A;if(l.isFunction(E)?A=E:A=this.types[E],!l.isFunction(A))throw new Error("validate.validators.type.types."+E+" must be a function.");if(!A(u,b,f,_,m)){var k=h.message||this.messages[E]||this.message||b.message||(l.isFunction(E)?"must be of the correct type":"must be of type %{type}");return l.isFunction(k)&&(k=k(u,h,f,_,m)),l.format(k,{attribute:l.prettify(f),type:E})}}},{types:{object:function(u){return l.isObject(u)&&!l.isArray(u)},array:l.isArray,integer:l.isInteger,number:l.isNumber,string:l.isString,date:l.isDate,boolean:l.isBoolean},messages:{}})},c.formatters={detailed:function(u){return u},flat:l.flattenErrorsToArray,grouped:function(u){var h;u=l.groupErrorsByAttribute(u);for(h in u)u[h]=l.flattenErrorsToArray(u[h]);return u},constraint:function(u){var h;u=l.groupErrorsByAttribute(u);for(h in u)u[h]=u[h].map(function(f){return f.validator}).sort();return u}},c.exposeModule(c,this,i,s,o)}).call(j4,e,t,null)}(Es,Es.exports)),Es.exports}var K4=X4();const Y4=q4(K4);function bc(t,e){return fetch(t,{body:JSON.stringify(e),cache:"no-cache",headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",mode:"cors"})}function J4(){return`
|
|
1328
1384
|
<style>
|
|
1329
1385
|
*,
|
|
1330
1386
|
*::before,
|
|
@@ -1791,7 +1847,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
1791
1847
|
</form>
|
|
1792
1848
|
</div>
|
|
1793
1849
|
</div>
|
|
1794
|
-
`}class
|
|
1850
|
+
`}class qu extends HTMLElement{constructor(){super(),this.templateString=J4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.modes=[],this["otp-delivery-mode"]="",this.queryOtpModes=this.queryOtpModes.bind(this),this.selectOtpMode=this.selectOtpMode.bind(this),this.submitOtp=this.submitOtp.bind(this),this.switchContactMethod=this.switchContactMethod.bind(this),this.handleTotpConsentGrant=this.handleTotpConsentGrant.bind(this),this.handleTotpConsentContactMethodsOutdated=this.handleTotpConsentContactMethodsOutdated.bind(this),this.pages=[]}static get observedAttributes(){return["modes","otp-delivery-mode"]}attributeChangedCallback(e){switch(e){case"modes":case"otp-delivery-mode":{const i=document.createElement("template");i.innerHTML=this.render();const s=i.content.cloneNode(!0).querySelector(`#${this.activeScreen.id}`);s.hidden=!1,this.shadowRoot.replaceChild(s,this.activeScreen),this.setUpEventListeners(),this.setActiveScreen(s);break}}}setUpEventListeners(){this.idEntryScreen=this.shadowRoot.querySelector("#id-entry"),this.selectModeScreen=this.shadowRoot.querySelector("#select-mode"),this.otpVerificationScreen=this.shadowRoot.querySelector("#otp-verification"),this.activeScreen||(this.activeScreen=this.idEntryScreen),this.queryOtpModesButton=this.idEntryScreen.querySelector("#query-otp-modes"),this.backButton=this.idEntryScreen.querySelector("#back-button"),this.selectOtpModeButton=this.selectModeScreen.querySelector("#select-otp-mode"),this.entryBackbutton=this.selectModeScreen.querySelector("#back-to-entry-button"),this.contactMethodsOutdatedButton=this.selectModeScreen.querySelector("#contact-methods-outdated"),this.submitOtpButton=this.otpVerificationScreen.querySelector("#submit-otp"),this.switchContactMethodButton=this.otpVerificationScreen.querySelector(".try-another-method");const e=this.shadowRoot.querySelectorAll(".close-iframe");this.idNumberInput=this.idEntryScreen.querySelector("#id_number"),this.modeInputs=this.selectModeScreen.querySelectorAll('[name="mode"]'),this.otpInput=this.otpVerificationScreen.querySelector("#totp-token"),this.queryOtpModesButton.addEventListener("click",i=>this.queryOtpModes(i)),this.selectOtpModeButton.addEventListener("click",i=>this.selectOtpMode(i)),this.submitOtpButton.addEventListener("click",i=>this.submitOtp(i)),this.switchContactMethodButton.addEventListener("click",i=>this.switchContactMethod(i)),this.contactMethodsOutdatedButton.addEventListener("click",i=>this.handleTotpConsentContactMethodsOutdated(i)),this.entryBackbutton.addEventListener("click",()=>{this.handleBackClick()}),this.backButton.addEventListener("click",()=>{this.handleBackClick()}),e.forEach(i=>{i.addEventListener("click",()=>{this.closeWindow()},!1)})}closeWindow(){const e=window.parent;[e.parent,e].forEach(i=>{i.postMessage("SmileIdentity::Close","*")})}handleBackClick(){const e=this.pages.pop();e?this.setActiveScreen(e):this.dispatchEvent(new CustomEvent("end-user-consent.totp.cancelled",{}))}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}switchContactMethod(){this.queryOtpModes()}resetForm(){this.activeScreen.querySelectorAll("[aria-invalid]").forEach(s=>s.removeAttribute("aria-invalid")),this.activeScreen.querySelectorAll(".validation-message").forEach(s=>s.remove())}handleIdNumberValidationErrors(e){Object.keys(e).forEach(s=>{const o=this.activeScreen.querySelector(`#${s}`);o.setAttribute("aria-invalid","true"),o.setAttribute("aria-describedby",`${s}-hint`);const c=document.createElement("div");c.setAttribute("id",`${s}-hint`),c.setAttribute("class","validation-message"),c.textContent=e[s][0],o.insertAdjacentElement("afterend",c)})}handleActiveScreenErrors(e){const i=this.activeScreen.querySelector('[type="submit"]'),s=document.createElement("div");s.setAttribute("class","validation-message"),s.textContent=e,i.insertAdjacentElement("beforebegin",s)}validateIdNumber(e){const i={id_number:{format:new RegExp(this.idRegex),presence:{allowEmpty:!1,message:"is required"}}},s=Y4({id_number:e},i);return s&&this.handleIdNumberValidationErrors(s),s}queryOtpModes(e){return q(this,null,function*(){e&&(e.preventDefault(),this.resetForm());const i=this.validateIdNumber(this.idNumberInput.value);if(localStorage.setItem("idNumber",this.idNumberInput.value||this.idNumber),!i){const s={country:this.country,id_number:this.idNumber,id_type:this.idType,partner_id:this.partnerId,token:this.token},o=`${this.baseUrl}/totp_consent`;try{this.toggleLoading();const c=yield bc(o,s),l=yield c.json();this.toggleLoading(),c.ok?(this.sessionId=l.session_id,this.modes=l.modes,this.setActiveScreen(this.selectModeScreen),this.setAttribute("modes",l.modes)):this.handleActiveScreenErrors(l.error)}catch(c){this.toggleLoading(),this.handleActiveScreenErrors(c.message)}}})}selectOtpMode(e){return q(this,null,function*(){e.preventDefault(),this.resetForm(),this.mode=Array.prototype.find.call(this.modeInputs,o=>o.checked).value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,mode:this.mode,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},s=`${this.baseUrl}/totp_consent/mode`;try{this.toggleLoading();const o=yield bc(s,i),c=yield o.json();this.toggleLoading(),o.ok?(this.selectedOtpDeliveryMode=this.modes.filter(l=>l[this.mode])[0][this.mode],this.setActiveScreen(this.otpVerificationScreen),this.setAttribute("otp-delivery-mode",this.selectedOtpDeliveryMode)):this.handleActiveScreenErrors(c.error)}catch(o){this.toggleLoading(),this.handleActiveScreenErrors(o.message)}})}submitOtp(e){return q(this,null,function*(){e.preventDefault(),this.resetForm(),this.otp=this.otpInput.value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,otp:this.otp,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},s=`${this.baseUrl}/totp_consent/otp`;try{this.toggleLoading();const o=yield bc(s,i),c=yield o.json();this.toggleLoading(),o.ok?this.handleTotpConsentGrant(e):this.handleActiveScreenErrors(c.error)}catch(o){this.toggleLoading(),this.handleActiveScreenErrors(o.message)}})}toggleLoading(){const e=this.activeScreen.querySelector('button[type="submit"]'),i=e.querySelector(".text"),s=e.querySelector("svg"),o=e.querySelector(".spinner");e.toggleAttribute("disabled"),i.toggleAttribute("hidden"),s.toggleAttribute("hidden"),o.toggleAttribute("hidden")}setActiveScreen(e){this.activeScreen.hidden=!0,e.hidden=!1,this.activeScreen=e}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get idNumber(){return localStorage.getItem("idNumber")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get token(){return this.getAttribute("token")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}handleTotpConsentGrant(){const e=new CustomEvent("end-user-consent.totp.granted",{detail:{consented:{contact_information:!0,document_information:!0,personal_details:!0},id_number:this.idNumber,session_id:this.sessionId}});this.dispatchEvent(e)}handleTotpConsentContactMethodsOutdated(){const e="end-user-consent.totp.denied.contact-methods-outdated",i=new CustomEvent(e,{detail:{data:{id_number:this.idNumber,session_id:this.sessionId},message:e}});this.dispatchEvent(i)}}"customElements"in window&&!window.customElements.get("totp-consent")&&window.customElements.define("totp-consent",qu);class Q4 extends HTMLElement{constructor(){super();const e=document.createElement("template");e.innerHTML=`
|
|
1795
1851
|
<p style='margin-inline: auto; max-inline-size: 10rem'>
|
|
1796
1852
|
<svg viewBox="0 0 90 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1797
1853
|
<path d="M0.544 7V1.4H2.616C3.064 1.4 3.43467 1.47467 3.728 1.624C4.02133 1.77333 4.24 1.97867 4.384 2.24C4.528 2.50133 4.6 2.79467 4.6 3.12C4.6 3.42933 4.53067 3.71467 4.392 3.976C4.25333 4.232 4.03733 4.44 3.744 4.6C3.45067 4.75467 3.07467 4.832 2.616 4.832H1.568V7H0.544ZM1.568 4H2.552C2.90933 4 3.16533 3.92267 3.32 3.768C3.48 3.608 3.56 3.392 3.56 3.12C3.56 2.84267 3.48 2.62667 3.32 2.472C3.16533 2.312 2.90933 2.232 2.552 2.232H1.568V4ZM7.08025 7.096C6.69625 7.096 6.34958 7.008 6.04025 6.832C5.73625 6.656 5.49358 6.41333 5.31225 6.104C5.13625 5.78933 5.04825 5.42667 5.04825 5.016C5.04825 4.60533 5.13892 4.24533 5.32025 3.936C5.50158 3.62133 5.74425 3.376 6.04825 3.2C6.35758 3.024 6.70425 2.936 7.08825 2.936C7.46692 2.936 7.80825 3.024 8.11225 3.2C8.42158 3.376 8.66425 3.62133 8.84025 3.936C9.02158 4.24533 9.11225 4.60533 9.11225 5.016C9.11225 5.42667 9.02158 5.78933 8.84025 6.104C8.66425 6.41333 8.42158 6.656 8.11225 6.832C7.80292 7.008 7.45892 7.096 7.08025 7.096ZM7.08025 6.208C7.34692 6.208 7.57892 6.10933 7.77625 5.912C7.97358 5.70933 8.07225 5.41067 8.07225 5.016C8.07225 4.62133 7.97358 4.32533 7.77625 4.128C7.57892 3.92533 7.34958 3.824 7.08825 3.824C6.81625 3.824 6.58158 3.92533 6.38425 4.128C6.19225 4.32533 6.09625 4.62133 6.09625 5.016C6.09625 5.41067 6.19225 5.70933 6.38425 5.912C6.58158 6.10933 6.81358 6.208 7.08025 6.208ZM10.6632 7L9.50319 3.032H10.5192L11.2072 5.888L12.0072 3.032H13.1432L13.9432 5.888L14.6392 3.032H15.6552L14.4872 7H13.4232L12.5752 4.032L11.7272 7H10.6632ZM18.0886 7.096C17.6886 7.096 17.334 7.01067 17.0246 6.84C16.7153 6.66933 16.4726 6.42933 16.2966 6.12C16.1206 5.81067 16.0326 5.45333 16.0326 5.048C16.0326 4.63733 16.118 4.272 16.2886 3.952C16.4646 3.632 16.7046 3.384 17.0086 3.208C17.318 3.02667 17.6806 2.936 18.0966 2.936C18.486 2.936 18.83 3.02133 19.1286 3.192C19.4273 3.36267 19.6593 3.59733 19.8246 3.896C19.9953 4.18933 20.0806 4.51733 20.0806 4.88C20.0806 4.93867 20.078 5 20.0726 5.064C20.0726 5.128 20.07 5.19467 20.0646 5.264H17.0486C17.07 5.57333 17.1766 5.816 17.3686 5.992C17.566 6.168 17.8033 6.256 18.0806 6.256C18.2886 6.256 18.462 6.21067 18.6006 6.12C18.7446 6.024 18.8513 5.90133 18.9206 5.752H19.9606C19.886 6.00267 19.7606 6.232 19.5846 6.44C19.414 6.64267 19.2006 6.80267 18.9446 6.92C18.694 7.03733 18.4086 7.096 18.0886 7.096ZM18.0966 3.768C17.846 3.768 17.6246 3.84 17.4326 3.984C17.2406 4.12267 17.118 4.336 17.0646 4.624H19.0406C19.0246 4.36267 18.9286 4.15467 18.7526 4C18.5766 3.84533 18.358 3.768 18.0966 3.768ZM20.9419 7V3.032H21.8539L21.9499 3.776C22.0939 3.52 22.2885 3.31733 22.5339 3.168C22.7845 3.01333 23.0779 2.936 23.4139 2.936V4.016H23.1259C22.9019 4.016 22.7019 4.05067 22.5259 4.12C22.3499 4.18933 22.2112 4.30933 22.1099 4.48C22.0139 4.65067 21.9659 4.888 21.9659 5.192V7H20.9419ZM25.9714 7.096C25.5714 7.096 25.2168 7.01067 24.9074 6.84C24.5981 6.66933 24.3554 6.42933 24.1794 6.12C24.0034 5.81067 23.9154 5.45333 23.9154 5.048C23.9154 4.63733 24.0008 4.272 24.1714 3.952C24.3474 3.632 24.5874 3.384 24.8914 3.208C25.2008 3.02667 25.5634 2.936 25.9794 2.936C26.3688 2.936 26.7128 3.02133 27.0114 3.192C27.3101 3.36267 27.5421 3.59733 27.7074 3.896C27.8781 4.18933 27.9634 4.51733 27.9634 4.88C27.9634 4.93867 27.9608 5 27.9554 5.064C27.9554 5.128 27.9528 5.19467 27.9474 5.264H24.9314C24.9528 5.57333 25.0594 5.816 25.2514 5.992C25.4488 6.168 25.6861 6.256 25.9634 6.256C26.1714 6.256 26.3448 6.21067 26.4834 6.12C26.6274 6.024 26.7341 5.90133 26.8034 5.752H27.8434C27.7688 6.00267 27.6434 6.232 27.4674 6.44C27.2968 6.64267 27.0834 6.80267 26.8274 6.92C26.5768 7.03733 26.2914 7.096 25.9714 7.096ZM25.9794 3.768C25.7288 3.768 25.5074 3.84 25.3154 3.984C25.1234 4.12267 25.0008 4.336 24.9474 4.624H26.9234C26.9074 4.36267 26.8114 4.15467 26.6354 4C26.4594 3.84533 26.2408 3.768 25.9794 3.768ZM30.6487 7.096C30.2754 7.096 29.942 7.00533 29.6487 6.824C29.3554 6.64267 29.1234 6.39467 28.9527 6.08C28.782 5.76533 28.6967 5.408 28.6967 5.008C28.6967 4.608 28.782 4.25333 28.9527 3.944C29.1234 3.62933 29.3554 3.384 29.6487 3.208C29.942 3.02667 30.2754 2.936 30.6487 2.936C30.9474 2.936 31.2087 2.992 31.4327 3.104C31.6567 3.216 31.838 3.37333 31.9767 3.576V1.24H33.0007V7H32.0887L31.9767 6.432C31.8487 6.608 31.678 6.76267 31.4647 6.896C31.2567 7.02933 30.9847 7.096 30.6487 7.096ZM30.8647 6.2C31.1954 6.2 31.4647 6.09067 31.6727 5.872C31.886 5.648 31.9927 5.36267 31.9927 5.016C31.9927 4.66933 31.886 4.38667 31.6727 4.168C31.4647 3.944 31.1954 3.832 30.8647 3.832C30.5394 3.832 30.27 3.94133 30.0567 4.16C29.8434 4.37867 29.7367 4.66133 29.7367 5.008C29.7367 5.35467 29.8434 5.64 30.0567 5.864C30.27 6.088 30.5394 6.2 30.8647 6.2ZM38.3017 7.096C38.003 7.096 37.7417 7.04 37.5177 6.928C37.2937 6.816 37.1124 6.65867 36.9737 6.456L36.8617 7H35.9497V1.24H36.9737V3.6C37.1017 3.424 37.2697 3.26933 37.4777 3.136C37.691 3.00267 37.9657 2.936 38.3017 2.936C38.675 2.936 39.0084 3.02667 39.3017 3.208C39.595 3.38933 39.827 3.63733 39.9977 3.952C40.1684 4.26667 40.2537 4.624 40.2537 5.024C40.2537 5.424 40.1684 5.78133 39.9977 6.096C39.827 6.40533 39.595 6.65067 39.3017 6.832C39.0084 7.008 38.675 7.096 38.3017 7.096ZM38.0857 6.2C38.411 6.2 38.6804 6.09067 38.8937 5.872C39.107 5.65333 39.2137 5.37067 39.2137 5.024C39.2137 4.67733 39.107 4.392 38.8937 4.168C38.6804 3.944 38.411 3.832 38.0857 3.832C37.755 3.832 37.483 3.944 37.2697 4.168C37.0617 4.38667 36.9577 4.66933 36.9577 5.016C36.9577 5.36267 37.0617 5.648 37.2697 5.872C37.483 6.09067 37.755 6.2 38.0857 6.2ZM41.3051 8.76L42.2251 6.736H41.9851L40.4411 3.032H41.5531L42.6651 5.824L43.8251 3.032H44.9131L42.3931 8.76H41.3051Z" fill="#001096"/>
|
|
@@ -1813,7 +1869,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
1813
1869
|
</defs>
|
|
1814
1870
|
</svg>
|
|
1815
1871
|
</p>
|
|
1816
|
-
`,this.attachShadow({mode:"open"}).appendChild(e.content.cloneNode(!0))}}window.customElements&&!window.customElements.get("powered-by-smile-id")&&window.customElements.define("powered-by-smile-id",
|
|
1872
|
+
`,this.attachShadow({mode:"open"}).appendChild(e.content.cloneNode(!0))}}window.customElements&&!window.customElements.get("powered-by-smile-id")&&window.customElements.define("powered-by-smile-id",Q4);function t5(){return`
|
|
1817
1873
|
<style>
|
|
1818
1874
|
*,
|
|
1819
1875
|
*::before,
|
|
@@ -2125,7 +2181,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2125
2181
|
color: var(--color-danger);
|
|
2126
2182
|
}
|
|
2127
2183
|
</style>
|
|
2128
|
-
${
|
|
2184
|
+
${Ai(this.themeColor)}
|
|
2129
2185
|
<div id='consent-screen'>
|
|
2130
2186
|
<section class='flow center'>
|
|
2131
2187
|
<div class="nav ${this.hideBack?"justify-right":""}">
|
|
@@ -2390,7 +2446,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2390
2446
|
|
|
2391
2447
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
2392
2448
|
</div>
|
|
2393
|
-
`}class
|
|
2449
|
+
`}class ju extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=t5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.consentScreen=this.shadowRoot.querySelector("#consent-screen"),this.totpConsentApp=this.shadowRoot.querySelector("totp-consent"),this.consentRejectedScreen=this.shadowRoot.querySelector("#consent-rejected-screen"),this.allowButton=this.shadowRoot.querySelector("#allow"),this.rejectButton=this.shadowRoot.querySelector("#cancel"),this.backToConsentButton=this.shadowRoot.querySelector("#back-to-consent"),this.confirmConsentRejectionButton=this.shadowRoot.querySelector("#confirm-consent-rejection"),this.backButton=this.shadowRoot.querySelector("#back-button");const i=this.shadowRoot.querySelectorAll(".close-iframe");this.allowButton.addEventListener("click",s=>this.handleConsentGrant(s)),this.rejectButton.addEventListener("click",s=>this.handleConsentGrant(s)),this.backToConsentButton.addEventListener("click",()=>this.setActiveScreen(this.consentScreen)),this.confirmConsentRejectionButton.addEventListener("click",s=>this.handleConsentRejection(s)),this.totpConsentApp.addEventListener("end-user-consent.totp.denied.contact-methods-outdated",s=>this.handleTotpConsentEvents(s)),this.totpConsentApp.addEventListener("end-user-consent.totp.granted",s=>this.handleTotpConsentEvents(s)),this.totpConsentApp.addEventListener("end-user-consent.totp.cancelled",s=>this.handleBackEvents(s)),this.backButton.addEventListener("click",s=>{this.handleBackEvents(s)}),i.forEach(s=>{s.addEventListener("click",()=>{this.closeWindow()},!1)}),this.activeScreen=this.consentScreen}setActiveScreen(e){this.activeScreen.hidden=!0,e.hidden=!1,this.activeScreen=e}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get demoMode(){return!!this.hasAttribute("demo-mode")}get hideBack(){return this.hasAttribute("hide-back-to-host")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get partnerLogoURL(){return this.getAttribute("partner-logo")}get partnerPolicyURL(){return this.getAttribute("policy-url")}get themeColor(){return this.getAttribute("theme-color")||"#151F72"}get token(){return this.getAttribute("token")}handleConsentGrant(e){const i=e.target===this.allowButton;i?this.idRequiresTotpConsent.includes(this.idType)?(this.setActiveScreen(this.totpConsentApp),this.pages.push(this.consentScreen)):this.dispatchEvent(new CustomEvent("end-user-consent.granted",{detail:{consented:{contact_information:i,document_information:i,personal_details:i}}})):this.setActiveScreen(this.consentRejectedScreen)}handleConsentRejection(){this.dispatchEvent(new CustomEvent("end-user-consent.denied"))}handleTotpConsentEvents(e){const i=new CustomEvent(e.type,{detail:Fe({},e.detail)});this.dispatchEvent(i)}handleBackEvents(){const e=this.pages.pop();e?this.setActiveScreen(e):this.dispatchEvent(new CustomEvent("end-user-consent.cancelled"))}closeWindow(){window.parent.postMessage("SmileIdentity::Close","*")}}"customElements"in window&&!window.customElements.get("end-user-consent")&&window.customElements.define("end-user-consent",ju);function e5(){return`
|
|
2394
2450
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
2395
2451
|
<link
|
|
2396
2452
|
href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap"
|
|
@@ -2648,6 +2704,9 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2648
2704
|
}
|
|
2649
2705
|
|
|
2650
2706
|
#selfie-capture-instruction-screen {
|
|
2707
|
+
box-sizing: border-box;
|
|
2708
|
+
height: 100%;
|
|
2709
|
+
padding: 1rem;
|
|
2651
2710
|
display: flex;
|
|
2652
2711
|
flex-direction: column;
|
|
2653
2712
|
max-block-size: 100%;
|
|
@@ -2658,17 +2717,20 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2658
2717
|
margin-block: 0 !important;
|
|
2659
2718
|
}
|
|
2660
2719
|
|
|
2720
|
+
header h1 {
|
|
2721
|
+
font-size: 1.25rem;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2661
2724
|
.instructions {
|
|
2662
|
-
margin-block-start: 1.5rem;
|
|
2663
2725
|
display: flex;
|
|
2664
2726
|
align-items: center;
|
|
2665
2727
|
text-align: initial;
|
|
2666
|
-
gap:
|
|
2728
|
+
gap: 0.5rem;
|
|
2667
2729
|
}
|
|
2668
2730
|
|
|
2669
2731
|
.instructions svg {
|
|
2670
2732
|
flex-shrink: 0;
|
|
2671
|
-
margin-inline-end:
|
|
2733
|
+
margin-inline-end: 0.25rem;
|
|
2672
2734
|
}
|
|
2673
2735
|
|
|
2674
2736
|
.instructions p {
|
|
@@ -2678,6 +2740,8 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2678
2740
|
h1 {
|
|
2679
2741
|
color: ${this.themeColor};
|
|
2680
2742
|
text-align: center;
|
|
2743
|
+
margin-top: 0;
|
|
2744
|
+
margin-bottom: 1rem;
|
|
2681
2745
|
|
|
2682
2746
|
/* h1 */
|
|
2683
2747
|
font-size: 1.5rem;
|
|
@@ -2686,41 +2750,73 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2686
2750
|
line-height: 36px; /* 150% */
|
|
2687
2751
|
}
|
|
2688
2752
|
|
|
2753
|
+
.controls {
|
|
2754
|
+
width: 100%;
|
|
2755
|
+
margin-top: 1rem;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
.content-root {
|
|
2759
|
+
height: 100%;
|
|
2760
|
+
display: flex;
|
|
2761
|
+
align-items: center;
|
|
2762
|
+
flex-direction: column;
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
.content-header, .content-body, .content-footer {
|
|
2766
|
+
width: 100%;
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
.content-body {
|
|
2770
|
+
height: 100%;
|
|
2771
|
+
display: flex;
|
|
2772
|
+
flex-direction: column;
|
|
2773
|
+
align-items: center;
|
|
2774
|
+
justify-content: space-between;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2689
2777
|
.tip-header {
|
|
2690
2778
|
color: ${this.themeColor};
|
|
2691
2779
|
}
|
|
2780
|
+
|
|
2781
|
+
.tip-body {
|
|
2782
|
+
text-align: justify;
|
|
2783
|
+
}
|
|
2692
2784
|
</style>
|
|
2693
|
-
${
|
|
2694
|
-
<div id="selfie-capture-instruction-screen" class="
|
|
2695
|
-
<
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
<
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2785
|
+
${Ai(this.themeColor)}
|
|
2786
|
+
<div id="selfie-capture-instruction-screen" class="center">
|
|
2787
|
+
<div class="content-root">
|
|
2788
|
+
<div class="content-header">
|
|
2789
|
+
<smileid-navigation theme-color=${this.themeColor} ${this.hideBack?"hide-back":""} ${this.showNavigation?"":"hidden"}></smileid-navigation>
|
|
2790
|
+
</div>
|
|
2791
|
+
<div class="content-body">
|
|
2792
|
+
<header>
|
|
2793
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="65" height="91" viewBox="0 0 65 91" fill="none">
|
|
2794
|
+
<g clip-path="url(#clip0_604_692)">
|
|
2795
|
+
<path d="M36.6833 60.4888C26.9272 54.8682 13.1977 54.3026 5.53473 59.2162C-2.12824 64.1298 -0.851078 72.9318 8.05358 78.9413L17.8806 85.1274L51.5126 69.6797L36.7188 60.4534H36.6478L36.6833 60.4888Z" fill="#3B3837"/>
|
|
2796
|
+
<path d="M27.5624 90.5007L17.9127 85.0923C17.9127 85.0923 17.9127 74.6288 18.1256 70.4929C18.232 68.2305 23.2342 37.441 44.1655 34.6484C48.1389 34.1182 56.8662 40.5871 56.8662 40.5871" fill="#91190F"/>
|
|
2797
|
+
<path d="M27.5624 90.5007L17.9127 85.0923C17.9127 85.0923 17.9127 74.6288 18.1256 70.4929C18.232 68.2305 23.2342 37.441 44.1655 34.6484C48.1389 34.1182 56.8662 40.5871 56.8662 40.5871" fill="#3B3837"/>
|
|
2798
|
+
<path d="M64.0705 51.9698C63.8931 41.0114 56.2301 36.5927 46.7224 42.0366C37.0727 47.5511 29.055 60.9486 28.3454 72.2958L27.5649 90.4655L63.7512 69.5739L64.1769 51.8991H64.106L64.0705 51.9698Z" fill="#7ECAF0"/>
|
|
2799
|
+
<path d="M44.2729 28.3906L30.0112 36.521L30.4015 19.73L44.6631 11.5643L44.2729 28.3906Z" fill="#F8CEEB"/>
|
|
2800
|
+
<path d="M53.959 33.8711L39.6974 42.0368L40.0876 25.2104L54.3493 17.0447L53.959 33.8711Z" fill="#7ECAF0"/>
|
|
2801
|
+
<path d="M44.6631 11.5643L54.3483 17.0434L40.0866 25.2092L39.6964 42.0356L30.0112 36.521L30.4015 19.73L44.6631 11.5643Z" fill="#3B3837"/>
|
|
2802
|
+
<path d="M53.0767 51.0497L59.9591 46.8785L59.9237 36.9099L64.4647 34.3294L64.5002 49.4236L53.0767 56.2461V51.0497Z" fill="#FF5805"/>
|
|
2803
|
+
<path d="M54.0676 54.5139L63.5044 48.8933L63.469 36.026L60.9146 37.4754V47.4439L54.0676 51.5798V54.5139Z" fill="#FF5805"/>
|
|
2804
|
+
<path d="M30.4053 52.2515L34.9463 49.6356V60.8414L44.0638 55.1855V60.4172L30.4407 68.7244L30.4053 52.2515Z" fill="#FF5805"/>
|
|
2805
|
+
<path d="M31.4317 66.9921L43.0681 59.8869V56.9529L33.9506 62.6088V51.3323L31.3962 52.817L31.4317 66.9921Z" fill="#FF5805"/>
|
|
2806
|
+
<path d="M30.4053 19.7312L42.5383 13.0148V18.1759L34.9463 22.3471V32.4924L30.4407 35.073L30.4053 19.7312Z" fill="#FF5805"/>
|
|
2807
|
+
<path d="M31.3962 33.377L33.9506 31.9276V21.7823L41.5426 17.6111V14.6771L31.3962 20.2976V28.7815V33.377Z" fill="#FF5805"/>
|
|
2808
|
+
<path d="M59.9223 8.27746L53.5365 11.9538V6.79277L64.4279 0.500549L64.4633 16.5846L59.9578 19.1651L59.9223 8.27746Z" fill="#FF5805"/>
|
|
2809
|
+
<path d="M60.9142 17.4682L63.504 16.0189L63.4685 2.19722L54.4929 7.35826L54.5284 10.2569L60.9142 6.58057V17.4682Z" fill="#FF5805"/>
|
|
2810
|
+
</g>
|
|
2811
|
+
<defs>
|
|
2812
|
+
<clipPath id="clip0_604_692">
|
|
2813
|
+
<rect width="64" height="90" fill="white" transform="translate(0.5 0.5)"/>
|
|
2814
|
+
</clipPath>
|
|
2815
|
+
</defs>
|
|
2816
|
+
</svg>
|
|
2817
|
+
<h1 class='title-color font-bold'>Next, we'll take a quick selfie</h1>
|
|
2818
|
+
</header>
|
|
2819
|
+
<div class="instructions-wrapper">
|
|
2724
2820
|
<div class="instructions">
|
|
2725
2821
|
<svg
|
|
2726
2822
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -2799,8 +2895,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2799
2895
|
<div class="instruction">
|
|
2800
2896
|
<p class="text-base title-color font-bold tip-header">Good Light</p>
|
|
2801
2897
|
<p class="tip-body">
|
|
2802
|
-
Make sure you are in a well-lit environment
|
|
2803
|
-
clear and visible.
|
|
2898
|
+
Make sure you are in a well-lit environment.
|
|
2804
2899
|
</p>
|
|
2805
2900
|
</div>
|
|
2806
2901
|
</div>
|
|
@@ -2887,9 +2982,8 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2887
2982
|
</svg>
|
|
2888
2983
|
<div class="instruction">
|
|
2889
2984
|
<p class="text-base title-color font-bold tip-header">Clear Image</p>
|
|
2890
|
-
<p>
|
|
2891
|
-
Hold your phone steady so the selfie is clear and sharp.
|
|
2892
|
-
take blurry images.
|
|
2985
|
+
<p class="tip-body">
|
|
2986
|
+
Hold your phone steady so the selfie is clear and sharp.
|
|
2893
2987
|
</p>
|
|
2894
2988
|
</div>
|
|
2895
2989
|
</div>
|
|
@@ -2920,143 +3014,60 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
2920
3014
|
</svg>
|
|
2921
3015
|
<div class="instruction">
|
|
2922
3016
|
<p class="text-base title-color font-bold tip-header">Remove Obstructions</p>
|
|
2923
|
-
<p>
|
|
2924
|
-
Remove anything that covers your face, such glasses, masks, hats
|
|
2925
|
-
and scarves.
|
|
3017
|
+
<p class="tip-body">
|
|
3018
|
+
Remove anything that covers your face, such as glasses, masks, and hats.
|
|
2926
3019
|
</p>
|
|
2927
3020
|
</div>
|
|
2928
3021
|
</div>
|
|
2929
3022
|
<div class="instructions">
|
|
2930
3023
|
<svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 24 24" fill="none" stroke="${this.themeColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-mood-happy"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M9 9l.01 0" /><path d="M15 9l.01 0" /><path d="M8 13a4 4 0 1 0 8 0h-8" /></svg>
|
|
2931
3024
|
<div class="instruction">
|
|
2932
|
-
<p class="text-base title-color font-bold tip-header">
|
|
2933
|
-
<p>
|
|
2934
|
-
When asked to smile, give a
|
|
3025
|
+
<p class="text-base title-color font-bold tip-header">Wide Smile</p>
|
|
3026
|
+
<p class="tip-body">
|
|
3027
|
+
When asked to smile, give a wide smile, showing your teeth.
|
|
2935
3028
|
</p>
|
|
2936
3029
|
</div>
|
|
2937
3030
|
</div>
|
|
2938
|
-
<section class='flow' style='--flow-space: 2.5rem'>
|
|
2939
|
-
<button id='allow' data-variant='solid full-width' class='button theme-background'>
|
|
2940
|
-
Allow
|
|
2941
|
-
</button>
|
|
2942
|
-
<button id='cancel' data-variant='outline full-width' class="button" style='--flow-space: 1.5rem' ${this.hideBack||!this.showNavigation?"hidden":""}>
|
|
2943
|
-
Cancel
|
|
2944
|
-
</button>
|
|
2945
|
-
</section>
|
|
2946
3031
|
</div>
|
|
3032
|
+
<section class="controls">
|
|
3033
|
+
<button id='allow' data-variant='solid full-width' class='button theme-background'>
|
|
3034
|
+
Allow
|
|
3035
|
+
</button>
|
|
3036
|
+
</section>
|
|
2947
3037
|
${this.hideAttribution?"":`
|
|
2948
|
-
|
|
3038
|
+
<div class="content-footer">
|
|
3039
|
+
<powered-by-smile-id></powered-by-smile-id>
|
|
3040
|
+
</div>
|
|
2949
3041
|
`}
|
|
2950
3042
|
</div>
|
|
2951
|
-
|
|
3043
|
+
</div>
|
|
3044
|
+
</div>
|
|
3045
|
+
`}class i5 extends HTMLElement{constructor(){super(),this.templateString=e5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.allowButton=this.shadowRoot.querySelector("#allow"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.allowButton&&this.allowButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-instructions.capture"))}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()},!1)}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.cancelled"))}get showNavigation(){return this.hasAttribute("show-navigation")}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.close"))}static get observedAttributes(){return["show-navigation"]}}"customElements"in window&&!window.customElements.get("selfie-capture-instructions")&&window.customElements.define("selfie-capture-instructions",i5);function n5(){return`
|
|
2952
3046
|
<style>
|
|
2953
3047
|
.retake-photo.button[data-variant~="ghost"] {
|
|
2954
3048
|
color: #FF5805;
|
|
2955
3049
|
}
|
|
2956
|
-
|
|
2957
|
-
appearance: none;
|
|
2958
|
-
background: none;
|
|
2959
|
-
border: none;
|
|
2960
|
-
color: hsl(0deg 0% 94%);
|
|
2961
|
-
cursor: pointer;
|
|
2962
|
-
display: flex;
|
|
2963
|
-
align-items: center;
|
|
2964
|
-
justify-content: center;
|
|
2965
|
-
padding: 4px 8px;
|
|
2966
|
-
}
|
|
2967
|
-
.justify-right {
|
|
2968
|
-
justify-content: end !important;
|
|
2969
|
-
}
|
|
2970
|
-
.nav {
|
|
2971
|
-
display: flex;
|
|
2972
|
-
justify-content: space-between;
|
|
2973
|
-
}
|
|
2974
|
-
.back-wrapper {
|
|
2975
|
-
display: flex;
|
|
2976
|
-
align-items: center;
|
|
2977
|
-
}
|
|
2978
|
-
.back-button-text {
|
|
2979
|
-
font-size: 11px;
|
|
2980
|
-
line-height: 11px;
|
|
2981
|
-
color: rgb(21, 31, 114);
|
|
2982
|
-
}
|
|
2983
|
-
.section {
|
|
2984
|
-
border-radius: .5rem;
|
|
2985
|
-
margin-left: auto;
|
|
2986
|
-
margin-right: auto;
|
|
2987
|
-
max-width: 35ch;
|
|
2988
|
-
padding: 1rem;
|
|
2989
|
-
}
|
|
2990
|
-
.selfie-capture-review-image {
|
|
2991
|
-
overflow: hidden;
|
|
2992
|
-
aspect-ratio: 1/1;
|
|
2993
|
-
}
|
|
2994
|
-
#review-image {
|
|
2995
|
-
scale: 1.75;
|
|
2996
|
-
}
|
|
2997
|
-
@media (max-aspect-ratio: 1/1) {
|
|
2998
|
-
#review-image {
|
|
2999
|
-
transform: scaleX(-1) translateY(-10%);
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
.tips,
|
|
3003
|
-
.powered-by {
|
|
3004
|
-
align-items: center;
|
|
3005
|
-
border-radius: 0.25rem;
|
|
3006
|
-
color: #4e6577;
|
|
3007
|
-
display: flex;
|
|
3008
|
-
justify-content: center;
|
|
3009
|
-
letter-spacing: 0.075em;
|
|
3010
|
-
}
|
|
3011
|
-
.powered-by {
|
|
3012
|
-
box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
|
|
3013
|
-
display: inline-flex;
|
|
3014
|
-
font-size: 0.5rem;
|
|
3015
|
-
}
|
|
3016
|
-
.tips {
|
|
3017
|
-
margin-left: auto;
|
|
3018
|
-
margin-right: auto;
|
|
3019
|
-
max-width: 17rem;
|
|
3020
|
-
}
|
|
3021
|
-
.tips > * + *,
|
|
3022
|
-
.powered-by > * + * {
|
|
3023
|
-
display: inline-block;
|
|
3024
|
-
margin-left: 0.5em;
|
|
3025
|
-
}
|
|
3026
|
-
.powered-by .company {
|
|
3027
|
-
color: #18406d;
|
|
3028
|
-
font-weight: 700;
|
|
3029
|
-
letter-spacing: 0.15rem;
|
|
3030
|
-
}
|
|
3031
|
-
.logo-mark {
|
|
3032
|
-
background-color: #004071;
|
|
3033
|
-
display: inline-block;
|
|
3034
|
-
padding: 0.25em 0.5em;
|
|
3035
|
-
}
|
|
3036
|
-
.logo-mark svg {
|
|
3037
|
-
height: auto;
|
|
3038
|
-
justify-self: center;
|
|
3039
|
-
width: 0.75em;
|
|
3040
|
-
}
|
|
3050
|
+
|
|
3041
3051
|
#selfie-capture-review-screen {
|
|
3042
|
-
block-size: 45rem;
|
|
3043
3052
|
display: flex;
|
|
3044
3053
|
flex-direction: column;
|
|
3045
|
-
|
|
3046
|
-
max-inline-size: 40ch;
|
|
3054
|
+
padding: 1rem;
|
|
3047
3055
|
}
|
|
3056
|
+
|
|
3048
3057
|
#selfie-capture-review-screen .selfie-review-container.landscape {
|
|
3049
3058
|
height: auto;
|
|
3050
3059
|
}
|
|
3060
|
+
|
|
3051
3061
|
#selfie-capture-review-screen header p {
|
|
3052
3062
|
margin-block: 0 !important;
|
|
3053
3063
|
}
|
|
3064
|
+
|
|
3054
3065
|
.selfie-review-container.portrait {
|
|
3055
3066
|
width: 100%;
|
|
3056
3067
|
position: relative;
|
|
3057
3068
|
height: calc(200px * 1.4);
|
|
3058
3069
|
}
|
|
3059
|
-
|
|
3070
|
+
|
|
3060
3071
|
.selfie-review-container.portrait img {
|
|
3061
3072
|
width: calc(213px + 0.9rem);
|
|
3062
3073
|
height: 100%;
|
|
@@ -3072,80 +3083,22 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3072
3083
|
block-size: 100%;
|
|
3073
3084
|
}
|
|
3074
3085
|
|
|
3075
|
-
.selfie-container img {
|
|
3076
|
-
background-color: black;
|
|
3077
|
-
position: absolute;
|
|
3078
|
-
left: 50%;
|
|
3079
|
-
height: calc(100% - 6px);
|
|
3080
|
-
clip-path: ellipse(101px 118px);
|
|
3081
|
-
}
|
|
3082
|
-
|
|
3083
|
-
.description {
|
|
3084
|
-
color: var(--neutral-off-black, #2D2B2A);
|
|
3085
|
-
text-align: center;
|
|
3086
|
-
/* p */
|
|
3087
|
-
font-family: DM Sans;
|
|
3088
|
-
font-size: 0.875rem;
|
|
3089
|
-
font-style: normal;
|
|
3090
|
-
font-weight: 400;
|
|
3091
|
-
line-height: 18px;
|
|
3092
|
-
}
|
|
3093
|
-
.padding-bottom-2 {
|
|
3094
|
-
padding-bottom: 2rem;
|
|
3095
|
-
}
|
|
3096
|
-
.instructions-wrapper {
|
|
3097
|
-
display: inline-flex;
|
|
3098
|
-
flex-direction: column;
|
|
3099
|
-
align-items: flex-start;
|
|
3100
|
-
gap: 2rem;
|
|
3101
|
-
margin-block-start: 2rem;
|
|
3102
|
-
margin-block-end: 4rem;
|
|
3103
|
-
}
|
|
3104
|
-
.instructions {
|
|
3105
|
-
display: flex;
|
|
3106
|
-
align-items: center;
|
|
3107
|
-
text-align: initial;
|
|
3108
|
-
}
|
|
3109
|
-
.instructions svg {
|
|
3110
|
-
flex-shrink: 0;
|
|
3111
|
-
margin-inline-end: 2rem;
|
|
3112
|
-
}
|
|
3113
|
-
.instructions p {
|
|
3114
|
-
margin-block: 0;
|
|
3115
|
-
}
|
|
3116
|
-
.instruction-body {
|
|
3117
|
-
font-size: 0.75rem;
|
|
3118
|
-
}
|
|
3119
3086
|
h1 {
|
|
3120
3087
|
color: var(--web-digital-blue, #001096);
|
|
3121
3088
|
text-align: center;
|
|
3122
3089
|
/* h1 */
|
|
3123
|
-
font-size: 1.
|
|
3090
|
+
font-size: 1.25rem;
|
|
3124
3091
|
font-style: normal;
|
|
3125
3092
|
font-weight: 700;
|
|
3126
3093
|
line-height: 36px; /* 150% */
|
|
3127
|
-
|
|
3128
|
-
.p2 {
|
|
3129
|
-
font-size: 1rem;
|
|
3130
|
-
font-style: normal;
|
|
3131
|
-
font-weight: 500;
|
|
3132
|
-
line-height: 1rem;
|
|
3133
|
-
}
|
|
3134
|
-
.instruction-header {
|
|
3135
|
-
color: var(--web-digital-blue, #001096);
|
|
3136
|
-
}
|
|
3137
|
-
.h2 {
|
|
3138
|
-
font-size: 1rem;
|
|
3139
|
-
font-style: normal;
|
|
3140
|
-
font-weight: 700;
|
|
3141
|
-
line-height: 1.5rem;
|
|
3094
|
+
margin-top: 0;
|
|
3142
3095
|
}
|
|
3143
3096
|
</style>
|
|
3144
|
-
${
|
|
3145
|
-
<div id='selfie-capture-review-screen' class='
|
|
3097
|
+
${Ai(this.themeColor)}
|
|
3098
|
+
<div id='selfie-capture-review-screen' class='center'>
|
|
3146
3099
|
<smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
|
|
3147
|
-
<h1 class="header-title
|
|
3148
|
-
Is your whole face
|
|
3100
|
+
<h1 class="header-title title-color font-bold">
|
|
3101
|
+
Is your whole face clear?
|
|
3149
3102
|
</h1>
|
|
3150
3103
|
<div class='section | flow'>
|
|
3151
3104
|
<div class='selfie-review-container ${this.isPortraitCaptureView?"portrait":"landscape"}'>
|
|
@@ -3154,7 +3107,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3154
3107
|
id='document-capture-review-image'
|
|
3155
3108
|
src='${this.imageSrc}'
|
|
3156
3109
|
width='396'
|
|
3157
|
-
style='transform: scaleX(-1);'
|
|
3110
|
+
style='max-width: 90%;${this.shouldMirror?" transform: scaleX(-1);":""}'
|
|
3158
3111
|
/>`:""}
|
|
3159
3112
|
</div>
|
|
3160
3113
|
<div class='flow action-buttons'>
|
|
@@ -3170,36 +3123,62 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3170
3123
|
`}
|
|
3171
3124
|
</div>
|
|
3172
3125
|
</div>
|
|
3173
|
-
`}class Cl extends HTMLElement{constructor(){super(),this.templateString=_l.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image"]}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 imageSrc(){return this.getAttribute("data-image")}get title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.close"))}attributeChangedCallback(e){switch(e){case"data-image":case"hide-back-to-host":case"show-navigation":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",Cl);var Pi,F,$o,Oo,Oe,Po,No,Ho,Uo,Cr,xr,Er,Ni={},Vo=[],xl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Hi=Array.isArray;function te(t,e){for(var i in e)t[i]=e[i];return t}function kr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ce(t,e,i){var n,r,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Pi.call(arguments,2):i),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return Ui(t,o,n,r,null)}function Ui(t,e,i,n,r){var s={type:t,props:e,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++$o,__i:-1,__u:0};return r==null&&F.vnode!=null&&F.vnode(s),s}function ye(t){return t.children}function Vi(t,e){this.props=t,this.context=e}function ti(t,e){if(e==null)return t.__?ti(t.__,t.__i+1):null;for(var i;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null)return i.__e;return typeof t.type=="function"?ti(t):null}function jo(t){var e,i;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null){t.__e=t.__c.base=i.__e;break}return jo(t)}}function Go(t){(!t.__d&&(t.__d=!0)&&Oe.push(t)&&!mn.__r++||Po!=F.debounceRendering)&&((Po=F.debounceRendering)||No)(mn)}function mn(){for(var t,e,i,n,r,s,o,a=1;Oe.length;)Oe.length>a&&Oe.sort(Ho),t=Oe.shift(),a=Oe.length,t.__d&&(i=void 0,r=(n=(e=t).__v).__e,s=[],o=[],e.__P&&((i=te({},n)).__v=n.__v+1,F.vnode&&F.vnode(i),Ar(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??ti(n),!!(32&n.__u),o),i.__v=n.__v,i.__.__k[i.__i]=i,Yo(s,i,o),i.__e!=r&&jo(i)));mn.__r=0}function zo(t,e,i,n,r,s,o,a,c,l,d){var h,u,p,f,m,g,v=n&&n.__k||Vo,b=e.length;for(c=El(i,e,v,c,b),h=0;h<b;h++)(p=i.__k[h])!=null&&(u=p.__i==-1?Ni:v[p.__i]||Ni,p.__i=h,g=Ar(t,p,u,r,s,o,a,c,l,d),f=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&Sr(u.ref,null,p),d.push(p.ref,p.__c||f,p)),m==null&&f!=null&&(m=f),4&p.__u||u.__k===p.__k?c=Zo(p,c,t):typeof p.type=="function"&&g!==void 0?c=g:f&&(c=f.nextSibling),p.__u&=-7);return i.__e=m,c}function El(t,e,i,n,r){var s,o,a,c,l,d=i.length,h=d,u=0;for(t.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=s+u,(o=t.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ui(null,o,null,null,null):Hi(o)?Ui(ye,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ui(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(l=o.__i=kl(o,i,c,h))!=-1&&(h--,(a=i[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>d?u--:r<d&&u++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?u--:l==c+1?u++:(l>c?u--:u++,o.__u|=4))):t.__k[s]=null;if(h)for(s=0;s<d;s++)(a=i[s])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=ti(a)),Jo(a,a));return n}function Zo(t,e,i){var n,r;if(typeof t.type=="function"){for(n=t.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=t,e=Zo(n[r],e,i));return e}t.__e!=e&&(e&&t.type&&!i.contains(e)&&(e=ti(t)),i.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Wo(t,e){return e=e||[],t==null||typeof t=="boolean"||(Hi(t)?t.some(function(i){Wo(i,e)}):e.push(t)),e}function kl(t,e,i,n){var r,s,o=t.key,a=t.type,c=e[i];if(c===null&&t.key==null||c&&o==c.key&&a==c.type&&(2&c.__u)==0)return i;if(n>(c!=null&&(2&c.__u)==0?1:0))for(r=i-1,s=i+1;r>=0||s<e.length;){if(r>=0){if((c=e[r])&&(2&c.__u)==0&&o==c.key&&a==c.type)return r;r--}if(s<e.length){if((c=e[s])&&(2&c.__u)==0&&o==c.key&&a==c.type)return s;s++}}return-1}function qo(t,e,i){e[0]=="-"?t.setProperty(e,i??""):t[e]=i==null?"":typeof i!="number"||xl.test(e)?i:i+"px"}function gn(t,e,i,n,r){var s,o;t:if(e=="style")if(typeof i=="string")t.style.cssText=i;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)i&&e in i||qo(t.style,e,"");if(i)for(e in i)n&&i[e]==n[e]||qo(t.style,e,i[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Uo,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?n?i.u=n.u:(i.u=Cr,t.addEventListener(e,s?Er:xr,s)):t.removeEventListener(e,s?Er:xr,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=i??"";break t}catch{}typeof i=="function"||(i==null||i===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&i==1?"":i))}}function Xo(t){return function(e){if(this.l){var i=this.l[e.type+t];if(e.t==null)e.t=Cr++;else if(e.t<i.u)return;return i(F.event?F.event(e):e)}}}function Ar(t,e,i,n,r,s,o,a,c,l){var d,h,u,p,f,m,g,v,b,k,S,O,ut,kt,At,wt,be,lt=e.type;if(e.constructor!=null)return null;128&i.__u&&(c=!!(32&i.__u),s=[a=e.__e=i.__e]),(d=F.__b)&&d(e);t:if(typeof lt=="function")try{if(v=e.props,b="prototype"in lt&<.prototype.render,k=(d=lt.contextType)&&n[d.__c],S=d?k?k.props.value:d.__:n,i.__c?g=(h=e.__c=i.__c).__=h.__E:(b?e.__c=h=new lt(v,S):(e.__c=h=new Vi(v,S),h.constructor=lt,h.render=Sl),k&&k.sub(h),h.props=v,h.state||(h.state={}),h.context=S,h.__n=n,u=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&<.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=te({},h.__s)),te(h.__s,lt.getDerivedStateFromProps(v,h.__s))),p=h.props,f=h.state,h.__v=e,u)b&<.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&<.getDerivedStateFromProps==null&&v!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(v,S),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(v,h.__s,S)===!1||e.__v==i.__v){for(e.__v!=i.__v&&(h.props=v,h.state=h.__s,h.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);h._sb=[],h.__h.length&&o.push(h);break t}h.componentWillUpdate!=null&&h.componentWillUpdate(v,h.__s,S),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,f,m)})}if(h.context=S,h.props=v,h.__P=t,h.__e=!1,ut=F.__r,kt=0,b){for(h.state=h.__s,h.__d=!1,ut&&ut(e),d=h.render(h.props,h.state,h.context),At=0;At<h._sb.length;At++)h.__h.push(h._sb[At]);h._sb=[]}else do h.__d=!1,ut&&ut(e),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++kt<25);h.state=h.__s,h.getChildContext!=null&&(n=te(te({},n),h.getChildContext())),b&&!u&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(p,f)),wt=d,d!=null&&d.type===ye&&d.key==null&&(wt=Ko(d.props.children)),a=zo(t,Hi(wt)?wt:[wt],e,i,n,r,s,o,a,c,l),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),g&&(h.__E=h.__=null)}catch(Q){if(e.__v=null,c||s!=null)if(Q.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else for(be=s.length;be--;)kr(s[be]);else e.__e=i.__e,e.__k=i.__k;F.__e(Q,e,i)}else s==null&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=Al(i.__e,e,i,n,r,s,o,c,l);return(d=F.diffed)&&d(e),128&e.__u?void 0:a}function Yo(t,e,i){for(var n=0;n<i.length;n++)Sr(i[n],i[++n],i[++n]);F.__c&&F.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){F.__e(s,r.__v)}})}function Ko(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Hi(t)?t.map(Ko):te({},t)}function Al(t,e,i,n,r,s,o,a,c){var l,d,h,u,p,f,m,g=i.props,v=e.props,b=e.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!b&&(b?p.localName==b:p.nodeType==3)){t=p,s[l]=null;break}}if(t==null){if(b==null)return document.createTextNode(v);t=document.createElementNS(r,b,v.is&&v),a&&(F.__m&&F.__m(e,s),a=!1),s=null}if(b==null)g===v||a&&t.data==v||(t.data=v);else{if(s=s&&Pi.call(t.childNodes),g=i.props||Ni,!a&&s!=null)for(g={},l=0;l<t.attributes.length;l++)g[(p=t.attributes[l]).name]=p.value;for(l in g)if(p=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")h=p;else if(!(l in v)){if(l=="value"&&"defaultValue"in v||l=="checked"&&"defaultChecked"in v)continue;gn(t,l,null,p,r)}}for(l in v)p=v[l],l=="children"?u=p:l=="dangerouslySetInnerHTML"?d=p:l=="value"?f=p:l=="checked"?m=p:a&&typeof p!="function"||g[l]===p||gn(t,l,p,g[l],r);if(d)a||h&&(d.__html==h.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(h&&(t.innerHTML=""),zo(e.type=="template"?t.content:t,Hi(u)?u:[u],e,i,n,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:i.__k&&ti(i,0),a,c),s!=null)for(l=s.length;l--;)kr(s[l]);a||(l="value",b=="progress"&&f==null?t.removeAttribute("value"):f!=null&&(f!==t[l]||b=="progress"&&!f||b=="option"&&f!=g[l])&&gn(t,l,f,g[l],r),l="checked",m!=null&&m!=t[l]&&gn(t,l,m,g[l],r))}return t}function Sr(t,e,i){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(r){F.__e(r,i)}}function Jo(t,e,i){var n,r;if(F.unmount&&F.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Sr(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){F.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(r=0;r<n.length;r++)n[r]&&Jo(n[r],e,i||typeof t.type!="function");i||kr(t.__e),t.__c=t.__=t.__e=void 0}function Sl(t,e,i){return this.constructor(t,i)}function vn(t,e,i){var n,r,s,o;e==document&&(e=document.documentElement),F.__&&F.__(t,e),r=(n=typeof i=="function")?null:i&&i.__k||e.__k,s=[],o=[],Ar(e,t=(!n&&i||e).__k=ce(ye,null,[t]),r||Ni,Ni,e.namespaceURI,!n&&i?[i]:r?null:e.firstChild?Pi.call(e.childNodes):null,s,!n&&i?i:r?r.__e:e.firstChild,n,o),Yo(s,t,o)}function Qo(t,e){vn(t,e,Qo)}function ta(t,e,i){var n,r,s,o,a=te({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?n=e[s]:s=="ref"?r=e[s]:a[s]=e[s]===void 0&&o!=null?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Pi.call(arguments,2):i),Ui(t.type,a,n||t.key,r||t.ref,null)}Pi=Vo.slice,F={__e:function(t,e,i,n){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,n||{}),o=r.__d),o)return r.__E=r}catch(a){t=a}throw t}},$o=0,Oo=function(t){return t!=null&&t.constructor==null},Vi.prototype.setState=function(t,e){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=te({},this.state),typeof t=="function"&&(t=t(te({},i),this.props)),t&&te(i,t),t!=null&&this.__v&&(e&&this._sb.push(e),Go(this))},Vi.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Go(this))},Vi.prototype.render=ye,Oe=[],No=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ho=function(t,e){return t.__v.__b-e.__v.__b},mn.__r=0,Uo=/(PointerCapture)$|Capture$/i,Cr=0,xr=Xo(!1),Er=Xo(!0);var Ll=0;function L(t,e,i,n,r,s){e||(e={});var o,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?o=e[a]:c[a]=e[a];var l={type:t,props:c,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ll,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return F.vnode&&F.vnode(l),l}var ji,Y,Lr,ea,bn=0,ia=[],tt=F,na=tt.__b,ra=tt.__r,sa=tt.diffed,oa=tt.__c,aa=tt.unmount,ca=tt.__;function Mr(t,e){tt.__h&&tt.__h(Y,t,bn||e),bn=0;var i=Y.__H||(Y.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Pe(t){return bn=1,Ml(da,t)}function Ml(t,e,i){var n=Mr(ji++,2);if(n.t=t,!n.__c&&(n.__=[da(void 0,e),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Y,!Y.__f)){var r=function(a,c,l){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(u){return!!u.__c});if(d.every(function(u){return!u.__N}))return!s||s.call(this,a,c,l);var h=n.__c.props!==a;return d.forEach(function(u){if(u.__N){var p=u.__[0];u.__=u.__N,u.__N=void 0,p!==u.__[0]&&(h=!0)}}),s&&s.call(this,a,c,l)||h};Y.__f=!0;var s=Y.shouldComponentUpdate,o=Y.componentWillUpdate;Y.componentWillUpdate=function(a,c,l){if(this.__e){var d=s;s=void 0,r(a,c,l),s=d}o&&o.call(this,a,c,l)},Y.shouldComponentUpdate=r}return n.__N||n.__}function ei(t,e){var i=Mr(ji++,3);!tt.__s&&ha(i.__H,e)&&(i.__=t,i.u=e,Y.__H.__h.push(i))}function Xt(t){return bn=5,wn(function(){return{current:t}},[])}function wn(t,e){var i=Mr(ji++,7);return ha(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Tl(){for(var t;t=ia.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(yn),t.__H.__h.forEach(Tr),t.__H.__h=[]}catch(e){t.__H.__h=[],tt.__e(e,t.__v)}}tt.__b=function(t){Y=null,na&&na(t)},tt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ca&&ca(t,e)},tt.__r=function(t){ra&&ra(t),ji=0;var e=(Y=t.__c).__H;e&&(Lr===Y?(e.__h=[],Y.__h=[],e.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(e.__h.forEach(yn),e.__h.forEach(Tr),e.__h=[],ji=0)),Lr=Y},tt.diffed=function(t){sa&&sa(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ia.push(e)!==1&&ea===tt.requestAnimationFrame||((ea=tt.requestAnimationFrame)||Il)(Tl)),e.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),Lr=Y=null},tt.__c=function(t,e){e.some(function(i){try{i.__h.forEach(yn),i.__h=i.__h.filter(function(n){return!n.__||Tr(n)})}catch(n){e.some(function(r){r.__h&&(r.__h=[])}),e=[],tt.__e(n,i.__v)}}),oa&&oa(t,e)},tt.unmount=function(t){aa&&aa(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{yn(n)}catch(r){e=r}}),i.__H=void 0,e&&tt.__e(e,i.__v))};var la=typeof requestAnimationFrame=="function";function Il(t){var e,i=function(){clearTimeout(n),la&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(i,35);la&&(e=requestAnimationFrame(i))}function yn(t){var e=Y,i=t.__c;typeof i=="function"&&(t.__c=void 0,i()),Y=e}function Tr(t){var e=Y;t.__c=t.__(),Y=e}function ha(t,e){return!t||t.length!==e.length||e.some(function(i,n){return i!==t[n]})}function da(t,e){return typeof e=="function"?e(t):e}/**
|
|
3126
|
+
`}class r5 extends HTMLElement{constructor(){super(),this.templateString=n5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image","mirror-image"]}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 imageSrc(){return this.getAttribute("data-image")}get shouldMirror(){return this.getAttribute("mirror-image")!=="false"}get title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.close"))}attributeChangedCallback(e){switch(e){case"data-image":case"hide-back-to-host":case"show-navigation":case"mirror-image":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",r5);var As,wt,Xu,Ku,Jn,Yu,Ju,Qu,t2,yc,Cc,xc,Ss={},e2=[],s5=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ks=Array.isArray;function Oi(t,e){for(var i in e)t[i]=e[i];return t}function Ec(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Qi(t,e,i){var s,o,c,l={};for(c in e)c=="key"?s=e[c]:c=="ref"?o=e[c]:l[c]=e[c];if(arguments.length>2&&(l.children=arguments.length>3?As.call(arguments,2):i),typeof t=="function"&&t.defaultProps!=null)for(c in t.defaultProps)l[c]===void 0&&(l[c]=t.defaultProps[c]);return Ls(t,l,s,o,null)}function Ls(t,e,i,s,o){var c={type:t,props:e,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o==null?++Xu:o,__i:-1,__u:0};return o==null&&wt.vnode!=null&&wt.vnode(c),c}function xn(t){return t.children}function Ms(t,e){this.props=t,this.context=e}function kr(t,e){if(e==null)return t.__?kr(t.__,t.__i+1):null;for(var i;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null)return i.__e;return typeof t.type=="function"?kr(t):null}function i2(t){var e,i;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null){t.__e=t.__c.base=i.__e;break}return i2(t)}}function n2(t){(!t.__d&&(t.__d=!0)&&Jn.push(t)&&!Co.__r++||Yu!=wt.debounceRendering)&&((Yu=wt.debounceRendering)||Ju)(Co)}function Co(){for(var t,e,i,s,o,c,l,u=1;Jn.length;)Jn.length>u&&Jn.sort(Qu),t=Jn.shift(),u=Jn.length,t.__d&&(i=void 0,o=(s=(e=t).__v).__e,c=[],l=[],e.__P&&((i=Oi({},s)).__v=s.__v+1,wt.vnode&&wt.vnode(i),Ac(e.__P,i,s,e.__n,e.__P.namespaceURI,32&s.__u?[o]:null,c,o==null?kr(s):o,!!(32&s.__u),l),i.__v=s.__v,i.__.__k[i.__i]=i,l2(c,i,l),i.__e!=o&&i2(i)));Co.__r=0}function r2(t,e,i,s,o,c,l,u,h,f,_){var m,b,E,A,k,F,M=s&&s.__k||e2,D=e.length;for(h=o5(i,e,M,h,D),m=0;m<D;m++)(E=i.__k[m])!=null&&(b=E.__i==-1?Ss:M[E.__i]||Ss,E.__i=m,F=Ac(t,E,b,o,c,l,u,h,f,_),A=E.__e,E.ref&&b.ref!=E.ref&&(b.ref&&Sc(b.ref,null,E),_.push(E.ref,E.__c||A,E)),k==null&&A!=null&&(k=A),4&E.__u||b.__k===E.__k?h=s2(E,h,t):typeof E.type=="function"&&F!==void 0?h=F:A&&(h=A.nextSibling),E.__u&=-7);return i.__e=k,h}function o5(t,e,i,s,o){var c,l,u,h,f,_=i.length,m=_,b=0;for(t.__k=new Array(o),c=0;c<o;c++)(l=e[c])!=null&&typeof l!="boolean"&&typeof l!="function"?(h=c+b,(l=t.__k[c]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?Ls(null,l,null,null,null):ks(l)?Ls(xn,{children:l},null,null,null):l.constructor==null&&l.__b>0?Ls(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=t,l.__b=t.__b+1,u=null,(f=l.__i=a5(l,i,h,m))!=-1&&(m--,(u=i[f])&&(u.__u|=2)),u==null||u.__v==null?(f==-1&&(o>_?b--:o<_&&b++),typeof l.type!="function"&&(l.__u|=4)):f!=h&&(f==h-1?b--:f==h+1?b++:(f>h?b--:b++,l.__u|=4))):t.__k[c]=null;if(m)for(c=0;c<_;c++)(u=i[c])!=null&&(2&u.__u)==0&&(u.__e==s&&(s=kr(u)),h2(u,u));return s}function s2(t,e,i){var s,o;if(typeof t.type=="function"){for(s=t.__k,o=0;s&&o<s.length;o++)s[o]&&(s[o].__=t,e=s2(s[o],e,i));return e}t.__e!=e&&(e&&t.type&&!i.contains(e)&&(e=kr(t)),i.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function o2(t,e){return e=e||[],t==null||typeof t=="boolean"||(ks(t)?t.some(function(i){o2(i,e)}):e.push(t)),e}function a5(t,e,i,s){var o,c,l=t.key,u=t.type,h=e[i];if(h===null&&t.key==null||h&&l==h.key&&u==h.type&&(2&h.__u)==0)return i;if(s>(h!=null&&(2&h.__u)==0?1:0))for(o=i-1,c=i+1;o>=0||c<e.length;){if(o>=0){if((h=e[o])&&(2&h.__u)==0&&l==h.key&&u==h.type)return o;o--}if(c<e.length){if((h=e[c])&&(2&h.__u)==0&&l==h.key&&u==h.type)return c;c++}}return-1}function a2(t,e,i){e[0]=="-"?t.setProperty(e,i==null?"":i):t[e]=i==null?"":typeof i!="number"||s5.test(e)?i:i+"px"}function xo(t,e,i,s,o){var c,l;t:if(e=="style")if(typeof i=="string")t.style.cssText=i;else{if(typeof s=="string"&&(t.style.cssText=s=""),s)for(e in s)i&&e in i||a2(t.style,e,"");if(i)for(e in i)s&&i[e]==s[e]||a2(t.style,e,i[e])}else if(e[0]=="o"&&e[1]=="n")c=e!=(e=e.replace(t2,"$1")),l=e.toLowerCase(),e=l in t||e=="onFocusOut"||e=="onFocusIn"?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+c]=i,i?s?i.u=s.u:(i.u=yc,t.addEventListener(e,c?xc:Cc,c)):t.removeEventListener(e,c?xc:Cc,c);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=i==null?"":i;break t}catch(u){}typeof i=="function"||(i==null||i===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&i==1?"":i))}}function c2(t){return function(e){if(this.l){var i=this.l[e.type+t];if(e.t==null)e.t=yc++;else if(e.t<i.u)return;return i(wt.event?wt.event(e):e)}}}function Ac(t,e,i,s,o,c,l,u,h,f){var _,m,b,E,A,k,F,M,D,R,$,X,N,vt,J,pt,kt,Zt=e.type;if(e.constructor!=null)return null;128&i.__u&&(h=!!(32&i.__u),c=[u=e.__e=i.__e]),(_=wt.__b)&&_(e);t:if(typeof Zt=="function")try{if(M=e.props,D="prototype"in Zt&&Zt.prototype.render,R=(_=Zt.contextType)&&s[_.__c],$=_?R?R.props.value:_.__:s,i.__c?F=(m=e.__c=i.__c).__=m.__E:(D?e.__c=m=new Zt(M,$):(e.__c=m=new Ms(M,$),m.constructor=Zt,m.render=l5),R&&R.sub(m),m.props=M,m.state||(m.state={}),m.context=$,m.__n=s,b=m.__d=!0,m.__h=[],m._sb=[]),D&&m.__s==null&&(m.__s=m.state),D&&Zt.getDerivedStateFromProps!=null&&(m.__s==m.state&&(m.__s=Oi({},m.__s)),Oi(m.__s,Zt.getDerivedStateFromProps(M,m.__s))),E=m.props,A=m.state,m.__v=e,b)D&&Zt.getDerivedStateFromProps==null&&m.componentWillMount!=null&&m.componentWillMount(),D&&m.componentDidMount!=null&&m.__h.push(m.componentDidMount);else{if(D&&Zt.getDerivedStateFromProps==null&&M!==E&&m.componentWillReceiveProps!=null&&m.componentWillReceiveProps(M,$),!m.__e&&m.shouldComponentUpdate!=null&&m.shouldComponentUpdate(M,m.__s,$)===!1||e.__v==i.__v){for(e.__v!=i.__v&&(m.props=M,m.state=m.__s,m.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(ne){ne&&(ne.__=e)}),X=0;X<m._sb.length;X++)m.__h.push(m._sb[X]);m._sb=[],m.__h.length&&l.push(m);break t}m.componentWillUpdate!=null&&m.componentWillUpdate(M,m.__s,$),D&&m.componentDidUpdate!=null&&m.__h.push(function(){m.componentDidUpdate(E,A,k)})}if(m.context=$,m.props=M,m.__P=t,m.__e=!1,N=wt.__r,vt=0,D){for(m.state=m.__s,m.__d=!1,N&&N(e),_=m.render(m.props,m.state,m.context),J=0;J<m._sb.length;J++)m.__h.push(m._sb[J]);m._sb=[]}else do m.__d=!1,N&&N(e),_=m.render(m.props,m.state,m.context),m.state=m.__s;while(m.__d&&++vt<25);m.state=m.__s,m.getChildContext!=null&&(s=Oi(Oi({},s),m.getChildContext())),D&&!b&&m.getSnapshotBeforeUpdate!=null&&(k=m.getSnapshotBeforeUpdate(E,A)),pt=_,_!=null&&_.type===xn&&_.key==null&&(pt=u2(_.props.children)),u=r2(t,ks(pt)?pt:[pt],e,i,s,o,c,l,u,h,f),m.base=e.__e,e.__u&=-161,m.__h.length&&l.push(m),F&&(m.__E=m.__=null)}catch(ne){if(e.__v=null,h||c!=null)if(ne.then){for(e.__u|=h?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;c[c.indexOf(u)]=null,e.__e=u}else for(kt=c.length;kt--;)Ec(c[kt]);else e.__e=i.__e,e.__k=i.__k;wt.__e(ne,e,i)}else c==null&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):u=e.__e=c5(i.__e,e,i,s,o,c,l,h,f);return(_=wt.diffed)&&_(e),128&e.__u?void 0:u}function l2(t,e,i){for(var s=0;s<i.length;s++)Sc(i[s],i[++s],i[++s]);wt.__c&&wt.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(c){c.call(o)})}catch(c){wt.__e(c,o.__v)}})}function u2(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:ks(t)?t.map(u2):Oi({},t)}function c5(t,e,i,s,o,c,l,u,h){var f,_,m,b,E,A,k,F=i.props,M=e.props,D=e.type;if(D=="svg"?o="http://www.w3.org/2000/svg":D=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),c!=null){for(f=0;f<c.length;f++)if((E=c[f])&&"setAttribute"in E==!!D&&(D?E.localName==D:E.nodeType==3)){t=E,c[f]=null;break}}if(t==null){if(D==null)return document.createTextNode(M);t=document.createElementNS(o,D,M.is&&M),u&&(wt.__m&&wt.__m(e,c),u=!1),c=null}if(D==null)F===M||u&&t.data==M||(t.data=M);else{if(c=c&&As.call(t.childNodes),F=i.props||Ss,!u&&c!=null)for(F={},f=0;f<t.attributes.length;f++)F[(E=t.attributes[f]).name]=E.value;for(f in F)if(E=F[f],f!="children"){if(f=="dangerouslySetInnerHTML")m=E;else if(!(f in M)){if(f=="value"&&"defaultValue"in M||f=="checked"&&"defaultChecked"in M)continue;xo(t,f,null,E,o)}}for(f in M)E=M[f],f=="children"?b=E:f=="dangerouslySetInnerHTML"?_=E:f=="value"?A=E:f=="checked"?k=E:u&&typeof E!="function"||F[f]===E||xo(t,f,E,F[f],o);if(_)u||m&&(_.__html==m.__html||_.__html==t.innerHTML)||(t.innerHTML=_.__html),e.__k=[];else if(m&&(t.innerHTML=""),r2(e.type=="template"?t.content:t,ks(b)?b:[b],e,i,s,D=="foreignObject"?"http://www.w3.org/1999/xhtml":o,c,l,c?c[0]:i.__k&&kr(i,0),u,h),c!=null)for(f=c.length;f--;)Ec(c[f]);u||(f="value",D=="progress"&&A==null?t.removeAttribute("value"):A!=null&&(A!==t[f]||D=="progress"&&!A||D=="option"&&A!=F[f])&&xo(t,f,A,F[f],o),f="checked",k!=null&&k!=t[f]&&xo(t,f,k,F[f],o))}return t}function Sc(t,e,i){try{if(typeof t=="function"){var s=typeof t.__u=="function";s&&t.__u(),s&&e==null||(t.__u=t(e))}else t.current=e}catch(o){wt.__e(o,i)}}function h2(t,e,i){var s,o;if(wt.unmount&&wt.unmount(t),(s=t.ref)&&(s.current&&s.current!=t.__e||Sc(s,null,e)),(s=t.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(c){wt.__e(c,e)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&h2(s[o],e,i||typeof t.type!="function");i||Ec(t.__e),t.__c=t.__=t.__e=void 0}function l5(t,e,i){return this.constructor(t,i)}function Eo(t,e,i){var s,o,c,l;e==document&&(e=document.documentElement),wt.__&&wt.__(t,e),o=(s=typeof i=="function")?null:i&&i.__k||e.__k,c=[],l=[],Ac(e,t=(!s&&i||e).__k=Qi(xn,null,[t]),o||Ss,Ss,e.namespaceURI,!s&&i?[i]:o?null:e.firstChild?As.call(e.childNodes):null,c,!s&&i?i:o?o.__e:e.firstChild,s,l),l2(c,t,l)}function d2(t,e){Eo(t,e,d2)}function f2(t,e,i){var s,o,c,l,u=Oi({},t.props);for(c in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)c=="key"?s=e[c]:c=="ref"?o=e[c]:u[c]=e[c]===void 0&&l!=null?l[c]:e[c];return arguments.length>2&&(u.children=arguments.length>3?As.call(arguments,2):i),Ls(t.type,u,s||t.key,o||t.ref,null)}As=e2.slice,wt={__e:function(t,e,i,s){for(var o,c,l;e=e.__;)if((o=e.__c)&&!o.__)try{if((c=o.constructor)&&c.getDerivedStateFromError!=null&&(o.setState(c.getDerivedStateFromError(t)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,s||{}),l=o.__d),l)return o.__E=o}catch(u){t=u}throw t}},Xu=0,Ku=function(t){return t!=null&&t.constructor==null},Ms.prototype.setState=function(t,e){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Oi({},this.state),typeof t=="function"&&(t=t(Oi({},i),this.props)),t&&Oi(i,t),t!=null&&this.__v&&(e&&this._sb.push(e),n2(this))},Ms.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),n2(this))},Ms.prototype.render=xn,Jn=[],Ju=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qu=function(t,e){return t.__v.__b-e.__v.__b},Co.__r=0,t2=/(PointerCapture)$|Capture$/i,yc=0,Cc=c2(!1),xc=c2(!0);var u5=0;function st(t,e,i,s,o,c){e||(e={});var l,u,h=e;if("ref"in h)for(u in h={},e)u=="ref"?l=e[u]:h[u]=e[u];var f={type:t,props:h,key:i,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--u5,__i:-1,__u:0,__source:o,__self:c};if(typeof t=="function"&&(l=t.defaultProps))for(u in l)h[u]===void 0&&(h[u]=l[u]);return wt.vnode&&wt.vnode(f),f}var Ts,jt,kc,p2,Ao=0,g2=[],Qt=wt,m2=Qt.__b,v2=Qt.__r,_2=Qt.diffed,w2=Qt.__c,b2=Qt.unmount,y2=Qt.__;function Lc(t,e){Qt.__h&&Qt.__h(jt,t,Ao||e),Ao=0;var i=jt.__H||(jt.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Qn(t){return Ao=1,h5(E2,t)}function h5(t,e,i){var s=Lc(Ts++,2);if(s.t=t,!s.__c&&(s.__=[E2(void 0,e),function(u){var h=s.__N?s.__N[0]:s.__[0],f=s.t(h,u);h!==f&&(s.__N=[f,s.__[1]],s.__c.setState({}))}],s.__c=jt,!jt.__f)){var o=function(u,h,f){if(!s.__c.__H)return!0;var _=s.__c.__H.__.filter(function(b){return!!b.__c});if(_.every(function(b){return!b.__N}))return!c||c.call(this,u,h,f);var m=s.__c.props!==u;return _.forEach(function(b){if(b.__N){var E=b.__[0];b.__=b.__N,b.__N=void 0,E!==b.__[0]&&(m=!0)}}),c&&c.call(this,u,h,f)||m};jt.__f=!0;var c=jt.shouldComponentUpdate,l=jt.componentWillUpdate;jt.componentWillUpdate=function(u,h,f){if(this.__e){var _=c;c=void 0,o(u,h,f),c=_}l&&l.call(this,u,h,f)},jt.shouldComponentUpdate=o}return s.__N||s.__}function Si(t,e){var i=Lc(Ts++,3);!Qt.__s&&x2(i.__H,e)&&(i.__=t,i.u=e,jt.__H.__h.push(i))}function pe(t){return Ao=5,So(function(){return{current:t}},[])}function So(t,e){var i=Lc(Ts++,7);return x2(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function d5(){for(var t;t=g2.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ko),t.__H.__h.forEach(Mc),t.__H.__h=[]}catch(e){t.__H.__h=[],Qt.__e(e,t.__v)}}Qt.__b=function(t){jt=null,m2&&m2(t)},Qt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),y2&&y2(t,e)},Qt.__r=function(t){v2&&v2(t),Ts=0;var e=(jt=t.__c).__H;e&&(kc===jt?(e.__h=[],jt.__h=[],e.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(e.__h.forEach(ko),e.__h.forEach(Mc),e.__h=[],Ts=0)),kc=jt},Qt.diffed=function(t){_2&&_2(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(g2.push(e)!==1&&p2===Qt.requestAnimationFrame||((p2=Qt.requestAnimationFrame)||f5)(d5)),e.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),kc=jt=null},Qt.__c=function(t,e){e.some(function(i){try{i.__h.forEach(ko),i.__h=i.__h.filter(function(s){return!s.__||Mc(s)})}catch(s){e.some(function(o){o.__h&&(o.__h=[])}),e=[],Qt.__e(s,i.__v)}}),w2&&w2(t,e)},Qt.unmount=function(t){b2&&b2(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach(function(s){try{ko(s)}catch(o){e=o}}),i.__H=void 0,e&&Qt.__e(e,i.__v))};var C2=typeof requestAnimationFrame=="function";function f5(t){var e,i=function(){clearTimeout(s),C2&&cancelAnimationFrame(e),setTimeout(t)},s=setTimeout(i,35);C2&&(e=requestAnimationFrame(i))}function ko(t){var e=jt,i=t.__c;typeof i=="function"&&(t.__c=void 0,i()),jt=e}function Mc(t){var e=jt;t.__c=t.__(),jt=e}function x2(t,e){return!t||t.length!==e.length||e.some(function(i,s){return i!==t[s]})}function E2(t,e){return typeof e=="function"?e(t):e}/**
|
|
3174
3127
|
* @license @tabler/icons-preact v3.34.0 - MIT
|
|
3175
3128
|
*
|
|
3176
3129
|
* This source code is licensed under the MIT license.
|
|
3177
3130
|
* See the LICENSE file in the root directory of this source tree.
|
|
3178
|
-
*/var
|
|
3131
|
+
*/var p5={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
|
|
3179
3132
|
* @license @tabler/icons-preact v3.34.0 - MIT
|
|
3180
3133
|
*
|
|
3181
3134
|
* This source code is licensed under the MIT license.
|
|
3182
3135
|
* See the LICENSE file in the root directory of this source tree.
|
|
3183
|
-
*/const
|
|
3136
|
+
*/const g5=(t,e,i,s)=>{const o=A=>{var k=A,{color:c="currentColor",size:l=24,stroke:u=2,title:h,children:f,className:_="",class:m="",style:b}=k,E=$u(k,["color","size","stroke","title","children","className","class","style"]);return Qi("svg",Fe(ys(Fe({},p5[t]),{width:String(l),height:String(l),class:["tabler-icon",`tabler-icon-${e}`,m,_].join(" "),"stroke-width":u,stroke:c,style:b}),E),[h&&Qi("title",{},h),...s.map(([F,M])=>Qi(F,M)),...o2(f)])};return o.displayName=`${i}`,o};/**
|
|
3184
3137
|
* @license @tabler/icons-preact v3.34.0 - MIT
|
|
3185
3138
|
*
|
|
3186
3139
|
* This source code is licensed under the MIT license.
|
|
3187
3140
|
* See the LICENSE file in the root directory of this source tree.
|
|
3188
|
-
*/var Dl=Fl("outline","loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function Ir(){return(Ir=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}var Rl=["context","children"];function $l(t){this.getChildContext=function(){return t.context};var e=t.children,i=function(n,r){if(n==null)return{};var s,o,a={},c=Object.keys(n);for(o=0;o<c.length;o++)r.indexOf(s=c[o])>=0||(a[s]=n[s]);return a}(t,Rl);return ta(e,i)}function Ol(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=ce($l,Ir({},this._props,{context:t.detail.context}),function e(i,n){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var r=[],s={},o=0,a=i.attributes,c=i.childNodes;for(o=a.length;o--;)a[o].name!=="slot"&&(s[a[o].name]=a[o].value,s[ua(a[o].name)]=a[o].value);for(o=c.length;o--;){var l=e(c[o],null),d=c[o].slot;d?s[d]=ce(pa,{name:d},l):r[o]=l}var h=n?ce(pa,null,r):r;return ce(n||i.nodeName.toLowerCase(),s,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Qo:vn)(this._vdom,this._root)}function ua(t){return t.replace(/-(\w)/g,function(e,i){return i?i.toUpperCase():""})}function Pl(t,e,i){if(this._vdom){var n={};n[t]=i=i??void 0,n[ua(t)]=i,this._vdom=ta(this._vdom,n),vn(this._vdom,this._root)}}function Nl(){vn(this._vdom=null,this._root)}function pa(t,e){var i=this;return ce("slot",Ir({},t,{ref:function(n){n?(i.ref=n,i._listener||(i._listener=function(r){r.stopPropagation(),r.detail.context=e},n.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function fa(t,e,i,n){function r(){var s=Reflect.construct(HTMLElement,[],r);return s._vdomComponent=t,s._root=n&&n.shadow?s.attachShadow({mode:n.mode||"open"}):s,s}return(r.prototype=Object.create(HTMLElement.prototype)).constructor=r,r.prototype.connectedCallback=Ol,r.prototype.attributeChangedCallback=Pl,r.prototype.disconnectedCallback=Nl,i=i||t.observedAttributes||Object.keys(t.propTypes||{}),r.observedAttributes=i,i.forEach(function(s){Object.defineProperty(r.prototype,s,{get:function(){return this._vdom.props[s]},set:function(o){this._vdom?this.attributeChangedCallback(s,null,o):(this._props||(this._props={}),this._props[s]=o,this.connectedCallback());var a=typeof o;o!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(s,o)}})}),customElements.define(e||t.tagName||t.displayName||t.name,r)}const ii=(t,e=!1)=>typeof t=="boolean"?t:typeof t=="string"?t==="true"||t==="":e,Hl=()=>{const t=Xt(null),e=Xt(null),[i,n]=Pe("user"),[r,s]=Pe(!1),o=async()=>{try{e.current&&(e.current.getTracks().forEach(f=>f.stop()),e.current=null),t.current&&(t.current.srcObject=null);const d=await navigator.mediaDevices.getUserMedia({video:{facingMode:i}});e.current=d;const u=(await navigator.mediaDevices.enumerateDevices()).find(f=>f.kind==="videoinput"&&d.getVideoTracks()[0].getSettings().deviceId===f.deviceId);document.querySelector("smart-camera-web")?.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:u?.label}})),t.current&&(t.current.srcObject=d,await t.current.play())}catch(d){console.error("Failed to start camera:",d)}};return{videoRef:t,streamRef:e,facingMode:i,agentSupported:r,startCamera:o,switchCamera:async()=>{n(i==="user"?"environment":"user"),e.current&&(e.current.getTracks().forEach(h=>h.stop()),e.current=null),await o()},checkAgentSupport:async()=>{try{const h=(await navigator.mediaDevices.enumerateDevices()).filter(u=>u.kind==="videoinput");s(h.length>1)}catch{s(!1)}},stopCamera:()=>{e.current&&(e.current.getTracks().forEach(d=>d.stop()),e.current=null),t.current&&(t.current.srcObject=null,t.current.load())}}};var Ul=Symbol.for("preact-signals");function _n(){if(_e>1)_e--;else{for(var t,e=!1;Gi!==void 0;){var i=Gi;for(Gi=void 0,Br++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&ba(i))try{i.c()}catch(r){e||(t=r,e=!0)}i=n}}if(Br=0,_e--,e)throw t}}function Vl(t){if(_e>0)return t();_e++;try{return t()}finally{_n()}}var D=void 0;function ma(t){var e=D;D=void 0;try{return t()}finally{D=e}}var Gi=void 0,_e=0,Br=0,Cn=0;function ga(t){if(D!==void 0){var e=t.n;if(e===void 0||e.t!==D)return e={i:0,S:t,p:D.s,n:void 0,t:D,e:void 0,x:void 0,r:e},D.s!==void 0&&(D.s.n=e),D.s=e,t.n=e,32&D.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=D.s,e.n=void 0,D.s.n=e,D.s=e),e}}function dt(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched}dt.prototype.brand=Ul,dt.prototype.h=function(){return!0},dt.prototype.S=function(t){var e=this,i=this.t;i!==t&&t.e===void 0&&(t.x=i,this.t=t,i!==void 0?i.e=t:ma(function(){var n;(n=e.W)==null||n.call(e)}))},dt.prototype.U=function(t){var e=this;if(this.t!==void 0){var i=t.e,n=t.x;i!==void 0&&(i.x=n,t.e=void 0),n!==void 0&&(n.e=i,t.x=void 0),t===this.t&&(this.t=n,n===void 0&&ma(function(){var r;(r=e.Z)==null||r.call(e)}))}},dt.prototype.subscribe=function(t){var e=this;return zi(function(){var i=e.value,n=D;D=void 0;try{t(i)}finally{D=n}})},dt.prototype.valueOf=function(){return this.value},dt.prototype.toString=function(){return this.value+""},dt.prototype.toJSON=function(){return this.value},dt.prototype.peek=function(){var t=D;D=void 0;try{return this.value}finally{D=t}},Object.defineProperty(dt.prototype,"value",{get:function(){var t=ga(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Br>100)throw new Error("Cycle detected");this.v=t,this.i++,Cn++,_e++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{_n()}}}});function va(t,e){return new dt(t,e)}function ba(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function wa(t){for(var e=t.s;e!==void 0;e=e.n){var i=e.S.n;if(i!==void 0&&(e.r=i),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function ya(t){for(var e=t.s,i=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):i=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=i}function Ne(t,e){dt.call(this,void 0),this.x=t,this.s=void 0,this.g=Cn-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched}Ne.prototype=new dt,Ne.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cn))return!0;if(this.g=Cn,this.f|=1,this.i>0&&!ba(this))return this.f&=-2,!0;var t=D;try{wa(this),D=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return D=t,ya(this),this.f&=-2,!0},Ne.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}dt.prototype.S.call(this,t)},Ne.prototype.U=function(t){if(this.t!==void 0&&(dt.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Ne.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(Ne.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=ga(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Fr(t,e){return new Ne(t,e)}function _a(t){var e=t.u;if(t.u=void 0,typeof e=="function"){_e++;var i=D;D=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Dr(t),n}finally{D=i,_n()}}}function Dr(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,_a(t)}function jl(t){if(D!==this)throw new Error("Out-of-order effect");ya(this),D=t,this.f&=-2,8&this.f&&Dr(this),_n()}function ni(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ni.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}},ni.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,_a(this),wa(this),_e++;var t=D;return D=this,jl.bind(this,t)},ni.prototype.N=function(){2&this.f||(this.f|=2,this.o=Gi,Gi=this)},ni.prototype.d=function(){this.f|=8,1&this.f||Dr(this)},ni.prototype.dispose=function(){this.d()};function zi(t){var e=new ni(t);try{e.c()}catch(n){throw e.d(),n}var i=e.d.bind(e);return i[Symbol.dispose]=i,i}var Ca,xn,Rr,xa=[];zi(function(){Ca=this.N})();function ri(t,e){F[t]=e.bind(null,F[t]||function(){})}function En(t){Rr&&Rr(),Rr=t&&t.S()}function Ea(t){var e=this,i=t.data,n=et(i);n.value=i;var r=wn(function(){for(var a=e,c=e.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var l=Fr(function(){var p=n.value.value;return p===0?0:p===!0?"":p||""}),d=Fr(function(){return!Array.isArray(l.value)&&!Oo(l.value)}),h=zi(function(){if(this.N=ka,d.value){var p=l.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=p)}}),u=e.__$u.d;return e.__$u.d=function(){h(),u.call(this)},[d,l]},[]),s=r[0],o=r[1];return s.value?o.peek():o.value}Ea.displayName="_st",Object.defineProperties(dt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ea},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ri("__b",function(t,e){if(typeof e.type=="string"){var i,n=e.props;for(var r in n)if(r!=="children"){var s=n[r];s instanceof dt&&(i||(e.__np=i={}),i[r]=s,n[r]=s.peek())}}t(e)}),ri("__r",function(t,e){if(e.type!==ye){En();var i,n=e.__c;n&&(n.__$f&=-2,(i=n.__$u)===void 0&&(n.__$u=i=function(r){var s;return zi(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),xn=n,En(i)}t(e)}),ri("__e",function(t,e,i,n){En(),xn=void 0,t(e,i,n)}),ri("diffed",function(t,e){En(),xn=void 0;var i;if(typeof e.type=="string"&&(i=e.__e)){var n=e.__np,r=e.props;if(n){var s=i.U;if(s)for(var o in s){var a=s[o];a!==void 0&&!(o in n)&&(a.d(),s[o]=void 0)}else s={},i.U=s;for(var c in n){var l=s[c],d=n[c];l===void 0?(l=Gl(i,c,d,r),s[c]=l):l.o(d,r)}}}t(e)});function Gl(t,e,i,n){var r=e in t&&t.ownerSVGElement===void 0,s=va(i);return{o:function(o,a){s.value=o,n=a},d:zi(function(){this.N=ka;var o=s.value.value;n[e]!==o&&(n[e]=o,r?t[e]=o:o?t.setAttribute(e,o):t.removeAttribute(e))})}}ri("unmount",function(t,e){if(typeof e.type=="string"){var i=e.__e;if(i){var n=i.U;if(n){i.U=void 0;for(var r in n){var s=n[r];s&&s.d()}}}}else{var o=e.__c;if(o){var a=o.__$u;a&&(o.__$u=void 0,a.d())}}t(e)}),ri("__h",function(t,e,i,n){(n<3||n===9)&&(e.__$f|=2),t(e,i,n)}),Vi.prototype.shouldComponentUpdate=function(t,e){var i=this.__$u,n=i&&i.s!==void 0;for(var r in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(n||s||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in t))return!0;return!1};function et(t,e){return wn(function(){return va(t,e)},[])}function $r(t,e){var i=Xt(t);return i.current=t,xn.__$f|=4,wn(function(){return Fr(function(){return i.current()},e)},[])}var zl=function(t){queueMicrotask(function(){queueMicrotask(t)})};function Zl(){Vl(function(){for(var t;t=xa.shift();)Ca.call(t)})}function ka(){xa.push(this)===1&&(F.requestAnimationFrame||zl)(Zl)}var si=typeof self<"u"?self:{};function He(){throw Error("Invalid UTF8")}function Aa(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let kn,Or;const Wl=typeof TextDecoder<"u";let ql;const Xl=typeof TextEncoder<"u";function Sa(t){if(Xl)t=(ql||=new TextEncoder).encode(t);else{let i=0;const n=new Uint8Array(3*t.length);for(let r=0;r<t.length;r++){var e=t.charCodeAt(r);if(e<128)n[i++]=e;else{if(e<2048)n[i++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&r<t.length){const s=t.charCodeAt(++r);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,n[i++]=e>>18|240,n[i++]=e>>12&63|128,n[i++]=e>>6&63|128,n[i++]=63&e|128;continue}r--}e=65533}n[i++]=e>>12|224,n[i++]=e>>6&63|128}n[i++]=63&e|128}}t=i===n.length?n:n.subarray(0,i)}return t}var Pr,An;t:{for(var La=["CLOSURE_FLAGS"],Nr=si,Hr=0;Hr<La.length;Hr++)if((Nr=Nr[La[Hr]])==null){An=null;break t}An=Nr}var Zi,Ma=An&&An[610401301];Pr=Ma!=null&&Ma;const Ta=si.navigator;function Ur(t){return!!Pr&&!!Zi&&Zi.brands.some(({brand:e})=>e&&e.indexOf(t)!=-1)}function Ht(t){var e;return(e=si.navigator)&&(e=e.userAgent)||(e=""),e.indexOf(t)!=-1}function Ce(){return!!Pr&&!!Zi&&Zi.brands.length>0}function Vr(){return Ce()?Ur("Chromium"):(Ht("Chrome")||Ht("CriOS"))&&!(!Ce()&&Ht("Edge"))||Ht("Silk")}function Sn(t){return Sn[" "](t),t}Zi=Ta&&Ta.userAgentData||null,Sn[" "]=function(){};var Yl=!Ce()&&(Ht("Trident")||Ht("MSIE"));!Ht("Android")||Vr(),Vr(),Ht("Safari")&&(Vr()||!Ce()&&Ht("Coast")||!Ce()&&Ht("Opera")||!Ce()&&Ht("Edge")||(Ce()?Ur("Microsoft Edge"):Ht("Edg/"))||Ce()&&Ur("Opera"));var Ia={},Wi=null;function Kl(t){const e=t.length;let i=3*e/4;i%3?i=Math.floor(i):"=.".indexOf(t[e-1])!=-1&&(i="=.".indexOf(t[e-2])!=-1?i-2:i-1);const n=new Uint8Array(i);let r=0;return function(s,o){function a(l){for(;c<s.length;){const d=s.charAt(c++),h=Wi[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}Ba();let c=0;for(;;){const l=a(-1),d=a(0),h=a(64),u=a(64);if(u===64&&l===-1)break;o(l<<2|d>>4),h!=64&&(o(d<<4&240|h>>2),u!=64&&o(h<<6&192|u))}}(t,function(s){n[r++]=s}),r!==i?n.subarray(0,r):n}function Ba(){if(!Wi){Wi={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const n=t.concat(e[i].split(""));Ia[i]=n;for(let r=0;r<n.length;r++){const s=n[r];Wi[s]===void 0&&(Wi[s]=r)}}}}var Fa=typeof Uint8Array<"u",Da=!Yl&&typeof btoa=="function";function Ra(t){if(!Da){var e;e===void 0&&(e=0),Ba(),e=Ia[e];var i=Array(Math.floor(t.length/3)),n=e[64]||"";let c=0,l=0;for(;c<t.length-2;c+=3){var r=t[c],s=t[c+1],o=t[c+2],a=e[r>>2];r=e[(3&r)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],i[l++]=a+r+s+o}switch(a=0,o=n,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||n;case 1:t=t[c],i[l]=e[t>>2]+e[(3&t)<<4|a>>4]+o+n}return i.join("")}for(e="",i=0,n=t.length-10240;i<n;)e+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));return e+=String.fromCharCode.apply(null,i?t.subarray(i):t),btoa(e)}const $a=/[-_.]/g,Jl={"-":"+",_:"/",".":"="};function Ql(t){return Jl[t]||""}function Oa(t){if(!Da)return Kl(t);$a.test(t)&&(t=t.replace($a,Ql)),t=atob(t);const e=new Uint8Array(t.length);for(let i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}function Ue(t){return Fa&&t!=null&&t instanceof Uint8Array}var oi={};function Ve(){return th||=new le(null,oi)}function jr(t){Pa(oi);var e=t.g;return(e=e==null||Ue(e)?e:typeof e=="string"?Oa(e):null)==null?e:t.g=e}var le=class{h(){return new Uint8Array(jr(this)||0)}constructor(t,e){if(Pa(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}};let th,eh;function Pa(t){if(t!==oi)throw Error("illegal external caller")}function Na(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function Gr(t){return Na(t=Error(t),"warning"),t}function zr(t){if(t!=null){var e=eh??={},i=e[t]||0;i>=5||(e[t]=i+1,Na(t=Error(),"incident"),function(n){si.setTimeout(()=>{throw n},0)}(t))}}var Ln=typeof Symbol=="function"&&typeof Symbol()=="symbol";function ai(t,e,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var ih=ai("jas",void 0,!0),Ha=ai(void 0,"0di"),qi=ai(void 0,"1oa"),ci=ai(void 0,Symbol()),nh=ai(void 0,"0actk"),Ua=ai(void 0,"8utk");const C=Ln?ih:"Ea",Va={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},ja=Object.defineProperties;function Mn(t,e){Ln||C in t||ja(t,Va),t[C]|=e}function it(t,e){Ln||C in t||ja(t,Va),t[C]=e}function li(t){return Mn(t,34),t}function rh(t,e){it(e,-15615&(0|t))}function Zr(t,e){it(e,-15581&(34|t))}function Tn(){return typeof BigInt=="function"}function _t(t){return Array.prototype.slice.call(t)}var Wr,Xi={};function In(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}function qr(t,e){if(t!=null){if(typeof t=="string")t=t?new le(t,oi):Ve();else if(t.constructor!==le)if(Ue(t))t=t.length?new le(new Uint8Array(t),oi):Ve();else{if(!e)throw Error();t=void 0}}return t}const Ga=[];function xe(t){if(2&t)throw Error()}it(Ga,55),Wr=Object.freeze(Ga);class za{constructor(e,i,n){this.g=e,this.h=i,this.l=n}next(){const e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}}function Xr(t){return ci?t[ci]:void 0}var sh=Object.freeze({});function Bn(t){return t.Na=!0,t}var oh=Bn(t=>typeof t=="number"),Za=Bn(t=>typeof t=="string"),ah=Bn(t=>typeof t=="boolean"),Fn=typeof si.BigInt=="function"&&typeof si.BigInt(0)=="bigint";function Ee(t){var e=t;if(Za(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(oh(e)&&!Number.isSafeInteger(e))throw Error(String(e));return Fn?BigInt(t):t=ah(t)?t?"1":"0":Za(t)?t.trim()||"0":String(t)}var Yr=Bn(t=>Fn?t>=lh&&t<=dh:t[0]==="-"?Wa(t,ch):Wa(t,hh));const ch=Number.MIN_SAFE_INTEGER.toString(),lh=Fn?BigInt(Number.MIN_SAFE_INTEGER):void 0,hh=Number.MAX_SAFE_INTEGER.toString(),dh=Fn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Wa(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let i=0;i<t.length;i++){const n=t[i],r=e[i];if(n>r)return!1;if(n<r)return!0}}const uh=typeof Uint8Array.prototype.slice=="function";let qa,P=0,q=0;function Xa(t){const e=t>>>0;P=e,q=(t-e)/4294967296>>>0}function je(t){if(t<0){Xa(-t);const[e,i]=ts(P,q);P=e>>>0,q=i>>>0}else Xa(t)}function Kr(t){const e=qa||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,P=e.getUint32(0,!0)}function Jr(t,e){const i=4294967296*e+(t>>>0);return Number.isSafeInteger(i)?i:Yi(t,e)}function Qr(t,e){const i=2147483648&e;return i&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=Jr(t,e))=="number"?i?-t:t:i?"-"+t:t}function Yi(t,e){if(t>>>=0,(e>>>=0)<=2097151)var i=""+(4294967296*e+t);else Tn()?i=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(i=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),i+=8147497*e,e*=2,t>=1e7&&(i+=t/1e7>>>0,t%=1e7),i>=1e7&&(e+=i/1e7>>>0,i%=1e7),i=e+Ya(i)+Ya(t));return i}function Ya(t){return t=String(t),"0000000".slice(t.length)+t}function Ka(){var t=P,e=q;if(2147483648&e)if(Tn())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[i,n]=ts(t,e);t="-"+Yi(i,n)}else t=Yi(t,e);return t}function Dn(t){if(t.length<16)je(Number(t));else if(Tn())t=BigInt(t),P=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");q=P=0;const i=t.length;for(let n=e,r=(i-e)%6+e;r<=i;n=r,r+=6){const s=Number(t.slice(n,r));q*=1e6,P=1e6*P+s,P>=4294967296&&(q+=Math.trunc(P/4294967296),q>>>=0,P>>>=0)}if(e){const[n,r]=ts(P,q);P=n,q=r}}}function ts(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}const Ki=typeof BigInt=="function"?BigInt.asIntN:void 0,ph=typeof BigInt=="function"?BigInt.asUintN:void 0,ke=Number.isSafeInteger,Rn=Number.isFinite,hi=Math.trunc,fh=Ee(0);function Ae(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function Ja(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}const mh=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ji(t){switch(typeof t){case"bigint":return!0;case"number":return Rn(t);case"string":return mh.test(t);default:return!1}}function di(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Rn(t)?0|t:void 0}function Qa(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Rn(t)?t>>>0:void 0}function t1(t){if(t[0]==="-")return!1;const e=t.length;return e<20||e===20&&Number(t.substring(0,6))<184467}function e1(t){const e=t.length;return t[0]==="-"?e<20||e===20&&Number(t.substring(0,7))>-922337:e<19||e===19&&Number(t.substring(0,6))<922337}function i1(t){return e1(t)?t:(Dn(t),Ka())}function es(t){return t=hi(t),ke(t)||(je(t),t=Qr(P,q)),t}function n1(t){var e=hi(Number(t));return ke(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),i1(t))}function r1(t){var e=hi(Number(t));return ke(e)?Ee(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Tn()?Ee(Ki(64,BigInt(t))):Ee(i1(t)))}function s1(t){if(ke(t))t=Ee(es(t));else{if(t=hi(t),ke(t))t=String(t);else{const e=String(t);e1(e)?t=e:(je(t),t=Ka())}t=Ee(t)}return t}function is(t){return t==null?t:typeof t=="bigint"?(Yr(t)?t=Number(t):(t=Ki(64,t),t=Yr(t)?Number(t):String(t)),t):Ji(t)?typeof t=="number"?es(t):n1(t):void 0}function gh(t){if(t==null)return t;var e=typeof t;if(e==="bigint")return String(ph(64,t));if(Ji(t)){if(e==="string")return e=hi(Number(t)),ke(e)&&e>=0?t=String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),t1(t)||(Dn(t),t=Yi(P,q))),t;if(e==="number")return(t=hi(t))>=0&&ke(t)?t:function(i){if(i<0){je(i);var n=Yi(P,q);return i=Number(n),ke(i)?i:n}return t1(n=String(i))?n:(je(i),Jr(P,q))}(t)}}function o1(t){if(typeof t!="string")throw Error();return t}function ui(t){if(t!=null&&typeof t!="string")throw Error();return t}function pi(t){return t==null||typeof t=="string"?t:void 0}function ns(t,e,i,n){if(t!=null&&typeof t=="object"&&t.W===Xi)return t;if(!Array.isArray(t))return i?2&n?((t=e[Ha])||(li((t=new e).u),t=e[Ha]=t),e=t):e=new e:e=void 0,e;let r=i=0|t[C];return r===0&&(r|=32&n),r|=2&n,r!==i&&it(t,r),new e(t)}function vh(t,e,i){if(e)t:{if(!Ji(e=t))throw Gr("int64");switch(typeof e){case"string":e=r1(e);break t;case"bigint":e=Ee(Ki(64,e));break t;default:e=s1(e)}}else t=typeof(e=t),e=e==null?e:t==="bigint"?Ee(Ki(64,e)):Ji(e)?t==="string"?r1(e):s1(e):void 0;return(t=e)==null?i?fh:void 0:t}function bh(t){return t}const wh={};let yh=function(){try{return Sn(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class rs{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,i){return this.g.set(e,i),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,i){return this.g.forEach(e,i)}[Symbol.iterator](){return this.entries()}}const _h=yh?(Object.setPrototypeOf(rs.prototype,Map.prototype),Object.defineProperties(rs.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),rs):class extends Map{constructor(){super()}};function a1(t){return t}function ss(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var ee=class extends _h{constructor(t,e,i=a1,n=a1){super();let r=0|t[C];r|=64,it(t,r),this.M=r,this.I=e,this.S=i,this.X=this.I?Ch:n;for(let s=0;s<t.length;s++){const o=t[s],a=i(o[0],!1,!0);let c=o[1];e?c===void 0&&(c=null):c=n(o[1],!1,!0,void 0,void 0,r),super.set(a,c)}}La(){var t=Sh;if(this.size!==0)return Array.from(super.entries(),e=>(e[0]=t(e[0]),e[1]=t(e[1]),e))}da(t=xh){const e=[],i=super.entries();for(var n;!(n=i.next()).done;)(n=n.value)[0]=t(n[0]),n[1]=t(n[1]),e.push(n);return e}clear(){ss(this),super.clear()}delete(t){return ss(this),super.delete(this.S(t,!0,!1))}entries(){if(this.I){var t=super.keys();t=new za(t,Eh,this)}else t=super.entries();return t}values(){if(this.I){var t=super.keys();t=new za(t,ee.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.I?super.forEach((i,n,r)=>{t.call(e,r.get(n),n,r)}):super.forEach(t,e)}set(t,e){return ss(this),(t=this.S(t,!0,!1))==null?this:e==null?(super.delete(t),this):super.set(t,this.X(e,!0,!0,this.I,!1,this.M))}Ja(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.I?t===void 0?null:t:this.X(t,!1,!0,void 0,!1,this.M),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(e!==void 0){var i=this.I;return i?((i=this.X(e,!1,!0,i,this.pa,this.M))!==e&&super.set(t,i),i):e}}[Symbol.iterator](){return this.entries()}};function Ch(t,e,i,n,r,s){return t=ns(t,n,i,s),r&&(t=Pn(t)),t}function xh(t){return t}function Eh(t){return[t,this.get(t)]}let kh,c1,l1,Ah;function h1(){return kh||=new ee(li([]),void 0,void 0,void 0,wh)}function os(t,e,i,n,r){if(t!=null){if(Array.isArray(t)){const s=0|t[C];return t.length===0&&1&s?void 0:r&&2&s?t:$n(t,e,i,n!==void 0,r)}return e(t,n)}}function $n(t,e,i,n,r){const s=n||i?0|t[C]:0,o=n?!!(32&s):void 0;let a=0;const c=(n=_t(t)).length;for(let f=0;f<c;f++){var l=n[f];if(f===c-1&&In(l)){var d=e,h=i,u=o,p=r;let m;for(let g in l){const v=os(l[g],d,h,u,p);v!=null&&((m??={})[g]=v)}l=m}else l=os(n[f],e,i,o,r);n[f]=l,l!=null&&(a=f+1)}return a<c&&(n.length=a),i&&((t=Xr(t))&&(n[ci]=_t(t)),i(s,n)),n}function Sh(t){return os(t,as,void 0,void 0,!1)}function as(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Yr(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Ue(t))return Ue(t)&&zr(Ua),Ra(t);if(t.W===Xi)return d1(t);if(t instanceof le){const e=t.g;return e==null?"":typeof e=="string"?e:t.g=Ra(e)}return t instanceof ee?t.La():void 0}return t}function d1(t){var e=t.u;t=$n(e,as,void 0,void 0,!1);var i=0|e[C];if((e=t.length)&&!(512&i)){var n=t[e-1],r=!1;In(n)?(e--,r=!0):n=void 0;var s=e-(i=512&i?0:-1),o=(c1??bh)(s,i,t,n);if(n&&(t[e]=void 0),s<o&&n){for(var a in s=!0,n){const c=+a;c<=o?(t[r=c+i]=n[a],e=Math.max(r+1,e),r=!1,delete n[a]):s=!1}s&&(n=void 0)}for(s=e-1;e>0;s=e-1)if((a=t[s])==null)e--,r=!0;else{if(!((s-=i)>=o))break;(n??={})[s]=a,e--,r=!0}r&&(t.length=e),n&&t.push(n)}return t}function Se(t,e,i){return t=u1(t,e[0],e[1],i?1:2),e!==l1&&i&&Mn(t,8192),t}function u1(t,e,i,n){if(t==null){var r=96;i?(t=[i],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(r=0|t[C])||!(64&r)||2&r||zr(nh),1024&r)throw Error("farr");if(64&r)return t;if(n===1||n===2||(r|=64),i&&(r|=512,i!==t[0]))throw Error("mid");t:{var s=(i=t).length;if(s){var o=s-1;if(In(n=i[o])){if((o-=e=512&(r|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in n)(s=+a)<o&&(i[s+e]=n[a],delete n[a]);r=-16760833&r|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(512&r?0:-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&a)<<14}}}return it(t,r),t}function cs(t,e,i=Zr){if(t!=null){if(Fa&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var n=0|t[C];return 2&n?t:(e&&=n===0||!!(32&n)&&!(64&n||!(16&n)),e?(it(t,34|n),4&n&&Object.freeze(t),t):$n(t,cs,4&n?Zr:i,!0,!0))}return t.W===Xi?t=2&(n=0|(i=t.u)[C])?t:new t.constructor(On(i,n,!0)):t instanceof ee&&!(2&t.M)&&(i=li(t.da(cs)),t=new ee(i,t.I,t.S,t.X)),t}}function On(t,e,i){const n=i||2&e?Zr:rh,r=!!(32&e);return t=function(s,o,a){const c=_t(s);var l=c.length;const d=256&o?c[l-1]:void 0;for(l+=d?-1:0,o=512&o?1:0;o<l;o++)c[o]=a(c[o]);if(d){o=c[o]={};for(const h in d)o[h]=a(d[h])}return(s=Xr(s))&&(c[ci]=_t(s)),c}(t,e,s=>cs(s,r,n)),Mn(t,32|(i?2:0)),t}function Pn(t){const e=t.u,i=0|e[C];return 2&i?new t.constructor(On(e,i,!1)):t}function fi(t,e){return he(t=t.u,0|t[C],e)}function he(t,e,i){if(i===-1)return null;const n=i+(512&e?0:-1),r=t.length-1;return n>=r&&256&e?t[r][i]:n<=r?t[n]:void 0}function N(t,e,i){const n=t.u;let r=0|n[C];return xe(r),Z(n,r,e,i),t}function Z(t,e,i,n){const r=512&e?0:-1,s=i+r;var o=t.length-1;return s>=o&&256&e?(t[o][i]=n,e):s<=o?(t[s]=n,e):(n!==void 0&&(i>=(o=e>>14&1023||536870912)?n!=null&&(t[o+r]={[i]:n},it(t,e|=256)):t[s]=n),e)}function Nn(t,e){let i=0|(t=t.u)[C];const n=he(t,i,e),r=Ae(n);return r!=null&&r!==n&&Z(t,i,e,r),r}function p1(t){let e=0|(t=t.u)[C];const i=he(t,e,1),n=qr(i,!0);return n!=null&&n!==i&&Z(t,e,1,n),n}function Ge(){return sh===void 0?2:4}function ze(t,e,i,n,r){const s=t.u,o=2&(t=0|s[C])?1:n;r=!!r;let a=0|(n=ls(s,t,e))[C];if(!(4&a)){4&a&&(n=_t(n),a=pe(a,t),t=Z(s,t,e,n));let c=0,l=0;for(;c<n.length;c++){const d=i(n[c]);d!=null&&(n[l++]=d)}l<c&&(n.length=l),a=hs(a,t),i=-2049&(20|a),a=i&=-4097,it(n,a),2&a&&Object.freeze(n)}return o===1||o===4&&32&a?de(a)||(r=a,a|=2,a!==r&&it(n,a),Object.freeze(n)):(o===2&&de(a)&&(n=_t(n),a=pe(a,t),a=Le(a,t,r),it(n,a),t=Z(s,t,e,n)),de(a)||(e=a,a=Le(a,t,r),a!==e&&it(n,a))),n}function ls(t,e,i){return t=he(t,e,i),Array.isArray(t)?t:Wr}function hs(t,e){return t===0&&(t=pe(t,e)),1|t}function de(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function f1(t){t=_t(t);for(let e=0;e<t.length;e++){const i=t[e]=_t(t[e]);Array.isArray(i[1])&&(i[1]=li(i[1]))}return t}function ds(t,e,i,n){let r=0|(t=t.u)[C];xe(r),Z(t,r,e,(n==="0"?Number(i)===0:i===n)?void 0:i)}function mi(t,e,i,n){xe(e);let r=ls(t,e,i);const s=r!==Wr;if(64&e||!(8192&e)||!s){const o=s?0|r[C]:0;let a=o;(!s||2&a||de(a)||4&a&&!(32&a))&&(r=_t(r),a=pe(a,e),e=Z(t,e,i,r)),a=-13&hs(a,e),a=Le(n?-17&a:16|a,e,!0),a!==o&&it(r,a)}return r}function us(t,e){var i=gc;return fs(ps(t=t.u),t,0|t[C],i)===e?e:-1}function ps(t){if(Ln)return t[qi]??(t[qi]=new Map);if(qi in t)return t[qi];const e=new Map;return Object.defineProperty(t,qi,{value:e}),e}function m1(t,e,i,n){const r=ps(t),s=fs(r,t,e,i);return s!==n&&(s&&(e=Z(t,e,s)),r.set(i,n)),e}function fs(t,e,i,n){let r=t.get(n);if(r!=null)return r;r=0;for(let s=0;s<n.length;s++){const o=n[s];he(e,i,o)!=null&&(r!==0&&(i=Z(e,i,r)),r=o)}return t.set(n,r),r}function ms(t,e,i){let n=0|t[C];const r=he(t,n,i);let s;if(r!=null&&r.W===Xi)return(e=Pn(r))!==r&&Z(t,n,i,e),e.u;if(Array.isArray(r)){const o=0|r[C];s=2&o?Se(On(r,o,!1),e,!0):64&o?r:Se(s,e,!0)}else s=Se(void 0,e,!0);return s!==r&&Z(t,n,i,s),s}function g1(t,e,i){let n=0|(t=t.u)[C];const r=he(t,n,i);return(e=ns(r,e,!1,n))!==r&&e!=null&&Z(t,n,i,e),e}function I(t,e,i){if((e=g1(t,e,i))==null)return e;let n=0|(t=t.u)[C];if(!(2&n)){const r=Pn(e);r!==e&&Z(t,n,i,e=r)}return e}function v1(t,e,i,n,r,s,o){t=t.u;var a=!!(2&e);const c=a?1:r;s=!!s,o&&=!a;var l=0|(r=ls(t,e,n))[C];if(!(a=!!(4&l))){var d=r,h=e;const u=!!(2&(l=hs(l,e)));u&&(h|=2);let p=!u,f=!0,m=0,g=0;for(;m<d.length;m++){const v=ns(d[m],i,!1,h);if(v instanceof i){if(!u){const b=!!(2&(0|v.u[C]));p&&=!b,f&&=b}d[g++]=v}}g<m&&(d.length=g),l|=4,l=f?16|l:-17&l,it(d,l=p?8|l:-9&l),u&&Object.freeze(d)}if(o&&!(8&l||!r.length&&(c===1||c===4&&32&l))){for(de(l)&&(r=_t(r),l=pe(l,e),e=Z(t,e,n,r)),i=r,o=l,d=0;d<i.length;d++)(l=i[d])!==(h=Pn(l))&&(i[d]=h);o|=8,it(i,o=i.length?-17&o:16|o),l=o}return c===1||c===4&&32&l?de(l)||(e=l,(l|=!r.length||16&l&&(!a||32&l)?2:1024)!==e&&it(r,l),Object.freeze(r)):(c===2&&de(l)&&(it(r=_t(r),l=Le(l=pe(l,e),e,s)),e=Z(t,e,n,r)),de(l)||(n=l,(l=Le(l,e,s))!==n&&it(r,l))),r}function ue(t,e,i){const n=0|t.u[C];return v1(t,n,e,i,Ge(),!1,!(2&n))}function E(t,e,i,n){return n==null&&(n=void 0),N(t,i,n)}function Qi(t,e,i,n){n==null&&(n=void 0);t:{let r=0|(t=t.u)[C];if(xe(r),n==null){const s=ps(t);if(fs(s,t,r,i)!==e)break t;s.set(i,0)}else r=m1(t,r,i,e);Z(t,r,e,n)}}function pe(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function Le(t,e,i){return 32&e&&i||(t&=-33),t}function Hn(t,e,i){xe(0|t.u[C]),ze(t,e,pi,2,!0).push(o1(i))}function Un(t,e,i,n){const r=0|t.u[C];xe(r),t=v1(t,r,i,e,2,!0),n=n??new i,t.push(n),t[C]=2&(0|n.u[C])?-9&t[C]:-17&t[C]}function Ut(t,e){return di(fi(t,e))}function Vt(t,e){return pi(fi(t,e))}function K(t,e){return Nn(t,e)??0}function tn(t,e,i){if(i!=null&&typeof i!="boolean")throw t=typeof i,Error(`Expected boolean but got ${t!="object"?t:i?Array.isArray(i)?"array":t:"null"}: ${i}`);N(t,e,i)}function ie(t,e,i){if(i!=null){if(typeof i!="number"||!Rn(i))throw Gr("int32");i|=0}N(t,e,i)}function _(t,e,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);N(t,e,i)}function Vn(t,e,i){{const o=t.u;let a=0|o[C];if(xe(a),i==null)Z(o,a,e);else{var n=t=0|i[C],r=de(t),s=r||Object.isFrozen(i);for(r||(t=0),s||(i=_t(i),n=0,t=Le(t=pe(t,a),a,!0),s=!1),t|=21,r=0;r<i.length;r++){const c=i[r],l=o1(c);Object.is(c,l)||(s&&(i=_t(i),n=0,t=Le(t=pe(t,a),a,!0),s=!1),i[r]=l)}t!==n&&(s&&(i=_t(i),t=Le(t=pe(t,a),a,!0)),it(i,t)),Z(o,a,e,i)}}}function b1(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function gs(){return Error("Failed to read varint, encoding is invalid.")}function w1(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function vs(t){if(typeof t=="string")return{buffer:Oa(t),O:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:!1};if(t.constructor===Uint8Array)return{buffer:t,O:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:!1};if(t.constructor===le)return{buffer:jr(t)||new Uint8Array(0),O:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function bs(t,e){let i,n=0,r=0,s=0;const o=t.h;let a=t.g;do i=o[a++],n|=(127&i)<<s,s+=7;while(s<32&&128&i);for(s>32&&(r|=(127&i)>>4),s=3;s<32&&128&i;s+=7)i=o[a++],r|=(127&i)<<s;if(Ze(t,a),i<128)return e(n>>>0,r>>>0);throw gs()}function ws(t){let e=0,i=t.g;const n=i+10,r=t.h;for(;i<n;){const s=r[i++];if(e|=s,(128&s)==0)return Ze(t,i),!!(127&e)}throw gs()}function Me(t){const e=t.h;let i=t.g,n=e[i++],r=127&n;if(128&n&&(n=e[i++],r|=(127&n)<<7,128&n&&(n=e[i++],r|=(127&n)<<14,128&n&&(n=e[i++],r|=(127&n)<<21,128&n&&(n=e[i++],r|=n<<28,128&n&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++])))))throw gs();return Ze(t,i),r}function fe(t){return Me(t)>>>0}function ys(t){var e=t.h;const i=t.g,n=e[i],r=e[i+1],s=e[i+2];return e=e[i+3],Ze(t,t.g+4),(n<<0|r<<8|s<<16|e<<24)>>>0}function _s(t){var e=ys(t);t=2*(e>>31)+1;const i=e>>>23&255;return e&=8388607,i==255?e?NaN:t*(1/0):i==0?1401298464324817e-60*t*e:t*Math.pow(2,i-150)*(e+8388608)}function Lh(t){return Me(t)}function Cs(t,e,{aa:i=!1}={}){t.aa=i,e&&(e=vs(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function Ze(t,e){if(t.g=e,e>t.l)throw w1(t.l,e)}function y1(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const i=t.g,n=i+e;if(n>t.l)throw w1(e,t.l-i);return t.g=n,i}function _1(t,e){if(e==0)return Ve();var i=y1(t,e);return t.aa&&t.m?i=t.h.subarray(i,i+e):(t=t.h,i=i===(e=i+e)?new Uint8Array(0):uh?t.slice(i,e):new Uint8Array(t.subarray(i,e))),i.length==0?Ve():new le(i,oi)}ee.prototype.toJSON=void 0;var C1=[];function x1(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var i=fe(t.g);if(e=i>>>3,!((i&=7)>=0&&i<=5))throw b1(i,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=i,!0}function jn(t){switch(t.h){case 0:t.h!=0?jn(t):ws(t.g);break;case 1:Ze(t=t.g,t.g+8);break;case 2:if(t.h!=2)jn(t);else{var e=fe(t.g);Ze(t=t.g,t.g+e)}break;case 5:Ze(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!x1(t))throw Error("Unmatched start-group tag: stream EOF");if(t.h==4){if(t.m!=e)throw Error("Unmatched end-group tag");break}jn(t)}break;default:throw b1(t.h,t.l)}}function en(t,e,i){const n=t.g.l,r=fe(t.g),s=t.g.g+r;let o=s-n;if(o<=0&&(t.g.l=s,i(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${r} bytes, instead read ${r-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=n,e}function xs(t){var e=fe(t.g),i=y1(t=t.g,e);if(t=t.h,Wl){var n,r=t;(n=Or)||(n=Or=new TextDecoder("utf-8",{fatal:!0})),e=i+e,r=i===0&&e===r.length?r:r.subarray(i,e);try{var s=n.decode(r)}catch(a){if(kn===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),kn=!0}catch{kn=!1}}throw!kn&&(Or=void 0),a}}else{e=(s=i)+e,i=[];let a,c=null;for(;s<e;){var o=t[s++];o<128?i.push(o):o<224?s>=e?He():(a=t[s++],o<194||(192&a)!=128?(s--,He()):i.push((31&o)<<6|63&a)):o<240?s>=e-1?He():(a=t[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(n=t[s++]))!=128?(s--,He()):i.push((15&o)<<12|(63&a)<<6|63&n)):o<=244?s>=e-2?He():(a=t[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(n=t[s++]))!=128||(192&(r=t[s++]))!=128?(s--,He()):(o=(7&o)<<18|(63&a)<<12|(63&n)<<6|63&r,o-=65536,i.push(55296+(o>>10&1023),56320+(1023&o)))):He(),i.length>=8192&&(c=Aa(c,i),i.length=0)}s=Aa(c,i)}return s}function E1(t){const e=fe(t.g);return _1(t.g,e)}function Gn(t,e,i){var n=fe(t.g);for(n=t.g.g+n;t.g.g<n;)i.push(e(t.g))}var zn=[];function Yt(t,e,i){e.g?e.m(t,e.g,e.h,i):e.m(t,e.h,i)}var y=class{constructor(t,e){this.u=u1(t,e)}toJSON(){try{var t=d1(this)}finally{c1=void 0}return t}l(){var t=h0;return t.g?t.l(this,t.g,t.h):t.l(this,t.h,t.defaultValue)}clone(){const t=this.u;return new this.constructor(On(t,0|t[C],!1))}O(){return!!(2&(0|this.u[C]))}};function k1(t){return t?/^\d+$/.test(t)?(Dn(t),new Es(P,q)):null:Mh||=new Es(0,0)}y.prototype.W=Xi,y.prototype.toString=function(){return this.u.toString()};var Es=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Mh;function A1(t){return t?/^-?\d+$/.test(t)?(Dn(t),new ks(P,q)):null:Th||=new ks(0,0)}var ks=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Th;function gi(t,e,i){for(;i>0||e>127;)t.g.push(127&e|128),e=(e>>>7|i<<25)>>>0,i>>>=7;t.g.push(e)}function vi(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Zn(t,e){if(e>=0)vi(t,e);else{for(let i=0;i<9;i++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function nn(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function bi(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function Lt(t,e,i){vi(t.g,8*e+i)}function As(t,e){return Lt(t,e,2),e=t.g.end(),bi(t,e),e.push(t.h),e}function Ss(t,e){var i=e.pop();for(i=t.h+t.g.length()-i;i>127;)e.push(127&i|128),i>>>=7,t.h++;e.push(i),t.h++}function Wn(t,e,i){Lt(t,e,2),vi(t.g,i.length),bi(t,t.g.end()),bi(t,i)}function qn(t,e,i,n){i!=null&&(e=As(t,e),n(i,t),Ss(t,e))}function Kt(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Ls=Kt(),S1=Kt(),Ms=Kt(),Ts=Kt(),L1=Kt(),M1=Kt(),Is=Kt(),T1=Kt(),I1=Kt(),wi=class{constructor(t,e,i){this.g=t,this.h=e,t=Ls,this.l=!!t&&i===t||!1}};function Xn(t,e){return new wi(t,e,Ls)}function B1(t,e,i,n,r){qn(t,i,P1(e,n),r)}const Ih=Xn(function(t,e,i,n,r){return t.h===2&&(en(t,ms(e,n,i),r),!0)},B1),Bh=Xn(function(t,e,i,n,r){return t.h===2&&(en(t,ms(e,n,i),r),!0)},B1);var Yn=Symbol(),Bs=Symbol(),F1=Symbol(),D1=Symbol();let R1,$1;function We(t,e,i,n){var r=n[t];if(r)return r;(r={}).Ma=n,r.T=function(h){switch(typeof h){case"boolean":return l1||=[0,void 0,!0];case"number":return h>0?void 0:h===0?Ah||=[0,void 0]:[-h,void 0];case"string":return[0,h];case"object":return h}}(n[0]);var s=n[1];let o=1;s&&s.constructor===Object&&(r.ga=s,typeof(s=n[++o])=="function"&&(r.la=!0,R1??=s,$1??=n[o+1],s=n[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=n[++o]}for(c=1;s!==void 0;){let h;typeof s=="number"&&(c+=s,s=n[++o]);var l=void 0;if(s instanceof wi?h=s:(h=Ih,o--),h?.l){s=n[++o],l=n;var d=o;typeof s=="function"&&(s=s(),l[d]=s),l=s}for(d=c+1,typeof(s=n[++o])=="number"&&s<0&&(d-=s,s=n[++o]);c<d;c++){const u=a[c];l?i(r,c,h,l,u):e(r,c,h,u)}}return n[t]=r}function O1(t){return Array.isArray(t)?t[0]instanceof wi?t:[Bh,t]:[t,void 0]}function P1(t,e){return t instanceof y?t.u:Array.isArray(t)?Se(t,e,!1):void 0}function Fs(t,e,i,n){const r=i.g;t[e]=n?(s,o,a)=>r(s,o,a,n):r}function Ds(t,e,i,n,r){const s=i.g;let o,a;t[e]=(c,l,d)=>s(c,l,d,a||=We(Bs,Fs,Ds,n).T,o||=Rs(n),r)}function Rs(t){let e=t[F1];if(e!=null)return e;const i=We(Bs,Fs,Ds,t);return e=i.la?(n,r)=>R1(n,r,i):(n,r)=>{const s=0|n[C];for(;x1(r)&&r.h!=4;){var o=r.m,a=i[o];if(a==null){var c=i.ga;c&&(c=c[o])&&(c=Fh(c))!=null&&(a=i[o]=c)}a!=null&&a(r,n,o)||(o=(a=r).l,jn(a),a.fa?a=void 0:(c=a.g.g-o,a.g.g=o,a=_1(a.g,c)),o=n,a&&((c=o[ci])?c.push(a):o[ci]=[a]))}return 8192&s&&li(n),!0},t[F1]=e}function Fh(t){const e=(t=O1(t))[0].g;if(t=t[1]){const i=Rs(t),n=We(Bs,Fs,Ds,t).T;return(r,s,o)=>e(r,s,o,n,i)}return e}function Kn(t,e,i){t[e]=i.h}function Jn(t,e,i,n){let r,s;const o=i.h;t[e]=(a,c,l)=>o(a,c,l,s||=We(Yn,Kn,Jn,n).T,r||=N1(n))}function N1(t){let e=t[D1];if(!e){const i=We(Yn,Kn,Jn,t);e=(n,r)=>H1(n,r,i),t[D1]=e}return e}function H1(t,e,i){(function(n,r,s){const o=512&r?0:-1,a=n.length,c=a+((r=64&r?256&r:!!a&&In(n[a-1]))?-1:0);for(let l=0;l<c;l++)s(l-o,n[l]);if(r){n=n[a-1];for(const l in n)!isNaN(l)&&s(+l,n[l])}})(t,0|t[C]|(i.T[1]?512:0),(n,r)=>{if(r!=null){var s=function(o,a){var c=o[a];if(c)return c;if((c=o.ga)&&(c=c[a])){var l=(c=O1(c))[0].h;if(c=c[1]){const d=N1(c),h=We(Yn,Kn,Jn,c).T;c=o.la?$1(h,d):(u,p,f)=>l(u,p,f,h,d)}else c=l;return o[a]=c}}(i,n);s&&s(e,r,n)}}),(t=Xr(t))&&function(n,r){bi(n,n.g.end());for(let s=0;s<r.length;s++)bi(n,jr(r[s])||new Uint8Array(0))}(e,t)}function yi(t,e){if(Array.isArray(e)){var i=0|e[C];if(4&i)return e;for(var n=0,r=0;n<e.length;n++){const s=t(e[n]);s!=null&&(e[r++]=s)}return r<n&&(e.length=r),it(e,-6145&(5|i)),2&i&&Object.freeze(e),e}}function ft(t,e,i){return new wi(t,e,i)}function _i(t,e,i){return new wi(t,e,i)}function mt(t,e,i){Z(t,0|t[C],e,i)}var Dh=Xn(function(t,e,i,n,r){return t.h===2&&(t=en(t,Se([void 0,void 0],n,!0),r),xe(n=0|e[C]),(r=he(e,n,i))instanceof ee?(2&r.M)!=0?((r=r.da()).push(t),Z(e,n,i,r)):r.Ja(t):Array.isArray(r)?(2&(0|r[C])&&Z(e,n,i,r=f1(r)),r.push(t)):Z(e,n,i,[t]),!0)},function(t,e,i,n,r){if(e instanceof ee)e.forEach((s,o)=>{qn(t,i,Se([o,s],n,!1),r)});else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&qn(t,i,Se(o,n,!1),r)}});function U1(t,e,i){if(e=function(n){if(n==null)return n;const r=typeof n;if(r==="bigint")return String(Ki(64,n));if(Ji(n)){if(r==="string")return n1(n);if(r==="number")return es(n)}}(e),e!=null&&(typeof e=="string"&&A1(e),e!=null))switch(Lt(t,i,0),typeof e){case"number":t=t.g,je(e),gi(t,P,q);break;case"bigint":i=BigInt.asUintN(64,e),i=new ks(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),gi(t.g,i.h,i.g);break;default:i=A1(e),gi(t.g,i.h,i.g)}}function V1(t,e,i){(e=di(e))!=null&&e!=null&&(Lt(t,i,0),Zn(t.g,e))}function j1(t,e,i){(e=Ja(e))!=null&&(Lt(t,i,0),t.g.g.push(e?1:0))}function G1(t,e,i){(e=pi(e))!=null&&Wn(t,i,Sa(e))}function z1(t,e,i,n,r){qn(t,i,P1(e,n),r)}function Z1(t,e,i){e==null||typeof e=="string"||e instanceof le||(Ue(e)?Ue(e)&&zr(Ua):e=void 0),e!=null&&Wn(t,i,vs(e).buffer)}function W1(t,e,i){return(t.h===5||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,_s,e):e.push(_s(t.g)),!0)}var me=ft(function(t,e,i){if(t.h!==1)return!1;var n=t.g;t=ys(n);const r=ys(n);n=2*(r>>31)+1;const s=r>>>20&2047;return t=4294967296*(1048575&r)+t,mt(e,i,s==2047?t?NaN:n*(1/0):s==0?5e-324*n*t:n*Math.pow(2,s-1075)*(t+4503599627370496)),!0},function(t,e,i){(e=Ae(e))!=null&&(Lt(t,i,1),t=t.g,(i=qa||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),P=i.getUint32(0,!0),q=i.getUint32(4,!0),nn(t,P),nn(t,q))},Kt()),nt=ft(function(t,e,i){return t.h===5&&(mt(e,i,_s(t.g)),!0)},function(t,e,i){(e=Ae(e))!=null&&(Lt(t,i,5),t=t.g,Kr(e),nn(t,P))},Is),Rh=_i(W1,function(t,e,i){if((e=yi(Ae,e))!=null)for(let o=0;o<e.length;o++){var n=t,r=i,s=e[o];s!=null&&(Lt(n,r,5),n=n.g,Kr(s),nn(n,P))}},Is),$s=_i(W1,function(t,e,i){if((e=yi(Ae,e))!=null&&e.length){Lt(t,i,2),vi(t.g,4*e.length);for(let n=0;n<e.length;n++)i=t.g,Kr(e[n]),nn(i,P)}},Is),Te=ft(function(t,e,i){return t.h===0&&(mt(e,i,bs(t.g,Qr)),!0)},U1,M1),Os=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=bs(t.g,Qr))===0?void 0:t),!0)},U1,M1),$h=ft(function(t,e,i){return t.h===0&&(mt(e,i,bs(t.g,Jr)),!0)},function(t,e,i){if((e=gh(e))!=null&&(typeof e=="string"&&k1(e),e!=null))switch(Lt(t,i,0),typeof e){case"number":t=t.g,je(e),gi(t,P,q);break;case"bigint":i=BigInt.asUintN(64,e),i=new Es(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),gi(t.g,i.h,i.g);break;default:i=k1(e),gi(t.g,i.h,i.g)}},Kt()),X=ft(function(t,e,i){return t.h===0&&(mt(e,i,Me(t.g)),!0)},V1,Ts),Qn=_i(function(t,e,i){return(t.h===0||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,Me,e):e.push(Me(t.g)),!0)},function(t,e,i){if((e=yi(di,e))!=null&&e.length){i=As(t,i);for(let n=0;n<e.length;n++)Zn(t.g,e[n]);Ss(t,i)}},Ts),Ci=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=Me(t.g))===0?void 0:t),!0)},V1,Ts),j=ft(function(t,e,i){return t.h===0&&(mt(e,i,ws(t.g)),!0)},j1,S1),xi=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=ws(t.g))===!1?void 0:t),!0)},j1,S1),pt=_i(function(t,e,i){return t.h===2&&(t=xs(t),mi(e,0|e[C],i,!1).push(t),!0)},function(t,e,i){if((e=yi(pi,e))!=null)for(let o=0;o<e.length;o++){var n=t,r=i,s=e[o];s!=null&&Wn(n,r,Sa(s))}},Ms),Ie=ft(function(t,e,i){return t.h===2&&(mt(e,i,(t=xs(t))===""?void 0:t),!0)},G1,Ms),R=ft(function(t,e,i){return t.h===2&&(mt(e,i,xs(t)),!0)},G1,Ms),ot=function(t,e,i=Ls){return new wi(t,e,i)}(function(t,e,i,n,r){return t.h===2&&(n=Se(void 0,n,!0),mi(e,0|e[C],i,!0).push(n),en(t,n,r),!0)},function(t,e,i,n,r){if(Array.isArray(e))for(let s=0;s<e.length;s++)z1(t,e[s],i,n,r)}),$=Xn(function(t,e,i,n,r,s){return t.h===2&&(m1(e,0|e[C],s,i),en(t,e=ms(e,n,i),r),!0)},z1),q1=ft(function(t,e,i){return t.h===2&&(mt(e,i,E1(t)),!0)},Z1,T1),Oh=_i(function(t,e,i){return(t.h===0||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,fe,e):e.push(fe(t.g)),!0)},function(t,e,i){if((e=yi(Qa,e))!=null)for(let o=0;o<e.length;o++){var n=t,r=i,s=e[o];s!=null&&(Lt(n,r,0),vi(n.g,s))}},L1),Ph=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=fe(t.g))===0?void 0:t),!0)},function(t,e,i){(e=Qa(e))!=null&&e!=null&&(Lt(t,i,0),vi(t.g,e))},L1),Mt=ft(function(t,e,i){return t.h===0&&(mt(e,i,Me(t.g)),!0)},function(t,e,i){(e=di(e))!=null&&(e=parseInt(e,10),Lt(t,i,0),Zn(t.g,e))},I1);class Nh{constructor(e,i){this.h=e,this.g=i,this.l=I,this.m=E,this.defaultValue=void 0}register(){Sn(this)}}function Jt(t,e){return new Nh(t,e)}function Be(t,e){return(i,n)=>{if(zn.length){const s=zn.pop();s.o(n),Cs(s.g,i,n),i=s}else i=new class{constructor(s,o){if(C1.length){const a=C1.pop();Cs(a,s,o),s=a}else s=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,Cs(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(s,o);this.g=s,this.l=this.g.g,this.h=this.m=-1,this.o(o)}o({fa:s=!1}={}){this.fa=s}}(i,n);try{const s=new t,o=s.u;Rs(e)(o,i);var r=s}finally{i.g.clear(),i.m=-1,i.h=-1,zn.length<100&&zn.push(i)}return r}}function tr(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};H1(this.u,e,We(Yn,Kn,Jn,t)),bi(e,e.g.end());const i=new Uint8Array(e.h),n=e.l,r=n.length;let s=0;for(let o=0;o<r;o++){const a=n[o];i.set(a,s),s+=a.length}return e.l=[i],i}}var X1=class extends y{constructor(t){super(t)}},Y1=[0,Ie,ft(function(t,e,i){return t.h===2&&(mt(e,i,(t=E1(t))===Ve()?void 0:t),!0)},function(t,e,i){if(e!=null){if(e instanceof y){const n=e.Oa;return void(n&&(e=n(e),e!=null&&Wn(t,i,vs(e).buffer)))}if(Array.isArray(e))return}Z1(t,e,i)},T1)];let Ps,K1=globalThis.trustedTypes;function J1(t){Ps===void 0&&(Ps=function(){let i=null;if(!K1)return i;try{const n=r=>r;i=K1.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return i}());var e=Ps;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function Hh(t,...e){if(e.length===0)return J1(t[0]);let i=t[0];for(let n=0;n<e.length;n++)i+=encodeURIComponent(e[n])+t[n+1];return J1(i)}var Q1=[0,X,Mt,j,-1,Qn,Mt,-1],Uh=class extends y{constructor(t){super(t)}},tc=[0,j,R,j,Mt,-1,_i(function(t,e,i){return(t.h===0||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,Lh,e):e.push(Me(t.g)),!0)},function(t,e,i){if((e=yi(di,e))!=null&&e.length){i=As(t,i);for(let n=0;n<e.length;n++)Zn(t.g,e[n]);Ss(t,i)}},I1),R,-1,[0,j,-1],Mt,j,-1],ec=[0,R,-2],ic=class extends y{constructor(t){super(t)}},nc=[0],rc=[0,X,j,1,j,-3],Tt=class extends y{constructor(t){super(t,2)}},rt={};rt[336783863]=[0,R,j,-1,X,[0,[1,2,3,4,5,6,7,8,9],$,nc,$,tc,$,ec,$,rc,$,Q1,$,[0,R,-2],$,[0,R,Mt],$,[0,Mt,R,-1],$,[0,Mt,-1]],[0,R],j,[0,[1,3],[2,4],$,[0,Qn],-1,$,[0,pt],-1,ot,[0,R,-1]],R];var sc=[0,Os,-1,xi,-3,Os,Qn,Ie,Ci,Os,-1,xi,Ci,xi,-2,Ie];function It(t,e){ds(t,2,ui(e),"")}function H(t,e){Hn(t,3,e)}function T(t,e){Hn(t,4,e)}var gt=class extends y{constructor(t){super(t,500)}o(t){return E(this,0,7,t)}},rn=[-1,{}],oc=[0,R,1,rn],ac=[0,R,pt,rn];function Bt(t,e){Un(t,1,gt,e)}function U(t,e){Hn(t,10,e)}function B(t,e){Hn(t,15,e)}var Ct=class extends y{constructor(t){super(t,500)}o(t){return E(this,0,1001,t)}},cc=[-500,ot,[-500,Ie,-1,pt,-3,[-2,rt,j],ot,Y1,Ci,-1,oc,ac,ot,[0,Ie,xi],Ie,sc,Ci,pt,987,pt],4,ot,[-500,R,-1,[-1,{}],998,R],ot,[-500,R,pt,-1,[-2,{},j],997,pt,-1],Ci,ot,[-500,R,pt,rn,998,pt],pt,Ci,oc,ac,ot,[0,Ie,-1,rn],pt,-2,sc,Ie,-1,xi,[0,xi,Ph],978,rn,ot,Y1];Ct.prototype.g=tr(cc);var Vh=Be(Ct,cc),jh=class extends y{constructor(t){super(t)}},lc=class extends y{constructor(t){super(t)}g(){return ue(this,jh,1)}},hc=[0,ot,[0,X,nt,R,-1]],er=Be(lc,hc),Gh=class extends y{constructor(t){super(t)}},zh=class extends y{constructor(t){super(t)}},Ns=class extends y{constructor(t){super(t)}h(){return I(this,Gh,2)}g(){return ue(this,zh,5)}},dc=Be(class extends y{constructor(t){super(t)}},[0,pt,Qn,$s,[0,Mt,[0,X,-3],[0,nt,-3],[0,X,-1,[0,ot,[0,X,-2]]],ot,[0,nt,-1,R,nt]],R,-1,Te,ot,[0,X,nt],pt,Te]),uc=class extends y{constructor(t){super(t)}},Ei=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,nt,-4]]),pc=class extends y{constructor(t){super(t)}},sn=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,nt,-4]]),Zh=class extends y{constructor(t){super(t)}},Wh=[0,X,-1,$s,Mt],fc=class extends y{constructor(t){super(t)}};fc.prototype.g=tr([0,nt,-4,Te]);var qh=class extends y{constructor(t){super(t)}},Xh=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,1,X,R,hc],Te]),mc=class extends y{constructor(t){super(t)}},Yh=class extends y{constructor(t){super(t)}ma(){const t=p1(this);return t??Ve()}},Kh=class extends y{constructor(t){super(t)}},gc=[1,2],Jh=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,gc,$,[0,$s],$,[0,q1],X,R],Te]),Hs=class extends y{constructor(t){super(t)}},vc=[0,R,X,nt,pt,-1],bc=class extends y{constructor(t){super(t)}},Qh=[0,j,-1],wc=class extends y{constructor(t){super(t)}},ir=[1,2,3,4,5],nr=class extends y{constructor(t){super(t)}g(){return p1(this)!=null}h(){return Vt(this,2)!=null}},G=class extends y{constructor(t){super(t)}g(){return Ja(fi(this,2))??!1}},yc=[0,q1,R,[0,X,Te,-1],[0,$h,Te]],J=[0,yc,j,[0,ir,$,rc,$,tc,$,Q1,$,nc,$,ec],Mt],rr=class extends y{constructor(t){super(t)}},Us=[0,J,nt,-1,X],t0=Jt(502141897,rr);rt[502141897]=Us;var e0=Be(class extends y{constructor(t){super(t)}},[0,[0,Mt,-1,Rh,Oh],Wh]),_c=class extends y{constructor(t){super(t)}},Cc=class extends y{constructor(t){super(t)}},Vs=[0,J,nt,[0,J],j],xc=[0,J,Us,Vs,nt,[0,[0,yc]]],i0=Jt(508968150,Cc);rt[508968150]=xc,rt[508968149]=Vs;var Ec=class extends y{constructor(t){super(t)}},n0=Jt(513916220,Ec);rt[513916220]=[0,J,xc,X];var ki=class extends y{constructor(t){super(t)}h(){return I(this,Hs,2)}g(){N(this,2)}},kc=[0,J,vc];rt[478825465]=kc;var r0=class extends y{constructor(t){super(t)}},Ac=class extends y{constructor(t){super(t)}},js=class extends y{constructor(t){super(t)}},Gs=class extends y{constructor(t){super(t)}},Sc=class extends y{constructor(t){super(t)}},Lc=[0,J,[0,J],kc,-1],Mc=[0,J,nt,X],zs=[0,J,nt],Tc=[0,J,Mc,zs,nt],s0=Jt(479097054,Sc);rt[479097054]=[0,J,Tc,Lc],rt[463370452]=Lc,rt[464864288]=Mc;var o0=Jt(462713202,Gs);rt[462713202]=Tc,rt[474472470]=zs;var a0=class extends y{constructor(t){super(t)}},Ic=class extends y{constructor(t){super(t)}},Bc=class extends y{constructor(t){super(t)}},Fc=class extends y{constructor(t){super(t)}},Zs=[0,J,nt,-1,X],Ws=[0,J,nt,j];Fc.prototype.g=tr([0,J,zs,[0,J],Us,Vs,Zs,Ws]);var Dc=class extends y{constructor(t){super(t)}},c0=Jt(456383383,Dc);rt[456383383]=[0,J,vc];var Rc=class extends y{constructor(t){super(t)}},l0=Jt(476348187,Rc);rt[476348187]=[0,J,Qh];var $c=class extends y{constructor(t){super(t)}},Oc=class extends y{constructor(t){super(t)}},Pc=[0,Mt,-1],h0=Jt(458105876,class extends y{constructor(t){super(t)}g(){var t=this.u;const e=0|t[C],i=2&e;return t=function(n,r,s){var o=Oc;const a=2&r;let c=!1;if(s==null){if(a)return h1();s=[]}else if(s.constructor===ee){if((2&s.M)==0||a)return s;s=s.da()}else Array.isArray(s)?c=!!(2&(0|s[C])):s=[];if(a){if(!s.length)return h1();c||(c=!0,li(s))}else c&&(c=!1,s=f1(s));return c||(64&(0|s[C])?s[C]&=-33:32&r&&Mn(s,32)),Z(n,r,2,o=new ee(s,o,vh,void 0)),o}(t,e,he(t,e,2)),!i&&Oc&&(t.pa=!0),t}});rt[458105876]=[0,Pc,Dh,[!0,Te,[0,R,-1,pt]]];var qs=class extends y{constructor(t){super(t)}},Nc=Jt(458105758,qs);rt[458105758]=[0,J,R,Pc];var Hc=class extends y{constructor(t){super(t)}},d0=Jt(443442058,Hc);rt[443442058]=[0,J,R,X,nt,pt,-1,j,nt],rt[514774813]=Zs;var Uc=class extends y{constructor(t){super(t)}},u0=Jt(516587230,Uc);function Xs(t,e){return e=e?e.clone():new Hs,t.displayNamesLocale!==void 0?N(e,1,ui(t.displayNamesLocale)):t.displayNamesLocale===void 0&&N(e,1),t.maxResults!==void 0?ie(e,2,t.maxResults):"maxResults"in t&&N(e,2),t.scoreThreshold!==void 0?_(e,3,t.scoreThreshold):"scoreThreshold"in t&&N(e,3),t.categoryAllowlist!==void 0?Vn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&N(e,4),t.categoryDenylist!==void 0?Vn(e,5,t.categoryDenylist):"categoryDenylist"in t&&N(e,5),e}function Ys(t,e=-1,i=""){return{categories:t.map(n=>({index:Ut(n,1)??0??-1,score:K(n,2)??0,categoryName:Vt(n,3)??""??"",displayName:Vt(n,4)??""??""})),headIndex:e,headName:i}}function Vc(t){var e=ze(t,3,Ae,Ge()),i=ze(t,2,di,Ge()),n=ze(t,1,pi,Ge()),r=ze(t,9,pi,Ge());const s={categories:[],keypoints:[]};for(let o=0;o<e.length;o++)s.categories.push({score:e[o],index:i[o]??-1,categoryName:n[o]??"",displayName:r[o]??""});if((e=I(t,Ns,4)?.h())&&(s.boundingBox={originX:Ut(e,1)??0,originY:Ut(e,2)??0,width:Ut(e,3)??0,height:Ut(e,4)??0,angle:0}),I(t,Ns,4)?.g().length)for(const o of I(t,Ns,4).g())s.keypoints.push({x:Nn(o,1)??0,y:Nn(o,2)??0,score:Nn(o,4)??0,label:Vt(o,3)??""});return s}function sr(t){const e=[];for(const i of ue(t,pc,1))e.push({x:K(i,1)??0,y:K(i,2)??0,z:K(i,3)??0,visibility:K(i,4)??0});return e}function on(t){const e=[];for(const i of ue(t,uc,1))e.push({x:K(i,1)??0,y:K(i,2)??0,z:K(i,3)??0,visibility:K(i,4)??0});return e}function jc(t){return Array.from(t,e=>e>127?e-256:e)}function Gc(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let i=0,n=0,r=0;for(let s=0;s<t.length;s++)i+=t[s]*e[s],n+=t[s]*t[s],r+=e[s]*e[s];if(n<=0||r<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(n*r)}let or;rt[516587230]=[0,J,Zs,Ws,nt],rt[518928384]=Ws;const p0=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function zc(){if(or===void 0)try{await WebAssembly.instantiate(p0),or=!0}catch{or=!1}return or}async function an(t,e=Hh``){const i=await zc()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${i}.js`,wasmBinaryPath:`${e}/${t}_${i}.wasm`}}var qe=class{};function Zc(){var t=navigator;return typeof OffscreenCanvas<"u"&&(!function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function Wc(t){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((i,n)=>{e.addEventListener("load",()=>{i()},!1),e.addEventListener("error",r=>{n(r)},!1),document.body.appendChild(e)})}importScripts(t.toString())}function qc(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function x(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Xc(t,e,i){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(i?t.i._bindTextureToStream(i):t.i._bindTextureToCanvas(),!(i=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[n,r]=qc(e);return!t.l||n===t.i.canvas.width&&r===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=r),[n,r]}function Yc(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),i(e);for(const r of n)t.i._free(r);t.i._free(e)}function ne(t,e,i){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=i}function Fe(t,e,i){let n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(r,s,o)=>{s?(i(n,o),n=[]):n.push(r)}}qe.forVisionTasks=function(t){return an("vision",t)},qe.forTextTasks=function(t){return an("text",t)},qe.forGenAiExperimentalTasks=function(t){return an("genai_experimental",t)},qe.forGenAiTasks=function(t){return an("genai",t)},qe.forAudioTasks=function(t){return an("audio",t)},qe.isSimdSupported=function(){return zc()};async function f0(t,e,i,n){return t=await(async(r,s,o,a,c)=>{if(s&&await Wc(s),!self.ModuleFactory||o&&(await Wc(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((s=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new r(c,a)})(t,i.wasmLoaderPath,i.assetLoaderPath,e,{locateFile:r=>r.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&r.endsWith(".data")?i.assetBinaryPath.toString():r}),await t.o(n),t}function Ks(t,e){const i=I(t.baseOptions,nr,1)||new nr;typeof e=="string"?(N(i,2,ui(e)),N(i,1)):e instanceof Uint8Array&&(N(i,1,qr(e,!1)),N(i,2)),E(t.baseOptions,0,1,i)}function Kc(t){try{const e=t.G.length;if(e===1)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map(i=>i.message).join(", "))}finally{t.G=[]}}function w(t,e){t.B=Math.max(t.B,e)}function ar(t,e){t.A=new gt,It(t.A,"PassThroughCalculator"),H(t.A,"free_memory"),T(t.A,"free_memory_unused_out"),U(e,"free_memory"),Bt(e,t.A)}function Ai(t,e){H(t.A,e),T(t.A,e+"_unused_out")}function cr(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var Js=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const i=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(I(this.baseOptions,nr,1)?.g()||I(this.baseOptions,nr,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(n,r){let s=I(n.baseOptions,wc,3);if(!s){var o=s=new wc,a=new ic;Qi(o,4,ir,a)}"delegate"in r&&(r.delegate==="GPU"?(r=s,o=new Uh,Qi(r,2,ir,o)):(r=s,o=new ic,Qi(r,4,ir,o))),E(n.baseOptions,0,3,s)}(this,i),i.modelAssetPath)return fetch(i.modelAssetPath.toString()).then(n=>{if(n.ok)return n.arrayBuffer();throw Error(`Failed to fetch model: ${i.modelAssetPath} (${n.status})`)}).then(n=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(n),!0,!1,!1),Ks(this,"/model.dat"),this.m(),this.J()});if(i.modelAssetBuffer instanceof Uint8Array)Ks(this,i.modelAssetBuffer);else if(i.modelAssetBuffer)return async function(n){const r=[];for(var s=0;;){const{done:o,value:a}=await n.read();if(o)break;r.push(a),s+=a.length}if(r.length===0)return new Uint8Array(0);if(r.length===1)return r[0];n=new Uint8Array(s),s=0;for(const o of r)n.set(o,s),s+=o.length;return n}(i.modelAssetBuffer).then(n=>{Ks(this,n),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let t;if(this.g.ca(e=>{t=Vh(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((i,n)=>{this.G.push(Error(n))}),this.g.Ha(),this.g.setGraph(t,e),this.A=void 0,Kc(this)}finishProcessing(){this.g.finishProcessing(),Kc(this)}close(){this.A=void 0,this.g.closeGraph()}};function vt(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Js.prototype.close=Js.prototype.close;class m0{constructor(e,i,n,r){this.g=e,this.h=i,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Jc(t,e,i){const n=t.g;if(i=vt(n.createShader(i),"Failed to create WebGL shader"),n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(i)}`);return n.attachShader(t.h,i),i}function Qc(t,e){const i=t.g,n=vt(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(n);const r=vt(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,r),i.enableVertexAttribArray(t.P),i.vertexAttribPointer(t.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const s=vt(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,s),i.enableVertexAttribArray(t.J),i.vertexAttribPointer(t.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new m0(i,n,r,s)}function Qs(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function cn(t,e,i,n){return Qs(t,e),t.h||(t.m(),t.C()),i?(t.s||(t.s=Qc(t,!0)),i=t.s):(t.v||(t.v=Qc(t,!1)),i=t.v),e.useProgram(t.h),i.bind(),t.l(),t=n(),i.g.bindVertexArray(null),t}function De(t,e,i){return Qs(t,e),t=vt(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function lr(t,e,i){Qs(t,e),t.A||(t.A=vt(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0)}function to(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var Si=class{G(){return`
|
|
3141
|
+
*/var m5=g5("outline","loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function Tc(){return(Tc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t}).apply(this,arguments)}var v5=["context","children"];function _5(t){this.getChildContext=function(){return t.context};var e=t.children,i=function(s,o){if(s==null)return{};var c,l,u={},h=Object.keys(s);for(l=0;l<h.length;l++)o.indexOf(c=h[l])>=0||(u[c]=s[c]);return u}(t,v5);return f2(e,i)}function w5(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=Qi(_5,Tc({},this._props,{context:t.detail.context}),function e(i,s){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var o=[],c={},l=0,u=i.attributes,h=i.childNodes;for(l=u.length;l--;)u[l].name!=="slot"&&(c[u[l].name]=u[l].value,c[A2(u[l].name)]=u[l].value);for(l=h.length;l--;){var f=e(h[l],null),_=h[l].slot;_?c[_]=Qi(S2,{name:_},f):o[l]=f}var m=s?Qi(S2,null,o):o;return Qi(s||i.nodeName.toLowerCase(),c,m)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?d2:Eo)(this._vdom,this._root)}function A2(t){return t.replace(/-(\w)/g,function(e,i){return i?i.toUpperCase():""})}function b5(t,e,i){if(this._vdom){var s={};s[t]=i=i==null?void 0:i,s[A2(t)]=i,this._vdom=f2(this._vdom,s),Eo(this._vdom,this._root)}}function y5(){Eo(this._vdom=null,this._root)}function S2(t,e){var i=this;return Qi("slot",Tc({},t,{ref:function(s){s?(i.ref=s,i._listener||(i._listener=function(o){o.stopPropagation(),o.detail.context=e},s.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function k2(t,e,i,s){function o(){var c=Reflect.construct(HTMLElement,[],o);return c._vdomComponent=t,c._root=s&&s.shadow?c.attachShadow({mode:s.mode||"open"}):c,c}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=w5,o.prototype.attributeChangedCallback=b5,o.prototype.disconnectedCallback=y5,i=i||t.observedAttributes||Object.keys(t.propTypes||{}),o.observedAttributes=i,i.forEach(function(c){Object.defineProperty(o.prototype,c,{get:function(){return this._vdom.props[c]},set:function(l){this._vdom?this.attributeChangedCallback(c,null,l):(this._props||(this._props={}),this._props[c]=l,this.connectedCallback());var u=typeof l;l!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(c,l)}})}),customElements.define(e||t.tagName||t.displayName||t.name,o)}const Lr=(t,e=!1)=>typeof t=="boolean"?t:typeof t=="string"?t==="true"||t==="":e;var C5=Symbol.for("preact-signals");function Lo(){if(En>1)En--;else{for(var t,e=!1;Is!==void 0;){var i=Is;for(Is=void 0,Ic++;i!==void 0;){var s=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&I2(i))try{i.c()}catch(o){e||(t=o,e=!0)}i=s}}if(Ic=0,En--,e)throw t}}function x5(t){if(En>0)return t();En++;try{return t()}finally{Lo()}}var bt=void 0;function L2(t){var e=bt;bt=void 0;try{return t()}finally{bt=e}}var Is=void 0,En=0,Ic=0,Mo=0;function M2(t){if(bt!==void 0){var e=t.n;if(e===void 0||e.t!==bt)return e={i:0,S:t,p:bt.s,n:void 0,t:bt,e:void 0,x:void 0,r:e},bt.s!==void 0&&(bt.s.n=e),bt.s=e,t.n=e,32&bt.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=bt.s,e.n=void 0,bt.s.n=e,bt.s=e),e}}function ue(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched}ue.prototype.brand=C5,ue.prototype.h=function(){return!0},ue.prototype.S=function(t){var e=this,i=this.t;i!==t&&t.e===void 0&&(t.x=i,this.t=t,i!==void 0?i.e=t:L2(function(){var s;(s=e.W)==null||s.call(e)}))},ue.prototype.U=function(t){var e=this;if(this.t!==void 0){var i=t.e,s=t.x;i!==void 0&&(i.x=s,t.e=void 0),s!==void 0&&(s.e=i,t.x=void 0),t===this.t&&(this.t=s,s===void 0&&L2(function(){var o;(o=e.Z)==null||o.call(e)}))}},ue.prototype.subscribe=function(t){var e=this;return Fs(function(){var i=e.value,s=bt;bt=void 0;try{t(i)}finally{bt=s}})},ue.prototype.valueOf=function(){return this.value},ue.prototype.toString=function(){return this.value+""},ue.prototype.toJSON=function(){return this.value},ue.prototype.peek=function(){var t=bt;bt=void 0;try{return this.value}finally{bt=t}},Object.defineProperty(ue.prototype,"value",{get:function(){var t=M2(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Ic>100)throw new Error("Cycle detected");this.v=t,this.i++,Mo++,En++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Lo()}}}});function T2(t,e){return new ue(t,e)}function I2(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function F2(t){for(var e=t.s;e!==void 0;e=e.n){var i=e.S.n;if(i!==void 0&&(e.r=i),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function B2(t){for(var e=t.s,i=void 0;e!==void 0;){var s=e.p;e.i===-1?(e.S.U(e),s!==void 0&&(s.n=e.n),e.n!==void 0&&(e.n.p=s)):i=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=s}t.s=i}function tr(t,e){ue.call(this,void 0),this.x=t,this.s=void 0,this.g=Mo-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched}tr.prototype=new ue,tr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Mo))return!0;if(this.g=Mo,this.f|=1,this.i>0&&!I2(this))return this.f&=-2,!0;var t=bt;try{F2(this),bt=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return bt=t,B2(this),this.f&=-2,!0},tr.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ue.prototype.S.call(this,t)},tr.prototype.U=function(t){if(this.t!==void 0&&(ue.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},tr.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(tr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=M2(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Fc(t,e){return new tr(t,e)}function R2(t){var e=t.u;if(t.u=void 0,typeof e=="function"){En++;var i=bt;bt=void 0;try{e()}catch(s){throw t.f&=-2,t.f|=8,Bc(t),s}finally{bt=i,Lo()}}}function Bc(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,R2(t)}function E5(t){if(bt!==this)throw new Error("Out-of-order effect");B2(this),bt=t,this.f&=-2,8&this.f&&Bc(this),Lo()}function Mr(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Mr.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}},Mr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,R2(this),F2(this),En++;var t=bt;return bt=this,E5.bind(this,t)},Mr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Is,Is=this)},Mr.prototype.d=function(){this.f|=8,1&this.f||Bc(this)},Mr.prototype.dispose=function(){this.d()};function Fs(t){var e=new Mr(t);try{e.c()}catch(s){throw e.d(),s}var i=e.d.bind(e);return i[Symbol.dispose]=i,i}var D2,To,Rc,O2=[];Fs(function(){D2=this.N})();function Tr(t,e){wt[t]=e.bind(null,wt[t]||function(){})}function Io(t){Rc&&Rc(),Rc=t&&t.S()}function P2(t){var e=this,i=t.data,s=Gt(i);s.value=i;var o=So(function(){for(var u=e,h=e.__v;h=h.__;)if(h.__c){h.__c.__$f|=4;break}var f=Fc(function(){var E=s.value.value;return E===0?0:E===!0?"":E||""}),_=Fc(function(){return!Array.isArray(f.value)&&!Ku(f.value)}),m=Fs(function(){if(this.N=U2,_.value){var E=f.value;u.__v&&u.__v.__e&&u.__v.__e.nodeType===3&&(u.__v.__e.data=E)}}),b=e.__$u.d;return e.__$u.d=function(){m(),b.call(this)},[_,f]},[]),c=o[0],l=o[1];return c.value?l.peek():l.value}P2.displayName="_st",Object.defineProperties(ue.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:P2},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Tr("__b",function(t,e){if(typeof e.type=="string"){var i,s=e.props;for(var o in s)if(o!=="children"){var c=s[o];c instanceof ue&&(i||(e.__np=i={}),i[o]=c,s[o]=c.peek())}}t(e)}),Tr("__r",function(t,e){if(e.type!==xn){Io();var i,s=e.__c;s&&(s.__$f&=-2,(i=s.__$u)===void 0&&(s.__$u=i=function(o){var c;return Fs(function(){c=this}),c.c=function(){s.__$f|=1,s.setState({})},c}())),To=s,Io(i)}t(e)}),Tr("__e",function(t,e,i,s){Io(),To=void 0,t(e,i,s)}),Tr("diffed",function(t,e){Io(),To=void 0;var i;if(typeof e.type=="string"&&(i=e.__e)){var s=e.__np,o=e.props;if(s){var c=i.U;if(c)for(var l in c){var u=c[l];u!==void 0&&!(l in s)&&(u.d(),c[l]=void 0)}else c={},i.U=c;for(var h in s){var f=c[h],_=s[h];f===void 0?(f=A5(i,h,_,o),c[h]=f):f.o(_,o)}}}t(e)});function A5(t,e,i,s){var o=e in t&&t.ownerSVGElement===void 0,c=T2(i);return{o:function(l,u){c.value=l,s=u},d:Fs(function(){this.N=U2;var l=c.value.value;s[e]!==l&&(s[e]=l,o?t[e]=l:l?t.setAttribute(e,l):t.removeAttribute(e))})}}Tr("unmount",function(t,e){if(typeof e.type=="string"){var i=e.__e;if(i){var s=i.U;if(s){i.U=void 0;for(var o in s){var c=s[o];c&&c.d()}}}}else{var l=e.__c;if(l){var u=l.__$u;u&&(l.__$u=void 0,u.d())}}t(e)}),Tr("__h",function(t,e,i,s){(s<3||s===9)&&(e.__$f|=2),t(e,i,s)}),Ms.prototype.shouldComponentUpdate=function(t,e){var i=this.__$u,s=i&&i.s!==void 0;for(var o in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var c=2&this.__$f;if(!(s||c||4&this.__$f)||1&this.__$f)return!0}else if(!(s||4&this.__$f)||3&this.__$f)return!0;for(var l in t)if(l!=="__source"&&t[l]!==this.props[l])return!0;for(var u in this.props)if(!(u in t))return!0;return!1};function Gt(t,e){return So(function(){return T2(t,e)},[])}function Dc(t,e){var i=pe(t);return i.current=t,To.__$f|=4,So(function(){return Fc(function(){return i.current()},e)},[])}var S5=function(t){queueMicrotask(function(){queueMicrotask(t)})};function k5(){x5(function(){for(var t;t=O2.shift();)D2.call(t)})}function U2(){O2.push(this)===1&&(wt.requestAnimationFrame||S5)(k5)}var Bs={exports:{}};/**
|
|
3142
|
+
* @license
|
|
3143
|
+
* Lodash <https://lodash.com/>
|
|
3144
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
3145
|
+
* Released under MIT license <https://lodash.com/license>
|
|
3146
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
3147
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
3148
|
+
*/var L5=Bs.exports,$2;function M5(){return $2||($2=1,function(t,e){(function(){var i,s="4.17.21",o=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,_="__lodash_placeholder__",m=1,b=2,E=4,A=1,k=2,F=1,M=2,D=4,R=8,$=16,X=32,N=64,vt=128,J=256,pt=512,kt=30,Zt="...",ne=800,Ii=16,Ae=1,he=2,Se=3,ur=1/0,ei=9007199254740991,ka=17976931348623157e292,rs=NaN,Pe=4294967295,ke=Pe-1,b1=Pe>>>1,y1=[["ary",vt],["bind",F],["bindKey",M],["curry",R],["curryRight",$],["flip",pt],["partial",X],["partialRight",N],["rearg",J]],Un="[object Arguments]",ss="[object Array]",to="[object AsyncFunction]",hn="[object Boolean]",hr="[object Date]",C1="[object DOMException]",dn="[object Error]",Wi="[object Function]",eo="[object GeneratorFunction]",Ue="[object Map]",os="[object Number]",e3="[object Null]",Zi="[object Object]",x1="[object Promise]",i3="[object Proxy]",lt="[object RegExp]",xt="[object Set]",me="[object String]",$n="[object Symbol]",Le="[object Undefined]",Nn="[object WeakMap]",La="[object WeakSet]",$e="[object ArrayBuffer]",Ne="[object DataView]",qi="[object Float32Array]",dr="[object Float64Array]",Hn="[object Int8Array]",Vn="[object Int16Array]",ji="[object Int32Array]",io="[object Uint8Array]",no="[object Uint8ClampedArray]",fr="[object Uint16Array]",E1="[object Uint32Array]",F6=/\b__p \+= '';/g,B6=/\b(__p \+=) '' \+/g,R6=/(__e\(.*?\)|\b__t\)) \+\n'';/g,n3=/&(?:amp|lt|gt|quot|#39);/g,r3=/[&<>"']/g,D6=RegExp(n3.source),O6=RegExp(r3.source),P6=/<%-([\s\S]+?)%>/g,U6=/<%([\s\S]+?)%>/g,s3=/<%=([\s\S]+?)%>/g,$6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N6=/^\w*$/,H6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A1=/[\\^$.*+?()[\]{}|]/g,V6=RegExp(A1.source),S1=/^\s+/,G6=/\s/,z6=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W6=/\{\n\/\* \[wrapped with (.+)\] \*/,Z6=/,? & /,q6=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,j6=/[()=,{}\[\]\/\s]/,X6=/\\(\\)?/g,K6=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,o3=/\w*$/,Y6=/^[-+]0x[0-9a-f]+$/i,J6=/^0b[01]+$/i,Q6=/^\[object .+?Constructor\]$/,t7=/^0o[0-7]+$/i,e7=/^(?:0|[1-9]\d*)$/,i7=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ma=/($^)/,n7=/['\n\r\u2028\u2029\\]/g,Ta="\\ud800-\\udfff",r7="\\u0300-\\u036f",s7="\\ufe20-\\ufe2f",o7="\\u20d0-\\u20ff",a3=r7+s7+o7,c3="\\u2700-\\u27bf",l3="a-z\\xdf-\\xf6\\xf8-\\xff",a7="\\xac\\xb1\\xd7\\xf7",c7="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",l7="\\u2000-\\u206f",u7=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",u3="A-Z\\xc0-\\xd6\\xd8-\\xde",h3="\\ufe0e\\ufe0f",d3=a7+c7+l7+u7,k1="['’]",h7="["+Ta+"]",f3="["+d3+"]",Ia="["+a3+"]",p3="\\d+",d7="["+c3+"]",g3="["+l3+"]",m3="[^"+Ta+d3+p3+c3+l3+u3+"]",L1="\\ud83c[\\udffb-\\udfff]",f7="(?:"+Ia+"|"+L1+")",v3="[^"+Ta+"]",M1="(?:\\ud83c[\\udde6-\\uddff]){2}",T1="[\\ud800-\\udbff][\\udc00-\\udfff]",as="["+u3+"]",_3="\\u200d",w3="(?:"+g3+"|"+m3+")",p7="(?:"+as+"|"+m3+")",b3="(?:"+k1+"(?:d|ll|m|re|s|t|ve))?",y3="(?:"+k1+"(?:D|LL|M|RE|S|T|VE))?",C3=f7+"?",x3="["+h3+"]?",g7="(?:"+_3+"(?:"+[v3,M1,T1].join("|")+")"+x3+C3+")*",m7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",v7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",E3=x3+C3+g7,_7="(?:"+[d7,M1,T1].join("|")+")"+E3,w7="(?:"+[v3+Ia+"?",Ia,M1,T1,h7].join("|")+")",b7=RegExp(k1,"g"),y7=RegExp(Ia,"g"),I1=RegExp(L1+"(?="+L1+")|"+w7+E3,"g"),C7=RegExp([as+"?"+g3+"+"+b3+"(?="+[f3,as,"$"].join("|")+")",p7+"+"+y3+"(?="+[f3,as+w3,"$"].join("|")+")",as+"?"+w3+"+"+b3,as+"+"+y3,v7,m7,p3,_7].join("|"),"g"),x7=RegExp("["+_3+Ta+a3+h3+"]"),E7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,A7=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],S7=-1,Rt={};Rt[qi]=Rt[dr]=Rt[Hn]=Rt[Vn]=Rt[ji]=Rt[io]=Rt[no]=Rt[fr]=Rt[E1]=!0,Rt[Un]=Rt[ss]=Rt[$e]=Rt[hn]=Rt[Ne]=Rt[hr]=Rt[dn]=Rt[Wi]=Rt[Ue]=Rt[os]=Rt[Zi]=Rt[lt]=Rt[xt]=Rt[me]=Rt[Nn]=!1;var It={};It[Un]=It[ss]=It[$e]=It[Ne]=It[hn]=It[hr]=It[qi]=It[dr]=It[Hn]=It[Vn]=It[ji]=It[Ue]=It[os]=It[Zi]=It[lt]=It[xt]=It[me]=It[$n]=It[io]=It[no]=It[fr]=It[E1]=!0,It[dn]=It[Wi]=It[Nn]=!1;var k7={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},L7={"&":"&","<":"<",">":">",'"':""","'":"'"},M7={"&":"&","<":"<",">":">",""":'"',"'":"'"},T7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I7=parseFloat,F7=parseInt,A3=typeof yo=="object"&&yo&&yo.Object===Object&&yo,B7=typeof self=="object"&&self&&self.Object===Object&&self,de=A3||B7||Function("return this")(),F1=e&&!e.nodeType&&e,pr=F1&&!0&&t&&!t.nodeType&&t,S3=pr&&pr.exports===F1,B1=S3&&A3.process,vi=function(){try{var C=pr&&pr.require&&pr.require("util").types;return C||B1&&B1.binding&&B1.binding("util")}catch(L){}}(),k3=vi&&vi.isArrayBuffer,L3=vi&&vi.isDate,M3=vi&&vi.isMap,T3=vi&&vi.isRegExp,I3=vi&&vi.isSet,F3=vi&&vi.isTypedArray;function ii(C,L,S){switch(S.length){case 0:return C.call(L);case 1:return C.call(L,S[0]);case 2:return C.call(L,S[0],S[1]);case 3:return C.call(L,S[0],S[1],S[2])}return C.apply(L,S)}function R7(C,L,S,P){for(var Q=-1,_t=C==null?0:C.length;++Q<_t;){var oe=C[Q];L(P,oe,S(oe),C)}return P}function _i(C,L){for(var S=-1,P=C==null?0:C.length;++S<P&&L(C[S],S,C)!==!1;);return C}function D7(C,L){for(var S=C==null?0:C.length;S--&&L(C[S],S,C)!==!1;);return C}function B3(C,L){for(var S=-1,P=C==null?0:C.length;++S<P;)if(!L(C[S],S,C))return!1;return!0}function Gn(C,L){for(var S=-1,P=C==null?0:C.length,Q=0,_t=[];++S<P;){var oe=C[S];L(oe,S,C)&&(_t[Q++]=oe)}return _t}function Fa(C,L){var S=C==null?0:C.length;return!!S&&cs(C,L,0)>-1}function R1(C,L,S){for(var P=-1,Q=C==null?0:C.length;++P<Q;)if(S(L,C[P]))return!0;return!1}function $t(C,L){for(var S=-1,P=C==null?0:C.length,Q=Array(P);++S<P;)Q[S]=L(C[S],S,C);return Q}function zn(C,L){for(var S=-1,P=L.length,Q=C.length;++S<P;)C[Q+S]=L[S];return C}function D1(C,L,S,P){var Q=-1,_t=C==null?0:C.length;for(P&&_t&&(S=C[++Q]);++Q<_t;)S=L(S,C[Q],Q,C);return S}function O7(C,L,S,P){var Q=C==null?0:C.length;for(P&&Q&&(S=C[--Q]);Q--;)S=L(S,C[Q],Q,C);return S}function O1(C,L){for(var S=-1,P=C==null?0:C.length;++S<P;)if(L(C[S],S,C))return!0;return!1}var P7=P1("length");function U7(C){return C.split("")}function $7(C){return C.match(q6)||[]}function R3(C,L,S){var P;return S(C,function(Q,_t,oe){if(L(Q,_t,oe))return P=_t,!1}),P}function Ba(C,L,S,P){for(var Q=C.length,_t=S+(P?1:-1);P?_t--:++_t<Q;)if(L(C[_t],_t,C))return _t;return-1}function cs(C,L,S){return L===L?Y7(C,L,S):Ba(C,D3,S)}function N7(C,L,S,P){for(var Q=S-1,_t=C.length;++Q<_t;)if(P(C[Q],L))return Q;return-1}function D3(C){return C!==C}function O3(C,L){var S=C==null?0:C.length;return S?$1(C,L)/S:rs}function P1(C){return function(L){return L==null?i:L[C]}}function U1(C){return function(L){return C==null?i:C[L]}}function P3(C,L,S,P,Q){return Q(C,function(_t,oe,Lt){S=P?(P=!1,_t):L(S,_t,oe,Lt)}),S}function H7(C,L){var S=C.length;for(C.sort(L);S--;)C[S]=C[S].value;return C}function $1(C,L){for(var S,P=-1,Q=C.length;++P<Q;){var _t=L(C[P]);_t!==i&&(S=S===i?_t:S+_t)}return S}function N1(C,L){for(var S=-1,P=Array(C);++S<C;)P[S]=L(S);return P}function V7(C,L){return $t(L,function(S){return[S,C[S]]})}function U3(C){return C&&C.slice(0,V3(C)+1).replace(S1,"")}function ni(C){return function(L){return C(L)}}function H1(C,L){return $t(L,function(S){return C[S]})}function ro(C,L){return C.has(L)}function $3(C,L){for(var S=-1,P=C.length;++S<P&&cs(L,C[S],0)>-1;);return S}function N3(C,L){for(var S=C.length;S--&&cs(L,C[S],0)>-1;);return S}function G7(C,L){for(var S=C.length,P=0;S--;)C[S]===L&&++P;return P}var z7=U1(k7),W7=U1(L7);function Z7(C){return"\\"+T7[C]}function q7(C,L){return C==null?i:C[L]}function ls(C){return x7.test(C)}function j7(C){return E7.test(C)}function X7(C){for(var L,S=[];!(L=C.next()).done;)S.push(L.value);return S}function V1(C){var L=-1,S=Array(C.size);return C.forEach(function(P,Q){S[++L]=[Q,P]}),S}function H3(C,L){return function(S){return C(L(S))}}function Wn(C,L){for(var S=-1,P=C.length,Q=0,_t=[];++S<P;){var oe=C[S];(oe===L||oe===_)&&(C[S]=_,_t[Q++]=S)}return _t}function Ra(C){var L=-1,S=Array(C.size);return C.forEach(function(P){S[++L]=P}),S}function K7(C){var L=-1,S=Array(C.size);return C.forEach(function(P){S[++L]=[P,P]}),S}function Y7(C,L,S){for(var P=S-1,Q=C.length;++P<Q;)if(C[P]===L)return P;return-1}function J7(C,L,S){for(var P=S+1;P--;)if(C[P]===L)return P;return P}function us(C){return ls(C)?t8(C):P7(C)}function Fi(C){return ls(C)?e8(C):U7(C)}function V3(C){for(var L=C.length;L--&&G6.test(C.charAt(L)););return L}var Q7=U1(M7);function t8(C){for(var L=I1.lastIndex=0;I1.test(C);)++L;return L}function e8(C){return C.match(I1)||[]}function i8(C){return C.match(C7)||[]}var n8=function C(L){L=L==null?de:hs.defaults(de.Object(),L,hs.pick(de,A7));var S=L.Array,P=L.Date,Q=L.Error,_t=L.Function,oe=L.Math,Lt=L.Object,G1=L.RegExp,r8=L.String,wi=L.TypeError,Da=S.prototype,s8=_t.prototype,ds=Lt.prototype,Oa=L["__core-js_shared__"],Pa=s8.toString,At=ds.hasOwnProperty,o8=0,G3=function(){var n=/[^.]+$/.exec(Oa&&Oa.keys&&Oa.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),Ua=ds.toString,a8=Pa.call(Lt),c8=de._,l8=G1("^"+Pa.call(At).replace(A1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$a=S3?L.Buffer:i,Zn=L.Symbol,Na=L.Uint8Array,z3=$a?$a.allocUnsafe:i,Ha=H3(Lt.getPrototypeOf,Lt),W3=Lt.create,Z3=ds.propertyIsEnumerable,Va=Da.splice,q3=Zn?Zn.isConcatSpreadable:i,so=Zn?Zn.iterator:i,gr=Zn?Zn.toStringTag:i,Ga=function(){try{var n=br(Lt,"defineProperty");return n({},"",{}),n}catch(r){}}(),u8=L.clearTimeout!==de.clearTimeout&&L.clearTimeout,h8=P&&P.now!==de.Date.now&&P.now,d8=L.setTimeout!==de.setTimeout&&L.setTimeout,za=oe.ceil,Wa=oe.floor,z1=Lt.getOwnPropertySymbols,f8=$a?$a.isBuffer:i,j3=L.isFinite,p8=Da.join,g8=H3(Lt.keys,Lt),ae=oe.max,ve=oe.min,m8=P.now,v8=L.parseInt,X3=oe.random,_8=Da.reverse,W1=br(L,"DataView"),oo=br(L,"Map"),Z1=br(L,"Promise"),fs=br(L,"Set"),ao=br(L,"WeakMap"),co=br(Lt,"create"),Za=ao&&new ao,ps={},w8=yr(W1),b8=yr(oo),y8=yr(Z1),C8=yr(fs),x8=yr(ao),qa=Zn?Zn.prototype:i,lo=qa?qa.valueOf:i,K3=qa?qa.toString:i;function g(n){if(qt(n)&&!tt(n)&&!(n instanceof ut)){if(n instanceof bi)return n;if(At.call(n,"__wrapped__"))return Jf(n)}return new bi(n)}var gs=function(){function n(){}return function(r){if(!Vt(r))return{};if(W3)return W3(r);n.prototype=r;var a=new n;return n.prototype=i,a}}();function ja(){}function bi(n,r){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=i}g.templateSettings={escape:P6,evaluate:U6,interpolate:s3,variable:"",imports:{_:g}},g.prototype=ja.prototype,g.prototype.constructor=g,bi.prototype=gs(ja.prototype),bi.prototype.constructor=bi;function ut(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Pe,this.__views__=[]}function E8(){var n=new ut(this.__wrapped__);return n.__actions__=He(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=He(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=He(this.__views__),n}function A8(){if(this.__filtered__){var n=new ut(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function S8(){var n=this.__wrapped__.value(),r=this.__dir__,a=tt(n),d=r<0,p=a?n.length:0,v=Ug(0,p,this.__views__),w=v.start,y=v.end,x=y-w,T=d?y:w-1,I=this.__iteratees__,B=I.length,O=0,V=ve(x,this.__takeCount__);if(!a||!d&&p==x&&V==x)return yf(n,this.__actions__);var K=[];t:for(;x--&&O<V;){T+=r;for(var nt=-1,Y=n[T];++nt<B;){var ot=I[nt],ft=ot.iteratee,oi=ot.type,Ie=ft(Y);if(oi==he)Y=Ie;else if(!Ie){if(oi==Ae)continue t;break t}}K[O++]=Y}return K}ut.prototype=gs(ja.prototype),ut.prototype.constructor=ut;function mr(n){var r=-1,a=n==null?0:n.length;for(this.clear();++r<a;){var d=n[r];this.set(d[0],d[1])}}function k8(){this.__data__=co?co(null):{},this.size=0}function L8(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r}function M8(n){var r=this.__data__;if(co){var a=r[n];return a===h?i:a}return At.call(r,n)?r[n]:i}function T8(n){var r=this.__data__;return co?r[n]!==i:At.call(r,n)}function I8(n,r){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=co&&r===i?h:r,this}mr.prototype.clear=k8,mr.prototype.delete=L8,mr.prototype.get=M8,mr.prototype.has=T8,mr.prototype.set=I8;function fn(n){var r=-1,a=n==null?0:n.length;for(this.clear();++r<a;){var d=n[r];this.set(d[0],d[1])}}function F8(){this.__data__=[],this.size=0}function B8(n){var r=this.__data__,a=Xa(r,n);if(a<0)return!1;var d=r.length-1;return a==d?r.pop():Va.call(r,a,1),--this.size,!0}function R8(n){var r=this.__data__,a=Xa(r,n);return a<0?i:r[a][1]}function D8(n){return Xa(this.__data__,n)>-1}function O8(n,r){var a=this.__data__,d=Xa(a,n);return d<0?(++this.size,a.push([n,r])):a[d][1]=r,this}fn.prototype.clear=F8,fn.prototype.delete=B8,fn.prototype.get=R8,fn.prototype.has=D8,fn.prototype.set=O8;function pn(n){var r=-1,a=n==null?0:n.length;for(this.clear();++r<a;){var d=n[r];this.set(d[0],d[1])}}function P8(){this.size=0,this.__data__={hash:new mr,map:new(oo||fn),string:new mr}}function U8(n){var r=ac(this,n).delete(n);return this.size-=r?1:0,r}function $8(n){return ac(this,n).get(n)}function N8(n){return ac(this,n).has(n)}function H8(n,r){var a=ac(this,n),d=a.size;return a.set(n,r),this.size+=a.size==d?0:1,this}pn.prototype.clear=P8,pn.prototype.delete=U8,pn.prototype.get=$8,pn.prototype.has=N8,pn.prototype.set=H8;function vr(n){var r=-1,a=n==null?0:n.length;for(this.__data__=new pn;++r<a;)this.add(n[r])}function V8(n){return this.__data__.set(n,h),this}function G8(n){return this.__data__.has(n)}vr.prototype.add=vr.prototype.push=V8,vr.prototype.has=G8;function Bi(n){var r=this.__data__=new fn(n);this.size=r.size}function z8(){this.__data__=new fn,this.size=0}function W8(n){var r=this.__data__,a=r.delete(n);return this.size=r.size,a}function Z8(n){return this.__data__.get(n)}function q8(n){return this.__data__.has(n)}function j8(n,r){var a=this.__data__;if(a instanceof fn){var d=a.__data__;if(!oo||d.length<o-1)return d.push([n,r]),this.size=++a.size,this;a=this.__data__=new pn(d)}return a.set(n,r),this.size=a.size,this}Bi.prototype.clear=z8,Bi.prototype.delete=W8,Bi.prototype.get=Z8,Bi.prototype.has=q8,Bi.prototype.set=j8;function Y3(n,r){var a=tt(n),d=!a&&Cr(n),p=!a&&!d&&Yn(n),v=!a&&!d&&!p&&ws(n),w=a||d||p||v,y=w?N1(n.length,r8):[],x=y.length;for(var T in n)(r||At.call(n,T))&&!(w&&(T=="length"||p&&(T=="offset"||T=="parent")||v&&(T=="buffer"||T=="byteLength"||T=="byteOffset")||_n(T,x)))&&y.push(T);return y}function J3(n){var r=n.length;return r?n[nu(0,r-1)]:i}function X8(n,r){return cc(He(n),_r(r,0,n.length))}function K8(n){return cc(He(n))}function q1(n,r,a){(a!==i&&!Ri(n[r],a)||a===i&&!(r in n))&&gn(n,r,a)}function uo(n,r,a){var d=n[r];(!(At.call(n,r)&&Ri(d,a))||a===i&&!(r in n))&&gn(n,r,a)}function Xa(n,r){for(var a=n.length;a--;)if(Ri(n[a][0],r))return a;return-1}function Y8(n,r,a,d){return qn(n,function(p,v,w){r(d,p,a(p),w)}),d}function Q3(n,r){return n&&Ki(r,le(r),n)}function J8(n,r){return n&&Ki(r,Ge(r),n)}function gn(n,r,a){r=="__proto__"&&Ga?Ga(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}function j1(n,r){for(var a=-1,d=r.length,p=S(d),v=n==null;++a<d;)p[a]=v?i:Lu(n,r[a]);return p}function _r(n,r,a){return n===n&&(a!==i&&(n=n<=a?n:a),r!==i&&(n=n>=r?n:r)),n}function yi(n,r,a,d,p,v){var w,y=r&m,x=r&b,T=r&E;if(a&&(w=p?a(n,d,p,v):a(n)),w!==i)return w;if(!Vt(n))return n;var I=tt(n);if(I){if(w=Ng(n),!y)return He(n,w)}else{var B=_e(n),O=B==Wi||B==eo;if(Yn(n))return Ef(n,y);if(B==Zi||B==Un||O&&!p){if(w=x||O?{}:Gf(n),!y)return x?Mg(n,J8(w,n)):Lg(n,Q3(w,n))}else{if(!It[B])return p?n:{};w=Hg(n,B,y)}}v||(v=new Bi);var V=v.get(n);if(V)return V;v.set(n,w),_4(n)?n.forEach(function(Y){w.add(yi(Y,r,a,Y,n,v))}):m4(n)&&n.forEach(function(Y,ot){w.set(ot,yi(Y,r,a,ot,n,v))});var K=T?x?pu:fu:x?Ge:le,nt=I?i:K(n);return _i(nt||n,function(Y,ot){nt&&(ot=Y,Y=n[ot]),uo(w,ot,yi(Y,r,a,ot,n,v))}),w}function Q8(n){var r=le(n);return function(a){return tf(a,n,r)}}function tf(n,r,a){var d=a.length;if(n==null)return!d;for(n=Lt(n);d--;){var p=a[d],v=r[p],w=n[p];if(w===i&&!(p in n)||!v(w))return!1}return!0}function ef(n,r,a){if(typeof n!="function")throw new wi(l);return _o(function(){n.apply(i,a)},r)}function ho(n,r,a,d){var p=-1,v=Fa,w=!0,y=n.length,x=[],T=r.length;if(!y)return x;a&&(r=$t(r,ni(a))),d?(v=R1,w=!1):r.length>=o&&(v=ro,w=!1,r=new vr(r));t:for(;++p<y;){var I=n[p],B=a==null?I:a(I);if(I=d||I!==0?I:0,w&&B===B){for(var O=T;O--;)if(r[O]===B)continue t;x.push(I)}else v(r,B,d)||x.push(I)}return x}var qn=Mf(Xi),nf=Mf(K1,!0);function tg(n,r){var a=!0;return qn(n,function(d,p,v){return a=!!r(d,p,v),a}),a}function Ka(n,r,a){for(var d=-1,p=n.length;++d<p;){var v=n[d],w=r(v);if(w!=null&&(y===i?w===w&&!si(w):a(w,y)))var y=w,x=v}return x}function eg(n,r,a,d){var p=n.length;for(a=it(a),a<0&&(a=-a>p?0:p+a),d=d===i||d>p?p:it(d),d<0&&(d+=p),d=a>d?0:b4(d);a<d;)n[a++]=r;return n}function rf(n,r){var a=[];return qn(n,function(d,p,v){r(d,p,v)&&a.push(d)}),a}function fe(n,r,a,d,p){var v=-1,w=n.length;for(a||(a=Gg),p||(p=[]);++v<w;){var y=n[v];r>0&&a(y)?r>1?fe(y,r-1,a,d,p):zn(p,y):d||(p[p.length]=y)}return p}var X1=Tf(),sf=Tf(!0);function Xi(n,r){return n&&X1(n,r,le)}function K1(n,r){return n&&sf(n,r,le)}function Ya(n,r){return Gn(r,function(a){return wn(n[a])})}function wr(n,r){r=Xn(r,n);for(var a=0,d=r.length;n!=null&&a<d;)n=n[Yi(r[a++])];return a&&a==d?n:i}function of(n,r,a){var d=r(n);return tt(n)?d:zn(d,a(n))}function Me(n){return n==null?n===i?Le:e3:gr&&gr in Lt(n)?Pg(n):Kg(n)}function Y1(n,r){return n>r}function ig(n,r){return n!=null&&At.call(n,r)}function ng(n,r){return n!=null&&r in Lt(n)}function rg(n,r,a){return n>=ve(r,a)&&n<ae(r,a)}function J1(n,r,a){for(var d=a?R1:Fa,p=n[0].length,v=n.length,w=v,y=S(v),x=1/0,T=[];w--;){var I=n[w];w&&r&&(I=$t(I,ni(r))),x=ve(I.length,x),y[w]=!a&&(r||p>=120&&I.length>=120)?new vr(w&&I):i}I=n[0];var B=-1,O=y[0];t:for(;++B<p&&T.length<x;){var V=I[B],K=r?r(V):V;if(V=a||V!==0?V:0,!(O?ro(O,K):d(T,K,a))){for(w=v;--w;){var nt=y[w];if(!(nt?ro(nt,K):d(n[w],K,a)))continue t}O&&O.push(K),T.push(V)}}return T}function sg(n,r,a,d){return Xi(n,function(p,v,w){r(d,a(p),v,w)}),d}function fo(n,r,a){r=Xn(r,n),n=qf(n,r);var d=n==null?n:n[Yi(xi(r))];return d==null?i:ii(d,n,a)}function af(n){return qt(n)&&Me(n)==Un}function og(n){return qt(n)&&Me(n)==$e}function ag(n){return qt(n)&&Me(n)==hr}function po(n,r,a,d,p){return n===r?!0:n==null||r==null||!qt(n)&&!qt(r)?n!==n&&r!==r:cg(n,r,a,d,po,p)}function cg(n,r,a,d,p,v){var w=tt(n),y=tt(r),x=w?ss:_e(n),T=y?ss:_e(r);x=x==Un?Zi:x,T=T==Un?Zi:T;var I=x==Zi,B=T==Zi,O=x==T;if(O&&Yn(n)){if(!Yn(r))return!1;w=!0,I=!1}if(O&&!I)return v||(v=new Bi),w||ws(n)?Nf(n,r,a,d,p,v):Dg(n,r,x,a,d,p,v);if(!(a&A)){var V=I&&At.call(n,"__wrapped__"),K=B&&At.call(r,"__wrapped__");if(V||K){var nt=V?n.value():n,Y=K?r.value():r;return v||(v=new Bi),p(nt,Y,a,d,v)}}return O?(v||(v=new Bi),Og(n,r,a,d,p,v)):!1}function lg(n){return qt(n)&&_e(n)==Ue}function Q1(n,r,a,d){var p=a.length,v=p,w=!d;if(n==null)return!v;for(n=Lt(n);p--;){var y=a[p];if(w&&y[2]?y[1]!==n[y[0]]:!(y[0]in n))return!1}for(;++p<v;){y=a[p];var x=y[0],T=n[x],I=y[1];if(w&&y[2]){if(T===i&&!(x in n))return!1}else{var B=new Bi;if(d)var O=d(T,I,x,n,r,B);if(!(O===i?po(I,T,A|k,d,B):O))return!1}}return!0}function cf(n){if(!Vt(n)||Wg(n))return!1;var r=wn(n)?l8:Q6;return r.test(yr(n))}function ug(n){return qt(n)&&Me(n)==lt}function hg(n){return qt(n)&&_e(n)==xt}function dg(n){return qt(n)&&pc(n.length)&&!!Rt[Me(n)]}function lf(n){return typeof n=="function"?n:n==null?ze:typeof n=="object"?tt(n)?df(n[0],n[1]):hf(n):I4(n)}function tu(n){if(!vo(n))return g8(n);var r=[];for(var a in Lt(n))At.call(n,a)&&a!="constructor"&&r.push(a);return r}function fg(n){if(!Vt(n))return Xg(n);var r=vo(n),a=[];for(var d in n)d=="constructor"&&(r||!At.call(n,d))||a.push(d);return a}function eu(n,r){return n<r}function uf(n,r){var a=-1,d=Ve(n)?S(n.length):[];return qn(n,function(p,v,w){d[++a]=r(p,v,w)}),d}function hf(n){var r=mu(n);return r.length==1&&r[0][2]?Wf(r[0][0],r[0][1]):function(a){return a===n||Q1(a,n,r)}}function df(n,r){return _u(n)&&zf(r)?Wf(Yi(n),r):function(a){var d=Lu(a,n);return d===i&&d===r?Mu(a,n):po(r,d,A|k)}}function Ja(n,r,a,d,p){n!==r&&X1(r,function(v,w){if(p||(p=new Bi),Vt(v))pg(n,r,w,a,Ja,d,p);else{var y=d?d(bu(n,w),v,w+"",n,r,p):i;y===i&&(y=v),q1(n,w,y)}},Ge)}function pg(n,r,a,d,p,v,w){var y=bu(n,a),x=bu(r,a),T=w.get(x);if(T){q1(n,a,T);return}var I=v?v(y,x,a+"",n,r,w):i,B=I===i;if(B){var O=tt(x),V=!O&&Yn(x),K=!O&&!V&&ws(x);I=x,O||V||K?tt(y)?I=y:Yt(y)?I=He(y):V?(B=!1,I=Ef(x,!0)):K?(B=!1,I=Af(x,!0)):I=[]:wo(x)||Cr(x)?(I=y,Cr(y)?I=y4(y):(!Vt(y)||wn(y))&&(I=Gf(x))):B=!1}B&&(w.set(x,I),p(I,x,d,v,w),w.delete(x)),q1(n,a,I)}function ff(n,r){var a=n.length;if(a)return r+=r<0?a:0,_n(r,a)?n[r]:i}function pf(n,r,a){r.length?r=$t(r,function(v){return tt(v)?function(w){return wr(w,v.length===1?v[0]:v)}:v}):r=[ze];var d=-1;r=$t(r,ni(j()));var p=uf(n,function(v,w,y){var x=$t(r,function(T){return T(v)});return{criteria:x,index:++d,value:v}});return H7(p,function(v,w){return kg(v,w,a)})}function gg(n,r){return gf(n,r,function(a,d){return Mu(n,d)})}function gf(n,r,a){for(var d=-1,p=r.length,v={};++d<p;){var w=r[d],y=wr(n,w);a(y,w)&&go(v,Xn(w,n),y)}return v}function mg(n){return function(r){return wr(r,n)}}function iu(n,r,a,d){var p=d?N7:cs,v=-1,w=r.length,y=n;for(n===r&&(r=He(r)),a&&(y=$t(n,ni(a)));++v<w;)for(var x=0,T=r[v],I=a?a(T):T;(x=p(y,I,x,d))>-1;)y!==n&&Va.call(y,x,1),Va.call(n,x,1);return n}function mf(n,r){for(var a=n?r.length:0,d=a-1;a--;){var p=r[a];if(a==d||p!==v){var v=p;_n(p)?Va.call(n,p,1):ou(n,p)}}return n}function nu(n,r){return n+Wa(X3()*(r-n+1))}function vg(n,r,a,d){for(var p=-1,v=ae(za((r-n)/(a||1)),0),w=S(v);v--;)w[d?v:++p]=n,n+=a;return w}function ru(n,r){var a="";if(!n||r<1||r>ei)return a;do r%2&&(a+=n),r=Wa(r/2),r&&(n+=n);while(r);return a}function rt(n,r){return yu(Zf(n,r,ze),n+"")}function _g(n){return J3(bs(n))}function wg(n,r){var a=bs(n);return cc(a,_r(r,0,a.length))}function go(n,r,a,d){if(!Vt(n))return n;r=Xn(r,n);for(var p=-1,v=r.length,w=v-1,y=n;y!=null&&++p<v;){var x=Yi(r[p]),T=a;if(x==="__proto__"||x==="constructor"||x==="prototype")return n;if(p!=w){var I=y[x];T=d?d(I,x,y):i,T===i&&(T=Vt(I)?I:_n(r[p+1])?[]:{})}uo(y,x,T),y=y[x]}return n}var vf=Za?function(n,r){return Za.set(n,r),n}:ze,bg=Ga?function(n,r){return Ga(n,"toString",{configurable:!0,enumerable:!1,value:Iu(r),writable:!0})}:ze;function yg(n){return cc(bs(n))}function Ci(n,r,a){var d=-1,p=n.length;r<0&&(r=-r>p?0:p+r),a=a>p?p:a,a<0&&(a+=p),p=r>a?0:a-r>>>0,r>>>=0;for(var v=S(p);++d<p;)v[d]=n[d+r];return v}function Cg(n,r){var a;return qn(n,function(d,p,v){return a=r(d,p,v),!a}),!!a}function Qa(n,r,a){var d=0,p=n==null?d:n.length;if(typeof r=="number"&&r===r&&p<=b1){for(;d<p;){var v=d+p>>>1,w=n[v];w!==null&&!si(w)&&(a?w<=r:w<r)?d=v+1:p=v}return p}return su(n,r,ze,a)}function su(n,r,a,d){var p=0,v=n==null?0:n.length;if(v===0)return 0;r=a(r);for(var w=r!==r,y=r===null,x=si(r),T=r===i;p<v;){var I=Wa((p+v)/2),B=a(n[I]),O=B!==i,V=B===null,K=B===B,nt=si(B);if(w)var Y=d||K;else T?Y=K&&(d||O):y?Y=K&&O&&(d||!V):x?Y=K&&O&&!V&&(d||!nt):V||nt?Y=!1:Y=d?B<=r:B<r;Y?p=I+1:v=I}return ve(v,ke)}function _f(n,r){for(var a=-1,d=n.length,p=0,v=[];++a<d;){var w=n[a],y=r?r(w):w;if(!a||!Ri(y,x)){var x=y;v[p++]=w===0?0:w}}return v}function wf(n){return typeof n=="number"?n:si(n)?rs:+n}function ri(n){if(typeof n=="string")return n;if(tt(n))return $t(n,ri)+"";if(si(n))return K3?K3.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function jn(n,r,a){var d=-1,p=Fa,v=n.length,w=!0,y=[],x=y;if(a)w=!1,p=R1;else if(v>=o){var T=r?null:Bg(n);if(T)return Ra(T);w=!1,p=ro,x=new vr}else x=r?[]:y;t:for(;++d<v;){var I=n[d],B=r?r(I):I;if(I=a||I!==0?I:0,w&&B===B){for(var O=x.length;O--;)if(x[O]===B)continue t;r&&x.push(B),y.push(I)}else p(x,B,a)||(x!==y&&x.push(B),y.push(I))}return y}function ou(n,r){return r=Xn(r,n),n=qf(n,r),n==null||delete n[Yi(xi(r))]}function bf(n,r,a,d){return go(n,r,a(wr(n,r)),d)}function tc(n,r,a,d){for(var p=n.length,v=d?p:-1;(d?v--:++v<p)&&r(n[v],v,n););return a?Ci(n,d?0:v,d?v+1:p):Ci(n,d?v+1:0,d?p:v)}function yf(n,r){var a=n;return a instanceof ut&&(a=a.value()),D1(r,function(d,p){return p.func.apply(p.thisArg,zn([d],p.args))},a)}function au(n,r,a){var d=n.length;if(d<2)return d?jn(n[0]):[];for(var p=-1,v=S(d);++p<d;)for(var w=n[p],y=-1;++y<d;)y!=p&&(v[p]=ho(v[p]||w,n[y],r,a));return jn(fe(v,1),r,a)}function Cf(n,r,a){for(var d=-1,p=n.length,v=r.length,w={};++d<p;){var y=d<v?r[d]:i;a(w,n[d],y)}return w}function cu(n){return Yt(n)?n:[]}function lu(n){return typeof n=="function"?n:ze}function Xn(n,r){return tt(n)?n:_u(n,r)?[n]:Yf(Et(n))}var xg=rt;function Kn(n,r,a){var d=n.length;return a=a===i?d:a,!r&&a>=d?n:Ci(n,r,a)}var xf=u8||function(n){return de.clearTimeout(n)};function Ef(n,r){if(r)return n.slice();var a=n.length,d=z3?z3(a):new n.constructor(a);return n.copy(d),d}function uu(n){var r=new n.constructor(n.byteLength);return new Na(r).set(new Na(n)),r}function Eg(n,r){var a=r?uu(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.byteLength)}function Ag(n){var r=new n.constructor(n.source,o3.exec(n));return r.lastIndex=n.lastIndex,r}function Sg(n){return lo?Lt(lo.call(n)):{}}function Af(n,r){var a=r?uu(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.length)}function Sf(n,r){if(n!==r){var a=n!==i,d=n===null,p=n===n,v=si(n),w=r!==i,y=r===null,x=r===r,T=si(r);if(!y&&!T&&!v&&n>r||v&&w&&x&&!y&&!T||d&&w&&x||!a&&x||!p)return 1;if(!d&&!v&&!T&&n<r||T&&a&&p&&!d&&!v||y&&a&&p||!w&&p||!x)return-1}return 0}function kg(n,r,a){for(var d=-1,p=n.criteria,v=r.criteria,w=p.length,y=a.length;++d<w;){var x=Sf(p[d],v[d]);if(x){if(d>=y)return x;var T=a[d];return x*(T=="desc"?-1:1)}}return n.index-r.index}function kf(n,r,a,d){for(var p=-1,v=n.length,w=a.length,y=-1,x=r.length,T=ae(v-w,0),I=S(x+T),B=!d;++y<x;)I[y]=r[y];for(;++p<w;)(B||p<v)&&(I[a[p]]=n[p]);for(;T--;)I[y++]=n[p++];return I}function Lf(n,r,a,d){for(var p=-1,v=n.length,w=-1,y=a.length,x=-1,T=r.length,I=ae(v-y,0),B=S(I+T),O=!d;++p<I;)B[p]=n[p];for(var V=p;++x<T;)B[V+x]=r[x];for(;++w<y;)(O||p<v)&&(B[V+a[w]]=n[p++]);return B}function He(n,r){var a=-1,d=n.length;for(r||(r=S(d));++a<d;)r[a]=n[a];return r}function Ki(n,r,a,d){var p=!a;a||(a={});for(var v=-1,w=r.length;++v<w;){var y=r[v],x=d?d(a[y],n[y],y,a,n):i;x===i&&(x=n[y]),p?gn(a,y,x):uo(a,y,x)}return a}function Lg(n,r){return Ki(n,vu(n),r)}function Mg(n,r){return Ki(n,Hf(n),r)}function ec(n,r){return function(a,d){var p=tt(a)?R7:Y8,v=r?r():{};return p(a,n,j(d,2),v)}}function ms(n){return rt(function(r,a){var d=-1,p=a.length,v=p>1?a[p-1]:i,w=p>2?a[2]:i;for(v=n.length>3&&typeof v=="function"?(p--,v):i,w&&Te(a[0],a[1],w)&&(v=p<3?i:v,p=1),r=Lt(r);++d<p;){var y=a[d];y&&n(r,y,d,v)}return r})}function Mf(n,r){return function(a,d){if(a==null)return a;if(!Ve(a))return n(a,d);for(var p=a.length,v=r?p:-1,w=Lt(a);(r?v--:++v<p)&&d(w[v],v,w)!==!1;);return a}}function Tf(n){return function(r,a,d){for(var p=-1,v=Lt(r),w=d(r),y=w.length;y--;){var x=w[n?y:++p];if(a(v[x],x,v)===!1)break}return r}}function Tg(n,r,a){var d=r&F,p=mo(n);function v(){var w=this&&this!==de&&this instanceof v?p:n;return w.apply(d?a:this,arguments)}return v}function If(n){return function(r){r=Et(r);var a=ls(r)?Fi(r):i,d=a?a[0]:r.charAt(0),p=a?Kn(a,1).join(""):r.slice(1);return d[n]()+p}}function vs(n){return function(r){return D1(M4(L4(r).replace(b7,"")),n,"")}}function mo(n){return function(){var r=arguments;switch(r.length){case 0:return new n;case 1:return new n(r[0]);case 2:return new n(r[0],r[1]);case 3:return new n(r[0],r[1],r[2]);case 4:return new n(r[0],r[1],r[2],r[3]);case 5:return new n(r[0],r[1],r[2],r[3],r[4]);case 6:return new n(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new n(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var a=gs(n.prototype),d=n.apply(a,r);return Vt(d)?d:a}}function Ig(n,r,a){var d=mo(n);function p(){for(var v=arguments.length,w=S(v),y=v,x=_s(p);y--;)w[y]=arguments[y];var T=v<3&&w[0]!==x&&w[v-1]!==x?[]:Wn(w,x);if(v-=T.length,v<a)return Of(n,r,ic,p.placeholder,i,w,T,i,i,a-v);var I=this&&this!==de&&this instanceof p?d:n;return ii(I,this,w)}return p}function Ff(n){return function(r,a,d){var p=Lt(r);if(!Ve(r)){var v=j(a,3);r=le(r),a=function(y){return v(p[y],y,p)}}var w=n(r,a,d);return w>-1?p[v?r[w]:w]:i}}function Bf(n){return vn(function(r){var a=r.length,d=a,p=bi.prototype.thru;for(n&&r.reverse();d--;){var v=r[d];if(typeof v!="function")throw new wi(l);if(p&&!w&&oc(v)=="wrapper")var w=new bi([],!0)}for(d=w?d:a;++d<a;){v=r[d];var y=oc(v),x=y=="wrapper"?gu(v):i;x&&wu(x[0])&&x[1]==(vt|R|X|J)&&!x[4].length&&x[9]==1?w=w[oc(x[0])].apply(w,x[3]):w=v.length==1&&wu(v)?w[y]():w.thru(v)}return function(){var T=arguments,I=T[0];if(w&&T.length==1&&tt(I))return w.plant(I).value();for(var B=0,O=a?r[B].apply(this,T):I;++B<a;)O=r[B].call(this,O);return O}})}function ic(n,r,a,d,p,v,w,y,x,T){var I=r&vt,B=r&F,O=r&M,V=r&(R|$),K=r&pt,nt=O?i:mo(n);function Y(){for(var ot=arguments.length,ft=S(ot),oi=ot;oi--;)ft[oi]=arguments[oi];if(V)var Ie=_s(Y),ai=G7(ft,Ie);if(d&&(ft=kf(ft,d,p,V)),v&&(ft=Lf(ft,v,w,V)),ot-=ai,V&&ot<T){var Jt=Wn(ft,Ie);return Of(n,r,ic,Y.placeholder,a,ft,Jt,y,x,T-ot)}var Di=B?a:this,yn=O?Di[n]:n;return ot=ft.length,y?ft=Yg(ft,y):K&&ot>1&&ft.reverse(),I&&x<ot&&(ft.length=x),this&&this!==de&&this instanceof Y&&(yn=nt||mo(yn)),yn.apply(Di,ft)}return Y}function Rf(n,r){return function(a,d){return sg(a,n,r(d),{})}}function nc(n,r){return function(a,d){var p;if(a===i&&d===i)return r;if(a!==i&&(p=a),d!==i){if(p===i)return d;typeof a=="string"||typeof d=="string"?(a=ri(a),d=ri(d)):(a=wf(a),d=wf(d)),p=n(a,d)}return p}}function hu(n){return vn(function(r){return r=$t(r,ni(j())),rt(function(a){var d=this;return n(r,function(p){return ii(p,d,a)})})})}function rc(n,r){r=r===i?" ":ri(r);var a=r.length;if(a<2)return a?ru(r,n):r;var d=ru(r,za(n/us(r)));return ls(r)?Kn(Fi(d),0,n).join(""):d.slice(0,n)}function Fg(n,r,a,d){var p=r&F,v=mo(n);function w(){for(var y=-1,x=arguments.length,T=-1,I=d.length,B=S(I+x),O=this&&this!==de&&this instanceof w?v:n;++T<I;)B[T]=d[T];for(;x--;)B[T++]=arguments[++y];return ii(O,p?a:this,B)}return w}function Df(n){return function(r,a,d){return d&&typeof d!="number"&&Te(r,a,d)&&(a=d=i),r=bn(r),a===i?(a=r,r=0):a=bn(a),d=d===i?r<a?1:-1:bn(d),vg(r,a,d,n)}}function sc(n){return function(r,a){return typeof r=="string"&&typeof a=="string"||(r=Ei(r),a=Ei(a)),n(r,a)}}function Of(n,r,a,d,p,v,w,y,x,T){var I=r&R,B=I?w:i,O=I?i:w,V=I?v:i,K=I?i:v;r|=I?X:N,r&=~(I?N:X),r&D||(r&=-4);var nt=[n,r,p,V,B,K,O,y,x,T],Y=a.apply(i,nt);return wu(n)&&jf(Y,nt),Y.placeholder=d,Xf(Y,n,r)}function du(n){var r=oe[n];return function(a,d){if(a=Ei(a),d=d==null?0:ve(it(d),292),d&&j3(a)){var p=(Et(a)+"e").split("e"),v=r(p[0]+"e"+(+p[1]+d));return p=(Et(v)+"e").split("e"),+(p[0]+"e"+(+p[1]-d))}return r(a)}}var Bg=fs&&1/Ra(new fs([,-0]))[1]==ur?function(n){return new fs(n)}:Ru;function Pf(n){return function(r){var a=_e(r);return a==Ue?V1(r):a==xt?K7(r):V7(r,n(r))}}function mn(n,r,a,d,p,v,w,y){var x=r&M;if(!x&&typeof n!="function")throw new wi(l);var T=d?d.length:0;if(T||(r&=-97,d=p=i),w=w===i?w:ae(it(w),0),y=y===i?y:it(y),T-=p?p.length:0,r&N){var I=d,B=p;d=p=i}var O=x?i:gu(n),V=[n,r,a,d,p,I,B,v,w,y];if(O&&jg(V,O),n=V[0],r=V[1],a=V[2],d=V[3],p=V[4],y=V[9]=V[9]===i?x?0:n.length:ae(V[9]-T,0),!y&&r&(R|$)&&(r&=-25),!r||r==F)var K=Tg(n,r,a);else r==R||r==$?K=Ig(n,r,y):(r==X||r==(F|X))&&!p.length?K=Fg(n,r,a,d):K=ic.apply(i,V);var nt=O?vf:jf;return Xf(nt(K,V),n,r)}function Uf(n,r,a,d){return n===i||Ri(n,ds[a])&&!At.call(d,a)?r:n}function $f(n,r,a,d,p,v){return Vt(n)&&Vt(r)&&(v.set(r,n),Ja(n,r,i,$f,v),v.delete(r)),n}function Rg(n){return wo(n)?i:n}function Nf(n,r,a,d,p,v){var w=a&A,y=n.length,x=r.length;if(y!=x&&!(w&&x>y))return!1;var T=v.get(n),I=v.get(r);if(T&&I)return T==r&&I==n;var B=-1,O=!0,V=a&k?new vr:i;for(v.set(n,r),v.set(r,n);++B<y;){var K=n[B],nt=r[B];if(d)var Y=w?d(nt,K,B,r,n,v):d(K,nt,B,n,r,v);if(Y!==i){if(Y)continue;O=!1;break}if(V){if(!O1(r,function(ot,ft){if(!ro(V,ft)&&(K===ot||p(K,ot,a,d,v)))return V.push(ft)})){O=!1;break}}else if(!(K===nt||p(K,nt,a,d,v))){O=!1;break}}return v.delete(n),v.delete(r),O}function Dg(n,r,a,d,p,v,w){switch(a){case Ne:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case $e:return!(n.byteLength!=r.byteLength||!v(new Na(n),new Na(r)));case hn:case hr:case os:return Ri(+n,+r);case dn:return n.name==r.name&&n.message==r.message;case lt:case me:return n==r+"";case Ue:var y=V1;case xt:var x=d&A;if(y||(y=Ra),n.size!=r.size&&!x)return!1;var T=w.get(n);if(T)return T==r;d|=k,w.set(n,r);var I=Nf(y(n),y(r),d,p,v,w);return w.delete(n),I;case $n:if(lo)return lo.call(n)==lo.call(r)}return!1}function Og(n,r,a,d,p,v){var w=a&A,y=fu(n),x=y.length,T=fu(r),I=T.length;if(x!=I&&!w)return!1;for(var B=x;B--;){var O=y[B];if(!(w?O in r:At.call(r,O)))return!1}var V=v.get(n),K=v.get(r);if(V&&K)return V==r&&K==n;var nt=!0;v.set(n,r),v.set(r,n);for(var Y=w;++B<x;){O=y[B];var ot=n[O],ft=r[O];if(d)var oi=w?d(ft,ot,O,r,n,v):d(ot,ft,O,n,r,v);if(!(oi===i?ot===ft||p(ot,ft,a,d,v):oi)){nt=!1;break}Y||(Y=O=="constructor")}if(nt&&!Y){var Ie=n.constructor,ai=r.constructor;Ie!=ai&&"constructor"in n&&"constructor"in r&&!(typeof Ie=="function"&&Ie instanceof Ie&&typeof ai=="function"&&ai instanceof ai)&&(nt=!1)}return v.delete(n),v.delete(r),nt}function vn(n){return yu(Zf(n,i,e4),n+"")}function fu(n){return of(n,le,vu)}function pu(n){return of(n,Ge,Hf)}var gu=Za?function(n){return Za.get(n)}:Ru;function oc(n){for(var r=n.name+"",a=ps[r],d=At.call(ps,r)?a.length:0;d--;){var p=a[d],v=p.func;if(v==null||v==n)return p.name}return r}function _s(n){var r=At.call(g,"placeholder")?g:n;return r.placeholder}function j(){var n=g.iteratee||Fu;return n=n===Fu?lf:n,arguments.length?n(arguments[0],arguments[1]):n}function ac(n,r){var a=n.__data__;return zg(r)?a[typeof r=="string"?"string":"hash"]:a.map}function mu(n){for(var r=le(n),a=r.length;a--;){var d=r[a],p=n[d];r[a]=[d,p,zf(p)]}return r}function br(n,r){var a=q7(n,r);return cf(a)?a:i}function Pg(n){var r=At.call(n,gr),a=n[gr];try{n[gr]=i;var d=!0}catch(v){}var p=Ua.call(n);return d&&(r?n[gr]=a:delete n[gr]),p}var vu=z1?function(n){return n==null?[]:(n=Lt(n),Gn(z1(n),function(r){return Z3.call(n,r)}))}:Du,Hf=z1?function(n){for(var r=[];n;)zn(r,vu(n)),n=Ha(n);return r}:Du,_e=Me;(W1&&_e(new W1(new ArrayBuffer(1)))!=Ne||oo&&_e(new oo)!=Ue||Z1&&_e(Z1.resolve())!=x1||fs&&_e(new fs)!=xt||ao&&_e(new ao)!=Nn)&&(_e=function(n){var r=Me(n),a=r==Zi?n.constructor:i,d=a?yr(a):"";if(d)switch(d){case w8:return Ne;case b8:return Ue;case y8:return x1;case C8:return xt;case x8:return Nn}return r});function Ug(n,r,a){for(var d=-1,p=a.length;++d<p;){var v=a[d],w=v.size;switch(v.type){case"drop":n+=w;break;case"dropRight":r-=w;break;case"take":r=ve(r,n+w);break;case"takeRight":n=ae(n,r-w);break}}return{start:n,end:r}}function $g(n){var r=n.match(W6);return r?r[1].split(Z6):[]}function Vf(n,r,a){r=Xn(r,n);for(var d=-1,p=r.length,v=!1;++d<p;){var w=Yi(r[d]);if(!(v=n!=null&&a(n,w)))break;n=n[w]}return v||++d!=p?v:(p=n==null?0:n.length,!!p&&pc(p)&&_n(w,p)&&(tt(n)||Cr(n)))}function Ng(n){var r=n.length,a=new n.constructor(r);return r&&typeof n[0]=="string"&&At.call(n,"index")&&(a.index=n.index,a.input=n.input),a}function Gf(n){return typeof n.constructor=="function"&&!vo(n)?gs(Ha(n)):{}}function Hg(n,r,a){var d=n.constructor;switch(r){case $e:return uu(n);case hn:case hr:return new d(+n);case Ne:return Eg(n,a);case qi:case dr:case Hn:case Vn:case ji:case io:case no:case fr:case E1:return Af(n,a);case Ue:return new d;case os:case me:return new d(n);case lt:return Ag(n);case xt:return new d;case $n:return Sg(n)}}function Vg(n,r){var a=r.length;if(!a)return n;var d=a-1;return r[d]=(a>1?"& ":"")+r[d],r=r.join(a>2?", ":" "),n.replace(z6,`{
|
|
3149
|
+
/* [wrapped with `+r+`] */
|
|
3150
|
+
`)}function Gg(n){return tt(n)||Cr(n)||!!(q3&&n&&n[q3])}function _n(n,r){var a=typeof n;return r=r==null?ei:r,!!r&&(a=="number"||a!="symbol"&&e7.test(n))&&n>-1&&n%1==0&&n<r}function Te(n,r,a){if(!Vt(a))return!1;var d=typeof r;return(d=="number"?Ve(a)&&_n(r,a.length):d=="string"&&r in a)?Ri(a[r],n):!1}function _u(n,r){if(tt(n))return!1;var a=typeof n;return a=="number"||a=="symbol"||a=="boolean"||n==null||si(n)?!0:N6.test(n)||!$6.test(n)||r!=null&&n in Lt(r)}function zg(n){var r=typeof n;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null}function wu(n){var r=oc(n),a=g[r];if(typeof a!="function"||!(r in ut.prototype))return!1;if(n===a)return!0;var d=gu(a);return!!d&&n===d[0]}function Wg(n){return!!G3&&G3 in n}var Zg=Oa?wn:Ou;function vo(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||ds;return n===a}function zf(n){return n===n&&!Vt(n)}function Wf(n,r){return function(a){return a==null?!1:a[n]===r&&(r!==i||n in Lt(a))}}function qg(n){var r=dc(n,function(d){return a.size===f&&a.clear(),d}),a=r.cache;return r}function jg(n,r){var a=n[1],d=r[1],p=a|d,v=p<(F|M|vt),w=d==vt&&a==R||d==vt&&a==J&&n[7].length<=r[8]||d==(vt|J)&&r[7].length<=r[8]&&a==R;if(!(v||w))return n;d&F&&(n[2]=r[2],p|=a&F?0:D);var y=r[3];if(y){var x=n[3];n[3]=x?kf(x,y,r[4]):y,n[4]=x?Wn(n[3],_):r[4]}return y=r[5],y&&(x=n[5],n[5]=x?Lf(x,y,r[6]):y,n[6]=x?Wn(n[5],_):r[6]),y=r[7],y&&(n[7]=y),d&vt&&(n[8]=n[8]==null?r[8]:ve(n[8],r[8])),n[9]==null&&(n[9]=r[9]),n[0]=r[0],n[1]=p,n}function Xg(n){var r=[];if(n!=null)for(var a in Lt(n))r.push(a);return r}function Kg(n){return Ua.call(n)}function Zf(n,r,a){return r=ae(r===i?n.length-1:r,0),function(){for(var d=arguments,p=-1,v=ae(d.length-r,0),w=S(v);++p<v;)w[p]=d[r+p];p=-1;for(var y=S(r+1);++p<r;)y[p]=d[p];return y[r]=a(w),ii(n,this,y)}}function qf(n,r){return r.length<2?n:wr(n,Ci(r,0,-1))}function Yg(n,r){for(var a=n.length,d=ve(r.length,a),p=He(n);d--;){var v=r[d];n[d]=_n(v,a)?p[v]:i}return n}function bu(n,r){if(!(r==="constructor"&&typeof n[r]=="function")&&r!="__proto__")return n[r]}var jf=Kf(vf),_o=d8||function(n,r){return de.setTimeout(n,r)},yu=Kf(bg);function Xf(n,r,a){var d=r+"";return yu(n,Vg(d,Jg($g(d),a)))}function Kf(n){var r=0,a=0;return function(){var d=m8(),p=Ii-(d-a);if(a=d,p>0){if(++r>=ne)return arguments[0]}else r=0;return n.apply(i,arguments)}}function cc(n,r){var a=-1,d=n.length,p=d-1;for(r=r===i?d:r;++a<r;){var v=nu(a,p),w=n[v];n[v]=n[a],n[a]=w}return n.length=r,n}var Yf=qg(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace(H6,function(a,d,p,v){r.push(p?v.replace(X6,"$1"):d||a)}),r});function Yi(n){if(typeof n=="string"||si(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function yr(n){if(n!=null){try{return Pa.call(n)}catch(r){}try{return n+""}catch(r){}}return""}function Jg(n,r){return _i(y1,function(a){var d="_."+a[0];r&a[1]&&!Fa(n,d)&&n.push(d)}),n.sort()}function Jf(n){if(n instanceof ut)return n.clone();var r=new bi(n.__wrapped__,n.__chain__);return r.__actions__=He(n.__actions__),r.__index__=n.__index__,r.__values__=n.__values__,r}function Qg(n,r,a){(a?Te(n,r,a):r===i)?r=1:r=ae(it(r),0);var d=n==null?0:n.length;if(!d||r<1)return[];for(var p=0,v=0,w=S(za(d/r));p<d;)w[v++]=Ci(n,p,p+=r);return w}function t9(n){for(var r=-1,a=n==null?0:n.length,d=0,p=[];++r<a;){var v=n[r];v&&(p[d++]=v)}return p}function e9(){var n=arguments.length;if(!n)return[];for(var r=S(n-1),a=arguments[0],d=n;d--;)r[d-1]=arguments[d];return zn(tt(a)?He(a):[a],fe(r,1))}var i9=rt(function(n,r){return Yt(n)?ho(n,fe(r,1,Yt,!0)):[]}),n9=rt(function(n,r){var a=xi(r);return Yt(a)&&(a=i),Yt(n)?ho(n,fe(r,1,Yt,!0),j(a,2)):[]}),r9=rt(function(n,r){var a=xi(r);return Yt(a)&&(a=i),Yt(n)?ho(n,fe(r,1,Yt,!0),i,a):[]});function s9(n,r,a){var d=n==null?0:n.length;return d?(r=a||r===i?1:it(r),Ci(n,r<0?0:r,d)):[]}function o9(n,r,a){var d=n==null?0:n.length;return d?(r=a||r===i?1:it(r),r=d-r,Ci(n,0,r<0?0:r)):[]}function a9(n,r){return n&&n.length?tc(n,j(r,3),!0,!0):[]}function c9(n,r){return n&&n.length?tc(n,j(r,3),!0):[]}function l9(n,r,a,d){var p=n==null?0:n.length;return p?(a&&typeof a!="number"&&Te(n,r,a)&&(a=0,d=p),eg(n,r,a,d)):[]}function Qf(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=a==null?0:it(a);return p<0&&(p=ae(d+p,0)),Ba(n,j(r,3),p)}function t4(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=d-1;return a!==i&&(p=it(a),p=a<0?ae(d+p,0):ve(p,d-1)),Ba(n,j(r,3),p,!0)}function e4(n){var r=n==null?0:n.length;return r?fe(n,1):[]}function u9(n){var r=n==null?0:n.length;return r?fe(n,ur):[]}function h9(n,r){var a=n==null?0:n.length;return a?(r=r===i?1:it(r),fe(n,r)):[]}function d9(n){for(var r=-1,a=n==null?0:n.length,d={};++r<a;){var p=n[r];d[p[0]]=p[1]}return d}function i4(n){return n&&n.length?n[0]:i}function f9(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=a==null?0:it(a);return p<0&&(p=ae(d+p,0)),cs(n,r,p)}function p9(n){var r=n==null?0:n.length;return r?Ci(n,0,-1):[]}var g9=rt(function(n){var r=$t(n,cu);return r.length&&r[0]===n[0]?J1(r):[]}),m9=rt(function(n){var r=xi(n),a=$t(n,cu);return r===xi(a)?r=i:a.pop(),a.length&&a[0]===n[0]?J1(a,j(r,2)):[]}),v9=rt(function(n){var r=xi(n),a=$t(n,cu);return r=typeof r=="function"?r:i,r&&a.pop(),a.length&&a[0]===n[0]?J1(a,i,r):[]});function _9(n,r){return n==null?"":p8.call(n,r)}function xi(n){var r=n==null?0:n.length;return r?n[r-1]:i}function w9(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=d;return a!==i&&(p=it(a),p=p<0?ae(d+p,0):ve(p,d-1)),r===r?J7(n,r,p):Ba(n,D3,p,!0)}function b9(n,r){return n&&n.length?ff(n,it(r)):i}var y9=rt(n4);function n4(n,r){return n&&n.length&&r&&r.length?iu(n,r):n}function C9(n,r,a){return n&&n.length&&r&&r.length?iu(n,r,j(a,2)):n}function x9(n,r,a){return n&&n.length&&r&&r.length?iu(n,r,i,a):n}var E9=vn(function(n,r){var a=n==null?0:n.length,d=j1(n,r);return mf(n,$t(r,function(p){return _n(p,a)?+p:p}).sort(Sf)),d});function A9(n,r){var a=[];if(!(n&&n.length))return a;var d=-1,p=[],v=n.length;for(r=j(r,3);++d<v;){var w=n[d];r(w,d,n)&&(a.push(w),p.push(d))}return mf(n,p),a}function Cu(n){return n==null?n:_8.call(n)}function S9(n,r,a){var d=n==null?0:n.length;return d?(a&&typeof a!="number"&&Te(n,r,a)?(r=0,a=d):(r=r==null?0:it(r),a=a===i?d:it(a)),Ci(n,r,a)):[]}function k9(n,r){return Qa(n,r)}function L9(n,r,a){return su(n,r,j(a,2))}function M9(n,r){var a=n==null?0:n.length;if(a){var d=Qa(n,r);if(d<a&&Ri(n[d],r))return d}return-1}function T9(n,r){return Qa(n,r,!0)}function I9(n,r,a){return su(n,r,j(a,2),!0)}function F9(n,r){var a=n==null?0:n.length;if(a){var d=Qa(n,r,!0)-1;if(Ri(n[d],r))return d}return-1}function B9(n){return n&&n.length?_f(n):[]}function R9(n,r){return n&&n.length?_f(n,j(r,2)):[]}function D9(n){var r=n==null?0:n.length;return r?Ci(n,1,r):[]}function O9(n,r,a){return n&&n.length?(r=a||r===i?1:it(r),Ci(n,0,r<0?0:r)):[]}function P9(n,r,a){var d=n==null?0:n.length;return d?(r=a||r===i?1:it(r),r=d-r,Ci(n,r<0?0:r,d)):[]}function U9(n,r){return n&&n.length?tc(n,j(r,3),!1,!0):[]}function $9(n,r){return n&&n.length?tc(n,j(r,3)):[]}var N9=rt(function(n){return jn(fe(n,1,Yt,!0))}),H9=rt(function(n){var r=xi(n);return Yt(r)&&(r=i),jn(fe(n,1,Yt,!0),j(r,2))}),V9=rt(function(n){var r=xi(n);return r=typeof r=="function"?r:i,jn(fe(n,1,Yt,!0),i,r)});function G9(n){return n&&n.length?jn(n):[]}function z9(n,r){return n&&n.length?jn(n,j(r,2)):[]}function W9(n,r){return r=typeof r=="function"?r:i,n&&n.length?jn(n,i,r):[]}function xu(n){if(!(n&&n.length))return[];var r=0;return n=Gn(n,function(a){if(Yt(a))return r=ae(a.length,r),!0}),N1(r,function(a){return $t(n,P1(a))})}function r4(n,r){if(!(n&&n.length))return[];var a=xu(n);return r==null?a:$t(a,function(d){return ii(r,i,d)})}var Z9=rt(function(n,r){return Yt(n)?ho(n,r):[]}),q9=rt(function(n){return au(Gn(n,Yt))}),j9=rt(function(n){var r=xi(n);return Yt(r)&&(r=i),au(Gn(n,Yt),j(r,2))}),X9=rt(function(n){var r=xi(n);return r=typeof r=="function"?r:i,au(Gn(n,Yt),i,r)}),K9=rt(xu);function Y9(n,r){return Cf(n||[],r||[],uo)}function J9(n,r){return Cf(n||[],r||[],go)}var Q9=rt(function(n){var r=n.length,a=r>1?n[r-1]:i;return a=typeof a=="function"?(n.pop(),a):i,r4(n,a)});function s4(n){var r=g(n);return r.__chain__=!0,r}function tm(n,r){return r(n),n}function lc(n,r){return r(n)}var em=vn(function(n){var r=n.length,a=r?n[0]:0,d=this.__wrapped__,p=function(v){return j1(v,n)};return r>1||this.__actions__.length||!(d instanceof ut)||!_n(a)?this.thru(p):(d=d.slice(a,+a+(r?1:0)),d.__actions__.push({func:lc,args:[p],thisArg:i}),new bi(d,this.__chain__).thru(function(v){return r&&!v.length&&v.push(i),v}))});function im(){return s4(this)}function nm(){return new bi(this.value(),this.__chain__)}function rm(){this.__values__===i&&(this.__values__=w4(this.value()));var n=this.__index__>=this.__values__.length,r=n?i:this.__values__[this.__index__++];return{done:n,value:r}}function sm(){return this}function om(n){for(var r,a=this;a instanceof ja;){var d=Jf(a);d.__index__=0,d.__values__=i,r?p.__wrapped__=d:r=d;var p=d;a=a.__wrapped__}return p.__wrapped__=n,r}function am(){var n=this.__wrapped__;if(n instanceof ut){var r=n;return this.__actions__.length&&(r=new ut(this)),r=r.reverse(),r.__actions__.push({func:lc,args:[Cu],thisArg:i}),new bi(r,this.__chain__)}return this.thru(Cu)}function cm(){return yf(this.__wrapped__,this.__actions__)}var lm=ec(function(n,r,a){At.call(n,a)?++n[a]:gn(n,a,1)});function um(n,r,a){var d=tt(n)?B3:tg;return a&&Te(n,r,a)&&(r=i),d(n,j(r,3))}function hm(n,r){var a=tt(n)?Gn:rf;return a(n,j(r,3))}var dm=Ff(Qf),fm=Ff(t4);function pm(n,r){return fe(uc(n,r),1)}function gm(n,r){return fe(uc(n,r),ur)}function mm(n,r,a){return a=a===i?1:it(a),fe(uc(n,r),a)}function o4(n,r){var a=tt(n)?_i:qn;return a(n,j(r,3))}function a4(n,r){var a=tt(n)?D7:nf;return a(n,j(r,3))}var vm=ec(function(n,r,a){At.call(n,a)?n[a].push(r):gn(n,a,[r])});function _m(n,r,a,d){n=Ve(n)?n:bs(n),a=a&&!d?it(a):0;var p=n.length;return a<0&&(a=ae(p+a,0)),gc(n)?a<=p&&n.indexOf(r,a)>-1:!!p&&cs(n,r,a)>-1}var wm=rt(function(n,r,a){var d=-1,p=typeof r=="function",v=Ve(n)?S(n.length):[];return qn(n,function(w){v[++d]=p?ii(r,w,a):fo(w,r,a)}),v}),bm=ec(function(n,r,a){gn(n,a,r)});function uc(n,r){var a=tt(n)?$t:uf;return a(n,j(r,3))}function ym(n,r,a,d){return n==null?[]:(tt(r)||(r=r==null?[]:[r]),a=d?i:a,tt(a)||(a=a==null?[]:[a]),pf(n,r,a))}var Cm=ec(function(n,r,a){n[a?0:1].push(r)},function(){return[[],[]]});function xm(n,r,a){var d=tt(n)?D1:P3,p=arguments.length<3;return d(n,j(r,4),a,p,qn)}function Em(n,r,a){var d=tt(n)?O7:P3,p=arguments.length<3;return d(n,j(r,4),a,p,nf)}function Am(n,r){var a=tt(n)?Gn:rf;return a(n,fc(j(r,3)))}function Sm(n){var r=tt(n)?J3:_g;return r(n)}function km(n,r,a){(a?Te(n,r,a):r===i)?r=1:r=it(r);var d=tt(n)?X8:wg;return d(n,r)}function Lm(n){var r=tt(n)?K8:yg;return r(n)}function Mm(n){if(n==null)return 0;if(Ve(n))return gc(n)?us(n):n.length;var r=_e(n);return r==Ue||r==xt?n.size:tu(n).length}function Tm(n,r,a){var d=tt(n)?O1:Cg;return a&&Te(n,r,a)&&(r=i),d(n,j(r,3))}var Im=rt(function(n,r){if(n==null)return[];var a=r.length;return a>1&&Te(n,r[0],r[1])?r=[]:a>2&&Te(r[0],r[1],r[2])&&(r=[r[0]]),pf(n,fe(r,1),[])}),hc=h8||function(){return de.Date.now()};function Fm(n,r){if(typeof r!="function")throw new wi(l);return n=it(n),function(){if(--n<1)return r.apply(this,arguments)}}function c4(n,r,a){return r=a?i:r,r=n&&r==null?n.length:r,mn(n,vt,i,i,i,i,r)}function l4(n,r){var a;if(typeof r!="function")throw new wi(l);return n=it(n),function(){return--n>0&&(a=r.apply(this,arguments)),n<=1&&(r=i),a}}var Eu=rt(function(n,r,a){var d=F;if(a.length){var p=Wn(a,_s(Eu));d|=X}return mn(n,d,r,a,p)}),u4=rt(function(n,r,a){var d=F|M;if(a.length){var p=Wn(a,_s(u4));d|=X}return mn(r,d,n,a,p)});function h4(n,r,a){r=a?i:r;var d=mn(n,R,i,i,i,i,i,r);return d.placeholder=h4.placeholder,d}function d4(n,r,a){r=a?i:r;var d=mn(n,$,i,i,i,i,i,r);return d.placeholder=d4.placeholder,d}function f4(n,r,a){var d,p,v,w,y,x,T=0,I=!1,B=!1,O=!0;if(typeof n!="function")throw new wi(l);r=Ei(r)||0,Vt(a)&&(I=!!a.leading,B="maxWait"in a,v=B?ae(Ei(a.maxWait)||0,r):v,O="trailing"in a?!!a.trailing:O);function V(Jt){var Di=d,yn=p;return d=p=i,T=Jt,w=n.apply(yn,Di),w}function K(Jt){return T=Jt,y=_o(ot,r),I?V(Jt):w}function nt(Jt){var Di=Jt-x,yn=Jt-T,F4=r-Di;return B?ve(F4,v-yn):F4}function Y(Jt){var Di=Jt-x,yn=Jt-T;return x===i||Di>=r||Di<0||B&&yn>=v}function ot(){var Jt=hc();if(Y(Jt))return ft(Jt);y=_o(ot,nt(Jt))}function ft(Jt){return y=i,O&&d?V(Jt):(d=p=i,w)}function oi(){y!==i&&xf(y),T=0,d=x=p=y=i}function Ie(){return y===i?w:ft(hc())}function ai(){var Jt=hc(),Di=Y(Jt);if(d=arguments,p=this,x=Jt,Di){if(y===i)return K(x);if(B)return xf(y),y=_o(ot,r),V(x)}return y===i&&(y=_o(ot,r)),w}return ai.cancel=oi,ai.flush=Ie,ai}var Bm=rt(function(n,r){return ef(n,1,r)}),Rm=rt(function(n,r,a){return ef(n,Ei(r)||0,a)});function Dm(n){return mn(n,pt)}function dc(n,r){if(typeof n!="function"||r!=null&&typeof r!="function")throw new wi(l);var a=function(){var d=arguments,p=r?r.apply(this,d):d[0],v=a.cache;if(v.has(p))return v.get(p);var w=n.apply(this,d);return a.cache=v.set(p,w)||v,w};return a.cache=new(dc.Cache||pn),a}dc.Cache=pn;function fc(n){if(typeof n!="function")throw new wi(l);return function(){var r=arguments;switch(r.length){case 0:return!n.call(this);case 1:return!n.call(this,r[0]);case 2:return!n.call(this,r[0],r[1]);case 3:return!n.call(this,r[0],r[1],r[2])}return!n.apply(this,r)}}function Om(n){return l4(2,n)}var Pm=xg(function(n,r){r=r.length==1&&tt(r[0])?$t(r[0],ni(j())):$t(fe(r,1),ni(j()));var a=r.length;return rt(function(d){for(var p=-1,v=ve(d.length,a);++p<v;)d[p]=r[p].call(this,d[p]);return ii(n,this,d)})}),Au=rt(function(n,r){var a=Wn(r,_s(Au));return mn(n,X,i,r,a)}),p4=rt(function(n,r){var a=Wn(r,_s(p4));return mn(n,N,i,r,a)}),Um=vn(function(n,r){return mn(n,J,i,i,i,r)});function $m(n,r){if(typeof n!="function")throw new wi(l);return r=r===i?r:it(r),rt(n,r)}function Nm(n,r){if(typeof n!="function")throw new wi(l);return r=r==null?0:ae(it(r),0),rt(function(a){var d=a[r],p=Kn(a,0,r);return d&&zn(p,d),ii(n,this,p)})}function Hm(n,r,a){var d=!0,p=!0;if(typeof n!="function")throw new wi(l);return Vt(a)&&(d="leading"in a?!!a.leading:d,p="trailing"in a?!!a.trailing:p),f4(n,r,{leading:d,maxWait:r,trailing:p})}function Vm(n){return c4(n,1)}function Gm(n,r){return Au(lu(r),n)}function zm(){if(!arguments.length)return[];var n=arguments[0];return tt(n)?n:[n]}function Wm(n){return yi(n,E)}function Zm(n,r){return r=typeof r=="function"?r:i,yi(n,E,r)}function qm(n){return yi(n,m|E)}function jm(n,r){return r=typeof r=="function"?r:i,yi(n,m|E,r)}function Xm(n,r){return r==null||tf(n,r,le(r))}function Ri(n,r){return n===r||n!==n&&r!==r}var Km=sc(Y1),Ym=sc(function(n,r){return n>=r}),Cr=af(function(){return arguments}())?af:function(n){return qt(n)&&At.call(n,"callee")&&!Z3.call(n,"callee")},tt=S.isArray,Jm=k3?ni(k3):og;function Ve(n){return n!=null&&pc(n.length)&&!wn(n)}function Yt(n){return qt(n)&&Ve(n)}function Qm(n){return n===!0||n===!1||qt(n)&&Me(n)==hn}var Yn=f8||Ou,tv=L3?ni(L3):ag;function ev(n){return qt(n)&&n.nodeType===1&&!wo(n)}function iv(n){if(n==null)return!0;if(Ve(n)&&(tt(n)||typeof n=="string"||typeof n.splice=="function"||Yn(n)||ws(n)||Cr(n)))return!n.length;var r=_e(n);if(r==Ue||r==xt)return!n.size;if(vo(n))return!tu(n).length;for(var a in n)if(At.call(n,a))return!1;return!0}function nv(n,r){return po(n,r)}function rv(n,r,a){a=typeof a=="function"?a:i;var d=a?a(n,r):i;return d===i?po(n,r,i,a):!!d}function Su(n){if(!qt(n))return!1;var r=Me(n);return r==dn||r==C1||typeof n.message=="string"&&typeof n.name=="string"&&!wo(n)}function sv(n){return typeof n=="number"&&j3(n)}function wn(n){if(!Vt(n))return!1;var r=Me(n);return r==Wi||r==eo||r==to||r==i3}function g4(n){return typeof n=="number"&&n==it(n)}function pc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ei}function Vt(n){var r=typeof n;return n!=null&&(r=="object"||r=="function")}function qt(n){return n!=null&&typeof n=="object"}var m4=M3?ni(M3):lg;function ov(n,r){return n===r||Q1(n,r,mu(r))}function av(n,r,a){return a=typeof a=="function"?a:i,Q1(n,r,mu(r),a)}function cv(n){return v4(n)&&n!=+n}function lv(n){if(Zg(n))throw new Q(c);return cf(n)}function uv(n){return n===null}function hv(n){return n==null}function v4(n){return typeof n=="number"||qt(n)&&Me(n)==os}function wo(n){if(!qt(n)||Me(n)!=Zi)return!1;var r=Ha(n);if(r===null)return!0;var a=At.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&Pa.call(a)==a8}var ku=T3?ni(T3):ug;function dv(n){return g4(n)&&n>=-9007199254740991&&n<=ei}var _4=I3?ni(I3):hg;function gc(n){return typeof n=="string"||!tt(n)&&qt(n)&&Me(n)==me}function si(n){return typeof n=="symbol"||qt(n)&&Me(n)==$n}var ws=F3?ni(F3):dg;function fv(n){return n===i}function pv(n){return qt(n)&&_e(n)==Nn}function gv(n){return qt(n)&&Me(n)==La}var mv=sc(eu),vv=sc(function(n,r){return n<=r});function w4(n){if(!n)return[];if(Ve(n))return gc(n)?Fi(n):He(n);if(so&&n[so])return X7(n[so]());var r=_e(n),a=r==Ue?V1:r==xt?Ra:bs;return a(n)}function bn(n){if(!n)return n===0?n:0;if(n=Ei(n),n===ur||n===-1/0){var r=n<0?-1:1;return r*ka}return n===n?n:0}function it(n){var r=bn(n),a=r%1;return r===r?a?r-a:r:0}function b4(n){return n?_r(it(n),0,Pe):0}function Ei(n){if(typeof n=="number")return n;if(si(n))return rs;if(Vt(n)){var r=typeof n.valueOf=="function"?n.valueOf():n;n=Vt(r)?r+"":r}if(typeof n!="string")return n===0?n:+n;n=U3(n);var a=J6.test(n);return a||t7.test(n)?F7(n.slice(2),a?2:8):Y6.test(n)?rs:+n}function y4(n){return Ki(n,Ge(n))}function _v(n){return n?_r(it(n),-9007199254740991,ei):n===0?n:0}function Et(n){return n==null?"":ri(n)}var wv=ms(function(n,r){if(vo(r)||Ve(r)){Ki(r,le(r),n);return}for(var a in r)At.call(r,a)&&uo(n,a,r[a])}),C4=ms(function(n,r){Ki(r,Ge(r),n)}),mc=ms(function(n,r,a,d){Ki(r,Ge(r),n,d)}),bv=ms(function(n,r,a,d){Ki(r,le(r),n,d)}),yv=vn(j1);function Cv(n,r){var a=gs(n);return r==null?a:Q3(a,r)}var xv=rt(function(n,r){n=Lt(n);var a=-1,d=r.length,p=d>2?r[2]:i;for(p&&Te(r[0],r[1],p)&&(d=1);++a<d;)for(var v=r[a],w=Ge(v),y=-1,x=w.length;++y<x;){var T=w[y],I=n[T];(I===i||Ri(I,ds[T])&&!At.call(n,T))&&(n[T]=v[T])}return n}),Ev=rt(function(n){return n.push(i,$f),ii(x4,i,n)});function Av(n,r){return R3(n,j(r,3),Xi)}function Sv(n,r){return R3(n,j(r,3),K1)}function kv(n,r){return n==null?n:X1(n,j(r,3),Ge)}function Lv(n,r){return n==null?n:sf(n,j(r,3),Ge)}function Mv(n,r){return n&&Xi(n,j(r,3))}function Tv(n,r){return n&&K1(n,j(r,3))}function Iv(n){return n==null?[]:Ya(n,le(n))}function Fv(n){return n==null?[]:Ya(n,Ge(n))}function Lu(n,r,a){var d=n==null?i:wr(n,r);return d===i?a:d}function Bv(n,r){return n!=null&&Vf(n,r,ig)}function Mu(n,r){return n!=null&&Vf(n,r,ng)}var Rv=Rf(function(n,r,a){r!=null&&typeof r.toString!="function"&&(r=Ua.call(r)),n[r]=a},Iu(ze)),Dv=Rf(function(n,r,a){r!=null&&typeof r.toString!="function"&&(r=Ua.call(r)),At.call(n,r)?n[r].push(a):n[r]=[a]},j),Ov=rt(fo);function le(n){return Ve(n)?Y3(n):tu(n)}function Ge(n){return Ve(n)?Y3(n,!0):fg(n)}function Pv(n,r){var a={};return r=j(r,3),Xi(n,function(d,p,v){gn(a,r(d,p,v),d)}),a}function Uv(n,r){var a={};return r=j(r,3),Xi(n,function(d,p,v){gn(a,p,r(d,p,v))}),a}var $v=ms(function(n,r,a){Ja(n,r,a)}),x4=ms(function(n,r,a,d){Ja(n,r,a,d)}),Nv=vn(function(n,r){var a={};if(n==null)return a;var d=!1;r=$t(r,function(v){return v=Xn(v,n),d||(d=v.length>1),v}),Ki(n,pu(n),a),d&&(a=yi(a,m|b|E,Rg));for(var p=r.length;p--;)ou(a,r[p]);return a});function Hv(n,r){return E4(n,fc(j(r)))}var Vv=vn(function(n,r){return n==null?{}:gg(n,r)});function E4(n,r){if(n==null)return{};var a=$t(pu(n),function(d){return[d]});return r=j(r),gf(n,a,function(d,p){return r(d,p[0])})}function Gv(n,r,a){r=Xn(r,n);var d=-1,p=r.length;for(p||(p=1,n=i);++d<p;){var v=n==null?i:n[Yi(r[d])];v===i&&(d=p,v=a),n=wn(v)?v.call(n):v}return n}function zv(n,r,a){return n==null?n:go(n,r,a)}function Wv(n,r,a,d){return d=typeof d=="function"?d:i,n==null?n:go(n,r,a,d)}var A4=Pf(le),S4=Pf(Ge);function Zv(n,r,a){var d=tt(n),p=d||Yn(n)||ws(n);if(r=j(r,4),a==null){var v=n&&n.constructor;p?a=d?new v:[]:Vt(n)?a=wn(v)?gs(Ha(n)):{}:a={}}return(p?_i:Xi)(n,function(w,y,x){return r(a,w,y,x)}),a}function qv(n,r){return n==null?!0:ou(n,r)}function jv(n,r,a){return n==null?n:bf(n,r,lu(a))}function Xv(n,r,a,d){return d=typeof d=="function"?d:i,n==null?n:bf(n,r,lu(a),d)}function bs(n){return n==null?[]:H1(n,le(n))}function Kv(n){return n==null?[]:H1(n,Ge(n))}function Yv(n,r,a){return a===i&&(a=r,r=i),a!==i&&(a=Ei(a),a=a===a?a:0),r!==i&&(r=Ei(r),r=r===r?r:0),_r(Ei(n),r,a)}function Jv(n,r,a){return r=bn(r),a===i?(a=r,r=0):a=bn(a),n=Ei(n),rg(n,r,a)}function Qv(n,r,a){if(a&&typeof a!="boolean"&&Te(n,r,a)&&(r=a=i),a===i&&(typeof r=="boolean"?(a=r,r=i):typeof n=="boolean"&&(a=n,n=i)),n===i&&r===i?(n=0,r=1):(n=bn(n),r===i?(r=n,n=0):r=bn(r)),n>r){var d=n;n=r,r=d}if(a||n%1||r%1){var p=X3();return ve(n+p*(r-n+I7("1e-"+((p+"").length-1))),r)}return nu(n,r)}var t_=vs(function(n,r,a){return r=r.toLowerCase(),n+(a?k4(r):r)});function k4(n){return Tu(Et(n).toLowerCase())}function L4(n){return n=Et(n),n&&n.replace(i7,z7).replace(y7,"")}function e_(n,r,a){n=Et(n),r=ri(r);var d=n.length;a=a===i?d:_r(it(a),0,d);var p=a;return a-=r.length,a>=0&&n.slice(a,p)==r}function i_(n){return n=Et(n),n&&O6.test(n)?n.replace(r3,W7):n}function n_(n){return n=Et(n),n&&V6.test(n)?n.replace(A1,"\\$&"):n}var r_=vs(function(n,r,a){return n+(a?"-":"")+r.toLowerCase()}),s_=vs(function(n,r,a){return n+(a?" ":"")+r.toLowerCase()}),o_=If("toLowerCase");function a_(n,r,a){n=Et(n),r=it(r);var d=r?us(n):0;if(!r||d>=r)return n;var p=(r-d)/2;return rc(Wa(p),a)+n+rc(za(p),a)}function c_(n,r,a){n=Et(n),r=it(r);var d=r?us(n):0;return r&&d<r?n+rc(r-d,a):n}function l_(n,r,a){n=Et(n),r=it(r);var d=r?us(n):0;return r&&d<r?rc(r-d,a)+n:n}function u_(n,r,a){return a||r==null?r=0:r&&(r=+r),v8(Et(n).replace(S1,""),r||0)}function h_(n,r,a){return(a?Te(n,r,a):r===i)?r=1:r=it(r),ru(Et(n),r)}function d_(){var n=arguments,r=Et(n[0]);return n.length<3?r:r.replace(n[1],n[2])}var f_=vs(function(n,r,a){return n+(a?"_":"")+r.toLowerCase()});function p_(n,r,a){return a&&typeof a!="number"&&Te(n,r,a)&&(r=a=i),a=a===i?Pe:a>>>0,a?(n=Et(n),n&&(typeof r=="string"||r!=null&&!ku(r))&&(r=ri(r),!r&&ls(n))?Kn(Fi(n),0,a):n.split(r,a)):[]}var g_=vs(function(n,r,a){return n+(a?" ":"")+Tu(r)});function m_(n,r,a){return n=Et(n),a=a==null?0:_r(it(a),0,n.length),r=ri(r),n.slice(a,a+r.length)==r}function v_(n,r,a){var d=g.templateSettings;a&&Te(n,r,a)&&(r=i),n=Et(n),r=mc({},r,d,Uf);var p=mc({},r.imports,d.imports,Uf),v=le(p),w=H1(p,v),y,x,T=0,I=r.interpolate||Ma,B="__p += '",O=G1((r.escape||Ma).source+"|"+I.source+"|"+(I===s3?K6:Ma).source+"|"+(r.evaluate||Ma).source+"|$","g"),V="//# sourceURL="+(At.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++S7+"]")+`
|
|
3151
|
+
`;n.replace(O,function(Y,ot,ft,oi,Ie,ai){return ft||(ft=oi),B+=n.slice(T,ai).replace(n7,Z7),ot&&(y=!0,B+=`' +
|
|
3152
|
+
__e(`+ot+`) +
|
|
3153
|
+
'`),Ie&&(x=!0,B+=`';
|
|
3154
|
+
`+Ie+`;
|
|
3155
|
+
__p += '`),ft&&(B+=`' +
|
|
3156
|
+
((__t = (`+ft+`)) == null ? '' : __t) +
|
|
3157
|
+
'`),T=ai+Y.length,Y}),B+=`';
|
|
3158
|
+
`;var K=At.call(r,"variable")&&r.variable;if(!K)B=`with (obj) {
|
|
3159
|
+
`+B+`
|
|
3160
|
+
}
|
|
3161
|
+
`;else if(j6.test(K))throw new Q(u);B=(x?B.replace(F6,""):B).replace(B6,"$1").replace(R6,"$1;"),B="function("+(K||"obj")+`) {
|
|
3162
|
+
`+(K?"":`obj || (obj = {});
|
|
3163
|
+
`)+"var __t, __p = ''"+(y?", __e = _.escape":"")+(x?`, __j = Array.prototype.join;
|
|
3164
|
+
function print() { __p += __j.call(arguments, '') }
|
|
3165
|
+
`:`;
|
|
3166
|
+
`)+B+`return __p
|
|
3167
|
+
}`;var nt=T4(function(){return _t(v,V+"return "+B).apply(i,w)});if(nt.source=B,Su(nt))throw nt;return nt}function __(n){return Et(n).toLowerCase()}function w_(n){return Et(n).toUpperCase()}function b_(n,r,a){if(n=Et(n),n&&(a||r===i))return U3(n);if(!n||!(r=ri(r)))return n;var d=Fi(n),p=Fi(r),v=$3(d,p),w=N3(d,p)+1;return Kn(d,v,w).join("")}function y_(n,r,a){if(n=Et(n),n&&(a||r===i))return n.slice(0,V3(n)+1);if(!n||!(r=ri(r)))return n;var d=Fi(n),p=N3(d,Fi(r))+1;return Kn(d,0,p).join("")}function C_(n,r,a){if(n=Et(n),n&&(a||r===i))return n.replace(S1,"");if(!n||!(r=ri(r)))return n;var d=Fi(n),p=$3(d,Fi(r));return Kn(d,p).join("")}function x_(n,r){var a=kt,d=Zt;if(Vt(r)){var p="separator"in r?r.separator:p;a="length"in r?it(r.length):a,d="omission"in r?ri(r.omission):d}n=Et(n);var v=n.length;if(ls(n)){var w=Fi(n);v=w.length}if(a>=v)return n;var y=a-us(d);if(y<1)return d;var x=w?Kn(w,0,y).join(""):n.slice(0,y);if(p===i)return x+d;if(w&&(y+=x.length-y),ku(p)){if(n.slice(y).search(p)){var T,I=x;for(p.global||(p=G1(p.source,Et(o3.exec(p))+"g")),p.lastIndex=0;T=p.exec(I);)var B=T.index;x=x.slice(0,B===i?y:B)}}else if(n.indexOf(ri(p),y)!=y){var O=x.lastIndexOf(p);O>-1&&(x=x.slice(0,O))}return x+d}function E_(n){return n=Et(n),n&&D6.test(n)?n.replace(n3,Q7):n}var A_=vs(function(n,r,a){return n+(a?" ":"")+r.toUpperCase()}),Tu=If("toUpperCase");function M4(n,r,a){return n=Et(n),r=a?i:r,r===i?j7(n)?i8(n):$7(n):n.match(r)||[]}var T4=rt(function(n,r){try{return ii(n,i,r)}catch(a){return Su(a)?a:new Q(a)}}),S_=vn(function(n,r){return _i(r,function(a){a=Yi(a),gn(n,a,Eu(n[a],n))}),n});function k_(n){var r=n==null?0:n.length,a=j();return n=r?$t(n,function(d){if(typeof d[1]!="function")throw new wi(l);return[a(d[0]),d[1]]}):[],rt(function(d){for(var p=-1;++p<r;){var v=n[p];if(ii(v[0],this,d))return ii(v[1],this,d)}})}function L_(n){return Q8(yi(n,m))}function Iu(n){return function(){return n}}function M_(n,r){return n==null||n!==n?r:n}var T_=Bf(),I_=Bf(!0);function ze(n){return n}function Fu(n){return lf(typeof n=="function"?n:yi(n,m))}function F_(n){return hf(yi(n,m))}function B_(n,r){return df(n,yi(r,m))}var R_=rt(function(n,r){return function(a){return fo(a,n,r)}}),D_=rt(function(n,r){return function(a){return fo(n,a,r)}});function Bu(n,r,a){var d=le(r),p=Ya(r,d);a==null&&!(Vt(r)&&(p.length||!d.length))&&(a=r,r=n,n=this,p=Ya(r,le(r)));var v=!(Vt(a)&&"chain"in a)||!!a.chain,w=wn(n);return _i(p,function(y){var x=r[y];n[y]=x,w&&(n.prototype[y]=function(){var T=this.__chain__;if(v||T){var I=n(this.__wrapped__),B=I.__actions__=He(this.__actions__);return B.push({func:x,args:arguments,thisArg:n}),I.__chain__=T,I}return x.apply(n,zn([this.value()],arguments))})}),n}function O_(){return de._===this&&(de._=c8),this}function Ru(){}function P_(n){return n=it(n),rt(function(r){return ff(r,n)})}var U_=hu($t),$_=hu(B3),N_=hu(O1);function I4(n){return _u(n)?P1(Yi(n)):mg(n)}function H_(n){return function(r){return n==null?i:wr(n,r)}}var V_=Df(),G_=Df(!0);function Du(){return[]}function Ou(){return!1}function z_(){return{}}function W_(){return""}function Z_(){return!0}function q_(n,r){if(n=it(n),n<1||n>ei)return[];var a=Pe,d=ve(n,Pe);r=j(r),n-=Pe;for(var p=N1(d,r);++a<n;)r(a);return p}function j_(n){return tt(n)?$t(n,Yi):si(n)?[n]:He(Yf(Et(n)))}function X_(n){var r=++o8;return Et(n)+r}var K_=nc(function(n,r){return n+r},0),Y_=du("ceil"),J_=nc(function(n,r){return n/r},1),Q_=du("floor");function tw(n){return n&&n.length?Ka(n,ze,Y1):i}function ew(n,r){return n&&n.length?Ka(n,j(r,2),Y1):i}function iw(n){return O3(n,ze)}function nw(n,r){return O3(n,j(r,2))}function rw(n){return n&&n.length?Ka(n,ze,eu):i}function sw(n,r){return n&&n.length?Ka(n,j(r,2),eu):i}var ow=nc(function(n,r){return n*r},1),aw=du("round"),cw=nc(function(n,r){return n-r},0);function lw(n){return n&&n.length?$1(n,ze):0}function uw(n,r){return n&&n.length?$1(n,j(r,2)):0}return g.after=Fm,g.ary=c4,g.assign=wv,g.assignIn=C4,g.assignInWith=mc,g.assignWith=bv,g.at=yv,g.before=l4,g.bind=Eu,g.bindAll=S_,g.bindKey=u4,g.castArray=zm,g.chain=s4,g.chunk=Qg,g.compact=t9,g.concat=e9,g.cond=k_,g.conforms=L_,g.constant=Iu,g.countBy=lm,g.create=Cv,g.curry=h4,g.curryRight=d4,g.debounce=f4,g.defaults=xv,g.defaultsDeep=Ev,g.defer=Bm,g.delay=Rm,g.difference=i9,g.differenceBy=n9,g.differenceWith=r9,g.drop=s9,g.dropRight=o9,g.dropRightWhile=a9,g.dropWhile=c9,g.fill=l9,g.filter=hm,g.flatMap=pm,g.flatMapDeep=gm,g.flatMapDepth=mm,g.flatten=e4,g.flattenDeep=u9,g.flattenDepth=h9,g.flip=Dm,g.flow=T_,g.flowRight=I_,g.fromPairs=d9,g.functions=Iv,g.functionsIn=Fv,g.groupBy=vm,g.initial=p9,g.intersection=g9,g.intersectionBy=m9,g.intersectionWith=v9,g.invert=Rv,g.invertBy=Dv,g.invokeMap=wm,g.iteratee=Fu,g.keyBy=bm,g.keys=le,g.keysIn=Ge,g.map=uc,g.mapKeys=Pv,g.mapValues=Uv,g.matches=F_,g.matchesProperty=B_,g.memoize=dc,g.merge=$v,g.mergeWith=x4,g.method=R_,g.methodOf=D_,g.mixin=Bu,g.negate=fc,g.nthArg=P_,g.omit=Nv,g.omitBy=Hv,g.once=Om,g.orderBy=ym,g.over=U_,g.overArgs=Pm,g.overEvery=$_,g.overSome=N_,g.partial=Au,g.partialRight=p4,g.partition=Cm,g.pick=Vv,g.pickBy=E4,g.property=I4,g.propertyOf=H_,g.pull=y9,g.pullAll=n4,g.pullAllBy=C9,g.pullAllWith=x9,g.pullAt=E9,g.range=V_,g.rangeRight=G_,g.rearg=Um,g.reject=Am,g.remove=A9,g.rest=$m,g.reverse=Cu,g.sampleSize=km,g.set=zv,g.setWith=Wv,g.shuffle=Lm,g.slice=S9,g.sortBy=Im,g.sortedUniq=B9,g.sortedUniqBy=R9,g.split=p_,g.spread=Nm,g.tail=D9,g.take=O9,g.takeRight=P9,g.takeRightWhile=U9,g.takeWhile=$9,g.tap=tm,g.throttle=Hm,g.thru=lc,g.toArray=w4,g.toPairs=A4,g.toPairsIn=S4,g.toPath=j_,g.toPlainObject=y4,g.transform=Zv,g.unary=Vm,g.union=N9,g.unionBy=H9,g.unionWith=V9,g.uniq=G9,g.uniqBy=z9,g.uniqWith=W9,g.unset=qv,g.unzip=xu,g.unzipWith=r4,g.update=jv,g.updateWith=Xv,g.values=bs,g.valuesIn=Kv,g.without=Z9,g.words=M4,g.wrap=Gm,g.xor=q9,g.xorBy=j9,g.xorWith=X9,g.zip=K9,g.zipObject=Y9,g.zipObjectDeep=J9,g.zipWith=Q9,g.entries=A4,g.entriesIn=S4,g.extend=C4,g.extendWith=mc,Bu(g,g),g.add=K_,g.attempt=T4,g.camelCase=t_,g.capitalize=k4,g.ceil=Y_,g.clamp=Yv,g.clone=Wm,g.cloneDeep=qm,g.cloneDeepWith=jm,g.cloneWith=Zm,g.conformsTo=Xm,g.deburr=L4,g.defaultTo=M_,g.divide=J_,g.endsWith=e_,g.eq=Ri,g.escape=i_,g.escapeRegExp=n_,g.every=um,g.find=dm,g.findIndex=Qf,g.findKey=Av,g.findLast=fm,g.findLastIndex=t4,g.findLastKey=Sv,g.floor=Q_,g.forEach=o4,g.forEachRight=a4,g.forIn=kv,g.forInRight=Lv,g.forOwn=Mv,g.forOwnRight=Tv,g.get=Lu,g.gt=Km,g.gte=Ym,g.has=Bv,g.hasIn=Mu,g.head=i4,g.identity=ze,g.includes=_m,g.indexOf=f9,g.inRange=Jv,g.invoke=Ov,g.isArguments=Cr,g.isArray=tt,g.isArrayBuffer=Jm,g.isArrayLike=Ve,g.isArrayLikeObject=Yt,g.isBoolean=Qm,g.isBuffer=Yn,g.isDate=tv,g.isElement=ev,g.isEmpty=iv,g.isEqual=nv,g.isEqualWith=rv,g.isError=Su,g.isFinite=sv,g.isFunction=wn,g.isInteger=g4,g.isLength=pc,g.isMap=m4,g.isMatch=ov,g.isMatchWith=av,g.isNaN=cv,g.isNative=lv,g.isNil=hv,g.isNull=uv,g.isNumber=v4,g.isObject=Vt,g.isObjectLike=qt,g.isPlainObject=wo,g.isRegExp=ku,g.isSafeInteger=dv,g.isSet=_4,g.isString=gc,g.isSymbol=si,g.isTypedArray=ws,g.isUndefined=fv,g.isWeakMap=pv,g.isWeakSet=gv,g.join=_9,g.kebabCase=r_,g.last=xi,g.lastIndexOf=w9,g.lowerCase=s_,g.lowerFirst=o_,g.lt=mv,g.lte=vv,g.max=tw,g.maxBy=ew,g.mean=iw,g.meanBy=nw,g.min=rw,g.minBy=sw,g.stubArray=Du,g.stubFalse=Ou,g.stubObject=z_,g.stubString=W_,g.stubTrue=Z_,g.multiply=ow,g.nth=b9,g.noConflict=O_,g.noop=Ru,g.now=hc,g.pad=a_,g.padEnd=c_,g.padStart=l_,g.parseInt=u_,g.random=Qv,g.reduce=xm,g.reduceRight=Em,g.repeat=h_,g.replace=d_,g.result=Gv,g.round=aw,g.runInContext=C,g.sample=Sm,g.size=Mm,g.snakeCase=f_,g.some=Tm,g.sortedIndex=k9,g.sortedIndexBy=L9,g.sortedIndexOf=M9,g.sortedLastIndex=T9,g.sortedLastIndexBy=I9,g.sortedLastIndexOf=F9,g.startCase=g_,g.startsWith=m_,g.subtract=cw,g.sum=lw,g.sumBy=uw,g.template=v_,g.times=q_,g.toFinite=bn,g.toInteger=it,g.toLength=b4,g.toLower=__,g.toNumber=Ei,g.toSafeInteger=_v,g.toString=Et,g.toUpper=w_,g.trim=b_,g.trimEnd=y_,g.trimStart=C_,g.truncate=x_,g.unescape=E_,g.uniqueId=X_,g.upperCase=A_,g.upperFirst=Tu,g.each=o4,g.eachRight=a4,g.first=i4,Bu(g,function(){var n={};return Xi(g,function(r,a){At.call(g.prototype,a)||(n[a]=r)}),n}(),{chain:!1}),g.VERSION=s,_i(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){g[n].placeholder=g}),_i(["drop","take"],function(n,r){ut.prototype[n]=function(a){a=a===i?1:ae(it(a),0);var d=this.__filtered__&&!r?new ut(this):this.clone();return d.__filtered__?d.__takeCount__=ve(a,d.__takeCount__):d.__views__.push({size:ve(a,Pe),type:n+(d.__dir__<0?"Right":"")}),d},ut.prototype[n+"Right"]=function(a){return this.reverse()[n](a).reverse()}}),_i(["filter","map","takeWhile"],function(n,r){var a=r+1,d=a==Ae||a==Se;ut.prototype[n]=function(p){var v=this.clone();return v.__iteratees__.push({iteratee:j(p,3),type:a}),v.__filtered__=v.__filtered__||d,v}}),_i(["head","last"],function(n,r){var a="take"+(r?"Right":"");ut.prototype[n]=function(){return this[a](1).value()[0]}}),_i(["initial","tail"],function(n,r){var a="drop"+(r?"":"Right");ut.prototype[n]=function(){return this.__filtered__?new ut(this):this[a](1)}}),ut.prototype.compact=function(){return this.filter(ze)},ut.prototype.find=function(n){return this.filter(n).head()},ut.prototype.findLast=function(n){return this.reverse().find(n)},ut.prototype.invokeMap=rt(function(n,r){return typeof n=="function"?new ut(this):this.map(function(a){return fo(a,n,r)})}),ut.prototype.reject=function(n){return this.filter(fc(j(n)))},ut.prototype.slice=function(n,r){n=it(n);var a=this;return a.__filtered__&&(n>0||r<0)?new ut(a):(n<0?a=a.takeRight(-n):n&&(a=a.drop(n)),r!==i&&(r=it(r),a=r<0?a.dropRight(-r):a.take(r-n)),a)},ut.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ut.prototype.toArray=function(){return this.take(Pe)},Xi(ut.prototype,function(n,r){var a=/^(?:filter|find|map|reject)|While$/.test(r),d=/^(?:head|last)$/.test(r),p=g[d?"take"+(r=="last"?"Right":""):r],v=d||/^find/.test(r);p&&(g.prototype[r]=function(){var w=this.__wrapped__,y=d?[1]:arguments,x=w instanceof ut,T=y[0],I=x||tt(w),B=function(ot){var ft=p.apply(g,zn([ot],y));return d&&O?ft[0]:ft};I&&a&&typeof T=="function"&&T.length!=1&&(x=I=!1);var O=this.__chain__,V=!!this.__actions__.length,K=v&&!O,nt=x&&!V;if(!v&&I){w=nt?w:new ut(this);var Y=n.apply(w,y);return Y.__actions__.push({func:lc,args:[B],thisArg:i}),new bi(Y,O)}return K&&nt?n.apply(this,y):(Y=this.thru(B),K?d?Y.value()[0]:Y.value():Y)})}),_i(["pop","push","shift","sort","splice","unshift"],function(n){var r=Da[n],a=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",d=/^(?:pop|shift)$/.test(n);g.prototype[n]=function(){var p=arguments;if(d&&!this.__chain__){var v=this.value();return r.apply(tt(v)?v:[],p)}return this[a](function(w){return r.apply(tt(w)?w:[],p)})}}),Xi(ut.prototype,function(n,r){var a=g[r];if(a){var d=a.name+"";At.call(ps,d)||(ps[d]=[]),ps[d].push({name:r,func:a})}}),ps[ic(i,M).name]=[{name:"wrapper",func:i}],ut.prototype.clone=E8,ut.prototype.reverse=A8,ut.prototype.value=S8,g.prototype.at=em,g.prototype.chain=im,g.prototype.commit=nm,g.prototype.next=rm,g.prototype.plant=om,g.prototype.reverse=am,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=cm,g.prototype.first=g.prototype.head,so&&(g.prototype[so]=sm),g},hs=n8();pr?((pr.exports=hs)._=hs,F1._=hs):de._=hs}).call(L5)}(Bs,Bs.exports)),Bs.exports}var N2=M5();const T5=(t="user")=>{var F;const e=pe(null),i=pe(null),[s,o]=Qn(t),[c,l]=Qn(!1),u=pe(null),h=pe(!1),f=pe(new Set),_=M=>{u.current=M};Si(()=>{const M=e.current;if(!M)return;const D=()=>{if(h.current&&u.current){const R=setTimeout(()=>{var $;($=u.current)==null||$.call(u),h.current=!1,f.current.delete(R)},100);f.current.add(R)}};return M.addEventListener("loadedmetadata",D),()=>{M.removeEventListener("loadedmetadata",D),f.current.forEach(R=>clearTimeout(R)),f.current.clear()}},[(F=e.current)==null?void 0:F.src]),Si(()=>()=>{f.current.forEach(M=>clearTimeout(M)),f.current.clear()},[]);const m=(M,D)=>q(null,null,function*(){try{i.current&&(i.current.getTracks().forEach(kt=>kt.stop()),i.current=null),e.current&&(e.current.srcObject=null);const R=yield navigator.mediaDevices.getUserMedia({video:{facingMode:M||s}});i.current=R;const N=R.getVideoTracks()[0].getSettings().facingMode;(N&&N!==(M||s)||N&&N!==s)&&o(N);const pt=(yield navigator.mediaDevices.enumerateDevices()).find(kt=>kt.kind==="videoinput"&&R.getVideoTracks()[0].getSettings().deviceId===kt.deviceId);D==null||D(pt==null?void 0:pt.label),e.current&&(e.current.srcObject=R,yield e.current.play())}catch(R){console.error("Failed to start camera:",R)}}),b=()=>q(null,null,function*(){const M=s==="user"?"environment":"user";h.current=!0;const D=s;try{o(M),i.current&&(i.current.getTracks().forEach(R=>R.stop()),i.current=null),yield m(M)}catch(R){o(D),h.current=!1;try{yield m(D)}catch($){console.error("Failed to restore previous camera:",$)}}}),E=()=>{const M=navigator.userAgent.toLowerCase(),D=M.includes("firefox")||M.includes("gecko")&&!M.includes("chrome")&&!M.includes("edge"),R="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",$=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:D||R||$,isChromium:M.includes("chrome")||M.includes("chromium")||M.includes("edge"),isWebKit:M.includes("webkit")&&!M.includes("chrome")}};return{videoRef:e,streamRef:i,facingMode:s,agentSupported:c,startCamera:m,switchCamera:b,checkAgentSupport:()=>q(null,null,function*(){var M,D;try{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>1){l(!0);return}const{isGecko:$}=E();let X=null,N=null;try{const J=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});X=(M=J.getVideoTracks()[0].getSettings().deviceId)!=null?M:null,J.getTracks().forEach(pt=>pt.stop())}catch(J){}try{const J=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});N=(D=J.getVideoTracks()[0].getSettings().deviceId)!=null?D:null,J.getTracks().forEach(pt=>pt.stop())}catch(J){}if(!(X&&N&&X!==N)){l(!1);return}l(!$)}catch(R){l(!1)}}),stopCamera:()=>{i.current&&(i.current.getTracks().forEach(M=>M.stop()),i.current=null),e.current&&(e.current.srcObject=null,e.current.load())},registerCameraSwitchCallback:_}};var Ir=typeof self!="undefined"?self:{};function er(){throw Error("Invalid UTF8")}function H2(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let Fo,Oc;const I5=typeof TextDecoder!="undefined";let F5;const B5=typeof TextEncoder!="undefined";function V2(t){if(B5)t=(F5||(F5=new TextEncoder)).encode(t);else{let i=0;const s=new Uint8Array(3*t.length);for(let o=0;o<t.length;o++){var e=t.charCodeAt(o);if(e<128)s[i++]=e;else{if(e<2048)s[i++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&o<t.length){const c=t.charCodeAt(++o);if(c>=56320&&c<=57343){e=1024*(e-55296)+c-56320+65536,s[i++]=e>>18|240,s[i++]=e>>12&63|128,s[i++]=e>>6&63|128,s[i++]=63&e|128;continue}o--}e=65533}s[i++]=e>>12|224,s[i++]=e>>6&63|128}s[i++]=63&e|128}}t=i===s.length?s:s.subarray(0,i)}return t}var Pc,Bo;t:{for(var G2=["CLOSURE_FLAGS"],Uc=Ir,$c=0;$c<G2.length;$c++)if((Uc=Uc[G2[$c]])==null){Bo=null;break t}Bo=Uc}var Rs,z2=Bo&&Bo[610401301];Pc=z2!=null&&z2;const W2=Ir.navigator;function Nc(t){return!!Pc&&!!Rs&&Rs.brands.some(({brand:e})=>e&&e.indexOf(t)!=-1)}function ci(t){var e;return(e=Ir.navigator)&&(e=e.userAgent)||(e=""),e.indexOf(t)!=-1}function An(){return!!Pc&&!!Rs&&Rs.brands.length>0}function Hc(){return An()?Nc("Chromium"):(ci("Chrome")||ci("CriOS"))&&!(!An()&&ci("Edge"))||ci("Silk")}function Ro(t){return Ro[" "](t),t}Rs=W2&&W2.userAgentData||null,Ro[" "]=function(){};var R5=!An()&&(ci("Trident")||ci("MSIE"));!ci("Android")||Hc(),Hc(),ci("Safari")&&(Hc()||!An()&&ci("Coast")||!An()&&ci("Opera")||!An()&&ci("Edge")||(An()?Nc("Microsoft Edge"):ci("Edg/"))||An()&&Nc("Opera"));var Z2={},Ds=null;function D5(t){const e=t.length;let i=3*e/4;i%3?i=Math.floor(i):"=.".indexOf(t[e-1])!=-1&&(i="=.".indexOf(t[e-2])!=-1?i-2:i-1);const s=new Uint8Array(i);let o=0;return function(c,l){function u(f){for(;h<c.length;){const _=c.charAt(h++),m=Ds[_];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(_))throw Error("Unknown base64 encoding at char: "+_)}return f}q2();let h=0;for(;;){const f=u(-1),_=u(0),m=u(64),b=u(64);if(b===64&&f===-1)break;l(f<<2|_>>4),m!=64&&(l(_<<4&240|m>>2),b!=64&&l(m<<6&192|b))}}(t,function(c){s[o++]=c}),o!==i?s.subarray(0,o):s}function q2(){if(!Ds){Ds={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const s=t.concat(e[i].split(""));Z2[i]=s;for(let o=0;o<s.length;o++){const c=s[o];Ds[c]===void 0&&(Ds[c]=o)}}}}var j2=typeof Uint8Array!="undefined",X2=!R5&&typeof btoa=="function";function K2(t){if(!X2){var e;e===void 0&&(e=0),q2(),e=Z2[e];var i=Array(Math.floor(t.length/3)),s=e[64]||"";let h=0,f=0;for(;h<t.length-2;h+=3){var o=t[h],c=t[h+1],l=t[h+2],u=e[o>>2];o=e[(3&o)<<4|c>>4],c=e[(15&c)<<2|l>>6],l=e[63&l],i[f++]=u+o+c+l}switch(u=0,l=s,t.length-h){case 2:l=e[(15&(u=t[h+1]))<<2]||s;case 1:t=t[h],i[f]=e[t>>2]+e[(3&t)<<4|u>>4]+l+s}return i.join("")}for(e="",i=0,s=t.length-10240;i<s;)e+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));return e+=String.fromCharCode.apply(null,i?t.subarray(i):t),btoa(e)}const Y2=/[-_.]/g,O5={"-":"+",_:"/",".":"="};function P5(t){return O5[t]||""}function J2(t){if(!X2)return D5(t);Y2.test(t)&&(t=t.replace(Y2,P5)),t=atob(t);const e=new Uint8Array(t.length);for(let i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}function ir(t){return j2&&t!=null&&t instanceof Uint8Array}var Fr={};function nr(){return U5||(U5=new tn(null,Fr))}function Vc(t){Q2(Fr);var e=t.g;return(e=e==null||ir(e)?e:typeof e=="string"?J2(e):null)==null?e:t.g=e}var tn=class{h(){return new Uint8Array(Vc(this)||0)}constructor(t,e){if(Q2(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}};let U5,Gc;function Q2(t){if(t!==Fr)throw Error("illegal external caller")}function th(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function zc(t){return th(t=Error(t),"warning"),t}function Wc(t){if(t!=null){var e=Gc!=null?Gc:Gc={},i=e[t]||0;i>=5||(e[t]=i+1,th(t=Error(),"incident"),function(s){Ir.setTimeout(()=>{throw s},0)}(t))}}var Do=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Br(t,e,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var $5=Br("jas",void 0,!0),eh=Br(void 0,"0di"),Os=Br(void 0,"1oa"),Rr=Br(void 0,Symbol()),N5=Br(void 0,"0actk"),ih=Br(void 0,"8utk");const z=Do?$5:"Ea",nh={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},rh=Object.defineProperties;function Oo(t,e){Do||z in t||rh(t,nh),t[z]|=e}function te(t,e){Do||z in t||rh(t,nh),t[z]=e}function Dr(t){return Oo(t,34),t}function H5(t,e){te(e,-15615&(0|t))}function Zc(t,e){te(e,-15581&(34|t))}function Po(){return typeof BigInt=="function"}function Be(t){return Array.prototype.slice.call(t)}var qc,Ps={};function Uo(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}function jc(t,e){if(t!=null){if(typeof t=="string")t=t?new tn(t,Fr):nr();else if(t.constructor!==tn)if(ir(t))t=t.length?new tn(new Uint8Array(t),Fr):nr();else{if(!e)throw Error();t=void 0}}return t}const sh=[];function Sn(t){if(2&t)throw Error()}te(sh,55),qc=Object.freeze(sh);class oh{constructor(e,i,s){this.g=e,this.h=i,this.l=s}next(){const e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}}function Xc(t){return Rr?t[Rr]:void 0}var V5=Object.freeze({});function $o(t){return t.Na=!0,t}var G5=$o(t=>typeof t=="number"),ah=$o(t=>typeof t=="string"),z5=$o(t=>typeof t=="boolean"),No=typeof Ir.BigInt=="function"&&typeof Ir.BigInt(0)=="bigint";function kn(t){var e=t;if(ah(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(G5(e)&&!Number.isSafeInteger(e))throw Error(String(e));return No?BigInt(t):t=z5(t)?t?"1":"0":ah(t)?t.trim()||"0":String(t)}var Kc=$o(t=>No?t>=Z5&&t<=j5:t[0]==="-"?ch(t,W5):ch(t,q5));const W5=Number.MIN_SAFE_INTEGER.toString(),Z5=No?BigInt(Number.MIN_SAFE_INTEGER):void 0,q5=Number.MAX_SAFE_INTEGER.toString(),j5=No?BigInt(Number.MAX_SAFE_INTEGER):void 0;function ch(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let i=0;i<t.length;i++){const s=t[i],o=e[i];if(s>o)return!1;if(s<o)return!0}}const X5=typeof Uint8Array.prototype.slice=="function";let lh,St=0,zt=0;function uh(t){const e=t>>>0;St=e,zt=(t-e)/4294967296>>>0}function rr(t){if(t<0){uh(-t);const[e,i]=tl(St,zt);St=e>>>0,zt=i>>>0}else uh(t)}function Yc(t){const e=lh||(lh=new DataView(new ArrayBuffer(8)));e.setFloat32(0,+t,!0),zt=0,St=e.getUint32(0,!0)}function Jc(t,e){const i=4294967296*e+(t>>>0);return Number.isSafeInteger(i)?i:Us(t,e)}function Qc(t,e){const i=2147483648&e;return i&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=Jc(t,e))=="number"?i?-t:t:i?"-"+t:t}function Us(t,e){if(t>>>=0,(e>>>=0)<=2097151)var i=""+(4294967296*e+t);else Po()?i=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(i=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),i+=8147497*e,e*=2,t>=1e7&&(i+=t/1e7>>>0,t%=1e7),i>=1e7&&(e+=i/1e7>>>0,i%=1e7),i=e+hh(i)+hh(t));return i}function hh(t){return t=String(t),"0000000".slice(t.length)+t}function dh(){var t=St,e=zt;if(2147483648&e)if(Po())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[i,s]=tl(t,e);t="-"+Us(i,s)}else t=Us(t,e);return t}function Ho(t){if(t.length<16)rr(Number(t));else if(Po())t=BigInt(t),St=Number(t&BigInt(4294967295))>>>0,zt=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");zt=St=0;const i=t.length;for(let s=e,o=(i-e)%6+e;o<=i;s=o,o+=6){const c=Number(t.slice(s,o));zt*=1e6,St=1e6*St+c,St>=4294967296&&(zt+=Math.trunc(St/4294967296),zt>>>=0,St>>>=0)}if(e){const[s,o]=tl(St,zt);St=s,zt=o}}}function tl(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}const $s=typeof BigInt=="function"?BigInt.asIntN:void 0,K5=typeof BigInt=="function"?BigInt.asUintN:void 0,Ln=Number.isSafeInteger,Vo=Number.isFinite,Or=Math.trunc,Y5=kn(0);function Mn(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function fh(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}const J5=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ns(t){switch(typeof t){case"bigint":return!0;case"number":return Vo(t);case"string":return J5.test(t);default:return!1}}function Pr(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Vo(t)?0|t:void 0}function ph(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Vo(t)?t>>>0:void 0}function gh(t){if(t[0]==="-")return!1;const e=t.length;return e<20||e===20&&Number(t.substring(0,6))<184467}function mh(t){const e=t.length;return t[0]==="-"?e<20||e===20&&Number(t.substring(0,7))>-922337:e<19||e===19&&Number(t.substring(0,6))<922337}function vh(t){return mh(t)?t:(Ho(t),dh())}function el(t){return t=Or(t),Ln(t)||(rr(t),t=Qc(St,zt)),t}function _h(t){var e=Or(Number(t));return Ln(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),vh(t))}function wh(t){var e=Or(Number(t));return Ln(e)?kn(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Po()?kn($s(64,BigInt(t))):kn(vh(t)))}function bh(t){if(Ln(t))t=kn(el(t));else{if(t=Or(t),Ln(t))t=String(t);else{const e=String(t);mh(e)?t=e:(rr(t),t=dh())}t=kn(t)}return t}function il(t){return t==null?t:typeof t=="bigint"?(Kc(t)?t=Number(t):(t=$s(64,t),t=Kc(t)?Number(t):String(t)),t):Ns(t)?typeof t=="number"?el(t):_h(t):void 0}function Q5(t){if(t==null)return t;var e=typeof t;if(e==="bigint")return String(K5(64,t));if(Ns(t)){if(e==="string")return e=Or(Number(t)),Ln(e)&&e>=0?t=String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),gh(t)||(Ho(t),t=Us(St,zt))),t;if(e==="number")return(t=Or(t))>=0&&Ln(t)?t:function(i){if(i<0){rr(i);var s=Us(St,zt);return i=Number(s),Ln(i)?i:s}return gh(s=String(i))?s:(rr(i),Jc(St,zt))}(t)}}function yh(t){if(typeof t!="string")throw Error();return t}function Ur(t){if(t!=null&&typeof t!="string")throw Error();return t}function $r(t){return t==null||typeof t=="string"?t:void 0}function nl(t,e,i,s){if(t!=null&&typeof t=="object"&&t.W===Ps)return t;if(!Array.isArray(t))return i?2&s?((t=e[eh])||(Dr((t=new e).u),t=e[eh]=t),e=t):e=new e:e=void 0,e;let o=i=0|t[z];return o===0&&(o|=32&s),o|=2&s,o!==i&&te(t,o),new e(t)}function tp(t,e,i){if(e)t:{if(!Ns(e=t))throw zc("int64");switch(typeof e){case"string":e=wh(e);break t;case"bigint":e=kn($s(64,e));break t;default:e=bh(e)}}else t=typeof(e=t),e=e==null?e:t==="bigint"?kn($s(64,e)):Ns(e)?t==="string"?wh(e):bh(e):void 0;return(t=e)==null?i?Y5:void 0:t}function ep(t){return t}const ip={};let np=function(){try{return Ro(new class extends Map{constructor(){super()}}),!1}catch(t){return!0}}();class rl{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,i){return this.g.set(e,i),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,i){return this.g.forEach(e,i)}[Symbol.iterator](){return this.entries()}}const rp=np?(Object.setPrototypeOf(rl.prototype,Map.prototype),Object.defineProperties(rl.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),rl):class extends Map{constructor(){super()}};function Ch(t){return t}function sl(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var Pi=class extends rp{constructor(t,e,i=Ch,s=Ch){super();let o=0|t[z];o|=64,te(t,o),this.M=o,this.I=e,this.S=i,this.X=this.I?sp:s;for(let c=0;c<t.length;c++){const l=t[c],u=i(l[0],!1,!0);let h=l[1];e?h===void 0&&(h=null):h=s(l[1],!1,!0,void 0,void 0,o),super.set(u,h)}}La(){var t=up;if(this.size!==0)return Array.from(super.entries(),e=>(e[0]=t(e[0]),e[1]=t(e[1]),e))}da(t=op){const e=[],i=super.entries();for(var s;!(s=i.next()).done;)(s=s.value)[0]=t(s[0]),s[1]=t(s[1]),e.push(s);return e}clear(){sl(this),super.clear()}delete(t){return sl(this),super.delete(this.S(t,!0,!1))}entries(){if(this.I){var t=super.keys();t=new oh(t,ap,this)}else t=super.entries();return t}values(){if(this.I){var t=super.keys();t=new oh(t,Pi.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.I?super.forEach((i,s,o)=>{t.call(e,o.get(s),s,o)}):super.forEach(t,e)}set(t,e){return sl(this),(t=this.S(t,!0,!1))==null?this:e==null?(super.delete(t),this):super.set(t,this.X(e,!0,!0,this.I,!1,this.M))}Ja(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.I?t===void 0?null:t:this.X(t,!1,!0,void 0,!1,this.M),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(e!==void 0){var i=this.I;return i?((i=this.X(e,!1,!0,i,this.pa,this.M))!==e&&super.set(t,i),i):e}}[Symbol.iterator](){return this.entries()}};function sp(t,e,i,s,o,c){return t=nl(t,s,i,c),o&&(t=Zo(t)),t}function op(t){return t}function ap(t){return[t,this.get(t)]}let cp,Go,xh,lp;function Eh(){return cp||(cp=new Pi(Dr([]),void 0,void 0,void 0,ip))}function ol(t,e,i,s,o){if(t!=null){if(Array.isArray(t)){const c=0|t[z];return t.length===0&&1&c?void 0:o&&2&c?t:zo(t,e,i,s!==void 0,o)}return e(t,s)}}function zo(t,e,i,s,o){const c=s||i?0|t[z]:0,l=s?!!(32&c):void 0;let u=0;const h=(s=Be(t)).length;for(let A=0;A<h;A++){var f=s[A];if(A===h-1&&Uo(f)){var _=e,m=i,b=l,E=o;let k;for(let F in f){const M=ol(f[F],_,m,b,E);M!=null&&((k!=null?k:k={})[F]=M)}f=k}else f=ol(s[A],e,i,l,o);s[A]=f,f!=null&&(u=A+1)}return u<h&&(s.length=u),i&&((t=Xc(t))&&(s[Rr]=Be(t)),i(c,s)),s}function up(t){return ol(t,al,void 0,void 0,!1)}function al(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Kc(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(ir(t))return ir(t)&&Wc(ih),K2(t);if(t.W===Ps)return Ah(t);if(t instanceof tn){const e=t.g;return e==null?"":typeof e=="string"?e:t.g=K2(e)}return t instanceof Pi?t.La():void 0}return t}function Ah(t){var e=t.u;t=zo(e,al,void 0,void 0,!1);var i=0|e[z];if((e=t.length)&&!(512&i)){var s=t[e-1],o=!1;Uo(s)?(e--,o=!0):s=void 0;var c=e-(i=512&i?0:-1),l=(Go!=null?Go:ep)(c,i,t,s);if(s&&(t[e]=void 0),c<l&&s){for(var u in c=!0,s){const h=+u;h<=l?(t[o=h+i]=s[u],e=Math.max(o+1,e),o=!1,delete s[u]):c=!1}c&&(s=void 0)}for(c=e-1;e>0;c=e-1)if((u=t[c])==null)e--,o=!0;else{if(!((c-=i)>=l))break;(s!=null?s:s={})[c]=u,e--,o=!0}o&&(t.length=e),s&&t.push(s)}return t}function Tn(t,e,i){return t=Sh(t,e[0],e[1],i?1:2),e!==xh&&i&&Oo(t,8192),t}function Sh(t,e,i,s){if(t==null){var o=96;i?(t=[i],o|=512):t=[],e&&(o=-16760833&o|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(o=0|t[z])||!(64&o)||2&o||Wc(N5),1024&o)throw Error("farr");if(64&o)return t;if(s===1||s===2||(o|=64),i&&(o|=512,i!==t[0]))throw Error("mid");t:{var c=(i=t).length;if(c){var l=c-1;if(Uo(s=i[l])){if((l-=e=512&(o|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var u in s)(c=+u)<l&&(i[c+e]=s[u],delete s[u]);o=-16760833&o|(1023&l)<<14;break t}}if(e){if((u=Math.max(e,c-(512&o?0:-1)))>1024)throw Error("spvt");o=-16760833&o|(1023&u)<<14}}}return te(t,o),t}function cl(t,e,i=Zc){if(t!=null){if(j2&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var s=0|t[z];return 2&s?t:(e&&(e=s===0||!!(32&s)&&!(64&s||!(16&s))),e?(te(t,34|s),4&s&&Object.freeze(t),t):zo(t,cl,4&s?Zc:i,!0,!0))}return t.W===Ps?t=2&(s=0|(i=t.u)[z])?t:new t.constructor(Wo(i,s,!0)):t instanceof Pi&&!(2&t.M)&&(i=Dr(t.da(cl)),t=new Pi(i,t.I,t.S,t.X)),t}}function Wo(t,e,i){const s=i||2&e?Zc:H5,o=!!(32&e);return t=function(c,l,u){const h=Be(c);var f=h.length;const _=256&l?h[f-1]:void 0;for(f+=_?-1:0,l=512&l?1:0;l<f;l++)h[l]=u(h[l]);if(_){l=h[l]={};for(const m in _)l[m]=u(_[m])}return(c=Xc(c))&&(h[Rr]=Be(c)),h}(t,e,c=>cl(c,o,s)),Oo(t,32|(i?2:0)),t}function Zo(t){const e=t.u,i=0|e[z];return 2&i?new t.constructor(Wo(e,i,!1)):t}function Nr(t,e){return en(t=t.u,0|t[z],e)}function en(t,e,i){if(i===-1)return null;const s=i+(512&e?0:-1),o=t.length-1;return s>=o&&256&e?t[o][i]:s<=o?t[s]:void 0}function Mt(t,e,i){const s=t.u;let o=0|s[z];return Sn(o),Ht(s,o,e,i),t}function Ht(t,e,i,s){const o=512&e?0:-1,c=i+o;var l=t.length-1;return c>=l&&256&e?(t[l][i]=s,e):c<=l?(t[c]=s,e):(s!==void 0&&(i>=(l=e>>14&1023||536870912)?s!=null&&(t[l+o]={[i]:s},te(t,e|=256)):t[c]=s),e)}function qo(t,e){let i=0|(t=t.u)[z];const s=en(t,i,e),o=Mn(s);return o!=null&&o!==s&&Ht(t,i,e,o),o}function kh(t){let e=0|(t=t.u)[z];const i=en(t,e,1),s=jc(i,!0);return s!=null&&s!==i&&Ht(t,e,1,s),s}function sr(){return V5===void 0?2:4}function or(t,e,i,s,o){const c=t.u,l=2&(t=0|c[z])?1:s;o=!!o;let u=0|(s=ll(c,t,e))[z];if(!(4&u)){4&u&&(s=Be(s),u=sn(u,t),t=Ht(c,t,e,s));let h=0,f=0;for(;h<s.length;h++){const _=i(s[h]);_!=null&&(s[f++]=_)}f<h&&(s.length=f),u=ul(u,t),i=-2049&(20|u),u=i&=-4097,te(s,u),2&u&&Object.freeze(s)}return l===1||l===4&&32&u?nn(u)||(o=u,u|=2,u!==o&&te(s,u),Object.freeze(s)):(l===2&&nn(u)&&(s=Be(s),u=sn(u,t),u=In(u,t,o),te(s,u),t=Ht(c,t,e,s)),nn(u)||(e=u,u=In(u,t,o),u!==e&&te(s,u))),s}function ll(t,e,i){return t=en(t,e,i),Array.isArray(t)?t:qc}function ul(t,e){return t===0&&(t=sn(t,e)),1|t}function nn(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function Lh(t){t=Be(t);for(let e=0;e<t.length;e++){const i=t[e]=Be(t[e]);Array.isArray(i[1])&&(i[1]=Dr(i[1]))}return t}function hl(t,e,i,s){let o=0|(t=t.u)[z];Sn(o),Ht(t,o,e,(s==="0"?Number(i)===0:i===s)?void 0:i)}function Hr(t,e,i,s){Sn(e);let o=ll(t,e,i);const c=o!==qc;if(64&e||!(8192&e)||!c){const l=c?0|o[z]:0;let u=l;(!c||2&u||nn(u)||4&u&&!(32&u))&&(o=Be(o),u=sn(u,e),e=Ht(t,e,i,o)),u=-13&ul(u,e),u=In(s?-17&u:16|u,e,!0),u!==l&&te(o,u)}return o}function dl(t,e){var i=L0;return pl(fl(t=t.u),t,0|t[z],i)===e?e:-1}function fl(t){var i;if(Do)return(i=t[Os])!=null?i:t[Os]=new Map;if(Os in t)return t[Os];const e=new Map;return Object.defineProperty(t,Os,{value:e}),e}function Mh(t,e,i,s){const o=fl(t),c=pl(o,t,e,i);return c!==s&&(c&&(e=Ht(t,e,c)),o.set(i,s)),e}function pl(t,e,i,s){let o=t.get(s);if(o!=null)return o;o=0;for(let c=0;c<s.length;c++){const l=s[c];en(e,i,l)!=null&&(o!==0&&(i=Ht(e,i,o)),o=l)}return t.set(s,o),o}function gl(t,e,i){let s=0|t[z];const o=en(t,s,i);let c;if(o!=null&&o.W===Ps)return(e=Zo(o))!==o&&Ht(t,s,i,e),e.u;if(Array.isArray(o)){const l=0|o[z];c=2&l?Tn(Wo(o,l,!1),e,!0):64&l?o:Tn(c,e,!0)}else c=Tn(void 0,e,!0);return c!==o&&Ht(t,s,i,c),c}function Th(t,e,i){let s=0|(t=t.u)[z];const o=en(t,s,i);return(e=nl(o,e,!1,s))!==o&&e!=null&&Ht(t,s,i,e),e}function gt(t,e,i){if((e=Th(t,e,i))==null)return e;let s=0|(t=t.u)[z];if(!(2&s)){const o=Zo(e);o!==e&&Ht(t,s,i,e=o)}return e}function Ih(t,e,i,s,o,c,l){t=t.u;var u=!!(2&e);const h=u?1:o;c=!!c,l&&(l=!u);var f=0|(o=ll(t,e,s))[z];if(!(u=!!(4&f))){var _=o,m=e;const b=!!(2&(f=ul(f,e)));b&&(m|=2);let E=!b,A=!0,k=0,F=0;for(;k<_.length;k++){const M=nl(_[k],i,!1,m);if(M instanceof i){if(!b){const D=!!(2&(0|M.u[z]));E&&(E=!D),A&&(A=D)}_[F++]=M}}F<k&&(_.length=F),f|=4,f=A?16|f:-17&f,te(_,f=E?8|f:-9&f),b&&Object.freeze(_)}if(l&&!(8&f||!o.length&&(h===1||h===4&&32&f))){for(nn(f)&&(o=Be(o),f=sn(f,e),e=Ht(t,e,s,o)),i=o,l=f,_=0;_<i.length;_++)(f=i[_])!==(m=Zo(f))&&(i[_]=m);l|=8,te(i,l=i.length?-17&l:16|l),f=l}return h===1||h===4&&32&f?nn(f)||(e=f,(f|=!o.length||16&f&&(!u||32&f)?2:1024)!==e&&te(o,f),Object.freeze(o)):(h===2&&nn(f)&&(te(o=Be(o),f=In(f=sn(f,e),e,c)),e=Ht(t,e,s,o)),nn(f)||(s=f,(f=In(f,e,c))!==s&&te(o,f))),o}function rn(t,e,i){const s=0|t.u[z];return Ih(t,s,e,i,sr(),!1,!(2&s))}function Z(t,e,i,s){return s==null&&(s=void 0),Mt(t,i,s)}function Hs(t,e,i,s){s==null&&(s=void 0);t:{let o=0|(t=t.u)[z];if(Sn(o),s==null){const c=fl(t);if(pl(c,t,o,i)!==e)break t;c.set(i,0)}else o=Mh(t,o,i,e);Ht(t,o,e,s)}}function sn(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function In(t,e,i){return 32&e&&i||(t&=-33),t}function jo(t,e,i){Sn(0|t.u[z]),or(t,e,$r,2,!0).push(yh(i))}function Xo(t,e,i,s){const o=0|t.u[z];Sn(o),t=Ih(t,o,i,e,2,!0),s=s!=null?s:new i,t.push(s),t[z]=2&(0|s.u[z])?-9&t[z]:-17&t[z]}function li(t,e){return Pr(Nr(t,e))}function ui(t,e){return $r(Nr(t,e))}function Xt(t,e){var i;return(i=qo(t,e))!=null?i:0}function Vs(t,e,i){if(i!=null&&typeof i!="boolean")throw t=typeof i,Error(`Expected boolean but got ${t!="object"?t:i?Array.isArray(i)?"array":t:"null"}: ${i}`);Mt(t,e,i)}function Ui(t,e,i){if(i!=null){if(typeof i!="number"||!Vo(i))throw zc("int32");i|=0}Mt(t,e,i)}function G(t,e,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);Mt(t,e,i)}function Ko(t,e,i){{const l=t.u;let u=0|l[z];if(Sn(u),i==null)Ht(l,u,e);else{var s=t=0|i[z],o=nn(t),c=o||Object.isFrozen(i);for(o||(t=0),c||(i=Be(i),s=0,t=In(t=sn(t,u),u,!0),c=!1),t|=21,o=0;o<i.length;o++){const h=i[o],f=yh(h);Object.is(h,f)||(c&&(i=Be(i),s=0,t=In(t=sn(t,u),u,!0),c=!1),i[o]=f)}t!==s&&(c&&(i=Be(i),t=In(t=sn(t,u),u,!0)),te(i,t)),Ht(l,u,e,i)}}}function Fh(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function ml(){return Error("Failed to read varint, encoding is invalid.")}function Bh(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function vl(t){if(typeof t=="string")return{buffer:J2(t),O:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:!1};if(t.constructor===Uint8Array)return{buffer:t,O:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:!1};if(t.constructor===tn)return{buffer:Vc(t)||new Uint8Array(0),O:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function _l(t,e){let i,s=0,o=0,c=0;const l=t.h;let u=t.g;do i=l[u++],s|=(127&i)<<c,c+=7;while(c<32&&128&i);for(c>32&&(o|=(127&i)>>4),c=3;c<32&&128&i;c+=7)i=l[u++],o|=(127&i)<<c;if(ar(t,u),i<128)return e(s>>>0,o>>>0);throw ml()}function wl(t){let e=0,i=t.g;const s=i+10,o=t.h;for(;i<s;){const c=o[i++];if(e|=c,(128&c)==0)return ar(t,i),!!(127&e)}throw ml()}function Fn(t){const e=t.h;let i=t.g,s=e[i++],o=127&s;if(128&s&&(s=e[i++],o|=(127&s)<<7,128&s&&(s=e[i++],o|=(127&s)<<14,128&s&&(s=e[i++],o|=(127&s)<<21,128&s&&(s=e[i++],o|=s<<28,128&s&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++])))))throw ml();return ar(t,i),o}function on(t){return Fn(t)>>>0}function bl(t){var e=t.h;const i=t.g,s=e[i],o=e[i+1],c=e[i+2];return e=e[i+3],ar(t,t.g+4),(s<<0|o<<8|c<<16|e<<24)>>>0}function yl(t){var e=bl(t);t=2*(e>>31)+1;const i=e>>>23&255;return e&=8388607,i==255?e?NaN:t*(1/0):i==0?1401298464324817e-60*t*e:t*Math.pow(2,i-150)*(e+8388608)}function hp(t){return Fn(t)}function Cl(t,e,{aa:i=!1}={}){t.aa=i,e&&(e=vl(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function ar(t,e){if(t.g=e,e>t.l)throw Bh(t.l,e)}function Rh(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const i=t.g,s=i+e;if(s>t.l)throw Bh(e,t.l-i);return t.g=s,i}function Dh(t,e){if(e==0)return nr();var i=Rh(t,e);return t.aa&&t.m?i=t.h.subarray(i,i+e):(t=t.h,i=i===(e=i+e)?new Uint8Array(0):X5?t.slice(i,e):new Uint8Array(t.subarray(i,e))),i.length==0?nr():new tn(i,Fr)}Pi.prototype.toJSON=void 0;var Oh=[];function Ph(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var i=on(t.g);if(e=i>>>3,!((i&=7)>=0&&i<=5))throw Fh(i,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=i,!0}function Yo(t){switch(t.h){case 0:t.h!=0?Yo(t):wl(t.g);break;case 1:ar(t=t.g,t.g+8);break;case 2:if(t.h!=2)Yo(t);else{var e=on(t.g);ar(t=t.g,t.g+e)}break;case 5:ar(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Ph(t))throw Error("Unmatched start-group tag: stream EOF");if(t.h==4){if(t.m!=e)throw Error("Unmatched end-group tag");break}Yo(t)}break;default:throw Fh(t.h,t.l)}}function Gs(t,e,i){const s=t.g.l,o=on(t.g),c=t.g.g+o;let l=c-s;if(l<=0&&(t.g.l=c,i(e,t,void 0,void 0,void 0),l=c-t.g.g),l)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-l} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=c,t.g.l=s,e}function xl(t){var e=on(t.g),i=Rh(t=t.g,e);if(t=t.h,I5){var s,o=t;(s=Oc)||(s=Oc=new TextDecoder("utf-8",{fatal:!0})),e=i+e,o=i===0&&e===o.length?o:o.subarray(i,e);try{var c=s.decode(o)}catch(u){if(Fo===void 0){try{s.decode(new Uint8Array([128]))}catch(h){}try{s.decode(new Uint8Array([97])),Fo=!0}catch(h){Fo=!1}}throw!Fo&&(Oc=void 0),u}}else{e=(c=i)+e,i=[];let u,h=null;for(;c<e;){var l=t[c++];l<128?i.push(l):l<224?c>=e?er():(u=t[c++],l<194||(192&u)!=128?(c--,er()):i.push((31&l)<<6|63&u)):l<240?c>=e-1?er():(u=t[c++],(192&u)!=128||l===224&&u<160||l===237&&u>=160||(192&(s=t[c++]))!=128?(c--,er()):i.push((15&l)<<12|(63&u)<<6|63&s)):l<=244?c>=e-2?er():(u=t[c++],(192&u)!=128||u-144+(l<<28)>>30!=0||(192&(s=t[c++]))!=128||(192&(o=t[c++]))!=128?(c--,er()):(l=(7&l)<<18|(63&u)<<12|(63&s)<<6|63&o,l-=65536,i.push(55296+(l>>10&1023),56320+(1023&l)))):er(),i.length>=8192&&(h=H2(h,i),i.length=0)}c=H2(h,i)}return c}function Uh(t){const e=on(t.g);return Dh(t.g,e)}function Jo(t,e,i){var s=on(t.g);for(s=t.g.g+s;t.g.g<s;)i.push(e(t.g))}var Qo=[];function ki(t,e,i){e.g?e.m(t,e.g,e.h,i):e.m(t,e.h,i)}var H=class{constructor(t,e){this.u=Sh(t,e)}toJSON(){try{var t=Ah(this)}finally{Go=void 0}return t}l(){var t=qp;return t.g?t.l(this,t.g,t.h):t.l(this,t.h,t.defaultValue)}clone(){const t=this.u;return new this.constructor(Wo(t,0|t[z],!1))}O(){return!!(2&(0|this.u[z]))}};function $h(t){return t?/^\d+$/.test(t)?(Ho(t),new El(St,zt)):null:dp||(dp=new El(0,0))}H.prototype.W=Ps,H.prototype.toString=function(){return this.u.toString()};var El=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let dp;function Nh(t){return t?/^-?\d+$/.test(t)?(Ho(t),new Al(St,zt)):null:fp||(fp=new Al(0,0))}var Al=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let fp;function Vr(t,e,i){for(;i>0||e>127;)t.g.push(127&e|128),e=(e>>>7|i<<25)>>>0,i>>>=7;t.g.push(e)}function Gr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function ta(t,e){if(e>=0)Gr(t,e);else{for(let i=0;i<9;i++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function zs(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function zr(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function Ze(t,e,i){Gr(t.g,8*e+i)}function Sl(t,e){return Ze(t,e,2),e=t.g.end(),zr(t,e),e.push(t.h),e}function kl(t,e){var i=e.pop();for(i=t.h+t.g.length()-i;i>127;)e.push(127&i|128),i>>>=7,t.h++;e.push(i),t.h++}function ea(t,e,i){Ze(t,e,2),Gr(t.g,i.length),zr(t,t.g.end()),zr(t,i)}function ia(t,e,i,s){i!=null&&(e=Sl(t,e),s(i,t),kl(t,e))}function Li(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Ll=Li(),Hh=Li(),Ml=Li(),Tl=Li(),Vh=Li(),Gh=Li(),Il=Li(),zh=Li(),Wh=Li(),Wr=class{constructor(t,e,i){this.g=t,this.h=e,t=Ll,this.l=!!t&&i===t||!1}};function na(t,e){return new Wr(t,e,Ll)}function Zh(t,e,i,s,o){ia(t,i,Kh(e,s),o)}const pp=na(function(t,e,i,s,o){return t.h===2&&(Gs(t,gl(e,s,i),o),!0)},Zh),gp=na(function(t,e,i,s,o){return t.h===2&&(Gs(t,gl(e,s,i),o),!0)},Zh);var ra=Symbol(),Fl=Symbol(),qh=Symbol(),jh=Symbol();let sa,oa;function cr(t,e,i,s){var o=s[t];if(o)return o;(o={}).Ma=s,o.T=function(m){switch(typeof m){case"boolean":return xh||(xh=[0,void 0,!0]);case"number":return m>0?void 0:m===0?lp||(lp=[0,void 0]):[-m,void 0];case"string":return[0,m];case"object":return m}}(s[0]);var c=s[1];let l=1;c&&c.constructor===Object&&(o.ga=c,typeof(c=s[++l])=="function"&&(o.la=!0,sa!=null||(sa=c),oa!=null||(oa=s[l+1]),c=s[l+=2]));const u={};for(;c&&Array.isArray(c)&&c.length&&typeof c[0]=="number"&&c[0]>0;){for(var h=0;h<c.length;h++)u[c[h]]=c;c=s[++l]}for(h=1;c!==void 0;){let m;typeof c=="number"&&(h+=c,c=s[++l]);var f=void 0;if(c instanceof Wr?m=c:(m=pp,l--),m==null?void 0:m.l){c=s[++l],f=s;var _=l;typeof c=="function"&&(c=c(),f[_]=c),f=c}for(_=h+1,typeof(c=s[++l])=="number"&&c<0&&(_-=c,c=s[++l]);h<_;h++){const b=u[h];f?i(o,h,m,f,b):e(o,h,m,b)}}return s[t]=o}function Xh(t){return Array.isArray(t)?t[0]instanceof Wr?t:[gp,t]:[t,void 0]}function Kh(t,e){return t instanceof H?t.u:Array.isArray(t)?Tn(t,e,!1):void 0}function Bl(t,e,i,s){const o=i.g;t[e]=s?(c,l,u)=>o(c,l,u,s):o}function Rl(t,e,i,s,o){const c=i.g;let l,u;t[e]=(h,f,_)=>c(h,f,_,u||(u=cr(Fl,Bl,Rl,s).T),l||(l=Dl(s)),o)}function Dl(t){let e=t[qh];if(e!=null)return e;const i=cr(Fl,Bl,Rl,t);return e=i.la?(s,o)=>sa(s,o,i):(s,o)=>{const c=0|s[z];for(;Ph(o)&&o.h!=4;){var l=o.m,u=i[l];if(u==null){var h=i.ga;h&&(h=h[l])&&(h=mp(h))!=null&&(u=i[l]=h)}u!=null&&u(o,s,l)||(l=(u=o).l,Yo(u),u.fa?u=void 0:(h=u.g.g-l,u.g.g=l,u=Dh(u.g,h)),l=s,u&&((h=l[Rr])?h.push(u):l[Rr]=[u]))}return 8192&c&&Dr(s),!0},t[qh]=e}function mp(t){const e=(t=Xh(t))[0].g;if(t=t[1]){const i=Dl(t),s=cr(Fl,Bl,Rl,t).T;return(o,c,l)=>e(o,c,l,s,i)}return e}function aa(t,e,i){t[e]=i.h}function ca(t,e,i,s){let o,c;const l=i.h;t[e]=(u,h,f)=>l(u,h,f,c||(c=cr(ra,aa,ca,s).T),o||(o=Yh(s)))}function Yh(t){let e=t[jh];if(!e){const i=cr(ra,aa,ca,t);e=(s,o)=>Jh(s,o,i),t[jh]=e}return e}function Jh(t,e,i){(function(s,o,c){const l=512&o?0:-1,u=s.length,h=u+((o=64&o?256&o:!!u&&Uo(s[u-1]))?-1:0);for(let f=0;f<h;f++)c(f-l,s[f]);if(o){s=s[u-1];for(const f in s)!isNaN(f)&&c(+f,s[f])}})(t,0|t[z]|(i.T[1]?512:0),(s,o)=>{if(o!=null){var c=function(l,u){var h=l[u];if(h)return h;if((h=l.ga)&&(h=h[u])){var f=(h=Xh(h))[0].h;if(h=h[1]){const _=Yh(h),m=cr(ra,aa,ca,h).T;h=l.la?oa(m,_):(b,E,A)=>f(b,E,A,m,_)}else h=f;return l[u]=h}}(i,s);c&&c(e,o,s)}}),(t=Xc(t))&&function(s,o){zr(s,s.g.end());for(let c=0;c<o.length;c++)zr(s,Vc(o[c])||new Uint8Array(0))}(e,t)}function Zr(t,e){if(Array.isArray(e)){var i=0|e[z];if(4&i)return e;for(var s=0,o=0;s<e.length;s++){const c=t(e[s]);c!=null&&(e[o++]=c)}return o<s&&(e.length=o),te(e,-6145&(5|i)),2&i&&Object.freeze(e),e}}function we(t,e,i){return new Wr(t,e,i)}function qr(t,e,i){return new Wr(t,e,i)}function be(t,e,i){Ht(t,0|t[z],e,i)}var vp=na(function(t,e,i,s,o){return t.h===2&&(t=Gs(t,Tn([void 0,void 0],s,!0),o),Sn(s=0|e[z]),(o=en(e,s,i))instanceof Pi?(2&o.M)!=0?((o=o.da()).push(t),Ht(e,s,i,o)):o.Ja(t):Array.isArray(o)?(2&(0|o[z])&&Ht(e,s,i,o=Lh(o)),o.push(t)):Ht(e,s,i,[t]),!0)},function(t,e,i,s,o){if(e instanceof Pi)e.forEach((c,l)=>{ia(t,i,Tn([l,c],s,!1),o)});else if(Array.isArray(e))for(let c=0;c<e.length;c++){const l=e[c];Array.isArray(l)&&ia(t,i,Tn(l,s,!1),o)}});function Qh(t,e,i){if(e=function(s){if(s==null)return s;const o=typeof s;if(o==="bigint")return String($s(64,s));if(Ns(s)){if(o==="string")return _h(s);if(o==="number")return el(s)}}(e),e!=null&&(typeof e=="string"&&Nh(e),e!=null))switch(Ze(t,i,0),typeof e){case"number":t=t.g,rr(e),Vr(t,St,zt);break;case"bigint":i=BigInt.asUintN(64,e),i=new Al(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Vr(t.g,i.h,i.g);break;default:i=Nh(e),Vr(t.g,i.h,i.g)}}function t0(t,e,i){(e=Pr(e))!=null&&e!=null&&(Ze(t,i,0),ta(t.g,e))}function e0(t,e,i){(e=fh(e))!=null&&(Ze(t,i,0),t.g.g.push(e?1:0))}function i0(t,e,i){(e=$r(e))!=null&&ea(t,i,V2(e))}function n0(t,e,i,s,o){ia(t,i,Kh(e,s),o)}function r0(t,e,i){e==null||typeof e=="string"||e instanceof tn||(ir(e)?ir(e)&&Wc(ih):e=void 0),e!=null&&ea(t,i,vl(e).buffer)}function s0(t,e,i){return(t.h===5||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,yl,e):e.push(yl(t.g)),!0)}var an=we(function(t,e,i){if(t.h!==1)return!1;var s=t.g;t=bl(s);const o=bl(s);s=2*(o>>31)+1;const c=o>>>20&2047;return t=4294967296*(1048575&o)+t,be(e,i,c==2047?t?NaN:s*(1/0):c==0?5e-324*s*t:s*Math.pow(2,c-1075)*(t+4503599627370496)),!0},function(t,e,i){(e=Mn(e))!=null&&(Ze(t,i,1),t=t.g,(i=lh||(lh=new DataView(new ArrayBuffer(8)))).setFloat64(0,+e,!0),St=i.getUint32(0,!0),zt=i.getUint32(4,!0),zs(t,St),zs(t,zt))},Li()),ee=we(function(t,e,i){return t.h===5&&(be(e,i,yl(t.g)),!0)},function(t,e,i){(e=Mn(e))!=null&&(Ze(t,i,5),t=t.g,Yc(e),zs(t,St))},Il),_p=qr(s0,function(t,e,i){if((e=Zr(Mn,e))!=null)for(let l=0;l<e.length;l++){var s=t,o=i,c=e[l];c!=null&&(Ze(s,o,5),s=s.g,Yc(c),zs(s,St))}},Il),Ol=qr(s0,function(t,e,i){if((e=Zr(Mn,e))!=null&&e.length){Ze(t,i,2),Gr(t.g,4*e.length);for(let s=0;s<e.length;s++)i=t.g,Yc(e[s]),zs(i,St)}},Il),Bn=we(function(t,e,i){return t.h===0&&(be(e,i,_l(t.g,Qc)),!0)},Qh,Gh),Pl=we(function(t,e,i){return t.h===0&&(be(e,i,(t=_l(t.g,Qc))===0?void 0:t),!0)},Qh,Gh),wp=we(function(t,e,i){return t.h===0&&(be(e,i,_l(t.g,Jc)),!0)},function(t,e,i){if((e=Q5(e))!=null&&(typeof e=="string"&&$h(e),e!=null))switch(Ze(t,i,0),typeof e){case"number":t=t.g,rr(e),Vr(t,St,zt);break;case"bigint":i=BigInt.asUintN(64,e),i=new El(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Vr(t.g,i.h,i.g);break;default:i=$h(e),Vr(t.g,i.h,i.g)}},Li()),Wt=we(function(t,e,i){return t.h===0&&(be(e,i,Fn(t.g)),!0)},t0,Tl),la=qr(function(t,e,i){return(t.h===0||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,Fn,e):e.push(Fn(t.g)),!0)},function(t,e,i){if((e=Zr(Pr,e))!=null&&e.length){i=Sl(t,i);for(let s=0;s<e.length;s++)ta(t.g,e[s]);kl(t,i)}},Tl),jr=we(function(t,e,i){return t.h===0&&(be(e,i,(t=Fn(t.g))===0?void 0:t),!0)},t0,Tl),Ot=we(function(t,e,i){return t.h===0&&(be(e,i,wl(t.g)),!0)},e0,Hh),Xr=we(function(t,e,i){return t.h===0&&(be(e,i,(t=wl(t.g))===!1?void 0:t),!0)},e0,Hh),ge=qr(function(t,e,i){return t.h===2&&(t=xl(t),Hr(e,0|e[z],i,!1).push(t),!0)},function(t,e,i){if((e=Zr($r,e))!=null)for(let l=0;l<e.length;l++){var s=t,o=i,c=e[l];c!=null&&ea(s,o,V2(c))}},Ml),Rn=we(function(t,e,i){return t.h===2&&(be(e,i,(t=xl(t))===""?void 0:t),!0)},i0,Ml),yt=we(function(t,e,i){return t.h===2&&(be(e,i,xl(t)),!0)},i0,Ml),re=function(t,e,i=Ll){return new Wr(t,e,i)}(function(t,e,i,s,o){return t.h===2&&(s=Tn(void 0,s,!0),Hr(e,0|e[z],i,!0).push(s),Gs(t,s,o),!0)},function(t,e,i,s,o){if(Array.isArray(e))for(let c=0;c<e.length;c++)n0(t,e[c],i,s,o)}),Ct=na(function(t,e,i,s,o,c){return t.h===2&&(Mh(e,0|e[z],c,i),Gs(t,e=gl(e,s,i),o),!0)},n0),o0=we(function(t,e,i){return t.h===2&&(be(e,i,Uh(t)),!0)},r0,zh),bp=qr(function(t,e,i){return(t.h===0||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,on,e):e.push(on(t.g)),!0)},function(t,e,i){if((e=Zr(ph,e))!=null)for(let l=0;l<e.length;l++){var s=t,o=i,c=e[l];c!=null&&(Ze(s,o,0),Gr(s.g,c))}},Vh),yp=we(function(t,e,i){return t.h===0&&(be(e,i,(t=on(t.g))===0?void 0:t),!0)},function(t,e,i){(e=ph(e))!=null&&e!=null&&(Ze(t,i,0),Gr(t.g,e))},Vh),qe=we(function(t,e,i){return t.h===0&&(be(e,i,Fn(t.g)),!0)},function(t,e,i){(e=Pr(e))!=null&&(e=parseInt(e,10),Ze(t,i,0),ta(t.g,e))},Wh);class Cp{constructor(e,i){this.h=e,this.g=i,this.l=gt,this.m=Z,this.defaultValue=void 0}register(){Ro(this)}}function Mi(t,e){return new Cp(t,e)}function Dn(t,e){return(i,s)=>{if(Qo.length){const c=Qo.pop();c.o(s),Cl(c.g,i,s),i=c}else i=new class{constructor(c,l){if(Oh.length){const u=Oh.pop();Cl(u,c,l),c=u}else c=new class{constructor(u,h){this.h=null,this.m=!1,this.g=this.l=this.j=0,Cl(this,u,h)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(c,l);this.g=c,this.l=this.g.g,this.h=this.m=-1,this.o(l)}o({fa:c=!1}={}){this.fa=c}}(i,s);try{const c=new t,l=c.u;Dl(e)(l,i);var o=c}finally{i.g.clear(),i.m=-1,i.h=-1,Qo.length<100&&Qo.push(i)}return o}}function ua(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const l=this.g;return this.g=[],l}}}};Jh(this.u,e,cr(ra,aa,ca,t)),zr(e,e.g.end());const i=new Uint8Array(e.h),s=e.l,o=s.length;let c=0;for(let l=0;l<o;l++){const u=s[l];i.set(u,c),c+=u.length}return e.l=[i],i}}var a0=class extends H{constructor(t){super(t)}},c0=[0,Rn,we(function(t,e,i){return t.h===2&&(be(e,i,(t=Uh(t))===nr()?void 0:t),!0)},function(t,e,i){if(e!=null){if(e instanceof H){const s=e.Oa;return void(s&&(e=s(e),e!=null&&ea(t,i,vl(e).buffer)))}if(Array.isArray(e))return}r0(t,e,i)},zh)];let Ul,l0=globalThis.trustedTypes;function u0(t){Ul===void 0&&(Ul=function(){let i=null;if(!l0)return i;try{const s=o=>o;i=l0.createPolicy("goog#html",{createHTML:s,createScript:s,createScriptURL:s})}catch(s){}return i}());var e=Ul;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function xp(t,...e){if(e.length===0)return u0(t[0]);let i=t[0];for(let s=0;s<e.length;s++)i+=encodeURIComponent(e[s])+t[s+1];return u0(i)}var h0=[0,Wt,qe,Ot,-1,la,qe,-1],Ep=class extends H{constructor(t){super(t)}},d0=[0,Ot,yt,Ot,qe,-1,qr(function(t,e,i){return(t.h===0||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,hp,e):e.push(Fn(t.g)),!0)},function(t,e,i){if((e=Zr(Pr,e))!=null&&e.length){i=Sl(t,i);for(let s=0;s<e.length;s++)ta(t.g,e[s]);kl(t,i)}},Wh),yt,-1,[0,Ot,-1],qe,Ot,-1],f0=[0,yt,-2],p0=class extends H{constructor(t){super(t)}},g0=[0],m0=[0,Wt,Ot,1,Ot,-3],je=class extends H{constructor(t){super(t,2)}},ie={};ie[336783863]=[0,yt,Ot,-1,Wt,[0,[1,2,3,4,5,6,7,8,9],Ct,g0,Ct,d0,Ct,f0,Ct,m0,Ct,h0,Ct,[0,yt,-2],Ct,[0,yt,qe],Ct,[0,qe,yt,-1],Ct,[0,qe,-1]],[0,yt],Ot,[0,[1,3],[2,4],Ct,[0,la],-1,Ct,[0,ge],-1,re,[0,yt,-1]],yt];var v0=[0,Pl,-1,Xr,-3,Pl,la,Rn,jr,Pl,-1,Xr,jr,Xr,-2,Rn];function Xe(t,e){hl(t,2,Ur(e),"")}function Tt(t,e){jo(t,3,e)}function dt(t,e){jo(t,4,e)}var ye=class extends H{constructor(t){super(t,500)}o(t){return Z(this,0,7,t)}},Ws=[-1,{}],_0=[0,yt,1,Ws],w0=[0,yt,ge,Ws];function Ke(t,e){Xo(t,1,ye,e)}function Ft(t,e){jo(t,10,e)}function mt(t,e){jo(t,15,e)}var Re=class extends H{constructor(t){super(t,500)}o(t){return Z(this,0,1001,t)}},b0=[-500,re,[-500,Rn,-1,ge,-3,[-2,ie,Ot],re,c0,jr,-1,_0,w0,re,[0,Rn,Xr],Rn,v0,jr,ge,987,ge],4,re,[-500,yt,-1,[-1,{}],998,yt],re,[-500,yt,ge,-1,[-2,{},Ot],997,ge,-1],jr,re,[-500,yt,ge,Ws,998,ge],ge,jr,_0,w0,re,[0,Rn,-1,Ws],ge,-2,v0,Rn,-1,Xr,[0,Xr,yp],978,Ws,re,c0];Re.prototype.g=ua(b0);var Ap=Dn(Re,b0),Sp=class extends H{constructor(t){super(t)}},y0=class extends H{constructor(t){super(t)}g(){return rn(this,Sp,1)}},C0=[0,re,[0,Wt,ee,yt,-1]],ha=Dn(y0,C0),kp=class extends H{constructor(t){super(t)}},Lp=class extends H{constructor(t){super(t)}},$l=class extends H{constructor(t){super(t)}h(){return gt(this,kp,2)}g(){return rn(this,Lp,5)}},x0=Dn(class extends H{constructor(t){super(t)}},[0,ge,la,Ol,[0,qe,[0,Wt,-3],[0,ee,-3],[0,Wt,-1,[0,re,[0,Wt,-2]]],re,[0,ee,-1,yt,ee]],yt,-1,Bn,re,[0,Wt,ee],ge,Bn]),E0=class extends H{constructor(t){super(t)}},Kr=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,ee,-4]]),A0=class extends H{constructor(t){super(t)}},Zs=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,ee,-4]]),Mp=class extends H{constructor(t){super(t)}},Tp=[0,Wt,-1,Ol,qe],S0=class extends H{constructor(t){super(t)}};S0.prototype.g=ua([0,ee,-4,Bn]);var Ip=class extends H{constructor(t){super(t)}},Fp=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,1,Wt,yt,C0],Bn]),k0=class extends H{constructor(t){super(t)}},Bp=class extends H{constructor(t){super(t)}ma(){const t=kh(this);return t==null?nr():t}},Rp=class extends H{constructor(t){super(t)}},L0=[1,2],Dp=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,L0,Ct,[0,Ol],Ct,[0,o0],Wt,yt],Bn]),Nl=class extends H{constructor(t){super(t)}},M0=[0,yt,Wt,ee,ge,-1],T0=class extends H{constructor(t){super(t)}},Op=[0,Ot,-1],I0=class extends H{constructor(t){super(t)}},da=[1,2,3,4,5],fa=class extends H{constructor(t){super(t)}g(){return kh(this)!=null}h(){return ui(this,2)!=null}},Pt=class extends H{constructor(t){super(t)}g(){var t;return(t=fh(Nr(this,2)))!=null?t:!1}},F0=[0,o0,yt,[0,Wt,Bn,-1],[0,wp,Bn]],Kt=[0,F0,Ot,[0,da,Ct,m0,Ct,d0,Ct,h0,Ct,g0,Ct,f0],qe],pa=class extends H{constructor(t){super(t)}},Hl=[0,Kt,ee,-1,Wt],Pp=Mi(502141897,pa);ie[502141897]=Hl;var Up=Dn(class extends H{constructor(t){super(t)}},[0,[0,qe,-1,_p,bp],Tp]),B0=class extends H{constructor(t){super(t)}},R0=class extends H{constructor(t){super(t)}},Vl=[0,Kt,ee,[0,Kt],Ot],D0=[0,Kt,Hl,Vl,ee,[0,[0,F0]]],$p=Mi(508968150,R0);ie[508968150]=D0,ie[508968149]=Vl;var O0=class extends H{constructor(t){super(t)}},Np=Mi(513916220,O0);ie[513916220]=[0,Kt,D0,Wt];var Yr=class extends H{constructor(t){super(t)}h(){return gt(this,Nl,2)}g(){Mt(this,2)}},P0=[0,Kt,M0];ie[478825465]=P0;var Hp=class extends H{constructor(t){super(t)}},U0=class extends H{constructor(t){super(t)}},Gl=class extends H{constructor(t){super(t)}},zl=class extends H{constructor(t){super(t)}},$0=class extends H{constructor(t){super(t)}},N0=[0,Kt,[0,Kt],P0,-1],H0=[0,Kt,ee,Wt],Wl=[0,Kt,ee],V0=[0,Kt,H0,Wl,ee],Vp=Mi(479097054,$0);ie[479097054]=[0,Kt,V0,N0],ie[463370452]=N0,ie[464864288]=H0;var Gp=Mi(462713202,zl);ie[462713202]=V0,ie[474472470]=Wl;var zp=class extends H{constructor(t){super(t)}},G0=class extends H{constructor(t){super(t)}},z0=class extends H{constructor(t){super(t)}},W0=class extends H{constructor(t){super(t)}},Zl=[0,Kt,ee,-1,Wt],ql=[0,Kt,ee,Ot];W0.prototype.g=ua([0,Kt,Wl,[0,Kt],Hl,Vl,Zl,ql]);var Z0=class extends H{constructor(t){super(t)}},Wp=Mi(456383383,Z0);ie[456383383]=[0,Kt,M0];var q0=class extends H{constructor(t){super(t)}},Zp=Mi(476348187,q0);ie[476348187]=[0,Kt,Op];var j0=class extends H{constructor(t){super(t)}},X0=class extends H{constructor(t){super(t)}},K0=[0,qe,-1],qp=Mi(458105876,class extends H{constructor(t){super(t)}g(){var t=this.u;const e=0|t[z],i=2&e;return t=function(s,o,c){var l=X0;const u=2&o;let h=!1;if(c==null){if(u)return Eh();c=[]}else if(c.constructor===Pi){if((2&c.M)==0||u)return c;c=c.da()}else Array.isArray(c)?h=!!(2&(0|c[z])):c=[];if(u){if(!c.length)return Eh();h||(h=!0,Dr(c))}else h&&(h=!1,c=Lh(c));return h||(64&(0|c[z])?c[z]&=-33:32&o&&Oo(c,32)),Ht(s,o,2,l=new Pi(c,l,tp,void 0)),l}(t,e,en(t,e,2)),!i&&X0&&(t.pa=!0),t}});ie[458105876]=[0,K0,vp,[!0,Bn,[0,yt,-1,ge]]];var jl=class extends H{constructor(t){super(t)}},Y0=Mi(458105758,jl);ie[458105758]=[0,Kt,yt,K0];var J0=class extends H{constructor(t){super(t)}},jp=Mi(443442058,J0);ie[443442058]=[0,Kt,yt,Wt,ee,ge,-1,Ot,ee],ie[514774813]=Zl;var Q0=class extends H{constructor(t){super(t)}},Xp=Mi(516587230,Q0);function Xl(t,e){return e=e?e.clone():new Nl,t.displayNamesLocale!==void 0?Mt(e,1,Ur(t.displayNamesLocale)):t.displayNamesLocale===void 0&&Mt(e,1),t.maxResults!==void 0?Ui(e,2,t.maxResults):"maxResults"in t&&Mt(e,2),t.scoreThreshold!==void 0?G(e,3,t.scoreThreshold):"scoreThreshold"in t&&Mt(e,3),t.categoryAllowlist!==void 0?Ko(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Mt(e,4),t.categoryDenylist!==void 0?Ko(e,5,t.categoryDenylist):"categoryDenylist"in t&&Mt(e,5),e}function Kl(t,e=-1,i=""){return{categories:t.map(s=>{var o,c,l,u,h,f,_;return{index:(c=(o=li(s,1))!=null?o:0)!=null?c:-1,score:(l=Xt(s,2))!=null?l:0,categoryName:(h=(u=ui(s,3))!=null?u:"")!=null?h:"",displayName:(_=(f=ui(s,4))!=null?f:"")!=null?_:""}}),headIndex:e,headName:i}}function td(t){var l,u,h,f,_,m,b,E,A,k,F,M,D;var e=or(t,3,Mn,sr()),i=or(t,2,Pr,sr()),s=or(t,1,$r,sr()),o=or(t,9,$r,sr());const c={categories:[],keypoints:[]};for(let R=0;R<e.length;R++)c.categories.push({score:e[R],index:(l=i[R])!=null?l:-1,categoryName:(u=s[R])!=null?u:"",displayName:(h=o[R])!=null?h:""});if((e=(f=gt(t,$l,4))==null?void 0:f.h())&&(c.boundingBox={originX:(_=li(e,1))!=null?_:0,originY:(m=li(e,2))!=null?m:0,width:(b=li(e,3))!=null?b:0,height:(E=li(e,4))!=null?E:0,angle:0}),(A=gt(t,$l,4))==null?void 0:A.g().length)for(const R of gt(t,$l,4).g())c.keypoints.push({x:(k=qo(R,1))!=null?k:0,y:(F=qo(R,2))!=null?F:0,score:(M=qo(R,4))!=null?M:0,label:(D=ui(R,3))!=null?D:""});return c}function ga(t){var i,s,o,c;const e=[];for(const l of rn(t,A0,1))e.push({x:(i=Xt(l,1))!=null?i:0,y:(s=Xt(l,2))!=null?s:0,z:(o=Xt(l,3))!=null?o:0,visibility:(c=Xt(l,4))!=null?c:0});return e}function qs(t){var i,s,o,c;const e=[];for(const l of rn(t,E0,1))e.push({x:(i=Xt(l,1))!=null?i:0,y:(s=Xt(l,2))!=null?s:0,z:(o=Xt(l,3))!=null?o:0,visibility:(c=Xt(l,4))!=null?c:0});return e}function ed(t){return Array.from(t,e=>e>127?e-256:e)}function id(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let i=0,s=0,o=0;for(let c=0;c<t.length;c++)i+=t[c]*e[c],s+=t[c]*t[c],o+=e[c]*e[c];if(s<=0||o<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(s*o)}let ma;ie[516587230]=[0,Kt,Zl,ql,ee],ie[518928384]=ql;const Kp=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function nd(){return q(this,null,function*(){if(ma===void 0)try{yield WebAssembly.instantiate(Kp),ma=!0}catch(t){ma=!1}return ma})}function js(i){return q(this,arguments,function*(t,e=xp``){const s=(yield nd())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${s}.js`,wasmBinaryPath:`${e}/${t}_${s}.wasm`}})}var lr=class{};function rd(){var t=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}function sd(t){return q(this,null,function*(){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((i,s)=>{e.addEventListener("load",()=>{i()},!1),e.addEventListener("error",o=>{s(o)},!1),document.body.appendChild(e)})}importScripts(t.toString())})}function od(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function W(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function ad(t,e,i){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(i?t.i._bindTextureToStream(i):t.i._bindTextureToCanvas(),!(i=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[s,o]=od(e);return!t.l||s===t.i.canvas.width&&o===t.i.canvas.height||(t.i.canvas.width=s,t.i.canvas.height=o),[s,o]}function cd(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const s=new Uint32Array(e.length);for(let o=0;o<e.length;o++)s[o]=t.i.stringToNewUTF8(e[o]);e=t.i._malloc(4*s.length),t.i.HEAPU32.set(s,e>>2),i(e);for(const o of s)t.i._free(o);t.i._free(e)}function $i(t,e,i){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=i}function On(t,e,i){let s=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(o,c,l)=>{c?(i(s,l),s=[]):s.push(o)}}lr.forVisionTasks=function(t){return js("vision",t)},lr.forTextTasks=function(t){return js("text",t)},lr.forGenAiExperimentalTasks=function(t){return js("genai_experimental",t)},lr.forGenAiTasks=function(t){return js("genai",t)},lr.forAudioTasks=function(t){return js("audio",t)},lr.isSimdSupported=function(){return nd()};function Yp(t,e,i,s){return q(this,null,function*(){return t=yield((o,c,l,u,h)=>q(null,null,function*(){if(c&&(yield sd(c)),!self.ModuleFactory||l&&(yield sd(l),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&h&&((c=self.Module).locateFile=h.locateFile,h.mainScriptUrlOrBlob&&(c.mainScriptUrlOrBlob=h.mainScriptUrlOrBlob)),h=yield self.ModuleFactory(self.Module||h),self.ModuleFactory=self.Module=void 0,new o(h,u)}))(t,i.wasmLoaderPath,i.assetLoaderPath,e,{locateFile:o=>o.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&o.endsWith(".data")?i.assetBinaryPath.toString():o}),yield t.o(s),t})}function Yl(t,e){const i=gt(t.baseOptions,fa,1)||new fa;typeof e=="string"?(Mt(i,2,Ur(e)),Mt(i,1)):e instanceof Uint8Array&&(Mt(i,1,jc(e,!1)),Mt(i,2)),Z(t.baseOptions,0,1,i)}function ld(t){try{const e=t.G.length;if(e===1)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map(i=>i.message).join(", "))}finally{t.G=[]}}function U(t,e){t.B=Math.max(t.B,e)}function va(t,e){t.A=new ye,Xe(t.A,"PassThroughCalculator"),Tt(t.A,"free_memory"),dt(t.A,"free_memory_unused_out"),Ft(e,"free_memory"),Ke(e,t.A)}function Jr(t,e){Tt(t.A,e),dt(t.A,e+"_unused_out")}function _a(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var Jl=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){var i,s,o,c,l,u;if(e){const h=t.baseOptions||{};if((i=t.baseOptions)!=null&&i.modelAssetBuffer&&((s=t.baseOptions)!=null&&s.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((o=gt(this.baseOptions,fa,1))!=null&&o.g()||(c=gt(this.baseOptions,fa,1))!=null&&c.h()||(l=t.baseOptions)!=null&&l.modelAssetBuffer||(u=t.baseOptions)!=null&&u.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(f,_){let m=gt(f.baseOptions,I0,3);if(!m){var b=m=new I0,E=new p0;Hs(b,4,da,E)}"delegate"in _&&(_.delegate==="GPU"?(_=m,b=new Ep,Hs(_,2,da,b)):(_=m,b=new p0,Hs(_,4,da,b))),Z(f.baseOptions,0,3,m)}(this,h),h.modelAssetPath)return fetch(h.modelAssetPath.toString()).then(f=>{if(f.ok)return f.arrayBuffer();throw Error(`Failed to fetch model: ${h.modelAssetPath} (${f.status})`)}).then(f=>{try{this.g.i.FS_unlink("/model.dat")}catch(_){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(f),!0,!1,!1),Yl(this,"/model.dat"),this.m(),this.J()});if(h.modelAssetBuffer instanceof Uint8Array)Yl(this,h.modelAssetBuffer);else if(h.modelAssetBuffer)return function(f){return q(this,null,function*(){const _=[];for(var m=0;;){const{done:b,value:E}=yield f.read();if(b)break;_.push(E),m+=E.length}if(_.length===0)return new Uint8Array(0);if(_.length===1)return _[0];f=new Uint8Array(m),m=0;for(const b of _)f.set(b,m),m+=b.length;return f})}(h.modelAssetBuffer).then(f=>{Yl(this,f),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let t;if(this.g.ca(e=>{t=Ap(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((i,s)=>{this.G.push(Error(s))}),this.g.Ha(),this.g.setGraph(t,e),this.A=void 0,ld(this)}finishProcessing(){this.g.finishProcessing(),ld(this)}close(){this.A=void 0,this.g.closeGraph()}};function Ce(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Jl.prototype.close=Jl.prototype.close;class Jp{constructor(e,i,s,o){this.g=e,this.h=i,this.m=s,this.l=o}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ud(t,e,i){const s=t.g;if(i=Ce(s.createShader(i),"Failed to create WebGL shader"),s.shaderSource(i,e),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${s.getShaderInfoLog(i)}`);return s.attachShader(t.h,i),i}function hd(t,e){const i=t.g,s=Ce(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(s);const o=Ce(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,o),i.enableVertexAttribArray(t.P),i.vertexAttribPointer(t.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const c=Ce(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,c),i.enableVertexAttribArray(t.J),i.vertexAttribPointer(t.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new Jp(i,s,o,c)}function Ql(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function Xs(t,e,i,s){return Ql(t,e),t.h||(t.m(),t.C()),i?(t.s||(t.s=hd(t,!0)),i=t.s):(t.v||(t.v=hd(t,!1)),i=t.v),e.useProgram(t.h),i.bind(),t.l(),t=s(),i.g.bindVertexArray(null),t}function Pn(t,e,i){return Ql(t,e),t=Ce(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i!=null?i:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i!=null?i:e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function wa(t,e,i){Ql(t,e),t.A||(t.A=Ce(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0)}function t1(t){var e;(e=t.g)==null||e.bindFramebuffer(t.g.FRAMEBUFFER,null)}var Qr=class{G(){return`
|
|
3189
3168
|
precision mediump float;
|
|
3190
3169
|
varying vec2 vTex;
|
|
3191
3170
|
uniform sampler2D inputTexture;
|
|
3192
3171
|
void main() {
|
|
3193
3172
|
gl_FragColor = texture2D(inputTexture, vTex);
|
|
3194
3173
|
}
|
|
3195
|
-
`}m(){const t=this.g;if(this.h=
|
|
3174
|
+
`}m(){const t=this.g;if(this.h=Ce(t.createProgram(),"Failed to create WebGL program"),this.Z=ud(this,`
|
|
3196
3175
|
attribute vec2 aVertex;
|
|
3197
3176
|
attribute vec2 aTex;
|
|
3198
3177
|
varying vec2 vTex;
|
|
3199
3178
|
void main(void) {
|
|
3200
3179
|
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
3201
3180
|
vTex = aTex;
|
|
3202
|
-
}`,t.VERTEX_SHADER),this.Y=
|
|
3181
|
+
}`,t.VERTEX_SHADER),this.Y=ud(this,this.G(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.P=t.getAttribLocation(this.h,"aVertex"),this.J=t.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.Z),t.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},Qp=class extends Qr{G(){return`
|
|
3203
3182
|
precision mediump float;
|
|
3204
3183
|
uniform sampler2D backgroundTexture;
|
|
3205
3184
|
uniform sampler2D maskTexture;
|
|
@@ -3211,7 +3190,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3211
3190
|
vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));
|
|
3212
3191
|
gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);
|
|
3213
3192
|
}
|
|
3214
|
-
`}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=
|
|
3193
|
+
`}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=Pn(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=Pn(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.L=Ce(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=Ce(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=Ce(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.K,0),t.uniform1i(this.L,1),t.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},t6=class extends Qr{G(){return`
|
|
3215
3194
|
precision mediump float;
|
|
3216
3195
|
uniform sampler2D maskTexture;
|
|
3217
3196
|
uniform sampler2D defaultTexture;
|
|
@@ -3225,7 +3204,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3225
3204
|
overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
|
|
3226
3205
|
gl_FragColor = mix(defaultColor, overlayColor, confidence);
|
|
3227
3206
|
}
|
|
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&<},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:`
|
|
3207
|
+
`}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=Pn(this,t),t.activeTexture(t.TEXTURE2),this.B=Pn(this,t)}m(){super.m();const t=this.g;this.K=Ce(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=Ce(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=Ce(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 cn(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!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function e1(t){var e=cn(t,1);if(!e){if(e=cn(t,0))e=new Float32Array(e).map(s=>s/255);else{e=new Float32Array(t.width*t.height);const s=ts(t);var i=i1(t);if(wa(i,s,dd(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),s.readPixels(0,0,t.width,t.height,s.RGBA,s.FLOAT,i);for(let o=0,c=0;o<e.length;++o,c+=4)e[o]=i[c]}else s.readPixels(0,0,t.width,t.height,s.RED,s.FLOAT,e)}t.g.push(e)}return e}function dd(t){let e=cn(t,2);if(!e){const i=ts(t);e=pd(t);const s=e1(t),o=fd(t);i.texImage2D(i.TEXTURE_2D,0,o,t.width,t.height,0,i.RED,i.FLOAT,s),n1(t)}return e}function ts(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=Ce(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function fd(t){if(t=ts(t),!ba)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))ba=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");ba=t.R16F}return ba}function i1(t){return t.l||(t.l=new Qr),t.l}function pd(t){const e=ts(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=cn(t,2);return i||(i=Pn(i1(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(i),t.j=!0),e.bindTexture(e.TEXTURE_2D,i),i}function n1(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var ba,se=class{constructor(t,e,i,s,o,c,l){this.g=t,this.m=e,this.j=i,this.canvas=s,this.l=o,this.width=c,this.height=l,this.j&&--gd===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!cn(this,0)}ja(){return!!cn(this,1)}R(){return!!cn(this,2)}ia(){return(e=cn(t=this,0))||(e=e1(t),e=new Uint8Array(e.map(i=>255*i)),t.g.push(e)),e;var t,e}ha(){return e1(this)}N(){return dd(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 s=ts(this),o=i1(this);s.activeTexture(s.TEXTURE1),i=Pn(o,s,this.m?s.LINEAR:s.NEAREST),s.bindTexture(s.TEXTURE_2D,i);const c=fd(this);s.texImage2D(s.TEXTURE_2D,0,c,this.width,this.height,0,s.RED,s.FLOAT,null),s.bindTexture(s.TEXTURE_2D,null),wa(o,s,i),Xs(o,s,!1,()=>{pd(this),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4),n1(this)}),t1(o),n1(this)}}t.push(i)}return new se(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ts(this).deleteTexture(cn(this,2)),gd=-1}};se.prototype.close=se.prototype.close,se.prototype.clone=se.prototype.clone,se.prototype.getAsWebGLTexture=se.prototype.N,se.prototype.getAsFloat32Array=se.prototype.ha,se.prototype.getAsUint8Array=se.prototype.ia,se.prototype.hasWebGLTexture=se.prototype.R,se.prototype.hasFloat32Array=se.prototype.ja,se.prototype.hasUint8Array=se.prototype.Da;var gd=250;const e6={color:"white",lineWidth:4,radius:6};function r1(t){return Fe(ys(Fe({},e6),{fillColor:(t=t||{}).color}),t)}function ln(t,e){return t instanceof Function?t(e):t}function md(t,e,i){return Math.max(Math.min(e,i),Math.min(Math.max(e,i),t))}function Ks(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Ys(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function vd(t,e,i){var s;if(e.R())i(e.N());else{const o=e.ja()?e.ha():e.ia();t.m=(s=t.m)!=null?s:new Qr;const c=Ys(t);i((t=new se([o],e.m,!1,c.canvas,t.m,e.width,e.height)).N()),t.close()}}function _d(t,e,i,s){const o=function(u){return u.g||(u.g=new Qp),u.g}(t),c=Ys(t),l=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;Xs(o,c,!0,()=>{(function(h,f,_,m){const b=h.g;if(b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,f),b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,h.B),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,_),h.H&&function(E,A){if(E!==A)return!1;E=E.entries(),A=A.entries();for(const[F,M]of E){E=F;const D=M;var k=A.next();if(k.done)return!1;const[R,$]=k.value;if(k=$,E!==R||D[0]!==k[0]||D[1]!==k[1]||D[2]!==k[2]||D[3]!==k[3])return!1}return!!A.next().done}(h.H,m))b.activeTexture(b.TEXTURE2),b.bindTexture(b.TEXTURE_2D,h.j);else{h.H=m;const E=Array(1024).fill(0);m.forEach((A,k)=>{if(A.length!==4)throw Error(`Color at index ${k} is not a four-channel value.`);E[4*k]=A[0],E[4*k+1]=A[1],E[4*k+2]=A[2],E[4*k+3]=A[3]}),b.activeTexture(b.TEXTURE2),b.bindTexture(b.TEXTURE_2D,h.j),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,256,1,0,b.RGBA,b.UNSIGNED_BYTE,new Uint8Array(E))}})(o,e,l,s),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),c.drawArrays(c.TRIANGLE_FAN,0,4);const u=o.g;u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,null),u.activeTexture(u.TEXTURE1),u.bindTexture(u.TEXTURE_2D,null),u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,null)})}function wd(t,e,i,s){const o=Ys(t),c=function(h){return h.h||(h.h=new t6),h.h}(t),l=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,u=Array.isArray(s)?new ImageData(new Uint8ClampedArray(s),1,1):s;Xs(c,o,!0,()=>{var h=c.g;h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,c.j),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,l),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,c.B),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,u),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4),o.bindTexture(o.TEXTURE_2D,null),(h=c.g).activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,null),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,null),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,null)})}var xe=class{constructor(t,e){typeof CanvasRenderingContext2D!="undefined"&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}wa(t,e){if(t){var i=Ks(this);e=r1(e),i.save();var s=i.canvas,o=0;for(const c of t)i.fillStyle=ln(e.fillColor,{index:o,from:c}),i.strokeStyle=ln(e.color,{index:o,from:c}),i.lineWidth=ln(e.lineWidth,{index:o,from:c}),(t=new Path2D).arc(c.x*s.width,c.y*s.height,ln(e.radius,{index:o,from:c}),0,2*Math.PI),i.fill(t),i.stroke(t),++o;i.restore()}}va(t,e,i){if(t&&e){var s=Ks(this);i=r1(i),s.save();var o=s.canvas,c=0;for(const l of e){s.beginPath(),e=t[l.start];const u=t[l.end];e&&u&&(s.strokeStyle=ln(i.color,{index:c,from:e,to:u}),s.lineWidth=ln(i.lineWidth,{index:c,from:e,to:u}),s.moveTo(e.x*o.width,e.y*o.height),s.lineTo(u.x*o.width,u.y*o.height)),++c,s.stroke()}s.restore()}}sa(t,e){const i=Ks(this);e=r1(e),i.save(),i.beginPath(),i.lineWidth=ln(e.lineWidth,{}),i.strokeStyle=ln(e.color,{}),i.fillStyle=ln(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(s,o,c,l){const u=Ys(s);vd(s,o,h=>{_d(s,h,c,l),(h=Ks(s)).drawImage(u.canvas,0,0,h.canvas.width,h.canvas.height)})}(this,t,i,e):_d(this,t.N(),i,e)}ua(t,e,i){this.l?function(s,o,c,l){const u=Ys(s);vd(s,o,h=>{wd(s,h,c,l),(h=Ks(s)).drawImage(u.canvas,0,0,h.canvas.width,h.canvas.height)})}(this,t,e,i):wd(this,t.N(),e,i)}close(){var t,e,i;(t=this.g)==null||t.close(),this.g=void 0,(e=this.h)==null||e.close(),this.h=void 0,(i=this.m)==null||i.close(),this.m=void 0}};function Ni(t,e){switch(e){case 0:return t.g.find(i=>i instanceof ImageData);case 1:return t.g.find(i=>typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap);case 2:return t.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function bd(t){var e=Ni(t,0);if(!e){e=es(t);const i=Ca(t),s=new Uint8Array(t.width*t.height*4);wa(i,e,ya(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,s),t1(i),e=new ImageData(new Uint8ClampedArray(s.buffer),t.width,t.height),t.g.push(e)}return e}function ya(t){let e=Ni(t,2);if(!e){const i=es(t);e=xa(t);const s=Ni(t,1)||bd(t);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,s),Js(t)}return e}function es(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=Ce(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Ca(t){return t.l||(t.l=new Qr),t.l}function xa(t){const e=es(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=Ni(t,2);return i||(i=Pn(Ca(t),e),t.g.push(i),t.m=!0),e.bindTexture(e.TEXTURE_2D,i),i}function Js(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function yd(t){const e=es(t);return Xs(Ca(t),e,!0,()=>function(i,s){const o=i.canvas;if(o.width===i.width&&o.height===i.height)return s();const c=o.width,l=o.height;return o.width=i.width,o.height=i.height,i=s(),o.width=c,o.height=l,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()}))}xe.prototype.close=xe.prototype.close,xe.prototype.drawConfidenceMask=xe.prototype.ua,xe.prototype.drawCategoryMask=xe.prototype.ta,xe.prototype.drawBoundingBox=xe.prototype.sa,xe.prototype.drawConnectors=xe.prototype.va,xe.prototype.drawLandmarks=xe.prototype.wa,xe.lerp=function(t,e,i,s,o){return md(s*(1-(t-e)/(i-e))+o*(1-(i-t)/(i-e)),s,o)},xe.clamp=md;var ce=class{constructor(t,e,i,s,o,c,l){this.g=t,this.j=e,this.m=i,this.canvas=s,this.l=o,this.width=c,this.height=l,(this.j||this.m)&&--Cd===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!Ni(this,0)}ka(){return!!Ni(this,1)}R(){return!!Ni(this,2)}Aa(){return bd(this)}za(){var t=Ni(this,1);return t||(ya(this),xa(this),t=yd(this),Js(this),this.g.push(t),this.j=!0),t}N(){return ya(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 s=es(this),o=Ca(this);s.activeTexture(s.TEXTURE1),i=Pn(o,s),s.bindTexture(s.TEXTURE_2D,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,this.width,this.height,0,s.RGBA,s.UNSIGNED_BYTE,null),s.bindTexture(s.TEXTURE_2D,null),wa(o,s,i),Xs(o,s,!1,()=>{xa(this),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4),Js(this)}),t1(o),Js(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);ya(this),xa(this),i=yd(this),Js(this)}t.push(i)}return new ce(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ni(this,1).close(),this.m&&es(this).deleteTexture(Ni(this,2)),Cd=-1}};ce.prototype.close=ce.prototype.close,ce.prototype.clone=ce.prototype.clone,ce.prototype.getAsWebGLTexture=ce.prototype.N,ce.prototype.getAsImageBitmap=ce.prototype.za,ce.prototype.getAsImageData=ce.prototype.Aa,ce.prototype.hasWebGLTexture=ce.prototype.R,ce.prototype.hasImageBitmap=ce.prototype.ka,ce.prototype.hasImageData=ce.prototype.Ca;var Cd=250;function Ti(...t){return t.map(([e,i])=>({start:e,end:i}))}const i6=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((xd=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:rd()?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"))}initializeGraph(t){return q(this,null,function*(){const e=yield(yield 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,s=this.i._malloc(i);this.i.HEAPU8.set(t,s),e?this.i._changeBinaryGraph(i,s):this.i._changeTextGraph(i,s),this.i._free(s)}configureAudio(t,e,i,s,o){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),W(this,s||"input_audio",c=>{W(this,o=o||"audio_header",l=>{this.i._configureAudio(c,l,t,e!=null?e:0,i)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){$i(this,"__graph_config__",e=>{t(e)}),W(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,s,o){const c=4*t.length;this.h!==c&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(c),this.h=c),this.i.HEAPF32.set(t,this.g/4),W(this,s,l=>{this.i._addAudioToInputStream(this.g,e,i,l,o)})}addGpuBufferToStream(t,e,i){W(this,e,s=>{const[o,c]=ad(this,t,s);this.i._addBoundTextureToStream(s,o,c,i)})}addBoolToStream(t,e,i){W(this,e,s=>{this.i._addBoolToInputStream(t,s,i)})}addDoubleToStream(t,e,i){W(this,e,s=>{this.i._addDoubleToInputStream(t,s,i)})}addFloatToStream(t,e,i){W(this,e,s=>{this.i._addFloatToInputStream(t,s,i)})}addIntToStream(t,e,i){W(this,e,s=>{this.i._addIntToInputStream(t,s,i)})}addUintToStream(t,e,i){W(this,e,s=>{this.i._addUintToInputStream(t,s,i)})}addStringToStream(t,e,i){W(this,e,s=>{W(this,t,o=>{this.i._addStringToInputStream(o,s,i)})})}addStringRecordToStream(t,e,i){W(this,e,s=>{cd(this,Object.keys(t),o=>{cd(this,Object.values(t),c=>{this.i._addFlatHashMapToInputStream(o,c,Object.keys(t).length,s,i)})})})}addProtoToStream(t,e,i,s){W(this,i,o=>{W(this,e,c=>{const l=this.i._malloc(t.length);this.i.HEAPU8.set(t,l),this.i._addProtoToInputStream(l,t.length,c,o,s),this.i._free(l)})})}addEmptyPacketToStream(t,e){W(this,t,i=>{this.i._addEmptyPacketToInputStream(i,e)})}addBoolVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateBoolVector(t.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(const c of t)this.i._addBoolVectorEntry(o,c);this.i._addBoolVectorToInputStream(o,s,i)})}addDoubleVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateDoubleVector(t.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(const c of t)this.i._addDoubleVectorEntry(o,c);this.i._addDoubleVectorToInputStream(o,s,i)})}addFloatVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateFloatVector(t.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(const c of t)this.i._addFloatVectorEntry(o,c);this.i._addFloatVectorToInputStream(o,s,i)})}addIntVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateIntVector(t.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(const c of t)this.i._addIntVectorEntry(o,c);this.i._addIntVectorToInputStream(o,s,i)})}addUintVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateUintVector(t.length);if(!o)throw Error("Unable to allocate new unsigned int vector on heap.");for(const c of t)this.i._addUintVectorEntry(o,c);this.i._addUintVectorToInputStream(o,s,i)})}addStringVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateStringVector(t.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(const c of t)W(this,c,l=>{this.i._addStringVectorEntry(o,l)});this.i._addStringVectorToInputStream(o,s,i)})}addBoolToInputSidePacket(t,e){W(this,e,i=>{this.i._addBoolToInputSidePacket(t,i)})}addDoubleToInputSidePacket(t,e){W(this,e,i=>{this.i._addDoubleToInputSidePacket(t,i)})}addFloatToInputSidePacket(t,e){W(this,e,i=>{this.i._addFloatToInputSidePacket(t,i)})}addIntToInputSidePacket(t,e){W(this,e,i=>{this.i._addIntToInputSidePacket(t,i)})}addUintToInputSidePacket(t,e){W(this,e,i=>{this.i._addUintToInputSidePacket(t,i)})}addStringToInputSidePacket(t,e){W(this,e,i=>{W(this,t,s=>{this.i._addStringToInputSidePacket(s,i)})})}addProtoToInputSidePacket(t,e,i){W(this,i,s=>{W(this,e,o=>{const c=this.i._malloc(t.length);this.i.HEAPU8.set(t,c),this.i._addProtoToInputSidePacket(c,t.length,o,s),this.i._free(c)})})}addBoolVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateBoolVector(t.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const o of t)this.i._addBoolVectorEntry(s,o);this.i._addBoolVectorToInputSidePacket(s,i)})}addDoubleVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateDoubleVector(t.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const o of t)this.i._addDoubleVectorEntry(s,o);this.i._addDoubleVectorToInputSidePacket(s,i)})}addFloatVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateFloatVector(t.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const o of t)this.i._addFloatVectorEntry(s,o);this.i._addFloatVectorToInputSidePacket(s,i)})}addIntVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateIntVector(t.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const o of t)this.i._addIntVectorEntry(s,o);this.i._addIntVectorToInputSidePacket(s,i)})}addUintVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateUintVector(t.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const o of t)this.i._addUintVectorEntry(s,o);this.i._addUintVectorToInputSidePacket(s,i)})}addStringVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateStringVector(t.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const o of t)W(this,o,c=>{this.i._addStringVectorEntry(s,c)});this.i._addStringVectorToInputSidePacket(s,i)})}attachBoolListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(t,e,i){$i(this,t,e),W(this,t,s=>{this.i._attachProtoListener(s,i||!1)})}attachProtoVectorListener(t,e,i){On(this,t,e),W(this,t,s=>{this.i._attachProtoVectorListener(s,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?'),$i(this,t,(s,o)=>{s=new Float32Array(s.buffer,s.byteOffset,s.length/4),e(s,o)}),W(this,t,s=>{this.i._attachAudioListener(s,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends xd{get ea(){return this.i}oa(t,e,i){W(this,e,s=>{const[o,c]=ad(this,t,s);this.ea._addBoundTextureAsImageToStream(s,o,c,i)})}V(t,e){$i(this,t,e),W(this,t,i=>{this.ea._attachImageListener(i)})}ba(t,e){On(this,t,e),W(this,t,i=>{this.ea._attachImageVectorListener(i)})}}));var xd,hi=class extends i6{};function ct(t,e,i){return q(this,null,function*(){var s;return function(o,c,l,u){return q(this,null,function*(){return Yp(o,c,l,u)})}(t,(s=i.canvas)!=null?s:rd()?void 0:document.createElement("canvas"),e,i)})}function Ed(t,e,i,s){if(t.U){const c=new S0;if(i!=null&&i.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var o=i.regionOfInterest;if(o.left>=o.right||o.top>=o.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(o.left<0||o.top<0||o.right>1||o.bottom>1)throw Error("Expected RectF values to be in [0,1].");G(c,1,(o.left+o.right)/2),G(c,2,(o.top+o.bottom)/2),G(c,4,o.right-o.left),G(c,3,o.bottom-o.top)}else G(c,1,.5),G(c,2,.5),G(c,4,1),G(c,3,1);if(i!=null&&i.rotationDegrees){if((i==null?void 0:i.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(G(c,5,-Math.PI*i.rotationDegrees/180),(i==null?void 0:i.rotationDegrees)%180!=0){const[l,u]=od(e);i=Xt(c,3)*u/l,o=Xt(c,4)*l/u,G(c,4,i),G(c,3,o)}}t.g.addProtoToStream(c.g(),"mediapipe.NormalizedRect",t.U,s)}t.g.oa(e,t.Z,s!=null?s:performance.now()),t.finishProcessing()}function di(t,e,i){var s;if((s=t.baseOptions)!=null&&s.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Ed(t,e,i,t.B+1)}function Hi(t,e,i,s){var o;if(!((o=t.baseOptions)!=null&&o.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Ed(t,e,i,s)}function is(t,e,i,s){var o=e.data;const c=e.width,l=c*(e=e.height);if((o instanceof Uint8Array||o instanceof Float32Array)&&o.length!==l)throw Error("Unsupported channel count: "+o.length/l);return t=new se([o],i,!1,t.g.i.canvas,t.P,c,e),s?t.clone():t}var De=class extends Jl{constructor(t,e,i,s){super(t),this.g=t,this.Z=e,this.U=i,this.na=s,this.P=new Qr}l(t,e=!0){if("runningMode"in t&&Vs(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()}};De.prototype.close=De.prototype.close;var fi=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},Z(t=this.h=new pa,0,1,e=new Pt),G(this.h,2,.5),G(this.h,3,.3)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i;return"minDetectionConfidence"in t&&G(this.h,2,(e=t.minDetectionConfidence)!=null?e:.5),"minSuppressionThreshold"in t&&G(this.h,3,(i=t.minSuppressionThreshold)!=null?i:.3),this.l(t)}D(t,e){return this.j={detections:[]},di(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect_in"),mt(t,"detections");const e=new je;ki(e,Pp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect_in"),dt(i,"DETECTIONS:detections"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("detections",(s,o)=>{for(const c of s)s=x0(c),this.j.detections.push(td(s));U(this,o)}),this.g.attachEmptyPacketListener("detections",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};fi.prototype.detectForVideo=fi.prototype.F,fi.prototype.detect=fi.prototype.D,fi.prototype.setOptions=fi.prototype.o,fi.createFromModelPath=function(t,e){return q(this,null,function*(){return ct(fi,t,{baseOptions:{modelAssetPath:e}})})},fi.createFromModelBuffer=function(t,e){return ct(fi,t,{baseOptions:{modelAssetBuffer:e}})},fi.createFromOptions=function(t,e){return ct(fi,t,e)};var s1=Ti([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]),o1=Ti([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]),a1=Ti([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Ad=Ti([474,475],[475,476],[476,477],[477,474]),c1=Ti([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]),l1=Ti([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),Sd=Ti([469,470],[470,471],[471,472],[472,469]),u1=Ti([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]),kd=[...s1,...o1,...a1,...c1,...l1,...u1],Ld=Ti([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 Md(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var Bt=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,Z(t=this.h=new R0,0,1,e=new Pt),this.v=new B0,Z(this.h,0,3,this.v),this.s=new pa,Z(this.h,0,2,this.s),Ui(this.s,4,1),G(this.s,2,.5),G(this.v,2,.5),G(this.h,4,.5)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i,s,o;return"numFaces"in t&&Ui(this.s,4,(e=t.numFaces)!=null?e:1),"minFaceDetectionConfidence"in t&&G(this.s,2,(i=t.minFaceDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in t&&G(this.h,4,(s=t.minTrackingConfidence)!=null?s:.5),"minFacePresenceConfidence"in t&&G(this.v,2,(o=t.minFacePresenceConfidence)!=null?o:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return Md(this),di(this,t,e),this.j}F(t,e,i){return Md(this),Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"face_landmarks");const e=new je;ki(e,$p,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"NORM_LANDMARKS:face_landmarks"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("face_landmarks",(s,o)=>{for(const c of s)s=Zs(c),this.j.faceLandmarks.push(ga(s));U(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{U(this,s)}),this.outputFaceBlendshapes&&(mt(t,"blendshapes"),dt(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(s,o)=>{var c;if(this.outputFaceBlendshapes)for(const l of s)s=ha(l),this.j.faceBlendshapes.push(Kl((c=s.g())!=null?c:[]));U(this,o)}),this.g.attachEmptyPacketListener("blendshapes",s=>{U(this,s)})),this.outputFacialTransformationMatrixes&&(mt(t,"face_geometry"),dt(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(s,o)=>{var c,l,u,h,f;if(this.outputFacialTransformationMatrixes)for(const _ of s)(s=gt(Up(_),Mp,2))&&this.j.facialTransformationMatrixes.push({rows:(l=(c=li(s,1))!=null?c:0)!=null?l:0,columns:(h=(u=li(s,2))!=null?u:0)!=null?h:0,data:(f=or(s,3,Mn,sr()).slice())!=null?f:[]});U(this,o)}),this.g.attachEmptyPacketListener("face_geometry",s=>{U(this,s)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Bt.prototype.detectForVideo=Bt.prototype.F,Bt.prototype.detect=Bt.prototype.D,Bt.prototype.setOptions=Bt.prototype.o,Bt.createFromModelPath=function(t,e){return ct(Bt,t,{baseOptions:{modelAssetPath:e}})},Bt.createFromModelBuffer=function(t,e){return ct(Bt,t,{baseOptions:{modelAssetBuffer:e}})},Bt.createFromOptions=function(t,e){return ct(Bt,t,e)},Bt.FACE_LANDMARKS_LIPS=s1,Bt.FACE_LANDMARKS_LEFT_EYE=o1,Bt.FACE_LANDMARKS_LEFT_EYEBROW=a1,Bt.FACE_LANDMARKS_LEFT_IRIS=Ad,Bt.FACE_LANDMARKS_RIGHT_EYE=c1,Bt.FACE_LANDMARKS_RIGHT_EYEBROW=l1,Bt.FACE_LANDMARKS_RIGHT_IRIS=Sd,Bt.FACE_LANDMARKS_FACE_OVAL=u1,Bt.FACE_LANDMARKS_CONTOURS=kd,Bt.FACE_LANDMARKS_TESSELATION=Ld;var Vi=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!0),Z(t=this.j=new O0,0,1,e=new Pt)}get baseOptions(){return gt(this.j,Pt,1)}set baseOptions(t){Z(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,i){const s=typeof e!="function"?e:{};if(this.h=typeof e=="function"?e:i,di(this,t,s!=null?s:{}),!this.h)return this.s}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"stylized_image");const e=new je;ki(e,Np,this.j);const i=new ye;Xe(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"STYLIZED_IMAGE:stylized_image"),i.o(e),Ke(t,i),this.g.V("stylized_image",(s,o)=>{var c=!this.h,l=s.data,u=s.width;const h=u*(s=s.height);if(l instanceof Uint8Array)if(l.length===3*h){const f=new Uint8ClampedArray(4*h);for(let _=0;_<h;++_)f[4*_]=l[3*_],f[4*_+1]=l[3*_+1],f[4*_+2]=l[3*_+2],f[4*_+3]=255;l=new ImageData(f,u,s)}else{if(l.length!==4*h)throw Error("Unsupported channel count: "+l.length/h);l=new ImageData(new Uint8ClampedArray(l.buffer,l.byteOffset,l.length),u,s)}else if(!(l instanceof WebGLTexture))throw Error(`Unsupported format: ${l.constructor.name}`);u=new ce([l],!1,!1,this.g.i.canvas,this.P,u,s),this.s=c=c?u.clone():u,this.h&&this.h(c),U(this,o)}),this.g.attachEmptyPacketListener("stylized_image",s=>{this.s=null,this.h&&this.h(null),U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Vi.prototype.stylize=Vi.prototype.Ka,Vi.prototype.setOptions=Vi.prototype.o,Vi.createFromModelPath=function(t,e){return ct(Vi,t,{baseOptions:{modelAssetPath:e}})},Vi.createFromModelBuffer=function(t,e){return ct(Vi,t,{baseOptions:{modelAssetBuffer:e}})},Vi.createFromOptions=function(t,e){return ct(Vi,t,e)};var h1=Ti([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 Td(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function Id(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 Fd(t,e=!0){var o,c,l,u,h,f;const i=[];for(const _ of t){var s=ha(_);t=[];for(const m of s.g())s=e&&li(m,1)!=null?(o=li(m,1))!=null?o:0:-1,t.push({score:(c=Xt(m,2))!=null?c:0,index:s,categoryName:(u=(l=ui(m,3))!=null?l:"")!=null?u:"",displayName:(f=(h=ui(m,4))!=null?h:"")!=null?f:""});i.push(t)}return i}var Ye=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Z(t=this.j=new $0,0,1,e=new Pt),this.s=new zl,Z(this.j,0,2,this.s),this.C=new Gl,Z(this.s,0,3,this.C),this.v=new U0,Z(this.s,0,2,this.v),this.h=new Hp,Z(this.j,0,3,this.h),G(this.v,2,.5),G(this.s,4,.5),G(this.C,2,.5)}get baseOptions(){return gt(this.j,Pt,1)}set baseOptions(t){Z(this.j,0,1,t)}o(t){var o,c,l,u,h,f,_,m;if(Ui(this.v,3,(o=t.numHands)!=null?o:1),"minHandDetectionConfidence"in t&&G(this.v,2,(c=t.minHandDetectionConfidence)!=null?c:.5),"minTrackingConfidence"in t&&G(this.s,4,(l=t.minTrackingConfidence)!=null?l:.5),"minHandPresenceConfidence"in t&&G(this.C,2,(u=t.minHandPresenceConfidence)!=null?u:.5),t.cannedGesturesClassifierOptions){var e=new Yr,i=e,s=Xl(t.cannedGesturesClassifierOptions,(h=gt(this.h,Yr,3))==null?void 0:h.h());Z(i,0,2,s),Z(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&((f=gt(this.h,Yr,3))==null||f.g());return t.customGesturesClassifierOptions?(Z(i=e=new Yr,0,2,s=Xl(t.customGesturesClassifierOptions,(_=gt(this.h,Yr,4))==null?void 0:_.h())),Z(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&((m=gt(this.h,Yr,4))==null||m.g()),this.l(t)}Fa(t,e){return Td(this),di(this,t,e),Id(this)}Ga(t,e,i){return Td(this),Hi(this,t,i,e),Id(this)}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"hand_gestures"),mt(t,"hand_landmarks"),mt(t,"world_hand_landmarks"),mt(t,"handedness");const e=new je;ki(e,Vp,this.j);const i=new ye;Xe(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"HAND_GESTURES:hand_gestures"),dt(i,"LANDMARKS:hand_landmarks"),dt(i,"WORLD_LANDMARKS:world_hand_landmarks"),dt(i,"HANDEDNESS:handedness"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("hand_landmarks",(s,o)=>{var c,l,u,h;for(const f of s){s=Zs(f);const _=[];for(const m of rn(s,A0,1))_.push({x:(c=Xt(m,1))!=null?c:0,y:(l=Xt(m,2))!=null?l:0,z:(u=Xt(m,3))!=null?u:0,visibility:(h=Xt(m,4))!=null?h:0});this.landmarks.push(_)}U(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("world_hand_landmarks",(s,o)=>{var c,l,u,h;for(const f of s){s=Kr(f);const _=[];for(const m of rn(s,E0,1))_.push({x:(c=Xt(m,1))!=null?c:0,y:(l=Xt(m,2))!=null?l:0,z:(u=Xt(m,3))!=null?u:0,visibility:(h=Xt(m,4))!=null?h:0});this.worldLandmarks.push(_)}U(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("hand_gestures",(s,o)=>{this.gestures.push(...Fd(s,!1)),U(this,o)}),this.g.attachEmptyPacketListener("hand_gestures",s=>{U(this,s)}),this.g.attachProtoVectorListener("handedness",(s,o)=>{this.handedness.push(...Fd(s)),U(this,o)}),this.g.attachEmptyPacketListener("handedness",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Bd(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}Ye.prototype.recognizeForVideo=Ye.prototype.Ga,Ye.prototype.recognize=Ye.prototype.Fa,Ye.prototype.setOptions=Ye.prototype.o,Ye.createFromModelPath=function(t,e){return ct(Ye,t,{baseOptions:{modelAssetPath:e}})},Ye.createFromModelBuffer=function(t,e){return ct(Ye,t,{baseOptions:{modelAssetBuffer:e}})},Ye.createFromOptions=function(t,e){return ct(Ye,t,e)},Ye.HAND_CONNECTIONS=h1;var Je=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Z(t=this.h=new zl,0,1,e=new Pt),this.s=new Gl,Z(this.h,0,3,this.s),this.j=new U0,Z(this.h,0,2,this.j),Ui(this.j,3,1),G(this.j,2,.5),G(this.s,2,.5),G(this.h,4,.5)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i,s,o;return"numHands"in t&&Ui(this.j,3,(e=t.numHands)!=null?e:1),"minHandDetectionConfidence"in t&&G(this.j,2,(i=t.minHandDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in t&&G(this.h,4,(s=t.minTrackingConfidence)!=null?s:.5),"minHandPresenceConfidence"in t&&G(this.s,2,(o=t.minHandPresenceConfidence)!=null?o:.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],di(this,t,e),Bd(this)}F(t,e,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Hi(this,t,i,e),Bd(this)}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"hand_landmarks"),mt(t,"world_hand_landmarks"),mt(t,"handedness");const e=new je;ki(e,Gp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"LANDMARKS:hand_landmarks"),dt(i,"WORLD_LANDMARKS:world_hand_landmarks"),dt(i,"HANDEDNESS:handedness"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("hand_landmarks",(s,o)=>{for(const c of s)s=Zs(c),this.landmarks.push(ga(s));U(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("world_hand_landmarks",(s,o)=>{for(const c of s)s=Kr(c),this.worldLandmarks.push(qs(s));U(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("handedness",(s,o)=>{var h,f,_,m,b,E,A;var c=this.handedness,l=c.push;const u=[];for(const k of s){s=ha(k);const F=[];for(const M of s.g())F.push({score:(h=Xt(M,2))!=null?h:0,index:(_=(f=li(M,1))!=null?f:0)!=null?_:-1,categoryName:(b=(m=ui(M,3))!=null?m:"")!=null?b:"",displayName:(A=(E=ui(M,4))!=null?E:"")!=null?A:""});u.push(F)}l.call(c,...u),U(this,o)}),this.g.attachEmptyPacketListener("handedness",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Je.prototype.detectForVideo=Je.prototype.F,Je.prototype.detect=Je.prototype.D,Je.prototype.setOptions=Je.prototype.o,Je.createFromModelPath=function(t,e){return ct(Je,t,{baseOptions:{modelAssetPath:e}})},Je.createFromModelBuffer=function(t,e){return ct(Je,t,{baseOptions:{modelAssetBuffer:e}})},Je.createFromOptions=function(t,e){return ct(Je,t,e)},Je.HAND_CONNECTIONS=h1;var Rd=Ti([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 Dd(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Od(t){try{if(!t.C)return t.h;t.C(t.h)}finally{_a(t)}}function Ea(t,e){t=Zs(t),e.push(ga(t))}var Ut=class extends De{constructor(t,e){super(new hi(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,Z(t=this.j=new W0,0,1,e=new Pt),this.K=new Gl,Z(this.j,0,2,this.K),this.Y=new zp,Z(this.j,0,3,this.Y),this.s=new pa,Z(this.j,0,4,this.s),this.H=new B0,Z(this.j,0,5,this.H),this.v=new G0,Z(this.j,0,6,this.v),this.L=new z0,Z(this.j,0,7,this.L),G(this.s,2,.5),G(this.s,3,.3),G(this.H,2,.5),G(this.v,2,.5),G(this.v,3,.3),G(this.L,2,.5),G(this.K,2,.5)}get baseOptions(){return gt(this.j,Pt,1)}set baseOptions(t){Z(this.j,0,1,t)}o(t){var e,i,s,o,c,l,u;return"minFaceDetectionConfidence"in t&&G(this.s,2,(e=t.minFaceDetectionConfidence)!=null?e:.5),"minFaceSuppressionThreshold"in t&&G(this.s,3,(i=t.minFaceSuppressionThreshold)!=null?i:.3),"minFacePresenceConfidence"in t&&G(this.H,2,(s=t.minFacePresenceConfidence)!=null?s:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&G(this.v,2,(o=t.minPoseDetectionConfidence)!=null?o:.5),"minPoseSuppressionThreshold"in t&&G(this.v,3,(c=t.minPoseSuppressionThreshold)!=null?c:.3),"minPosePresenceConfidence"in t&&G(this.L,2,(l=t.minPosePresenceConfidence)!=null?l:.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&G(this.K,2,(u=t.minHandLandmarksConfidence)!=null?u:.5),this.l(t)}D(t,e,i){const s=typeof e!="function"?e:{};return this.C=typeof e=="function"?e:i,Dd(this),di(this,t,s),Od(this)}F(t,e,i,s){const o=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:s,Dd(this),Hi(this,t,o,e),Od(this)}m(){var t=new Re;Ft(t,"input_frames_image"),mt(t,"pose_landmarks"),mt(t,"pose_world_landmarks"),mt(t,"face_landmarks"),mt(t,"left_hand_landmarks"),mt(t,"left_hand_world_landmarks"),mt(t,"right_hand_landmarks"),mt(t,"right_hand_world_landmarks");const e=new je,i=new a0;hl(i,1,Ur("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(o,c){if(c!=null)if(Array.isArray(c))Mt(o,2,zo(c,al,void 0,void 0,!1));else{if(!(typeof c=="string"||c instanceof tn||ir(c)))throw Error("invalid value in Any.value field: "+c+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");hl(o,2,jc(c,!1),nr())}}(i,this.j.g());const s=new ye;Xe(s,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Xo(s,8,a0,i),Tt(s,"IMAGE:input_frames_image"),dt(s,"POSE_LANDMARKS:pose_landmarks"),dt(s,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),dt(s,"FACE_LANDMARKS:face_landmarks"),dt(s,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),dt(s,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),dt(s,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),dt(s,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),s.o(e),Ke(t,s),va(this,t),this.g.attachProtoListener("pose_landmarks",(o,c)=>{Ea(o,this.h.poseLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("pose_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("pose_world_landmarks",(o,c)=>{var l=this.h.poseWorldLandmarks;o=Kr(o),l.push(qs(o)),U(this,c)}),this.g.attachEmptyPacketListener("pose_world_landmarks",o=>{U(this,o)}),this.outputPoseSegmentationMasks&&(dt(s,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Jr(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(o,c)=>{this.h.poseSegmentationMasks=[is(this,o,!0,!this.C)],U(this,c)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",o=>{this.h.poseSegmentationMasks=[],U(this,o)})),this.g.attachProtoListener("face_landmarks",(o,c)=>{Ea(o,this.h.faceLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("face_landmarks",o=>{U(this,o)}),this.outputFaceBlendshapes&&(mt(t,"extra_blendshapes"),dt(s,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(o,c)=>{var u;var l=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(o=ha(o),l.push(Kl((u=o.g())!=null?u:[]))),U(this,c)}),this.g.attachEmptyPacketListener("extra_blendshapes",o=>{U(this,o)})),this.g.attachProtoListener("left_hand_landmarks",(o,c)=>{Ea(o,this.h.leftHandLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("left_hand_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("left_hand_world_landmarks",(o,c)=>{var l=this.h.leftHandWorldLandmarks;o=Kr(o),l.push(qs(o)),U(this,c)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("right_hand_landmarks",(o,c)=>{Ea(o,this.h.rightHandLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("right_hand_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("right_hand_world_landmarks",(o,c)=>{var l=this.h.rightHandWorldLandmarks;o=Kr(o),l.push(qs(o)),U(this,c)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",o=>{U(this,o)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ut.prototype.detectForVideo=Ut.prototype.F,Ut.prototype.detect=Ut.prototype.D,Ut.prototype.setOptions=Ut.prototype.o,Ut.createFromModelPath=function(t,e){return ct(Ut,t,{baseOptions:{modelAssetPath:e}})},Ut.createFromModelBuffer=function(t,e){return ct(Ut,t,{baseOptions:{modelAssetBuffer:e}})},Ut.createFromOptions=function(t,e){return ct(Ut,t,e)},Ut.HAND_CONNECTIONS=h1,Ut.POSE_CONNECTIONS=Rd,Ut.FACE_LANDMARKS_LIPS=s1,Ut.FACE_LANDMARKS_LEFT_EYE=o1,Ut.FACE_LANDMARKS_LEFT_EYEBROW=a1,Ut.FACE_LANDMARKS_LEFT_IRIS=Ad,Ut.FACE_LANDMARKS_RIGHT_EYE=c1,Ut.FACE_LANDMARKS_RIGHT_EYEBROW=l1,Ut.FACE_LANDMARKS_RIGHT_IRIS=Sd,Ut.FACE_LANDMARKS_FACE_OVAL=u1,Ut.FACE_LANDMARKS_CONTOURS=kd,Ut.FACE_LANDMARKS_TESSELATION=Ld;var pi=class extends De{constructor(t,e){super(new hi(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},Z(t=this.h=new Z0,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){return Z(this.h,0,2,Xl(t,gt(this.h,Nl,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},di(this,t,e),this.j}ra(t,e,i){return this.j={classifications:[]},Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"input_image"),Ft(t,"norm_rect"),mt(t,"classifications");const e=new je;ki(e,Wp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Tt(i,"IMAGE:input_image"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"CLASSIFICATIONS:classifications"),i.o(e),Ke(t,i),this.g.attachProtoListener("classifications",(s,o)=>{this.j=function(c){var u;const l={classifications:rn(c,Ip,1).map(h=>{var f,_,m,b;return Kl((_=(f=gt(h,y0,4))==null?void 0:f.g())!=null?_:[],(m=li(h,2))!=null?m:0,(b=ui(h,3))!=null?b:"")})};return il(Nr(c,2))!=null&&(l.timestampMs=(u=il(Nr(c,2)))!=null?u:0),l}(Fp(s)),U(this,o)}),this.g.attachEmptyPacketListener("classifications",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};pi.prototype.classifyForVideo=pi.prototype.ra,pi.prototype.classify=pi.prototype.qa,pi.prototype.setOptions=pi.prototype.o,pi.createFromModelPath=function(t,e){return ct(pi,t,{baseOptions:{modelAssetPath:e}})},pi.createFromModelBuffer=function(t,e){return ct(pi,t,{baseOptions:{modelAssetBuffer:e}})},pi.createFromOptions=function(t,e){return ct(pi,t,e)};var Qe=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!0),this.h=new q0,this.embeddings={embeddings:[]},Z(t=this.h,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e=this.h,i=gt(this.h,T0,2);return i=i?i.clone():new T0,t.l2Normalize!==void 0?Vs(i,1,t.l2Normalize):"l2Normalize"in t&&Mt(i,1),t.quantize!==void 0?Vs(i,2,t.quantize):"quantize"in t&&Mt(i,2),Z(e,0,2,i),this.l(t)}xa(t,e){return di(this,t,e),this.embeddings}ya(t,e,i){return Hi(this,t,i,e),this.embeddings}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"embeddings_out");const e=new je;ki(e,Zp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"EMBEDDINGS:embeddings_out"),i.o(e),Ke(t,i),this.g.attachProtoListener("embeddings_out",(s,o)=>{s=Dp(s),this.embeddings=function(c){var l;return{embeddings:rn(c,Rp,1).map(u=>{var f,_,m,b,E,A,k;const h={headIndex:(_=(f=li(u,3))!=null?f:0)!=null?_:-1,headName:(b=(m=ui(u,4))!=null?m:"")!=null?b:""};if(Th(u,k0,dl(u,1))!==void 0)u=or(u=gt(u,k0,dl(u,1)),1,Mn,sr()),h.floatEmbedding=u.slice();else{const F=new Uint8Array(0);h.quantizedEmbedding=(k=(A=(E=gt(u,Bp,dl(u,2)))==null?void 0:E.ma())==null?void 0:A.h())!=null?k:F}return h}),timestampMs:(l=il(Nr(c,2)))!=null?l:0}}(s),U(this,o)}),this.g.attachEmptyPacketListener("embeddings_out",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Qe.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=id(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=id(ed(t.quantizedEmbedding),ed(e.quantizedEmbedding))}return t},Qe.prototype.embedForVideo=Qe.prototype.ya,Qe.prototype.embed=Qe.prototype.xa,Qe.prototype.setOptions=Qe.prototype.o,Qe.createFromModelPath=function(t,e){return ct(Qe,t,{baseOptions:{modelAssetPath:e}})},Qe.createFromModelBuffer=function(t,e){return ct(Qe,t,{baseOptions:{modelAssetBuffer:e}})},Qe.createFromOptions=function(t,e){return ct(Qe,t,e)};var d1=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(i=>{i.close()}),(e=this.categoryMask)==null||e.close()}};function Pd(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Ud(t){try{const e=new d1(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{_a(t)}}d1.prototype.close=d1.prototype.close;var Oe=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new jl,this.v=new j0,Z(this.h,0,3,this.v),Z(t=this.h,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i;return t.displayNamesLocale!==void 0?Mt(this.h,2,Ur(t.displayNamesLocale)):"displayNamesLocale"in t&&Mt(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(i=t.outputConfidenceMasks)!=null?i:!0),super.l(t)}J(){(function(t){var i,s,o;const e=rn(t.ca(),ye,1).filter(c=>{var l;return((l=ui(c,1))!=null?l:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&((o=(s=(i=gt(e[0],je,7))==null?void 0:i.l())==null?void 0:s.g())!=null?o:new Map).forEach((c,l)=>{var u;t.s[Number(l)]=(u=ui(c,1))!=null?u:""})})(this)}segment(t,e,i){const s=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:i,Pd(this),di(this,t,s),Ud(this)}Ia(t,e,i,s){const o=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:s,Pd(this),Hi(this,t,o,e),Ud(this)}Ba(){return this.s}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect");const e=new je;ki(e,Y0,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),i.o(e),Ke(t,i),va(this,t),this.outputConfidenceMasks&&(mt(t,"confidence_masks"),dt(i,"CONFIDENCE_MASKS:confidence_masks"),Jr(this,"confidence_masks"),this.g.ba("confidence_masks",(s,o)=>{this.confidenceMasks=s.map(c=>is(this,c,!0,!this.j)),U(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",s=>{this.confidenceMasks=[],U(this,s)})),this.outputCategoryMask&&(mt(t,"category_mask"),dt(i,"CATEGORY_MASK:category_mask"),Jr(this,"category_mask"),this.g.V("category_mask",(s,o)=>{this.categoryMask=is(this,s,!1,!this.j),U(this,o)}),this.g.attachEmptyPacketListener("category_mask",s=>{this.categoryMask=void 0,U(this,s)})),mt(t,"quality_scores"),dt(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(s,o)=>{this.qualityScores=s,U(this,o)}),this.g.attachEmptyPacketListener("quality_scores",s=>{this.categoryMask=void 0,U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Oe.prototype.getLabels=Oe.prototype.Ba,Oe.prototype.segmentForVideo=Oe.prototype.Ia,Oe.prototype.segment=Oe.prototype.segment,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(t,e){return ct(Oe,t,{baseOptions:{modelAssetPath:e}})},Oe.createFromModelBuffer=function(t,e){return ct(Oe,t,{baseOptions:{modelAssetBuffer:e}})},Oe.createFromOptions=function(t,e){return ct(Oe,t,e)};var f1=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(i=>{i.close()}),(e=this.categoryMask)==null||e.close()}};f1.prototype.close=f1.prototype.close;var n6=class extends H{constructor(t){super(t)}},ns=[0,Wt,-2],Aa=[0,an,-3,Ot,an,-1],$d=[0,Aa],Nd=[0,Aa,Wt,-1],p1=class extends H{constructor(t){super(t)}},Hd=[0,an,-1,Ot],r6=class extends H{constructor(t){super(t)}},Vd=class extends H{constructor(t){super(t)}},g1=[1,2,3,4,5,6,7,8,9,10,14,15],Gd=class extends H{constructor(t){super(t)}};Gd.prototype.g=ua([0,re,[0,g1,Ct,Aa,Ct,[0,Aa,ns],Ct,$d,Ct,[0,$d,ns],Ct,Hd,Ct,[0,an,-3,Ot,qe],Ct,[0,an,-3,Ot],Ct,[0,yt,an,-2,Ot,Wt,Ot,-1,2,an,ns],Ct,Nd,Ct,[0,Nd,ns],an,ns,yt,Ct,[0,an,-3,Ot,ns,-1],Ct,[0,re,Hd]],yt,[0,yt,Wt,-1,Ot]]);var Gi=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new jl,this.s=new j0,Z(this.h,0,3,this.s),Z(t=this.h,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i;return"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(i=t.outputConfidenceMasks)!=null?i:!0),super.l(t)}segment(t,e,i,s){const o=typeof i!="function"?i:{};this.j=typeof i=="function"?i:s,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,s=new Gd;const c=new Vd;var l=new n6;if(Ui(l,1,255),Z(c,0,12,l),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var u=new p1;Vs(u,3,!0),G(u,1,e.keypoint.x),G(u,2,e.keypoint.y),Hs(c,5,g1,u)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(u of(l=new r6,e.scribble))Vs(e=new p1,3,!0),G(e,1,u.x),G(e,2,u.y),Xo(l,1,p1,e);Hs(c,15,g1,l)}Xo(s,1,Vd,c),this.g.addProtoToStream(s.g(),"drishti.RenderData","roi_in",i),di(this,t,o);t:{try{const f=new f1(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var h=f;break t}this.j(f)}finally{_a(this)}h=void 0}return h}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"roi_in"),Ft(t,"norm_rect_in");const e=new je;ki(e,Y0,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"ROI:roi_in"),Tt(i,"NORM_RECT:norm_rect_in"),i.o(e),Ke(t,i),va(this,t),this.outputConfidenceMasks&&(mt(t,"confidence_masks"),dt(i,"CONFIDENCE_MASKS:confidence_masks"),Jr(this,"confidence_masks"),this.g.ba("confidence_masks",(s,o)=>{this.confidenceMasks=s.map(c=>is(this,c,!0,!this.j)),U(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",s=>{this.confidenceMasks=[],U(this,s)})),this.outputCategoryMask&&(mt(t,"category_mask"),dt(i,"CATEGORY_MASK:category_mask"),Jr(this,"category_mask"),this.g.V("category_mask",(s,o)=>{this.categoryMask=is(this,s,!1,!this.j),U(this,o)}),this.g.attachEmptyPacketListener("category_mask",s=>{this.categoryMask=void 0,U(this,s)})),mt(t,"quality_scores"),dt(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(s,o)=>{this.qualityScores=s,U(this,o)}),this.g.attachEmptyPacketListener("quality_scores",s=>{this.categoryMask=void 0,U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Gi.prototype.segment=Gi.prototype.segment,Gi.prototype.setOptions=Gi.prototype.o,Gi.createFromModelPath=function(t,e){return ct(Gi,t,{baseOptions:{modelAssetPath:e}})},Gi.createFromModelBuffer=function(t,e){return ct(Gi,t,{baseOptions:{modelAssetBuffer:e}})},Gi.createFromOptions=function(t,e){return ct(Gi,t,e)};var gi=class extends De{constructor(t,e){super(new hi(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},Z(t=this.h=new J0,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?Mt(this.h,2,Ur(t.displayNamesLocale)):"displayNamesLocale"in t&&Mt(this.h,2),t.maxResults!==void 0?Ui(this.h,3,t.maxResults):"maxResults"in t&&Mt(this.h,3),t.scoreThreshold!==void 0?G(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&Mt(this.h,4),t.categoryAllowlist!==void 0?Ko(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&Mt(this.h,5),t.categoryDenylist!==void 0?Ko(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&Mt(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},di(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"input_frame_gpu"),Ft(t,"norm_rect"),mt(t,"detections");const e=new je;ki(e,jp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),Tt(i,"IMAGE:input_frame_gpu"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"DETECTIONS:detections"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("detections",(s,o)=>{for(const c of s)s=x0(c),this.j.detections.push(td(s));U(this,o)}),this.g.attachEmptyPacketListener("detections",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};gi.prototype.detectForVideo=gi.prototype.F,gi.prototype.detect=gi.prototype.D,gi.prototype.setOptions=gi.prototype.o,gi.createFromModelPath=function(t,e){return q(this,null,function*(){return ct(gi,t,{baseOptions:{modelAssetPath:e}})})},gi.createFromModelBuffer=function(t,e){return ct(gi,t,{baseOptions:{modelAssetBuffer:e}})},gi.createFromOptions=function(t,e){return ct(gi,t,e)};var m1=class{constructor(t,e,i){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=i}close(){var t;(t=this.segmentationMasks)==null||t.forEach(e=>{e.close()})}};function zd(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Wd(t){try{const e=new m1(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{_a(t)}}m1.prototype.close=m1.prototype.close;var ti=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,Z(t=this.h=new Q0,0,1,e=new Pt),this.v=new z0,Z(this.h,0,3,this.v),this.j=new G0,Z(this.h,0,2,this.j),Ui(this.j,4,1),G(this.j,2,.5),G(this.v,2,.5),G(this.h,4,.5)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i,s,o,c;return"numPoses"in t&&Ui(this.j,4,(e=t.numPoses)!=null?e:1),"minPoseDetectionConfidence"in t&&G(this.j,2,(i=t.minPoseDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in t&&G(this.h,4,(s=t.minTrackingConfidence)!=null?s:.5),"minPosePresenceConfidence"in t&&G(this.v,2,(o=t.minPosePresenceConfidence)!=null?o:.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=(c=t.outputSegmentationMasks)!=null?c:!1),this.l(t)}D(t,e,i){const s=typeof e!="function"?e:{};return this.s=typeof e=="function"?e:i,zd(this),di(this,t,s),Wd(this)}F(t,e,i,s){const o=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:s,zd(this),Hi(this,t,o,e),Wd(this)}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"normalized_landmarks"),mt(t,"world_landmarks"),mt(t,"segmentation_masks");const e=new je;ki(e,Xp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"NORM_LANDMARKS:normalized_landmarks"),dt(i,"WORLD_LANDMARKS:world_landmarks"),i.o(e),Ke(t,i),va(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(s,o)=>{this.landmarks=[];for(const c of s)s=Zs(c),this.landmarks.push(ga(s));U(this,o)}),this.g.attachEmptyPacketListener("normalized_landmarks",s=>{this.landmarks=[],U(this,s)}),this.g.attachProtoVectorListener("world_landmarks",(s,o)=>{this.worldLandmarks=[];for(const c of s)s=Kr(c),this.worldLandmarks.push(qs(s));U(this,o)}),this.g.attachEmptyPacketListener("world_landmarks",s=>{this.worldLandmarks=[],U(this,s)}),this.outputSegmentationMasks&&(dt(i,"SEGMENTATION_MASK:segmentation_masks"),Jr(this,"segmentation_masks"),this.g.ba("segmentation_masks",(s,o)=>{this.segmentationMasks=s.map(c=>is(this,c,!0,!this.s)),U(this,o)}),this.g.attachEmptyPacketListener("segmentation_masks",s=>{this.segmentationMasks=[],U(this,s)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ti.prototype.detectForVideo=ti.prototype.F,ti.prototype.detect=ti.prototype.D,ti.prototype.setOptions=ti.prototype.o,ti.createFromModelPath=function(t,e){return ct(ti,t,{baseOptions:{modelAssetPath:e}})},ti.createFromModelBuffer=function(t,e){return ct(ti,t,{baseOptions:{modelAssetBuffer:e}})},ti.createFromOptions=function(t,e){return ct(ti,t,e)},ti.POSE_CONNECTIONS=Rd;const s6=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;let i=1,s=0,o=1,c=0;e.forEach(f=>{f&&typeof f.x=="number"&&typeof f.y=="number"&&(i=Math.min(i,f.x),s=Math.max(s,f.x),o=Math.min(o,f.y),c=Math.max(c,f.y))});const l=s-i,u=c-o;return Math.max(l,u)},o6=(t,e)=>{if(!t||t.length===0)return!1;const i=t[0];let s=1,o=0,c=1,l=0;i.forEach(ne=>{s=Math.min(s,ne.x),o=Math.max(o,ne.x),c=Math.min(c,ne.y),l=Math.max(l,ne.y)});const u=.5,h=.6,f=e>1;let _,m;f?(_=.4,m=.3):(_=.35,m=.5);const b=(s+o)/2,E=(c+l)/2,A=.2,k=_*(1+A),F=m*(1+A),D=((ne,Ii)=>{const Ae=(ne-u)/k,he=(Ii-h)/F;return Ae*Ae+he*he<=1})(b,E),R=.2,$=.1,X=_*(1+R),N=m*(1+$),vt=(ne,Ii)=>{const Ae=(ne-u)/X,he=(Ii-h)/N;return Ae*Ae+he*he<=1},J=vt(s,c),pt=vt(o,c),kt=vt(s,l),Zt=vt(o,l);return D&&J&&pt&&kt&&Zt},a6=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;const i=e[13],s=e[14];if(!i||!s)return 0;const o=Math.abs(s.y-i.y),c=Math.min(...e.map(h=>h.y)),u=Math.max(...e.map(h=>h.y))-c;return u>0?o/u:0},c6=t=>{const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)return null;const s=t.videoWidth,o=t.videoHeight,c=Math.min(s,o),l=(s-c)/2,u=(o-c)/2;return e.width=c,e.height=c,i.drawImage(t,l,u,c,c,0,0,c,c),e},Zd=(t,e,i,s)=>{const o=t.getContext("2d");if(!o)return;const c=t.width,l=t.height;o.clearRect(0,0,c,l);const u=new xe(o);e.forEach(h=>{if(!h||h.length===0)return;const f="rgba(162, 155, 254,0.4)",_=2;o.strokeStyle="rgba(255, 255, 255, 0.6)",o.lineWidth=_,o.lineCap="round",o.lineJoin="round",u.drawLandmarks(h,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),u.drawConnectors(h,Bt.FACE_LANDMARKS_FACE_OVAL,{color:f,lineWidth:_}),i>0&&i>=s&&u.drawConnectors(h,Bt.FACE_LANDMARKS_LIPS,{color:f,lineWidth:_})})},qd=t=>{const e=t.getContext("2d");e&&e.clearRect(0,0,t.width,t.height)},l6=(t,e=!1)=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return null;const o=t.videoHeight>t.videoWidth;e?o?(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)):o?(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 c=1,l=t.videoWidth*c,u=t.videoHeight*c,h=(l-t.videoWidth)/2,f=(u-t.videoHeight)/2;return s.drawImage(t,-h,-f-0,l,u,0,0,i.width,i.height),i.toDataURL("image/jpeg")},jd={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},Xd={"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":"Wider smile - teeth visible",initializing:"Initializing..."},u6=()=>{const t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)return!1;const i=e.getExtension("OES_texture_half_float"),s=e.getExtension("OES_texture_half_float_linear"),o=e.getExtension("EXT_color_buffer_half_float");return!!(i&&o&&s)},Kd=()=>q(null,null,function*(){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=q(null,null,function*(){try{const e=yield lr.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=yield Bt.createFromOptions(e,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:u6()?"GPU":"CPU"},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)}),Qs=xs.version,h6=({videoRef:t,canvasRef:e,interval:i,duration:s,smileThreshold:o,mouthOpenThreshold:c,minFaceSize:l,maxFaceSize:u,smileCooldown:h,getFacingMode:f})=>{const _=pe(null),m=pe(null),b=pe(null),E=pe(null),A=Gt(!1),k=Gt(!1),F=Gt("good"),M=Gt(!1),D=Gt(16/9),R=Gt([]),$=Gt(0),X=Gt(0),N=Gt(0),vt=Gt(0),J=Gt(""),pt=Gt(!0),kt=Gt(!1),Zt=Gt(!1),ne=Gt(0),Ii=Gt([]),Ae=Gt(null),he=Gt(1),Se=Gt(0),ur=Gt(!1),ei=Dc(()=>Math.floor(he.value*.4)),ka=Dc(()=>Math.floor(he.value*.2)),rs=Dc(()=>A.value&&k.value&&F.value==="good"&&!M.value),Pe=lt=>{lt&&Xd[lt]?J.value=Xd[lt]:J.value=""},ke=pe(N2.throttle(lt=>{Pe(lt)},300)).current,b1=()=>q(null,null,function*(){var lt,xt;try{((lt=window.__smileIdentityMediapipe)==null?void 0:lt.loaded)&&((xt=window.__smileIdentityMediapipe)==null?void 0:xt.instance)||(pt.value=!0,Pe("initializing")),_.current=yield Kd(),pt.value=!1}catch(me){console.error("Failed to initialize MediaPipe:",me),pt.value=!1}}),y1=()=>{if(t.current&&e.current){const{videoWidth:lt,videoHeight:xt}=t.current;D.value=lt/xt,e.current.width=lt,e.current.height=xt,t.current.parentElement&&(e.current.style.left="50%",e.current.style.top="50%")}},Un=()=>{const lt=Se.value<ka.value,xt=Se.value>=ei.value;lt?J.value="Capturing...":xt?Date.now()-vt.value>h?$.value>=o&&N.value<c?ke("open-mouth-smile"):ke("smile-required"):J.value="Keep smiling!":ke(null)},ss=()=>{pt.value?Pe("initializing"):M.value?ke("multiple-faces"):A.value?F.value==="too-close"?ke("too-close"):F.value==="too-far"?ke("too-far"):k.value?kt.value?Un():J.value="Ready to capture":ke("out-of-bounds"):ke("no-face")},to=()=>{m.current&&(cancelAnimationFrame(m.current),m.current=null)},hn=()=>q(null,null,function*(){var lt,xt;if(!_.current||!t.current){to();return}if(t.current.videoWidth<=0||t.current.videoHeight<=0||t.current.readyState<2){m.current=requestAnimationFrame(hn);return}try{pt.value&&(pt.value=!1);const me=c6(t.current),$n=me||t.current,Le=_.current.detectForVideo($n,performance.now());if(R.value=Le.faceLandmarks||[],Le.faceLandmarks&&e.current&&t.current)if(me){const $e=t.current.videoWidth,Ne=t.current.videoHeight,qi=Math.min($e,Ne),dr=($e-qi)/(2*$e),Hn=(Ne-qi)/(2*Ne),Vn=qi/$e,ji=qi/Ne,io=Le.faceLandmarks.map(no=>no.map(fr=>({x:fr.x*Vn+dr,y:fr.y*ji+Hn,z:fr.z})));Zd(e.current,io,Se.value,ei.value)}else Zd(e.current,Le.faceLandmarks,Se.value,ei.value);else e.current&&qd(e.current);const Nn=Le.faceLandmarks?Le.faceLandmarks.length:0;M.value=Nn>1;const La=Le.faceBlendshapes&&Le.faceBlendshapes.length>0&&Nn===1;if(A.value=La,La&&Le.faceLandmarks){const $e=s6(Le.faceLandmarks);X.value=$e,$e>u?F.value="too-close":$e<l?F.value="too-far":F.value="good",k.value=o6(Le.faceLandmarks,D.value);const Ne=Le.faceBlendshapes[0].categories,qi=((lt=Ne.find(ji=>ji.categoryName==="mouthSmileLeft"))==null?void 0:lt.score)||0,dr=((xt=Ne.find(ji=>ji.categoryName==="mouthSmileRight"))==null?void 0:xt.score)||0,Hn=a6(Le.faceLandmarks),Vn=(qi+dr)/2;$.value=Vn,N.value=Hn,Vn>=o&&Hn>=c&&(vt.value=Date.now(),Zt.value&&kt.value&&E.current&&setTimeout(()=>{Date.now()-vt.value<=100&&Zt.value&&kt.value&&E.current&&E.current()},0))}else $.value=0,X.value=0,N.value=0,k.value=!1,F.value="good";ss()}catch(me){A.value=!1,k.value=!1,M.value=!1,F.value="good",N.value=0,kt.value&&ke("no-face")}m.current=requestAnimationFrame(hn)}),hr=()=>{m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(hn)},C1=()=>{if(!t.current)return;const lt=Se.value===he.value-1,xt=l6(t.current,lt);xt&&(lt?Ae.value=xt:Ii.value=[...Ii.value,xt],Se.value++,ne.value=he.value-Se.value)},dn=()=>{if(b.current&&(clearInterval(b.current),b.current=null),kt.value=!1,Zt.value=!1,Se.value>=he.value&&Ae.value){const lt=Ii.value.map($n=>({image:$n.split(",")[1],image_type_id:jd.LIVENESS_IMAGE_BASE64})),xt={image:Ae.value.split(",")[1],image_type_id:jd.SELFIE_IMAGE_BASE64},me={images:[...lt,xt],referenceImage:Ae.value,previewImage:Ae.value,facingMode:f(),meta:{libraryVersion:Qs}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:me})),ur.value=!0}},Wi=()=>{b.current&&(clearInterval(b.current),b.current=null),Zt.value=!0,!M.value&&A.value&&k.value&&F.value==="good"&&ke("smile-required")},eo=()=>{b.current&&clearInterval(b.current),b.current=setInterval(()=>{if(Se.value>=he.value){dn();return}if(M.value){Wi();return}if(!A.value)return;if(!k.value){Wi();return}if(F.value!=="good"){Wi();return}if(Se.value>=ei.value&&Date.now()-vt.value>h){Wi();return}C1()},i)},Ue=()=>{if(A.value&&F.value==="good"&&k.value&&!M.value){if(Se.value>=ei.value&&Date.now()-vt.value>h)return;Zt.value=!1,ke(null),eo()}};return E.current=Ue,{faceDetected:A,faceInBounds:k,faceProximity:F,multipleFaces:M,videoAspectRatio:D,faceLandmarks:R,currentSmileScore:$,currentFaceSize:X,currentMouthOpen:N,lastSmileTime:vt,alertTitle:J,isInitializing:pt,isReadyToCapture:rs,isCapturing:kt,isPaused:Zt,countdown:ne,capturedImages:Ii,referencePhoto:Ae,totalCaptures:he,capturesTaken:Se,hasFinishedCapture:ur,smileCheckpoint:ei,neutralZone:ka,initializeFaceLandmarker:b1,setupCanvas:y1,startDetectionLoop:hr,stopDetectionLoop:to,updateAlert:ke,startCapture:()=>q(null,null,function*(){Ii.value=[],kt.value=!0,Zt.value=!1,he.value=Math.ceil(s/i),Se.value=0,ne.value=he.value;const lt=document.querySelector("smart-camera-web");lt==null||lt.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),lt==null||lt.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[f()]}})),eo()}),stopCapture:dn,pauseCapture:Wi,resumeCapture:Ue,handleCancel:()=>{dn(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:Qs}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:Qs}}}))},handleClose:()=>{dn(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:Qs}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:Qs}}}))},cleanup:()=>{b.current&&clearInterval(b.current),to(),ke.cancel()},resetFaceDetectionState:()=>{A.value=!1,k.value=!1,F.value="good",M.value=!1,R.value=[],$.value=0,X.value=0,N.value=0,vt.value=0,e.current&&qd(e.current)}}},d6=({progress:t,duration:e=1e3,themeColor:i="#001096"})=>{const s=pe(null),o=pe(t);return Si(()=>{const c=s.current;if(!c)return;const l=c.getTotalLength();c.style.opacity=t>0?"1":"0";const u=l*(1-o.current),h=l*(1-t);u!==h&&(c.style.transition="none",c.style.strokeDasharray=`${l} ${l}`,c.style.strokeDashoffset=`${u}`,c.getBoundingClientRect(),c.style.transition=`stroke-dashoffset ${e}ms ease-out`,c.style.strokeDashoffset=`${h}`,o.current=t)},[t,e]),st("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:st("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[st("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:st("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"})}),st("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"}}),st("path",{ref:s,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"})]})})},f6=({videoRef:t,canvasRef:e,facingMode:i,multipleFaces:s,progress:o,interval:c,themeColor:l})=>st(xn,{children:[st("div",{className:"camera-preview-container",children:[st("div",{className:"video-wrapper",style:{clipPath:s?"none":"url(#selfie-clip-path)"},children:st("div",{className:"video-container",children:[st("video",{ref:t,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),st("canvas",{ref:e,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!s&&st(d6,{progress:o,duration:c,themeColor:l})]}),st("style",{children:`
|
|
3229
3208
|
.camera-preview-container {
|
|
3230
3209
|
position: relative;
|
|
3231
3210
|
width: 100%;
|
|
@@ -3266,7 +3245,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3266
3245
|
.camera-canvas {
|
|
3267
3246
|
pointer-events: none;
|
|
3268
3247
|
}
|
|
3269
|
-
`})]}),
|
|
3248
|
+
`})]}),p6=({alertTitle:t})=>t?st(xn,{children:[st("div",{className:"alert-message",children:st("div",{className:"alert-title",children:t})}),st("style",{children:`
|
|
3270
3249
|
.alert-message {
|
|
3271
3250
|
margin-top: 1.5rem;
|
|
3272
3251
|
color: #000;
|
|
@@ -3282,19 +3261,21 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3282
3261
|
font-weight: bold;
|
|
3283
3262
|
text-align: center;
|
|
3284
3263
|
}
|
|
3285
|
-
`})]}):null,
|
|
3264
|
+
`})]}):null,g6=({isCapturing:t,hasFinishedCapture:e,isReadyToCapture:i,allowAgentMode:s,agentSupported:o,showAgentModeForTests:c,facingMode:l,themeColor:u="#001096",onStartCapture:h,onSwitchCamera:f})=>st(xn,{children:[st("div",{className:"controls",children:[st("button",{class:"btn-primary",onClick:h,disabled:t||e||!i,children:"Start Capture"}),s&&(o||c)&&st("button",{onClick:f,className:"agent-mode-btn",disabled:t||e,children:l==="user"?"Agent Mode Off":"Agent Mode On"})]}),st("style",{children:`
|
|
3286
3265
|
.controls {
|
|
3287
3266
|
margin: 1.5rem 0;
|
|
3288
3267
|
display: flex;
|
|
3289
3268
|
flex-direction: column;
|
|
3290
3269
|
gap: 1rem;
|
|
3291
3270
|
justify-content: center;
|
|
3271
|
+
max-width: 356px;
|
|
3272
|
+
margin: 0 auto;
|
|
3292
3273
|
}
|
|
3293
3274
|
|
|
3294
3275
|
.agent-mode-btn {
|
|
3295
3276
|
padding: 8px 16px;
|
|
3296
3277
|
font-size: 14px;
|
|
3297
|
-
background: ${
|
|
3278
|
+
background: ${u};
|
|
3298
3279
|
color: white;
|
|
3299
3280
|
border: none;
|
|
3300
3281
|
border-radius: 4px;
|
|
@@ -3305,7 +3286,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3305
3286
|
background: #ccc;
|
|
3306
3287
|
cursor: not-allowed;
|
|
3307
3288
|
}
|
|
3308
|
-
`})]}),
|
|
3289
|
+
`})]}),v1=({interval:t=350,duration:e=2800,"theme-color":i="#001096","show-navigation":s=!1,"allow-agent-mode":o=!1,"show-agent-mode-for-tests":c=!1,"hide-attribution":l=!1})=>{const u=pe(null),h=pe(null),f=Lr(s),_=Lr(o),m=Lr(c),b=Lr(l),E=300,A=.25,k=.05,F=.35,M=.5,D=_?"environment":"user",R=T5(D),$=Gt(!1),X=pe(N2.throttle(J=>{$.value=J},100)).current,N=h6({videoRef:R.videoRef,canvasRef:u,interval:t,duration:e,smileThreshold:A,mouthOpenThreshold:k,minFaceSize:F,maxFaceSize:M,smileCooldown:E,getFacingMode:()=>R.facingMode});Si(()=>{const J=()=>q(null,null,function*(){yield R.startCamera(D,pt=>{const kt=document.querySelector("smart-camera-web");kt==null||kt.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:pt}}))}),yield R.checkAgentSupport(),yield N.initializeFaceLandmarker(),setTimeout(()=>{N.setupCanvas(),N.startDetectionLoop()},500)});return R.registerCameraSwitchCallback(()=>{try{N.resetFaceDetectionState(),N.setupCanvas(),N.stopDetectionLoop(),N.startDetectionLoop()}catch(pt){console.error("Error during camera switch callback:",pt)}}),J(),()=>{N.stopDetectionLoop(),R.stopCamera(),N.cleanup(),X.cancel()}},[]),Si(()=>{X(N.multipleFaces.value)},[N.multipleFaces.value]),Si(()=>{const J=h.current;if(J&&f){const pt=()=>{N.handleCancel()},kt=()=>{N.handleClose()};return J.addEventListener("navigation.back",pt),J.addEventListener("navigation.close",kt),()=>{J.removeEventListener("navigation.back",pt),J.removeEventListener("navigation.close",kt)}}},[f]),Si(()=>{if(N.hasFinishedCapture.value){const J=document.querySelector("smart-camera-web");J==null||J.dispatchEvent(new CustomEvent("metadata.selfie-capture-end"))}},[N.hasFinishedCapture.value]);const vt=()=>{N.startCapture();const J=document.querySelector("smart-camera-web");J==null||J.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),J==null||J.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[R.facingMode]}}))};return st("div",{className:"smartselfie-capture",children:[f&&st("smileid-navigation",{ref:h,"theme-color":i}),st(f6,{videoRef:R.videoRef,canvasRef:u,facingMode:R.facingMode,multipleFaces:$.value,progress:N.capturesTaken.value>0?N.capturesTaken.value/N.totalCaptures.value:0,interval:t,themeColor:i}),st(p6,{alertTitle:N.alertTitle.value}),!N.isCapturing.value&&!N.hasFinishedCapture.value&&st(g6,{isCapturing:N.isCapturing.value,hasFinishedCapture:N.hasFinishedCapture.value,isReadyToCapture:N.isReadyToCapture.value,allowAgentMode:_,agentSupported:R.agentSupported,showAgentModeForTests:m,facingMode:R.facingMode,themeColor:i,onStartCapture:vt,onSwitchCamera:R.switchCamera}),!b&&st("powered-by-smile-id",{}),st("style",{children:`
|
|
3309
3290
|
* {
|
|
3310
3291
|
box-sizing: border-box;
|
|
3311
3292
|
}
|
|
@@ -3350,12 +3331,11 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3350
3331
|
}
|
|
3351
3332
|
|
|
3352
3333
|
.smartselfie-capture {
|
|
3334
|
+
padding: 1rem;
|
|
3353
3335
|
font-family: sans-serif;
|
|
3354
|
-
max-width: 356px;
|
|
3355
|
-
margin: 0 auto;
|
|
3356
3336
|
}
|
|
3357
|
-
`})]})};customElements.get("smartselfie-capture")||
|
|
3358
|
-
${
|
|
3337
|
+
`})]})};customElements.get("smartselfie-capture")||k2(v1,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const m6=xs.version,v6=8;function _6(t,e=16){const i=new Set;for(let s=0;s<Math.min(t.length,1e4);s+=4)if(i.add(t[s]<<16|t[s+1]<<8|t[s+2]),i.size>e)return!0;return!1}function w6(t,e=v6){const i=[];if(t<e)throw new Error("SmartCameraWeb: Minimum required no of frames is ",e);const s=e-1,o=Math.floor(t/s);let c=1;for(let u=0;u<t;u+=o)i.length<8?i.push(u):(i[c]=u,i.sort((h,f)=>h-f),c+=1);const l=t-1;return i.length<8&&!i.includes(l)&&i.push(l),i}function b6(){return`
|
|
3338
|
+
${Ai(this.themeColor)}
|
|
3359
3339
|
<style>
|
|
3360
3340
|
:host {
|
|
3361
3341
|
--theme-color: ${this.themeColor||"#001096"};
|
|
@@ -3641,6 +3621,7 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3641
3621
|
position: relative;
|
|
3642
3622
|
z-index: 1;
|
|
3643
3623
|
width: 100%;
|
|
3624
|
+
overflow: hidden;
|
|
3644
3625
|
}
|
|
3645
3626
|
|
|
3646
3627
|
.video-container video,
|
|
@@ -3757,11 +3738,12 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3757
3738
|
|
|
3758
3739
|
#selfie-capture-screen,
|
|
3759
3740
|
#back-of-id-entry-screen {
|
|
3760
|
-
|
|
3741
|
+
box-sizing: border-box;
|
|
3761
3742
|
display: flex;
|
|
3762
3743
|
flex-direction: column;
|
|
3763
3744
|
max-block-size: 100%;
|
|
3764
3745
|
max-inline-size: 40ch;
|
|
3746
|
+
padding: 1rem;
|
|
3765
3747
|
}
|
|
3766
3748
|
|
|
3767
3749
|
#selfie-capture-screen header p {
|
|
@@ -3846,22 +3828,22 @@ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
|
3846
3828
|
${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
|
|
3847
3829
|
</div>
|
|
3848
3830
|
</div>
|
|
3849
|
-
`}async function P2(t,e={facingMode:"user"}){try{const i=await A.getMedia({audio:!1,video:e}),r=(await navigator.mediaDevices.enumerateDevices()).find(s=>s.kind==="videoinput"&&i.getVideoTracks()[0].getSettings().deviceId===s.deviceId);window.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:r?.label}})),t?.removeAttribute("data-camera-error"),t?.setAttribute("data-camera-ready",!0)}catch(i){t?.removeAttribute("data-camera-ready"),t?.setAttribute("data-camera-error",A.handleCameraError(i))}}class P0 extends HTMLElement{constructor(){super(),this.templateString=O0.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.facingMode="user",this.allowAgentMode&&(this.facingMode="environment")}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.videoContainer=this.shadowRoot.querySelector(".video-container > .video"),this.init()}init(){this._videoStreamDurationInMS=7800,this._imageCaptureIntervalInMS=200,this._data={images:[],meta:{libraryVersion:F0}},this._rawImages=[],this.setUpEventListeners()}reset(){this.disconnectedCallback(),this.connectedCallback()}_startImageCapture(){this.startImageCapture.disabled=!0,this.switchCamera&&(this.switchCamera.disabled=!0);const e=this.imageOutline.getTotalLength();this.imageOutline.style.transition="none",this.imageOutline.style.strokeDasharray=`${e} ${e}`,this.imageOutline.style.strokeDashoffset=e,this.imageOutline.getBoundingClientRect(),this.imageOutline.style.transition=`stroke-dashoffset ${this._videoStreamDurationInMS/1e3}s ease-in-out`,this.imageOutline.style.strokeDashoffset="0",setTimeout(()=>{this.smileCTABox.style.opacity=1,this.mouthAnim.beginElement()},1500),setTimeout(()=>{this.smileCTABox.style.opacity=0},3500),setTimeout(()=>{this.smileCTABox.style.opacity=1,this.smileCTA.textContent="BIGGER SMILE",this.mouth.setAttribute("d","m 213.88314,319.4551 c -1.58,0.97 -0.35309,9.33393 1.50671,9.30586 6.05679,-0.0914 16.11631,0.17227 34.57066,0.13346 18.45435,-0.0388 28.15778,-0.0418 31.09964,-0.79956 1.80122,-0.46394 2.75061,-7.48365 1.16061,-8.45365 -1.6,-1.74874 -2.96432,-0.94348 -6.77747,-1.56441 -12.83012,0.04 -36.52534,0.50197 -41.29469,0.43262 -2.51525,-0.0713 -18.41588,-0.61 -20.01588,0.35 z m 57.29363,1.36599 c -9.24417,-2.23757 -8.08363,-2.42362 -20.78363,-2.42362 -12.7,0 -17.77931,2.69528 -26.84042,5.36549 12.57883,3.28731 33.57775,-4.29887 49.70067,2.24964 z"),this.mouthAnim.beginElement()},4e3),this._imageCaptureInterval=setInterval(()=>{this._capturePOLPhoto()},this._imageCaptureIntervalInMS),this._videoStreamTimeout=setTimeout(()=>{this._stopVideoStream()},this._videoStreamDurationInMS)}async _switchCamera(){this.facingMode=this.facingMode==="user"?"environment":"user",this.facingMode==="user"?this.shadowRoot.querySelector("video").classList.remove("agent-mode"):this.shadowRoot.querySelector("video").classList.add("agent-mode"),this.startImageCapture.disabled=!0,this.switchCamera.disabled=!0,A.stopMedia(),await P2(this,{facingMode:this.facingMode}),this.handleStream(A.stream)}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),A.stopMedia();const e=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=$0(e);this._data.images=this._data.images.concat(i.map(n=>({image:this._rawImages[n].split(",")[1],image_type_id:Je.LIVENESS_IMAGE_BASE64}))),this._publishImages()}catch(e){console.error(e)}}_capturePOLPhoto(){const e=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(e.width=240,e.height=Math.max(320,e.width*this._video.videoHeight/this._video.videoWidth)):(e.height=240,e.width=Math.max(320,e.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(e,!1),this._rawImages.push(e.toDataURL("image/jpeg"))}_captureReferencePhoto(){const e=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(e.width=480,e.height=Math.max(640,e.width*this._video.videoHeight/this._video.videoWidth)):(e.height=480,e.width=Math.max(640,e.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(e,!this.disableImageTests);const n=e.toDataURL("image/jpeg");this._referenceImage=n,this._data.images.push({image:n.split(",")[1],image_type_id:Je.SELFIE_IMAGE_BASE64})}_publishImages(){this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:this._data}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(e,i=!0,n=this._video){const r=e.getContext("2d");if(r.drawImage(n,0,0,n.videoWidth,n.videoHeight,0,0,e.width,e.height),i){const s=r.getImageData(0,0,e.width,e.height);if(R0(s.data))return r;throw new Error("Unable to capture webcam images - Please try another device")}else return r}handleStream(e){try{const i=this.shadowRoot.querySelector("video");let n=null;i?n=this.shadowRoot.querySelector("video"):n=document.createElement("video"),n.autoplay=!0,n.playsInline=!0,n.muted=!0,"srcObject"in n?n.srcObject=e:n.src=window.URL.createObjectURL(e),n.onloadedmetadata=()=>{n.play()},this._video=n;const r=this.shadowRoot.querySelector(".video-container > .video");this._data.permissionGranted=!0,i||r.prepend(n)}catch(i){this.setAttribute("data-camera-error",A.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),A.stopMedia()}}setUpEventListeners(){this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),this.switchCamera?.addEventListener("click",()=>{this._switchCamera()}),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.closeWindow()}),A.stream?this.handleStream(A.stream):this.hasAttribute("data-camera-ready")&&P2(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){A.stopMedia(),clearTimeout(this._videoStreamTimeout)}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}async setupAgentMode(){if(!this.allowAgentMode)return;await A.supportsAgentMode()||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?this.shadowRoot.querySelector("video")?.classList?.remove("agent-mode"):this.shadowRoot.querySelector("video")?.classList?.add("agent-mode")):this.switchCamera.hidden=!0}get hasAgentSupport(){return this.hasAttribute("has-agent-support")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get hidden(){return this.getAttribute("hidden")}get cameraError(){return this.getAttribute("data-camera-error")}get disableImageTests(){return this.hasAttribute("disable-image-tests")}get allowAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get inAgentMode(){return this.facingMode==="environment"}static get observedAttributes(){return["allow-agent-mode","data-camera-error","data-camera-ready","disable-image-tests","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(e){switch(e){case"data-camera-error":case"data-camera-ready":case"hidden":case"title":case"allow-agent-mode":this.shadowRoot.innerHTML=this.render(),this.init();break}}handleBackEvents(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.cancelled"))}closeWindow(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.close"))}stopMedia(){this.removeAttribute("data-camera-ready"),A.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",P0);const N0=({timeout:t=2e4,"start-countdown":e=!1,hidden:i=!1,...n})=>{const r=ii(i),s=ii(e),[o,a]=Pe(!1),[c,l]=Pe(0),[d,h]=Pe(!1),[u,p]=Pe(!1),[f,m]=Pe(!1);if(ei(()=>{if(o||u)return;(async()=>{p(!0);try{await O2(),a(!0)}catch(v){console.error("Failed to load Mediapipe:",v)}p(!1)})()},[o,u]),ei(()=>{if(r||!s||o)return;const g=setInterval(()=>{l(v=>Math.min(v+1,100))},t/100);return()=>{clearInterval(g)}},[r,s,t,o]),ei(()=>{if(r||o||c<100)return;const v=setTimeout(()=>{const b=document.querySelector("selfie-capture");if(b&&!b.hasAttribute("data-backup-events-setup")){b.setAttribute("data-backup-events-setup","true");const k=S=>{const O=S;window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};return b.addEventListener("selfie-capture.publish",k),b.addEventListener("selfie-capture.cancelled",k),b.addEventListener("selfie-capture.close",k),()=>{b.removeEventListener("selfie-capture.publish",k),b.removeEventListener("selfie-capture.cancelled",k),b.removeEventListener("selfie-capture.close",k)}}},200);return()=>{clearTimeout(v)}},[r,o,c]),r)return null;if(d&&o&&!f)return L(bo,{...n});if(!d&&o&&!f)return L(bo,{...n});if(c>=100){f||m(!0);const g={...n};return delete g.hidden,L("selfie-capture",{...g,ref:v=>{if(v&&!v.hasAttribute("data-events-setup")){v.setAttribute("data-events-setup","true");const b=k=>{const S=k;(S.type==="selfie-capture.publish"||S.type==="selfie-capture.cancelled"||S.type==="selfie-capture.close")&&h(!0),window.dispatchEvent(new CustomEvent(S.type,{detail:S.detail,bubbles:!0}))};v.addEventListener("selfie-capture.publish",b),v.addEventListener("selfie-capture.cancelled",b),v.addEventListener("selfie-capture.close",b)}}})}return L("div",{style:{textAlign:"center",marginTop:"20%"},children:[L("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:L(Dl,{size:48,style:{animation:"spin 1s linear infinite"}})}),L("p",{children:["Loading... ",c,"%"]}),L("style",{children:`
|
|
3831
|
+
`}function Yd(i){return q(this,arguments,function*(t,e={facingMode:"user"}){try{const s=yield et.getMedia({audio:!1,video:e}),c=(yield navigator.mediaDevices.enumerateDevices()).find(u=>u.kind==="videoinput"&&s.getVideoTracks()[0].getSettings().deviceId===u.deviceId),l=document.querySelector("smart-camera-web");l==null||l.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:c==null?void 0:c.label}})),t==null||t.removeAttribute("data-camera-error"),t==null||t.setAttribute("data-camera-ready",!0)}catch(s){t==null||t.removeAttribute("data-camera-ready"),t==null||t.setAttribute("data-camera-error",et.handleCameraError(s))}})}class y6 extends HTMLElement{constructor(){super(),this.templateString=b6.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.facingMode="user",this.allowAgentMode&&(this.facingMode="environment")}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.videoContainer=this.shadowRoot.querySelector(".video-container > .video"),this.init()}init(){this._videoStreamDurationInMS=7800,this._imageCaptureIntervalInMS=200,this._data={images:[],meta:{libraryVersion:m6}},this._rawImages=[],this.setUpEventListeners()}reset(){this.disconnectedCallback(),this.connectedCallback()}_startImageCapture(){this.startImageCapture.disabled=!0,this.switchCamera&&(this.switchCamera.disabled=!0);const e=this.imageOutline.getTotalLength();this.imageOutline.style.transition="none",this.imageOutline.style.strokeDasharray=`${e} ${e}`,this.imageOutline.style.strokeDashoffset=e,this.imageOutline.getBoundingClientRect(),this.imageOutline.style.transition=`stroke-dashoffset ${this._videoStreamDurationInMS/1e3}s ease-in-out`,this.imageOutline.style.strokeDashoffset="0",setTimeout(()=>{this.smileCTABox.style.opacity=1,this.mouthAnim.beginElement()},1500),setTimeout(()=>{this.smileCTABox.style.opacity=0},3500),setTimeout(()=>{this.smileCTABox.style.opacity=1,this.smileCTA.textContent="WIDER SMILE",this.mouth.setAttribute("d","m 213.88314,319.4551 c -1.58,0.97 -0.35309,9.33393 1.50671,9.30586 6.05679,-0.0914 16.11631,0.17227 34.57066,0.13346 18.45435,-0.0388 28.15778,-0.0418 31.09964,-0.79956 1.80122,-0.46394 2.75061,-7.48365 1.16061,-8.45365 -1.6,-1.74874 -2.96432,-0.94348 -6.77747,-1.56441 -12.83012,0.04 -36.52534,0.50197 -41.29469,0.43262 -2.51525,-0.0713 -18.41588,-0.61 -20.01588,0.35 z m 57.29363,1.36599 c -9.24417,-2.23757 -8.08363,-2.42362 -20.78363,-2.42362 -12.7,0 -17.77931,2.69528 -26.84042,5.36549 12.57883,3.28731 33.57775,-4.29887 49.70067,2.24964 z"),this.mouthAnim.beginElement()},4e3),this._imageCaptureInterval=setInterval(()=>{this._capturePOLPhoto()},this._imageCaptureIntervalInMS),this._videoStreamTimeout=setTimeout(()=>{this._stopVideoStream()},this._videoStreamDurationInMS)}_switchCamera(){return q(this,null,function*(){this.facingMode=this.facingMode==="user"?"environment":"user",this.facingMode==="user"?this.shadowRoot.querySelector("video").classList.remove("agent-mode"):this.shadowRoot.querySelector("video").classList.add("agent-mode"),this.startImageCapture.disabled=!0,this.switchCamera.disabled=!0,et.stopMedia(),yield Yd(this,{facingMode:this.facingMode}),this.handleStream(et.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),et.stopMedia();const e=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=w6(e);this._data.images=this._data.images.concat(i.map(s=>({image:this._rawImages[s].split(",")[1],image_type_id:Ar.LIVENESS_IMAGE_BASE64}))),this._publishImages()}catch(e){console.error(e)}}_capturePOLPhoto(){const e=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(e.width=240,e.height=Math.max(320,e.width*this._video.videoHeight/this._video.videoWidth)):(e.height=240,e.width=Math.max(320,e.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(e,!1),this._rawImages.push(e.toDataURL("image/jpeg"))}_captureReferencePhoto(){const e=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(e.width=480,e.height=Math.max(640,e.width*this._video.videoHeight/this._video.videoWidth)):(e.height=480,e.width=Math.max(640,e.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(e,!this.disableImageTests);const s=e.toDataURL("image/jpeg");this._referenceImage=s,this._data.images.push({image:s.split(",")[1],image_type_id:Ar.SELFIE_IMAGE_BASE64})}_publishImages(){const e=ys(Fe({},this._data),{facingMode:this.facingMode});this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:e}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(e,i=!0,s=this._video){const o=e.getContext("2d");if(o.drawImage(s,0,0,s.videoWidth,s.videoHeight,0,0,e.width,e.height),i){const c=o.getImageData(0,0,e.width,e.height);if(_6(c.data))return o;throw new Error("Unable to capture webcam images - Please try another device")}else return o}handleStream(e){try{const i=this.shadowRoot.querySelector(".video");if(!i)return;const s=this.shadowRoot.querySelector("video");let o=null;s?o=this.shadowRoot.querySelector("video"):o=document.createElement("video"),o.autoplay=!0,o.playsInline=!0,o.muted=!0,"srcObject"in o?o.srcObject=e:o.src=window.URL.createObjectURL(e),o.onloadedmetadata=()=>{o.play()},this._video=o,this._data.permissionGranted=!0,s||i.prepend(o)}catch(i){this.setAttribute("data-camera-error",et.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),et.stopMedia()}}setUpEventListeners(){var e;this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),(e=this.switchCamera)==null||e.addEventListener("click",()=>{this._switchCamera()}),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.closeWindow()}),et.stream?this.handleStream(et.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&Yd(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){et.stopMedia(),clearTimeout(this._videoStreamTimeout)}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}setupAgentMode(){return q(this,null,function*(){var i,s,o,c;if(!this.allowAgentMode)return;(yield et.supportsAgentMode())||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?(s=(i=this.shadowRoot.querySelector("video"))==null?void 0:i.classList)==null||s.remove("agent-mode"):(c=(o=this.shadowRoot.querySelector("video"))==null?void 0:o.classList)==null||c.add("agent-mode")):this.switchCamera.hidden=!0})}get hasAgentSupport(){return this.hasAttribute("has-agent-support")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get hidden(){return this.getAttribute("hidden")}get cameraError(){return this.getAttribute("data-camera-error")}get disableImageTests(){return this.hasAttribute("disable-image-tests")}get allowAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get inAgentMode(){return this.facingMode==="environment"}static get observedAttributes(){return["allow-agent-mode","data-camera-error","data-camera-ready","disable-image-tests","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(e){switch(e){case"data-camera-error":case"hidden":case"title":this.shadowRoot.innerHTML=this.render(),this.init();break;case"allow-agent-mode":this.shadowRoot.innerHTML.trim()?this.setupAgentMode():(this.shadowRoot.innerHTML=this.render(),this.init());break;case"show-navigation":if(this.shadowRoot.innerHTML.trim()){const i=this.shadowRoot.querySelector("smileid-navigation");i&&(this.showNavigation?i.setAttribute("show-navigation",""):i.removeAttribute("show-navigation"))}else this.shadowRoot.innerHTML=this.render(),this.init();break;case"data-camera-ready":this.hasAttribute("data-camera-ready")&&et.stream&&this.handleStream(et.stream);break}}handleBackEvents(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.cancelled"))}closeWindow(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.close"))}stopMedia(){this.removeAttribute("data-camera-ready"),et.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",y6);const C6=o=>{var c=o,{timeout:t=2e4,"start-countdown":e=!1,hidden:i=!1}=c,s=$u(c,["timeout","start-countdown","hidden"]);const l=Lr(i),u=Lr(e),[h,f]=Qn(!1),[_,m]=Qn(0),[b,E]=Qn(!1),[A,k]=Qn(!1),[F,M]=Qn(!1);if(Si(()=>{if(h||A)return;q(null,null,function*(){k(!0);try{yield Kd(),f(!0)}catch(R){console.error("Failed to load Mediapipe:",R)}k(!1)})},[h,A]),Si(()=>{if(l||!u||h)return;const D=setInterval(()=>{m(R=>Math.min(R+1,100))},t/100);return()=>{clearInterval(D)}},[l,u,t,h]),Si(()=>{if(l||h||_<100)return;const R=setTimeout(()=>{const $=document.querySelector("selfie-capture");if($&&!$.hasAttribute("data-backup-events-setup")){$.setAttribute("data-backup-events-setup","true");const X=N=>{const vt=N;window.dispatchEvent(new CustomEvent(vt.type,{detail:vt.detail,bubbles:!0}))};return $.addEventListener("selfie-capture.publish",X),$.addEventListener("selfie-capture.cancelled",X),$.addEventListener("selfie-capture.close",X),()=>{$.removeEventListener("selfie-capture.publish",X),$.removeEventListener("selfie-capture.cancelled",X),$.removeEventListener("selfie-capture.close",X)}}},200);return()=>{clearTimeout(R)}},[l,h,_]),Si(()=>{if(l||A)return;const D=document.querySelector("smart-camera-web");D==null||D.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:F?"0.0.1":"1.0.0"}}))},[F,l,A]),l)return null;if(b&&h&&!F)return st(v1,Fe({},s));if(!b&&h&&!F)return st(v1,Fe({},s));if(_>=100){F||M(!0);const D=Fe({},s);return delete D.hidden,st("selfie-capture",ys(Fe({},D),{ref:R=>{if(R&&!R.hasAttribute("data-events-setup")){R.setAttribute("data-events-setup","true");const $=X=>{const N=X;(N.type==="selfie-capture.publish"||N.type==="selfie-capture.cancelled"||N.type==="selfie-capture.close")&&E(!0),window.dispatchEvent(new CustomEvent(N.type,{detail:N.detail,bubbles:!0}))};R.addEventListener("selfie-capture.publish",$),R.addEventListener("selfie-capture.cancelled",$),R.addEventListener("selfie-capture.close",$)}}}))}return st("div",{style:{textAlign:"center",marginTop:"20%"},children:[st("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:st(m5,{size:48,style:{animation:"spin 1s linear infinite"}})}),st("p",{children:["Loading... ",_,"%"]}),st("style",{children:`
|
|
3850
3832
|
@keyframes spin {
|
|
3851
3833
|
from { transform: rotate(0deg); }
|
|
3852
3834
|
to { transform: rotate(360deg); }
|
|
3853
3835
|
}
|
|
3854
|
-
`})]})};customElements.get("selfie-capture-wrapper")||
|
|
3855
|
-
${
|
|
3856
|
-
<div>
|
|
3836
|
+
`})]})};customElements.get("selfie-capture-wrapper")||k2(C6,"selfie-capture-wrapper",["timeout","interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests","key","start-countdown","hidden"],{shadow:!0});const x6=xs.version,Ee=document.querySelector("smart-camera-web"),E6=(t,e=0,i=0,s=.9)=>new Promise((o,c)=>{if(!t||typeof t!="string"){c(new Error("Invalid data URI provided"));return}if(e<0||e>=99||i<0||i>=99){c(new Error("Crop percentages must be between 0 and 99"));return}const l=new Image;l.onload=()=>{try{const u=document.createElement("canvas"),h=u.getContext("2d"),f=l.width,_=l.height,m=f*e/100,b=_*i/100,E=f-m*2,A=_-b*2;u.width=E,u.height=A,h.drawImage(l,m,b,E,A,0,0,E,A);const k=u.toDataURL("image/jpeg",s);o(k)}catch(u){c(new Error(`Failed to process image: ${u.message}`))}},l.onerror=()=>{c(new Error("Failed to load image from data URI"))},l.src=t});class Jd extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
|
|
3837
|
+
${Ai(this.themeColor)}
|
|
3838
|
+
<div style="height: 100%;">
|
|
3857
3839
|
<selfie-capture-instructions theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} ${this.hideBack} hidden></selfie-capture-instructions>
|
|
3858
3840
|
<selfie-capture-wrapper theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} key="${this._remountKey}" start-countdown="false" hidden></selfie-capture-wrapper>
|
|
3859
3841
|
<selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
|
|
3860
3842
|
</div>
|
|
3861
|
-
`,this._data={images:[],meta:{libraryVersion:
|
|
3843
|
+
`,this._data={images:[],meta:{libraryVersion:x6}},this.selfieInstruction=this.querySelector("selfie-capture-instructions"),this.selfieCapture=this.querySelector("selfie-capture-wrapper"),this.selfieReview=this.querySelector("selfie-capture-review"),this.getAttribute("initial-screen")==="selfie-capture"||this.hideInstructions?this.setActiveScreen(this.selfieCapture):this.setActiveScreen(this.selfieInstruction),this.setUpEventListeners()}getAgentMode(){return this.inAgentMode?"environment":"user"}disconnectedCallback(){et.stopMedia(),this._selfieWrapperListeners&&(this._selfieWrapperListeners.forEach(({event:e,handler:i})=>{window.removeEventListener(e,i)}),this._selfieWrapperListeners=null),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",()=>q(this,null,function*(){this.setActiveScreen(this.selfieCapture),this.selfieCapture.querySelector("selfie-capture")&&(Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[this.getAgentMode()]}})))})),this.selfieInstruction.addEventListener("selfie-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.setupSelfieWrapperEventListeners(),this.selfieReview.addEventListener("selfie-capture-review.rejected",()=>q(this,null,function*(){Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.selfie-capture-retry")),this.selfieReview.removeAttribute("data-image"),this.selfieReview.removeAttribute("mirror-image"),this._data.images=[],yield this.forceWrapperRemount(),this.setActiveScreen(this.selfieCapture)})),this.selfieReview.addEventListener("selfie-capture-review.accepted",()=>q(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(e=>{e.addEventListener(`${e.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return q(this,null,function*(){et.stopMedia(),this._remountKey++;const e=this.querySelector("div"),i=this.selfieCapture;if(i&&e){const s=document.createElement("selfie-capture-wrapper");Array.from(i.attributes).forEach(l=>{s.setAttribute(l.name,l.value)}),i.remove(),yield new Promise(l=>{setTimeout(l,50)}),s.setAttribute("key",this._remountKey.toString()),s.setAttribute("start-countdown","false"),s.setAttribute("hidden","");const c=e.querySelector("selfie-capture-review");c?e.insertBefore(s,c):e.appendChild(s),this.selfieCapture=s,this.setupSelfieWrapperEventListeners()}return new Promise(s=>{setTimeout(()=>{s()},200)})})}setActiveScreen(e){var i;this.activeScreen!==e&&((i=this.activeScreen)==null||i.setAttribute("hidden",""),e.removeAttribute("hidden"),this.activeScreen=e,e===this.selfieCapture?e.setAttribute("start-countdown","true"):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false"))}setupSelfieWrapperEventListeners(){this._selfieWrapperListeners&&this._selfieWrapperListeners.forEach(({event:o,handler:c})=>{window.removeEventListener(o,c)});const e=()=>q(this,null,function*(){if(et.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>q(this,null,function*(){et.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),s=o=>q(this,null,function*(){Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield E6(o.detail.referenceImage,20,20));const c=o.detail.facingMode==="user";this.selfieReview.setAttribute("mirror-image",c?"true":"false"),this._data.images=o.detail.images,et.stopMedia(),this.setActiveScreen(this.selfieReview)});this._selfieWrapperListeners=[{event:"selfie-capture.cancelled",handler:e},{event:"selfie-capture.close",handler:i},{event:"selfie-capture.publish",handler:s}],this._selfieWrapperListeners.forEach(({event:o,handler:c})=>{window.addEventListener(o,c)}),this.addEventListener("selfie-capture.publish",s)}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideAttribution(){return this.hasAttribute("hide-attribution")?'hide-attribution=""':""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?'show-navigation=""':""}get inAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get allowAgentMode(){return this.inAgentMode?'allow-agent-mode="true"':""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?'show-agent-mode-for-tests=""':""}get hideBack(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?'hide-back=""':""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?'disable-image-tests=""':""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled"))}handleCloseEvent(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.close"))}static get observedAttributes(){return["title","hidden","show-navigation","hide-back-to-host","initial-screen"]}attributeChangedCallback(e){switch(e){case"title":case"hidden":case"initial-screen":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",Jd);/*!
|
|
3862
3844
|
* Signature Pad v5.0.2 | https://github.com/szimek/signature_pad
|
|
3863
3845
|
* (c) 2024 Szymon Nowak | Released under the MIT license
|
|
3864
|
-
*/class gr{constructor(e,i,n,r){if(isNaN(e)||isNaN(i))throw new Error(`Point is invalid: (${e}, ${i})`);this.x=+e,this.y=+i,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class wo{static fromPoints(e,i){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,r=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new wo(e[1],n,r,e[2],i.start,i.end)}static calculateControlPoints(e,i,n){const r=e.x-i.x,s=e.y-i.y,o=i.x-n.x,a=i.y-n.y,c={x:(e.x+i.x)/2,y:(e.y+i.y)/2},l={x:(i.x+n.x)/2,y:(i.y+n.y)/2},d=Math.sqrt(r*r+s*s),h=Math.sqrt(o*o+a*a),u=c.x-l.x,p=c.y-l.y,f=h/(d+h),m={x:l.x+u*f,y:l.y+p*f},g=i.x-m.x,v=i.y-m.y;return{c1:new gr(c.x+g,c.y+v),c2:new gr(l.x+g,l.y+v)}}constructor(e,i,n,r,s,o){this.startPoint=e,this.control2=i,this.control1=n,this.endPoint=r,this.startWidth=s,this.endWidth=o}length(){let i=0,n,r;for(let s=0;s<=10;s+=1){const o=s/10,a=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),c=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const l=a-n,d=c-r;i+=Math.sqrt(l*l+d*d)}n=a,r=c}return i}point(e,i,n,r,s){return i*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+s*e*e*e}}class U0{constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,i,n){this._et.addEventListener(e,i,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,i,n){this._et.removeEventListener(e,i,n)}}function V0(t,e=250){let i=0,n=null,r,s,o;const a=()=>{i=Date.now(),n=null,r=t.apply(s,o),n||(s=null,o=[])};return function(...l){const d=Date.now(),h=e-(d-i);return s=this,o=l,h<=0||h>e?(n&&(clearTimeout(n),n=null),i=d,r=t.apply(s,o),n||(s=null,o=[])):n||(n=window.setTimeout(a,h)),r}}let j0=class ko extends U0{constructor(e,i={}){var n,r,s;super(),this.canvas=e,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=o=>{!this._isLeftButtonPressed(o,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(o))},this._handleMouseMove=o=>{if(!this._isLeftButtonPressed(o,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(o),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(o))},this._handleMouseUp=o=>{this._isLeftButtonPressed(o)||this._strokeEnd(this._pointerEventToSignatureEvent(o))},this._handleTouchStart=o=>{o.targetTouches.length!==1||this._drawingStroke||(o.cancelable&&o.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(o)))},this._handleTouchMove=o=>{if(o.targetTouches.length===1){if(o.cancelable&&o.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(o),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(o))}},this._handleTouchEnd=o=>{o.targetTouches.length===0&&(o.cancelable&&o.preventDefault(),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this._strokeEnd(this._touchEventToSignatureEvent(o)))},this._handlePointerDown=o=>{!this._isLeftButtonPressed(o)||this._drawingStroke||(o.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(o)))},this._handlePointerMove=o=>{if(!this._isLeftButtonPressed(o,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(o),!1);return}o.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(o))},this._handlePointerUp=o=>{this._isLeftButtonPressed(o)||(o.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(o)))},this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(n=i.throttle)!==null&&n!==void 0?n:16,this.minDistance=(r=i.minDistance)!==null&&r!==void 0?r:5,this.dotSize=i.dotSize||0,this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=i.compositeOperation||"source-over",this.canvasContextOptions=(s=i.canvasContextOptions)!==null&&s!==void 0?s:{},this._strokeMoveUpdate=this.throttle?V0(ko.prototype._strokeUpdate,this.throttle):ko.prototype._strokeUpdate,this._ctx=e.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:e,canvas:i}=this;e.fillStyle=this.backgroundColor,e.clearRect(0,0,i.width,i.height),e.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}fromDataURL(e,i={}){return new Promise((n,r)=>{const s=new Image,o=i.ratio||window.devicePixelRatio||1,a=i.width||this.canvas.width/o,c=i.height||this.canvas.height/o,l=i.xOffset||0,d=i.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,l,d,a,c),n()},s.onerror=h=>{r(h)},s.crossOrigin="anonymous",s.src=e,this._isEmpty=!1})}toDataURL(e="image/png",i){switch(e){case"image/svg+xml":return typeof i!="object"&&(i=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(i))}`;default:return typeof i!="number"&&(i=void 0),this.canvas.toDataURL(e,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const e=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!e?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var e;const i=window.document===this.canvas.ownerDocument?window:(e=this.canvas.ownerDocument.defaultView)!==null&&e!==void 0?e:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:e}=this._getListenerFunctions();e("pointermove",this._handlePointerMove),e("pointerup",this._handlePointerUp),e("mousemove",this._handleMouseMove),e("mouseup",this._handleMouseUp),e("touchmove",this._handleTouchMove),e("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(e,{clear:i=!0}={}){i&&this.clear(),this._fromData(e,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(e)}toData(){return this._data}_isLeftButtonPressed(e,i){return i?e.buttons===1:(e.buttons&1)===1}_pointerEventToSignatureEvent(e){return{event:e,type:e.type,x:e.clientX,y:e.clientY,pressure:"pressure"in e?e.pressure:0}}_touchEventToSignatureEvent(e){const i=e.changedTouches[0];return{event:e,type:e.type,x:i.clientX,y:i.clientY,pressure:i.force}}_getPointGroupOptions(e){return{penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}}_strokeBegin(e){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:e,cancelable:!0})))return;const{addEventListener:n}=this._getListenerFunctions();switch(e.event.type){case"mousedown":n("mousemove",this._handleMouseMove),n("mouseup",this._handleMouseUp);break;case"touchstart":n("touchmove",this._handleTouchMove),n("touchend",this._handleTouchEnd);break;case"pointerdown":n("pointermove",this._handlePointerMove),n("pointerup",this._handlePointerUp);break}this._drawingStroke=!0;const r=this._getPointGroupOptions(),s=Object.assign(Object.assign({},r),{points:[]});this._data.push(s),this._reset(r),this._strokeUpdate(e)}_strokeUpdate(e){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(e);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:e}));const i=this._createPoint(e.x,e.y,e.pressure),n=this._data[this._data.length-1],r=n.points,s=r.length>0&&r[r.length-1],o=s?i.distanceTo(s)<=this.minDistance:!1,a=this._getPointGroupOptions(n);if(!s||!(s&&o)){const c=this._addPoint(i,a);s?c&&this._drawCurve(c,a):this._drawDot(i,a),r.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:e}))}_strokeEnd(e,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(e),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:e})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown)}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown)}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart)}_reset(e){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this._ctx.fillStyle=e.penColor,this._ctx.globalCompositeOperation=e.compositeOperation}_createPoint(e,i,n){const r=this.canvas.getBoundingClientRect();return new gr(e-r.left,i-r.top,n,new Date().getTime())}_addPoint(e,i){const{_lastPoints:n}=this;if(n.push(e),n.length>2){n.length===3&&n.unshift(n[0]);const r=this._calculateCurveWidths(n[1],n[2],i),s=wo.fromPoints(n,r);return n.shift(),s}return null}_calculateCurveWidths(e,i,n){const r=n.velocityFilterWeight*i.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(r,n),o={end:s,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=s,o}_strokeWidth(e,i){return Math.max(i.maxWidth/(e+1),i.minWidth)}_drawCurveSegment(e,i,n){const r=this._ctx;r.moveTo(e,i),r.arc(e,i,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,i){const n=this._ctx,r=e.endWidth-e.startWidth,s=Math.ceil(e.length())*2;n.beginPath(),n.fillStyle=i.penColor;for(let o=0;o<s;o+=1){const a=o/s,c=a*a,l=c*a,d=1-a,h=d*d,u=h*d;let p=u*e.startPoint.x;p+=3*h*a*e.control1.x,p+=3*d*c*e.control2.x,p+=l*e.endPoint.x;let f=u*e.startPoint.y;f+=3*h*a*e.control1.y,f+=3*d*c*e.control2.y,f+=l*e.endPoint.y;const m=Math.min(e.startWidth+l*r,i.maxWidth);this._drawCurveSegment(p,f,m)}n.closePath(),n.fill()}_drawDot(e,i){const n=this._ctx,r=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=i.penColor,n.fill()}_fromData(e,i,n){for(const r of e){const{points:s}=r,o=this._getPointGroupOptions(r);if(s.length>1)for(let a=0;a<s.length;a+=1){const c=s[a],l=new gr(c.x,c.y,c.pressure,c.time);a===0&&this._reset(o);const d=this._addPoint(l,o);d&&i(d,o)}else this._reset(o),n(s[0],o)}}toSVG({includeBackgroundColor:e=!1}={}){const i=this._data,n=Math.max(window.devicePixelRatio||1,1),r=0,s=0,o=this.canvas.width/n,a=this.canvas.height/n,c=document.createElementNS("http://www.w3.org/2000/svg","svg");if(c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("viewBox",`${r} ${s} ${o} ${a}`),c.setAttribute("width",o.toString()),c.setAttribute("height",a.toString()),e&&this.backgroundColor){const l=document.createElement("rect");l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("fill",this.backgroundColor),c.appendChild(l)}return this._fromData(i,(l,{penColor:d})=>{const h=document.createElement("path");if(!isNaN(l.control1.x)&&!isNaN(l.control1.y)&&!isNaN(l.control2.x)&&!isNaN(l.control2.y)){const u=`M ${l.startPoint.x.toFixed(3)},${l.startPoint.y.toFixed(3)} C ${l.control1.x.toFixed(3)},${l.control1.y.toFixed(3)} ${l.control2.x.toFixed(3)},${l.control2.y.toFixed(3)} ${l.endPoint.x.toFixed(3)},${l.endPoint.y.toFixed(3)}`;h.setAttribute("d",u),h.setAttribute("stroke-width",(l.endWidth*2.25).toFixed(3)),h.setAttribute("stroke",d),h.setAttribute("fill","none"),h.setAttribute("stroke-linecap","round"),c.appendChild(h)}},(l,{penColor:d,dotSize:h,minWidth:u,maxWidth:p})=>{const f=document.createElement("circle"),m=h>0?h:(u+p)/2;f.setAttribute("r",m.toString()),f.setAttribute("cx",l.x.toString()),f.setAttribute("cy",l.y.toString()),f.setAttribute("fill",d),c.appendChild(f)}),c.outerHTML}};class Ye{static memoryLimit=2048e3;static supportedTypes=["image/jpeg","image/png","image/svg+xml"];static getHumanSize(e){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1),r=e/1024**n;return n===0?`${e} bytes`:`${r.toFixed(0)} ${i[n]}`}static getData(e){return new Promise((i,n)=>{const r=new FileReader;r.onload=s=>{i(s.target.result)},r.onerror=()=>{n(new Error("An error occurred reading the file. Please check the file, and try again"))},r.readAsDataURL(e)})}static async retrieve(e){if(e.length>1)throw new Error("Only one file upload is permitted at a time");const i=e[0];if(!Ye.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG, PNG or SVG image");if(i.size>Ye.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${Ye.getHumanSize(Ye.memoryLimit)}.`);return await Ye.getData(i)}}class U2 extends HTMLElement{connectedCallback(){const e=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
3846
|
+
*/class Sa{constructor(e,i,s,o){if(isNaN(e)||isNaN(i))throw new Error(`Point is invalid: (${e}, ${i})`);this.x=+e,this.y=+i,this.pressure=s||0,this.time=o||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class _1{static fromPoints(e,i){const s=this.calculateControlPoints(e[0],e[1],e[2]).c2,o=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new _1(e[1],s,o,e[2],i.start,i.end)}static calculateControlPoints(e,i,s){const o=e.x-i.x,c=e.y-i.y,l=i.x-s.x,u=i.y-s.y,h={x:(e.x+i.x)/2,y:(e.y+i.y)/2},f={x:(i.x+s.x)/2,y:(i.y+s.y)/2},_=Math.sqrt(o*o+c*c),m=Math.sqrt(l*l+u*u),b=h.x-f.x,E=h.y-f.y,A=m/(_+m),k={x:f.x+b*A,y:f.y+E*A},F=i.x-k.x,M=i.y-k.y;return{c1:new Sa(h.x+F,h.y+M),c2:new Sa(f.x+F,f.y+M)}}constructor(e,i,s,o,c,l){this.startPoint=e,this.control2=i,this.control1=s,this.endPoint=o,this.startWidth=c,this.endWidth=l}length(){let i=0,s,o;for(let c=0;c<=10;c+=1){const l=c/10,u=this.point(l,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),h=this.point(l,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(c>0){const f=u-s,_=h-o;i+=Math.sqrt(f*f+_*_)}s=u,o=h}return i}point(e,i,s,o,c){return i*(1-e)*(1-e)*(1-e)+3*s*(1-e)*(1-e)*e+3*o*(1-e)*e*e+c*e*e*e}}class A6{constructor(){try{this._et=new EventTarget}catch(e){this._et=document}}addEventListener(e,i,s){this._et.addEventListener(e,i,s)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,i,s){this._et.removeEventListener(e,i,s)}}function S6(t,e=250){let i=0,s=null,o,c,l;const u=()=>{i=Date.now(),s=null,o=t.apply(c,l),s||(c=null,l=[])};return function(...f){const _=Date.now(),m=e-(_-i);return c=this,l=f,m<=0||m>e?(s&&(clearTimeout(s),s=null),i=_,o=t.apply(c,l),s||(c=null,l=[])):s||(s=window.setTimeout(u,m)),o}}let k6=class Nu extends A6{constructor(e,i={}){var s,o,c;super(),this.canvas=e,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=l=>{!this._isLeftButtonPressed(l,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(l))},this._handleMouseMove=l=>{if(!this._isLeftButtonPressed(l,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(l),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(l))},this._handleMouseUp=l=>{this._isLeftButtonPressed(l)||this._strokeEnd(this._pointerEventToSignatureEvent(l))},this._handleTouchStart=l=>{l.targetTouches.length!==1||this._drawingStroke||(l.cancelable&&l.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(l)))},this._handleTouchMove=l=>{if(l.targetTouches.length===1){if(l.cancelable&&l.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(l),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(l))}},this._handleTouchEnd=l=>{l.targetTouches.length===0&&(l.cancelable&&l.preventDefault(),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this._strokeEnd(this._touchEventToSignatureEvent(l)))},this._handlePointerDown=l=>{!this._isLeftButtonPressed(l)||this._drawingStroke||(l.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(l)))},this._handlePointerMove=l=>{if(!this._isLeftButtonPressed(l,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(l),!1);return}l.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(l))},this._handlePointerUp=l=>{this._isLeftButtonPressed(l)||(l.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(l)))},this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(s=i.throttle)!==null&&s!==void 0?s:16,this.minDistance=(o=i.minDistance)!==null&&o!==void 0?o:5,this.dotSize=i.dotSize||0,this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=i.compositeOperation||"source-over",this.canvasContextOptions=(c=i.canvasContextOptions)!==null&&c!==void 0?c:{},this._strokeMoveUpdate=this.throttle?S6(Nu.prototype._strokeUpdate,this.throttle):Nu.prototype._strokeUpdate,this._ctx=e.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:e,canvas:i}=this;e.fillStyle=this.backgroundColor,e.clearRect(0,0,i.width,i.height),e.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}fromDataURL(e,i={}){return new Promise((s,o)=>{const c=new Image,l=i.ratio||window.devicePixelRatio||1,u=i.width||this.canvas.width/l,h=i.height||this.canvas.height/l,f=i.xOffset||0,_=i.yOffset||0;this._reset(this._getPointGroupOptions()),c.onload=()=>{this._ctx.drawImage(c,f,_,u,h),s()},c.onerror=m=>{o(m)},c.crossOrigin="anonymous",c.src=e,this._isEmpty=!1})}toDataURL(e="image/png",i){switch(e){case"image/svg+xml":return typeof i!="object"&&(i=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(i))}`;default:return typeof i!="number"&&(i=void 0),this.canvas.toDataURL(e,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const e=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!e?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var e;const i=window.document===this.canvas.ownerDocument?window:(e=this.canvas.ownerDocument.defaultView)!==null&&e!==void 0?e:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:e}=this._getListenerFunctions();e("pointermove",this._handlePointerMove),e("pointerup",this._handlePointerUp),e("mousemove",this._handleMouseMove),e("mouseup",this._handleMouseUp),e("touchmove",this._handleTouchMove),e("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(e,{clear:i=!0}={}){i&&this.clear(),this._fromData(e,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(e)}toData(){return this._data}_isLeftButtonPressed(e,i){return i?e.buttons===1:(e.buttons&1)===1}_pointerEventToSignatureEvent(e){return{event:e,type:e.type,x:e.clientX,y:e.clientY,pressure:"pressure"in e?e.pressure:0}}_touchEventToSignatureEvent(e){const i=e.changedTouches[0];return{event:e,type:e.type,x:i.clientX,y:i.clientY,pressure:i.force}}_getPointGroupOptions(e){return{penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}}_strokeBegin(e){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:e,cancelable:!0})))return;const{addEventListener:s}=this._getListenerFunctions();switch(e.event.type){case"mousedown":s("mousemove",this._handleMouseMove),s("mouseup",this._handleMouseUp);break;case"touchstart":s("touchmove",this._handleTouchMove),s("touchend",this._handleTouchEnd);break;case"pointerdown":s("pointermove",this._handlePointerMove),s("pointerup",this._handlePointerUp);break}this._drawingStroke=!0;const o=this._getPointGroupOptions(),c=Object.assign(Object.assign({},o),{points:[]});this._data.push(c),this._reset(o),this._strokeUpdate(e)}_strokeUpdate(e){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(e);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:e}));const i=this._createPoint(e.x,e.y,e.pressure),s=this._data[this._data.length-1],o=s.points,c=o.length>0&&o[o.length-1],l=c?i.distanceTo(c)<=this.minDistance:!1,u=this._getPointGroupOptions(s);if(!c||!(c&&l)){const h=this._addPoint(i,u);c?h&&this._drawCurve(h,u):this._drawDot(i,u),o.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:e}))}_strokeEnd(e,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(e),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:e})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown)}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown)}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart)}_reset(e){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this._ctx.fillStyle=e.penColor,this._ctx.globalCompositeOperation=e.compositeOperation}_createPoint(e,i,s){const o=this.canvas.getBoundingClientRect();return new Sa(e-o.left,i-o.top,s,new Date().getTime())}_addPoint(e,i){const{_lastPoints:s}=this;if(s.push(e),s.length>2){s.length===3&&s.unshift(s[0]);const o=this._calculateCurveWidths(s[1],s[2],i),c=_1.fromPoints(s,o);return s.shift(),c}return null}_calculateCurveWidths(e,i,s){const o=s.velocityFilterWeight*i.velocityFrom(e)+(1-s.velocityFilterWeight)*this._lastVelocity,c=this._strokeWidth(o,s),l={end:c,start:this._lastWidth};return this._lastVelocity=o,this._lastWidth=c,l}_strokeWidth(e,i){return Math.max(i.maxWidth/(e+1),i.minWidth)}_drawCurveSegment(e,i,s){const o=this._ctx;o.moveTo(e,i),o.arc(e,i,s,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,i){const s=this._ctx,o=e.endWidth-e.startWidth,c=Math.ceil(e.length())*2;s.beginPath(),s.fillStyle=i.penColor;for(let l=0;l<c;l+=1){const u=l/c,h=u*u,f=h*u,_=1-u,m=_*_,b=m*_;let E=b*e.startPoint.x;E+=3*m*u*e.control1.x,E+=3*_*h*e.control2.x,E+=f*e.endPoint.x;let A=b*e.startPoint.y;A+=3*m*u*e.control1.y,A+=3*_*h*e.control2.y,A+=f*e.endPoint.y;const k=Math.min(e.startWidth+f*o,i.maxWidth);this._drawCurveSegment(E,A,k)}s.closePath(),s.fill()}_drawDot(e,i){const s=this._ctx,o=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;s.beginPath(),this._drawCurveSegment(e.x,e.y,o),s.closePath(),s.fillStyle=i.penColor,s.fill()}_fromData(e,i,s){for(const o of e){const{points:c}=o,l=this._getPointGroupOptions(o);if(c.length>1)for(let u=0;u<c.length;u+=1){const h=c[u],f=new Sa(h.x,h.y,h.pressure,h.time);u===0&&this._reset(l);const _=this._addPoint(f,l);_&&i(_,l)}else this._reset(l),s(c[0],l)}}toSVG({includeBackgroundColor:e=!1}={}){const i=this._data,s=Math.max(window.devicePixelRatio||1,1),o=0,c=0,l=this.canvas.width/s,u=this.canvas.height/s,h=document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.setAttribute("viewBox",`${o} ${c} ${l} ${u}`),h.setAttribute("width",l.toString()),h.setAttribute("height",u.toString()),e&&this.backgroundColor){const f=document.createElement("rect");f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.setAttribute("fill",this.backgroundColor),h.appendChild(f)}return this._fromData(i,(f,{penColor:_})=>{const m=document.createElement("path");if(!isNaN(f.control1.x)&&!isNaN(f.control1.y)&&!isNaN(f.control2.x)&&!isNaN(f.control2.y)){const b=`M ${f.startPoint.x.toFixed(3)},${f.startPoint.y.toFixed(3)} C ${f.control1.x.toFixed(3)},${f.control1.y.toFixed(3)} ${f.control2.x.toFixed(3)},${f.control2.y.toFixed(3)} ${f.endPoint.x.toFixed(3)},${f.endPoint.y.toFixed(3)}`;m.setAttribute("d",b),m.setAttribute("stroke-width",(f.endWidth*2.25).toFixed(3)),m.setAttribute("stroke",_),m.setAttribute("fill","none"),m.setAttribute("stroke-linecap","round"),h.appendChild(m)}},(f,{penColor:_,dotSize:m,minWidth:b,maxWidth:E})=>{const A=document.createElement("circle"),k=m>0?m:(b+E)/2;A.setAttribute("r",k.toString()),A.setAttribute("cx",f.x.toString()),A.setAttribute("cy",f.y.toString()),A.setAttribute("fill",_),h.appendChild(A)}),h.outerHTML}};const un=class un{static getHumanSize(e){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1),o=e/Uu(1024,s);return s===0?`${e} bytes`:`${o.toFixed(0)} ${i[s]}`}static getData(e){return new Promise((i,s)=>{const o=new FileReader;o.onload=c=>{i(c.target.result)},o.onerror=()=>{s(new Error("An error occurred reading the file. Please check the file, and try again"))},o.readAsDataURL(e)})}static retrieve(e){return q(this,null,function*(){if(e.length>1)throw new Error("Only one file upload is permitted at a time");const i=e[0];if(!un.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG, PNG or SVG image");if(i.size>un.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${un.getHumanSize(un.memoryLimit)}.`);return yield un.getData(i)})}};xr(un,"memoryLimit",2048e3),xr(un,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let w1=un;class Qd extends HTMLElement{connectedCallback(){const e=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
3865
3847
|
:host {
|
|
3866
3848
|
display: block;
|
|
3867
3849
|
block-size: auto;
|
|
@@ -3992,9 +3974,9 @@ button:active {
|
|
|
3992
3974
|
button:disabled {
|
|
3993
3975
|
--button-color: var(--color-disabled);
|
|
3994
3976
|
}
|
|
3995
|
-
`;const
|
|
3977
|
+
`;const s=document.createElement("div"),o=document.createElement("div");o.innerHTML=`
|
|
3996
3978
|
<p id="error" class="color-red | center"><p>
|
|
3997
|
-
`;const
|
|
3979
|
+
`;const c=document.createElement("div");c.setAttribute("id","controls"),c.setAttribute("part","signature-controls"),c.innerHTML=`
|
|
3998
3980
|
<button data-variant="icon" type="button" name="clear" id="clear">
|
|
3999
3981
|
<span class="visually-hidden">
|
|
4000
3982
|
Clear Signature
|
|
@@ -4003,7 +3985,7 @@ button:disabled {
|
|
|
4003
3985
|
<path d="M3.314 15.646a8.004 8.004 0 01-2.217-4.257 8.06 8.06 0 01.545-4.655l1.789.788a6.062 6.062 0 001.264 6.737 6.033 6.033 0 008.551 0c2.358-2.37 2.358-6.224 0-8.592a5.996 5.996 0 00-4.405-1.782l.662 2.354-3.128-.796-3.127-.796 2.25-2.324L7.748 0l.55 1.953a7.966 7.966 0 016.33 2.326 8.004 8.004 0 012.342 5.684 8.005 8.005 0 01-2.343 5.683A7.928 7.928 0 018.97 18a7.928 7.928 0 01-5.656-2.354z" fill="currentColor" />
|
|
4004
3986
|
</svg>
|
|
4005
3987
|
</button>
|
|
4006
|
-
`;const
|
|
3988
|
+
`;const l=document.createElement("canvas"),f=this.parentElement.closest(":not([hidden])").querySelector(":not([hidden])").offsetWidth,m=30*getComputedStyle(document.documentElement).fontSize.split("px")[0],b=2;l.width=f<m?f:m,l.height=(f<m?f:m)/b,l.setAttribute("id","signature-canvas"),l.setAttribute("part","canvas");const E=document.createElement("div");E.setAttribute("id","signature-upload-wrapper"),E.innerHTML=`
|
|
4007
3989
|
<p part="upload">
|
|
4008
3990
|
<strong>or</strong>
|
|
4009
3991
|
<label>
|
|
@@ -4021,7 +4003,7 @@ button:disabled {
|
|
|
4021
4003
|
<span>upload a signature</span>
|
|
4022
4004
|
</label>
|
|
4023
4005
|
</p>
|
|
4024
|
-
`;const
|
|
4006
|
+
`;const A=document.createElement("p");A.innerHTML=`
|
|
4025
4007
|
<button data-variant="solid" type="button" name="publish" id="publish">
|
|
4026
4008
|
<span>
|
|
4027
4009
|
Continue
|
|
@@ -4042,8 +4024,8 @@ button:disabled {
|
|
|
4042
4024
|
/>
|
|
4043
4025
|
</svg>
|
|
4044
4026
|
</button>
|
|
4045
|
-
`,
|
|
4046
|
-
${
|
|
4027
|
+
`,s.appendChild(o),s.appendChild(c),s.appendChild(l),this.allowUpload&&s.appendChild(E),s.appendChild(A),e.appendChild(i),e.appendChild(s),this.core=new k6(l),this.errorMessage=o.querySelector("#error"),window&&(window.onresize=this.resizeCanvas()),this.clearSignatureButton=c.querySelector("#clear"),this.clearSignatureButton.addEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton=E.querySelector("#upload-signature"),this.uploadSignatureButton.addEventListener("change",k=>this.uploadSignature(k)),this.publishSignatureButton=A.querySelector("#publish"),this.publishSignatureButton.addEventListener("click",()=>this.publishSignature())}disconnectedCallback(){this.publishSignatureButton.removeEventListener("click",()=>this.publishSignature()),this.clearSignatureButton.removeEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton.removeEventListener("change",e=>this.uploadSignature(e))}resizeCanvas(){const e=this.shadowRoot.querySelector("canvas"),i=Math.max(window.devicePixelRatio||1,1);e.width=(e.offsetWidth||e.width)*i,e.height=(e.offsetHeight||e.height)*i,e.getContext("2d").scale(i,i),this.core.fromData(this.core.toData())}publishSignature(){try{this.resetErrorMessage();const e=this.shadowRoot.querySelector("img");let i=e?e.src:void 0;if(!i&&!this.core.isEmpty()&&(i=this.core.toDataURL("image/svg+xml")),i)this.dispatchEvent(new CustomEvent("signature-pad.publish",{detail:i}));else throw new Error(`No signature present. ${this.allowUpload?"Draw or upload":"Draw"} a signature`)}catch(e){this.handleError(e.message)}}resetErrorMessage(){this.errorMessage.textContent=""}handleError(e){this.errorMessage.textContent=e}clearSignature(){this.resetErrorMessage();const e=this.shadowRoot.querySelector("canvas"),i=this.shadowRoot.querySelector("img");i&&(i.remove(),e.removeAttribute("hidden")),this.core.clear()}previewUpload(e){const i=this.shadowRoot.querySelector("canvas");let s=this.shadowRoot.querySelector("img");s||(s=document.createElement("img")),s.src=e,s.setAttribute("part","upload-preview-image"),i.setAttribute("hidden",!0),i.insertAdjacentElement("afterend",s)}uploadSignature(e){return q(this,null,function*(){try{this.resetErrorMessage();const{files:i}=e.target,s=yield w1.retrieve(i);this.previewUpload(s)}catch(i){this.handleError(i.message)}})}get allowUpload(){return this.hasAttribute("allow-upload")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}"customElements"in window&&!window.customElements.get("smileid-signature-pad")&&window.customElements.define("smileid-signature-pad",Qd);function L6(){return`
|
|
4028
|
+
${Ai(this.themeColor)}
|
|
4047
4029
|
<style>
|
|
4048
4030
|
.camera-permission-screen {
|
|
4049
4031
|
display: flex;
|
|
@@ -4117,9 +4099,15 @@ button:disabled {
|
|
|
4117
4099
|
</div>
|
|
4118
4100
|
</div>
|
|
4119
4101
|
</div>
|
|
4120
|
-
`}class
|
|
4121
|
-
|
|
4122
|
-
|
|
4102
|
+
`}class M6 extends HTMLElement{connectedCallback(){this.templateString=L6.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners()}setUpEventListeners(){const e=this.shadowRoot.querySelector("#error"),i=this.shadowRoot.getElementById("request-camera-access");e.textContent="",i.addEventListener("click",()=>q(this,null,function*(){i.setAttribute("disabled",!0);try{yield et.getMedia({audio:!1,video:!0}),this.dispatchEvent(new CustomEvent("camera-permission.granted"))}catch(s){this.dispatchEvent(new CustomEvent("camera-permission.denied",{detail:s})),e.textContent=et.handleCameraError(s)}i.removeAttribute("disabled")}))}get showNavigation(){return this.hasAttribute("show-navigation")}get hideAttribution(){return this.hasAttribute("hide-attribution")}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}window.customElements&&!window.customElements.get("camera-permission")&&window.customElements.define("camera-permission",M6);const T6=xs.version;function I6(){return`
|
|
4103
|
+
<style>
|
|
4104
|
+
:host {
|
|
4105
|
+
display: block;
|
|
4106
|
+
height: 100%;
|
|
4107
|
+
}
|
|
4108
|
+
</style>
|
|
4109
|
+
${Ai(this.themeColor)}
|
|
4110
|
+
<div style="height: 100%;">
|
|
4123
4111
|
<camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}></camera-permission>
|
|
4124
4112
|
<selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
|
|
4125
4113
|
${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests}
|
|
@@ -4127,5 +4115,5 @@ button:disabled {
|
|
|
4127
4115
|
<document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
|
|
4128
4116
|
${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
|
|
4129
4117
|
</div>
|
|
4130
|
-
`}class
|
|
4118
|
+
`}class t3 extends HTMLElement{constructor(){super(),this.scwTemplateString=I6.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:T6}},"mediaDevices"in navigator&&"getUserMedia"in navigator.mediaDevices?this.setUpEventListeners():this.shadowRoot.innerHTML='<h1 class="error-message">Your browser does not support this integration</h1>'}disconnectedCallback(){et.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.shadowRoot.innerHTML=""}static get observedAttributes(){return["allow-agent-mode","disable-image-tests","document-capture-modes","document-type","hide-attribution","hide-back-of-id","hide-back-to-host","show-navigation","theme-color"]}attributeChangedCallback(e){switch(e){case"allow-agent-mode":case"disable-image-tests":case"document-capture-modes":case"document-type":case"hide-attribution":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":case"theme-color":this.disconnectedCallback(),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.cameraPermission=this.shadowRoot.querySelector("camera-permission"),this.SelfieCaptureScreens=this.shadowRoot.querySelector("selfie-capture-screens"),this.documentCapture=this.shadowRoot.querySelector("document-capture-screens"),this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.setActiveScreen(this.SelfieCaptureScreens),this.cameraPermission.addEventListener("camera-permission.granted",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.publish",e=>{this._data.images=e.detail.images,this.captureId?this.setActiveScreen(this.documentCapture):this._publishSelectedImages()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.cancelled",()=>{this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.handleBackEvents()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.back",()=>{this.hideInstructions||this.setActiveScreen(this.cameraPermission)}),this.documentCapture.addEventListener("document-capture-screens.publish",e=>{this._data.images=[...this._data.images,...e.detail.images],this._publishSelectedImages()}),this.documentCapture.addEventListener("document-capture-screens.cancelled",()=>{this.SelfieCaptureScreens.setAttribute("initial-screen","selfie-capture"),this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),[this.cameraPermission,this.SelfieCaptureScreens,this.documentCapture].forEach(e=>{e.addEventListener(`${e.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvent())}),this.documentCapture.addEventListener("document-capture-screens.back",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.reset()})}reset(){this.disconnectedCallback(),this.connectedCallback()}handleBackEvents(){this.dispatchEvent(new CustomEvent("smart-camera-web.cancelled"))}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("smart-camera-web.publish",{detail:this._data}))}get captureId(){return this.hasAttribute("capture-id")}get documentType(){return this.getAttribute("document-type")}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get hideInstructions(){return this.hasAttribute("hide-instructions")?"hide-instructions":""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")?"hide-back-of-id":""}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get hideBackToHost(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?"hide-back":""}get allowAgentMode(){return this.hasAttribute("allow-agent-mode")?`allow-agent-mode=${this.getAttribute("allow-agent-mode")}`:""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?"show-agent-mode-for-tests":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?"disable-image-tests":""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get hasThemeColor(){return this.hasAttribute("theme-color")&&![null,void 0,"null","undefined"].includes(this.getAttribute("theme-color"))}get themeColor(){return this.hasThemeColor?this.getAttribute("theme-color"):"#001096"}get applyComponentThemeColor(){return this.hasThemeColor?`theme-color='${this.themeColor}'`:""}setActiveScreen(e){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),e.removeAttribute("hidden"),this.activeScreen=e}handleCloseEvent(){this.dispatchEvent(new CustomEvent("smart-camera-web.close"))}}return"customElements"in window&&!customElements.get("smart-camera-web")&&customElements.define("smart-camera-web",t3),ht.DocumentCaptureScreens=Wu,ht.EndUserConsent=ju,ht.List=Vu,ht.Navigation=zu,ht.Option=Gu,ht.Root=Er,ht.SelfieCaptureScreens=Jd,ht.SignaturePad=Qd,ht.SmartCameraWeb=t3,ht.TotpConsent=qu,ht.Trigger=Hu,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"}),ht}({});
|
|
4131
4119
|
//# sourceMappingURL=smart-camera-web.js.map
|