@photonhealth/elements 0.0.85 → 0.0.86

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";const fr={};function d$(e){fr.context=e}const f$=(e,t)=>e===t,br=Symbol("solid-proxy"),_u=Symbol("solid-track"),gs={equals:f$};let Dg=jg;const Ur=1,bs=2,Rg={owned:null,cleanups:null,context:null,owner:null};var it=null;let Cn=null,et=null,mt=null,Ir=null,th=0;function $a(e,t){const r=et,n=it,i=e.length===0,o=i?Rg:{owned:null,cleanups:null,context:null,owner:t||n},a=i?e:()=>e(()=>V(()=>Dl(o)));it=o,et=null;try{return Ti(a,!0)}finally{et=r,it=n}}function L(e,t){t=t?Object.assign({},gs,t):gs;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),Mg(r,i));return[Lg.bind(r),n]}function h$(e,t,r){const n=Al(e,t,!0,Ur);Pi(n)}function W(e,t,r){const n=Al(e,t,!1,Ur);Pi(n)}function ge(e,t,r){Dg=$$;const n=Al(e,t,!1,Ur);n.user=!0,Ir?Ir.push(n):Pi(n)}function pe(e,t,r){r=r?Object.assign({},gs,r):gs;const n=Al(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Pi(n),Lg.bind(n)}function p$(e){return Ti(e,!1)}function V(e){const t=et;et=null;try{return e()}finally{et=t}}function Tt(e){ge(()=>V(e))}function Il(e){return it===null||(it.cleanups===null?it.cleanups=[e]:it.cleanups.push(e)),e}function Fg(){return et}function P(){return it}function m$(e,t){const r=Symbol("context");return{id:r,Provider:_$(r),defaultValue:e}}function v$(e){let t;return(t=Vg(it,e.id))!==void 0?t:e.defaultValue}function y$(e){const t=pe(e),r=pe(()=>xu(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}function Lg(){const e=Cn;if(this.sources&&(this.state||e))if(this.state===Ur||e)Pi(this);else{const t=mt;mt=null,Ti(()=>ws(this),!1),mt=t}if(et){const t=this.observers?this.observers.length:0;et.sources?(et.sources.push(this),et.sourceSlots.push(t)):(et.sources=[this],et.sourceSlots=[t]),this.observers?(this.observers.push(et),this.observerSlots.push(et.sources.length-1)):(this.observers=[et],this.observerSlots=[et.sources.length-1])}return this.value}function Mg(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&Ti(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],a=Cn&&Cn.running;a&&Cn.disposed.has(o),(a&&!o.tState||!a&&!o.state)&&(o.pure?mt.push(o):Ir.push(o),o.observers&&zg(o)),a||(o.state=Ur)}if(mt.length>1e6)throw mt=[],new Error},!1)),t}function Pi(e){if(!e.fn)return;Dl(e);const t=it,r=et,n=th;et=it=e,g$(e,e.value,n),et=r,it=t}function g$(e,t,r){let n;try{n=e.fn(t)}catch(i){e.pure&&(e.state=Ur,e.owned&&e.owned.forEach(Dl),e.owned=null),Ug(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Mg(e,n):e.value=n,e.updatedAt=r)}function Al(e,t,r,n=Ur,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:it,context:null,pure:r};return it===null||it!==Rg&&(it.owned?it.owned.push(o):it.owned=[o]),o}function $s(e){const t=Cn;if(e.state===0||t)return;if(e.state===bs||t)return ws(e);if(e.suspense&&V(e.suspense.inFallback))return e.suspense.effects.push(e);const r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<th);)(e.state||t)&&r.push(e);for(let n=r.length-1;n>=0;n--)if(e=r[n],e.state===Ur||t)Pi(e);else if(e.state===bs||t){const i=mt;mt=null,Ti(()=>ws(e,r[0]),!1),mt=i}}function Ti(e,t){if(mt)return e();let r=!1;t||(mt=[]),Ir?r=!0:Ir=[],th++;try{const n=e();return b$(r),n}catch(n){mt||(Ir=null),mt=null,Ug(n)}}function b$(e){if(mt&&(jg(mt),mt=null),e)return;const t=Ir;Ir=null,t.length&&Ti(()=>Dg(t),!1)}function jg(e){for(let t=0;t<e.length;t++)$s(e[t])}function $$(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:$s(n)}for(fr.context&&d$(),t=0;t<r;t++)$s(e[t])}function ws(e,t){const r=Cn;e.state=0;for(let n=0;n<e.sources.length;n+=1){const i=e.sources[n];i.sources&&(i.state===Ur||r?i!==t&&$s(i):(i.state===bs||r)&&ws(i,t))}}function zg(e){const t=Cn;for(let r=0;r<e.observers.length;r+=1){const n=e.observers[r];(!n.state||t)&&(n.state=bs,n.pure?mt.push(n):Ir.push(n),n.observers&&zg(n))}}function Dl(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const o=i.pop(),a=r.observerSlots.pop();n<i.length&&(o.sourceSlots[a]=n,i[n]=o,r.observerSlots[n]=a)}}if(e.owned){for(t=0;t<e.owned.length;t++)Dl(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function w$(e){return e instanceof Error||typeof e=="string"?e:new Error("Unknown error")}function Ug(e){throw e=w$(e),e}function Vg(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:Vg(e.owner,t):void 0}function xu(e){if(typeof e=="function"&&!e.length)return xu(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=xu(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function _$(e,t){return function(n){let i;return W(()=>i=V(()=>(it.context={[e]:n.value},y$(()=>n.children))),void 0),i}}const x$=Symbol("fallback");function $p(e){for(let t=0;t<e.length;t++)e[t]()}function S$(e,t,r={}){let n=[],i=[],o=[],a=0,s=t.length>1?[]:null;return Il(()=>$p(o)),()=>{let c=e()||[],l,u;return c[_u],V(()=>{let f=c.length,h,p,m,v,y,b,g,w,x;if(f===0)a!==0&&($p(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[x$],i[0]=$a(E=>(o[0]=E,r.fallback())),a=1);else if(a===0){for(i=new Array(f),u=0;u<f;u++)n[u]=c[u],i[u]=$a(d);a=f}else{for(m=new Array(f),v=new Array(f),s&&(y=new Array(f)),b=0,g=Math.min(a,f);b<g&&n[b]===c[b];b++);for(g=a-1,w=f-1;g>=b&&w>=b&&n[g]===c[w];g--,w--)m[w]=i[g],v[w]=o[g],s&&(y[w]=s[g]);for(h=new Map,p=new Array(w+1),u=w;u>=b;u--)x=c[u],l=h.get(x),p[u]=l===void 0?-1:l,h.set(x,u);for(l=b;l<=g;l++)x=n[l],u=h.get(x),u!==void 0&&u!==-1?(m[u]=i[l],v[u]=o[l],s&&(y[u]=s[l]),u=p[u],h.set(x,u)):o[l]();for(u=b;u<f;u++)u in m?(i[u]=m[u],o[u]=v[u],s&&(s[u]=y[u],s[u](u))):i[u]=$a(d);i=i.slice(0,a=f),n=c.slice(0)}return i});function d(f){if(o[u]=f,s){const[h,p]=L(u);return s[u]=p,t(c[u],h)}return t(c[u])}}}function z(e,t){return V(()=>e(t||{}))}function Yo(){return!0}const k$={get(e,t,r){return t===br?r:e.get(t)},has(e,t){return t===br?!0:e.has(t)},set:Yo,deleteProperty:Yo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Yo,deleteProperty:Yo}},ownKeys(e){return e.keys()}};function uc(e){return(e=typeof e=="function"?e():e)?e:{}}function Su(...e){let t=!1;for(let n=0;n<e.length;n++){const i=e[n];t=t||!!i&&br in i,e[n]=typeof i=="function"?(t=!0,pe(i)):i}if(t)return new Proxy({get(n){for(let i=e.length-1;i>=0;i--){const o=uc(e[i])[n];if(o!==void 0)return o}},has(n){for(let i=e.length-1;i>=0;i--)if(n in uc(e[i]))return!0;return!1},keys(){const n=[];for(let i=0;i<e.length;i++)n.push(...Object.keys(uc(e[i])));return[...new Set(n)]}},k$);const r={};for(let n=e.length-1;n>=0;n--)if(e[n]){const i=Object.getOwnPropertyDescriptors(e[n]);for(const o in i)o in r||Object.defineProperty(r,o,{enumerable:!0,get(){for(let a=e.length-1;a>=0;a--){const s=(e[a]||{})[o];if(s!==void 0)return s}}})}return r}function Rl(e){const t="fallback"in e&&{fallback:()=>e.fallback};return pe(S$(()=>e.each,e.children,t||void 0))}function re(e){let t=!1;const r=e.keyed,n=pe(()=>e.when,void 0,{equals:(i,o)=>t?i===o:!i==!o});return pe(()=>{const i=n();if(i){const o=e.children,a=typeof o=="function"&&o.length>0;return t=r||a,a?V(()=>o(i)):o}return e.fallback},void 0,void 0)}function E$(e,t,r){let n=r.length,i=t.length,o=n,a=0,s=0,c=t[i-1].nextSibling,l=null;for(;a<i||s<o;){if(t[a]===r[s]){a++,s++;continue}for(;t[i-1]===r[o-1];)i--,o--;if(i===a){const u=o<n?s?r[s-1].nextSibling:r[o-s]:c;for(;s<o;)e.insertBefore(r[s++],u)}else if(o===s)for(;a<i;)(!l||!l.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[o-1]&&r[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--o],u),t[i]=r[o]}else{if(!l){l=new Map;let d=s;for(;d<o;)l.set(r[d],d++)}const u=l.get(t[a]);if(u!=null)if(s<u&&u<o){let d=a,f=1,h;for(;++d<i&&d<o&&!((h=l.get(t[d]))==null||h!==u+f);)f++;if(f>u-s){const p=t[a];for(;s<u;)e.insertBefore(r[s++],p)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}const wp="_$DX_DELEGATE";function O(e,t,r){const n=document.createElement("template");n.innerHTML=e;let i=n.content.firstChild;return r&&(i=i.firstChild),i}function Ni(e,t=window.document){const r=t[wp]||(t[wp]=new Set);for(let n=0,i=e.length;n<i;n++){const o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,T$))}}function O$(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function _p(e,t){t==null?e.removeAttribute("class"):e.className=t}function C$(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(xp(e,s,!1),delete r[s])}for(o=0,a=n.length;o<a;o++){const s=n[o],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(xp(e,s,!0),r[s]=c)}return r}function P$(e,t,r){if(!t)return r?O$(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function ee(e,t,r){return V(()=>e(t,r))}function _(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return _s(e,t,n,r);W(i=>_s(e,t(),i,r),n)}function xp(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function T$(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),fr.registry&&!fr.done&&(fr.done=!0,document.querySelectorAll("[id^=pl-]").forEach(n=>{for(;n&&n.nodeType!==8&&n.nodeValue!=="pl-"+e;){let i=n.nextSibling;n.remove(),n=i}n&&n.remove()}));r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function _s(e,t,r,n,i){for(fr.context&&!r&&(r=[...e.childNodes]);typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(fr.context)return r;if(o==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=Wn(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(fr.context)return r;r=Wn(e,r,n)}else{if(o==="function")return W(()=>{let s=t();for(;typeof s=="function";)s=s();r=_s(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],c=r&&Array.isArray(r);if(ku(s,t,r,i))return W(()=>r=_s(e,s,r,n,!0)),()=>r;if(fr.context){if(!s.length)return r;for(let l=0;l<s.length;l++)if(s[l].parentNode)return r=s}if(s.length===0){if(r=Wn(e,r,n),a)return r}else c?r.length===0?Sp(e,s,n):E$(e,r,s):(r&&Wn(e),Sp(e,s));r=s}else if(t instanceof Node){if(fr.context&&t.parentNode)return r=a?[t]:t;if(Array.isArray(r)){if(a)return r=Wn(e,r,n,t);Wn(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function ku(e,t,r,n){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],c=r&&r[o];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))i=ku(e,s,c)||i;else if(typeof s=="function")if(n){for(;typeof s=="function";)s=s();i=ku(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else e.push(s),i=!0;else{const l=String(s);c&&c.nodeType===3&&c.data===l?e.push(c):e.push(document.createTextNode(l))}}return i}function Sp(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Wn(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const c=s.parentNode===e;!o&&!a?c?e.replaceChild(i,s):e.insertBefore(i,r):c&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}function N$(e){return Object.keys(e).reduce((r,n)=>{const i=e[n];return r[n]=Object.assign({},i),Wg(i.value)&&!F$(i.value)&&!Array.isArray(i.value)&&(r[n].value=Object.assign({},i.value)),Array.isArray(i.value)&&(r[n].value=i.value.slice(0)),r},{})}function I$(e){return e?Object.keys(e).reduce((r,n)=>{const i=e[n];return r[n]=Wg(i)&&"value"in i?i:{value:i},r[n].attribute||(r[n].attribute=R$(n)),r[n].parse="parse"in r[n]?r[n].parse:typeof r[n].value!="string",r},{}):{}}function A$(e){return Object.keys(e).reduce((r,n)=>(r[n]=e[n].value,r),{})}function D$(e,t){const r=N$(t);return Object.keys(t).forEach(i=>{const o=r[i],a=e.getAttribute(o.attribute),s=e[i];a&&(o.value=o.parse?Bg(a):a),s!=null&&(o.value=Array.isArray(s)?s.slice(0):s),o.reflect&&kp(e,o.attribute,o.value),Object.defineProperty(e,i,{get(){return o.value},set(c){const l=o.value;o.value=c,o.reflect&&kp(this,o.attribute,o.value);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](i,c,l)},enumerable:!0,configurable:!0})}),r}function Bg(e){if(!!e)try{return JSON.parse(e)}catch{return e}}function kp(e,t,r){if(r==null||r===!1)return e.removeAttribute(t);let n=JSON.stringify(r);e.__updating[t]=!0,n==="true"&&(n=""),e.setAttribute(t,n),Promise.resolve().then(()=>delete e.__updating[t])}function R$(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function Wg(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function F$(e){return Object.prototype.toString.call(e)==="[object Function]"}function L$(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let dc;function M$(e,t){const r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(i=>t[i].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=D$(this,t);const i=A$(this.props),o=this.Component,a=dc;try{dc=this,this.__initialized=!0,L$(o)?new o(i,{element:this}):o(i,{element:this})}finally{dc=a}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let i=null;for(;i=this.__releaseCallbacks.pop();)i(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(i,o,a){if(!!this.__initialized&&!this.__updating[i]&&(i=this.lookupProp(i),i in t)){if(a==null&&!this[i])return;this[i]=t[i].parse?Bg(a):a}}lookupProp(i){if(!!t)return r.find(o=>i===o||i===t[o].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(i){this.__releaseCallbacks.push(i)}addPropertyChangedCallback(i){this.__propertyChangedCallbacks.push(i)}}}function j$(e,t={},r={}){const{BaseElement:n=HTMLElement,extension:i}=r;return o=>{if(!e)throw new Error("tag is required to register a Component");let a=customElements.get(e);return a?(a.prototype.Component=o,a):(a=M$(n,I$(t)),a.prototype.Component=o,a.prototype.registeredTag=e,customElements.define(e,a,i),a)}}function z$(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const[i,o]=L(e[t[n]]);Object.defineProperty(r,t[n],{get:i,set(a){o(()=>a)}})}return r}function U$(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function V$(e){return(t,r)=>{const{element:n}=r;return $a(i=>{const o=z$(t);n.addPropertyChangedCallback((s,c)=>o[s]=c),n.addReleaseCallback(()=>{n.renderRoot.textContent="",i()});const a=e(o,r);return _(n.renderRoot,a)},U$(n))}}function we(e,t,r){return arguments.length===2&&(r=t,t={}),j$(e,t)(V$(r))}const qg=m$(),rt=()=>v$(qg),B$=(e,t)=>{const r=[];return t.forEach(n=>{(!Object.keys(e).includes(n)||e[n]==null)&&r.push(`photon-client requires ${n}, but no value was provided`)}),r.forEach(n=>console.warn(n)),r},W$=/[?&]code=[^&]+/,q$=/[?&]state=[^&]+/,H$=/[?&]error=[^&]+/,G$=(e=window.location.search)=>(W$.test(e)||H$.test(e))&&q$.test(e),Ep=e=>e.replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),Q$=e=>/^\d+$/.test(e)&&e.length>=5;var Eu=function(e,t){return Eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Eu(e,t)};function lr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Eu(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var C=function(){return C=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},C.apply(this,arguments)};function an(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function ie(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?o(u.value):i(u.value).then(s,c)}l((n=n.apply(e,t||[])).next())})}function Kr(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function xs(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var Ou=function(e,t){return Ou=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ou(e,t)};function zn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ou(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var se=function(){return se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},se.apply(this,arguments)};function At(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function ve(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(l){try{c(n.next(l))}catch(u){o(u)}}function s(l){try{c(n.throw(l))}catch(u){o(u)}}function c(l){var u;l.done?i(l.value):(u=l.value,u instanceof r?u:new r(function(d){d(u)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function ye(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!((i=i.length>0&&i[i.length-1])||u[0]!==6&&u[0]!==2)){a=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(u[0]===6&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(d){u=[6,d],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([c,l])}}}function vi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function Cu(e,t,r){if(r||arguments.length===2)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ii(e,t){return e(t={exports:{}},t.exports),t.exports}var Br,wa,Xo=function(e){return e&&e.Math==Math&&e},le=Xo(typeof globalThis=="object"&&globalThis)||Xo(typeof window=="object"&&window)||Xo(typeof self=="object"&&self)||Xo(typeof vr=="object"&&vr)||function(){return this}()||Function("return this")(),Ae=function(e){try{return!!e()}catch{return!0}},Ee=!Ae(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Lo=!Ae(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Zo=Function.prototype.call,kt=Lo?Zo.bind(Zo):function(){return Zo.apply(Zo,arguments)},Op={}.propertyIsEnumerable,Cp=Object.getOwnPropertyDescriptor,K$=Cp&&!Op.call({1:2},1)?function(e){var t=Cp(this,e);return!!t&&t.enumerable}:Op,nh={f:K$},An=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Hg=Function,Gg=Hg.prototype,Y$=Gg.bind,Pu=Gg.call,X$=Lo&&Y$.bind(Pu,Pu),fe=function(e){return e instanceof Hg?Lo?X$(e):function(){return Pu.apply(e,arguments)}:void 0},Z$=fe({}.toString),J$=fe("".slice),Ar=function(e){return J$(Z$(e),8,-1)},fc=Object,ew=fe("".split),Qg=Ae(function(){return!fc("z").propertyIsEnumerable(0)})?function(e){return Ar(e)=="String"?ew(e,""):fc(e)}:fc,Ai=function(e){return e==null},tw=TypeError,Mo=function(e){if(Ai(e))throw tw("Can't call method on "+e);return e},kr=function(e){return Qg(Mo(e))},hc=typeof document=="object"&&document.all,Fl={all:hc,IS_HTMLDDA:hc===void 0&&hc!==void 0},rw=Fl.all,Te=Fl.IS_HTMLDDA?function(e){return typeof e=="function"||e===rw}:function(e){return typeof e=="function"},nw=Fl.all,Le=Fl.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Te(e)||e===nw}:function(e){return typeof e=="object"?e!==null:Te(e)},iw=function(e){return Te(e)?e:void 0},cr=function(e,t){return arguments.length<2?iw(le[e]):le[e]&&le[e][t]},Dn=fe({}.isPrototypeOf),pc=cr("navigator","userAgent")||"",Pp=le.process,Tp=le.Deno,Np=Pp&&Pp.versions||Tp&&Tp.version,Ip=Np&&Np.v8;Ip&&(wa=(Br=Ip.split("."))[0]>0&&Br[0]<4?1:+(Br[0]+Br[1])),!wa&&pc&&(!(Br=pc.match(/Edge\/(\d+)/))||Br[1]>=74)&&(Br=pc.match(/Chrome\/(\d+)/))&&(wa=+Br[1]);var Ss=wa,Wt=!!Object.getOwnPropertySymbols&&!Ae(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ss&&Ss<41}),ih=Wt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ow=Object,yi=ih?function(e){return typeof e=="symbol"}:function(e){var t=cr("Symbol");return Te(t)&&Dn(t.prototype,ow(e))},aw=String,Di=function(e){try{return aw(e)}catch{return"Object"}},sw=TypeError,oh=function(e){if(Te(e))return e;throw sw(Di(e)+" is not a function")},ks=function(e,t){var r=e[t];return Ai(r)?void 0:oh(r)},lw=TypeError,cw=Object.defineProperty,ah=function(e,t){try{cw(le,e,{value:t,configurable:!0,writable:!0})}catch{le[e]=t}return t},tn=le["__core-js_shared__"]||ah("__core-js_shared__",{}),vn=Ii(function(e){(e.exports=function(t,r){return tn[t]||(tn[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.25.4",mode:"global",copyright:"\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.4/LICENSE",source:"https://github.com/zloirock/core-js"})}),uw=Object,Ri=function(e){return uw(Mo(e))},dw=fe({}.hasOwnProperty),J=Object.hasOwn||function(e,t){return dw(Ri(e),t)},fw=0,hw=Math.random(),pw=fe(1 .toString),gi=function(e){return"Symbol("+(e===void 0?"":e)+")_"+pw(++fw+hw,36)},Hi=vn("wks"),Pn=le.Symbol,Ap=Pn&&Pn.for,mw=ih?Pn:Pn&&Pn.withoutSetter||gi,Ye=function(e){if(!J(Hi,e)||!Wt&&typeof Hi[e]!="string"){var t="Symbol."+e;Wt&&J(Pn,e)?Hi[e]=Pn[e]:Hi[e]=ih&&Ap?Ap(t):mw(t)}return Hi[e]},vw=TypeError,yw=Ye("toPrimitive"),gw=function(e,t){if(!Le(e)||yi(e))return e;var r,n=ks(e,yw);if(n){if(t===void 0&&(t="default"),r=kt(n,e,t),!Le(r)||yi(r))return r;throw vw("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&Te(a=i.toString)&&!Le(s=kt(a,i))||Te(a=i.valueOf)&&!Le(s=kt(a,i))||o!=="string"&&Te(a=i.toString)&&!Le(s=kt(a,i)))return s;throw lw("Can't convert object to primitive value")}(e,t)},Rn=function(e){var t=gw(e,"string");return yi(t)?t:t+""},Tu=le.document,bw=Le(Tu)&&Le(Tu.createElement),Kg=function(e){return bw?Tu.createElement(e):{}},Yg=!Ee&&!Ae(function(){return Object.defineProperty(Kg("div"),"a",{get:function(){return 7}}).a!=7}),Dp=Object.getOwnPropertyDescriptor,jo={f:Ee?Dp:function(e,t){if(e=kr(e),t=Rn(t),Yg)try{return Dp(e,t)}catch{}if(J(e,t))return An(!kt(nh.f,e,t),e[t])}},Xg=Ee&&Ae(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),$w=String,ww=TypeError,ut=function(e){if(Le(e))return e;throw ww($w(e)+" is not an object")},_w=TypeError,mc=Object.defineProperty,xw=Object.getOwnPropertyDescriptor,$t={f:Ee?Xg?function(e,t,r){if(ut(e),t=Rn(t),ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&"writable"in r&&!r.writable){var n=xw(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return mc(e,t,r)}:mc:function(e,t,r){if(ut(e),t=Rn(t),ut(r),Yg)try{return mc(e,t,r)}catch{}if("get"in r||"set"in r)throw _w("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Ll=Ee?function(e,t,r){return $t.f(e,t,An(1,r))}:function(e,t,r){return e[t]=r,e},Zg=Function.prototype,Sw=Ee&&Object.getOwnPropertyDescriptor,vc=J(Zg,"name"),sh={EXISTS:vc,PROPER:vc&&function(){}.name==="something",CONFIGURABLE:vc&&(!Ee||Ee&&Sw(Zg,"name").configurable)},kw=fe(Function.toString);Te(tn.inspectSource)||(tn.inspectSource=function(e){return kw(e)});var Es,ho,Os,Jg=tn.inspectSource,Rp=le.WeakMap,Ew=Te(Rp)&&/native code/.test(String(Rp)),Fp=vn("keys"),Ml=function(e){return Fp[e]||(Fp[e]=gi(e))},Fi={},Nu=le.TypeError,Ow=le.WeakMap;if(Ew||tn.state){var bn=tn.state||(tn.state=new Ow),Cw=fe(bn.get),Lp=fe(bn.has),Pw=fe(bn.set);Es=function(e,t){if(Lp(bn,e))throw Nu("Object already initialized");return t.facade=e,Pw(bn,e,t),t},ho=function(e){return Cw(bn,e)||{}},Os=function(e){return Lp(bn,e)}}else{var qn=Ml("state");Fi[qn]=!0,Es=function(e,t){if(J(e,qn))throw Nu("Object already initialized");return t.facade=e,Ll(e,qn,t),t},ho=function(e){return J(e,qn)?e[qn]:{}},Os=function(e){return J(e,qn)}}var Kt={set:Es,get:ho,has:Os,enforce:function(e){return Os(e)?ho(e):Es(e,{})},getterFor:function(e){return function(t){var r;if(!Le(t)||(r=ho(t)).type!==e)throw Nu("Incompatible receiver, "+e+" required");return r}}},Tw=Ii(function(e){var t=sh.CONFIGURABLE,r=Kt.enforce,n=Kt.get,i=Object.defineProperty,o=Ee&&!Ae(function(){return i(function(){},"length",{value:8}).length!==8}),a=String(String).split("String"),s=e.exports=function(c,l,u){String(l).slice(0,7)==="Symbol("&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),u&&u.getter&&(l="get "+l),u&&u.setter&&(l="set "+l),(!J(c,"name")||t&&c.name!==l)&&(Ee?i(c,"name",{value:l,configurable:!0}):c.name=l),o&&u&&J(u,"arity")&&c.length!==u.arity&&i(c,"length",{value:u.arity});try{u&&J(u,"constructor")&&u.constructor?Ee&&i(c,"prototype",{writable:!1}):c.prototype&&(c.prototype=void 0)}catch{}var d=r(c);return J(d,"source")||(d.source=a.join(typeof l=="string"?l:"")),c};Function.prototype.toString=s(function(){return Te(this)&&n(this).source||Jg(this)},"toString")}),Ot=function(e,t,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:t;if(Te(r)&&Tw(r,o,n),n.global)i?e[t]=r:ah(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch{}i?e[t]=r:$t.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Nw=Math.ceil,Iw=Math.floor,Aw=Math.trunc||function(e){var t=+e;return(t>0?Iw:Nw)(t)},lh=function(e){var t=+e;return t!=t||t===0?0:Aw(t)},Dw=Math.max,Rw=Math.min,Iu=function(e,t){var r=lh(e);return r<0?Dw(r+t,0):Rw(r,t)},Fw=Math.min,eb=function(e){return e>0?Fw(lh(e),9007199254740991):0},Li=function(e){return eb(e.length)},Mp=function(e){return function(t,r,n){var i,o=kr(t),a=Li(o),s=Iu(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},tb={includes:Mp(!0),indexOf:Mp(!1)},Lw=tb.indexOf,jp=fe([].push),rb=function(e,t){var r,n=kr(e),i=0,o=[];for(r in n)!J(Fi,r)&&J(n,r)&&jp(o,r);for(;t.length>i;)J(n,r=t[i++])&&(~Lw(o,r)||jp(o,r));return o},Cs=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mw=Cs.concat("length","prototype"),wo={f:Object.getOwnPropertyNames||function(e){return rb(e,Mw)}},jl={f:Object.getOwnPropertySymbols},jw=fe([].concat),zw=cr("Reflect","ownKeys")||function(e){var t=wo.f(ut(e)),r=jl.f;return r?jw(t,r(e)):t},nb=function(e,t,r){for(var n=zw(t),i=$t.f,o=jo.f,a=0;a<n.length;a++){var s=n[a];J(e,s)||r&&J(r,s)||i(e,s,o(t,s))}},Uw=/#|\.prototype\./,zo=function(e,t){var r=Bw[Vw(e)];return r==qw||r!=Ww&&(Te(t)?Ae(t):!!t)},Vw=zo.normalize=function(e){return String(e).replace(Uw,".").toLowerCase()},Bw=zo.data={},Ww=zo.NATIVE="N",qw=zo.POLYFILL="P",Au=zo,Hw=jo.f,dt=function(e,t){var r,n,i,o,a,s=e.target,c=e.global,l=e.stat;if(r=c?le:l?le[s]||ah(s,{}):(le[s]||{}).prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(a=Hw(r,n))&&a.value:r[n],!Au(c?n:s+(l?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;nb(o,i)}(e.sham||i&&i.sham)&&Ll(o,"sham",!0),Ot(r,n,o,e)}},ib={};ib[Ye("toStringTag")]="z";var yc,ch=String(ib)==="[object z]",Gw=Ye("toStringTag"),Qw=Object,Kw=Ar(function(){return arguments}())=="Arguments",Un=ch?Ar:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch{}}(t=Qw(e),Gw))=="string"?r:Kw?Ar(t):(n=Ar(t))=="Object"&&Te(t.callee)?"Arguments":n},Yw=String,Rr=function(e){if(Un(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Yw(e)},Xw=Ye("match"),Zw=TypeError,ob=function(e){if(function(t){var r;return Le(t)&&((r=t[Xw])!==void 0?!!r:Ar(t)=="RegExp")}(e))throw Zw("The method doesn't accept regular expressions");return e},Jw=Ye("match"),ab=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[Jw]=!1,"/./"[e](t)}catch{}}return!1},e_=jo.f,zp=fe("".startsWith),t_=fe("".slice),r_=Math.min,sb=ab("startsWith"),n_=!(sb||(yc=e_(String.prototype,"startsWith"),!yc||yc.writable));dt({target:"String",proto:!0,forced:!n_&&!sb},{startsWith:function(e){var t=Rr(Mo(this));ob(e);var r=eb(r_(arguments.length>1?arguments[1]:void 0,t.length)),n=Rr(e);return zp?zp(t,n,r):t_(t,r,r+n.length)===n}});var uh=function(e,t){return fe(le[e].prototype[t])};uh("String","startsWith");var Ps=Array.isArray||function(e){return Ar(e)=="Array"},i_=TypeError,Up=function(e){if(e>9007199254740991)throw i_("Maximum allowed index exceeded");return e},_o=function(e,t,r){var n=Rn(t);n in e?$t.f(e,n,An(0,r)):e[n]=r},lb=function(){},o_=[],cb=cr("Reflect","construct"),dh=/^\s*(?:class|function)\b/,a_=fe(dh.exec),s_=!dh.exec(lb),Gi=function(e){if(!Te(e))return!1;try{return cb(lb,o_,e),!0}catch{return!1}},ub=function(e){if(!Te(e))return!1;switch(Un(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return s_||!!a_(dh,Jg(e))}catch{return!0}};ub.sham=!0;var Vp,fh=!cb||Ae(function(){var e;return Gi(Gi.call)||!Gi(Object)||!Gi(function(){e=!0})||e})?ub:Gi,l_=Ye("species"),Bp=Array,db=function(e,t){return new(function(r){var n;return Ps(r)&&(n=r.constructor,(fh(n)&&(n===Bp||Ps(n.prototype))||Le(n)&&(n=n[l_])===null)&&(n=void 0)),n===void 0?Bp:n}(e))(t===0?0:t)},c_=Ye("species"),fb=Ye("isConcatSpreadable"),u_=Ss>=51||!Ae(function(){var e=[];return e[fb]=!1,e.concat()[0]!==e}),d_=(Vp="concat",Ss>=51||!Ae(function(){var e=[];return(e.constructor={})[c_]=function(){return{foo:1}},e[Vp](Boolean).foo!==1})),f_=function(e){if(!Le(e))return!1;var t=e[fb];return t!==void 0?!!t:Ps(e)};dt({target:"Array",proto:!0,arity:1,forced:!u_||!d_},{concat:function(e){var t,r,n,i,o,a=Ri(this),s=db(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(f_(o=t===-1?a:arguments[t]))for(i=Li(o),Up(c+i),r=0;r<i;r++,c++)r in o&&_o(s,c,o[r]);else Up(c+1),_o(s,c++,o);return s.length=c,s}});var h_=ch?{}.toString:function(){return"[object "+Un(this)+"]"};ch||Ot(Object.prototype,"toString",h_,{unsafe:!0});var Jo,hh=Object.keys||function(e){return rb(e,Cs)},p_=Ee&&!Xg?Object.defineProperties:function(e,t){ut(e);for(var r,n=kr(t),i=hh(t),o=i.length,a=0;o>a;)$t.f(e,r=i[a++],n[r]);return e},hb={f:p_},m_=cr("document","documentElement"),pb=Ml("IE_PROTO"),gc=function(){},mb=function(e){return"<script>"+e+"<\/script>"},Wp=function(e){e.write(mb("")),e.close();var t=e.parentWindow.Object;return e=null,t},_a=function(){try{Jo=new ActiveXObject("htmlfile")}catch{}var e,t;_a=typeof document<"u"?document.domain&&Jo?Wp(Jo):((t=Kg("iframe")).style.display="none",m_.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(mb("document.F=Object")),e.close(),e.F):Wp(Jo);for(var r=Cs.length;r--;)delete _a.prototype[Cs[r]];return _a()};Fi[pb]=!0;var sn=Object.create||function(e,t){var r;return e!==null?(gc.prototype=ut(e),r=new gc,gc.prototype=null,r[pb]=e):r=_a(),t===void 0?r:hb.f(r,t)},v_=Array,y_=Math.max,vb=wo.f,yb=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],g_=function(e){try{return vb(e)}catch{return function(r,n,i){for(var o=Li(r),a=Iu(n,o),s=Iu(i===void 0?o:i,o),c=v_(y_(s-a,0)),l=0;a<s;a++,l++)_o(c,l,r[a]);return c.length=l,c}(yb)}},ph={f:function(e){return yb&&Ar(e)=="Window"?g_(e):vb(kr(e))}},gb={f:Ye},xo=le,b_=$t.f,Dt=function(e){var t=xo.Symbol||(xo.Symbol={});J(t,e)||b_(t,e,{value:gb.f(e)})},bb=function(){var e=cr("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=Ye("toPrimitive");t&&!t[n]&&Ot(t,n,function(i){return kt(r,this)},{arity:1})},$_=$t.f,qp=Ye("toStringTag"),en=function(e,t,r){e&&!r&&(e=e.prototype),e&&!J(e,qp)&&$_(e,qp,{configurable:!0,value:t})},w_=fe(fe.bind),zl=function(e,t){return oh(e),t===void 0?e:Lo?w_(e,t):function(){return e.apply(t,arguments)}},Hp=fe([].push),Wr=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(c,l,u,d){for(var f,h,p=Ri(c),m=Qg(p),v=zl(l,u),y=Li(m),b=0,g=d||db,w=t?g(c,y):r||a?g(c,0):void 0;y>b;b++)if((s||b in m)&&(h=v(f=m[b],b,p),e))if(t)w[b]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return b;case 2:Hp(w,f)}else switch(e){case 4:return!1;case 7:Hp(w,f)}return o?-1:n||i?i:w}},Ul={forEach:Wr(0),map:Wr(1),filter:Wr(2),some:Wr(3),every:Wr(4),find:Wr(5),findIndex:Wr(6),filterReject:Wr(7)}.forEach,Rt=Ml("hidden"),__=Kt.set,Gp=Kt.getterFor("Symbol"),Ht=Object.prototype,ni=le.Symbol,lo=ni&&ni.prototype,x_=le.TypeError,bc=le.QObject,$b=jo.f,Zr=$t.f,wb=ph.f,S_=nh.f,_b=fe([].push),Fr=vn("symbols"),Uo=vn("op-symbols"),k_=vn("wks"),$c=!bc||!bc.prototype||!bc.prototype.findChild,Du=Ee&&Ae(function(){return sn(Zr({},"a",{get:function(){return Zr(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=$b(Ht,t);n&&delete Ht[t],Zr(e,t,r),n&&e!==Ht&&Zr(Ht,t,n)}:Zr,wc=function(e,t){var r=Fr[e]=sn(lo);return __(r,{type:"Symbol",tag:e,description:t}),Ee||(r.description=t),r},Ts=function(e,t,r){e===Ht&&Ts(Uo,t,r),ut(e);var n=Rn(t);return ut(r),J(Fr,n)?(r.enumerable?(J(e,Rt)&&e[Rt][n]&&(e[Rt][n]=!1),r=sn(r,{enumerable:An(0,!1)})):(J(e,Rt)||Zr(e,Rt,An(1,{})),e[Rt][n]=!0),Du(e,n,r)):Zr(e,n,r)},_c=function(e,t){ut(e);var r=kr(t),n=hh(r).concat(xb(r));return Ul(n,function(i){Ee&&!kt(Ru,r,i)||Ts(e,i,r[i])}),e},Ru=function(e){var t=Rn(e),r=kt(S_,this,t);return!(this===Ht&&J(Fr,t)&&!J(Uo,t))&&(!(r||!J(this,t)||!J(Fr,t)||J(this,Rt)&&this[Rt][t])||r)},Qp=function(e,t){var r=kr(e),n=Rn(t);if(r!==Ht||!J(Fr,n)||J(Uo,n)){var i=$b(r,n);return!i||!J(Fr,n)||J(r,Rt)&&r[Rt][n]||(i.enumerable=!0),i}},Kp=function(e){var t=wb(kr(e)),r=[];return Ul(t,function(n){J(Fr,n)||J(Fi,n)||_b(r,n)}),r},xb=function(e){var t=e===Ht,r=wb(t?Uo:kr(e)),n=[];return Ul(r,function(i){!J(Fr,i)||t&&!J(Ht,i)||_b(n,Fr[i])}),n};Wt||(lo=(ni=function(){if(Dn(lo,this))throw x_("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?Rr(arguments[0]):void 0,t=gi(e),r=function(n){this===Ht&&kt(r,Uo,n),J(this,Rt)&&J(this[Rt],t)&&(this[Rt][t]=!1),Du(this,t,An(1,n))};return Ee&&$c&&Du(Ht,t,{configurable:!0,set:r}),wc(t,e)}).prototype,Ot(lo,"toString",function(){return Gp(this).tag}),Ot(ni,"withoutSetter",function(e){return wc(gi(e),e)}),nh.f=Ru,$t.f=Ts,hb.f=_c,jo.f=Qp,wo.f=ph.f=Kp,jl.f=xb,gb.f=function(e){return wc(Ye(e),e)},Ee&&(Zr(lo,"description",{configurable:!0,get:function(){return Gp(this).description}}),Ot(Ht,"propertyIsEnumerable",Ru,{unsafe:!0}))),dt({global:!0,constructor:!0,wrap:!0,forced:!Wt,sham:!Wt},{Symbol:ni}),Ul(hh(k_),function(e){Dt(e)}),dt({target:"Symbol",stat:!0,forced:!Wt},{useSetter:function(){$c=!0},useSimple:function(){$c=!1}}),dt({target:"Object",stat:!0,forced:!Wt,sham:!Ee},{create:function(e,t){return t===void 0?sn(e):_c(sn(e),t)},defineProperty:Ts,defineProperties:_c,getOwnPropertyDescriptor:Qp}),dt({target:"Object",stat:!0,forced:!Wt},{getOwnPropertyNames:Kp}),bb(),en(ni,"Symbol"),Fi[Rt]=!0;var Sb=Wt&&!!Symbol.for&&!!Symbol.keyFor,xc=vn("string-to-symbol-registry"),E_=vn("symbol-to-string-registry");dt({target:"Symbol",stat:!0,forced:!Sb},{for:function(e){var t=Rr(e);if(J(xc,t))return xc[t];var r=cr("Symbol")(t);return xc[t]=r,E_[r]=t,r}});var Yp=vn("symbol-to-string-registry");dt({target:"Symbol",stat:!0,forced:!Sb},{keyFor:function(e){if(!yi(e))throw TypeError(Di(e)+" is not a symbol");if(J(Yp,e))return Yp[e]}});var kb=Function.prototype,Xp=kb.apply,Zp=kb.call,Eb=typeof Reflect=="object"&&Reflect.apply||(Lo?Zp.bind(Xp):function(){return Zp.apply(Xp,arguments)}),mh=fe([].slice),rn=cr("JSON","stringify"),ea=fe(/./.exec),Jp=fe("".charAt),O_=fe("".charCodeAt),C_=fe("".replace),P_=fe(1 .toString),T_=/[\uD800-\uDFFF]/g,e0=/^[\uD800-\uDBFF]$/,t0=/^[\uDC00-\uDFFF]$/,r0=!Wt||Ae(function(){var e=cr("Symbol")();return rn([e])!="[null]"||rn({a:e})!="{}"||rn(Object(e))!="{}"}),n0=Ae(function(){return rn("\uDF06\uD834")!=='"\\udf06\\ud834"'||rn("\uDEAD")!=='"\\udead"'}),N_=function(e,t){var r=mh(arguments),n=t;if((Le(t)||e!==void 0)&&!yi(e))return Ps(t)||(t=function(i,o){if(Te(n)&&(o=kt(n,this,i,o)),!yi(o))return o}),r[1]=t,Eb(rn,null,r)},I_=function(e,t,r){var n=Jp(r,t-1),i=Jp(r,t+1);return ea(e0,e)&&!ea(t0,i)||ea(t0,e)&&!ea(e0,n)?"\\u"+P_(O_(e,0),16):e};rn&&dt({target:"JSON",stat:!0,arity:3,forced:r0||n0},{stringify:function(e,t,r){var n=mh(arguments),i=Eb(r0?N_:rn,null,n);return n0&&typeof i=="string"?C_(i,T_,I_):i}});var A_=!Wt||Ae(function(){jl.f(1)});dt({target:"Object",stat:!0,forced:A_},{getOwnPropertySymbols:function(e){var t=jl.f;return t?t(Ri(e)):[]}}),Dt("asyncIterator");var D_=$t.f,Pr=le.Symbol,$n=Pr&&Pr.prototype;if(Ee&&Te(Pr)&&(!("description"in $n)||Pr().description!==void 0)){var i0={},ta=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:Rr(arguments[0]),t=Dn($n,this)?new Pr(e):e===void 0?Pr():Pr(e);return e===""&&(i0[t]=!0),t};nb(ta,Pr),ta.prototype=$n,$n.constructor=ta;var R_=String(Pr("test"))=="Symbol(test)",F_=fe($n.valueOf),L_=fe($n.toString),M_=/^Symbol\((.*)\)[^)]+$/,j_=fe("".replace),z_=fe("".slice);D_($n,"description",{configurable:!0,get:function(){var e=F_(this);if(J(i0,e))return"";var t=L_(e),r=R_?z_(t,7,-1):j_(t,M_,"$1");return r===""?void 0:r}}),dt({global:!0,constructor:!0,forced:!0},{Symbol:ta})}Dt("hasInstance"),Dt("isConcatSpreadable"),Dt("iterator"),Dt("match"),Dt("matchAll"),Dt("replace"),Dt("search"),Dt("species"),Dt("split"),Dt("toPrimitive"),bb(),Dt("toStringTag"),en(cr("Symbol"),"Symbol"),Dt("unscopables"),en(le.JSON,"JSON",!0),en(Math,"Math",!0),dt({global:!0},{Reflect:{}}),en(le.Reflect,"Reflect",!0),xo.Symbol;var Tn,o0,a0,U_=fe("".charAt),s0=fe("".charCodeAt),V_=fe("".slice),l0=function(e){return function(t,r){var n,i,o=Rr(Mo(t)),a=lh(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=s0(o,a))<55296||n>56319||a+1===s||(i=s0(o,a+1))<56320||i>57343?e?U_(o,a):n:e?V_(o,a,a+2):i-56320+(n-55296<<10)+65536}},B_={codeAt:l0(!1),charAt:l0(!0)},W_=!Ae(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),c0=Ml("IE_PROTO"),Fu=Object,q_=Fu.prototype,ln=W_?Fu.getPrototypeOf:function(e){var t=Ri(e);if(J(t,c0))return t[c0];var r=t.constructor;return Te(r)&&t instanceof r?r.prototype:t instanceof Fu?q_:null},Lu=Ye("iterator"),Ob=!1;[].keys&&("next"in(a0=[].keys())?(o0=ln(ln(a0)))!==Object.prototype&&(Tn=o0):Ob=!0);var H_=!Le(Tn)||Ae(function(){var e={};return Tn[Lu].call(e)!==e});H_&&(Tn={}),Te(Tn[Lu])||Ot(Tn,Lu,function(){return this});var vh={IteratorPrototype:Tn,BUGGY_SAFARI_ITERATORS:Ob},bi={},G_=vh.IteratorPrototype,Q_=function(){return this},K_=String,Y_=TypeError,$r=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=fe(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch{}return function(n,i){return ut(n),function(o){if(typeof o=="object"||Te(o))return o;throw Y_("Can't set "+K_(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),X_=sh.PROPER,Z_=sh.CONFIGURABLE,u0=vh.IteratorPrototype,ra=vh.BUGGY_SAFARI_ITERATORS,Qi=Ye("iterator"),J_=function(){return this},yh=function(e,t,r,n,i,o,a){(function(y,b,g,w){var x=b+" Iterator";y.prototype=sn(G_,{next:An(+!w,g)}),en(y,x,!1),bi[x]=Q_})(r,t,n);var s,c,l,u=function(y){if(y===i&&m)return m;if(!ra&&y in h)return h[y];switch(y){case"keys":case"values":case"entries":return function(){return new r(this,y)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[Qi]||h["@@iterator"]||i&&h[i],m=!ra&&p||u(i),v=t=="Array"&&h.entries||p;if(v&&(s=ln(v.call(new e)))!==Object.prototype&&s.next&&(ln(s)!==u0&&($r?$r(s,u0):Te(s[Qi])||Ot(s,Qi,J_)),en(s,d,!0)),X_&&i=="values"&&p&&p.name!=="values"&&(Z_?Ll(h,"name","values"):(f=!0,m=function(){return kt(p,this)})),i)if(c={values:u("values"),keys:o?m:u("keys"),entries:u("entries")},a)for(l in c)(ra||f||!(l in h))&&Ot(h,l,c[l]);else dt({target:t,proto:!0,forced:ra||f},c);return h[Qi]!==m&&Ot(h,Qi,m,{name:i}),bi[t]=m,c},$i=function(e,t){return{value:e,done:t}},e3=B_.charAt,t3=Kt.set,r3=Kt.getterFor("String Iterator");yh(String,"String",function(e){t3(this,{type:"String Iterator",string:Rr(e),index:0})},function(){var e,t=r3(this),r=t.string,n=t.index;return n>=r.length?$i(void 0,!0):(e=e3(r,n),t.index+=e.length,$i(e,!1))});var Mu=function(e,t,r){var n,i;ut(e);try{if(!(n=ks(e,"return"))){if(t==="throw")throw r;return r}n=kt(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return ut(n),r},n3=function(e,t,r,n){try{return n?t(ut(r)[0],r[1]):t(r)}catch(i){Mu(e,"throw",i)}},i3=Ye("iterator"),o3=Array.prototype,Cb=function(e){return e!==void 0&&(bi.Array===e||o3[i3]===e)},a3=Ye("iterator"),gh=function(e){if(!Ai(e))return ks(e,a3)||ks(e,"@@iterator")||bi[Un(e)]},s3=TypeError,Pb=function(e,t){var r=arguments.length<2?gh(e):t;if(oh(r))return ut(kt(r,e));throw s3(Di(e)+" is not iterable")},d0=Array,Tb=Ye("iterator"),Nb=!1;try{var l3=0,f0={next:function(){return{done:!!l3++}},return:function(){Nb=!0}};f0[Tb]=function(){return this},Array.from(f0,function(){throw 2})}catch{}var Ib=function(e,t){if(!t&&!Nb)return!1;var r=!1;try{var n={};n[Tb]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},c3=!Ib(function(e){Array.from(e)});dt({target:"Array",stat:!0,forced:c3},{from:function(e){var t=Ri(e),r=fh(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=i!==void 0;o&&(i=zl(i,n>2?arguments[2]:void 0));var a,s,c,l,u,d,f=gh(t),h=0;if(!f||this===d0&&Cb(f))for(a=Li(t),s=r?new this(a):d0(a);a>h;h++)d=o?i(t[h],h):t[h],_o(s,h,d);else for(u=(l=Pb(t,f)).next,s=r?new this:[];!(c=kt(u,l)).done;h++)d=o?n3(l,i,[c.value,h],!0):c.value,_o(s,h,d);return s.length=h,s}}),xo.Array.from;var Ft,ci,Ns,u3=typeof ArrayBuffer<"u"&&typeof DataView<"u",d3=$t.f,Ab=Kt.enforce,f3=Kt.get,Is=le.Int8Array,ju=Is&&Is.prototype,h0=le.Uint8ClampedArray,p0=h0&&h0.prototype,hr=Is&&ln(Is),nr=ju&&ln(ju),h3=Object.prototype,zu=le.TypeError,m0=Ye("toStringTag"),Uu=gi("TYPED_ARRAY_TAG"),Dr=u3&&!!$r&&Un(le.opera)!=="Opera",Db=!1,Tr={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},bh={BigInt64Array:8,BigUint64Array:8},Rb=function(e){var t=ln(e);if(Le(t)){var r=f3(t);return r&&J(r,"TypedArrayConstructor")?r.TypedArrayConstructor:Rb(t)}},v0=function(e){if(!Le(e))return!1;var t=Un(e);return J(Tr,t)||J(bh,t)};for(Ft in Tr)(Ns=(ci=le[Ft])&&ci.prototype)?Ab(Ns).TypedArrayConstructor=ci:Dr=!1;for(Ft in bh)(Ns=(ci=le[Ft])&&ci.prototype)&&(Ab(Ns).TypedArrayConstructor=ci);if((!Dr||!Te(hr)||hr===Function.prototype)&&(hr=function(){throw zu("Incorrect invocation")},Dr))for(Ft in Tr)le[Ft]&&$r(le[Ft],hr);if((!Dr||!nr||nr===h3)&&(nr=hr.prototype,Dr))for(Ft in Tr)le[Ft]&&$r(le[Ft].prototype,nr);if(Dr&&ln(p0)!==nr&&$r(p0,nr),Ee&&!J(nr,m0))for(Ft in Db=!0,d3(nr,m0,{get:function(){return Le(this)?this[Uu]:void 0}}),Tr)le[Ft]&&Ll(le[Ft],Uu,Ft);var Vl={NATIVE_ARRAY_BUFFER_VIEWS:Dr,TYPED_ARRAY_TAG:Db&&Uu,aTypedArray:function(e){if(v0(e))return e;throw zu("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Te(e)&&(!$r||Dn(hr,e)))return e;throw zu(Di(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(Ee){if(r)for(var i in Tr){var o=le[i];if(o&&J(o.prototype,e))try{delete o.prototype[e]}catch{try{o.prototype[e]=t}catch{}}}nr[e]&&!r||Ot(nr,e,r?t:Dr&&ju[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(Ee){if($r){if(r){for(n in Tr)if((i=le[n])&&J(i,e))try{delete i[e]}catch{}}if(hr[e]&&!r)return;try{return Ot(hr,e,r?t:Dr&&hr[e]||t)}catch{}}for(n in Tr)!(i=le[n])||i[e]&&!r||Ot(i,e,t)}},getTypedArrayConstructor:Rb,isView:function(e){if(!Le(e))return!1;var t=Un(e);return t==="DataView"||J(Tr,t)||J(bh,t)},isTypedArray:v0,TypedArray:hr,TypedArrayPrototype:nr},p3=TypeError,m3=Ye("species"),v3=function(e,t){var r,n=ut(e).constructor;return n===void 0||Ai(r=ut(n)[m3])?t:function(i){if(fh(i))return i;throw p3(Di(i)+" is not a constructor")}(r)},y3=Vl.aTypedArrayConstructor,g3=Vl.getTypedArrayConstructor,b3=Vl.aTypedArray;(0,Vl.exportTypedArrayMethod)("slice",function(e,t){for(var r,n=mh(b3(this),e,t),i=y3(v3(r=this,g3(r))),o=0,a=n.length,s=new i(a);a>o;)s[o]=n[o++];return s},Ae(function(){new Int8Array(1).slice()}));var $3=$t.f,Vu=Ye("unscopables"),Bu=Array.prototype;Bu[Vu]==null&&$3(Bu,Vu,{configurable:!0,value:sn(null)});var xa=function(e){Bu[Vu][e]=!0},w3=tb.includes,_3=Ae(function(){return!Array(1).includes()});dt({target:"Array",proto:!0,forced:_3},{includes:function(e){return w3(this,e,arguments.length>1?arguments[1]:void 0)}}),xa("includes"),uh("Array","includes");var x3=fe("".indexOf);dt({target:"String",proto:!0,forced:!ab("includes")},{includes:function(e){return!!~x3(Rr(Mo(this)),Rr(ob(e)),arguments.length>1?arguments[1]:void 0)}}),uh("String","includes");var S3=$t.f,k3=Kt.set,E3=Kt.getterFor("Array Iterator");yh(Array,"Array",function(e,t){k3(this,{type:"Array Iterator",target:kr(e),index:0,kind:t})},function(){var e=E3(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,$i(void 0,!0)):$i(r=="keys"?n:r=="values"?t[n]:[n,t[n]],!1)},"values");var y0=bi.Arguments=bi.Array;if(xa("keys"),xa("values"),xa("entries"),Ee&&y0.name!=="values")try{S3(y0,"name",{value:"values"})}catch{}var g0=Ae(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),na=Object.isExtensible,Sc=Ae(function(){na(1)})||g0?function(e){return!!Le(e)&&(!g0||Ar(e)!="ArrayBuffer")&&(!na||na(e))}:na,O3=!Ae(function(){return Object.isExtensible(Object.preventExtensions({}))}),ii=Ii(function(e){var t=$t.f,r=!1,n=gi("meta"),i=0,o=function(s){t(s,n,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},r=!0;var s=wo.f,c=fe([].splice),l={};l[n]=1,s(l).length&&(wo.f=function(u){for(var d=s(u),f=0,h=d.length;f<h;f++)if(d[f]===n){c(d,f,1);break}return d},dt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:ph.f}))},fastKey:function(s,c){if(!Le(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!J(s,n)){if(!Sc(s))return"F";if(!c)return"E";o(s)}return s[n].objectID},getWeakData:function(s,c){if(!J(s,n)){if(!Sc(s))return!0;if(!c)return!1;o(s)}return s[n].weakData},onFreeze:function(s){return O3&&r&&Sc(s)&&!J(s,n)&&o(s),s}};Fi[n]=!0});ii.enable,ii.fastKey,ii.getWeakData,ii.onFreeze;var C3=TypeError,Sa=function(e,t){this.stopped=e,this.result=t},b0=Sa.prototype,Fb=function(e,t,r){var n,i,o,a,s,c,l,u=r&&r.that,d=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_RECORD),h=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),m=zl(t,u),v=function(b){return n&&Mu(n,"normal",b),new Sa(!0,b)},y=function(b){return d?(ut(b),p?m(b[0],b[1],v):m(b[0],b[1])):p?m(b,v):m(b)};if(f)n=e.iterator;else if(h)n=e;else{if(!(i=gh(e)))throw C3(Di(e)+" is not iterable");if(Cb(i)){for(o=0,a=Li(e);a>o;o++)if((s=y(e[o]))&&Dn(b0,s))return s;return new Sa(!1)}n=Pb(e,i)}for(c=f?e.next:n.next;!(l=kt(c,n)).done;){try{s=y(l.value)}catch(b){Mu(n,"throw",b)}if(typeof s=="object"&&s&&Dn(b0,s))return s}return new Sa(!1)},P3=TypeError,Lb=function(e,t){if(Dn(t,e))return e;throw P3("Incorrect invocation")},$0=function(e,t,r){for(var n in t)Ot(e,n,t[n],r);return e},w0=Ye("species"),T3=$t.f,_0=ii.fastKey,x0=Kt.set,kc=Kt.getterFor,N3={getConstructor:function(e,t,r,n){var i=e(function(l,u){Lb(l,o),x0(l,{type:t,index:sn(null),first:void 0,last:void 0,size:0}),Ee||(l.size=0),Ai(u)||Fb(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=kc(t),s=function(l,u,d){var f,h,p=a(l),m=c(l,u);return m?m.value=d:(p.last=m={index:h=_0(u,!0),key:u,value:d,previous:f=p.last,next:void 0,removed:!1},p.first||(p.first=m),f&&(f.next=m),Ee?p.size++:l.size++,h!=="F"&&(p.index[h]=m)),l},c=function(l,u){var d,f=a(l),h=_0(u);if(h!=="F")return f.index[h];for(d=f.first;d;d=d.next)if(d.key==u)return d};return $0(o,{clear:function(){for(var l=a(this),u=l.index,d=l.first;d;)d.removed=!0,d.previous&&(d.previous=d.previous.next=void 0),delete u[d.index],d=d.next;l.first=l.last=void 0,Ee?l.size=0:this.size=0},delete:function(l){var u=this,d=a(u),f=c(u,l);if(f){var h=f.next,p=f.previous;delete d.index[f.index],f.removed=!0,p&&(p.next=h),h&&(h.previous=p),d.first==f&&(d.first=h),d.last==f&&(d.last=p),Ee?d.size--:u.size--}return!!f},forEach:function(l){for(var u,d=a(this),f=zl(l,arguments.length>1?arguments[1]:void 0);u=u?u.next:d.first;)for(f(u.value,u.key,this);u&&u.removed;)u=u.previous},has:function(l){return!!c(this,l)}}),$0(o,r?{get:function(l){var u=c(this,l);return u&&u.value},set:function(l,u){return s(this,l===0?0:l,u)}}:{add:function(l){return s(this,l=l===0?0:l,l)}}),Ee&&T3(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=kc(t),o=kc(n);yh(e,t,function(a,s){x0(this,{type:n,target:a,state:i(a),kind:s,last:void 0})},function(){for(var a=o(this),s=a.kind,c=a.last;c&&c.removed;)c=c.previous;return a.target&&(a.last=c=c?c.next:a.state.first)?$i(s=="keys"?c.key:s=="values"?c.value:[c.key,c.value],!1):(a.target=void 0,$i(void 0,!0))},r?"entries":"values",!r,!0),function(a){var s=cr(a),c=$t.f;Ee&&s&&!s[w0]&&c(s,w0,{configurable:!0,get:function(){return this}})}(t)}};function Mb(e){var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){return t.reject(r)})})}function jb(e){return new this(function(t,r){if(!e||e.length===void 0)return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(e);if(n.length===0)return t([]);var i=n.length;function o(s,c){if(c&&(typeof c=="object"||typeof c=="function")){var l=c.then;if(typeof l=="function")return void l.call(c,function(u){o(s,u)},function(u){n[s]={status:"rejected",reason:u},--i==0&&t(n)})}n[s]={status:"fulfilled",value:c},--i==0&&t(n)}for(var a=0;a<n.length;a++)o(a,n[a])})}(function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=le[e],s=a&&a.prototype,c=a,l={},u=function(v){var y=fe(s[v]);Ot(s,v,v=="add"?function(b){return y(this,b===0?0:b),this}:v=="delete"?function(b){return!(i&&!Le(b))&&y(this,b===0?0:b)}:v=="get"?function(b){return i&&!Le(b)?void 0:y(this,b===0?0:b)}:v=="has"?function(b){return!(i&&!Le(b))&&y(this,b===0?0:b)}:function(b,g){return y(this,b===0?0:b,g),this})};if(Au(e,!Te(a)||!(i||s.forEach&&!Ae(function(){new a().entries().next()}))))c=r.getConstructor(t,e,n,o),ii.enable();else if(Au(e,!0)){var d=new c,f=d[o](i?{}:-0,1)!=d,h=Ae(function(){d.has(1)}),p=Ib(function(v){new a(v)}),m=!i&&Ae(function(){for(var v=new a,y=5;y--;)v[o](y,y);return!v.has(-0)});p||((c=t(function(v,y){Lb(v,s);var b=function(g,w,x){var E,S;return $r&&Te(E=w.constructor)&&E!==x&&Le(S=E.prototype)&&S!==x.prototype&&$r(g,S),g}(new a,v,c);return Ai(y)||Fb(y,b[o],{that:b,AS_ENTRIES:n}),b})).prototype=s,s.constructor=c),(h||m)&&(u("delete"),u("has"),n&&u("get")),(m||f)&&u(o),i&&s.clear&&delete s.clear}l[e]=c,dt({global:!0,constructor:!0,forced:c!=a},l),en(c,e),i||r.setStrong(c,e,n)})("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},N3),xo.Set;var I3=setTimeout;function S0(e){return Boolean(e&&e.length!==void 0)}function A3(){}function Ve(e){if(!(this instanceof Ve))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ub(e,this)}function zb(e,t){for(;e._state===3;)e=e._value;e._state!==0?(e._handled=!0,Ve._immediateFn(function(){var r=e._state===1?t.onFulfilled:t.onRejected;if(r!==null){var n;try{n=r(e._value)}catch(i){return void So(t.promise,i)}Wu(t.promise,n)}else(e._state===1?Wu:So)(t.promise,e._value)})):e._deferreds.push(t)}function Wu(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var r=t.then;if(t instanceof Ve)return e._state=3,e._value=t,void qu(e);if(typeof r=="function")return void Ub((n=r,i=t,function(){n.apply(i,arguments)}),e)}e._state=1,e._value=t,qu(e)}catch(o){So(e,o)}var n,i}function So(e,t){e._state=2,e._value=t,qu(e)}function qu(e){e._state===2&&e._deferreds.length===0&&Ve._immediateFn(function(){e._handled||Ve._unhandledRejectionFn(e._value)});for(var t=0,r=e._deferreds.length;t<r;t++)zb(e,e._deferreds[t]);e._deferreds=null}function D3(e,t,r){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=r}function Ub(e,t){var r=!1;try{e(function(n){r||(r=!0,Wu(t,n))},function(n){r||(r=!0,So(t,n))})}catch(n){if(r)return;r=!0,So(t,n)}}Ve.prototype.catch=function(e){return this.then(null,e)},Ve.prototype.then=function(e,t){var r=new this.constructor(A3);return zb(this,new D3(e,t,r)),r},Ve.prototype.finally=Mb,Ve.all=function(e){return new Ve(function(t,r){if(!S0(e))return r(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(e);if(n.length===0)return t([]);var i=n.length;function o(s,c){try{if(c&&(typeof c=="object"||typeof c=="function")){var l=c.then;if(typeof l=="function")return void l.call(c,function(u){o(s,u)},r)}n[s]=c,--i==0&&t(n)}catch(u){r(u)}}for(var a=0;a<n.length;a++)o(a,n[a])})},Ve.allSettled=jb,Ve.resolve=function(e){return e&&typeof e=="object"&&e.constructor===Ve?e:new Ve(function(t){t(e)})},Ve.reject=function(e){return new Ve(function(t,r){r(e)})},Ve.race=function(e){return new Ve(function(t,r){if(!S0(e))return r(new TypeError("Promise.race accepts an array"));for(var n=0,i=e.length;n<i;n++)Ve.resolve(e[n]).then(t,r)})},Ve._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){I3(e,0)},Ve._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Hn=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}();typeof Hn.Promise!="function"?Hn.Promise=Ve:(Hn.Promise.prototype.finally||(Hn.Promise.prototype.finally=Mb),Hn.Promise.allSettled||(Hn.Promise.allSettled=jb)),function(e){function t(h){for(var p=0,m=Math.min(65536,h.length+1),v=new Uint16Array(m),y=[],b=0;;){var g=p<h.length;if(!g||b>=m-1){var w=v.subarray(0,b);if(y.push(String.fromCharCode.apply(null,w)),!g)return y.join("");h=h.subarray(p),p=0,b=0}var x=h[p++];if((128&x)==0)v[b++]=x;else if((224&x)==192){var E=63&h[p++];v[b++]=(31&x)<<6|E}else if((240&x)==224){E=63&h[p++];var S=63&h[p++];v[b++]=(31&x)<<12|E<<6|S}else if((248&x)==240){var T=(7&x)<<18|(E=63&h[p++])<<12|(S=63&h[p++])<<6|63&h[p++];T>65535&&(T-=65536,v[b++]=T>>>10&1023|55296,T=56320|1023&T),v[b++]=T}}}var r="Failed to ",n=function(h,p,m){if(h)throw new Error("".concat(r).concat(p,": the '").concat(m,"' option is unsupported."))},i=typeof Buffer=="function"&&Buffer.from,o=i?function(h){return Buffer.from(h)}:function(h){for(var p=0,m=h.length,v=0,y=Math.max(32,m+(m>>>1)+7),b=new Uint8Array(y>>>3<<3);p<m;){var g=h.charCodeAt(p++);if(g>=55296&&g<=56319){if(p<m){var w=h.charCodeAt(p);(64512&w)==56320&&(++p,g=((1023&g)<<10)+(1023&w)+65536)}if(g>=55296&&g<=56319)continue}if(v+4>b.length){y+=8,y=(y*=1+p/h.length*2)>>>3<<3;var x=new Uint8Array(y);x.set(b),b=x}if((4294967168&g)!=0){if((4294965248&g)==0)b[v++]=g>>>6&31|192;else if((4294901760&g)==0)b[v++]=g>>>12&15|224,b[v++]=g>>>6&63|128;else{if((4292870144&g)!=0)continue;b[v++]=g>>>18&7|240,b[v++]=g>>>12&63|128,b[v++]=g>>>6&63|128}b[v++]=63&g|128}else b[v++]=g}return b.slice?b.slice(0,v):b.subarray(0,v)};function a(){this.encoding="utf-8"}a.prototype.encode=function(h,p){return n(p&&p.stream,"encode","stream"),o(h)};var s=!i&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",c=["utf-8","utf8","unicode-1-1-utf-8"],l=t;i?l=function(h,p){return(h instanceof Buffer?h:Buffer.from(h.buffer,h.byteOffset,h.byteLength)).toString(p)}:s&&(l=function(h){try{return function(p){var m;try{var v=new Blob([p],{type:"text/plain;charset=UTF-8"});m=URL.createObjectURL(v);var y=new XMLHttpRequest;return y.open("GET",m,!1),y.send(),y.responseText}finally{m&&URL.revokeObjectURL(m)}}(h)}catch{return t(h)}});var u="construct 'TextDecoder'",d="".concat(r," ").concat(u,": the ");function f(h,p){if(n(p&&p.fatal,u,"fatal"),h=h||"utf-8",!(i?Buffer.isEncoding(h):c.indexOf(h.toLowerCase())!==-1))throw new RangeError("".concat(d," encoding label provided ('").concat(h,"') is invalid."));this.encoding=h,this.fatal=!1,this.ignoreBOM=!1}f.prototype.decode=function(h,p){var m;return n(p&&p.stream,"decode","stream"),m=h instanceof Uint8Array?h:h.buffer instanceof ArrayBuffer?new Uint8Array(h.buffer):new Uint8Array(h),l(m,this.encoding)},e.TextEncoder=e.TextEncoder||a,e.TextDecoder=e.TextDecoder||f}(typeof window<"u"?window:vr),function(){function e(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function t(v,y){for(var b=0;b<y.length;b++){var g=y[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}function r(v,y,b){return y&&t(v.prototype,y),b&&t(v,b),v}function n(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),y&&o(v,y)}function i(v){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},i(v)}function o(v,y){return o=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},o(v,y)}function a(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function s(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function c(v,y){return!y||typeof y!="object"&&typeof y!="function"?s(v):y}function l(v){var y=a();return function(){var b,g=i(v);if(y){var w=i(this).constructor;b=Reflect.construct(g,arguments,w)}else b=g.apply(this,arguments);return c(this,b)}}function u(v,y){for(;!Object.prototype.hasOwnProperty.call(v,y)&&(v=i(v))!==null;);return v}function d(v,y,b){return d=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(g,w,x){var E=u(g,w);if(E){var S=Object.getOwnPropertyDescriptor(E,w);return S.get?S.get.call(x):S.value}},d(v,y,b||v)}var f=function(){function v(){e(this,v),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return r(v,[{key:"addEventListener",value:function(y,b,g){y in this.listeners||(this.listeners[y]=[]),this.listeners[y].push({callback:b,options:g})}},{key:"removeEventListener",value:function(y,b){if(y in this.listeners){for(var g=this.listeners[y],w=0,x=g.length;w<x;w++)if(g[w].callback===b)return void g.splice(w,1)}}},{key:"dispatchEvent",value:function(y){if(y.type in this.listeners){for(var b=this.listeners[y.type].slice(),g=0,w=b.length;g<w;g++){var x=b[g];try{x.callback.call(this,y)}catch(E){Promise.resolve().then(function(){throw E})}x.options&&x.options.once&&this.removeEventListener(y.type,x.callback)}return!y.defaultPrevented}}}]),v}(),h=function(v){n(b,v);var y=l(b);function b(){var g;return e(this,b),(g=y.call(this)).listeners||f.call(s(g)),Object.defineProperty(s(g),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(s(g),"onabort",{value:null,writable:!0,configurable:!0}),g}return r(b,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(g){g.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,g)),d(i(b.prototype),"dispatchEvent",this).call(this,g)}}]),b}(f),p=function(){function v(){e(this,v),Object.defineProperty(this,"signal",{value:new h,writable:!0,configurable:!0})}return r(v,[{key:"abort",value:function(){var y;try{y=new Event("abort")}catch{typeof document<"u"?document.createEvent?(y=document.createEvent("Event")).initEvent("abort",!1,!1):(y=document.createEventObject()).type="abort":y={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(y)}},{key:"toString",value:function(){return"[object AbortController]"}}]),v}();function m(v){return v.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof v.Request=="function"&&!v.Request.prototype.hasOwnProperty("signal")||!v.AbortController}typeof Symbol<"u"&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",h.prototype[Symbol.toStringTag]="AbortSignal"),function(v){m(v)&&(v.AbortController=p,v.AbortSignal=h)}(typeof self<"u"?self:vr)}();var _n=Ii(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var i=this;this.locked=new Map,this.addToLocked=function(o,a){var s=i.locked.get(o);s===void 0?a===void 0?i.locked.set(o,[]):i.locked.set(o,[a]):a!==void 0&&(s.unshift(a),i.locked.set(o,s))},this.isLocked=function(o){return i.locked.has(o)},this.lock=function(o){return new Promise(function(a,s){i.isLocked(o)?i.addToLocked(o,a):(i.addToLocked(o),a())})},this.unlock=function(o){var a=i.locked.get(o);if(a!==void 0&&a.length!==0){var s=a.pop();i.locked.set(o,a),s!==void 0&&setTimeout(s,0)}else i.locked.delete(o)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});rh(_n);var R3=Ii(function(e,t){var r=vr&&vr.__awaiter||function(c,l,u,d){return new(u||(u=Promise))(function(f,h){function p(y){try{v(d.next(y))}catch(b){h(b)}}function m(y){try{v(d.throw(y))}catch(b){h(b)}}function v(y){y.done?f(y.value):new u(function(b){b(y.value)}).then(p,m)}v((d=d.apply(c,l||[])).next())})},n=vr&&vr.__generator||function(c,l){var u,d,f,h,p={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function m(v){return function(y){return function(b){if(u)throw new TypeError("Generator is already executing.");for(;p;)try{if(u=1,d&&(f=2&b[0]?d.return:b[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,b[1])).done)return f;switch(d=0,f&&(b=[2&b[0],f.value]),b[0]){case 0:case 1:f=b;break;case 4:return p.label++,{value:b[1],done:!1};case 5:p.label++,d=b[1],b=[0];continue;case 7:b=p.ops.pop(),p.trys.pop();continue;default:if(f=p.trys,!((f=f.length>0&&f[f.length-1])||b[0]!==6&&b[0]!==2)){p=0;continue}if(b[0]===3&&(!f||b[1]>f[0]&&b[1]<f[3])){p.label=b[1];break}if(b[0]===6&&p.label<f[1]){p.label=f[1],f=b;break}if(f&&p.label<f[2]){p.label=f[2],p.ops.push(b);break}f[2]&&p.ops.pop(),p.trys.pop();continue}b=l.call(c,p)}catch(g){b=[6,g],d=0}finally{u=f=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([v,y])}}};Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key";function o(c){return new Promise(function(l){return setTimeout(l,c)})}function a(c){for(var l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",u="",d=0;d<c;d++)u+=l[Math.floor(Math.random()*l.length)];return u}var s=function(){function c(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+a(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(l,u){return u===void 0&&(u=5e3),r(this,void 0,void 0,function(){var d,f,h,p,m,v;return n(this,function(y){switch(y.label){case 0:d=Date.now()+a(4),f=Date.now()+u,h=i+"-"+l,p=window.localStorage,y.label=1;case 1:return Date.now()<f?[4,o(30)]:[3,8];case 2:return y.sent(),p.getItem(h)!==null?[3,5]:(m=this.id+"-"+l+"-"+d,[4,o(Math.floor(25*Math.random()))]);case 3:return y.sent(),p.setItem(h,JSON.stringify({id:this.id,iat:d,timeoutKey:m,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return y.sent(),(v=p.getItem(h))!==null&&(v=JSON.parse(v)).id===this.id&&v.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(h,d),[2,!0]):[3,7];case 5:return c.lockCorrector(),[4,this.waitForSomethingToChange(f)];case 6:y.sent(),y.label=7;case 7:return d=Date.now()+a(4),[3,1];case 8:return[2,!1]}})})},c.prototype.refreshLockWhileAcquired=function(l,u){return r(this,void 0,void 0,function(){var d=this;return n(this,function(f){return setTimeout(function(){return r(d,void 0,void 0,function(){var h,p;return n(this,function(m){switch(m.label){case 0:return[4,_n.default().lock(u)];case 1:return m.sent(),this.acquiredIatSet.has(u)?(h=window.localStorage,(p=h.getItem(l))===null?(_n.default().unlock(u),[2]):((p=JSON.parse(p)).timeRefreshed=Date.now(),h.setItem(l,JSON.stringify(p)),_n.default().unlock(u),this.refreshLockWhileAcquired(l,u),[2])):(_n.default().unlock(u),[2])}})})},1e3),[2]})})},c.prototype.waitForSomethingToChange=function(l){return r(this,void 0,void 0,function(){return n(this,function(u){switch(u.label){case 0:return[4,new Promise(function(d){var f=!1,h=Date.now(),p=!1;function m(){if(p||(window.removeEventListener("storage",m),c.removeFromWaiting(m),clearTimeout(v),p=!0),!f){f=!0;var y=50-(Date.now()-h);y>0?setTimeout(d,y):d()}}window.addEventListener("storage",m),c.addToWaiting(m);var v=setTimeout(m,Math.max(0,l-Date.now()))})];case 1:return u.sent(),[2]}})})},c.addToWaiting=function(l){this.removeFromWaiting(l),c.waiters!==void 0&&c.waiters.push(l)},c.removeFromWaiting=function(l){c.waiters!==void 0&&(c.waiters=c.waiters.filter(function(u){return u!==l}))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach(function(l){return l()})},c.prototype.releaseLock=function(l){return r(this,void 0,void 0,function(){return n(this,function(u){switch(u.label){case 0:return[4,this.releaseLock__private__(l)];case 1:return[2,u.sent()]}})})},c.prototype.releaseLock__private__=function(l){return r(this,void 0,void 0,function(){var u,d,f;return n(this,function(h){switch(h.label){case 0:return u=window.localStorage,d=i+"-"+l,(f=u.getItem(d))===null?[2]:(f=JSON.parse(f)).id!==this.id?[3,2]:[4,_n.default().lock(f.iat)];case 1:h.sent(),this.acquiredIatSet.delete(f.iat),u.removeItem(d),_n.default().unlock(f.iat),c.notifyWaiters(),h.label=2;case 2:return[2]}})})},c.lockCorrector=function(){for(var l=Date.now()-5e3,u=window.localStorage,d=Object.keys(u),f=!1,h=0;h<d.length;h++){var p=d[h];if(p.includes(i)){var m=u.getItem(p);m!==null&&((m=JSON.parse(m)).timeRefreshed===void 0&&m.timeAcquired<l||m.timeRefreshed!==void 0&&m.timeRefreshed<l)&&(u.removeItem(p),f=!0)}}f&&c.notifyWaiters()},c.waiters=void 0,c}();t.default=s}),F3=rh(R3),L3={timeoutInSeconds:60},M3=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],Vb={name:"auth0-spa-js",version:"1.22.6"},Bb=function(){return Date.now()},Lr=function(e){function t(r,n){var i=e.call(this,n)||this;return i.error=r,i.error_description=n,Object.setPrototypeOf(i,t.prototype),i}return zn(t,e),t.fromPayload=function(r){return new t(r.error,r.error_description)},t}(Error),j3=function(e){function t(r,n,i,o){o===void 0&&(o=null);var a=e.call(this,r,n)||this;return a.state=i,a.appState=o,Object.setPrototypeOf(a,t.prototype),a}return zn(t,e),t}(Lr),Hu=function(e){function t(){var r=e.call(this,"timeout","Timeout")||this;return Object.setPrototypeOf(r,t.prototype),r}return zn(t,e),t}(Lr),z3=function(e){function t(r){var n=e.call(this)||this;return n.popup=r,Object.setPrototypeOf(n,t.prototype),n}return zn(t,e),t}(Hu),U3=function(e){function t(r){var n=e.call(this,"cancelled","Popup closed")||this;return n.popup=r,Object.setPrototypeOf(n,t.prototype),n}return zn(t,e),t}(Lr),V3=function(e){function t(r,n,i){var o=e.call(this,r,n)||this;return o.mfa_token=i,Object.setPrototypeOf(o,t.prototype),o}return zn(t,e),t}(Lr),B3=function(e){function t(r,n){var i=e.call(this,"missing_refresh_token","Missing Refresh Token (audience: '".concat(E0(r,["default"]),"', scope: '").concat(E0(n),"')"))||this;return i.audience=r,i.scope=n,Object.setPrototypeOf(i,t.prototype),i}return zn(t,e),t}(Lr),W3=function(e){return new Promise(function(t,r){var n,i=setInterval(function(){e.popup&&e.popup.closed&&(clearInterval(i),clearTimeout(o),window.removeEventListener("message",n,!1),r(new U3(e.popup)))},1e3),o=setTimeout(function(){clearInterval(i),r(new z3(e.popup)),window.removeEventListener("message",n,!1)},1e3*(e.timeoutInSeconds||60));n=function(a){if(a.data&&a.data.type==="authorization_response"){if(clearTimeout(o),clearInterval(i),window.removeEventListener("message",n,!1),e.popup.close(),a.data.response.error)return r(Lr.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",n)})},$h=function(){return window.crypto||window.msCrypto},Wb=function(){var e=$h();return e.subtle||e.webkitSubtle},Or=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from($h().getRandomValues(new Uint8Array(43))).forEach(function(r){return t+=e[r%e.length]}),t},Gn=function(e){return btoa(e)},Gu=function(e){return Object.keys(e).filter(function(t){return e[t]!==void 0}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},Ec=function(e){return ve(void 0,void 0,void 0,function(){var t;return ye(this,function(r){switch(r.label){case 0:return t=Wb().digest({name:"SHA-256"},new TextEncoder().encode(e)),window.msCrypto?[2,new Promise(function(n,i){t.oncomplete=function(o){n(o.target.result)},t.onerror=function(o){i(o.error)},t.onabort=function(){i("The digest operation was aborted")}})]:[4,t];case 1:return[2,r.sent()]}})})},k0=function(e){return function(t){return decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},Oc=function(e){var t=new Uint8Array(e);return function(r){var n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,function(i){return n[i]})}(window.btoa(String.fromCharCode.apply(String,Cu([],vi(Array.from(t)),!1))))};function E0(e,t){return t===void 0&&(t=[]),e&&!t.includes(e)?e:""}var q3=function(e,t){return ve(void 0,void 0,void 0,function(){var r,n;return ye(this,function(i){switch(i.label){case 0:return[4,(o=e,a=t,a=a||{},new Promise(function(s,c){var l=new XMLHttpRequest,u=[],d=[],f={},h=function(){return{ok:(l.status/100|0)==2,statusText:l.statusText,status:l.status,url:l.responseURL,text:function(){return Promise.resolve(l.responseText)},json:function(){return Promise.resolve(l.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([l.response]))},clone:h,headers:{keys:function(){return u},entries:function(){return d},get:function(m){return f[m.toLowerCase()]},has:function(m){return m.toLowerCase()in f}}}};for(var p in l.open(a.method||"get",o,!0),l.onload=function(){l.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,v,y){u.push(v=v.toLowerCase()),d.push([v,y]),f[v]=f[v]?f[v]+","+y:y}),s(h())},l.onerror=c,l.withCredentials=a.credentials=="include",a.headers)l.setRequestHeader(p,a.headers[p]);l.send(a.body||null)}))];case 1:return r=i.sent(),n={ok:r.ok},[4,r.json()];case 2:return[2,(n.json=i.sent(),n)]}var o,a})})},H3=function(e,t,r){return ve(void 0,void 0,void 0,function(){var n,i;return ye(this,function(o){return n=new AbortController,t.signal=n.signal,[2,Promise.race([q3(e,t),new Promise(function(a,s){i=setTimeout(function(){n.abort(),s(new Error("Timeout when executing 'fetch'"))},r)})]).finally(function(){clearTimeout(i)})]})})},G3=function(e,t,r,n,i,o,a){return ve(void 0,void 0,void 0,function(){return ye(this,function(s){return[2,(c={auth:{audience:t,scope:r},timeout:i,fetchUrl:e,fetchOptions:n,useFormData:a},l=o,new Promise(function(u,d){var f=new MessageChannel;f.port1.onmessage=function(h){h.data.error?d(new Error(h.data.error)):u(h.data),f.port1.close()},l.postMessage(c,[f.port2])}))];var c,l})})},Q3=function(e,t,r,n,i,o,a){return a===void 0&&(a=1e4),ve(void 0,void 0,void 0,function(){return ye(this,function(s){return i?[2,G3(e,t,r,n,a,i,o)]:[2,H3(e,n,a)]})})};function K3(e,t,r,n,i,o,a){return ve(this,void 0,void 0,function(){var s,c,l,u,d,f,h,p,m;return ye(this,function(v){switch(v.label){case 0:s=null,l=0,v.label=1;case 1:if(!(l<3))return[3,6];v.label=2;case 2:return v.trys.push([2,4,,5]),[4,Q3(e,r,n,i,o,a,t)];case 3:return c=v.sent(),s=null,[3,6];case 4:return u=v.sent(),s=u,[3,5];case 5:return l++,[3,1];case 6:if(s)throw s.message=s.message||"Failed to fetch",s;if(d=c.json,f=d.error,h=d.error_description,p=At(d,["error","error_description"]),!c.ok)throw m=h||"HTTP error. Unable to fetch ".concat(e),f==="mfa_required"?new V3(f,m,p.mfa_token):new Lr(f||"request_error",m);return[2,p]}})})}function ia(e,t){var r=e.baseUrl,n=e.timeout,i=e.audience,o=e.scope,a=e.auth0Client,s=e.useFormData,c=At(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);return ve(this,void 0,void 0,function(){var l;return ye(this,function(u){switch(u.label){case 0:return l=s?Gu(c):JSON.stringify(c),[4,K3("".concat(r,"/oauth/token"),n,i||"default",o,{method:"POST",body:l,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||Vb))}},t,s)];case 1:return[2,u.sent()]}})})}var Y3=function(e){return Array.from(new Set(e))},qr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Y3(e.join(" ").trim().split(/\s+/)).join(" ")},En=function(){function e(t,r){r===void 0&&(r="@@auth0spajs@@"),this.prefix=r,this.client_id=t.client_id,this.scope=t.scope,this.audience=t.audience}return e.prototype.toKey=function(){return"".concat(this.prefix,"::").concat(this.client_id,"::").concat(this.audience,"::").concat(this.scope)},e.fromKey=function(t){var r=vi(t.split("::"),4),n=r[0],i=r[1],o=r[2];return new e({client_id:i,scope:r[3],audience:o},n)},e.fromCacheEntry=function(t){return new e({scope:t.scope,audience:t.audience,client_id:t.client_id})},e}(),X3=function(){function e(){}return e.prototype.set=function(t,r){localStorage.setItem(t,JSON.stringify(r))},e.prototype.get=function(t){var r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}},e.prototype.remove=function(t){localStorage.removeItem(t)},e.prototype.allKeys=function(){return Object.keys(window.localStorage).filter(function(t){return t.startsWith("@@auth0spajs@@")})},e}(),Z3=function(){var e;this.enclosedCache=(e={},{set:function(t,r){e[t]=r},get:function(t){var r=e[t];if(r)return r},remove:function(t){delete e[t]},allKeys:function(){return Object.keys(e)}})},J3=function(){function e(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n,this.nowProvider=this.nowProvider||Bb}return e.prototype.get=function(t,r){var n;return r===void 0&&(r=0),ve(this,void 0,void 0,function(){var i,o,a,s,c;return ye(this,function(l){switch(l.label){case 0:return[4,this.cache.get(t.toKey())];case 1:return(i=l.sent())?[3,4]:[4,this.getCacheKeys()];case 2:return(o=l.sent())?(a=this.matchExistingCacheKey(t,o))?[4,this.cache.get(a)]:[3,4]:[2];case 3:i=l.sent(),l.label=4;case 4:return i?[4,this.nowProvider()]:[2];case 5:return s=l.sent(),c=Math.floor(s/1e3),i.expiresAt-r<c?i.body.refresh_token?(i.body={refresh_token:i.body.refresh_token},[4,this.cache.set(t.toKey(),i)]):[3,7]:[3,10];case 6:return l.sent(),[2,i.body];case 7:return[4,this.cache.remove(t.toKey())];case 8:return l.sent(),[4,(n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey())];case 9:return l.sent(),[2];case 10:return[2,i.body]}})})},e.prototype.set=function(t){var r;return ve(this,void 0,void 0,function(){var n,i;return ye(this,function(o){switch(o.label){case 0:return n=new En({client_id:t.client_id,scope:t.scope,audience:t.audience}),[4,this.wrapCacheEntry(t)];case 1:return i=o.sent(),[4,this.cache.set(n.toKey(),i)];case 2:return o.sent(),[4,(r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey())];case 3:return o.sent(),[2]}})})},e.prototype.clear=function(t){var r;return ve(this,void 0,void 0,function(){var n,i=this;return ye(this,function(o){switch(o.label){case 0:return[4,this.getCacheKeys()];case 1:return(n=o.sent())?[4,n.filter(function(a){return!t||a.includes(t)}).reduce(function(a,s){return ve(i,void 0,void 0,function(){return ye(this,function(c){switch(c.label){case 0:return[4,a];case 1:return c.sent(),[4,this.cache.remove(s)];case 2:return c.sent(),[2]}})})},Promise.resolve())]:[2];case 2:return o.sent(),[4,(r=this.keyManifest)===null||r===void 0?void 0:r.clear()];case 3:return o.sent(),[2]}})})},e.prototype.clearSync=function(t){var r=this,n=this.cache.allKeys();n&&n.filter(function(i){return!t||i.includes(t)}).forEach(function(i){r.cache.remove(i)})},e.prototype.wrapCacheEntry=function(t){return ve(this,void 0,void 0,function(){var r,n,i;return ye(this,function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return r=o.sent(),n=Math.floor(r/1e3)+t.expires_in,i=Math.min(n,t.decodedToken.claims.exp),[2,{body:t,expiresAt:i}]}})})},e.prototype.getCacheKeys=function(){var t;return ve(this,void 0,void 0,function(){var r;return ye(this,function(n){switch(n.label){case 0:return this.keyManifest?[4,this.keyManifest.get()]:[3,2];case 1:return r=(t=n.sent())===null||t===void 0?void 0:t.keys,[3,4];case 2:return[4,this.cache.allKeys()];case 3:r=n.sent(),n.label=4;case 4:return[2,r]}})})},e.prototype.matchExistingCacheKey=function(t,r){return r.filter(function(n){var i=En.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),a=t.scope.split(" "),s=i.scope&&a.reduce(function(c,l){return c&&o.has(l)},!0);return i.prefix==="@@auth0spajs@@"&&i.client_id===t.client_id&&i.audience===t.audience&&s})[0]},e}(),e4=function(){function e(t,r){this.storage=t,this.clientId=r,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId),this.transaction=this.storage.get(this.storageKey)}return e.prototype.create=function(t){this.transaction=t,this.storage.save(this.storageKey,t,{daysUntilExpire:1})},e.prototype.get=function(){return this.transaction},e.prototype.remove=function(){delete this.transaction,this.storage.remove(this.storageKey)},e}(),Ki=function(e){return typeof e=="number"},t4=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],r4=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(s){var c=s.split("."),l=vi(c,3),u=l[0],d=l[1],f=l[2];if(c.length!==3||!u||!d||!f)throw new Error("ID token could not be decoded");var h=JSON.parse(k0(d)),p={__raw:s},m={};return Object.keys(h).forEach(function(v){p[v]=h[v],t4.includes(v)||(m[v]=h[v])}),{encoded:{header:u,payload:d,signature:f},header:JSON.parse(k0(u)),claims:p,user:m}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Ki(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!Ki(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ki(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var r=e.leeway||60,n=new Date(e.now||Date.now()),i=new Date(0),o=new Date(0),a=new Date(0);if(a.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),i.setUTCSeconds(t.claims.exp+r),o.setUTCSeconds(t.claims.nbf-r),n>i)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(n,") is after expiration time (").concat(i,")"));if(Ki(t.claims.nbf)&&n<o)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (".concat(n,") is before ").concat(o));if(Ki(t.claims.auth_time)&&n>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (".concat(n,") is after last auth at ").concat(a));if(e.organizationId){if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e.organizationId!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(e.organizationId,'", found "').concat(t.claims.org_id,'"'))}return t},On=Ii(function(e,t){var r=vr&&vr.__assign||function(){return r=Object.assign||function(c){for(var l,u=1,d=arguments.length;u<d;u++)for(var f in l=arguments[u])Object.prototype.hasOwnProperty.call(l,f)&&(c[f]=l[f]);return c},r.apply(this,arguments)};function n(c,l){if(!l)return"";var u="; "+c;return l===!0?u:u+"="+l}function i(c,l,u){return encodeURIComponent(c).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(d){if(typeof d.expires=="number"){var f=new Date;f.setMilliseconds(f.getMilliseconds()+864e5*d.expires),d.expires=f}return n("Expires",d.expires?d.expires.toUTCString():"")+n("Domain",d.domain)+n("Path",d.path)+n("Secure",d.secure)+n("SameSite",d.sameSite)}(u)}function o(c){for(var l={},u=c?c.split("; "):[],d=/(%[\dA-F]{2})+/gi,f=0;f<u.length;f++){var h=u[f].split("="),p=h.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{l[h[0].replace(d,decodeURIComponent)]=p.replace(d,decodeURIComponent)}catch{}}return l}function a(){return o(document.cookie)}function s(c,l,u){document.cookie=i(c,l,r({path:"/"},u))}t.__esModule=!0,t.encode=i,t.parse=o,t.getAll=a,t.get=function(c){return a()[c]},t.set=s,t.remove=function(c,l){s(c,"",r(r({},l),{expires:-1}))}});rh(On),On.encode,On.parse,On.getAll;var n4=On.get,qb=On.set,Hb=On.remove,Jn={get:function(e){var t=n4(e);if(t!==void 0)return JSON.parse(t)},save:function(e,t,r){var n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),qb(e,JSON.stringify(t),n)},remove:function(e,t){var r={};t?.cookieDomain&&(r.domain=t.cookieDomain),Hb(e,r)}},i4={get:function(e){var t=Jn.get(e);return t||Jn.get("".concat("_legacy_").concat(e))},save:function(e,t,r){var n={};window.location.protocol==="https:"&&(n={secure:!0}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),qb("".concat("_legacy_").concat(e),JSON.stringify(t),n),Jn.save(e,t,r)},remove:function(e,t){var r={};t?.cookieDomain&&(r.domain=t.cookieDomain),Hb(e,r),Jn.remove(e,t),Jn.remove("".concat("_legacy_").concat(e),t)}},o4={get:function(e){if(typeof sessionStorage<"u"){var t=sessionStorage.getItem(e);if(t!==void 0)return JSON.parse(t)}},save:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove:function(e){sessionStorage.removeItem(e)}};function a4(e,t,r){var n=t===void 0?null:t,i=function(c,l){var u=atob(c);if(l){for(var d=new Uint8Array(u.length),f=0,h=u.length;f<h;++f)d[f]=u.charCodeAt(f);return String.fromCharCode.apply(null,new Uint16Array(d.buffer))}return u}(e,r!==void 0&&r),o=i.indexOf(`
1
+ "use strict";const fr={};function d$(e){fr.context=e}const f$=(e,t)=>e===t,br=Symbol("solid-proxy"),_u=Symbol("solid-track"),gs={equals:f$};let Dg=jg;const Ur=1,bs=2,Rg={owned:null,cleanups:null,context:null,owner:null};var it=null;let Cn=null,et=null,mt=null,Ir=null,th=0;function $a(e,t){const r=et,n=it,i=e.length===0,o=i?Rg:{owned:null,cleanups:null,context:null,owner:t||n},a=i?e:()=>e(()=>V(()=>Dl(o)));it=o,et=null;try{return Ti(a,!0)}finally{et=r,it=n}}function L(e,t){t=t?Object.assign({},gs,t):gs;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),Mg(r,i));return[Lg.bind(r),n]}function h$(e,t,r){const n=Al(e,t,!0,Ur);Pi(n)}function W(e,t,r){const n=Al(e,t,!1,Ur);Pi(n)}function ge(e,t,r){Dg=$$;const n=Al(e,t,!1,Ur);n.user=!0,Ir?Ir.push(n):Pi(n)}function fe(e,t,r){r=r?Object.assign({},gs,r):gs;const n=Al(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Pi(n),Lg.bind(n)}function p$(e){return Ti(e,!1)}function V(e){const t=et;et=null;try{return e()}finally{et=t}}function Tt(e){ge(()=>V(e))}function Il(e){return it===null||(it.cleanups===null?it.cleanups=[e]:it.cleanups.push(e)),e}function Fg(){return et}function P(){return it}function m$(e,t){const r=Symbol("context");return{id:r,Provider:_$(r),defaultValue:e}}function v$(e){let t;return(t=Vg(it,e.id))!==void 0?t:e.defaultValue}function y$(e){const t=fe(e),r=fe(()=>xu(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}function Lg(){const e=Cn;if(this.sources&&(this.state||e))if(this.state===Ur||e)Pi(this);else{const t=mt;mt=null,Ti(()=>ws(this),!1),mt=t}if(et){const t=this.observers?this.observers.length:0;et.sources?(et.sources.push(this),et.sourceSlots.push(t)):(et.sources=[this],et.sourceSlots=[t]),this.observers?(this.observers.push(et),this.observerSlots.push(et.sources.length-1)):(this.observers=[et],this.observerSlots=[et.sources.length-1])}return this.value}function Mg(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&Ti(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],a=Cn&&Cn.running;a&&Cn.disposed.has(o),(a&&!o.tState||!a&&!o.state)&&(o.pure?mt.push(o):Ir.push(o),o.observers&&zg(o)),a||(o.state=Ur)}if(mt.length>1e6)throw mt=[],new Error},!1)),t}function Pi(e){if(!e.fn)return;Dl(e);const t=it,r=et,n=th;et=it=e,g$(e,e.value,n),et=r,it=t}function g$(e,t,r){let n;try{n=e.fn(t)}catch(i){e.pure&&(e.state=Ur,e.owned&&e.owned.forEach(Dl),e.owned=null),Ug(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Mg(e,n):e.value=n,e.updatedAt=r)}function Al(e,t,r,n=Ur,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:it,context:null,pure:r};return it===null||it!==Rg&&(it.owned?it.owned.push(o):it.owned=[o]),o}function $s(e){const t=Cn;if(e.state===0||t)return;if(e.state===bs||t)return ws(e);if(e.suspense&&V(e.suspense.inFallback))return e.suspense.effects.push(e);const r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<th);)(e.state||t)&&r.push(e);for(let n=r.length-1;n>=0;n--)if(e=r[n],e.state===Ur||t)Pi(e);else if(e.state===bs||t){const i=mt;mt=null,Ti(()=>ws(e,r[0]),!1),mt=i}}function Ti(e,t){if(mt)return e();let r=!1;t||(mt=[]),Ir?r=!0:Ir=[],th++;try{const n=e();return b$(r),n}catch(n){mt||(Ir=null),mt=null,Ug(n)}}function b$(e){if(mt&&(jg(mt),mt=null),e)return;const t=Ir;Ir=null,t.length&&Ti(()=>Dg(t),!1)}function jg(e){for(let t=0;t<e.length;t++)$s(e[t])}function $$(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:$s(n)}for(fr.context&&d$(),t=0;t<r;t++)$s(e[t])}function ws(e,t){const r=Cn;e.state=0;for(let n=0;n<e.sources.length;n+=1){const i=e.sources[n];i.sources&&(i.state===Ur||r?i!==t&&$s(i):(i.state===bs||r)&&ws(i,t))}}function zg(e){const t=Cn;for(let r=0;r<e.observers.length;r+=1){const n=e.observers[r];(!n.state||t)&&(n.state=bs,n.pure?mt.push(n):Ir.push(n),n.observers&&zg(n))}}function Dl(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const o=i.pop(),a=r.observerSlots.pop();n<i.length&&(o.sourceSlots[a]=n,i[n]=o,r.observerSlots[n]=a)}}if(e.owned){for(t=0;t<e.owned.length;t++)Dl(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function w$(e){return e instanceof Error||typeof e=="string"?e:new Error("Unknown error")}function Ug(e){throw e=w$(e),e}function Vg(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:Vg(e.owner,t):void 0}function xu(e){if(typeof e=="function"&&!e.length)return xu(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=xu(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function _$(e,t){return function(n){let i;return W(()=>i=V(()=>(it.context={[e]:n.value},y$(()=>n.children))),void 0),i}}const x$=Symbol("fallback");function $p(e){for(let t=0;t<e.length;t++)e[t]()}function S$(e,t,r={}){let n=[],i=[],o=[],a=0,s=t.length>1?[]:null;return Il(()=>$p(o)),()=>{let c=e()||[],l,u;return c[_u],V(()=>{let f=c.length,h,p,m,v,y,b,g,w,x;if(f===0)a!==0&&($p(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[x$],i[0]=$a(E=>(o[0]=E,r.fallback())),a=1);else if(a===0){for(i=new Array(f),u=0;u<f;u++)n[u]=c[u],i[u]=$a(d);a=f}else{for(m=new Array(f),v=new Array(f),s&&(y=new Array(f)),b=0,g=Math.min(a,f);b<g&&n[b]===c[b];b++);for(g=a-1,w=f-1;g>=b&&w>=b&&n[g]===c[w];g--,w--)m[w]=i[g],v[w]=o[g],s&&(y[w]=s[g]);for(h=new Map,p=new Array(w+1),u=w;u>=b;u--)x=c[u],l=h.get(x),p[u]=l===void 0?-1:l,h.set(x,u);for(l=b;l<=g;l++)x=n[l],u=h.get(x),u!==void 0&&u!==-1?(m[u]=i[l],v[u]=o[l],s&&(y[u]=s[l]),u=p[u],h.set(x,u)):o[l]();for(u=b;u<f;u++)u in m?(i[u]=m[u],o[u]=v[u],s&&(s[u]=y[u],s[u](u))):i[u]=$a(d);i=i.slice(0,a=f),n=c.slice(0)}return i});function d(f){if(o[u]=f,s){const[h,p]=L(u);return s[u]=p,t(c[u],h)}return t(c[u])}}}function z(e,t){return V(()=>e(t||{}))}function Yo(){return!0}const k$={get(e,t,r){return t===br?r:e.get(t)},has(e,t){return t===br?!0:e.has(t)},set:Yo,deleteProperty:Yo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Yo,deleteProperty:Yo}},ownKeys(e){return e.keys()}};function uc(e){return(e=typeof e=="function"?e():e)?e:{}}function Su(...e){let t=!1;for(let n=0;n<e.length;n++){const i=e[n];t=t||!!i&&br in i,e[n]=typeof i=="function"?(t=!0,fe(i)):i}if(t)return new Proxy({get(n){for(let i=e.length-1;i>=0;i--){const o=uc(e[i])[n];if(o!==void 0)return o}},has(n){for(let i=e.length-1;i>=0;i--)if(n in uc(e[i]))return!0;return!1},keys(){const n=[];for(let i=0;i<e.length;i++)n.push(...Object.keys(uc(e[i])));return[...new Set(n)]}},k$);const r={};for(let n=e.length-1;n>=0;n--)if(e[n]){const i=Object.getOwnPropertyDescriptors(e[n]);for(const o in i)o in r||Object.defineProperty(r,o,{enumerable:!0,get(){for(let a=e.length-1;a>=0;a--){const s=(e[a]||{})[o];if(s!==void 0)return s}}})}return r}function Rl(e){const t="fallback"in e&&{fallback:()=>e.fallback};return fe(S$(()=>e.each,e.children,t||void 0))}function re(e){let t=!1;const r=e.keyed,n=fe(()=>e.when,void 0,{equals:(i,o)=>t?i===o:!i==!o});return fe(()=>{const i=n();if(i){const o=e.children,a=typeof o=="function"&&o.length>0;return t=r||a,a?V(()=>o(i)):o}return e.fallback},void 0,void 0)}function E$(e,t,r){let n=r.length,i=t.length,o=n,a=0,s=0,c=t[i-1].nextSibling,l=null;for(;a<i||s<o;){if(t[a]===r[s]){a++,s++;continue}for(;t[i-1]===r[o-1];)i--,o--;if(i===a){const u=o<n?s?r[s-1].nextSibling:r[o-s]:c;for(;s<o;)e.insertBefore(r[s++],u)}else if(o===s)for(;a<i;)(!l||!l.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[o-1]&&r[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--o],u),t[i]=r[o]}else{if(!l){l=new Map;let d=s;for(;d<o;)l.set(r[d],d++)}const u=l.get(t[a]);if(u!=null)if(s<u&&u<o){let d=a,f=1,h;for(;++d<i&&d<o&&!((h=l.get(t[d]))==null||h!==u+f);)f++;if(f>u-s){const p=t[a];for(;s<u;)e.insertBefore(r[s++],p)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}const wp="_$DX_DELEGATE";function O(e,t,r){const n=document.createElement("template");n.innerHTML=e;let i=n.content.firstChild;return r&&(i=i.firstChild),i}function Ni(e,t=window.document){const r=t[wp]||(t[wp]=new Set);for(let n=0,i=e.length;n<i;n++){const o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,T$))}}function O$(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function _p(e,t){t==null?e.removeAttribute("class"):e.className=t}function C$(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(xp(e,s,!1),delete r[s])}for(o=0,a=n.length;o<a;o++){const s=n[o],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(xp(e,s,!0),r[s]=c)}return r}function P$(e,t,r){if(!t)return r?O$(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function ee(e,t,r){return V(()=>e(t,r))}function _(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return _s(e,t,n,r);W(i=>_s(e,t(),i,r),n)}function xp(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function T$(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),fr.registry&&!fr.done&&(fr.done=!0,document.querySelectorAll("[id^=pl-]").forEach(n=>{for(;n&&n.nodeType!==8&&n.nodeValue!=="pl-"+e;){let i=n.nextSibling;n.remove(),n=i}n&&n.remove()}));r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function _s(e,t,r,n,i){for(fr.context&&!r&&(r=[...e.childNodes]);typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(fr.context)return r;if(o==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=Wn(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(fr.context)return r;r=Wn(e,r,n)}else{if(o==="function")return W(()=>{let s=t();for(;typeof s=="function";)s=s();r=_s(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],c=r&&Array.isArray(r);if(ku(s,t,r,i))return W(()=>r=_s(e,s,r,n,!0)),()=>r;if(fr.context){if(!s.length)return r;for(let l=0;l<s.length;l++)if(s[l].parentNode)return r=s}if(s.length===0){if(r=Wn(e,r,n),a)return r}else c?r.length===0?Sp(e,s,n):E$(e,r,s):(r&&Wn(e),Sp(e,s));r=s}else if(t instanceof Node){if(fr.context&&t.parentNode)return r=a?[t]:t;if(Array.isArray(r)){if(a)return r=Wn(e,r,n,t);Wn(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function ku(e,t,r,n){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],c=r&&r[o];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))i=ku(e,s,c)||i;else if(typeof s=="function")if(n){for(;typeof s=="function";)s=s();i=ku(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else e.push(s),i=!0;else{const l=String(s);c&&c.nodeType===3&&c.data===l?e.push(c):e.push(document.createTextNode(l))}}return i}function Sp(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Wn(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const c=s.parentNode===e;!o&&!a?c?e.replaceChild(i,s):e.insertBefore(i,r):c&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}function N$(e){return Object.keys(e).reduce((r,n)=>{const i=e[n];return r[n]=Object.assign({},i),Wg(i.value)&&!F$(i.value)&&!Array.isArray(i.value)&&(r[n].value=Object.assign({},i.value)),Array.isArray(i.value)&&(r[n].value=i.value.slice(0)),r},{})}function I$(e){return e?Object.keys(e).reduce((r,n)=>{const i=e[n];return r[n]=Wg(i)&&"value"in i?i:{value:i},r[n].attribute||(r[n].attribute=R$(n)),r[n].parse="parse"in r[n]?r[n].parse:typeof r[n].value!="string",r},{}):{}}function A$(e){return Object.keys(e).reduce((r,n)=>(r[n]=e[n].value,r),{})}function D$(e,t){const r=N$(t);return Object.keys(t).forEach(i=>{const o=r[i],a=e.getAttribute(o.attribute),s=e[i];a&&(o.value=o.parse?Bg(a):a),s!=null&&(o.value=Array.isArray(s)?s.slice(0):s),o.reflect&&kp(e,o.attribute,o.value),Object.defineProperty(e,i,{get(){return o.value},set(c){const l=o.value;o.value=c,o.reflect&&kp(this,o.attribute,o.value);for(let u=0,d=this.__propertyChangedCallbacks.length;u<d;u++)this.__propertyChangedCallbacks[u](i,c,l)},enumerable:!0,configurable:!0})}),r}function Bg(e){if(!!e)try{return JSON.parse(e)}catch{return e}}function kp(e,t,r){if(r==null||r===!1)return e.removeAttribute(t);let n=JSON.stringify(r);e.__updating[t]=!0,n==="true"&&(n=""),e.setAttribute(t,n),Promise.resolve().then(()=>delete e.__updating[t])}function R$(e){return e.replace(/\.?([A-Z]+)/g,(t,r)=>"-"+r.toLowerCase()).replace("_","-").replace(/^-/,"")}function Wg(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function F$(e){return Object.prototype.toString.call(e)==="[object Function]"}function L$(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let dc;function M$(e,t){const r=Object.keys(t);return class extends e{static get observedAttributes(){return r.map(i=>t[i].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=D$(this,t);const i=A$(this.props),o=this.Component,a=dc;try{dc=this,this.__initialized=!0,L$(o)?new o(i,{element:this}):o(i,{element:this})}finally{dc=a}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let i=null;for(;i=this.__releaseCallbacks.pop();)i(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(i,o,a){if(!!this.__initialized&&!this.__updating[i]&&(i=this.lookupProp(i),i in t)){if(a==null&&!this[i])return;this[i]=t[i].parse?Bg(a):a}}lookupProp(i){if(!!t)return r.find(o=>i===o||i===t[o].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(i){this.__releaseCallbacks.push(i)}addPropertyChangedCallback(i){this.__propertyChangedCallbacks.push(i)}}}function j$(e,t={},r={}){const{BaseElement:n=HTMLElement,extension:i}=r;return o=>{if(!e)throw new Error("tag is required to register a Component");let a=customElements.get(e);return a?(a.prototype.Component=o,a):(a=M$(n,I$(t)),a.prototype.Component=o,a.prototype.registeredTag=e,customElements.define(e,a,i),a)}}function z$(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const[i,o]=L(e[t[n]]);Object.defineProperty(r,t[n],{get:i,set(a){o(()=>a)}})}return r}function U$(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function V$(e){return(t,r)=>{const{element:n}=r;return $a(i=>{const o=z$(t);n.addPropertyChangedCallback((s,c)=>o[s]=c),n.addReleaseCallback(()=>{n.renderRoot.textContent="",i()});const a=e(o,r);return _(n.renderRoot,a)},U$(n))}}function we(e,t,r){return arguments.length===2&&(r=t,t={}),j$(e,t)(V$(r))}const qg=m$(),rt=()=>v$(qg),B$=(e,t)=>{const r=[];return t.forEach(n=>{(!Object.keys(e).includes(n)||e[n]==null)&&r.push(`photon-client requires ${n}, but no value was provided`)}),r.forEach(n=>console.warn(n)),r},W$=/[?&]code=[^&]+/,q$=/[?&]state=[^&]+/,H$=/[?&]error=[^&]+/,G$=(e=window.location.search)=>(W$.test(e)||H$.test(e))&&q$.test(e),Ep=e=>e.replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),Q$=e=>/^\d+$/.test(e)&&e.length>=5;var Eu=function(e,t){return Eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Eu(e,t)};function lr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Eu(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var C=function(){return C=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},C.apply(this,arguments)};function an(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function ie(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?o(u.value):i(u.value).then(s,c)}l((n=n.apply(e,t||[])).next())})}function Kr(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function xs(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var Ou=function(e,t){return Ou=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ou(e,t)};function zn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ou(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var se=function(){return se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},se.apply(this,arguments)};function At(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function ve(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(l){try{c(n.next(l))}catch(u){o(u)}}function s(l){try{c(n.throw(l))}catch(u){o(u)}}function c(l){var u;l.done?i(l.value):(u=l.value,u instanceof r?u:new r(function(d){d(u)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function ye(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!((i=i.length>0&&i[i.length-1])||u[0]!==6&&u[0]!==2)){a=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(u[0]===6&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(d){u=[6,d],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([c,l])}}}function vi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function Cu(e,t,r){if(r||arguments.length===2)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ii(e,t){return e(t={exports:{}},t.exports),t.exports}var Br,wa,Xo=function(e){return e&&e.Math==Math&&e},le=Xo(typeof globalThis=="object"&&globalThis)||Xo(typeof window=="object"&&window)||Xo(typeof self=="object"&&self)||Xo(typeof vr=="object"&&vr)||function(){return this}()||Function("return this")(),Ae=function(e){try{return!!e()}catch{return!0}},Ee=!Ae(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Lo=!Ae(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Zo=Function.prototype.call,kt=Lo?Zo.bind(Zo):function(){return Zo.apply(Zo,arguments)},Op={}.propertyIsEnumerable,Cp=Object.getOwnPropertyDescriptor,K$=Cp&&!Op.call({1:2},1)?function(e){var t=Cp(this,e);return!!t&&t.enumerable}:Op,nh={f:K$},An=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Hg=Function,Gg=Hg.prototype,Y$=Gg.bind,Pu=Gg.call,X$=Lo&&Y$.bind(Pu,Pu),he=function(e){return e instanceof Hg?Lo?X$(e):function(){return Pu.apply(e,arguments)}:void 0},Z$=he({}.toString),J$=he("".slice),Ar=function(e){return J$(Z$(e),8,-1)},fc=Object,ew=he("".split),Qg=Ae(function(){return!fc("z").propertyIsEnumerable(0)})?function(e){return Ar(e)=="String"?ew(e,""):fc(e)}:fc,Ai=function(e){return e==null},tw=TypeError,Mo=function(e){if(Ai(e))throw tw("Can't call method on "+e);return e},kr=function(e){return Qg(Mo(e))},hc=typeof document=="object"&&document.all,Fl={all:hc,IS_HTMLDDA:hc===void 0&&hc!==void 0},rw=Fl.all,Te=Fl.IS_HTMLDDA?function(e){return typeof e=="function"||e===rw}:function(e){return typeof e=="function"},nw=Fl.all,Le=Fl.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:Te(e)||e===nw}:function(e){return typeof e=="object"?e!==null:Te(e)},iw=function(e){return Te(e)?e:void 0},cr=function(e,t){return arguments.length<2?iw(le[e]):le[e]&&le[e][t]},Dn=he({}.isPrototypeOf),pc=cr("navigator","userAgent")||"",Pp=le.process,Tp=le.Deno,Np=Pp&&Pp.versions||Tp&&Tp.version,Ip=Np&&Np.v8;Ip&&(wa=(Br=Ip.split("."))[0]>0&&Br[0]<4?1:+(Br[0]+Br[1])),!wa&&pc&&(!(Br=pc.match(/Edge\/(\d+)/))||Br[1]>=74)&&(Br=pc.match(/Chrome\/(\d+)/))&&(wa=+Br[1]);var Ss=wa,Wt=!!Object.getOwnPropertySymbols&&!Ae(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ss&&Ss<41}),ih=Wt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ow=Object,yi=ih?function(e){return typeof e=="symbol"}:function(e){var t=cr("Symbol");return Te(t)&&Dn(t.prototype,ow(e))},aw=String,Di=function(e){try{return aw(e)}catch{return"Object"}},sw=TypeError,oh=function(e){if(Te(e))return e;throw sw(Di(e)+" is not a function")},ks=function(e,t){var r=e[t];return Ai(r)?void 0:oh(r)},lw=TypeError,cw=Object.defineProperty,ah=function(e,t){try{cw(le,e,{value:t,configurable:!0,writable:!0})}catch{le[e]=t}return t},tn=le["__core-js_shared__"]||ah("__core-js_shared__",{}),vn=Ii(function(e){(e.exports=function(t,r){return tn[t]||(tn[t]=r!==void 0?r:{})})("versions",[]).push({version:"3.25.4",mode:"global",copyright:"\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.4/LICENSE",source:"https://github.com/zloirock/core-js"})}),uw=Object,Ri=function(e){return uw(Mo(e))},dw=he({}.hasOwnProperty),J=Object.hasOwn||function(e,t){return dw(Ri(e),t)},fw=0,hw=Math.random(),pw=he(1 .toString),gi=function(e){return"Symbol("+(e===void 0?"":e)+")_"+pw(++fw+hw,36)},Hi=vn("wks"),Pn=le.Symbol,Ap=Pn&&Pn.for,mw=ih?Pn:Pn&&Pn.withoutSetter||gi,Ye=function(e){if(!J(Hi,e)||!Wt&&typeof Hi[e]!="string"){var t="Symbol."+e;Wt&&J(Pn,e)?Hi[e]=Pn[e]:Hi[e]=ih&&Ap?Ap(t):mw(t)}return Hi[e]},vw=TypeError,yw=Ye("toPrimitive"),gw=function(e,t){if(!Le(e)||yi(e))return e;var r,n=ks(e,yw);if(n){if(t===void 0&&(t="default"),r=kt(n,e,t),!Le(r)||yi(r))return r;throw vw("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(i,o){var a,s;if(o==="string"&&Te(a=i.toString)&&!Le(s=kt(a,i))||Te(a=i.valueOf)&&!Le(s=kt(a,i))||o!=="string"&&Te(a=i.toString)&&!Le(s=kt(a,i)))return s;throw lw("Can't convert object to primitive value")}(e,t)},Rn=function(e){var t=gw(e,"string");return yi(t)?t:t+""},Tu=le.document,bw=Le(Tu)&&Le(Tu.createElement),Kg=function(e){return bw?Tu.createElement(e):{}},Yg=!Ee&&!Ae(function(){return Object.defineProperty(Kg("div"),"a",{get:function(){return 7}}).a!=7}),Dp=Object.getOwnPropertyDescriptor,jo={f:Ee?Dp:function(e,t){if(e=kr(e),t=Rn(t),Yg)try{return Dp(e,t)}catch{}if(J(e,t))return An(!kt(nh.f,e,t),e[t])}},Xg=Ee&&Ae(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),$w=String,ww=TypeError,ut=function(e){if(Le(e))return e;throw ww($w(e)+" is not an object")},_w=TypeError,mc=Object.defineProperty,xw=Object.getOwnPropertyDescriptor,$t={f:Ee?Xg?function(e,t,r){if(ut(e),t=Rn(t),ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&"writable"in r&&!r.writable){var n=xw(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return mc(e,t,r)}:mc:function(e,t,r){if(ut(e),t=Rn(t),ut(r),Yg)try{return mc(e,t,r)}catch{}if("get"in r||"set"in r)throw _w("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Ll=Ee?function(e,t,r){return $t.f(e,t,An(1,r))}:function(e,t,r){return e[t]=r,e},Zg=Function.prototype,Sw=Ee&&Object.getOwnPropertyDescriptor,vc=J(Zg,"name"),sh={EXISTS:vc,PROPER:vc&&function(){}.name==="something",CONFIGURABLE:vc&&(!Ee||Ee&&Sw(Zg,"name").configurable)},kw=he(Function.toString);Te(tn.inspectSource)||(tn.inspectSource=function(e){return kw(e)});var Es,ho,Os,Jg=tn.inspectSource,Rp=le.WeakMap,Ew=Te(Rp)&&/native code/.test(String(Rp)),Fp=vn("keys"),Ml=function(e){return Fp[e]||(Fp[e]=gi(e))},Fi={},Nu=le.TypeError,Ow=le.WeakMap;if(Ew||tn.state){var bn=tn.state||(tn.state=new Ow),Cw=he(bn.get),Lp=he(bn.has),Pw=he(bn.set);Es=function(e,t){if(Lp(bn,e))throw Nu("Object already initialized");return t.facade=e,Pw(bn,e,t),t},ho=function(e){return Cw(bn,e)||{}},Os=function(e){return Lp(bn,e)}}else{var qn=Ml("state");Fi[qn]=!0,Es=function(e,t){if(J(e,qn))throw Nu("Object already initialized");return t.facade=e,Ll(e,qn,t),t},ho=function(e){return J(e,qn)?e[qn]:{}},Os=function(e){return J(e,qn)}}var Kt={set:Es,get:ho,has:Os,enforce:function(e){return Os(e)?ho(e):Es(e,{})},getterFor:function(e){return function(t){var r;if(!Le(t)||(r=ho(t)).type!==e)throw Nu("Incompatible receiver, "+e+" required");return r}}},Tw=Ii(function(e){var t=sh.CONFIGURABLE,r=Kt.enforce,n=Kt.get,i=Object.defineProperty,o=Ee&&!Ae(function(){return i(function(){},"length",{value:8}).length!==8}),a=String(String).split("String"),s=e.exports=function(c,l,u){String(l).slice(0,7)==="Symbol("&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),u&&u.getter&&(l="get "+l),u&&u.setter&&(l="set "+l),(!J(c,"name")||t&&c.name!==l)&&(Ee?i(c,"name",{value:l,configurable:!0}):c.name=l),o&&u&&J(u,"arity")&&c.length!==u.arity&&i(c,"length",{value:u.arity});try{u&&J(u,"constructor")&&u.constructor?Ee&&i(c,"prototype",{writable:!1}):c.prototype&&(c.prototype=void 0)}catch{}var d=r(c);return J(d,"source")||(d.source=a.join(typeof l=="string"?l:"")),c};Function.prototype.toString=s(function(){return Te(this)&&n(this).source||Jg(this)},"toString")}),Ot=function(e,t,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:t;if(Te(r)&&Tw(r,o,n),n.global)i?e[t]=r:ah(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch{}i?e[t]=r:$t.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Nw=Math.ceil,Iw=Math.floor,Aw=Math.trunc||function(e){var t=+e;return(t>0?Iw:Nw)(t)},lh=function(e){var t=+e;return t!=t||t===0?0:Aw(t)},Dw=Math.max,Rw=Math.min,Iu=function(e,t){var r=lh(e);return r<0?Dw(r+t,0):Rw(r,t)},Fw=Math.min,eb=function(e){return e>0?Fw(lh(e),9007199254740991):0},Li=function(e){return eb(e.length)},Mp=function(e){return function(t,r,n){var i,o=kr(t),a=Li(o),s=Iu(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},tb={includes:Mp(!0),indexOf:Mp(!1)},Lw=tb.indexOf,jp=he([].push),rb=function(e,t){var r,n=kr(e),i=0,o=[];for(r in n)!J(Fi,r)&&J(n,r)&&jp(o,r);for(;t.length>i;)J(n,r=t[i++])&&(~Lw(o,r)||jp(o,r));return o},Cs=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mw=Cs.concat("length","prototype"),wo={f:Object.getOwnPropertyNames||function(e){return rb(e,Mw)}},jl={f:Object.getOwnPropertySymbols},jw=he([].concat),zw=cr("Reflect","ownKeys")||function(e){var t=wo.f(ut(e)),r=jl.f;return r?jw(t,r(e)):t},nb=function(e,t,r){for(var n=zw(t),i=$t.f,o=jo.f,a=0;a<n.length;a++){var s=n[a];J(e,s)||r&&J(r,s)||i(e,s,o(t,s))}},Uw=/#|\.prototype\./,zo=function(e,t){var r=Bw[Vw(e)];return r==qw||r!=Ww&&(Te(t)?Ae(t):!!t)},Vw=zo.normalize=function(e){return String(e).replace(Uw,".").toLowerCase()},Bw=zo.data={},Ww=zo.NATIVE="N",qw=zo.POLYFILL="P",Au=zo,Hw=jo.f,dt=function(e,t){var r,n,i,o,a,s=e.target,c=e.global,l=e.stat;if(r=c?le:l?le[s]||ah(s,{}):(le[s]||{}).prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(a=Hw(r,n))&&a.value:r[n],!Au(c?n:s+(l?".":"#")+n,e.forced)&&i!==void 0){if(typeof o==typeof i)continue;nb(o,i)}(e.sham||i&&i.sham)&&Ll(o,"sham",!0),Ot(r,n,o,e)}},ib={};ib[Ye("toStringTag")]="z";var yc,ch=String(ib)==="[object z]",Gw=Ye("toStringTag"),Qw=Object,Kw=Ar(function(){return arguments}())=="Arguments",Un=ch?Ar:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=function(i,o){try{return i[o]}catch{}}(t=Qw(e),Gw))=="string"?r:Kw?Ar(t):(n=Ar(t))=="Object"&&Te(t.callee)?"Arguments":n},Yw=String,Rr=function(e){if(Un(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return Yw(e)},Xw=Ye("match"),Zw=TypeError,ob=function(e){if(function(t){var r;return Le(t)&&((r=t[Xw])!==void 0?!!r:Ar(t)=="RegExp")}(e))throw Zw("The method doesn't accept regular expressions");return e},Jw=Ye("match"),ab=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[Jw]=!1,"/./"[e](t)}catch{}}return!1},e_=jo.f,zp=he("".startsWith),t_=he("".slice),r_=Math.min,sb=ab("startsWith"),n_=!(sb||(yc=e_(String.prototype,"startsWith"),!yc||yc.writable));dt({target:"String",proto:!0,forced:!n_&&!sb},{startsWith:function(e){var t=Rr(Mo(this));ob(e);var r=eb(r_(arguments.length>1?arguments[1]:void 0,t.length)),n=Rr(e);return zp?zp(t,n,r):t_(t,r,r+n.length)===n}});var uh=function(e,t){return he(le[e].prototype[t])};uh("String","startsWith");var Ps=Array.isArray||function(e){return Ar(e)=="Array"},i_=TypeError,Up=function(e){if(e>9007199254740991)throw i_("Maximum allowed index exceeded");return e},_o=function(e,t,r){var n=Rn(t);n in e?$t.f(e,n,An(0,r)):e[n]=r},lb=function(){},o_=[],cb=cr("Reflect","construct"),dh=/^\s*(?:class|function)\b/,a_=he(dh.exec),s_=!dh.exec(lb),Gi=function(e){if(!Te(e))return!1;try{return cb(lb,o_,e),!0}catch{return!1}},ub=function(e){if(!Te(e))return!1;switch(Un(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return s_||!!a_(dh,Jg(e))}catch{return!0}};ub.sham=!0;var Vp,fh=!cb||Ae(function(){var e;return Gi(Gi.call)||!Gi(Object)||!Gi(function(){e=!0})||e})?ub:Gi,l_=Ye("species"),Bp=Array,db=function(e,t){return new(function(r){var n;return Ps(r)&&(n=r.constructor,(fh(n)&&(n===Bp||Ps(n.prototype))||Le(n)&&(n=n[l_])===null)&&(n=void 0)),n===void 0?Bp:n}(e))(t===0?0:t)},c_=Ye("species"),fb=Ye("isConcatSpreadable"),u_=Ss>=51||!Ae(function(){var e=[];return e[fb]=!1,e.concat()[0]!==e}),d_=(Vp="concat",Ss>=51||!Ae(function(){var e=[];return(e.constructor={})[c_]=function(){return{foo:1}},e[Vp](Boolean).foo!==1})),f_=function(e){if(!Le(e))return!1;var t=e[fb];return t!==void 0?!!t:Ps(e)};dt({target:"Array",proto:!0,arity:1,forced:!u_||!d_},{concat:function(e){var t,r,n,i,o,a=Ri(this),s=db(a,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(f_(o=t===-1?a:arguments[t]))for(i=Li(o),Up(c+i),r=0;r<i;r++,c++)r in o&&_o(s,c,o[r]);else Up(c+1),_o(s,c++,o);return s.length=c,s}});var h_=ch?{}.toString:function(){return"[object "+Un(this)+"]"};ch||Ot(Object.prototype,"toString",h_,{unsafe:!0});var Jo,hh=Object.keys||function(e){return rb(e,Cs)},p_=Ee&&!Xg?Object.defineProperties:function(e,t){ut(e);for(var r,n=kr(t),i=hh(t),o=i.length,a=0;o>a;)$t.f(e,r=i[a++],n[r]);return e},hb={f:p_},m_=cr("document","documentElement"),pb=Ml("IE_PROTO"),gc=function(){},mb=function(e){return"<script>"+e+"<\/script>"},Wp=function(e){e.write(mb("")),e.close();var t=e.parentWindow.Object;return e=null,t},_a=function(){try{Jo=new ActiveXObject("htmlfile")}catch{}var e,t;_a=typeof document<"u"?document.domain&&Jo?Wp(Jo):((t=Kg("iframe")).style.display="none",m_.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(mb("document.F=Object")),e.close(),e.F):Wp(Jo);for(var r=Cs.length;r--;)delete _a.prototype[Cs[r]];return _a()};Fi[pb]=!0;var sn=Object.create||function(e,t){var r;return e!==null?(gc.prototype=ut(e),r=new gc,gc.prototype=null,r[pb]=e):r=_a(),t===void 0?r:hb.f(r,t)},v_=Array,y_=Math.max,vb=wo.f,yb=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],g_=function(e){try{return vb(e)}catch{return function(r,n,i){for(var o=Li(r),a=Iu(n,o),s=Iu(i===void 0?o:i,o),c=v_(y_(s-a,0)),l=0;a<s;a++,l++)_o(c,l,r[a]);return c.length=l,c}(yb)}},ph={f:function(e){return yb&&Ar(e)=="Window"?g_(e):vb(kr(e))}},gb={f:Ye},xo=le,b_=$t.f,Dt=function(e){var t=xo.Symbol||(xo.Symbol={});J(t,e)||b_(t,e,{value:gb.f(e)})},bb=function(){var e=cr("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=Ye("toPrimitive");t&&!t[n]&&Ot(t,n,function(i){return kt(r,this)},{arity:1})},$_=$t.f,qp=Ye("toStringTag"),en=function(e,t,r){e&&!r&&(e=e.prototype),e&&!J(e,qp)&&$_(e,qp,{configurable:!0,value:t})},w_=he(he.bind),zl=function(e,t){return oh(e),t===void 0?e:Lo?w_(e,t):function(){return e.apply(t,arguments)}},Hp=he([].push),Wr=function(e){var t=e==1,r=e==2,n=e==3,i=e==4,o=e==6,a=e==7,s=e==5||o;return function(c,l,u,d){for(var f,h,p=Ri(c),m=Qg(p),v=zl(l,u),y=Li(m),b=0,g=d||db,w=t?g(c,y):r||a?g(c,0):void 0;y>b;b++)if((s||b in m)&&(h=v(f=m[b],b,p),e))if(t)w[b]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return b;case 2:Hp(w,f)}else switch(e){case 4:return!1;case 7:Hp(w,f)}return o?-1:n||i?i:w}},Ul={forEach:Wr(0),map:Wr(1),filter:Wr(2),some:Wr(3),every:Wr(4),find:Wr(5),findIndex:Wr(6),filterReject:Wr(7)}.forEach,Rt=Ml("hidden"),__=Kt.set,Gp=Kt.getterFor("Symbol"),Ht=Object.prototype,ni=le.Symbol,lo=ni&&ni.prototype,x_=le.TypeError,bc=le.QObject,$b=jo.f,Zr=$t.f,wb=ph.f,S_=nh.f,_b=he([].push),Fr=vn("symbols"),Uo=vn("op-symbols"),k_=vn("wks"),$c=!bc||!bc.prototype||!bc.prototype.findChild,Du=Ee&&Ae(function(){return sn(Zr({},"a",{get:function(){return Zr(this,"a",{value:7}).a}})).a!=7})?function(e,t,r){var n=$b(Ht,t);n&&delete Ht[t],Zr(e,t,r),n&&e!==Ht&&Zr(Ht,t,n)}:Zr,wc=function(e,t){var r=Fr[e]=sn(lo);return __(r,{type:"Symbol",tag:e,description:t}),Ee||(r.description=t),r},Ts=function(e,t,r){e===Ht&&Ts(Uo,t,r),ut(e);var n=Rn(t);return ut(r),J(Fr,n)?(r.enumerable?(J(e,Rt)&&e[Rt][n]&&(e[Rt][n]=!1),r=sn(r,{enumerable:An(0,!1)})):(J(e,Rt)||Zr(e,Rt,An(1,{})),e[Rt][n]=!0),Du(e,n,r)):Zr(e,n,r)},_c=function(e,t){ut(e);var r=kr(t),n=hh(r).concat(xb(r));return Ul(n,function(i){Ee&&!kt(Ru,r,i)||Ts(e,i,r[i])}),e},Ru=function(e){var t=Rn(e),r=kt(S_,this,t);return!(this===Ht&&J(Fr,t)&&!J(Uo,t))&&(!(r||!J(this,t)||!J(Fr,t)||J(this,Rt)&&this[Rt][t])||r)},Qp=function(e,t){var r=kr(e),n=Rn(t);if(r!==Ht||!J(Fr,n)||J(Uo,n)){var i=$b(r,n);return!i||!J(Fr,n)||J(r,Rt)&&r[Rt][n]||(i.enumerable=!0),i}},Kp=function(e){var t=wb(kr(e)),r=[];return Ul(t,function(n){J(Fr,n)||J(Fi,n)||_b(r,n)}),r},xb=function(e){var t=e===Ht,r=wb(t?Uo:kr(e)),n=[];return Ul(r,function(i){!J(Fr,i)||t&&!J(Ht,i)||_b(n,Fr[i])}),n};Wt||(lo=(ni=function(){if(Dn(lo,this))throw x_("Symbol is not a constructor");var e=arguments.length&&arguments[0]!==void 0?Rr(arguments[0]):void 0,t=gi(e),r=function(n){this===Ht&&kt(r,Uo,n),J(this,Rt)&&J(this[Rt],t)&&(this[Rt][t]=!1),Du(this,t,An(1,n))};return Ee&&$c&&Du(Ht,t,{configurable:!0,set:r}),wc(t,e)}).prototype,Ot(lo,"toString",function(){return Gp(this).tag}),Ot(ni,"withoutSetter",function(e){return wc(gi(e),e)}),nh.f=Ru,$t.f=Ts,hb.f=_c,jo.f=Qp,wo.f=ph.f=Kp,jl.f=xb,gb.f=function(e){return wc(Ye(e),e)},Ee&&(Zr(lo,"description",{configurable:!0,get:function(){return Gp(this).description}}),Ot(Ht,"propertyIsEnumerable",Ru,{unsafe:!0}))),dt({global:!0,constructor:!0,wrap:!0,forced:!Wt,sham:!Wt},{Symbol:ni}),Ul(hh(k_),function(e){Dt(e)}),dt({target:"Symbol",stat:!0,forced:!Wt},{useSetter:function(){$c=!0},useSimple:function(){$c=!1}}),dt({target:"Object",stat:!0,forced:!Wt,sham:!Ee},{create:function(e,t){return t===void 0?sn(e):_c(sn(e),t)},defineProperty:Ts,defineProperties:_c,getOwnPropertyDescriptor:Qp}),dt({target:"Object",stat:!0,forced:!Wt},{getOwnPropertyNames:Kp}),bb(),en(ni,"Symbol"),Fi[Rt]=!0;var Sb=Wt&&!!Symbol.for&&!!Symbol.keyFor,xc=vn("string-to-symbol-registry"),E_=vn("symbol-to-string-registry");dt({target:"Symbol",stat:!0,forced:!Sb},{for:function(e){var t=Rr(e);if(J(xc,t))return xc[t];var r=cr("Symbol")(t);return xc[t]=r,E_[r]=t,r}});var Yp=vn("symbol-to-string-registry");dt({target:"Symbol",stat:!0,forced:!Sb},{keyFor:function(e){if(!yi(e))throw TypeError(Di(e)+" is not a symbol");if(J(Yp,e))return Yp[e]}});var kb=Function.prototype,Xp=kb.apply,Zp=kb.call,Eb=typeof Reflect=="object"&&Reflect.apply||(Lo?Zp.bind(Xp):function(){return Zp.apply(Xp,arguments)}),mh=he([].slice),rn=cr("JSON","stringify"),ea=he(/./.exec),Jp=he("".charAt),O_=he("".charCodeAt),C_=he("".replace),P_=he(1 .toString),T_=/[\uD800-\uDFFF]/g,e0=/^[\uD800-\uDBFF]$/,t0=/^[\uDC00-\uDFFF]$/,r0=!Wt||Ae(function(){var e=cr("Symbol")();return rn([e])!="[null]"||rn({a:e})!="{}"||rn(Object(e))!="{}"}),n0=Ae(function(){return rn("\uDF06\uD834")!=='"\\udf06\\ud834"'||rn("\uDEAD")!=='"\\udead"'}),N_=function(e,t){var r=mh(arguments),n=t;if((Le(t)||e!==void 0)&&!yi(e))return Ps(t)||(t=function(i,o){if(Te(n)&&(o=kt(n,this,i,o)),!yi(o))return o}),r[1]=t,Eb(rn,null,r)},I_=function(e,t,r){var n=Jp(r,t-1),i=Jp(r,t+1);return ea(e0,e)&&!ea(t0,i)||ea(t0,e)&&!ea(e0,n)?"\\u"+P_(O_(e,0),16):e};rn&&dt({target:"JSON",stat:!0,arity:3,forced:r0||n0},{stringify:function(e,t,r){var n=mh(arguments),i=Eb(r0?N_:rn,null,n);return n0&&typeof i=="string"?C_(i,T_,I_):i}});var A_=!Wt||Ae(function(){jl.f(1)});dt({target:"Object",stat:!0,forced:A_},{getOwnPropertySymbols:function(e){var t=jl.f;return t?t(Ri(e)):[]}}),Dt("asyncIterator");var D_=$t.f,Pr=le.Symbol,$n=Pr&&Pr.prototype;if(Ee&&Te(Pr)&&(!("description"in $n)||Pr().description!==void 0)){var i0={},ta=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:Rr(arguments[0]),t=Dn($n,this)?new Pr(e):e===void 0?Pr():Pr(e);return e===""&&(i0[t]=!0),t};nb(ta,Pr),ta.prototype=$n,$n.constructor=ta;var R_=String(Pr("test"))=="Symbol(test)",F_=he($n.valueOf),L_=he($n.toString),M_=/^Symbol\((.*)\)[^)]+$/,j_=he("".replace),z_=he("".slice);D_($n,"description",{configurable:!0,get:function(){var e=F_(this);if(J(i0,e))return"";var t=L_(e),r=R_?z_(t,7,-1):j_(t,M_,"$1");return r===""?void 0:r}}),dt({global:!0,constructor:!0,forced:!0},{Symbol:ta})}Dt("hasInstance"),Dt("isConcatSpreadable"),Dt("iterator"),Dt("match"),Dt("matchAll"),Dt("replace"),Dt("search"),Dt("species"),Dt("split"),Dt("toPrimitive"),bb(),Dt("toStringTag"),en(cr("Symbol"),"Symbol"),Dt("unscopables"),en(le.JSON,"JSON",!0),en(Math,"Math",!0),dt({global:!0},{Reflect:{}}),en(le.Reflect,"Reflect",!0),xo.Symbol;var Tn,o0,a0,U_=he("".charAt),s0=he("".charCodeAt),V_=he("".slice),l0=function(e){return function(t,r){var n,i,o=Rr(Mo(t)),a=lh(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=s0(o,a))<55296||n>56319||a+1===s||(i=s0(o,a+1))<56320||i>57343?e?U_(o,a):n:e?V_(o,a,a+2):i-56320+(n-55296<<10)+65536}},B_={codeAt:l0(!1),charAt:l0(!0)},W_=!Ae(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),c0=Ml("IE_PROTO"),Fu=Object,q_=Fu.prototype,ln=W_?Fu.getPrototypeOf:function(e){var t=Ri(e);if(J(t,c0))return t[c0];var r=t.constructor;return Te(r)&&t instanceof r?r.prototype:t instanceof Fu?q_:null},Lu=Ye("iterator"),Ob=!1;[].keys&&("next"in(a0=[].keys())?(o0=ln(ln(a0)))!==Object.prototype&&(Tn=o0):Ob=!0);var H_=!Le(Tn)||Ae(function(){var e={};return Tn[Lu].call(e)!==e});H_&&(Tn={}),Te(Tn[Lu])||Ot(Tn,Lu,function(){return this});var vh={IteratorPrototype:Tn,BUGGY_SAFARI_ITERATORS:Ob},bi={},G_=vh.IteratorPrototype,Q_=function(){return this},K_=String,Y_=TypeError,$r=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=he(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch{}return function(n,i){return ut(n),function(o){if(typeof o=="object"||Te(o))return o;throw Y_("Can't set "+K_(o)+" as a prototype")}(i),t?e(n,i):n.__proto__=i,n}}():void 0),X_=sh.PROPER,Z_=sh.CONFIGURABLE,u0=vh.IteratorPrototype,ra=vh.BUGGY_SAFARI_ITERATORS,Qi=Ye("iterator"),J_=function(){return this},yh=function(e,t,r,n,i,o,a){(function(y,b,g,w){var x=b+" Iterator";y.prototype=sn(G_,{next:An(+!w,g)}),en(y,x,!1),bi[x]=Q_})(r,t,n);var s,c,l,u=function(y){if(y===i&&m)return m;if(!ra&&y in h)return h[y];switch(y){case"keys":case"values":case"entries":return function(){return new r(this,y)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[Qi]||h["@@iterator"]||i&&h[i],m=!ra&&p||u(i),v=t=="Array"&&h.entries||p;if(v&&(s=ln(v.call(new e)))!==Object.prototype&&s.next&&(ln(s)!==u0&&($r?$r(s,u0):Te(s[Qi])||Ot(s,Qi,J_)),en(s,d,!0)),X_&&i=="values"&&p&&p.name!=="values"&&(Z_?Ll(h,"name","values"):(f=!0,m=function(){return kt(p,this)})),i)if(c={values:u("values"),keys:o?m:u("keys"),entries:u("entries")},a)for(l in c)(ra||f||!(l in h))&&Ot(h,l,c[l]);else dt({target:t,proto:!0,forced:ra||f},c);return h[Qi]!==m&&Ot(h,Qi,m,{name:i}),bi[t]=m,c},$i=function(e,t){return{value:e,done:t}},e3=B_.charAt,t3=Kt.set,r3=Kt.getterFor("String Iterator");yh(String,"String",function(e){t3(this,{type:"String Iterator",string:Rr(e),index:0})},function(){var e,t=r3(this),r=t.string,n=t.index;return n>=r.length?$i(void 0,!0):(e=e3(r,n),t.index+=e.length,$i(e,!1))});var Mu=function(e,t,r){var n,i;ut(e);try{if(!(n=ks(e,"return"))){if(t==="throw")throw r;return r}n=kt(n,e)}catch(o){i=!0,n=o}if(t==="throw")throw r;if(i)throw n;return ut(n),r},n3=function(e,t,r,n){try{return n?t(ut(r)[0],r[1]):t(r)}catch(i){Mu(e,"throw",i)}},i3=Ye("iterator"),o3=Array.prototype,Cb=function(e){return e!==void 0&&(bi.Array===e||o3[i3]===e)},a3=Ye("iterator"),gh=function(e){if(!Ai(e))return ks(e,a3)||ks(e,"@@iterator")||bi[Un(e)]},s3=TypeError,Pb=function(e,t){var r=arguments.length<2?gh(e):t;if(oh(r))return ut(kt(r,e));throw s3(Di(e)+" is not iterable")},d0=Array,Tb=Ye("iterator"),Nb=!1;try{var l3=0,f0={next:function(){return{done:!!l3++}},return:function(){Nb=!0}};f0[Tb]=function(){return this},Array.from(f0,function(){throw 2})}catch{}var Ib=function(e,t){if(!t&&!Nb)return!1;var r=!1;try{var n={};n[Tb]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},c3=!Ib(function(e){Array.from(e)});dt({target:"Array",stat:!0,forced:c3},{from:function(e){var t=Ri(e),r=fh(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=i!==void 0;o&&(i=zl(i,n>2?arguments[2]:void 0));var a,s,c,l,u,d,f=gh(t),h=0;if(!f||this===d0&&Cb(f))for(a=Li(t),s=r?new this(a):d0(a);a>h;h++)d=o?i(t[h],h):t[h],_o(s,h,d);else for(u=(l=Pb(t,f)).next,s=r?new this:[];!(c=kt(u,l)).done;h++)d=o?n3(l,i,[c.value,h],!0):c.value,_o(s,h,d);return s.length=h,s}}),xo.Array.from;var Ft,ci,Ns,u3=typeof ArrayBuffer<"u"&&typeof DataView<"u",d3=$t.f,Ab=Kt.enforce,f3=Kt.get,Is=le.Int8Array,ju=Is&&Is.prototype,h0=le.Uint8ClampedArray,p0=h0&&h0.prototype,hr=Is&&ln(Is),nr=ju&&ln(ju),h3=Object.prototype,zu=le.TypeError,m0=Ye("toStringTag"),Uu=gi("TYPED_ARRAY_TAG"),Dr=u3&&!!$r&&Un(le.opera)!=="Opera",Db=!1,Tr={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},bh={BigInt64Array:8,BigUint64Array:8},Rb=function(e){var t=ln(e);if(Le(t)){var r=f3(t);return r&&J(r,"TypedArrayConstructor")?r.TypedArrayConstructor:Rb(t)}},v0=function(e){if(!Le(e))return!1;var t=Un(e);return J(Tr,t)||J(bh,t)};for(Ft in Tr)(Ns=(ci=le[Ft])&&ci.prototype)?Ab(Ns).TypedArrayConstructor=ci:Dr=!1;for(Ft in bh)(Ns=(ci=le[Ft])&&ci.prototype)&&(Ab(Ns).TypedArrayConstructor=ci);if((!Dr||!Te(hr)||hr===Function.prototype)&&(hr=function(){throw zu("Incorrect invocation")},Dr))for(Ft in Tr)le[Ft]&&$r(le[Ft],hr);if((!Dr||!nr||nr===h3)&&(nr=hr.prototype,Dr))for(Ft in Tr)le[Ft]&&$r(le[Ft].prototype,nr);if(Dr&&ln(p0)!==nr&&$r(p0,nr),Ee&&!J(nr,m0))for(Ft in Db=!0,d3(nr,m0,{get:function(){return Le(this)?this[Uu]:void 0}}),Tr)le[Ft]&&Ll(le[Ft],Uu,Ft);var Vl={NATIVE_ARRAY_BUFFER_VIEWS:Dr,TYPED_ARRAY_TAG:Db&&Uu,aTypedArray:function(e){if(v0(e))return e;throw zu("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Te(e)&&(!$r||Dn(hr,e)))return e;throw zu(Di(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(Ee){if(r)for(var i in Tr){var o=le[i];if(o&&J(o.prototype,e))try{delete o.prototype[e]}catch{try{o.prototype[e]=t}catch{}}}nr[e]&&!r||Ot(nr,e,r?t:Dr&&ju[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(Ee){if($r){if(r){for(n in Tr)if((i=le[n])&&J(i,e))try{delete i[e]}catch{}}if(hr[e]&&!r)return;try{return Ot(hr,e,r?t:Dr&&hr[e]||t)}catch{}}for(n in Tr)!(i=le[n])||i[e]&&!r||Ot(i,e,t)}},getTypedArrayConstructor:Rb,isView:function(e){if(!Le(e))return!1;var t=Un(e);return t==="DataView"||J(Tr,t)||J(bh,t)},isTypedArray:v0,TypedArray:hr,TypedArrayPrototype:nr},p3=TypeError,m3=Ye("species"),v3=function(e,t){var r,n=ut(e).constructor;return n===void 0||Ai(r=ut(n)[m3])?t:function(i){if(fh(i))return i;throw p3(Di(i)+" is not a constructor")}(r)},y3=Vl.aTypedArrayConstructor,g3=Vl.getTypedArrayConstructor,b3=Vl.aTypedArray;(0,Vl.exportTypedArrayMethod)("slice",function(e,t){for(var r,n=mh(b3(this),e,t),i=y3(v3(r=this,g3(r))),o=0,a=n.length,s=new i(a);a>o;)s[o]=n[o++];return s},Ae(function(){new Int8Array(1).slice()}));var $3=$t.f,Vu=Ye("unscopables"),Bu=Array.prototype;Bu[Vu]==null&&$3(Bu,Vu,{configurable:!0,value:sn(null)});var xa=function(e){Bu[Vu][e]=!0},w3=tb.includes,_3=Ae(function(){return!Array(1).includes()});dt({target:"Array",proto:!0,forced:_3},{includes:function(e){return w3(this,e,arguments.length>1?arguments[1]:void 0)}}),xa("includes"),uh("Array","includes");var x3=he("".indexOf);dt({target:"String",proto:!0,forced:!ab("includes")},{includes:function(e){return!!~x3(Rr(Mo(this)),Rr(ob(e)),arguments.length>1?arguments[1]:void 0)}}),uh("String","includes");var S3=$t.f,k3=Kt.set,E3=Kt.getterFor("Array Iterator");yh(Array,"Array",function(e,t){k3(this,{type:"Array Iterator",target:kr(e),index:0,kind:t})},function(){var e=E3(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,$i(void 0,!0)):$i(r=="keys"?n:r=="values"?t[n]:[n,t[n]],!1)},"values");var y0=bi.Arguments=bi.Array;if(xa("keys"),xa("values"),xa("entries"),Ee&&y0.name!=="values")try{S3(y0,"name",{value:"values"})}catch{}var g0=Ae(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),na=Object.isExtensible,Sc=Ae(function(){na(1)})||g0?function(e){return!!Le(e)&&(!g0||Ar(e)!="ArrayBuffer")&&(!na||na(e))}:na,O3=!Ae(function(){return Object.isExtensible(Object.preventExtensions({}))}),ii=Ii(function(e){var t=$t.f,r=!1,n=gi("meta"),i=0,o=function(s){t(s,n,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},r=!0;var s=wo.f,c=he([].splice),l={};l[n]=1,s(l).length&&(wo.f=function(u){for(var d=s(u),f=0,h=d.length;f<h;f++)if(d[f]===n){c(d,f,1);break}return d},dt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:ph.f}))},fastKey:function(s,c){if(!Le(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!J(s,n)){if(!Sc(s))return"F";if(!c)return"E";o(s)}return s[n].objectID},getWeakData:function(s,c){if(!J(s,n)){if(!Sc(s))return!0;if(!c)return!1;o(s)}return s[n].weakData},onFreeze:function(s){return O3&&r&&Sc(s)&&!J(s,n)&&o(s),s}};Fi[n]=!0});ii.enable,ii.fastKey,ii.getWeakData,ii.onFreeze;var C3=TypeError,Sa=function(e,t){this.stopped=e,this.result=t},b0=Sa.prototype,Fb=function(e,t,r){var n,i,o,a,s,c,l,u=r&&r.that,d=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_RECORD),h=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),m=zl(t,u),v=function(b){return n&&Mu(n,"normal",b),new Sa(!0,b)},y=function(b){return d?(ut(b),p?m(b[0],b[1],v):m(b[0],b[1])):p?m(b,v):m(b)};if(f)n=e.iterator;else if(h)n=e;else{if(!(i=gh(e)))throw C3(Di(e)+" is not iterable");if(Cb(i)){for(o=0,a=Li(e);a>o;o++)if((s=y(e[o]))&&Dn(b0,s))return s;return new Sa(!1)}n=Pb(e,i)}for(c=f?e.next:n.next;!(l=kt(c,n)).done;){try{s=y(l.value)}catch(b){Mu(n,"throw",b)}if(typeof s=="object"&&s&&Dn(b0,s))return s}return new Sa(!1)},P3=TypeError,Lb=function(e,t){if(Dn(t,e))return e;throw P3("Incorrect invocation")},$0=function(e,t,r){for(var n in t)Ot(e,n,t[n],r);return e},w0=Ye("species"),T3=$t.f,_0=ii.fastKey,x0=Kt.set,kc=Kt.getterFor,N3={getConstructor:function(e,t,r,n){var i=e(function(l,u){Lb(l,o),x0(l,{type:t,index:sn(null),first:void 0,last:void 0,size:0}),Ee||(l.size=0),Ai(u)||Fb(u,l[n],{that:l,AS_ENTRIES:r})}),o=i.prototype,a=kc(t),s=function(l,u,d){var f,h,p=a(l),m=c(l,u);return m?m.value=d:(p.last=m={index:h=_0(u,!0),key:u,value:d,previous:f=p.last,next:void 0,removed:!1},p.first||(p.first=m),f&&(f.next=m),Ee?p.size++:l.size++,h!=="F"&&(p.index[h]=m)),l},c=function(l,u){var d,f=a(l),h=_0(u);if(h!=="F")return f.index[h];for(d=f.first;d;d=d.next)if(d.key==u)return d};return $0(o,{clear:function(){for(var l=a(this),u=l.index,d=l.first;d;)d.removed=!0,d.previous&&(d.previous=d.previous.next=void 0),delete u[d.index],d=d.next;l.first=l.last=void 0,Ee?l.size=0:this.size=0},delete:function(l){var u=this,d=a(u),f=c(u,l);if(f){var h=f.next,p=f.previous;delete d.index[f.index],f.removed=!0,p&&(p.next=h),h&&(h.previous=p),d.first==f&&(d.first=h),d.last==f&&(d.last=p),Ee?d.size--:u.size--}return!!f},forEach:function(l){for(var u,d=a(this),f=zl(l,arguments.length>1?arguments[1]:void 0);u=u?u.next:d.first;)for(f(u.value,u.key,this);u&&u.removed;)u=u.previous},has:function(l){return!!c(this,l)}}),$0(o,r?{get:function(l){var u=c(this,l);return u&&u.value},set:function(l,u){return s(this,l===0?0:l,u)}}:{add:function(l){return s(this,l=l===0?0:l,l)}}),Ee&&T3(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=kc(t),o=kc(n);yh(e,t,function(a,s){x0(this,{type:n,target:a,state:i(a),kind:s,last:void 0})},function(){for(var a=o(this),s=a.kind,c=a.last;c&&c.removed;)c=c.previous;return a.target&&(a.last=c=c?c.next:a.state.first)?$i(s=="keys"?c.key:s=="values"?c.value:[c.key,c.value],!1):(a.target=void 0,$i(void 0,!0))},r?"entries":"values",!r,!0),function(a){var s=cr(a),c=$t.f;Ee&&s&&!s[w0]&&c(s,w0,{configurable:!0,get:function(){return this}})}(t)}};function Mb(e){var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){return t.reject(r)})})}function jb(e){return new this(function(t,r){if(!e||e.length===void 0)return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(e);if(n.length===0)return t([]);var i=n.length;function o(s,c){if(c&&(typeof c=="object"||typeof c=="function")){var l=c.then;if(typeof l=="function")return void l.call(c,function(u){o(s,u)},function(u){n[s]={status:"rejected",reason:u},--i==0&&t(n)})}n[s]={status:"fulfilled",value:c},--i==0&&t(n)}for(var a=0;a<n.length;a++)o(a,n[a])})}(function(e,t,r){var n=e.indexOf("Map")!==-1,i=e.indexOf("Weak")!==-1,o=n?"set":"add",a=le[e],s=a&&a.prototype,c=a,l={},u=function(v){var y=he(s[v]);Ot(s,v,v=="add"?function(b){return y(this,b===0?0:b),this}:v=="delete"?function(b){return!(i&&!Le(b))&&y(this,b===0?0:b)}:v=="get"?function(b){return i&&!Le(b)?void 0:y(this,b===0?0:b)}:v=="has"?function(b){return!(i&&!Le(b))&&y(this,b===0?0:b)}:function(b,g){return y(this,b===0?0:b,g),this})};if(Au(e,!Te(a)||!(i||s.forEach&&!Ae(function(){new a().entries().next()}))))c=r.getConstructor(t,e,n,o),ii.enable();else if(Au(e,!0)){var d=new c,f=d[o](i?{}:-0,1)!=d,h=Ae(function(){d.has(1)}),p=Ib(function(v){new a(v)}),m=!i&&Ae(function(){for(var v=new a,y=5;y--;)v[o](y,y);return!v.has(-0)});p||((c=t(function(v,y){Lb(v,s);var b=function(g,w,x){var E,S;return $r&&Te(E=w.constructor)&&E!==x&&Le(S=E.prototype)&&S!==x.prototype&&$r(g,S),g}(new a,v,c);return Ai(y)||Fb(y,b[o],{that:b,AS_ENTRIES:n}),b})).prototype=s,s.constructor=c),(h||m)&&(u("delete"),u("has"),n&&u("get")),(m||f)&&u(o),i&&s.clear&&delete s.clear}l[e]=c,dt({global:!0,constructor:!0,forced:c!=a},l),en(c,e),i||r.setStrong(c,e,n)})("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},N3),xo.Set;var I3=setTimeout;function S0(e){return Boolean(e&&e.length!==void 0)}function A3(){}function Ve(e){if(!(this instanceof Ve))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ub(e,this)}function zb(e,t){for(;e._state===3;)e=e._value;e._state!==0?(e._handled=!0,Ve._immediateFn(function(){var r=e._state===1?t.onFulfilled:t.onRejected;if(r!==null){var n;try{n=r(e._value)}catch(i){return void So(t.promise,i)}Wu(t.promise,n)}else(e._state===1?Wu:So)(t.promise,e._value)})):e._deferreds.push(t)}function Wu(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var r=t.then;if(t instanceof Ve)return e._state=3,e._value=t,void qu(e);if(typeof r=="function")return void Ub((n=r,i=t,function(){n.apply(i,arguments)}),e)}e._state=1,e._value=t,qu(e)}catch(o){So(e,o)}var n,i}function So(e,t){e._state=2,e._value=t,qu(e)}function qu(e){e._state===2&&e._deferreds.length===0&&Ve._immediateFn(function(){e._handled||Ve._unhandledRejectionFn(e._value)});for(var t=0,r=e._deferreds.length;t<r;t++)zb(e,e._deferreds[t]);e._deferreds=null}function D3(e,t,r){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=r}function Ub(e,t){var r=!1;try{e(function(n){r||(r=!0,Wu(t,n))},function(n){r||(r=!0,So(t,n))})}catch(n){if(r)return;r=!0,So(t,n)}}Ve.prototype.catch=function(e){return this.then(null,e)},Ve.prototype.then=function(e,t){var r=new this.constructor(A3);return zb(this,new D3(e,t,r)),r},Ve.prototype.finally=Mb,Ve.all=function(e){return new Ve(function(t,r){if(!S0(e))return r(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(e);if(n.length===0)return t([]);var i=n.length;function o(s,c){try{if(c&&(typeof c=="object"||typeof c=="function")){var l=c.then;if(typeof l=="function")return void l.call(c,function(u){o(s,u)},r)}n[s]=c,--i==0&&t(n)}catch(u){r(u)}}for(var a=0;a<n.length;a++)o(a,n[a])})},Ve.allSettled=jb,Ve.resolve=function(e){return e&&typeof e=="object"&&e.constructor===Ve?e:new Ve(function(t){t(e)})},Ve.reject=function(e){return new Ve(function(t,r){r(e)})},Ve.race=function(e){return new Ve(function(t,r){if(!S0(e))return r(new TypeError("Promise.race accepts an array"));for(var n=0,i=e.length;n<i;n++)Ve.resolve(e[n]).then(t,r)})},Ve._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){I3(e,0)},Ve._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Hn=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}();typeof Hn.Promise!="function"?Hn.Promise=Ve:(Hn.Promise.prototype.finally||(Hn.Promise.prototype.finally=Mb),Hn.Promise.allSettled||(Hn.Promise.allSettled=jb)),function(e){function t(h){for(var p=0,m=Math.min(65536,h.length+1),v=new Uint16Array(m),y=[],b=0;;){var g=p<h.length;if(!g||b>=m-1){var w=v.subarray(0,b);if(y.push(String.fromCharCode.apply(null,w)),!g)return y.join("");h=h.subarray(p),p=0,b=0}var x=h[p++];if((128&x)==0)v[b++]=x;else if((224&x)==192){var E=63&h[p++];v[b++]=(31&x)<<6|E}else if((240&x)==224){E=63&h[p++];var S=63&h[p++];v[b++]=(31&x)<<12|E<<6|S}else if((248&x)==240){var T=(7&x)<<18|(E=63&h[p++])<<12|(S=63&h[p++])<<6|63&h[p++];T>65535&&(T-=65536,v[b++]=T>>>10&1023|55296,T=56320|1023&T),v[b++]=T}}}var r="Failed to ",n=function(h,p,m){if(h)throw new Error("".concat(r).concat(p,": the '").concat(m,"' option is unsupported."))},i=typeof Buffer=="function"&&Buffer.from,o=i?function(h){return Buffer.from(h)}:function(h){for(var p=0,m=h.length,v=0,y=Math.max(32,m+(m>>>1)+7),b=new Uint8Array(y>>>3<<3);p<m;){var g=h.charCodeAt(p++);if(g>=55296&&g<=56319){if(p<m){var w=h.charCodeAt(p);(64512&w)==56320&&(++p,g=((1023&g)<<10)+(1023&w)+65536)}if(g>=55296&&g<=56319)continue}if(v+4>b.length){y+=8,y=(y*=1+p/h.length*2)>>>3<<3;var x=new Uint8Array(y);x.set(b),b=x}if((4294967168&g)!=0){if((4294965248&g)==0)b[v++]=g>>>6&31|192;else if((4294901760&g)==0)b[v++]=g>>>12&15|224,b[v++]=g>>>6&63|128;else{if((4292870144&g)!=0)continue;b[v++]=g>>>18&7|240,b[v++]=g>>>12&63|128,b[v++]=g>>>6&63|128}b[v++]=63&g|128}else b[v++]=g}return b.slice?b.slice(0,v):b.subarray(0,v)};function a(){this.encoding="utf-8"}a.prototype.encode=function(h,p){return n(p&&p.stream,"encode","stream"),o(h)};var s=!i&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",c=["utf-8","utf8","unicode-1-1-utf-8"],l=t;i?l=function(h,p){return(h instanceof Buffer?h:Buffer.from(h.buffer,h.byteOffset,h.byteLength)).toString(p)}:s&&(l=function(h){try{return function(p){var m;try{var v=new Blob([p],{type:"text/plain;charset=UTF-8"});m=URL.createObjectURL(v);var y=new XMLHttpRequest;return y.open("GET",m,!1),y.send(),y.responseText}finally{m&&URL.revokeObjectURL(m)}}(h)}catch{return t(h)}});var u="construct 'TextDecoder'",d="".concat(r," ").concat(u,": the ");function f(h,p){if(n(p&&p.fatal,u,"fatal"),h=h||"utf-8",!(i?Buffer.isEncoding(h):c.indexOf(h.toLowerCase())!==-1))throw new RangeError("".concat(d," encoding label provided ('").concat(h,"') is invalid."));this.encoding=h,this.fatal=!1,this.ignoreBOM=!1}f.prototype.decode=function(h,p){var m;return n(p&&p.stream,"decode","stream"),m=h instanceof Uint8Array?h:h.buffer instanceof ArrayBuffer?new Uint8Array(h.buffer):new Uint8Array(h),l(m,this.encoding)},e.TextEncoder=e.TextEncoder||a,e.TextDecoder=e.TextDecoder||f}(typeof window<"u"?window:vr),function(){function e(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function t(v,y){for(var b=0;b<y.length;b++){var g=y[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}function r(v,y,b){return y&&t(v.prototype,y),b&&t(v,b),v}function n(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),y&&o(v,y)}function i(v){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},i(v)}function o(v,y){return o=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},o(v,y)}function a(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function s(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function c(v,y){return!y||typeof y!="object"&&typeof y!="function"?s(v):y}function l(v){var y=a();return function(){var b,g=i(v);if(y){var w=i(this).constructor;b=Reflect.construct(g,arguments,w)}else b=g.apply(this,arguments);return c(this,b)}}function u(v,y){for(;!Object.prototype.hasOwnProperty.call(v,y)&&(v=i(v))!==null;);return v}function d(v,y,b){return d=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(g,w,x){var E=u(g,w);if(E){var S=Object.getOwnPropertyDescriptor(E,w);return S.get?S.get.call(x):S.value}},d(v,y,b||v)}var f=function(){function v(){e(this,v),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return r(v,[{key:"addEventListener",value:function(y,b,g){y in this.listeners||(this.listeners[y]=[]),this.listeners[y].push({callback:b,options:g})}},{key:"removeEventListener",value:function(y,b){if(y in this.listeners){for(var g=this.listeners[y],w=0,x=g.length;w<x;w++)if(g[w].callback===b)return void g.splice(w,1)}}},{key:"dispatchEvent",value:function(y){if(y.type in this.listeners){for(var b=this.listeners[y.type].slice(),g=0,w=b.length;g<w;g++){var x=b[g];try{x.callback.call(this,y)}catch(E){Promise.resolve().then(function(){throw E})}x.options&&x.options.once&&this.removeEventListener(y.type,x.callback)}return!y.defaultPrevented}}}]),v}(),h=function(v){n(b,v);var y=l(b);function b(){var g;return e(this,b),(g=y.call(this)).listeners||f.call(s(g)),Object.defineProperty(s(g),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(s(g),"onabort",{value:null,writable:!0,configurable:!0}),g}return r(b,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(g){g.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,g)),d(i(b.prototype),"dispatchEvent",this).call(this,g)}}]),b}(f),p=function(){function v(){e(this,v),Object.defineProperty(this,"signal",{value:new h,writable:!0,configurable:!0})}return r(v,[{key:"abort",value:function(){var y;try{y=new Event("abort")}catch{typeof document<"u"?document.createEvent?(y=document.createEvent("Event")).initEvent("abort",!1,!1):(y=document.createEventObject()).type="abort":y={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(y)}},{key:"toString",value:function(){return"[object AbortController]"}}]),v}();function m(v){return v.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof v.Request=="function"&&!v.Request.prototype.hasOwnProperty("signal")||!v.AbortController}typeof Symbol<"u"&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",h.prototype[Symbol.toStringTag]="AbortSignal"),function(v){m(v)&&(v.AbortController=p,v.AbortSignal=h)}(typeof self<"u"?self:vr)}();var _n=Ii(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var i=this;this.locked=new Map,this.addToLocked=function(o,a){var s=i.locked.get(o);s===void 0?a===void 0?i.locked.set(o,[]):i.locked.set(o,[a]):a!==void 0&&(s.unshift(a),i.locked.set(o,s))},this.isLocked=function(o){return i.locked.has(o)},this.lock=function(o){return new Promise(function(a,s){i.isLocked(o)?i.addToLocked(o,a):(i.addToLocked(o),a())})},this.unlock=function(o){var a=i.locked.get(o);if(a!==void 0&&a.length!==0){var s=a.pop();i.locked.set(o,a),s!==void 0&&setTimeout(s,0)}else i.locked.delete(o)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});rh(_n);var R3=Ii(function(e,t){var r=vr&&vr.__awaiter||function(c,l,u,d){return new(u||(u=Promise))(function(f,h){function p(y){try{v(d.next(y))}catch(b){h(b)}}function m(y){try{v(d.throw(y))}catch(b){h(b)}}function v(y){y.done?f(y.value):new u(function(b){b(y.value)}).then(p,m)}v((d=d.apply(c,l||[])).next())})},n=vr&&vr.__generator||function(c,l){var u,d,f,h,p={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return h={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function m(v){return function(y){return function(b){if(u)throw new TypeError("Generator is already executing.");for(;p;)try{if(u=1,d&&(f=2&b[0]?d.return:b[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,b[1])).done)return f;switch(d=0,f&&(b=[2&b[0],f.value]),b[0]){case 0:case 1:f=b;break;case 4:return p.label++,{value:b[1],done:!1};case 5:p.label++,d=b[1],b=[0];continue;case 7:b=p.ops.pop(),p.trys.pop();continue;default:if(f=p.trys,!((f=f.length>0&&f[f.length-1])||b[0]!==6&&b[0]!==2)){p=0;continue}if(b[0]===3&&(!f||b[1]>f[0]&&b[1]<f[3])){p.label=b[1];break}if(b[0]===6&&p.label<f[1]){p.label=f[1],f=b;break}if(f&&p.label<f[2]){p.label=f[2],p.ops.push(b);break}f[2]&&p.ops.pop(),p.trys.pop();continue}b=l.call(c,p)}catch(g){b=[6,g],d=0}finally{u=f=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([v,y])}}};Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key";function o(c){return new Promise(function(l){return setTimeout(l,c)})}function a(c){for(var l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",u="",d=0;d<c;d++)u+=l[Math.floor(Math.random()*l.length)];return u}var s=function(){function c(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+a(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(l,u){return u===void 0&&(u=5e3),r(this,void 0,void 0,function(){var d,f,h,p,m,v;return n(this,function(y){switch(y.label){case 0:d=Date.now()+a(4),f=Date.now()+u,h=i+"-"+l,p=window.localStorage,y.label=1;case 1:return Date.now()<f?[4,o(30)]:[3,8];case 2:return y.sent(),p.getItem(h)!==null?[3,5]:(m=this.id+"-"+l+"-"+d,[4,o(Math.floor(25*Math.random()))]);case 3:return y.sent(),p.setItem(h,JSON.stringify({id:this.id,iat:d,timeoutKey:m,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return y.sent(),(v=p.getItem(h))!==null&&(v=JSON.parse(v)).id===this.id&&v.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(h,d),[2,!0]):[3,7];case 5:return c.lockCorrector(),[4,this.waitForSomethingToChange(f)];case 6:y.sent(),y.label=7;case 7:return d=Date.now()+a(4),[3,1];case 8:return[2,!1]}})})},c.prototype.refreshLockWhileAcquired=function(l,u){return r(this,void 0,void 0,function(){var d=this;return n(this,function(f){return setTimeout(function(){return r(d,void 0,void 0,function(){var h,p;return n(this,function(m){switch(m.label){case 0:return[4,_n.default().lock(u)];case 1:return m.sent(),this.acquiredIatSet.has(u)?(h=window.localStorage,(p=h.getItem(l))===null?(_n.default().unlock(u),[2]):((p=JSON.parse(p)).timeRefreshed=Date.now(),h.setItem(l,JSON.stringify(p)),_n.default().unlock(u),this.refreshLockWhileAcquired(l,u),[2])):(_n.default().unlock(u),[2])}})})},1e3),[2]})})},c.prototype.waitForSomethingToChange=function(l){return r(this,void 0,void 0,function(){return n(this,function(u){switch(u.label){case 0:return[4,new Promise(function(d){var f=!1,h=Date.now(),p=!1;function m(){if(p||(window.removeEventListener("storage",m),c.removeFromWaiting(m),clearTimeout(v),p=!0),!f){f=!0;var y=50-(Date.now()-h);y>0?setTimeout(d,y):d()}}window.addEventListener("storage",m),c.addToWaiting(m);var v=setTimeout(m,Math.max(0,l-Date.now()))})];case 1:return u.sent(),[2]}})})},c.addToWaiting=function(l){this.removeFromWaiting(l),c.waiters!==void 0&&c.waiters.push(l)},c.removeFromWaiting=function(l){c.waiters!==void 0&&(c.waiters=c.waiters.filter(function(u){return u!==l}))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach(function(l){return l()})},c.prototype.releaseLock=function(l){return r(this,void 0,void 0,function(){return n(this,function(u){switch(u.label){case 0:return[4,this.releaseLock__private__(l)];case 1:return[2,u.sent()]}})})},c.prototype.releaseLock__private__=function(l){return r(this,void 0,void 0,function(){var u,d,f;return n(this,function(h){switch(h.label){case 0:return u=window.localStorage,d=i+"-"+l,(f=u.getItem(d))===null?[2]:(f=JSON.parse(f)).id!==this.id?[3,2]:[4,_n.default().lock(f.iat)];case 1:h.sent(),this.acquiredIatSet.delete(f.iat),u.removeItem(d),_n.default().unlock(f.iat),c.notifyWaiters(),h.label=2;case 2:return[2]}})})},c.lockCorrector=function(){for(var l=Date.now()-5e3,u=window.localStorage,d=Object.keys(u),f=!1,h=0;h<d.length;h++){var p=d[h];if(p.includes(i)){var m=u.getItem(p);m!==null&&((m=JSON.parse(m)).timeRefreshed===void 0&&m.timeAcquired<l||m.timeRefreshed!==void 0&&m.timeRefreshed<l)&&(u.removeItem(p),f=!0)}}f&&c.notifyWaiters()},c.waiters=void 0,c}();t.default=s}),F3=rh(R3),L3={timeoutInSeconds:60},M3=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],Vb={name:"auth0-spa-js",version:"1.22.6"},Bb=function(){return Date.now()},Lr=function(e){function t(r,n){var i=e.call(this,n)||this;return i.error=r,i.error_description=n,Object.setPrototypeOf(i,t.prototype),i}return zn(t,e),t.fromPayload=function(r){return new t(r.error,r.error_description)},t}(Error),j3=function(e){function t(r,n,i,o){o===void 0&&(o=null);var a=e.call(this,r,n)||this;return a.state=i,a.appState=o,Object.setPrototypeOf(a,t.prototype),a}return zn(t,e),t}(Lr),Hu=function(e){function t(){var r=e.call(this,"timeout","Timeout")||this;return Object.setPrototypeOf(r,t.prototype),r}return zn(t,e),t}(Lr),z3=function(e){function t(r){var n=e.call(this)||this;return n.popup=r,Object.setPrototypeOf(n,t.prototype),n}return zn(t,e),t}(Hu),U3=function(e){function t(r){var n=e.call(this,"cancelled","Popup closed")||this;return n.popup=r,Object.setPrototypeOf(n,t.prototype),n}return zn(t,e),t}(Lr),V3=function(e){function t(r,n,i){var o=e.call(this,r,n)||this;return o.mfa_token=i,Object.setPrototypeOf(o,t.prototype),o}return zn(t,e),t}(Lr),B3=function(e){function t(r,n){var i=e.call(this,"missing_refresh_token","Missing Refresh Token (audience: '".concat(E0(r,["default"]),"', scope: '").concat(E0(n),"')"))||this;return i.audience=r,i.scope=n,Object.setPrototypeOf(i,t.prototype),i}return zn(t,e),t}(Lr),W3=function(e){return new Promise(function(t,r){var n,i=setInterval(function(){e.popup&&e.popup.closed&&(clearInterval(i),clearTimeout(o),window.removeEventListener("message",n,!1),r(new U3(e.popup)))},1e3),o=setTimeout(function(){clearInterval(i),r(new z3(e.popup)),window.removeEventListener("message",n,!1)},1e3*(e.timeoutInSeconds||60));n=function(a){if(a.data&&a.data.type==="authorization_response"){if(clearTimeout(o),clearInterval(i),window.removeEventListener("message",n,!1),e.popup.close(),a.data.response.error)return r(Lr.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",n)})},$h=function(){return window.crypto||window.msCrypto},Wb=function(){var e=$h();return e.subtle||e.webkitSubtle},Or=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from($h().getRandomValues(new Uint8Array(43))).forEach(function(r){return t+=e[r%e.length]}),t},Gn=function(e){return btoa(e)},Gu=function(e){return Object.keys(e).filter(function(t){return e[t]!==void 0}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},Ec=function(e){return ve(void 0,void 0,void 0,function(){var t;return ye(this,function(r){switch(r.label){case 0:return t=Wb().digest({name:"SHA-256"},new TextEncoder().encode(e)),window.msCrypto?[2,new Promise(function(n,i){t.oncomplete=function(o){n(o.target.result)},t.onerror=function(o){i(o.error)},t.onabort=function(){i("The digest operation was aborted")}})]:[4,t];case 1:return[2,r.sent()]}})})},k0=function(e){return function(t){return decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},Oc=function(e){var t=new Uint8Array(e);return function(r){var n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,function(i){return n[i]})}(window.btoa(String.fromCharCode.apply(String,Cu([],vi(Array.from(t)),!1))))};function E0(e,t){return t===void 0&&(t=[]),e&&!t.includes(e)?e:""}var q3=function(e,t){return ve(void 0,void 0,void 0,function(){var r,n;return ye(this,function(i){switch(i.label){case 0:return[4,(o=e,a=t,a=a||{},new Promise(function(s,c){var l=new XMLHttpRequest,u=[],d=[],f={},h=function(){return{ok:(l.status/100|0)==2,statusText:l.statusText,status:l.status,url:l.responseURL,text:function(){return Promise.resolve(l.responseText)},json:function(){return Promise.resolve(l.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([l.response]))},clone:h,headers:{keys:function(){return u},entries:function(){return d},get:function(m){return f[m.toLowerCase()]},has:function(m){return m.toLowerCase()in f}}}};for(var p in l.open(a.method||"get",o,!0),l.onload=function(){l.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,v,y){u.push(v=v.toLowerCase()),d.push([v,y]),f[v]=f[v]?f[v]+","+y:y}),s(h())},l.onerror=c,l.withCredentials=a.credentials=="include",a.headers)l.setRequestHeader(p,a.headers[p]);l.send(a.body||null)}))];case 1:return r=i.sent(),n={ok:r.ok},[4,r.json()];case 2:return[2,(n.json=i.sent(),n)]}var o,a})})},H3=function(e,t,r){return ve(void 0,void 0,void 0,function(){var n,i;return ye(this,function(o){return n=new AbortController,t.signal=n.signal,[2,Promise.race([q3(e,t),new Promise(function(a,s){i=setTimeout(function(){n.abort(),s(new Error("Timeout when executing 'fetch'"))},r)})]).finally(function(){clearTimeout(i)})]})})},G3=function(e,t,r,n,i,o,a){return ve(void 0,void 0,void 0,function(){return ye(this,function(s){return[2,(c={auth:{audience:t,scope:r},timeout:i,fetchUrl:e,fetchOptions:n,useFormData:a},l=o,new Promise(function(u,d){var f=new MessageChannel;f.port1.onmessage=function(h){h.data.error?d(new Error(h.data.error)):u(h.data),f.port1.close()},l.postMessage(c,[f.port2])}))];var c,l})})},Q3=function(e,t,r,n,i,o,a){return a===void 0&&(a=1e4),ve(void 0,void 0,void 0,function(){return ye(this,function(s){return i?[2,G3(e,t,r,n,a,i,o)]:[2,H3(e,n,a)]})})};function K3(e,t,r,n,i,o,a){return ve(this,void 0,void 0,function(){var s,c,l,u,d,f,h,p,m;return ye(this,function(v){switch(v.label){case 0:s=null,l=0,v.label=1;case 1:if(!(l<3))return[3,6];v.label=2;case 2:return v.trys.push([2,4,,5]),[4,Q3(e,r,n,i,o,a,t)];case 3:return c=v.sent(),s=null,[3,6];case 4:return u=v.sent(),s=u,[3,5];case 5:return l++,[3,1];case 6:if(s)throw s.message=s.message||"Failed to fetch",s;if(d=c.json,f=d.error,h=d.error_description,p=At(d,["error","error_description"]),!c.ok)throw m=h||"HTTP error. Unable to fetch ".concat(e),f==="mfa_required"?new V3(f,m,p.mfa_token):new Lr(f||"request_error",m);return[2,p]}})})}function ia(e,t){var r=e.baseUrl,n=e.timeout,i=e.audience,o=e.scope,a=e.auth0Client,s=e.useFormData,c=At(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);return ve(this,void 0,void 0,function(){var l;return ye(this,function(u){switch(u.label){case 0:return l=s?Gu(c):JSON.stringify(c),[4,K3("".concat(r,"/oauth/token"),n,i||"default",o,{method:"POST",body:l,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||Vb))}},t,s)];case 1:return[2,u.sent()]}})})}var Y3=function(e){return Array.from(new Set(e))},qr=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Y3(e.join(" ").trim().split(/\s+/)).join(" ")},En=function(){function e(t,r){r===void 0&&(r="@@auth0spajs@@"),this.prefix=r,this.client_id=t.client_id,this.scope=t.scope,this.audience=t.audience}return e.prototype.toKey=function(){return"".concat(this.prefix,"::").concat(this.client_id,"::").concat(this.audience,"::").concat(this.scope)},e.fromKey=function(t){var r=vi(t.split("::"),4),n=r[0],i=r[1],o=r[2];return new e({client_id:i,scope:r[3],audience:o},n)},e.fromCacheEntry=function(t){return new e({scope:t.scope,audience:t.audience,client_id:t.client_id})},e}(),X3=function(){function e(){}return e.prototype.set=function(t,r){localStorage.setItem(t,JSON.stringify(r))},e.prototype.get=function(t){var r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}},e.prototype.remove=function(t){localStorage.removeItem(t)},e.prototype.allKeys=function(){return Object.keys(window.localStorage).filter(function(t){return t.startsWith("@@auth0spajs@@")})},e}(),Z3=function(){var e;this.enclosedCache=(e={},{set:function(t,r){e[t]=r},get:function(t){var r=e[t];if(r)return r},remove:function(t){delete e[t]},allKeys:function(){return Object.keys(e)}})},J3=function(){function e(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n,this.nowProvider=this.nowProvider||Bb}return e.prototype.get=function(t,r){var n;return r===void 0&&(r=0),ve(this,void 0,void 0,function(){var i,o,a,s,c;return ye(this,function(l){switch(l.label){case 0:return[4,this.cache.get(t.toKey())];case 1:return(i=l.sent())?[3,4]:[4,this.getCacheKeys()];case 2:return(o=l.sent())?(a=this.matchExistingCacheKey(t,o))?[4,this.cache.get(a)]:[3,4]:[2];case 3:i=l.sent(),l.label=4;case 4:return i?[4,this.nowProvider()]:[2];case 5:return s=l.sent(),c=Math.floor(s/1e3),i.expiresAt-r<c?i.body.refresh_token?(i.body={refresh_token:i.body.refresh_token},[4,this.cache.set(t.toKey(),i)]):[3,7]:[3,10];case 6:return l.sent(),[2,i.body];case 7:return[4,this.cache.remove(t.toKey())];case 8:return l.sent(),[4,(n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey())];case 9:return l.sent(),[2];case 10:return[2,i.body]}})})},e.prototype.set=function(t){var r;return ve(this,void 0,void 0,function(){var n,i;return ye(this,function(o){switch(o.label){case 0:return n=new En({client_id:t.client_id,scope:t.scope,audience:t.audience}),[4,this.wrapCacheEntry(t)];case 1:return i=o.sent(),[4,this.cache.set(n.toKey(),i)];case 2:return o.sent(),[4,(r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey())];case 3:return o.sent(),[2]}})})},e.prototype.clear=function(t){var r;return ve(this,void 0,void 0,function(){var n,i=this;return ye(this,function(o){switch(o.label){case 0:return[4,this.getCacheKeys()];case 1:return(n=o.sent())?[4,n.filter(function(a){return!t||a.includes(t)}).reduce(function(a,s){return ve(i,void 0,void 0,function(){return ye(this,function(c){switch(c.label){case 0:return[4,a];case 1:return c.sent(),[4,this.cache.remove(s)];case 2:return c.sent(),[2]}})})},Promise.resolve())]:[2];case 2:return o.sent(),[4,(r=this.keyManifest)===null||r===void 0?void 0:r.clear()];case 3:return o.sent(),[2]}})})},e.prototype.clearSync=function(t){var r=this,n=this.cache.allKeys();n&&n.filter(function(i){return!t||i.includes(t)}).forEach(function(i){r.cache.remove(i)})},e.prototype.wrapCacheEntry=function(t){return ve(this,void 0,void 0,function(){var r,n,i;return ye(this,function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return r=o.sent(),n=Math.floor(r/1e3)+t.expires_in,i=Math.min(n,t.decodedToken.claims.exp),[2,{body:t,expiresAt:i}]}})})},e.prototype.getCacheKeys=function(){var t;return ve(this,void 0,void 0,function(){var r;return ye(this,function(n){switch(n.label){case 0:return this.keyManifest?[4,this.keyManifest.get()]:[3,2];case 1:return r=(t=n.sent())===null||t===void 0?void 0:t.keys,[3,4];case 2:return[4,this.cache.allKeys()];case 3:r=n.sent(),n.label=4;case 4:return[2,r]}})})},e.prototype.matchExistingCacheKey=function(t,r){return r.filter(function(n){var i=En.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),a=t.scope.split(" "),s=i.scope&&a.reduce(function(c,l){return c&&o.has(l)},!0);return i.prefix==="@@auth0spajs@@"&&i.client_id===t.client_id&&i.audience===t.audience&&s})[0]},e}(),e4=function(){function e(t,r){this.storage=t,this.clientId=r,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId),this.transaction=this.storage.get(this.storageKey)}return e.prototype.create=function(t){this.transaction=t,this.storage.save(this.storageKey,t,{daysUntilExpire:1})},e.prototype.get=function(){return this.transaction},e.prototype.remove=function(){delete this.transaction,this.storage.remove(this.storageKey)},e}(),Ki=function(e){return typeof e=="number"},t4=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],r4=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(s){var c=s.split("."),l=vi(c,3),u=l[0],d=l[1],f=l[2];if(c.length!==3||!u||!d||!f)throw new Error("ID token could not be decoded");var h=JSON.parse(k0(d)),p={__raw:s},m={};return Object.keys(h).forEach(function(v){p[v]=h[v],t4.includes(v)||(m[v]=h[v])}),{encoded:{header:u,payload:d,signature:f},header:JSON.parse(k0(u)),claims:p,user:m}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Ki(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!Ki(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ki(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var r=e.leeway||60,n=new Date(e.now||Date.now()),i=new Date(0),o=new Date(0),a=new Date(0);if(a.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),i.setUTCSeconds(t.claims.exp+r),o.setUTCSeconds(t.claims.nbf-r),n>i)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(n,") is after expiration time (").concat(i,")"));if(Ki(t.claims.nbf)&&n<o)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (".concat(n,") is before ").concat(o));if(Ki(t.claims.auth_time)&&n>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (".concat(n,") is after last auth at ").concat(a));if(e.organizationId){if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e.organizationId!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(e.organizationId,'", found "').concat(t.claims.org_id,'"'))}return t},On=Ii(function(e,t){var r=vr&&vr.__assign||function(){return r=Object.assign||function(c){for(var l,u=1,d=arguments.length;u<d;u++)for(var f in l=arguments[u])Object.prototype.hasOwnProperty.call(l,f)&&(c[f]=l[f]);return c},r.apply(this,arguments)};function n(c,l){if(!l)return"";var u="; "+c;return l===!0?u:u+"="+l}function i(c,l,u){return encodeURIComponent(c).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(d){if(typeof d.expires=="number"){var f=new Date;f.setMilliseconds(f.getMilliseconds()+864e5*d.expires),d.expires=f}return n("Expires",d.expires?d.expires.toUTCString():"")+n("Domain",d.domain)+n("Path",d.path)+n("Secure",d.secure)+n("SameSite",d.sameSite)}(u)}function o(c){for(var l={},u=c?c.split("; "):[],d=/(%[\dA-F]{2})+/gi,f=0;f<u.length;f++){var h=u[f].split("="),p=h.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{l[h[0].replace(d,decodeURIComponent)]=p.replace(d,decodeURIComponent)}catch{}}return l}function a(){return o(document.cookie)}function s(c,l,u){document.cookie=i(c,l,r({path:"/"},u))}t.__esModule=!0,t.encode=i,t.parse=o,t.getAll=a,t.get=function(c){return a()[c]},t.set=s,t.remove=function(c,l){s(c,"",r(r({},l),{expires:-1}))}});rh(On),On.encode,On.parse,On.getAll;var n4=On.get,qb=On.set,Hb=On.remove,Jn={get:function(e){var t=n4(e);if(t!==void 0)return JSON.parse(t)},save:function(e,t,r){var n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),qb(e,JSON.stringify(t),n)},remove:function(e,t){var r={};t?.cookieDomain&&(r.domain=t.cookieDomain),Hb(e,r)}},i4={get:function(e){var t=Jn.get(e);return t||Jn.get("".concat("_legacy_").concat(e))},save:function(e,t,r){var n={};window.location.protocol==="https:"&&(n={secure:!0}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),qb("".concat("_legacy_").concat(e),JSON.stringify(t),n),Jn.save(e,t,r)},remove:function(e,t){var r={};t?.cookieDomain&&(r.domain=t.cookieDomain),Hb(e,r),Jn.remove(e,t),Jn.remove("".concat("_legacy_").concat(e),t)}},o4={get:function(e){if(typeof sessionStorage<"u"){var t=sessionStorage.getItem(e);if(t!==void 0)return JSON.parse(t)}},save:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove:function(e){sessionStorage.removeItem(e)}};function a4(e,t,r){var n=t===void 0?null:t,i=function(c,l){var u=atob(c);if(l){for(var d=new Uint8Array(u.length),f=0,h=u.length;f<h;++f)d[f]=u.charCodeAt(f);return String.fromCharCode.apply(null,new Uint16Array(d.buffer))}return u}(e,r!==void 0&&r),o=i.indexOf(`
2
2
  `,10)+1,a=i.substring(o)+(n?"//# sourceMappingURL="+n:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var O0,C0,P0,Cc,s4=(O0="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9ZnVuY3Rpb24oZSxyKXtyZXR1cm4gdD1PYmplY3Quc2V0UHJvdG90eXBlT2Z8fHtfX3Byb3RvX186W119aW5zdGFuY2VvZiBBcnJheSYmZnVuY3Rpb24odCxlKXt0Ll9fcHJvdG9fXz1lfXx8ZnVuY3Rpb24odCxlKXtmb3IodmFyIHIgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxyKSYmKHRbcl09ZVtyXSl9LHQoZSxyKX07ZnVuY3Rpb24gZShlLHIpe2lmKCJmdW5jdGlvbiIhPXR5cGVvZiByJiZudWxsIT09cil0aHJvdyBuZXcgVHlwZUVycm9yKCJDbGFzcyBleHRlbmRzIHZhbHVlICIrU3RyaW5nKHIpKyIgaXMgbm90IGEgY29uc3RydWN0b3Igb3IgbnVsbCIpO2Z1bmN0aW9uIG4oKXt0aGlzLmNvbnN0cnVjdG9yPWV9dChlLHIpLGUucHJvdG90eXBlPW51bGw9PT1yP09iamVjdC5jcmVhdGUocik6KG4ucHJvdG90eXBlPXIucHJvdG90eXBlLG5ldyBuKX12YXIgcj1mdW5jdGlvbigpe3JldHVybiByPU9iamVjdC5hc3NpZ258fGZ1bmN0aW9uKHQpe2Zvcih2YXIgZSxyPTEsbj1hcmd1bWVudHMubGVuZ3RoO3I8bjtyKyspZm9yKHZhciBvIGluIGU9YXJndW1lbnRzW3JdKU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChlLG8pJiYodFtvXT1lW29dKTtyZXR1cm4gdH0sci5hcHBseSh0aGlzLGFyZ3VtZW50cyl9O2Z1bmN0aW9uIG4odCxlLHIsbil7cmV0dXJuIG5ldyhyfHwocj1Qcm9taXNlKSkoKGZ1bmN0aW9uKG8sYyl7ZnVuY3Rpb24gaSh0KXt0cnl7cyhuLm5leHQodCkpfWNhdGNoKHQpe2ModCl9fWZ1bmN0aW9uIGEodCl7dHJ5e3Mobi50aHJvdyh0KSl9Y2F0Y2godCl7Yyh0KX19ZnVuY3Rpb24gcyh0KXt2YXIgZTt0LmRvbmU/byh0LnZhbHVlKTooZT10LnZhbHVlLGUgaW5zdGFuY2VvZiByP2U6bmV3IHIoKGZ1bmN0aW9uKHQpe3QoZSl9KSkpLnRoZW4oaSxhKX1zKChuPW4uYXBwbHkodCxlfHxbXSkpLm5leHQoKSl9KSl9ZnVuY3Rpb24gbyh0LGUpe3ZhciByLG4sbyxjLGk9e2xhYmVsOjAsc2VudDpmdW5jdGlvbigpe2lmKDEmb1swXSl0aHJvdyBvWzFdO3JldHVybiBvWzFdfSx0cnlzOltdLG9wczpbXX07cmV0dXJuIGM9e25leHQ6YSgwKSx0aHJvdzphKDEpLHJldHVybjphKDIpfSwiZnVuY3Rpb24iPT10eXBlb2YgU3ltYm9sJiYoY1tTeW1ib2wuaXRlcmF0b3JdPWZ1bmN0aW9uKCl7cmV0dXJuIHRoaXN9KSxjO2Z1bmN0aW9uIGEoYyl7cmV0dXJuIGZ1bmN0aW9uKGEpe3JldHVybiBmdW5jdGlvbihjKXtpZihyKXRocm93IG5ldyBUeXBlRXJyb3IoIkdlbmVyYXRvciBpcyBhbHJlYWR5IGV4ZWN1dGluZy4iKTtmb3IoO2k7KXRyeXtpZihyPTEsbiYmKG89MiZjWzBdP24ucmV0dXJuOmNbMF0/bi50aHJvd3x8KChvPW4ucmV0dXJuKSYmby5jYWxsKG4pLDApOm4ubmV4dCkmJiEobz1vLmNhbGwobixjWzFdKSkuZG9uZSlyZXR1cm4gbztzd2l0Y2gobj0wLG8mJihjPVsyJmNbMF0sby52YWx1ZV0pLGNbMF0pe2Nhc2UgMDpjYXNlIDE6bz1jO2JyZWFrO2Nhc2UgNDpyZXR1cm4gaS5sYWJlbCsrLHt2YWx1ZTpjWzFdLGRvbmU6ITF9O2Nhc2UgNTppLmxhYmVsKyssbj1jWzFdLGM9WzBdO2NvbnRpbnVlO2Nhc2UgNzpjPWkub3BzLnBvcCgpLGkudHJ5cy5wb3AoKTtjb250aW51ZTtkZWZhdWx0OmlmKCEobz1pLnRyeXMsKG89by5sZW5ndGg+MCYmb1tvLmxlbmd0aC0xXSl8fDYhPT1jWzBdJiYyIT09Y1swXSkpe2k9MDtjb250aW51ZX1pZigzPT09Y1swXSYmKCFvfHxjWzFdPm9bMF0mJmNbMV08b1szXSkpe2kubGFiZWw9Y1sxXTticmVha31pZig2PT09Y1swXSYmaS5sYWJlbDxvWzFdKXtpLmxhYmVsPW9bMV0sbz1jO2JyZWFrfWlmKG8mJmkubGFiZWw8b1syXSl7aS5sYWJlbD1vWzJdLGkub3BzLnB1c2goYyk7YnJlYWt9b1syXSYmaS5vcHMucG9wKCksaS50cnlzLnBvcCgpO2NvbnRpbnVlfWM9ZS5jYWxsKHQsaSl9Y2F0Y2godCl7Yz1bNix0XSxuPTB9ZmluYWxseXtyPW89MH1pZig1JmNbMF0pdGhyb3cgY1sxXTtyZXR1cm57dmFsdWU6Y1swXT9jWzFdOnZvaWQgMCxkb25lOiEwfX0oW2MsYV0pfX19ZnVuY3Rpb24gYyh0LGUpe3JldHVybiB2b2lkIDA9PT1lJiYoZT1bXSksdCYmIWUuaW5jbHVkZXModCk/dDoiIn12YXIgaT1mdW5jdGlvbih0KXtmdW5jdGlvbiByKGUsbil7dmFyIG89dC5jYWxsKHRoaXMsbil8fHRoaXM7cmV0dXJuIG8uZXJyb3I9ZSxvLmVycm9yX2Rlc2NyaXB0aW9uPW4sT2JqZWN0LnNldFByb3RvdHlwZU9mKG8sci5wcm90b3R5cGUpLG99cmV0dXJuIGUocix0KSxyLmZyb21QYXlsb2FkPWZ1bmN0aW9uKHQpe3JldHVybiBuZXcgcih0LmVycm9yLHQuZXJyb3JfZGVzY3JpcHRpb24pfSxyfShFcnJvcik7IWZ1bmN0aW9uKHQpe2Z1bmN0aW9uIHIoZSxuLG8sYyl7dm9pZCAwPT09YyYmKGM9bnVsbCk7dmFyIGk9dC5jYWxsKHRoaXMsZSxuKXx8dGhpcztyZXR1cm4gaS5zdGF0ZT1vLGkuYXBwU3RhdGU9YyxPYmplY3Quc2V0UHJvdG90eXBlT2YoaSxyLnByb3RvdHlwZSksaX1lKHIsdCl9KGkpLGZ1bmN0aW9uKHQpe2Z1bmN0aW9uIHIoZSl7dmFyIG49dC5jYWxsKHRoaXMpfHx0aGlzO3JldHVybiBuLnBvcHVwPWUsT2JqZWN0LnNldFByb3RvdHlwZU9mKG4sci5wcm90b3R5cGUpLG59ZShyLHQpfShmdW5jdGlvbih0KXtmdW5jdGlvbiByKCl7dmFyIGU9dC5jYWxsKHRoaXMsInRpbWVvdXQiLCJUaW1lb3V0Iil8fHRoaXM7cmV0dXJuIE9iamVjdC5zZXRQcm90b3R5cGVPZihlLHIucHJvdG90eXBlKSxlfXJldHVybiBlKHIsdCkscn0oaSkpLGZ1bmN0aW9uKHQpe2Z1bmN0aW9uIHIoZSl7dmFyIG49dC5jYWxsKHRoaXMsImNhbmNlbGxlZCIsIlBvcHVwIGNsb3NlZCIpfHx0aGlzO3JldHVybiBuLnBvcHVwPWUsT2JqZWN0LnNldFByb3RvdHlwZU9mKG4sci5wcm90b3R5cGUpLG59ZShyLHQpfShpKSxmdW5jdGlvbih0KXtmdW5jdGlvbiByKGUsbixvKXt2YXIgYz10LmNhbGwodGhpcyxlLG4pfHx0aGlzO3JldHVybiBjLm1mYV90b2tlbj1vLE9iamVjdC5zZXRQcm90b3R5cGVPZihjLHIucHJvdG90eXBlKSxjfWUocix0KX0oaSk7dmFyIGE9ZnVuY3Rpb24odCl7ZnVuY3Rpb24gcihlLG4pe3ZhciBvPXQuY2FsbCh0aGlzLCJtaXNzaW5nX3JlZnJlc2hfdG9rZW4iLCJNaXNzaW5nIFJlZnJlc2ggVG9rZW4gKGF1ZGllbmNlOiAnIi5jb25jYXQoYyhlLFsiZGVmYXVsdCJdKSwiJywgc2NvcGU6ICciKS5jb25jYXQoYyhuKSwiJykiKSl8fHRoaXM7cmV0dXJuIG8uYXVkaWVuY2U9ZSxvLnNjb3BlPW4sT2JqZWN0LnNldFByb3RvdHlwZU9mKG8sci5wcm90b3R5cGUpLG99cmV0dXJuIGUocix0KSxyfShpKSxzPXt9LHU9ZnVuY3Rpb24odCxlKXtyZXR1cm4iIi5jb25jYXQodCwifCIpLmNvbmNhdChlKX07YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGZ1bmN0aW9uKHQpe3ZhciBlPXQuZGF0YSxjPWUudGltZW91dCxpPWUuYXV0aCxmPWUuZmV0Y2hVcmwsbD1lLmZldGNoT3B0aW9ucyxwPWUudXNlRm9ybURhdGEsaD1mdW5jdGlvbih0LGUpe3ZhciByPSJmdW5jdGlvbiI9PXR5cGVvZiBTeW1ib2wmJnRbU3ltYm9sLml0ZXJhdG9yXTtpZighcilyZXR1cm4gdDt2YXIgbixvLGM9ci5jYWxsKHQpLGk9W107dHJ5e2Zvcig7KHZvaWQgMD09PWV8fGUtLSA+MCkmJiEobj1jLm5leHQoKSkuZG9uZTspaS5wdXNoKG4udmFsdWUpfWNhdGNoKHQpe289e2Vycm9yOnR9fWZpbmFsbHl7dHJ5e24mJiFuLmRvbmUmJihyPWMucmV0dXJuKSYmci5jYWxsKGMpfWZpbmFsbHl7aWYobyl0aHJvdyBvLmVycm9yfX1yZXR1cm4gaX0odC5wb3J0cywxKVswXTtyZXR1cm4gbih2b2lkIDAsdm9pZCAwLHZvaWQgMCwoZnVuY3Rpb24oKXt2YXIgdCxlLG4seSx2LGIsZCx3LE8sXztyZXR1cm4gbyh0aGlzLChmdW5jdGlvbihvKXtzd2l0Y2goby5sYWJlbCl7Y2FzZSAwOm49KGU9aXx8e30pLmF1ZGllbmNlLHk9ZS5zY29wZSxvLmxhYmVsPTE7Y2FzZSAxOmlmKG8udHJ5cy5wdXNoKFsxLDcsLDhdKSwhKHY9cD8obT1sLmJvZHksaz1uZXcgVVJMU2VhcmNoUGFyYW1zKG0pLFA9e30say5mb3JFYWNoKChmdW5jdGlvbih0LGUpe1BbZV09dH0pKSxQKTpKU09OLnBhcnNlKGwuYm9keSkpLnJlZnJlc2hfdG9rZW4mJiJyZWZyZXNoX3Rva2VuIj09PXYuZ3JhbnRfdHlwZSl7aWYoYj1mdW5jdGlvbih0LGUpe3JldHVybiBzW3UodCxlKV19KG4seSksIWIpdGhyb3cgbmV3IGEobix5KTtsLmJvZHk9cD9uZXcgVVJMU2VhcmNoUGFyYW1zKHIocih7fSx2KSx7cmVmcmVzaF90b2tlbjpifSkpLnRvU3RyaW5nKCk6SlNPTi5zdHJpbmdpZnkocihyKHt9LHYpLHtyZWZyZXNoX3Rva2VuOmJ9KSl9ZD12b2lkIDAsImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGQ9bmV3IEFib3J0Q29udHJvbGxlcixsLnNpZ25hbD1kLnNpZ25hbCksdz12b2lkIDAsby5sYWJlbD0yO2Nhc2UgMjpyZXR1cm4gby50cnlzLnB1c2goWzIsNCwsNV0pLFs0LFByb21pc2UucmFjZShbKGc9YyxuZXcgUHJvbWlzZSgoZnVuY3Rpb24odCl7cmV0dXJuIHNldFRpbWVvdXQodCxnKX0pKSksZmV0Y2goZixyKHt9LGwpKV0pXTtjYXNlIDM6cmV0dXJuIHc9by5zZW50KCksWzMsNV07Y2FzZSA0OnJldHVybiBPPW8uc2VudCgpLGgucG9zdE1lc3NhZ2Uoe2Vycm9yOk8ubWVzc2FnZX0pLFsyXTtjYXNlIDU6cmV0dXJuIHc/WzQsdy5qc29uKCldOihkJiZkLmFib3J0KCksaC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KSxbMl0pO2Nhc2UgNjpyZXR1cm4odD1vLnNlbnQoKSkucmVmcmVzaF90b2tlbj8oZnVuY3Rpb24odCxlLHIpe3NbdShlLHIpXT10fSh0LnJlZnJlc2hfdG9rZW4sbix5KSxkZWxldGUgdC5yZWZyZXNoX3Rva2VuKTpmdW5jdGlvbih0LGUpe2RlbGV0ZSBzW3UodCxlKV19KG4seSksaC5wb3N0TWVzc2FnZSh7b2s6dy5vayxqc29uOnR9KSxbMyw4XTtjYXNlIDc6cmV0dXJuIF89by5zZW50KCksaC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3JfZGVzY3JpcHRpb246Xy5tZXNzYWdlfX0pLFszLDhdO2Nhc2UgODpyZXR1cm5bMl19dmFyIGcsbSxrLFB9KSl9KSl9KSl9KCk7Cgo=",C0=null,P0=!1,function(e){return Cc=Cc||a4(O0,C0,P0),new Worker(Cc,e)}),Pc={},l4=function(){function e(t,r){this.cache=t,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}return e.prototype.add=function(t){var r;return ve(this,void 0,void 0,function(){var n,i;return ye(this,function(o){switch(o.label){case 0:return i=Set.bind,[4,this.cache.get(this.manifestKey)];case 1:return(n=new(i.apply(Set,[void 0,((r=o.sent())===null||r===void 0?void 0:r.keys)||[]]))).add(t),[4,this.cache.set(this.manifestKey,{keys:Cu([],vi(n),!1)})];case 2:return o.sent(),[2]}})})},e.prototype.remove=function(t){return ve(this,void 0,void 0,function(){var r,n;return ye(this,function(i){switch(i.label){case 0:return[4,this.cache.get(this.manifestKey)];case 1:return(r=i.sent())?((n=new Set(r.keys)).delete(t),n.size>0?[4,this.cache.set(this.manifestKey,{keys:Cu([],vi(n),!1)})]:[3,3]):[3,5];case 2:case 4:return[2,i.sent()];case 3:return[4,this.cache.remove(this.manifestKey)];case 5:return[2]}})})},e.prototype.get=function(){return this.cache.get(this.manifestKey)},e.prototype.clear=function(){return this.cache.remove(this.manifestKey)},e.prototype.createManifestKeyFrom=function(t){return"".concat("@@auth0spajs@@","::").concat(t)},e}(),Tc=new F3,c4={memory:function(){return new Z3().enclosedCache},localstorage:function(){return new X3}},T0=function(e){return c4[e]},u4=function(){return!/Trident.*rv:11\.0/.test(navigator.userAgent)},d4=function(){function e(t){var r,n,i,o,a=this;if(this.options=t,this._releaseLockOnPageHide=function(){return ve(a,void 0,void 0,function(){return ye(this,function(l){switch(l.label){case 0:return[4,Tc.releaseLock("auth0.lock.getTokenSilently")];case 1:return l.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[2]}})})},typeof window<"u"&&function(){if(!$h())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Wb()===void 0)throw new Error(`
3
3
  auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
4
4
  `)}(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)i=t.cache;else{if(this.cacheLocation=t.cacheLocation||"memory",!T0(this.cacheLocation))throw new Error('Invalid cache location "'.concat(this.cacheLocation,'"'));i=T0(this.cacheLocation)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Jn:i4,this.orgHintCookieName=(o=this.options.client_id,"auth0.".concat(o,".organization_hint")),this.isAuthenticatedCookieName=function(l){return"auth0.".concat(l,".is.authenticated")}(this.options.client_id),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;var s,c=t.useCookiesForTransactions?this.cookieStorage:o4;this.scope=this.options.scope,this.transactionManager=new e4(c,this.options.client_id),this.nowProvider=this.options.nowProvider||Bb,this.cacheManager=new J3(i,i.allKeys?null:new l4(i,this.options.client_id),this.nowProvider),this.domainUrl=(s=this.options.domain,/^https?:\/\//.test(s)?s:"https://".concat(s)),this.tokenIssuer=function(l,u){return l?l.startsWith("https://")?l:"https://".concat(l,"/"):"".concat(u,"/")}(this.options.issuer,this.domainUrl),this.defaultScope=qr("openid",((n=(r=this.options)===null||r===void 0?void 0:r.advancedOptions)===null||n===void 0?void 0:n.defaultScope)!==void 0?this.options.advancedOptions.defaultScope:"openid profile email"),this.options.useRefreshTokens&&(this.scope=qr(this.scope,"offline_access")),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&this.cacheLocation==="memory"&&u4()&&(this.worker=new s4),this.customOptions=function(l){return l.advancedOptions,l.audience,l.auth0Client,l.authorizeTimeoutInSeconds,l.cacheLocation,l.cache,l.client_id,l.domain,l.issuer,l.leeway,l.max_age,l.nowProvider,l.redirect_uri,l.scope,l.useRefreshTokens,l.useRefreshTokensFallback,l.useCookiesForTransactions,l.useFormData,At(l,["advancedOptions","audience","auth0Client","authorizeTimeoutInSeconds","cacheLocation","cache","client_id","domain","issuer","leeway","max_age","nowProvider","redirect_uri","scope","useRefreshTokens","useRefreshTokensFallback","useCookiesForTransactions","useFormData"])}(t),this.useRefreshTokensFallback=this.options.useRefreshTokensFallback!==!1}return e.prototype._url=function(t){var r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Vb)));return"".concat(this.domainUrl).concat(t,"&auth0Client=").concat(r)},e.prototype._getParams=function(t,r,n,i,o){var a=this.options;a.useRefreshTokens,a.useCookiesForTransactions,a.useFormData,a.auth0Client,a.cacheLocation,a.advancedOptions,a.detailedResponse,a.nowProvider,a.authorizeTimeoutInSeconds,a.legacySameSiteCookie,a.sessionCheckExpiryDays,a.domain,a.leeway,a.httpTimeoutInSeconds;var s=At(a,["useRefreshTokens","useCookiesForTransactions","useFormData","auth0Client","cacheLocation","advancedOptions","detailedResponse","nowProvider","authorizeTimeoutInSeconds","legacySameSiteCookie","sessionCheckExpiryDays","domain","leeway","httpTimeoutInSeconds"]);return se(se(se({},s),t),{scope:qr(this.defaultScope,this.scope,t.scope),response_type:"code",response_mode:"query",state:r,nonce:n,redirect_uri:o||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(t){return this._url("/authorize?".concat(Gu(t)))},e.prototype._verifyIdToken=function(t,r,n){return ve(this,void 0,void 0,function(){var i;return ye(this,function(o){switch(o.label){case 0:return[4,this.nowProvider()];case 1:return i=o.sent(),[2,r4({iss:this.tokenIssuer,aud:this.options.client_id,id_token:t,nonce:r,organizationId:n,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age),now:i})]}})})},e.prototype._parseNumber=function(t){return typeof t!="string"?t:parseInt(t,10)||void 0},e.prototype._processOrgIdHint=function(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})},e.prototype.buildAuthorizeUrl=function(t){return t===void 0&&(t={}),ve(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l,u,d,f,h;return ye(this,function(p){switch(p.label){case 0:return r=t.redirect_uri,n=t.appState,i=At(t,["redirect_uri","appState"]),o=Gn(Or()),a=Gn(Or()),s=Or(),[4,Ec(s)];case 1:return c=p.sent(),l=Oc(c),u=t.fragment?"#".concat(t.fragment):"",d=this._getParams(i,o,a,l,r),f=this._authorizeUrl(d),h=t.organization||this.options.organization,this.transactionManager.create(se({nonce:a,code_verifier:s,appState:n,scope:d.scope,audience:d.audience||"default",redirect_uri:d.redirect_uri,state:o},h&&{organizationId:h})),[2,f+u]}})})},e.prototype.loginWithPopup=function(t,r){return ve(this,void 0,void 0,function(){var n,i,o,a,s,c,l,u,d,f,h,p,m;return ye(this,function(v){switch(v.label){case 0:if(t=t||{},!(r=r||{}).popup&&(r.popup=function(y){var b=window.screenX+(window.innerWidth-400)/2,g=window.screenY+(window.innerHeight-600)/2;return window.open(y,"auth0:authorize:popup","left=".concat(b,",top=").concat(g,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))}(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");return n=At(t,[]),i=Gn(Or()),o=Gn(Or()),a=Or(),[4,Ec(a)];case 1:return s=v.sent(),c=Oc(s),l=this._getParams(n,i,o,c,this.options.redirect_uri||window.location.origin),u=this._authorizeUrl(se(se({},l),{response_mode:"web_message"})),r.popup.location.href=u,[4,W3(se(se({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(d=v.sent(),i!==d.state)throw new Error("Invalid state");return[4,ia({audience:l.audience,scope:l.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:a,code:d.code,grant_type:"authorization_code",redirect_uri:l.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},this.worker)];case 3:return f=v.sent(),h=t.organization||this.options.organization,[4,this._verifyIdToken(f.id_token,o,h)];case 4:return p=v.sent(),m=se(se({},f),{decodedToken:p,scope:l.scope,audience:l.audience||"default",client_id:this.options.client_id}),[4,this.cacheManager.set(m)];case 5:return v.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(p.claims.org_id),[2]}})})},e.prototype.getUser=function(t){return t===void 0&&(t={}),ve(this,void 0,void 0,function(){var r,n,i;return ye(this,function(o){switch(o.label){case 0:return r=t.audience||this.options.audience||"default",n=qr(this.defaultScope,this.scope,t.scope),[4,this.cacheManager.get(new En({client_id:this.options.client_id,audience:r,scope:n}))];case 1:return[2,(i=o.sent())&&i.decodedToken&&i.decodedToken.user]}})})},e.prototype.getIdTokenClaims=function(t){return t===void 0&&(t={}),ve(this,void 0,void 0,function(){var r,n,i;return ye(this,function(o){switch(o.label){case 0:return r=t.audience||this.options.audience||"default",n=qr(this.defaultScope,this.scope,t.scope),[4,this.cacheManager.get(new En({client_id:this.options.client_id,audience:r,scope:n}))];case 1:return[2,(i=o.sent())&&i.decodedToken&&i.decodedToken.claims]}})})},e.prototype.loginWithRedirect=function(t){return t===void 0&&(t={}),ve(this,void 0,void 0,function(){var r,n,i;return ye(this,function(o){switch(o.label){case 0:return r=t.redirectMethod,n=At(t,["redirectMethod"]),[4,this.buildAuthorizeUrl(n)];case 1:return i=o.sent(),window.location[r||"assign"](i),[2]}})})},e.prototype.handleRedirectCallback=function(t){return t===void 0&&(t=window.location.href),ve(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l,u,d;return ye(this,function(f){switch(f.label){case 0:if((r=t.split("?").slice(1)).length===0)throw new Error("There are no query params available for parsing.");if(n=function(h){h.indexOf("#")>-1&&(h=h.substr(0,h.indexOf("#")));var p=h.split("&"),m={};return p.forEach(function(v){var y=vi(v.split("="),2),b=y[0],g=y[1];m[b]=decodeURIComponent(g)}),m.expires_in&&(m.expires_in=parseInt(m.expires_in)),m}(r.join("")),i=n.state,o=n.code,a=n.error,s=n.error_description,!(c=this.transactionManager.get()))throw new Error("Invalid state");if(this.transactionManager.remove(),a)throw new j3(a,s,i,c.appState);if(!c.code_verifier||c.state&&c.state!==i)throw new Error("Invalid state");return l={audience:c.audience,scope:c.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:c.code_verifier,grant_type:"authorization_code",code:o,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},c.redirect_uri!==void 0&&(l.redirect_uri=c.redirect_uri),[4,ia(l,this.worker)];case 1:return u=f.sent(),[4,this._verifyIdToken(u.id_token,c.nonce,c.organizationId)];case 2:return d=f.sent(),[4,this.cacheManager.set(se(se(se(se({},u),{decodedToken:d,audience:c.audience,scope:c.scope}),u.scope?{oauthTokenScope:u.scope}:null),{client_id:this.options.client_id}))];case 3:return f.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgIdHint(d.claims.org_id),[2,{appState:c.appState}]}})})},e.prototype.checkSession=function(t){return ve(this,void 0,void 0,function(){var r;return ye(this,function(n){switch(n.label){case 0:if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return[2];this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getTokenSilently(t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),!M3.includes(r.error))throw r;return[3,4];case 4:return[2]}})})},e.prototype.getTokenSilently=function(t){return t===void 0&&(t={}),ve(this,void 0,void 0,function(){var r,n,i,o,a=this;return ye(this,function(s){switch(s.label){case 0:return r=se(se({audience:this.options.audience,ignoreCache:!1},t),{scope:qr(this.defaultScope,this.scope,t.scope)}),n=r.ignoreCache,i=At(r,["ignoreCache"]),[4,(c=function(){return a._getTokenSilently(se({ignoreCache:n},i))},l="".concat(this.options.client_id,"::").concat(i.audience,"::").concat(i.scope),u=Pc[l],u||(u=c().finally(function(){delete Pc[l],u=null}),Pc[l]=u),u)];case 1:return o=s.sent(),[2,t.detailedResponse?o:o.access_token]}var c,l,u})})},e.prototype._getTokenSilently=function(t){return t===void 0&&(t={}),ve(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l,u;return ye(this,function(d){switch(d.label){case 0:return r=t.ignoreCache,n=At(t,["ignoreCache"]),r?[3,2]:[4,this._getEntryFromCache({scope:n.scope,audience:n.audience||"default",client_id:this.options.client_id})];case 1:if(i=d.sent())return[2,i];d.label=2;case 2:return[4,(f=function(){return Tc.acquireLock("auth0.lock.getTokenSilently",5e3)},h=10,h===void 0&&(h=3),ve(void 0,void 0,void 0,function(){var p;return ye(this,function(m){switch(m.label){case 0:p=0,m.label=1;case 1:return p<h?[4,f()]:[3,4];case 2:if(m.sent())return[2,!0];m.label=3;case 3:return p++,[3,1];case 4:return[2,!1]}})}))];case 3:if(!d.sent())return[3,15];d.label=4;case 4:return d.trys.push([4,,12,14]),window.addEventListener("pagehide",this._releaseLockOnPageHide),r?[3,6]:[4,this._getEntryFromCache({scope:n.scope,audience:n.audience||"default",client_id:this.options.client_id})];case 5:if(i=d.sent())return[2,i];d.label=6;case 6:return this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(n)]:[3,8];case 7:return a=d.sent(),[3,10];case 8:return[4,this._getTokenFromIFrame(n)];case 9:a=d.sent(),d.label=10;case 10:return o=a,[4,this.cacheManager.set(se({client_id:this.options.client_id},o))];case 11:return d.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),s=o.id_token,c=o.access_token,l=o.oauthTokenScope,u=o.expires_in,[2,se(se({id_token:s,access_token:c},l?{scope:l}:null),{expires_in:u})];case 12:return[4,Tc.releaseLock("auth0.lock.getTokenSilently")];case 13:return d.sent(),window.removeEventListener("pagehide",this._releaseLockOnPageHide),[7];case 14:return[3,16];case 15:throw new Hu;case 16:return[2]}var f,h})})},e.prototype.getTokenWithPopup=function(t,r){return t===void 0&&(t={}),r===void 0&&(r={}),ve(this,void 0,void 0,function(){return ye(this,function(n){switch(n.label){case 0:return t.audience=t.audience||this.options.audience,t.scope=qr(this.defaultScope,this.scope,t.scope),r=se(se({},L3),r),[4,this.loginWithPopup(t,r)];case 1:return n.sent(),[4,this.cacheManager.get(new En({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id}))];case 2:return[2,n.sent().access_token]}})})},e.prototype.isAuthenticated=function(){return ve(this,void 0,void 0,function(){return ye(this,function(t){switch(t.label){case 0:return[4,this.getUser()];case 1:return[2,!!t.sent()]}})})},e.prototype.buildLogoutUrl=function(t){t===void 0&&(t={}),t.client_id!==null?t.client_id=t.client_id||this.options.client_id:delete t.client_id;var r=t.federated,n=At(t,["federated"]),i=r?"&federated":"";return this._url("/v2/logout?".concat(Gu(n)))+i},e.prototype.logout=function(t){var r=this;t===void 0&&(t={});var n=t.localOnly,i=At(t,["localOnly"]);if(n&&i.federated)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");var o=function(){if(r.cookieStorage.remove(r.orgHintCookieName,{cookieDomain:r.options.cookieDomain}),r.cookieStorage.remove(r.isAuthenticatedCookieName,{cookieDomain:r.options.cookieDomain}),!n){var a=r.buildLogoutUrl(i);window.location.assign(a)}};if(this.options.cache)return this.cacheManager.clear().then(function(){return o()});this.cacheManager.clearSync(),o()},e.prototype._getTokenFromIFrame=function(t){return ve(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l,u,d,f,h,p,m,v,y,b;return ye(this,function(g){switch(g.label){case 0:return r=Gn(Or()),n=Gn(Or()),i=Or(),[4,Ec(i)];case 1:o=g.sent(),a=Oc(o),s=At(t,["detailedResponse"]),c=this._getParams(s,r,n,a,t.redirect_uri||this.options.redirect_uri||window.location.origin),(l=this.cookieStorage.get(this.orgHintCookieName))&&!c.organization&&(c.organization=l),u=this._authorizeUrl(se(se({},c),{prompt:"none",response_mode:"web_message"})),g.label=2;case 2:if(g.trys.push([2,6,,7]),window.crossOriginIsolated)throw new Lr("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");return d=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,(w=u,x=this.domainUrl,E=d,E===void 0&&(E=60),new Promise(function(S,T){var M=window.document.createElement("iframe");M.setAttribute("width","0"),M.setAttribute("height","0"),M.style.display="none";var F,K=function(){window.document.body.contains(M)&&(window.document.body.removeChild(M),window.removeEventListener("message",F,!1))},D=setTimeout(function(){T(new Hu),K()},1e3*E);F=function(R){if(R.origin==x&&R.data&&R.data.type==="authorization_response"){var U=R.source;U&&U.close(),R.data.response.error?T(Lr.fromPayload(R.data.response)):S(R.data.response),clearTimeout(D),window.removeEventListener("message",F,!1),setTimeout(K,2e3)}},window.addEventListener("message",F,!1),window.document.body.appendChild(M),M.setAttribute("src",w)}))];case 3:if(f=g.sent(),r!==f.state)throw new Error("Invalid state");return h=t.scope,p=t.audience,m=At(t,["scope","audience","redirect_uri","ignoreCache","timeoutInSeconds","detailedResponse"]),[4,ia(se(se(se({},this.customOptions),m),{scope:h,audience:p,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:i,code:f.code,grant_type:"authorization_code",redirect_uri:c.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:m.timeout||this.httpTimeoutMs}),this.worker)];case 4:return v=g.sent(),[4,this._verifyIdToken(v.id_token,n)];case 5:return y=g.sent(),this._processOrgIdHint(y.claims.org_id),[2,se(se({},v),{decodedToken:y,scope:c.scope,oauthTokenScope:v.scope,audience:c.audience||"default"})];case 6:throw(b=g.sent()).error==="login_required"&&this.logout({localOnly:!0}),b;case 7:return[2]}var w,x,E})})},e.prototype._getTokenUsingRefreshToken=function(t){return ve(this,void 0,void 0,function(){var r,n,i,o,a,s,c,l,u;return ye(this,function(d){switch(d.label){case 0:return t.scope=qr(this.defaultScope,this.options.scope,t.scope),[4,this.cacheManager.get(new En({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id}))];case 1:return(r=d.sent())&&r.refresh_token||this.worker?[3,4]:this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(t)]:[3,3];case 2:return[2,d.sent()];case 3:throw new B3(t.audience||"default",t.scope);case 4:n=t.redirect_uri||this.options.redirect_uri||window.location.origin,o=t.scope,a=t.audience,s=At(t,["scope","audience","ignoreCache","timeoutInSeconds","detailedResponse"]),c=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,d.label=5;case 5:return d.trys.push([5,7,,10]),[4,ia(se(se(se(se(se({},this.customOptions),s),{audience:a,scope:o,baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),c&&{timeout:c}),{auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs}),this.worker)];case 6:return i=d.sent(),[3,10];case 7:return((l=d.sent()).message.indexOf("Missing Refresh Token")>-1||l.message&&l.message.indexOf("invalid refresh token")>-1)&&this.useRefreshTokensFallback?[4,this._getTokenFromIFrame(t)]:[3,9];case 8:return[2,d.sent()];case 9:throw l;case 10:return[4,this._verifyIdToken(i.id_token)];case 11:return u=d.sent(),[2,se(se({},i),{decodedToken:u,scope:t.scope,oauthTokenScope:i.scope,audience:t.audience||"default"})]}})})},e.prototype._getEntryFromCache=function(t){var r=t.scope,n=t.audience,i=t.client_id;return ve(this,void 0,void 0,function(){var o,a,s,c,l;return ye(this,function(u){switch(u.label){case 0:return[4,this.cacheManager.get(new En({scope:r,audience:n,client_id:i}),60)];case 1:return(o=u.sent())&&o.access_token?(a=o.id_token,s=o.access_token,c=o.oauthTokenScope,l=o.expires_in,[2,se(se({id_token:a,access_token:s},c?{scope:c}:null),{expires_in:l})]):[2]}})})},e}(),Nc="Invariant Violation",N0=Object.setPrototypeOf,f4=N0===void 0?function(e,t){return e.__proto__=t,e}:N0,$e=function(e){lr(t,e);function t(r){r===void 0&&(r=Nc);var n=e.call(this,typeof r=="number"?Nc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Nc,f4(n,t.prototype),n}return t}(Error);function B(e,t){if(!e)throw new $e(t)}var Gb=["debug","log","warn","error","silent"],h4=Gb.indexOf("log");function oa(e){return function(){if(Gb.indexOf(e)>=h4){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=oa("debug"),e.log=oa("log"),e.warn=oa("warn"),e.error=oa("error")})(B||(B={}));function qt(e){try{return e()}catch{}}const I0=qt(function(){return globalThis})||qt(function(){return window})||qt(function(){return self})||qt(function(){return global})||qt(function(){return qt.constructor("return this")()});var A0="__",D0=[A0,A0].join("DEV");function p4(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(I0,D0,{value:qt(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),I0[D0]}}const Ic=p4();function Yr(e){try{return e()}catch{}}var Qu=Yr(function(){return globalThis})||Yr(function(){return window})||Yr(function(){return self})||Yr(function(){return global})||Yr(function(){return Yr.constructor("return this")()}),Ku=!1;function m4(){Qu&&!Yr(function(){return"production"})&&!Yr(function(){return process})&&(Object.defineProperty(Qu,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Ku=!0)}m4();function R0(){Ku&&(delete Qu.process,Ku=!1)}function ka(e,t){if(!Boolean(e))throw new Error(t)}function v4(e){return typeof e=="object"&&e!==null}function y4(e,t){if(!Boolean(e))throw new Error(t??"Unexpected invariant triggered.")}const g4=/\r\n|[\n\r]/g;function Yu(e,t){let r=0,n=1;for(const i of e.body.matchAll(g4)){if(typeof i.index=="number"||y4(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function b4(e){return Qb(e.source,Yu(e.source,e.start))}function Qb(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=t.line===1?r:0,c=t.column+s,l=`${e.name}:${a}:${c}
@@ -13,30 +13,30 @@
13
13
  `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ct(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function F4(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,o=t+3,a=o,s="";const c=[];for(;o<n;){const l=r.charCodeAt(o);if(l===34&&r.charCodeAt(o+1)===34&&r.charCodeAt(o+2)===34){s+=r.slice(a,o),c.push(s);const u=Je(e,N.BLOCK_STRING,t,o+3,S4(c).join(`
14
14
  `));return e.line+=c.length-1,e.lineStart=i,u}if(l===92&&r.charCodeAt(o+1)===34&&r.charCodeAt(o+2)===34&&r.charCodeAt(o+3)===34){s+=r.slice(a,o),a=o+1,o+=4;continue}if(l===10||l===13){s+=r.slice(a,o),c.push(s),l===13&&r.charCodeAt(o+1)===10?o+=2:++o,s="",a=o,i=o;continue}if(Mi(l))++o;else if(Bl(r,o))o+=2;else throw ct(e.source,o,`Invalid character within String: ${Fn(e,o)}.`)}throw ct(e.source,o,"Unterminated string.")}function L4(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const o=r.charCodeAt(i);if(x4(o))++i;else break}return Je(e,N.NAME,t,i,r.slice(t,i))}const M4=10,t1=2;function r1(e){return Wl(e,[])}function Wl(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return j4(e,t);default:return String(e)}}function j4(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(z4(e)){const n=e.toJSON();if(n!==e)return typeof n=="string"?n:Wl(n,r)}else if(Array.isArray(e))return V4(e,r);return U4(e,r)}function z4(e){return typeof e.toJSON=="function"}function U4(e,t){const r=Object.entries(e);return r.length===0?"{}":t.length>t1?"["+B4(e)+"]":"{ "+r.map(([i,o])=>i+": "+Wl(o,t)).join(", ")+" }"}function V4(e,t){if(e.length===0)return"[]";if(t.length>t1)return"[Array]";const r=Math.min(M4,e.length),n=e.length-r,i=[];for(let o=0;o<r;++o)i.push(Wl(e[o],t));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function B4(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}const W4=function(t,r){return t instanceof r};class _h{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||ka(!1,`Body must be a string. Received: ${r1(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ka(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ka(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function q4(e){return W4(e,_h)}function H4(e,t){return new G4(e,t).parseDocument()}class G4{constructor(t,r={}){const n=q4(t)?t:new _h(t);this._lexer=new O4(n),this._options=r,this._tokenCounter=0}parseName(){const t=this.expectToken(N.NAME);return this.node(t,{kind:Z.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:Z.DOCUMENT,definitions:this.many(N.SOF,this.parseDefinition,N.EOF)})}parseDefinition(){if(this.peek(N.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===N.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw ct(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(N.BRACE_L))return this.node(t,{kind:Z.OPERATION_DEFINITION,operation:oi.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let n;return this.peek(N.NAME)&&(n=this.parseName()),this.node(t,{kind:Z.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(N.NAME);switch(t.value){case"query":return oi.QUERY;case"mutation":return oi.MUTATION;case"subscription":return oi.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(N.PAREN_L,this.parseVariableDefinition,N.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Z.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(N.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(N.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(N.DOLLAR),this.node(t,{kind:Z.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Z.SELECTION_SET,selections:this.many(N.BRACE_L,this.parseSelection,N.BRACE_R)})}parseSelection(){return this.peek(N.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(N.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:Z.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(N.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(N.PAREN_L,r,N.PAREN_R)}parseArgument(t=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(N.COLON),this.node(r,{kind:Z.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(N.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(N.NAME)?this.node(t,{kind:Z.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:Z.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:Z.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:Z.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const r=this._lexer.token;switch(r.kind){case N.BRACKET_L:return this.parseList(t);case N.BRACE_L:return this.parseObject(t);case N.INT:return this.advanceLexer(),this.node(r,{kind:Z.INT,value:r.value});case N.FLOAT:return this.advanceLexer(),this.node(r,{kind:Z.FLOAT,value:r.value});case N.STRING:case N.BLOCK_STRING:return this.parseStringLiteral();case N.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:Z.BOOLEAN,value:!0});case"false":return this.node(r,{kind:Z.BOOLEAN,value:!1});case"null":return this.node(r,{kind:Z.NULL});default:return this.node(r,{kind:Z.ENUM,value:r.value})}case N.DOLLAR:if(t)if(this.expectToken(N.DOLLAR),this._lexer.token.kind===N.NAME){const n=this._lexer.token.value;throw ct(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:Z.STRING,value:t.value,block:t.kind===N.BLOCK_STRING})}parseList(t){const r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:Z.LIST,values:this.any(N.BRACKET_L,r,N.BRACKET_R)})}parseObject(t){const r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:Z.OBJECT,fields:this.any(N.BRACE_L,r,N.BRACE_R)})}parseObjectField(t){const r=this._lexer.token,n=this.parseName();return this.expectToken(N.COLON),this.node(r,{kind:Z.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const r=[];for(;this.peek(N.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const r=this._lexer.token;return this.expectToken(N.AT),this.node(r,{kind:Z.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let r;if(this.expectOptionalToken(N.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(N.BRACKET_R),r=this.node(t,{kind:Z.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(N.BANG)?this.node(t,{kind:Z.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:Z.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(N.STRING)||this.peek(N.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(N.BRACE_L,this.parseOperationTypeDefinition,N.BRACE_R);return this.node(t,{kind:Z.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,r=this.parseOperationType();this.expectToken(N.COLON);const n=this.parseNamedType();return this.node(t,{kind:Z.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:Z.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:Z.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(N.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(N.BRACE_L,this.parseFieldDefinition,N.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(N.COLON);const o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:Z.FIELD_DEFINITION,description:r,name:n,arguments:i,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(N.PAREN_L,this.parseInputValueDef,N.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(N.COLON);const i=this.parseTypeReference();let o;this.expectOptionalToken(N.EQUALS)&&(o=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(t,{kind:Z.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:Z.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:o,fields:a})}parseUnionTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:Z.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(N.EQUALS)?this.delimitedMany(N.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:Z.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:o})}parseEnumValuesDefinition(){return this.optionalMany(N.BRACE_L,this.parseEnumValueDefinition,N.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:Z.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ct(this._lexer.source,this._lexer.token.start,`${aa(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:Z.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(N.BRACE_L,this.parseInputValueDef,N.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===N.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(N.BRACE_L,this.parseOperationTypeDefinition,N.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:Z.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:Z.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:Z.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:o})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:Z.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:o})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Z.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Z.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Z.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(N.AT);const n=this.parseName(),i=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const a=this.parseDirectiveLocations();return this.node(t,{kind:Z.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(N.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(Xu,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new w4(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){const r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw ct(this._lexer.source,r.start,`Expected ${n1(t)}, found ${aa(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const r=this._lexer.token;if(r.kind===N.NAME&&r.value===t)this.advanceLexer();else throw ct(this._lexer.source,r.start,`Expected "${t}", found ${aa(r)}.`)}expectOptionalKeyword(t){const r=this._lexer.token;return r.kind===N.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const r=t??this._lexer.token;return ct(this._lexer.source,r.start,`Unexpected ${aa(r)}.`)}any(t,r,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){const{maxTokens:t}=this._options,r=this._lexer.advance();if(t!==void 0&&r.kind!==N.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw ct(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function aa(e){const t=e.value;return n1(e.kind)+(t!=null?` "${t}"`:"")}function n1(e){return C4(e)?`"${e}"`:e}function Q4(e){return`"${e.replace(K4,Y4)}"`}const K4=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Y4(e){return X4[e.charCodeAt(0)]}const X4=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],xh=Object.freeze({});function ar(e,t,r=Yb){const n=new Map;for(const y of Object.values(Z))n.set(y,Z4(t,y));let i,o=Array.isArray(e),a=[e],s=-1,c=[],l=e,u,d;const f=[],h=[];do{s++;const y=s===a.length,b=y&&c.length!==0;if(y){if(u=h.length===0?void 0:f[f.length-1],l=d,d=h.pop(),b)if(o){l=l.slice();let w=0;for(const[x,E]of c){const S=x-w;E===null?(l.splice(S,1),w++):l[S]=E}}else{l=Object.defineProperties({},Object.getOwnPropertyDescriptors(l));for(const[w,x]of c)l[w]=x}s=i.index,a=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(d){if(u=o?s:a[s],l=d[u],l==null)continue;f.push(u)}let g;if(!Array.isArray(l)){var p,m;M0(l)||ka(!1,`Invalid AST Node: ${r1(l)}.`);const w=y?(p=n.get(l.kind))===null||p===void 0?void 0:p.leave:(m=n.get(l.kind))===null||m===void 0?void 0:m.enter;if(g=w?.call(t,l,u,d,f,h),g===xh)break;if(g===!1){if(!y){f.pop();continue}}else if(g!==void 0&&(c.push([u,g]),!y))if(M0(g))l=g;else{f.pop();continue}}if(g===void 0&&b&&c.push([u,l]),y)f.pop();else{var v;i={inArray:o,index:s,keys:a,edits:c,prev:i},o=Array.isArray(l),a=o?l:(v=r[l.kind])!==null&&v!==void 0?v:[],s=-1,c=[],d&&h.push(d),d=l}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function Z4(e,t){const r=e[t];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function J4(e){return ar(e,t5)}const e5=80,t5={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>q(e.definitions,`
15
15
 
16
- `)},OperationDefinition:{leave(e){const t=he("(",q(e.variableDefinitions,", "),")"),r=q([e.operation,q([e.name,t]),q(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+he(" = ",r)+he(" ",q(n," "))},SelectionSet:{leave:({selections:e})=>Jt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=he("",e,": ")+t;let a=o+he("(",q(r,", "),")");return a.length>e5&&(a=o+he(`(
16
+ `)},OperationDefinition:{leave(e){const t=pe("(",q(e.variableDefinitions,", "),")"),r=q([e.operation,q([e.name,t]),q(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+pe(" = ",r)+pe(" ",q(n," "))},SelectionSet:{leave:({selections:e})=>Jt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=pe("",e,": ")+t;let a=o+pe("(",q(r,", "),")");return a.length>e5&&(a=o+pe(`(
17
17
  `,Ea(q(r,`
18
18
  `)),`
19
- )`)),q([a,q(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+he(" ",q(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>q(["...",he("on ",e),q(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${he("(",q(r,", "),")")} on ${t} ${he("",q(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?E4(e):Q4(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+q(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+q(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+he("(",q(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>he("",e,`
20
- `)+q(["schema",q(t," "),Jt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>he("",e,`
21
- `)+q(["scalar",t,q(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>he("",e,`
22
- `)+q(["type",t,he("implements ",q(r," & ")),q(n," "),Jt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>he("",e,`
23
- `)+t+(z0(r)?he(`(
19
+ )`)),q([a,q(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+pe(" ",q(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>q(["...",pe("on ",e),q(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${pe("(",q(r,", "),")")} on ${t} ${pe("",q(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?E4(e):Q4(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+q(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+q(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+pe("(",q(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>pe("",e,`
20
+ `)+q(["schema",q(t," "),Jt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>pe("",e,`
21
+ `)+q(["scalar",t,q(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>pe("",e,`
22
+ `)+q(["type",t,pe("implements ",q(r," & ")),q(n," "),Jt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>pe("",e,`
23
+ `)+t+(z0(r)?pe(`(
24
24
  `,Ea(q(r,`
25
25
  `)),`
26
- )`):he("(",q(r,", "),")"))+": "+n+he(" ",q(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>he("",e,`
27
- `)+q([t+": "+r,he("= ",n),q(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>he("",e,`
28
- `)+q(["interface",t,he("implements ",q(r," & ")),q(n," "),Jt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>he("",e,`
29
- `)+q(["union",t,q(r," "),he("= ",q(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>he("",e,`
30
- `)+q(["enum",t,q(r," "),Jt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>he("",e,`
31
- `)+q([t,q(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>he("",e,`
32
- `)+q(["input",t,q(r," "),Jt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>he("",e,`
33
- `)+"directive @"+t+(z0(r)?he(`(
26
+ )`):pe("(",q(r,", "),")"))+": "+n+pe(" ",q(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>pe("",e,`
27
+ `)+q([t+": "+r,pe("= ",n),q(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>pe("",e,`
28
+ `)+q(["interface",t,pe("implements ",q(r," & ")),q(n," "),Jt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>pe("",e,`
29
+ `)+q(["union",t,q(r," "),pe("= ",q(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>pe("",e,`
30
+ `)+q(["enum",t,q(r," "),Jt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>pe("",e,`
31
+ `)+q([t,q(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>pe("",e,`
32
+ `)+q(["input",t,q(r," "),Jt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>pe("",e,`
33
+ `)+"directive @"+t+(z0(r)?pe(`(
34
34
  `,Ea(q(r,`
35
35
  `)),`
36
- )`):he("(",q(r,", "),")"))+(n?" repeatable":"")+" on "+q(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>q(["extend schema",q(e," "),Jt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>q(["extend scalar",e,q(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>q(["extend type",e,he("implements ",q(t," & ")),q(r," "),Jt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>q(["extend interface",e,he("implements ",q(t," & ")),q(r," "),Jt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>q(["extend union",e,q(t," "),he("= ",q(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>q(["extend enum",e,q(t," "),Jt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>q(["extend input",e,q(t," "),Jt(r)]," ")}};function q(e,t=""){var r;return(r=e?.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function Jt(e){return he(`{
36
+ )`):pe("(",q(r,", "),")"))+(n?" repeatable":"")+" on "+q(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>q(["extend schema",q(e," "),Jt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>q(["extend scalar",e,q(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>q(["extend type",e,pe("implements ",q(t," & ")),q(r," "),Jt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>q(["extend interface",e,pe("implements ",q(t," & ")),q(r," "),Jt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>q(["extend union",e,q(t," "),pe("= ",q(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>q(["extend enum",e,q(t," "),Jt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>q(["extend input",e,q(t," "),Jt(r)]," ")}};function q(e,t=""){var r;return(r=e?.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function Jt(e){return pe(`{
37
37
  `,Ea(q(e,`
38
38
  `)),`
39
- }`)}function he(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function Ea(e){return he(" ",e.replace(/\n/g,`
39
+ }`)}function pe(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function Ea(e){return pe(" ",e.replace(/\n/g,`
40
40
  `))}function z0(e){var t;return(t=e?.some(r=>r.includes(`
41
41
  `)))!==null&&t!==void 0?t:!1}function U0(e){return e.kind===Z.FIELD||e.kind===Z.FRAGMENT_SPREAD||e.kind===Z.INLINE_FRAGMENT}function r5(){return R0()}function n5(){__DEV__?B(typeof Ic=="boolean",Ic):B(typeof Ic=="boolean",39)}r5();n5();function ql(e,t){var r=e.directives;return!r||!r.length?!0:a5(r).every(function(n){var i=n.directive,o=n.ifArgument,a=!1;return o.value.kind==="Variable"?(a=t&&t[o.value.name.value],__DEV__?B(a!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):B(a!==void 0,40)):a=o.value.value,i.name.value==="skip"?!a:a})}function Sh(e,t,r){var n=new Set(e),i=n.size;return ar(t,{Directive:function(o){if(n.delete(o.name.value)&&(!r||!n.size))return xh}}),r?!n.size:n.size<i}function i5(e){return e&&Sh(["client","export"],e,!0)}function o5(e){var t=e.name.value;return t==="skip"||t==="include"}function a5(e){var t=[];return e&&e.length&&e.forEach(function(r){if(!!o5(r)){var n=r.arguments,i=r.name.value;__DEV__?B(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):B(n&&n.length===1,41);var o=n[0];__DEV__?B(o.name&&o.name.value==="if","Invalid argument for the @".concat(i," directive.")):B(o.name&&o.name.value==="if",42);var a=o.value;__DEV__?B(a&&(a.kind==="Variable"||a.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):B(a&&(a.kind==="Variable"||a.kind==="BooleanValue"),43),t.push({directive:r,ifArgument:o})}}),t}function s5(e,t){var r=t,n=[];e.definitions.forEach(function(o){if(o.kind==="OperationDefinition")throw __DEV__?new $e("Found a ".concat(o.operation," operation").concat(o.name?" named '".concat(o.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new $e(44);o.kind==="FragmentDefinition"&&n.push(o)}),typeof r>"u"&&(__DEV__?B(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):B(n.length===1,45),r=n[0].name.value);var i=C(C({},e),{definitions:xs([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)});return i}function kh(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function Eh(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return __DEV__?B(n,"No fragment named ".concat(r)):B(n,46),n||null}default:return null}}function We(e){return e!==null&&typeof e=="object"}function ui(e){return{__ref:String(e)}}function ke(e){return Boolean(e&&typeof e=="object"&&typeof e.__ref=="string")}function l5(e){return We(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function c5(e){return e.kind==="StringValue"}function u5(e){return e.kind==="BooleanValue"}function d5(e){return e.kind==="IntValue"}function f5(e){return e.kind==="FloatValue"}function h5(e){return e.kind==="Variable"}function p5(e){return e.kind==="ObjectValue"}function m5(e){return e.kind==="ListValue"}function v5(e){return e.kind==="EnumValue"}function y5(e){return e.kind==="NullValue"}function wi(e,t,r,n){if(d5(r)||f5(r))e[t.value]=Number(r.value);else if(u5(r)||c5(r))e[t.value]=r.value;else if(p5(r)){var i={};r.fields.map(function(a){return wi(i,a.name,a.value,n)}),e[t.value]=i}else if(h5(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(m5(r))e[t.value]=r.values.map(function(a){var s={};return wi(s,t,a,n),s[t.value]});else if(v5(r))e[t.value]=r.value;else if(y5(r))e[t.value]=null;else throw __DEV__?new $e('The inline argument "'.concat(t.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new $e(55)}function g5(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(o){var a=o.name,s=o.value;return wi(r[i.name.value],a,s,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(i){var o=i.name,a=i.value;return wi(n,o,a,t)})),Oh(e.name.value,n,r)}var b5=["connection","include","skip","client","rest","export"],Oh=Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(Yi(i),")")}else return r.connection.key;var o=e;if(t){var a=Yi(t);o+="(".concat(a,")")}return r&&Object.keys(r).forEach(function(s){b5.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?o+="@".concat(s,"(").concat(Yi(r[s]),")"):o+="@".concat(s))}),o},{setStringify:function(e){var t=Yi;return Yi=e,t}}),Yi=function(t){return JSON.stringify(t,$5)};function $5(e,t){return We(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce(function(r,n){return r[n]=t[n],r},{})),t}function Hl(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,o=n.value;return wi(r,i,o,t)}),r}return null}function Ln(e){return e.alias?e.alias.value:e.name.value}function Ju(e,t,r){if(typeof e.__typename=="string")return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var o=i[n];if(Mr(o)){if(o.name.value==="__typename")return e[Ln(o)]}else{var a=Ju(e,Eh(o,r).selectionSet,r);if(typeof a=="string")return a}}}function Mr(e){return e.kind==="Field"}function i1(e){return e.kind==="InlineFragment"}function Gl(e){__DEV__?B(e&&e.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):B(e&&e.kind==="Document",47);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new $e('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new $e(48);return r});return __DEV__?B(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):B(t.length<=1,49),e}function Vo(e){return Gl(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function ed(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&t.name}).map(function(t){return t.name.value})[0]||null}function Ch(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function o1(e){var t=Vo(e);return __DEV__?B(t&&t.operation==="query","Must contain a query definition."):B(t&&t.operation==="query",50),t}function w5(e){__DEV__?B(e.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):B(e.kind==="Document",51),__DEV__?B(e.definitions.length<=1,"Fragment must have exactly one definition."):B(e.definitions.length<=1,52);var t=e.definitions[0];return __DEV__?B(t.kind==="FragmentDefinition","Must be a fragment definition."):B(t.kind==="FragmentDefinition",53),t}function Ph(e){Gl(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var o=i.operation;if(o==="query"||o==="mutation"||o==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw __DEV__?new $e("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new $e(54)}function Th(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&wi(t,n.variable.name,n.defaultValue)}),t}function V0(e,t,r){var n=0;return e.forEach(function(i,o){t.call(this,i,o,e)&&(e[n++]=i)},r),e.length=n,e}var B0={kind:"Field",name:{kind:"Name",value:"__typename"}};function a1(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind==="FragmentSpread"&&a1(t[r.name.value],t)})}function Nh(e){return a1(Vo(e)||w5(e),kh(Ch(e)))?null:e}function W0(e){return function(r){return e.some(function(n){return n.name&&n.name===r.name.value||n.test&&n.test(r)})}}function s1(e,t){var r=Object.create(null),n=[],i=Object.create(null),o=[],a=Nh(ar(t,{Variable:{enter:function(s,c,l){l.kind!=="VariableDefinition"&&(r[s.name.value]=!0)}},Field:{enter:function(s){if(e&&s.directives){var c=e.some(function(l){return l.remove});if(c&&s.directives&&s.directives.some(W0(e)))return s.arguments&&s.arguments.forEach(function(l){l.value.kind==="Variable"&&n.push({name:l.value.name.value})}),s.selectionSet&&l1(s.selectionSet).forEach(function(l){o.push({name:l.name.value})}),null}}},FragmentSpread:{enter:function(s){i[s.name.value]=!0}},Directive:{enter:function(s){if(W0(e)(s))return null}}}));return a&&V0(n,function(s){return!!s.name&&!r[s.name]}).length&&(a=k5(n,a)),a&&V0(o,function(s){return!!s.name&&!i[s.name]}).length&&(a=E5(o,a)),a}var Ih=Object.assign(function(e){return ar(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind==="OperationDefinition")){var i=t.selections;if(!!i){var o=i.some(function(s){return Mr(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!o){var a=n;if(!(Mr(a)&&a.directives&&a.directives.some(function(s){return s.name.value==="export"})))return C(C({},t),{selections:xs(xs([],i,!0),[B0],!1)})}}}}}})},{added:function(e){return e===B0}}),_5={test:function(e){var t=e.name.value==="connection";return t&&(!e.arguments||!e.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&B.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),t}};function x5(e){return s1([_5],Gl(e))}function S5(e){return function(r){return e.some(function(n){return r.value&&r.value.kind==="Variable"&&r.value.name&&(n.name===r.value.name.value||n.test&&n.test(r))})}}function k5(e,t){var r=S5(e);return Nh(ar(t,{OperationDefinition:{enter:function(n){return C(C({},n),{variableDefinitions:n.variableDefinitions?n.variableDefinitions.filter(function(i){return!e.some(function(o){return o.name===i.variable.name.value})}):[]})}},Field:{enter:function(n){var i=e.some(function(a){return a.remove});if(i){var o=0;if(n.arguments&&n.arguments.forEach(function(a){r(a)&&(o+=1)}),o===1)return null}}},Argument:{enter:function(n){if(r(n))return null}}}))}function E5(e,t){function r(n){if(e.some(function(i){return i.name===n.name.value}))return null}return Nh(ar(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}function l1(e){var t=[];return e.selections.forEach(function(r){(Mr(r)||i1(r))&&r.selectionSet?l1(r.selectionSet).forEach(function(n){return t.push(n)}):r.kind==="FragmentSpread"&&t.push(r)}),t}function O5(e){var t=Ph(e),r=t.operation;if(r==="query")return e;var n=ar(e,{OperationDefinition:{enter:function(i){return C(C({},i),{operation:"query"})}}});return n}function C5(e){Gl(e);var t=s1([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t&&(t=ar(t,{FragmentDefinition:{enter:function(r){if(r.selectionSet){var n=r.selectionSet.selections.every(function(i){return Mr(i)&&i.name.value==="__typename"});if(n)return null}}}})),t}var P5=Object.prototype.hasOwnProperty;function q0(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ah(e)}function Ah(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new cn,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var T5=function(e,t,r){return this.merge(e[r],t[r])},cn=function(){function e(t){t===void 0&&(t=T5),this.reconciler=t,this.isObject=We,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return We(r)&&We(t)?(Object.keys(r).forEach(function(a){if(P5.call(t,a)){var s=t[a];if(r[a]!==s){var c=n.reconciler.apply(n,xs([t,r,a],i,!1));c!==s&&(t=n.shallowCopyForMerge(t),t[a]=c)}}else t=n.shallowCopyForMerge(t),t[a]=r[a]}),t):r},e.prototype.shallowCopyForMerge=function(t){return We(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=C({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function N5(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=I5(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
42
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I5(e,t){if(!!e){if(typeof e=="string")return H0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H0(e,t)}}function H0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function G0(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Dh(e,t,r){return t&&G0(e.prototype,t),r&&G0(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Rh=function(){return typeof Symbol=="function"},Fh=function(e){return Rh()&&Boolean(Symbol[e])},Lh=function(e){return Fh(e)?Symbol[e]:"@@"+e};Rh()&&!Fh("observable")&&(Symbol.observable=Symbol("observable"));var A5=Lh("iterator"),td=Lh("observable"),c1=Lh("species");function As(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Xi(e){var t=e.constructor;return t!==void 0&&(t=t[c1],t===null&&(t=void 0)),t!==void 0?t:Pe}function D5(e){return e instanceof Pe}function _i(e){_i.log?_i.log(e):setTimeout(function(){throw e})}function Oa(e){Promise.resolve().then(function(){try{e()}catch(t){_i(t)}})}function u1(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=As(t,"unsubscribe");r&&r.call(t)}}catch(n){_i(n)}}function rd(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function R5(e){var t=e._queue;if(!!t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(d1(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function d1(e,t,r){e._state="running";var n=e._observer;try{var i=As(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(rd(e),i)i.call(n,r);else throw r;break;case"complete":rd(e),i&&i.call(n);break}}catch(o){_i(o)}e._state==="closed"?u1(e):e._state==="running"&&(e._state="ready")}function Dc(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],Oa(function(){return R5(e)});return}d1(e,t,r)}}var F5=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new L5(this);try{this._cleanup=n.call(void 0,i)}catch(o){i.error(o)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(rd(this),u1(this))},Dh(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),L5=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){Dc(this._subscription,"next",n)},t.error=function(n){Dc(this._subscription,"error",n)},t.complete=function(){Dc(this._subscription,"complete")},Dh(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),Pe=function(){function e(r){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new F5(n,this._subscriber)},t.forEach=function(n){var i=this;return new Promise(function(o,a){if(typeof n!="function"){a(new TypeError(n+" is not a function"));return}function s(){c.unsubscribe(),o()}var c=i.subscribe({next:function(l){try{n(l,s)}catch(u){a(u),c.unsubscribe()}},error:a,complete:o})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=Xi(this);return new o(function(a){return i.subscribe({next:function(s){try{s=n(s)}catch(c){return a.error(c)}a.next(s)},error:function(s){a.error(s)},complete:function(){a.complete()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=Xi(this);return new o(function(a){return i.subscribe({next:function(s){try{if(!n(s))return}catch(c){return a.error(c)}a.next(s)},error:function(s){a.error(s)},complete:function(){a.complete()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=Xi(this),a=arguments.length>1,s=!1,c=arguments[1],l=c;return new o(function(u){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||a)try{l=n(l,d)}catch(h){return u.error(h)}else l=d},error:function(d){u.error(d)},complete:function(){if(!s&&!a)return u.error(new TypeError("Cannot reduce an empty sequence"));u.next(l),u.complete()}})})},t.concat=function(){for(var n=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=Xi(this);return new s(function(c){var l,u=0;function d(f){l=f.subscribe({next:function(h){c.next(h)},error:function(h){c.error(h)},complete:function(){u===o.length?(l=void 0,c.complete()):d(s.from(o[u++]))}})}return d(n),function(){l&&(l.unsubscribe(),l=void 0)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var o=Xi(this);return new o(function(a){var s=[],c=i.subscribe({next:function(u){if(n)try{u=n(u)}catch(f){return a.error(f)}var d=o.from(u).subscribe({next:function(f){a.next(f)},error:function(f){a.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),l()}});s.push(d)},error:function(u){a.error(u)},complete:function(){l()}});function l(){c.closed&&s.length===0&&a.complete()}return function(){s.forEach(function(u){return u.unsubscribe()}),c.unsubscribe()}})},t[td]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var o=As(n,td);if(o){var a=o.call(n);if(Object(a)!==a)throw new TypeError(a+" is not an object");return D5(a)&&a.constructor===i?a:new i(function(s){return a.subscribe(s)})}if(Fh("iterator")&&(o=As(n,A5),o))return new i(function(s){Oa(function(){if(!s.closed){for(var c=N5(o.call(n)),l;!(l=c()).done;){var u=l.value;if(s.next(u),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Oa(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=typeof this=="function"?this:e;return new a(function(s){Oa(function(){if(!s.closed){for(var c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Dh(e,null,[{key:c1,get:function(){return this}}]),e}();Rh()&&Object.defineProperty(Pe,Symbol("extensions"),{value:{symbol:td,hostReportError:_i},configurable:!0});function M5(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var ei;typeof self<"u"?ei=self:typeof window<"u"?ei=window:typeof global<"u"?ei=global:typeof module<"u"?ei=module:ei=Function("return this")();M5(ei);var Q0=Pe.prototype,K0="@@observable";Q0[K0]||(Q0[K0]=function(){return this});var j5=Object.prototype.toString;function f1(e){return nd(e)}function nd(e,t){switch(j5.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,o){r[o]=nd(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=nd(e[i],t)}),n}default:return e}}function z5(e){var t=new Set([e]);return t.forEach(function(r){We(r)&&U5(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){We(r[n])&&t.add(r[n])})}),e}function U5(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function id(e){return __DEV__&&z5(e),e}function po(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function Rc(e,t,r){return new Pe(function(n){var i=n.next,o=n.error,a=n.complete,s=0,c=!1,l={then:function(h){return new Promise(function(p){return p(h())})}};function u(h,p){return h?function(m){++s;var v=function(){return h(m)};l=l.then(v,v).then(function(y){--s,i&&i.call(n,y),c&&d.complete()},function(y){throw--s,y}).catch(function(y){o&&o.call(n,y)})}:function(m){return p&&p.call(n,m)}}var d={next:u(t,i),error:u(r,o),complete:function(){c=!0,s||a&&a.call(n)}},f=e.subscribe(d);return function(){return f.unsubscribe()}})}var Vn=typeof WeakMap=="function"&&qt(function(){return navigator.product})!=="ReactNative",V5=typeof WeakSet=="function",h1=typeof Symbol=="function"&&typeof Symbol.for=="function",Ql=h1&&Symbol.asyncIterator;qt(function(){return window.document.createElement});qt(function(){return navigator.userAgent.indexOf("jsdom")>=0});function p1(e){function t(r){Object.defineProperty(e,r,{value:Pe})}return h1&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Y0(e){return e&&typeof e.then=="function"}var uo=function(e){lr(t,e);function t(r){var n=e.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,o){n.resolve=i,n.reject=o}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),po(n.observers,"next",i))},error:function(i){var o=n.sub;o!==null&&(o&&setTimeout(function(){return o.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),po(n.observers,"error",i))},complete:function(){var i=n.sub;if(i!==null){var o=n.sources.shift();o?Y0(o)?o.then(function(a){return n.sub=a.subscribe(n.handlers)}):n.sub=o.subscribe(n.handlers):(i&&setTimeout(function(){return i.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),po(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new Pe(r)]),Y0(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(o){return o(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,o){n||(n=!0,r(i,o))})},t}(Pe);p1(uo);function Yt(e){return Array.isArray(e)&&e.length>0}function di(e){return"incremental"in e}function B5(e){return"hasNext"in e&&"data"in e}function W5(e){return di(e)||B5(e)}function m1(e,t){var r=e,n=new cn;return di(t)&&Yt(t.incremental)&&t.incremental.forEach(function(i){for(var o=i.data,a=i.path,s=a.length-1;s>=0;--s){var c=a[s],l=!isNaN(+c),u=l?[]:{};u[c]=o,o=u}r=n.merge(r,o)}),r}function Ca(e){var t=od(e);return Yt(t)}function od(e){var t=Yt(e.errors)?e.errors.slice(0):[];return di(e)&&Yt(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function Kl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){!n||Object.keys(n).forEach(function(i){var o=n[i];o!==void 0&&(r[i]=o)})}),r}var X0=new Map;function ad(e){var t=X0.get(e)||1;return X0.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function q5(e){var t=ad("stringifyForDisplay");return JSON.stringify(e,function(r,n){return n===void 0?t:n}).split(JSON.stringify(t)).join("<undefined>")}function Fc(e,t){return Kl(e,t,t.variables&&{variables:C(C({},e&&e.variables),t.variables)})}function Z0(e){return new Pe(function(t){t.error(e)})}var sd=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function H5(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw __DEV__?new $e("illegal argument: ".concat(i)):new $e(27)}return e}function G5(e,t){var r=C({},e),n=function(o){typeof o=="function"?r=C(C({},r),o(r)):r=C(C({},r),o)},i=function(){return C({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function Q5(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?ed(t.query)||void 0:""),t}function J0(e,t){return t?t(e):Pe.of()}function Zi(e){return typeof e=="function"?new ji(e):e}function sa(e){return e.request.length<=1}var K5=function(e){lr(t,e);function t(r,n){var i=e.call(this,r)||this;return i.link=n,i}return t}(Error),ji=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return Pe.of()})},e.from=function(t){return t.length===0?e.empty():t.map(Zi).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=Zi(r),o=Zi(n||new e(J0));return sa(i)&&sa(o)?new e(function(a){return t(a)?i.request(a)||Pe.of():o.request(a)||Pe.of()}):new e(function(a,s){return t(a)?i.request(a,s)||Pe.of():o.request(a,s)||Pe.of()})},e.execute=function(t,r){return t.request(G5(r.context,Q5(H5(r))))||Pe.of()},e.concat=function(t,r){var n=Zi(t);if(sa(n))return __DEV__&&B.warn(new K5("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Zi(r);return sa(i)?new e(function(o){return n.request(o,function(a){return i.request(a)||Pe.of()})||Pe.of()}):new e(function(o,a){return n.request(o,function(s){return i.request(s,a)||Pe.of()})||Pe.of()})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(J0)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw __DEV__?new $e("request is not implemented"):new $e(22)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}(),ld=ji.execute,Y5="3.7.6";function X5(e){return!!e.body}function Z5(e){return!!e.getReader}function J5(e){return!!(Ql&&e[Symbol.asyncIterator])}function ex(e){return!!e.stream}function tx(e){return!!e.arrayBuffer}function rx(e){return!!e.pipe}function nx(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function ix(e){var t=null,r=null,n=!1,i=[],o=[];function a(d){if(!r){if(o.length){var f=o.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=o.slice();f.forEach(function(h){h[1](d)}),!t||t()}function c(){n=!0;var d=o.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",s),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",a),e.on("error",s),e.on("end",c),e.on("finish",c),e.on("close",c);function l(){return new Promise(function(d,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});o.push([d,f])})}var u={next:function(){return l()}};return Ql&&(u[Symbol.asyncIterator]=function(){return this}),u}function ox(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(o){n({value:o,done:!1})}).catch(i)}))}};return Ql&&(r[Symbol.asyncIterator]=function(){return this}),r}function em(e){var t={next:function(){return e.read()}};return Ql&&(t[Symbol.asyncIterator]=function(){return this}),t}function ax(e){var t=e;if(X5(e)&&(t=e.body),J5(t))return nx(t);if(Z5(t))return em(t.getReader());if(ex(t))return em(t.stream().getReader());if(tx(t))return ox(t.arrayBuffer());if(rx(t))return ix(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var tm=Object.prototype.hasOwnProperty;function sx(e,t){var r,n,i;return ie(this,void 0,void 0,function(){var o,a,s,c,l,u,d,f,h,p,m,v,y,b,g,w,x,E,S,T;return Kr(this,function(M){switch(M.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");o=new TextDecoder("utf-8"),a=(r=e.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",c=a?.includes(s)?a?.substring(a?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(c),u="",d=ax(e),f=!0,M.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(h=M.sent(),p=h.value,m=h.done,v=typeof p=="string"?p:o.decode(p),f=!m,u+=v,y=u.indexOf(l);y>-1;){if(b=void 0,T=[u.slice(0,y),u.slice(y+l.length)],b=T[0],u=T[1],b.trim()){if(g=b.indexOf(`\r
@@ -714,7 +714,8 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a
714
714
  }`;return Et(this.apollo,i)}deleteWebhook(){const t=G`
715
715
  mutation deleteWebhookConfig($id: String!) {
716
716
  deleteWebhookConfig(id: $id)
717
- }`;return Et(this.apollo,t)}}class q9{constructor(t){this.client=new V9(t),this.organization=new B9(t),this.webhook=new W9(t)}}var Dm;(function(e){e.Drug="DRUG",e.Package="PACKAGE",e.Product="PRODUCT"})(Dm||(Dm={}));var Rm;(function(e){e.Icd10="ICD10"})(Rm||(Rm={}));var Fm;(function(e){e.Canceled="CANCELED",e.New="NEW",e.Scheduled="SCHEDULED",e.Sent="SENT"})(Fm||(Fm={}));var Lm;(function(e){e.MailOrder="MAIL_ORDER",e.PickUp="PICK_UP"})(Lm||(Lm={}));var Mm;(function(e){e.Otc="OTC",e.Rx="RX"})(Mm||(Mm={}));var jm;(function(e){e.Canceled="CANCELED",e.Completed="COMPLETED",e.Error="ERROR",e.Pending="PENDING",e.Placed="PLACED"})(jm||(jm={}));var zm;(function(e){e.Pharmacy="PHARMACY",e.Prescriber="PRESCRIBER"})(zm||(zm={}));var Um;(function(e){e.Active="ACTIVE",e.Depleted="DEPLETED",e.Expired="EXPIRED"})(Um||(Um={}));var Vm;(function(e){e.I="I",e.Ii="II",e.Iii="III",e.Iv="IV",e.V="V"})(Vm||(Vm={}));var Bm;(function(e){e.Concept="CONCEPT",e.Form="FORM",e.Route="ROUTE",e.Strength="STRENGTH"})(Bm||(Bm={}));var Wm;(function(e){e.Female="FEMALE",e.Male="MALE",e.Unknown="UNKNOWN"})(Wm||(Wm={}));class H9{constructor({domain:t,clientId:r,redirectURI:n,organization:i,audience:o="https://api.photon.health",uri:a="https://api.photon.health/graphql",developmentMode:s=!1}){this.auth0Client=new d4({domain:t||(s?"auth.neutron.health":"auth.photon.health"),client_id:r,redirect_uri:n,cacheLocation:"memory"}),this.audience=o,this.uri=a,s&&(this.audience="https://api.neutron.health",this.uri="https://api.neutron.health/graphql"),this.organization=i,this.authentication=new Pm({authentication:this.auth0Client,organization:this.organization,audience:this.audience});let c=this.constructApolloClient();this.clinical=new U9(c),this.management=new q9(c)}constructApolloClient(){return new y9({link:E9((r,n)=>ie(this,void 0,void 0,function*(){var{headers:i}=n,o=an(n,["headers"]);let a;try{a=yield this.authentication.getAccessToken()}catch(s){if(s.message.includes("Consent required"))a=yield this.authentication.getAccessTokenWithConsent();else throw s}return a?Object.assign(Object.assign({},o),{headers:Object.assign(Object.assign({},i),{authorization:a})}):Object.assign({headers:i},o)})).concat(new y1({uri:this.uri})),defaultOptions:{query:{fetchPolicy:"network-only",errorPolicy:"all"}},cache:new c9})}setOrganization(t){return this.organization=t,this.authentication=new Pm({authentication:this.auth0Client,organization:t,audience:this.audience}),this}}const wd=Symbol("store-raw"),Po=Symbol("store-node"),G9=Symbol("store-name");function G1(e,t){let r=e[br];if(!r&&(Object.defineProperty(e,br,{value:r=new Proxy(e,Y9)}),!Array.isArray(e))){const n=Object.keys(e),i=Object.getOwnPropertyDescriptors(e);for(let o=0,a=n.length;o<a;o++){const s=n[o];i[s].get&&Object.defineProperty(e,s,{enumerable:i[s].enumerable,get:i[s].get.bind(r)})}}return r}function fn(e){let t;return e!=null&&typeof e=="object"&&(e[br]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Si(e,t=new Set){let r,n,i,o;if(r=e!=null&&e[wd])return r;if(!fn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,s=e.length;a<s;a++)i=e[a],(n=Si(i,t))!==i&&(e[a]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const a=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let c=0,l=a.length;c<l;c++)o=a[c],!s[o].get&&(i=e[o],(n=Si(i,t))!==i&&(e[o]=n))}return e}function qh(e){let t=e[Po];return t||Object.defineProperty(e,Po,{value:t={}}),t}function _d(e,t,r){return e[t]||(e[t]=K1(r))}function Q9(e,t){const r=Reflect.getOwnPropertyDescriptor(e,t);return!r||r.get||!r.configurable||t===br||t===Po||t===G9||(delete r.value,delete r.writable,r.get=()=>e[br][t]),r}function Q1(e){if(Fg()){const t=qh(e);(t._||(t._=K1()))()}}function K9(e){return Q1(e),Reflect.ownKeys(e)}function K1(e){const[t,r]=L(e,{equals:!1,internal:!0});return t.$=r,t}const Y9={get(e,t,r){if(t===wd)return e;if(t===br)return r;if(t===_u)return Q1(e),r;const n=qh(e),i=n.hasOwnProperty(t);let o=i?n[t]():e[t];if(t===Po||t==="__proto__")return o;if(!i){const a=Object.getOwnPropertyDescriptor(e,t);Fg()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(o=_d(n,t,o)())}return fn(o)?G1(o):o},has(e,t){return t===wd||t===br||t===_u||t===Po||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:K9,getOwnPropertyDescriptor:Q9};function Bt(e,t,r,n=!1){if(!n&&e[t]===r)return;const i=e[t],o=e.length;r===void 0?delete e[t]:e[t]=r;let a=qh(e),s;(s=_d(a,t,i))&&s.$(()=>r),Array.isArray(e)&&e.length!==o&&(s=_d(a,"length",o))&&s.$(e.length),(s=a._)&&s.$()}function Y1(e,t){const r=Object.keys(t);for(let n=0;n<r.length;n+=1){const i=r[n];Bt(e,i,t[i])}}function X9(e,t){if(typeof t=="function"&&(t=t(e)),t=Si(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;r<n;r++){const i=t[r];e[r]!==i&&Bt(e,r,i)}Bt(e,"length",n)}else Y1(e,t)}function fo(e,t,r=[]){let n,i=e;if(t.length>1){n=t.shift();const a=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let c=0;c<n.length;c++)fo(e,[n[c]].concat(t),r);return}else if(s&&a==="function"){for(let c=0;c<e.length;c++)n(e[c],c)&&fo(e,[c].concat(t),r);return}else if(s&&a==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=n;for(let d=c;d<=l;d+=u)fo(e,[d].concat(t),r);return}else if(t.length>1){fo(e[n],t,[n].concat(r));return}i=e[n],r=[n].concat(r)}let o=t[0];typeof o=="function"&&(o=o(i,r),o===i)||n===void 0&&o==null||(o=Si(o),n===void 0||fn(i)&&fn(o)&&!Array.isArray(o)?Y1(i,o):Bt(e,n,o))}function yn(...[e,t]){const r=Si(e||{}),n=Array.isArray(r),i=G1(r);function o(...a){p$(()=>{n&&a.length===1?X9(r,a[0]):fo(r,a)})}return[i,o]}const xd=Symbol("store-root");function ti(e,t,r,n,i){const o=t[r];if(e===o)return;if(!fn(e)||!fn(o)||i&&e[i]!==o[i]){if(e!==o){if(r===xd)return e;Bt(t,r,e)}return}if(Array.isArray(e)){if(e.length&&o.length&&(!n||i&&e[0]&&e[0][i]!=null)){let c,l,u,d,f,h,p,m;for(u=0,d=Math.min(o.length,e.length);u<d&&(o[u]===e[u]||i&&o[u]&&e[u]&&o[u][i]===e[u][i]);u++)ti(e[u],o,u,n,i);const v=new Array(e.length),y=new Map;for(d=o.length-1,f=e.length-1;d>=u&&f>=u&&(o[d]===e[f]||i&&o[u]&&e[u]&&o[d][i]===e[f][i]);d--,f--)v[f]=o[d];if(u>f||u>d){for(l=u;l<=f;l++)Bt(o,l,e[l]);for(;l<e.length;l++)Bt(o,l,v[l]),ti(e[l],o,l,n,i);o.length>e.length&&Bt(o,"length",e.length);return}for(p=new Array(f+1),l=f;l>=u;l--)h=e[l],m=i&&h?h[i]:h,c=y.get(m),p[l]=c===void 0?-1:c,y.set(m,l);for(c=u;c<=d;c++)h=o[c],m=i&&h?h[i]:h,l=y.get(m),l!==void 0&&l!==-1&&(v[l]=o[c],l=p[l],y.set(m,l));for(l=u;l<e.length;l++)l in v?(Bt(o,l,v[l]),ti(e[l],o,l,n,i)):Bt(o,l,e[l])}else for(let c=0,l=e.length;c<l;c++)ti(e[c],o,c,n,i);o.length>e.length&&Bt(o,"length",e.length);return}const a=Object.keys(e);for(let c=0,l=a.length;c<l;c++)ti(e[a[c]],o,a[c],n,i);const s=Object.keys(o);for(let c=0,l=s.length;c<l;c++)e[s[c]]===void 0&&Bt(o,s[c],void 0)}function Z9(e,t={}){const{merge:r,key:n="id"}=t,i=Si(e);return o=>{if(!fn(o)||!fn(i))return i;const a=ti(i,{[xd]:o},xd,r,n);return a===void 0?o:a}}const J9=e=>{window.location.replace(e?.returnTo||window.location.pathname)},e8=Wo`
717
+ }
718
+ `;return Et(this.apollo,t)}}class q9{constructor(t){this.client=new V9(t),this.organization=new B9(t),this.webhook=new W9(t)}}var Dm;(function(e){e.Drug="DRUG",e.Package="PACKAGE",e.Product="PRODUCT"})(Dm||(Dm={}));var Rm;(function(e){e.Icd10="ICD10"})(Rm||(Rm={}));var Fm;(function(e){e.Canceled="CANCELED",e.New="NEW",e.Scheduled="SCHEDULED",e.Sent="SENT"})(Fm||(Fm={}));var Lm;(function(e){e.MailOrder="MAIL_ORDER",e.PickUp="PICK_UP"})(Lm||(Lm={}));var Mm;(function(e){e.Otc="OTC",e.Rx="RX"})(Mm||(Mm={}));var jm;(function(e){e.Canceled="CANCELED",e.Completed="COMPLETED",e.Error="ERROR",e.Pending="PENDING",e.Placed="PLACED"})(jm||(jm={}));var zm;(function(e){e.Pharmacy="PHARMACY",e.Prescriber="PRESCRIBER"})(zm||(zm={}));var Um;(function(e){e.Active="ACTIVE",e.Depleted="DEPLETED",e.Expired="EXPIRED"})(Um||(Um={}));var Vm;(function(e){e.I="I",e.Ii="II",e.Iii="III",e.Iv="IV",e.V="V"})(Vm||(Vm={}));var Bm;(function(e){e.Concept="CONCEPT",e.Form="FORM",e.Route="ROUTE",e.Strength="STRENGTH"})(Bm||(Bm={}));var Wm;(function(e){e.Female="FEMALE",e.Male="MALE",e.Unknown="UNKNOWN"})(Wm||(Wm={}));class H9{constructor({domain:t,clientId:r,redirectURI:n,organization:i,audience:o="https://api.photon.health",uri:a="https://api.photon.health/graphql",developmentMode:s=!1}){this.auth0Client=new d4({domain:t||(s?"auth.neutron.health":"auth.photon.health"),client_id:r,redirect_uri:n,cacheLocation:"memory"}),this.audience=o,this.uri=a,s&&(this.audience="https://api.neutron.health",this.uri="https://api.neutron.health/graphql"),this.organization=i,this.authentication=new Pm({authentication:this.auth0Client,organization:this.organization,audience:this.audience});let c=this.constructApolloClient();this.clinical=new U9(c),this.management=new q9(c)}constructApolloClient(){return new y9({link:E9((r,n)=>ie(this,void 0,void 0,function*(){var{headers:i}=n,o=an(n,["headers"]);let a;try{a=yield this.authentication.getAccessToken()}catch(s){if(s.message.includes("Consent required"))a=yield this.authentication.getAccessTokenWithConsent();else throw s}return a?Object.assign(Object.assign({},o),{headers:Object.assign(Object.assign({},i),{authorization:a})}):Object.assign({headers:i},o)})).concat(new y1({uri:this.uri})),defaultOptions:{query:{fetchPolicy:"network-only",errorPolicy:"all"}},cache:new c9})}setOrganization(t){return this.organization=t,this.authentication=new Pm({authentication:this.auth0Client,organization:t,audience:this.audience}),this}}const wd=Symbol("store-raw"),Po=Symbol("store-node"),G9=Symbol("store-name");function G1(e,t){let r=e[br];if(!r&&(Object.defineProperty(e,br,{value:r=new Proxy(e,Y9)}),!Array.isArray(e))){const n=Object.keys(e),i=Object.getOwnPropertyDescriptors(e);for(let o=0,a=n.length;o<a;o++){const s=n[o];i[s].get&&Object.defineProperty(e,s,{enumerable:i[s].enumerable,get:i[s].get.bind(r)})}}return r}function fn(e){let t;return e!=null&&typeof e=="object"&&(e[br]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Si(e,t=new Set){let r,n,i,o;if(r=e!=null&&e[wd])return r;if(!fn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let a=0,s=e.length;a<s;a++)i=e[a],(n=Si(i,t))!==i&&(e[a]=n)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const a=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let c=0,l=a.length;c<l;c++)o=a[c],!s[o].get&&(i=e[o],(n=Si(i,t))!==i&&(e[o]=n))}return e}function qh(e){let t=e[Po];return t||Object.defineProperty(e,Po,{value:t={}}),t}function _d(e,t,r){return e[t]||(e[t]=K1(r))}function Q9(e,t){const r=Reflect.getOwnPropertyDescriptor(e,t);return!r||r.get||!r.configurable||t===br||t===Po||t===G9||(delete r.value,delete r.writable,r.get=()=>e[br][t]),r}function Q1(e){if(Fg()){const t=qh(e);(t._||(t._=K1()))()}}function K9(e){return Q1(e),Reflect.ownKeys(e)}function K1(e){const[t,r]=L(e,{equals:!1,internal:!0});return t.$=r,t}const Y9={get(e,t,r){if(t===wd)return e;if(t===br)return r;if(t===_u)return Q1(e),r;const n=qh(e),i=n.hasOwnProperty(t);let o=i?n[t]():e[t];if(t===Po||t==="__proto__")return o;if(!i){const a=Object.getOwnPropertyDescriptor(e,t);Fg()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(o=_d(n,t,o)())}return fn(o)?G1(o):o},has(e,t){return t===wd||t===br||t===_u||t===Po||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:K9,getOwnPropertyDescriptor:Q9};function Bt(e,t,r,n=!1){if(!n&&e[t]===r)return;const i=e[t],o=e.length;r===void 0?delete e[t]:e[t]=r;let a=qh(e),s;(s=_d(a,t,i))&&s.$(()=>r),Array.isArray(e)&&e.length!==o&&(s=_d(a,"length",o))&&s.$(e.length),(s=a._)&&s.$()}function Y1(e,t){const r=Object.keys(t);for(let n=0;n<r.length;n+=1){const i=r[n];Bt(e,i,t[i])}}function X9(e,t){if(typeof t=="function"&&(t=t(e)),t=Si(t),Array.isArray(t)){if(e===t)return;let r=0,n=t.length;for(;r<n;r++){const i=t[r];e[r]!==i&&Bt(e,r,i)}Bt(e,"length",n)}else Y1(e,t)}function fo(e,t,r=[]){let n,i=e;if(t.length>1){n=t.shift();const a=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let c=0;c<n.length;c++)fo(e,[n[c]].concat(t),r);return}else if(s&&a==="function"){for(let c=0;c<e.length;c++)n(e[c],c)&&fo(e,[c].concat(t),r);return}else if(s&&a==="object"){const{from:c=0,to:l=e.length-1,by:u=1}=n;for(let d=c;d<=l;d+=u)fo(e,[d].concat(t),r);return}else if(t.length>1){fo(e[n],t,[n].concat(r));return}i=e[n],r=[n].concat(r)}let o=t[0];typeof o=="function"&&(o=o(i,r),o===i)||n===void 0&&o==null||(o=Si(o),n===void 0||fn(i)&&fn(o)&&!Array.isArray(o)?Y1(i,o):Bt(e,n,o))}function yn(...[e,t]){const r=Si(e||{}),n=Array.isArray(r),i=G1(r);function o(...a){p$(()=>{n&&a.length===1?X9(r,a[0]):fo(r,a)})}return[i,o]}const xd=Symbol("store-root");function ti(e,t,r,n,i){const o=t[r];if(e===o)return;if(!fn(e)||!fn(o)||i&&e[i]!==o[i]){if(e!==o){if(r===xd)return e;Bt(t,r,e)}return}if(Array.isArray(e)){if(e.length&&o.length&&(!n||i&&e[0]&&e[0][i]!=null)){let c,l,u,d,f,h,p,m;for(u=0,d=Math.min(o.length,e.length);u<d&&(o[u]===e[u]||i&&o[u]&&e[u]&&o[u][i]===e[u][i]);u++)ti(e[u],o,u,n,i);const v=new Array(e.length),y=new Map;for(d=o.length-1,f=e.length-1;d>=u&&f>=u&&(o[d]===e[f]||i&&o[u]&&e[u]&&o[d][i]===e[f][i]);d--,f--)v[f]=o[d];if(u>f||u>d){for(l=u;l<=f;l++)Bt(o,l,e[l]);for(;l<e.length;l++)Bt(o,l,v[l]),ti(e[l],o,l,n,i);o.length>e.length&&Bt(o,"length",e.length);return}for(p=new Array(f+1),l=f;l>=u;l--)h=e[l],m=i&&h?h[i]:h,c=y.get(m),p[l]=c===void 0?-1:c,y.set(m,l);for(c=u;c<=d;c++)h=o[c],m=i&&h?h[i]:h,l=y.get(m),l!==void 0&&l!==-1&&(v[l]=o[c],l=p[l],y.set(m,l));for(l=u;l<e.length;l++)l in v?(Bt(o,l,v[l]),ti(e[l],o,l,n,i)):Bt(o,l,e[l])}else for(let c=0,l=e.length;c<l;c++)ti(e[c],o,c,n,i);o.length>e.length&&Bt(o,"length",e.length);return}const a=Object.keys(e);for(let c=0,l=a.length;c<l;c++)ti(e[a[c]],o,a[c],n,i);const s=Object.keys(o);for(let c=0,l=s.length;c<l;c++)e[s[c]]===void 0&&Bt(o,s[c],void 0)}function Z9(e,t={}){const{merge:r,key:n="id"}=t,i=Si(e);return o=>{if(!fn(o)||!fn(i))return i;const a=ti(i,{[xd]:o},xd,r,n);return a===void 0?o:a}}const J9=e=>{window.location.replace(e?.returnTo||window.location.pathname)},e8=Wo`
718
719
  fragment CatalogTreatmentsFields on Catalog {
719
720
  treatments {
720
721
  id
@@ -1833,7 +1834,7 @@ lit-html/directives/unsafe-svg.js:
1833
1834
  */var k6=["bottom","height","left","right","top","width"],E6=function(t,r){return t===void 0&&(t={}),r===void 0&&(r={}),k6.some(function(n){return t[n]!==r[n]})},Qr=new Map,w2,O6=function e(){var t=[];Qr.forEach(function(r,n){var i=n.getBoundingClientRect();E6(i,r.rect)&&(r.rect=i,t.push(r))}),t.forEach(function(r){r.callbacks.forEach(function(n){return n(r.rect)})}),w2=window.requestAnimationFrame(e)};function C6(e,t){return{observe:function(){var n=Qr.size===0;Qr.has(e)?Qr.get(e).callbacks.push(t):Qr.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&O6()},unobserve:function(){var n=Qr.get(e);if(n){var i=n.callbacks.indexOf(t);i>=0&&n.callbacks.splice(i,1),n.callbacks.length||Qr.delete(e),Qr.size||cancelAnimationFrame(w2)}}}}function fa(e,t,r){let n=[],i;return()=>{let o;r.key&&r.debug!=null&&r.debug()&&(o=Date.now());const a=e();if(!(a.length!==n.length||a.some((l,u)=>n[u]!==l)))return i;n=a;let c;if(r.key&&r.debug!=null&&r.debug()&&(c=Date.now()),i=t(...a),r==null||r.onChange==null||r.onChange(i),r.key&&r.debug!=null&&r.debug()){const l=Math.round((Date.now()-o)*100)/100,u=Math.round((Date.now()-c)*100)/100,d=u/16,f=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info("%c\u23F1 "+f(u,5)+" /"+f(l,5)+" ms",`
1834
1835
  font-size: .6rem;
1835
1836
  font-weight: bold;
1836
- color: hsl(`+Math.max(0,Math.min(120-120*d,120))+"deg 100% 31%);",r?.key)}return i}}const P6=e=>e,T6=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let i=t;i<=r;i++)n.push(i);return n},N6=(e,t)=>{const r=C6(e.scrollElement,n=>{t(n)});if(!!e.scrollElement)return t(e.scrollElement.getBoundingClientRect()),r.observe(),()=>{r.unobserve()}},I6=(e,t)=>{const r=()=>t(e.scrollElement[e.options.horizontal?"scrollLeft":"scrollTop"]);if(!!e.scrollElement)return r(),e.scrollElement.addEventListener("scroll",r,{capture:!1,passive:!0}),()=>{e.scrollElement.removeEventListener("scroll",r)}},A6=(e,t)=>e.getBoundingClientRect()[t.options.horizontal?"width":"height"],D6=(e,t,r)=>{var n;(n=r.scrollElement)==null||n.scrollTo({[r.options.horizontal?"left":"top"]:e,behavior:t?"smooth":void 0})};class R6{constructor(t){var r=this;this.unsubs=[],this.scrollElement=null,this.measurementsCache=[],this.itemMeasurementsCache={},this.pendingMeasuredCacheIndexes=[],this.measureElementCache={},this.setOptions=n=>{Object.entries(n).forEach(i=>{let[o,a]=i;typeof a>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:P6,rangeExtractor:T6,enableSmoothScroll:!0,onChange:()=>{},measureElement:A6,initialRect:{width:0,height:0},...n}},this.notify=()=>{var n,i;(n=(i=this.options).onChange)==null||n.call(i,this)},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[]},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{const n=this.options.getScrollElement();this.scrollElement!==n&&(this.cleanup(),this.scrollElement=n,this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.notify()})),this.unsubs.push(this.options.observeElementOffset(this,i=>{this.scrollOffset=i,this.notify()})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurements=fa(()=>[this.options.count,this.options.paddingStart,this.options.getItemKey,this.itemMeasurementsCache],(n,i,o,a)=>{const s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,s);for(let l=s;l<n;l++){const u=o(l),d=a[u],f=c[l-1]?c[l-1].end:i,h=typeof d=="number"?d:this.options.estimateSize(l),p=f+h;c[l]={index:l,start:f,size:h,end:p,key:u}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=fa(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(n,i,o)=>L6({measurements:n,outerSize:i,scrollOffset:o}),{key:!1,debug:()=>this.options.debug}),this.getIndexes=fa(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,i,o,a)=>n({...i,overscan:o,count:a}),{key:!1}),this.getVirtualItems=fa(()=>[this.getIndexes(),this.getMeasurements(),this.options.measureElement],(n,i,o)=>{const a=u=>d=>{var f;const h=this.measurementsCache[u];if(!d)return;const p=o(d,this),m=(f=this.itemMeasurementsCache[h.key])!=null?f:h.size;p!==m&&(h.start<this.scrollOffset&&(this.destinationOffset||this._scrollToOffset(this.scrollOffset+(p-m),!1)),this.pendingMeasuredCacheIndexes.push(u),this.itemMeasurementsCache={...this.itemMeasurementsCache,[h.key]:p},this.notify())},s=[],c={};for(let u=0,d=n.length;u<d;u++){var l;const f=n[u],p={...i[f],measureElement:c[f]=(l=this.measureElementCache[f])!=null?l:a(f)};s.push(p)}return this.measureElementCache=c,s},{key:!1}),this.scrollToOffset=function(n,i){let{align:o}=i===void 0?{align:"start"}:i;const a=()=>{const s=r.scrollOffset,c=r.getSize();o==="auto"&&(n<=s?o="start":n>=s+c?o="end":o="start"),o==="start"?r._scrollToOffset(n,!0):o==="end"?r._scrollToOffset(n-c,!0):o==="center"&&r._scrollToOffset(n-c/2,!0)};a(),requestAnimationFrame(()=>{a()})},this.scrollToIndex=function(n,i){let{align:o,...a}=i===void 0?{align:"auto"}:i;const s=r.getMeasurements(),c=r.scrollOffset,l=r.getSize(),{count:u}=r.options,d=s[Math.max(0,Math.min(n,u-1))];if(!d)return;if(o==="auto")if(d.end>=c+l-r.options.scrollPaddingEnd)o="end";else if(d.start<=c+r.options.scrollPaddingStart)o="start";else return;const f=o==="end"?d.end+r.options.scrollPaddingEnd:d.start-r.options.scrollPaddingStart;r.scrollToOffset(f,{align:o,...a})},this.getTotalSize=()=>{var n;return(((n=this.getMeasurements()[this.options.count-1])==null?void 0:n.end)||this.options.paddingStart)+this.options.paddingEnd},this._scrollToOffset=(n,i)=>{clearTimeout(this.scrollCheckFrame),this.destinationOffset=n,this.options.scrollToFn(n,this.options.enableSmoothScroll&&i,this);let o;const a=()=>{let s=this.scrollOffset;this.scrollCheckFrame=o=setTimeout(()=>{if(this.scrollCheckFrame===o){if(this.scrollOffset===s){this.destinationOffset=void 0;return}s=this.scrollOffset,a()}},100)};a()},this.measure=()=>{this.itemMeasurementsCache={},this.notify()},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset}}const F6=(e,t,r,n)=>{for(;e<=t;){const i=(e+t)/2|0,o=r(i);if(o<n)e=i+1;else if(o>n)t=i-1;else return i}return e>0?e-1:0};function L6(e){let{measurements:t,outerSize:r,scrollOffset:n}=e;const i=t.length-1,a=F6(0,i,c=>t[c].start,n);let s=a;for(;s<i&&t[s].end<n+r;)s++;return{startIndex:a,endIndex:s}}function M6(e){const t=Su(e),r=new R6(t),[n,i]=yn(r.getVirtualItems()),[o,a]=L(r.getTotalSize()),s={get(l,u){switch(u){case"getVirtualItems":return()=>n;case"getTotalSize":return()=>o();default:return Reflect.get(l,u)}}},c=new Proxy(r,s);return c.setOptions(t),Tt(()=>{const l=c._didMount();c._willUpdate(),Il(l)}),h$(()=>{c.setOptions(Su(t,e,{onChange:l=>{l._willUpdate(),i(Z9(l.getVirtualItems(),{key:"index"})),a(l.getTotalSize()),e.onChange==null||e.onChange(l)}})),c.measure()}),c}function $v(e){return M6(Su({observeElementRect:N6,observeElementOffset:I6,scrollToFn:D6},e))}const j6=O('<div slot="suffix" class="flex"><sl-icon class="text-gray-400 hover:text-gray-600" name="x-circle-fill"></sl-icon></div>'),iu=O("<sl-menu-item></sl-menu-item>"),z6=O('<sl-menu-item><p class="text-center text-gray-400 italic">Loading...</p></sl-menu-item>'),U6=O('<div><style></style><style></style><style></style><style></style><sl-dropdown class="dropdown relative" hoist><sl-input slot="trigger" size="medium" class="input"><p slot="help-text" class="text-red-500 pt-2 font-sans"></p><div slot="suffix" class="flex"><sl-spinner slot="suffix"></sl-spinner></div><div slot="suffix" class="flex"><sl-icon></sl-icon></div></sl-input><div class="border border-gray-200 dropdown-container overflow-hidden relative"><div class="bg-white pt-2 overflow-x-hidden overflow-y-auto relative"><div></div></div></div></sl-dropdown></div>'),V6=O('<div class="flex items-center pt-2 pb-2"><p class="text-gray-700 text-sm font-sans"></p></div>'),B6=O('<p class="pl-1 text-red-500">*</p>'),W6=O('<p class="text-gray-400 text-xs pl-2 font-sans">Optional</p>'),wv=O('<p class="text-center text-gray-400 italic">Loading...</p>'),_v=O('<p class="text-center text-gray-400 italic">Nothing more to load</p>'),q6=O("<p></p>"),H6=O('<sl-menu-item class="group"></sl-menu-item>'),G6=O('<p class="overflow-hidden overflow-ellipsis whitespace-nowrap"></p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const Nt=e=>{let t,r,n,i,o;e.actionRef&&(e.actionRef.clear=()=>{d(void 0),h(-1),i.value="",b(""),E()});const[a,s]=L(!1),[c,l]=L(""),[u,d]=L(),[f,h]=L(-1),[p,m]=L($v({count:e.data.length,getScrollElement:()=>n,estimateSize:()=>36.8,overscan:25})),[v,y]=L(),b=X1(async S=>{l(S),e.onSearchChange&&await e.onSearchChange(S)},250),g=new IntersectionObserver(async S=>{S.at(-1)?.isIntersecting&&e.hasMore&&e.fetchMore&&await e.fetchMore(c())});ge(()=>{v()&&g.observe(v())});const w=S=>{if(S)return e.helpText?e.helpText:e.required?"Please select data...":void 0},x=S=>{const T=new CustomEvent("photon-data-selected",{composed:!0,bubbles:!0,detail:{data:S}});t?.dispatchEvent(T)},E=()=>{const S=new CustomEvent("photon-data-unselected",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(S)};return ge(()=>{e.selectedData&&(d(e.selectedData),x(e.selectedData)),e.selectedData===void 0&&d(void 0)}),ge(()=>{const S=e.data.length*36.8;n.style.minHeight=`${S}px`;const T=$v({count:e.hasMore?e.data.length+1:e.data.length,getScrollElement:()=>n,estimateSize:()=>36.8,overscan:e.fetchMore?25:e.data.length});m(T)}),Tt(()=>{i&&i.addEventListener("keydown",S=>{(S.code=="Space"||S.key==" ")&&S.stopImmediatePropagation()})}),(()=>{const S=V(()=>document.importNode(U6,!0)),T=S.firstChild,M=T.nextSibling,F=M.nextSibling,K=F.nextSibling,D=K.nextSibling,R=D.firstChild,U=R.firstChild,j=U.nextSibling,Y=j.firstChild,oe=j.nextSibling,ae=oe.firstChild,A=R.nextSibling,me=A.firstChild,xe=me.firstChild,I=t;typeof I=="function"?ee(I,S):t=S,_(T,ze),_(M,Vt),_(F,Ut),_(K,S6),_(S,(()=>{const H=pe(()=>!!e.label);return()=>H()?(()=>{const Q=V6.cloneNode(!0),X=Q.firstChild;return _(X,()=>e.label),_(Q,(()=>{const ne=pe(()=>!!e.required);return()=>ne()?B6.cloneNode(!0):null})(),null),_(Q,(()=>{const ne=pe(()=>!!e.optional);return()=>ne()?W6.cloneNode(!0):null})(),null),Q})():null})(),D);const xt=r;typeof xt=="function"?ee(xt,D):r=D,D.addEventListener("sl-hide",async()=>{u()||(i.value="",l(""),e.onHide&&await e.onHide()),s(!1)}),D.addEventListener("sl-show",async()=>{s(!0),e.onOpen&&await e.onOpen()}),D.style.setProperty("width","100%"),D._$owner=P();const St=i;typeof St=="function"?ee(St,R):i=R,R.addEventListener("sl-input",H=>{a()||r.show(),b(H.target.value)}),R.addEventListener("sl-focus",()=>{r.children[1].style.width=`${i.clientWidth}px`,f()>0&&p().scrollToIndex(f())}),R._$owner=P(),_(U,()=>w(e.invalid??!1)),Y._$owner=P(),_(R,z(re,{get when(){return e.clearable},get children(){const H=V(()=>document.importNode(j6,!0)),Q=H.firstChild;return Q.addEventListener("click",X=>{X.stopImmediatePropagation(),d(void 0),h(-1),i.value="",b(""),E(),r.hide()}),Q._$owner=P(),W(()=>H.classList.toggle("hidden",!!(e.isLoading||u()==null))),H}}),oe),ae._$owner=P();const Mt=o;typeof Mt=="function"?ee(Mt,me):o=me,me.style.setProperty("max-height","200px"),me.style.setProperty("min-height","56px"),me.style.setProperty("width","100%");const It=n;return typeof It=="function"?ee(It,xe):n=xe,xe.style.setProperty("min-height","36.8px"),xe.style.setProperty("width","100%"),_(xe,z(re,{get when(){return e.data.length>0&&!e.groups},get children(){return p().getVirtualItems().map(H=>{const Q=H.index>e.data.length-1,X=e.data[H.index];return(()=>{const ne=V(()=>document.importNode(iu,!0));return ee(ue=>{Q&&H.index>0&&y(ue)},ne),ne.$$click=()=>{Q||(d(X),h(H.index),i.value="",b(""),x(X),r.hide())},ne.style.setProperty("width","100%"),ne._$owner=P(),_(ne,()=>Q?e.hasMore?wv.cloneNode(!0):_v.cloneNode(!0):(()=>{const ue=q6.cloneNode(!0);return _(ue,()=>e.displayAccessor(X,!0)),W(de=>{const Ue=!e.showOverflow,Me=!e.showOverflow,st=!e.showOverflow,dr=!!e.showOverflow;return Ue!==de._v$14&&ue.classList.toggle("overflow-hidden",de._v$14=Ue),Me!==de._v$15&&ue.classList.toggle("overflow-ellipsis",de._v$15=Me),st!==de._v$16&&ue.classList.toggle("whitespace-nowrap",de._v$16=st),dr!==de._v$17&&ue.classList.toggle("whitespace-normal",de._v$17=dr),de},{_v$14:void 0,_v$15:void 0,_v$16:void 0,_v$17:void 0}),ue})()),W(ue=>{const de=X&&X.id===u()?.id&&!Q?"selected default":"default",Ue=`${H.size}px`;return de!==ue._v$12&&_p(ne,ue._v$12=de),Ue!==ue._v$13&&ne.style.setProperty("min-height",ue._v$13=Ue),ue},{_v$12:void 0,_v$13:void 0}),ne})()})}}),null),_(xe,z(re,{get when(){return e.data.length>0&&e.groups&&e.groups.length>0},get children(){return z(Rl,{get each(){return e.groups||[]},children:H=>[(()=>{const Q=V(()=>document.importNode(H6,!0));return Q._$owner=P(),_(Q,()=>H.label),W(()=>Q.classList.toggle("hidden",p().getVirtualItems().filter(X=>H.filter(e.data[X.index])).length===0)),Q})(),pe(()=>p().getVirtualItems().filter(Q=>H.filter(e.data[Q.index])).map(Q=>{const X=Q.index>e.data.length-1,ne=e.data[Q.index];return(()=>{const ue=V(()=>document.importNode(iu,!0));return ee(de=>{X&&Q.index>0&&y(de)},ue),ue.$$click=()=>{X||(d(ne),h(Q.index),i.value="",b(""),x(ne),r.hide())},ue.style.setProperty("width","100%"),ue._$owner=P(),_(ue,()=>X?e.hasMore?wv.cloneNode(!0):_v.cloneNode(!0):(()=>{const de=G6.cloneNode(!0);return _(de,()=>e.displayAccessor(ne,!0)),de})()),W(de=>{const Ue=ne&&ne.id===u()?.id&&!X?"selected default group-member":"default group-member",Me=`${Q.size}px`;return Ue!==de._v$18&&_p(ue,de._v$18=Ue),Me!==de._v$19&&ue.style.setProperty("min-height",de._v$19=Me),de},{_v$18:void 0,_v$19:void 0}),ue})()}))]})}}),null),_(xe,z(re,{get when(){return e.data.length==0&&!e.isLoading},get children(){const H=V(()=>document.importNode(iu,!0));return H._$owner=P(),_(H,()=>e.noDataMsg?e.noDataMsg:"No data found"),H}}),null),_(xe,z(re,{get when(){return e.data.length==0&&e.isLoading},get children(){const H=V(()=>document.importNode(z6,!0));return H._$owner=P(),H}}),null),W(H=>{const Q=e.forceLabelSize&&!e.invalid?-20:e.invalid?-18:0,X=e.disabled??!1,ne=u()?e.displayAccessor(u(),!1):e.placeholder??"Select data...",ue=e.disabled??!1,de=!!(e.invalid??!1),Ue=!!(e.disabled??!1),Me=e.required,st=!!e.forceLabelSize,dr=!e.isLoading,gn=!!e.isLoading,Vr=a()?"chevron-up":"chevron-down";return Q!==H._v$&&(D.distance=H._v$=Q),X!==H._v$2&&(D.disabled=H._v$2=X),ne!==H._v$3&&(R.placeholder=H._v$3=ne),ue!==H._v$4&&(R.disabled=H._v$4=ue),de!==H._v$5&&R.classList.toggle("invalid",H._v$5=de),Ue!==H._v$6&&R.classList.toggle("disabled",H._v$6=Ue),Me!==H._v$7&&(R.required=H._v$7=Me),st!==H._v$8&&U.classList.toggle("h-[28px]",H._v$8=st),dr!==H._v$9&&j.classList.toggle("hidden",H._v$9=dr),gn!==H._v$10&&oe.classList.toggle("hidden",H._v$10=gn),Vr!==H._v$11&&(ae.name=H._v$11=Vr),H},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0}),S})()};Ni(["click"]);const xv=Wo`
1837
+ color: hsl(`+Math.max(0,Math.min(120-120*d,120))+"deg 100% 31%);",r?.key)}return i}}const P6=e=>e,T6=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let i=t;i<=r;i++)n.push(i);return n},N6=(e,t)=>{const r=C6(e.scrollElement,n=>{t(n)});if(!!e.scrollElement)return t(e.scrollElement.getBoundingClientRect()),r.observe(),()=>{r.unobserve()}},I6=(e,t)=>{const r=()=>t(e.scrollElement[e.options.horizontal?"scrollLeft":"scrollTop"]);if(!!e.scrollElement)return r(),e.scrollElement.addEventListener("scroll",r,{capture:!1,passive:!0}),()=>{e.scrollElement.removeEventListener("scroll",r)}},A6=(e,t)=>e.getBoundingClientRect()[t.options.horizontal?"width":"height"],D6=(e,t,r)=>{var n;(n=r.scrollElement)==null||n.scrollTo({[r.options.horizontal?"left":"top"]:e,behavior:t?"smooth":void 0})};class R6{constructor(t){var r=this;this.unsubs=[],this.scrollElement=null,this.measurementsCache=[],this.itemMeasurementsCache={},this.pendingMeasuredCacheIndexes=[],this.measureElementCache={},this.setOptions=n=>{Object.entries(n).forEach(i=>{let[o,a]=i;typeof a>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:P6,rangeExtractor:T6,enableSmoothScroll:!0,onChange:()=>{},measureElement:A6,initialRect:{width:0,height:0},...n}},this.notify=()=>{var n,i;(n=(i=this.options).onChange)==null||n.call(i,this)},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[]},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{const n=this.options.getScrollElement();this.scrollElement!==n&&(this.cleanup(),this.scrollElement=n,this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.notify()})),this.unsubs.push(this.options.observeElementOffset(this,i=>{this.scrollOffset=i,this.notify()})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurements=fa(()=>[this.options.count,this.options.paddingStart,this.options.getItemKey,this.itemMeasurementsCache],(n,i,o,a)=>{const s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,s);for(let l=s;l<n;l++){const u=o(l),d=a[u],f=c[l-1]?c[l-1].end:i,h=typeof d=="number"?d:this.options.estimateSize(l),p=f+h;c[l]={index:l,start:f,size:h,end:p,key:u}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=fa(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(n,i,o)=>L6({measurements:n,outerSize:i,scrollOffset:o}),{key:!1,debug:()=>this.options.debug}),this.getIndexes=fa(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,i,o,a)=>n({...i,overscan:o,count:a}),{key:!1}),this.getVirtualItems=fa(()=>[this.getIndexes(),this.getMeasurements(),this.options.measureElement],(n,i,o)=>{const a=u=>d=>{var f;const h=this.measurementsCache[u];if(!d)return;const p=o(d,this),m=(f=this.itemMeasurementsCache[h.key])!=null?f:h.size;p!==m&&(h.start<this.scrollOffset&&(this.destinationOffset||this._scrollToOffset(this.scrollOffset+(p-m),!1)),this.pendingMeasuredCacheIndexes.push(u),this.itemMeasurementsCache={...this.itemMeasurementsCache,[h.key]:p},this.notify())},s=[],c={};for(let u=0,d=n.length;u<d;u++){var l;const f=n[u],p={...i[f],measureElement:c[f]=(l=this.measureElementCache[f])!=null?l:a(f)};s.push(p)}return this.measureElementCache=c,s},{key:!1}),this.scrollToOffset=function(n,i){let{align:o}=i===void 0?{align:"start"}:i;const a=()=>{const s=r.scrollOffset,c=r.getSize();o==="auto"&&(n<=s?o="start":n>=s+c?o="end":o="start"),o==="start"?r._scrollToOffset(n,!0):o==="end"?r._scrollToOffset(n-c,!0):o==="center"&&r._scrollToOffset(n-c/2,!0)};a(),requestAnimationFrame(()=>{a()})},this.scrollToIndex=function(n,i){let{align:o,...a}=i===void 0?{align:"auto"}:i;const s=r.getMeasurements(),c=r.scrollOffset,l=r.getSize(),{count:u}=r.options,d=s[Math.max(0,Math.min(n,u-1))];if(!d)return;if(o==="auto")if(d.end>=c+l-r.options.scrollPaddingEnd)o="end";else if(d.start<=c+r.options.scrollPaddingStart)o="start";else return;const f=o==="end"?d.end+r.options.scrollPaddingEnd:d.start-r.options.scrollPaddingStart;r.scrollToOffset(f,{align:o,...a})},this.getTotalSize=()=>{var n;return(((n=this.getMeasurements()[this.options.count-1])==null?void 0:n.end)||this.options.paddingStart)+this.options.paddingEnd},this._scrollToOffset=(n,i)=>{clearTimeout(this.scrollCheckFrame),this.destinationOffset=n,this.options.scrollToFn(n,this.options.enableSmoothScroll&&i,this);let o;const a=()=>{let s=this.scrollOffset;this.scrollCheckFrame=o=setTimeout(()=>{if(this.scrollCheckFrame===o){if(this.scrollOffset===s){this.destinationOffset=void 0;return}s=this.scrollOffset,a()}},100)};a()},this.measure=()=>{this.itemMeasurementsCache={},this.notify()},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset}}const F6=(e,t,r,n)=>{for(;e<=t;){const i=(e+t)/2|0,o=r(i);if(o<n)e=i+1;else if(o>n)t=i-1;else return i}return e>0?e-1:0};function L6(e){let{measurements:t,outerSize:r,scrollOffset:n}=e;const i=t.length-1,a=F6(0,i,c=>t[c].start,n);let s=a;for(;s<i&&t[s].end<n+r;)s++;return{startIndex:a,endIndex:s}}function M6(e){const t=Su(e),r=new R6(t),[n,i]=yn(r.getVirtualItems()),[o,a]=L(r.getTotalSize()),s={get(l,u){switch(u){case"getVirtualItems":return()=>n;case"getTotalSize":return()=>o();default:return Reflect.get(l,u)}}},c=new Proxy(r,s);return c.setOptions(t),Tt(()=>{const l=c._didMount();c._willUpdate(),Il(l)}),h$(()=>{c.setOptions(Su(t,e,{onChange:l=>{l._willUpdate(),i(Z9(l.getVirtualItems(),{key:"index"})),a(l.getTotalSize()),e.onChange==null||e.onChange(l)}})),c.measure()}),c}function $v(e){return M6(Su({observeElementRect:N6,observeElementOffset:I6,scrollToFn:D6},e))}const j6=O('<div slot="suffix" class="flex"><sl-icon class="text-gray-400 hover:text-gray-600" name="x-circle-fill"></sl-icon></div>'),iu=O("<sl-menu-item></sl-menu-item>"),z6=O('<sl-menu-item><p class="text-center text-gray-400 italic">Loading...</p></sl-menu-item>'),U6=O('<div><style></style><style></style><style></style><style></style><sl-dropdown class="dropdown relative" hoist><sl-input slot="trigger" size="medium" class="input"><p slot="help-text" class="text-red-500 pt-2 font-sans"></p><div slot="suffix" class="flex"><sl-spinner slot="suffix"></sl-spinner></div><div slot="suffix" class="flex"><sl-icon></sl-icon></div></sl-input><div class="border border-gray-200 dropdown-container overflow-hidden relative"><div class="bg-white pt-2 overflow-x-hidden overflow-y-auto relative"><div></div></div></div></sl-dropdown></div>'),V6=O('<div class="flex items-center pt-2 pb-2"><p class="text-gray-700 text-sm font-sans"></p></div>'),B6=O('<p class="pl-1 text-red-500">*</p>'),W6=O('<p class="text-gray-400 text-xs pl-2 font-sans">Optional</p>'),wv=O('<p class="text-center text-gray-400 italic">Loading...</p>'),_v=O('<p class="text-center text-gray-400 italic">Nothing more to load</p>'),q6=O("<p></p>"),H6=O('<sl-menu-item class="group"></sl-menu-item>'),G6=O('<p class="overflow-hidden overflow-ellipsis whitespace-nowrap"></p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const Nt=e=>{let t,r,n,i,o;e.actionRef&&(e.actionRef.clear=()=>{d(void 0),h(-1),i.value="",b(""),E()});const[a,s]=L(!1),[c,l]=L(""),[u,d]=L(),[f,h]=L(-1),[p,m]=L($v({count:e.data.length,getScrollElement:()=>n,estimateSize:()=>36.8,overscan:25})),[v,y]=L(),b=X1(async S=>{l(S),e.onSearchChange&&await e.onSearchChange(S)},250),g=new IntersectionObserver(async S=>{S.at(-1)?.isIntersecting&&e.hasMore&&e.fetchMore&&await e.fetchMore(c())});ge(()=>{v()&&g.observe(v())});const w=S=>{if(S)return e.helpText?e.helpText:e.required?"Please select data...":void 0},x=S=>{const T=new CustomEvent("photon-data-selected",{composed:!0,bubbles:!0,detail:{data:S}});t?.dispatchEvent(T)},E=()=>{const S=new CustomEvent("photon-data-unselected",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(S)};return ge(()=>{e.selectedData&&(d(e.selectedData),x(e.selectedData)),e.selectedData===void 0&&d(void 0)}),ge(()=>{const S=e.data.length*36.8;n.style.minHeight=`${S}px`;const T=$v({count:e.hasMore?e.data.length+1:e.data.length,getScrollElement:()=>n,estimateSize:()=>36.8,overscan:e.fetchMore?25:e.data.length});m(T)}),Tt(()=>{i&&i.addEventListener("keydown",S=>{(S.code=="Space"||S.key==" ")&&S.stopImmediatePropagation()})}),(()=>{const S=V(()=>document.importNode(U6,!0)),T=S.firstChild,M=T.nextSibling,F=M.nextSibling,K=F.nextSibling,D=K.nextSibling,R=D.firstChild,U=R.firstChild,j=U.nextSibling,Y=j.firstChild,oe=j.nextSibling,ae=oe.firstChild,A=R.nextSibling,me=A.firstChild,xe=me.firstChild,I=t;typeof I=="function"?ee(I,S):t=S,_(T,ze),_(M,Vt),_(F,Ut),_(K,S6),_(S,(()=>{const H=fe(()=>!!e.label);return()=>H()?(()=>{const Q=V6.cloneNode(!0),X=Q.firstChild;return _(X,()=>e.label),_(Q,(()=>{const ne=fe(()=>!!e.required);return()=>ne()?B6.cloneNode(!0):null})(),null),_(Q,(()=>{const ne=fe(()=>!!e.optional);return()=>ne()?W6.cloneNode(!0):null})(),null),Q})():null})(),D);const xt=r;typeof xt=="function"?ee(xt,D):r=D,D.addEventListener("sl-hide",async()=>{u()||(i.value="",l(""),e.onHide&&await e.onHide()),s(!1)}),D.addEventListener("sl-show",async()=>{s(!0),e.onOpen&&await e.onOpen()}),D.style.setProperty("width","100%"),D._$owner=P();const St=i;typeof St=="function"?ee(St,R):i=R,R.addEventListener("sl-input",H=>{a()||r.show(),b(H.target.value)}),R.addEventListener("sl-focus",()=>{r.children[1].style.width=`${i.clientWidth}px`,f()>0&&p().scrollToIndex(f())}),R._$owner=P(),_(U,()=>w(e.invalid??!1)),Y._$owner=P(),_(R,z(re,{get when(){return e.clearable},get children(){const H=V(()=>document.importNode(j6,!0)),Q=H.firstChild;return Q.addEventListener("click",X=>{X.stopImmediatePropagation(),d(void 0),h(-1),i.value="",b(""),E(),r.hide()}),Q._$owner=P(),W(()=>H.classList.toggle("hidden",!!(e.isLoading||u()==null))),H}}),oe),ae._$owner=P();const Mt=o;typeof Mt=="function"?ee(Mt,me):o=me,me.style.setProperty("max-height","200px"),me.style.setProperty("min-height","56px"),me.style.setProperty("width","100%");const It=n;return typeof It=="function"?ee(It,xe):n=xe,xe.style.setProperty("min-height","36.8px"),xe.style.setProperty("width","100%"),_(xe,z(re,{get when(){return e.data.length>0&&!e.groups},get children(){return p().getVirtualItems().map(H=>{const Q=H.index>e.data.length-1,X=e.data[H.index];return(()=>{const ne=V(()=>document.importNode(iu,!0));return ee(ue=>{Q&&H.index>0&&y(ue)},ne),ne.$$click=()=>{Q||(d(X),h(H.index),i.value="",b(""),x(X),r.hide())},ne.style.setProperty("width","100%"),ne._$owner=P(),_(ne,()=>Q?e.hasMore?wv.cloneNode(!0):_v.cloneNode(!0):(()=>{const ue=q6.cloneNode(!0);return _(ue,()=>e.displayAccessor(X,!0)),W(de=>{const Ue=!e.showOverflow,Me=!e.showOverflow,st=!e.showOverflow,dr=!!e.showOverflow;return Ue!==de._v$14&&ue.classList.toggle("overflow-hidden",de._v$14=Ue),Me!==de._v$15&&ue.classList.toggle("overflow-ellipsis",de._v$15=Me),st!==de._v$16&&ue.classList.toggle("whitespace-nowrap",de._v$16=st),dr!==de._v$17&&ue.classList.toggle("whitespace-normal",de._v$17=dr),de},{_v$14:void 0,_v$15:void 0,_v$16:void 0,_v$17:void 0}),ue})()),W(ue=>{const de=X&&X.id===u()?.id&&!Q?"selected default":"default",Ue=`${H.size}px`;return de!==ue._v$12&&_p(ne,ue._v$12=de),Ue!==ue._v$13&&ne.style.setProperty("min-height",ue._v$13=Ue),ue},{_v$12:void 0,_v$13:void 0}),ne})()})}}),null),_(xe,z(re,{get when(){return e.data.length>0&&e.groups&&e.groups.length>0},get children(){return z(Rl,{get each(){return e.groups||[]},children:H=>[(()=>{const Q=V(()=>document.importNode(H6,!0));return Q._$owner=P(),_(Q,()=>H.label),W(()=>Q.classList.toggle("hidden",p().getVirtualItems().filter(X=>H.filter(e.data[X.index])).length===0)),Q})(),fe(()=>p().getVirtualItems().filter(Q=>H.filter(e.data[Q.index])).map(Q=>{const X=Q.index>e.data.length-1,ne=e.data[Q.index];return(()=>{const ue=V(()=>document.importNode(iu,!0));return ee(de=>{X&&Q.index>0&&y(de)},ue),ue.$$click=()=>{X||(d(ne),h(Q.index),i.value="",b(""),x(ne),r.hide())},ue.style.setProperty("width","100%"),ue._$owner=P(),_(ue,()=>X?e.hasMore?wv.cloneNode(!0):_v.cloneNode(!0):(()=>{const de=G6.cloneNode(!0);return _(de,()=>e.displayAccessor(ne,!0)),de})()),W(de=>{const Ue=ne&&ne.id===u()?.id&&!X?"selected default group-member":"default group-member",Me=`${Q.size}px`;return Ue!==de._v$18&&_p(ue,de._v$18=Ue),Me!==de._v$19&&ue.style.setProperty("min-height",de._v$19=Me),de},{_v$18:void 0,_v$19:void 0}),ue})()}))]})}}),null),_(xe,z(re,{get when(){return e.data.length==0&&!e.isLoading},get children(){const H=V(()=>document.importNode(iu,!0));return H._$owner=P(),_(H,()=>e.noDataMsg?e.noDataMsg:"No data found"),H}}),null),_(xe,z(re,{get when(){return e.data.length==0&&e.isLoading},get children(){const H=V(()=>document.importNode(z6,!0));return H._$owner=P(),H}}),null),W(H=>{const Q=e.forceLabelSize&&!e.invalid?-20:e.invalid?-18:0,X=e.disabled??!1,ne=u()?e.displayAccessor(u(),!1):e.placeholder??"Select data...",ue=e.disabled??!1,de=!!(e.invalid??!1),Ue=!!(e.disabled??!1),Me=e.required,st=!!e.forceLabelSize,dr=!e.isLoading,gn=!!e.isLoading,Vr=a()?"chevron-up":"chevron-down";return Q!==H._v$&&(D.distance=H._v$=Q),X!==H._v$2&&(D.disabled=H._v$2=X),ne!==H._v$3&&(R.placeholder=H._v$3=ne),ue!==H._v$4&&(R.disabled=H._v$4=ue),de!==H._v$5&&R.classList.toggle("invalid",H._v$5=de),Ue!==H._v$6&&R.classList.toggle("disabled",H._v$6=Ue),Me!==H._v$7&&(R.required=H._v$7=Me),st!==H._v$8&&U.classList.toggle("h-[28px]",H._v$8=st),dr!==H._v$9&&j.classList.toggle("hidden",H._v$9=dr),gn!==H._v$10&&oe.classList.toggle("hidden",H._v$10=gn),Vr!==H._v$11&&(ae.name=H._v$11=Vr),H},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0}),S})()};Ni(["click"]);const xv=Wo`
1837
1838
  fragment PatientOrderFields on Patient {
1838
1839
  id
1839
1840
  externalId
@@ -1874,7 +1875,7 @@ lit-html/directives/unsafe-svg.js:
1874
1875
  phone
1875
1876
  }
1876
1877
  }
1877
- `,Q6=()=>{const[e,t]=yn({patients:{data:[],errors:[],isLoading:!1,finished:!1},selectedPatient:{data:void 0,errors:[],isLoading:!1}}),r=async(s,c)=>{t("selectedPatient",{...e.selectedPatient,isLoading:!0});const{data:l,errors:u}=await s.clinical.patient.getPatient({id:c,fragment:{PatientOrderFields:xv}});t("selectedPatient",{...e.selectedPatient,isLoading:!1,data:l.patient,errors:u})},n=async(s,c)=>{c||(c={}),t("patients",{...e.patients,isLoading:!0});const{data:l,errors:u}=await s.clinical.patient.getPatients({first:c.first,name:c.name,fragment:{PatientOrderFields:xv}});return t("patients",{...e.patients,isLoading:!1,errors:u,data:l.patients,finished:l.patients.length===0}),(!u||u.length===0)&&l.patients.length>0?()=>i(s,{...c,after:l.patients.at(-1).id}):void 0},i=async(s,c)=>{t("patients",{...e.patients,isLoading:!0});const{data:l,errors:u}=await s.clinical.patient.getPatients(c);return t("patients",{...e.patients,isLoading:!1,errors:u,data:[...e.patients.data,...l.patients],finished:l.patients.length===0}),(!u||u.length===0)&&l.patients.length>0?()=>i(s,{...c,after:l.patients.at(-1).id}):void 0};return{store:e,actions:{getPatients:n,getSelectedPatient:r,clearSelectedPatient:async()=>{t("selectedPatient",{...e.selectedPatient,data:void 0})},reset:async()=>{t("patients",{data:[],errors:[],isLoading:!1,finished:!1}),t("selectedPatient",{data:void 0,errors:[],isLoading:!1})}}}},nc=Q6(),K6=O("<div></div>");we("photon-patient-select",{label:void 0,required:!1,invalid:!1,helpText:void 0,selected:void 0,formName:void 0,disabled:!1,forceLabelSize:!1,sdk:void 0},e=>{let t;const r=rt(),{store:n,actions:i}=nc;let o;Tt(()=>{i.reset()});const a=c=>{const l=new CustomEvent("photon-patient-selected",{composed:!0,bubbles:!0,detail:{patient:c}});t?.dispatchEvent(l)},s=pe(()=>n.selectedPatient.data?[n.selectedPatient.data,...n.patients.data.filter(c=>c.id!==n.selectedPatient.data.id)]:n.patients.data);return ge(async()=>{e.selected&&!n.selectedPatient.data&&V(async()=>{await i.getSelectedPatient(r?r.getSDK():e.sdk,e.selected)})}),(()=>{const c=K6.cloneNode(!0),l=t;return typeof l=="function"?ee(l,c):t=c,c.addEventListener("photon-data-selected",u=>{a(u.detail.data)}),_(c,z(Nt,{get data(){return s()},get label(){return e.label},get forceLabelSize(){return e.forceLabelSize},get required(){return e.required},get disabled(){return e.disabled},placeholder:"Select patient...",get invalid(){return e.invalid},get isLoading(){return n.patients.isLoading||n.selectedPatient.isLoading},get hasMore(){return n.patients.data.length%25===0&&!n.patients.finished},displayAccessor:u=>u.name.full,onSearchChange:async u=>o=await i.getPatients(r.getSDK(),{name:u}),onOpen:async()=>{n.patients.data.length==0&&(o=await i.getPatients(r.getSDK()))},onHide:async()=>{o=await i.getPatients(r.getSDK())},fetchMore:async u=>{o&&(o=await o())},noDataMsg:"No patients found",get helpText(){return e.helpText},get selectedData(){return n.selectedPatient.data}})),c})()});const ou=O("<style></style>"),Y6=O("<slot></slot>"),X6=O("<photon-login></photon-login>"),Z6=O('<div class="w-full flex justify-center"><sl-spinner style="font-size: 3rem;"></sl-spinner></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-auth-wrapper",{autoLogin:!1,hideLoader:!1,redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},e=>{const t=rt(),[r,n]=L(!1),[i,o]=L(!0);return ge(()=>{t||console.error("[photon-auth-wrapper] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),ge(()=>{if(t?.authentication.state.isLoading)o(!0);else{if(o(!1),!t?.authentication.state.isAuthenticated&&e.autoLogin){const a={appState:{}};e.redirectPath&&(a.appState.returnTo=e.redirectPath),t?.authentication.login(a)}n(t?.authentication.state.isAuthenticated||!1)}},[t?.authentication.state.isAuthenticated,t?.authentication.state.isLoading]),[(()=>{const a=ou.cloneNode(!0);return _(a,ze),a})(),(()=>{const a=ou.cloneNode(!0);return _(a,Vt),a})(),(()=>{const a=ou.cloneNode(!0);return _(a,Ut),a})(),z(re,{get when(){return t&&r()},get children(){const a=Y6.cloneNode(!0);return a._$owner=P(),a}}),z(re,{get when(){return t&&!r()&&!i()&&!e.autoLogin},get children(){const a=V(()=>document.importNode(X6,!0));return a._$owner=P(),W(()=>a.redirectPath=e.redirectPath),a}}),z(re,{get when(){return t&&i()&&!e.hideLoader},get children(){const a=V(()=>document.importNode(Z6,!0)),s=a.firstChild;return s._$owner=P(),a}})]});var J6=ft`
1878
+ `,Q6=()=>{const[e,t]=yn({patients:{data:[],errors:[],isLoading:!1,finished:!1},selectedPatient:{data:void 0,errors:[],isLoading:!1}}),r=async(s,c)=>{t("selectedPatient",{...e.selectedPatient,isLoading:!0});const{data:l,errors:u}=await s.clinical.patient.getPatient({id:c,fragment:{PatientOrderFields:xv}});t("selectedPatient",{...e.selectedPatient,isLoading:!1,data:l.patient,errors:u})},n=async(s,c)=>{c||(c={}),t("patients",{...e.patients,isLoading:!0});const{data:l,errors:u}=await s.clinical.patient.getPatients({first:c.first,name:c.name,fragment:{PatientOrderFields:xv}});return t("patients",{...e.patients,isLoading:!1,errors:u,data:l.patients,finished:l.patients.length===0}),(!u||u.length===0)&&l.patients.length>0?()=>i(s,{...c,after:l.patients.at(-1).id}):void 0},i=async(s,c)=>{t("patients",{...e.patients,isLoading:!0});const{data:l,errors:u}=await s.clinical.patient.getPatients(c);return t("patients",{...e.patients,isLoading:!1,errors:u,data:[...e.patients.data,...l.patients],finished:l.patients.length===0}),(!u||u.length===0)&&l.patients.length>0?()=>i(s,{...c,after:l.patients.at(-1).id}):void 0};return{store:e,actions:{getPatients:n,getSelectedPatient:r,clearSelectedPatient:async()=>{t("selectedPatient",{...e.selectedPatient,data:void 0})},reset:async()=>{t("patients",{data:[],errors:[],isLoading:!1,finished:!1}),t("selectedPatient",{data:void 0,errors:[],isLoading:!1})}}}},nc=Q6(),K6=O("<div></div>");we("photon-patient-select",{label:void 0,required:!1,invalid:!1,helpText:void 0,selected:void 0,formName:void 0,disabled:!1,forceLabelSize:!1,sdk:void 0},e=>{let t;const r=rt(),{store:n,actions:i}=nc;let o;Tt(()=>{i.reset()});const a=c=>{const l=new CustomEvent("photon-patient-selected",{composed:!0,bubbles:!0,detail:{patient:c}});t?.dispatchEvent(l)},s=fe(()=>n.selectedPatient.data?[n.selectedPatient.data,...n.patients.data.filter(c=>c.id!==n.selectedPatient.data.id)]:n.patients.data);return ge(async()=>{e.selected&&!n.selectedPatient.data&&V(async()=>{await i.getSelectedPatient(r?r.getSDK():e.sdk,e.selected)})}),(()=>{const c=K6.cloneNode(!0),l=t;return typeof l=="function"?ee(l,c):t=c,c.addEventListener("photon-data-selected",u=>{a(u.detail.data)}),_(c,z(Nt,{get data(){return s()},get label(){return e.label},get forceLabelSize(){return e.forceLabelSize},get required(){return e.required},get disabled(){return e.disabled},placeholder:"Select patient...",get invalid(){return e.invalid},get isLoading(){return n.patients.isLoading||n.selectedPatient.isLoading},get hasMore(){return n.patients.data.length%25===0&&!n.patients.finished},displayAccessor:u=>u.name.full,onSearchChange:async u=>o=await i.getPatients(r.getSDK(),{name:u}),onOpen:async()=>{n.patients.data.length==0&&(o=await i.getPatients(r.getSDK()))},onHide:async()=>{o=await i.getPatients(r.getSDK())},fetchMore:async u=>{o&&(o=await o())},noDataMsg:"No patients found",get helpText(){return e.helpText},get selectedData(){return n.selectedPatient.data}})),c})()});const ou=O("<style></style>"),Y6=O("<slot></slot>"),X6=O("<photon-login></photon-login>"),Z6=O('<div class="w-full flex justify-center"><sl-spinner style="font-size: 3rem;"></sl-spinner></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-auth-wrapper",{autoLogin:!1,hideLoader:!1,redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},e=>{const t=rt(),[r,n]=L(!1),[i,o]=L(!0);return ge(()=>{t||console.error("[photon-auth-wrapper] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),ge(()=>{if(t?.authentication.state.isLoading)o(!0);else{if(o(!1),!t?.authentication.state.isAuthenticated&&e.autoLogin){const a={appState:{}};e.redirectPath&&(a.appState.returnTo=e.redirectPath),t?.authentication.login(a)}n(t?.authentication.state.isAuthenticated||!1)}},[t?.authentication.state.isAuthenticated,t?.authentication.state.isLoading]),[(()=>{const a=ou.cloneNode(!0);return _(a,ze),a})(),(()=>{const a=ou.cloneNode(!0);return _(a,Vt),a})(),(()=>{const a=ou.cloneNode(!0);return _(a,Ut),a})(),z(re,{get when(){return t&&r()},get children(){const a=Y6.cloneNode(!0);return a._$owner=P(),a}}),z(re,{get when(){return t&&!r()&&!i()&&!e.autoLogin},get children(){const a=V(()=>document.importNode(X6,!0));return a._$owner=P(),W(()=>a.redirectPath=e.redirectPath),a}}),z(re,{get when(){return t&&i()&&!e.hideLoader},get children(){const a=V(()=>document.importNode(Z6,!0)),s=a.firstChild;return s._$owner=P(),a}})]});var J6=ft`
1878
1879
  ${wt}
1879
1880
 
1880
1881
  :host {
@@ -2872,7 +2873,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2872
2873
  ${this.caret?Ia` <sl-icon part="caret" class="button__caret" library="system" name="caret"></sl-icon> `:""}
2873
2874
  ${this.loading?Ia`<sl-spinner></sl-spinner>`:""}
2874
2875
  </${t}>
2875
- `}};Ce.styles=rP;$([Xe(".button")],Ce.prototype,"button",2);$([Er()],Ce.prototype,"hasFocus",2);$([Er()],Ce.prototype,"invalid",2);$([k()],Ce.prototype,"title",2);$([k({reflect:!0})],Ce.prototype,"variant",2);$([k({reflect:!0})],Ce.prototype,"size",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"caret",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"disabled",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"loading",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"outline",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"pill",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"circle",2);$([k()],Ce.prototype,"type",2);$([k()],Ce.prototype,"name",2);$([k()],Ce.prototype,"value",2);$([k()],Ce.prototype,"href",2);$([k()],Ce.prototype,"target",2);$([k()],Ce.prototype,"download",2);$([k()],Ce.prototype,"form",2);$([k({attribute:"formaction"})],Ce.prototype,"formAction",2);$([k({attribute:"formenctype"})],Ce.prototype,"formEnctype",2);$([k({attribute:"formmethod"})],Ce.prototype,"formMethod",2);$([k({attribute:"formnovalidate",type:Boolean})],Ce.prototype,"formNoValidate",2);$([k({attribute:"formtarget"})],Ce.prototype,"formTarget",2);$([De("disabled",{waitUntilFirstUpdate:!0})],Ce.prototype,"handleDisabledChange",1);Ce=$([_t("sl-button")],Ce);const nP=O('<photon-checkbox label="Add To Templates" form-name="daw"></photon-checkbox>'),iP=O('<photon-card title="Add Prescription"><div class="flex flex-col gap-3"><photon-treatment-select label="Search Treatment Catalog"></photon-treatment-select><div class="flex flex-col-reverse xs:flex-row xs:items-center gap-2"><photon-checkbox label="Dispense as written" tip="This prescription will be filled generically unless this box is checked" form-name="daw" class="flex-grow"></photon-checkbox><photon-med-search-dialog></photon-med-search-dialog><a class="font-sans text-gray-500 text-sm hover:text-black hover:cursor-pointer pt-1">Advanced Search \u2192</a></div><div class="sm:max-w-[50%] sm:pr-2"><photon-datepicker label="Effective Date" required="true"></photon-datepicker></div><div class="flex flex-col sm:flex-wrap sm:flex-row sm:items-start sm:gap-x-4"><div class="flex flex-col flex-1 flex-shrink md:max-w-[50%]"><photon-number-input class="flex-grow flex-1" label="Quantity" required="true" min="1"></photon-number-input><photon-dosage-calculator-dialog></photon-dosage-calculator-dialog><photon-button variant="outline" class="w-fit"><sl-icon slot="suffix" name="calculator"></sl-icon>Dose Calculator</photon-button></div><photon-dispense-units class="flex-grow flex-shrink md:max-w-[50%] flex-1" label="Dispense Unit" required="true" force-label-size="true"></photon-dispense-units></div><div class="flex flex-col sm:flex-wrap sm:flex-row sm:items-center sm:gap-x-4"><photon-number-input class="flex-grow flex-shrink md:max-w-[50%] flex-1" label="Days Supply" required="true" min="0"></photon-number-input><photon-number-input class="flex-grow flex-shrink md:max-w-[50%] flex-1" label="Refills" required="true" min="0"></photon-number-input></div><photon-textarea label="Patient Instructions (SIG)" form-name="patient_instructions" required="true" placeholder="Enter patient instructions"></photon-textarea><photon-textarea label="Pharmacy Note" placeholder="Enter pharmacy note"></photon-textarea><div class="flex flex-col xs:flex-row gap-2"><div class="flex flex-grow justify-end"><photon-button class="w-full xs:w-fit">Add Prescription</photon-button></div></div></div></photon-card>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const oP={treatment:ot(ic(jt(),Bi()),"Please select a treatment..."),dispenseQuantity:ot(su(au(),1),"Quantity must be positive"),daysSupply:ot(su(au(),0),"Days Supply must be at least 0"),refillsInput:ot(su(au(),0),"Refills must be at least 0"),instructions:ot(Nr(jt(),1,1/0),"Please enter instructions for the patient..."),effectiveDate:ot(JC(new Date),"Please choose a date that isn't in the past")},aP=e=>{let t,r;const[n,i]=L(void 0),[o,a]=L(void 0);let s;for(const[c,l]of Object.entries(oP))e.actions.registerValidator({key:c,validator:l});return(()=>{const c=V(()=>document.importNode(iP,!0)),l=c.firstChild,u=l.firstChild,d=u.nextSibling,f=d.firstChild,h=f.nextSibling,p=h.nextSibling,m=d.nextSibling,v=m.firstChild,y=m.nextSibling,b=y.firstChild,g=b.firstChild,w=g.nextSibling,x=w.nextSibling,E=x.firstChild,S=b.nextSibling,T=y.nextSibling,M=T.firstChild,F=M.nextSibling,K=T.nextSibling,D=K.nextSibling,R=D.nextSibling,U=R.firstChild,j=U.firstChild,Y=s;typeof Y=="function"?ee(Y,c):s=c,c._$owner=P(),l.addEventListener("photon-medication-selected",A=>{i(A.detail.medication),e.actions.updateFormValue({key:"treatment",value:A.detail.medication})}),u.addEventListener("photon-treatment-selected",A=>{A.detail.data.__typename==="PrescriptionTemplate"?(e.actions.updateFormValue({key:"treatment",value:A.detail.data.treatment}),A.detail.data.dispenseAsWritten&&e.actions.updateFormValue({key:"dispenseAsWritten",value:A.detail.data.dispenseAsWritten}),A.detail.data.dispenseQuantity&&e.actions.updateFormValue({key:"dispenseQuantity",value:Number(A.detail.data.dispenseQuantity)}),A.detail.data.dispenseUnit&&e.actions.updateFormValue({key:"dispenseUnit",value:A.detail.data.dispenseUnit}),A.detail.data.daysSupply&&e.actions.updateFormValue({key:"daysSupply",value:Number(A.detail.data.daysSupply)}),A.detail.data.fillsAllowed&&e.actions.updateFormValue({key:"refillsInput",value:Number(A.detail.data.fillsAllowed)-1}),A.detail.data.instructions&&e.actions.updateFormValue({key:"instructions",value:A.detail.data.instructions}),A.detail.data.notes&&e.actions.updateFormValue({key:"notes",value:A.detail.data.notes})):e.actions.updateFormValue({key:"treatment",value:A.detail.data}),e.actions.updateFormValue({key:"catalogId",value:A.detail.catalogId})}),u._$owner=P(),f.addEventListener("photon-checkbox-toggled",A=>e.actions.updateFormValue({key:"dispenseAsWritten",value:A.detail.checked})),f._$owner=P();const oe=t;typeof oe=="function"?ee(oe,h):t=h,h._$owner=P(),p.$$click=()=>t.open=!0,v.addEventListener("photon-datepicker-selected",A=>e.actions.updateFormValue({key:"effectiveDate",value:A.detail.date})),v._$owner=P(),g.addEventListener("photon-input-changed",A=>{e.actions.updateFormValue({key:"dispenseQuantity",value:Number(A.detail.input)})}),g._$owner=P();const ae=r;return typeof ae=="function"?ee(ae,w):r=w,w.addEventListener("photon-dose-selected",A=>{e.actions.updateFormValue({key:"dispenseQuantity",value:Number(A.detail.value)}),A.detail.unit==="mL"&&e.actions.updateFormValue({key:"dispenseUnit",value:"Milliliter"})}),w._$owner=P(),x.addEventListener("photon-clicked",()=>{r.open=!0}),x._$owner=P(),E._$owner=P(),S.addEventListener("photon-dispense-unit-selected",A=>e.actions.updateFormValue({key:"dispenseUnit",value:A.detail.dispenseUnit.name})),S._$owner=P(),M.addEventListener("photon-input-changed",A=>{e.actions.updateFormValue({key:"daysSupply",value:Number(A.detail.input)})}),M._$owner=P(),F.addEventListener("photon-input-changed",A=>e.actions.updateFormValue({key:"refillsInput",value:Number(A.detail.input)})),F._$owner=P(),K.addEventListener("photon-textarea-changed",A=>e.actions.updateFormValue({key:"instructions",value:A.detail.value})),K._$owner=P(),D.addEventListener("photon-textarea-changed",A=>e.actions.updateFormValue({key:"notes",value:A.detail.value})),D._$owner=P(),_(R,z(re,{get when(){return!e.hideAddToTemplates},get children(){const A=V(()=>document.importNode(nP,!0));return A.addEventListener("photon-checkbox-toggled",me=>e.actions.updateFormValue({key:"addToTemplates",value:me.detail.checked})),A._$owner=P(),W(()=>A.checked=e.store.addToTemplates?.value||!1),A}}),U),j.addEventListener("photon-clicked",()=>{const A=["treatment","effectiveDate","dispenseQuantity","daysSupply","refillsInput","instructions"];e.actions.validate(A),e.actions.hasErrors(A)||(e.actions.updateFormValue({key:"draftPrescriptions",value:[...e.store.draftPrescriptions?.value||[],{id:String(Math.random()),effectiveDate:e.store.effectiveDate.value,treatment:e.store.treatment.value,dispenseAsWritten:e.store.dispenseAsWritten.value,dispenseQuantity:e.store.dispenseQuantity.value,dispenseUnit:e.store.dispenseUnit.value,daysSupply:e.store.daysSupply.value,refillsInput:e.store.refillsInput.value,instructions:e.store.instructions.value,notes:e.store.notes.value,fillsAllowed:e.store.refillsInput.value+1,addToTemplates:e.store.addToTemplates?.value??!1,catalogId:e.store.catalogId.value??void 0}]}),e.actions.updateFormValue({key:"effectiveDate",value:oc(new Date,"yyyy-MM-dd").toString()}),e.actions.clearKeys(["treatment","dispenseAsWritten","dispenseQuantity","dispenseUnit","daysSupply","refillsInput","instructions","notes"]),i(void 0),e.actions.updateFormValue({key:"treatment",value:void 0}),e.actions.updateFormValue({key:"refillsInput",value:0}),e.actions.updateFormValue({key:"dispenseAsWritten",value:!1}),e.actions.updateFormValue({key:"dispenseQuantity",value:1}),e.actions.updateFormValue({key:"daysSupply",value:30}),e.actions.updateFormValue({key:"instructions",value:""}),e.actions.updateFormValue({key:"notes",value:""}))}),j._$owner=P(),W(A=>{const me=e.store.treatment?.value??void 0,xe=e.store.treatment?.error??!1,I=e.store.treatment?.error,xt=n(),St=e.store.effectiveDate?.error??!1,Mt=e.store.effectiveDate?.error,It=e.store.dispenseQuantity?.error??!1,H=e.store.dispenseQuantity?.error,Q=e.store.treatment?.value??void 0,X=e.store.dispenseUnit?.value??o()?.name,ne=e.store.daysSupply?.error??!1,ue=e.store.daysSupply?.error,de=e.store.refillsInput?.error??!1,Ue=e.store.refillsInput?.error,Me=e.store.instructions?.error??!1,st=e.store.instructions?.error;return me!==A._v$&&(u.selected=A._v$=me),xe!==A._v$2&&(u.invalid=A._v$2=xe),I!==A._v$3&&(u.helpText=A._v$3=I),xt!==A._v$4&&(u.offCatalogOption=A._v$4=xt),St!==A._v$5&&(v.invalid=A._v$5=St),Mt!==A._v$6&&(v.helpText=A._v$6=Mt),It!==A._v$7&&(g.invalid=A._v$7=It),H!==A._v$8&&(g.helpText=A._v$8=H),Q!==A._v$9&&(w.medication=A._v$9=Q),X!==A._v$10&&(S.selected=A._v$10=X),ne!==A._v$11&&(M.invalid=A._v$11=ne),ue!==A._v$12&&(M.helpText=A._v$12=ue),de!==A._v$13&&(F.invalid=A._v$13=de),Ue!==A._v$14&&(F.helpText=A._v$14=Ue),Me!==A._v$15&&(K.invalid=A._v$15=Me),st!==A._v$16&&(K.helpText=A._v$16=st),A},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0,_v$12:void 0,_v$13:void 0,_v$14:void 0,_v$15:void 0,_v$16:void 0}),W(()=>f.checked=e.store.dispenseAsWritten?.value||!1),W(()=>g.value=e.store.dispenseQuantity?.value??1),W(()=>M.value=e.store.daysSupply?.value??30),W(()=>F.value=e.store.refillsInput?.value??0),W(()=>K.value=e.store.instructions?.value),W(()=>D.value=e.store.notes?.value),c})()};Ni(["click"]);const sP=O("<photon-patient-dialog></photon-patient-dialog>"),lP=O('<p class="font-sans text-sm font-medium">Patient Address</p>'),cP=O('<div class="flex flex-col font-sans text-gray-700"><p></p><div class="flex flex-row gap-1"><div class="flex flex-row"><p>,</p><p></p></div><p></p></div></div>'),uP=O('<p class="italic font-sans text-gray-500">Please edit patient and add address</p>'),dP=O('<p class="font-sans text-red-500 text-sm"></p>'),fP=O('<photon-button class="self-end" variant="outline">Edit Patient</photon-button>'),hP=O('<photon-card><div class="flex flex-col gap-3"><p class="font-sans text-l font-medium">Select Patient</p><photon-patient-select></photon-patient-select></div></photon-card>'),pP=O("<p></p>"),mP=ot(ic(jt(),Bi()),"Please select a patient..."),vP=ot(ic(jt(),Bi()),"Please enter an address for patient..."),yP=e=>{const[t,r]=L(!1),{actions:n}=nc;return e.actions.registerValidator({key:"patient",validator:mP}),e.enableOrder&&e.actions.registerValidator({key:"address",validator:vP}),(()=>{const i=V(()=>document.importNode(hP,!0)),o=i.firstChild,a=o.firstChild,s=a.nextSibling;return i._$owner=P(),s.addEventListener("photon-patient-selected",c=>{e.actions.updateFormValue({key:"patient",value:c.detail.patient}),e.enableOrder&&e.actions.updateFormValue({key:"address",value:c.detail.patient.address})}),s._$owner=P(),_(o,z(re,{get when(){return e.store.patient?.value?.id&&e.enableOrder},get children(){return[(()=>{const c=V(()=>document.importNode(sP,!0));return c.addEventListener("photon-patient-updated",()=>{n.getSelectedPatient(e.client.getSDK(),e.store.patient?.value?.id)}),c._$owner=P(),W(l=>{const u=t(),d=e.store.patient.value.id;return u!==l._v$&&(c.open=l._v$=u),d!==l._v$2&&(c.patientId=l._v$2=d),l},{_v$:void 0,_v$2:void 0}),c})(),z(re,{get when(){return e.store.patient?.value},get children(){return[lP.cloneNode(!0),z(re,{get when(){return e.store.patient.value.address},get children(){const c=cP.cloneNode(!0),l=c.firstChild,u=l.nextSibling,d=u.firstChild,f=d.firstChild,h=f.firstChild,p=f.nextSibling,m=d.nextSibling;return _(l,()=>e.store.patient.value.address.street1),_(c,(()=>{const v=pe(()=>!!e.store.patient.value.address.street2);return()=>v()?(()=>{const y=pP.cloneNode(!0);return _(y,()=>e.store.patient.value.address.street2),y})():null})(),u),_(f,()=>e.store.patient.value.address.city,h),_(p,()=>e.store.patient.value.address.state),_(m,()=>e.store.patient.value.address.postalCode),c}}),z(re,{get when(){return!e.store.patient.value.address},get children(){return[(()=>{const c=uP.cloneNode(!0);return W(l=>{const u=!!e.store.address.error,d=!!e.store.address.error,f=!!e.store.address.error,h=!!e.store.address.error;return u!==l._v$3&&c.classList.toggle("p-2",l._v$3=u),d!==l._v$4&&c.classList.toggle("border-red-500",l._v$4=d),f!==l._v$5&&c.classList.toggle("border-2",l._v$5=f),h!==l._v$6&&c.classList.toggle("rounded",l._v$6=h),l},{_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0}),c})(),z(re,{get when(){return e.store.address.error},get children(){const c=dP.cloneNode(!0);return _(c,()=>e.store.address.error),c}})]}})]}}),(()=>{const c=V(()=>document.importNode(fP,!0));return c.addEventListener("photon-clicked",()=>{r(!1),r(!0)}),c._$owner=P(),c})()]}}),null),W(c=>{const l=e.store.patient?.error??!1,u=e.store.patient?.error,d=e.store.patient?.value?.id??e.patientId,f=e.client.getSDK();return l!==c._v$7&&(s.invalid=c._v$7=l),u!==c._v$8&&(s.helpText=c._v$8=u),d!==c._v$9&&(s.selected=c._v$9=d),f!==c._v$10&&(s.sdk=c._v$10=f),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0}),i})()},gP=O('<p class="font-sans text-red-500 text-sm pt-1.5"></p>'),bP=O('<div><photon-card><p class="italic font-sans text-gray-500">No prescriptions pending</p></photon-card></div>'),$P=O('<div><photon-card><div class="w-full flex justify-between"><p class="italic font-sans text-gray-500">Loading Prescriptions...</p><sl-spinner style="font-size: 1rem;"></sl-spinner></div></photon-card></div>'),wP=O('<photon-card><photon-dialog label="Lose pending prescription?" confirm-text="Yes, Cancel" cancel-text="No, Keep Editing"><p class="font-sans text-lg xs:text-base">You have selected to remove a pending prescription. Continuing will remove it from the list of prescriptions to be created.</p></photon-dialog><div class="flex flex-col gap-3"><p class="font-sans text-l font-medium">Pending Prescriptions</p></div></photon-card>'),_P=O('<photon-card><div class="flex flex-row items-center"><div class="flex flex-col flex-grow" style="max-width: calc(100% - 36px);"><p class="font-medium font-sans"></p><p class="font-normal text-gray-700 overflow-hidden whitespace-nowrap overflow-ellipsis font-sans"> <!>, <!> refills - </p></div><div><sl-icon-button class="self-end text-xl remove-icon-button" name="trash3"></sl-icon-button></div></div></photon-card>'),xP=ot(Nr(d7(Bi()),1,1/0),"You must add at least 1 Prescription"),SP=e=>{const[t,r]=L(!1),[n,i]=L();return e.actions.registerValidator({key:"draftPrescriptions",validator:xP}),(()=>{const o=V(()=>document.importNode(wP,!0)),a=o.firstChild,s=a.nextSibling;return s.firstChild,o._$owner=P(),a.addEventListener("photon-dialog-confirmed",()=>{e.actions.updateFormValue({key:"draftPrescriptions",value:e.store.draftPrescriptions.value.filter(c=>c.id!==n())}),r(!1),i(void 0)}),a.addEventListener("photon-dialog-canceled",()=>{r(!1),i(void 0)}),a._$owner=P(),_(s,z(re,{get when(){return(e.store.draftPrescriptions?.value??[]).length===0&&!e.isLoading},get children(){const c=V(()=>document.importNode(bP,!0)),l=c.firstChild;return l._$owner=P(),_(c,z(re,{get when(){return e.store.draftPrescriptions?.error},get children(){const u=gP.cloneNode(!0);return _(u,()=>e.store.draftPrescriptions?.error),u}}),null),W(()=>l.invalid=e.store.draftPrescriptions?.error),c}}),null),_(s,z(re,{get when(){return e.isLoading},get children(){const c=V(()=>document.importNode($P,!0)),l=c.firstChild,u=l.firstChild,d=u.firstChild,f=d.nextSibling;return l._$owner=P(),f._$owner=P(),c}}),null),_(s,z(Rl,{get each(){return e.store.draftPrescriptions?.value??[]},children:c=>(()=>{const l=V(()=>document.importNode(_P,!0)),u=l.firstChild,d=u.firstChild,f=d.firstChild,h=f.nextSibling,p=h.firstChild,m=p.nextSibling,v=m.nextSibling,y=v.nextSibling;y.nextSibling;const b=d.nextSibling,g=b.firstChild;return l._$owner=P(),_(f,()=>c.treatment.name),_(h,()=>c.dispenseQuantity,p),_(h,()=>c.dispenseUnit,m),_(h,()=>c.refillsInput,y),_(h,()=>c.instructions,null),g.$$click=()=>{r(!0),i(c.id)},g._$owner=P(),l})()}),null),W(()=>a.open=t()),o})()};Ni(["click"]);const kP=O('<photon-card><p class="italic font-sans text-gray-500">Please select a patient</p></photon-card>'),EP=O('<photon-card><p class="italic font-sans text-gray-500">Please update patient address in order to select pharmacy</p></photon-card>'),OP=O('<div class="flex flex-col gap-2"><p class="font-sans text-sm font-medium flex-grow">Search for a Local Pharmacy</p><photon-pharmacy-search></photon-pharmacy-search></div>'),CP=O('<photon-card><div class="flex flex-col gap-3"><div class="flex flex-row"><p class="font-sans text-l font-medium flex-grow">Select Pharmacy</p></div></div></photon-card>'),PP=ot(ic(jt(),Bi()),"Please select or search for a pharmacy..."),TP=e=>(e.actions.registerValidator({key:"pharmacy",validator:PP}),(()=>{const t=V(()=>document.importNode(CP,!0)),r=t.firstChild;return r.firstChild,t._$owner=P(),_(r,z(re,{get when(){return!e.store.patient?.value},get children(){const n=V(()=>document.importNode(kP,!0));return n._$owner=P(),n}}),null),_(r,z(re,{get when(){return e.store.patient?.value&&!e.store.address?.value},get children(){const n=V(()=>document.importNode(EP,!0));return n._$owner=P(),n}}),null),_(r,z(re,{get when(){return e.store.patient?.value&&e.store.address?.value},get children(){const n=V(()=>document.importNode(OP,!0)),i=n.firstChild,o=i.nextSibling;return o.addEventListener("photon-pharmacy-selected",a=>{e.actions.updateFormValue({key:"pharmacy",value:a.detail.pharmacy})}),o.addEventListener("photon-pharmacy-removed",a=>{e.actions.updateFormValue({key:"pharmacy",value:void 0})}),o._$owner=P(),W(a=>{const s=e.store.pharmacy?.error??!1,c=e.store.pharmacy?.error,l=e.store.patient.value.address?`${e.store.patient.value.address.street1} ${e.store.patient.value.address.street2||""} ${e.store.patient.value.address.city}, ${e.store.patient.value.address.state} ${e.store.patient.value.address.postalCode}`:"",u=e.store.patient.value.preferredPharmacies?.[0]?.id??"";return s!==a._v$&&(o.invalid=a._v$=s),c!==a._v$2&&(o.helpText=a._v$2=c),l!==a._v$3&&(o.address=a._v$3=l),u!==a._v$4&&(o.selected=a._v$4=u),a},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),n}}),null),t})()),NP=O('<sl-spinner style="font-size: 1rem;"></sl-spinner>'),IP=O('<div class="flex flex-col gap-2"></div>'),AP=O('<photon-card><div class="flex flex-col gap-3"><div class="flex flex-row"><p class="font-sans text-l font-medium flex-grow">Selected Pharmacy</p></div></div></photon-card>'),DP=({pharmacyId:e})=>{const t=rt(),[r,n]=L({});return ge(async()=>{if(e&&t){const{data:i}=await t.getSDK().clinical.pharmacy.getPharmacy({id:e});n(i.pharmacy)}}),(()=>{const i=V(()=>document.importNode(AP,!0)),o=i.firstChild;return o.firstChild,i._$owner=P(),_(o,z(re,{get when(){return!r()},get children(){const a=V(()=>document.importNode(NP,!0));return a._$owner=P(),a}}),null),_(o,z(re,{get when(){return r()},get children(){const a=IP.cloneNode(!0);return _(a,()=>r()?.name),a}}),null),i})()};var so=[],RP=class{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){so.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){so=so.filter(e=>e!==this.element),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return so[so.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=n2(this.element),r=this.tabDirection==="forward"?e:t;typeof r?.focus=="function"&&r.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){e.key==="Tab"&&e.shiftKey&&(this.tabDirection="backward",requestAnimationFrame(()=>this.checkFocus()))}handleKeyUp(){this.tabDirection="forward"}},FP=ft`
2876
+ `}};Ce.styles=rP;$([Xe(".button")],Ce.prototype,"button",2);$([Er()],Ce.prototype,"hasFocus",2);$([Er()],Ce.prototype,"invalid",2);$([k()],Ce.prototype,"title",2);$([k({reflect:!0})],Ce.prototype,"variant",2);$([k({reflect:!0})],Ce.prototype,"size",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"caret",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"disabled",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"loading",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"outline",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"pill",2);$([k({type:Boolean,reflect:!0})],Ce.prototype,"circle",2);$([k()],Ce.prototype,"type",2);$([k()],Ce.prototype,"name",2);$([k()],Ce.prototype,"value",2);$([k()],Ce.prototype,"href",2);$([k()],Ce.prototype,"target",2);$([k()],Ce.prototype,"download",2);$([k()],Ce.prototype,"form",2);$([k({attribute:"formaction"})],Ce.prototype,"formAction",2);$([k({attribute:"formenctype"})],Ce.prototype,"formEnctype",2);$([k({attribute:"formmethod"})],Ce.prototype,"formMethod",2);$([k({attribute:"formnovalidate",type:Boolean})],Ce.prototype,"formNoValidate",2);$([k({attribute:"formtarget"})],Ce.prototype,"formTarget",2);$([De("disabled",{waitUntilFirstUpdate:!0})],Ce.prototype,"handleDisabledChange",1);Ce=$([_t("sl-button")],Ce);const nP=O('<photon-checkbox label="Add To Templates" form-name="daw"></photon-checkbox>'),iP=O('<photon-card title="Add Prescription"><div class="flex flex-col gap-3"><photon-treatment-select label="Search Treatment Catalog"></photon-treatment-select><div class="flex flex-col-reverse xs:flex-row xs:items-center gap-2"><photon-checkbox label="Dispense as written" tip="This prescription will be filled generically unless this box is checked" form-name="daw" class="flex-grow"></photon-checkbox><photon-med-search-dialog></photon-med-search-dialog><a class="font-sans text-gray-500 text-sm hover:text-black hover:cursor-pointer pt-1">Advanced Search \u2192</a></div><div class="sm:max-w-[50%] sm:pr-2"><photon-datepicker label="Effective Date" required="true"></photon-datepicker></div><div class="flex flex-col sm:flex-wrap sm:flex-row sm:items-start sm:gap-x-4"><div class="flex flex-col flex-1 flex-shrink md:max-w-[50%]"><photon-number-input class="flex-grow flex-1" label="Quantity" required="true" min="1"></photon-number-input><photon-dosage-calculator-dialog></photon-dosage-calculator-dialog><photon-button variant="outline" class="w-fit"><sl-icon slot="suffix" name="calculator"></sl-icon>Dose Calculator</photon-button></div><photon-dispense-units class="flex-grow flex-shrink md:max-w-[50%] flex-1" label="Dispense Unit" required="true" force-label-size="true"></photon-dispense-units></div><div class="flex flex-col sm:flex-wrap sm:flex-row sm:items-center sm:gap-x-4"><photon-number-input class="flex-grow flex-shrink md:max-w-[50%] flex-1" label="Days Supply" required="true" min="0"></photon-number-input><photon-number-input class="flex-grow flex-shrink md:max-w-[50%] flex-1" label="Refills" required="true" min="0"></photon-number-input></div><photon-textarea label="Patient Instructions (SIG)" form-name="patient_instructions" required="true" placeholder="Enter patient instructions"></photon-textarea><photon-textarea label="Pharmacy Note" placeholder="Enter pharmacy note"></photon-textarea><div class="flex flex-col xs:flex-row gap-2"><div class="flex flex-grow justify-end"><photon-button class="w-full xs:w-fit">Add Prescription</photon-button></div></div></div></photon-card>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const oP={treatment:ot(ic(jt(),Bi()),"Please select a treatment..."),dispenseQuantity:ot(su(au(),1),"Quantity must be positive"),daysSupply:ot(su(au(),0),"Days Supply must be at least 0"),refillsInput:ot(su(au(),0),"Refills must be at least 0"),instructions:ot(Nr(jt(),1,1/0),"Please enter instructions for the patient..."),effectiveDate:ot(JC(new Date),"Please choose a date that isn't in the past")},aP=e=>{let t,r;const[n,i]=L(void 0),[o,a]=L(void 0);let s;for(const[c,l]of Object.entries(oP))e.actions.registerValidator({key:c,validator:l});return(()=>{const c=V(()=>document.importNode(iP,!0)),l=c.firstChild,u=l.firstChild,d=u.nextSibling,f=d.firstChild,h=f.nextSibling,p=h.nextSibling,m=d.nextSibling,v=m.firstChild,y=m.nextSibling,b=y.firstChild,g=b.firstChild,w=g.nextSibling,x=w.nextSibling,E=x.firstChild,S=b.nextSibling,T=y.nextSibling,M=T.firstChild,F=M.nextSibling,K=T.nextSibling,D=K.nextSibling,R=D.nextSibling,U=R.firstChild,j=U.firstChild,Y=s;typeof Y=="function"?ee(Y,c):s=c,c._$owner=P(),l.addEventListener("photon-medication-selected",A=>{i(A.detail.medication),e.actions.updateFormValue({key:"treatment",value:A.detail.medication})}),u.addEventListener("photon-treatment-selected",A=>{A.detail.data.__typename==="PrescriptionTemplate"?(e.actions.updateFormValue({key:"treatment",value:A.detail.data.treatment}),A.detail.data.dispenseAsWritten&&e.actions.updateFormValue({key:"dispenseAsWritten",value:A.detail.data.dispenseAsWritten}),A.detail.data.dispenseQuantity&&e.actions.updateFormValue({key:"dispenseQuantity",value:Number(A.detail.data.dispenseQuantity)}),A.detail.data.dispenseUnit&&e.actions.updateFormValue({key:"dispenseUnit",value:A.detail.data.dispenseUnit}),A.detail.data.daysSupply&&e.actions.updateFormValue({key:"daysSupply",value:Number(A.detail.data.daysSupply)}),A.detail.data.fillsAllowed&&e.actions.updateFormValue({key:"refillsInput",value:Number(A.detail.data.fillsAllowed)-1}),A.detail.data.instructions&&e.actions.updateFormValue({key:"instructions",value:A.detail.data.instructions}),A.detail.data.notes&&e.actions.updateFormValue({key:"notes",value:A.detail.data.notes})):e.actions.updateFormValue({key:"treatment",value:A.detail.data}),e.actions.updateFormValue({key:"catalogId",value:A.detail.catalogId})}),u._$owner=P(),f.addEventListener("photon-checkbox-toggled",A=>e.actions.updateFormValue({key:"dispenseAsWritten",value:A.detail.checked})),f._$owner=P();const oe=t;typeof oe=="function"?ee(oe,h):t=h,h._$owner=P(),p.$$click=()=>t.open=!0,v.addEventListener("photon-datepicker-selected",A=>e.actions.updateFormValue({key:"effectiveDate",value:A.detail.date})),v._$owner=P(),g.addEventListener("photon-input-changed",A=>{e.actions.updateFormValue({key:"dispenseQuantity",value:Number(A.detail.input)})}),g._$owner=P();const ae=r;return typeof ae=="function"?ee(ae,w):r=w,w.addEventListener("photon-dose-selected",A=>{e.actions.updateFormValue({key:"dispenseQuantity",value:Number(A.detail.value)}),A.detail.unit==="mL"&&e.actions.updateFormValue({key:"dispenseUnit",value:"Milliliter"})}),w._$owner=P(),x.addEventListener("photon-clicked",()=>{r.open=!0}),x._$owner=P(),E._$owner=P(),S.addEventListener("photon-dispense-unit-selected",A=>e.actions.updateFormValue({key:"dispenseUnit",value:A.detail.dispenseUnit.name})),S._$owner=P(),M.addEventListener("photon-input-changed",A=>{e.actions.updateFormValue({key:"daysSupply",value:Number(A.detail.input)})}),M._$owner=P(),F.addEventListener("photon-input-changed",A=>e.actions.updateFormValue({key:"refillsInput",value:Number(A.detail.input)})),F._$owner=P(),K.addEventListener("photon-textarea-changed",A=>e.actions.updateFormValue({key:"instructions",value:A.detail.value})),K._$owner=P(),D.addEventListener("photon-textarea-changed",A=>e.actions.updateFormValue({key:"notes",value:A.detail.value})),D._$owner=P(),_(R,z(re,{get when(){return!e.hideAddToTemplates},get children(){const A=V(()=>document.importNode(nP,!0));return A.addEventListener("photon-checkbox-toggled",me=>e.actions.updateFormValue({key:"addToTemplates",value:me.detail.checked})),A._$owner=P(),W(()=>A.checked=e.store.addToTemplates?.value||!1),A}}),U),j.addEventListener("photon-clicked",()=>{const A=["treatment","effectiveDate","dispenseQuantity","daysSupply","refillsInput","instructions"];e.actions.validate(A),e.actions.hasErrors(A)||(e.actions.updateFormValue({key:"draftPrescriptions",value:[...e.store.draftPrescriptions?.value||[],{id:String(Math.random()),effectiveDate:e.store.effectiveDate.value,treatment:e.store.treatment.value,dispenseAsWritten:e.store.dispenseAsWritten.value,dispenseQuantity:e.store.dispenseQuantity.value,dispenseUnit:e.store.dispenseUnit.value,daysSupply:e.store.daysSupply.value,refillsInput:e.store.refillsInput.value,instructions:e.store.instructions.value,notes:e.store.notes.value,fillsAllowed:e.store.refillsInput.value+1,addToTemplates:e.store.addToTemplates?.value??!1,catalogId:e.store.catalogId.value??void 0}]}),e.actions.updateFormValue({key:"effectiveDate",value:oc(new Date,"yyyy-MM-dd").toString()}),e.actions.clearKeys(["treatment","dispenseAsWritten","dispenseQuantity","dispenseUnit","daysSupply","refillsInput","instructions","notes"]),i(void 0),e.actions.updateFormValue({key:"treatment",value:void 0}),e.actions.updateFormValue({key:"refillsInput",value:0}),e.actions.updateFormValue({key:"dispenseAsWritten",value:!1}),e.actions.updateFormValue({key:"dispenseQuantity",value:1}),e.actions.updateFormValue({key:"daysSupply",value:30}),e.actions.updateFormValue({key:"instructions",value:""}),e.actions.updateFormValue({key:"notes",value:""}))}),j._$owner=P(),W(A=>{const me=e.store.treatment?.value??void 0,xe=e.store.treatment?.error??!1,I=e.store.treatment?.error,xt=n(),St=e.store.effectiveDate?.error??!1,Mt=e.store.effectiveDate?.error,It=e.store.dispenseQuantity?.error??!1,H=e.store.dispenseQuantity?.error,Q=e.store.treatment?.value??void 0,X=e.store.dispenseUnit?.value??o()?.name,ne=e.store.daysSupply?.error??!1,ue=e.store.daysSupply?.error,de=e.store.refillsInput?.error??!1,Ue=e.store.refillsInput?.error,Me=e.store.instructions?.error??!1,st=e.store.instructions?.error;return me!==A._v$&&(u.selected=A._v$=me),xe!==A._v$2&&(u.invalid=A._v$2=xe),I!==A._v$3&&(u.helpText=A._v$3=I),xt!==A._v$4&&(u.offCatalogOption=A._v$4=xt),St!==A._v$5&&(v.invalid=A._v$5=St),Mt!==A._v$6&&(v.helpText=A._v$6=Mt),It!==A._v$7&&(g.invalid=A._v$7=It),H!==A._v$8&&(g.helpText=A._v$8=H),Q!==A._v$9&&(w.medication=A._v$9=Q),X!==A._v$10&&(S.selected=A._v$10=X),ne!==A._v$11&&(M.invalid=A._v$11=ne),ue!==A._v$12&&(M.helpText=A._v$12=ue),de!==A._v$13&&(F.invalid=A._v$13=de),Ue!==A._v$14&&(F.helpText=A._v$14=Ue),Me!==A._v$15&&(K.invalid=A._v$15=Me),st!==A._v$16&&(K.helpText=A._v$16=st),A},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0,_v$12:void 0,_v$13:void 0,_v$14:void 0,_v$15:void 0,_v$16:void 0}),W(()=>f.checked=e.store.dispenseAsWritten?.value||!1),W(()=>g.value=e.store.dispenseQuantity?.value??1),W(()=>M.value=e.store.daysSupply?.value??30),W(()=>F.value=e.store.refillsInput?.value??0),W(()=>K.value=e.store.instructions?.value),W(()=>D.value=e.store.notes?.value),c})()};Ni(["click"]);const sP=O("<photon-patient-dialog></photon-patient-dialog>"),lP=O('<p class="font-sans text-sm font-medium">Patient Address</p>'),cP=O('<div class="flex flex-col font-sans text-gray-700"><p></p><div class="flex flex-row gap-1"><div class="flex flex-row"><p>,</p><p></p></div><p></p></div></div>'),uP=O('<p class="italic font-sans text-gray-500">Please edit patient and add address</p>'),dP=O('<p class="font-sans text-red-500 text-sm"></p>'),fP=O('<photon-button class="self-end" variant="outline">Edit Patient</photon-button>'),hP=O('<photon-card><div class="flex flex-col gap-3"><p class="font-sans text-l font-medium">Select Patient</p><photon-patient-select></photon-patient-select></div></photon-card>'),pP=O("<p></p>"),mP=ot(ic(jt(),Bi()),"Please select a patient..."),vP=ot(ic(jt(),Bi()),"Please enter an address for patient..."),yP=e=>{const[t,r]=L(!1),{actions:n}=nc;return e.actions.registerValidator({key:"patient",validator:mP}),e.enableOrder&&e.actions.registerValidator({key:"address",validator:vP}),(()=>{const i=V(()=>document.importNode(hP,!0)),o=i.firstChild,a=o.firstChild,s=a.nextSibling;return i._$owner=P(),s.addEventListener("photon-patient-selected",c=>{e.actions.updateFormValue({key:"patient",value:c.detail.patient}),e.enableOrder&&e.actions.updateFormValue({key:"address",value:c.detail.patient.address})}),s._$owner=P(),_(o,z(re,{get when(){return e.store.patient?.value?.id&&e.enableOrder},get children(){return[(()=>{const c=V(()=>document.importNode(sP,!0));return c.addEventListener("photon-patient-updated",()=>{n.getSelectedPatient(e.client.getSDK(),e.store.patient?.value?.id)}),c._$owner=P(),W(l=>{const u=t(),d=e.store.patient.value.id;return u!==l._v$&&(c.open=l._v$=u),d!==l._v$2&&(c.patientId=l._v$2=d),l},{_v$:void 0,_v$2:void 0}),c})(),z(re,{get when(){return e.store.patient?.value},get children(){return[lP.cloneNode(!0),z(re,{get when(){return e.store.patient.value.address},get children(){const c=cP.cloneNode(!0),l=c.firstChild,u=l.nextSibling,d=u.firstChild,f=d.firstChild,h=f.firstChild,p=f.nextSibling,m=d.nextSibling;return _(l,()=>e.store.patient.value.address.street1),_(c,(()=>{const v=fe(()=>!!e.store.patient.value.address.street2);return()=>v()?(()=>{const y=pP.cloneNode(!0);return _(y,()=>e.store.patient.value.address.street2),y})():null})(),u),_(f,()=>e.store.patient.value.address.city,h),_(p,()=>e.store.patient.value.address.state),_(m,()=>e.store.patient.value.address.postalCode),c}}),z(re,{get when(){return!e.store.patient.value.address},get children(){return[(()=>{const c=uP.cloneNode(!0);return W(l=>{const u=!!e.store.address.error,d=!!e.store.address.error,f=!!e.store.address.error,h=!!e.store.address.error;return u!==l._v$3&&c.classList.toggle("p-2",l._v$3=u),d!==l._v$4&&c.classList.toggle("border-red-500",l._v$4=d),f!==l._v$5&&c.classList.toggle("border-2",l._v$5=f),h!==l._v$6&&c.classList.toggle("rounded",l._v$6=h),l},{_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0}),c})(),z(re,{get when(){return e.store.address.error},get children(){const c=dP.cloneNode(!0);return _(c,()=>e.store.address.error),c}})]}})]}}),(()=>{const c=V(()=>document.importNode(fP,!0));return c.addEventListener("photon-clicked",()=>{r(!1),r(!0)}),c._$owner=P(),c})()]}}),null),W(c=>{const l=e.store.patient?.error??!1,u=e.store.patient?.error,d=e.store.patient?.value?.id??e.patientId,f=e.client.getSDK();return l!==c._v$7&&(s.invalid=c._v$7=l),u!==c._v$8&&(s.helpText=c._v$8=u),d!==c._v$9&&(s.selected=c._v$9=d),f!==c._v$10&&(s.sdk=c._v$10=f),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0}),i})()},gP=O('<p class="font-sans text-red-500 text-sm pt-1.5"></p>'),bP=O('<div><photon-card><p class="italic font-sans text-gray-500">No prescriptions pending</p></photon-card></div>'),$P=O('<div><photon-card><div class="w-full flex justify-between"><p class="italic font-sans text-gray-500">Loading Prescriptions...</p><sl-spinner style="font-size: 1rem;"></sl-spinner></div></photon-card></div>'),wP=O('<photon-card><photon-dialog label="Lose pending prescription?" confirm-text="Yes, Cancel" cancel-text="No, Keep Editing"><p class="font-sans text-lg xs:text-base">You have selected to remove a pending prescription. Continuing will remove it from the list of prescriptions to be created.</p></photon-dialog><div class="flex flex-col gap-3"><p class="font-sans text-l font-medium">Pending Prescriptions</p></div></photon-card>'),_P=O('<photon-card><div class="flex flex-row items-center"><div class="flex flex-col flex-grow" style="max-width: calc(100% - 36px);"><p class="font-medium font-sans"></p><p class="font-normal text-gray-700 overflow-hidden whitespace-nowrap overflow-ellipsis font-sans"> <!>, <!> refills - </p></div><div><sl-icon-button class="self-end text-xl remove-icon-button" name="trash3"></sl-icon-button></div></div></photon-card>'),xP=ot(Nr(d7(Bi()),1,1/0),"You must add at least 1 Prescription"),SP=e=>{const[t,r]=L(!1),[n,i]=L();return e.actions.registerValidator({key:"draftPrescriptions",validator:xP}),(()=>{const o=V(()=>document.importNode(wP,!0)),a=o.firstChild,s=a.nextSibling;return s.firstChild,o._$owner=P(),a.addEventListener("photon-dialog-confirmed",()=>{e.actions.updateFormValue({key:"draftPrescriptions",value:e.store.draftPrescriptions.value.filter(c=>c.id!==n())}),r(!1),i(void 0)}),a.addEventListener("photon-dialog-canceled",()=>{r(!1),i(void 0)}),a._$owner=P(),_(s,z(re,{get when(){return(e.store.draftPrescriptions?.value??[]).length===0&&!e.isLoading},get children(){const c=V(()=>document.importNode(bP,!0)),l=c.firstChild;return l._$owner=P(),_(c,z(re,{get when(){return e.store.draftPrescriptions?.error},get children(){const u=gP.cloneNode(!0);return _(u,()=>e.store.draftPrescriptions?.error),u}}),null),W(()=>l.invalid=e.store.draftPrescriptions?.error),c}}),null),_(s,z(re,{get when(){return e.isLoading},get children(){const c=V(()=>document.importNode($P,!0)),l=c.firstChild,u=l.firstChild,d=u.firstChild,f=d.nextSibling;return l._$owner=P(),f._$owner=P(),c}}),null),_(s,z(Rl,{get each(){return e.store.draftPrescriptions?.value??[]},children:c=>(()=>{const l=V(()=>document.importNode(_P,!0)),u=l.firstChild,d=u.firstChild,f=d.firstChild,h=f.nextSibling,p=h.firstChild,m=p.nextSibling,v=m.nextSibling,y=v.nextSibling;y.nextSibling;const b=d.nextSibling,g=b.firstChild;return l._$owner=P(),_(f,()=>c.treatment.name),_(h,()=>c.dispenseQuantity,p),_(h,()=>c.dispenseUnit,m),_(h,()=>c.refillsInput,y),_(h,()=>c.instructions,null),g.$$click=()=>{r(!0),i(c.id)},g._$owner=P(),l})()}),null),W(()=>a.open=t()),o})()};Ni(["click"]);const kP=O('<photon-card><p class="italic font-sans text-gray-500">Please select a patient</p></photon-card>'),EP=O('<photon-card><p class="italic font-sans text-gray-500">Please update patient address in order to select pharmacy</p></photon-card>'),OP=O('<div class="flex flex-col gap-2"><p class="font-sans text-sm font-medium flex-grow">Search for a Local Pharmacy</p><photon-pharmacy-search></photon-pharmacy-search></div>'),CP=O('<photon-card><div class="flex flex-col gap-3"><div class="flex flex-row"><p class="font-sans text-l font-medium flex-grow">Select Pharmacy</p></div></div></photon-card>'),PP=ot(ic(jt(),Bi()),"Please select or search for a pharmacy..."),TP=e=>(e.actions.registerValidator({key:"pharmacy",validator:PP}),(()=>{const t=V(()=>document.importNode(CP,!0)),r=t.firstChild;return r.firstChild,t._$owner=P(),_(r,z(re,{get when(){return!e.store.patient?.value},get children(){const n=V(()=>document.importNode(kP,!0));return n._$owner=P(),n}}),null),_(r,z(re,{get when(){return e.store.patient?.value&&!e.store.address?.value},get children(){const n=V(()=>document.importNode(EP,!0));return n._$owner=P(),n}}),null),_(r,z(re,{get when(){return e.store.patient?.value&&e.store.address?.value},get children(){const n=V(()=>document.importNode(OP,!0)),i=n.firstChild,o=i.nextSibling;return o.addEventListener("photon-pharmacy-selected",a=>{e.actions.updateFormValue({key:"pharmacy",value:a.detail.pharmacy})}),o.addEventListener("photon-pharmacy-removed",a=>{e.actions.updateFormValue({key:"pharmacy",value:void 0})}),o._$owner=P(),W(a=>{const s=e.store.pharmacy?.error??!1,c=e.store.pharmacy?.error,l=e.store.patient.value.address?`${e.store.patient.value.address.street1} ${e.store.patient.value.address.street2||""} ${e.store.patient.value.address.city}, ${e.store.patient.value.address.state} ${e.store.patient.value.address.postalCode}`:"",u=e.store.patient.value.preferredPharmacies?.[0]?.id??"";return s!==a._v$&&(o.invalid=a._v$=s),c!==a._v$2&&(o.helpText=a._v$2=c),l!==a._v$3&&(o.address=a._v$3=l),u!==a._v$4&&(o.selected=a._v$4=u),a},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),n}}),null),t})()),NP=O('<sl-spinner style="font-size: 1rem;"></sl-spinner>'),IP=O('<div class="flex flex-col gap-2"></div>'),AP=O('<photon-card><div class="flex flex-col gap-3"><div class="flex flex-row"><p class="font-sans text-l font-medium flex-grow">Selected Pharmacy</p></div></div></photon-card>'),DP=({pharmacyId:e})=>{const t=rt(),[r,n]=L({});return ge(async()=>{if(e&&t){const{data:i}=await t.getSDK().clinical.pharmacy.getPharmacy({id:e});n(i.pharmacy)}}),(()=>{const i=V(()=>document.importNode(AP,!0)),o=i.firstChild;return o.firstChild,i._$owner=P(),_(o,z(re,{get when(){return!r()},get children(){const a=V(()=>document.importNode(NP,!0));return a._$owner=P(),a}}),null),_(o,z(re,{get when(){return r()},get children(){const a=IP.cloneNode(!0);return _(a,()=>r()?.name),a}}),null),i})()};var so=[],RP=class{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){so.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){so=so.filter(e=>e!==this.element),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return so[so.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=n2(this.element),r=this.tabDirection==="forward"?e:t;typeof r?.focus=="function"&&r.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){e.key==="Tab"&&e.shiftKey&&(this.tabDirection="backward",requestAnimationFrame(()=>this.checkFocus()))}handleKeyUp(){this.tabDirection="forward"}},FP=ft`
2876
2877
  ${wt}
2877
2878
 
2878
2879
  :host {
@@ -3035,7 +3036,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3035
3036
  </footer>
3036
3037
  </div>
3037
3038
  </div>
3038
- `}};xr.styles=FP;$([Xe(".dialog")],xr.prototype,"dialog",2);$([Xe(".dialog__panel")],xr.prototype,"panel",2);$([Xe(".dialog__overlay")],xr.prototype,"overlay",2);$([k({type:Boolean,reflect:!0})],xr.prototype,"open",2);$([k({reflect:!0})],xr.prototype,"label",2);$([k({attribute:"no-header",type:Boolean,reflect:!0})],xr.prototype,"noHeader",2);$([De("open",{waitUntilFirstUpdate:!0})],xr.prototype,"handleOpenChange",1);xr=$([_t("sl-dialog")],xr);ur("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}});ur("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});ur("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}});ur("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}});ur("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});const LP=O('<sl-alert variant="warning" open><sl-icon slot="icon" name="exclamation-triangle"></sl-icon><strong>You are not signed in</strong><br></sl-alert>'),MP=O('<sl-alert variant="warning" open><sl-icon slot="icon" name="exclamation-triangle"></sl-icon><strong>Something went wrong, please contact support at Photon Health <a style="text-decoration:underline" href="mailto:support@photon.health">support@photon.health</a></strong><br></sl-alert>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const V2=e=>{const t=rt(),[r,n]=L(t?.authentication.state.isLoading||!1),[i,o]=L(t?.authentication.state.isAuthenticated||!1),[a,s]=L(t?.authentication.state.isAuthorized||!1);return ge(()=>{n(t?.authentication.state.isLoading||!1)}),ge(()=>{o(t?.authentication.state.isAuthenticated||!1)}),ge(()=>{s(t?.authentication.state.isAuthorized||!1)}),[z(re,{get when(){return t&&!i()},get children(){const c=V(()=>document.importNode(LP,!0)),l=c.firstChild;return c._$owner=P(),l._$owner=P(),c}}),z(re,{get when(){return pe(()=>!!(t&&i()&&!a()))()&&!r()},get children(){const c=V(()=>document.importNode(MP,!0)),l=c.firstChild;return c._$owner=P(),l._$owner=P(),c}}),z(re,{get when(){return pe(()=>!!(t&&a()))()&&!r()},get children(){return e.children}})]},jP=O('<div class="w-full flex justify-center"><sl-spinner style="font-size: 3rem;"></sl-spinner></div>'),zP=O('<photon-button class="w-full xs:w-fit" variant="outline">Add Prescription</photon-button>'),UP=O('<div class="flex flex-row justify-end gap-2"><photon-button class="w-full xs:w-fit"></photon-button></div>'),VP=O('<div><style></style><style></style><style></style><style></style><div><div class="flex flex-col gap-8"></div></div></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const BP=Wo`
3039
+ `}};xr.styles=FP;$([Xe(".dialog")],xr.prototype,"dialog",2);$([Xe(".dialog__panel")],xr.prototype,"panel",2);$([Xe(".dialog__overlay")],xr.prototype,"overlay",2);$([k({type:Boolean,reflect:!0})],xr.prototype,"open",2);$([k({reflect:!0})],xr.prototype,"label",2);$([k({attribute:"no-header",type:Boolean,reflect:!0})],xr.prototype,"noHeader",2);$([De("open",{waitUntilFirstUpdate:!0})],xr.prototype,"handleOpenChange",1);xr=$([_t("sl-dialog")],xr);ur("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}});ur("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});ur("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}});ur("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}});ur("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});const LP=O('<sl-alert variant="warning" open><sl-icon slot="icon" name="exclamation-triangle"></sl-icon><strong>You are not signed in</strong><br></sl-alert>'),MP=O('<sl-alert variant="warning" open><sl-icon slot="icon" name="exclamation-triangle"></sl-icon><strong>Something went wrong, please contact support at Photon Health <a style="text-decoration:underline" href="mailto:support@photon.health">support@photon.health</a></strong><br></sl-alert>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const V2=e=>{const t=rt(),[r,n]=L(t?.authentication.state.isLoading||!1),[i,o]=L(t?.authentication.state.isAuthenticated||!1),[a,s]=L(t?.authentication.state.isAuthorized||!1);return ge(()=>{n(t?.authentication.state.isLoading||!1)}),ge(()=>{o(t?.authentication.state.isAuthenticated||!1)}),ge(()=>{s(t?.authentication.state.isAuthorized||!1)}),[z(re,{get when(){return fe(()=>!!(t&&!i()))()&&!r()},get children(){const c=V(()=>document.importNode(LP,!0)),l=c.firstChild;return c._$owner=P(),l._$owner=P(),c}}),z(re,{get when(){return fe(()=>!!(t&&i()&&!a()))()&&!r()},get children(){const c=V(()=>document.importNode(MP,!0)),l=c.firstChild;return c._$owner=P(),l._$owner=P(),c}}),z(re,{get when(){return fe(()=>!!(t&&a()))()&&!r()},get children(){return e.children}})]},jP=O('<div class="w-full flex justify-center"><sl-spinner style="font-size: 3rem;"></sl-spinner></div>'),zP=O('<photon-button class="w-full xs:w-fit" variant="outline">Add Prescription</photon-button>'),UP=O('<div class="flex flex-row justify-end gap-2"><photon-button class="w-full xs:w-fit"></photon-button></div>'),VP=O('<div><style></style><style></style><style></style><style></style><div><div class="flex flex-col gap-8"></div></div></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const BP=Wo`
3039
3040
  fragment CatalogTreatmentsFields on Catalog {
3040
3041
  id
3041
3042
  treatments {
@@ -3057,7 +3058,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3057
3058
  }
3058
3059
  }
3059
3060
  }
3060
- `;we("photon-prescribe-workflow",{patientId:void 0,templateIds:void 0,hideSubmit:!1,hideTemplates:!0,enableOrder:!1,pharmacyId:void 0,loading:!1},(e,t)=>{let r;const{store:n,actions:i}=k2({dispenseAsWritten:!1,patient:void 0,treatment:void 0,draftPrescriptions:[],pharmacy:void 0,errors:[],address:void 0}),o=rt(),[a,s]=L(!e.templateIds),[c,l]=L(!0),[u,d]=L(!1),[f,h]=L(o?.authentication.state.isAuthenticated||!1);ge(()=>{!o?.authentication.state.isAuthenticated&&!o?.authentication.state.isLoading&&!o?.authentication.state.error&&o?.authentication.login({appState:{returnTo:window.location.pathname}})}),ge(()=>{l(o?.authentication.state.isLoading||!1)},[o?.authentication.state.isLoading]),ge(()=>{h(o?.authentication.state.isAuthenticated||!1)},[o?.authentication.state.isAuthenticated]),ge(async()=>{if(e.templateIds&&o){d(!0);const w=e.templateIds.split(","),{data:{catalogs:x}}=await o.getSDK().clinical.catalog.getCatalogs();if(x.length===0){console.error("No catalog set");return}const{data:{catalog:E}}=await o.getSDK().clinical.catalog.getCatalog({id:x[0].id,fragment:{CatalogTreatmentsFields:BP}}),S={};E.templates.forEach(T=>{T&&(S[T.id]=T)});for(let T=0;T<w.length;T++){const M=w[T],F=S[M];F||console.error(`Invalid template id ${M}`),(!F.treatment||!F.dispenseQuantity||!F.dispenseUnit||!F.fillsAllowed||!F.instructions)&&console.error(`Template is missing required prescription details ${M}`),i.updateFormValue({key:"draftPrescriptions",value:[...n.draftPrescriptions?.value||[],{id:String(Math.random()),effectiveDate:oc(new Date,"yyyy-MM-dd").toString(),treatment:F.treatment,dispenseAsWritten:F.dispenseAsWritten,dispenseQuantity:F.dispenseQuantity,dispenseUnit:F.dispenseUnit,daysSupply:F.daysSupply,refillsInput:F.fillsAllowed?F.fillsAllowed-1:0,fillsAllowed:F.fillsAllowed,instructions:F.instructions,notes:F.notes,addToTemplates:!1,catalogId:void 0}]})}d(!1)}},[o]);const p=w=>{const x=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{prescriptions:w}});r?.dispatchEvent(x)},m=w=>{const x=new CustomEvent("photon-order-created",{composed:!0,bubbles:!0,detail:{order:w}});r?.dispatchEvent(x)},v=w=>{const x=new CustomEvent("photon-prescriptions-error",{composed:!0,bubbles:!0,detail:{errors:w}});r?.dispatchEvent(x)},y=w=>{const x=new CustomEvent("photon-order-error",{composed:!0,bubbles:!0,detail:{errors:w}});r?.dispatchEvent(x)},b=w=>{const x=new CustomEvent("photon-form-validate",{composed:!0,bubbles:!0,detail:{canSubmit:w,form:n,actions:i}});r?.dispatchEvent(x)},g=async w=>{const x=w?["patient","draftPrescriptions","pharmacy","address"]:["patient","draftPrescriptions"];if(i.validate(x),!i.hasErrors(x)){l(!0),i.updateFormValue({key:"errors",value:[]});const S=o.getSDK().clinical.order.createOrder({}),T=o.getSDK().clinical.prescription.createPrescriptions({}),M=[];for(const D of n.draftPrescriptions.value){const R={daysSupply:D.daysSupply,dispenseAsWritten:D.dispenseAsWritten,dispenseQuantity:D.dispenseQuantity,dispenseUnit:D.dispenseUnit,effectiveDate:D.effectiveDate,instructions:D.instructions,notes:D.notes,patientId:n.patient?.value.id,fillsAllowed:D.refillsInput?D.refillsInput+1:1,treatmentId:D.treatment.id};M.push(R)}const{data:F,errors:K}=await T({variables:{prescriptions:M},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder||l(!1),K){v(K);return}if(p(F.createPrescriptions),e.enableOrder){const D=Object.assign({},n.patient?.value.address);delete D.__typename,delete D.name;const{data:R,errors:U}=await S({variables:{patientId:n.patient?.value.id,pharmacyId:e?.pharmacyId||n.pharmacy?.value.id,address:D,fills:F?.createPrescriptions.map(j=>({prescriptionId:j.id}))},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder&&l(!1),U){y(U);return}m(R.createOrder)}}};return t.element.submitForm=g,ge(()=>{b(Boolean(n.draftPrescriptions?.value?.length>0&&n.patient?.value))}),(()=>{const w=VP.cloneNode(!0),x=w.firstChild,E=x.nextSibling,S=E.nextSibling,T=S.nextSibling,M=T.nextSibling,F=M.firstChild,K=r;return typeof K=="function"?ee(K,w):r=w,_(x,ze),_(E,Vt),_(S,Ut),_(T,i7),_(F,z(re,{get when(){return pe(()=>!!(!o||c()))()&&!f()},get children(){const D=V(()=>document.importNode(jP,!0)),R=D.firstChild;return R._$owner=P(),D}}),null),_(F,z(V2,{get children(){return[z(yP,{actions:i,store:n,get patientId(){return e.patientId},client:o,get enableOrder(){return e.enableOrder}}),z(re,{get when(){return a()},get children(){return z(aP,{get hideAddToTemplates(){return e.hideTemplates},actions:i,store:n})}}),z(SP,{actions:i,store:n,get isLoading(){return u()}}),z(re,{get when(){return e.enableOrder&&!e.pharmacyId},get children(){return z(TP,{store:n,actions:i})}}),z(re,{get when(){return e.enableOrder&&e.pharmacyId},get children(){return z(DP,{get pharmacyId(){return e.pharmacyId}})}}),z(re,{get when(){return!e.hideSubmit},get children(){const D=V(()=>document.importNode(UP,!0)),R=D.firstChild;return _(D,z(re,{get when(){return!a()},get children(){const U=V(()=>document.importNode(zP,!0));return U.addEventListener("photon-clicked",async()=>s(!0)),U._$owner=P(),U}}),R),R.addEventListener("photon-clicked",async()=>await g(e.enableOrder)),R._$owner=P(),_(R,()=>e.enableOrder?"Send Order":"Save Prescriptions"),W(()=>R.loading=c()),D}})]}}),null),w})()});const WP=O('<p class="font-sans text-l font-medium"></p>'),qP=O('<sl-icon-button class="self-start"></sl-icon-button>'),HP=O("<style></style>"),GP=O('<div class="rounded-lg bg-white p-4 shadow-card border border-gray-200"></div>'),QP=O('<div class="flex flex-row justify-between"></div>'),KP=O("<slot></slot>");we("photon-card",{invalid:!1,title:null,collapsable:!1},e=>{const[t,r]=L(!0);let n=null,i=null;return e.title&&(n=(()=>{const o=WP.cloneNode(!0);return _(o,()=>e.title),o})()),e.collapsable&&(i=(()=>{const o=V(()=>document.importNode(qP,!0));return o.addEventListener("click",()=>{r(!t())}),o._$owner=P(),W(()=>o.name=t()?"chevron-right":"chevron-down"),o})()),[(()=>{const o=HP.cloneNode(!0);return _(o,ze),o})(),(()=>{const o=GP.cloneNode(!0);return _(o,n||i?(()=>{const a=QP.cloneNode(!0);return _(a,n,null),_(a,i,null),a})():null,null),_(o,(()=>{const a=pe(()=>!!(e.collapsable&&t()));return()=>a()?null:(()=>{const s=KP.cloneNode(!0);return s._$owner=P(),s})()})(),null),W(a=>{const s=!!e.invalid,c=!!e.invalid;return s!==a._v$&&o.classList.toggle("border-red-500",a._v$=s),c!==a._v$2&&o.classList.toggle("border-2",a._v$2=c),a},{_v$:void 0,_v$2:void 0}),o})()]});const YP=Wo`
3061
+ `;we("photon-prescribe-workflow",{patientId:void 0,templateIds:void 0,hideSubmit:!1,hideTemplates:!0,enableOrder:!1,pharmacyId:void 0,loading:!1},(e,t)=>{let r;const{store:n,actions:i}=k2({dispenseAsWritten:!1,patient:void 0,treatment:void 0,draftPrescriptions:[],pharmacy:void 0,errors:[],address:void 0}),o=rt(),[a,s]=L(!e.templateIds),[c,l]=L(!0),[u,d]=L(!1),[f,h]=L(o?.authentication.state.isAuthenticated||!1);ge(()=>{!o?.authentication.state.isAuthenticated&&!o?.authentication.state.isLoading&&!o?.authentication.state.error&&o?.authentication.login({appState:{returnTo:window.location.pathname}})}),ge(()=>{l(o?.authentication.state.isLoading||!1)},[o?.authentication.state.isLoading]),ge(()=>{h(o?.authentication.state.isAuthenticated||!1)},[o?.authentication.state.isAuthenticated]),ge(async()=>{if(e.templateIds&&o){d(!0);const w=e.templateIds.split(","),{data:{catalogs:x}}=await o.getSDK().clinical.catalog.getCatalogs();if(x.length===0){console.error("No catalog set");return}const{data:{catalog:E}}=await o.getSDK().clinical.catalog.getCatalog({id:x[0].id,fragment:{CatalogTreatmentsFields:BP}}),S={};E.templates.forEach(T=>{T&&(S[T.id]=T)});for(let T=0;T<w.length;T++){const M=w[T],F=S[M];F||console.error(`Invalid template id ${M}`),(!F.treatment||!F.dispenseQuantity||!F.dispenseUnit||!F.fillsAllowed||!F.instructions)&&console.error(`Template is missing required prescription details ${M}`),i.updateFormValue({key:"draftPrescriptions",value:[...n.draftPrescriptions?.value||[],{id:String(Math.random()),effectiveDate:oc(new Date,"yyyy-MM-dd").toString(),treatment:F.treatment,dispenseAsWritten:F.dispenseAsWritten,dispenseQuantity:F.dispenseQuantity,dispenseUnit:F.dispenseUnit,daysSupply:F.daysSupply,refillsInput:F.fillsAllowed?F.fillsAllowed-1:0,fillsAllowed:F.fillsAllowed,instructions:F.instructions,notes:F.notes,addToTemplates:!1,catalogId:void 0}]})}d(!1)}},[o]);const p=w=>{const x=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{prescriptions:w}});r?.dispatchEvent(x)},m=w=>{const x=new CustomEvent("photon-order-created",{composed:!0,bubbles:!0,detail:{order:w}});r?.dispatchEvent(x)},v=w=>{const x=new CustomEvent("photon-prescriptions-error",{composed:!0,bubbles:!0,detail:{errors:w}});r?.dispatchEvent(x)},y=w=>{const x=new CustomEvent("photon-order-error",{composed:!0,bubbles:!0,detail:{errors:w}});r?.dispatchEvent(x)},b=w=>{const x=new CustomEvent("photon-form-validate",{composed:!0,bubbles:!0,detail:{canSubmit:w,form:n,actions:i}});r?.dispatchEvent(x)},g=async w=>{const x=w?["patient","draftPrescriptions","pharmacy","address"]:["patient","draftPrescriptions"];if(i.validate(x),!i.hasErrors(x)){l(!0),i.updateFormValue({key:"errors",value:[]});const S=o.getSDK().clinical.order.createOrder({}),T=o.getSDK().clinical.prescription.createPrescriptions({}),M=[];for(const D of n.draftPrescriptions.value){const R={daysSupply:D.daysSupply,dispenseAsWritten:D.dispenseAsWritten,dispenseQuantity:D.dispenseQuantity,dispenseUnit:D.dispenseUnit,effectiveDate:D.effectiveDate,instructions:D.instructions,notes:D.notes,patientId:n.patient?.value.id,fillsAllowed:D.refillsInput?D.refillsInput+1:1,treatmentId:D.treatment.id};M.push(R)}const{data:F,errors:K}=await T({variables:{prescriptions:M},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder||l(!1),K){v(K);return}if(p(F.createPrescriptions),e.enableOrder){const D=Object.assign({},n.patient?.value.address);delete D.__typename,delete D.name;const{data:R,errors:U}=await S({variables:{patientId:n.patient?.value.id,pharmacyId:e?.pharmacyId||n.pharmacy?.value.id,address:D,fills:F?.createPrescriptions.map(j=>({prescriptionId:j.id}))},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder&&l(!1),U){y(U);return}m(R.createOrder)}}};return t.element.submitForm=g,ge(()=>{b(Boolean(n.draftPrescriptions?.value?.length>0&&n.patient?.value))}),(()=>{const w=VP.cloneNode(!0),x=w.firstChild,E=x.nextSibling,S=E.nextSibling,T=S.nextSibling,M=T.nextSibling,F=M.firstChild,K=r;return typeof K=="function"?ee(K,w):r=w,_(x,ze),_(E,Vt),_(S,Ut),_(T,i7),_(F,z(re,{get when(){return fe(()=>!!(!o||c()))()&&!f()},get children(){const D=V(()=>document.importNode(jP,!0)),R=D.firstChild;return R._$owner=P(),D}}),null),_(F,z(V2,{get children(){return[z(yP,{actions:i,store:n,get patientId(){return e.patientId},client:o,get enableOrder(){return e.enableOrder}}),z(re,{get when(){return a()},get children(){return z(aP,{get hideAddToTemplates(){return e.hideTemplates},actions:i,store:n})}}),z(SP,{actions:i,store:n,get isLoading(){return u()}}),z(re,{get when(){return e.enableOrder&&!e.pharmacyId},get children(){return z(TP,{store:n,actions:i})}}),z(re,{get when(){return e.enableOrder&&e.pharmacyId},get children(){return z(DP,{get pharmacyId(){return e.pharmacyId}})}}),z(re,{get when(){return!e.hideSubmit},get children(){const D=V(()=>document.importNode(UP,!0)),R=D.firstChild;return _(D,z(re,{get when(){return!a()},get children(){const U=V(()=>document.importNode(zP,!0));return U.addEventListener("photon-clicked",async()=>s(!0)),U._$owner=P(),U}}),R),R.addEventListener("photon-clicked",async()=>await g(e.enableOrder)),R._$owner=P(),_(R,()=>e.enableOrder?"Send Order":"Save Prescriptions"),W(()=>R.loading=c()),D}})]}}),null),w})()});const WP=O('<p class="font-sans text-l font-medium"></p>'),qP=O('<sl-icon-button class="self-start"></sl-icon-button>'),HP=O("<style></style>"),GP=O('<div class="rounded-lg bg-white p-4 shadow-card border border-gray-200"></div>'),QP=O('<div class="flex flex-row justify-between"></div>'),KP=O("<slot></slot>");we("photon-card",{invalid:!1,title:null,collapsable:!1},e=>{const[t,r]=L(!0);let n=null,i=null;return e.title&&(n=(()=>{const o=WP.cloneNode(!0);return _(o,()=>e.title),o})()),e.collapsable&&(i=(()=>{const o=V(()=>document.importNode(qP,!0));return o.addEventListener("click",()=>{r(!t())}),o._$owner=P(),W(()=>o.name=t()?"chevron-right":"chevron-down"),o})()),[(()=>{const o=HP.cloneNode(!0);return _(o,ze),o})(),(()=>{const o=GP.cloneNode(!0);return _(o,n||i?(()=>{const a=QP.cloneNode(!0);return _(a,n,null),_(a,i,null),a})():null,null),_(o,(()=>{const a=fe(()=>!!(e.collapsable&&t()));return()=>a()?null:(()=>{const s=KP.cloneNode(!0);return s._$owner=P(),s})()})(),null),W(a=>{const s=!!e.invalid,c=!!e.invalid;return s!==a._v$&&o.classList.toggle("border-red-500",a._v$=s),c!==a._v$2&&o.classList.toggle("border-2",a._v$2=c),a},{_v$:void 0,_v$2:void 0}),o})()]});const YP=Wo`
3061
3062
  fragment CatalogTreatmentsFields on Catalog {
3062
3063
  id
3063
3064
  treatments {
@@ -3314,9 +3315,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3314
3315
  ${this.content}
3315
3316
  </slot>
3316
3317
  </sl-popup>
3317
- `}};yt.styles=nT;$([Xe("slot:not([name])")],yt.prototype,"defaultSlot",2);$([Xe(".tooltip__body")],yt.prototype,"body",2);$([Xe("sl-popup")],yt.prototype,"popup",2);$([k()],yt.prototype,"content",2);$([k()],yt.prototype,"placement",2);$([k({type:Boolean,reflect:!0})],yt.prototype,"disabled",2);$([k({type:Number})],yt.prototype,"distance",2);$([k({type:Boolean,reflect:!0})],yt.prototype,"open",2);$([k({type:Number})],yt.prototype,"skidding",2);$([k()],yt.prototype,"trigger",2);$([k({type:Boolean})],yt.prototype,"hoist",2);$([De("open",{waitUntilFirstUpdate:!0})],yt.prototype,"handleOpenChange",1);$([De(["content","distance","hoist","placement","skidding"])],yt.prototype,"handleOptionsChange",1);$([De("disabled")],yt.prototype,"handleDisabledChange",1);yt=$([_t("sl-tooltip")],yt);ur("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}});ur("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});const du=O("<style></style>"),iT=O('<sl-tooltip style="--max-width: 200px;"><sl-icon name="info-circle"></sl-icon></sl-tooltip>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const oT=({tip:e,placement:t="top"})=>[(()=>{const r=du.cloneNode(!0);return _(r,ze),r})(),(()=>{const r=du.cloneNode(!0);return _(r,Vt),r})(),(()=>{const r=du.cloneNode(!0);return _(r,Ut),r})(),(()=>{const r=V(()=>document.importNode(iT,!0)),n=r.firstChild;return r.content=e,r.placement=t,r._$owner=P(),n._$owner=P(),r})()],fu=O("<style></style>"),aT=O('<div class="flex items-center py-2"><p class="text-gray-500 text-sm font-medium pt-1 font-sans"></p><p class="text-gray-400 text-xs pt-1 pl-2 font-sans"></p></div>'),sT=O("<sl-checkbox checked></sl-checkbox>"),lT=O("<sl-checkbox></sl-checkbox>");tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-checkbox",{label:void 0,required:!1,disabled:!1,checked:!1,tip:void 0},e=>{const[t,r]=L(!1);let n;const i=o=>{const a=new CustomEvent("photon-checkbox-toggled",{composed:!0,bubbles:!0,detail:{checked:o}});n?.dispatchEvent(a)};return Tt(()=>{i(t())}),ge(()=>{e.checked!==t()&&r(e.checked)}),[(()=>{const o=fu.cloneNode(!0);return _(o,ze),o})(),(()=>{const o=fu.cloneNode(!0);return _(o,Vt),o})(),(()=>{const o=fu.cloneNode(!0);return _(o,Ut),o})(),(()=>{const o=aT.cloneNode(!0),a=o.firstChild,s=a.nextSibling;return _(o,(()=>{const c=pe(()=>!!e.checked);return()=>c()?(()=>{const l=V(()=>document.importNode(sT,!0)),u=n;return typeof u=="function"?ee(u,l):n=l,l.addEventListener("sl-change",d=>{i(!t()),r(!t())}),l._$owner=P(),W(()=>l.disabled=e.disabled),l})():(()=>{const l=V(()=>document.importNode(lT,!0)),u=n;return typeof u=="function"?ee(u,l):n=l,l.addEventListener("sl-change",d=>{i(!t()),r(!t())}),l._$owner=P(),W(()=>l.disabled=e.disabled),l})()})(),a),_(a,()=>e.label,null),_(a,z(re,{get when(){return e.tip},get children(){return z(oT,{get tip(){return e.tip||""},placement:"right"})}}),null),_(s,()=>e.required?"Required":"Optional"),o})()]});const cT=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity));font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";padding-top:.5rem}
3318
- `,ha=O("<style></style>"),uT=O('<div class="pb-2 flex flex-col"><sl-input class="input" type="date"></sl-input></div>'),dT=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm font-sans"></p></div>'),fT=O('<p class="pl-1 text-red-500">*</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-datepicker",{label:void 0,required:!1,invalid:!1,helpText:void 0,disabled:!1},e=>{let t;const r=oc(new Date,"yyyy-MM-dd").toString(),n=i=>{const o=new CustomEvent("photon-datepicker-selected",{composed:!0,bubbles:!0,detail:{date:i}});t?.dispatchEvent(o)};return Tt(()=>{n(r)}),[(()=>{const i=ha.cloneNode(!0);return _(i,ze),i})(),(()=>{const i=ha.cloneNode(!0);return _(i,Vt),i})(),(()=>{const i=ha.cloneNode(!0);return _(i,Ut),i})(),(()=>{const i=ha.cloneNode(!0);return _(i,cT),i})(),(()=>{const i=V(()=>document.importNode(uT,!0)),o=i.firstChild,a=t;return typeof a=="function"?ee(a,i):t=i,_(i,(()=>{const s=pe(()=>!!e.label);return()=>s()?(()=>{const c=dT.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=pe(()=>!!e.required);return()=>u()?fT.cloneNode(!0):null})(),null),c})():null})(),o),o.addEventListener("sl-input",s=>{n(s.target.value)}),o.value=r,o._$owner=P(),W(s=>{const c=e.disabled,l=!!e.invalid,u=e.helpText,d=e.invalid;return c!==s._v$&&(o.disabled=s._v$=c),l!==s._v$2&&o.classList.toggle("invalid",s._v$2=l),u!==s._v$3&&(o.helpText=s._v$3=u),d!==s._v$4&&(o.invalid=s._v$4=d),s},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),i})()]});const hT=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3319
- `,pa=O("<style></style>"),pT=O('<div class="py-2 flex flex-col font-sans"><sl-input class="input" type="number"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-input></div>'),mT=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm"></p></div>'),vT=O('<p class="pl-1 text-red-500">*</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-number-input",{label:void 0,required:!1,value:void 0,formName:void 0,min:void 0,max:void 0,invalid:!1,helpText:void 0,disabled:!1},e=>{let t;const r=n=>{const i=new CustomEvent("photon-input-changed",{composed:!0,bubbles:!0,detail:{input:n}});t?.dispatchEvent(i)};return Tt(()=>{r(e.value??0)}),[(()=>{const n=pa.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=pa.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=pa.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=pa.cloneNode(!0);return _(n,hT),n})(),(()=>{const n=V(()=>document.importNode(pT,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,_(n,(()=>{const s=pe(()=>!!e.label);return()=>s()?(()=>{const c=mT.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=pe(()=>!!e.required);return()=>u()?vT.cloneNode(!0):null})(),null),c})():null})(),i),i.addEventListener("sl-input",s=>{r(s.target.value)}),i.addEventListener("wheel",s=>{s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation()}),i._$owner=P(),_(o,()=>e.helpText),W(s=>{const c=!!e.invalid,l=e.disabled,u=e.min,d=e.max,f=e.invalid;return c!==s._v$&&i.classList.toggle("invalid",s._v$=c),l!==s._v$2&&(i.disabled=s._v$2=l),u!==s._v$3&&(i.min=s._v$3=u),d!==s._v$4&&(i.max=s._v$4=d),f!==s._v$5&&(i.invalid=s._v$5=f),s},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),W(()=>i.value=e.value),n})()]});const yT=()=>{const[e,t]=yn({dispenseUnits:{data:[],errors:[],isLoading:!1}});return{store:e,actions:{getDispenseUnits:async n=>{t("dispenseUnits",{...e.dispenseUnits,isLoading:!0});const{data:i,errors:o}=await n.clinical.prescription.getDispenseUnits();t("dispenseUnits",{...e.dispenseUnits,isLoading:!1,data:i.dispenseUnits.map((a,s)=>({id:s.toString(),...a})),errors:o})}}}},gT=yT(),bT=O("<div></div>");we("photon-dispense-units",{label:void 0,required:!1,invalid:!1,helpText:void 0,formName:void 0,disabled:!1,forceLabelSize:!1,selected:void 0},e=>{let t;const r=rt(),{store:n,actions:i}=gT,[o,a]=L(""),s=l=>{const u=new CustomEvent("photon-dispense-unit-selected",{composed:!0,bubbles:!0,detail:{dispenseUnit:{name:l.name}}});t?.dispatchEvent(u)};Tt(async()=>{await i.getDispenseUnits(r.getSDK())});const c=l=>{if(n.dispenseUnits.data.length>0){const u=n.dispenseUnits.data;return l.length===0?u:u.filter(d=>d.name.toLowerCase().includes(l.toLowerCase()))}return[]};return(()=>{const l=bT.cloneNode(!0),u=t;return typeof u=="function"?ee(u,l):t=l,l.addEventListener("photon-data-selected",d=>{s(d.detail.data)}),_(l,z(Nt,{get data(){return c(o())},get label(){return e.label},get disabled(){return e.disabled},get required(){return e.required},get forceLabelSize(){return e.forceLabelSize},placeholder:"Select a dispense unit...",get invalid(){return e.invalid},get isLoading(){return r?.clinical.dispenseUnits.state.isLoading||!1},hasMore:!1,get selectedData(){return pe(()=>!!e.selected)()?n.dispenseUnits.data?.filter(d=>d.name===e.selected)[0]:n.dispenseUnits.data?.[0]},displayAccessor:d=>d.name,onSearchChange:async d=>{a(d)},onHide:async()=>{a("")},noDataMsg:"No dispense units found",get helpText(){return e.helpText}})),l})()});var $T=ft`
3318
+ `}};yt.styles=nT;$([Xe("slot:not([name])")],yt.prototype,"defaultSlot",2);$([Xe(".tooltip__body")],yt.prototype,"body",2);$([Xe("sl-popup")],yt.prototype,"popup",2);$([k()],yt.prototype,"content",2);$([k()],yt.prototype,"placement",2);$([k({type:Boolean,reflect:!0})],yt.prototype,"disabled",2);$([k({type:Number})],yt.prototype,"distance",2);$([k({type:Boolean,reflect:!0})],yt.prototype,"open",2);$([k({type:Number})],yt.prototype,"skidding",2);$([k()],yt.prototype,"trigger",2);$([k({type:Boolean})],yt.prototype,"hoist",2);$([De("open",{waitUntilFirstUpdate:!0})],yt.prototype,"handleOpenChange",1);$([De(["content","distance","hoist","placement","skidding"])],yt.prototype,"handleOptionsChange",1);$([De("disabled")],yt.prototype,"handleDisabledChange",1);yt=$([_t("sl-tooltip")],yt);ur("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}});ur("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});const du=O("<style></style>"),iT=O('<sl-tooltip style="--max-width: 200px;"><sl-icon name="info-circle"></sl-icon></sl-tooltip>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const oT=({tip:e,placement:t="top"})=>[(()=>{const r=du.cloneNode(!0);return _(r,ze),r})(),(()=>{const r=du.cloneNode(!0);return _(r,Vt),r})(),(()=>{const r=du.cloneNode(!0);return _(r,Ut),r})(),(()=>{const r=V(()=>document.importNode(iT,!0)),n=r.firstChild;return r.content=e,r.placement=t,r._$owner=P(),n._$owner=P(),r})()],fu=O("<style></style>"),aT=O('<div class="flex items-center py-2"><p class="text-gray-500 text-sm font-medium pt-1 font-sans"></p><p class="text-gray-400 text-xs pt-1 pl-2 font-sans"></p></div>'),sT=O("<sl-checkbox checked></sl-checkbox>"),lT=O("<sl-checkbox></sl-checkbox>");tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-checkbox",{label:void 0,required:!1,disabled:!1,checked:!1,tip:void 0},e=>{const[t,r]=L(!1);let n;const i=o=>{const a=new CustomEvent("photon-checkbox-toggled",{composed:!0,bubbles:!0,detail:{checked:o}});n?.dispatchEvent(a)};return Tt(()=>{i(t())}),ge(()=>{e.checked!==t()&&r(e.checked)}),[(()=>{const o=fu.cloneNode(!0);return _(o,ze),o})(),(()=>{const o=fu.cloneNode(!0);return _(o,Vt),o})(),(()=>{const o=fu.cloneNode(!0);return _(o,Ut),o})(),(()=>{const o=aT.cloneNode(!0),a=o.firstChild,s=a.nextSibling;return _(o,(()=>{const c=fe(()=>!!e.checked);return()=>c()?(()=>{const l=V(()=>document.importNode(sT,!0)),u=n;return typeof u=="function"?ee(u,l):n=l,l.addEventListener("sl-change",d=>{i(!t()),r(!t())}),l._$owner=P(),W(()=>l.disabled=e.disabled),l})():(()=>{const l=V(()=>document.importNode(lT,!0)),u=n;return typeof u=="function"?ee(u,l):n=l,l.addEventListener("sl-change",d=>{i(!t()),r(!t())}),l._$owner=P(),W(()=>l.disabled=e.disabled),l})()})(),a),_(a,()=>e.label,null),_(a,z(re,{get when(){return e.tip},get children(){return z(oT,{get tip(){return e.tip||""},placement:"right"})}}),null),_(s,()=>e.required?"Required":"Optional"),o})()]});const cT=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity));font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";padding-top:.5rem}
3319
+ `,ha=O("<style></style>"),uT=O('<div class="pb-2 flex flex-col"><sl-input class="input" type="date"></sl-input></div>'),dT=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm font-sans"></p></div>'),fT=O('<p class="pl-1 text-red-500">*</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-datepicker",{label:void 0,required:!1,invalid:!1,helpText:void 0,disabled:!1},e=>{let t;const r=oc(new Date,"yyyy-MM-dd").toString(),n=i=>{const o=new CustomEvent("photon-datepicker-selected",{composed:!0,bubbles:!0,detail:{date:i}});t?.dispatchEvent(o)};return Tt(()=>{n(r)}),[(()=>{const i=ha.cloneNode(!0);return _(i,ze),i})(),(()=>{const i=ha.cloneNode(!0);return _(i,Vt),i})(),(()=>{const i=ha.cloneNode(!0);return _(i,Ut),i})(),(()=>{const i=ha.cloneNode(!0);return _(i,cT),i})(),(()=>{const i=V(()=>document.importNode(uT,!0)),o=i.firstChild,a=t;return typeof a=="function"?ee(a,i):t=i,_(i,(()=>{const s=fe(()=>!!e.label);return()=>s()?(()=>{const c=dT.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=fe(()=>!!e.required);return()=>u()?fT.cloneNode(!0):null})(),null),c})():null})(),o),o.addEventListener("sl-input",s=>{n(s.target.value)}),o.value=r,o._$owner=P(),W(s=>{const c=e.disabled,l=!!e.invalid,u=e.helpText,d=e.invalid;return c!==s._v$&&(o.disabled=s._v$=c),l!==s._v$2&&o.classList.toggle("invalid",s._v$2=l),u!==s._v$3&&(o.helpText=s._v$3=u),d!==s._v$4&&(o.invalid=s._v$4=d),s},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),i})()]});const hT=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3320
+ `,pa=O("<style></style>"),pT=O('<div class="py-2 flex flex-col font-sans"><sl-input class="input" type="number"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-input></div>'),mT=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm"></p></div>'),vT=O('<p class="pl-1 text-red-500">*</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-number-input",{label:void 0,required:!1,value:void 0,formName:void 0,min:void 0,max:void 0,invalid:!1,helpText:void 0,disabled:!1},e=>{let t;const r=n=>{const i=new CustomEvent("photon-input-changed",{composed:!0,bubbles:!0,detail:{input:n}});t?.dispatchEvent(i)};return Tt(()=>{r(e.value??0)}),[(()=>{const n=pa.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=pa.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=pa.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=pa.cloneNode(!0);return _(n,hT),n})(),(()=>{const n=V(()=>document.importNode(pT,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,_(n,(()=>{const s=fe(()=>!!e.label);return()=>s()?(()=>{const c=mT.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=fe(()=>!!e.required);return()=>u()?vT.cloneNode(!0):null})(),null),c})():null})(),i),i.addEventListener("sl-input",s=>{r(s.target.value)}),i.addEventListener("wheel",s=>{s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation()}),i._$owner=P(),_(o,()=>e.helpText),W(s=>{const c=!!e.invalid,l=e.disabled,u=e.min,d=e.max,f=e.invalid;return c!==s._v$&&i.classList.toggle("invalid",s._v$=c),l!==s._v$2&&(i.disabled=s._v$2=l),u!==s._v$3&&(i.min=s._v$3=u),d!==s._v$4&&(i.max=s._v$4=d),f!==s._v$5&&(i.invalid=s._v$5=f),s},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),W(()=>i.value=e.value),n})()]});const yT=()=>{const[e,t]=yn({dispenseUnits:{data:[],errors:[],isLoading:!1}});return{store:e,actions:{getDispenseUnits:async n=>{t("dispenseUnits",{...e.dispenseUnits,isLoading:!0});const{data:i,errors:o}=await n.clinical.prescription.getDispenseUnits();t("dispenseUnits",{...e.dispenseUnits,isLoading:!1,data:i.dispenseUnits.map((a,s)=>({id:s.toString(),...a})),errors:o})}}}},gT=yT(),bT=O("<div></div>");we("photon-dispense-units",{label:void 0,required:!1,invalid:!1,helpText:void 0,formName:void 0,disabled:!1,forceLabelSize:!1,selected:void 0},e=>{let t;const r=rt(),{store:n,actions:i}=gT,[o,a]=L(""),s=l=>{const u=new CustomEvent("photon-dispense-unit-selected",{composed:!0,bubbles:!0,detail:{dispenseUnit:{name:l.name}}});t?.dispatchEvent(u)};Tt(async()=>{await i.getDispenseUnits(r.getSDK())});const c=l=>{if(n.dispenseUnits.data.length>0){const u=n.dispenseUnits.data;return l.length===0?u:u.filter(d=>d.name.toLowerCase().includes(l.toLowerCase()))}return[]};return(()=>{const l=bT.cloneNode(!0),u=t;return typeof u=="function"?ee(u,l):t=l,l.addEventListener("photon-data-selected",d=>{s(d.detail.data)}),_(l,z(Nt,{get data(){return c(o())},get label(){return e.label},get disabled(){return e.disabled},get required(){return e.required},get forceLabelSize(){return e.forceLabelSize},placeholder:"Select a dispense unit...",get invalid(){return e.invalid},get isLoading(){return r?.clinical.dispenseUnits.state.isLoading||!1},hasMore:!1,get selectedData(){return fe(()=>!!e.selected)()?n.dispenseUnits.data?.filter(d=>d.name===e.selected)[0]:n.dispenseUnits.data?.[0]},displayAccessor:d=>d.name,onSearchChange:async d=>{a(d)},onHide:async()=>{a("")},noDataMsg:"No dispense units found",get helpText(){return e.helpText}})),l})()});var $T=ft`
3320
3321
  ${wt}
3321
3322
  ${$2}
3322
3323
 
@@ -3539,8 +3540,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3539
3540
  </slot>
3540
3541
  </div>
3541
3542
  `}};be.styles=$T;$([Xe(".textarea__control")],be.prototype,"input",2);$([Er()],be.prototype,"hasFocus",2);$([k()],be.prototype,"title",2);$([k()],be.prototype,"name",2);$([k()],be.prototype,"value",2);$([k({reflect:!0})],be.prototype,"size",2);$([k({type:Boolean,reflect:!0})],be.prototype,"filled",2);$([k()],be.prototype,"label",2);$([k({attribute:"help-text"})],be.prototype,"helpText",2);$([k()],be.prototype,"placeholder",2);$([k({type:Number})],be.prototype,"rows",2);$([k()],be.prototype,"resize",2);$([k({type:Boolean,reflect:!0})],be.prototype,"disabled",2);$([k({type:Boolean,reflect:!0})],be.prototype,"readonly",2);$([k({reflect:!0})],be.prototype,"form",2);$([k({type:Boolean,reflect:!0})],be.prototype,"required",2);$([k({type:Number})],be.prototype,"minlength",2);$([k({type:Number})],be.prototype,"maxlength",2);$([k()],be.prototype,"autocapitalize",2);$([k()],be.prototype,"autocorrect",2);$([k()],be.prototype,"autocomplete",2);$([k({type:Boolean})],be.prototype,"autofocus",2);$([k()],be.prototype,"enterkeyhint",2);$([k({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],be.prototype,"spellcheck",2);$([k()],be.prototype,"inputmode",2);$([rc()],be.prototype,"defaultValue",2);$([De("disabled",{waitUntilFirstUpdate:!0})],be.prototype,"handleDisabledChange",1);$([De("rows",{waitUntilFirstUpdate:!0})],be.prototype,"handleRowsChange",1);$([De("value",{waitUntilFirstUpdate:!0})],be.prototype,"handleValueChange",1);be=$([_t("sl-textarea")],be);const wT=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3542
- `,ma=O("<style></style>"),_T=O('<div class="py-2 flex flex-col"><sl-textarea class="input"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-textarea></div>'),xT=O('<div class="flex items-center pb-2 font-sans"><p class="text-gray-700 text-sm"></p></div>'),ST=O('<p class="pl-1 text-red-500">*</p>'),kT=O('<p class="text-gray-400 text-xs pl-2">Optional</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-textarea",{label:void 0,required:!1,placeholder:void 0,value:void 0,formName:void 0,helpText:void 0,invalid:!1,disabled:!1},e=>{let t;const r=n=>{const i=new CustomEvent("photon-textarea-changed",{composed:!0,bubbles:!0,detail:{value:n}});t?.dispatchEvent(i)};return Tt(()=>{r(e.value??"")}),[(()=>{const n=ma.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=ma.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=ma.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=ma.cloneNode(!0);return _(n,wT),n})(),(()=>{const n=V(()=>document.importNode(_T,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,_(n,(()=>{const s=pe(()=>!!e.label);return()=>s()?(()=>{const c=xT.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=pe(()=>!!e.required);return()=>u()?ST.cloneNode(!0):null})(),null),_(c,(()=>{const u=pe(()=>!e.required);return()=>u()?kT.cloneNode(!0):null})(),null),c})():null})(),i),i.addEventListener("sl-input",s=>{r(s.target.value)}),i._$owner=P(),_(o,()=>e.helpText),W(s=>{const c=!!e.invalid,l=e.disabled,u=e.invalid,d=e.placeholder;return c!==s._v$&&i.classList.toggle("invalid",s._v$=c),l!==s._v$2&&(i.disabled=s._v$2=l),u!==s._v$3&&(i.invalid=s._v$3=u),d!==s._v$4&&(i.placeholder=s._v$4=d),s},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),W(()=>i.value=e.value?e.value:""),n})()]});const ET=`.button{border-radius:var(--photon-border-radius, .375rem);--tw-text-opacity: 1;color:rgb(209 213 219/var(--tw-text-opacity))}.button:disabled{cursor:not-allowed}.button--solid{--tw-bg-opacity: 1;background-color:rgb(49 130 206/var(--tw-bg-opacity))}.button--solid:hover:disabled{background-color:#3182ce99}.button--solid:disabled{background-color:#3182ce99}.button--solid{--tw-text-opacity: 1;color:rgb(255 255 255/var(--tw-text-opacity))}.button--solid:hover{--tw-bg-opacity: 1;background-color:rgb(43 108 176/var(--tw-bg-opacity))}.button--outline{--tw-text-opacity: 1;color:rgb(49 130 206/var(--tw-text-opacity))}.button--outline:disabled{color:#3182ce99}.button--outline{border-width:1px}.button--outline:disabled{border-color:#3182ce99}.button--outline{--tw-border-opacity: 1;border-color:rgb(49 130 206/var(--tw-border-opacity))}.button--outline:hover{background-color:#3182ce33}.button--xs{height:1.5rem;padding-left:.5rem;padding-right:.5rem;font-size:.875rem;line-height:1.25rem}.button--sm{height:2rem;padding-left:.625rem;padding-right:.625rem;font-size:.875rem;line-height:1.25rem}.button--md{height:2.5rem;padding-left:1rem;padding-right:1rem}.button--lg{height:3rem;padding-left:1.5rem;padding-right:1.5rem;font-size:1.125rem;line-height:1.75rem}.spinner--solid{--indicator-color: white;--track-color: none}.spinner--outline{--indicator-color: rgb(49 130 206 / .6);--track-color: none}
3543
- `,va=O("<style></style>"),OT=O('<button class="rounded-lg font-sans transition ease-in-out delay-50 flex items-center gap-2"><slot name="suffix"></slot><slot name="postfix"></slot></button>'),CT=O('<p class="w-full"><slot></slot></p>'),PT=O('<div class="pt-[3px]"><sl-spinner class="w-[16px]"></sl-spinner></div>'),TT=O('<p class="w-full"></p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-button",{disabled:!1,loading:!1,loadingText:void 0,full:!1,variant:"solid",size:"md"},e=>{let t;const r=()=>{const n=new CustomEvent("photon-clicked",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(n)};return[(()=>{const n=va.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=va.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=va.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=va.cloneNode(!0);return _(n,ET),n})(),(()=>{const n=OT.cloneNode(!0),i=n.firstChild,o=i.nextSibling;n.$$click=()=>r();const a=t;return typeof a=="function"?ee(a,n):t=n,i._$owner=P(),_(n,(()=>{const s=pe(()=>!e.loading);return()=>s()?(()=>{const c=CT.cloneNode(!0),l=c.firstChild;return l._$owner=P(),c})():null})(),o),_(n,(()=>{const s=pe(()=>!!e.loading);return()=>s()?(()=>{const c=V(()=>document.importNode(PT,!0)),l=c.firstChild;return l._$owner=P(),W(u=>{const d=e.variant==="solid",f=e.variant==="outline";return d!==u._v$3&&l.classList.toggle("spinner--solid",u._v$3=d),f!==u._v$4&&l.classList.toggle("spinner--outline",u._v$4=f),u},{_v$3:void 0,_v$4:void 0}),c})():null})(),o),_(n,(()=>{const s=pe(()=>!!(e.loading&&e.loadingText));return()=>s()?(()=>{const c=TT.cloneNode(!0);return _(c,()=>e.loadingText),c})():null})(),o),o._$owner=P(),W(s=>{const c=e.disabled||e.loading,l={button:!0,"button--solid":e.variant==="solid","button--outline":e.variant==="outline","button--lg":e.size=="lg","button--md":e.size=="md","button--sm":e.size=="sm","button--xs":e.size=="xs","xs:w-fit":!0,"w-full":!0};return c!==s._v$&&(n.disabled=s._v$=c),s._v$2=C$(n,l,s._v$2),s},{_v$:void 0,_v$2:void 0}),n})()]});Ni(["click"]);const NT=Wo`
3543
+ `,ma=O("<style></style>"),_T=O('<div class="py-2 flex flex-col"><sl-textarea class="input"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-textarea></div>'),xT=O('<div class="flex items-center pb-2 font-sans"><p class="text-gray-700 text-sm"></p></div>'),ST=O('<p class="pl-1 text-red-500">*</p>'),kT=O('<p class="text-gray-400 text-xs pl-2">Optional</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-textarea",{label:void 0,required:!1,placeholder:void 0,value:void 0,formName:void 0,helpText:void 0,invalid:!1,disabled:!1},e=>{let t;const r=n=>{const i=new CustomEvent("photon-textarea-changed",{composed:!0,bubbles:!0,detail:{value:n}});t?.dispatchEvent(i)};return Tt(()=>{r(e.value??"")}),[(()=>{const n=ma.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=ma.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=ma.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=ma.cloneNode(!0);return _(n,wT),n})(),(()=>{const n=V(()=>document.importNode(_T,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,_(n,(()=>{const s=fe(()=>!!e.label);return()=>s()?(()=>{const c=xT.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=fe(()=>!!e.required);return()=>u()?ST.cloneNode(!0):null})(),null),_(c,(()=>{const u=fe(()=>!e.required);return()=>u()?kT.cloneNode(!0):null})(),null),c})():null})(),i),i.addEventListener("sl-input",s=>{r(s.target.value)}),i._$owner=P(),_(o,()=>e.helpText),W(s=>{const c=!!e.invalid,l=e.disabled,u=e.invalid,d=e.placeholder;return c!==s._v$&&i.classList.toggle("invalid",s._v$=c),l!==s._v$2&&(i.disabled=s._v$2=l),u!==s._v$3&&(i.invalid=s._v$3=u),d!==s._v$4&&(i.placeholder=s._v$4=d),s},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),W(()=>i.value=e.value?e.value:""),n})()]});const ET=`.button{border-radius:var(--photon-border-radius, .375rem);--tw-text-opacity: 1;color:rgb(209 213 219/var(--tw-text-opacity))}.button:disabled{cursor:not-allowed}.button--solid{--tw-bg-opacity: 1;background-color:rgb(49 130 206/var(--tw-bg-opacity))}.button--solid:hover:disabled{background-color:#3182ce99}.button--solid:disabled{background-color:#3182ce99}.button--solid{--tw-text-opacity: 1;color:rgb(255 255 255/var(--tw-text-opacity))}.button--solid:hover{--tw-bg-opacity: 1;background-color:rgb(43 108 176/var(--tw-bg-opacity))}.button--outline{--tw-text-opacity: 1;color:rgb(49 130 206/var(--tw-text-opacity))}.button--outline:disabled{color:#3182ce99}.button--outline{border-width:1px}.button--outline:disabled{border-color:#3182ce99}.button--outline{--tw-border-opacity: 1;border-color:rgb(49 130 206/var(--tw-border-opacity))}.button--outline:hover{background-color:#3182ce33}.button--xs{height:1.5rem;padding-left:.5rem;padding-right:.5rem;font-size:.875rem;line-height:1.25rem}.button--sm{height:2rem;padding-left:.625rem;padding-right:.625rem;font-size:.875rem;line-height:1.25rem}.button--md{height:2.5rem;padding-left:1rem;padding-right:1rem}.button--lg{height:3rem;padding-left:1.5rem;padding-right:1.5rem;font-size:1.125rem;line-height:1.75rem}.spinner--solid{--indicator-color: white;--track-color: none}.spinner--outline{--indicator-color: rgb(49 130 206 / .6);--track-color: none}
3544
+ `,va=O("<style></style>"),OT=O('<button class="rounded-lg font-sans transition ease-in-out delay-50 flex items-center gap-2"><slot name="suffix"></slot><slot name="postfix"></slot></button>'),CT=O('<p class="w-full"><slot></slot></p>'),PT=O('<div class="pt-[3px]"><sl-spinner class="w-[16px]"></sl-spinner></div>'),TT=O('<p class="w-full"></p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-button",{disabled:!1,loading:!1,loadingText:void 0,full:!1,variant:"solid",size:"md"},e=>{let t;const r=()=>{const n=new CustomEvent("photon-clicked",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(n)};return[(()=>{const n=va.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=va.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=va.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=va.cloneNode(!0);return _(n,ET),n})(),(()=>{const n=OT.cloneNode(!0),i=n.firstChild,o=i.nextSibling;n.$$click=()=>r();const a=t;return typeof a=="function"?ee(a,n):t=n,i._$owner=P(),_(n,(()=>{const s=fe(()=>!e.loading);return()=>s()?(()=>{const c=CT.cloneNode(!0),l=c.firstChild;return l._$owner=P(),c})():null})(),o),_(n,(()=>{const s=fe(()=>!!e.loading);return()=>s()?(()=>{const c=V(()=>document.importNode(PT,!0)),l=c.firstChild;return l._$owner=P(),W(u=>{const d=e.variant==="solid",f=e.variant==="outline";return d!==u._v$3&&l.classList.toggle("spinner--solid",u._v$3=d),f!==u._v$4&&l.classList.toggle("spinner--outline",u._v$4=f),u},{_v$3:void 0,_v$4:void 0}),c})():null})(),o),_(n,(()=>{const s=fe(()=>!!(e.loading&&e.loadingText));return()=>s()?(()=>{const c=TT.cloneNode(!0);return _(c,()=>e.loadingText),c})():null})(),o),o._$owner=P(),W(s=>{const c=e.disabled||e.loading,l={button:!0,"button--solid":e.variant==="solid","button--outline":e.variant==="outline","button--lg":e.size=="lg","button--md":e.size=="md","button--sm":e.size=="sm","button--xs":e.size=="xs","xs:w-fit":!0,"w-full":!0};return c!==s._v$&&(n.disabled=s._v$=c),s._v$2=C$(n,l,s._v$2),s},{_v$:void 0,_v$2:void 0}),n})()]});Ni(["click"]);const NT=Wo`
3544
3545
  fragment PatientPharmacyFields on Patient {
3545
3546
  preferredPharmacies {
3546
3547
  id
@@ -3556,8 +3557,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3556
3557
  phone
3557
3558
  }
3558
3559
  }
3559
- `,IT=()=>{const[e,t]=yn({pharmacies:{data:[],address:void 0,errors:[],isLoading:!1},selectedPharmacy:{data:void 0,errors:[],isLoading:!1},preferredPharmacies:{data:void 0,errors:[],isLoading:!1}}),r=async(l,u,d,f)=>{try{const h=await u.geocode({address:d}),p=h.results[0].geometry.location.lat(),m=h.results[0].geometry.location.lng(),v=h.results[0].formatted_address;if(v&&t("pharmacies",{...e.pharmacies,address:v,errors:[]}),!p||!m){t("pharmacies",{...e.pharmacies,errors:[new Error("An unexpected error occured")]});return}await n(l,{name:f,location:{latitude:p,longitude:m,radius:20}})}catch(h){console.log("ERR",h),t("pharmacies",{...e.pharmacies,errors:[new Error("The provided address seems invalid. Please revise and try again.")]})}},n=async(l,u)=>{t("pharmacies",{...e.pharmacies,isLoading:!0});const{data:d,errors:f}=await l.clinical.pharmacy.getPharmacies({name:u.name,location:u.location,first:u.first,type:"PICK_UP"});t("pharmacies",{...e.pharmacies,isLoading:!1,data:d.pharmacies,errors:f})};return{store:e,actions:{getPharmacies:n,getPharmaciesByAddress:r,getPharmacy:async(l,u)=>{t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!0});const{data:d,errors:f}=await l.clinical.pharmacy.getPharmacy({id:u});(e.pharmacies.errors||[]).filter(h=>h.message.includes("seems invalid")||h.message.includes("unexpected error")).length>0&&t("pharmacies",{...e.pharmacies,errors:[]}),t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!1,data:d.pharmacy,errors:f})},clearSelectedPharmacy:()=>{t("selectedPharmacy",{...e.selectedPharmacy,data:void 0,errors:[]})},getPreferredPharmacies:async(l,u)=>{t("preferredPharmacies",{...e.preferredPharmacies,isLoading:!0});const{data:d,errors:f}=await l.clinical.patient.getPatient({id:u,fragment:{PatientPharmacyFields:NT}});t("preferredPharmacies",{...e.selectedPharmacy,isLoading:!1,data:d.patient.preferredPharmacies?.map(h=>h),errors:f})},clearPreferredPharmacies:()=>{t("preferredPharmacies",{...e.selectedPharmacy,data:[],errors:[]})},reset:async()=>{t("pharmacies",{data:[],errors:[],address:void 0,isLoading:!1}),t("selectedPharmacy",{data:void 0,errors:[],isLoading:!1}),t("preferredPharmacies",{data:void 0,errors:[],isLoading:!1})}}}},B2=IT(),AT=O('<div class="flex flex-row gap-4 items-start"><div class="flex flex-col font-sans text-sm"><p class=" text-gray-500">Showing pharmacies near</p><p></p></div><photon-button class="self-end" variant="outline" size="xs">Change</photon-button></div>'),DT=O('<div class="flex flex-row gap-4 items-center"><div class="flex flex-col font-sans text-sm"><p class=" text-gray-500">Showing preferred pharmacy</p></div><photon-button variant="outline" size="xs">Change</photon-button></div>'),RT=O('<photon-text-input debounce-time="800" label="Enter an address or zip code"></photon-text-input>'),FT=O('<div class="flex flex-col gap-2"></div>');we("photon-pharmacy-search",{label:void 0,required:!1,invalid:!1,helpText:void 0,selected:"",formName:void 0,disabled:!1,forceLabelSize:!1,address:"",patientId:void 0,geocodingApiKey:"AIzaSyAvuwwE6g2Bsmih66nu4dB7-H7U1_7KQ6g"},e=>{let t;const r=rt();let n;const{store:i,actions:o}=B2,[a,s]=L(!1),[c,l]=L(""),[u,d]=L(""),[f,h]=L(""),p=y=>{const b=new CustomEvent("photon-pharmacy-selected",{composed:!0,bubbles:!0,detail:{pharmacy:y}});t?.dispatchEvent(b)},m=()=>{const y=new CustomEvent("photon-pharmacy-removed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(y)},v=pe(()=>{const y=i.pharmacies.data.filter(b=>!(i.preferredPharmacies.data??[]).map(g=>g.id).includes(b.id)).filter(b=>b.name.toLowerCase().includes(f().toLowerCase()));return i.selectedPharmacy.data&&u()?[i.selectedPharmacy.data,...(i.preferredPharmacies.data??[]).filter(b=>b.id!=i.selectedPharmacy.data?.id),...y]:[...i.preferredPharmacies.data??[],...y]});return Tt(async()=>{const y=document.createElement("script");y.src=`https://maps.googleapis.com/maps/api/js?key=${e.geocodingApiKey}`,document.head.appendChild(y),y.onload=async()=>{n=new google.maps.Geocoder,l(e.address),d(e.selected),e.patientId&&await o.getPreferredPharmacies(r.getSDK(),e.patientId),e.address&&await o.getPharmaciesByAddress(r.getSDK(),n,String(e.address)),e.selected&&await o.getPharmacy(r.getSDK(),e.selected),!e.address&&!e.selected&&s(!0)},y.onerror=b=>{console.error("Error loading Google Maps Geocoding API: ",b)}}),ge(()=>{l(e.address),d(e.selected),!e.selected&&!e.address?s(!0):s(!1),e.selected&&V(async()=>{await o.getPharmacy(r.getSDK(),e.selected)}),e.address&&!e.selected&&V(async()=>{o.clearSelectedPharmacy(),await o.getPharmaciesByAddress(r.getSDK(),n,e.address)})}),(()=>{const y=FT.cloneNode(!0),b=t;return typeof b=="function"?ee(b,y):t=y,y.addEventListener("photon-data-selected",g=>{p(g.detail.data)}),_(y,z(re,{get when(){return c()&&!a()&&(i.pharmacies.errors||[]).length==0},get children(){const g=V(()=>document.importNode(AT,!0)),w=g.firstChild,x=w.firstChild,E=x.nextSibling,S=w.nextSibling;return _(E,()=>i.pharmacies.address),S.addEventListener("photon-clicked",()=>{s(!0)}),S._$owner=P(),g}}),null),_(y,z(re,{get when(){return u()&&!c()&&!a()&&(i.pharmacies.errors||[]).length==0},get children(){const g=V(()=>document.importNode(DT,!0)),w=g.firstChild,x=w.nextSibling;return x.addEventListener("photon-clicked",()=>{m(),s(!0)}),x._$owner=P(),g}}),null),_(y,z(re,{get when(){return a()||(i.pharmacies.errors||[]).filter(g=>g.message.includes("seems invalid")||g.message.includes("unexpected error")).length>0},get children(){const g=V(()=>document.importNode(RT,!0));return g.addEventListener("photon-input-changed",async w=>{await o.getPharmaciesByAddress(r.getSDK(),n,w.detail.input),l(w.detail.input),d(""),o.clearSelectedPharmacy(),s(!1)}),g._$owner=P(),W(w=>{const x=e.invalid||(i.pharmacies.errors||[]).length>0,E=(i.pharmacies.errors||[]).length>0?i.pharmacies.errors[0].message:e.helpText;return x!==w._v$&&(g.invalid=w._v$=x),E!==w._v$2&&(g.helpText=w._v$2=E),w},{_v$:void 0,_v$2:void 0}),g}}),null),_(y,z(re,{get when(){return pe(()=>!!((c()||u())&&!a()))()&&(i.pharmacies.errors||[]).filter(g=>g.message.includes("seems invalid")||g.message.includes("unexpected error")).length==0},get children(){return z(Nt,{get data(){return v()},get groups(){return[...f()===""?[{label:"Preferred Pharmacy",filter:g=>g?(i.preferredPharmacies.data??[]).map(w=>w.id).includes(g.id):!1}]:[],{label:"Pharmacies",filter:g=>g?!(i.preferredPharmacies.data??[]).map(w=>w.id).includes(g.id):!1}]},get label(){return e.label},get forceLabelSize(){return e.forceLabelSize},get required(){return e.required},get disabled(){return e.disabled},placeholder:"Select a pharmacy...",get invalid(){return e.invalid||(i.pharmacies.errors||[]).length>0},get isLoading(){return i.pharmacies.isLoading||i.selectedPharmacy.isLoading},hasMore:!1,displayAccessor:g=>`${g.name}, ${Ep(g.address?.street1||"")}, ${Ep(g.address?.city||"")}, ${g.address?.state||""}`,showOverflow:!0,onSearchChange:async g=>{h(g)},onOpen:async()=>{i.pharmacies.data.length==0&&c()&&n&&await o.getPharmaciesByAddress(r.getSDK(),n,c())},noDataMsg:"No pharmacies found",get helpText(){return(i.pharmacies.errors||[]).length>0?i.pharmacies.errors[0].message:e.helpText},get selectedData(){return u()?i.selectedPharmacy.data:e.patientId?i.preferredPharmacies.data?.[0]:void 0}})}}),null),y})()});const LT=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3560
- `,ya=O("<style></style>"),MT=O('<div class="py-2 flex flex-col font-sans"><sl-input class="input" type="text"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-input></div>'),jT=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm"></p></div>'),zT=O('<p class="pl-1 text-red-500">*</p>'),UT=O('<p class="text-gray-400 text-xs pl-2 font-sans">Optional</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-text-input",{label:void 0,required:!1,value:void 0,formName:void 0,invalid:!1,helpText:void 0,disabled:!1,debounceTime:250,dispatchOnMount:!1,optional:!1},e=>{let t;const r=i=>{const o=new CustomEvent("photon-input-changed",{composed:!0,bubbles:!0,detail:{input:i}});t?.dispatchEvent(o)},n=X1(i=>r(i),e.debounceTime);return Tt(()=>{e.dispatchOnMount&&r(e.value??"")}),[(()=>{const i=ya.cloneNode(!0);return _(i,ze),i})(),(()=>{const i=ya.cloneNode(!0);return _(i,Vt),i})(),(()=>{const i=ya.cloneNode(!0);return _(i,Ut),i})(),(()=>{const i=ya.cloneNode(!0);return _(i,LT),i})(),(()=>{const i=V(()=>document.importNode(MT,!0)),o=i.firstChild,a=o.firstChild,s=t;return typeof s=="function"?ee(s,i):t=i,_(i,(()=>{const c=pe(()=>!!e.label);return()=>c()?(()=>{const l=jT.cloneNode(!0),u=l.firstChild;return _(u,()=>e.label),_(l,(()=>{const d=pe(()=>!!e.required);return()=>d()?zT.cloneNode(!0):null})(),null),_(l,(()=>{const d=pe(()=>!!e.optional);return()=>d()?UT.cloneNode(!0):null})(),null),l})():null})(),o),o.addEventListener("sl-input",c=>{n(c.target.value)}),o._$owner=P(),_(a,()=>e.helpText),W(c=>{const l=!!e.invalid,u=e.disabled,d=e.invalid;return l!==c._v$&&o.classList.toggle("invalid",c._v$=l),u!==c._v$2&&(o.disabled=c._v$2=u),d!==c._v$3&&(o.invalid=c._v$3=d),c},{_v$:void 0,_v$2:void 0,_v$3:void 0}),W(()=>o.value=e.value||""),i})()]});const VT=`.dialog::part(overlay){background-color:#0000007a}.dialog::part(body){padding-bottom:.25rem}.dialog::part(footer){padding-top:0}.hideFooter::part(footer){display:none}.showHeader::part(body){padding-top:0}.dialog::part(title){font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-weight:500}
3560
+ `,IT=()=>{const[e,t]=yn({pharmacies:{data:[],address:void 0,errors:[],isLoading:!1},selectedPharmacy:{data:void 0,errors:[],isLoading:!1},preferredPharmacies:{data:void 0,errors:[],isLoading:!1}}),r=async(l,u,d,f)=>{try{const h=await u.geocode({address:d}),p=h.results[0].geometry.location.lat(),m=h.results[0].geometry.location.lng(),v=h.results[0].formatted_address;if(v&&t("pharmacies",{...e.pharmacies,address:v,errors:[]}),!p||!m){t("pharmacies",{...e.pharmacies,errors:[new Error("An unexpected error occured")]});return}await n(l,{name:f,location:{latitude:p,longitude:m,radius:20}})}catch(h){console.log("ERR",h),t("pharmacies",{...e.pharmacies,errors:[new Error("The provided address seems invalid. Please revise and try again.")]})}},n=async(l,u)=>{t("pharmacies",{...e.pharmacies,isLoading:!0});const{data:d,errors:f}=await l.clinical.pharmacy.getPharmacies({name:u.name,location:u.location,first:u.first,type:"PICK_UP"});t("pharmacies",{...e.pharmacies,isLoading:!1,data:d.pharmacies,errors:f})};return{store:e,actions:{getPharmacies:n,getPharmaciesByAddress:r,getPharmacy:async(l,u)=>{t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!0});const{data:d,errors:f}=await l.clinical.pharmacy.getPharmacy({id:u});(e.pharmacies.errors||[]).filter(h=>h.message.includes("seems invalid")||h.message.includes("unexpected error")).length>0&&t("pharmacies",{...e.pharmacies,errors:[]}),t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!1,data:d.pharmacy,errors:f})},clearSelectedPharmacy:()=>{t("selectedPharmacy",{...e.selectedPharmacy,data:void 0,errors:[]})},getPreferredPharmacies:async(l,u)=>{t("preferredPharmacies",{...e.preferredPharmacies,isLoading:!0});const{data:d,errors:f}=await l.clinical.patient.getPatient({id:u,fragment:{PatientPharmacyFields:NT}});t("preferredPharmacies",{...e.selectedPharmacy,isLoading:!1,data:d.patient.preferredPharmacies?.map(h=>h),errors:f})},clearPreferredPharmacies:()=>{t("preferredPharmacies",{...e.selectedPharmacy,data:[],errors:[]})},reset:async()=>{t("pharmacies",{data:[],errors:[],address:void 0,isLoading:!1}),t("selectedPharmacy",{data:void 0,errors:[],isLoading:!1}),t("preferredPharmacies",{data:void 0,errors:[],isLoading:!1})}}}},B2=IT(),AT=O('<div class="flex flex-row gap-4 items-start"><div class="flex flex-col font-sans text-sm"><p class=" text-gray-500">Showing pharmacies near</p><p></p></div><photon-button class="self-end" variant="outline" size="xs">Change</photon-button></div>'),DT=O('<div class="flex flex-row gap-4 items-center"><div class="flex flex-col font-sans text-sm"><p class=" text-gray-500">Showing preferred pharmacy</p></div><photon-button variant="outline" size="xs">Change</photon-button></div>'),RT=O('<photon-text-input debounce-time="800" label="Enter an address or zip code"></photon-text-input>'),FT=O('<div class="flex flex-col gap-2"></div>');we("photon-pharmacy-search",{label:void 0,required:!1,invalid:!1,helpText:void 0,selected:"",formName:void 0,disabled:!1,forceLabelSize:!1,address:"",patientId:void 0,geocodingApiKey:"AIzaSyAvuwwE6g2Bsmih66nu4dB7-H7U1_7KQ6g"},e=>{let t;const r=rt();let n;const{store:i,actions:o}=B2,[a,s]=L(!1),[c,l]=L(""),[u,d]=L(""),[f,h]=L(""),p=y=>{const b=new CustomEvent("photon-pharmacy-selected",{composed:!0,bubbles:!0,detail:{pharmacy:y}});t?.dispatchEvent(b)},m=()=>{const y=new CustomEvent("photon-pharmacy-removed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(y)},v=fe(()=>{const y=i.pharmacies.data.filter(b=>!(i.preferredPharmacies.data??[]).map(g=>g.id).includes(b.id)).filter(b=>b.name.toLowerCase().includes(f().toLowerCase()));return i.selectedPharmacy.data&&u()?[i.selectedPharmacy.data,...(i.preferredPharmacies.data??[]).filter(b=>b.id!=i.selectedPharmacy.data?.id),...y]:[...i.preferredPharmacies.data??[],...y]});return Tt(async()=>{const y=document.createElement("script");y.src=`https://maps.googleapis.com/maps/api/js?key=${e.geocodingApiKey}`,document.head.appendChild(y),y.onload=async()=>{n=new google.maps.Geocoder,l(e.address),d(e.selected),e.patientId&&await o.getPreferredPharmacies(r.getSDK(),e.patientId),e.address&&await o.getPharmaciesByAddress(r.getSDK(),n,String(e.address)),e.selected&&await o.getPharmacy(r.getSDK(),e.selected),!e.address&&!e.selected&&s(!0)},y.onerror=b=>{console.error("Error loading Google Maps Geocoding API: ",b)}}),ge(()=>{l(e.address),d(e.selected),!e.selected&&!e.address?s(!0):s(!1),e.selected&&V(async()=>{await o.getPharmacy(r.getSDK(),e.selected)}),e.address&&!e.selected&&V(async()=>{o.clearSelectedPharmacy(),await o.getPharmaciesByAddress(r.getSDK(),n,e.address)})}),(()=>{const y=FT.cloneNode(!0),b=t;return typeof b=="function"?ee(b,y):t=y,y.addEventListener("photon-data-selected",g=>{p(g.detail.data)}),_(y,z(re,{get when(){return c()&&!a()&&(i.pharmacies.errors||[]).length==0},get children(){const g=V(()=>document.importNode(AT,!0)),w=g.firstChild,x=w.firstChild,E=x.nextSibling,S=w.nextSibling;return _(E,()=>i.pharmacies.address),S.addEventListener("photon-clicked",()=>{s(!0)}),S._$owner=P(),g}}),null),_(y,z(re,{get when(){return u()&&!c()&&!a()&&(i.pharmacies.errors||[]).length==0},get children(){const g=V(()=>document.importNode(DT,!0)),w=g.firstChild,x=w.nextSibling;return x.addEventListener("photon-clicked",()=>{m(),s(!0)}),x._$owner=P(),g}}),null),_(y,z(re,{get when(){return a()||(i.pharmacies.errors||[]).filter(g=>g.message.includes("seems invalid")||g.message.includes("unexpected error")).length>0},get children(){const g=V(()=>document.importNode(RT,!0));return g.addEventListener("photon-input-changed",async w=>{await o.getPharmaciesByAddress(r.getSDK(),n,w.detail.input),l(w.detail.input),d(""),o.clearSelectedPharmacy(),s(!1)}),g._$owner=P(),W(w=>{const x=e.invalid||(i.pharmacies.errors||[]).length>0,E=(i.pharmacies.errors||[]).length>0?i.pharmacies.errors[0].message:e.helpText;return x!==w._v$&&(g.invalid=w._v$=x),E!==w._v$2&&(g.helpText=w._v$2=E),w},{_v$:void 0,_v$2:void 0}),g}}),null),_(y,z(re,{get when(){return fe(()=>!!((c()||u())&&!a()))()&&(i.pharmacies.errors||[]).filter(g=>g.message.includes("seems invalid")||g.message.includes("unexpected error")).length==0},get children(){return z(Nt,{get data(){return v()},get groups(){return[...f()===""?[{label:"Preferred Pharmacy",filter:g=>g?(i.preferredPharmacies.data??[]).map(w=>w.id).includes(g.id):!1}]:[],{label:"Pharmacies",filter:g=>g?!(i.preferredPharmacies.data??[]).map(w=>w.id).includes(g.id):!1}]},get label(){return e.label},get forceLabelSize(){return e.forceLabelSize},get required(){return e.required},get disabled(){return e.disabled},placeholder:"Select a pharmacy...",get invalid(){return e.invalid||(i.pharmacies.errors||[]).length>0},get isLoading(){return i.pharmacies.isLoading||i.selectedPharmacy.isLoading},hasMore:!1,displayAccessor:g=>`${g.name}, ${Ep(g.address?.street1||"")}, ${Ep(g.address?.city||"")}, ${g.address?.state||""}`,showOverflow:!0,onSearchChange:async g=>{h(g)},onOpen:async()=>{i.pharmacies.data.length==0&&c()&&n&&await o.getPharmaciesByAddress(r.getSDK(),n,c())},noDataMsg:"No pharmacies found",get helpText(){return(i.pharmacies.errors||[]).length>0?i.pharmacies.errors[0].message:e.helpText},get selectedData(){return u()?i.selectedPharmacy.data:e.patientId?i.preferredPharmacies.data?.[0]:void 0}})}}),null),y})()});const LT=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3561
+ `,ya=O("<style></style>"),MT=O('<div class="py-2 flex flex-col font-sans"><sl-input class="input" type="text"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-input></div>'),jT=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm"></p></div>'),zT=O('<p class="pl-1 text-red-500">*</p>'),UT=O('<p class="text-gray-400 text-xs pl-2 font-sans">Optional</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-text-input",{label:void 0,required:!1,value:void 0,formName:void 0,invalid:!1,helpText:void 0,disabled:!1,debounceTime:250,dispatchOnMount:!1,optional:!1},e=>{let t;const r=i=>{const o=new CustomEvent("photon-input-changed",{composed:!0,bubbles:!0,detail:{input:i}});t?.dispatchEvent(o)},n=X1(i=>r(i),e.debounceTime);return Tt(()=>{e.dispatchOnMount&&r(e.value??"")}),[(()=>{const i=ya.cloneNode(!0);return _(i,ze),i})(),(()=>{const i=ya.cloneNode(!0);return _(i,Vt),i})(),(()=>{const i=ya.cloneNode(!0);return _(i,Ut),i})(),(()=>{const i=ya.cloneNode(!0);return _(i,LT),i})(),(()=>{const i=V(()=>document.importNode(MT,!0)),o=i.firstChild,a=o.firstChild,s=t;return typeof s=="function"?ee(s,i):t=i,_(i,(()=>{const c=fe(()=>!!e.label);return()=>c()?(()=>{const l=jT.cloneNode(!0),u=l.firstChild;return _(u,()=>e.label),_(l,(()=>{const d=fe(()=>!!e.required);return()=>d()?zT.cloneNode(!0):null})(),null),_(l,(()=>{const d=fe(()=>!!e.optional);return()=>d()?UT.cloneNode(!0):null})(),null),l})():null})(),o),o.addEventListener("sl-input",c=>{n(c.target.value)}),o._$owner=P(),_(a,()=>e.helpText),W(c=>{const l=!!e.invalid,u=e.disabled,d=e.invalid;return l!==c._v$&&o.classList.toggle("invalid",c._v$=l),u!==c._v$2&&(o.disabled=c._v$2=u),d!==c._v$3&&(o.invalid=c._v$3=d),c},{_v$:void 0,_v$2:void 0,_v$3:void 0}),W(()=>o.value=e.value||""),i})()]});const VT=`.dialog::part(overlay){background-color:#0000007a}.dialog::part(body){padding-bottom:.25rem}.dialog::part(footer){padding-top:0}.hideFooter::part(footer){display:none}.showHeader::part(body){padding-top:0}.dialog::part(title){font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-weight:500}
3561
3562
  `,ga=O("<style></style>"),BT=O('<slot name="label"><p class="text-xl font-sans font-medium"></p></slot>'),WT=O('<sl-dialog class="dialog"><div class="font-sans py-4"><slot></slot></div><div class="flex flex-col xs:flex-row justify-end gap-2" slot="footer"><photon-button variant="outline"></photon-button><photon-button></photon-button></div></sl-dialog>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-dialog",{label:void 0,header:!0,open:!1,confirmText:"Yes, Cancel",cancelText:"No, Keep Editing",disableButtons:!1,loading:!1,hideFooter:!1,disableSubmit:!1,width:"500px",overlayClose:!1},e=>{let t;const r=n=>{const i=new CustomEvent(n?"photon-dialog-confirmed":"photon-dialog-canceled",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(i)};return[(()=>{const n=ga.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=ga.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=ga.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=ga.cloneNode(!0);return _(n,VT),n})(),(()=>{const n=V(()=>document.importNode(WT,!0)),i=n.firstChild,o=i.firstChild,a=i.nextSibling,s=a.firstChild,c=s.nextSibling,l=t;return typeof l=="function"?ee(l,n):t=n,n.addEventListener("sl-request-close",u=>{u.detail.source==="overlay"&&!e.overlayClose||u.detail.source==="keyboard"?u.preventDefault():r(!1)}),n._$owner=P(),_(n,z(re,{get when(){return!e.header},get children(){const u=BT.cloneNode(!0),d=u.firstChild;return u._$owner=P(),_(d,()=>e.label),u}}),i),o._$owner=P(),s.addEventListener("photon-clicked",()=>{r(!1)}),s._$owner=P(),_(s,()=>e.cancelText),c.addEventListener("photon-clicked",()=>{r(!0)}),c._$owner=P(),_(c,()=>e.confirmText),W(u=>{const d=!!e.hideFooter,f=!!e.header,h=`--width: ${e.width};`,p=e.label,m=e.open,v=!e.header,y=!!e.hideFooter,b=e.disableButtons||e.loading,g=e.disableButtons||e.disableSubmit,w=e.loading;return d!==u._v$&&n.classList.toggle("hideFooter",u._v$=d),f!==u._v$2&&n.classList.toggle("showHeader",u._v$2=f),u._v$3=P$(n,h,u._v$3),p!==u._v$4&&(n.label=u._v$4=p),m!==u._v$5&&(n.open=u._v$5=m),v!==u._v$6&&(n.noHeader=u._v$6=v),y!==u._v$7&&a.classList.toggle("hidden",u._v$7=y),b!==u._v$8&&(s.disabled=u._v$8=b),g!==u._v$9&&(c.disabled=u._v$9=g),w!==u._v$10&&(c.loading=u._v$10=w),u},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0}),n})()]});const W2={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:83[0-389]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|3[178]|50|68|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-7]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:83[0-389]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0(4(?:[14]4|56)|[579])?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:83[0-389]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-579])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d\\d|1(?:[0-7]\\d\\d|8(?:[02]\\d|1[0-246-9])))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1289]|5[3-579]|6[0-489]|7[08]|8[0-689]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","9008\\d{3}|(?:[2-467]\\d\\d|862)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[25]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29[1289]|389)","529(?:1[1-46-9]|2[013-8]|90)|5(?:298|389)[0-46-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5293[01]\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|9[0-289])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[0189]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]|8[0-3]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670"],MQ:["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[1-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:[27]2|44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","976\\d{6}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]"],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-6]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6(?:0[5-7]|[1-35-9])|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:00|[1-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["505(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|4[46]))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[0-2]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","(?:0004|4)\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10,13],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63"],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[013-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function qT(e,t){var r=Array.prototype.slice.call(t);return r.push(W2),e.apply(this,r)}function qf(e){return qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qf(e)}function Vy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function HT(e,t,r){return t&&Vy(e.prototype,t),r&&Vy(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function GT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QT(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ro(e,t)}function KT(e){var t=H2();return function(){var n=Fo(e),i;if(t){var o=Fo(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return YT(this,i)}}function YT(e,t){if(t&&(qf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q2(e)}function q2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hf(e){var t=typeof Map=="function"?new Map:void 0;return Hf=function(n){if(n===null||!XT(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return vs(n,arguments,Fo(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ro(i,n)},Hf(e)}function vs(e,t,r){return H2()?vs=Reflect.construct:vs=function(i,o,a){var s=[null];s.push.apply(s,o);var c=Function.bind.apply(i,s),l=new c;return a&&Ro(l,a.prototype),l},vs.apply(null,arguments)}function H2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function XT(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ro(e,t){return Ro=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ro(e,t)}function Fo(e){return Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Fo(e)}var kn=function(e){QT(r,e);var t=KT(r);function r(n){var i;return GT(this,r),i=t.call(this,n),Object.setPrototypeOf(q2(i),r.prototype),i.name=i.constructor.name,i}return HT(r)}(Hf(Error)),ap=2,ZT=17,JT=3,Zt="0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9",eN="-\u2010-\u2015\u2212\u30FC\uFF0D",tN="\uFF0F/",rN="\uFF0E.",nN=" \xA0\xAD\u200B\u2060\u3000",iN="()\uFF08\uFF09\uFF3B\uFF3D\\[\\]",oN="~\u2053\u223C\uFF5E",or="".concat(eN).concat(tN).concat(rN).concat(nN).concat(iN).concat(oN),ac="+\uFF0B";function By(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var o=Number(r[i]),a=Number(n[i]);if(o>a)return 1;if(a>o)return-1;if(!isNaN(o)&&isNaN(a))return 1;if(isNaN(o)&&!isNaN(a))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}function Ol(e){return Ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ol(e)}function sc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function lc(e,t,r){return t&&Wy(e.prototype,t),r&&Wy(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var aN="1.2.0",sN="1.7.35",qy=" ext. ",lN=/^\d+$/,bt=function(){function e(t){sc(this,e),fN(t),this.metadata=t,G2.call(this,t)}return lc(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(r){return r!=="001"})}},{key:"getCountryMetadata",value:function(r){return this.metadata.countries[r]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(r){return this.getCountryMetadata(r)!==void 0}},{key:"hasCallingCode",value:function(r){if(this.getCountryCodesForCallingCode(r))return!0;if(this.nonGeographic()){if(this.nonGeographic()[r])return!0}else{var n=this.countryCallingCodes()[r];if(n&&n.length===1&&n[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(r){return this.nonGeographic()?!!this.nonGeographic()[r]:!this.getCountryCodesForCallingCode(r)}},{key:"country",value:function(r){return this.selectNumberingPlan(r)}},{key:"selectNumberingPlan",value:function(r,n){if(r&&lN.test(r)&&(n=r,r=null),r&&r!=="001"){if(!this.hasCountry(r))throw new Error("Unknown country: ".concat(r));this.numberingPlan=new Hy(this.getCountryMetadata(r),this)}else if(n){if(!this.hasCallingCode(n))throw new Error("Unknown calling code: ".concat(n));this.numberingPlan=new Hy(this.getNumberingPlanMetadata(n),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(r){var n=this.countryCallingCodes()[r];if(n)return n.length===1&&n[0].length===3?void 0:n}},{key:"getCountryCodeForCallingCode",value:function(r){var n=this.getCountryCodesForCallingCode(r);if(n)return n[0]}},{key:"getNumberingPlanMetadata",value:function(r){var n=this.getCountryCodeForCallingCode(r);if(n)return this.getCountryMetadata(n);if(this.nonGeographic()){var i=this.nonGeographic()[r];if(i)return i}else{var o=this.countryCallingCodes()[r];if(o&&o.length===1&&o[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(r){return this.numberingPlan.type(r)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(r){return this.selectNumberingPlan(r)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}]),e}(),Hy=function(){function e(t,r){sc(this,e),this.globalMetadataObject=r,this.metadata=t,G2.call(this,r.metadata)}return lc(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(r){return r[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var r=this,n=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return n.map(function(i){return new cN(i,r)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(r){return r[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(r){if(this.hasTypes()&&Gy(this.types(),r))return new dN(Gy(this.types(),r),this)}},{key:"ext",value:function(){return this.v1||this.v2?qy:this.metadata[13]||qy}}]),e}(),cN=function(){function e(t,r){sc(this,e),this._format=t,this.metadata=r}return lc(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!uN.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),e}(),uN=/^\(?\$1\)?$/,dN=function(){function e(t,r){sc(this,e),this.type=t,this.metadata=r}return lc(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),e}();function Gy(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function fN(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!hu(e)||!hu(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(hu(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+hN(e)+": "+e,"."))}var hu=function(t){return Ol(t)==="object"},hN=function(t){return Ol(t)};function sp(e,t){if(t=new bt(t),t.hasCountry(e))return t.country(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function G2(e){var t=e.version;typeof t=="number"?(this.v1=t===1,this.v2=t===2,this.v3=t===3,this.v4=t===4):t?By(t,aN)===-1?this.v2=!0:By(t,sN)===-1?this.v3=!0:this.v4=!0:this.v1=!0}var pN=";ext=",Zn=function(t){return"([".concat(Zt,"]{1,").concat(t,"})")};function Q2(e){var t="20",r="15",n="9",i="6",o="[ \xA0\\t,]*",a="[:\\.\uFF0E]?[ \xA0\\t,-]*",s="#?",c="(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)",l="(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)",u="[- ]+",d="[ \xA0\\t]*",f="(?:,{2}|;)",h=pN+Zn(t),p=o+c+a+Zn(t)+s,m=o+l+a+Zn(n)+s,v=u+Zn(i)+"#",y=d+f+a+Zn(r)+s,b=d+"(?:,)+"+a+Zn(n)+s;return h+"|"+p+"|"+m+"|"+v+"|"+y+"|"+b}var mN="["+Zt+"]{"+ap+"}",vN="["+ac+"]{0,1}(?:["+or+"]*["+Zt+"]){3,}["+or+Zt+"]*",yN=new RegExp("^["+ac+"]{0,1}(?:["+or+"]*["+Zt+"]){1,2}$","i"),gN=vN+"(?:"+Q2()+")?",bN=new RegExp("^"+mN+"$|^"+gN+"$","i");function K2(e){return e.length>=ap&&bN.test(e)}function $N(e){return yN.test(e)}var Qy=new RegExp("(?:"+Q2()+")$","i");function wN(e){var t=e.search(Qy);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(Qy),i=1;i<n.length;){if(n[i])return{number:r,ext:n[i]};i++}}function _N(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=xN(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3562
3563
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xN(e,t){if(!!e){if(typeof e=="string")return Ky(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ky(e,t)}}function Ky(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var SN={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","\uFF10":"0","\uFF11":"1","\uFF12":"2","\uFF13":"3","\uFF14":"4","\uFF15":"5","\uFF16":"6","\uFF17":"7","\uFF18":"8","\uFF19":"9","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9"};function Y2(e){return SN[e]}function Cl(e){for(var t="",r=_N(e.split("")),n;!(n=r()).done;){var i=n.value,o=Y2(i);o&&(t+=o)}return t}function kN(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=EN(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3563
3564
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EN(e,t){if(!!e){if(typeof e=="string")return Yy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yy(e,t)}}function Yy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xy(e){for(var t="",r=kN(e.split("")),n;!(n=r()).done;){var i=n.value;t+=ON(i,t)||""}return t}function ON(e,t){return e==="+"?t?void 0:"+":Y2(e)}function CN(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=PN(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
@@ -3575,7 +3576,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3575
3576
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XI(e,t){if(!!e){if(typeof e=="string")return _g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _g(e,t)}}function _g(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ZI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function JI(e,t,r){return t&&xg(e.prototype,t),r&&xg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Xf="9",eA=15,tA=ys(Xf,eA),rA=/[- ]/,nA=function(){return/\[([^\[\]])*\]/g},iA=function(){return/\d(?=[^,}][^,}])/g},oA=new RegExp("["+or+"]*\\$1["+or+"]*(\\$\\d["+or+"]*)*$"),Sg=3,aA=function(){function e(t){t.state;var r=t.metadata;ZI(this,e),this.metadata=r,this.resetFormat()}return JI(e,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(r,n){this.resetFormat(),r?(this.isNANP=r.callingCode()==="1",this.matchingFormats=r.formats(),n.nationalSignificantNumber&&this.narrowDownMatchingFormats(n)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(r,n){var i=this;if(MI(n.nationalSignificantNumber,this.metadata))for(var o=wg(this.matchingFormats),a;!(a=o()).done;){var s=a.value,c=LI(n,s,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(u){return i.shouldTryNationalPrefixFormattingRule(u,{international:n.international,nationalPrefix:n.nationalPrefix})},getSeparatorAfterNationalPrefix:function(u){return i.getSeparatorAfterNationalPrefix(u)}});if(c)return this.resetFormat(),this.chosenFormat=s,this.setNationalNumberTemplate(c.replace(/\d/g,er),n),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(er),c}return this.formatNationalNumberWithNextDigits(r,n)}},{key:"formatNationalNumberWithNextDigits",value:function(r,n){var i=this.chosenFormat,o=this.chooseFormat(n);if(o)return o===i?this.formatNextNationalNumberDigits(r):this.formatNextNationalNumberDigits(n.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(r){var n=this,i=r.nationalSignificantNumber,o=r.nationalPrefix,a=r.international,s=i,c=s.length-Sg;c<0&&(c=0),this.matchingFormats=this.matchingFormats.filter(function(l){return n.formatSuits(l,a,o)&&n.formatMatches(l,s,c)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(r,n,i){return!(i&&!r.usesNationalPrefix()&&!r.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!n&&!i&&r.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(r,n,i){var o=r.leadingDigitsPatterns().length;if(o===0)return!0;i=Math.min(i,o-1);var a=r.leadingDigitsPatterns()[i];if(n.length<Sg)try{return new YI(a).match(n,{allowOverflow:!0})!==void 0}catch(s){return console.error(s),!0}return new RegExp("^(".concat(a,")")).test(n)}},{key:"getFormatFormat",value:function(r,n){return n?r.internationalFormat():r.format()}},{key:"chooseFormat",value:function(r){for(var n=this,i=function(){var l=a.value;return n.chosenFormat===l?"break":oA.test(n.getFormatFormat(l,r.international))?n.createTemplateForFormat(l,r)?(n.chosenFormat=l,"break"):(n.matchingFormats=n.matchingFormats.filter(function(u){return u!==l}),"continue"):"continue"},o=wg(this.matchingFormats.slice()),a;!(a=o()).done;){var s=i();if(s==="break")break}return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(r,n){if(!(r.pattern().indexOf("|")>=0)){var i=this.getTemplateForFormat(r,n);if(i)return this.setNationalNumberTemplate(i,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&rA.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,o=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":o?"":"+"}},{key:"getTemplate",value:function(r){if(!!this.template){for(var n=-1,i=0,o=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";i<o.length+r.getDigitsWithoutInternationalPrefix().length;)n=this.template.indexOf(er,n+1),i++;return mg(this.template,n+1)}}},{key:"setNationalNumberTemplate",value:function(r,n){this.nationalNumberTemplate=r,this.populatedNationalNumberTemplate=r,this.populatedNationalNumberTemplatePosition=-1,n.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(n).replace(/[\d\+]/g,er)+ys(er,n.callingCode.length)+" "+r:this.template=r}},{key:"getTemplateForFormat",value:function(r,n){var i=n.nationalSignificantNumber,o=n.international,a=n.nationalPrefix,s=n.complexPrefixBeforeNationalSignificantNumber,c=r.pattern();c=c.replace(nA(),"\\d").replace(iA(),"\\d");var l=tA.match(c)[0];if(!(i.length>l.length)){var u=new RegExp("^"+c+"$"),d=i.replace(/\d/g,Xf);u.test(d)&&(l=d);var f=this.getFormatFormat(r,o),h;if(this.shouldTryNationalPrefixFormattingRule(r,{international:o,nationalPrefix:a})){var p=f.replace(t$,r.nationalPrefixFormattingRule());if(Cl(r.nationalPrefixFormattingRule())===(a||"")+Cl("$1")&&(f=p,h=!0,a))for(var m=a.length;m>0;)f=f.replace(/\d/,er),m--}var v=l.replace(new RegExp(c),f).replace(new RegExp(Xf,"g"),er);return h||(s?v=ys(er,s.length)+" "+v:a&&(v=ys(er,a.length)+this.getSeparatorAfterNationalPrefix(r)+v)),o&&(v=e$(v)),v}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=FI(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],mg(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,o=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var a=r.usesNationalPrefix();if(a&&o||!a&&!i)return!0}}}]),e}();function l$(e,t){return uA(e)||cA(e,t)||lA(e,t)||sA()}function sA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3576
3577
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lA(e,t){if(!!e){if(typeof e=="string")return kg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kg(e,t)}}function kg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function cA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(e);!(i=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));i=!0);}catch(c){o=!0,s=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function uA(e){if(Array.isArray(e))return e}function dA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fA(e,t,r){return t&&Eg(e.prototype,t),r&&Eg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var hA="["+or+Zt+"]+",pA=new RegExp("^"+hA+"$","i"),mA="(?:["+ac+"]["+or+Zt+"]*|["+or+Zt+"]+)",vA=new RegExp("[^"+or+Zt+"]+.*$"),yA=/[^\d\[\]]/,gA=function(){function e(t){var r=t.defaultCountry,n=t.defaultCallingCode,i=t.metadata,o=t.onNationalSignificantNumberChange;dA(this,e),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=i,this.onNationalSignificantNumberChange=o}return fA(e,[{key:"input",value:function(r,n){var i=wA(r),o=l$(i,2),a=o[0],s=o[1],c=Cl(a),l;return s&&(n.digits||(n.startInternationalNumber(),c||(l=!0))),c&&this.inputDigits(c,n),{digits:c,justLeadingPlus:l}}},{key:"inputDigits",value:function(r,n){var i=n.digits,o=i.length<3&&i.length+r.length>=3;if(n.appendDigits(r),o&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(a){return n.update(a)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=a$("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,o=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:o}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&yA.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(!!this.hasSelectedNumberingPlan){var i=Gf(r,this.metadata),o=i.nationalPrefix,a=i.nationalNumber,s=i.carrierCode;if(a!==r)return this.onExtractedNationalNumber(o,s,a,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(!!this.couldPossiblyExtractAnotherNationalSignificantNumber){var o=Gf(r,this.metadata),a=o.nationalPrefix,s=o.nationalNumber,c=o.carrierCode;if(s!==n)return this.onExtractedNationalNumber(a,c,s,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,o,a){var s,c,l=o.lastIndexOf(i);if(l>=0&&l===o.length-i.length){c=!0;var u=o.slice(0,l);u!==r&&(s=u)}a({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:c,complexPrefixBeforeNationalSignificantNumber:s}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,i=r.IDDPrefix,o=r.digits;if(r.nationalSignificantNumber,!(n||i)){var a=i$(o,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(a!==void 0&&a!==o)return r.update({IDDPrefix:o.slice(0,o.length-a.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=o$(r.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode;if(n.number,i)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(r,n){var i=n.country,o=n.callingCode;r.startInternationalNumber(i,o),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}]),e}();function bA(e){var t=e.search(mA);if(!(t<0)){e=e.slice(t);var r;return e[0]==="+"&&(r=!0,e=e.slice(1)),e=e.replace(vA,""),r&&(e="+"+e),e}}function $A(e){var t=bA(e)||"";return t[0]==="+"?[t.slice(1),!0]:[t]}function wA(e){var t=$A(e),r=l$(t,2),n=r[0],i=r[1];return pA.test(n)||(n=""),[n,i]}function Zf(e){return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(e)}function _A(e,t){return EA(e)||kA(e,t)||SA(e,t)||xA()}function xA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3577
3578
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SA(e,t){if(!!e){if(typeof e=="string")return Og(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Og(e,t)}}function Og(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(e);!(i=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));i=!0);}catch(c){o=!0,s=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function EA(e){if(Array.isArray(e))return e}function OA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function CA(e,t,r){return t&&Cg(e.prototype,t),r&&Cg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var c$=function(){function e(t,r){OA(this,e),this.metadata=new bt(r);var n=this.getCountryAndCallingCode(t),i=_A(n,2),o=i[0],a=i[1];this.defaultCountry=o,this.defaultCallingCode=a,this.reset()}return CA(e,[{key:"getCountryAndCallingCode",value:function(r){var n,i;return r&&(Zf(r)==="object"?(n=r.defaultCountry,i=r.defaultCallingCode):n=r),n&&!this.metadata.hasCountry(n)&&(n=void 0),[n,i]}},{key:"input",value:function(r){var n=this.parser.input(r,this.state),i=n.digits,o=n.justLeadingPlus;if(o)this.formattedOutput="+";else if(i){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var a;if(this.metadata.hasSelectedNumberingPlan()&&(a=this.formatter.format(i,this.state)),a===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var s=this.state.getNationalDigits();s&&(a=this.formatter.format(s,this.state))}this.formattedOutput=a?this.getFullNumber(a):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var r=this;return this.state=new II({onCountryChange:function(i){r.country=i},onCallingCodeChange:function(i,o){r.metadata.selectNumberingPlan(o,i),r.formatter.reset(r.metadata.numberingPlan,r.state),r.parser.reset(r.metadata.numberingPlan)}}),this.formatter=new aA({state:this.state,metadata:this.metadata}),this.parser=new gA({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){r.determineTheCountryIfNeeded(),r.formatter.reset(r.metadata.numberingPlan,r.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var r=this.state.digits;if(r)return this._getCountry()}},{key:"_getCountry",value:function(){var r=this.state.country;return r}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(r){var n=this;if(this.isInternational()){var i=function(s){return n.formatter.getInternationalPrefixBeforeCountryCallingCode(n.state,{spacing:!!s})+s},o=this.state.callingCode;return i(o?r?"".concat(o," ").concat(r):o:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return r}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.complexPrefixBeforeNationalSignificantNumber,o=r.nationalPrefix,a=n,s=i||o;return s&&(a=s+a),a}},{key:"getNonFormattedNumber",value:function(){var r=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(r?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var r=this.getNonFormattedNumber();if(r)return r.replace(/[\+\d]/g,er)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var r=this.state.callingCode,n=this.metadata.getCountryCodesForCallingCode(r);return n&&n.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(s$(this.isInternational()?this.state.callingCode:this.defaultCallingCode,this.state.nationalSignificantNumber,this.metadata))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,i=r.callingCode,o=r.country,a=r.nationalSignificantNumber;if(!!n){if(this.isInternational())return i?"+"+i+a:"+"+n;if(o||i){var s=o?this.metadata.countryCallingCode():i;return"+"+s+a}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,o=r.callingCode,a=this._getCountry();if(!!n&&!(!a&&!o)){var s=new n$(a||o,n,this.metadata.metadata);return i&&(s.carrierCode=i),s}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),e}();function gu(){return qT(OI,arguments)}function Tl(e){return c$.call(this,e,W2)}Tl.prototype=Object.create(c$.prototype,{});Tl.prototype.constructor=Tl;const PA=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3578
- `,ba=O("<style></style>"),TA=O('<div class="py-2 flex flex-col font-sans"><sl-input class="input" type="tel" placeholder="( ) ___-____"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-input></div>'),NA=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm"></p></div>'),IA=O('<p class="pl-1 text-red-500">*</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-phone-input",{label:void 0,required:!1,value:void 0,invalid:!1,helpText:void 0,disabled:!1},e=>{let t;const r=n=>{const i=new CustomEvent("photon-phone-changed",{composed:!0,bubbles:!0,detail:{phone:n}});t?.dispatchEvent(i)};return Tt(()=>{e.value&&r(gu(e.value,"US").format("E.164"))}),[(()=>{const n=ba.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=ba.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=ba.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=ba.cloneNode(!0);return _(n,PA),n})(),(()=>{const n=V(()=>document.importNode(TA,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,_(n,(()=>{const s=pe(()=>!!e.label);return()=>s()?(()=>{const c=NA.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=pe(()=>!!e.required);return()=>u()?IA.cloneNode(!0):null})(),null),c})():null})(),i),i.addEventListener("sl-input",s=>{r(gu(s.target.value,"US").format("E.164"))}),i._$owner=P(),_(o,()=>e.helpText),W(s=>{const c=!!e.invalid,l=e.disabled,u=e.invalid;return c!==s._v$&&i.classList.toggle("invalid",s._v$=c),l!==s._v$2&&(i.disabled=s._v$2=l),u!==s._v$3&&(i.invalid=s._v$3=u),s},{_v$:void 0,_v$2:void 0,_v$3:void 0}),W(()=>i.value=e.value?new Tl("US").input(gu(e.value,"US").formatNational()):""),n})()]});const AA=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3579
+ `,ba=O("<style></style>"),TA=O('<div class="py-2 flex flex-col font-sans"><sl-input class="input" type="tel" placeholder="( ) ___-____"><p slot="help-text" class="text-red-500 pt-2 h-[21px] font-sans"></p></sl-input></div>'),NA=O('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm"></p></div>'),IA=O('<p class="pl-1 text-red-500">*</p>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-phone-input",{label:void 0,required:!1,value:void 0,invalid:!1,helpText:void 0,disabled:!1},e=>{let t;const r=n=>{const i=new CustomEvent("photon-phone-changed",{composed:!0,bubbles:!0,detail:{phone:n}});t?.dispatchEvent(i)};return Tt(()=>{e.value&&r(gu(e.value,"US").format("E.164"))}),[(()=>{const n=ba.cloneNode(!0);return _(n,ze),n})(),(()=>{const n=ba.cloneNode(!0);return _(n,Vt),n})(),(()=>{const n=ba.cloneNode(!0);return _(n,Ut),n})(),(()=>{const n=ba.cloneNode(!0);return _(n,PA),n})(),(()=>{const n=V(()=>document.importNode(TA,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,_(n,(()=>{const s=fe(()=>!!e.label);return()=>s()?(()=>{const c=NA.cloneNode(!0),l=c.firstChild;return _(l,()=>e.label),_(c,(()=>{const u=fe(()=>!!e.required);return()=>u()?IA.cloneNode(!0):null})(),null),c})():null})(),i),i.addEventListener("sl-input",s=>{r(gu(s.target.value,"US").format("E.164"))}),i._$owner=P(),_(o,()=>e.helpText),W(s=>{const c=!!e.invalid,l=e.disabled,u=e.invalid;return c!==s._v$&&i.classList.toggle("invalid",s._v$=c),l!==s._v$2&&(i.disabled=s._v$2=l),u!==s._v$3&&(i.invalid=s._v$3=u),s},{_v$:void 0,_v$2:void 0,_v$3:void 0}),W(()=>i.value=e.value?new Tl("US").input(gu(e.value,"US").formatNational()):""),n})()]});const AA=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3579
3580
  `,DA=O("<div><style></style><style></style></div>"),Jf=[{id:"1",name:"MALE"},{id:"2",name:"FEMALE"},{id:"3",name:"UNKNOWN"}];we("photon-sex-input",{label:void 0,required:!1,value:void 0,invalid:!1,helpText:void 0,disabled:!1,selected:void 0},e=>{let t;const r=n=>{const i=new CustomEvent("photon-sex-selected",{composed:!0,bubbles:!0,detail:{sex:n}});t?.dispatchEvent(i)};return(()=>{const n=DA.cloneNode(!0),i=n.firstChild,o=i.nextSibling,a=t;return typeof a=="function"?ee(a,n):t=n,n.addEventListener("photon-data-selected",s=>{r(s.detail.data.name)}),_(i,ze),_(o,AA),_(n,z(Nt,{data:Jf,get label(){return e.label},get required(){return e.required},placeholder:"",get disabled(){return e.disabled},get invalid(){return e.invalid},isLoading:!1,hasMore:!1,displayAccessor:s=>s.name,showOverflow:!0,noDataMsg:"",optional:!1,get helpText(){return e.helpText},get selectedData(){return Jf.filter(s=>s.name.toUpperCase()===e.selected)?.[0]}}),null),n})()});const RA=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3580
3581
  `,FA=O("<div><style></style><style></style></div>"),bu=[{id:"1",name:"Male/Man"},{id:"2",name:"Female/Woman"},{id:"3",name:"TransMale/TransMan"},{id:"4",name:"TransFemale/TransWoman"},{id:"5",name:"Genderqueery/Gender nonconforming"},{id:"6",name:"Something else"},{id:"7",name:"Decline to answer"}];we("photon-gender-input",{label:void 0,required:!1,value:void 0,invalid:!1,helpText:void 0,disabled:!1,selected:void 0},e=>{const[t,r]=L("");let n;const i=s=>s.length===0?bu:bu.filter(c=>c.name.toLowerCase().includes(s.toLowerCase())),o=s=>{const c=new CustomEvent("photon-gender-selected",{composed:!0,bubbles:!0,detail:{gender:s}});n?.dispatchEvent(c)},a=()=>{const s=new CustomEvent("photon-gender-deselected",{composed:!0,bubbles:!0,detail:{}});n?.dispatchEvent(s)};return(()=>{const s=FA.cloneNode(!0),c=s.firstChild,l=c.nextSibling,u=n;return typeof u=="function"?ee(u,s):n=s,s.addEventListener("photon-data-selected",d=>{o(d.detail.data.name)}),s.addEventListener("photon-data-unselected",d=>{a()}),_(c,ze),_(l,RA),_(s,z(Nt,{get data(){return i(t())},get label(){return e.label},get required(){return e.required},placeholder:"",get disabled(){return e.disabled},get invalid(){return e.invalid},isLoading:!1,hasMore:!1,displayAccessor:d=>d.name,showOverflow:!0,onSearchChange:async d=>{r(d)},onHide:async()=>{r("")},noDataMsg:"",get optional(){return!e.required},get helpText(){return e.helpText},get selectedData(){return bu.filter(d=>d.name===e.selected)?.[0]}}),null),s})()});const LA=O('<div class="flex align-center justify-center h-screen"><sl-spinner style="font-size: 3rem;" class="mt-8"></sl-spinner></div>'),MA=O('<photon-card title="Personal"><div class="flex flex-col xs:flex-row xs:gap-4"><photon-text-input class="flex-grow min-w-[40%]" debounce-time="0" label="First Name"></photon-text-input><photon-text-input class="min-w-[48%]" debounce-time="0" label="Last Name"></photon-text-input></div><div class="flex flex-col xs:flex-row items-center xs:gap-4"><photon-datepicker class="pb-3 flex-grow w-full xs:min-w-[40%]" label="Date of Birth"></photon-datepicker><photon-phone-input class="w-full xs:min-w-[48%]" label="Phone Number"></photon-phone-input></div><div class="flex flex-col xs:flex-row justify-between xs:gap-4"><div class="flex-grow w-full xs:min-w-[40%]"><photon-gender-input label="Gender" required="false"></photon-gender-input></div><div class="flex-grow w-full xs:min-w-[40%]"><photon-sex-input label="Sex at Birth" required="false"></photon-sex-input></div></div><photon-text-input debounce-time="0" label="Email"></photon-text-input><hr class="py-2"><p class="font-sans text-lg flex-grow">Address</p><photon-text-input debounce-time="0" label="Street 1"></photon-text-input><photon-text-input debounce-time="0" label="Street 2"></photon-text-input><photon-text-input debounce-time="0" label="City"></photon-text-input><div class="flex gap-4 pb-5 xs:pb-2"><photon-state-input class="flex-grow min-w-[40%]" label="State" required="false"></photon-state-input><photon-text-input debounce-time="0" class="flex-grow min-w-[40%]" label="Zip Code"></photon-text-input></div><hr class="py-2"><p class="font-sans text-lg flex-grow">Preferred Local Pharmacy</p><photon-pharmacy-search></photon-pharmacy-search></photon-card>'),jA=O('<div class="w-full h-full relative"><style></style><style></style><style></style></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");const zA=(e,t)=>{const r=e.selectedPatient.data?.address;return t.address_zip?.value&&Q$(t.address_zip?.value)&&t.address_zip?.value!=r?.postalCode?t.address_zip?.value:r?`${r.street1} ${r.street2??""} ${r.city}, ${r.state} ${r.postalCode}`:""};we("photon-patient-form",{patientId:""},({patientId:e})=>{let t;const r=rt(),{store:n,actions:i}=nc,{actions:o}=B2,{store:a,actions:s}=k2({firstName:void 0,lastName:void 0,dateOfBirth:void 0,phone:void 0,gender:void 0,sex:void 0,email:void 0,address_street1:void 0,address_street2:void 0,address_city:void 0,address_state:void 0,address_zip:void 0,preferredPharmacy:void 0});s.registerValidator({key:"firstName",validator:ot(Nr(jt(),1,1/0),"Please enter a first name...")}),s.registerValidator({key:"lastName",validator:ot(Nr(jt(),1,1/0),"Please enter a last name...")}),s.registerValidator({key:"sex",validator:ot(f7(Jf.map(l=>l.name)),"Please enter Sex at Birth...")}),s.registerValidator({key:"phone",validator:ot(Nr(jt(),12),"Please enter a valid phone number...")}),s.registerValidator({key:"email",validator:ot(kv([tP(),Uy()]),"Please enter a valid email...")}),s.registerValidator({key:"address_zip",validator:ot(kv([Nr(eP(),0,10),Uy()]),"Please enter a valid zip code...")}),Tt(()=>{e&&i.getSelectedPatient(r.getSDK(),e)});const c=l=>{const u=new CustomEvent("photon-form-updated",{composed:!0,bubbles:!0,detail:{form:l,actions:s,selected:n,reset:()=>{s.reset(),i.reset(),o.reset()}}});t?.dispatchEvent(u)};return ge(()=>{n.selectedPatient.data&&(s.updateFormValue({key:"firstName",value:n.selectedPatient.data.name.first}),s.updateFormValue({key:"lastName",value:n.selectedPatient.data.name.last}),s.updateFormValue({key:"phone",value:n.selectedPatient.data.phone}),s.updateFormValue({key:"gender",value:n.selectedPatient.data.gender}),s.updateFormValue({key:"sex",value:n.selectedPatient.data.sex}),s.updateFormValue({key:"email",value:n.selectedPatient.data.email}),s.updateFormValue({key:"address_street1",value:n.selectedPatient.data.address?.street1}),s.updateFormValue({key:"address_street2",value:n.selectedPatient.data.address?.street2}),s.updateFormValue({key:"address_city",value:n.selectedPatient.data.address?.city}),s.updateFormValue({key:"address_state",value:n.selectedPatient.data.address?.state}),s.updateFormValue({key:"address_zip",value:n.selectedPatient.data.address?.postalCode}),s.updateFormValue({key:"preferredPharmacy",value:n.selectedPatient.data.preferredPharmacies?.[0]?.id}))}),ge(()=>{c(a)}),(()=>{const l=jA.cloneNode(!0),u=l.firstChild,d=u.nextSibling,f=d.nextSibling,h=t;return typeof h=="function"?ee(h,l):t=l,_(u,ze),_(d,Vt),_(f,Ut),_(l,z(re,{get when(){return n.selectedPatient.isLoading},get children(){const p=V(()=>document.importNode(LA,!0)),m=p.firstChild;return m._$owner=P(),p}}),null),_(l,z(re,{get when(){return!n.selectedPatient.isLoading},get children(){return z(V2,{get children(){const p=V(()=>document.importNode(MA,!0)),m=p.firstChild,v=m.firstChild,y=v.nextSibling,b=m.nextSibling,g=b.firstChild,w=g.nextSibling,x=b.nextSibling,E=x.firstChild,S=E.firstChild,T=E.nextSibling,M=T.firstChild,F=x.nextSibling,K=F.nextSibling,D=K.nextSibling,R=D.nextSibling,U=R.nextSibling,j=U.nextSibling,Y=j.nextSibling,oe=Y.firstChild,ae=oe.nextSibling,A=Y.nextSibling,me=A.nextSibling,xe=me.nextSibling;return p._$owner=P(),v.disabled=!!e,v.addEventListener("photon-input-changed",async I=>{s.updateFormValue({key:"firstName",value:I.detail.input})}),v._$owner=P(),y.disabled=!!e,y.addEventListener("photon-input-changed",async I=>{s.updateFormValue({key:"lastName",value:I.detail.input})}),y._$owner=P(),g.disabled=!!e,g.addEventListener("photon-datepicker-selected",async I=>{s.updateFormValue({key:"dateOfBirth",value:I.detail.date})}),g._$owner=P(),w.addEventListener("photon-phone-changed",async I=>{s.updateFormValue({key:"phone",value:I.detail.phone})}),w._$owner=P(),S.addEventListener("photon-gender-selected",I=>{s.updateFormValue({key:"gender",value:I.detail.gender})}),S.addEventListener("photon-gender-deselected",I=>{s.updateFormValue({key:"gender",value:void 0})}),S._$owner=P(),M.disabled=!!e,M.addEventListener("photon-sex-selected",I=>{s.updateFormValue({key:"sex",value:I.detail.sex})}),M.addEventListener("photon-sex-deselected",I=>{s.updateFormValue({key:"sex",value:void 0})}),M._$owner=P(),F.addEventListener("photon-input-changed",async I=>{s.updateFormValue({key:"email",value:I.detail.input})}),F._$owner=P(),R.addEventListener("photon-input-changed",async I=>{s.updateFormValue({key:"address_street1",value:I.detail.input})}),R._$owner=P(),U.optional=!0,U.addEventListener("photon-input-changed",async I=>{s.updateFormValue({key:"address_street2",value:I.detail.input})}),U._$owner=P(),j.addEventListener("photon-input-changed",async I=>{s.updateFormValue({key:"address_city",value:I.detail.input})}),j._$owner=P(),oe.addEventListener("photon-state-selected",I=>{s.updateFormValue({key:"address_state",value:I.detail.state})}),oe._$owner=P(),ae.addEventListener("photon-input-changed",async I=>{s.updateFormValue({key:"address_zip",value:I.detail.input})}),ae._$owner=P(),xe.addEventListener("photon-pharmacy-selected",I=>{s.updateFormValue({key:"preferredPharmacy",value:I.detail.pharmacy.id})}),xe.patientId=e,xe._$owner=P(),W(I=>{const xt=a.firstName?.error,St=a.firstName?.error,Mt=a.lastName?.error,It=a.lastName?.error,H=a.dateOfBirth?.error,Q=a.dateOfBirth?.error,X=a.phone?.error,ne=a.phone?.error,ue=a.gender?.error,de=a.gender?.error!==void 0,Ue=n.selectedPatient.data?.gender,Me=a.sex?.error,st=a.sex?.error!==void 0,dr=n.selectedPatient.data?.sex,gn=a.email?.error,Vr=a.email?.error,Ze=a.address_street1?.error,qi=a.address_street1?.error,cp=a.address_street2?.error,up=a.address_street2?.error,dp=a.address_city?.error,fp=a.address_city?.error,hp=a.address_state?.error,pp=a.address_state?.error!==void 0,mp=a.state?.value??n.selectedPatient.data?.address?.state,vp=a.address_zip?.error,yp=a.address_zip?.error,gp=zA(n,a),bp=n.selectedPatient.data?.preferredPharmacies?.[0]?.id;return xt!==I._v$&&(v.invalid=I._v$=xt),St!==I._v$2&&(v.helpText=I._v$2=St),Mt!==I._v$3&&(y.invalid=I._v$3=Mt),It!==I._v$4&&(y.helpText=I._v$4=It),H!==I._v$5&&(g.invalid=I._v$5=H),Q!==I._v$6&&(g.helpText=I._v$6=Q),X!==I._v$7&&(w.invalid=I._v$7=X),ne!==I._v$8&&(w.helpText=I._v$8=ne),ue!==I._v$9&&(S.helpText=I._v$9=ue),de!==I._v$10&&(S.invalid=I._v$10=de),Ue!==I._v$11&&(S.selected=I._v$11=Ue),Me!==I._v$12&&(M.helpText=I._v$12=Me),st!==I._v$13&&(M.invalid=I._v$13=st),dr!==I._v$14&&(M.selected=I._v$14=dr),gn!==I._v$15&&(F.invalid=I._v$15=gn),Vr!==I._v$16&&(F.helpText=I._v$16=Vr),Ze!==I._v$17&&(R.invalid=I._v$17=Ze),qi!==I._v$18&&(R.helpText=I._v$18=qi),cp!==I._v$19&&(U.invalid=I._v$19=cp),up!==I._v$20&&(U.helpText=I._v$20=up),dp!==I._v$21&&(j.invalid=I._v$21=dp),fp!==I._v$22&&(j.helpText=I._v$22=fp),hp!==I._v$23&&(oe.helpText=I._v$23=hp),pp!==I._v$24&&(oe.invalid=I._v$24=pp),mp!==I._v$25&&(oe.selected=I._v$25=mp),vp!==I._v$26&&(ae.invalid=I._v$26=vp),yp!==I._v$27&&(ae.helpText=I._v$27=yp),gp!==I._v$28&&(xe.address=I._v$28=gp),bp!==I._v$29&&(xe.selected=I._v$29=bp),I},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0,_v$12:void 0,_v$13:void 0,_v$14:void 0,_v$15:void 0,_v$16:void 0,_v$17:void 0,_v$18:void 0,_v$19:void 0,_v$20:void 0,_v$21:void 0,_v$22:void 0,_v$23:void 0,_v$24:void 0,_v$25:void 0,_v$26:void 0,_v$27:void 0,_v$28:void 0,_v$29:void 0}),W(()=>v.value=a.firstName?.value??n.selectedPatient.data?.name.first),W(()=>y.value=a.lastName?.value??n.selectedPatient.data?.name.last),W(()=>g.value=a.dateOfBirth?.value??n.selectedPatient.data?.dateOfBirth),W(()=>w.value=a.phone?.value??n.selectedPatient.data?.phone),W(()=>F.value=a.email?.value??n.selectedPatient.data?.email),W(()=>R.value=a.address_street1?.value??n.selectedPatient.data?.address?.street1),W(()=>U.value=a.address_street2?.value??n.selectedPatient.data?.address?.street2),W(()=>j.value=a.address_city?.value??n.selectedPatient.data?.address?.city),W(()=>ae.value=a.address_zip?.value??n.selectedPatient.data?.address?.postalCode),p}})}}),null),l})()});const UA=`.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}
3581
3582
  `,VA=O("<div><style></style><style></style></div>"),$u=[{id:"1",name:"AL"},{id:"2",name:"AK"},{id:"3",name:"AZ"},{id:"4",name:"AR"},{id:"5",name:"CA"},{id:"6",name:"CO"},{id:"7",name:"CT"},{id:"8",name:"DE"},{id:"9",name:"DC"},{id:"10",name:"FL"},{id:"11",name:"GA"},{id:"12",name:"HI"},{id:"13",name:"ID"},{id:"14",name:"IL"},{id:"15",name:"IN"},{id:"16",name:"IA"},{id:"17",name:"KS"},{id:"18",name:"KY"},{id:"19",name:"LA"},{id:"20",name:"ME"},{id:"21",name:"MD"},{id:"22",name:"MA"},{id:"23",name:"MI"},{id:"24",name:"MN"},{id:"25",name:"MS"},{id:"26",name:"MO"},{id:"27",name:"MT"},{id:"28",name:"NB"},{id:"29",name:"NV"},{id:"30",name:"NH"},{id:"31",name:"NJ"},{id:"32",name:"NM"},{id:"33",name:"NY"},{id:"34",name:"NC"},{id:"35",name:"ND"},{id:"36",name:"OH"},{id:"37",name:"OK"},{id:"38",name:"OR"},{id:"39",name:"PA"},{id:"40",name:"PR"},{id:"41",name:"RI"},{id:"42",name:"SC"},{id:"43",name:"SD"},{id:"44",name:"TN"},{id:"45",name:"TX"},{id:"46",name:"UT"},{id:"47",name:"VT"},{id:"48",name:"VA"},{id:"49",name:"WA"},{id:"50",name:"WV"},{id:"51",name:"WI"},{id:"52",name:"WY"}];we("photon-state-input",{label:void 0,required:!1,value:void 0,invalid:!1,helpText:void 0,disabled:!1,selected:void 0},e=>{const[t,r]=L("");let n;const i=a=>{const s=new CustomEvent("photon-state-selected",{composed:!0,bubbles:!0,detail:{state:a}});n?.dispatchEvent(s)},o=a=>a.length===0?$u:$u.filter(s=>s.name.toLowerCase().includes(a.toLowerCase()));return(()=>{const a=VA.cloneNode(!0),s=a.firstChild,c=s.nextSibling,l=n;return typeof l=="function"?ee(l,a):n=a,a.addEventListener("photon-data-selected",u=>{i(u.detail.data.name)}),_(s,ze),_(c,UA),_(a,z(Nt,{get data(){return o(t())},get label(){return e.label},get required(){return e.required},placeholder:"",get disabled(){return e.disabled},get invalid(){return e.invalid},isLoading:!1,hasMore:!1,displayAccessor:u=>u.name,showOverflow:!0,onSearchChange:async u=>{r(u)},onHide:async()=>{r("")},noDataMsg:"",optional:!1,get helpText(){return e.helpText},get selectedData(){return $u.filter(u=>u.name===e.selected)?.[0]}}),null),a})()});const BA=O("<sl-icon></sl-icon>"),WA=O('<div class="flex-1 flex justify-end"></div>'),qA=O('<div class="absolute top-0 left-0 w-full z-10"><style></style><photon-dialog confirm-text="Yes, Close" cancel-text="Keep Editing"><p class="font-sans text-lg xs:text-base"></p></photon-dialog><div class="flex items-center px-4 py-2 md:px-8 md:py-3 bg-white fixed w-full z-10 shadow-card"><div class="md:w-1/3 flex justify-start"><photon-button class="close-button" variant="naked"><div class="text-black text-3xl"><sl-icon name="x"></sl-icon></div></photon-button></div><div class="w-full md:w-2/3 flex flex-col md:flex-row"><div class="mb-2 md:mb-0 flex-1 flex justify-end md:justify-center items-center"><p class="ml-1 font-sans text-xl font-medium"></p></div></div></div><div class="w-full h-full bg-[#f7f4f4] pt-28 xs:pt-28 lg:pt-20"><div class="pt-4 pb-52 px-4 w-full h-full sm:w-[600px] xs:mx-auto"></div></div></div>'),u$=({closeTitle:e="Lose unsaved changes?",closeBody:t="You will not be able to recover unsaved changes.",headerRight:r,title:n,titleIconName:i,form:o,onClosed:a,checkShouldWarn:s=()=>!1})=>{let c;const[l,u]=L(!1);return(()=>{const d=V(()=>document.importNode(qA,!0)),f=d.firstChild,h=f.nextSibling,p=h.firstChild,m=h.nextSibling,v=m.firstChild,y=v.firstChild,b=y.firstChild,g=b.firstChild,w=v.nextSibling,x=w.firstChild,E=x.firstChild,S=m.nextSibling,T=S.firstChild,M=c;return typeof M=="function"?ee(M,d):c=d,_(f,ze),h.label=e,h.addEventListener("photon-dialog-confirmed",()=>{u(!1),a()}),h.addEventListener("photon-dialog-canceled",()=>{u(!1)}),h._$owner=P(),_(p,t),y.addEventListener("click",()=>{s()?u(!0):a()}),y._$owner=P(),g.style.setProperty("display","block"),g._$owner=P(),_(x,z(re,{when:i,get children(){const F=V(()=>document.importNode(BA,!0));return F.name=i,F._$owner=P(),F}}),E),_(E,n),_(w,z(re,{when:r,get children(){const F=WA.cloneNode(!0);return _(F,r),F}}),null),_(T,o),W(()=>h.open=l()),d})()},HA=O("<div></div>"),GA=O('<div class="flex space-x-2"><photon-button size="sm" variant="outline">Save and Create Prescription</photon-button><photon-button size="sm">Save</photon-button></div>'),QA=O('<photon-patient-form slot="form"></photon-patient-form>');we("photon-patient-dialog",{patientId:"",open:!1},e=>{let t;const r=rt(),[n,i]=L(!1),[o,a]=L(void 0),[s,c]=L(void 0),[l,u]=L(void 0),d=(m,v=!1)=>{const y=new CustomEvent("photon-patient-updated",{composed:!0,bubbles:!0,detail:{patientId:m,createPrescription:v}});t?.dispatchEvent(y)},f=(m,v=!1)=>{const y=new CustomEvent("photon-patient-created",{composed:!0,bubbles:!0,detail:{patientId:m,createPrescription:v}});t?.dispatchEvent(y)},h=()=>{const m=new CustomEvent("photon-patient-closed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(m)},p=async(m,v,y,b=!1)=>{i(!0);let g=["firstName","lastName","phone","sex","email"];if(m.address_street1?.value!==void 0||m.address_city?.value!==void 0||m.address_state?.value!==void 0||m.address_zip?.value!==void 0)v.registerValidator({key:"address_street1",validator:ot(Nr(jt(),1,1/0),"Please enter a valid Street 1..")}),v.registerValidator({key:"address_city",validator:ot(Nr(jt(),1,1/0),"Please enter a valid City..")}),v.registerValidator({key:"address_state",validator:ot(Nr(jt(),2,2),"Please enter a valid State..")}),g=[...g,"address_zip","address_street1","address_city","address_state"];else{const x=["address_street1","address_city","address_state"];for(const E of x)v.unRegisterValidator(E)}if(v.validate(g),v.hasErrors(g))return i(!1),!0;m.preferredPharmacy.value&&y.selectedPatient.data?.preferredPharmacies&&y.selectedPatient.data?.preferredPharmacies.length!==0&&!y.selectedPatient.data?.preferredPharmacies?.map(x=>x?.id).filter(x=>x!==null).includes(m.preferredPharmacy.value)&&await r.getSDK().clinical.patient.removePatientPreferredPharmacy({})({variables:{patientId:e.patientId,pharmacyId:y.selectedPatient.data?.preferredPharmacies[0].id},awaitRefetchQueries:!1});const w={...e?.patientId?{id:e.patientId}:{},name:{first:m.firstName.value,last:m.lastName.value},gender:m.gender.value,email:m.email.value,phone:m.phone.value,dateOfBirth:m.dateOfBirth.value,sex:m.sex.value,address:m.address_street1.value!==void 0?{street1:m.address_street1.value,street2:m.address_street2.value,city:m.address_city.value,state:m.address_state.value,postalCode:m.address_zip.value,country:"US"}:void 0,preferredPharmacies:m.preferredPharmacy.value?[m.preferredPharmacy.value]:[]};if(e?.patientId)await r.getSDK().clinical.patient.updatePatient({})({variables:w,awaitRefetchQueries:!1}),d(e.patientId,b);else{const E=await r.getSDK().clinical.patient.createPatient({})({variables:w,awaitRefetchQueries:!1});f(E?.data?.createPatient?.id||"",b)}i(!1),v.resetStores(),e.open=!1};return(()=>{const m=HA.cloneNode(!0),v=t;return typeof v=="function"?ee(v,m):t=m,_(m,z(re,{get when(){return e.open},get children(){return z(u$,{onClosed:()=>{h(),l().resetStores(),e.open=!1},get title(){return e?.patientId?"Update Patient":"Create Patient"},get titleIconName(){return e?.patientId?"pencil-square":"person-plus"},get headerRight(){return(()=>{const y=V(()=>document.importNode(GA,!0)),b=y.firstChild,g=b.nextSibling;return b.$$click=()=>p(o(),l(),s(),!0),b._$owner=P(),g.$$click=()=>p(o(),l(),s(),!1),g._$owner=P(),W(w=>{const x=n(),E=n(),S=n(),T=n();return x!==w._v$&&(b.disabled=w._v$=x),E!==w._v$2&&(b.loading=w._v$2=E),S!==w._v$3&&(g.disabled=w._v$3=S),T!==w._v$4&&(g.loading=w._v$4=T),w},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),y})()},get form(){return(()=>{const y=V(()=>document.importNode(QA,!0));return y.addEventListener("photon-form-updated",b=>{a(b.detail.form),u(Object.assign({},b.detail.actions,{resetStores:b.detail.reset})),c(b.detail.selected)}),y._$owner=P(),W(()=>y.patientId=e.patientId),y})()}})}})),m})()});Ni(["click"]);const KA=O("<photon-patient-dialog></photon-patient-dialog>");we("photon-update-patient-dialog",{patientId:"",open:!1},e=>(console.warn("photon-update-patient-dialog will be deprecated soon. Please use photon-patient-dialog instead."),(()=>{const t=V(()=>document.importNode(KA,!0));return t._$owner=P(),W(r=>{const n=e.patientId,i=e.open;return n!==r._v$&&(t.patientId=r._v$=n),i!==r._v$2&&(t.open=r._v$2=i),r},{_v$:void 0,_v$2:void 0}),t})()));const YA=O('<div class="w-full"></div>'),XA=()=>{let e;const t=rt(),[r,n]=L(!1),[i,o]=L(""),[a,s]=L(),[c,l]=L([]),u=d=>{const f=new CustomEvent("photon-name-selected",{composed:!0,bubbles:!0,detail:{medicationId:d}});e?.dispatchEvent(f)};return ge(async()=>{i().length>0&&(n(!0),V(async()=>{const d=String(Math.random());s(d);const{data:f}=await t.getSDK().clinical.searchMedication.getConcepts({name:i()});d===a()&&l(f.medicationConcepts??[]),n(!1)}))},[i]),(()=>{const d=YA.cloneNode(!0),f=e;return typeof f=="function"?ee(f,d):e=d,d.addEventListener("photon-data-selected",h=>{u(h.detail.data.id)}),_(d,z(Nt,{get data(){return c()},label:"Medication Name",placeholder:"Enter a medication name...",get isLoading(){return r()},hasMore:!1,displayAccessor:h=>h.name,onSearchChange:async h=>o(h),onHide:async()=>{o("")},noDataMsg:"No medications found",required:!1})),d})()},ZA=O('<div class="w-full"></div>'),JA=e=>{const t=rt(),[r,n]=L(),[i,o]=L(!1),[a]=L(""),[s,c]=L([]),l=h=>{const p=new CustomEvent("photon-strength-selected",{composed:!0,bubbles:!0,detail:{strengthId:h}});f?.dispatchEvent(p)},u=()=>{const h=new CustomEvent("photon-strength-deselected",{composed:!0,bubbles:!0,detail:{}});f?.dispatchEvent(h)};ge(async()=>{d.clear(),e.medicationId.length>0&&(o(!0),V(async()=>{const h=String(Math.random());n(h);const{data:p}=await t.getSDK().clinical.searchMedication.getStrengths({id:e.medicationId});h===r()&&c(p.medicationStrengths??[]),o(!1)}))},[e.medicationId]);const d={};let f;return(()=>{const h=ZA.cloneNode(!0),p=f;return typeof p=="function"?ee(p,h):f=h,h.addEventListener("photon-data-selected",m=>{l(m.detail.data.id)}),h.addEventListener("photon-data-unselected",()=>{u()}),_(h,z(Nt,{actionRef:d,get data(){return s()},label:"Strength",get disabled(){return e.disabled},placeholder:"Select a strength...",get isLoading(){return i()},hasMore:!1,displayAccessor:m=>m.name,onSearchChange:async m=>a(m),onHide:async()=>{a("")},noDataMsg:"No strengths found",required:!1})),h})()},eD=O('<div class="w-full"></div>'),tD=e=>{const t=rt(),[r,n]=L(),[i,o]=L(!1),[a]=L(""),[s,c]=L([]),l=h=>{const p=new CustomEvent("photon-route-selected",{composed:!0,bubbles:!0,detail:{routeId:h}});f?.dispatchEvent(p)},u=()=>{const h=new CustomEvent("photon-route-deselected",{composed:!0,bubbles:!0,detail:{}});f?.dispatchEvent(h)};ge(async()=>{d.clear(),e.medicationId.length>0&&(o(!0),V(async()=>{const h=String(Math.random());n(h);const{data:p}=await t.getSDK().clinical.searchMedication.getRoutes({id:e.medicationId});h===r()&&c(p.medicationRoutes??[]),o(!1)}))},[e.medicationId]);const d={};let f;return(()=>{const h=eD.cloneNode(!0),p=f;return typeof p=="function"?ee(p,h):f=h,h.addEventListener("photon-data-selected",m=>{l(m.detail.data.id)}),h.addEventListener("photon-data-unselected",()=>{u()}),_(h,z(Nt,{actionRef:d,get data(){return s()},label:"Route",get disabled(){return e.disabled},placeholder:"Select a route...",get isLoading(){return i()},hasMore:!1,displayAccessor:m=>m.name,onSearchChange:async m=>a(m),onHide:async()=>{a("")},noDataMsg:"No routes found",required:!1})),h})()},rD=O('<div class="w-full"></div>'),nD=e=>{const t=rt(),[r,n]=L(!1),[i,o]=L(),[a]=L(""),[s,c]=L([]),l=h=>{const p=new CustomEvent("photon-form-selected",{composed:!0,bubbles:!0,detail:{formId:h}});f?.dispatchEvent(p)},u=()=>{const h=new CustomEvent("photon-form-deselected",{composed:!0,bubbles:!0,detail:{}});f?.dispatchEvent(h)};ge(async()=>{d.clear(),e.medicationId.length>0&&(n(!0),V(async()=>{const h=String(Math.random());o(h);const{data:p}=await t.getSDK().clinical.searchMedication.getForms({id:e.medicationId});h===i()&&c(p.medicationForms??[]),n(!1)}))},[e.medicationId]);const d={};let f;return(()=>{const h=rD.cloneNode(!0),p=f;return typeof p=="function"?ee(p,h):f=h,h.addEventListener("photon-data-selected",m=>{l(m.detail.data.id)}),h.addEventListener("photon-data-unselected",()=>{u()}),_(h,z(Nt,{actionRef:d,get data(){return s()},label:"Form",get disabled(){return e.disabled},placeholder:"Select a form...",get isLoading(){return r()},hasMore:!1,displayAccessor:m=>m.form,onSearchChange:async m=>a(m),onHide:async()=>{a("")},noDataMsg:"No forms found",required:!1})),h})()},iD=O('<photon-checkbox label="Add Medication to Catalog"></photon-checkbox>'),oD=O('<div><p class="font-sans text-lg text-gray-700 text-center pb-2">Advanced Medication Search</p><div class="flex flex-col xs:flex-row gap-4"></div><div class="flex flex-col xs:flex-row gap-4"></div><hr class="my-8"><p class="font-sans text-gray-700 pb-4">Select a medication:</p><div><photon-radio-group></photon-radio-group></div></div>'),aD=O("<photon-radio-card></photon-radio-card>");tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-med-search",{},()=>{let e;const t=rt(),[r,n]=L(""),[i,o]=L(""),[a,s]=L(""),[c,l]=L(""),[u,d]=L([]),[f,h]=L(!1),[p,m]=L(void 0),[v,y]=L(""),b=(g,w)=>{const x=new CustomEvent("photon-form-updated",{composed:!0,bubbles:!0,detail:{medication:g,addToCatalog:w,catalogId:v()}});e?.dispatchEvent(x)};return Tt(async()=>{const{data:g}=await t.getSDK().clinical.catalog.getCatalogs();g.catalogs.length>0&&y(g.catalogs[0].id)}),ge(()=>{const g=c()||a()||i()||r();g.length>0&&V(async()=>{const{data:w}=await t.getSDK().clinical.searchMedication.getProducts({id:g});h(!1),m(void 0),d(w.medicationProducts)})},[r,i,a,c]),ge(()=>{p()&&b(p(),f())},[p,f]),(()=>{const g=V(()=>document.importNode(oD,!0)),w=g.firstChild,x=w.nextSibling,E=x.nextSibling,S=E.nextSibling,T=S.nextSibling,M=T.nextSibling,F=M.firstChild,K=e;return typeof K=="function"?ee(K,g):e=g,g.addEventListener("photon-name-selected",D=>{n(D.detail.medicationId)}),g.addEventListener("photon-strength-selected",D=>{o(D.detail.strengthId)}),g.addEventListener("photon-strength-deselected",D=>{o("")}),g.addEventListener("photon-route-selected",D=>{s(D.detail.routeId)}),g.addEventListener("photon-route-deselected",D=>{s("")}),g.addEventListener("photon-form-selected",D=>{l(D.detail.formId)}),g.addEventListener("photon-form-deselected",D=>{l("")}),_(x,z(XA,{}),null),_(x,z(JA,{get medicationId(){return r()},get disabled(){return r().length==0}}),null),_(E,z(tD,{get medicationId(){return i()},get disabled(){return i().length==0}}),null),_(E,z(nD,{get medicationId(){return a()},get disabled(){return a().length==0}}),null),M.addEventListener("photon-option-selected",D=>{m(D.detail.value)}),F._$owner=P(),_(F,z(Rl,{get each(){return u().filter((D,R,U)=>{const j=U.findIndex(Y=>Y.name===D.name);if(R===j)return!0}).sort((D,R)=>D.name.toLowerCase()>R.name.toLowerCase()?-1:1)},children:D=>(()=>{const R=V(()=>document.importNode(aD,!0));return R.value=D,R._$owner=P(),_(R,()=>D.name),R})()})),_(g,z(re,{get when(){return v().length>0},get children(){const D=V(()=>document.importNode(iD,!0));return D.addEventListener("photon-checkbox-toggled",R=>h(R.detail.checked)),D._$owner=P(),W(()=>D.disabled=!p()),W(()=>D.checked=f()),D}}),null),g})()});var sD=ft`
@@ -3699,4 +3700,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3699
3700
 
3700
3701
  <slot part="label" class="radio__label"></slot>
3701
3702
  </span>
3702
- `}};Sr.styles=sD;$([Er()],Sr.prototype,"checked",2);$([Er()],Sr.prototype,"hasFocus",2);$([k()],Sr.prototype,"value",2);$([k({reflect:!0})],Sr.prototype,"size",2);$([k({type:Boolean,reflect:!0})],Sr.prototype,"disabled",2);$([De("checked")],Sr.prototype,"handleCheckedChange",1);$([De("disabled",{waitUntilFirstUpdate:!0})],Sr.prototype,"handleDisabledChange",1);Sr=$([_t("sl-radio")],Sr);const lD=O('<div><style></style><photon-card><div class="flex items-center gap-2"><p class="font-sans flex-grow text-gray-600 text-sm"><slot></slot></p><input type="radio"></div></photon-card></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-radio-card",{selected:!1,value:""},e=>{let t;const r=()=>{const n=new CustomEvent("photon-radio-selected",{composed:!0,bubbles:!0,detail:{value:e.value}});t?.dispatchEvent(n)};return(()=>{const n=V(()=>document.importNode(lD,!0)),i=n.firstChild,o=i.nextSibling,a=o.firstChild,s=a.firstChild,c=s.firstChild,l=s.nextSibling,u=t;return typeof u=="function"?ee(u,n):t=n,_(i,ze),o.addEventListener("click",()=>r()),o._$owner=P(),c._$owner=P(),W(()=>l.checked=e.selected),n})()});function cD(e){const[t,r]=yn(Array());return ge(()=>{if(!e)return;const n=()=>{r(e()?.assignedElements()||[])};return e()?.addEventListener("slotchange",n)},[e]),t}const uD=O('<div><style></style><div class="flex flex-col gap-3"><slot></slot></div></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-radio-group",{},()=>{let e;const[t,r]=L(),n=cD(t),i=o=>{const a=new CustomEvent("photon-option-selected",{composed:!0,bubbles:!0,detail:{value:o}});e?.dispatchEvent(a)};return(()=>{const o=uD.cloneNode(!0),a=o.firstChild,s=a.nextSibling,c=s.firstChild,l=e;return typeof l=="function"?ee(l,o):e=o,o.addEventListener("photon-radio-selected",u=>{u.stopImmediatePropagation(),u.stopPropagation();for(const d of n)d.value.id===u.detail.value.id||d.value===u.detail.value?d.selected=!0:d.selected=!1;i(u.detail.value)}),_(a,ze),ee(u=>r(u),c),c._$owner=P(),o})()});const dD=O('<div><photon-dialog cancel-text="Back" confirm-text="Select Medication" width="min-content"><photon-med-search></photon-med-search></photon-dialog></div>');we("photon-med-search-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0}},e=>{const t=rt();let r;const[n,i]=L(void 0),[o,a]=L(!1),[s,c]=L(""),[l,u]=L(!1),d=()=>{const f=new CustomEvent("photon-medication-selected",{composed:!0,bubbles:!0,detail:{medication:n()}});r?.dispatchEvent(f)};return(()=>{const f=V(()=>document.importNode(dD,!0)),h=f.firstChild,p=h.firstChild,m=r;return typeof m=="function"?ee(m,f):r=f,f.addEventListener("photon-form-updated",v=>{i(v.detail.medication),a(v.detail.addToCatalog),c(v.detail.catalogId)}),h.addEventListener("photon-dialog-confirmed",async()=>{u(!0),o()&&await t.getSDK().clinical.catalog.addToCatalog({})({variables:{catalogId:s(),treatmentId:n()?.id},awaitRefetchQueries:!1}),d(),u(!1),e.open=!1}),h.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),h._$owner=P(),p._$owner=P(),W(v=>{const y=e.open,b=l(),g=!n();return y!==v._v$&&(h.open=v._v$=y),b!==v._v$2&&(h.loading=v._v$2=b),g!==v._v$3&&(h.disableSubmit=v._v$3=g),v},{_v$:void 0,_v$2:void 0,_v$3:void 0}),f})()});const fD=O('<div class="min-w-[125px]"></div>'),Pg=[{id:"mcg/kg",name:"mcg/kg"},{id:"mg/kg",name:"mg/kg"},{id:"g/kg",name:"g/kg"}],hD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=fD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Pg.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Pg[1]}})),i})()},pD=O('<div class="min-w-[125px]"></div>'),Tg=[{id:"mg",name:"mg"},{id:"mcg",name:"mcg"},{id:"g",name:"g"}],mD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=pD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Tg.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Tg[0]}})),i})()},vD=O('<div class="min-w-[125px]"></div>'),Ng=[{id:"mL",name:"mL"},{id:"L",name:"L"}],yD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=vD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Ng.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Ng[0]}})),i})()},gD=O('<div class="min-w-[125px]"></div>'),Ig=[{id:"lbs",name:"lbs"},{id:"kgs",name:"kgs"}],bD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=gD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Ig.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Ig[0]}})),i})()},$D=O('<div><style></style><div class="flex flex-col xs:flex-row items-start xs:items-center gap-2 pb-2"><p class="font-sans text-lg">Selected Drug: </p></div><div class="flex flex-col"><p class="font-sans pb-1">Input</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Dosage</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Weight</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans pb-1">Liquid Formation</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Drug Amount</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3 flex-shrink"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Per Volume</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans">Result</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Liquid Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div></div></div>'),wD=O("<p></p>"),_D=O('<p class="text-gray-500 font-sans italic">None selected</p>'),wu=(e,t)=>!!((t==="kgs"||t==="g")&&e.includes("kg")||(t==="lbs"||t==="oz")&&e.includes("lb")),xD=(e,t)=>e.includes("kg")&&t.unit==="oz"?t.value/16*.453592:e.includes("kg")&&t.unit==="lbs"?t.value*.453592:e.includes("lb")&&t.unit==="kgs"?t.value*2.20462:e.includes("lb")&&t.unit==="g"?t.value/1e3*2.20462:0,SD=(e,t)=>t==="mcg"&&e.split("/")[0]==="mcg"||t==="mg"&&e.split("/")[0]==="mg"||t==="g"&&e.split("/")[0]==="g",kD=(e,t)=>e.includes("mcg")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("mcg")&&t.unit==="g"?t.value*(1e3*1e3):e.includes("mg")&&t.unit==="mcg"?t.value/1e3:e.includes("mg")&&t.unit==="g"?t.value*1e3:e.includes("g")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("g")&&t.unit==="mg"?t.value/1e3:0,ED=(e,t)=>wu(e.unit,t.unit)&&t.unit==="g"?e.value*(t.value/1e3):wu(e.unit,t.unit)&&t.unit==="oz"?e.value*(t.value/16):wu(e.unit,t.unit)?e.value*t.value:e.value*xD(e.unit,t),OD=(e,t,r,n,i)=>r===0||r.toString().length===0||parseInt(r.toString(),10)===0||window.isNaN(r)?0:SD(t,n)?e*i/r:e*i/kD(t,{value:r,unit:n});we("photon-dosage-calculator",{medication:void 0},e=>{let t;const[r,n]=L(0),[i,o]=L(0),[a,s]=L(0),[c,l]=L(0),[u,d]=L("mg/kg"),[f,h]=L("lbs"),[p,m]=L("mg"),[v,y]=L("mL"),[b,g]=L(""),[w,x]=L(""),E=S=>{const T=new CustomEvent("photon-dosage-selected",{composed:!0,bubbles:!0,detail:{value:Number(S?w().split(" ")[0]:b().split(" ")[0]),unit:S?w().split(" ")[1]:b().split(" ")[1]}});t?.dispatchEvent(T)};return ge(()=>{let S=ED({value:r(),unit:u()},{value:a(),unit:f()});S.toString().split(".").length>1&&S.toString().split(".")[1].length>4&&(S=parseFloat(S.toFixed(4))),g(`${S} ${u().split("/")[0]}`);let T=OD(S,u().split("/")[0],i(),p(),c());i.toString().split(".").length>1&&i.toString().split(".")[1].length>4&&(T=parseFloat(T.toFixed(4))),x(`${T} ${v()}`)},[r,u,f,a,i,c,p,v]),(()=>{const S=V(()=>document.importNode($D,!0)),T=S.firstChild,M=T.nextSibling;M.firstChild;const F=M.nextSibling,K=F.firstChild,D=K.nextSibling,R=D.firstChild,U=R.nextSibling,j=D.nextSibling,Y=j.firstChild,oe=Y.nextSibling,ae=j.nextSibling,A=ae.nextSibling,me=A.firstChild,xe=me.nextSibling,I=A.nextSibling,xt=I.firstChild,St=xt.nextSibling,Mt=I.nextSibling,It=Mt.nextSibling,H=It.firstChild,Q=H.nextSibling,X=Q.nextSibling,ne=X.firstChild,ue=ne.nextSibling,de=It.nextSibling,Ue=de.firstChild,Me=Ue.nextSibling,st=Me.nextSibling,dr=st.firstChild,gn=dr.nextSibling,Vr=t;return typeof Vr=="function"?ee(Vr,S):t=S,_(T,ze),_(M,(()=>{const Ze=pe(()=>!!e.medication);return()=>Ze()?(()=>{const qi=wD.cloneNode(!0);return _(qi,()=>e.medication.name),qi})():_D.cloneNode(!0)})(),null),D.addEventListener("photon-input-changed",Ze=>{n(Ze.detail.input)}),D.addEventListener("photon-unit-selected",Ze=>{d(Ze.detail.unit)}),U._$owner=P(),_(D,z(hD,{}),null),j.addEventListener("photon-input-changed",Ze=>{s(Ze.detail.input)}),j.addEventListener("photon-unit-selected",Ze=>{h(Ze.detail.unit)}),oe._$owner=P(),_(j,z(bD,{}),null),A.addEventListener("photon-input-changed",Ze=>{o(Ze.detail.input)}),A.addEventListener("photon-unit-selected",Ze=>{m(Ze.detail.unit)}),xe._$owner=P(),_(A,z(mD,{}),null),I.addEventListener("photon-input-changed",Ze=>{l(Ze.detail.input)}),I.addEventListener("photon-unit-selected",Ze=>{y(Ze.detail.unit)}),St._$owner=P(),_(I,z(yD,{}),null),Q.disabled=!0,Q._$owner=P(),X.addEventListener("photon-clicked",()=>E(!1)),X._$owner=P(),ue._$owner=P(),Me.disabled=!0,Me._$owner=P(),st.addEventListener("photon-clicked",()=>E(!0)),st._$owner=P(),gn._$owner=P(),W(()=>Q.value=b()??"0"),W(()=>Me.value=w()??"0"),S})()});const CD=O('<div><photon-dialog label="Dosage Calculator"><photon-dosage-calculator></photon-dosage-calculator></photon-dialog></div>');we("photon-dosage-calculator-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0},medication:{value:void 0,reflect:!0,notify:!1,attribute:"medication",parse:!0}},e=>{rt();let t;const r=(n,i)=>{const o=new CustomEvent("photon-dose-selected",{composed:!0,bubbles:!0,detail:{value:n,unit:i}});t?.dispatchEvent(o)};return(()=>{const n=V(()=>document.importNode(CD,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,n.addEventListener("photon-dosage-selected",s=>{s.stopImmediatePropagation(),s.stopPropagation(),r(s.detail.value,s.detail.unit),e.open=!1}),i.header=!0,i.hideFooter=!0,i.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),i._$owner=P(),o._$owner=P(),W(s=>{const c=e.open,l=e.medication;return c!==s._v$&&(i.open=s._v$=c),l!==s._v$2&&(o.medication=s._v$2=l),s},{_v$:void 0,_v$2:void 0}),n})()});function eh(e){this.message=e}eh.prototype=new Error,eh.prototype.name="InvalidCharacterError";var Ag=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new eh("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,o=0,a="";n=t.charAt(o++);~n&&(r=i%4?64*r+n:n,i++%4)?a+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};function PD(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(r){return decodeURIComponent(Ag(r).replace(/(.)/g,function(n,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(t)}catch{return Ag(t)}}function Nl(e){this.message=e}function TD(e,t){if(typeof e!="string")throw new Nl("Invalid token specified");var r=(t=t||{}).header===!0?0:1;try{return JSON.parse(PD(e.split(".")[r]))}catch(n){throw new Nl("Invalid token specified: "+n.message)}}Nl.prototype=new Error,Nl.prototype.name="InvalidTokenError";const ND=O(`<div><photon-dialog label="Lose Unsaved Prescription?" confirm-text="Yes, Continue" cancel-text="Keep Editing" width="500px"><p class="font-sans text-lg xs:text-base">You have a prescription "<!>" that hasn't been added. Please add it or continue.</p></photon-dialog></div>`),ID=O('<div class="flex flex-row sm:flex-col md:flex-col lg:flex-row gap-2 justify-end items-end"><photon-button size="sm" variant="outline" loading-text="Save prescriptions">Save prescriptions</photon-button><photon-button size="sm" loading-text="Save and create order">Save and create order</photon-button></div>'),AD=O('<div class="w-full h-full bg-[#f7f4f4]"><div class="p-4 w-full h-full sm:w-[600px] xs:mx-auto"><photon-prescribe-workflow hide-submit="true"></photon-prescribe-workflow></div></div>'),DD=O('<div class="pt-2"><sl-alert variant="danger" open><div class="flex items-start xs:items-center gap-4"><sl-icon slot="icon" name="exclamation-octagon" class="text-red-500" style="font-size: 24px;"></sl-icon><p class="font-sans"></p></div></sl-alert></div>'),RD=e=>e().notes?.value.length>0||e().instructions?.value.length>0||e().treatment?.value||e().patient?.value||e().dispenseAsWritten?.value!=!1||e().dispenseQuantity?.value!=1||e().dispenseUnit?.value!="Each"||e().daysSupply?.value!=30||e().refillsInput?.value!=0||e().addToTemplates?.value!=!1||e().effectiveDate?.value!=oc(new Date,"yyyy-MM-dd").toString()||e().draftPrescriptions?.value.length>0;we("photon-multirx-form-wrapper",{hideTemplates:!1,patientId:void 0,templateIds:void 0},e=>{let t;const r=rt(),[n,i]=L(!1),[o,a]=L([]),[s,c]=L(!1),[l,u]=L(!1),[d,f]=L(),[h,p]=L(),[m,v]=L(!1),{actions:y}=nc;Tt(async()=>{const E=await r.getSDK().authentication.getAccessToken();TD(E).permissions?.includes("write:prescription")&&c(!0)});const b=(E,S,T)=>{const M=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{patientId:T,prescriptionIds:S,createOrder:E}});t?.dispatchEvent(M)},g=()=>{const E=new CustomEvent("photon-prescriptions-closed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(E)},w=async(E,S,T)=>{a([]);const M=["patient","draftPrescriptions"];if(S.validate(M),!S.hasErrors(M)){u(!0),S.updateFormValue({key:"errors",value:[]});const K=r.getSDK().clinical.prescription.createPrescriptions({}),D=r.getSDK().clinical.prescriptionTemplate.createPrescriptionTemplate({}),R=[];for(const U of E.draftPrescriptions.value){if(U.addToTemplates)try{const{errors:Y}=await D({variables:{catalogId:U.catalogId,treatmentId:U.treatment.id,dispenseAsWritten:U.dispenseAsWritten,dispenseQuantity:U.dispenseQuantity,dispenseUnit:U.dispenseUnit,fillsAllowed:U.refillsInput+1,daysSupply:U.daysSupply,instructions:U.instructions,notes:U.notes},awaitRefetchQueries:!1});Y&&a(Y)}catch(Y){a([Y])}const j={daysSupply:U.daysSupply,dispenseAsWritten:U.dispenseAsWritten,dispenseQuantity:U.dispenseQuantity,dispenseUnit:U.dispenseUnit,effectiveDate:U.effectiveDate,instructions:U.instructions,notes:U.notes,patientId:E.patient?.value.id,fillsAllowed:U.refillsInput+1,treatmentId:U.treatment.id};R.push(j)}if(o().length>0)return;try{const{data:U,errors:j}=await K({variables:{prescriptions:R},refetchQueries:[],awaitRefetchQueries:!1});if(j){a(j);return}b(T,U.createPrescriptions.map(Y=>Y.id),E.patient?.value.id)}catch(U){a([U])}u(!1)}},x=()=>w(d(),h(),!0);return(()=>{const E=V(()=>document.importNode(ND,!0)),S=E.firstChild,T=S.firstChild,M=T.firstChild,F=M.nextSibling;F.nextSibling;const K=t;return typeof K=="function"?ee(K,E):t=E,S.addEventListener("photon-dialog-confirmed",()=>{v(!1),x()}),S.addEventListener("photon-dialog-canceled",()=>{v(!1)}),S._$owner=P(),_(T,()=>d()?.treatment?.value?.name,F),_(E,z(u$,{closeTitle:"Lose unsaved prescriptions?",closeBody:"You will not be able to recover unsaved prescriptions.",onClosed:()=>{g(),y.clearSelectedPatient(),e.open=!1},checkShouldWarn:()=>RD(d),title:"New Prescriptions",titleIconName:"prescription",get headerRight(){return(()=>{const D=V(()=>document.importNode(ID,!0)),R=D.firstChild,U=R.nextSibling;return R.addEventListener("photon-clicked",()=>w(d(),h(),!1)),R._$owner=P(),U.addEventListener("photon-clicked",()=>d()?.treatment?.value?.name?v(!0):x()),U._$owner=P(),W(j=>{const Y=!n()||!s(),oe=l(),ae=!n()||!s(),A=l();return Y!==j._v$&&(R.disabled=j._v$=Y),oe!==j._v$2&&(R.loading=j._v$2=oe),ae!==j._v$3&&(U.disabled=j._v$3=ae),A!==j._v$4&&(U.loading=j._v$4=A),j},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),D})()},get form(){return(()=>{const D=V(()=>document.importNode(AD,!0)),R=D.firstChild,U=R.firstChild;return _(D,z(re,{get when(){return o().length>0},get children(){return z(Rl,{get each(){return o()},children:j=>(()=>{const Y=V(()=>document.importNode(DD,!0)),oe=Y.firstChild,ae=oe.firstChild,A=ae.firstChild,me=A.nextSibling;return oe._$owner=P(),A._$owner=P(),_(me,()=>j.message),Y})()})}}),R),U.addEventListener("photon-form-validate",j=>{i(j.detail.canSubmit),p(j.detail.actions),f(j.detail.form)}),U._$owner=P(),W(j=>{const Y=e.hideTemplates,oe=l(),ae=e.patientId,A=e.templateIds;return Y!==j._v$5&&(U.hideTemplates=j._v$5=Y),oe!==j._v$6&&(U.loading=j._v$6=oe),ae!==j._v$7&&(U.patientId=j._v$7=ae),A!==j._v$8&&(U.templateIds=j._v$8=A),j},{_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0}),D})()}}),null),W(()=>S.open=m()),E})()});
3703
+ `}};Sr.styles=sD;$([Er()],Sr.prototype,"checked",2);$([Er()],Sr.prototype,"hasFocus",2);$([k()],Sr.prototype,"value",2);$([k({reflect:!0})],Sr.prototype,"size",2);$([k({type:Boolean,reflect:!0})],Sr.prototype,"disabled",2);$([De("checked")],Sr.prototype,"handleCheckedChange",1);$([De("disabled",{waitUntilFirstUpdate:!0})],Sr.prototype,"handleDisabledChange",1);Sr=$([_t("sl-radio")],Sr);const lD=O('<div><style></style><photon-card><div class="flex items-center gap-2"><p class="font-sans flex-grow text-gray-600 text-sm"><slot></slot></p><input type="radio"></div></photon-card></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-radio-card",{selected:!1,value:""},e=>{let t;const r=()=>{const n=new CustomEvent("photon-radio-selected",{composed:!0,bubbles:!0,detail:{value:e.value}});t?.dispatchEvent(n)};return(()=>{const n=V(()=>document.importNode(lD,!0)),i=n.firstChild,o=i.nextSibling,a=o.firstChild,s=a.firstChild,c=s.firstChild,l=s.nextSibling,u=t;return typeof u=="function"?ee(u,n):t=n,_(i,ze),o.addEventListener("click",()=>r()),o._$owner=P(),c._$owner=P(),W(()=>l.checked=e.selected),n})()});function cD(e){const[t,r]=yn(Array());return ge(()=>{if(!e)return;const n=()=>{r(e()?.assignedElements()||[])};return e()?.addEventListener("slotchange",n)},[e]),t}const uD=O('<div><style></style><div class="flex flex-col gap-3"><slot></slot></div></div>');tt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");we("photon-radio-group",{},()=>{let e;const[t,r]=L(),n=cD(t),i=o=>{const a=new CustomEvent("photon-option-selected",{composed:!0,bubbles:!0,detail:{value:o}});e?.dispatchEvent(a)};return(()=>{const o=uD.cloneNode(!0),a=o.firstChild,s=a.nextSibling,c=s.firstChild,l=e;return typeof l=="function"?ee(l,o):e=o,o.addEventListener("photon-radio-selected",u=>{u.stopImmediatePropagation(),u.stopPropagation();for(const d of n)d.value.id===u.detail.value.id||d.value===u.detail.value?d.selected=!0:d.selected=!1;i(u.detail.value)}),_(a,ze),ee(u=>r(u),c),c._$owner=P(),o})()});const dD=O('<div><photon-dialog cancel-text="Back" confirm-text="Select Medication" width="min-content"><photon-med-search></photon-med-search></photon-dialog></div>');we("photon-med-search-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0}},e=>{const t=rt();let r;const[n,i]=L(void 0),[o,a]=L(!1),[s,c]=L(""),[l,u]=L(!1),d=()=>{const f=new CustomEvent("photon-medication-selected",{composed:!0,bubbles:!0,detail:{medication:n()}});r?.dispatchEvent(f)};return(()=>{const f=V(()=>document.importNode(dD,!0)),h=f.firstChild,p=h.firstChild,m=r;return typeof m=="function"?ee(m,f):r=f,f.addEventListener("photon-form-updated",v=>{i(v.detail.medication),a(v.detail.addToCatalog),c(v.detail.catalogId)}),h.addEventListener("photon-dialog-confirmed",async()=>{u(!0),o()&&await t.getSDK().clinical.catalog.addToCatalog({})({variables:{catalogId:s(),treatmentId:n()?.id},awaitRefetchQueries:!1}),d(),u(!1),e.open=!1}),h.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),h._$owner=P(),p._$owner=P(),W(v=>{const y=e.open,b=l(),g=!n();return y!==v._v$&&(h.open=v._v$=y),b!==v._v$2&&(h.loading=v._v$2=b),g!==v._v$3&&(h.disableSubmit=v._v$3=g),v},{_v$:void 0,_v$2:void 0,_v$3:void 0}),f})()});const fD=O('<div class="min-w-[125px]"></div>'),Pg=[{id:"mcg/kg",name:"mcg/kg"},{id:"mg/kg",name:"mg/kg"},{id:"g/kg",name:"g/kg"}],hD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=fD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Pg.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Pg[1]}})),i})()},pD=O('<div class="min-w-[125px]"></div>'),Tg=[{id:"mg",name:"mg"},{id:"mcg",name:"mcg"},{id:"g",name:"g"}],mD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=pD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Tg.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Tg[0]}})),i})()},vD=O('<div class="min-w-[125px]"></div>'),Ng=[{id:"mL",name:"mL"},{id:"L",name:"L"}],yD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=vD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Ng.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Ng[0]}})),i})()},gD=O('<div class="min-w-[125px]"></div>'),Ig=[{id:"lbs",name:"lbs"},{id:"kgs",name:"kgs"}],bD=()=>{const[e,t]=L(""),r=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});n?.dispatchEvent(o)};let n;return(()=>{const i=gD.cloneNode(!0),o=n;return typeof o=="function"?ee(o,i):n=i,i.addEventListener("photon-data-selected",a=>{r(a.detail.data.name)}),_(i,z(Nt,{get data(){return Ig.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a.name,onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return Ig[0]}})),i})()},$D=O('<div><style></style><div class="flex flex-col xs:flex-row items-start xs:items-center gap-2 pb-2"><p class="font-sans text-lg">Selected Drug: </p></div><div class="flex flex-col"><p class="font-sans pb-1">Input</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Dosage</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Weight</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans pb-1">Liquid Formation</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Drug Amount</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3 flex-shrink"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Per Volume</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans">Result</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Liquid Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div></div></div>'),wD=O("<p></p>"),_D=O('<p class="text-gray-500 font-sans italic">None selected</p>'),wu=(e,t)=>!!((t==="kgs"||t==="g")&&e.includes("kg")||(t==="lbs"||t==="oz")&&e.includes("lb")),xD=(e,t)=>e.includes("kg")&&t.unit==="oz"?t.value/16*.453592:e.includes("kg")&&t.unit==="lbs"?t.value*.453592:e.includes("lb")&&t.unit==="kgs"?t.value*2.20462:e.includes("lb")&&t.unit==="g"?t.value/1e3*2.20462:0,SD=(e,t)=>t==="mcg"&&e.split("/")[0]==="mcg"||t==="mg"&&e.split("/")[0]==="mg"||t==="g"&&e.split("/")[0]==="g",kD=(e,t)=>e.includes("mcg")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("mcg")&&t.unit==="g"?t.value*(1e3*1e3):e.includes("mg")&&t.unit==="mcg"?t.value/1e3:e.includes("mg")&&t.unit==="g"?t.value*1e3:e.includes("g")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("g")&&t.unit==="mg"?t.value/1e3:0,ED=(e,t)=>wu(e.unit,t.unit)&&t.unit==="g"?e.value*(t.value/1e3):wu(e.unit,t.unit)&&t.unit==="oz"?e.value*(t.value/16):wu(e.unit,t.unit)?e.value*t.value:e.value*xD(e.unit,t),OD=(e,t,r,n,i)=>r===0||r.toString().length===0||parseInt(r.toString(),10)===0||window.isNaN(r)?0:SD(t,n)?e*i/r:e*i/kD(t,{value:r,unit:n});we("photon-dosage-calculator",{medication:void 0},e=>{let t;const[r,n]=L(0),[i,o]=L(0),[a,s]=L(0),[c,l]=L(0),[u,d]=L("mg/kg"),[f,h]=L("lbs"),[p,m]=L("mg"),[v,y]=L("mL"),[b,g]=L(""),[w,x]=L(""),E=S=>{const T=new CustomEvent("photon-dosage-selected",{composed:!0,bubbles:!0,detail:{value:Number(S?w().split(" ")[0]:b().split(" ")[0]),unit:S?w().split(" ")[1]:b().split(" ")[1]}});t?.dispatchEvent(T)};return ge(()=>{let S=ED({value:r(),unit:u()},{value:a(),unit:f()});S.toString().split(".").length>1&&S.toString().split(".")[1].length>4&&(S=parseFloat(S.toFixed(4))),g(`${S} ${u().split("/")[0]}`);let T=OD(S,u().split("/")[0],i(),p(),c());i.toString().split(".").length>1&&i.toString().split(".")[1].length>4&&(T=parseFloat(T.toFixed(4))),x(`${T} ${v()}`)},[r,u,f,a,i,c,p,v]),(()=>{const S=V(()=>document.importNode($D,!0)),T=S.firstChild,M=T.nextSibling;M.firstChild;const F=M.nextSibling,K=F.firstChild,D=K.nextSibling,R=D.firstChild,U=R.nextSibling,j=D.nextSibling,Y=j.firstChild,oe=Y.nextSibling,ae=j.nextSibling,A=ae.nextSibling,me=A.firstChild,xe=me.nextSibling,I=A.nextSibling,xt=I.firstChild,St=xt.nextSibling,Mt=I.nextSibling,It=Mt.nextSibling,H=It.firstChild,Q=H.nextSibling,X=Q.nextSibling,ne=X.firstChild,ue=ne.nextSibling,de=It.nextSibling,Ue=de.firstChild,Me=Ue.nextSibling,st=Me.nextSibling,dr=st.firstChild,gn=dr.nextSibling,Vr=t;return typeof Vr=="function"?ee(Vr,S):t=S,_(T,ze),_(M,(()=>{const Ze=fe(()=>!!e.medication);return()=>Ze()?(()=>{const qi=wD.cloneNode(!0);return _(qi,()=>e.medication.name),qi})():_D.cloneNode(!0)})(),null),D.addEventListener("photon-input-changed",Ze=>{n(Ze.detail.input)}),D.addEventListener("photon-unit-selected",Ze=>{d(Ze.detail.unit)}),U._$owner=P(),_(D,z(hD,{}),null),j.addEventListener("photon-input-changed",Ze=>{s(Ze.detail.input)}),j.addEventListener("photon-unit-selected",Ze=>{h(Ze.detail.unit)}),oe._$owner=P(),_(j,z(bD,{}),null),A.addEventListener("photon-input-changed",Ze=>{o(Ze.detail.input)}),A.addEventListener("photon-unit-selected",Ze=>{m(Ze.detail.unit)}),xe._$owner=P(),_(A,z(mD,{}),null),I.addEventListener("photon-input-changed",Ze=>{l(Ze.detail.input)}),I.addEventListener("photon-unit-selected",Ze=>{y(Ze.detail.unit)}),St._$owner=P(),_(I,z(yD,{}),null),Q.disabled=!0,Q._$owner=P(),X.addEventListener("photon-clicked",()=>E(!1)),X._$owner=P(),ue._$owner=P(),Me.disabled=!0,Me._$owner=P(),st.addEventListener("photon-clicked",()=>E(!0)),st._$owner=P(),gn._$owner=P(),W(()=>Q.value=b()??"0"),W(()=>Me.value=w()??"0"),S})()});const CD=O('<div><photon-dialog label="Dosage Calculator"><photon-dosage-calculator></photon-dosage-calculator></photon-dialog></div>');we("photon-dosage-calculator-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0},medication:{value:void 0,reflect:!0,notify:!1,attribute:"medication",parse:!0}},e=>{rt();let t;const r=(n,i)=>{const o=new CustomEvent("photon-dose-selected",{composed:!0,bubbles:!0,detail:{value:n,unit:i}});t?.dispatchEvent(o)};return(()=>{const n=V(()=>document.importNode(CD,!0)),i=n.firstChild,o=i.firstChild,a=t;return typeof a=="function"?ee(a,n):t=n,n.addEventListener("photon-dosage-selected",s=>{s.stopImmediatePropagation(),s.stopPropagation(),r(s.detail.value,s.detail.unit),e.open=!1}),i.header=!0,i.hideFooter=!0,i.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),i._$owner=P(),o._$owner=P(),W(s=>{const c=e.open,l=e.medication;return c!==s._v$&&(i.open=s._v$=c),l!==s._v$2&&(o.medication=s._v$2=l),s},{_v$:void 0,_v$2:void 0}),n})()});function eh(e){this.message=e}eh.prototype=new Error,eh.prototype.name="InvalidCharacterError";var Ag=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new eh("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,o=0,a="";n=t.charAt(o++);~n&&(r=i%4?64*r+n:n,i++%4)?a+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};function PD(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(r){return decodeURIComponent(Ag(r).replace(/(.)/g,function(n,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(t)}catch{return Ag(t)}}function Nl(e){this.message=e}function TD(e,t){if(typeof e!="string")throw new Nl("Invalid token specified");var r=(t=t||{}).header===!0?0:1;try{return JSON.parse(PD(e.split(".")[r]))}catch(n){throw new Nl("Invalid token specified: "+n.message)}}Nl.prototype=new Error,Nl.prototype.name="InvalidTokenError";const ND=O(`<div><photon-dialog label="Lose Unsaved Prescription?" confirm-text="Yes, Continue" cancel-text="Keep Editing" width="500px"><p class="font-sans text-lg xs:text-base">You have a prescription "<!>" that hasn't been added. Please add it or continue.</p></photon-dialog></div>`),ID=O('<div class="flex flex-row sm:flex-col md:flex-col lg:flex-row gap-2 justify-end items-end"><photon-button size="sm" variant="outline" loading-text="Save prescriptions">Save prescriptions</photon-button><photon-button size="sm" loading-text="Save and create order">Save and create order</photon-button></div>'),AD=O('<div class="w-full h-full bg-[#f7f4f4]"><div class="p-4 w-full h-full sm:w-[600px] xs:mx-auto"><photon-prescribe-workflow hide-submit="true"></photon-prescribe-workflow></div></div>'),DD=O('<div class="pt-2"><sl-alert variant="danger" open><div class="flex items-start xs:items-center gap-4"><sl-icon slot="icon" name="exclamation-octagon" class="text-red-500" style="font-size: 24px;"></sl-icon><p class="font-sans"></p></div></sl-alert></div>'),RD=e=>e().notes?.value.length>0||e().instructions?.value.length>0||e().treatment?.value||e().patient?.value||e().dispenseAsWritten?.value!=!1||e().dispenseQuantity?.value!=1||e().dispenseUnit?.value!="Each"||e().daysSupply?.value!=30||e().refillsInput?.value!=0||e().addToTemplates?.value!=!1||e().effectiveDate?.value!=oc(new Date,"yyyy-MM-dd").toString()||e().draftPrescriptions?.value.length>0;we("photon-multirx-form-wrapper",{hideTemplates:!1,patientId:void 0,templateIds:void 0},e=>{let t;const r=rt(),[n,i]=L(!1),[o,a]=L([]),[s,c]=L(!1),[l,u]=L(!1),[d,f]=L(),[h,p]=L(),[m,v]=L(!1),{actions:y}=nc;Tt(async()=>{const E=await r.getSDK().authentication.getAccessToken();TD(E).permissions?.includes("write:prescription")&&c(!0)});const b=(E,S,T)=>{const M=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{patientId:T,prescriptionIds:S,createOrder:E}});t?.dispatchEvent(M)},g=()=>{const E=new CustomEvent("photon-prescriptions-closed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(E)},w=async(E,S,T)=>{a([]);const M=["patient","draftPrescriptions"];if(S.validate(M),!S.hasErrors(M)){u(!0),S.updateFormValue({key:"errors",value:[]});const K=r.getSDK().clinical.prescription.createPrescriptions({}),D=r.getSDK().clinical.prescriptionTemplate.createPrescriptionTemplate({}),R=[];for(const U of E.draftPrescriptions.value){if(U.addToTemplates)try{const{errors:Y}=await D({variables:{catalogId:U.catalogId,treatmentId:U.treatment.id,dispenseAsWritten:U.dispenseAsWritten,dispenseQuantity:U.dispenseQuantity,dispenseUnit:U.dispenseUnit,fillsAllowed:U.refillsInput+1,daysSupply:U.daysSupply,instructions:U.instructions,notes:U.notes},awaitRefetchQueries:!1});Y&&a(Y)}catch(Y){a([Y])}const j={daysSupply:U.daysSupply,dispenseAsWritten:U.dispenseAsWritten,dispenseQuantity:U.dispenseQuantity,dispenseUnit:U.dispenseUnit,effectiveDate:U.effectiveDate,instructions:U.instructions,notes:U.notes,patientId:E.patient?.value.id,fillsAllowed:U.refillsInput+1,treatmentId:U.treatment.id};R.push(j)}if(o().length>0)return;try{const{data:U,errors:j}=await K({variables:{prescriptions:R},refetchQueries:[],awaitRefetchQueries:!1});if(j){a(j);return}b(T,U.createPrescriptions.map(Y=>Y.id),E.patient?.value.id)}catch(U){a([U])}u(!1)}},x=()=>w(d(),h(),!0);return(()=>{const E=V(()=>document.importNode(ND,!0)),S=E.firstChild,T=S.firstChild,M=T.firstChild,F=M.nextSibling;F.nextSibling;const K=t;return typeof K=="function"?ee(K,E):t=E,S.addEventListener("photon-dialog-confirmed",()=>{v(!1),x()}),S.addEventListener("photon-dialog-canceled",()=>{v(!1)}),S._$owner=P(),_(T,()=>d()?.treatment?.value?.name,F),_(E,z(u$,{closeTitle:"Lose unsaved prescriptions?",closeBody:"You will not be able to recover unsaved prescriptions.",onClosed:()=>{g(),y.clearSelectedPatient(),e.open=!1},checkShouldWarn:()=>RD(d),title:"New Prescriptions",titleIconName:"prescription",get headerRight(){return(()=>{const D=V(()=>document.importNode(ID,!0)),R=D.firstChild,U=R.nextSibling;return R.addEventListener("photon-clicked",()=>w(d(),h(),!1)),R._$owner=P(),U.addEventListener("photon-clicked",()=>d()?.treatment?.value?.name?v(!0):x()),U._$owner=P(),W(j=>{const Y=!n()||!s(),oe=l(),ae=!n()||!s(),A=l();return Y!==j._v$&&(R.disabled=j._v$=Y),oe!==j._v$2&&(R.loading=j._v$2=oe),ae!==j._v$3&&(U.disabled=j._v$3=ae),A!==j._v$4&&(U.loading=j._v$4=A),j},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),D})()},get form(){return(()=>{const D=V(()=>document.importNode(AD,!0)),R=D.firstChild,U=R.firstChild;return _(D,z(re,{get when(){return o().length>0},get children(){return z(Rl,{get each(){return o()},children:j=>(()=>{const Y=V(()=>document.importNode(DD,!0)),oe=Y.firstChild,ae=oe.firstChild,A=ae.firstChild,me=A.nextSibling;return oe._$owner=P(),A._$owner=P(),_(me,()=>j.message),Y})()})}}),R),U.addEventListener("photon-form-validate",j=>{i(j.detail.canSubmit),p(j.detail.actions),f(j.detail.form)}),U._$owner=P(),W(j=>{const Y=e.hideTemplates,oe=l(),ae=e.patientId,A=e.templateIds;return Y!==j._v$5&&(U.hideTemplates=j._v$5=Y),oe!==j._v$6&&(U.loading=j._v$6=oe),ae!==j._v$7&&(U.patientId=j._v$7=ae),A!==j._v$8&&(U.templateIds=j._v$8=A),j},{_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0}),D})()}}),null),W(()=>S.open=m()),E})()});