@sprig-technologies/sprig-bundled 1.0.0-beta → 1.0.0-beta.2

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.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var dp=Object.defineProperty;var fp=(e,t,n)=>t in e?dp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t,n)=>(fp(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var pp=Object.create,Uu=Object.defineProperty,hp=Object.getOwnPropertyDescriptor,mp=Object.getOwnPropertyNames,gp=Object.getPrototypeOf,vp=Object.prototype.hasOwnProperty,xr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yp=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mp(t))!vp.call(e,i)&&i!==n&&Uu(e,i,{get:()=>t[i],enumerable:!(r=hp(t,i))||r.enumerable});return e},_p=(e,t,n)=>(n=e!=null?pp(gp(e)):{},yp(t||!e||!e.__esModule?Uu(n,"default",{value:e,enumerable:!0}):n,e)),bp=xr((e,t)=>{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n={},t.exports=n}),wp=xr((e,t)=>{t.exports=r;var n=Object.prototype.toString;function r(i){if(!i)return!1;var o=n.call(i);return o==="[object Function]"||typeof i=="function"&&o!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}}),Cp=xr((e,t)=>{var n=function(i){return i.replace(/^\s+|\s+$/g,"")},r=function(i){return Object.prototype.toString.call(i)==="[object Array]"};t.exports=function(i){if(!i)return{};for(var o={},a=n(i).split(`
2
- `),s=0;s<a.length;s++){var l=a[s],u=l.indexOf(":"),c=n(l.slice(0,u)).toLowerCase(),d=n(l.slice(u+1));typeof o[c]>"u"?o[c]=d:r(o[c])?o[c].push(d):o[c]=[o[c],d]}return o}}),Ep=xr((e,t)=>{t.exports=r;var n=Object.prototype.hasOwnProperty;function r(){for(var i={},o=0;o<arguments.length;o++){var a=arguments[o];for(var s in a)n.call(a,s)&&(i[s]=a[s])}return i}}),Sp=xr((e,t)=>{var n=bp(),r=wp(),i=Cp(),o=Ep();t.exports=u,t.exports.default=u,u.XMLHttpRequest=n.XMLHttpRequest||p,u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,a(["get","put","post","patch","head","delete"],function(f){u[f==="delete"?"del":f]=function(h,m,g){return m=l(h,m,g),m.method=f.toUpperCase(),c(m)}});function a(f,h){for(var m=0;m<f.length;m++)h(f[m])}function s(f){for(var h in f)if(f.hasOwnProperty(h))return!1;return!0}function l(f,h,m){var g=f;return r(h)?(m=h,typeof f=="string"&&(g={uri:f})):g=o(h,{uri:f}),g.callback=m,g}function u(f,h,m){return h=l(f,h,m),c(h)}function c(f){if(typeof f.callback>"u")throw new Error("callback argument missing");var h=!1,m=function(R,V,K){h||(h=!0,f.callback(R,V,K))};function g(){v.readyState===4&&setTimeout(_,0)}function b(){var R=void 0;if(v.response?R=v.response:R=v.responseText||d(v),L)try{R=JSON.parse(R)}catch{}return R}function y(R){return clearTimeout(k),R instanceof Error||(R=new Error(""+(R||"Unknown XMLHttpRequest Error"))),R.statusCode=0,m(R,U)}function _(){if(!E){var R;clearTimeout(k),f.useXDR&&v.status===void 0?R=200:R=v.status===1223?204:v.status;var V=U,K=null;return R!==0?(V={body:b(),statusCode:R,method:S,headers:{},url:I,rawRequest:v},v.getAllResponseHeaders&&(V.headers=i(v.getAllResponseHeaders()))):K=new Error("Internal XMLHttpRequest Error"),m(K,V,V.body)}}var v=f.xhr||null;v||(f.cors||f.useXDR?v=new u.XDomainRequest:v=new u.XMLHttpRequest);var w,E,I=v.url=f.uri||f.url,S=v.method=f.method||"GET",x=f.body||f.data,T=v.headers=f.headers||{},A=!!f.sync,L=!1,k,U={body:void 0,headers:{},statusCode:0,method:S,url:I,rawRequest:v};if("json"in f&&f.json!==!1&&(L=!0,T.accept||T.Accept||(T.Accept="application/json"),S!=="GET"&&S!=="HEAD"&&(T["content-type"]||T["Content-Type"]||(T["Content-Type"]="application/json"),x=JSON.stringify(f.json===!0?x:f.json))),v.onreadystatechange=g,v.onload=_,v.onerror=y,v.onprogress=function(){},v.onabort=function(){E=!0},v.ontimeout=y,v.open(S,I,!A,f.username,f.password),A||(v.withCredentials=!!f.withCredentials),!A&&f.timeout>0&&(k=setTimeout(function(){if(!E){E=!0,v.abort("timeout");var R=new Error("XMLHttpRequest timeout");R.code="ETIMEDOUT",y(R)}},f.timeout)),v.setRequestHeader)for(w in T)T.hasOwnProperty(w)&&v.setRequestHeader(w,T[w]);else if(f.headers&&!s(f.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in f&&(v.responseType=f.responseType),"beforeSend"in f&&typeof f.beforeSend=="function"&&f.beforeSend(v),v.send(x||null),v}function d(f){try{if(f.responseType==="document")return f.responseXML;var h=f.responseXML&&f.responseXML.documentElement.nodeName==="parsererror";if(f.responseType===""&&!h)return f.responseXML}catch{}return null}function p(){}});function Ba(e,t,...n){if(!e)throw new TypeError(Pu(t,n))}function Pu(e,t){let n=0;return e.replace(/%[os]/gu,()=>Mu(t[n++]))}function Mu(e){return typeof e!="object"||e===null?String(e):Object.prototype.toString.call(e)}var Ip;function kp(e){try{let t=e instanceof Error?e:new Error(Mu(e));if(typeof dispatchEvent=="function"&&typeof ErrorEvent=="function")dispatchEvent(new ErrorEvent("error",{error:t,message:t.message}));else if(typeof process<"u"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)}catch{}}var it=typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:typeof globalThis<"u"?globalThis:void 0,xp,Ut=class{constructor(e,t){this.code=e,this.message=t}warn(...e){var t;try{let n=((t=new Error().stack)!==null&&t!==void 0?t:"").replace(/^(?:.+?\n){2}/gu,`
3
- `);console.warn(this.message,...e,n)}catch{}}},Ap=new Ut("W01","Unable to initialize event under dispatching."),Tp=new Ut("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),Rp=new Ut("W03","Assigning any truthy value to 'returnValue' property has no effect."),Lp=new Ut("W04","Unable to preventDefault on non-cancelable events."),Op=new Ut("W05","Unable to preventDefault inside passive event listener invocation."),Np=new Ut("W06","An event listener wasn't added because it has been added already: %o, %o"),lo=new Ut("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),Vs=new Ut("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o");new Ut("W09","Event attribute handler must be a function: %o");var Pt=class{static get NONE(){return Fs}static get CAPTURING_PHASE(){return Bs}static get AT_TARGET(){return js}static get BUBBLING_PHASE(){return Hs}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let n=t!=null?t:{};Go.set(this,{type:String(e),bubbles:Boolean(n.bubbles),cancelable:Boolean(n.cancelable),composed:Boolean(n.composed),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return me(this).type}get target(){return me(this).target}get srcElement(){return me(this).target}get currentTarget(){return me(this).currentTarget}composedPath(){let e=me(this).currentTarget;return e?[e]:[]}get NONE(){return Fs}get CAPTURING_PHASE(){return Bs}get AT_TARGET(){return js}get BUBBLING_PHASE(){return Hs}get eventPhase(){return me(this).dispatchFlag?2:0}stopPropagation(){me(this).stopPropagationFlag=!0}get cancelBubble(){return me(this).stopPropagationFlag}set cancelBubble(e){e?me(this).stopPropagationFlag=!0:Tp.warn()}stopImmediatePropagation(){let e=me(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return me(this).bubbles}get cancelable(){return me(this).cancelable}get returnValue(){return!me(this).canceledFlag}set returnValue(e){e?Rp.warn():zs(me(this))}preventDefault(){zs(me(this))}get defaultPrevented(){return me(this).canceledFlag}get composed(){return me(this).composed}get isTrusted(){return!1}get timeStamp(){return me(this).timeStamp}initEvent(e,t=!1,n=!1){let r=me(this);if(r.dispatchFlag){Ap.warn();return}Go.set(this,{...r,type:String(e),bubbles:Boolean(t),cancelable:Boolean(n),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}},Fs=0,Bs=1,js=2,Hs=3,Go=new WeakMap;function me(e,t="this"){let n=Go.get(e);return Ba(n!=null,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),n}function zs(e){if(e.inPassiveListenerFlag){Op.warn();return}if(!e.cancelable){Lp.warn();return}e.canceledFlag=!0}Object.defineProperty(Pt,"NONE",{enumerable:!0});Object.defineProperty(Pt,"CAPTURING_PHASE",{enumerable:!0});Object.defineProperty(Pt,"AT_TARGET",{enumerable:!0});Object.defineProperty(Pt,"BUBBLING_PHASE",{enumerable:!0});var uo=Object.getOwnPropertyNames(Pt.prototype);for(let e=0;e<uo.length;++e)uo[e]!=="constructor"&&Object.defineProperty(Pt.prototype,uo[e],{enumerable:!0});typeof it<"u"&&typeof it.Event<"u"&&Object.setPrototypeOf(Pt.prototype,it.Event.prototype);function Dp(e){return it.DOMException?new it.DOMException(e,"InvalidStateError"):(Cn==null&&(Cn=class Vu extends Error{constructor(n){super(n),Error.captureStackTrace&&Error.captureStackTrace(this,Vu)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(Cn.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),Ks(Cn),Ks(Cn.prototype)),new Cn(e))}var Cn,Gs={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function Ks(e){let t=Object.keys(Gs);for(let n=0;n<t.length;++n){let r=t[n],i=Gs[r];Object.defineProperty(e,r,{get(){return i},configurable:!0,enumerable:!0})}}var Ki=class extends Pt{static wrap(e){return new(Bu(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),Fu.set(this,{original:e});let t=Object.keys(e);for(let n=0;n<t.length;++n){let r=t[n];r in this||Object.defineProperty(this,r,ju(e,r))}}stopPropagation(){super.stopPropagation();let{original:e}=Vt(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;let{original:t}=Vt(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();let{original:e}=Vt(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;let{original:t}=Vt(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();let{original:e}=Vt(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){let{original:e}=Vt(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}},Fu=new WeakMap;function Vt(e){let t=Fu.get(e);return Ba(t!=null,"'this' is expected an Event object, but got",e),t}var vi=new WeakMap;vi.set(Object.prototype,Ki);typeof it<"u"&&typeof it.Event<"u"&&vi.set(it.Event.prototype,Ki);function Bu(e){let t=Object.getPrototypeOf(e);if(t==null)return Ki;let n=vi.get(t);return n==null&&(n=Up(Bu(t),t),vi.set(t,n)),n}function Up(e,t){class n extends e{}let r=Object.keys(t);for(let i=0;i<r.length;++i)Object.defineProperty(n.prototype,r[i],ju(t,r[i]));return n}function ju(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return{get(){let r=Vt(this).original,i=r[t];return typeof i=="function"?i.bind(r):i},set(r){let i=Vt(this).original;i[t]=r},configurable:n.configurable,enumerable:n.enumerable}}function Pp(e,t,n,r,i,o){return{callback:e,flags:(t?1:0)|(n?2:0)|(r?4:0),signal:i,signalListener:o}}function Mp(e){e.flags|=8}function Hu(e){return(e.flags&1)===1}function zu(e){return(e.flags&2)===2}function Gu(e){return(e.flags&4)===4}function Vp(e){return(e.flags&8)===8}function Fp({callback:e},t,n){try{typeof e=="function"?e.call(t,n):typeof e.handleEvent=="function"&&e.handleEvent(n)}catch(r){kp(r)}}function Ku({listeners:e},t,n){for(let r=0;r<e.length;++r)if(e[r].callback===t&&Hu(e[r])===n)return r;return-1}function Bp(e,t,n,r,i,o){let a;o&&(a=Wu.bind(null,e,t,n),o.addEventListener("abort",a));let s=Pp(t,n,r,i,o,a);return e.cow?(e.cow=!1,e.listeners=[...e.listeners,s]):e.listeners.push(s),s}function Wu(e,t,n){let r=Ku(e,t,n);return r!==-1?qu(e,r):!1}function qu(e,t,n=!1){let r=e.listeners[t];return Mp(r),r.signal&&r.signal.removeEventListener("abort",r.signalListener),e.cow&&!n?(e.cow=!1,e.listeners=e.listeners.filter((i,o)=>o!==t),!1):(e.listeners.splice(t,1),!0)}function jp(){return Object.create(null)}function Hp(e,t){var n;return(n=e[t])!==null&&n!==void 0?n:e[t]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}var Wi=class{constructor(){$u.set(this,jp())}addEventListener(e,t,n){let r=co(this),{callback:i,capture:o,once:a,passive:s,signal:l,type:u}=zp(e,t,n);if(i==null||(l==null?void 0:l.aborted))return;let c=Hp(r,u),d=Ku(c,i,o);if(d!==-1){Kp(c.listeners[d],s,a,l);return}Bp(c,i,o,s,a,l)}removeEventListener(e,t,n){let r=co(this),{callback:i,capture:o,type:a}=Gp(e,t,n),s=r[a];i!=null&&s&&Wu(s,i,o)}dispatchEvent(e){let t=co(this)[String(e.type)];if(t==null)return!0;let n=e instanceof Pt?e:Ki.wrap(e),r=me(n,"event");if(r.dispatchFlag)throw Dp("This event has been in dispatching.");if(r.dispatchFlag=!0,r.target=r.currentTarget=this,!r.stopPropagationFlag){let{cow:i,listeners:o}=t;t.cow=!0;for(let a=0;a<o.length;++a){let s=o[a];if(!Vp(s)&&(Gu(s)&&qu(t,a,!i)&&(a-=1),r.inPassiveListenerFlag=zu(s),Fp(s,this,n),r.inPassiveListenerFlag=!1,r.stopImmediatePropagationFlag))break}i||(t.cow=!1)}return r.target=null,r.currentTarget=null,r.stopImmediatePropagationFlag=!1,r.stopPropagationFlag=!1,r.dispatchFlag=!1,!r.canceledFlag}},$u=new WeakMap;function co(e,t="this"){let n=$u.get(e);return Ba(n!=null,"'%s' must be an object that EventTarget constructor created, but got another one: %o",t,e),n}function zp(e,t,n){var r;return Yu(t),typeof n=="object"&&n!==null?{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n.capture),passive:Boolean(n.passive),once:Boolean(n.once),signal:(r=n.signal)!==null&&r!==void 0?r:void 0}:{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n),passive:!1,once:!1,signal:void 0}}function Gp(e,t,n){return Yu(t),typeof n=="object"&&n!==null?{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n.capture)}:{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n)}}function Yu(e){if(!(typeof e=="function"||typeof e=="object"&&e!==null&&typeof e.handleEvent=="function")){if(e==null||typeof e=="object"){Vs.warn(e);return}throw new TypeError(Pu(Vs.message,[e]))}}function Kp(e,t,n,r){Np.warn(Hu(e)?"capture":"bubble",e.callback),zu(e)!==t&&lo.warn("passive"),Gu(e)!==n&&lo.warn("once"),e.signal!==r&&lo.warn("signal")}var fo=Object.getOwnPropertyNames(Wi.prototype);for(let e=0;e<fo.length;++e)fo[e]!=="constructor"&&Object.defineProperty(Wi.prototype,fo[e],{enumerable:!0});typeof it<"u"&&typeof it.EventTarget<"u"&&Object.setPrototypeOf(Wi.prototype,it.EventTarget.prototype);var Wp=_p(Sp()),Zu=30720,qi=512e3,$i=256,Ko=(e,{minChunkSize:t=$i,maxChunkSize:n=qi}={})=>e==null||typeof e=="number"&&e>=256&&e%256===0&&e>=t&&e<=n,Wo=(e,{minChunkSize:t=$i,maxChunkSize:n=qi}={})=>new TypeError(`chunkSize ${e} must be a positive number in multiples of 256, between ${t} and ${n}`),qp=class{constructor(e,t={}){this.readableStream=e;var n,r,i;if(!Ko(t.defaultChunkSize,t))throw Wo(t.defaultChunkSize,t);this.defaultChunkSize=(n=t.defaultChunkSize)!=null?n:Zu,this.minChunkSize=(r=t.minChunkSize)!=null?r:$i,this.maxChunkSize=(i=t.maxChunkSize)!=null?i:qi}get chunkSize(){var e;return(e=this._chunkSize)!=null?e:this.defaultChunkSize}set chunkSize(e){if(!Ko(e,this))throw Wo(e,this);this._chunkSize=e}get chunkByteSize(){return this.chunkSize*1024}async*[Symbol.asyncIterator](){let e,t=this.readableStream.getReader();try{for(;;){let{done:n,value:r}=await t.read();if(n){if(e){let o=e;e=void 0,yield o}break}let i=r instanceof Uint8Array?new Blob([r],{type:"application/octet-stream"}):r;for(e=e?new Blob([e,i]):i;e;)if(e.size===this.chunkByteSize){let o=e;e=void 0,yield o;break}else{if(e.size<this.chunkByteSize)break;{let o=e.slice(0,this.chunkByteSize);e=e.slice(this.chunkByteSize),yield o}}}}finally{if(e){let n=e;e=void 0,yield n}t.releaseLock();return}}},$p=[200,201,202,204,308],Qu=[408,502,503,504],Ju=(e,t)=>!!e&&$p.includes(e.statusCode),Yp=(e,{retryCodes:t=Qu})=>!e||t.includes(e.statusCode),Zp=(e,t)=>t.attemptCount>=t.attempts||!(Ju(e)||Yp(e,t)),Xu=class{static createUpload(e){return new Xu(e)}constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.headers=e.headers||{},this.method=e.method||"PUT",this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.retryCodes=e.retryCodes||Qu,this.dynamicChunkSize=e.dynamicChunkSize||!1,this.maxFileBytes=(e.maxFileSize||0)*1024,this.chunkCount=0,this.attemptCount=0,this.offline=!1,this._paused=!1,this.success=!1,this.nextChunkRangeStart=0,this.chunkedStreamIterable=new qp(this.file.stream(),{...e,defaultChunkSize:e.chunkSize}),this.chunkedStreamIterator=this.chunkedStreamIterable[Symbol.asyncIterator](),this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.eventTarget=new Wi,this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{!this.offline||(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}get maxChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.maxChunkSize)!=null?t:qi}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:$i}get chunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.chunkSize)!=null?t:Zu}set chunkSize(e){this.chunkedStreamIterable.chunkSize=e}get chunkByteSize(){return this.chunkedStreamIterable.chunkByteSize}get totalChunkSize(){return Math.ceil(this.file.size/this.chunkByteSize)}on(e,t){this.eventTarget.addEventListener(e,t)}once(e,t){this.eventTarget.addEventListener(e,t,{once:!0})}off(e,t){this.eventTarget.removeEventListener(e,t)}get paused(){return this._paused}abort(){var e;this.pause(),(e=this.currentXhr)==null||e.abort()}pause(){this._paused=!0}resume(){this._paused&&(this._paused=!1,this.sendChunks())}dispatch(e,t){let n=new CustomEvent(e,{detail:t});this.eventTarget.dispatchEvent(n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint must be defined as a string or a function that returns a promise");if(!(this.file instanceof File))throw new TypeError("file must be a File object");if(this.headers&&typeof this.headers!="function"&&typeof this.headers!="object")throw new TypeError("headers must be null, an object, or a function that returns an object or a promise");if(!Ko(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize}))throw Wo(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize});if(this.maxChunkSize&&(typeof this.maxChunkSize!="number"||this.maxChunkSize<256||this.maxChunkSize%256!==0||this.maxChunkSize<this.chunkSize||this.maxChunkSize<this.minChunkSize))throw new TypeError(`maxChunkSize must be a positive number in multiples of 256, and larger than or equal to both ${this.minChunkSize} and ${this.chunkSize}`);if(this.minChunkSize&&(typeof this.minChunkSize!="number"||this.minChunkSize<256||this.minChunkSize%256!==0||this.minChunkSize>this.chunkSize||this.minChunkSize>this.maxChunkSize))throw new TypeError(`minChunkSize must be a positive number in multiples of 256, and smaller than ${this.chunkSize} and ${this.maxChunkSize}`);if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`file size exceeds maximum (${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("retries must be a positive number");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("delayBeforeAttempt must be a positive number")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(e=>(this.endpointValue=e,this.endpointValue))}xhrPromise(e){let t=n=>{n.upload.onprogress=r=>{var i;let o=this.totalChunks-this.chunkCount,a=(this.file.size-this.nextChunkRangeStart)/this.file.size/o,s=this.nextChunkRangeStart/this.file.size,l=r.loaded/((i=r.total)!=null?i:this.chunkByteSize)*a;this.dispatch("progress",Math.min((s+l)*100,100))}};return new Promise((n,r)=>{this.currentXhr=(0,Wp.default)({...e,beforeSend:t},(i,o)=>(this.currentXhr=void 0,i?r(i):n(o)))})}async sendChunk(e){let t=this.nextChunkRangeStart,n=t+e.size-1,r={...await(typeof this.headers=="function"?this.headers():this.headers),"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${this.file.size}`};return this.dispatch("attempt",{chunkNumber:this.chunkCount,totalChunks:this.totalChunks,chunkSize:this.chunkSize}),this.xhrPromise({headers:r,url:this.endpointValue,method:this.method,body:e})}async sendChunkWithRetries(e){let t=async(a,s)=>{var l;let u=(new Date().getTime()-this.lastChunkStart.getTime())/1e3;if(this.dispatch("chunkSuccess",{chunk:this.chunkCount,chunkSize:this.chunkSize,attempts:this.attemptCount,timeInterval:u,response:a}),this.attemptCount=0,this.chunkCount=((l=this.chunkCount)!=null?l:0)+1,this.nextChunkRangeStart=this.nextChunkRangeStart+this.chunkByteSize,this.dynamicChunkSize){let c=this.chunkSize;u<10?c=Math.min(this.chunkSize*2,this.maxChunkSize):u>30&&(c=Math.max(this.chunkSize/2,this.minChunkSize)),this.chunkSize=Math.ceil(c/256)*256;let d=(this.file.size-this.nextChunkRangeStart)/this.chunkByteSize;this.totalChunks=Math.ceil(this.chunkCount+d)}return!0},n=async(a,s)=>(this.dispatch("error",{message:`Server responded with ${a.statusCode}. Stopping upload.`,chunk:this.chunkCount,attempts:this.attemptCount}),!1),r=async(a,s)=>(this.dispatch("attemptFailure",{message:`An error occured uploading chunk ${this.chunkCount}. ${this.attempts-this.attemptCount} retries left.`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount}),new Promise(l=>{setTimeout(async()=>{if(this._paused||this.offline){this.pendingChunk=e,l(!1);return}let u=await this.sendChunkWithRetries(e);l(u)},this.delayBeforeAttempt*1e3)})),i;try{this.attemptCount=this.attemptCount+1,this.lastChunkStart=new Date,i=await this.sendChunk(e)}catch{}let o={retryCodes:this.retryCodes,attemptCount:this.attemptCount,attempts:this.attempts};return Ju(i)?t(i):Zp(i,o)?n(i):r()}async sendChunks(){if(this.pendingChunk&&!(this._paused||this.offline)){let e=this.pendingChunk;this.pendingChunk=void 0;let t=await this.sendChunkWithRetries(e);this.success&&t&&this.dispatch("success")}for(;!(this.success||this._paused||this.offline);){let{value:e,done:t}=await this.chunkedStreamIterator.next(),n=!e&&t;if(e&&(n=await this.sendChunkWithRetries(e)),this.success=!!t,this.success&&n&&this.dispatch("success"),!n)return}}},Qp=Xu.createUpload,be;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(be||(be={}));function Jp(e){return e.nodeType===e.ELEMENT_NODE}function or(e){var t=e==null?void 0:e.host;return Boolean((t==null?void 0:t.shadowRoot)===e)}function ar(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Xp(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function eh(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return e.layerName===""?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function yi(e){try{var t=e.rules||e.cssRules;return t?Xp(Array.from(t).map(ec).join("")):null}catch{return null}}function ec(e){var t;if(nh(e))try{t=yi(e.styleSheet)||eh(e)}catch{}return th(t||e.cssText)}function th(e){if(e.includes(":")){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}function nh(e){return"styleSheet"in e}var tc=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r!=null?r:-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(i){return n.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function rh(){return new tc}function ja(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,a=e.maskInputFn,s=o||"",l=i&&hn(i);return(n[r.toLowerCase()]||l&&n[l])&&(a?s=a(s,t):s="*".repeat(s.length)),s}function hn(e){return e.toLowerCase()}var Ws="__rrweb_original__";function ih(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var o=t.getImageData,a=Ws in o?o[Ws]:o,s=new Uint32Array(a.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer);if(s.some(function(l){return l!==0}))return!1}return!0}function Ha(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?hn(t):null}var oh=1,ah=new RegExp("[^a-z0-9-_:]"),mr=-2;function nc(){return oh++}function sh(e){if(e instanceof HTMLFormElement)return"form";var t=hn(e.tagName);return ah.test(t)?"div":t}function lh(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var En,qs,uh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ch=/^(?:[a-z+]+:)?\/\//i,dh=/^www\..*/i,fh=/^(data:)([^,]*),(.*)/i;function _i(e,t){return(e||"").replace(uh,function(n,r,i,o,a,s){var l=i||a||s,u=r||o||"";if(!l)return n;if(ch.test(l)||dh.test(l)||fh.test(l))return"url(".concat(u).concat(l).concat(u,")");if(l[0]==="/")return"url(".concat(u).concat(lh(t)+l).concat(u,")");var c=t.split("/"),d=l.split("/");c.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];h!=="."&&(h===".."?c.pop():c.push(h))}return"url(".concat(u).concat(c.join("/")).concat(u,")")})}var ph=/^[^ \t\n\r\u000c]+/,hh=/^[, \t\n\r\u000c]+/;function mh(e,t){if(t.trim()==="")return t;var n=0;function r(u){var c,d=u.exec(t.substring(n));return d?(c=d[0],n+=c.length,c):""}for(var i=[];r(hh),!(n>=t.length);){var o=r(ph);if(o.slice(-1)===",")o=Tn(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=Tn(e,o);for(var s=!1;;){var l=t.charAt(n);if(l===""){i.push((o+a).trim());break}else if(s)l===")"&&(s=!1);else if(l===","){n+=1,i.push((o+a).trim());break}else l==="("&&(s=!0);a+=l,n+=1}}}return i.join(", ")}function Tn(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function gh(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function za(){var e=document.createElement("a");return e.href="",e.href}function rc(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?Tn(e,r):n==="srcset"?mh(e,r):n==="style"?_i(r,za()):t==="object"&&n==="data"?Tn(e,r):r)}function ic(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function vh(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function bi(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?bi(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return n?bi(e.parentNode,t,n):!1}function oc(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(bi(r,t,!0))return!0;if(n&&(r.matches(n)||r.closest(n)))return!0}catch{}return!1}function yh(e,t,n){var r=e.contentWindow;if(!!r){var i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){var a=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(a),i=!0,t()});return}var s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function _h(e,t,n){var r=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(o),r=!0,t()})}}function bh(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,l=t.inlineStylesheet,u=t.maskInputOptions,c=u===void 0?{}:u,d=t.maskTextFn,p=t.maskInputFn,f=t.dataURLOptions,h=f===void 0?{}:f,m=t.inlineImages,g=t.recordCanvas,b=t.keepIframeSrcFn,y=t.newlyAddedElement,_=y===void 0?!1:y,v=wh(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:be.Document,childNodes:[],compatMode:e.compatMode}:{type:be.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:be.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return Eh(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:c,maskInputFn:p,dataURLOptions:h,inlineImages:m,recordCanvas:g,keepIframeSrcFn:b,newlyAddedElement:_,rootId:v});case e.TEXT_NODE:return Ch(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:v});case e.CDATA_SECTION_NODE:return{type:be.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:be.Comment,textContent:e.textContent||"",rootId:v};default:return!1}}function wh(e,t){if(!!t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Ch(e,t){var n,r=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,a=t.rootId,s=e.parentNode&&e.parentNode.tagName,l=e.textContent,u=s==="STYLE"?!0:void 0,c=s==="SCRIPT"?!0:void 0;if(u&&l){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(l=yi(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}l=_i(l,za())}return c&&(l="SCRIPT_PLACEHOLDER"),!u&&!c&&l&&oc(e,r,i)&&(l=o?o(l):l.replace(/[\S]/g,"*")),{type:be.Text,textContent:l||"",isStyle:u,rootId:a}}function Eh(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,a=t.maskInputOptions,s=a===void 0?{}:a,l=t.maskInputFn,u=t.dataURLOptions,c=u===void 0?{}:u,d=t.inlineImages,p=t.recordCanvas,f=t.keepIframeSrcFn,h=t.newlyAddedElement,m=h===void 0?!1:h,g=t.rootId,b=vh(e,r,i),y=sh(e),_={},v=e.attributes.length,w=0;w<v;w++){var E=e.attributes[w];ic(y,E.name,E.value)||(_[E.name]=rc(n,y,hn(E.name),E.value))}if(y==="link"&&o){var I=Array.from(n.styleSheets).find(function(fe){return fe.href===e.href}),S=null;I&&(S=yi(I)),S&&(delete _.rel,delete _.href,_._cssText=_i(S,I.href))}if(y==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var S=yi(e.sheet);S&&(_._cssText=_i(S,za()))}if(y==="input"||y==="textarea"||y==="select"){var x=e.value,T=e.checked;if(_.type!=="radio"&&_.type!=="checkbox"&&_.type!=="submit"&&_.type!=="button"&&x){var A=Ha(e);_.value=ja({element:e,type:A,tagName:y,value:x,maskInputOptions:s,maskInputFn:l})}else T&&(_.checked=T)}if(y==="option"&&(e.selected&&!s.select?_.selected=!0:delete _.selected),y==="canvas"&&p){if(e.__context==="2d")ih(e)||(_.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var L=e.toDataURL(c.type,c.quality),k=document.createElement("canvas");k.width=e.width,k.height=e.height;var U=k.toDataURL(c.type,c.quality);L!==U&&(_.rr_dataURL=L)}}if(y==="img"&&d){En||(En=n.createElement("canvas"),qs=En.getContext("2d"));var R=e,V=R.crossOrigin;R.crossOrigin="anonymous";var K=function(){R.removeEventListener("load",K);try{En.width=R.naturalWidth,En.height=R.naturalHeight,qs.drawImage(R,0,0),_.rr_dataURL=En.toDataURL(c.type,c.quality)}catch(fe){console.warn("Cannot inline img src=".concat(R.currentSrc,"! Error: ").concat(fe))}V?_.crossOrigin=V:R.removeAttribute("crossorigin")};R.complete&&R.naturalWidth!==0?K():R.addEventListener("load",K)}if((y==="audio"||y==="video")&&(_.rr_mediaState=e.paused?"paused":"played",_.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop)),b){var z=e.getBoundingClientRect(),ie=z.width,oe=z.height;_={class:_.class,rr_width:"".concat(ie,"px"),rr_height:"".concat(oe,"px")}}return y==="iframe"&&!f(_.src)&&(e.contentDocument||(_.rr_src=_.src),delete _.src),{type:be.Element,tagName:y,attributes:_,childNodes:[],isSVG:gh(e)||void 0,needBlock:b,rootId:g}}function re(e){return e==null?"":e.toLowerCase()}function Sh(e,t){if(t.comment&&e.type===be.Comment)return!0;if(e.type===be.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(re(e.attributes.name).match(/^msapplication-tile(image|color)$/)||re(e.attributes.name)==="application-name"||re(e.attributes.rel)==="icon"||re(e.attributes.rel)==="apple-touch-icon"||re(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&re(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(re(e.attributes.property).match(/^(og|twitter|fb):/)||re(e.attributes.name).match(/^(og|twitter):/)||re(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(re(e.attributes.name)==="robots"||re(e.attributes.name)==="googlebot"||re(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(re(e.attributes.name)==="author"||re(e.attributes.name)==="generator"||re(e.attributes.name)==="framework"||re(e.attributes.name)==="publisher"||re(e.attributes.name)==="progid"||re(e.attributes.property).match(/^article:/)||re(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(re(e.attributes.name)==="google-site-verification"||re(e.attributes.name)==="yandex-verification"||re(e.attributes.name)==="csrf-token"||re(e.attributes.name)==="p:domain_verify"||re(e.attributes.name)==="verify-v1"||re(e.attributes.name)==="verification"||re(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Rn(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,l=t.skipChild,u=l===void 0?!1:l,c=t.inlineStylesheet,d=c===void 0?!0:c,p=t.maskInputOptions,f=p===void 0?{}:p,h=t.maskTextFn,m=t.maskInputFn,g=t.slimDOMOptions,b=t.dataURLOptions,y=b===void 0?{}:b,_=t.inlineImages,v=_===void 0?!1:_,w=t.recordCanvas,E=w===void 0?!1:w,I=t.onSerialize,S=t.onIframeLoad,x=t.iframeLoadTimeout,T=x===void 0?5e3:x,A=t.onStylesheetLoad,L=t.stylesheetLoadTimeout,k=L===void 0?5e3:L,U=t.keepIframeSrcFn,R=U===void 0?function(){return!1}:U,V=t.newlyAddedElement,K=V===void 0?!1:V,z=t.preserveWhiteSpace,ie=z===void 0?!0:z,oe=bh(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,dataURLOptions:y,inlineImages:v,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:K});if(!oe)return console.warn(e,"not serialized"),null;var fe;r.hasNode(e)?fe=r.getId(e):Sh(oe,g)||!ie&&oe.type===be.Text&&!oe.isStyle&&!oe.textContent.replace(/^\s+|\s+$/gm,"").length?fe=mr:fe=nc();var Q=Object.assign(oe,{id:fe});if(r.add(e,Q),fe===mr)return null;I&&I(e);var Ke=!u;if(Q.type===be.Element){Ke=Ke&&!Q.needBlock,delete Q.needBlock;var Ie=e.shadowRoot;Ie&&ar(Ie)&&(Q.isShadowHost=!0)}if((Q.type===be.Document||Q.type===be.Element)&&Ke){g.headWhitespace&&Q.type===be.Element&&Q.tagName==="head"&&(ie=!1);for(var yt={doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:u,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:E,preserveWhiteSpace:ie,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:T,onStylesheetLoad:A,stylesheetLoadTimeout:k,keepIframeSrcFn:R},Fe=0,st=Array.from(e.childNodes);Fe<st.length;Fe++){var Xt=st[Fe],Xe=Rn(Xt,yt);Xe&&Q.childNodes.push(Xe)}if(Jp(e)&&e.shadowRoot)for(var j=0,Pe=Array.from(e.shadowRoot.childNodes);j<Pe.length;j++){var Xt=Pe[j],Xe=Rn(Xt,yt);Xe&&(ar(e.shadowRoot)&&(Xe.isShadow=!0),Q.childNodes.push(Xe))}}return e.parentNode&&or(e.parentNode)&&ar(e.parentNode)&&(Q.isShadow=!0),Q.type===be.Element&&Q.tagName==="iframe"&&yh(e,function(){var ee=e.contentDocument;if(ee&&S){var Ce=Rn(ee,{doc:ee,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:E,preserveWhiteSpace:ie,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:T,onStylesheetLoad:A,stylesheetLoadTimeout:k,keepIframeSrcFn:R});Ce&&S(e,Ce)}},T),Q.type===be.Element&&Q.tagName==="link"&&Q.attributes.rel==="stylesheet"&&_h(e,function(){if(A){var ee=Rn(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:E,preserveWhiteSpace:ie,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:T,onStylesheetLoad:A,stylesheetLoadTimeout:k,keepIframeSrcFn:R});ee&&A(e,ee)}},k),Q}function Ih(e,t){var n=t||{},r=n.mirror,i=r===void 0?new tc:r,o=n.blockClass,a=o===void 0?"rr-block":o,s=n.blockSelector,l=s===void 0?null:s,u=n.maskTextClass,c=u===void 0?"rr-mask":u,d=n.maskTextSelector,p=d===void 0?null:d,f=n.inlineStylesheet,h=f===void 0?!0:f,m=n.inlineImages,g=m===void 0?!1:m,b=n.recordCanvas,y=b===void 0?!1:b,_=n.maskAllInputs,v=_===void 0?!1:_,w=n.maskTextFn,E=n.maskInputFn,I=n.slimDOM,S=I===void 0?!1:I,x=n.dataURLOptions,T=n.preserveWhiteSpace,A=n.onSerialize,L=n.onIframeLoad,k=n.iframeLoadTimeout,U=n.onStylesheetLoad,R=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,K=V===void 0?function(){return!1}:V,z=v===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:v===!1?{password:!0}:v,ie=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S;return Rn(e,{doc:e,mirror:i,blockClass:a,blockSelector:l,maskTextClass:c,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:z,maskTextFn:w,maskInputFn:E,slimDOMOptions:ie,dataURLOptions:x,inlineImages:g,recordCanvas:y,preserveWhiteSpace:T,onSerialize:A,onIframeLoad:L,iframeLoadTimeout:k,onStylesheetLoad:U,stylesheetLoadTimeout:R,keepIframeSrcFn:K,newlyAddedElement:!1})}function Oe(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const xn=`Please stop import mirror directly. Instead of that,\r
1
+ "use strict";var Tf=Object.defineProperty;var Rf=(e,t,n)=>t in e?Tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ce=(e,t,n)=>(Rf(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Lf=Object.create,il=Object.defineProperty,Of=Object.getOwnPropertyDescriptor,Nf=Object.getOwnPropertyNames,Uf=Object.getPrototypeOf,Df=Object.prototype.hasOwnProperty,yr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nf(t))!Df.call(e,i)&&i!==n&&il(e,i,{get:()=>t[i],enumerable:!(r=Of(t,i))||r.enumerable});return e},Mf=(e,t,n)=>(n=e!=null?Lf(Uf(e)):{},Pf(t||!e||!e.__esModule?il(n,"default",{value:e,enumerable:!0}):n,e)),Ff=yr((e,t)=>{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n={},t.exports=n}),Vf=yr((e,t)=>{t.exports=r;var n=Object.prototype.toString;function r(i){if(!i)return!1;var o=n.call(i);return o==="[object Function]"||typeof i=="function"&&o!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}}),Bf=yr((e,t)=>{var n=function(i){return i.replace(/^\s+|\s+$/g,"")},r=function(i){return Object.prototype.toString.call(i)==="[object Array]"};t.exports=function(i){if(!i)return{};for(var o={},a=n(i).split(`
2
+ `),s=0;s<a.length;s++){var u=a[s],c=u.indexOf(":"),l=n(u.slice(0,c)).toLowerCase(),d=n(u.slice(c+1));typeof o[l]>"u"?o[l]=d:r(o[l])?o[l].push(d):o[l]=[o[l],d]}return o}}),Kf=yr((e,t)=>{t.exports=r;var n=Object.prototype.hasOwnProperty;function r(){for(var i={},o=0;o<arguments.length;o++){var a=arguments[o];for(var s in a)n.call(a,s)&&(i[s]=a[s])}return i}}),Hf=yr((e,t)=>{var n=Ff(),r=Vf(),i=Bf(),o=Kf();t.exports=c,t.exports.default=c,c.XMLHttpRequest=n.XMLHttpRequest||p,c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:n.XDomainRequest,a(["get","put","post","patch","head","delete"],function(f){c[f==="delete"?"del":f]=function(h,m,g){return m=u(h,m,g),m.method=f.toUpperCase(),l(m)}});function a(f,h){for(var m=0;m<f.length;m++)h(f[m])}function s(f){for(var h in f)if(f.hasOwnProperty(h))return!1;return!0}function u(f,h,m){var g=f;return r(h)?(m=h,typeof f=="string"&&(g={uri:f})):g=o(h,{uri:f}),g.callback=m,g}function c(f,h,m){return h=u(f,h,m),l(h)}function l(f){if(typeof f.callback>"u")throw new Error("callback argument missing");var h=!1,m=function(A,U,W){h||(h=!0,f.callback(A,U,W))};function g(){b.readyState===4&&setTimeout(v,0)}function w(){var A=void 0;if(b.response?A=b.response:A=b.responseText||d(b),F)try{A=JSON.parse(A)}catch{}return A}function y(A){return clearTimeout(P),A instanceof Error||(A=new Error(""+(A||"Unknown XMLHttpRequest Error"))),A.statusCode=0,m(A,T)}function v(){if(!C){var A;clearTimeout(P),f.useXDR&&b.status===void 0?A=200:A=b.status===1223?204:b.status;var U=T,W=null;return A!==0?(U={body:w(),statusCode:A,method:I,headers:{},url:k,rawRequest:b},b.getAllResponseHeaders&&(U.headers=i(b.getAllResponseHeaders()))):W=new Error("Internal XMLHttpRequest Error"),m(W,U,U.body)}}var b=f.xhr||null;b||(f.cors||f.useXDR?b=new c.XDomainRequest:b=new c.XMLHttpRequest);var _,C,k=b.url=f.uri||f.url,I=b.method=f.method||"GET",E=f.body||f.data,x=b.headers=f.headers||{},N=!!f.sync,F=!1,P,T={body:void 0,headers:{},statusCode:0,method:I,url:k,rawRequest:b};if("json"in f&&f.json!==!1&&(F=!0,x.accept||x.Accept||(x.Accept="application/json"),I!=="GET"&&I!=="HEAD"&&(x["content-type"]||x["Content-Type"]||(x["Content-Type"]="application/json"),E=JSON.stringify(f.json===!0?E:f.json))),b.onreadystatechange=g,b.onload=v,b.onerror=y,b.onprogress=function(){},b.onabort=function(){C=!0},b.ontimeout=y,b.open(I,k,!N,f.username,f.password),N||(b.withCredentials=!!f.withCredentials),!N&&f.timeout>0&&(P=setTimeout(function(){if(!C){C=!0,b.abort("timeout");var A=new Error("XMLHttpRequest timeout");A.code="ETIMEDOUT",y(A)}},f.timeout)),b.setRequestHeader)for(_ in x)x.hasOwnProperty(_)&&b.setRequestHeader(_,x[_]);else if(f.headers&&!s(f.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in f&&(b.responseType=f.responseType),"beforeSend"in f&&typeof f.beforeSend=="function"&&f.beforeSend(b),b.send(E||null),b}function d(f){try{if(f.responseType==="document")return f.responseXML;var h=f.responseXML&&f.responseXML.documentElement.nodeName==="parsererror";if(f.responseType===""&&!h)return f.responseXML}catch{}return null}function p(){}});function ba(e,t,...n){if(!e)throw new TypeError(ol(t,n))}function ol(e,t){let n=0;return e.replace(/%[os]/gu,()=>al(t[n++]))}function al(e){return typeof e!="object"||e===null?String(e):Object.prototype.toString.call(e)}var jf;function Gf(e){try{let t=e instanceof Error?e:new Error(al(e));if(typeof dispatchEvent=="function"&&typeof ErrorEvent=="function")dispatchEvent(new ErrorEvent("error",{error:t,message:t.message}));else if(typeof process<"u"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)}catch{}}var et=typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:typeof globalThis<"u"?globalThis:void 0,zf,kt=class{constructor(e,t){this.code=e,this.message=t}warn(...e){var t;try{let n=((t=new Error().stack)!==null&&t!==void 0?t:"").replace(/^(?:.+?\n){2}/gu,`
3
+ `);console.warn(this.message,...e,n)}catch{}}},Wf=new kt("W01","Unable to initialize event under dispatching."),qf=new kt("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),$f=new kt("W03","Assigning any truthy value to 'returnValue' property has no effect."),Yf=new kt("W04","Unable to preventDefault on non-cancelable events."),Zf=new kt("W05","Unable to preventDefault inside passive event listener invocation."),Qf=new kt("W06","An event listener wasn't added because it has been added already: %o, %o"),Zi=new kt("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),gs=new kt("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o");new kt("W09","Event attribute handler must be a function: %o");var At=class{static get NONE(){return vs}static get CAPTURING_PHASE(){return ys}static get AT_TARGET(){return _s}static get BUBBLING_PHASE(){return bs}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let n=t!=null?t:{};Co.set(this,{type:String(e),bubbles:Boolean(n.bubbles),cancelable:Boolean(n.cancelable),composed:Boolean(n.composed),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return fe(this).type}get target(){return fe(this).target}get srcElement(){return fe(this).target}get currentTarget(){return fe(this).currentTarget}composedPath(){let e=fe(this).currentTarget;return e?[e]:[]}get NONE(){return vs}get CAPTURING_PHASE(){return ys}get AT_TARGET(){return _s}get BUBBLING_PHASE(){return bs}get eventPhase(){return fe(this).dispatchFlag?2:0}stopPropagation(){fe(this).stopPropagationFlag=!0}get cancelBubble(){return fe(this).stopPropagationFlag}set cancelBubble(e){e?fe(this).stopPropagationFlag=!0:qf.warn()}stopImmediatePropagation(){let e=fe(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return fe(this).bubbles}get cancelable(){return fe(this).cancelable}get returnValue(){return!fe(this).canceledFlag}set returnValue(e){e?$f.warn():ws(fe(this))}preventDefault(){ws(fe(this))}get defaultPrevented(){return fe(this).canceledFlag}get composed(){return fe(this).composed}get isTrusted(){return!1}get timeStamp(){return fe(this).timeStamp}initEvent(e,t=!1,n=!1){let r=fe(this);if(r.dispatchFlag){Wf.warn();return}Co.set(this,{...r,type:String(e),bubbles:Boolean(t),cancelable:Boolean(n),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}},vs=0,ys=1,_s=2,bs=3,Co=new WeakMap;function fe(e,t="this"){let n=Co.get(e);return ba(n!=null,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),n}function ws(e){if(e.inPassiveListenerFlag){Zf.warn();return}if(!e.cancelable){Yf.warn();return}e.canceledFlag=!0}Object.defineProperty(At,"NONE",{enumerable:!0});Object.defineProperty(At,"CAPTURING_PHASE",{enumerable:!0});Object.defineProperty(At,"AT_TARGET",{enumerable:!0});Object.defineProperty(At,"BUBBLING_PHASE",{enumerable:!0});var Qi=Object.getOwnPropertyNames(At.prototype);for(let e=0;e<Qi.length;++e)Qi[e]!=="constructor"&&Object.defineProperty(At.prototype,Qi[e],{enumerable:!0});typeof et<"u"&&typeof et.Event<"u"&&Object.setPrototypeOf(At.prototype,et.Event.prototype);function Jf(e){return et.DOMException?new et.DOMException(e,"InvalidStateError"):(pn==null&&(pn=class sl extends Error{constructor(n){super(n),Error.captureStackTrace&&Error.captureStackTrace(this,sl)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(pn.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),Is(pn),Is(pn.prototype)),new pn(e))}var pn,Ss={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function Is(e){let t=Object.keys(Ss);for(let n=0;n<t.length;++n){let r=t[n],i=Ss[r];Object.defineProperty(e,r,{get(){return i},configurable:!0,enumerable:!0})}}var Ni=class extends At{static wrap(e){return new(ll(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),ul.set(this,{original:e});let t=Object.keys(e);for(let n=0;n<t.length;++n){let r=t[n];r in this||Object.defineProperty(this,r,cl(e,r))}}stopPropagation(){super.stopPropagation();let{original:e}=Rt(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;let{original:t}=Rt(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();let{original:e}=Rt(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;let{original:t}=Rt(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();let{original:e}=Rt(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){let{original:e}=Rt(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}},ul=new WeakMap;function Rt(e){let t=ul.get(e);return ba(t!=null,"'this' is expected an Event object, but got",e),t}var ai=new WeakMap;ai.set(Object.prototype,Ni);typeof et<"u"&&typeof et.Event<"u"&&ai.set(et.Event.prototype,Ni);function ll(e){let t=Object.getPrototypeOf(e);if(t==null)return Ni;let n=ai.get(t);return n==null&&(n=Xf(ll(t),t),ai.set(t,n)),n}function Xf(e,t){class n extends e{}let r=Object.keys(t);for(let i=0;i<r.length;++i)Object.defineProperty(n.prototype,r[i],cl(t,r[i]));return n}function cl(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return{get(){let r=Rt(this).original,i=r[t];return typeof i=="function"?i.bind(r):i},set(r){let i=Rt(this).original;i[t]=r},configurable:n.configurable,enumerable:n.enumerable}}function ep(e,t,n,r,i,o){return{callback:e,flags:(t?1:0)|(n?2:0)|(r?4:0),signal:i,signalListener:o}}function tp(e){e.flags|=8}function dl(e){return(e.flags&1)===1}function fl(e){return(e.flags&2)===2}function pl(e){return(e.flags&4)===4}function np(e){return(e.flags&8)===8}function rp({callback:e},t,n){try{typeof e=="function"?e.call(t,n):typeof e.handleEvent=="function"&&e.handleEvent(n)}catch(r){Gf(r)}}function hl({listeners:e},t,n){for(let r=0;r<e.length;++r)if(e[r].callback===t&&dl(e[r])===n)return r;return-1}function ip(e,t,n,r,i,o){let a;o&&(a=ml.bind(null,e,t,n),o.addEventListener("abort",a));let s=ep(t,n,r,i,o,a);return e.cow?(e.cow=!1,e.listeners=[...e.listeners,s]):e.listeners.push(s),s}function ml(e,t,n){let r=hl(e,t,n);return r!==-1?gl(e,r):!1}function gl(e,t,n=!1){let r=e.listeners[t];return tp(r),r.signal&&r.signal.removeEventListener("abort",r.signalListener),e.cow&&!n?(e.cow=!1,e.listeners=e.listeners.filter((i,o)=>o!==t),!1):(e.listeners.splice(t,1),!0)}function op(){return Object.create(null)}function ap(e,t){var n;return(n=e[t])!==null&&n!==void 0?n:e[t]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}var Ui=class{constructor(){vl.set(this,op())}addEventListener(e,t,n){let r=Ji(this),{callback:i,capture:o,once:a,passive:s,signal:u,type:c}=sp(e,t,n);if(i==null||(u==null?void 0:u.aborted))return;let l=ap(r,c),d=hl(l,i,o);if(d!==-1){lp(l.listeners[d],s,a,u);return}ip(l,i,o,s,a,u)}removeEventListener(e,t,n){let r=Ji(this),{callback:i,capture:o,type:a}=up(e,t,n),s=r[a];i!=null&&s&&ml(s,i,o)}dispatchEvent(e){let t=Ji(this)[String(e.type)];if(t==null)return!0;let n=e instanceof At?e:Ni.wrap(e),r=fe(n,"event");if(r.dispatchFlag)throw Jf("This event has been in dispatching.");if(r.dispatchFlag=!0,r.target=r.currentTarget=this,!r.stopPropagationFlag){let{cow:i,listeners:o}=t;t.cow=!0;for(let a=0;a<o.length;++a){let s=o[a];if(!np(s)&&(pl(s)&&gl(t,a,!i)&&(a-=1),r.inPassiveListenerFlag=fl(s),rp(s,this,n),r.inPassiveListenerFlag=!1,r.stopImmediatePropagationFlag))break}i||(t.cow=!1)}return r.target=null,r.currentTarget=null,r.stopImmediatePropagationFlag=!1,r.stopPropagationFlag=!1,r.dispatchFlag=!1,!r.canceledFlag}},vl=new WeakMap;function Ji(e,t="this"){let n=vl.get(e);return ba(n!=null,"'%s' must be an object that EventTarget constructor created, but got another one: %o",t,e),n}function sp(e,t,n){var r;return yl(t),typeof n=="object"&&n!==null?{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n.capture),passive:Boolean(n.passive),once:Boolean(n.once),signal:(r=n.signal)!==null&&r!==void 0?r:void 0}:{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n),passive:!1,once:!1,signal:void 0}}function up(e,t,n){return yl(t),typeof n=="object"&&n!==null?{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n.capture)}:{type:String(e),callback:t!=null?t:void 0,capture:Boolean(n)}}function yl(e){if(!(typeof e=="function"||typeof e=="object"&&e!==null&&typeof e.handleEvent=="function")){if(e==null||typeof e=="object"){gs.warn(e);return}throw new TypeError(ol(gs.message,[e]))}}function lp(e,t,n,r){Qf.warn(dl(e)?"capture":"bubble",e.callback),fl(e)!==t&&Zi.warn("passive"),pl(e)!==n&&Zi.warn("once"),e.signal!==r&&Zi.warn("signal")}var Xi=Object.getOwnPropertyNames(Ui.prototype);for(let e=0;e<Xi.length;++e)Xi[e]!=="constructor"&&Object.defineProperty(Ui.prototype,Xi[e],{enumerable:!0});typeof et<"u"&&typeof et.EventTarget<"u"&&Object.setPrototypeOf(Ui.prototype,et.EventTarget.prototype);var cp=Mf(Hf()),_l=30720,Di=512e3,Pi=256,Eo=(e,{minChunkSize:t=Pi,maxChunkSize:n=Di}={})=>e==null||typeof e=="number"&&e>=256&&e%256===0&&e>=t&&e<=n,ko=(e,{minChunkSize:t=Pi,maxChunkSize:n=Di}={})=>new TypeError(`chunkSize ${e} must be a positive number in multiples of 256, between ${t} and ${n}`),dp=class{constructor(e,t={}){this.readableStream=e;var n,r,i;if(!Eo(t.defaultChunkSize,t))throw ko(t.defaultChunkSize,t);this.defaultChunkSize=(n=t.defaultChunkSize)!=null?n:_l,this.minChunkSize=(r=t.minChunkSize)!=null?r:Pi,this.maxChunkSize=(i=t.maxChunkSize)!=null?i:Di}get chunkSize(){var e;return(e=this._chunkSize)!=null?e:this.defaultChunkSize}set chunkSize(e){if(!Eo(e,this))throw ko(e,this);this._chunkSize=e}get chunkByteSize(){return this.chunkSize*1024}async*[Symbol.asyncIterator](){let e,t=this.readableStream.getReader();try{for(;;){let{done:n,value:r}=await t.read();if(n){if(e){let o=e;e=void 0,yield o}break}let i=r instanceof Uint8Array?new Blob([r],{type:"application/octet-stream"}):r;for(e=e?new Blob([e,i]):i;e;)if(e.size===this.chunkByteSize){let o=e;e=void 0,yield o;break}else{if(e.size<this.chunkByteSize)break;{let o=e.slice(0,this.chunkByteSize);e=e.slice(this.chunkByteSize),yield o}}}}finally{if(e){let n=e;e=void 0,yield n}t.releaseLock();return}}},fp=[200,201,202,204,308],bl=[408,502,503,504],wl=(e,t)=>!!e&&fp.includes(e.statusCode),pp=(e,{retryCodes:t=bl})=>!e||t.includes(e.statusCode),hp=(e,t)=>t.attemptCount>=t.attempts||!(wl(e)||pp(e,t)),Sl=class{static createUpload(e){return new Sl(e)}constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.headers=e.headers||{},this.method=e.method||"PUT",this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.retryCodes=e.retryCodes||bl,this.dynamicChunkSize=e.dynamicChunkSize||!1,this.maxFileBytes=(e.maxFileSize||0)*1024,this.chunkCount=0,this.attemptCount=0,this.offline=!1,this._paused=!1,this.success=!1,this.nextChunkRangeStart=0,this.chunkedStreamIterable=new dp(this.file.stream(),{...e,defaultChunkSize:e.chunkSize}),this.chunkedStreamIterator=this.chunkedStreamIterable[Symbol.asyncIterator](),this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.eventTarget=new Ui,this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{!this.offline||(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}get maxChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.maxChunkSize)!=null?t:Di}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:Pi}get chunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.chunkSize)!=null?t:_l}set chunkSize(e){this.chunkedStreamIterable.chunkSize=e}get chunkByteSize(){return this.chunkedStreamIterable.chunkByteSize}get totalChunkSize(){return Math.ceil(this.file.size/this.chunkByteSize)}on(e,t){this.eventTarget.addEventListener(e,t)}once(e,t){this.eventTarget.addEventListener(e,t,{once:!0})}off(e,t){this.eventTarget.removeEventListener(e,t)}get paused(){return this._paused}abort(){var e;this.pause(),(e=this.currentXhr)==null||e.abort()}pause(){this._paused=!0}resume(){this._paused&&(this._paused=!1,this.sendChunks())}dispatch(e,t){let n=new CustomEvent(e,{detail:t});this.eventTarget.dispatchEvent(n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint must be defined as a string or a function that returns a promise");if(!(this.file instanceof File))throw new TypeError("file must be a File object");if(this.headers&&typeof this.headers!="function"&&typeof this.headers!="object")throw new TypeError("headers must be null, an object, or a function that returns an object or a promise");if(!Eo(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize}))throw ko(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize});if(this.maxChunkSize&&(typeof this.maxChunkSize!="number"||this.maxChunkSize<256||this.maxChunkSize%256!==0||this.maxChunkSize<this.chunkSize||this.maxChunkSize<this.minChunkSize))throw new TypeError(`maxChunkSize must be a positive number in multiples of 256, and larger than or equal to both ${this.minChunkSize} and ${this.chunkSize}`);if(this.minChunkSize&&(typeof this.minChunkSize!="number"||this.minChunkSize<256||this.minChunkSize%256!==0||this.minChunkSize>this.chunkSize||this.minChunkSize>this.maxChunkSize))throw new TypeError(`minChunkSize must be a positive number in multiples of 256, and smaller than ${this.chunkSize} and ${this.maxChunkSize}`);if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`file size exceeds maximum (${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("retries must be a positive number");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("delayBeforeAttempt must be a positive number")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(e=>(this.endpointValue=e,this.endpointValue))}xhrPromise(e){let t=n=>{n.upload.onprogress=r=>{var i;let o=this.totalChunks-this.chunkCount,a=(this.file.size-this.nextChunkRangeStart)/this.file.size/o,s=this.nextChunkRangeStart/this.file.size,u=r.loaded/((i=r.total)!=null?i:this.chunkByteSize)*a;this.dispatch("progress",Math.min((s+u)*100,100))}};return new Promise((n,r)=>{this.currentXhr=(0,cp.default)({...e,beforeSend:t},(i,o)=>(this.currentXhr=void 0,i?r(i):n(o)))})}async sendChunk(e){let t=this.nextChunkRangeStart,n=t+e.size-1,r={...await(typeof this.headers=="function"?this.headers():this.headers),"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${this.file.size}`};return this.dispatch("attempt",{chunkNumber:this.chunkCount,totalChunks:this.totalChunks,chunkSize:this.chunkSize}),this.xhrPromise({headers:r,url:this.endpointValue,method:this.method,body:e})}async sendChunkWithRetries(e){let t=async(a,s)=>{var u;let c=(new Date().getTime()-this.lastChunkStart.getTime())/1e3;if(this.dispatch("chunkSuccess",{chunk:this.chunkCount,chunkSize:this.chunkSize,attempts:this.attemptCount,timeInterval:c,response:a}),this.attemptCount=0,this.chunkCount=((u=this.chunkCount)!=null?u:0)+1,this.nextChunkRangeStart=this.nextChunkRangeStart+this.chunkByteSize,this.dynamicChunkSize){let l=this.chunkSize;c<10?l=Math.min(this.chunkSize*2,this.maxChunkSize):c>30&&(l=Math.max(this.chunkSize/2,this.minChunkSize)),this.chunkSize=Math.ceil(l/256)*256;let d=(this.file.size-this.nextChunkRangeStart)/this.chunkByteSize;this.totalChunks=Math.ceil(this.chunkCount+d)}return!0},n=async(a,s)=>(this.dispatch("error",{message:`Server responded with ${a.statusCode}. Stopping upload.`,chunk:this.chunkCount,attempts:this.attemptCount}),!1),r=async(a,s)=>(this.dispatch("attemptFailure",{message:`An error occured uploading chunk ${this.chunkCount}. ${this.attempts-this.attemptCount} retries left.`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount}),new Promise(u=>{setTimeout(async()=>{if(this._paused||this.offline){this.pendingChunk=e,u(!1);return}let c=await this.sendChunkWithRetries(e);u(c)},this.delayBeforeAttempt*1e3)})),i;try{this.attemptCount=this.attemptCount+1,this.lastChunkStart=new Date,i=await this.sendChunk(e)}catch{}let o={retryCodes:this.retryCodes,attemptCount:this.attemptCount,attempts:this.attempts};return wl(i)?t(i):hp(i,o)?n(i):r()}async sendChunks(){if(this.pendingChunk&&!(this._paused||this.offline)){let e=this.pendingChunk;this.pendingChunk=void 0;let t=await this.sendChunkWithRetries(e);this.success&&t&&this.dispatch("success")}for(;!(this.success||this._paused||this.offline);){let{value:e,done:t}=await this.chunkedStreamIterator.next(),n=!e&&t;if(e&&(n=await this.sendChunkWithRetries(e)),this.success=!!t,this.success&&n&&this.dispatch("success"),!n)return}}},mp=Sl.createUpload,ye;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(ye||(ye={}));function gp(e){return e.nodeType===e.ELEMENT_NODE}function Zn(e){var t=e==null?void 0:e.host;return Boolean((t==null?void 0:t.shadowRoot)===e)}function Qn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function vp(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function yp(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return e.layerName===""?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function si(e){try{var t=e.rules||e.cssRules;return t?vp(Array.from(t).map(Il).join("")):null}catch{return null}}function Il(e){var t;if(bp(e))try{t=si(e.styleSheet)||yp(e)}catch{}return _p(t||e.cssText)}function _p(e){if(e.includes(":")){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}function bp(e){return"styleSheet"in e}var Cl=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r!=null?r:-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(i){return n.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function wp(){return new Cl}function wa(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,a=e.maskInputFn,s=o||"",u=i&&nn(i);return(n[r.toLowerCase()]||u&&n[u])&&(a?s=a(s,t):s="*".repeat(s.length)),s}function nn(e){return e.toLowerCase()}var Cs="__rrweb_original__";function Sp(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var o=t.getImageData,a=Cs in o?o[Cs]:o,s=new Uint32Array(a.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer);if(s.some(function(u){return u!==0}))return!1}return!0}function Sa(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?nn(t):null}var Ip=1,Cp=new RegExp("[^a-z0-9-_:]"),ar=-2;function El(){return Ip++}function Ep(e){if(e instanceof HTMLFormElement)return"form";var t=nn(e.tagName);return Cp.test(t)?"div":t}function kp(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var hn,Es,Ap=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xp=/^(?:[a-z+]+:)?\/\//i,Tp=/^www\..*/i,Rp=/^(data:)([^,]*),(.*)/i;function ui(e,t){return(e||"").replace(Ap,function(n,r,i,o,a,s){var u=i||a||s,c=r||o||"";if(!u)return n;if(xp.test(u)||Tp.test(u)||Rp.test(u))return"url(".concat(c).concat(u).concat(c,")");if(u[0]==="/")return"url(".concat(c).concat(kp(t)+u).concat(c,")");var l=t.split("/"),d=u.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];h!=="."&&(h===".."?l.pop():l.push(h))}return"url(".concat(c).concat(l.join("/")).concat(c,")")})}var Lp=/^[^ \t\n\r\u000c]+/,Op=/^[, \t\n\r\u000c]+/;function Np(e,t){if(t.trim()==="")return t;var n=0;function r(c){var l,d=c.exec(t.substring(n));return d?(l=d[0],n+=l.length,l):""}for(var i=[];r(Op),!(n>=t.length);){var o=r(Lp);if(o.slice(-1)===",")o=bn(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=bn(e,o);for(var s=!1;;){var u=t.charAt(n);if(u===""){i.push((o+a).trim());break}else if(s)u===")"&&(s=!1);else if(u===","){n+=1,i.push((o+a).trim());break}else u==="("&&(s=!0);a+=u,n+=1}}}return i.join(", ")}function bn(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function Up(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Ia(){var e=document.createElement("a");return e.href="",e.href}function kl(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?bn(e,r):n==="srcset"?Np(e,r):n==="style"?ui(r,Ia()):t==="object"&&n==="data"?bn(e,r):r)}function Al(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function Dp(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function li(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?li(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return n?li(e.parentNode,t,n):!1}function xl(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(li(r,t,!0))return!0;if(n&&(r.matches(n)||r.closest(n)))return!0}catch{}return!1}function Pp(e,t,n){var r=e.contentWindow;if(!!r){var i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){var a=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(a),i=!0,t()});return}var s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Mp(e,t,n){var r=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(o),r=!0,t()})}}function Fp(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,u=t.inlineStylesheet,c=t.maskInputOptions,l=c===void 0?{}:c,d=t.maskTextFn,p=t.maskInputFn,f=t.dataURLOptions,h=f===void 0?{}:f,m=t.inlineImages,g=t.recordCanvas,w=t.keepIframeSrcFn,y=t.newlyAddedElement,v=y===void 0?!1:y,b=Vp(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ye.Document,childNodes:[],compatMode:e.compatMode}:{type:ye.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ye.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Kp(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:u,maskInputOptions:l,maskInputFn:p,dataURLOptions:h,inlineImages:m,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:v,rootId:b});case e.TEXT_NODE:return Bp(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:b});case e.CDATA_SECTION_NODE:return{type:ye.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:ye.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function Vp(e,t){if(!!t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Bp(e,t){var n,r=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,a=t.rootId,s=e.parentNode&&e.parentNode.tagName,u=e.textContent,c=s==="STYLE"?!0:void 0,l=s==="SCRIPT"?!0:void 0;if(c&&u){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(u=si(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}u=ui(u,Ia())}return l&&(u="SCRIPT_PLACEHOLDER"),!c&&!l&&u&&xl(e,r,i)&&(u=o?o(u):u.replace(/[\S]/g,"*")),{type:ye.Text,textContent:u||"",isStyle:c,rootId:a}}function Kp(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,a=t.maskInputOptions,s=a===void 0?{}:a,u=t.maskInputFn,c=t.dataURLOptions,l=c===void 0?{}:c,d=t.inlineImages,p=t.recordCanvas,f=t.keepIframeSrcFn,h=t.newlyAddedElement,m=h===void 0?!1:h,g=t.rootId,w=Dp(e,r,i),y=Ep(e),v={},b=e.attributes.length,_=0;_<b;_++){var C=e.attributes[_];Al(y,C.name,C.value)||(v[C.name]=kl(n,y,nn(C.name),C.value))}if(y==="link"&&o){var k=Array.from(n.styleSheets).find(function(ce){return ce.href===e.href}),I=null;k&&(I=si(k)),I&&(delete v.rel,delete v.href,v._cssText=ui(I,k.href))}if(y==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var I=si(e.sheet);I&&(v._cssText=ui(I,Ia()))}if(y==="input"||y==="textarea"||y==="select"){var E=e.value,x=e.checked;if(v.type!=="radio"&&v.type!=="checkbox"&&v.type!=="submit"&&v.type!=="button"&&E){var N=Sa(e);v.value=wa({element:e,type:N,tagName:y,value:E,maskInputOptions:s,maskInputFn:u})}else x&&(v.checked=x)}if(y==="option"&&(e.selected&&!s.select?v.selected=!0:delete v.selected),y==="canvas"&&p){if(e.__context==="2d")Sp(e)||(v.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){var F=e.toDataURL(l.type,l.quality),P=document.createElement("canvas");P.width=e.width,P.height=e.height;var T=P.toDataURL(l.type,l.quality);F!==T&&(v.rr_dataURL=F)}}if(y==="img"&&d){hn||(hn=n.createElement("canvas"),Es=hn.getContext("2d"));var A=e,U=A.crossOrigin;A.crossOrigin="anonymous";var W=function(){A.removeEventListener("load",W);try{hn.width=A.naturalWidth,hn.height=A.naturalHeight,Es.drawImage(A,0,0),v.rr_dataURL=hn.toDataURL(l.type,l.quality)}catch(ce){console.warn("Cannot inline img src=".concat(A.currentSrc,"! Error: ").concat(ce))}U?v.crossOrigin=U:A.removeAttribute("crossorigin")};A.complete&&A.naturalWidth!==0?W():A.addEventListener("load",W)}if((y==="audio"||y==="video")&&(v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop)),w){var se=e.getBoundingClientRect(),J=se.width,ne=se.height;v={class:v.class,rr_width:"".concat(J,"px"),rr_height:"".concat(ne,"px")}}return y==="iframe"&&!f(v.src)&&(e.contentDocument||(v.rr_src=v.src),delete v.src),{type:ye.Element,tagName:y,attributes:v,childNodes:[],isSVG:Up(e)||void 0,needBlock:w,rootId:g}}function te(e){return e==null?"":e.toLowerCase()}function Hp(e,t){if(t.comment&&e.type===ye.Comment)return!0;if(e.type===ye.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||te(e.attributes.name)==="application-name"||te(e.attributes.rel)==="icon"||te(e.attributes.rel)==="apple-touch-icon"||te(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||te(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(te(e.attributes.name)==="robots"||te(e.attributes.name)==="googlebot"||te(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(te(e.attributes.name)==="author"||te(e.attributes.name)==="generator"||te(e.attributes.name)==="framework"||te(e.attributes.name)==="publisher"||te(e.attributes.name)==="progid"||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(te(e.attributes.name)==="google-site-verification"||te(e.attributes.name)==="yandex-verification"||te(e.attributes.name)==="csrf-token"||te(e.attributes.name)==="p:domain_verify"||te(e.attributes.name)==="verify-v1"||te(e.attributes.name)==="verification"||te(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function wn(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,c=u===void 0?!1:u,l=t.inlineStylesheet,d=l===void 0?!0:l,p=t.maskInputOptions,f=p===void 0?{}:p,h=t.maskTextFn,m=t.maskInputFn,g=t.slimDOMOptions,w=t.dataURLOptions,y=w===void 0?{}:w,v=t.inlineImages,b=v===void 0?!1:v,_=t.recordCanvas,C=_===void 0?!1:_,k=t.onSerialize,I=t.onIframeLoad,E=t.iframeLoadTimeout,x=E===void 0?5e3:E,N=t.onStylesheetLoad,F=t.stylesheetLoadTimeout,P=F===void 0?5e3:F,T=t.keepIframeSrcFn,A=T===void 0?function(){return!1}:T,U=t.newlyAddedElement,W=U===void 0?!1:U,se=t.preserveWhiteSpace,J=se===void 0?!0:se,ne=Fp(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,dataURLOptions:y,inlineImages:b,recordCanvas:C,keepIframeSrcFn:A,newlyAddedElement:W});if(!ne)return console.warn(e,"not serialized"),null;var ce;r.hasNode(e)?ce=r.getId(e):Hp(ne,g)||!J&&ne.type===ye.Text&&!ne.isStyle&&!ne.textContent.replace(/^\s+|\s+$/gm,"").length?ce=ar:ce=El();var q=Object.assign(ne,{id:ce});if(r.add(e,q),ce===ar)return null;k&&k(e);var Ke=!c;if(q.type===ye.Element){Ke=Ke&&!q.needBlock,delete q.needBlock;var Se=e.shadowRoot;Se&&Qn(Se)&&(q.isShadowHost=!0)}if((q.type===ye.Document||q.type===ye.Element)&&Ke){g.headWhitespace&&q.type===ye.Element&&q.tagName==="head"&&(J=!1);for(var dt={doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:C,preserveWhiteSpace:J,onSerialize:k,onIframeLoad:I,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:P,keepIframeSrcFn:A},De=0,it=Array.from(e.childNodes);De<it.length;De++){var Ht=it[De],Ze=wn(Ht,dt);Ze&&q.childNodes.push(Ze)}if(gp(e)&&e.shadowRoot)for(var B=0,Oe=Array.from(e.shadowRoot.childNodes);B<Oe.length;B++){var Ht=Oe[B],Ze=wn(Ht,dt);Ze&&(Qn(e.shadowRoot)&&(Ze.isShadow=!0),q.childNodes.push(Ze))}}return e.parentNode&&Zn(e.parentNode)&&Qn(e.parentNode)&&(q.isShadow=!0),q.type===ye.Element&&q.tagName==="iframe"&&Pp(e,function(){var Q=e.contentDocument;if(Q&&I){var be=wn(Q,{doc:Q,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:C,preserveWhiteSpace:J,onSerialize:k,onIframeLoad:I,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:P,keepIframeSrcFn:A});be&&I(e,be)}},x),q.type===ye.Element&&q.tagName==="link"&&q.attributes.rel==="stylesheet"&&Mp(e,function(){if(N){var Q=wn(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:b,recordCanvas:C,preserveWhiteSpace:J,onSerialize:k,onIframeLoad:I,iframeLoadTimeout:x,onStylesheetLoad:N,stylesheetLoadTimeout:P,keepIframeSrcFn:A});Q&&N(e,Q)}},P),q}function jp(e,t){var n=t||{},r=n.mirror,i=r===void 0?new Cl:r,o=n.blockClass,a=o===void 0?"rr-block":o,s=n.blockSelector,u=s===void 0?null:s,c=n.maskTextClass,l=c===void 0?"rr-mask":c,d=n.maskTextSelector,p=d===void 0?null:d,f=n.inlineStylesheet,h=f===void 0?!0:f,m=n.inlineImages,g=m===void 0?!1:m,w=n.recordCanvas,y=w===void 0?!1:w,v=n.maskAllInputs,b=v===void 0?!1:v,_=n.maskTextFn,C=n.maskInputFn,k=n.slimDOM,I=k===void 0?!1:k,E=n.dataURLOptions,x=n.preserveWhiteSpace,N=n.onSerialize,F=n.onIframeLoad,P=n.iframeLoadTimeout,T=n.onStylesheetLoad,A=n.stylesheetLoadTimeout,U=n.keepIframeSrcFn,W=U===void 0?function(){return!1}:U,se=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b===!1?{password:!0}:b,J=I===!0||I==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:I==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:I===!1?{}:I;return wn(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:se,maskTextFn:_,maskInputFn:C,slimDOMOptions:J,dataURLOptions:E,inlineImages:g,recordCanvas:y,preserveWhiteSpace:x,onSerialize:N,onIframeLoad:F,iframeLoadTimeout:P,onStylesheetLoad:T,stylesheetLoadTimeout:A,keepIframeSrcFn:W,newlyAddedElement:!1})}function xe(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const yn=`Please stop import mirror directly. Instead of that,\r
4
4
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
5
- or you can use record.mirror to access the mirror instance during recording.`;let $s={map:{},getId(){return console.error(xn),-1},getNode(){return console.error(xn),null},removeNodeFromMap(){console.error(xn)},has(){return console.error(xn),!1},reset(){console.error(xn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&($s=new Proxy($s,{get(e,t,n){return t==="map"&&console.error(xn),Reflect.get(e,t,n)}}));function gr(e,t,n={}){let r=null,i=0;return function(...o){const a=Date.now();!i&&n.leading===!1&&(i=a);const s=t-(a-i),l=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=a,e.apply(l,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(l,o)},s))}}function Yi(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>Yi(e,t,o||{},!0)}function Ar(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}let wi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(wi=()=>new Date().getTime());function ac(e){var t,n,r,i,o,a;const s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(s==null?void 0:s.documentElement.scrollLeft)||((n=(t=s==null?void 0:s.body)===null||t===void 0?void 0:t.parentElement)===null||n===void 0?void 0:n.scrollLeft)||((r=s==null?void 0:s.body)===null||r===void 0?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(s==null?void 0:s.documentElement.scrollTop)||((o=(i=s==null?void 0:s.body)===null||i===void 0?void 0:i.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=s==null?void 0:s.body)===null||a===void 0?void 0:a.scrollTop)||0}}function sc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function lc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ne(e,t,n,r){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(bi(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function kh(e,t){return t.getId(e)!==-1}function po(e,t){return t.getId(e)===mr}function uc(e,t){if(or(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?uc(e.parentNode,t):!0:!0}function qo(e){return Boolean(e.changedTouches)}function xh(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function cc(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function dc(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $o(e){return Boolean(e==null?void 0:e.shadowRoot)}class Ah{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!==null&&n!==void 0?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function fc(e){var t,n;let r=null;return((n=(t=e.getRootNode)===null||t===void 0?void 0:t.call(e))===null||n===void 0?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function Th(e){let t=e,n;for(;n=fc(t);)t=n;return t}function Rh(e){const t=e.ownerDocument;if(!t)return!1;const n=Th(e);return t.contains(n)}function pc(e){const t=e.ownerDocument;return t?t.contains(e)||Rh(e):!1}var X=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(X||{}),J=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(J||{}),Me=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Me||{}),bt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(bt||{}),Mn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Mn||{});function Ys(e){return"__ln"in e}class Lh{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Ys(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Ys(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Zs=(e,t)=>`${e}@${t}`;class Oh{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new Lh,i=l=>{let u=l,c=mr;for(;c===mr;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{if(!l.parentNode||!pc(l))return;const u=or(l.parentNode)?this.mirror.getId(fc(l)):this.mirror.getId(l.parentNode),c=i(l);if(u===-1||c===-1)return r.addNode(l);const d=Rn(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{cc(p,this.mirror)&&this.iframeManager.addIframe(p),dc(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),$o(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,f)=>{this.iframeManager.attachIframe(p,f),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,f)=>{this.stylesheetManager.attachLinkElement(p,f)}});d&&(t.push({parentId:u,nextId:c,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Qs(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of this.addedSet)!Js(this.droppedSet,l)&&!Qs(this.removes,l,this.mirror)||Js(this.movedSet,l)?o(l):this.droppedSet.add(l);let a=null;for(;r.length;){let l=null;if(a){const u=this.mirror.getId(a.value.parentNode),c=i(a.value);u!==-1&&c!==-1&&(l=a)}if(!l){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const d=this.mirror.getId(c.value.parentNode);if(i(c.value)===-1)continue;if(d!==-1){l=c;break}else{const f=c.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=f.parentNode.host;if(this.mirror.getId(h)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),o(l.value)}const s={texts:this.texts.map(l=>({id:this.mirror.getId(l.node),value:l.value})).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:u}=l;if(typeof u.style=="string"){const c=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(po(t.target,this.mirror))return;let n;try{n=document.implementation.createHTMLDocument()}catch{n=this.doc}switch(t.type){case"characterData":{const r=t.target.textContent;!Ne(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:oc(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let i=t.attributeName,o=t.target.getAttribute(i);if(i==="value"){const s=Ha(r);o=ja({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:o,maskInputFn:this.maskInputFn})}if(Ne(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;let a=this.attributes.find(s=>s.node===t.target);if(r.tagName==="IFRAME"&&i==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)i="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a)),i==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!ic(r.tagName,i)&&(a.attributes[i]=rc(this.doc,hn(r.tagName),hn(i),o),i==="style")){const s=n.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(const l of Array.from(r.style)){const u=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);u!==s.style.getPropertyValue(l)||c!==s.style.getPropertyPriority(l)?c===""?a.styleDiff[l]=u:a.styleDiff[l]=[u,c]:a._unchangedStyles[l]=[u,c]}for(const l of Array.from(s.style))r.style.getPropertyValue(l)===""&&(a.styleDiff[l]=!1)}break}case"childList":{if(Ne(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const i=this.mirror.getId(r),o=or(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Ne(t.target,this.blockClass,this.blockSelector,!1)||po(r,this.mirror)||!kh(r,this.mirror)||(this.addedSet.has(r)?(Yo(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&i===-1||uc(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Zs(i,o)]?Yo(this.movedSet,r):this.removes.push({parentId:o,id:i,isShadow:or(t.target)&&ar(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(po(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Zs(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ne(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(r=>this.genAdds(r)),$o(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yo(e,t){e.delete(t),t.childNodes.forEach(n=>Yo(e,n))}function Qs(e,t,n){return e.length===0?!1:hc(e,t,n)}function hc(e,t,n){const{parentNode:r}=t;if(!r)return!1;const i=n.getId(r);return e.some(o=>o.id===i)?!0:hc(e,r,n)}function Js(e,t){return e.size===0?!1:mc(e,t)}function mc(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:mc(e,n):!1}let sr;function Nh(e){sr=e}function Dh(){sr=void 0}const q=e=>sr?(...n)=>{try{return e(...n)}catch(r){if(sr&&sr(r)===!0)return;throw r}}:e,sn=[];function Tr(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function gc(e,t){var n,r;const i=new Oh;sn.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window==null?void 0:window.Zone)===null||n===void 0?void 0:n.__symbol__)===null||r===void 0?void 0:r.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);const s=new o(q(i.processMutations.bind(i)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Uh({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],s;const l=gr(q(d=>{const p=Date.now()-s;e(a.map(f=>(f.timeOffset-=p,f)),d),a=[],s=null}),o),u=q(gr(q(d=>{const p=Tr(d),{clientX:f,clientY:h}=qo(d)?d.changedTouches[0]:d;s||(s=wi()),a.push({x:f,y:h,id:r.getId(p),timeOffset:wi()-s}),l(typeof DragEvent<"u"&&d instanceof DragEvent?J.Drag:d instanceof MouseEvent?J.MouseMove:J.TouchMove)}),i,{trailing:!1})),c=[Oe("mousemove",u,n),Oe("touchmove",u,n),Oe("drag",u,n)];return q(()=>{c.forEach(d=>d())})}function Ph({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,s=[];let l=null;const u=c=>d=>{const p=Tr(d);if(Ne(p,r,i,!0))return;let f=null,h=c;if("pointerType"in d){switch(d.pointerType){case"mouse":f=bt.Mouse;break;case"touch":f=bt.Touch;break;case"pen":f=bt.Pen;break}f===bt.Touch?Me[c]===Me.MouseDown?h="TouchStart":Me[c]===Me.MouseUp&&(h="TouchEnd"):bt.Pen}else qo(d)&&(f=bt.Touch);f!==null?(l=f,(h.startsWith("Touch")&&f===bt.Touch||h.startsWith("Mouse")&&f===bt.Mouse)&&(f=null)):Me[c]===Me.Click&&(f=l,l=null);const m=qo(d)?d.changedTouches[0]:d;if(!m)return;const g=n.getId(p),{clientX:b,clientY:y}=m;q(e)(Object.assign({type:Me[h],id:g,x:b,y},f!==null&&{pointerType:f}))};return Object.keys(Me).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let d=hn(c);const p=u(c);if(window.PointerEvent)switch(Me[c]){case Me.MouseDown:case Me.MouseUp:d=d.replace("mouse","pointer");break;case Me.TouchStart:case Me.TouchEnd:return}s.push(Oe(d,p,t))}),q(()=>{s.forEach(c=>c())})}function vc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){const a=q(gr(q(s=>{const l=Tr(s);if(!l||Ne(l,r,i,!0))return;const u=n.getId(l);if(l===t&&t.defaultView){const c=ac(t.defaultView);e({id:u,x:c.left,y:c.top})}else e({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Oe("scroll",a,t)}function Mh({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const i=q(gr(q(()=>{const o=sc(),a=lc();(n!==o||r!==a)&&(e({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return Oe("resize",i,t)}function Xs(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Vh=["INPUT","TEXTAREA","SELECT"],el=new WeakMap;function Fh({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:s,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function d(y){let _=Tr(y);const v=y.isTrusted,w=_&&_.tagName;if(_&&w==="OPTION"&&(_=_.parentElement),!_||!w||Vh.indexOf(w)<0||Ne(_,r,i,!0)||_.classList.contains(o)||a&&_.matches(a))return;let E=_.value,I=!1;const S=Ha(_)||"";S==="radio"||S==="checkbox"?I=_.checked:(s[w.toLowerCase()]||s[S])&&(E=ja({element:_,maskInputOptions:s,tagName:w,type:S,value:E,maskInputFn:l})),p(_,q(Xs)({text:E,isChecked:I,userTriggered:v},c));const x=_.name;S==="radio"&&x&&I&&t.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(T=>{T!==_&&p(T,q(Xs)({text:T.value,isChecked:!I,userTriggered:!1},c))})}function p(y,_){const v=el.get(y);if(!v||v.text!==_.text||v.isChecked!==_.isChecked){el.set(y,_);const w=n.getId(y);q(e)(Object.assign(Object.assign({},_),{id:w}))}}const h=(u.input==="last"?["change"]:["input","change"]).map(y=>Oe(y,q(d),t)),m=t.defaultView;if(!m)return()=>{h.forEach(y=>y())};const g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),b=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...b.map(y=>Yi(y[0],y[1],{set(){q(d)({target:this,isTrusted:!1})}},!1,m))),q(()=>{h.forEach(y=>y())})}function Ci(e){const t=[];function n(r,i){if(Hr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Hr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Hr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Hr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(a)}return i}return n(e,t)}function Ft(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Bh({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:q((c,d,p)=>{const[f,h]=p,{id:m,styleId:g}=Ft(d,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:f,index:h}]}),c.apply(d,p)})});const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:q((c,d,p)=>{const[f]=p,{id:h,styleId:m}=Ft(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:f}]}),c.apply(d,p)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:q((c,d,p)=>{const[f]=p,{id:h,styleId:m}=Ft(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:f}),c.apply(d,p)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:q((c,d,p)=>{const[f]=p,{id:h,styleId:m}=Ft(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:f}),c.apply(d,p)})}));const l={};zr("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(zr("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),zr("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),zr("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:q((p,f,h)=>{const[m,g]=h,{id:b,styleId:y}=Ft(f.parentStyleSheet,t,n.styleMirror);return(b&&b!==-1||y&&y!==-1)&&e({id:b,styleId:y,adds:[{rule:m,index:[...Ci(f),g||0]}]}),p.apply(f,h)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:q((p,f,h)=>{const[m]=h,{id:g,styleId:b}=Ft(f.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||b&&b!==-1)&&e({id:g,styleId:b,removes:[{index:[...Ci(f),m]}]}),p.apply(f,h)})})}),q(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function yc({mirror:e,stylesheetManager:t},n){var r,i,o;let a=null;n.nodeName==="#document"?a=e.getId(n):a=e.getId(n.host);const s=n.nodeName==="#document"?(r=n.defaultView)===null||r===void 0?void 0:r.Document:(o=(i=n.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,l=Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets");return a===null||a===-1||!s||!l?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)===null||u===void 0?void 0:u.call(this)},set(u){var c;const d=(c=l.set)===null||c===void 0?void 0:c.call(this,u);if(a!==null&&a!==-1)try{t.adoptStyleSheets(u,a)}catch{}return d}}),q(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function jh({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:q((s,l,u)=>{var c;const[d,p,f]=u;if(n.has(d))return o.apply(l,[d,p,f]);const{id:h,styleId:m}=Ft((c=l.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,set:{property:d,value:p,priority:f},index:Ci(l.parentRule)}),s.apply(l,u)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:q((s,l,u)=>{var c;const[d]=u;if(n.has(d))return a.apply(l,[d]);const{id:p,styleId:f}=Ft((c=l.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||f&&f!==-1)&&e({id:p,styleId:f,remove:{property:d},index:Ci(l.parentRule)}),s.apply(l,u)})}),q(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function Hh({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const a=q(l=>gr(q(u=>{const c=Tr(u);if(!c||Ne(c,t,n,!0))return;const{currentTime:d,volume:p,muted:f,playbackRate:h}=c;e({type:l,id:r.getId(c),currentTime:d,volume:p,muted:f,playbackRate:h})}),i.media||500)),s=[Oe("play",a(0),o),Oe("pause",a(1),o),Oe("seeked",a(2),o),Oe("volumechange",a(3),o),Oe("ratechange",a(4),o)];return q(()=>{s.forEach(l=>l())})}function zh({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(l,u,c){const d=new o(l,u,c);return i.set(d,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};const a=Ar(t.fonts,"add",function(s){return function(l){return setTimeout(q(()=>{const u=i.get(l);u&&(e(u),i.delete(l))}),0),s.apply(this,[l])}});return r.push(()=>{n.FontFace=o}),r.push(a),q(()=>{r.forEach(s=>s())})}function Gh(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let a=!0;const s=q(()=>{const l=t.getSelection();if(!l||a&&(l==null?void 0:l.isCollapsed))return;a=l.isCollapsed||!1;const u=[],c=l.rangeCount||0;for(let d=0;d<c;d++){const p=l.getRangeAt(d),{startContainer:f,startOffset:h,endContainer:m,endOffset:g}=p;Ne(f,r,i,!0)||Ne(m,r,i,!0)||u.push({start:n.getId(f),startOffset:h,end:n.getId(m),endOffset:g})}o({ranges:u})});return s(),Oe("selectionchange",s)}function Kh(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:s,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:f}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),n(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),r(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),i(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),o(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),s(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),l(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),u(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),c(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),p(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),f(...h)}}function Wh(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Kh(e,t);const r=gc(e,e.doc),i=Uh(e),o=Ph(e),a=vc(e),s=Mh(e,{win:n}),l=Fh(e),u=Hh(e),c=Bh(e,{win:n}),d=yc(e,e.doc),p=jh(e,{win:n}),f=e.collectFonts?zh(e):()=>{},h=Gh(e),m=[];for(const g of e.plugins)m.push(g.observer(g.callback,n,g.options));return q(()=>{sn.forEach(g=>g.reset()),r.disconnect(),i(),o(),a(),s(),l(),u(),c(),d(),p(),f(),h(),m.forEach(g=>g())})}function Hr(e){return typeof window[e]<"u"}function zr(e){return Boolean(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class tl{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,i){const o=r||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let s=o.get(n);return s||(s=this.generateIdFn(),o.set(n,s),a.set(s,n)),s}getIds(t,n){const r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return n.map(o=>this.getId(t,o,r,i))}getRemoteId(t,n,r){const i=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const o=i.get(n);return o||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(i=>this.getRemoteId(t,i,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class qh{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new tl(nc),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(r=this.loadListener)===null||r===void 0||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case X.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const i=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(n.data.node,i),{timestamp:n.timestamp,type:X.IncrementalSnapshot,data:{source:J.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case X.Meta:case X.Load:case X.DomContentLoaded:return!1;case X.Plugin:return n;case X.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case X.IncrementalSnapshot:switch(n.data.source){case J.Mutation:return n.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),n.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),n.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),n.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case J.Drag:case J.TouchMove:case J.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case J.ViewportResize:return!1;case J.MediaInteraction:case J.MouseInteraction:case J.Scroll:case J.CanvasMutation:case J.Input:return this.replaceIds(n.data,t,["id"]),n;case J.StyleSheetRule:case J.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case J.Font:return n;case J.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case J.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)===null||r===void 0||r.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),n}}}replace(t,n,r,i){for(const o of i)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=t.getIds(r,n[o]):n[o]=t.getId(r,n[o]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==be.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class $h{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!ar(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=gc(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(vc(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(yc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Ar(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o);return this.shadowRoot&&pc(this)&&r.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
5
+ or you can use record.mirror to access the mirror instance during recording.`;let ks={map:{},getId(){return console.error(yn),-1},getNode(){return console.error(yn),null},removeNodeFromMap(){console.error(yn)},has(){return console.error(yn),!1},reset(){console.error(yn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ks=new Proxy(ks,{get(e,t,n){return t==="map"&&console.error(yn),Reflect.get(e,t,n)}}));function sr(e,t,n={}){let r=null,i=0;return function(...o){const a=Date.now();!i&&n.leading===!1&&(i=a);const s=t-(a-i),u=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=a,e.apply(u,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(u,o)},s))}}function Mi(e,t,n,r,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>Mi(e,t,o||{},!0)}function _r(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}let ci=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ci=()=>new Date().getTime());function Tl(e){var t,n,r,i,o,a;const s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(s==null?void 0:s.documentElement.scrollLeft)||((n=(t=s==null?void 0:s.body)===null||t===void 0?void 0:t.parentElement)===null||n===void 0?void 0:n.scrollLeft)||((r=s==null?void 0:s.body)===null||r===void 0?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(s==null?void 0:s.documentElement.scrollTop)||((o=(i=s==null?void 0:s.body)===null||i===void 0?void 0:i.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=s==null?void 0:s.body)===null||a===void 0?void 0:a.scrollTop)||0}}function Rl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ll(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Te(e,t,n,r){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||r&&i.closest("."+t)!==null)return!0}else if(li(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function Gp(e,t){return t.getId(e)!==-1}function eo(e,t){return t.getId(e)===ar}function Ol(e,t){if(Zn(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ol(e.parentNode,t):!0:!0}function Ao(e){return Boolean(e.changedTouches)}function zp(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Nl(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ul(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function xo(e){return Boolean(e==null?void 0:e.shadowRoot)}class Wp{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!==null&&n!==void 0?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Dl(e){var t,n;let r=null;return((n=(t=e.getRootNode)===null||t===void 0?void 0:t.call(e))===null||n===void 0?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function qp(e){let t=e,n;for(;n=Dl(t);)t=n;return t}function $p(e){const t=e.ownerDocument;if(!t)return!1;const n=qp(e);return t.contains(n)}function Pl(e){const t=e.ownerDocument;return t?t.contains(e)||$p(e):!1}var Z=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Z||{}),$=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))($||{}),Ne=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ne||{}),pt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(pt||{}),xn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(xn||{});function As(e){return"__ln"in e}class Yp{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&As(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&As(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const xs=(e,t)=>`${e}@${t}`;class Zp{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new Yp,i=u=>{let c=u,l=ar;for(;l===ar;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},o=u=>{if(!u.parentNode||!Pl(u))return;const c=Zn(u.parentNode)?this.mirror.getId(Dl(u)):this.mirror.getId(u.parentNode),l=i(u);if(c===-1||l===-1)return r.addNode(u);const d=wn(u,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Nl(p,this.mirror)&&this.iframeManager.addIframe(p),Ul(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),xo(u)&&this.shadowDomManager.addShadowRoot(u.shadowRoot,this.doc)},onIframeLoad:(p,f)=>{this.iframeManager.attachIframe(p,f),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,f)=>{this.stylesheetManager.attachLinkElement(p,f)}});d&&(t.push({parentId:c,nextId:l,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const u of this.movedSet)Ts(this.removes,u,this.mirror)&&!this.movedSet.has(u.parentNode)||o(u);for(const u of this.addedSet)!Rs(this.droppedSet,u)&&!Ts(this.removes,u,this.mirror)||Rs(this.movedSet,u)?o(u):this.droppedSet.add(u);let a=null;for(;r.length;){let u=null;if(a){const c=this.mirror.getId(a.value.parentNode),l=i(a.value);c!==-1&&l!==-1&&(u=a)}if(!u){let c=r.tail;for(;c;){const l=c;if(c=c.previous,l){const d=this.mirror.getId(l.value.parentNode);if(i(l.value)===-1)continue;if(d!==-1){u=l;break}else{const f=l.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=f.parentNode.host;if(this.mirror.getId(h)!==-1){u=l;break}}}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),o(u.value)}const s={texts:this.texts.map(u=>({id:this.mirror.getId(u.node),value:u.value})).filter(u=>!n.has(u.id)).filter(u=>this.mirror.has(u.id)),attributes:this.attributes.map(u=>{const{attributes:c}=u;if(typeof c.style=="string"){const l=JSON.stringify(u.styleDiff),d=JSON.stringify(u._unchangedStyles);l.length<c.style.length&&(l+d).split("var(").length===c.style.split("var(").length&&(c.style=u.styleDiff)}return{id:this.mirror.getId(u.node),attributes:c}}).filter(u=>!n.has(u.id)).filter(u=>this.mirror.has(u.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(eo(t.target,this.mirror))return;let n;try{n=document.implementation.createHTMLDocument()}catch{n=this.doc}switch(t.type){case"characterData":{const r=t.target.textContent;!Te(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:xl(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let i=t.attributeName,o=t.target.getAttribute(i);if(i==="value"){const s=Sa(r);o=wa({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:o,maskInputFn:this.maskInputFn})}if(Te(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;let a=this.attributes.find(s=>s.node===t.target);if(r.tagName==="IFRAME"&&i==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)i="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a)),i==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Al(r.tagName,i)&&(a.attributes[i]=kl(this.doc,nn(r.tagName),nn(i),o),i==="style")){const s=n.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue);for(const u of Array.from(r.style)){const c=r.style.getPropertyValue(u),l=r.style.getPropertyPriority(u);c!==s.style.getPropertyValue(u)||l!==s.style.getPropertyPriority(u)?l===""?a.styleDiff[u]=c:a.styleDiff[u]=[c,l]:a._unchangedStyles[u]=[c,l]}for(const u of Array.from(s.style))r.style.getPropertyValue(u)===""&&(a.styleDiff[u]=!1)}break}case"childList":{if(Te(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const i=this.mirror.getId(r),o=Zn(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Te(t.target,this.blockClass,this.blockSelector,!1)||eo(r,this.mirror)||!Gp(r,this.mirror)||(this.addedSet.has(r)?(To(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&i===-1||Ol(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[xs(i,o)]?To(this.movedSet,r):this.removes.push({parentId:o,id:i,isShadow:Zn(t.target)&&Qn(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(eo(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[xs(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Te(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(r=>this.genAdds(r)),xo(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function To(e,t){e.delete(t),t.childNodes.forEach(n=>To(e,n))}function Ts(e,t,n){return e.length===0?!1:Ml(e,t,n)}function Ml(e,t,n){const{parentNode:r}=t;if(!r)return!1;const i=n.getId(r);return e.some(o=>o.id===i)?!0:Ml(e,r,n)}function Rs(e,t){return e.size===0?!1:Fl(e,t)}function Fl(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Fl(e,n):!1}let Jn;function Qp(e){Jn=e}function Jp(){Jn=void 0}const H=e=>Jn?(...n)=>{try{return e(...n)}catch(r){if(Jn&&Jn(r)===!0)return;throw r}}:e,$t=[];function br(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Vl(e,t){var n,r;const i=new Zp;$t.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window==null?void 0:window.Zone)===null||n===void 0?void 0:n.__symbol__)===null||r===void 0?void 0:r.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);const s=new o(H(i.processMutations.bind(i)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Xp({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],s;const u=sr(H(d=>{const p=Date.now()-s;e(a.map(f=>(f.timeOffset-=p,f)),d),a=[],s=null}),o),c=H(sr(H(d=>{const p=br(d),{clientX:f,clientY:h}=Ao(d)?d.changedTouches[0]:d;s||(s=ci()),a.push({x:f,y:h,id:r.getId(p),timeOffset:ci()-s}),u(typeof DragEvent<"u"&&d instanceof DragEvent?$.Drag:d instanceof MouseEvent?$.MouseMove:$.TouchMove)}),i,{trailing:!1})),l=[xe("mousemove",c,n),xe("touchmove",c,n),xe("drag",c,n)];return H(()=>{l.forEach(d=>d())})}function eh({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,s=[];let u=null;const c=l=>d=>{const p=br(d);if(Te(p,r,i,!0))return;let f=null,h=l;if("pointerType"in d){switch(d.pointerType){case"mouse":f=pt.Mouse;break;case"touch":f=pt.Touch;break;case"pen":f=pt.Pen;break}f===pt.Touch?Ne[l]===Ne.MouseDown?h="TouchStart":Ne[l]===Ne.MouseUp&&(h="TouchEnd"):pt.Pen}else Ao(d)&&(f=pt.Touch);f!==null?(u=f,(h.startsWith("Touch")&&f===pt.Touch||h.startsWith("Mouse")&&f===pt.Mouse)&&(f=null)):Ne[l]===Ne.Click&&(f=u,u=null);const m=Ao(d)?d.changedTouches[0]:d;if(!m)return;const g=n.getId(p),{clientX:w,clientY:y}=m;H(e)(Object.assign({type:Ne[h],id:g,x:w,y},f!==null&&{pointerType:f}))};return Object.keys(Ne).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let d=nn(l);const p=c(l);if(window.PointerEvent)switch(Ne[l]){case Ne.MouseDown:case Ne.MouseUp:d=d.replace("mouse","pointer");break;case Ne.TouchStart:case Ne.TouchEnd:return}s.push(xe(d,p,t))}),H(()=>{s.forEach(l=>l())})}function Bl({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:o}){const a=H(sr(H(s=>{const u=br(s);if(!u||Te(u,r,i,!0))return;const c=n.getId(u);if(u===t&&t.defaultView){const l=Tl(t.defaultView);e({id:c,x:l.left,y:l.top})}else e({id:c,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return xe("scroll",a,t)}function th({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const i=H(sr(H(()=>{const o=Rl(),a=Ll();(n!==o||r!==a)&&(e({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return xe("resize",i,t)}function Ls(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const nh=["INPUT","TEXTAREA","SELECT"],Os=new WeakMap;function rh({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:s,maskInputFn:u,sampling:c,userTriggeredOnInput:l}){function d(y){let v=br(y);const b=y.isTrusted,_=v&&v.tagName;if(v&&_==="OPTION"&&(v=v.parentElement),!v||!_||nh.indexOf(_)<0||Te(v,r,i,!0)||v.classList.contains(o)||a&&v.matches(a))return;let C=v.value,k=!1;const I=Sa(v)||"";I==="radio"||I==="checkbox"?k=v.checked:(s[_.toLowerCase()]||s[I])&&(C=wa({element:v,maskInputOptions:s,tagName:_,type:I,value:C,maskInputFn:u})),p(v,H(Ls)({text:C,isChecked:k,userTriggered:b},l));const E=v.name;I==="radio"&&E&&k&&t.querySelectorAll(`input[type="radio"][name="${E}"]`).forEach(x=>{x!==v&&p(x,H(Ls)({text:x.value,isChecked:!k,userTriggered:!1},l))})}function p(y,v){const b=Os.get(y);if(!b||b.text!==v.text||b.isChecked!==v.isChecked){Os.set(y,v);const _=n.getId(y);H(e)(Object.assign(Object.assign({},v),{id:_}))}}const h=(c.input==="last"?["change"]:["input","change"]).map(y=>xe(y,H(d),t)),m=t.defaultView;if(!m)return()=>{h.forEach(y=>y())};const g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),w=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...w.map(y=>Mi(y[0],y[1],{set(){H(d)({target:this,isTrusted:!1})}},!1,m))),H(()=>{h.forEach(y=>y())})}function di(e){const t=[];function n(r,i){if(Nr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Nr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Nr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Nr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(a)}return i}return n(e,t)}function Lt(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function ih({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:H((l,d,p)=>{const[f,h]=p,{id:m,styleId:g}=Lt(d,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:f,index:h}]}),l.apply(d,p)})});const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:H((l,d,p)=>{const[f]=p,{id:h,styleId:m}=Lt(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:f}]}),l.apply(d,p)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:H((l,d,p)=>{const[f]=p,{id:h,styleId:m}=Lt(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:f}),l.apply(d,p)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:H((l,d,p)=>{const[f]=p,{id:h,styleId:m}=Lt(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:f}),l.apply(d,p)})}));const u={};Ur("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(Ur("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),Ur("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),Ur("CSSSupportsRule")&&(u.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(u).forEach(([l,d])=>{c[l]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[l].insertRule,{apply:H((p,f,h)=>{const[m,g]=h,{id:w,styleId:y}=Lt(f.parentStyleSheet,t,n.styleMirror);return(w&&w!==-1||y&&y!==-1)&&e({id:w,styleId:y,adds:[{rule:m,index:[...di(f),g||0]}]}),p.apply(f,h)})}),d.prototype.deleteRule=new Proxy(c[l].deleteRule,{apply:H((p,f,h)=>{const[m]=h,{id:g,styleId:w}=Lt(f.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||w&&w!==-1)&&e({id:g,styleId:w,removes:[{index:[...di(f),m]}]}),p.apply(f,h)})})}),H(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(u).forEach(([l,d])=>{d.prototype.insertRule=c[l].insertRule,d.prototype.deleteRule=c[l].deleteRule})})}function Kl({mirror:e,stylesheetManager:t},n){var r,i,o;let a=null;n.nodeName==="#document"?a=e.getId(n):a=e.getId(n.host);const s=n.nodeName==="#document"?(r=n.defaultView)===null||r===void 0?void 0:r.Document:(o=(i=n.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,u=Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets");return a===null||a===-1||!s||!u?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var c;return(c=u.get)===null||c===void 0?void 0:c.call(this)},set(c){var l;const d=(l=u.set)===null||l===void 0?void 0:l.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return d}}),H(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))}function oh({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:H((s,u,c)=>{var l;const[d,p,f]=c;if(n.has(d))return o.apply(u,[d,p,f]);const{id:h,styleId:m}=Lt((l=u.parentRule)===null||l===void 0?void 0:l.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,set:{property:d,value:p,priority:f},index:di(u.parentRule)}),s.apply(u,c)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:H((s,u,c)=>{var l;const[d]=c;if(n.has(d))return a.apply(u,[d]);const{id:p,styleId:f}=Lt((l=u.parentRule)===null||l===void 0?void 0:l.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||f&&f!==-1)&&e({id:p,styleId:f,remove:{property:d},index:di(u.parentRule)}),s.apply(u,c)})}),H(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function ah({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:o}){const a=H(u=>sr(H(c=>{const l=br(c);if(!l||Te(l,t,n,!0))return;const{currentTime:d,volume:p,muted:f,playbackRate:h}=l;e({type:u,id:r.getId(l),currentTime:d,volume:p,muted:f,playbackRate:h})}),i.media||500)),s=[xe("play",a(0),o),xe("pause",a(1),o),xe("seeked",a(2),o),xe("volumechange",a(3),o),xe("ratechange",a(4),o)];return H(()=>{s.forEach(u=>u())})}function sh({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(u,c,l){const d=new o(u,c,l);return i.set(d,{family:u,buffer:typeof c!="string",descriptors:l,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};const a=_r(t.fonts,"add",function(s){return function(u){return setTimeout(H(()=>{const c=i.get(u);c&&(e(c),i.delete(u))}),0),s.apply(this,[u])}});return r.push(()=>{n.FontFace=o}),r.push(a),H(()=>{r.forEach(s=>s())})}function uh(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:o}=e;let a=!0;const s=H(()=>{const u=t.getSelection();if(!u||a&&(u==null?void 0:u.isCollapsed))return;a=u.isCollapsed||!1;const c=[],l=u.rangeCount||0;for(let d=0;d<l;d++){const p=u.getRangeAt(d),{startContainer:f,startOffset:h,endContainer:m,endOffset:g}=p;Te(f,r,i,!0)||Te(m,r,i,!0)||c.push({start:n.getId(f),startOffset:h,end:n.getId(m),endOffset:g})}o({ranges:c})});return s(),xe("selectionchange",s)}function lh(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:s,mediaInteractionCb:u,styleSheetRuleCb:c,styleDeclarationCb:l,canvasMutationCb:d,fontCb:p,selectionCb:f}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),n(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),r(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),i(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),o(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),s(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),u(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),c(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),l(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),p(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),f(...h)}}function ch(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};lh(e,t);const r=Vl(e,e.doc),i=Xp(e),o=eh(e),a=Bl(e),s=th(e,{win:n}),u=rh(e),c=ah(e),l=ih(e,{win:n}),d=Kl(e,e.doc),p=oh(e,{win:n}),f=e.collectFonts?sh(e):()=>{},h=uh(e),m=[];for(const g of e.plugins)m.push(g.observer(g.callback,n,g.options));return H(()=>{$t.forEach(g=>g.reset()),r.disconnect(),i(),o(),a(),s(),u(),c(),l(),d(),p(),f(),h(),m.forEach(g=>g())})}function Nr(e){return typeof window[e]<"u"}function Ur(e){return Boolean(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ns{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,i){const o=r||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let s=o.get(n);return s||(s=this.generateIdFn(),o.set(n,s),a.set(s,n)),s}getIds(t,n){const r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return n.map(o=>this.getId(t,o,r,i))}getRemoteId(t,n,r){const i=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const o=i.get(n);return o||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(i=>this.getRemoteId(t,i,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class dh{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ns(El),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ns(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(r=this.loadListener)===null||r===void 0||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case Z.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const i=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(n.data.node,i),{timestamp:n.timestamp,type:Z.IncrementalSnapshot,data:{source:$.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Z.Meta:case Z.Load:case Z.DomContentLoaded:return!1;case Z.Plugin:return n;case Z.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case Z.IncrementalSnapshot:switch(n.data.source){case $.Mutation:return n.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),n.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),n.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),n.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case $.Drag:case $.TouchMove:case $.MouseMove:return n.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),n;case $.ViewportResize:return!1;case $.MediaInteraction:case $.MouseInteraction:case $.Scroll:case $.CanvasMutation:case $.Input:return this.replaceIds(n.data,t,["id"]),n;case $.StyleSheetRule:case $.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case $.Font:return n;case $.Selection:return n.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),n;case $.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)===null||r===void 0||r.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),n}}}replace(t,n,r,i){for(const o of i)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=t.getIds(r,n[o]):n[o]=t.getId(r,n[o]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==ye.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class fh{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!Qn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=Vl(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Bl(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Kl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(_r(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o);return this.shadowRoot&&Pl(this)&&r.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation.
7
7
 
8
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -15,9 +15,9 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
15
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
16
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
17
  PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */function Yh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Zh(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{u(r.next(c))}catch(d){a(d)}}function l(c){try{u(r.throw(c))}catch(d){a(d)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}var Ln="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Gr=0;Gr<Ln.length;Gr++)Qh[Ln.charCodeAt(Gr)]=Gr;var Jh=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Ln[t[n]>>2],i+=Ln[(t[n]&3)<<4|t[n+1]>>4],i+=Ln[(t[n+1]&15)<<2|t[n+2]>>6],i+=Ln[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const nl=new Map;function Xh(e,t){let n=nl.get(e);return n||(n=new Map,nl.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const _c=(e,t,n)=>{if(!e||!(wc(e,t)||typeof e=="object"))return;const r=e.constructor.name,i=Xh(n,r);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function ti(e,t,n){if(e instanceof Array)return e.map(r=>ti(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,i=Jh(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ti(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",i=e.toDataURL();return{rr_type:r,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ti(e.data,t,n),e.width,e.height]};if(wc(e,t)||typeof e=="object"){const r=e.constructor.name,i=_c(e,t,n);return{rr_type:r,index:i}}}}return e}const bc=(e,t,n)=>[...e].map(r=>ti(r,t,n)),wc=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function");return Boolean(r.find(i=>e instanceof t[i]))};function em(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const s=Ar(t.CanvasRenderingContext2D.prototype,a,function(l){return function(...u){return Ne(this.canvas,n,r,!0)||setTimeout(()=>{const c=bc([...u],t,this);e(this.canvas,{type:Mn["2D"],property:a,args:c})},0),l.apply(this,u)}});i.push(s)}catch{const l=Yi(t.CanvasRenderingContext2D.prototype,a,{set(u){e(this.canvas,{type:Mn["2D"],property:a,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(a=>a())}}function tm(e){return e==="experimental-webgl"?"webgl":e}function rl(e,t,n,r){const i=[];try{const o=Ar(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(s,...l){if(!Ne(this,t,n,!0)){const u=tm(s);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){const c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[s,...l])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function il(e,t,n,r,i,o,a){const s=[],l=Object.getOwnPropertyNames(e);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if(typeof e[u]!="function")continue;const c=Ar(e,u,function(d){return function(...p){const f=d.apply(this,p);if(_c(f,a,this),"tagName"in this.canvas&&!Ne(this.canvas,r,i,!0)){const h=bc([...p],a,this),m={type:t,property:u,args:h};n(this.canvas,m)}return f}});s.push(c)}catch{const d=Yi(e,u,{set(p){n(this.canvas,{type:t,property:u,args:[p],setter:!0})}});s.push(d)}return s}function nm(e,t,n,r,i){const o=[];return o.push(...il(t.WebGLRenderingContext.prototype,Mn.WebGL,e,n,r,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...il(t.WebGL2RenderingContext.prototype,Mn.WebGL2,e,n,r,i,t)),()=>{o.forEach(a=>a())}}function rm(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function im(e,t,n){var r=t===void 0?null:t,i=n===void 0?!1:n,o=rm(e,i),a=o.indexOf(`
19
- `,10)+1,s=o.substring(a)+(r?"//# sourceMappingURL="+r:""),l=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(l)}function om(e,t,n){var r;return function(o){return r=r||im(e,t,n),new Worker(r,o)}}var am=om("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);class sm{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)};const{sampling:n="all",win:r,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,i,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,i,o,{dataURLOptions:s})}initCanvasFPSObserver(t,n,r,i,o){const a=rl(n,r,i,!0),s=new Map,l=new am;l.onmessage=h=>{const{id:m}=h.data;if(s.set(m,!1),!("base64"in h.data))return;const{base64:g,type:b,width:y,height:_}=h.data;this.mutationCb({id:m,type:Mn["2D"],commands:[{property:"clearRect",args:[0,0,y,_]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:b}]},0,0]}]})};const u=1e3/t;let c=0,d;const p=()=>{const h=[];return n.document.querySelectorAll("canvas").forEach(m=>{Ne(m,r,i,!0)||h.push(m)}),h},f=h=>{if(c&&h-c<u){d=requestAnimationFrame(f);return}c=h,p().forEach(m=>Zh(this,void 0,void 0,function*(){var g;const b=this.mirror.getId(m);if(s.get(b))return;if(s.set(b,!0),["webgl","webgl2"].includes(m.__context)){const _=m.getContext(m.__context);((g=_==null?void 0:_.getContextAttributes())===null||g===void 0?void 0:g.preserveDrawingBuffer)===!1&&_.clear(_.COLOR_BUFFER_BIT)}const y=yield createImageBitmap(m);l.postMessage({id:b,bitmap:y,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[y])})),d=requestAnimationFrame(f)};d=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=rl(t,n,r,!1),o=em(this.processMutation.bind(this),t,n,r),a=nm(this.processMutation.bind(this),t,n,r,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const i=r.map(a=>Yh(a,["type"])),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class lm{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ah,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},i=[];for(const o of t){let a;if(this.styleMirror.has(o))a=this.styleMirror.getId(o);else{a=this.styleMirror.add(o);const s=Array.from(o.rules||CSSRule);i.push({styleId:a,rules:s.map((l,u)=>({rule:ec(l),index:u}))})}r.styleIds.push(a)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class um{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(i=>i!==n)}add(t,n){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function ye(e){return Object.assign(Object.assign({},e),{timestamp:wi()})}let pe,ni,ho,Ei=!1;const et=rh();function Rr(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:h,maskTextFn:m,hooks:g,packFn:b,sampling:y={},dataURLOptions:_={},mousemoveWait:v,recordCanvas:w=!1,recordCrossOriginIframes:E=!1,recordAfter:I=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:S=!1,collectFonts:x=!1,inlineImages:T=!1,plugins:A,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:k=new Set([]),errorHandler:U}=e;Nh(U);const R=E?window.parent===window:!0;let V=!1;if(!R)try{window.parent.document&&(V=!1)}catch{V=!0}if(R&&!t)throw new Error("emit function is required");v!==void 0&&y.mousemove===void 0&&(y.mousemove=v),et.reset();const K=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},z=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};xh();let ie,oe=0;const fe=j=>{for(const Pe of A||[])Pe.eventProcessor&&(j=Pe.eventProcessor(j));return b&&!V&&(j=b(j)),j};pe=(j,Pe)=>{var ee;if(((ee=sn[0])===null||ee===void 0?void 0:ee.isFrozen())&&j.type!==X.FullSnapshot&&!(j.type===X.IncrementalSnapshot&&j.data.source===J.Mutation)&&sn.forEach(Ce=>Ce.unfreeze()),R)t==null||t(fe(j),Pe);else if(V){const Ce={type:"rrweb",event:fe(j),origin:window.location.origin,isCheckout:Pe};window.parent.postMessage(Ce,"*")}if(j.type===X.FullSnapshot)ie=j,oe=0;else if(j.type===X.IncrementalSnapshot){if(j.data.source===J.Mutation&&j.data.isAttachIframe)return;oe++;const Ce=r&&oe>=r,en=n&&j.timestamp-ie.timestamp>n;(Ce||en)&&ni(!0)}};const Q=j=>{pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.Mutation},j)}))},Ke=j=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.Scroll},j)})),Ie=j=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.CanvasMutation},j)})),yt=j=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.AdoptedStyleSheet},j)})),Fe=new lm({mutationCb:Q,adoptedStyleSheetCb:yt}),st=new qh({mirror:et,mutationCb:Q,stylesheetManager:Fe,recordCrossOriginIframes:E,wrappedEmit:pe});for(const j of A||[])j.getMirror&&j.getMirror({nodeMirror:et,crossOriginIframeMirror:st.crossOriginIframeMirror,crossOriginIframeStyleMirror:st.crossOriginIframeStyleMirror});const Xt=new um;ho=new sm({recordCanvas:w,mutationCb:Ie,win:window,blockClass:i,blockSelector:o,mirror:et,sampling:y.canvas,dataURLOptions:_});const Xe=new $h({mutationCb:Q,scrollCb:Ke,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:K,dataURLOptions:_,maskTextFn:m,maskInputFn:h,recordCanvas:w,inlineImages:T,sampling:y,slimDOMOptions:z,iframeManager:st,stylesheetManager:Fe,canvasManager:ho,keepIframeSrcFn:L,processedNodeManager:Xt},mirror:et});ni=(j=!1)=>{pe(ye({type:X.Meta,data:{href:window.location.href,width:lc(),height:sc()}}),j),Fe.reset(),Xe.init(),sn.forEach(ee=>ee.lock());const Pe=Ih(document,{mirror:et,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:K,maskTextFn:m,slimDOM:z,dataURLOptions:_,recordCanvas:w,inlineImages:T,onSerialize:ee=>{cc(ee,et)&&st.addIframe(ee),dc(ee,et)&&Fe.trackLinkElement(ee),$o(ee)&&Xe.addShadowRoot(ee.shadowRoot,document)},onIframeLoad:(ee,Ce)=>{st.attachIframe(ee,Ce),Xe.observeAttachShadow(ee)},onStylesheetLoad:(ee,Ce)=>{Fe.attachLinkElement(ee,Ce)},keepIframeSrcFn:L});if(!Pe)return console.warn("Failed to snapshot the document");pe(ye({type:X.FullSnapshot,data:{node:Pe,initialOffset:ac(window)}}),j),sn.forEach(ee=>ee.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Fe.adoptStyleSheets(document.adoptedStyleSheets,et.getId(document))};try{const j=[],Pe=Ce=>{var en;return q(Wh)({mutationCb:Q,mousemoveCb:(de,so)=>pe(ye({type:X.IncrementalSnapshot,data:{source:so,positions:de}})),mouseInteractionCb:de=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.MouseInteraction},de)})),scrollCb:Ke,viewportResizeCb:de=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.ViewportResize},de)})),inputCb:de=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.Input},de)})),mediaInteractionCb:de=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.MediaInteraction},de)})),styleSheetRuleCb:de=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleSheetRule},de)})),styleDeclarationCb:de=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleDeclaration},de)})),canvasMutationCb:Ie,fontCb:de=>pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.Font},de)})),selectionCb:de=>{pe(ye({type:X.IncrementalSnapshot,data:Object.assign({source:J.Selection},de)}))},blockClass:i,ignoreClass:a,ignoreSelector:s,maskTextClass:l,maskTextSelector:u,maskInputOptions:K,inlineStylesheet:c,sampling:y,recordCanvas:w,inlineImages:T,userTriggeredOnInput:S,collectFonts:x,doc:Ce,maskInputFn:h,maskTextFn:m,keepIframeSrcFn:L,blockSelector:o,slimDOMOptions:z,dataURLOptions:_,mirror:et,iframeManager:st,stylesheetManager:Fe,shadowDomManager:Xe,processedNodeManager:Xt,canvasManager:ho,ignoreCSSAttributes:k,plugins:((en=A==null?void 0:A.filter(de=>de.observer))===null||en===void 0?void 0:en.map(de=>({observer:de.observer,options:de.options,callback:so=>pe(ye({type:X.Plugin,data:{plugin:de.name,payload:so}}))})))||[]},g)};st.addLoadListener(Ce=>{try{j.push(Pe(Ce.contentDocument))}catch(en){console.warn(en)}});const ee=()=>{ni(),j.push(Pe(document)),Ei=!0};return document.readyState==="interactive"||document.readyState==="complete"?ee():(j.push(Oe("DOMContentLoaded",()=>{pe(ye({type:X.DomContentLoaded,data:{}})),I==="DOMContentLoaded"&&ee()})),j.push(Oe("load",()=>{pe(ye({type:X.Load,data:{}})),I==="load"&&ee()},window))),()=>{j.forEach(Ce=>Ce()),Xt.destroy(),Ei=!1,Dh()}}catch(j){console.warn(j)}}Rr.addCustomEvent=(e,t)=>{if(!Ei)throw new Error("please add custom event after start recording");pe(ye({type:X.Custom,data:{tag:e,payload:t}}))};Rr.freezePage=()=>{sn.forEach(e=>e.freeze())};Rr.takeFullSnapshot=e=>{if(!Ei)throw new Error("please take full snapshot after start recording");ni(e)};Rr.mirror=et;var dt=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.PageChange="page.change",e.API="api",e.Override="override",e))(dt||{}),G=(e=>(e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e.QuestionAnswered="question.answered",e))(G||{}),Cc=(e=>(e.SurveyId="survey.id",e))(Cc||{});const Ga={SDK_READY:"sdk.ready",SURVEY_APPEARED:"survey.appeared",SURVEY_CLOSED:"survey.closed",SURVEY_DIMENSIONS:"survey.dimensions",SURVEY_FADING_OUT:"survey.fadingOut",SURVEY_HEIGHT:"survey.height",SURVEY_PRESENTED:"survey.presented",SURVEY_LIFE_CYCLE:"survey.lifeCycle",SURVEY_WILL_CLOSE:"survey.willClose",SURVEY_WILL_PRESENT:"survey.will.present",QUESTION_ANSWERED:"question.answered",CLOSE_SURVEY_ON_OVERLAY_CLICK:"close.survey.overlayClick",VISITOR_ID_UPDATED:"visitor.id.updated",DATA:{DISMISS_REASONS:{API:"api",CLOSED:"close.click",COMPLETE:"survey.completed",PAGE_CHANGE:"page.change",OVERRIDE:"override"},SURVEY_ID:"survey.id"}};var Qe=(e=>(e.VerifyViewVersion="verify.view.version",e.CurrentQuestion="survey.question",e.ViewPrototypeClick="question.prototype.click",e.ViewAgreementClick="question.agreement.click",e.RecordedTaskStart="recorded.task.start",e.RecordedTaskPermissionScreen="recorded.task.permission.screen",e.SurveyComplete="survey.complete",e))(Qe||{}),ln=(e=>(e.ViewVersion="view.version",e.QuestionId="qid",e.Props="props",e))(ln||{}),le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dm(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Se={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});var Ka=function(){function e(){}return e.prototype.handleError=function(t){},e}();_n.NoopErrorHandler=Ka;var Wa=new Ka;function fm(e){Wa=e}_n.setErrorHandler=fm;function pm(){return Wa}_n.getErrorHandler=pm;function hm(){Wa=new Ka}_n.resetErrorHandler=hm;var qa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.NOTSET=0]="NOTSET",t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARNING=3]="WARNING",t[t.ERROR=4]="ERROR"}(e.LogLevel||(e.LogLevel={}))})(qa);var Zt={},Wn={},Si={exports:{}},ol=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(ol){var al=new Uint8Array(16);Si.exports=function(){return ol(al),al}}else{var sl=new Array(16);Si.exports=function(){for(var t=0,n;t<16;t++)(t&3)===0&&(n=Math.random()*4294967296),sl[t]=n>>>((t&3)<<3)&255;return sl}}var Ec=[];for(var Kr=0;Kr<256;++Kr)Ec[Kr]=(Kr+256).toString(16).substr(1);function mm(e,t){var n=t||0,r=Ec;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}var Sc=mm,gm=Si.exports,vm=Sc,ll,mo,go=0,vo=0;function ym(e,t,n){var r=t&&n||0,i=t||[];e=e||{};var o=e.node||ll,a=e.clockseq!==void 0?e.clockseq:mo;if(o==null||a==null){var s=gm();o==null&&(o=ll=[s[0]|1,s[1],s[2],s[3],s[4],s[5]]),a==null&&(a=mo=(s[6]<<8|s[7])&16383)}var l=e.msecs!==void 0?e.msecs:new Date().getTime(),u=e.nsecs!==void 0?e.nsecs:vo+1,c=l-go+(u-vo)/1e4;if(c<0&&e.clockseq===void 0&&(a=a+1&16383),(c<0||l>go)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");go=l,vo=u,mo=a,l+=122192928e5;var d=((l&268435455)*1e4+u)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var p=l/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(var f=0;f<6;++f)i[r+f]=o[f];return t||vm(i)}var _m=ym,bm=Si.exports,wm=Sc;function Cm(e,t,n){var r=t&&n||0;typeof e=="string"&&(t=e==="binary"?new Array(16):null,e=null),e=e||{};var i=e.random||(e.rng||bm)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||wm(i)}var Em=Cm,Sm=_m,Ic=Em,$a=Ic;$a.v1=Sm;$a.v4=Ic;var Im=$a;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Im;function n(){return t.v4()}e.generateUUID=n;function r(){return new Date().getTime()}e.getTimestamp=r;function i(d,p){for(var f=!1,h=Object.keys(d),m=0;m<h.length;m++)if(p===d[h[m]]){f=!0;break}return f}e.isValidEnum=i;function o(d,p){var f={};return d.forEach(function(h){var m=p(h);f[m]=f[m]||[],f[m].push(h)}),a(f)}e.groupBy=o;function a(d){return Object.keys(d).map(function(p){return d[p]})}e.objectValues=a;function s(d){return Object.keys(d).map(function(p){return[p,d[p]]})}e.objectEntries=s;function l(d,p){for(var f,h=0,m=d;h<m.length;h++){var g=m[h];if(p(g)){f=g;break}}return f}e.find=l;function u(d,p){var f={};return d.forEach(function(h){var m=p(h);f[m]=h}),f}e.keyBy=u;function c(d){for(var p=[],f=1;f<arguments.length;f++)p[f-1]=arguments[f];var h=0;return d.replace(/%s/g,function(){var m=p[h++],g=typeof m;return g==="function"?m():g==="string"?m:String(m)})}e.sprintf=c,function(d){d.ACTIVATE="ACTIVATE:experiment, user_id,attributes, variation, event",d.DECISION="DECISION:type, userId, attributes, decisionInfo",d.LOG_EVENT="LOG_EVENT:logEvent",d.OPTIMIZELY_CONFIG_UPDATE="OPTIMIZELY_CONFIG_UPDATE",d.TRACK="TRACK:event_key, user_id, attributes, event_tags, event"}(e.NOTIFICATION_TYPES||(e.NOTIFICATION_TYPES={}))})(Wn);var km=le&&le.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(Zt,"__esModule",{value:!0});var xm=_n,Ii=Wn,ge=qa,ul={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4};function Ya(e){return typeof e!="string"||(e=e.toUpperCase(),e==="WARN"&&(e="WARNING"),!ul[e])?e:ul[e]}var kc=function(){function e(){this.defaultLoggerFacade=new cl,this.loggers={}}return e.prototype.getLogger=function(t){return t?(this.loggers[t]||(this.loggers[t]=new cl({messagePrefix:t})),this.loggers[t]):this.defaultLoggerFacade},e}(),Am=function(){function e(t){t===void 0&&(t={}),this.logLevel=ge.LogLevel.NOTSET,t.logLevel!==void 0&&Ii.isValidEnum(ge.LogLevel,t.logLevel)&&this.setLogLevel(t.logLevel),this.logToConsole=t.logToConsole!==void 0?!!t.logToConsole:!0,this.prefix=t.prefix!==void 0?t.prefix:"[OPTIMIZELY]"}return e.prototype.log=function(t,n){if(!(!this.shouldLog(t)||!this.logToConsole)){var r=this.prefix+" - "+this.getLogLevelName(t)+" "+this.getTime()+" "+n;this.consoleLog(t,[r])}},e.prototype.setLogLevel=function(t){t=Ya(t),!Ii.isValidEnum(ge.LogLevel,t)||t===void 0?this.logLevel=ge.LogLevel.ERROR:this.logLevel=t},e.prototype.getTime=function(){return new Date().toISOString()},e.prototype.shouldLog=function(t){return t>=this.logLevel},e.prototype.getLogLevelName=function(t){switch(t){case ge.LogLevel.DEBUG:return"DEBUG";case ge.LogLevel.INFO:return"INFO ";case ge.LogLevel.WARNING:return"WARN ";case ge.LogLevel.ERROR:return"ERROR";default:return"NOTSET"}},e.prototype.consoleLog=function(t,n){switch(t){case ge.LogLevel.DEBUG:console.log.apply(console,n);break;case ge.LogLevel.INFO:console.info.apply(console,n);break;case ge.LogLevel.WARNING:console.warn.apply(console,n);break;case ge.LogLevel.ERROR:console.error.apply(console,n);break;default:console.log.apply(console,n)}},e}();Zt.ConsoleLogHandler=Am;var vr=ge.LogLevel.NOTSET,Zo=null,cl=function(){function e(t){t===void 0&&(t={}),this.messagePrefix="",t.messagePrefix&&(this.messagePrefix=t.messagePrefix)}return e.prototype.log=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];this.internalLog(Ya(t),{message:n,splat:r})},e.prototype.info=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(ge.LogLevel.INFO,t,n)},e.prototype.debug=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(ge.LogLevel.DEBUG,t,n)},e.prototype.warn=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(ge.LogLevel.WARNING,t,n)},e.prototype.error=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(ge.LogLevel.ERROR,t,n)},e.prototype.format=function(t){return(this.messagePrefix?this.messagePrefix+": ":"")+Ii.sprintf.apply(void 0,km([t.message],t.splat))},e.prototype.internalLog=function(t,n){!Zo||t<vr||(Zo.log(t,this.format(n)),n.error&&n.error instanceof Error&&xm.getErrorHandler().handleError(n.error))},e.prototype.namedLog=function(t,n,r){var i;if(n instanceof Error){i=n,n=i.message,this.internalLog(t,{error:i,message:n,splat:r});return}if(r.length===0){this.internalLog(t,{message:n,splat:r});return}var o=r[r.length-1];o instanceof Error&&(i=o,r.splice(-1)),this.internalLog(t,{message:n,error:i,splat:r})},e}(),xc=new kc;function Tm(e){return xc.getLogger(e)}Zt.getLogger=Tm;function Rm(e){Zo=e}Zt.setLogHandler=Rm;function Lm(e){e=Ya(e),!Ii.isValidEnum(ge.LogLevel,e)||e===void 0?vr=ge.LogLevel.ERROR:vr=e}Zt.setLogLevel=Lm;function Om(){return vr}Zt.getLogLevel=Om;function Nm(){xc=new kc,vr=ge.LogLevel.NOTSET}Zt.resetLogger=Nm;(function(e){function t(n){for(var r in n)e.hasOwnProperty(r)||(e[r]=n[r])}Object.defineProperty(e,"__esModule",{value:!0}),t(_n),t(qa),t(Zt)})(Se);var Dm={},Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.areEventContextsEqual=void 0;function Um(e,t){var n=e.context,r=t.context;return n.accountId===r.accountId&&n.projectId===r.projectId&&n.clientName===r.clientName&&n.clientVersion===r.clientVersion&&n.revision===r.revision&&n.anonymizeIP===r.anonymizeIP&&n.botFiltering===r.botFiltering}Lr.areEventContextsEqual=Um;var Za={},Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.DefaultEventQueue=Vn.SingleEventQueue=void 0;var Pm=Se,Mm=Pm.getLogger("EventProcessor"),Vm=function(){function e(t){var n=t.timeout,r=t.callback;this.timeout=Math.max(n,0),this.callback=r}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),Fm=function(){function e(t){var n=t.sink;this.sink=n}return e.prototype.start=function(){},e.prototype.stop=function(){return Promise.resolve()},e.prototype.enqueue=function(t){this.sink([t])},e}();Vn.SingleEventQueue=Fm;var Bm=function(){function e(t){var n=t.flushInterval,r=t.maxQueueSize,i=t.sink,o=t.batchComparator;this.buffer=[],this.maxQueueSize=Math.max(r,1),this.sink=i,this.batchComparator=o,this.timer=new Vm({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var t=this.sink(this.buffer);return this.buffer=[],this.timer.stop(),t},e.prototype.enqueue=function(t){if(!this.started){Mm.warn("Queue is stopped, not accepting event");return}var n=this.buffer[0];n&&!this.batchComparator(n,t)&&this.flush(),this.buffer.length===0&&this.timer.refresh(),this.buffer.push(t),this.buffer.length>=this.maxQueueSize&&this.flush()},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e}();Vn.DefaultEventQueue=Bm;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sendEventNotification=e.getQueue=e.validateAndGetBatchSize=e.validateAndGetFlushInterval=e.DEFAULT_BATCH_SIZE=e.DEFAULT_FLUSH_INTERVAL=void 0;var t=Vn,n=Se,r=Wn;e.DEFAULT_FLUSH_INTERVAL=3e4,e.DEFAULT_BATCH_SIZE=10;var i=n.getLogger("EventProcessor");function o(u){return u<=0&&(i.warn("Invalid flushInterval "+u+", defaulting to "+e.DEFAULT_FLUSH_INTERVAL),u=e.DEFAULT_FLUSH_INTERVAL),u}e.validateAndGetFlushInterval=o;function a(u){return u=Math.floor(u),u<1&&(i.warn("Invalid batchSize "+u+", defaulting to "+e.DEFAULT_BATCH_SIZE),u=e.DEFAULT_BATCH_SIZE),u=Math.max(1,u),u}e.validateAndGetBatchSize=a;function s(u,c,d,p){var f;return u>1?f=new t.DefaultEventQueue({flushInterval:c,maxQueueSize:u,sink:d,batchComparator:p}):f=new t.SingleEventQueue({sink:d}),f}e.getQueue=s;function l(u,c){u&&u.sendNotifications(r.NOTIFICATION_TYPES.LOG_EVENT,c)}e.sendEventNotification=l})(Za);var Ac={};Object.defineProperty(Ac,"__esModule",{value:!0});var Tc={};Object.defineProperty(Tc,"__esModule",{value:!0});var Fn={},Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.LocalStorageStore=void 0;var jm=Wn,Hm=Se,dl=Hm.getLogger("EventProcessor"),zm=function(){function e(t){var n=t.key,r=t.maxValues,i=r===void 0?1e3:r;this.LS_KEY=n,this.maxValues=i}return e.prototype.get=function(t){return this.getMap()[t]||null},e.prototype.set=function(t,n){var r=this.getMap();r[t]=n,this.replace(r)},e.prototype.remove=function(t){var n=this.getMap();delete n[t],this.replace(n)},e.prototype.values=function(){return jm.objectValues(this.getMap())},e.prototype.clear=function(){this.replace({})},e.prototype.replace=function(t){try{window.localStorage&&localStorage.setItem(this.LS_KEY,JSON.stringify(t)),this.clean()}catch(n){dl.error(n)}},e.prototype.clean=function(){var t=this.getMap(),n=Object.keys(t),r=n.length-this.maxValues;if(!(r<1)){var i=n.map(function(a){return{key:a,value:t[a]}});i.sort(function(a,s){return a.value.timestamp-s.value.timestamp});for(var o=0;o<r;o++)delete t[i[o].key];this.replace(t)}},e.prototype.getMap=function(){try{var t=window.localStorage&&localStorage.getItem(this.LS_KEY);if(t)return JSON.parse(t)||{}}catch(n){dl.error(n)}return{}},e}();Zi.LocalStorageStore=zm;var Gm=le&&le.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.LocalStoragePendingEventsDispatcher=Fn.PendingEventsDispatcher=void 0;var Km=Se,Wm=Zi,fl=Wn,qm=Km.getLogger("EventProcessor"),Rc=function(){function e(t){var n=t.eventDispatcher,r=t.store;this.dispatcher=n,this.store=r}return e.prototype.dispatchEvent=function(t,n){this.send({uuid:fl.generateUUID(),timestamp:fl.getTimestamp(),request:t},n)},e.prototype.sendPendingEvents=function(){var t=this,n=this.store.values();qm.debug("Sending %s pending events from previous page",n.length),n.forEach(function(r){try{t.send(r,function(){})}catch{}})},e.prototype.send=function(t,n){var r=this;this.store.set(t.uuid,t),this.dispatcher.dispatchEvent(t.request,function(i){r.store.remove(t.uuid),n(i)})},e}();Fn.PendingEventsDispatcher=Rc;var $m=function(e){Gm(t,e);function t(n){var r=n.eventDispatcher;return e.call(this,{eventDispatcher:r,store:new Wm.LocalStorageStore({maxValues:100,key:"fs_optly_pending_events"})})||this}return t}(Rc);Fn.LocalStoragePendingEventsDispatcher=$m;var rt={},Qo=le&&le.__assign||function(){return Qo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qo.apply(this,arguments)};Object.defineProperty(rt,"__esModule",{value:!0});rt.formatEvents=rt.buildConversionEventV1=rt.buildImpressionEventV1=rt.makeBatchedEventV1=void 0;var Ym="campaign_activated",Zm="custom",pl="$opt_bot_filtering";function Lc(e){var t=[],n=e[0];return e.forEach(function(r){if(r.type==="conversion"||r.type==="impression"){var i=Qa(r);r.type==="impression"?i.snapshots.push(Nc(r)):r.type==="conversion"&&i.snapshots.push(Oc(r)),t.push(i)}}),{client_name:n.context.clientName,client_version:n.context.clientVersion,account_id:n.context.accountId,project_id:n.context.projectId,revision:n.context.revision,anonymize_ip:n.context.anonymizeIP,enrich_decisions:!0,visitors:t}}rt.makeBatchedEventV1=Lc;function Oc(e){var t=Qo({},e.tags);delete t.revenue,delete t.value;var n={entity_id:e.event.id,key:e.event.key,timestamp:e.timestamp,uuid:e.uuid};return e.tags&&(n.tags=e.tags),e.value!=null&&(n.value=e.value),e.revenue!=null&&(n.revenue=e.revenue),{events:[n]}}function Nc(e){var t,n,r=e.layer,i=e.experiment,o=e.variation,a=e.ruleKey,s=e.flagKey,l=e.ruleType,u=e.enabled,c=r?r.id:null,d=(t=i==null?void 0:i.id)!==null&&t!==void 0?t:"",p=(n=o==null?void 0:o.id)!==null&&n!==void 0?n:"",f=o?o.key:"";return{decisions:[{campaign_id:c,experiment_id:d,variation_id:p,metadata:{flag_key:s,rule_key:a,rule_type:l,variation_key:f,enabled:u}}],events:[{entity_id:c,timestamp:e.timestamp,key:Ym,uuid:e.uuid}]}}function Qa(e){var t={snapshots:[],visitor_id:e.user.id,attributes:[]};return e.user.attributes.forEach(function(n){t.attributes.push({entity_id:n.entityId,key:n.key,type:"custom",value:n.value})}),typeof e.context.botFiltering=="boolean"&&t.attributes.push({entity_id:pl,key:pl,type:Zm,value:e.context.botFiltering}),t}function Qm(e){var t=Qa(e);return t.snapshots.push(Nc(e)),{client_name:e.context.clientName,client_version:e.context.clientVersion,account_id:e.context.accountId,project_id:e.context.projectId,revision:e.context.revision,anonymize_ip:e.context.anonymizeIP,enrich_decisions:!0,visitors:[t]}}rt.buildImpressionEventV1=Qm;function Jm(e){var t=Qa(e);return t.snapshots.push(Oc(e)),{client_name:e.context.clientName,client_version:e.context.clientVersion,account_id:e.context.accountId,project_id:e.context.projectId,revision:e.context.revision,anonymize_ip:e.context.anonymizeIP,enrich_decisions:!0,visitors:[t]}}rt.buildConversionEventV1=Jm;function Xm(e){return{url:"https://logx.optimizely.com/v1/events",httpVerb:"POST",params:Lc(e)}}rt.formatEvents=Xm;var Qi={},Ja={};Object.defineProperty(Ja,"__esModule",{value:!0});var eg=function(){function e(){this.reqsInFlightCount=0,this.reqsCompleteResolvers=[]}return e.prototype.trackRequest=function(t){var n=this;this.reqsInFlightCount++;var r=function(){n.reqsInFlightCount--,n.reqsInFlightCount===0&&(n.reqsCompleteResolvers.forEach(function(i){return i()}),n.reqsCompleteResolvers=[])};t.then(r,r)},e.prototype.onRequestsComplete=function(){var t=this;return new Promise(function(n){t.reqsInFlightCount===0?n():t.reqsCompleteResolvers.push(n)})},e}();Ja.default=eg;var tg=le&&le.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{u(r.next(c))}catch(d){a(d)}}function l(c){try{u(r.throw(c))}catch(d){a(d)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})},ng=le&&le.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},rg=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.LogTierV1EventProcessor=void 0;var ig=Se,Sn=Za,og=rg(Ja),ag=Lr,sg=rt,hl=ig.getLogger("LogTierV1EventProcessor"),lg=function(){function e(t){var n=t.dispatcher,r=t.flushInterval,i=r===void 0?Sn.DEFAULT_FLUSH_INTERVAL:r,o=t.batchSize,a=o===void 0?Sn.DEFAULT_BATCH_SIZE:o,s=t.notificationCenter;this.dispatcher=n,this.notificationCenter=s,this.requestTracker=new og.default,i=Sn.validateAndGetFlushInterval(i),a=Sn.validateAndGetBatchSize(a),this.queue=Sn.getQueue(a,i,this.drainQueue.bind(this),ag.areEventContextsEqual)}return e.prototype.drainQueue=function(t){var n=this,r=new Promise(function(i){if(hl.debug("draining queue with %s events",t.length),t.length===0){i();return}var o=sg.formatEvents(t);n.dispatcher.dispatchEvent(o,function(){i()}),Sn.sendEventNotification(n.notificationCenter,o)});return this.requestTracker.trackRequest(r),r},e.prototype.process=function(t){this.queue.enqueue(t)},e.prototype.stop=function(){try{return this.queue.stop(),this.requestTracker.onRequestsComplete()}catch(t){hl.error('Error stopping EventProcessor: "%s"',t.message,t)}return Promise.resolve()},e.prototype.start=function(){return tg(this,void 0,void 0,function(){return ng(this,function(t){return this.queue.start(),[2]})})},e}();Qi.LogTierV1EventProcessor=lg;(function(e){var t=le&&le.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o),Object.defineProperty(r,a,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=le&&le.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Lr,e),n(Za,e),n(Ac,e),n(Tc,e),n(Fn,e),n(rt,e),n(Qi,e)})(Dm);var ki={exports:{}},ml=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(ml){var gl=new Uint8Array(16);ki.exports=function(){return ml(gl),gl}}else{var vl=new Array(16);ki.exports=function(){for(var t=0,n;t<16;t++)(t&3)===0&&(n=Math.random()*4294967296),vl[t]=n>>>((t&3)<<3)&255;return vl}}var Dc=[];for(var Wr=0;Wr<256;++Wr)Dc[Wr]=(Wr+256).toString(16).substr(1);function ug(e,t){var n=t||0,r=Dc;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}var Uc=ug,cg=ki.exports,dg=Uc,yl,yo,_o=0,bo=0;function fg(e,t,n){var r=t&&n||0,i=t||[];e=e||{};var o=e.node||yl,a=e.clockseq!==void 0?e.clockseq:yo;if(o==null||a==null){var s=cg();o==null&&(o=yl=[s[0]|1,s[1],s[2],s[3],s[4],s[5]]),a==null&&(a=yo=(s[6]<<8|s[7])&16383)}var l=e.msecs!==void 0?e.msecs:new Date().getTime(),u=e.nsecs!==void 0?e.nsecs:bo+1,c=l-_o+(u-bo)/1e4;if(c<0&&e.clockseq===void 0&&(a=a+1&16383),(c<0||l>_o)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_o=l,bo=u,yo=a,l+=122192928e5;var d=((l&268435455)*1e4+u)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var p=l/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(var f=0;f<6;++f)i[r+f]=o[f];return t||dg(i)}var pg=fg,hg=ki.exports,mg=Uc;function gg(e,t,n){var r=t&&n||0;typeof e=="string"&&(t=e==="binary"?new Array(16):null,e=null),e=e||{};var i=e.random||(e.rng||hg)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||mg(i)}var vg=gg,yg=pg,Pc=vg,Mc=Pc;Mc.v1=yg;Mc.v4=Pc;var _g={exports:{}};(function(e){(function(){function t(i,o){for(var a=i.length,s=o^a,l=0,u;a>=4;)u=i.charCodeAt(l)&255|(i.charCodeAt(++l)&255)<<8|(i.charCodeAt(++l)&255)<<16|(i.charCodeAt(++l)&255)<<24,u=(u&65535)*1540483477+(((u>>>16)*1540483477&65535)<<16),u^=u>>>24,u=(u&65535)*1540483477+(((u>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^u,a-=4,++l;switch(a){case 3:s^=(i.charCodeAt(l+2)&255)<<16;case 2:s^=(i.charCodeAt(l+1)&255)<<8;case 1:s^=i.charCodeAt(l)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}function n(i,o){var a,s,l,u,c,d,p,f;for(a=i.length&3,s=i.length-a,l=o,c=3432918353,d=461845907,f=0;f<s;)p=i.charCodeAt(f)&255|(i.charCodeAt(++f)&255)<<8|(i.charCodeAt(++f)&255)<<16|(i.charCodeAt(++f)&255)<<24,++f,p=(p&65535)*c+(((p>>>16)*c&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*d+(((p>>>16)*d&65535)<<16)&4294967295,l^=p,l=l<<13|l>>>19,u=(l&65535)*5+(((l>>>16)*5&65535)<<16)&4294967295,l=(u&65535)+27492+(((u>>>16)+58964&65535)<<16);switch(p=0,a){case 3:p^=(i.charCodeAt(f+2)&255)<<16;case 2:p^=(i.charCodeAt(f+1)&255)<<8;case 1:p^=i.charCodeAt(f)&255,p=(p&65535)*c+(((p>>>16)*c&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*d+(((p>>>16)*d&65535)<<16)&4294967295,l^=p}return l^=i.length,l^=l>>>16,l=(l&65535)*2246822507+(((l>>>16)*2246822507&65535)<<16)&4294967295,l^=l>>>13,l=(l&65535)*3266489909+(((l>>>16)*3266489909&65535)<<16)&4294967295,l^=l>>>16,l>>>0}var r=n;r.v2=t,r.v3=n,e.exports=r})()})(_g);var Vc={},Xa={},es={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.DEFAULT_UPDATE_INTERVAL=5*60*1e3;ht.MIN_UPDATE_INTERVAL=1e3;ht.DEFAULT_URL_TEMPLATE="https://cdn.optimizely.com/datafiles/%s.json";ht.DEFAULT_AUTHENTICATED_URL_TEMPLATE="https://config.optimizely.com/datafiles/auth/%s.json";ht.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT=[0,8,16,32,64,128,256,512];ht.REQUEST_TIMEOUT_MS=60*1e3;Object.defineProperty(es,"__esModule",{value:!0});var bg=ht,wg=Se,Cg=wg.getLogger("DatafileManager"),Eg="GET",Sg=4;function Ig(e){var t=e.getAllResponseHeaders();if(t===null)return{};var n=t.split(`\r
20
- `),r={};return n.forEach(function(i){var o=i.indexOf(": ");if(o>-1){var a=i.slice(0,o),s=i.slice(o+2);s.length>0&&(r[a]=s)}}),r}function kg(e,t){Object.keys(e).forEach(function(n){var r=e[n];t.setRequestHeader(n,r)})}function xg(e,t){var n=new XMLHttpRequest,r=new Promise(function(i,o){n.open(Eg,e,!0),kg(t,n),n.onreadystatechange=function(){if(n.readyState===Sg){var a=n.status;if(a===0){o(new Error("Request error"));return}var s=Ig(n),l={statusCode:n.status,body:n.responseText,headers:s};i(l)}},n.timeout=bg.REQUEST_TIMEOUT_MS,n.ontimeout=function(){Cg.error("Request timed out")},n.send()});return{responsePromise:r,abort:function(){n.abort()}}}es.makeGetRequest=xg;var ts={},ns={};Object.defineProperty(ns,"__esModule",{value:!0});var Ag=function(){function e(){this.listeners={},this.listenerId=1}return e.prototype.on=function(t,n){var r=this;this.listeners[t]||(this.listeners[t]={});var i=String(this.listenerId);return this.listenerId++,this.listeners[t][i]=n,function(){r.listeners[t]&&delete r.listeners[t][i]}},e.prototype.emit=function(t,n){var r=this.listeners[t];r&&Object.keys(r).forEach(function(i){var o=r[i];o(n)})},e.prototype.removeAllListeners=function(){this.listeners={}},e}();ns.default=Ag;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});var wo=ht;function Tg(){return Math.round(Math.random()*1e3)}var Rg=function(){function e(){this.errorCount=0}return e.prototype.getDelay=function(){if(this.errorCount===0)return 0;var t=wo.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT[Math.min(wo.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT.length-1,this.errorCount)];return t*1e3+Tg()},e.prototype.countError=function(){this.errorCount<wo.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT.length-1&&this.errorCount++},e.prototype.reset=function(){this.errorCount=0},e}();rs.default=Rg;var xi=le&&le.__assign||function(){return xi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},xi.apply(this,arguments)},Fc=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ts,"__esModule",{value:!0});var Lg=Se,Og=Wn,Ng=Fc(ns),tr=ht,Dg=Fc(rs),We=Lg.getLogger("DatafileManager"),Ug="update";function Pg(e){return e>=tr.MIN_UPDATE_INTERVAL}function _l(e){return e>=200&&e<400}var Mg={get:function(){return Promise.resolve("")},set:function(){return Promise.resolve()},contains:function(){return Promise.resolve(!1)},remove:function(){return Promise.resolve()}},Vg=function(){function e(t){var n=this,r=xi(xi({},this.getConfigDefaults()),t),i=r.datafile,o=r.autoUpdate,a=o===void 0?!1:o,s=r.sdkKey,l=r.updateInterval,u=l===void 0?tr.DEFAULT_UPDATE_INTERVAL:l,c=r.urlTemplate,d=c===void 0?tr.DEFAULT_URL_TEMPLATE:c,p=r.cache,f=p===void 0?Mg:p;this.cache=f,this.cacheKey="opt-datafile-"+s,this.isReadyPromiseSettled=!1,this.readyPromiseResolver=function(){},this.readyPromiseRejecter=function(){},this.readyPromise=new Promise(function(h,m){n.readyPromiseResolver=h,n.readyPromiseRejecter=m}),i?(this.currentDatafile=i,s||this.resolveReadyPromise()):this.currentDatafile="",this.isStarted=!1,this.datafileUrl=Og.sprintf(d,s),this.emitter=new Ng.default,this.autoUpdate=a,Pg(u)?this.updateInterval=u:(We.warn("Invalid updateInterval %s, defaulting to %s",u,tr.DEFAULT_UPDATE_INTERVAL),this.updateInterval=tr.DEFAULT_UPDATE_INTERVAL),this.currentTimeout=null,this.currentRequest=null,this.backoffController=new Dg.default,this.syncOnCurrentRequestComplete=!1}return e.prototype.get=function(){return this.currentDatafile},e.prototype.start=function(){this.isStarted||(We.debug("Datafile manager started"),this.isStarted=!0,this.backoffController.reset(),this.setDatafileFromCacheIfAvailable(),this.syncDatafile())},e.prototype.stop=function(){return We.debug("Datafile manager stopped"),this.isStarted=!1,this.currentTimeout&&(clearTimeout(this.currentTimeout),this.currentTimeout=null),this.emitter.removeAllListeners(),this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null),Promise.resolve()},e.prototype.onReady=function(){return this.readyPromise},e.prototype.on=function(t,n){return this.emitter.on(t,n)},e.prototype.onRequestRejected=function(t){!this.isStarted||(this.backoffController.countError(),t instanceof Error?We.error("Error fetching datafile: %s",t.message,t):typeof t=="string"?We.error("Error fetching datafile: %s",t):We.error("Error fetching datafile"))},e.prototype.onRequestResolved=function(t){if(!!this.isStarted){typeof t.statusCode<"u"&&_l(t.statusCode)?this.backoffController.reset():this.backoffController.countError(),this.trySavingLastModified(t.headers);var n=this.getNextDatafileFromResponse(t);if(n!=="")if(We.info("Updating datafile from response"),this.currentDatafile=n,this.cache.set(this.cacheKey,n),!this.isReadyPromiseSettled)this.resolveReadyPromise();else{var r={datafile:n};this.emitter.emit(Ug,r)}}},e.prototype.onRequestComplete=function(){!this.isStarted||(this.currentRequest=null,!this.isReadyPromiseSettled&&!this.autoUpdate&&this.rejectReadyPromise(new Error("Failed to become ready")),this.autoUpdate&&this.syncOnCurrentRequestComplete&&this.syncDatafile(),this.syncOnCurrentRequestComplete=!1)},e.prototype.syncDatafile=function(){var t=this,n={};this.lastResponseLastModified&&(n["if-modified-since"]=this.lastResponseLastModified),We.debug("Making datafile request to url %s with headers: %s",this.datafileUrl,function(){return JSON.stringify(n)}),this.currentRequest=this.makeGetRequest(this.datafileUrl,n);var r=function(){t.onRequestComplete()},i=function(a){t.onRequestResolved(a)},o=function(a){t.onRequestRejected(a)};this.currentRequest.responsePromise.then(i,o).then(r,r),this.autoUpdate&&this.scheduleNextUpdate()},e.prototype.resolveReadyPromise=function(){this.readyPromiseResolver(),this.isReadyPromiseSettled=!0},e.prototype.rejectReadyPromise=function(t){this.readyPromiseRejecter(t),this.isReadyPromiseSettled=!0},e.prototype.scheduleNextUpdate=function(){var t=this,n=this.backoffController.getDelay(),r=Math.max(n,this.updateInterval);We.debug("Scheduling sync in %s ms",r),this.currentTimeout=setTimeout(function(){t.currentRequest?t.syncOnCurrentRequestComplete=!0:t.syncDatafile()},r)},e.prototype.getNextDatafileFromResponse=function(t){return We.debug("Response status code: %s",t.statusCode),typeof t.statusCode>"u"||t.statusCode===304?"":_l(t.statusCode)?t.body:""},e.prototype.trySavingLastModified=function(t){var n=t["last-modified"]||t["Last-Modified"];typeof n<"u"&&(this.lastResponseLastModified=n,We.debug("Saved last modified header value from response: %s",this.lastResponseLastModified))},e.prototype.setDatafileFromCacheIfAvailable=function(){var t=this;this.cache.get(this.cacheKey).then(function(n){t.isStarted&&!t.isReadyPromiseSettled&&n!==""&&(We.debug("Using datafile from cache"),t.currentDatafile=n,t.resolveReadyPromise())})},e}();ts.default=Vg;var Fg=le&&le.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bg=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xa,"__esModule",{value:!0});var jg=es,Hg=Bg(ts),zg=function(e){Fg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeGetRequest=function(n,r){return jg.makeGetRequest(n,r)},t.prototype.getConfigDefaults=function(){return{autoUpdate:!1}},t}(Hg.default);Xa.default=zg;Object.defineProperty(Vc,"__esModule",{value:!0});var Gg=Xa;Vc.HttpPollingDatafileManager=Gg.default;var Kg={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4},Wg={CONDITION_EVALUATOR_ERROR:"%s: Error evaluating audience condition of type %s: %s",DATAFILE_AND_SDK_KEY_MISSING:"%s: You must provide at least one of sdkKey or datafile. Cannot start Optimizely",EXPERIMENT_KEY_NOT_IN_DATAFILE:"%s: Experiment key %s is not in datafile.",FEATURE_NOT_IN_DATAFILE:"%s: Feature key %s is not in datafile.",IMPROPERLY_FORMATTED_EXPERIMENT:"%s: Experiment key %s is improperly formatted.",INVALID_ATTRIBUTES:"%s: Provided attributes are in an invalid format.",INVALID_BUCKETING_ID:"%s: Unable to generate hash for bucketing ID %s: %s",INVALID_DATAFILE:"%s: Datafile is invalid - property %s: %s",INVALID_DATAFILE_MALFORMED:"%s: Datafile is invalid because it is malformed.",INVALID_CONFIG:"%s: Provided Optimizely config is in an invalid format.",INVALID_JSON:"%s: JSON object is not valid.",INVALID_ERROR_HANDLER:'%s: Provided "errorHandler" is in an invalid format.',INVALID_EVENT_DISPATCHER:'%s: Provided "eventDispatcher" is in an invalid format.',INVALID_EVENT_TAGS:"%s: Provided event tags are in an invalid format.",INVALID_EXPERIMENT_KEY:"%s: Experiment key %s is not in datafile. It is either invalid, paused, or archived.",INVALID_EXPERIMENT_ID:"%s: Experiment ID %s is not in datafile.",INVALID_GROUP_ID:"%s: Group ID %s is not in datafile.",INVALID_LOGGER:'%s: Provided "logger" is in an invalid format.',INVALID_ROLLOUT_ID:"%s: Invalid rollout ID %s attached to feature %s",INVALID_USER_ID:"%s: Provided user ID is in an invalid format.",INVALID_USER_PROFILE_SERVICE:"%s: Provided user profile service instance is in an invalid format: %s.",NO_DATAFILE_SPECIFIED:"%s: No datafile specified. Cannot start optimizely.",NO_JSON_PROVIDED:"%s: No JSON object to validate against schema.",NO_VARIATION_FOR_EXPERIMENT_KEY:"%s: No variation key %s defined in datafile for experiment %s.",UNDEFINED_ATTRIBUTE:"%s: Provided attribute: %s has an undefined value.",UNRECOGNIZED_ATTRIBUTE:"%s: Unrecognized attribute %s provided. Pruning before sending event to Optimizely.",UNABLE_TO_CAST_VALUE:"%s: Unable to cast value %s to type %s, returning null.",USER_NOT_IN_FORCED_VARIATION:"%s: User %s is not in the forced variation map. Cannot remove their forced variation.",USER_PROFILE_LOOKUP_ERROR:'%s: Error while looking up user profile for user ID "%s": %s.',USER_PROFILE_SAVE_ERROR:'%s: Error while saving user profile for user ID "%s": %s.',VARIABLE_KEY_NOT_IN_DATAFILE:'%s: Variable with key "%s" associated with feature with key "%s" is not in datafile.',VARIATION_ID_NOT_IN_DATAFILE:"%s: No variation ID %s defined in datafile for experiment %s.",VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT:"%s: Variation ID %s is not in the datafile.",INVALID_INPUT_FORMAT:"%s: Provided %s is in an invalid format.",INVALID_DATAFILE_VERSION:"%s: This version of the JavaScript SDK does not support the given datafile version: %s",INVALID_VARIATION_KEY:"%s: Provided variation key is in an invalid format."},qg={ACTIVATE_USER:"%s: Activating user %s in experiment %s.",DISPATCH_CONVERSION_EVENT:"%s: Dispatching conversion event to URL %s with params %s.",DISPATCH_IMPRESSION_EVENT:"%s: Dispatching impression event to URL %s with params %s.",DEPRECATED_EVENT_VALUE:"%s: Event value is deprecated in %s call.",EVENT_KEY_NOT_FOUND:"%s: Event key %s is not in datafile.",EXPERIMENT_NOT_RUNNING:"%s: Experiment %s is not running.",FEATURE_ENABLED_FOR_USER:"%s: Feature %s is enabled for user %s.",FEATURE_NOT_ENABLED_FOR_USER:"%s: Feature %s is not enabled for user %s.",FEATURE_HAS_NO_EXPERIMENTS:"%s: Feature %s is not attached to any experiments.",FAILED_TO_PARSE_VALUE:'%s: Failed to parse event value "%s" from event tags.',FAILED_TO_PARSE_REVENUE:'%s: Failed to parse revenue value "%s" from event tags.',FORCED_BUCKETING_FAILED:"%s: Variation key %s is not in datafile. Not activating user %s.",INVALID_OBJECT:"%s: Optimizely object is not valid. Failing %s.",INVALID_CLIENT_ENGINE:"%s: Invalid client engine passed: %s. Defaulting to node-sdk.",INVALID_DEFAULT_DECIDE_OPTIONS:"%s: Provided default decide options is not an array.",INVALID_DECIDE_OPTIONS:"%s: Provided decide options is not an array. Using default decide options.",INVALID_VARIATION_ID:"%s: Bucketed into an invalid variation ID. Returning null.",NOTIFICATION_LISTENER_EXCEPTION:"%s: Notification listener for (%s) threw exception: %s",NO_ROLLOUT_EXISTS:"%s: There is no rollout of feature %s.",NOT_ACTIVATING_USER:"%s: Not activating user %s for experiment %s.",NOT_TRACKING_USER:"%s: Not tracking user %s.",PARSED_REVENUE_VALUE:'%s: Parsed revenue value "%s" from event tags.',PARSED_NUMERIC_VALUE:'%s: Parsed event value "%s" from event tags.',RETURNING_STORED_VARIATION:'%s: Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.',ROLLOUT_HAS_NO_EXPERIMENTS:"%s: Rollout of feature %s has no experiments",SAVED_VARIATION:'%s: Saved variation "%s" of experiment "%s" for user "%s".',SAVED_VARIATION_NOT_FOUND:"%s: User %s was previously bucketed into variation with ID %s for experiment %s, but no matching variation was found.",SHOULD_NOT_DISPATCH_ACTIVATE:'%s: Experiment %s is not in "Running" state. Not activating user.',SKIPPING_JSON_VALIDATION:"%s: Skipping JSON schema validation.",TRACK_EVENT:"%s: Tracking event %s for user %s.",UNRECOGNIZED_DECIDE_OPTION:"%s: Unrecognized decide option %s provided.",USER_ASSIGNED_TO_EXPERIMENT_BUCKET:"%s: Assigned bucket %s to user with bucketing ID %s.",USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is in experiment %s of group %s.",USER_BUCKETED_INTO_TARGETING_RULE:"%s: User %s bucketed into targeting rule %s.",USER_IN_FEATURE_EXPERIMENT:"%s: User %s is in variation %s of experiment %s on the feature %s.",USER_IN_ROLLOUT:"%s: User %s is in rollout of feature %s.",USER_NOT_BUCKETED_INTO_EVERYONE_TARGETING_RULE:"%s: User %s not bucketed into everyone targeting rule due to traffic allocation.",USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is not in experiment %s of group %s.",USER_NOT_BUCKETED_INTO_ANY_EXPERIMENT_IN_GROUP:"%s: User %s is not in any experiment of group %s.",USER_NOT_BUCKETED_INTO_TARGETING_RULE:"%s User %s not bucketed into targeting rule %s due to traffic allocation. Trying everyone rule.",USER_NOT_IN_FEATURE_EXPERIMENT:"%s: User %s is not in any experiment on the feature %s.",USER_NOT_IN_ROLLOUT:"%s: User %s is not in rollout of feature %s.",USER_FORCED_IN_VARIATION:"%s: User %s is forced in variation %s.",USER_MAPPED_TO_FORCED_VARIATION:"%s: Set variation %s for experiment %s and user %s in the forced variation map.",USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE:"%s: User %s does not meet conditions for targeting rule %s.",USER_MEETS_CONDITIONS_FOR_TARGETING_RULE:"%s: User %s meets conditions for targeting rule %s.",USER_HAS_VARIATION:"%s: User %s is in variation %s of experiment %s.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_VARIATION:"%s: Variation %s is mapped to experiment %s and user %s in the forced variation map.",USER_HAS_NO_VARIATION:"%s: User %s is in no variation of experiment %s.",USER_HAS_NO_FORCED_VARIATION:"%s: User %s is not in the forced variation map.",USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT:"%s: No experiment %s mapped to user %s in the forced variation map.",USER_NOT_IN_ANY_EXPERIMENT:"%s: User %s is not in any experiment of group %s.",USER_NOT_IN_EXPERIMENT:"%s: User %s does not meet conditions to be in experiment %s.",USER_RECEIVED_DEFAULT_VARIABLE_VALUE:'%s: User "%s" is not in any variation or rollout rule. Returning default value for variable "%s" of feature flag "%s".',FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Feature "%s" is not enabled for user %s. Returning the default variable value "%s".',VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Variable "%s" is not used in variation "%s". Returning default value.',USER_RECEIVED_VARIABLE_VALUE:'%s: Got variable value "%s" for variable "%s" of feature flag "%s"',VALID_DATAFILE:"%s: Datafile is valid.",VALID_USER_PROFILE_SERVICE:"%s: Valid user profile service provided.",VARIATION_REMOVED_FOR_USER:"%s: Variation mapped to experiment %s has been removed for user %s.",VARIABLE_REQUESTED_WITH_WRONG_TYPE:'%s: Requested variable type "%s", but variable is of type "%s". Use correct API to retrieve value. Returning None.',VALID_BUCKETING_ID:'%s: BucketingId is valid: "%s"',BUCKETING_ID_NOT_STRING:"%s: BucketingID attribute is not a string. Defaulted to userId",EVALUATING_AUDIENCE:'%s: Starting to evaluate audience "%s" with conditions: %s.',EVALUATING_AUDIENCES_COMBINED:'%s: Evaluating audiences for %s "%s": %s.',AUDIENCE_EVALUATION_RESULT:'%s: Audience "%s" evaluated to %s.',AUDIENCE_EVALUATION_RESULT_COMBINED:"%s: Audiences for %s %s collectively evaluated to %s.",MISSING_ATTRIBUTE_VALUE:'%s: Audience condition %s evaluated to UNKNOWN because no value was passed for user attribute "%s".',UNEXPECTED_CONDITION_VALUE:"%s: Audience condition %s evaluated to UNKNOWN because the condition value is not supported.",UNEXPECTED_TYPE:'%s: Audience condition %s evaluated to UNKNOWN because a value of type "%s" was passed for user attribute "%s".',UNEXPECTED_TYPE_NULL:'%s: Audience condition %s evaluated to UNKNOWN because a null value was passed for user attribute "%s".',UNKNOWN_CONDITION_TYPE:"%s: Audience condition %s has an unknown condition type. You may need to upgrade to a newer release of the Optimizely SDK.",UNKNOWN_MATCH_TYPE:"%s: Audience condition %s uses an unknown match type. You may need to upgrade to a newer release of the Optimizely SDK.",UPDATED_OPTIMIZELY_CONFIG:"%s: Updated Optimizely config to revision %s (project id %s)",OUT_OF_BOUNDS:'%s: Audience condition %s evaluated to UNKNOWN because the number value for user attribute "%s" is not in the range [-2^53, +2^53].',UNABLE_TO_ATTACH_UNLOAD:'%s: unable to bind optimizely.close() to page unload event: "%s"'},$g={BOT_FILTERING:"$opt_bot_filtering",BUCKETING_ID:"$opt_bucketing_id",STICKY_BUCKETING_KEY:"$opt_experiment_bucket_map",USER_AGENT:"$opt_user_agent",FORCED_DECISION_NULL_RULE_KEY:"$opt_null_rule_key"},Yg="javascript-sdk",Zg="node-sdk",Qg="react-sdk",Jg="react-native-sdk",Xg="react-native-js-sdk",ev="4.9.4",tv="4.9.4",nv={AB_TEST:"ab-test",FEATURE:"feature",FEATURE_TEST:"feature-test",FEATURE_VARIABLE:"feature-variable",ALL_FEATURE_VARIABLES:"all-feature-variables",FLAG:"flag"},rv={FEATURE_TEST:"feature-test",ROLLOUT:"rollout",EXPERIMENT:"experiment"},iv={RULE:"rule",EXPERIMENT:"experiment"},ov={BOOLEAN:"boolean",DOUBLE:"double",INTEGER:"integer",STRING:"string",JSON:"json"},ri={V2:"2",V3:"3",V4:"4"},av={SDK_NOT_READY:"Optimizely SDK not configured properly yet.",FLAG_KEY_INVALID:'No flag was found for key "%s".',VARIABLE_VALUE_INVALID:'Variable value for key "%s" is invalid or wrong type.'},Jo;(function(e){e.ACTIVATE="ACTIVATE:experiment, user_id,attributes, variation, event",e.DECISION="DECISION:type, userId, attributes, decisionInfo",e.LOG_EVENT="LOG_EVENT:logEvent",e.OPTIMIZELY_CONFIG_UPDATE="OPTIMIZELY_CONFIG_UPDATE",e.TRACK="TRACK:event_key, user_id, attributes, event_tags, event"})(Jo||(Jo={}));var sv=Object.freeze({__proto__:null,LOG_LEVEL:Kg,ERROR_MESSAGES:Wg,LOG_MESSAGES:qg,CONTROL_ATTRIBUTES:$g,JAVASCRIPT_CLIENT_ENGINE:Yg,NODE_CLIENT_ENGINE:Zg,REACT_CLIENT_ENGINE:Qg,REACT_NATIVE_CLIENT_ENGINE:Jg,REACT_NATIVE_JS_CLIENT_ENGINE:Xg,BROWSER_CLIENT_VERSION:ev,NODE_CLIENT_VERSION:tv,DECISION_NOTIFICATION_TYPES:nv,DECISION_SOURCES:rv,AUDIENCE_EVALUATION_TYPES:iv,FEATURE_VARIABLE_TYPES:ov,DATAFILE_VERSIONS:ri,DECISION_MESSAGES:av,get NOTIFICATION_TYPES(){return Jo}});ri.V2,ri.V3,ri.V4;(function(){function e(){}return e.prototype.log=function(){},e})();function lv(e){return new Se.ConsoleLogHandler(e)}var bl;(function(e){e.BOOLEAN="boolean",e.DOUBLE="double",e.INTEGER="integer",e.STRING="string",e.JSON="json"})(bl||(bl={}));var wl;(function(e){e.DISABLE_DECISION_EVENT="DISABLE_DECISION_EVENT",e.ENABLED_FLAGS_ONLY="ENABLED_FLAGS_ONLY",e.IGNORE_USER_PROFILE_SERVICE="IGNORE_USER_PROFILE_SERVICE",e.INCLUDE_REASONS="INCLUDE_REASONS",e.EXCLUDE_VARIABLES="EXCLUDE_VARIABLES"})(wl||(wl={}));Se.getLogger();Se.getLogger();Se.getLogger();Se.getLogger();Se.getLogger("EVENT_BUILDER");Se.getLogger();Se.setLogHandler(lv());Se.setLogLevel(Se.LogLevel.INFO);let qr;const uv=new Uint8Array(16);function cv(){if(!qr&&(qr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qr(uv)}const ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));function dv(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}const fv=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Cl={randomUUID:fv};function Kt(e,t,n){if(Cl.randomUUID&&!t&&!e)return Cl.randomUUID();e=e||{};const r=e.random||(e.rng||cv)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return dv(r)}const Nn="ul-app";var N=(e=>(e.Caption="ul-caption",e.CardContainer="ul-card__container",e.CardMainContent="ul-card-main-content",e.Choice="choice",e.ChoiceCheckbox="select-checkbox",e.ChoiceGroup="ul-card__choices",e.ChoiceLabel="select-label",e.ChoiceLabelContainer="choice-label-container",e.ChoiceRadio="select-radio",e.ChoiceTextEntryContainer="choice-text-entry-container",e.ChoiceTextInput="choice-text-input",e.CloseButton="close-btn",e.CloseContainer="close-container",e.ConsentLegalNameInput="ul-consent-legal__name-input",e.CustomStyle="ul-custom-style",e.DesktopSuffix="--desktop",e.FadeInTransition="fade-in-transition",e.LikertNumber="likert-number",e.LikertSmiley="likert-smiley",e.LikertStar="likert-star",e.LoadingSpinner="ul-loading-spinner",e.LoadingSpinnerContainer="ul-loading-spinner-container",e.LoadingSpinnerFirst="first",e.LoadingSpinnerFourth="fourth",e.LoadingSpinnerSecond="second",e.LoadingSpinnerThird="third",e.MobileSuffix="--mobile",e.NPSNumber="nps-number",e.OpenTextInput="ul-card-text__input",e.QuestionHeader="ul-question",e.VideoCard="ul-card--video",e.CheckmarkButton="ul-button-checkmark",e.InactiveButton="ul-button-inactive",e.LeftAlignButton="ul-button-left-align",e.ButtonDisabled="sprig-button-disabled",e.SkipButton="ul-card-skip__button",e))(N||{});const is="#e6e6e6",lr="#bd282a",pv=500,hv=1030;var He=(e=>(e.Preview="sprig.previewKey",e.Credentials="userleap.ids",e.PageViews="userleap.pageviews",e))(He||{});const Bc=()=>{try{return window.parent.Intercom}catch(e){return console.error(e),null}},mv=()=>{const e=Bc();!e||(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)},gv=()=>{const e=Bc();!e||(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},vv=Object.freeze(Object.defineProperty({__proto__:null,enable:mv,disable:gv},Symbol.toStringTag,{value:"Module"})),El=[vv];class Xo{static disable(){El.forEach(t=>t.disable())}static enable(){El.forEach(t=>t.enable())}}const yv=1,Bn=e=>e instanceof HTMLElement,_v=e=>e instanceof HTMLInputElement,ur=e=>e instanceof HTMLTextAreaElement,jc=(e,t,n)=>{const r=e.createElement("style");n&&(r.nonce=n),r.textContent=t,r.id=N.CustomStyle,e.head.appendChild(r)},Hc=e=>{const t=e.querySelector(`.${N.CardContainer}`);let n=600,r=0;if(t){n=t.scrollHeight;const i=getComputedStyle(t),o=parseFloat(i.marginTop)+parseFloat(i.marginBottom),a=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth);r=o+a}return n+r+yv},bv=e=>{const t=e.querySelector(`.${N.CardContainer}`);t&&(t.scrollTop=0)};var wv=class extends Error{constructor(e,t,n){super(`Possible EventEmitter memory leak detected. ${n} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=t,this.count=n,this.name="MaxListenersExceededWarning"}},zc=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=zc.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}_emitInternalEvent(e,t,n){this.emit(e,t,n)}_getListeners(e){return Array.prototype.concat.apply([],this.events.get(e))||[]}_removeListener(e,t){const n=e.indexOf(t);return n>-1&&e.splice(n,1),[]}_wrapOnceListener(e,t){const n=(...r)=>(this.removeListener(e,n),t.apply(this,r));return Object.defineProperty(n,"name",{value:t.name}),n}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(e,...t){const n=this._getListeners(e);return n.forEach(r=>{r.apply(this,t)}),n.length>0}addListener(e,t){this._emitInternalEvent("newListener",e,t);const n=this._getListeners(e).concat(t);if(this.events.set(e,n),this.maxListeners>0&&this.listenerCount(e)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;const r=new wv(this,e,this.listenerCount(e));console.warn(r)}return this}on(e,t){return this.addListener(e,t)}once(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}prependListener(e,t){const n=this._getListeners(e);if(n.length>0){const r=[t].concat(n);this.events.set(e,r)}else this.events.set(e,n.concat(t));return this}prependOnceListener(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}removeListener(e,t){const n=this._getListeners(e);return n.length>0&&(this._removeListener(n,t),this.events.set(e,n),this._emitInternalEvent("removeListener",e,t)),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){return e?this.events.delete(e):this.events.clear(),this}listeners(e){return Array.from(this._getListeners(e))}listenerCount(e){return this._getListeners(e).length}rawListeners(e){return this.listeners(e)}},Gc=zc;Gc.defaultMaxListeners=10;const Z=new Gc;var nr=(e=>(e.BottomLeft="bottomLeft",e.BottomRight="bottomRight",e.Center="center",e.TopLeft="topLeft",e.TopRight="topRight",e))(nr||{}),ct=(e=>(e.Error="x-ul-error",e.EnvironmentID="x-ul-environment-id",e.InstallationMethod="x-ul-installation-method",e.PartnerAnonymousId="x-ul-anonymous-id",e.Platform="userleap-platform",e.PreviewMode="x-ul-preview-mode",e.UserID="x-ul-user-id",e.VisitorID="x-ul-visitor-id",e))(ct||{}),mn=(e=>(e.Email="email",e.Link="link",e.Web="web",e))(mn||{}),Tt=(e=>(e.Npm="web-npm",e.NpmBundled="web-npm-bundled",e.Gtm="web-gtm",e.Segment="web-segment",e.SegmentAndroid="android-segment",e.SegmentReactNative="react-native-segment",e.SegmentIOS="ios-segment",e.Snippet="web-snippet",e))(Tt||{});const Ai=e=>new Promise(t=>{setTimeout(()=>{t()},e)}),Dn=({"userleap-platform":e})=>e!==mn.Web,_e=(e,t)=>{const n=t?N.MobileSuffix:N.DesktopSuffix;return[e+n,e]},mt=(e,t)=>[e,`${e}__${t}`];class Cv{constructor(t){Ae(this,"payload");Ae(this,"promise");Ae(this,"reject",()=>{});Ae(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((n,r)=>{this.reject=r,this.resolve=n})}resolveRequest(t){this.resolve(t)}}const Ev={RATELIMIT_RESET_DEFAULT:10};let Kc=!1,Wc="",$r=!1,qc=!1,ii=[];const Sv=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?Tt.Gtm:e._segment?Tt.Segment:Tt.Snippet,ea=e=>{var t;(t=e==null?void 0:e.blockedURI)!=null&&t.includes(window.UserLeap._API_URL)&&(qc=!0,console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`),document.removeEventListener("securitypolicyviolation",ea))},ta=(e="")=>{Kc=!0,Wc=e};function Or(e={}){const t={"Content-Type":"application/json","userleap-platform":mn.Web,"x-ul-sdk-version":__SDK_VERSION__,[ct.InstallationMethod]:Sv(e)};if(e.envId&&(t[ct.EnvironmentID]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t[ct.UserID]=e.userId),e.visitorId&&(t[ct.VisitorID]=e.visitorId),e.partnerAnonymousId&&(t[ct.PartnerAnonymousId]=e.partnerAnonymousId),e.mobileHeadersJSON){const n=JSON.parse(e.mobileHeadersJSON);Object.assign(t,n)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t[ct.PreviewMode]="1"),t}const Sl=async(e,t,n)=>{if(e)return{status:429};{const r=new Cv(n);return ii.push(r),r.promise}},Rt=async(e,t,n=0,r=!1,i=!1)=>{const o={url:e,options:t,attempt:n,shouldDropOnRateLimit:r};if($r&&!i)return Sl(r,i,o);const a={ok:!1,reportError:!1};if(Kc)return console.info(`UserLeap - ${Wc}`),a;try{t.headers=Object.assign(Or(),t.headers);const s=await fetch(e,t);if(s.status===429)if(!$r&&!r||i){$r=!0;const u=s.headers.has("ratelimit-reset")?Number(s.headers.get("ratelimit-reset")):Ev.RATELIMIT_RESET_DEFAULT;return await Ai(u*1e3),Rt(e,t,0,r,!0)}else return Sl(r,!1,o);if($r=!1,ii.length&&(ii.map(l=>{const{url:u,options:c,attempt:d,shouldDropOnRateLimit:p}=l.payload;Rt(u,c,d,p).then(f=>{l.resolveRequest(f)})}),ii=[]),s.ok){if(s.status===249)return ta(),a;const l=await s.text();try{return l&&l!=="OK"&&(s.json=JSON.parse(l)),s}catch{return{ok:!1,reportError:!1,error:new Error(`failed parsing response json for ${e} - ${l}`)}}}return s}catch(s){const l=n+1;return l>5||qc?{ok:!1,reportError:!1,error:s}:(await Ai(Math.pow(2,n)*1e3),Rt(e,t,l))}};var $c={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(le,function(){var n=function(o,a){if(a=a||{},typeof o!="function")throw new i("fetch must be a function");if(typeof a!="object")throw new i("defaults must be an object");if(a.retries!==void 0&&!r(a.retries))throw new i("retries must be a positive integer");if(a.retryDelay!==void 0&&!r(a.retryDelay)&&typeof a.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(a.retryOn!==void 0&&!Array.isArray(a.retryOn)&&typeof a.retryOn!="function")throw new i("retryOn property expects an array or function");var s={retries:3,retryDelay:1e3,retryOn:[]};return a=Object.assign(s,a),function(u,c){var d=a.retries,p=a.retryDelay,f=a.retryOn;if(c&&c.retries!==void 0)if(r(c.retries))d=c.retries;else throw new i("retries must be a positive integer");if(c&&c.retryDelay!==void 0)if(r(c.retryDelay)||typeof c.retryDelay=="function")p=c.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(c&&c.retryOn)if(Array.isArray(c.retryOn)||typeof c.retryOn=="function")f=c.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(h,m){var g=function(y){var _=typeof Request<"u"&&u instanceof Request?u.clone():u;o(_,c).then(function(v){if(Array.isArray(f)&&f.indexOf(v.status)===-1)h(v);else if(typeof f=="function")try{return Promise.resolve(f(y,null,v)).then(function(w){w?b(y,null,v):h(v)}).catch(m)}catch(w){m(w)}else y<d?b(y,null,v):h(v)}).catch(function(v){if(typeof f=="function")try{Promise.resolve(f(y,v,null)).then(function(w){w?b(y,v,null):m(v)}).catch(function(w){m(w)})}catch(w){m(w)}else y<d?b(y,v,null):m(v)})};function b(y,_,v){var w=typeof p=="function"?p(y,_,v):p;setTimeout(function(){g(++y)},w)}g(0)})}};function r(o){return Number.isInteger(o)&&o>=0}function i(o){this.name="ArgumentError",this.message=o}return n})})($c);const Iv=$c.exports;class kv{constructor(t){Ae(this,"awaitingResolvers",[]);Ae(this,"activeCount",0);this.capacity=t}async acquire(){if(this.activeCount<this.capacity){this.activeCount++;return}return new Promise(t=>{this.awaitingResolvers.push(t)})}release(){const t=this.awaitingResolvers.shift();t&&this.activeCount<=this.capacity?t():this.activeCount--}async execute(t){try{return await this.acquire(),await t()}finally{this.release()}}setLimit(t){this.capacity=t}}const Yc=new kv(2),xv=e=>Yc.setLimit(e),Av=Iv(fetch),Tv=async(e,t=3)=>Yc.execute(async()=>{const r=(await Av(e.uploadUrl,{body:e.data,method:"PUT",retries:t,retryDelay:i=>Math.pow(2,i)*1e3})).headers.get("ETag");if(!r)throw new Error(`Upload response did not include etag for upload ${e.uploadId}, part ${e.chunkIndex}`);return r}),Zc=async({apiUrl:e,surveyId:t,uploadId:n,etags:r,headers:i,responseGroupUuid:o,replayDuration:a,eventDigest:s},l=!1)=>{var u;if(!(!l&&!n&&!r))return Rt(`${e}/sdk/1/completeSessionReplay`,{method:"POST",body:JSON.stringify({etags:r,uploadId:n,responseGroupUuid:o,surveyId:t,replayDuration:a,eventDigest:s,userAgent:(u=window==null?void 0:window.navigator)==null?void 0:u.userAgent}),headers:i})};/*! *****************************************************************************
18
+ ***************************************************************************** */function ph(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function hh(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})}var Sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Dr=0;Dr<Sn.length;Dr++)mh[Sn.charCodeAt(Dr)]=Dr;var gh=function(e){var t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Sn[t[n]>>2],i+=Sn[(t[n]&3)<<4|t[n+1]>>4],i+=Sn[(t[n+1]&15)<<2|t[n+2]>>6],i+=Sn[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const Us=new Map;function vh(e,t){let n=Us.get(e);return n||(n=new Map,Us.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const Hl=(e,t,n)=>{if(!e||!(Gl(e,t)||typeof e=="object"))return;const r=e.constructor.name,i=vh(n,r);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};function Wr(e,t,n){if(e instanceof Array)return e.map(r=>Wr(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,i=gh(e);return{rr_type:r,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Wr(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:i}=e;return{rr_type:r,src:i}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",i=e.toDataURL();return{rr_type:r,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Wr(e.data,t,n),e.width,e.height]};if(Gl(e,t)||typeof e=="object"){const r=e.constructor.name,i=Hl(e,t,n);return{rr_type:r,index:i}}}}return e}const jl=(e,t,n)=>[...e].map(r=>Wr(r,t,n)),Gl=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function");return Boolean(r.find(i=>e instanceof t[i]))};function yh(e,t,n,r){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const s=_r(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...c){return Te(this.canvas,n,r,!0)||setTimeout(()=>{const l=jl([...c],t,this);e(this.canvas,{type:xn["2D"],property:a,args:l})},0),u.apply(this,c)}});i.push(s)}catch{const u=Mi(t.CanvasRenderingContext2D.prototype,a,{set(c){e(this.canvas,{type:xn["2D"],property:a,args:[c],setter:!0})}});i.push(u)}return()=>{i.forEach(a=>a())}}function _h(e){return e==="experimental-webgl"?"webgl":e}function Ds(e,t,n,r){const i=[];try{const o=_r(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(s,...u){if(!Te(this,t,n,!0)){const c=_h(s);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(u[0]&&typeof u[0]=="object"){const l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[s,...u])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function Ps(e,t,n,r,i,o,a){const s=[],u=Object.getOwnPropertyNames(e);for(const c of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const l=_r(e,c,function(d){return function(...p){const f=d.apply(this,p);if(Hl(f,a,this),"tagName"in this.canvas&&!Te(this.canvas,r,i,!0)){const h=jl([...p],a,this),m={type:t,property:c,args:h};n(this.canvas,m)}return f}});s.push(l)}catch{const d=Mi(e,c,{set(p){n(this.canvas,{type:t,property:c,args:[p],setter:!0})}});s.push(d)}return s}function bh(e,t,n,r,i){const o=[];return o.push(...Ps(t.WebGLRenderingContext.prototype,xn.WebGL,e,n,r,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Ps(t.WebGL2RenderingContext.prototype,xn.WebGL2,e,n,r,i,t)),()=>{o.forEach(a=>a())}}function wh(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function Sh(e,t,n){var r=t===void 0?null:t,i=n===void 0?!1:n,o=wh(e,i),a=o.indexOf(`
19
+ `,10)+1,s=o.substring(a)+(r?"//# sourceMappingURL="+r:""),u=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(u)}function Ih(e,t,n){var r;return function(o){return r=r||Sh(e,t,n),new Worker(r,o)}}var Ch=Ih("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);class Eh{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(u,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(u)||this.pendingCanvasMutations.set(u,[]),this.pendingCanvasMutations.get(u).push(c)};const{sampling:n="all",win:r,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,i,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,i,o,{dataURLOptions:s})}initCanvasFPSObserver(t,n,r,i,o){const a=Ds(n,r,i,!0),s=new Map,u=new Ch;u.onmessage=h=>{const{id:m}=h.data;if(s.set(m,!1),!("base64"in h.data))return;const{base64:g,type:w,width:y,height:v}=h.data;this.mutationCb({id:m,type:xn["2D"],commands:[{property:"clearRect",args:[0,0,y,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:w}]},0,0]}]})};const c=1e3/t;let l=0,d;const p=()=>{const h=[];return n.document.querySelectorAll("canvas").forEach(m=>{Te(m,r,i,!0)||h.push(m)}),h},f=h=>{if(l&&h-l<c){d=requestAnimationFrame(f);return}l=h,p().forEach(m=>hh(this,void 0,void 0,function*(){var g;const w=this.mirror.getId(m);if(s.get(w))return;if(s.set(w,!0),["webgl","webgl2"].includes(m.__context)){const v=m.getContext(m.__context);((g=v==null?void 0:v.getContextAttributes())===null||g===void 0?void 0:g.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const y=yield createImageBitmap(m);u.postMessage({id:w,bitmap:y,width:m.width,height:m.height,dataURLOptions:o.dataURLOptions},[y])})),d=requestAnimationFrame(f)};d=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Ds(t,n,r,!1),o=yh(this.processMutation.bind(this),t,n,r),a=bh(this.processMutation.bind(this),t,n,r,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const i=r.map(a=>ph(a,["type"])),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class kh{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Wp,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},i=[];for(const o of t){let a;if(this.styleMirror.has(o))a=this.styleMirror.getId(o);else{a=this.styleMirror.add(o);const s=Array.from(o.rules||CSSRule);i.push({styleId:a,rules:s.map((u,c)=>({rule:Il(u),index:c}))})}r.styleIds.push(a)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Ah{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(i=>i!==n)}add(t,n){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function ge(e){return Object.assign(Object.assign({},e),{timestamp:ci()})}let de,qr,to,fi=!1;const Qe=wp();function wr(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:h,maskTextFn:m,hooks:g,packFn:w,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:_=!1,recordCrossOriginIframes:C=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:E=!1,inlineImages:x=!1,plugins:N,keepIframeSrcFn:F=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:T}=e;Qp(T);const A=C?window.parent===window:!0;let U=!1;if(!A)try{window.parent.document&&(U=!1)}catch{U=!0}if(A&&!t)throw new Error("emit function is required");b!==void 0&&y.mousemove===void 0&&(y.mousemove=b),Qe.reset();const W=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},se=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};zp();let J,ne=0;const ce=B=>{for(const Oe of N||[])Oe.eventProcessor&&(B=Oe.eventProcessor(B));return w&&!U&&(B=w(B)),B};de=(B,Oe)=>{var Q;if(((Q=$t[0])===null||Q===void 0?void 0:Q.isFrozen())&&B.type!==Z.FullSnapshot&&!(B.type===Z.IncrementalSnapshot&&B.data.source===$.Mutation)&&$t.forEach(be=>be.unfreeze()),A)t==null||t(ce(B),Oe);else if(U){const be={type:"rrweb",event:ce(B),origin:window.location.origin,isCheckout:Oe};window.parent.postMessage(be,"*")}if(B.type===Z.FullSnapshot)J=B,ne=0;else if(B.type===Z.IncrementalSnapshot){if(B.data.source===$.Mutation&&B.data.isAttachIframe)return;ne++;const be=r&&ne>=r,jt=n&&B.timestamp-J.timestamp>n;(be||jt)&&qr(!0)}};const q=B=>{de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.Mutation},B)}))},Ke=B=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.Scroll},B)})),Se=B=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.CanvasMutation},B)})),dt=B=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.AdoptedStyleSheet},B)})),De=new kh({mutationCb:q,adoptedStyleSheetCb:dt}),it=new dh({mirror:Qe,mutationCb:q,stylesheetManager:De,recordCrossOriginIframes:C,wrappedEmit:de});for(const B of N||[])B.getMirror&&B.getMirror({nodeMirror:Qe,crossOriginIframeMirror:it.crossOriginIframeMirror,crossOriginIframeStyleMirror:it.crossOriginIframeStyleMirror});const Ht=new Ah;to=new Eh({recordCanvas:_,mutationCb:Se,win:window,blockClass:i,blockSelector:o,mirror:Qe,sampling:y.canvas,dataURLOptions:v});const Ze=new fh({mutationCb:q,scrollCb:Ke,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:W,dataURLOptions:v,maskTextFn:m,maskInputFn:h,recordCanvas:_,inlineImages:x,sampling:y,slimDOMOptions:se,iframeManager:it,stylesheetManager:De,canvasManager:to,keepIframeSrcFn:F,processedNodeManager:Ht},mirror:Qe});qr=(B=!1)=>{de(ge({type:Z.Meta,data:{href:window.location.href,width:Ll(),height:Rl()}}),B),De.reset(),Ze.init(),$t.forEach(Q=>Q.lock());const Oe=jp(document,{mirror:Qe,blockClass:i,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:W,maskTextFn:m,slimDOM:se,dataURLOptions:v,recordCanvas:_,inlineImages:x,onSerialize:Q=>{Nl(Q,Qe)&&it.addIframe(Q),Ul(Q,Qe)&&De.trackLinkElement(Q),xo(Q)&&Ze.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,be)=>{it.attachIframe(Q,be),Ze.observeAttachShadow(Q)},onStylesheetLoad:(Q,be)=>{De.attachLinkElement(Q,be)},keepIframeSrcFn:F});if(!Oe)return console.warn("Failed to snapshot the document");de(ge({type:Z.FullSnapshot,data:{node:Oe,initialOffset:Tl(window)}}),B),$t.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&De.adoptStyleSheets(document.adoptedStyleSheets,Qe.getId(document))};try{const B=[],Oe=be=>{var jt;return H(ch)({mutationCb:q,mousemoveCb:(ue,Yi)=>de(ge({type:Z.IncrementalSnapshot,data:{source:Yi,positions:ue}})),mouseInteractionCb:ue=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.MouseInteraction},ue)})),scrollCb:Ke,viewportResizeCb:ue=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.ViewportResize},ue)})),inputCb:ue=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.Input},ue)})),mediaInteractionCb:ue=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.MediaInteraction},ue)})),styleSheetRuleCb:ue=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.StyleSheetRule},ue)})),styleDeclarationCb:ue=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.StyleDeclaration},ue)})),canvasMutationCb:Se,fontCb:ue=>de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.Font},ue)})),selectionCb:ue=>{de(ge({type:Z.IncrementalSnapshot,data:Object.assign({source:$.Selection},ue)}))},blockClass:i,ignoreClass:a,ignoreSelector:s,maskTextClass:u,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:l,sampling:y,recordCanvas:_,inlineImages:x,userTriggeredOnInput:I,collectFonts:E,doc:be,maskInputFn:h,maskTextFn:m,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:se,dataURLOptions:v,mirror:Qe,iframeManager:it,stylesheetManager:De,shadowDomManager:Ze,processedNodeManager:Ht,canvasManager:to,ignoreCSSAttributes:P,plugins:((jt=N==null?void 0:N.filter(ue=>ue.observer))===null||jt===void 0?void 0:jt.map(ue=>({observer:ue.observer,options:ue.options,callback:Yi=>de(ge({type:Z.Plugin,data:{plugin:ue.name,payload:Yi}}))})))||[]},g)};it.addLoadListener(be=>{try{B.push(Oe(be.contentDocument))}catch(jt){console.warn(jt)}});const Q=()=>{qr(),B.push(Oe(document)),fi=!0};return document.readyState==="interactive"||document.readyState==="complete"?Q():(B.push(xe("DOMContentLoaded",()=>{de(ge({type:Z.DomContentLoaded,data:{}})),k==="DOMContentLoaded"&&Q()})),B.push(xe("load",()=>{de(ge({type:Z.Load,data:{}})),k==="load"&&Q()},window))),()=>{B.forEach(be=>be()),Ht.destroy(),fi=!1,Jp()}}catch(B){console.warn(B)}}wr.addCustomEvent=(e,t)=>{if(!fi)throw new Error("please add custom event after start recording");de(ge({type:Z.Custom,data:{tag:e,payload:t}}))};wr.freezePage=()=>{$t.forEach(e=>e.freeze())};wr.takeFullSnapshot=e=>{if(!fi)throw new Error("please take full snapshot after start recording");qr(e)};wr.mirror=Qe;var st=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.PageChange="page.change",e.API="api",e.Override="override",e))(st||{}),K=(e=>(e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e.QuestionAnswered="question.answered",e))(K||{}),zl=(e=>(e.SurveyId="survey.id",e))(zl||{});const Ca={SDK_READY:"sdk.ready",SURVEY_APPEARED:"survey.appeared",SURVEY_CLOSED:"survey.closed",SURVEY_DIMENSIONS:"survey.dimensions",SURVEY_FADING_OUT:"survey.fadingOut",SURVEY_HEIGHT:"survey.height",SURVEY_PRESENTED:"survey.presented",SURVEY_LIFE_CYCLE:"survey.lifeCycle",SURVEY_WILL_CLOSE:"survey.willClose",SURVEY_WILL_PRESENT:"survey.will.present",QUESTION_ANSWERED:"question.answered",CLOSE_SURVEY_ON_OVERLAY_CLICK:"close.survey.overlayClick",VISITOR_ID_UPDATED:"visitor.id.updated",DATA:{DISMISS_REASONS:{API:"api",CLOSED:"close.click",COMPLETE:"survey.completed",PAGE_CHANGE:"page.change",OVERRIDE:"override"},SURVEY_ID:"survey.id"}};var qe=(e=>(e.VerifyViewVersion="verify.view.version",e.CurrentQuestion="survey.question",e.ViewPrototypeClick="question.prototype.click",e.ViewAgreementClick="question.agreement.click",e.RecordedTaskStart="recorded.task.start",e.RecordedTaskPermissionScreen="recorded.task.permission.screen",e.SurveyComplete="survey.complete",e))(qe||{}),Yt=(e=>(e.ViewVersion="view.version",e.QuestionId="qid",e.Props="props",e))(Yt||{}),oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Th(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var we={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});var Ea=function(){function e(){}return e.prototype.handleError=function(t){},e}();ln.NoopErrorHandler=Ea;var ka=new Ea;function Rh(e){ka=e}ln.setErrorHandler=Rh;function Lh(){return ka}ln.getErrorHandler=Lh;function Oh(){ka=new Ea}ln.resetErrorHandler=Oh;var Aa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.NOTSET=0]="NOTSET",t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARNING=3]="WARNING",t[t.ERROR=4]="ERROR"}(e.LogLevel||(e.LogLevel={}))})(Aa);var Bt={},Vn={},pi={exports:{}},Ms=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(Ms){var Fs=new Uint8Array(16);pi.exports=function(){return Ms(Fs),Fs}}else{var Vs=new Array(16);pi.exports=function(){for(var t=0,n;t<16;t++)(t&3)===0&&(n=Math.random()*4294967296),Vs[t]=n>>>((t&3)<<3)&255;return Vs}}var Wl=[];for(var Pr=0;Pr<256;++Pr)Wl[Pr]=(Pr+256).toString(16).substr(1);function Nh(e,t){var n=t||0,r=Wl;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}var ql=Nh,Uh=pi.exports,Dh=ql,Bs,no,ro=0,io=0;function Ph(e,t,n){var r=t&&n||0,i=t||[];e=e||{};var o=e.node||Bs,a=e.clockseq!==void 0?e.clockseq:no;if(o==null||a==null){var s=Uh();o==null&&(o=Bs=[s[0]|1,s[1],s[2],s[3],s[4],s[5]]),a==null&&(a=no=(s[6]<<8|s[7])&16383)}var u=e.msecs!==void 0?e.msecs:new Date().getTime(),c=e.nsecs!==void 0?e.nsecs:io+1,l=u-ro+(c-io)/1e4;if(l<0&&e.clockseq===void 0&&(a=a+1&16383),(l<0||u>ro)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ro=u,io=c,no=a,u+=122192928e5;var d=((u&268435455)*1e4+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var p=u/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(var f=0;f<6;++f)i[r+f]=o[f];return t||Dh(i)}var Mh=Ph,Fh=pi.exports,Vh=ql;function Bh(e,t,n){var r=t&&n||0;typeof e=="string"&&(t=e==="binary"?new Array(16):null,e=null),e=e||{};var i=e.random||(e.rng||Fh)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||Vh(i)}var Kh=Bh,Hh=Mh,$l=Kh,xa=$l;xa.v1=Hh;xa.v4=$l;var jh=xa;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=jh;function n(){return t.v4()}e.generateUUID=n;function r(){return new Date().getTime()}e.getTimestamp=r;function i(d,p){for(var f=!1,h=Object.keys(d),m=0;m<h.length;m++)if(p===d[h[m]]){f=!0;break}return f}e.isValidEnum=i;function o(d,p){var f={};return d.forEach(function(h){var m=p(h);f[m]=f[m]||[],f[m].push(h)}),a(f)}e.groupBy=o;function a(d){return Object.keys(d).map(function(p){return d[p]})}e.objectValues=a;function s(d){return Object.keys(d).map(function(p){return[p,d[p]]})}e.objectEntries=s;function u(d,p){for(var f,h=0,m=d;h<m.length;h++){var g=m[h];if(p(g)){f=g;break}}return f}e.find=u;function c(d,p){var f={};return d.forEach(function(h){var m=p(h);f[m]=h}),f}e.keyBy=c;function l(d){for(var p=[],f=1;f<arguments.length;f++)p[f-1]=arguments[f];var h=0;return d.replace(/%s/g,function(){var m=p[h++],g=typeof m;return g==="function"?m():g==="string"?m:String(m)})}e.sprintf=l,function(d){d.ACTIVATE="ACTIVATE:experiment, user_id,attributes, variation, event",d.DECISION="DECISION:type, userId, attributes, decisionInfo",d.LOG_EVENT="LOG_EVENT:logEvent",d.OPTIMIZELY_CONFIG_UPDATE="OPTIMIZELY_CONFIG_UPDATE",d.TRACK="TRACK:event_key, user_id, attributes, event_tags, event"}(e.NOTIFICATION_TYPES||(e.NOTIFICATION_TYPES={}))})(Vn);var Gh=oe&&oe.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(Bt,"__esModule",{value:!0});var zh=ln,hi=Vn,pe=Aa,Ks={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4};function Ta(e){return typeof e!="string"||(e=e.toUpperCase(),e==="WARN"&&(e="WARNING"),!Ks[e])?e:Ks[e]}var Yl=function(){function e(){this.defaultLoggerFacade=new Hs,this.loggers={}}return e.prototype.getLogger=function(t){return t?(this.loggers[t]||(this.loggers[t]=new Hs({messagePrefix:t})),this.loggers[t]):this.defaultLoggerFacade},e}(),Wh=function(){function e(t){t===void 0&&(t={}),this.logLevel=pe.LogLevel.NOTSET,t.logLevel!==void 0&&hi.isValidEnum(pe.LogLevel,t.logLevel)&&this.setLogLevel(t.logLevel),this.logToConsole=t.logToConsole!==void 0?!!t.logToConsole:!0,this.prefix=t.prefix!==void 0?t.prefix:"[OPTIMIZELY]"}return e.prototype.log=function(t,n){if(!(!this.shouldLog(t)||!this.logToConsole)){var r=this.prefix+" - "+this.getLogLevelName(t)+" "+this.getTime()+" "+n;this.consoleLog(t,[r])}},e.prototype.setLogLevel=function(t){t=Ta(t),!hi.isValidEnum(pe.LogLevel,t)||t===void 0?this.logLevel=pe.LogLevel.ERROR:this.logLevel=t},e.prototype.getTime=function(){return new Date().toISOString()},e.prototype.shouldLog=function(t){return t>=this.logLevel},e.prototype.getLogLevelName=function(t){switch(t){case pe.LogLevel.DEBUG:return"DEBUG";case pe.LogLevel.INFO:return"INFO ";case pe.LogLevel.WARNING:return"WARN ";case pe.LogLevel.ERROR:return"ERROR";default:return"NOTSET"}},e.prototype.consoleLog=function(t,n){switch(t){case pe.LogLevel.DEBUG:console.log.apply(console,n);break;case pe.LogLevel.INFO:console.info.apply(console,n);break;case pe.LogLevel.WARNING:console.warn.apply(console,n);break;case pe.LogLevel.ERROR:console.error.apply(console,n);break;default:console.log.apply(console,n)}},e}();Bt.ConsoleLogHandler=Wh;var ur=pe.LogLevel.NOTSET,Ro=null,Hs=function(){function e(t){t===void 0&&(t={}),this.messagePrefix="",t.messagePrefix&&(this.messagePrefix=t.messagePrefix)}return e.prototype.log=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];this.internalLog(Ta(t),{message:n,splat:r})},e.prototype.info=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(pe.LogLevel.INFO,t,n)},e.prototype.debug=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(pe.LogLevel.DEBUG,t,n)},e.prototype.warn=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(pe.LogLevel.WARNING,t,n)},e.prototype.error=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.namedLog(pe.LogLevel.ERROR,t,n)},e.prototype.format=function(t){return(this.messagePrefix?this.messagePrefix+": ":"")+hi.sprintf.apply(void 0,Gh([t.message],t.splat))},e.prototype.internalLog=function(t,n){!Ro||t<ur||(Ro.log(t,this.format(n)),n.error&&n.error instanceof Error&&zh.getErrorHandler().handleError(n.error))},e.prototype.namedLog=function(t,n,r){var i;if(n instanceof Error){i=n,n=i.message,this.internalLog(t,{error:i,message:n,splat:r});return}if(r.length===0){this.internalLog(t,{message:n,splat:r});return}var o=r[r.length-1];o instanceof Error&&(i=o,r.splice(-1)),this.internalLog(t,{message:n,error:i,splat:r})},e}(),Zl=new Yl;function qh(e){return Zl.getLogger(e)}Bt.getLogger=qh;function $h(e){Ro=e}Bt.setLogHandler=$h;function Yh(e){e=Ta(e),!hi.isValidEnum(pe.LogLevel,e)||e===void 0?ur=pe.LogLevel.ERROR:ur=e}Bt.setLogLevel=Yh;function Zh(){return ur}Bt.getLogLevel=Zh;function Qh(){Zl=new Yl,ur=pe.LogLevel.NOTSET}Bt.resetLogger=Qh;(function(e){function t(n){for(var r in n)e.hasOwnProperty(r)||(e[r]=n[r])}Object.defineProperty(e,"__esModule",{value:!0}),t(ln),t(Aa),t(Bt)})(we);var Jh={},Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.areEventContextsEqual=void 0;function Xh(e,t){var n=e.context,r=t.context;return n.accountId===r.accountId&&n.projectId===r.projectId&&n.clientName===r.clientName&&n.clientVersion===r.clientVersion&&n.revision===r.revision&&n.anonymizeIP===r.anonymizeIP&&n.botFiltering===r.botFiltering}Sr.areEventContextsEqual=Xh;var Ra={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.DefaultEventQueue=Tn.SingleEventQueue=void 0;var em=we,tm=em.getLogger("EventProcessor"),nm=function(){function e(t){var n=t.timeout,r=t.callback;this.timeout=Math.max(n,0),this.callback=r}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),rm=function(){function e(t){var n=t.sink;this.sink=n}return e.prototype.start=function(){},e.prototype.stop=function(){return Promise.resolve()},e.prototype.enqueue=function(t){this.sink([t])},e}();Tn.SingleEventQueue=rm;var im=function(){function e(t){var n=t.flushInterval,r=t.maxQueueSize,i=t.sink,o=t.batchComparator;this.buffer=[],this.maxQueueSize=Math.max(r,1),this.sink=i,this.batchComparator=o,this.timer=new nm({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var t=this.sink(this.buffer);return this.buffer=[],this.timer.stop(),t},e.prototype.enqueue=function(t){if(!this.started){tm.warn("Queue is stopped, not accepting event");return}var n=this.buffer[0];n&&!this.batchComparator(n,t)&&this.flush(),this.buffer.length===0&&this.timer.refresh(),this.buffer.push(t),this.buffer.length>=this.maxQueueSize&&this.flush()},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e}();Tn.DefaultEventQueue=im;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sendEventNotification=e.getQueue=e.validateAndGetBatchSize=e.validateAndGetFlushInterval=e.DEFAULT_BATCH_SIZE=e.DEFAULT_FLUSH_INTERVAL=void 0;var t=Tn,n=we,r=Vn;e.DEFAULT_FLUSH_INTERVAL=3e4,e.DEFAULT_BATCH_SIZE=10;var i=n.getLogger("EventProcessor");function o(c){return c<=0&&(i.warn("Invalid flushInterval "+c+", defaulting to "+e.DEFAULT_FLUSH_INTERVAL),c=e.DEFAULT_FLUSH_INTERVAL),c}e.validateAndGetFlushInterval=o;function a(c){return c=Math.floor(c),c<1&&(i.warn("Invalid batchSize "+c+", defaulting to "+e.DEFAULT_BATCH_SIZE),c=e.DEFAULT_BATCH_SIZE),c=Math.max(1,c),c}e.validateAndGetBatchSize=a;function s(c,l,d,p){var f;return c>1?f=new t.DefaultEventQueue({flushInterval:l,maxQueueSize:c,sink:d,batchComparator:p}):f=new t.SingleEventQueue({sink:d}),f}e.getQueue=s;function u(c,l){c&&c.sendNotifications(r.NOTIFICATION_TYPES.LOG_EVENT,l)}e.sendEventNotification=u})(Ra);var Ql={};Object.defineProperty(Ql,"__esModule",{value:!0});var Jl={};Object.defineProperty(Jl,"__esModule",{value:!0});var Rn={},Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.LocalStorageStore=void 0;var om=Vn,am=we,js=am.getLogger("EventProcessor"),sm=function(){function e(t){var n=t.key,r=t.maxValues,i=r===void 0?1e3:r;this.LS_KEY=n,this.maxValues=i}return e.prototype.get=function(t){return this.getMap()[t]||null},e.prototype.set=function(t,n){var r=this.getMap();r[t]=n,this.replace(r)},e.prototype.remove=function(t){var n=this.getMap();delete n[t],this.replace(n)},e.prototype.values=function(){return om.objectValues(this.getMap())},e.prototype.clear=function(){this.replace({})},e.prototype.replace=function(t){try{window.localStorage&&localStorage.setItem(this.LS_KEY,JSON.stringify(t)),this.clean()}catch(n){js.error(n)}},e.prototype.clean=function(){var t=this.getMap(),n=Object.keys(t),r=n.length-this.maxValues;if(!(r<1)){var i=n.map(function(a){return{key:a,value:t[a]}});i.sort(function(a,s){return a.value.timestamp-s.value.timestamp});for(var o=0;o<r;o++)delete t[i[o].key];this.replace(t)}},e.prototype.getMap=function(){try{var t=window.localStorage&&localStorage.getItem(this.LS_KEY);if(t)return JSON.parse(t)||{}}catch(n){js.error(n)}return{}},e}();Fi.LocalStorageStore=sm;var um=oe&&oe.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Rn,"__esModule",{value:!0});Rn.LocalStoragePendingEventsDispatcher=Rn.PendingEventsDispatcher=void 0;var lm=we,cm=Fi,Gs=Vn,dm=lm.getLogger("EventProcessor"),Xl=function(){function e(t){var n=t.eventDispatcher,r=t.store;this.dispatcher=n,this.store=r}return e.prototype.dispatchEvent=function(t,n){this.send({uuid:Gs.generateUUID(),timestamp:Gs.getTimestamp(),request:t},n)},e.prototype.sendPendingEvents=function(){var t=this,n=this.store.values();dm.debug("Sending %s pending events from previous page",n.length),n.forEach(function(r){try{t.send(r,function(){})}catch{}})},e.prototype.send=function(t,n){var r=this;this.store.set(t.uuid,t),this.dispatcher.dispatchEvent(t.request,function(i){r.store.remove(t.uuid),n(i)})},e}();Rn.PendingEventsDispatcher=Xl;var fm=function(e){um(t,e);function t(n){var r=n.eventDispatcher;return e.call(this,{eventDispatcher:r,store:new cm.LocalStorageStore({maxValues:100,key:"fs_optly_pending_events"})})||this}return t}(Xl);Rn.LocalStoragePendingEventsDispatcher=fm;var Xe={},Lo=oe&&oe.__assign||function(){return Lo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Lo.apply(this,arguments)};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.formatEvents=Xe.buildConversionEventV1=Xe.buildImpressionEventV1=Xe.makeBatchedEventV1=void 0;var pm="campaign_activated",hm="custom",zs="$opt_bot_filtering";function ec(e){var t=[],n=e[0];return e.forEach(function(r){if(r.type==="conversion"||r.type==="impression"){var i=La(r);r.type==="impression"?i.snapshots.push(nc(r)):r.type==="conversion"&&i.snapshots.push(tc(r)),t.push(i)}}),{client_name:n.context.clientName,client_version:n.context.clientVersion,account_id:n.context.accountId,project_id:n.context.projectId,revision:n.context.revision,anonymize_ip:n.context.anonymizeIP,enrich_decisions:!0,visitors:t}}Xe.makeBatchedEventV1=ec;function tc(e){var t=Lo({},e.tags);delete t.revenue,delete t.value;var n={entity_id:e.event.id,key:e.event.key,timestamp:e.timestamp,uuid:e.uuid};return e.tags&&(n.tags=e.tags),e.value!=null&&(n.value=e.value),e.revenue!=null&&(n.revenue=e.revenue),{events:[n]}}function nc(e){var t,n,r=e.layer,i=e.experiment,o=e.variation,a=e.ruleKey,s=e.flagKey,u=e.ruleType,c=e.enabled,l=r?r.id:null,d=(t=i==null?void 0:i.id)!==null&&t!==void 0?t:"",p=(n=o==null?void 0:o.id)!==null&&n!==void 0?n:"",f=o?o.key:"";return{decisions:[{campaign_id:l,experiment_id:d,variation_id:p,metadata:{flag_key:s,rule_key:a,rule_type:u,variation_key:f,enabled:c}}],events:[{entity_id:l,timestamp:e.timestamp,key:pm,uuid:e.uuid}]}}function La(e){var t={snapshots:[],visitor_id:e.user.id,attributes:[]};return e.user.attributes.forEach(function(n){t.attributes.push({entity_id:n.entityId,key:n.key,type:"custom",value:n.value})}),typeof e.context.botFiltering=="boolean"&&t.attributes.push({entity_id:zs,key:zs,type:hm,value:e.context.botFiltering}),t}function mm(e){var t=La(e);return t.snapshots.push(nc(e)),{client_name:e.context.clientName,client_version:e.context.clientVersion,account_id:e.context.accountId,project_id:e.context.projectId,revision:e.context.revision,anonymize_ip:e.context.anonymizeIP,enrich_decisions:!0,visitors:[t]}}Xe.buildImpressionEventV1=mm;function gm(e){var t=La(e);return t.snapshots.push(tc(e)),{client_name:e.context.clientName,client_version:e.context.clientVersion,account_id:e.context.accountId,project_id:e.context.projectId,revision:e.context.revision,anonymize_ip:e.context.anonymizeIP,enrich_decisions:!0,visitors:[t]}}Xe.buildConversionEventV1=gm;function vm(e){return{url:"https://logx.optimizely.com/v1/events",httpVerb:"POST",params:ec(e)}}Xe.formatEvents=vm;var Vi={},Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});var ym=function(){function e(){this.reqsInFlightCount=0,this.reqsCompleteResolvers=[]}return e.prototype.trackRequest=function(t){var n=this;this.reqsInFlightCount++;var r=function(){n.reqsInFlightCount--,n.reqsInFlightCount===0&&(n.reqsCompleteResolvers.forEach(function(i){return i()}),n.reqsCompleteResolvers=[])};t.then(r,r)},e.prototype.onRequestsComplete=function(){var t=this;return new Promise(function(n){t.reqsInFlightCount===0?n():t.reqsCompleteResolvers.push(n)})},e}();Oa.default=ym;var _m=oe&&oe.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},bm=oe&&oe.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,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(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},wm=oe&&oe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.LogTierV1EventProcessor=void 0;var Sm=we,mn=Ra,Im=wm(Oa),Cm=Sr,Em=Xe,Ws=Sm.getLogger("LogTierV1EventProcessor"),km=function(){function e(t){var n=t.dispatcher,r=t.flushInterval,i=r===void 0?mn.DEFAULT_FLUSH_INTERVAL:r,o=t.batchSize,a=o===void 0?mn.DEFAULT_BATCH_SIZE:o,s=t.notificationCenter;this.dispatcher=n,this.notificationCenter=s,this.requestTracker=new Im.default,i=mn.validateAndGetFlushInterval(i),a=mn.validateAndGetBatchSize(a),this.queue=mn.getQueue(a,i,this.drainQueue.bind(this),Cm.areEventContextsEqual)}return e.prototype.drainQueue=function(t){var n=this,r=new Promise(function(i){if(Ws.debug("draining queue with %s events",t.length),t.length===0){i();return}var o=Em.formatEvents(t);n.dispatcher.dispatchEvent(o,function(){i()}),mn.sendEventNotification(n.notificationCenter,o)});return this.requestTracker.trackRequest(r),r},e.prototype.process=function(t){this.queue.enqueue(t)},e.prototype.stop=function(){try{return this.queue.stop(),this.requestTracker.onRequestsComplete()}catch(t){Ws.error('Error stopping EventProcessor: "%s"',t.message,t)}return Promise.resolve()},e.prototype.start=function(){return _m(this,void 0,void 0,function(){return bm(this,function(t){return this.queue.start(),[2]})})},e}();Vi.LogTierV1EventProcessor=km;(function(e){var t=oe&&oe.__createBinding||(Object.create?function(r,i,o,a){a===void 0&&(a=o),Object.defineProperty(r,a,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]}),n=oe&&oe.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Sr,e),n(Ra,e),n(Ql,e),n(Jl,e),n(Rn,e),n(Xe,e),n(Vi,e)})(Jh);var mi={exports:{}},qs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(qs){var $s=new Uint8Array(16);mi.exports=function(){return qs($s),$s}}else{var Ys=new Array(16);mi.exports=function(){for(var t=0,n;t<16;t++)(t&3)===0&&(n=Math.random()*4294967296),Ys[t]=n>>>((t&3)<<3)&255;return Ys}}var rc=[];for(var Mr=0;Mr<256;++Mr)rc[Mr]=(Mr+256).toString(16).substr(1);function Am(e,t){var n=t||0,r=rc;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}var ic=Am,xm=mi.exports,Tm=ic,Zs,oo,ao=0,so=0;function Rm(e,t,n){var r=t&&n||0,i=t||[];e=e||{};var o=e.node||Zs,a=e.clockseq!==void 0?e.clockseq:oo;if(o==null||a==null){var s=xm();o==null&&(o=Zs=[s[0]|1,s[1],s[2],s[3],s[4],s[5]]),a==null&&(a=oo=(s[6]<<8|s[7])&16383)}var u=e.msecs!==void 0?e.msecs:new Date().getTime(),c=e.nsecs!==void 0?e.nsecs:so+1,l=u-ao+(c-so)/1e4;if(l<0&&e.clockseq===void 0&&(a=a+1&16383),(l<0||u>ao)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ao=u,so=c,oo=a,u+=122192928e5;var d=((u&268435455)*1e4+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var p=u/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=p&255,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(var f=0;f<6;++f)i[r+f]=o[f];return t||Tm(i)}var Lm=Rm,Om=mi.exports,Nm=ic;function Um(e,t,n){var r=t&&n||0;typeof e=="string"&&(t=e==="binary"?new Array(16):null,e=null),e=e||{};var i=e.random||(e.rng||Om)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||Nm(i)}var Dm=Um,Pm=Lm,oc=Dm,ac=oc;ac.v1=Pm;ac.v4=oc;var Mm={exports:{}};(function(e){(function(){function t(i,o){for(var a=i.length,s=o^a,u=0,c;a>=4;)c=i.charCodeAt(u)&255|(i.charCodeAt(++u)&255)<<8|(i.charCodeAt(++u)&255)<<16|(i.charCodeAt(++u)&255)<<24,c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16),c^=c>>>24,c=(c&65535)*1540483477+(((c>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^c,a-=4,++u;switch(a){case 3:s^=(i.charCodeAt(u+2)&255)<<16;case 2:s^=(i.charCodeAt(u+1)&255)<<8;case 1:s^=i.charCodeAt(u)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}function n(i,o){var a,s,u,c,l,d,p,f;for(a=i.length&3,s=i.length-a,u=o,l=3432918353,d=461845907,f=0;f<s;)p=i.charCodeAt(f)&255|(i.charCodeAt(++f)&255)<<8|(i.charCodeAt(++f)&255)<<16|(i.charCodeAt(++f)&255)<<24,++f,p=(p&65535)*l+(((p>>>16)*l&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*d+(((p>>>16)*d&65535)<<16)&4294967295,u^=p,u=u<<13|u>>>19,c=(u&65535)*5+(((u>>>16)*5&65535)<<16)&4294967295,u=(c&65535)+27492+(((c>>>16)+58964&65535)<<16);switch(p=0,a){case 3:p^=(i.charCodeAt(f+2)&255)<<16;case 2:p^=(i.charCodeAt(f+1)&255)<<8;case 1:p^=i.charCodeAt(f)&255,p=(p&65535)*l+(((p>>>16)*l&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*d+(((p>>>16)*d&65535)<<16)&4294967295,u^=p}return u^=i.length,u^=u>>>16,u=(u&65535)*2246822507+(((u>>>16)*2246822507&65535)<<16)&4294967295,u^=u>>>13,u=(u&65535)*3266489909+(((u>>>16)*3266489909&65535)<<16)&4294967295,u^=u>>>16,u>>>0}var r=n;r.v2=t,r.v3=n,e.exports=r})()})(Mm);var sc={},Na={},Ua={},lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.DEFAULT_UPDATE_INTERVAL=5*60*1e3;lt.MIN_UPDATE_INTERVAL=1e3;lt.DEFAULT_URL_TEMPLATE="https://cdn.optimizely.com/datafiles/%s.json";lt.DEFAULT_AUTHENTICATED_URL_TEMPLATE="https://config.optimizely.com/datafiles/auth/%s.json";lt.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT=[0,8,16,32,64,128,256,512];lt.REQUEST_TIMEOUT_MS=60*1e3;Object.defineProperty(Ua,"__esModule",{value:!0});var Fm=lt,Vm=we,Bm=Vm.getLogger("DatafileManager"),Km="GET",Hm=4;function jm(e){var t=e.getAllResponseHeaders();if(t===null)return{};var n=t.split(`\r
20
+ `),r={};return n.forEach(function(i){var o=i.indexOf(": ");if(o>-1){var a=i.slice(0,o),s=i.slice(o+2);s.length>0&&(r[a]=s)}}),r}function Gm(e,t){Object.keys(e).forEach(function(n){var r=e[n];t.setRequestHeader(n,r)})}function zm(e,t){var n=new XMLHttpRequest,r=new Promise(function(i,o){n.open(Km,e,!0),Gm(t,n),n.onreadystatechange=function(){if(n.readyState===Hm){var a=n.status;if(a===0){o(new Error("Request error"));return}var s=jm(n),u={statusCode:n.status,body:n.responseText,headers:s};i(u)}},n.timeout=Fm.REQUEST_TIMEOUT_MS,n.ontimeout=function(){Bm.error("Request timed out")},n.send()});return{responsePromise:r,abort:function(){n.abort()}}}Ua.makeGetRequest=zm;var Da={},Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});var Wm=function(){function e(){this.listeners={},this.listenerId=1}return e.prototype.on=function(t,n){var r=this;this.listeners[t]||(this.listeners[t]={});var i=String(this.listenerId);return this.listenerId++,this.listeners[t][i]=n,function(){r.listeners[t]&&delete r.listeners[t][i]}},e.prototype.emit=function(t,n){var r=this.listeners[t];r&&Object.keys(r).forEach(function(i){var o=r[i];o(n)})},e.prototype.removeAllListeners=function(){this.listeners={}},e}();Pa.default=Wm;var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});var uo=lt;function qm(){return Math.round(Math.random()*1e3)}var $m=function(){function e(){this.errorCount=0}return e.prototype.getDelay=function(){if(this.errorCount===0)return 0;var t=uo.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT[Math.min(uo.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT.length-1,this.errorCount)];return t*1e3+qm()},e.prototype.countError=function(){this.errorCount<uo.BACKOFF_BASE_WAIT_SECONDS_BY_ERROR_COUNT.length-1&&this.errorCount++},e.prototype.reset=function(){this.errorCount=0},e}();Ma.default=$m;var gi=oe&&oe.__assign||function(){return gi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},gi.apply(this,arguments)},uc=oe&&oe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Da,"__esModule",{value:!0});var Ym=we,Zm=Vn,Qm=uc(Pa),Wn=lt,Jm=uc(Ma),He=Ym.getLogger("DatafileManager"),Xm="update";function eg(e){return e>=Wn.MIN_UPDATE_INTERVAL}function Qs(e){return e>=200&&e<400}var tg={get:function(){return Promise.resolve("")},set:function(){return Promise.resolve()},contains:function(){return Promise.resolve(!1)},remove:function(){return Promise.resolve()}},ng=function(){function e(t){var n=this,r=gi(gi({},this.getConfigDefaults()),t),i=r.datafile,o=r.autoUpdate,a=o===void 0?!1:o,s=r.sdkKey,u=r.updateInterval,c=u===void 0?Wn.DEFAULT_UPDATE_INTERVAL:u,l=r.urlTemplate,d=l===void 0?Wn.DEFAULT_URL_TEMPLATE:l,p=r.cache,f=p===void 0?tg:p;this.cache=f,this.cacheKey="opt-datafile-"+s,this.isReadyPromiseSettled=!1,this.readyPromiseResolver=function(){},this.readyPromiseRejecter=function(){},this.readyPromise=new Promise(function(h,m){n.readyPromiseResolver=h,n.readyPromiseRejecter=m}),i?(this.currentDatafile=i,s||this.resolveReadyPromise()):this.currentDatafile="",this.isStarted=!1,this.datafileUrl=Zm.sprintf(d,s),this.emitter=new Qm.default,this.autoUpdate=a,eg(c)?this.updateInterval=c:(He.warn("Invalid updateInterval %s, defaulting to %s",c,Wn.DEFAULT_UPDATE_INTERVAL),this.updateInterval=Wn.DEFAULT_UPDATE_INTERVAL),this.currentTimeout=null,this.currentRequest=null,this.backoffController=new Jm.default,this.syncOnCurrentRequestComplete=!1}return e.prototype.get=function(){return this.currentDatafile},e.prototype.start=function(){this.isStarted||(He.debug("Datafile manager started"),this.isStarted=!0,this.backoffController.reset(),this.setDatafileFromCacheIfAvailable(),this.syncDatafile())},e.prototype.stop=function(){return He.debug("Datafile manager stopped"),this.isStarted=!1,this.currentTimeout&&(clearTimeout(this.currentTimeout),this.currentTimeout=null),this.emitter.removeAllListeners(),this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null),Promise.resolve()},e.prototype.onReady=function(){return this.readyPromise},e.prototype.on=function(t,n){return this.emitter.on(t,n)},e.prototype.onRequestRejected=function(t){!this.isStarted||(this.backoffController.countError(),t instanceof Error?He.error("Error fetching datafile: %s",t.message,t):typeof t=="string"?He.error("Error fetching datafile: %s",t):He.error("Error fetching datafile"))},e.prototype.onRequestResolved=function(t){if(!!this.isStarted){typeof t.statusCode<"u"&&Qs(t.statusCode)?this.backoffController.reset():this.backoffController.countError(),this.trySavingLastModified(t.headers);var n=this.getNextDatafileFromResponse(t);if(n!=="")if(He.info("Updating datafile from response"),this.currentDatafile=n,this.cache.set(this.cacheKey,n),!this.isReadyPromiseSettled)this.resolveReadyPromise();else{var r={datafile:n};this.emitter.emit(Xm,r)}}},e.prototype.onRequestComplete=function(){!this.isStarted||(this.currentRequest=null,!this.isReadyPromiseSettled&&!this.autoUpdate&&this.rejectReadyPromise(new Error("Failed to become ready")),this.autoUpdate&&this.syncOnCurrentRequestComplete&&this.syncDatafile(),this.syncOnCurrentRequestComplete=!1)},e.prototype.syncDatafile=function(){var t=this,n={};this.lastResponseLastModified&&(n["if-modified-since"]=this.lastResponseLastModified),He.debug("Making datafile request to url %s with headers: %s",this.datafileUrl,function(){return JSON.stringify(n)}),this.currentRequest=this.makeGetRequest(this.datafileUrl,n);var r=function(){t.onRequestComplete()},i=function(a){t.onRequestResolved(a)},o=function(a){t.onRequestRejected(a)};this.currentRequest.responsePromise.then(i,o).then(r,r),this.autoUpdate&&this.scheduleNextUpdate()},e.prototype.resolveReadyPromise=function(){this.readyPromiseResolver(),this.isReadyPromiseSettled=!0},e.prototype.rejectReadyPromise=function(t){this.readyPromiseRejecter(t),this.isReadyPromiseSettled=!0},e.prototype.scheduleNextUpdate=function(){var t=this,n=this.backoffController.getDelay(),r=Math.max(n,this.updateInterval);He.debug("Scheduling sync in %s ms",r),this.currentTimeout=setTimeout(function(){t.currentRequest?t.syncOnCurrentRequestComplete=!0:t.syncDatafile()},r)},e.prototype.getNextDatafileFromResponse=function(t){return He.debug("Response status code: %s",t.statusCode),typeof t.statusCode>"u"||t.statusCode===304?"":Qs(t.statusCode)?t.body:""},e.prototype.trySavingLastModified=function(t){var n=t["last-modified"]||t["Last-Modified"];typeof n<"u"&&(this.lastResponseLastModified=n,He.debug("Saved last modified header value from response: %s",this.lastResponseLastModified))},e.prototype.setDatafileFromCacheIfAvailable=function(){var t=this;this.cache.get(this.cacheKey).then(function(n){t.isStarted&&!t.isReadyPromiseSettled&&n!==""&&(He.debug("Using datafile from cache"),t.currentDatafile=n,t.resolveReadyPromise())})},e}();Da.default=ng;var rg=oe&&oe.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ig=oe&&oe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Na,"__esModule",{value:!0});var og=Ua,ag=ig(Da),sg=function(e){rg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeGetRequest=function(n,r){return og.makeGetRequest(n,r)},t.prototype.getConfigDefaults=function(){return{autoUpdate:!1}},t}(ag.default);Na.default=sg;Object.defineProperty(sc,"__esModule",{value:!0});var ug=Na;sc.HttpPollingDatafileManager=ug.default;var lg={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4},cg={CONDITION_EVALUATOR_ERROR:"%s: Error evaluating audience condition of type %s: %s",DATAFILE_AND_SDK_KEY_MISSING:"%s: You must provide at least one of sdkKey or datafile. Cannot start Optimizely",EXPERIMENT_KEY_NOT_IN_DATAFILE:"%s: Experiment key %s is not in datafile.",FEATURE_NOT_IN_DATAFILE:"%s: Feature key %s is not in datafile.",IMPROPERLY_FORMATTED_EXPERIMENT:"%s: Experiment key %s is improperly formatted.",INVALID_ATTRIBUTES:"%s: Provided attributes are in an invalid format.",INVALID_BUCKETING_ID:"%s: Unable to generate hash for bucketing ID %s: %s",INVALID_DATAFILE:"%s: Datafile is invalid - property %s: %s",INVALID_DATAFILE_MALFORMED:"%s: Datafile is invalid because it is malformed.",INVALID_CONFIG:"%s: Provided Optimizely config is in an invalid format.",INVALID_JSON:"%s: JSON object is not valid.",INVALID_ERROR_HANDLER:'%s: Provided "errorHandler" is in an invalid format.',INVALID_EVENT_DISPATCHER:'%s: Provided "eventDispatcher" is in an invalid format.',INVALID_EVENT_TAGS:"%s: Provided event tags are in an invalid format.",INVALID_EXPERIMENT_KEY:"%s: Experiment key %s is not in datafile. It is either invalid, paused, or archived.",INVALID_EXPERIMENT_ID:"%s: Experiment ID %s is not in datafile.",INVALID_GROUP_ID:"%s: Group ID %s is not in datafile.",INVALID_LOGGER:'%s: Provided "logger" is in an invalid format.',INVALID_ROLLOUT_ID:"%s: Invalid rollout ID %s attached to feature %s",INVALID_USER_ID:"%s: Provided user ID is in an invalid format.",INVALID_USER_PROFILE_SERVICE:"%s: Provided user profile service instance is in an invalid format: %s.",NO_DATAFILE_SPECIFIED:"%s: No datafile specified. Cannot start optimizely.",NO_JSON_PROVIDED:"%s: No JSON object to validate against schema.",NO_VARIATION_FOR_EXPERIMENT_KEY:"%s: No variation key %s defined in datafile for experiment %s.",UNDEFINED_ATTRIBUTE:"%s: Provided attribute: %s has an undefined value.",UNRECOGNIZED_ATTRIBUTE:"%s: Unrecognized attribute %s provided. Pruning before sending event to Optimizely.",UNABLE_TO_CAST_VALUE:"%s: Unable to cast value %s to type %s, returning null.",USER_NOT_IN_FORCED_VARIATION:"%s: User %s is not in the forced variation map. Cannot remove their forced variation.",USER_PROFILE_LOOKUP_ERROR:'%s: Error while looking up user profile for user ID "%s": %s.',USER_PROFILE_SAVE_ERROR:'%s: Error while saving user profile for user ID "%s": %s.',VARIABLE_KEY_NOT_IN_DATAFILE:'%s: Variable with key "%s" associated with feature with key "%s" is not in datafile.',VARIATION_ID_NOT_IN_DATAFILE:"%s: No variation ID %s defined in datafile for experiment %s.",VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT:"%s: Variation ID %s is not in the datafile.",INVALID_INPUT_FORMAT:"%s: Provided %s is in an invalid format.",INVALID_DATAFILE_VERSION:"%s: This version of the JavaScript SDK does not support the given datafile version: %s",INVALID_VARIATION_KEY:"%s: Provided variation key is in an invalid format."},dg={ACTIVATE_USER:"%s: Activating user %s in experiment %s.",DISPATCH_CONVERSION_EVENT:"%s: Dispatching conversion event to URL %s with params %s.",DISPATCH_IMPRESSION_EVENT:"%s: Dispatching impression event to URL %s with params %s.",DEPRECATED_EVENT_VALUE:"%s: Event value is deprecated in %s call.",EVENT_KEY_NOT_FOUND:"%s: Event key %s is not in datafile.",EXPERIMENT_NOT_RUNNING:"%s: Experiment %s is not running.",FEATURE_ENABLED_FOR_USER:"%s: Feature %s is enabled for user %s.",FEATURE_NOT_ENABLED_FOR_USER:"%s: Feature %s is not enabled for user %s.",FEATURE_HAS_NO_EXPERIMENTS:"%s: Feature %s is not attached to any experiments.",FAILED_TO_PARSE_VALUE:'%s: Failed to parse event value "%s" from event tags.',FAILED_TO_PARSE_REVENUE:'%s: Failed to parse revenue value "%s" from event tags.',FORCED_BUCKETING_FAILED:"%s: Variation key %s is not in datafile. Not activating user %s.",INVALID_OBJECT:"%s: Optimizely object is not valid. Failing %s.",INVALID_CLIENT_ENGINE:"%s: Invalid client engine passed: %s. Defaulting to node-sdk.",INVALID_DEFAULT_DECIDE_OPTIONS:"%s: Provided default decide options is not an array.",INVALID_DECIDE_OPTIONS:"%s: Provided decide options is not an array. Using default decide options.",INVALID_VARIATION_ID:"%s: Bucketed into an invalid variation ID. Returning null.",NOTIFICATION_LISTENER_EXCEPTION:"%s: Notification listener for (%s) threw exception: %s",NO_ROLLOUT_EXISTS:"%s: There is no rollout of feature %s.",NOT_ACTIVATING_USER:"%s: Not activating user %s for experiment %s.",NOT_TRACKING_USER:"%s: Not tracking user %s.",PARSED_REVENUE_VALUE:'%s: Parsed revenue value "%s" from event tags.',PARSED_NUMERIC_VALUE:'%s: Parsed event value "%s" from event tags.',RETURNING_STORED_VARIATION:'%s: Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.',ROLLOUT_HAS_NO_EXPERIMENTS:"%s: Rollout of feature %s has no experiments",SAVED_VARIATION:'%s: Saved variation "%s" of experiment "%s" for user "%s".',SAVED_VARIATION_NOT_FOUND:"%s: User %s was previously bucketed into variation with ID %s for experiment %s, but no matching variation was found.",SHOULD_NOT_DISPATCH_ACTIVATE:'%s: Experiment %s is not in "Running" state. Not activating user.',SKIPPING_JSON_VALIDATION:"%s: Skipping JSON schema validation.",TRACK_EVENT:"%s: Tracking event %s for user %s.",UNRECOGNIZED_DECIDE_OPTION:"%s: Unrecognized decide option %s provided.",USER_ASSIGNED_TO_EXPERIMENT_BUCKET:"%s: Assigned bucket %s to user with bucketing ID %s.",USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is in experiment %s of group %s.",USER_BUCKETED_INTO_TARGETING_RULE:"%s: User %s bucketed into targeting rule %s.",USER_IN_FEATURE_EXPERIMENT:"%s: User %s is in variation %s of experiment %s on the feature %s.",USER_IN_ROLLOUT:"%s: User %s is in rollout of feature %s.",USER_NOT_BUCKETED_INTO_EVERYONE_TARGETING_RULE:"%s: User %s not bucketed into everyone targeting rule due to traffic allocation.",USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is not in experiment %s of group %s.",USER_NOT_BUCKETED_INTO_ANY_EXPERIMENT_IN_GROUP:"%s: User %s is not in any experiment of group %s.",USER_NOT_BUCKETED_INTO_TARGETING_RULE:"%s User %s not bucketed into targeting rule %s due to traffic allocation. Trying everyone rule.",USER_NOT_IN_FEATURE_EXPERIMENT:"%s: User %s is not in any experiment on the feature %s.",USER_NOT_IN_ROLLOUT:"%s: User %s is not in rollout of feature %s.",USER_FORCED_IN_VARIATION:"%s: User %s is forced in variation %s.",USER_MAPPED_TO_FORCED_VARIATION:"%s: Set variation %s for experiment %s and user %s in the forced variation map.",USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE:"%s: User %s does not meet conditions for targeting rule %s.",USER_MEETS_CONDITIONS_FOR_TARGETING_RULE:"%s: User %s meets conditions for targeting rule %s.",USER_HAS_VARIATION:"%s: User %s is in variation %s of experiment %s.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_VARIATION:"%s: Variation %s is mapped to experiment %s and user %s in the forced variation map.",USER_HAS_NO_VARIATION:"%s: User %s is in no variation of experiment %s.",USER_HAS_NO_FORCED_VARIATION:"%s: User %s is not in the forced variation map.",USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT:"%s: No experiment %s mapped to user %s in the forced variation map.",USER_NOT_IN_ANY_EXPERIMENT:"%s: User %s is not in any experiment of group %s.",USER_NOT_IN_EXPERIMENT:"%s: User %s does not meet conditions to be in experiment %s.",USER_RECEIVED_DEFAULT_VARIABLE_VALUE:'%s: User "%s" is not in any variation or rollout rule. Returning default value for variable "%s" of feature flag "%s".',FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Feature "%s" is not enabled for user %s. Returning the default variable value "%s".',VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Variable "%s" is not used in variation "%s". Returning default value.',USER_RECEIVED_VARIABLE_VALUE:'%s: Got variable value "%s" for variable "%s" of feature flag "%s"',VALID_DATAFILE:"%s: Datafile is valid.",VALID_USER_PROFILE_SERVICE:"%s: Valid user profile service provided.",VARIATION_REMOVED_FOR_USER:"%s: Variation mapped to experiment %s has been removed for user %s.",VARIABLE_REQUESTED_WITH_WRONG_TYPE:'%s: Requested variable type "%s", but variable is of type "%s". Use correct API to retrieve value. Returning None.',VALID_BUCKETING_ID:'%s: BucketingId is valid: "%s"',BUCKETING_ID_NOT_STRING:"%s: BucketingID attribute is not a string. Defaulted to userId",EVALUATING_AUDIENCE:'%s: Starting to evaluate audience "%s" with conditions: %s.',EVALUATING_AUDIENCES_COMBINED:'%s: Evaluating audiences for %s "%s": %s.',AUDIENCE_EVALUATION_RESULT:'%s: Audience "%s" evaluated to %s.',AUDIENCE_EVALUATION_RESULT_COMBINED:"%s: Audiences for %s %s collectively evaluated to %s.",MISSING_ATTRIBUTE_VALUE:'%s: Audience condition %s evaluated to UNKNOWN because no value was passed for user attribute "%s".',UNEXPECTED_CONDITION_VALUE:"%s: Audience condition %s evaluated to UNKNOWN because the condition value is not supported.",UNEXPECTED_TYPE:'%s: Audience condition %s evaluated to UNKNOWN because a value of type "%s" was passed for user attribute "%s".',UNEXPECTED_TYPE_NULL:'%s: Audience condition %s evaluated to UNKNOWN because a null value was passed for user attribute "%s".',UNKNOWN_CONDITION_TYPE:"%s: Audience condition %s has an unknown condition type. You may need to upgrade to a newer release of the Optimizely SDK.",UNKNOWN_MATCH_TYPE:"%s: Audience condition %s uses an unknown match type. You may need to upgrade to a newer release of the Optimizely SDK.",UPDATED_OPTIMIZELY_CONFIG:"%s: Updated Optimizely config to revision %s (project id %s)",OUT_OF_BOUNDS:'%s: Audience condition %s evaluated to UNKNOWN because the number value for user attribute "%s" is not in the range [-2^53, +2^53].',UNABLE_TO_ATTACH_UNLOAD:'%s: unable to bind optimizely.close() to page unload event: "%s"'},fg={BOT_FILTERING:"$opt_bot_filtering",BUCKETING_ID:"$opt_bucketing_id",STICKY_BUCKETING_KEY:"$opt_experiment_bucket_map",USER_AGENT:"$opt_user_agent",FORCED_DECISION_NULL_RULE_KEY:"$opt_null_rule_key"},pg="javascript-sdk",hg="node-sdk",mg="react-sdk",gg="react-native-sdk",vg="react-native-js-sdk",yg="4.9.4",_g="4.9.4",bg={AB_TEST:"ab-test",FEATURE:"feature",FEATURE_TEST:"feature-test",FEATURE_VARIABLE:"feature-variable",ALL_FEATURE_VARIABLES:"all-feature-variables",FLAG:"flag"},wg={FEATURE_TEST:"feature-test",ROLLOUT:"rollout",EXPERIMENT:"experiment"},Sg={RULE:"rule",EXPERIMENT:"experiment"},Ig={BOOLEAN:"boolean",DOUBLE:"double",INTEGER:"integer",STRING:"string",JSON:"json"},$r={V2:"2",V3:"3",V4:"4"},Cg={SDK_NOT_READY:"Optimizely SDK not configured properly yet.",FLAG_KEY_INVALID:'No flag was found for key "%s".',VARIABLE_VALUE_INVALID:'Variable value for key "%s" is invalid or wrong type.'},Oo;(function(e){e.ACTIVATE="ACTIVATE:experiment, user_id,attributes, variation, event",e.DECISION="DECISION:type, userId, attributes, decisionInfo",e.LOG_EVENT="LOG_EVENT:logEvent",e.OPTIMIZELY_CONFIG_UPDATE="OPTIMIZELY_CONFIG_UPDATE",e.TRACK="TRACK:event_key, user_id, attributes, event_tags, event"})(Oo||(Oo={}));var Eg=Object.freeze({__proto__:null,LOG_LEVEL:lg,ERROR_MESSAGES:cg,LOG_MESSAGES:dg,CONTROL_ATTRIBUTES:fg,JAVASCRIPT_CLIENT_ENGINE:pg,NODE_CLIENT_ENGINE:hg,REACT_CLIENT_ENGINE:mg,REACT_NATIVE_CLIENT_ENGINE:gg,REACT_NATIVE_JS_CLIENT_ENGINE:vg,BROWSER_CLIENT_VERSION:yg,NODE_CLIENT_VERSION:_g,DECISION_NOTIFICATION_TYPES:bg,DECISION_SOURCES:wg,AUDIENCE_EVALUATION_TYPES:Sg,FEATURE_VARIABLE_TYPES:Ig,DATAFILE_VERSIONS:$r,DECISION_MESSAGES:Cg,get NOTIFICATION_TYPES(){return Oo}});$r.V2,$r.V3,$r.V4;(function(){function e(){}return e.prototype.log=function(){},e})();function kg(e){return new we.ConsoleLogHandler(e)}var Js;(function(e){e.BOOLEAN="boolean",e.DOUBLE="double",e.INTEGER="integer",e.STRING="string",e.JSON="json"})(Js||(Js={}));var Xs;(function(e){e.DISABLE_DECISION_EVENT="DISABLE_DECISION_EVENT",e.ENABLED_FLAGS_ONLY="ENABLED_FLAGS_ONLY",e.IGNORE_USER_PROFILE_SERVICE="IGNORE_USER_PROFILE_SERVICE",e.INCLUDE_REASONS="INCLUDE_REASONS",e.EXCLUDE_VARIABLES="EXCLUDE_VARIABLES"})(Xs||(Xs={}));we.getLogger();we.getLogger();we.getLogger();we.getLogger();we.getLogger("EVENT_BUILDER");we.getLogger();we.setLogHandler(kg());we.setLogLevel(we.LogLevel.INFO);let Fr;const Ag=new Uint8Array(16);function xg(){if(!Fr&&(Fr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Fr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fr(Ag)}const Ie=[];for(let e=0;e<256;++e)Ie.push((e+256).toString(16).slice(1));function Tg(e,t=0){return(Ie[e[t+0]]+Ie[e[t+1]]+Ie[e[t+2]]+Ie[e[t+3]]+"-"+Ie[e[t+4]]+Ie[e[t+5]]+"-"+Ie[e[t+6]]+Ie[e[t+7]]+"-"+Ie[e[t+8]]+Ie[e[t+9]]+"-"+Ie[e[t+10]]+Ie[e[t+11]]+Ie[e[t+12]]+Ie[e[t+13]]+Ie[e[t+14]]+Ie[e[t+15]]).toLowerCase()}const Rg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eu={randomUUID:Rg};function rn(e,t,n){if(eu.randomUUID&&!t&&!e)return eu.randomUUID();e=e||{};const r=e.random||(e.rng||xg)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Tg(r)}const Cn="ul-app";var O=(e=>(e.Caption="ul-caption",e.CardContainer="ul-card__container",e.CardMainContent="ul-card-main-content",e.Choice="choice",e.ChoiceCheckbox="select-checkbox",e.ChoiceGroup="ul-card__choices",e.ChoiceLabel="select-label",e.ChoiceLabelContainer="choice-label-container",e.ChoiceRadio="select-radio",e.ChoiceTextEntryContainer="choice-text-entry-container",e.ChoiceTextInput="choice-text-input",e.CloseButton="close-btn",e.CloseContainer="close-container",e.ConsentLegalNameInput="ul-consent-legal__name-input",e.CustomStyle="ul-custom-style",e.DesktopSuffix="--desktop",e.FadeInTransition="fade-in-transition",e.LikertNumber="likert-number",e.LikertSmiley="likert-smiley",e.LikertStar="likert-star",e.LoadingSpinner="ul-loading-spinner",e.LoadingSpinnerContainer="ul-loading-spinner-container",e.LoadingSpinnerFirst="first",e.LoadingSpinnerFourth="fourth",e.LoadingSpinnerSecond="second",e.LoadingSpinnerThird="third",e.MobileSuffix="--mobile",e.NPSNumber="nps-number",e.OpenTextInput="ul-card-text__input",e.QuestionHeader="ul-question",e.VideoCard="ul-card--video",e.CheckmarkButton="ul-button-checkmark",e.InactiveButton="ul-button-inactive",e.LeftAlignButton="ul-button-left-align",e.ButtonDisabled="sprig-button-disabled",e.SkipButton="ul-card-skip__button",e))(O||{});const Fa="#e6e6e6",Xn="#bd282a",Lg=500,Og=1030;var Fe=(e=>(e.Preview="sprig.previewKey",e.Credentials="userleap.ids",e.PageViews="userleap.pageviews",e))(Fe||{});const lc=()=>{try{return window.parent.Intercom}catch(e){return console.error(e),null}},Ng=()=>{const e=lc();!e||(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)},Ug=()=>{const e=lc();!e||(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},Dg=Object.freeze(Object.defineProperty({__proto__:null,enable:Ng,disable:Ug},Symbol.toStringTag,{value:"Module"})),tu=[Dg];class No{static disable(){tu.forEach(t=>t.disable())}static enable(){tu.forEach(t=>t.enable())}}const Pg=1,Ln=e=>e instanceof HTMLElement,Mg=e=>e instanceof HTMLInputElement,er=e=>e instanceof HTMLTextAreaElement,cc=(e,t,n)=>{const r=e.createElement("style");n&&(r.nonce=n),r.textContent=t,r.id=O.CustomStyle,e.head.appendChild(r)},dc=e=>{const t=e.querySelector(`.${O.CardContainer}`);let n=600,r=0;if(t){n=t.scrollHeight;const i=getComputedStyle(t),o=parseFloat(i.marginTop)+parseFloat(i.marginBottom),a=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth);r=o+a}return n+r+Pg},Fg=e=>{const t=e.querySelector(`.${O.CardContainer}`);t&&(t.scrollTop=0)};var Vg=class extends Error{constructor(e,t,n){super(`Possible EventEmitter memory leak detected. ${n} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=t,this.count=n,this.name="MaxListenersExceededWarning"}},fc=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=fc.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}_emitInternalEvent(e,t,n){this.emit(e,t,n)}_getListeners(e){return Array.prototype.concat.apply([],this.events.get(e))||[]}_removeListener(e,t){const n=e.indexOf(t);return n>-1&&e.splice(n,1),[]}_wrapOnceListener(e,t){const n=(...r)=>(this.removeListener(e,n),t.apply(this,r));return Object.defineProperty(n,"name",{value:t.name}),n}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(e,...t){const n=this._getListeners(e);return n.forEach(r=>{r.apply(this,t)}),n.length>0}addListener(e,t){this._emitInternalEvent("newListener",e,t);const n=this._getListeners(e).concat(t);if(this.events.set(e,n),this.maxListeners>0&&this.listenerCount(e)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;const r=new Vg(this,e,this.listenerCount(e));console.warn(r)}return this}on(e,t){return this.addListener(e,t)}once(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}prependListener(e,t){const n=this._getListeners(e);if(n.length>0){const r=[t].concat(n);this.events.set(e,r)}else this.events.set(e,n.concat(t));return this}prependOnceListener(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}removeListener(e,t){const n=this._getListeners(e);return n.length>0&&(this._removeListener(n,t),this.events.set(e,n),this._emitInternalEvent("removeListener",e,t)),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){return e?this.events.delete(e):this.events.clear(),this}listeners(e){return Array.from(this._getListeners(e))}listenerCount(e){return this._getListeners(e).length}rawListeners(e){return this.listeners(e)}},pc=fc;pc.defaultMaxListeners=10;const z=new pc;var qn=(e=>(e.BottomLeft="bottomLeft",e.BottomRight="bottomRight",e.Center="center",e.TopLeft="topLeft",e.TopRight="topRight",e))(qn||{}),at=(e=>(e.Error="x-ul-error",e.EnvironmentID="x-ul-environment-id",e.InstallationMethod="x-ul-installation-method",e.PartnerAnonymousId="x-ul-anonymous-id",e.Platform="userleap-platform",e.PreviewMode="x-ul-preview-mode",e.UserID="x-ul-user-id",e.VisitorID="x-ul-visitor-id",e))(at||{}),on=(e=>(e.Email="email",e.Link="link",e.Web="web",e))(on||{}),Xt=(e=>(e.Npm="web-npm",e.NpmBundled="web-npm-bundled",e.Gtm="web-gtm",e.Segment="web-segment",e.SegmentAndroid="android-segment",e.SegmentReactNative="react-native-segment",e.SegmentIOS="ios-segment",e.Snippet="web-snippet",e))(Xt||{});const vi=e=>new Promise(t=>{setTimeout(()=>{t()},e)}),En=({"userleap-platform":e})=>e!==on.Web,ve=(e,t)=>{const n=t?O.MobileSuffix:O.DesktopSuffix;return[e+n,e]},Bg=(e,t)=>[e,`${e}__${t}`];class Kg{constructor(t){Ce(this,"payload");Ce(this,"promise");Ce(this,"reject",()=>{});Ce(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((n,r)=>{this.reject=r,this.resolve=n})}resolveRequest(t){this.resolve(t)}}const Hg={RATELIMIT_RESET_DEFAULT:10};let hc=!1,mc="",Vr=!1,gc=!1,Yr=[];const jg=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?Xt.Gtm:e._segment?Xt.Segment:Xt.Snippet,Uo=e=>{var t;(t=e==null?void 0:e.blockedURI)!=null&&t.includes(window.UserLeap._API_URL)&&(gc=!0,console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`),document.removeEventListener("securitypolicyviolation",Uo))},Do=(e="")=>{hc=!0,mc=e};function On(e={}){const t={"Content-Type":"application/json","userleap-platform":on.Web,"x-ul-sdk-version":"2.24.10",[at.InstallationMethod]:jg(e)};if(e.envId&&(t[at.EnvironmentID]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t[at.UserID]=e.userId),e.visitorId&&(t[at.VisitorID]=e.visitorId),e.partnerAnonymousId&&(t[at.PartnerAnonymousId]=e.partnerAnonymousId),e.mobileHeadersJSON){const n=JSON.parse(e.mobileHeadersJSON);Object.assign(t,n)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t[at.PreviewMode]="1"),t}const nu=async(e,t,n)=>{if(e)return{status:429};{const r=new Kg(n);return Yr.push(r),r.promise}},wt=async(e,t,n=0,r=!1,i=!1)=>{const o={url:e,options:t,attempt:n,shouldDropOnRateLimit:r};if(Vr&&!i)return nu(r,i,o);const a={ok:!1,reportError:!1};if(hc)return console.info(`UserLeap - ${mc}`),a;try{t.headers=Object.assign(On(),t.headers);const s=await fetch(e,t);if(s.status===429)if(!Vr&&!r||i){Vr=!0;const c=s.headers.has("ratelimit-reset")?Number(s.headers.get("ratelimit-reset")):Hg.RATELIMIT_RESET_DEFAULT;return await vi(c*1e3),wt(e,t,0,r,!0)}else return nu(r,!1,o);if(Vr=!1,Yr.length&&(Yr.map(u=>{const{url:c,options:l,attempt:d,shouldDropOnRateLimit:p}=u.payload;wt(c,l,d,p).then(f=>{u.resolveRequest(f)})}),Yr=[]),s.ok){if(s.status===249)return Do(),a;const u=await s.text();try{return u&&u!=="OK"&&(s.json=JSON.parse(u)),s}catch{return{ok:!1,reportError:!1,error:new Error(`failed parsing response json for ${e} - ${u}`)}}}return s}catch(s){const u=n+1;return u>5||gc?{ok:!1,reportError:!1,error:s}:(await vi(Math.pow(2,n)*1e3),wt(e,t,u))}};var vc={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(oe,function(){var n=function(o,a){if(a=a||{},typeof o!="function")throw new i("fetch must be a function");if(typeof a!="object")throw new i("defaults must be an object");if(a.retries!==void 0&&!r(a.retries))throw new i("retries must be a positive integer");if(a.retryDelay!==void 0&&!r(a.retryDelay)&&typeof a.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(a.retryOn!==void 0&&!Array.isArray(a.retryOn)&&typeof a.retryOn!="function")throw new i("retryOn property expects an array or function");var s={retries:3,retryDelay:1e3,retryOn:[]};return a=Object.assign(s,a),function(c,l){var d=a.retries,p=a.retryDelay,f=a.retryOn;if(l&&l.retries!==void 0)if(r(l.retries))d=l.retries;else throw new i("retries must be a positive integer");if(l&&l.retryDelay!==void 0)if(r(l.retryDelay)||typeof l.retryDelay=="function")p=l.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(l&&l.retryOn)if(Array.isArray(l.retryOn)||typeof l.retryOn=="function")f=l.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(h,m){var g=function(y){var v=typeof Request<"u"&&c instanceof Request?c.clone():c;o(v,l).then(function(b){if(Array.isArray(f)&&f.indexOf(b.status)===-1)h(b);else if(typeof f=="function")try{return Promise.resolve(f(y,null,b)).then(function(_){_?w(y,null,b):h(b)}).catch(m)}catch(_){m(_)}else y<d?w(y,null,b):h(b)}).catch(function(b){if(typeof f=="function")try{Promise.resolve(f(y,b,null)).then(function(_){_?w(y,b,null):m(b)}).catch(function(_){m(_)})}catch(_){m(_)}else y<d?w(y,b,null):m(b)})};function w(y,v,b){var _=typeof p=="function"?p(y,v,b):p;setTimeout(function(){g(++y)},_)}g(0)})}};function r(o){return Number.isInteger(o)&&o>=0}function i(o){this.name="ArgumentError",this.message=o}return n})})(vc);const Gg=vc.exports;class zg{constructor(t){Ce(this,"awaitingResolvers",[]);Ce(this,"activeCount",0);this.capacity=t}async acquire(){if(this.activeCount<this.capacity){this.activeCount++;return}return new Promise(t=>{this.awaitingResolvers.push(t)})}release(){const t=this.awaitingResolvers.shift();t&&this.activeCount<=this.capacity?t():this.activeCount--}async execute(t){try{return await this.acquire(),await t()}finally{this.release()}}setLimit(t){this.capacity=t}}const yc=new zg(2),Wg=e=>yc.setLimit(e),qg=Gg(fetch),$g=async(e,t=3)=>yc.execute(async()=>{const r=(await qg(e.uploadUrl,{body:e.data,method:"PUT",retries:t,retryDelay:i=>Math.pow(2,i)*1e3})).headers.get("ETag");if(!r)throw new Error(`Upload response did not include etag for upload ${e.uploadId}, part ${e.chunkIndex}`);return r}),_c=async({apiUrl:e,surveyId:t,uploadId:n,etags:r,headers:i,responseGroupUuid:o,replayDuration:a,eventDigest:s},u=!1)=>{var c;if(!(!u&&!n&&!r))return wt(`${e}/sdk/1/completeSessionReplay`,{method:"POST",body:JSON.stringify({etags:r,uploadId:n,responseGroupUuid:o,surveyId:t,replayDuration:a,eventDigest:s,userAgent:(c=window==null?void 0:window.navigator)==null?void 0:c.userAgent}),headers:i})};/*! *****************************************************************************
21
21
  Copyright (c) Microsoft Corporation.
22
22
  Permission to use, copy, modify, and/or distribute this software for any
23
23
  purpose with or without fee is hereby granted.
@@ -28,13 +28,13 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
28
28
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
29
29
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30
30
  PERFORMANCE OF THIS SOFTWARE.
31
- ***************************************************************************** */var $=function(){return $=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},$.apply(this,arguments)};function na(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ae=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ve=Object.keys,Le=Array.isArray;typeof Promise<"u"&&!ae.Promise&&(ae.Promise=Promise);function Ue(e,t){return typeof t!="object"||ve(t).forEach(function(n){e[n]=t[n]}),e}var yr=Object.getPrototypeOf,Rv={}.hasOwnProperty;function ze(e,t){return Rv.call(e,t)}function jn(e,t){typeof t=="function"&&(t=t(yr(e))),(typeof Reflect>"u"?ve:Reflect.ownKeys)(t).forEach(function(n){Nt(e,n,t[n])})}var Qc=Object.defineProperty;function Nt(e,t,n,r){Qc(e,t,Ue(n&&ze(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function qn(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Nt(e.prototype,"constructor",e),{extend:jn.bind(null,e.prototype)}}}}var Lv=Object.getOwnPropertyDescriptor;function os(e,t){var n=Lv(e,t),r;return n||(r=yr(e))&&os(r,t)}var Ov=[].slice;function Ji(e,t,n){return Ov.call(e,t,n)}function Jc(e,t){return t(e)}function rr(e){if(!e)throw new Error("Assertion Failed")}function Xc(e){ae.setImmediate?setImmediate(e):setTimeout(e,0)}function ed(e,t){return e.reduce(function(n,r,i){var o=t(r,i);return o&&(n[o[0]]=o[1]),n},{})}function Nv(e,t,n){try{e.apply(null,n)}catch(r){t&&t(r)}}function Lt(e,t){if(ze(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],r=0,i=t.length;r<i;++r){var o=Lt(e,t[r]);n.push(o)}return n}var a=t.indexOf(".");if(a!==-1){var s=e[t.substr(0,a)];return s===void 0?void 0:Lt(s,t.substr(a+1))}}function ot(e,t,n){if(!(!e||t===void 0)&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){rr(typeof n!="string"&&"length"in n);for(var r=0,i=t.length;r<i;++r)ot(e,t[r],n[r])}else{var o=t.indexOf(".");if(o!==-1){var a=t.substr(0,o),s=t.substr(o+1);if(s==="")n===void 0?Le(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var l=e[a];(!l||!ze(e,a))&&(l=e[a]={}),ot(l,s,n)}}else n===void 0?Le(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function Dv(e,t){typeof t=="string"?ot(e,t,void 0):"length"in t&&[].map.call(t,function(n){ot(e,n,void 0)})}function td(e){var t={};for(var n in e)ze(e,n)&&(t[n]=e[n]);return t}var Uv=[].concat;function nd(e){return Uv.apply([],e)}var rd="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(nd([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return ae[e]}),Pv=rd.map(function(e){return ae[e]});ed(rd,function(e){return[e,!0]});var Bt=null;function Nr(e){Bt=typeof WeakMap<"u"&&new WeakMap;var t=ra(e);return Bt=null,t}function ra(e){if(!e||typeof e!="object")return e;var t=Bt&&Bt.get(e);if(t)return t;if(Le(e)){t=[],Bt&&Bt.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(ra(e[n]))}else if(Pv.indexOf(e.constructor)>=0)t=e;else{var i=yr(e);t=i===Object.prototype?{}:Object.create(i),Bt&&Bt.set(e,t);for(var o in e)ze(e,o)&&(t[o]=ra(e[o]))}return t}var Mv={}.toString;function ia(e){return Mv.call(e).slice(8,-1)}var oa=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Vv=typeof oa=="symbol"?function(e){var t;return e!=null&&(t=e[oa])&&t.apply(e)}:function(){return null},An={};function Et(e){var t,n,r,i;if(arguments.length===1){if(Le(e))return e.slice();if(this===An&&typeof e=="string")return[e];if(i=Vv(e)){for(n=[];r=i.next(),!r.done;)n.push(r.value);return n}if(e==null)return[e];if(t=e.length,typeof t=="number"){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var as=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},gt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function id(e,t){gt=e,od=t}var od=function(){return!0},Fv=!new Error("").stack;function bn(){if(Fv)try{throw bn.arguments,new Error}catch(e){return e}return new Error}function aa(e,t){var n=e.stack;return n?(t=t||0,n.indexOf(e.name)===0&&(t+=(e.name+e.message).split(`
31
+ ***************************************************************************** */var j=function(){return j=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},j.apply(this,arguments)};function Po(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var re=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,me=Object.keys,Ae=Array.isArray;typeof Promise<"u"&&!re.Promise&&(re.Promise=Promise);function Le(e,t){return typeof t!="object"||me(t).forEach(function(n){e[n]=t[n]}),e}var lr=Object.getPrototypeOf,Yg={}.hasOwnProperty;function Be(e,t){return Yg.call(e,t)}function Nn(e,t){typeof t=="function"&&(t=t(lr(e))),(typeof Reflect>"u"?me:Reflect.ownKeys)(t).forEach(function(n){Ct(e,n,t[n])})}var bc=Object.defineProperty;function Ct(e,t,n,r){bc(e,t,Le(n&&Be(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Bn(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Ct(e.prototype,"constructor",e),{extend:Nn.bind(null,e.prototype)}}}}var Zg=Object.getOwnPropertyDescriptor;function Va(e,t){var n=Zg(e,t),r;return n||(r=lr(e))&&Va(r,t)}var Qg=[].slice;function Bi(e,t,n){return Qg.call(e,t,n)}function wc(e,t){return t(e)}function $n(e){if(!e)throw new Error("Assertion Failed")}function Sc(e){re.setImmediate?setImmediate(e):setTimeout(e,0)}function Ic(e,t){return e.reduce(function(n,r,i){var o=t(r,i);return o&&(n[o[0]]=o[1]),n},{})}function Jg(e,t,n){try{e.apply(null,n)}catch(r){t&&t(r)}}function St(e,t){if(Be(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],r=0,i=t.length;r<i;++r){var o=St(e,t[r]);n.push(o)}return n}var a=t.indexOf(".");if(a!==-1){var s=e[t.substr(0,a)];return s===void 0?void 0:St(s,t.substr(a+1))}}function tt(e,t,n){if(!(!e||t===void 0)&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){$n(typeof n!="string"&&"length"in n);for(var r=0,i=t.length;r<i;++r)tt(e,t[r],n[r])}else{var o=t.indexOf(".");if(o!==-1){var a=t.substr(0,o),s=t.substr(o+1);if(s==="")n===void 0?Ae(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var u=e[a];(!u||!Be(e,a))&&(u=e[a]={}),tt(u,s,n)}}else n===void 0?Ae(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function Xg(e,t){typeof t=="string"?tt(e,t,void 0):"length"in t&&[].map.call(t,function(n){tt(e,n,void 0)})}function Cc(e){var t={};for(var n in e)Be(e,n)&&(t[n]=e[n]);return t}var ev=[].concat;function Ec(e){return ev.apply([],e)}var kc="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Ec([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return re[e]}),tv=kc.map(function(e){return re[e]});Ic(kc,function(e){return[e,!0]});var Ot=null;function Ir(e){Ot=typeof WeakMap<"u"&&new WeakMap;var t=Mo(e);return Ot=null,t}function Mo(e){if(!e||typeof e!="object")return e;var t=Ot&&Ot.get(e);if(t)return t;if(Ae(e)){t=[],Ot&&Ot.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(Mo(e[n]))}else if(tv.indexOf(e.constructor)>=0)t=e;else{var i=lr(e);t=i===Object.prototype?{}:Object.create(i),Ot&&Ot.set(e,t);for(var o in e)Be(e,o)&&(t[o]=Mo(e[o]))}return t}var nv={}.toString;function Fo(e){return nv.call(e).slice(8,-1)}var Vo=typeof Symbol<"u"?Symbol.iterator:"@@iterator",rv=typeof Vo=="symbol"?function(e){var t;return e!=null&&(t=e[Vo])&&t.apply(e)}:function(){return null},_n={};function gt(e){var t,n,r,i;if(arguments.length===1){if(Ae(e))return e.slice();if(this===_n&&typeof e=="string")return[e];if(i=rv(e)){for(n=[];r=i.next(),!r.done;)n.push(r.value);return n}if(e==null)return[e];if(t=e.length,typeof t=="number"){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var Ba=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},ct=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ac(e,t){ct=e,xc=t}var xc=function(){return!0},iv=!new Error("").stack;function cn(){if(iv)try{throw cn.arguments,new Error}catch(e){return e}return new Error}function Bo(e,t){var n=e.stack;return n?(t=t||0,n.indexOf(e.name)===0&&(t+=(e.name+e.message).split(`
32
32
  `).length),n.split(`
33
- `).slice(t).filter(od).map(function(r){return`
34
- `+r}).join("")):""}var Bv=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"],ad=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ss=Bv.concat(ad),jv={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function $n(e,t){this._e=bn(),this.name=e,this.message=t}qn($n).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+aa(this._e,2))}},toString:function(){return this.name+": "+this.message}});function sd(e,t){return e+". Errors: "+Object.keys(t).map(function(n){return t[n].toString()}).filter(function(n,r,i){return i.indexOf(n)===r}).join(`
35
- `)}function Ti(e,t,n,r){this._e=bn(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=sd(e,t)}qn(Ti).from($n);function cr(e,t){this._e=bn(),this.name="BulkError",this.failures=Object.keys(t).map(function(n){return t[n]}),this.failuresByPos=t,this.message=sd(e,t)}qn(cr).from($n);var ls=ss.reduce(function(e,t){return e[t]=t+"Error",e},{}),Hv=$n,B=ss.reduce(function(e,t){var n=t+"Error";function r(i,o){this._e=bn(),this.name=n,i?typeof i=="string"?(this.message=""+i+(o?`
36
- `+o:""),this.inner=o||null):typeof i=="object"&&(this.message=i.name+" "+i.message,this.inner=i):(this.message=jv[t]||n,this.inner=null)}return qn(r).from(Hv),e[t]=r,e},{});B.Syntax=SyntaxError;B.Type=TypeError;B.Range=RangeError;var Il=ad.reduce(function(e,t){return e[t+"Error"]=B[t],e},{});function zv(e,t){if(!e||e instanceof $n||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Il[e.name])return e;var n=new Il[e.name](t||e.message,e);return"stack"in e&&Nt(n,"stack",{get:function(){return this.inner.stack}}),n}var Xi=ss.reduce(function(e,t){return["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=B[t]),e},{});Xi.ModifyError=Ti;Xi.DexieError=$n;Xi.BulkError=cr;function ne(){}function Dr(e){return e}function Gv(e,t){return e==null||e===Dr?t:function(n){return t(e(n))}}function gn(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Kv(e,t){return e===ne?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?gn(r,this.onsuccess):r),i&&(this.onerror=this.onerror?gn(i,this.onerror):i),o!==void 0?o:n}}function Wv(e,t){return e===ne?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?gn(n,this.onsuccess):n),r&&(this.onerror=this.onerror?gn(r,this.onerror):r)}}function qv(e,t){return e===ne?t:function(n){var r=e.apply(this,arguments);Ue(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?gn(i,this.onsuccess):i),o&&(this.onerror=this.onerror?gn(o,this.onerror):o),r===void 0?a===void 0?void 0:a:Ue(r,a)}}function $v(e,t){return e===ne?t:function(){return t.apply(this,arguments)===!1?!1:e.apply(this,arguments)}}function us(e,t){return e===ne?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then=="function"){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}var _r={},Yv=100,Zv=20,ld=100,cs=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,yr(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,yr(t),e]}(),sa=cs[0],Ri=cs[1],la=cs[2],ud=Ri&&Ri.then,oi=sa&&sa.constructor,ds=!!la,ua=!1,Qv=la?function(){la.then(Yr)}:ae.setImmediate?setImmediate.bind(null,Yr):ae.MutationObserver?function(){var e=document.createElement("div");new MutationObserver(function(){Yr(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(Yr,0)},br=function(e,t){ir.push([e,t]),Li&&(Qv(),Li=!1)},ca=!0,Li=!0,fn=[],ai=[],da=null,fa=Dr,Un={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Al,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(function(e){try{Al(e[0],e[1])}catch{}})}},M=Un,ir=[],pn=0,si=[];function D(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ne,this._lib=!1;var t=this._PSD=M;if(gt&&(this._stackHolder=bn(),this._prev=null,this._numPrev=0),typeof e!="function"){if(e!==_r)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&ha(this,this._value);return}this._state=null,this._value=null,++t.ref,dd(this,e)}var pa={get:function(){var e=M,t=Oi;function n(r,i){var o=this,a=!e.global&&(e!==M||t!==Oi),s=a&&!Dt(),l=new D(function(u,c){fs(o,new cd(Di(r,e,a,s),Di(i,e,a,s),u,c,e))});return gt&&hd(l,this),l}return n.prototype=_r,n},set:function(e){Nt(this,"then",e&&e.prototype===_r?pa:{get:function(){return e},set:pa.set})}};jn(D.prototype,{then:pa,_then:function(e,t){fs(this,new cd(null,null,e,t,M))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=arguments[0],n=arguments[1];return typeof t=="function"?this.then(null,function(r){return r instanceof t?n(r):li(r)}):this.then(null,function(r){return r&&r.name===t?n(r):li(r)})},finally:function(e){return this.then(function(t){return e(),t},function(t){return e(),li(t)})},stack:{get:function(){if(this._stack)return this._stack;try{ua=!0;var e=pd(this,[],Zv),t=e.join(`
37
- From previous: `);return this._state!==null&&(this._stack=t),t}finally{ua=!1}}},timeout:function(e,t){var n=this;return e<1/0?new D(function(r,i){var o=setTimeout(function(){return i(new B.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}});typeof Symbol<"u"&&Symbol.toStringTag&&Nt(D.prototype,Symbol.toStringTag,"Dexie.Promise");Un.env=md();function cd(e,t,n,r,i){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=n,this.reject=r,this.psd=i}jn(D,{all:function(){var e=Et.apply(null,arguments).map(Ni);return new D(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(i,o){return D.resolve(i).then(function(a){e[o]=a,--r||t(e)},n)})})},resolve:function(e){if(e instanceof D)return e;if(e&&typeof e.then=="function")return new D(function(n,r){e.then(n,r)});var t=new D(_r,!0,e);return hd(t,da),t},reject:li,race:function(){var e=Et.apply(null,arguments).map(Ni);return new D(function(t,n){e.map(function(r){return D.resolve(r).then(t,n)})})},PSD:{get:function(){return M},set:function(e){return M=e}},totalEchoes:{get:function(){return Oi}},newPSD:Wt,usePSD:Zn,scheduler:{get:function(){return br},set:function(e){br=e}},rejectionMapper:{get:function(){return fa},set:function(e){fa=e}},follow:function(e,t){return new D(function(n,r){return Wt(function(i,o){var a=M;a.unhandleds=[],a.onunhandled=o,a.finalize=gn(function(){var s=this;Xv(function(){s.unhandleds.length===0?i():o(s.unhandleds[0])})},a.finalize),e()},t,n,r)})}});oi&&(oi.allSettled&&Nt(D,"allSettled",function(){var e=Et.apply(null,arguments).map(Ni);return new D(function(t){e.length===0&&t([]);var n=e.length,r=new Array(n);e.forEach(function(i,o){return D.resolve(i).then(function(a){return r[o]={status:"fulfilled",value:a}},function(a){return r[o]={status:"rejected",reason:a}}).then(function(){return--n||t(r)})})})}),oi.any&&typeof AggregateError<"u"&&Nt(D,"any",function(){var e=Et.apply(null,arguments).map(Ni);return new D(function(t,n){e.length===0&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach(function(o,a){return D.resolve(o).then(function(s){return t(s)},function(s){i[a]=s,--r||n(new AggregateError(i))})})})}));function dd(e,t){try{t(function(n){if(e._state===null){if(n===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&Ur();n&&typeof n.then=="function"?dd(e,function(i,o){n instanceof D?n._then(i,o):n.then(i,o)}):(e._state=!0,e._value=n,fd(e)),r&&Pr()}},ha.bind(null,e))}catch(n){ha(e,n)}}function ha(e,t){if(ai.push(t),e._state===null){var n=e._lib&&Ur();t=fa(t),e._state=!1,e._value=t,gt&&t!==null&&typeof t=="object"&&!t._promise&&Nv(function(){var r=os(t,"stack");t._promise=e,Nt(t,"stack",{get:function(){return ua?r&&(r.get?r.get.apply(t):r.value):e.stack}})}),ey(e),fd(e),n&&Pr()}}function fd(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)fs(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),pn===0&&(++pn,br(function(){--pn===0&&ps()},[]))}function fs(e,t){if(e._state===null){e._listeners.push(t);return}var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++pn,br(Jv,[n,e,t])}function Jv(e,t,n){try{da=t;var r,i=t._value;t._state?r=e(i):(ai.length&&(ai=[]),r=e(i),ai.indexOf(i)===-1&&ty(t)),n.resolve(r)}catch(o){n.reject(o)}finally{da=null,--pn===0&&ps(),--n.psd.ref||n.psd.finalize()}}function pd(e,t,n){if(t.length===n)return t;var r="";if(e._state===!1){var i=e._value,o,a;i!=null?(o=i.name||"Error",a=i.message||i,r=aa(i,0)):(o=i,a=""),t.push(o+(a?": "+a:"")+r)}return gt&&(r=aa(e._stackHolder,2),r&&t.indexOf(r)===-1&&t.push(r),e._prev&&pd(e._prev,t,n)),t}function hd(e,t){var n=t?t._numPrev+1:0;n<Yv&&(e._prev=t,e._numPrev=n)}function Yr(){Ur()&&Pr()}function Ur(){var e=ca;return ca=!1,Li=!1,e}function Pr(){var e,t,n;do for(;ir.length>0;)for(e=ir,ir=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(ir.length>0);ca=!0,Li=!0}function ps(){var e=fn;fn=[],e.forEach(function(r){r._PSD.onunhandled.call(null,r._value,r)});for(var t=si.slice(0),n=t.length;n;)t[--n]()}function Xv(e){function t(){e(),si.splice(si.indexOf(t),1)}si.push(t),++pn,br(function(){--pn===0&&ps()},[])}function ey(e){fn.some(function(t){return t._value===e._value})||fn.push(e)}function ty(e){for(var t=fn.length;t;)if(fn[--t]._value===e._value){fn.splice(t,1);return}}function li(e){return new D(_r,!1,e)}function ue(e,t){var n=M;return function(){var r=Ur(),i=M;try{return qt(n,!0),e.apply(this,arguments)}catch(o){t&&t(o)}finally{qt(i,!1),r&&Pr()}}}var Re={awaits:0,echoes:0,id:0},ny=0,ui=[],Co=0,Oi=0,ry=0;function Wt(e,t,n,r){var i=M,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++ry;var a=Un.env;o.env=ds?{Promise:D,PromiseProp:{value:D,configurable:!0,writable:!0},all:D.all,race:D.race,allSettled:D.allSettled,any:D.any,resolve:D.resolve,reject:D.reject,nthen:kl(a.nthen,o),gthen:kl(a.gthen,o)}:{},t&&Ue(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=Zn(o,e,n,r);return o.ref===0&&o.finalize(),s}function Yn(){return Re.id||(Re.id=++ny),++Re.awaits,Re.echoes+=ld,Re.id}function Dt(){return Re.awaits?(--Re.awaits===0&&(Re.id=0),Re.echoes=Re.awaits*ld,!0):!1}(""+ud).indexOf("[native code]")===-1&&(Yn=Dt=ne);function Ni(e){return Re.echoes&&e&&e.constructor===oi?(Yn(),e.then(function(t){return Dt(),t},function(t){return Dt(),we(t)})):e}function iy(e){++Oi,(!Re.echoes||--Re.echoes===0)&&(Re.echoes=Re.id=0),ui.push(M),qt(e,!0)}function oy(){var e=ui[ui.length-1];ui.pop(),qt(e,!1)}function qt(e,t){var n=M;if((t?Re.echoes&&(!Co++||e!==M):Co&&(!--Co||e!==M))&&gd(t?iy.bind(null,e):oy),e!==M&&(M=e,n===Un&&(Un.env=md()),ds)){var r=Un.env.Promise,i=e.env;Ri.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(ae,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function md(){var e=ae.Promise;return ds?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(ae,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ri.then,gthen:e.prototype.then}:{}}function Zn(e,t,n,r,i){var o=M;try{return qt(e,!0),t(n,r,i)}finally{qt(o,!1)}}function gd(e){ud.call(sa,e)}function Di(e,t,n,r){return typeof e!="function"?e:function(){var i=M;n&&Yn(),qt(t,!0);try{return e.apply(this,arguments)}finally{qt(i,!1),r&&gd(Dt)}}}function kl(e,t){return function(n,r){return e.call(this,Di(n,t),Di(r,t))}}var xl="unhandledrejection";function Al(e,t){var n;try{n=t.onuncatched(e)}catch{}if(n!==!1)try{var r,i={promise:t,reason:e};if(ae.document&&document.createEvent?(r=document.createEvent("Event"),r.initEvent(xl,!0,!0),Ue(r,i)):ae.CustomEvent&&(r=new CustomEvent(xl,{detail:i}),Ue(r,i)),r&&ae.dispatchEvent&&(dispatchEvent(r),!ae.PromiseRejectionEvent&&ae.onunhandledrejection))try{ae.onunhandledrejection(r)}catch{}gt&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch{}}var we=D.reject;function ma(e,t,n,r){if(!e.idbdb||!e._state.openComplete&&!M.letThrough&&!e._vip){if(e._state.openComplete)return we(new B.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return we(new B.DatabaseClosed);e.open().catch(ne)}return e._state.dbReadyPromise.then(function(){return ma(e,t,n,r)})}else{var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===ls.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(function(){return ma(e,t,n,r)})):we(o)}return i._promise(t,function(o,a){return Wt(function(){return M.trans=i,r(o,a,i)})}).then(function(o){return i._completion.then(function(){return o})})}}var Tl="3.2.4",un=String.fromCharCode(65535),ga=-1/0,_t="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",vd="String expected.",dr=[],eo=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),ay=eo,sy=eo,yd=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},to="__dbnames",Eo="readonly",So="readwrite";function vn(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var _d={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Zr(e){return typeof e=="string"&&!/\./.test(e)?function(t){return t[e]===void 0&&e in t&&(t=Nr(t),delete t[e]),t}:function(t){return t}}var ly=function(){function e(){}return e.prototype._trans=function(t,n,r){var i=this._tx||M.trans,o=this.name;function a(l,u,c){if(!c.schema[o])throw new B.NotFound("Table "+o+" not part of transaction");return n(c.idbtrans,c)}var s=Ur();try{return i&&i.db===this.db?i===M.trans?i._promise(t,a,r):Wt(function(){return i._promise(t,a,r)},{trans:i,transless:M.transless||M}):ma(this.db,t,[this.name],a)}finally{s&&Pr()}},e.prototype.get=function(t,n){var r=this;return t&&t.constructor===Object?this.where(t).first(n):this._trans("readonly",function(i){return r.core.get({trans:i,key:t}).then(function(o){return r.hook.reading.fire(o)})}).then(n)},e.prototype.where=function(t){if(typeof t=="string")return new this.db.WhereClause(this,t);if(Le(t))return new this.db.WhereClause(this,"["+t.join("+")+"]");var n=ve(t);if(n.length===1)return this.where(n[0]).equals(t[n[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter(function(c){return c.compound&&n.every(function(d){return c.keyPath.indexOf(d)>=0})&&c.keyPath.every(function(d){return n.indexOf(d)>=0})})[0];if(r&&this.db._maxKey!==un)return this.where(r.name).equals(r.keyPath.map(function(c){return t[c]}));!r&&gt&&console.warn("The query "+JSON.stringify(t)+" on "+this.name+" would benefit of a "+("compound index ["+n.join("+")+"]"));var i=this.schema.idxByName,o=this.db._deps.indexedDB;function a(c,d){try{return o.cmp(c,d)===0}catch{return!1}}var s=n.reduce(function(c,d){var p=c[0],f=c[1],h=i[d],m=t[d];return[p||h,p||!h?vn(f,h&&h.multi?function(g){var b=Lt(g,d);return Le(b)&&b.some(function(y){return a(m,y)})}:function(g){return a(m,Lt(g,d))}):f]},[null,null]),l=s[0],u=s[1];return l?this.where(l.name).equals(t[l.keyPath]).filter(u):r?this.filter(u):this.where(n).equals("")},e.prototype.filter=function(t){return this.toCollection().and(t)},e.prototype.count=function(t){return this.toCollection().count(t)},e.prototype.offset=function(t){return this.toCollection().offset(t)},e.prototype.limit=function(t){return this.toCollection().limit(t)},e.prototype.each=function(t){return this.toCollection().each(t)},e.prototype.toArray=function(t){return this.toCollection().toArray(t)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(t){return new this.db.Collection(new this.db.WhereClause(this,Le(t)?"["+t.join("+")+"]":t))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(t){this.schema.mappedClass=t;var n=function(r){if(!r)return r;var i=Object.create(t.prototype);for(var o in r)if(ze(r,o))try{i[o]=r[o]}catch{}return i};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),t},e.prototype.defineClass=function(){function t(n){Ue(this,n)}return this.mapToClass(t)},e.prototype.add=function(t,n){var r=this,i=this.schema.primKey,o=i.auto,a=i.keyPath,s=t;return a&&o&&(s=Zr(a)(t)),this._trans("readwrite",function(l){return r.core.mutate({trans:l,type:"add",keys:n!=null?[n]:null,values:[s]})}).then(function(l){return l.numFailures?D.reject(l.failures[0]):l.lastResult}).then(function(l){if(a)try{ot(t,a,l)}catch{}return l})},e.prototype.update=function(t,n){if(typeof t=="object"&&!Le(t)){var r=Lt(t,this.schema.primKey.keyPath);if(r===void 0)return we(new B.InvalidArgument("Given object does not contain its primary key"));try{typeof n!="function"?ve(n).forEach(function(i){ot(t,i,n[i])}):n(t,{value:t,primKey:r})}catch{}return this.where(":id").equals(r).modify(n)}else return this.where(":id").equals(t).modify(n)},e.prototype.put=function(t,n){var r=this,i=this.schema.primKey,o=i.auto,a=i.keyPath,s=t;return a&&o&&(s=Zr(a)(t)),this._trans("readwrite",function(l){return r.core.mutate({trans:l,type:"put",values:[s],keys:n!=null?[n]:null})}).then(function(l){return l.numFailures?D.reject(l.failures[0]):l.lastResult}).then(function(l){if(a)try{ot(t,a,l)}catch{}return l})},e.prototype.delete=function(t){var n=this;return this._trans("readwrite",function(r){return n.core.mutate({trans:r,type:"delete",keys:[t]})}).then(function(r){return r.numFailures?D.reject(r.failures[0]):void 0})},e.prototype.clear=function(){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"deleteRange",range:_d})}).then(function(n){return n.numFailures?D.reject(n.failures[0]):void 0})},e.prototype.bulkGet=function(t){var n=this;return this._trans("readonly",function(r){return n.core.getMany({keys:t,trans:r}).then(function(i){return i.map(function(o){return n.hook.reading.fire(o)})})})},e.prototype.bulkAdd=function(t,n,r){var i=this,o=Array.isArray(n)?n:void 0;r=r||(o?void 0:n);var a=r?r.allKeys:void 0;return this._trans("readwrite",function(s){var l=i.schema.primKey,u=l.auto,c=l.keyPath;if(c&&o)throw new B.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new B.InvalidArgument("Arguments objects and keys must have the same length");var d=t.length,p=c&&u?t.map(Zr(c)):t;return i.core.mutate({trans:s,type:"add",keys:o,values:p,wantResults:a}).then(function(f){var h=f.numFailures,m=f.results,g=f.lastResult,b=f.failures,y=a?m:g;if(h===0)return y;throw new cr(i.name+".bulkAdd(): "+h+" of "+d+" operations failed",b)})})},e.prototype.bulkPut=function(t,n,r){var i=this,o=Array.isArray(n)?n:void 0;r=r||(o?void 0:n);var a=r?r.allKeys:void 0;return this._trans("readwrite",function(s){var l=i.schema.primKey,u=l.auto,c=l.keyPath;if(c&&o)throw new B.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new B.InvalidArgument("Arguments objects and keys must have the same length");var d=t.length,p=c&&u?t.map(Zr(c)):t;return i.core.mutate({trans:s,type:"put",keys:o,values:p,wantResults:a}).then(function(f){var h=f.numFailures,m=f.results,g=f.lastResult,b=f.failures,y=a?m:g;if(h===0)return y;throw new cr(i.name+".bulkPut(): "+h+" of "+d+" operations failed",b)})})},e.prototype.bulkDelete=function(t){var n=this,r=t.length;return this._trans("readwrite",function(i){return n.core.mutate({trans:i,type:"delete",keys:t})}).then(function(i){var o=i.numFailures,a=i.lastResult,s=i.failures;if(o===0)return a;throw new cr(n.name+".bulkDelete(): "+o+" of "+r+" operations failed",s)})},e}();function Mr(e){var t={},n=function(s,l){if(l){for(var u=arguments.length,c=new Array(u-1);--u;)c[u-1]=arguments[u];return t[s].subscribe.apply(null,c),e}else if(typeof s=="string")return t[s]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(s,l,u){if(typeof s=="object")return a(s);l||(l=$v),u||(u=ne);var c={subscribers:[],fire:u,subscribe:function(d){c.subscribers.indexOf(d)===-1&&(c.subscribers.push(d),c.fire=l(c.fire,d))},unsubscribe:function(d){c.subscribers=c.subscribers.filter(function(p){return p!==d}),c.fire=c.subscribers.reduce(l,u)}};return t[s]=n[s]=c,c}function a(s){ve(s).forEach(function(l){var u=s[l];if(Le(u))o(l,s[l][0],s[l][1]);else if(u==="asap")var c=o(l,Dr,function(){for(var p=arguments.length,f=new Array(p);p--;)f[p]=arguments[p];c.subscribers.forEach(function(h){Xc(function(){h.apply(null,f)})})});else throw new B.InvalidArgument("Invalid event config")})}}function Vr(e,t){return qn(t).from({prototype:e}),t}function uy(e){return Vr(ly.prototype,function(n,r,i){this.db=e,this._tx=i,this.name=n,this.schema=r,this.hook=e._allTables[n]?e._allTables[n].hook:Mr(null,{creating:[Kv,ne],reading:[Gv,Dr],updating:[qv,ne],deleting:[Wv,ne]})})}function In(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Io(e,t){e.filter=vn(e.filter,t)}function ko(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return vn(r(),t())}:t,e.justLimit=n&&!r}function cy(e,t){e.isMatch=vn(e.isMatch,t)}function ci(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new B.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function Rl(e,t,n){var r=ci(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:r,range:e.range}})}function Qr(e,t,n,r){var i=e.replayFilter?vn(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(s,l,u){if(!i||i(l,u,function(p){return l.stop(p)},function(p){return l.fail(p)})){var c=l.primaryKey,d=""+c;d==="[object ArrayBuffer]"&&(d=""+new Uint8Array(c)),ze(o,d)||(o[d]=!0,t(s,l,u))}};return Promise.all([e.or._iterate(a,n),Ll(Rl(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}else return Ll(Rl(e,r,n),vn(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function Ll(e,t,n,r){var i=r?function(a,s,l){return n(r(a),s,l)}:n,o=ue(i);return e.then(function(a){if(a)return a.start(function(){var s=function(){return a.continue()};(!t||t(a,function(l){return s=l},function(l){a.stop(l),s=ne},function(l){a.fail(l),s=ne}))&&o(a.value,a,function(l){return s=l}),s()})})}function De(e,t){try{var n=Ol(e),r=Ol(t);if(n!==r)return n==="Array"?1:r==="Array"?-1:n==="binary"?1:r==="binary"?-1:n==="string"?1:r==="string"?-1:n==="Date"?1:r!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return fy(Nl(e),Nl(t));case"Array":return dy(e,t)}}catch{}return NaN}function dy(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var a=De(e[o],t[o]);if(a!==0)return a}return n===r?0:n<r?-1:1}function fy(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}function Ol(e){var t=typeof e;if(t!=="object")return t;if(ArrayBuffer.isView(e))return"binary";var n=ia(e);return n==="ArrayBuffer"?"binary":n}function Nl(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var py=function(){function e(){}return e.prototype._read=function(t,n){var r=this._ctx;return r.error?r.table._trans(null,we.bind(null,r.error)):r.table._trans("readonly",t).then(n)},e.prototype._write=function(t){var n=this._ctx;return n.error?n.table._trans(null,we.bind(null,n.error)):n.table._trans("readwrite",t,"locked")},e.prototype._addAlgorithm=function(t){var n=this._ctx;n.algorithm=vn(n.algorithm,t)},e.prototype._iterate=function(t,n){return Qr(this._ctx,t,n,this._ctx.table.core)},e.prototype.clone=function(t){var n=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return t&&Ue(r,t),n._ctx=r,n},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(t){var n=this._ctx;return this._read(function(r){return Qr(n,t,r,n.table.core)})},e.prototype.count=function(t){var n=this;return this._read(function(r){var i=n._ctx,o=i.table.core;if(In(i,!0))return o.count({trans:r,query:{index:ci(i,o.schema),range:i.range}}).then(function(s){return Math.min(s,i.limit)});var a=0;return Qr(i,function(){return++a,!1},r,o).then(function(){return a})}).then(t)},e.prototype.sortBy=function(t,n){var r=t.split(".").reverse(),i=r[0],o=r.length-1;function a(u,c){return c?a(u[r[c]],c-1):u[i]}var s=this._ctx.dir==="next"?1:-1;function l(u,c){var d=a(u,o),p=a(c,o);return d<p?-s:d>p?s:0}return this.toArray(function(u){return u.sort(l)}).then(n)},e.prototype.toArray=function(t){var n=this;return this._read(function(r){var i=n._ctx;if(i.dir==="next"&&In(i,!0)&&i.limit>0){var o=i.valueMapper,a=ci(i,i.table.core.schema);return i.table.core.query({trans:r,limit:i.limit,values:!0,query:{index:a,range:i.range}}).then(function(l){var u=l.result;return o?u.map(o):u})}else{var s=[];return Qr(i,function(l){return s.push(l)},r,i.table.core).then(function(){return s})}},t)},e.prototype.offset=function(t){var n=this._ctx;return t<=0?this:(n.offset+=t,In(n)?ko(n,function(){var r=t;return function(i,o){return r===0?!0:r===1?(--r,!1):(o(function(){i.advance(r),r=0}),!1)}}):ko(n,function(){var r=t;return function(){return--r<0}}),this)},e.prototype.limit=function(t){return this._ctx.limit=Math.min(this._ctx.limit,t),ko(this._ctx,function(){var n=t;return function(r,i,o){return--n<=0&&i(o),n>=0}},!0),this},e.prototype.until=function(t,n){return Io(this._ctx,function(r,i,o){return t(r.value)?(i(o),n):!0}),this},e.prototype.first=function(t){return this.limit(1).toArray(function(n){return n[0]}).then(t)},e.prototype.last=function(t){return this.reverse().first(t)},e.prototype.filter=function(t){return Io(this._ctx,function(n){return t(n.value)}),cy(this._ctx,t),this},e.prototype.and=function(t){return this.filter(t)},e.prototype.or=function(t){return new this.db.WhereClause(this._ctx.table,t,this)},e.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,i){t(i.key,i)})},e.prototype.eachUniqueKey=function(t){return this._ctx.unique="unique",this.eachKey(t)},e.prototype.eachPrimaryKey=function(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,i){t(i.primaryKey,i)})},e.prototype.keys=function(t){var n=this._ctx;n.keysOnly=!n.isMatch;var r=[];return this.each(function(i,o){r.push(o.key)}).then(function(){return r}).then(t)},e.prototype.primaryKeys=function(t){var n=this._ctx;if(n.dir==="next"&&In(n,!0)&&n.limit>0)return this._read(function(i){var o=ci(n,n.table.core.schema);return n.table.core.query({trans:i,values:!1,limit:n.limit,query:{index:o,range:n.range}})}).then(function(i){var o=i.result;return o}).then(t);n.keysOnly=!n.isMatch;var r=[];return this.each(function(i,o){r.push(o.primaryKey)}).then(function(){return r}).then(t)},e.prototype.uniqueKeys=function(t){return this._ctx.unique="unique",this.keys(t)},e.prototype.firstKey=function(t){return this.limit(1).keys(function(n){return n[0]}).then(t)},e.prototype.lastKey=function(t){return this.reverse().firstKey(t)},e.prototype.distinct=function(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var r={};return Io(this._ctx,function(i){var o=i.primaryKey.toString(),a=ze(r,o);return r[o]=!0,!a}),this},e.prototype.modify=function(t){var n=this,r=this._ctx;return this._write(function(i){var o;if(typeof t=="function")o=t;else{var a=ve(t),s=a.length;o=function(b){for(var y=!1,_=0;_<s;++_){var v=a[_],w=t[v];Lt(b,v)!==w&&(ot(b,v,w),y=!0)}return y}}var l=r.table.core,u=l.schema.primaryKey,c=u.outbound,d=u.extractKey,p=n.db._options.modifyChunkSize||200,f=[],h=0,m=[],g=function(b,y){var _=y.failures,v=y.numFailures;h+=b-v;for(var w=0,E=ve(_);w<E.length;w++){var I=E[w];f.push(_[I])}};return n.clone().primaryKeys().then(function(b){var y=function(_){var v=Math.min(p,b.length-_);return l.getMany({trans:i,keys:b.slice(_,_+v),cache:"immutable"}).then(function(w){for(var E=[],I=[],S=c?[]:null,x=[],T=0;T<v;++T){var A=w[T],L={value:Nr(A),primKey:b[_+T]};o.call(L,L.value,L)!==!1&&(L.value==null?x.push(b[_+T]):!c&&De(d(A),d(L.value))!==0?(x.push(b[_+T]),E.push(L.value)):(I.push(L.value),c&&S.push(b[_+T])))}var k=In(r)&&r.limit===1/0&&(typeof t!="function"||t===xo)&&{index:r.index,range:r.range};return Promise.resolve(E.length>0&&l.mutate({trans:i,type:"add",values:E}).then(function(U){for(var R in U.failures)x.splice(parseInt(R),1);g(E.length,U)})).then(function(){return(I.length>0||k&&typeof t=="object")&&l.mutate({trans:i,type:"put",keys:S,values:I,criteria:k,changeSpec:typeof t!="function"&&t}).then(function(U){return g(I.length,U)})}).then(function(){return(x.length>0||k&&t===xo)&&l.mutate({trans:i,type:"delete",keys:x,criteria:k}).then(function(U){return g(x.length,U)})}).then(function(){return b.length>_+v&&y(_+p)})})};return y(0).then(function(){if(f.length>0)throw new Ti("Error modifying one or more objects",f,h,m);return b.length})})})},e.prototype.delete=function(){var t=this._ctx,n=t.range;return In(t)&&(t.isPrimKey&&!sy||n.type===3)?this._write(function(r){var i=t.table.core.schema.primaryKey,o=n;return t.table.core.count({trans:r,query:{index:i,range:o}}).then(function(a){return t.table.core.mutate({trans:r,type:"deleteRange",range:o}).then(function(s){var l=s.failures;s.lastResult,s.results;var u=s.numFailures;if(u)throw new Ti("Could not delete some values",Object.keys(l).map(function(c){return l[c]}),a-u);return a-u})})}):this.modify(xo)},e}(),xo=function(e,t){return t.value=null};function hy(e){return Vr(py.prototype,function(n,r){this.db=e;var i=_d,o=null;if(r)try{i=r()}catch(u){o=u}var a=n._ctx,s=a.table,l=s.hook.reading.fire;this._ctx={table:s,index:a.index,isPrimKey:!a.index||s.schema.primKey.keyPath&&a.index===s.schema.primKey.name,range:i,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:o,or:a.or,valueMapper:l!==Dr?l:null}})}function my(e,t){return e<t?-1:e===t?0:1}function gy(e,t){return e>t?-1:e===t?0:1}function Be(e,t,n){var r=e instanceof wd?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function kn(e){return new e.Collection(e,function(){return bd("")}).limit(0)}function vy(e){return e==="next"?function(t){return t.toUpperCase()}:function(t){return t.toLowerCase()}}function yy(e){return e==="next"?function(t){return t.toLowerCase()}:function(t){return t.toUpperCase()}}function _y(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,l=0;l<a;++l){var u=t[l];if(u!==r[l])return i(e[l],n[l])<0?e.substr(0,l)+n[l]+n.substr(l+1):i(e[l],r[l])<0?e.substr(0,l)+r[l]+n.substr(l+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[l],u)<0&&(s=l)}return a<r.length&&o==="next"?e+n.substr(e.length):a<e.length&&o==="prev"?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function Jr(e,t,n,r){var i,o,a,s,l,u,c,d=n.length;if(!n.every(function(m){return typeof m=="string"}))return Be(e,vd);function p(m){i=vy(m),o=yy(m),a=m==="next"?my:gy;var g=n.map(function(b){return{lower:o(b),upper:i(b)}}).sort(function(b,y){return a(b.lower,y.lower)});s=g.map(function(b){return b.upper}),l=g.map(function(b){return b.lower}),u=m,c=m==="next"?"":r}p("next");var f=new e.Collection(e,function(){return Mt(s[0],l[d-1]+r)});f._ondirectionchange=function(m){p(m)};var h=0;return f._addAlgorithm(function(m,g,b){var y=m.key;if(typeof y!="string")return!1;var _=o(y);if(t(_,l,h))return!0;for(var v=null,w=h;w<d;++w){var E=_y(y,_,s[w],l[w],a,u);E===null&&v===null?h=w+1:(v===null||a(v,E)>0)&&(v=E)}return g(v!==null?function(){m.continue(v+c)}:b),!1}),f}function Mt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function bd(e){return{type:1,lower:e,upper:e}}var wd=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(t,n,r,i){r=r!==!1,i=i===!0;try{return this._cmp(t,n)>0||this._cmp(t,n)===0&&(r||i)&&!(r&&i)?kn(this):new this.Collection(this,function(){return Mt(t,n,!r,!i)})}catch{return Be(this,_t)}},e.prototype.equals=function(t){return t==null?Be(this,_t):new this.Collection(this,function(){return bd(t)})},e.prototype.above=function(t){return t==null?Be(this,_t):new this.Collection(this,function(){return Mt(t,void 0,!0)})},e.prototype.aboveOrEqual=function(t){return t==null?Be(this,_t):new this.Collection(this,function(){return Mt(t,void 0,!1)})},e.prototype.below=function(t){return t==null?Be(this,_t):new this.Collection(this,function(){return Mt(void 0,t,!1,!0)})},e.prototype.belowOrEqual=function(t){return t==null?Be(this,_t):new this.Collection(this,function(){return Mt(void 0,t)})},e.prototype.startsWith=function(t){return typeof t!="string"?Be(this,vd):this.between(t,t+un,!0,!0)},e.prototype.startsWithIgnoreCase=function(t){return t===""?this.startsWith(t):Jr(this,function(n,r){return n.indexOf(r[0])===0},[t],un)},e.prototype.equalsIgnoreCase=function(t){return Jr(this,function(n,r){return n===r[0]},[t],"")},e.prototype.anyOfIgnoreCase=function(){var t=Et.apply(An,arguments);return t.length===0?kn(this):Jr(this,function(n,r){return r.indexOf(n)!==-1},t,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var t=Et.apply(An,arguments);return t.length===0?kn(this):Jr(this,function(n,r){return r.some(function(i){return n.indexOf(i)===0})},t,un)},e.prototype.anyOf=function(){var t=this,n=Et.apply(An,arguments),r=this._cmp;try{n.sort(r)}catch{return Be(this,_t)}if(n.length===0)return kn(this);var i=new this.Collection(this,function(){return Mt(n[0],n[n.length-1])});i._ondirectionchange=function(a){r=a==="next"?t._ascending:t._descending,n.sort(r)};var o=0;return i._addAlgorithm(function(a,s,l){for(var u=a.key;r(u,n[o])>0;)if(++o,o===n.length)return s(l),!1;return r(u,n[o])===0?!0:(s(function(){a.continue(n[o])}),!1)}),i},e.prototype.notEqual=function(t){return this.inAnyRange([[ga,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var t=Et.apply(An,arguments);if(t.length===0)return new this.Collection(this);try{t.sort(this._ascending)}catch{return Be(this,_t)}var n=t.reduce(function(r,i){return r?r.concat([[r[r.length-1][1],i]]):[[ga,i]]},null);return n.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(t,n){var r=this,i=this._cmp,o=this._ascending,a=this._descending,s=this._min,l=this._max;if(t.length===0)return kn(this);if(!t.every(function(w){return w[0]!==void 0&&w[1]!==void 0&&o(w[0],w[1])<=0}))return Be(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",B.InvalidArgument);var u=!n||n.includeLowers!==!1,c=n&&n.includeUppers===!0;function d(w,E){for(var I=0,S=w.length;I<S;++I){var x=w[I];if(i(E[0],x[1])<0&&i(E[1],x[0])>0){x[0]=s(x[0],E[0]),x[1]=l(x[1],E[1]);break}}return I===S&&w.push(E),w}var p=o;function f(w,E){return p(w[0],E[0])}var h;try{h=t.reduce(d,[]),h.sort(f)}catch{return Be(this,_t)}var m=0,g=c?function(w){return o(w,h[m][1])>0}:function(w){return o(w,h[m][1])>=0},b=u?function(w){return a(w,h[m][0])>0}:function(w){return a(w,h[m][0])>=0};function y(w){return!g(w)&&!b(w)}var _=g,v=new this.Collection(this,function(){return Mt(h[0][0],h[h.length-1][1],!u,!c)});return v._ondirectionchange=function(w){w==="next"?(_=g,p=o):(_=b,p=a),h.sort(f)},v._addAlgorithm(function(w,E,I){for(var S=w.key;_(S);)if(++m,m===h.length)return E(I),!1;return y(S)?!0:(r._cmp(S,h[m][1])===0||r._cmp(S,h[m][0])===0||E(function(){p===o?w.continue(h[m][0]):w.continue(h[m][1])}),!1)}),v},e.prototype.startsWithAnyOf=function(){var t=Et.apply(An,arguments);return t.every(function(n){return typeof n=="string"})?t.length===0?kn(this):this.inAnyRange(t.map(function(n){return[n,n+un]})):Be(this,"startsWithAnyOf() only works with strings")},e}();function by(e){return Vr(wd.prototype,function(n,r,i){this.db=e,this._ctx={table:n,index:r===":id"?null:r,or:i};var o=e._deps.indexedDB;if(!o)throw new B.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(a,s){return o.cmp(s,a)},this._max=function(a,s){return o.cmp(a,s)>0?a:s},this._min=function(a,s){return o.cmp(a,s)<0?a:s},this._IDBKeyRange=e._deps.IDBKeyRange})}function lt(e){return ue(function(t){return wr(t),e(t.target.error),!1})}function wr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Cr="storagemutated",zt="x-storagemutated-1",$t=Mr(null,Cr),wy=function(){function e(){}return e.prototype._lock=function(){return rr(!M.global),++this._reculock,this._reculock===1&&!M.global&&(M.lockOwnerFor=this),this},e.prototype._unlock=function(){if(rr(!M.global),--this._reculock===0)for(M.global||(M.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{Zn(t[1],t[0])}catch{}}return this},e.prototype._locked=function(){return this._reculock&&M.lockOwnerFor!==this},e.prototype.create=function(t){var n=this;if(!this.mode)return this;var r=this.db.idbdb,i=this.db._state.dbOpenError;if(rr(!this.idbtrans),!t&&!r)switch(i&&i.name){case"DatabaseClosedError":throw new B.DatabaseClosed(i);case"MissingAPIError":throw new B.MissingAPI(i.message,i);default:throw new B.OpenFailed(i)}if(!this.active)throw new B.TransactionInactive;return rr(this._completion._state===null),t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):r.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})),t.onerror=ue(function(o){wr(o),n._reject(t.error)}),t.onabort=ue(function(o){wr(o),n.active&&n._reject(new B.Abort(t.error)),n.active=!1,n.on("abort").fire(o)}),t.oncomplete=ue(function(){n.active=!1,n._resolve(),"mutatedParts"in t&&$t.storagemutated.fire(t.mutatedParts)}),this},e.prototype._promise=function(t,n,r){var i=this;if(t==="readwrite"&&this.mode!=="readwrite")return we(new B.ReadOnly("Transaction is readonly"));if(!this.active)return we(new B.TransactionInactive);if(this._locked())return new D(function(a,s){i._blockedFuncs.push([function(){i._promise(t,n,r).then(a,s)},M])});if(r)return Wt(function(){var a=new D(function(s,l){i._lock();var u=n(s,l,i);u&&u.then&&u.then(s,l)});return a.finally(function(){return i._unlock()}),a._lib=!0,a});var o=new D(function(a,s){var l=n(a,s,i);l&&l.then&&l.then(a,s)});return o._lib=!0,o},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(t){var n=this._root(),r=D.resolve(t);if(n._waitingFor)n._waitingFor=n._waitingFor.then(function(){return r});else{n._waitingFor=r,n._waitingQueue=[];var i=n.idbtrans.objectStore(n.storeNames[0]);(function a(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(i.get(-1/0).onsuccess=a)})()}var o=n._waitingFor;return new D(function(a,s){r.then(function(l){return n._waitingQueue.push(ue(a.bind(null,l)))},function(l){return n._waitingQueue.push(ue(s.bind(null,l)))}).finally(function(){n._waitingFor===o&&(n._waitingFor=null)})})},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new B.Abort))},e.prototype.table=function(t){var n=this._memoizedTables||(this._memoizedTables={});if(ze(n,t))return n[t];var r=this.schema[t];if(!r)throw new B.NotFound("Table "+t+" not part of transaction");var i=new this.db.Table(t,r,this);return i.core=this.db.core.table(t),n[t]=i,i},e}();function Cy(e){return Vr(wy.prototype,function(n,r,i,o,a){var s=this;this.db=e,this.mode=n,this.storeNames=r,this.schema=i,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Mr(this,"complete","error","abort"),this.parent=a||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new D(function(l,u){s._resolve=l,s._reject=u}),this._completion.then(function(){s.active=!1,s.on.complete.fire()},function(l){var u=s.active;return s.active=!1,s.on.error.fire(l),s.parent?s.parent._reject(l):u&&s.idbtrans&&s.idbtrans.abort(),we(l)})})}function va(e,t,n,r,i,o,a){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+Cd(t)}}function Cd(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function Ed(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:ed(n,function(r){return[r.name,r]})}}function Ey(e){return e.length===1?e[0]:e}var Er=function(e){try{return e.only([[]]),Er=function(){return[[]]},[[]]}catch{return Er=function(){return un},un}};function ya(e){return e==null?function(){}:typeof e=="string"?Sy(e):function(t){return Lt(t,e)}}function Sy(e){var t=e.split(".");return t.length===1?function(n){return n[e]}:function(n){return Lt(n,e)}}function Dl(e){return[].slice.call(e)}var Iy=0;function fr(e){return e==null?":id":typeof e=="string"?e:"["+e.join("+")+"]"}function ky(e,t,n){function r(d,p){var f=Dl(d.objectStoreNames);return{schema:{name:d.name,tables:f.map(function(h){return p.objectStore(h)}).map(function(h){var m=h.keyPath,g=h.autoIncrement,b=Le(m),y=m==null,_={},v={name:h.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:y,compound:b,keyPath:m,autoIncrement:g,unique:!0,extractKey:ya(m)},indexes:Dl(h.indexNames).map(function(w){return h.index(w)}).map(function(w){var E=w.name,I=w.unique,S=w.multiEntry,x=w.keyPath,T=Le(x),A={name:E,compound:T,keyPath:x,unique:I,multiEntry:S,extractKey:ya(x)};return _[fr(x)]=A,A}),getIndexByKeyPath:function(w){return _[fr(w)]}};return _[":id"]=v.primaryKey,m!=null&&(_[fr(m)]=v.primaryKey),v})},hasGetAll:f.length>0&&"getAll"in p.objectStore(f[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}function i(d){if(d.type===3)return null;if(d.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var p=d.lower,f=d.upper,h=d.lowerOpen,m=d.upperOpen,g=p===void 0?f===void 0?null:t.upperBound(f,!!m):f===void 0?t.lowerBound(p,!!h):t.bound(p,f,!!h,!!m);return g}function o(d){var p=d.name;function f(g){var b=g.trans,y=g.type,_=g.keys,v=g.values,w=g.range;return new Promise(function(E,I){E=ue(E);var S=b.objectStore(p),x=S.keyPath==null,T=y==="put"||y==="add";if(!T&&y!=="delete"&&y!=="deleteRange")throw new Error("Invalid operation type: "+y);var A=(_||v||{length:1}).length;if(_&&v&&_.length!==v.length)throw new Error("Given keys array must have same length as given values array.");if(A===0)return E({numFailures:0,failures:{},results:[],lastResult:void 0});var L,k=[],U=[],R=0,V=function(Q){++R,wr(Q)};if(y==="deleteRange"){if(w.type===4)return E({numFailures:R,failures:U,results:[],lastResult:void 0});w.type===3?k.push(L=S.clear()):k.push(L=S.delete(i(w)))}else{var K=T?x?[v,_]:[v,null]:[_,null],z=K[0],ie=K[1];if(T)for(var oe=0;oe<A;++oe)k.push(L=ie&&ie[oe]!==void 0?S[y](z[oe],ie[oe]):S[y](z[oe])),L.onerror=V;else for(var oe=0;oe<A;++oe)k.push(L=S[y](z[oe])),L.onerror=V}var fe=function(Q){var Ke=Q.target.result;k.forEach(function(Ie,yt){return Ie.error!=null&&(U[yt]=Ie.error)}),E({numFailures:R,failures:U,results:y==="delete"?_:k.map(function(Ie){return Ie.result}),lastResult:Ke})};L.onerror=function(Q){V(Q),fe(Q)},L.onsuccess=fe})}function h(g){var b=g.trans,y=g.values,_=g.query,v=g.reverse,w=g.unique;return new Promise(function(E,I){E=ue(E);var S=_.index,x=_.range,T=b.objectStore(p),A=S.isPrimaryKey?T:T.index(S.name),L=v?w?"prevunique":"prev":w?"nextunique":"next",k=y||!("openKeyCursor"in A)?A.openCursor(i(x),L):A.openKeyCursor(i(x),L);k.onerror=lt(I),k.onsuccess=ue(function(U){var R=k.result;if(!R){E(null);return}R.___id=++Iy,R.done=!1;var V=R.continue.bind(R),K=R.continuePrimaryKey;K&&(K=K.bind(R));var z=R.advance.bind(R),ie=function(){throw new Error("Cursor not started")},oe=function(){throw new Error("Cursor not stopped")};R.trans=b,R.stop=R.continue=R.continuePrimaryKey=R.advance=ie,R.fail=ue(I),R.next=function(){var fe=this,Q=1;return this.start(function(){return Q--?fe.continue():fe.stop()}).then(function(){return fe})},R.start=function(fe){var Q=new Promise(function(Ie,yt){Ie=ue(Ie),k.onerror=lt(yt),R.fail=yt,R.stop=function(Fe){R.stop=R.continue=R.continuePrimaryKey=R.advance=oe,Ie(Fe)}}),Ke=function(){if(k.result)try{fe()}catch(Ie){R.fail(Ie)}else R.done=!0,R.start=function(){throw new Error("Cursor behind last entry")},R.stop()};return k.onsuccess=ue(function(Ie){k.onsuccess=Ke,Ke()}),R.continue=V,R.continuePrimaryKey=K,R.advance=z,Ke(),Q},E(R)},I)})}function m(g){return function(b){return new Promise(function(y,_){y=ue(y);var v=b.trans,w=b.values,E=b.limit,I=b.query,S=E===1/0?void 0:E,x=I.index,T=I.range,A=v.objectStore(p),L=x.isPrimaryKey?A:A.index(x.name),k=i(T);if(E===0)return y({result:[]});if(g){var U=w?L.getAll(k,S):L.getAllKeys(k,S);U.onsuccess=function(z){return y({result:z.target.result})},U.onerror=lt(_)}else{var R=0,V=w||!("openKeyCursor"in L)?L.openCursor(k):L.openKeyCursor(k),K=[];V.onsuccess=function(z){var ie=V.result;if(!ie)return y({result:K});if(K.push(w?ie.value:ie.primaryKey),++R===E)return y({result:K});ie.continue()},V.onerror=lt(_)}})}}return{name:p,schema:d,mutate:f,getMany:function(g){var b=g.trans,y=g.keys;return new Promise(function(_,v){_=ue(_);for(var w=b.objectStore(p),E=y.length,I=new Array(E),S=0,x=0,T,A=function(R){var V=R.target;(I[V._pos]=V.result)!=null,++x===S&&_(I)},L=lt(v),k=0;k<E;++k){var U=y[k];U!=null&&(T=w.get(y[k]),T._pos=k,T.onsuccess=A,T.onerror=L,++S)}S===0&&_(I)})},get:function(g){var b=g.trans,y=g.key;return new Promise(function(_,v){_=ue(_);var w=b.objectStore(p),E=w.get(y);E.onsuccess=function(I){return _(I.target.result)},E.onerror=lt(v)})},query:m(l),openCursor:h,count:function(g){var b=g.query,y=g.trans,_=b.index,v=b.range;return new Promise(function(w,E){var I=y.objectStore(p),S=_.isPrimaryKey?I:I.index(_.name),x=i(v),T=x?S.count(x):S.count();T.onsuccess=ue(function(A){return w(A.target.result)}),T.onerror=lt(E)})}}}var a=r(e,n),s=a.schema,l=a.hasGetAll,u=s.tables.map(function(d){return o(d)}),c={};return u.forEach(function(d){return c[d.name]=d}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(d){var p=c[d];if(!p)throw new Error("Table '"+d+"' not found");return c[d]},MIN_KEY:-1/0,MAX_KEY:Er(t),schema:s}}function xy(e,t){return t.reduce(function(n,r){var i=r.create;return $($({},n),i(n))},e)}function Ay(e,t,n,r){var i=n.IDBKeyRange;n.indexedDB;var o=xy(ky(t,i,r),e.dbcore);return{dbcore:o}}function hs(e,t){var n=e._novip,r=t.db,i=Ay(n._middlewares,r,n._deps,t);n.core=i.dbcore,n.tables.forEach(function(o){var a=o.name;n.core.schema.tables.some(function(s){return s.name===a})&&(o.core=n.core.table(a),n[a]instanceof n.Table&&(n[a].core=o.core))})}function Ui(e,t,n,r){var i=e._novip;n.forEach(function(o){var a=r[o];t.forEach(function(s){var l=os(s,o);(!l||"value"in l&&l.value===void 0)&&(s===i.Transaction.prototype||s instanceof i.Transaction?Nt(s,o,{get:function(){return this.table(o)},set:function(u){Qc(this,o,{value:u,writable:!0,configurable:!0,enumerable:!0})}}):s[o]=new i.Table(o,a))})})}function _a(e,t){var n=e._novip;t.forEach(function(r){for(var i in r)r[i]instanceof n.Table&&delete r[i]})}function Ty(e,t){return e._cfg.version-t._cfg.version}function Ry(e,t,n,r){var i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(n),o._completion.catch(r);var a=o._reject.bind(o),s=M.transless||M;Wt(function(){M.trans=o,M.transless=s,t===0?(ve(i).forEach(function(l){ms(n,l,i[l].primKey,i[l].indexes)}),hs(e,n),D.follow(function(){return e.on.populate.fire(o)}).catch(a)):Ly(e,t,o,n).catch(a)})}function Ly(e,t,n,r){var i=e._novip,o=[],a=i._versions,s=i._dbSchema=gs(i,i.idbdb,r),l=!1,u=a.filter(function(d){return d._cfg.version>=t});u.forEach(function(d){o.push(function(){var p=s,f=d._cfg.dbschema;wa(i,p,r),wa(i,f,r),s=i._dbSchema=f;var h=Sd(p,f);h.add.forEach(function(v){ms(r,v[0],v[1].primKey,v[1].indexes)}),h.change.forEach(function(v){if(v.recreate)throw new B.Upgrade("Not yet support for changing primary key");var w=r.objectStore(v.name);v.add.forEach(function(E){return ba(w,E)}),v.change.forEach(function(E){w.deleteIndex(E.name),ba(w,E)}),v.del.forEach(function(E){return w.deleteIndex(E)})});var m=d._cfg.contentUpgrade;if(m&&d._cfg.version>t){hs(i,r),n._memoizedTables={},l=!0;var g=td(f);h.del.forEach(function(v){g[v]=p[v]}),_a(i,[i.Transaction.prototype]),Ui(i,[i.Transaction.prototype],ve(g),g),n.schema=g;var b=as(m);b&&Yn();var y,_=D.follow(function(){if(y=m(n),y&&b){var v=Dt.bind(null,null);y.then(v,v)}});return y&&typeof y.then=="function"?D.resolve(y):_.then(function(){return y})}}),o.push(function(p){if(!l||!ay){var f=d._cfg.dbschema;Ny(f,p)}_a(i,[i.Transaction.prototype]),Ui(i,[i.Transaction.prototype],i._storeNames,i._dbSchema),n.schema=i._dbSchema})});function c(){return o.length?D.resolve(o.shift()(n.idbtrans)).then(c):D.resolve()}return c().then(function(){Oy(s,r)})}function Sd(e,t){var n={del:[],add:[],change:[]},r;for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(!i)n.add.push([r,o]);else{var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!eo)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,l=o.idxByName,u=void 0;for(u in s)l[u]||a.del.push(u);for(u in l){var c=s[u],d=l[u];c?c.src!==d.src&&a.change.push(d):a.add.push(d)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}}return n}function ms(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(o){return ba(i,o)}),i}function Oy(e,t){ve(e).forEach(function(n){t.db.objectStoreNames.contains(n)||ms(t,n,e[n].primKey,e[n].indexes)})}function Ny(e,t){[].slice.call(t.db.objectStoreNames).forEach(function(n){return e[n]==null&&t.db.deleteObjectStore(n)})}function ba(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function gs(e,t,n){var r={},i=Ji(t.objectStoreNames,0);return i.forEach(function(o){for(var a=n.objectStore(o),s=a.keyPath,l=va(Cd(s),s||"",!1,!1,!!a.autoIncrement,s&&typeof s!="string",!0),u=[],c=0;c<a.indexNames.length;++c){var d=a.index(a.indexNames[c]);s=d.keyPath;var p=va(d.name,s,!!d.unique,!!d.multiEntry,!1,s&&typeof s!="string",!1);u.push(p)}r[o]=Ed(o,l,u)}),r}function Dy(e,t,n){var r=e._novip;r.verno=t.version/10;var i=r._dbSchema=gs(r,t,n);r._storeNames=Ji(t.objectStoreNames,0),Ui(r,[r._allTables],ve(i),i)}function Uy(e,t){var n=gs(e,e.idbdb,t),r=Sd(n,e._dbSchema);return!(r.add.length||r.change.some(function(i){return i.add.length||i.change.length}))}function wa(e,t,n){for(var r=e._novip,i=n.db.objectStoreNames,o=0;o<i.length;++o){var a=i[o],s=n.objectStore(a);r._hasGetAll="getAll"in s;for(var l=0;l<s.indexNames.length;++l){var u=s.indexNames[l],c=s.index(u).keyPath,d=typeof c=="string"?c:"["+Ji(c).join("+")+"]";if(t[a]){var p=t[a].idxByName[d];p&&(p.name=u,delete t[a].idxByName[d],t[a].idxByName[u]=p)}}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&ae.WorkerGlobalScope&&ae instanceof ae.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function Py(e){return e.split(",").map(function(t,n){t=t.trim();var r=t.replace(/([&*]|\+\+)/g,""),i=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return va(r,i||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),Le(i),n===0)})}var My=function(){function e(){}return e.prototype._parseStoresSpec=function(t,n){ve(t).forEach(function(r){if(t[r]!==null){var i=Py(t[r]),o=i.shift();if(o.multi)throw new B.Schema("Primary key cannot be multi-valued");i.forEach(function(a){if(a.auto)throw new B.Schema("Only primary key can be marked as autoIncrement (++)");if(!a.keyPath)throw new B.Schema("Index must have a name and cannot be an empty string")}),n[r]=Ed(r,o,i)}})},e.prototype.stores=function(t){var n=this.db;this._cfg.storesSource=this._cfg.storesSource?Ue(this._cfg.storesSource,t):t;var r=n._versions,i={},o={};return r.forEach(function(a){Ue(i,a._cfg.storesSource),o=a._cfg.dbschema={},a._parseStoresSpec(i,o)}),n._dbSchema=o,_a(n,[n._allTables,n,n.Transaction.prototype]),Ui(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],ve(o),o),n._storeNames=ve(o),this},e.prototype.upgrade=function(t){return this._cfg.contentUpgrade=us(this._cfg.contentUpgrade||ne,t),this},e}();function Vy(e){return Vr(My.prototype,function(n){this.db=e,this._cfg={version:n,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}function vs(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new ws(to,{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function ys(e){return e&&typeof e.databases=="function"}function Fy(e){var t=e.indexedDB,n=e.IDBKeyRange;return ys(t)?Promise.resolve(t.databases()).then(function(r){return r.map(function(i){return i.name}).filter(function(i){return i!==to})}):vs(t,n).toCollection().primaryKeys()}function By(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!ys(n)&&t!==to&&vs(n,r).put({name:t}).catch(ne)}function jy(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!ys(n)&&t!==to&&vs(n,r).delete(t).catch(ne)}function Ca(e){return Wt(function(){return M.letThrough=!0,e()})}function Hy(){var e=!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent);if(!e||!indexedDB.databases)return Promise.resolve();var t;return new Promise(function(n){var r=function(){return indexedDB.databases().finally(n)};t=setInterval(r,100),r()}).finally(function(){return clearInterval(t)})}function zy(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?we(t.dbOpenError):e});gt&&(t.openCanceller._stackHolder=bn()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller;function i(){if(t.openCanceller!==r)throw new B.DatabaseClosed("db.open() was cancelled")}var o=t.dbReadyResolve,a=null,s=!1;return D.race([r,(typeof navigator>"u"?D.resolve():Hy()).then(function(){return new D(function(l,u){if(i(),!n)throw new B.MissingAPI;var c=e.name,d=t.autoSchema?n.open(c):n.open(c,Math.round(e.verno*10));if(!d)throw new B.MissingAPI;d.onerror=lt(u),d.onblocked=ue(e._fireOnBlocked),d.onupgradeneeded=ue(function(p){if(a=d.transaction,t.autoSchema&&!e._options.allowEmptyDB){d.onerror=wr,a.abort(),d.result.close();var f=n.deleteDatabase(c);f.onsuccess=f.onerror=ue(function(){u(new B.NoSuchDatabase("Database "+c+" doesnt exist"))})}else{a.onerror=lt(u);var h=p.oldVersion>Math.pow(2,62)?0:p.oldVersion;s=h<1,e._novip.idbdb=d.result,Ry(e,h/10,a,u)}},u),d.onsuccess=ue(function(){a=null;var p=e._novip.idbdb=d.result,f=Ji(p.objectStoreNames);if(f.length>0)try{var h=p.transaction(Ey(f),"readonly");t.autoSchema?Dy(e,p,h):(wa(e,e._dbSchema,h),Uy(e,h)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),hs(e,h)}catch{}dr.push(e),p.onversionchange=ue(function(m){t.vcFired=!0,e.on("versionchange").fire(m)}),p.onclose=ue(function(m){e.on("close").fire(m)}),s&&By(e._deps,c),l()},u)})})]).then(function(){return i(),t.onReadyBeingFired=[],D.resolve(Ca(function(){return e.on.ready.fire(e.vip)})).then(function l(){if(t.onReadyBeingFired.length>0){var u=t.onReadyBeingFired.reduce(us,ne);return t.onReadyBeingFired=[],D.resolve(Ca(function(){return u(e.vip)})).then(l)}})}).finally(function(){t.onReadyBeingFired=null,t.isBeingOpened=!1}).then(function(){return e}).catch(function(l){t.dbOpenError=l;try{a&&a.abort()}catch{}return r===t.openCanceller&&e._close(),we(l)}).finally(function(){t.openComplete=!0,o()})}function Ea(e){var t=function(a){return e.next(a)},n=function(a){return e.throw(a)},r=o(t),i=o(n);function o(a){return function(s){var l=a(s),u=l.value;return l.done?u:!u||typeof u.then!="function"?Le(u)?Promise.all(u).then(r,i):r(u):u.then(r,i)}}return o(t)()}function Gy(e,t,n){var r=arguments.length;if(r<2)throw new B.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=nd(i);return[e,o,n]}function Id(e,t,n,r,i){return D.resolve().then(function(){var o=M.transless||M,a=e._createTransaction(t,n,e._dbSchema,r),s={trans:a,transless:o};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(d){return d.name===ls.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(function(){return Id(e,t,n,null,i)})):we(d)}var l=as(i);l&&Yn();var u,c=D.follow(function(){if(u=i.call(a,a),u)if(l){var d=Dt.bind(null,null);u.then(d,d)}else typeof u.next=="function"&&typeof u.throw=="function"&&(u=Ea(u))},s);return(u&&typeof u.then=="function"?D.resolve(u).then(function(d){return a.active?d:we(new B.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):c.then(function(){return u})).then(function(d){return r&&a._resolve(),a._completion.then(function(){return d})}).catch(function(d){return a._reject(d),we(d)})})}function Xr(e,t,n){for(var r=Le(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}function Ky(e){return $($({},e),{table:function(t){var n=e.table(t),r=n.schema,i={},o=[];function a(m,g,b){var y=fr(m),_=i[y]=i[y]||[],v=m==null?0:typeof m=="string"?1:m.length,w=g>0,E=$($({},b),{isVirtual:w,keyTail:g,keyLength:v,extractKey:ya(m),unique:!w&&b.unique});if(_.push(E),E.isPrimaryKey||o.push(E),v>1){var I=v===2?m[0]:m.slice(0,v-1);a(I,g+1,b)}return _.sort(function(S,x){return S.keyTail-x.keyTail}),E}var s=a(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[s];for(var l=0,u=r.indexes;l<u.length;l++){var c=u[l];a(c.keyPath,0,c)}function d(m){var g=i[fr(m)];return g&&g[0]}function p(m,g){return{type:m.type===1?2:m.type,lower:Xr(m.lower,m.lowerOpen?e.MAX_KEY:e.MIN_KEY,g),lowerOpen:!0,upper:Xr(m.upper,m.upperOpen?e.MIN_KEY:e.MAX_KEY,g),upperOpen:!0}}function f(m){var g=m.query.index;return g.isVirtual?$($({},m),{query:{index:g,range:p(m.query.range,g.keyTail)}}):m}var h=$($({},n),{schema:$($({},r),{primaryKey:s,indexes:o,getIndexByKeyPath:d}),count:function(m){return n.count(f(m))},query:function(m){return n.query(f(m))},openCursor:function(m){var g=m.query.index,b=g.keyTail,y=g.isVirtual,_=g.keyLength;if(!y)return n.openCursor(m);function v(w){function E(S){S!=null?w.continue(Xr(S,m.reverse?e.MAX_KEY:e.MIN_KEY,b)):m.unique?w.continue(w.key.slice(0,_).concat(m.reverse?e.MIN_KEY:e.MAX_KEY,b)):w.continue()}var I=Object.create(w,{continue:{value:E},continuePrimaryKey:{value:function(S,x){w.continuePrimaryKey(Xr(S,e.MAX_KEY,b),x)}},primaryKey:{get:function(){return w.primaryKey}},key:{get:function(){var S=w.key;return _===1?S[0]:S.slice(0,_)}},value:{get:function(){return w.value}}});return I}return n.openCursor(f(m)).then(function(w){return w&&v(w)})}});return h}})}var Wy={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:Ky};function _s(e,t,n,r){return n=n||{},r=r||"",ve(e).forEach(function(i){if(!ze(t,i))n[r+i]=void 0;else{var o=e[i],a=t[i];if(typeof o=="object"&&typeof a=="object"&&o&&a){var s=ia(o),l=ia(a);s!==l?n[r+i]=t[i]:s==="Object"?_s(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i])}else o!==a&&(n[r+i]=t[i])}}),ve(t).forEach(function(i){ze(e,i)||(n[r+i]=t[i])}),n}function qy(e,t){return t.type==="delete"?t.keys:t.keys||t.values.map(e.extractKey)}var $y={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return $($({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey,i=$($({},n),{mutate:function(o){var a=M.trans,s=a.table(t).hook,l=s.deleting,u=s.creating,c=s.updating;switch(o.type){case"add":if(u.fire===ne)break;return a._promise("readwrite",function(){return d(o)},!0);case"put":if(u.fire===ne&&c.fire===ne)break;return a._promise("readwrite",function(){return d(o)},!0);case"delete":if(l.fire===ne)break;return a._promise("readwrite",function(){return d(o)},!0);case"deleteRange":if(l.fire===ne)break;return a._promise("readwrite",function(){return p(o)},!0)}return n.mutate(o);function d(h){var m=M.trans,g=h.keys||qy(r,h);if(!g)throw new Error("Keys missing");return h=h.type==="add"||h.type==="put"?$($({},h),{keys:g}):$({},h),h.type!=="delete"&&(h.values=na([],h.values,!0)),h.keys&&(h.keys=na([],h.keys,!0)),Yy(n,h,g).then(function(b){var y=g.map(function(_,v){var w=b[v],E={onerror:null,onsuccess:null};if(h.type==="delete")l.fire.call(E,_,w,m);else if(h.type==="add"||w===void 0){var I=u.fire.call(E,_,h.values[v],m);_==null&&I!=null&&(_=I,h.keys[v]=_,r.outbound||ot(h.values[v],r.keyPath,_))}else{var S=_s(w,h.values[v]),x=c.fire.call(E,S,_,w,m);if(x){var T=h.values[v];Object.keys(x).forEach(function(A){ze(T,A)?T[A]=x[A]:ot(T,A,x[A])})}}return E});return n.mutate(h).then(function(_){for(var v=_.failures,w=_.results,E=_.numFailures,I=_.lastResult,S=0;S<g.length;++S){var x=w?w[S]:g[S],T=y[S];x==null?T.onerror&&T.onerror(v[S]):T.onsuccess&&T.onsuccess(h.type==="put"&&b[S]?h.values[S]:x)}return{failures:v,results:w,numFailures:E,lastResult:I}}).catch(function(_){return y.forEach(function(v){return v.onerror&&v.onerror(_)}),Promise.reject(_)})})}function p(h){return f(h.trans,h.range,1e4)}function f(h,m,g){return n.query({trans:h,values:!1,query:{index:r,range:m},limit:g}).then(function(b){var y=b.result;return d({type:"delete",keys:y,trans:h}).then(function(_){return _.numFailures>0?Promise.reject(_.failures[0]):y.length<g?{failures:[],numFailures:0,lastResult:void 0}:f(h,$($({},m),{lower:y[y.length-1],lowerOpen:!0}),g)})})}}});return i}})}};function Yy(e,t,n){return t.type==="add"?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}function kd(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)De(t.keys[i],e[o])===0&&(r.push(n?Nr(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch{return null}}var Zy={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return $($({},n),{getMany:function(r){if(!r.cache)return n.getMany(r);var i=kd(r.keys,r.trans._cache,r.cache==="clone");return i?D.resolve(i):n.getMany(r).then(function(o){return r.trans._cache={keys:r.keys,values:r.cache==="clone"?Nr(o):o},o})},mutate:function(r){return r.type!=="add"&&(r.trans._cache=null),n.mutate(r)}})}}}},Ao;function bs(e){return!("from"in e)}var wt=function(e,t){if(this)Ue(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0});else{var n=new wt;return e&&"d"in e&&Ue(n,e),n}};jn(wt.prototype,(Ao={add:function(e){return Pi(this,e),this},addKey:function(e){return Sr(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(n){return Sr(t,n,n)}),this}},Ao[oa]=function(){return Sa(this)},Ao));function Sr(e,t,n){var r=De(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(bs(e))return Ue(e,{from:t,to:n,d:1});var i=e.l,o=e.r;if(De(n,e.from)<0)return i?Sr(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Ul(e);if(De(t,e.to)>0)return o?Sr(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Ul(e);De(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),De(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;i&&!e.l&&Pi(e,i),o&&a&&Pi(e,o)}}function Pi(e,t){function n(r,i){var o=i.from,a=i.to,s=i.l,l=i.r;Sr(r,o,a),s&&n(r,s),l&&n(r,l)}bs(t)||n(e,t)}function Qy(e,t){var n=Sa(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=Sa(e),a=o.next(i.from),s=a.value;!r.done&&!a.done;){if(De(s.from,i.to)<=0&&De(s.to,i.from)>=0)return!0;De(i.from,s.from)<0?i=(r=n.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}function Sa(e){var t=bs(e)?null:{s:0,n:e};return{next:function(n){for(var r=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&De(n,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||De(n,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function Ul(e){var t,n,r=(((t=e.r)===null||t===void 0?void 0:t.d)||0)-(((n=e.l)===null||n===void 0?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){var o=i==="r"?"l":"r",a=$({},e),s=e[i];e.from=s.from,e.to=s.to,e[i]=s[i],a[i]=s[o],e[o]=a,a.d=Pl(a)}e.d=Pl(e)}function Pl(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}var Jy={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new wt(e.MIN_KEY,e.MAX_KEY);return $($({},e),{table:function(r){var i=e.table(r),o=i.schema,a=o.primaryKey,s=a.extractKey,l=a.outbound,u=$($({},i),{mutate:function(p){var f=p.trans,h=f.mutatedParts||(f.mutatedParts={}),m=function(I){var S="idb://"+t+"/"+r+"/"+I;return h[S]||(h[S]=new wt)},g=m(""),b=m(":dels"),y=p.type,_=p.type==="deleteRange"?[p.range]:p.type==="delete"?[p.keys]:p.values.length<50?[[],p.values]:[],v=_[0],w=_[1],E=p.trans._cache;return i.mutate(p).then(function(I){if(Le(v)){y!=="delete"&&(v=I.results),g.addKeys(v);var S=kd(v,E);!S&&y!=="add"&&b.addKeys(v),(S||w)&&Xy(m,o,S,w)}else if(v){var x={from:v.lower,to:v.upper};b.add(x),g.add(x)}else g.add(n),b.add(n),o.indexes.forEach(function(T){return m(T.name).add(n)});return I})}}),c=function(p){var f,h,m=p.query,g=m.index,b=m.range;return[g,new wt((f=b.lower)!==null&&f!==void 0?f:e.MIN_KEY,(h=b.upper)!==null&&h!==void 0?h:e.MAX_KEY)]},d={get:function(p){return[a,new wt(p.key)]},getMany:function(p){return[a,new wt().addKeys(p.keys)]},count:c,query:c,openCursor:c};return ve(d).forEach(function(p){u[p]=function(f){var h=M.subscr;if(h){var m=function(E){var I="idb://"+t+"/"+r+"/"+E;return h[I]||(h[I]=new wt)},g=m(""),b=m(":dels"),y=d[p](f),_=y[0],v=y[1];if(m(_.name||"").add(v),!_.isPrimaryKey)if(p==="count")b.add(n);else{var w=p==="query"&&l&&f.values&&i.query($($({},f),{values:!1}));return i[p].apply(this,arguments).then(function(E){if(p==="query"){if(l&&f.values)return w.then(function(T){var A=T.result;return g.addKeys(A),E});var I=f.values?E.result.map(s):E.result;f.values?g.addKeys(I):b.addKeys(I)}else if(p==="openCursor"){var S=E,x=f.values;return S&&Object.create(S,{key:{get:function(){return b.addKey(S.primaryKey),S.key}},primaryKey:{get:function(){var T=S.primaryKey;return b.addKey(T),T}},value:{get:function(){return x&&g.addKey(S.primaryKey),S.value}}})}return E})}}return i[p].apply(this,arguments)}}),u}})}};function Xy(e,t,n,r){function i(o){var a=e(o.name||"");function s(u){return u!=null?o.extractKey(u):null}var l=function(u){return o.multiEntry&&Le(u)?u.forEach(function(c){return a.addKey(c)}):a.addKey(u)};(n||r).forEach(function(u,c){var d=n&&s(n[c]),p=r&&s(r[c]);De(d,p)!==0&&(d!=null&&l(d),p!=null&&l(p))})}t.indexes.forEach(i)}var ws=function(){function e(t,n){var r=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=n=$({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var o=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ne,dbReadyPromise:null,cancelOpen:ne,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};a.dbReadyPromise=new D(function(s){a.dbReadyResolve=s}),a.openCanceller=new D(function(s,l){a.cancelOpen=l}),this._state=a,this.name=t,this.on=Mr(this,"populate","blocked","versionchange","close",{ready:[us,ne]}),this.on.ready.subscribe=Jc(this.on.ready.subscribe,function(s){return function(l,u){e.vip(function(){var c=r._state;if(c.openComplete)c.dbOpenError||D.resolve().then(l),u&&s(l);else if(c.onReadyBeingFired)c.onReadyBeingFired.push(l),u&&s(l);else{s(l);var d=r;u||s(function p(){d.on.ready.unsubscribe(l),d.on.ready.unsubscribe(p)})}})}}),this.Collection=hy(this),this.Table=uy(this),this.Transaction=Cy(this),this.Version=Vy(this),this.WhereClause=by(this),this.on("versionchange",function(s){s.newVersion>0?console.warn("Another connection wants to upgrade database '"+r.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+r.name+"'. Closing db now to resume the delete request."),r.close()}),this.on("blocked",function(s){!s.newVersion||s.newVersion<s.oldVersion?console.warn("Dexie.delete('"+r.name+"') was blocked"):console.warn("Upgrade '"+r.name+"' blocked by other connection holding version "+s.oldVersion/10)}),this._maxKey=Er(n.IDBKeyRange),this._createTransaction=function(s,l,u,c){return new r.Transaction(s,l,u,r._options.chromeTransactionDurability,c)},this._fireOnBlocked=function(s){r.on("blocked").fire(s),dr.filter(function(l){return l.name===r.name&&l!==r&&!l._state.vcFired}).map(function(l){return l.on("versionchange").fire(s)})},this.use(Wy),this.use($y),this.use(Jy),this.use(Zy),this.vip=Object.create(this,{_vip:{value:!0}}),o.forEach(function(s){return s(r)})}return e.prototype.version=function(t){if(isNaN(t)||t<.1)throw new B.Type("Given version is not a positive number");if(t=Math.round(t*10)/10,this.idbdb||this._state.isBeingOpened)throw new B.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);var n=this._versions,r=n.filter(function(i){return i._cfg.version===t})[0];return r||(r=new this.Version(t),n.push(r),n.sort(Ty),r.stores({}),this._state.autoSchema=!1,r)},e.prototype._whenReady=function(t){var n=this;return this.idbdb&&(this._state.openComplete||M.letThrough||this._vip)?t():new D(function(r,i){if(n._state.openComplete)return i(new B.DatabaseClosed(n._state.dbOpenError));if(!n._state.isBeingOpened){if(!n._options.autoOpen){i(new B.DatabaseClosed);return}n.open().catch(ne)}n._state.dbReadyPromise.then(r,i)}).then(t)},e.prototype.use=function(t){var n=t.stack,r=t.create,i=t.level,o=t.name;o&&this.unuse({stack:n,name:o});var a=this._middlewares[n]||(this._middlewares[n]=[]);return a.push({stack:n,create:r,level:i==null?10:i,name:o}),a.sort(function(s,l){return s.level-l.level}),this},e.prototype.unuse=function(t){var n=t.stack,r=t.name,i=t.create;return n&&this._middlewares[n]&&(this._middlewares[n]=this._middlewares[n].filter(function(o){return i?o.create!==i:r?o.name!==r:!1})),this},e.prototype.open=function(){return zy(this)},e.prototype._close=function(){var t=this._state,n=dr.indexOf(this);if(n>=0&&dr.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}t.dbReadyPromise=new D(function(r){t.dbReadyResolve=r}),t.openCanceller=new D(function(r,i){t.cancelOpen=i})},e.prototype.close=function(){this._close();var t=this._state;this._options.autoOpen=!1,t.dbOpenError=new B.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)},e.prototype.delete=function(){var t=this,n=arguments.length>0,r=this._state;return new D(function(i,o){var a=function(){t.close();var s=t._deps.indexedDB.deleteDatabase(t.name);s.onsuccess=ue(function(){jy(t._deps,t.name),i()}),s.onerror=lt(o),s.onblocked=t._fireOnBlocked};if(n)throw new B.InvalidArgument("Arguments not allowed in db.delete()");r.isBeingOpened?r.dbReadyPromise.then(a):a()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return this.idbdb!==null},e.prototype.hasBeenClosed=function(){var t=this._state.dbOpenError;return t&&t.name==="DatabaseClosed"},e.prototype.hasFailed=function(){return this._state.dbOpenError!==null},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var t=this;return ve(this._allTables).map(function(n){return t._allTables[n]})},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var t=Gy.apply(this,arguments);return this._transaction.apply(this,t)},e.prototype._transaction=function(t,n,r){var i=this,o=M.trans;(!o||o.db!==this||t.indexOf("!")!==-1)&&(o=null);var a=t.indexOf("?")!==-1;t=t.replace("!","").replace("?","");var s,l;try{if(l=n.map(function(c){var d=c instanceof i.Table?c.name:c;if(typeof d!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return d}),t=="r"||t===Eo)s=Eo;else if(t=="rw"||t==So)s=So;else throw new B.InvalidArgument("Invalid transaction mode: "+t);if(o){if(o.mode===Eo&&s===So)if(a)o=null;else throw new B.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o&&l.forEach(function(c){if(o&&o.storeNames.indexOf(c)===-1)if(a)o=null;else throw new B.SubTransaction("Table "+c+" not included in parent transaction.")}),a&&o&&!o.active&&(o=null)}}catch(c){return o?o._promise(null,function(d,p){p(c)}):we(c)}var u=Id.bind(null,this,s,l,o,r);return o?o._promise(s,u,"lock"):M.trans?Zn(M.transless,function(){return i._whenReady(u)}):this._whenReady(u)},e.prototype.table=function(t){if(!ze(this._allTables,t))throw new B.InvalidTable("Table "+t+" does not exist");return this._allTables[t]},e}(),e0=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",t0=function(){function e(t){this._subscribe=t}return e.prototype.subscribe=function(t,n,r){return this._subscribe(!t||typeof t=="function"?{next:t,error:n,complete:r}:t)},e.prototype[e0]=function(){return this},e}();function xd(e,t){return ve(t).forEach(function(n){var r=e[n]||(e[n]=new wt);Pi(r,t[n])}),e}function n0(e){var t=!1,n=void 0,r=new t0(function(i){var o=as(e);function a(g){o&&Yn();var b=function(){return Wt(e,{subscr:g,trans:null})},y=M.trans?Zn(M.transless,b):b();return o&&y.then(Dt,Dt),y}var s=!1,l={},u={},c={get closed(){return s},unsubscribe:function(){s=!0,$t.storagemutated.unsubscribe(h)}};i.start&&i.start(c);var d=!1,p=!1;function f(){return ve(u).some(function(g){return l[g]&&Qy(l[g],u[g])})}var h=function(g){xd(l,g),f()&&m()},m=function(){if(!(d||s)){l={};var g={},b=a(g);p||($t(Cr,h),p=!0),d=!0,Promise.resolve(b).then(function(y){t=!0,n=y,d=!1,!s&&(f()?m():(l={},u=g,i.next&&i.next(y)))},function(y){d=!1,t=!1,i.error&&i.error(y),c.unsubscribe()})}};return m(),c});return r.hasValue=function(){return t},r.getValue=function(){return n},r}var Ia;try{Ia={indexedDB:ae.indexedDB||ae.mozIndexedDB||ae.webkitIndexedDB||ae.msIndexedDB,IDBKeyRange:ae.IDBKeyRange||ae.webkitIDBKeyRange}}catch{Ia={indexedDB:null,IDBKeyRange:null}}var rn=ws;jn(rn,$($({},Xi),{delete:function(e){var t=new rn(e,{addons:[]});return t.delete()},exists:function(e){return new rn(e,{addons:[]}).open().then(function(t){return t.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return Fy(rn.dependencies).then(e)}catch{return we(new B.MissingAPI)}},defineClass:function(){function e(t){Ue(this,t)}return e},ignoreTransaction:function(e){return M.trans?Zn(M.transless,e):e()},vip:Ca,async:function(e){return function(){try{var t=Ea(e.apply(this,arguments));return!t||typeof t.then!="function"?D.resolve(t):t}catch(n){return we(n)}}},spawn:function(e,t,n){try{var r=Ea(e.apply(n,t||[]));return!r||typeof r.then!="function"?D.resolve(r):r}catch(i){return we(i)}},currentTransaction:{get:function(){return M.trans||null}},waitFor:function(e,t){var n=D.resolve(typeof e=="function"?rn.ignoreTransaction(e):e).timeout(t||6e4);return M.trans?M.trans.waitFor(n):n},Promise:D,debug:{get:function(){return gt},set:function(e){id(e,e==="dexie"?function(){return!0}:yd)}},derive:qn,extend:Ue,props:jn,override:Jc,Events:Mr,on:$t,liveQuery:n0,extendObservabilitySet:xd,getByKeyPath:Lt,setByKeyPath:ot,delByKeyPath:Dv,shallowClone:td,deepClone:Nr,getObjectDiff:_s,cmp:De,asap:Xc,minKey:ga,addons:[],connections:dr,errnames:ls,dependencies:Ia,semVer:Tl,version:Tl.split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,n*2)})}));rn.maxKey=Er(rn.dependencies.IDBKeyRange);typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&($t(Cr,function(e){if(!xt){var t;eo?(t=document.createEvent("CustomEvent"),t.initCustomEvent(zt,!0,!0,e)):t=new CustomEvent(zt,{detail:e}),xt=!0,dispatchEvent(t),xt=!1}}),addEventListener(zt,function(e){var t=e.detail;xt||Mi(t)}));function Mi(e){var t=xt;try{xt=!0,$t.storagemutated.fire(e)}finally{xt=t}}var xt=!1;if(typeof BroadcastChannel<"u"){var ei=new BroadcastChannel(zt);typeof ei.unref=="function"&&ei.unref(),$t(Cr,function(e){xt||ei.postMessage(e)}),ei.onmessage=function(e){e.data&&Mi(e.data)}}else if(typeof self<"u"&&typeof navigator<"u"){$t(Cr,function(e){try{xt||(typeof localStorage<"u"&&localStorage.setItem(zt,JSON.stringify({trig:Math.random(),changedParts:e})),typeof self.clients=="object"&&na([],self.clients.matchAll({includeUncontrolled:!0}),!0).forEach(function(t){return t.postMessage({type:zt,changedParts:e})}))}catch{}}),typeof addEventListener<"u"&&addEventListener("storage",function(e){if(e.key===zt){var t=JSON.parse(e.newValue);t&&Mi(t.changedParts)}});var Ml=self.document&&navigator.serviceWorker;Ml&&Ml.addEventListener("message",r0)}function r0(e){var t=e.data;t&&t.type===zt&&Mi(t.changedParts)}D.rejectionMapper=zv;id(gt,yd);var Qn=(e=>(e.ReadyForUpload="ReadyForUpload",e.UploadComplete="UploadComplete",e))(Qn||{}),Pn=(e=>(e.After="after",e.Before="before",e.BeforeAndAfter="beforeAndAfter",e))(Pn||{});const ka="sprig.sessionId",Ad="sprig.disableReplayRecording",i0=30,Td=()=>{sessionStorage.setItem(Ad,"disabled")},yn=()=>!!sessionStorage.getItem(Ad),o0=["did not allow mutations","called in an invalid security context"],a0=e=>{if(!e)return!0;for(const t of o0)if(e.toLowerCase().includes(t))return!1;return!0},Vl=(e,t,n)=>{yn()||t instanceof Error&&(Td(),a0(t==null?void 0:t.message)&&(u0(),window.UserLeap.reportError(e,t,n)))},s0=(e,t)=>{var n,r;(r=(n=window.navigator)==null?void 0:n.storage)!=null&&r.estimate?window.navigator.storage.estimate().then(i=>{Vl(e,t,i)}).catch(i=>{window.UserLeap.reportError("Error getting storage estimate",i)}):Vl(e,t)},l0=()=>{const e=sessionStorage.getItem(ka);return e?(sessionStorage.removeItem(ka),e):Kt()},Ve=l0();window.addEventListener("beforeunload",()=>{sessionStorage.setItem(ka,Ve)});const u0=()=>{Promise.all([te.events.clear(),te.chunkUploads.clear(),te.pendingCaptures.clear()]).catch(e=>{window.UserLeap.reportError("Error wiping database",e)})},To=(e,t,n=()=>!0)=>te.table(t).where("timestamp").below(e).and(n).delete(),c0=()=>{te.events.where("sessionId").equals(Ve).delete(),te.pendingCaptures.where("sessionId").equals(Ve).delete()},d0=e=>{const t=e.map(n=>{var r;return{...n,sessionId:(r=n.sessionId)!=null?r:Ve}});return te.events.bulkAdd(t)},f0=(e,t)=>te.events.where("[sessionId+timestamp]").between([Ve,e],[Ve,t]).toArray(),p0=(e,t,n)=>{const r=new Date,i=r.setMinutes(r.getMinutes()+(n!=null?n:i0));return te.events.where("[sessionId+timestamp]").between([Ve,e],[Ve,t]).modify({expiredAt:i})},h0=e=>{var t;return te.chunkUploads.add({...e,sessionId:(t=e.sessionId)!=null?t:Ve})},m0=(e,t)=>te.chunkUploads.update(e,{data:null,etag:t,status:Qn.UploadComplete}),g0=({status:e,uploadId:t})=>t?te.chunkUploads.where({uploadId:t,status:e}).toArray():te.chunkUploads.where({sessionId:Ve,status:e}).toArray(),v0=e=>te.chunkUploads.where({uploadId:e,status:Qn.UploadComplete}).toArray(),y0=e=>te.chunkUploads.where({uploadId:e,status:Qn.UploadComplete}).delete(),_0=e=>{var t;return te.pendingCaptures.add({...e,sessionId:(t=e.sessionId)!=null?t:Ve,canUpload:!1})},b0=()=>te.pendingCaptures.where("sessionId").equals(Ve).and(e=>e.targetTimestamp<Date.now()).toArray(),w0=()=>te.pendingCaptures.where("sessionId").equals(Ve).toArray(),C0=e=>te.pendingCaptures.where("sessionId").equals(Ve).and(t=>t.captureParams.responseGroupId===e).modify({canUpload:!0});class E0 extends ws{constructor(){super("replayStorage",{autoOpen:!1});Ae(this,"events");Ae(this,"chunkUploads");Ae(this,"pendingCaptures")}}const te=new E0;te.version(1).stores({events:"uuid, timestamp, [sessionId+timestamp]",chunkUploads:"uuid, timestamp, [sessionId+status], [uploadId+status], [sessionId+status+uploadId]",pendingCaptures:"uuid, timestamp, [sessionId+targetTimestamp]"});te.open().catch(()=>{Td()});const S0=async(e,t,n)=>new Promise((r,i)=>{const o=e.createElement("script");o.src=t,o.onload=r,o.onerror=i,n&&(o.nonce=n),e.head.appendChild(o)});let Rd=5e3,xa=6e4;const I0=5,Fl=1e3,Ld=30,Vi=Ld+I0,Cs="sprig.pendingCount";let Bl=0,jl=Date.now(),Es=!1;const k0=async(e,t,n,r=2,i)=>{try{if(yn()||!t)return;i!=null&&i.minDuration&&(Rd=i.minDuration),i!=null&&i.batchDuration&&(xa=i.batchDuration),xv(r),N0(),T0(t+Vi,30*60,t+Vi),R0(),window.rrwebRecord||await S0(e,"https://cdn.sprig.com/dependencies/record-2.0.0-alpha.6.min.js",n);const o=window.rrwebRecord;if(!o)return;let a=!0;o({checkoutEveryNms:Ld*1e3,sampling:{input:"last",scroll:250,media:800},emit:(s,l)=>{if(yn())return;jl=Date.now();const u=a||!!l;a=!1,x0({uuid:Kt(),event:JSON.stringify(s),isValidStart:u,timestamp:Date.now()})},...i}),Es=!0,Bl||(Bl=window.setInterval(()=>{Date.now()-jl>Fl&&Fr("Sprig_Noop",{})},Fl))}catch(o){pt("Error initializing replay",o)}};let Aa=!1,Ta=[];const x0=e=>{Ta.push(e),Aa||A0()},A0=()=>{Aa=!0,setTimeout(async()=>{if(yn())return;const e=Ta;Ta=[],Aa=!1;try{await d0(e)}catch(t){pt("Error storing replay events",t)}},500)},T0=(e=6*60,t=30*60,n=4*60)=>{const r=setInterval(async()=>{const i=Date.now();yn()||await te.transaction("rw",te.events,te.chunkUploads,te.pendingCaptures,()=>{To(i-e*1e3,"events",o=>o.expiredAt===void 0||o.expiredAt<i-e*1e3),To(i-t*1e3,"chunkUploads"),To(i-n*1e3,"pendingCaptures",o=>o.canUpload===void 0||o.canUpload===!1)}).catch(o=>{clearInterval(r),pt("Error deleting table rows",o)})},3e4)},R0=(e=5)=>{setInterval(V0,e*1e3)},L0=async(e,t,n,r,i)=>{try{const o=Math.min(e+i,n),a=await f0(e,o);if(!(a!=null&&a.length))return[r,[]];if(!r){let s=-1;return a==null||a.forEach((l,u)=>{if(!l.isValidStart)return;const c=l.timestamp<=t;(s<0||c)&&(s=u)}),s<0?[]:[!0,a==null?void 0:a.slice(s)]}return[r,a]}catch(o){pt("Error getting events batch",o)}},O0=(e,t,n)=>{const r=e.length,i=t*1024*1024,o=Math.ceil(r/n),a=Math.max(i,o),s=[];let l=0;for(;l<r;)s.push(e.slice(l,l+a)),l+=a;return s},Od=e=>Promise.all(e.map(async t=>{const n=await Tv(t);return await m0(t.uuid,n),t.uploadId})),Nd=async e=>{const t=await v0(e);if(!(t!=null&&t.length))return;t.sort((i,o)=>i.chunkIndex-o.chunkIndex);const n=t.map(i=>({ETag:i.etag,PartNumber:i.chunkIndex})).filter(i=>i.ETag!==null),r=t[0];await Zc({apiUrl:r.apiUrl,surveyId:r.surveyId,uploadId:e,responseGroupUuid:r.responseGroupId,etags:n,headers:r.completeUploadHeaders,replayDuration:r.replayDuration}),await y0(e)},N0=async()=>{try{let e=[];if(await te.transaction("rw",te.chunkUploads,async()=>{e=await g0({status:Qn.ReadyForUpload}).catch(n=>{pt("chunkUploads transaction error",n)})}),!(e!=null&&e.length))return;const t=await Od(e);t!=null&&t.length&&await Promise.all(t.map(async n=>{n&&await Nd(n)}))}catch(e){pt("Error getting chunk upload uuids",e)}},D0=async(e,t)=>{await Od(t),await Promise.all(e.map(n=>Nd(n)))},U0=e=>{let t=0;e.forEach(i=>{t+=i.length});const n=new Uint8Array(t);let r=0;return e.forEach(i=>{n.set(i,r),r+=i.length}),n},Hl=async(e,t,n)=>{const r=new TextEncoder;let i=null,o=null,a=null,s=!1,l=!1,[u,c]=[0,0];const d=e-Vi*1e3,p=[];let f=[];for(let m=d;m<t;m+=xa){if([l,f]=await L0(m,e,t,l,xa),!(f!=null&&f.length))continue;u===0&&(u=f[0].timestamp),c=f[f.length-1].timestamp;const g=`${s?",":"["}${f.map(y=>y.event).join(",")}`,b=r.encode(g);n?(o===null&&(a=new window.CompressionStream("gzip"),o=a.writable.getWriter()),o.write(b)):p.push(b),s=!0}if(c-u<Rd)return null;const h=r.encode("]");return o&&a?(o.write(h),o.close(),i=new Uint8Array(await new Response(a.readable).arrayBuffer())):(p.push(h),i=U0(p)),i},P0=async(e,t)=>{const n=window.CompressionStream!==void 0;let r=null;const i=t!=null?t:Date.now(),o=i-e;try{r=await Hl(o,i,n)}catch(a){if(a instanceof Error&&window.UserLeap.reportError("Error compressing replay",a),n)try{r=await Hl(o,i,!1)}catch(s){pt("fileData fallback failed",s)}}return r},zl=async e=>{const{surveyId:t,responseGroupId:n,visitorId:r,apiUrl:i,completeUploadHeaders:o,replayParams:a,triggerTimestamp:s}=e,l=await P0(a.replayDurationSeconds*1e3,s);if(!(l!=null&&l.length))return;const u=O0(l,a.minimumChunkSizeMb,a.signedUrls.length),c=await Promise.all(u.map(async(d,p)=>{const f=Kt(),h={apiUrl:i,chunkIndex:p+1,completeUploadHeaders:o,etag:null,responseGroupId:n,status:Qn.ReadyForUpload,surveyId:t,timestamp:s,totalChunks:u.length,data:d,uploadId:a.uploadId,uploadUrl:a.signedUrls[p].url,uuid:f,visitorId:r};return await h0(h),h}));await D0([a.uploadId],c)},Dd=async(e,t)=>{if(!yn())try{const{isStandalone:n,replayParams:r,triggerTimestamp:i,responseGroupId:o}=e,a=async()=>{setTimeout(()=>Z.removeListener(G.QuestionAnswered,a),0),r.replayDurationType===Pn.Before?await zl(e):await C0(o)};if(r.replayDurationType===Pn.After||r.replayDurationType===Pn.BeforeAndAfter){n||Z.on(G.QuestionAnswered,a),await M0(e);return}if(n||t)await zl(e);else{const s=Vi+r.replayDurationSeconds;await p0(i-s*1e3,i,r.expirationTimeLimitMinutes),Z.on(G.QuestionAnswered,a)}}catch(n){pt("Error scheduling or capturing replay",n)}},Gl=()=>{if(!yn())try{c0()}catch(e){pt("Error clearing session event data",e)}};let St=sessionStorage.getItem(Cs);const M0=async e=>{const{surveyId:t}=e,n=await w0(),r=n==null?void 0:n.filter(a=>a.captureParams.surveyId===t);if(r!=null&&r.length)return;const i={...e,replayParams:{...e.replayParams}};e.replayParams.replayDurationType===Pn.BeforeAndAfter&&(i.replayParams.replayDurationSeconds*=2),i.replayParams.replayDurationType=Pn.Before;const o=e.triggerTimestamp+e.replayParams.replayDurationSeconds*1e3;return i.triggerTimestamp=o,St=St?(parseInt(St)+1).toString():"1",sessionStorage.setItem(Cs,St),_0({uuid:Kt(),targetTimestamp:o,timestamp:Date.now(),captureParams:i})},V0=async()=>{try{if(St&&parseInt(St)>0){const e=await b0();e.length&&await Promise.all(e.map(async t=>{await te.pendingCaptures.delete(t.uuid),await Dd(t.captureParams,t.canUpload)})),St=(parseInt(St)-e.length).toString(),sessionStorage.setItem(Cs,St)}}catch(e){pt("Error initiating pending captures",e)}},Fr=(e,t)=>{var n,r;!Es||(r=(n=window.rrwebRecord)==null?void 0:n.addCustomEvent)==null||r.call(n,e,t)},Kl=e=>{Fr("Sprig_PageView",e)},F0=e=>{Fr("Sprig_TrackEvent",e)},B0=e=>{Fr("Sprig_ShowSurvey",e)},j0=e=>{Fr("Sprig_SubmitSurvey",e)},pt=(e,t)=>{Es=!1,s0(e,t)};var O=(e=>(e.ConsentLegal="consentlegal",e.Likert="likert",e.MultipleChoice="multiplechoice",e.MultipleSelect="multipleselect",e.NPS="nps",e.Open="open",e.RecordedTask="recordedtask",e.TextUrlPrompt="texturlprompt",e.Thanks="thanks",e.Uploading="uploading",e.VideoVoice="videovoice",e))(O||{}),It=(e=>(e.Answered="answered",e.Equal="eq",e.NotEqual="neq",e.Skipped="skipped",e.LessThan="lt",e.LessThanOrEqual="lte",e.GivenUp="given_up",e.GreaterThan="gt",e.GreaterThanOrEqual="gte",e.ListAll="list_all",e.ListAtLeastOne="list_alo",e.ListExact="list_exact",e.DoesNotInclude="list_dni",e.Contains="contains",e.DoesNotContain="notcontains",e))(It||{}),Hn=(e=>(e.Camera="camera",e.Microphone="microphone",e.Screen="screen",e))(Hn||{}),$e=(e=>(e.AvPermission="av_permission",e.ScreenPermission="screen_permission",e.StartTask="start_task",e.CompleteTask="complete_task",e))($e||{}),cn=(e=>(e.Number="number",e.Smiley="smiley",e.Star="star",e))(cn||{}),Br,P,Ud,zn,on,Wl,Pd,Md,Fi={},Vd=[],H0=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function At(e,t){for(var n in t)e[n]=t[n];return e}function Fd(e){var t=e.parentNode;t&&t.removeChild(e)}function he(e,t,n){var r,i,o,a={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Br.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return pr(e,a,r,i,null)}function pr(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++Ud:i};return i==null&&P.vnode!=null&&P.vnode(o),o}function Bd(){return{current:null}}function Je(e){return e.children}function z0(e,t,n,r,i){var o;for(o in n)o==="children"||o==="key"||o in t||Bi(e,o,null,n[o],r);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||Bi(e,o,t[o],n[o],r)}function ql(e,t,n){t[0]==="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||H0.test(t)?n:n+"px"}function Bi(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ql(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ql(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Yl:$l,o):e.removeEventListener(t,o?Yl:$l,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t.indexOf("-")==-1?e.removeAttribute(t):e.setAttribute(t,n))}}function $l(e){zn=!0;try{return this.l[e.type+!1](P.event?P.event(e):e)}finally{zn=!1}}function Yl(e){zn=!0;try{return this.l[e.type+!0](P.event?P.event(e):e)}finally{zn=!1}}function at(e,t){this.props=e,this.context=t}function Ir(e,t){if(t==null)return e.__?Ir(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Ir(e):null}function jd(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return jd(e)}}function G0(e){zn?setTimeout(e):Pd(e)}function Ra(e){(!e.__d&&(e.__d=!0)&&on.push(e)&&!ji.__r++||Wl!==P.debounceRendering)&&((Wl=P.debounceRendering)||G0)(ji)}function ji(){var e,t,n,r,i,o,a,s;for(on.sort(function(l,u){return l.__v.__b-u.__v.__b});e=on.shift();)e.__d&&(t=on.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=At({},o)).__v=o.__v+1,Ss(s,o,i,n.__n,s.ownerSVGElement!==void 0,o.__h!=null?[a]:null,r,a==null?Ir(o):a,o.__h),Wd(r,o),o.__e!=a&&jd(o)),on.length>t&&on.sort(function(l,u){return l.__v.__b-u.__v.__b}));ji.__r=0}function Hd(e,t,n,r,i,o,a,s,l,u){var c,d,p,f,h,m,g,b=r&&r.__k||Vd,y=b.length;for(n.__k=[],c=0;c<t.length;c++)if((f=n.__k[c]=(f=t[c])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?pr(null,f,null,null,f):Array.isArray(f)?pr(Je,{children:f},null,null,null):f.__b>0?pr(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)!=null){if(f.__=n,f.__b=n.__b+1,(p=b[c])===null||p&&f.key==p.key&&f.type===p.type)b[c]=void 0;else for(d=0;d<y;d++){if((p=b[d])&&f.key==p.key&&f.type===p.type){b[d]=void 0;break}p=null}Ss(e,f,p=p||Fi,i,o,a,s,l,u),h=f.__e,(d=f.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,f),g.push(d,f.__c||h,f)),h!=null?(m==null&&(m=h),typeof f.type=="function"&&f.__k===p.__k?f.__d=l=zd(f,l,e):l=Gd(e,f,p,b,h,l),typeof n.type=="function"&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=Ir(p))}for(n.__e=m,c=y;c--;)b[c]!=null&&(typeof n.type=="function"&&b[c].__e!=null&&b[c].__e==n.__d&&(n.__d=Kd(r).nextSibling),$d(b[c],b[c]));if(g)for(c=0;c<g.length;c++)qd(g[c],g[++c],g[++c])}function zd(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t=typeof r.type=="function"?zd(r,t,n):Gd(n,r,r,i,r.__e,t));return t}function Ot(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){Ot(n,t)}):t.push(e)),t}function Gd(e,t,n,r,i,o){var a,s,l;if(t.__d!==void 0)a=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return a!==void 0?a:i.nextSibling}function Kd(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=Kd(n)))return r}return null}function Ss(e,t,n,r,i,o,a,s,l){var u,c,d,p,f,h,m,g,b,y,_,v,w,E,I,S=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(u=P.__b)&&u(t);try{e:if(typeof S=="function"){if(g=t.props,b=(u=S.contextType)&&r[u.__c],y=u?b?b.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in S&&S.prototype.render?t.__c=c=new S(g,y):(t.__c=c=new at(g,y),c.constructor=S,c.render=W0),b&&b.sub(c),c.props=g,c.state||(c.state={}),c.context=y,c.__n=r,d=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),S.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=At({},c.__s)),At(c.__s,S.getDerivedStateFromProps(g,c.__s))),p=c.props,f=c.state,c.__v=t,d)S.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(S.getDerivedStateFromProps==null&&g!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(g,y),!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(g,c.__s,y)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(c.props=g,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(x){x&&(x.__=t)}),_=0;_<c._sb.length;_++)c.__h.push(c._sb[_]);c._sb=[],c.__h.length&&a.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(g,c.__s,y),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,f,h)})}if(c.context=y,c.props=g,c.__P=e,v=P.__r,w=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,v&&v(t),u=c.render(c.props,c.state,c.context),E=0;E<c._sb.length;E++)c.__h.push(c._sb[E]);c._sb=[]}else do c.__d=!1,v&&v(t),u=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++w<25);c.state=c.__s,c.getChildContext!=null&&(r=At(At({},r),c.getChildContext())),d||c.getSnapshotBeforeUpdate==null||(h=c.getSnapshotBeforeUpdate(p,f)),I=u!=null&&u.type===Je&&u.key==null?u.props.children:u,Hd(e,Array.isArray(I)?I:[I],t,n,r,i,o,a,s,l),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),m&&(c.__E=c.__=null),c.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=K0(n.__e,t,n,r,i,o,a,l);(u=P.diffed)&&u(t)}catch(x){t.__v=null,(l||o!=null)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),P.__e(x,t,n)}}function Wd(e,t){P.__c&&P.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){P.__e(r,n.__v)}})}function K0(e,t,n,r,i,o,a,s){var l,u,c,d=n.props,p=t.props,f=t.type,h=0;if(f==="svg"&&(i=!0),o!=null){for(;h<o.length;h++)if((l=o[h])&&"setAttribute"in l==!!f&&(f?l.localName===f:l.nodeType===3)){e=l,o[h]=null;break}}if(e==null){if(f===null)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),o=null,s=!1}if(f===null)d===p||s&&e.data===p||(e.data=p);else{if(o=o&&Br.call(e.childNodes),u=(d=n.props||Fi).dangerouslySetInnerHTML,c=p.dangerouslySetInnerHTML,!s){if(o!=null)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(z0(e,p,d,i,s),c)t.__k=[];else if(h=t.props.children,Hd(e,Array.isArray(h)?h:[h],t,n,r,i&&f!=="foreignObject",o,a,o?o[0]:n.__k&&Ir(n,0),s),o!=null)for(h=o.length;h--;)o[h]!=null&&Fd(o[h]);s||("value"in p&&(h=p.value)!==void 0&&(h!==e.value||f==="progress"&&!h||f==="option"&&h!==d.value)&&Bi(e,"value",h,d.value,!1),"checked"in p&&(h=p.checked)!==void 0&&h!==e.checked&&Bi(e,"checked",h,d.checked,!1))}return e}function qd(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){P.__e(r,n)}}function $d(e,t,n){var r,i;if(P.unmount&&P.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||qd(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){P.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&$d(r[i],t,n||typeof e.type!="function");n||e.__e==null||Fd(e.__e),e.__=e.__e=e.__d=void 0}function W0(e,t,n){return this.constructor(e,n)}function Gn(e,t,n){var r,i,o;P.__&&P.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],Ss(t,e=(!r&&n||t).__k=he(Je,null,[e]),i||Fi,Fi,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?Br.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),Wd(o,e)}function Yd(e,t){Gn(e,t,Yd)}function q0(e,t,n){var r,i,o,a=At({},e.props);for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];return arguments.length>2&&(a.children=arguments.length>3?Br.call(arguments,2):n),pr(e.type,a,r||e.key,i||e.ref,null)}function Zd(e,t){var n={__c:t="__cC"+Md++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(s){s.__e=!0,Ra(s)})},this.sub=function(a){i.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),s&&s.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Br=Vd.slice,P={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Ud=0,zn=!1,at.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=At({},this.state),typeof e=="function"&&(e=e(At({},n),this.props)),e&&At(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ra(this))},at.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ra(this))},at.prototype.render=Je,on=[],Pd=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ji.__r=0,Md=0;var nt=(e=>(e.Video="video",e.Audio="audio",e.Screen="screen",e))(nt||{}),Te=(e=>(e.PermissionStatus="permission.status",e.AvPermission="av.permission",e.ScreenPermission="screen.permission",e.BeginRecording="begin.recording",e.StartTask="start.task",e.FinishTask="finish.task",e))(Te||{}),Ye=(e=>(e.Abandoned="abandoned",e.GivenUp="given.up",e.Completed="completed",e))(Ye||{}),Y=(e=>(e.ScreenPermissionRequested="screen.permission.requested",e.PermissionDescriptors="permission.descriptors",e.PermissionStatusCallback="permission.status.callback",e.StreamReadyCallback="stream.ready.callback",e.StreamCanceledCallback="stream.canceled.callback",e.TaskCompleteCallback="task.complete.callback",e.TaskResponse="task.response",e.TaskStatus="task.status",e.RecordingMediaTypes="recording.media.types",e.StartRecordingCallback="start.recording.callback",e.PassthroughData="passthrough.data",e.CurrentIndex="current.index",e.UploadCallback="upload.callback",e.ProgressCallback="progress.callback",e.BeginCallback="begin.callback",e))(Y||{});const Zl=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=(u!=null?u:typeof c!="object")?c:Object.assign({},t,c),n.forEach(p=>p(t,d))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>n.clear()};return t=e(r,i,s),s},$0=e=>e?Zl(e):Zl;var Qt,se,Ro,Ql,Kn=0,Qd=[],di=[],Jl=P.__b,Xl=P.__r,eu=P.diffed,tu=P.__c,nu=P.unmount;function wn(e,t){P.__h&&P.__h(se,e,Kn||t),Kn=0;var n=se.__H||(se.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:di}),n.__[e]}function xe(e){return Kn=1,Is(nf,e)}function Is(e,t,n){var r=wn(Qt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):nf(void 0,t),function(o){var a=r.__N?r.__N[0]:r.__[0],s=r.t(a,o);a!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=se,!se.u)){se.u=!0;var i=se.shouldComponentUpdate;se.shouldComponentUpdate=function(o,a,s){if(!r.__c.__H)return!0;var l=r.__c.__H.__.filter(function(c){return c.__c});if(l.every(function(c){return!c.__N}))return!i||i.call(this,o,a,s);var u=!1;return l.forEach(function(c){if(c.__N){var d=c.__[0];c.__=c.__N,c.__N=void 0,d!==c.__[0]&&(u=!0)}}),!(!u&&r.__c.props===o)&&(!i||i.call(this,o,a,s))}}return r.__N||r.__}function Ze(e,t){var n=wn(Qt++,3);!P.__s&&xs(n.__H,t)&&(n.__=e,n.i=t,se.__H.__h.push(n))}function jr(e,t){var n=wn(Qt++,4);!P.__s&&xs(n.__H,t)&&(n.__=e,n.i=t,se.__h.push(n))}function Yt(e){return Kn=5,no(function(){return{current:e}},[])}function Jd(e,t,n){Kn=6,jr(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function no(e,t){var n=wn(Qt++,7);return xs(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Xd(e,t){return Kn=8,no(function(){return e},t)}function ef(e){var t=se.context[e.__c],n=wn(Qt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(se)),t.props.value):e.__}function ks(e,t){P.useDebugValue&&P.useDebugValue(t?t(e):e)}function Y0(e){var t=wn(Qt++,10),n=xe();return t.__=e,se.componentDidCatch||(se.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function tf(){var e=wn(Qt++,11);if(!e.__){for(var t=se.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Z0(){for(var e;e=Qd.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(fi),e.__H.__h.forEach(La),e.__H.__h=[]}catch(t){e.__H.__h=[],P.__e(t,e.__v)}}P.__b=function(e){se=null,Jl&&Jl(e)},P.__r=function(e){Xl&&Xl(e),Qt=0;var t=(se=e.__c).__H;t&&(Ro===se?(t.__h=[],se.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=di,n.__N=n.i=void 0})):(t.__h.forEach(fi),t.__h.forEach(La),t.__h=[])),Ro=se},P.diffed=function(e){eu&&eu(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Qd.push(t)!==1&&Ql===P.requestAnimationFrame||((Ql=P.requestAnimationFrame)||Q0)(Z0)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==di&&(n.__=n.__V),n.i=void 0,n.__V=di})),Ro=se=null},P.__c=function(e,t){t.some(function(n){try{n.__h.forEach(fi),n.__h=n.__h.filter(function(r){return!r.__||La(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],P.__e(r,n.__v)}}),tu&&tu(e,t)},P.unmount=function(e){nu&&nu(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{fi(r)}catch(i){t=i}}),n.__H=void 0,t&&P.__e(t,n.__v))};var ru=typeof requestAnimationFrame=="function";function Q0(e){var t,n=function(){clearTimeout(r),ru&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ru&&(t=requestAnimationFrame(n))}function fi(e){var t=se,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),se=t}function La(e){var t=se;e.__c=e.__(),se=t}function xs(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function nf(e,t){return typeof t=="function"?t(e):t}function rf(e,t){for(var n in t)e[n]=t[n];return e}function Oa(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Lo(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function Hi(e){this.props=e}function of(e,t){function n(i){var o=this.props.ref,a=o==i.ref;return!a&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!a:Oa(this.props,i)}function r(i){return this.shouldComponentUpdate=n,he(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Hi.prototype=new at).isPureReactComponent=!0,Hi.prototype.shouldComponentUpdate=function(e,t){return Oa(this.props,e)||Oa(this.state,t)};var iu=P.__b;P.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),iu&&iu(e)};var J0=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function af(e){function t(n){var r=rf({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=J0,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var ou=function(e,t){return e==null?null:Ot(Ot(e).map(t))},sf={map:ou,forEach:ou,count:function(e){return e?Ot(e).length:0},only:function(e){var t=Ot(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Ot},X0=P.__e;P.__e=function(e,t,n,r){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}X0(e,t,n,r)};var au=P.unmount;function lf(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=rf({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return lf(r,t,n)})),e}function uf(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return uf(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function hr(){this.__u=0,this.t=null,this.__b=null}function cf(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function df(e){var t,n,r;function i(o){if(t||(t=e()).then(function(a){n=a.default||a},function(a){r=a}),r)throw r;if(!n)throw t;return he(n,o)}return i.displayName="Lazy",i.__f=!0,i}function On(){this.u=null,this.o=null}P.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),au&&au(e)},(hr.prototype=new at).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=cf(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=uf(u,u.__c.__P,u.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.t.pop();)c.forceUpdate()}},l=t.__h===!0;r.__u++||l||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},hr.prototype.componentWillUnmount=function(){this.t=[]},hr.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=lf(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&he(Je,null,e.fallback);return i&&(i.__h=null),[he(Je,null,t.__a?null:e.children),i]};var su=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function e_(e){return this.getChildContext=function(){return e.context},e.children}function t_(e){var t=this,n=e.i;t.componentWillUnmount=function(){Gn(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),Gn(he(e_,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function ff(e,t){var n=he(t_,{__v:e,i:t});return n.containerInfo=t,n}(On.prototype=new at).__a=function(e){var t=this,n=cf(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),su(t,e,r)):i()};n?n(o):o()}},On.prototype.render=function(e){this.u=null,this.o=new Map;var t=Ot(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},On.prototype.componentDidUpdate=On.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){su(e,n,t)})};var pf=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,n_=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,r_=typeof document<"u",i_=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function hf(e,t,n){return t.__k==null&&(t.textContent=""),Gn(e,t),typeof n=="function"&&n(),e?e.__c:null}function mf(e,t,n){return Yd(e,t),typeof n=="function"&&n(),e?e.__c:null}at.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(at.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var lu=P.event;function o_(){}function a_(){return this.cancelBubble}function s_(){return this.defaultPrevented}P.event=function(e){return lu&&(e=lu(e)),e.persist=o_,e.isPropagationStopped=a_,e.isDefaultPrevented=s_,e.nativeEvent=e};var gf,uu={configurable:!0,get:function(){return this.class}},cu=P.vnode;P.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){var i=t.indexOf("-")===-1;for(var o in r={},n){var a=n[o];r_&&o==="children"&&t==="noscript"||o==="value"&&"defaultValue"in n&&a==null||(o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&a===!0?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!i_(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():i&&n_.test(o)?o=o.replace(/[A-Z0-9]/g,"-$&").toLowerCase():a===null&&(a=void 0),/^oninput$/i.test(o)&&(o=o.toLowerCase(),r[o]&&(o="oninputCapture")),r[o]=a)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=Ot(n.children).forEach(function(s){s.props.selected=r.value.indexOf(s.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=Ot(n.children).forEach(function(s){s.props.selected=r.multiple?r.defaultValue.indexOf(s.props.value)!=-1:r.defaultValue==s.props.value})),e.props=r,n.class!=n.className&&(uu.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",uu))}e.$$typeof=pf,cu&&cu(e)};var du=P.__r;P.__r=function(e){du&&du(e),gf=e.__c};var vf={ReactCurrentDispatcher:{current:{readContext:function(e){return gf.__n[e.__c].props.value}}}},l_="17.0.2";function yf(e){return he.bind(null,e)}function As(e){return!!e&&e.$$typeof===pf}function _f(e){return As(e)?q0.apply(null,arguments):e}function bf(e){return!!e.__k&&(Gn(null,e),!0)}function wf(e){return e&&(e.base||e.nodeType===1&&e)||null}var Cf=function(e,t){return e(t)},Ef=function(e,t){return e(t)},Sf=Je;function Ts(e){e()}function If(e){return e}function kf(){return[!1,Ts]}var xf=jr;function Af(e,t){var n=t(),r=xe({h:{__:n,v:t}}),i=r[0].h,o=r[1];return jr(function(){i.__=n,i.v=t,Lo(i.__,t())||o({h:i})},[e,n,t]),Ze(function(){return Lo(i.__,i.v())||o({h:i}),e(function(){Lo(i.__,i.v())||o({h:i})})},[e]),n}var u_={useState:xe,useId:tf,useReducer:Is,useEffect:Ze,useLayoutEffect:jr,useInsertionEffect:xf,useTransition:kf,useDeferredValue:If,useSyncExternalStore:Af,startTransition:Ts,useRef:Yt,useImperativeHandle:Jd,useMemo:no,useCallback:Xd,useContext:ef,useDebugValue:ks,version:"17.0.2",Children:sf,render:hf,hydrate:mf,unmountComponentAtNode:bf,createPortal:ff,createElement:he,createContext:Zd,createFactory:yf,cloneElement:_f,createRef:Bd,Fragment:Je,isValidElement:As,findDOMNode:wf,Component:at,PureComponent:Hi,memo:of,forwardRef:af,flushSync:Ef,unstable_batchedUpdates:Cf,StrictMode:Sf,Suspense:hr,SuspenseList:On,lazy:df,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:vf};const c_=Object.freeze(Object.defineProperty({__proto__:null,Children:sf,PureComponent:Hi,StrictMode:Sf,Suspense:hr,SuspenseList:On,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:vf,cloneElement:_f,createFactory:yf,createPortal:ff,default:u_,findDOMNode:wf,flushSync:Ef,forwardRef:af,hydrate:mf,isValidElement:As,lazy:df,memo:of,render:hf,startTransition:Ts,unmountComponentAtNode:bf,unstable_batchedUpdates:Cf,useDeferredValue:If,useInsertionEffect:xf,useSyncExternalStore:Af,useTransition:kf,version:l_,Component:at,Fragment:Je,createContext:Zd,createElement:he,createRef:Bd,useCallback:Xd,useContext:ef,useDebugValue:ks,useEffect:Ze,useErrorBoundary:Y0,useId:tf,useImperativeHandle:Jd,useLayoutEffect:jr,useMemo:no,useReducer:Is,useRef:Yt,useState:xe},Symbol.toStringTag,{value:"Module"}));var Tf={exports:{}},Oo={};const ro=dm(c_);var No={exports:{}},Do={};/**
33
+ `).slice(t).filter(xc).map(function(r){return`
34
+ `+r}).join("")):""}var ov=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"],Tc=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ka=ov.concat(Tc),av={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Kn(e,t){this._e=cn(),this.name=e,this.message=t}Bn(Kn).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Bo(this._e,2))}},toString:function(){return this.name+": "+this.message}});function Rc(e,t){return e+". Errors: "+Object.keys(t).map(function(n){return t[n].toString()}).filter(function(n,r,i){return i.indexOf(n)===r}).join(`
35
+ `)}function yi(e,t,n,r){this._e=cn(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Rc(e,t)}Bn(yi).from(Kn);function tr(e,t){this._e=cn(),this.name="BulkError",this.failures=Object.keys(t).map(function(n){return t[n]}),this.failuresByPos=t,this.message=Rc(e,t)}Bn(tr).from(Kn);var Ha=Ka.reduce(function(e,t){return e[t]=t+"Error",e},{}),sv=Kn,V=Ka.reduce(function(e,t){var n=t+"Error";function r(i,o){this._e=cn(),this.name=n,i?typeof i=="string"?(this.message=""+i+(o?`
36
+ `+o:""),this.inner=o||null):typeof i=="object"&&(this.message=i.name+" "+i.message,this.inner=i):(this.message=av[t]||n,this.inner=null)}return Bn(r).from(sv),e[t]=r,e},{});V.Syntax=SyntaxError;V.Type=TypeError;V.Range=RangeError;var ru=Tc.reduce(function(e,t){return e[t+"Error"]=V[t],e},{});function uv(e,t){if(!e||e instanceof Kn||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ru[e.name])return e;var n=new ru[e.name](t||e.message,e);return"stack"in e&&Ct(n,"stack",{get:function(){return this.inner.stack}}),n}var Ki=Ka.reduce(function(e,t){return["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=V[t]),e},{});Ki.ModifyError=yi;Ki.DexieError=Kn;Ki.BulkError=tr;function ee(){}function Cr(e){return e}function lv(e,t){return e==null||e===Cr?t:function(n){return t(e(n))}}function an(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function cv(e,t){return e===ee?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?an(r,this.onsuccess):r),i&&(this.onerror=this.onerror?an(i,this.onerror):i),o!==void 0?o:n}}function dv(e,t){return e===ee?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?an(n,this.onsuccess):n),r&&(this.onerror=this.onerror?an(r,this.onerror):r)}}function fv(e,t){return e===ee?t:function(n){var r=e.apply(this,arguments);Le(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?an(i,this.onsuccess):i),o&&(this.onerror=this.onerror?an(o,this.onerror):o),r===void 0?a===void 0?void 0:a:Le(r,a)}}function pv(e,t){return e===ee?t:function(){return t.apply(this,arguments)===!1?!1:e.apply(this,arguments)}}function ja(e,t){return e===ee?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then=="function"){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}var cr={},hv=100,mv=20,Lc=100,Ga=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,lr(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,lr(t),e]}(),Ko=Ga[0],_i=Ga[1],Ho=Ga[2],Oc=_i&&_i.then,Zr=Ko&&Ko.constructor,za=!!Ho,jo=!1,gv=Ho?function(){Ho.then(Br)}:re.setImmediate?setImmediate.bind(null,Br):re.MutationObserver?function(){var e=document.createElement("div");new MutationObserver(function(){Br(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(Br,0)},dr=function(e,t){Yn.push([e,t]),bi&&(gv(),bi=!1)},Go=!0,bi=!0,en=[],Qr=[],zo=null,Wo=Cr,kn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:au,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(function(e){try{au(e[0],e[1])}catch{}})}},M=kn,Yn=[],tn=0,Jr=[];function L(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ee,this._lib=!1;var t=this._PSD=M;if(ct&&(this._stackHolder=cn(),this._prev=null,this._numPrev=0),typeof e!="function"){if(e!==cr)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&$o(this,this._value);return}this._state=null,this._value=null,++t.ref,Uc(this,e)}var qo={get:function(){var e=M,t=wi;function n(r,i){var o=this,a=!e.global&&(e!==M||t!==wi),s=a&&!Et(),u=new L(function(c,l){Wa(o,new Nc(Ii(r,e,a,s),Ii(i,e,a,s),c,l,e))});return ct&&Mc(u,this),u}return n.prototype=cr,n},set:function(e){Ct(this,"then",e&&e.prototype===cr?qo:{get:function(){return e},set:qo.set})}};Nn(L.prototype,{then:qo,_then:function(e,t){Wa(this,new Nc(null,null,e,t,M))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=arguments[0],n=arguments[1];return typeof t=="function"?this.then(null,function(r){return r instanceof t?n(r):Xr(r)}):this.then(null,function(r){return r&&r.name===t?n(r):Xr(r)})},finally:function(e){return this.then(function(t){return e(),t},function(t){return e(),Xr(t)})},stack:{get:function(){if(this._stack)return this._stack;try{jo=!0;var e=Pc(this,[],mv),t=e.join(`
37
+ From previous: `);return this._state!==null&&(this._stack=t),t}finally{jo=!1}}},timeout:function(e,t){var n=this;return e<1/0?new L(function(r,i){var o=setTimeout(function(){return i(new V.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}});typeof Symbol<"u"&&Symbol.toStringTag&&Ct(L.prototype,Symbol.toStringTag,"Dexie.Promise");kn.env=Fc();function Nc(e,t,n,r,i){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=n,this.reject=r,this.psd=i}Nn(L,{all:function(){var e=gt.apply(null,arguments).map(Si);return new L(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(i,o){return L.resolve(i).then(function(a){e[o]=a,--r||t(e)},n)})})},resolve:function(e){if(e instanceof L)return e;if(e&&typeof e.then=="function")return new L(function(n,r){e.then(n,r)});var t=new L(cr,!0,e);return Mc(t,zo),t},reject:Xr,race:function(){var e=gt.apply(null,arguments).map(Si);return new L(function(t,n){e.map(function(r){return L.resolve(r).then(t,n)})})},PSD:{get:function(){return M},set:function(e){return M=e}},totalEchoes:{get:function(){return wi}},newPSD:Pt,usePSD:jn,scheduler:{get:function(){return dr},set:function(e){dr=e}},rejectionMapper:{get:function(){return Wo},set:function(e){Wo=e}},follow:function(e,t){return new L(function(n,r){return Pt(function(i,o){var a=M;a.unhandleds=[],a.onunhandled=o,a.finalize=an(function(){var s=this;yv(function(){s.unhandleds.length===0?i():o(s.unhandleds[0])})},a.finalize),e()},t,n,r)})}});Zr&&(Zr.allSettled&&Ct(L,"allSettled",function(){var e=gt.apply(null,arguments).map(Si);return new L(function(t){e.length===0&&t([]);var n=e.length,r=new Array(n);e.forEach(function(i,o){return L.resolve(i).then(function(a){return r[o]={status:"fulfilled",value:a}},function(a){return r[o]={status:"rejected",reason:a}}).then(function(){return--n||t(r)})})})}),Zr.any&&typeof AggregateError<"u"&&Ct(L,"any",function(){var e=gt.apply(null,arguments).map(Si);return new L(function(t,n){e.length===0&&n(new AggregateError([]));var r=e.length,i=new Array(r);e.forEach(function(o,a){return L.resolve(o).then(function(s){return t(s)},function(s){i[a]=s,--r||n(new AggregateError(i))})})})}));function Uc(e,t){try{t(function(n){if(e._state===null){if(n===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&Er();n&&typeof n.then=="function"?Uc(e,function(i,o){n instanceof L?n._then(i,o):n.then(i,o)}):(e._state=!0,e._value=n,Dc(e)),r&&kr()}},$o.bind(null,e))}catch(n){$o(e,n)}}function $o(e,t){if(Qr.push(t),e._state===null){var n=e._lib&&Er();t=Wo(t),e._state=!1,e._value=t,ct&&t!==null&&typeof t=="object"&&!t._promise&&Jg(function(){var r=Va(t,"stack");t._promise=e,Ct(t,"stack",{get:function(){return jo?r&&(r.get?r.get.apply(t):r.value):e.stack}})}),_v(e),Dc(e),n&&kr()}}function Dc(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Wa(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),tn===0&&(++tn,dr(function(){--tn===0&&qa()},[]))}function Wa(e,t){if(e._state===null){e._listeners.push(t);return}var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++tn,dr(vv,[n,e,t])}function vv(e,t,n){try{zo=t;var r,i=t._value;t._state?r=e(i):(Qr.length&&(Qr=[]),r=e(i),Qr.indexOf(i)===-1&&bv(t)),n.resolve(r)}catch(o){n.reject(o)}finally{zo=null,--tn===0&&qa(),--n.psd.ref||n.psd.finalize()}}function Pc(e,t,n){if(t.length===n)return t;var r="";if(e._state===!1){var i=e._value,o,a;i!=null?(o=i.name||"Error",a=i.message||i,r=Bo(i,0)):(o=i,a=""),t.push(o+(a?": "+a:"")+r)}return ct&&(r=Bo(e._stackHolder,2),r&&t.indexOf(r)===-1&&t.push(r),e._prev&&Pc(e._prev,t,n)),t}function Mc(e,t){var n=t?t._numPrev+1:0;n<hv&&(e._prev=t,e._numPrev=n)}function Br(){Er()&&kr()}function Er(){var e=Go;return Go=!1,bi=!1,e}function kr(){var e,t,n;do for(;Yn.length>0;)for(e=Yn,Yn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(Yn.length>0);Go=!0,bi=!0}function qa(){var e=en;en=[],e.forEach(function(r){r._PSD.onunhandled.call(null,r._value,r)});for(var t=Jr.slice(0),n=t.length;n;)t[--n]()}function yv(e){function t(){e(),Jr.splice(Jr.indexOf(t),1)}Jr.push(t),++tn,dr(function(){--tn===0&&qa()},[])}function _v(e){en.some(function(t){return t._value===e._value})||en.push(e)}function bv(e){for(var t=en.length;t;)if(en[--t]._value===e._value){en.splice(t,1);return}}function Xr(e){return new L(cr,!1,e)}function ae(e,t){var n=M;return function(){var r=Er(),i=M;try{return Mt(n,!0),e.apply(this,arguments)}catch(o){t&&t(o)}finally{Mt(i,!1),r&&kr()}}}var ke={awaits:0,echoes:0,id:0},wv=0,ei=[],lo=0,wi=0,Sv=0;function Pt(e,t,n,r){var i=M,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++Sv;var a=kn.env;o.env=za?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject,nthen:iu(a.nthen,o),gthen:iu(a.gthen,o)}:{},t&&Le(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=jn(o,e,n,r);return o.ref===0&&o.finalize(),s}function Hn(){return ke.id||(ke.id=++wv),++ke.awaits,ke.echoes+=Lc,ke.id}function Et(){return ke.awaits?(--ke.awaits===0&&(ke.id=0),ke.echoes=ke.awaits*Lc,!0):!1}(""+Oc).indexOf("[native code]")===-1&&(Hn=Et=ee);function Si(e){return ke.echoes&&e&&e.constructor===Zr?(Hn(),e.then(function(t){return Et(),t},function(t){return Et(),_e(t)})):e}function Iv(e){++wi,(!ke.echoes||--ke.echoes===0)&&(ke.echoes=ke.id=0),ei.push(M),Mt(e,!0)}function Cv(){var e=ei[ei.length-1];ei.pop(),Mt(e,!1)}function Mt(e,t){var n=M;if((t?ke.echoes&&(!lo++||e!==M):lo&&(!--lo||e!==M))&&Vc(t?Iv.bind(null,e):Cv),e!==M&&(M=e,n===kn&&(kn.env=Fc()),za)){var r=kn.env.Promise,i=e.env;_i.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(re,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function Fc(){var e=re.Promise;return za?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(re,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:_i.then,gthen:e.prototype.then}:{}}function jn(e,t,n,r,i){var o=M;try{return Mt(e,!0),t(n,r,i)}finally{Mt(o,!1)}}function Vc(e){Oc.call(Ko,e)}function Ii(e,t,n,r){return typeof e!="function"?e:function(){var i=M;n&&Hn(),Mt(t,!0);try{return e.apply(this,arguments)}finally{Mt(i,!1),r&&Vc(Et)}}}function iu(e,t){return function(n,r){return e.call(this,Ii(n,t),Ii(r,t))}}var ou="unhandledrejection";function au(e,t){var n;try{n=t.onuncatched(e)}catch{}if(n!==!1)try{var r,i={promise:t,reason:e};if(re.document&&document.createEvent?(r=document.createEvent("Event"),r.initEvent(ou,!0,!0),Le(r,i)):re.CustomEvent&&(r=new CustomEvent(ou,{detail:i}),Le(r,i)),r&&re.dispatchEvent&&(dispatchEvent(r),!re.PromiseRejectionEvent&&re.onunhandledrejection))try{re.onunhandledrejection(r)}catch{}ct&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch{}}var _e=L.reject;function Yo(e,t,n,r){if(!e.idbdb||!e._state.openComplete&&!M.letThrough&&!e._vip){if(e._state.openComplete)return _e(new V.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return _e(new V.DatabaseClosed);e.open().catch(ee)}return e._state.dbReadyPromise.then(function(){return Yo(e,t,n,r)})}else{var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===Ha.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(function(){return Yo(e,t,n,r)})):_e(o)}return i._promise(t,function(o,a){return Pt(function(){return M.trans=i,r(o,a,i)})}).then(function(o){return i._completion.then(function(){return o})})}}var su="3.2.4",Zt=String.fromCharCode(65535),Zo=-1/0,ft="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bc="String expected.",nr=[],Hi=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Ev=Hi,kv=Hi,Kc=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},ji="__dbnames",co="readonly",fo="readwrite";function sn(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var Hc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Kr(e){return typeof e=="string"&&!/\./.test(e)?function(t){return t[e]===void 0&&e in t&&(t=Ir(t),delete t[e]),t}:function(t){return t}}var Av=function(){function e(){}return e.prototype._trans=function(t,n,r){var i=this._tx||M.trans,o=this.name;function a(u,c,l){if(!l.schema[o])throw new V.NotFound("Table "+o+" not part of transaction");return n(l.idbtrans,l)}var s=Er();try{return i&&i.db===this.db?i===M.trans?i._promise(t,a,r):Pt(function(){return i._promise(t,a,r)},{trans:i,transless:M.transless||M}):Yo(this.db,t,[this.name],a)}finally{s&&kr()}},e.prototype.get=function(t,n){var r=this;return t&&t.constructor===Object?this.where(t).first(n):this._trans("readonly",function(i){return r.core.get({trans:i,key:t}).then(function(o){return r.hook.reading.fire(o)})}).then(n)},e.prototype.where=function(t){if(typeof t=="string")return new this.db.WhereClause(this,t);if(Ae(t))return new this.db.WhereClause(this,"["+t.join("+")+"]");var n=me(t);if(n.length===1)return this.where(n[0]).equals(t[n[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter(function(l){return l.compound&&n.every(function(d){return l.keyPath.indexOf(d)>=0})&&l.keyPath.every(function(d){return n.indexOf(d)>=0})})[0];if(r&&this.db._maxKey!==Zt)return this.where(r.name).equals(r.keyPath.map(function(l){return t[l]}));!r&&ct&&console.warn("The query "+JSON.stringify(t)+" on "+this.name+" would benefit of a "+("compound index ["+n.join("+")+"]"));var i=this.schema.idxByName,o=this.db._deps.indexedDB;function a(l,d){try{return o.cmp(l,d)===0}catch{return!1}}var s=n.reduce(function(l,d){var p=l[0],f=l[1],h=i[d],m=t[d];return[p||h,p||!h?sn(f,h&&h.multi?function(g){var w=St(g,d);return Ae(w)&&w.some(function(y){return a(m,y)})}:function(g){return a(m,St(g,d))}):f]},[null,null]),u=s[0],c=s[1];return u?this.where(u.name).equals(t[u.keyPath]).filter(c):r?this.filter(c):this.where(n).equals("")},e.prototype.filter=function(t){return this.toCollection().and(t)},e.prototype.count=function(t){return this.toCollection().count(t)},e.prototype.offset=function(t){return this.toCollection().offset(t)},e.prototype.limit=function(t){return this.toCollection().limit(t)},e.prototype.each=function(t){return this.toCollection().each(t)},e.prototype.toArray=function(t){return this.toCollection().toArray(t)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(t){return new this.db.Collection(new this.db.WhereClause(this,Ae(t)?"["+t.join("+")+"]":t))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(t){this.schema.mappedClass=t;var n=function(r){if(!r)return r;var i=Object.create(t.prototype);for(var o in r)if(Be(r,o))try{i[o]=r[o]}catch{}return i};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),t},e.prototype.defineClass=function(){function t(n){Le(this,n)}return this.mapToClass(t)},e.prototype.add=function(t,n){var r=this,i=this.schema.primKey,o=i.auto,a=i.keyPath,s=t;return a&&o&&(s=Kr(a)(t)),this._trans("readwrite",function(u){return r.core.mutate({trans:u,type:"add",keys:n!=null?[n]:null,values:[s]})}).then(function(u){return u.numFailures?L.reject(u.failures[0]):u.lastResult}).then(function(u){if(a)try{tt(t,a,u)}catch{}return u})},e.prototype.update=function(t,n){if(typeof t=="object"&&!Ae(t)){var r=St(t,this.schema.primKey.keyPath);if(r===void 0)return _e(new V.InvalidArgument("Given object does not contain its primary key"));try{typeof n!="function"?me(n).forEach(function(i){tt(t,i,n[i])}):n(t,{value:t,primKey:r})}catch{}return this.where(":id").equals(r).modify(n)}else return this.where(":id").equals(t).modify(n)},e.prototype.put=function(t,n){var r=this,i=this.schema.primKey,o=i.auto,a=i.keyPath,s=t;return a&&o&&(s=Kr(a)(t)),this._trans("readwrite",function(u){return r.core.mutate({trans:u,type:"put",values:[s],keys:n!=null?[n]:null})}).then(function(u){return u.numFailures?L.reject(u.failures[0]):u.lastResult}).then(function(u){if(a)try{tt(t,a,u)}catch{}return u})},e.prototype.delete=function(t){var n=this;return this._trans("readwrite",function(r){return n.core.mutate({trans:r,type:"delete",keys:[t]})}).then(function(r){return r.numFailures?L.reject(r.failures[0]):void 0})},e.prototype.clear=function(){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"deleteRange",range:Hc})}).then(function(n){return n.numFailures?L.reject(n.failures[0]):void 0})},e.prototype.bulkGet=function(t){var n=this;return this._trans("readonly",function(r){return n.core.getMany({keys:t,trans:r}).then(function(i){return i.map(function(o){return n.hook.reading.fire(o)})})})},e.prototype.bulkAdd=function(t,n,r){var i=this,o=Array.isArray(n)?n:void 0;r=r||(o?void 0:n);var a=r?r.allKeys:void 0;return this._trans("readwrite",function(s){var u=i.schema.primKey,c=u.auto,l=u.keyPath;if(l&&o)throw new V.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new V.InvalidArgument("Arguments objects and keys must have the same length");var d=t.length,p=l&&c?t.map(Kr(l)):t;return i.core.mutate({trans:s,type:"add",keys:o,values:p,wantResults:a}).then(function(f){var h=f.numFailures,m=f.results,g=f.lastResult,w=f.failures,y=a?m:g;if(h===0)return y;throw new tr(i.name+".bulkAdd(): "+h+" of "+d+" operations failed",w)})})},e.prototype.bulkPut=function(t,n,r){var i=this,o=Array.isArray(n)?n:void 0;r=r||(o?void 0:n);var a=r?r.allKeys:void 0;return this._trans("readwrite",function(s){var u=i.schema.primKey,c=u.auto,l=u.keyPath;if(l&&o)throw new V.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new V.InvalidArgument("Arguments objects and keys must have the same length");var d=t.length,p=l&&c?t.map(Kr(l)):t;return i.core.mutate({trans:s,type:"put",keys:o,values:p,wantResults:a}).then(function(f){var h=f.numFailures,m=f.results,g=f.lastResult,w=f.failures,y=a?m:g;if(h===0)return y;throw new tr(i.name+".bulkPut(): "+h+" of "+d+" operations failed",w)})})},e.prototype.bulkDelete=function(t){var n=this,r=t.length;return this._trans("readwrite",function(i){return n.core.mutate({trans:i,type:"delete",keys:t})}).then(function(i){var o=i.numFailures,a=i.lastResult,s=i.failures;if(o===0)return a;throw new tr(n.name+".bulkDelete(): "+o+" of "+r+" operations failed",s)})},e}();function Ar(e){var t={},n=function(s,u){if(u){for(var c=arguments.length,l=new Array(c-1);--c;)l[c-1]=arguments[c];return t[s].subscribe.apply(null,l),e}else if(typeof s=="string")return t[s]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(s,u,c){if(typeof s=="object")return a(s);u||(u=pv),c||(c=ee);var l={subscribers:[],fire:c,subscribe:function(d){l.subscribers.indexOf(d)===-1&&(l.subscribers.push(d),l.fire=u(l.fire,d))},unsubscribe:function(d){l.subscribers=l.subscribers.filter(function(p){return p!==d}),l.fire=l.subscribers.reduce(u,c)}};return t[s]=n[s]=l,l}function a(s){me(s).forEach(function(u){var c=s[u];if(Ae(c))o(u,s[u][0],s[u][1]);else if(c==="asap")var l=o(u,Cr,function(){for(var p=arguments.length,f=new Array(p);p--;)f[p]=arguments[p];l.subscribers.forEach(function(h){Sc(function(){h.apply(null,f)})})});else throw new V.InvalidArgument("Invalid event config")})}}function xr(e,t){return Bn(t).from({prototype:e}),t}function xv(e){return xr(Av.prototype,function(n,r,i){this.db=e,this._tx=i,this.name=n,this.schema=r,this.hook=e._allTables[n]?e._allTables[n].hook:Ar(null,{creating:[cv,ee],reading:[lv,Cr],updating:[fv,ee],deleting:[dv,ee]})})}function gn(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function po(e,t){e.filter=sn(e.filter,t)}function ho(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return sn(r(),t())}:t,e.justLimit=n&&!r}function Tv(e,t){e.isMatch=sn(e.isMatch,t)}function ti(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new V.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function uu(e,t,n){var r=ti(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:r,range:e.range}})}function Hr(e,t,n,r){var i=e.replayFilter?sn(e.filter,e.replayFilter()):e.filter;if(e.or){var o={},a=function(s,u,c){if(!i||i(u,c,function(p){return u.stop(p)},function(p){return u.fail(p)})){var l=u.primaryKey,d=""+l;d==="[object ArrayBuffer]"&&(d=""+new Uint8Array(l)),Be(o,d)||(o[d]=!0,t(s,u,c))}};return Promise.all([e.or._iterate(a,n),lu(uu(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}else return lu(uu(e,r,n),sn(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function lu(e,t,n,r){var i=r?function(a,s,u){return n(r(a),s,u)}:n,o=ae(i);return e.then(function(a){if(a)return a.start(function(){var s=function(){return a.continue()};(!t||t(a,function(u){return s=u},function(u){a.stop(u),s=ee},function(u){a.fail(u),s=ee}))&&o(a.value,a,function(u){return s=u}),s()})})}function Re(e,t){try{var n=cu(e),r=cu(t);if(n!==r)return n==="Array"?1:r==="Array"?-1:n==="binary"?1:r==="binary"?-1:n==="string"?1:r==="string"?-1:n==="Date"?1:r!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return Lv(du(e),du(t));case"Array":return Rv(e,t)}}catch{}return NaN}function Rv(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o){var a=Re(e[o],t[o]);if(a!==0)return a}return n===r?0:n<r?-1:1}function Lv(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,o=0;o<i;++o)if(e[o]!==t[o])return e[o]<t[o]?-1:1;return n===r?0:n<r?-1:1}function cu(e){var t=typeof e;if(t!=="object")return t;if(ArrayBuffer.isView(e))return"binary";var n=Fo(e);return n==="ArrayBuffer"?"binary":n}function du(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var Ov=function(){function e(){}return e.prototype._read=function(t,n){var r=this._ctx;return r.error?r.table._trans(null,_e.bind(null,r.error)):r.table._trans("readonly",t).then(n)},e.prototype._write=function(t){var n=this._ctx;return n.error?n.table._trans(null,_e.bind(null,n.error)):n.table._trans("readwrite",t,"locked")},e.prototype._addAlgorithm=function(t){var n=this._ctx;n.algorithm=sn(n.algorithm,t)},e.prototype._iterate=function(t,n){return Hr(this._ctx,t,n,this._ctx.table.core)},e.prototype.clone=function(t){var n=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return t&&Le(r,t),n._ctx=r,n},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(t){var n=this._ctx;return this._read(function(r){return Hr(n,t,r,n.table.core)})},e.prototype.count=function(t){var n=this;return this._read(function(r){var i=n._ctx,o=i.table.core;if(gn(i,!0))return o.count({trans:r,query:{index:ti(i,o.schema),range:i.range}}).then(function(s){return Math.min(s,i.limit)});var a=0;return Hr(i,function(){return++a,!1},r,o).then(function(){return a})}).then(t)},e.prototype.sortBy=function(t,n){var r=t.split(".").reverse(),i=r[0],o=r.length-1;function a(c,l){return l?a(c[r[l]],l-1):c[i]}var s=this._ctx.dir==="next"?1:-1;function u(c,l){var d=a(c,o),p=a(l,o);return d<p?-s:d>p?s:0}return this.toArray(function(c){return c.sort(u)}).then(n)},e.prototype.toArray=function(t){var n=this;return this._read(function(r){var i=n._ctx;if(i.dir==="next"&&gn(i,!0)&&i.limit>0){var o=i.valueMapper,a=ti(i,i.table.core.schema);return i.table.core.query({trans:r,limit:i.limit,values:!0,query:{index:a,range:i.range}}).then(function(u){var c=u.result;return o?c.map(o):c})}else{var s=[];return Hr(i,function(u){return s.push(u)},r,i.table.core).then(function(){return s})}},t)},e.prototype.offset=function(t){var n=this._ctx;return t<=0?this:(n.offset+=t,gn(n)?ho(n,function(){var r=t;return function(i,o){return r===0?!0:r===1?(--r,!1):(o(function(){i.advance(r),r=0}),!1)}}):ho(n,function(){var r=t;return function(){return--r<0}}),this)},e.prototype.limit=function(t){return this._ctx.limit=Math.min(this._ctx.limit,t),ho(this._ctx,function(){var n=t;return function(r,i,o){return--n<=0&&i(o),n>=0}},!0),this},e.prototype.until=function(t,n){return po(this._ctx,function(r,i,o){return t(r.value)?(i(o),n):!0}),this},e.prototype.first=function(t){return this.limit(1).toArray(function(n){return n[0]}).then(t)},e.prototype.last=function(t){return this.reverse().first(t)},e.prototype.filter=function(t){return po(this._ctx,function(n){return t(n.value)}),Tv(this._ctx,t),this},e.prototype.and=function(t){return this.filter(t)},e.prototype.or=function(t){return new this.db.WhereClause(this._ctx.table,t,this)},e.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,i){t(i.key,i)})},e.prototype.eachUniqueKey=function(t){return this._ctx.unique="unique",this.eachKey(t)},e.prototype.eachPrimaryKey=function(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,i){t(i.primaryKey,i)})},e.prototype.keys=function(t){var n=this._ctx;n.keysOnly=!n.isMatch;var r=[];return this.each(function(i,o){r.push(o.key)}).then(function(){return r}).then(t)},e.prototype.primaryKeys=function(t){var n=this._ctx;if(n.dir==="next"&&gn(n,!0)&&n.limit>0)return this._read(function(i){var o=ti(n,n.table.core.schema);return n.table.core.query({trans:i,values:!1,limit:n.limit,query:{index:o,range:n.range}})}).then(function(i){var o=i.result;return o}).then(t);n.keysOnly=!n.isMatch;var r=[];return this.each(function(i,o){r.push(o.primaryKey)}).then(function(){return r}).then(t)},e.prototype.uniqueKeys=function(t){return this._ctx.unique="unique",this.keys(t)},e.prototype.firstKey=function(t){return this.limit(1).keys(function(n){return n[0]}).then(t)},e.prototype.lastKey=function(t){return this.reverse().firstKey(t)},e.prototype.distinct=function(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var r={};return po(this._ctx,function(i){var o=i.primaryKey.toString(),a=Be(r,o);return r[o]=!0,!a}),this},e.prototype.modify=function(t){var n=this,r=this._ctx;return this._write(function(i){var o;if(typeof t=="function")o=t;else{var a=me(t),s=a.length;o=function(w){for(var y=!1,v=0;v<s;++v){var b=a[v],_=t[b];St(w,b)!==_&&(tt(w,b,_),y=!0)}return y}}var u=r.table.core,c=u.schema.primaryKey,l=c.outbound,d=c.extractKey,p=n.db._options.modifyChunkSize||200,f=[],h=0,m=[],g=function(w,y){var v=y.failures,b=y.numFailures;h+=w-b;for(var _=0,C=me(v);_<C.length;_++){var k=C[_];f.push(v[k])}};return n.clone().primaryKeys().then(function(w){var y=function(v){var b=Math.min(p,w.length-v);return u.getMany({trans:i,keys:w.slice(v,v+b),cache:"immutable"}).then(function(_){for(var C=[],k=[],I=l?[]:null,E=[],x=0;x<b;++x){var N=_[x],F={value:Ir(N),primKey:w[v+x]};o.call(F,F.value,F)!==!1&&(F.value==null?E.push(w[v+x]):!l&&Re(d(N),d(F.value))!==0?(E.push(w[v+x]),C.push(F.value)):(k.push(F.value),l&&I.push(w[v+x])))}var P=gn(r)&&r.limit===1/0&&(typeof t!="function"||t===mo)&&{index:r.index,range:r.range};return Promise.resolve(C.length>0&&u.mutate({trans:i,type:"add",values:C}).then(function(T){for(var A in T.failures)E.splice(parseInt(A),1);g(C.length,T)})).then(function(){return(k.length>0||P&&typeof t=="object")&&u.mutate({trans:i,type:"put",keys:I,values:k,criteria:P,changeSpec:typeof t!="function"&&t}).then(function(T){return g(k.length,T)})}).then(function(){return(E.length>0||P&&t===mo)&&u.mutate({trans:i,type:"delete",keys:E,criteria:P}).then(function(T){return g(E.length,T)})}).then(function(){return w.length>v+b&&y(v+p)})})};return y(0).then(function(){if(f.length>0)throw new yi("Error modifying one or more objects",f,h,m);return w.length})})})},e.prototype.delete=function(){var t=this._ctx,n=t.range;return gn(t)&&(t.isPrimKey&&!kv||n.type===3)?this._write(function(r){var i=t.table.core.schema.primaryKey,o=n;return t.table.core.count({trans:r,query:{index:i,range:o}}).then(function(a){return t.table.core.mutate({trans:r,type:"deleteRange",range:o}).then(function(s){var u=s.failures;s.lastResult,s.results;var c=s.numFailures;if(c)throw new yi("Could not delete some values",Object.keys(u).map(function(l){return u[l]}),a-c);return a-c})})}):this.modify(mo)},e}(),mo=function(e,t){return t.value=null};function Nv(e){return xr(Ov.prototype,function(n,r){this.db=e;var i=Hc,o=null;if(r)try{i=r()}catch(c){o=c}var a=n._ctx,s=a.table,u=s.hook.reading.fire;this._ctx={table:s,index:a.index,isPrimKey:!a.index||s.schema.primKey.keyPath&&a.index===s.schema.primKey.name,range:i,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:o,or:a.or,valueMapper:u!==Cr?u:null}})}function Uv(e,t){return e<t?-1:e===t?0:1}function Dv(e,t){return e>t?-1:e===t?0:1}function Pe(e,t,n){var r=e instanceof Gc?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function vn(e){return new e.Collection(e,function(){return jc("")}).limit(0)}function Pv(e){return e==="next"?function(t){return t.toUpperCase()}:function(t){return t.toLowerCase()}}function Mv(e){return e==="next"?function(t){return t.toLowerCase()}:function(t){return t.toUpperCase()}}function Fv(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,u=0;u<a;++u){var c=t[u];if(c!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[u],c)<0&&(s=u)}return a<r.length&&o==="next"?e+n.substr(e.length):a<e.length&&o==="prev"?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function jr(e,t,n,r){var i,o,a,s,u,c,l,d=n.length;if(!n.every(function(m){return typeof m=="string"}))return Pe(e,Bc);function p(m){i=Pv(m),o=Mv(m),a=m==="next"?Uv:Dv;var g=n.map(function(w){return{lower:o(w),upper:i(w)}}).sort(function(w,y){return a(w.lower,y.lower)});s=g.map(function(w){return w.upper}),u=g.map(function(w){return w.lower}),c=m,l=m==="next"?"":r}p("next");var f=new e.Collection(e,function(){return Tt(s[0],u[d-1]+r)});f._ondirectionchange=function(m){p(m)};var h=0;return f._addAlgorithm(function(m,g,w){var y=m.key;if(typeof y!="string")return!1;var v=o(y);if(t(v,u,h))return!0;for(var b=null,_=h;_<d;++_){var C=Fv(y,v,s[_],u[_],a,c);C===null&&b===null?h=_+1:(b===null||a(b,C)>0)&&(b=C)}return g(b!==null?function(){m.continue(b+l)}:w),!1}),f}function Tt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function jc(e){return{type:1,lower:e,upper:e}}var Gc=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(t,n,r,i){r=r!==!1,i=i===!0;try{return this._cmp(t,n)>0||this._cmp(t,n)===0&&(r||i)&&!(r&&i)?vn(this):new this.Collection(this,function(){return Tt(t,n,!r,!i)})}catch{return Pe(this,ft)}},e.prototype.equals=function(t){return t==null?Pe(this,ft):new this.Collection(this,function(){return jc(t)})},e.prototype.above=function(t){return t==null?Pe(this,ft):new this.Collection(this,function(){return Tt(t,void 0,!0)})},e.prototype.aboveOrEqual=function(t){return t==null?Pe(this,ft):new this.Collection(this,function(){return Tt(t,void 0,!1)})},e.prototype.below=function(t){return t==null?Pe(this,ft):new this.Collection(this,function(){return Tt(void 0,t,!1,!0)})},e.prototype.belowOrEqual=function(t){return t==null?Pe(this,ft):new this.Collection(this,function(){return Tt(void 0,t)})},e.prototype.startsWith=function(t){return typeof t!="string"?Pe(this,Bc):this.between(t,t+Zt,!0,!0)},e.prototype.startsWithIgnoreCase=function(t){return t===""?this.startsWith(t):jr(this,function(n,r){return n.indexOf(r[0])===0},[t],Zt)},e.prototype.equalsIgnoreCase=function(t){return jr(this,function(n,r){return n===r[0]},[t],"")},e.prototype.anyOfIgnoreCase=function(){var t=gt.apply(_n,arguments);return t.length===0?vn(this):jr(this,function(n,r){return r.indexOf(n)!==-1},t,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var t=gt.apply(_n,arguments);return t.length===0?vn(this):jr(this,function(n,r){return r.some(function(i){return n.indexOf(i)===0})},t,Zt)},e.prototype.anyOf=function(){var t=this,n=gt.apply(_n,arguments),r=this._cmp;try{n.sort(r)}catch{return Pe(this,ft)}if(n.length===0)return vn(this);var i=new this.Collection(this,function(){return Tt(n[0],n[n.length-1])});i._ondirectionchange=function(a){r=a==="next"?t._ascending:t._descending,n.sort(r)};var o=0;return i._addAlgorithm(function(a,s,u){for(var c=a.key;r(c,n[o])>0;)if(++o,o===n.length)return s(u),!1;return r(c,n[o])===0?!0:(s(function(){a.continue(n[o])}),!1)}),i},e.prototype.notEqual=function(t){return this.inAnyRange([[Zo,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var t=gt.apply(_n,arguments);if(t.length===0)return new this.Collection(this);try{t.sort(this._ascending)}catch{return Pe(this,ft)}var n=t.reduce(function(r,i){return r?r.concat([[r[r.length-1][1],i]]):[[Zo,i]]},null);return n.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(t,n){var r=this,i=this._cmp,o=this._ascending,a=this._descending,s=this._min,u=this._max;if(t.length===0)return vn(this);if(!t.every(function(_){return _[0]!==void 0&&_[1]!==void 0&&o(_[0],_[1])<=0}))return Pe(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",V.InvalidArgument);var c=!n||n.includeLowers!==!1,l=n&&n.includeUppers===!0;function d(_,C){for(var k=0,I=_.length;k<I;++k){var E=_[k];if(i(C[0],E[1])<0&&i(C[1],E[0])>0){E[0]=s(E[0],C[0]),E[1]=u(E[1],C[1]);break}}return k===I&&_.push(C),_}var p=o;function f(_,C){return p(_[0],C[0])}var h;try{h=t.reduce(d,[]),h.sort(f)}catch{return Pe(this,ft)}var m=0,g=l?function(_){return o(_,h[m][1])>0}:function(_){return o(_,h[m][1])>=0},w=c?function(_){return a(_,h[m][0])>0}:function(_){return a(_,h[m][0])>=0};function y(_){return!g(_)&&!w(_)}var v=g,b=new this.Collection(this,function(){return Tt(h[0][0],h[h.length-1][1],!c,!l)});return b._ondirectionchange=function(_){_==="next"?(v=g,p=o):(v=w,p=a),h.sort(f)},b._addAlgorithm(function(_,C,k){for(var I=_.key;v(I);)if(++m,m===h.length)return C(k),!1;return y(I)?!0:(r._cmp(I,h[m][1])===0||r._cmp(I,h[m][0])===0||C(function(){p===o?_.continue(h[m][0]):_.continue(h[m][1])}),!1)}),b},e.prototype.startsWithAnyOf=function(){var t=gt.apply(_n,arguments);return t.every(function(n){return typeof n=="string"})?t.length===0?vn(this):this.inAnyRange(t.map(function(n){return[n,n+Zt]})):Pe(this,"startsWithAnyOf() only works with strings")},e}();function Vv(e){return xr(Gc.prototype,function(n,r,i){this.db=e,this._ctx={table:n,index:r===":id"?null:r,or:i};var o=e._deps.indexedDB;if(!o)throw new V.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(a,s){return o.cmp(s,a)},this._max=function(a,s){return o.cmp(a,s)>0?a:s},this._min=function(a,s){return o.cmp(a,s)<0?a:s},this._IDBKeyRange=e._deps.IDBKeyRange})}function ot(e){return ae(function(t){return fr(t),e(t.target.error),!1})}function fr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var pr="storagemutated",Ut="x-storagemutated-1",Ft=Ar(null,pr),Bv=function(){function e(){}return e.prototype._lock=function(){return $n(!M.global),++this._reculock,this._reculock===1&&!M.global&&(M.lockOwnerFor=this),this},e.prototype._unlock=function(){if($n(!M.global),--this._reculock===0)for(M.global||(M.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{jn(t[1],t[0])}catch{}}return this},e.prototype._locked=function(){return this._reculock&&M.lockOwnerFor!==this},e.prototype.create=function(t){var n=this;if(!this.mode)return this;var r=this.db.idbdb,i=this.db._state.dbOpenError;if($n(!this.idbtrans),!t&&!r)switch(i&&i.name){case"DatabaseClosedError":throw new V.DatabaseClosed(i);case"MissingAPIError":throw new V.MissingAPI(i.message,i);default:throw new V.OpenFailed(i)}if(!this.active)throw new V.TransactionInactive;return $n(this._completion._state===null),t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):r.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})),t.onerror=ae(function(o){fr(o),n._reject(t.error)}),t.onabort=ae(function(o){fr(o),n.active&&n._reject(new V.Abort(t.error)),n.active=!1,n.on("abort").fire(o)}),t.oncomplete=ae(function(){n.active=!1,n._resolve(),"mutatedParts"in t&&Ft.storagemutated.fire(t.mutatedParts)}),this},e.prototype._promise=function(t,n,r){var i=this;if(t==="readwrite"&&this.mode!=="readwrite")return _e(new V.ReadOnly("Transaction is readonly"));if(!this.active)return _e(new V.TransactionInactive);if(this._locked())return new L(function(a,s){i._blockedFuncs.push([function(){i._promise(t,n,r).then(a,s)},M])});if(r)return Pt(function(){var a=new L(function(s,u){i._lock();var c=n(s,u,i);c&&c.then&&c.then(s,u)});return a.finally(function(){return i._unlock()}),a._lib=!0,a});var o=new L(function(a,s){var u=n(a,s,i);u&&u.then&&u.then(a,s)});return o._lib=!0,o},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(t){var n=this._root(),r=L.resolve(t);if(n._waitingFor)n._waitingFor=n._waitingFor.then(function(){return r});else{n._waitingFor=r,n._waitingQueue=[];var i=n.idbtrans.objectStore(n.storeNames[0]);(function a(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(i.get(-1/0).onsuccess=a)})()}var o=n._waitingFor;return new L(function(a,s){r.then(function(u){return n._waitingQueue.push(ae(a.bind(null,u)))},function(u){return n._waitingQueue.push(ae(s.bind(null,u)))}).finally(function(){n._waitingFor===o&&(n._waitingFor=null)})})},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new V.Abort))},e.prototype.table=function(t){var n=this._memoizedTables||(this._memoizedTables={});if(Be(n,t))return n[t];var r=this.schema[t];if(!r)throw new V.NotFound("Table "+t+" not part of transaction");var i=new this.db.Table(t,r,this);return i.core=this.db.core.table(t),n[t]=i,i},e}();function Kv(e){return xr(Bv.prototype,function(n,r,i,o,a){var s=this;this.db=e,this.mode=n,this.storeNames=r,this.schema=i,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Ar(this,"complete","error","abort"),this.parent=a||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L(function(u,c){s._resolve=u,s._reject=c}),this._completion.then(function(){s.active=!1,s.on.complete.fire()},function(u){var c=s.active;return s.active=!1,s.on.error.fire(u),s.parent?s.parent._reject(u):c&&s.idbtrans&&s.idbtrans.abort(),_e(u)})})}function Qo(e,t,n,r,i,o,a){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+zc(t)}}function zc(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function Wc(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Ic(n,function(r){return[r.name,r]})}}function Hv(e){return e.length===1?e[0]:e}var hr=function(e){try{return e.only([[]]),hr=function(){return[[]]},[[]]}catch{return hr=function(){return Zt},Zt}};function Jo(e){return e==null?function(){}:typeof e=="string"?jv(e):function(t){return St(t,e)}}function jv(e){var t=e.split(".");return t.length===1?function(n){return n[e]}:function(n){return St(n,e)}}function fu(e){return[].slice.call(e)}var Gv=0;function rr(e){return e==null?":id":typeof e=="string"?e:"["+e.join("+")+"]"}function zv(e,t,n){function r(d,p){var f=fu(d.objectStoreNames);return{schema:{name:d.name,tables:f.map(function(h){return p.objectStore(h)}).map(function(h){var m=h.keyPath,g=h.autoIncrement,w=Ae(m),y=m==null,v={},b={name:h.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:y,compound:w,keyPath:m,autoIncrement:g,unique:!0,extractKey:Jo(m)},indexes:fu(h.indexNames).map(function(_){return h.index(_)}).map(function(_){var C=_.name,k=_.unique,I=_.multiEntry,E=_.keyPath,x=Ae(E),N={name:C,compound:x,keyPath:E,unique:k,multiEntry:I,extractKey:Jo(E)};return v[rr(E)]=N,N}),getIndexByKeyPath:function(_){return v[rr(_)]}};return v[":id"]=b.primaryKey,m!=null&&(v[rr(m)]=b.primaryKey),b})},hasGetAll:f.length>0&&"getAll"in p.objectStore(f[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}function i(d){if(d.type===3)return null;if(d.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var p=d.lower,f=d.upper,h=d.lowerOpen,m=d.upperOpen,g=p===void 0?f===void 0?null:t.upperBound(f,!!m):f===void 0?t.lowerBound(p,!!h):t.bound(p,f,!!h,!!m);return g}function o(d){var p=d.name;function f(g){var w=g.trans,y=g.type,v=g.keys,b=g.values,_=g.range;return new Promise(function(C,k){C=ae(C);var I=w.objectStore(p),E=I.keyPath==null,x=y==="put"||y==="add";if(!x&&y!=="delete"&&y!=="deleteRange")throw new Error("Invalid operation type: "+y);var N=(v||b||{length:1}).length;if(v&&b&&v.length!==b.length)throw new Error("Given keys array must have same length as given values array.");if(N===0)return C({numFailures:0,failures:{},results:[],lastResult:void 0});var F,P=[],T=[],A=0,U=function(q){++A,fr(q)};if(y==="deleteRange"){if(_.type===4)return C({numFailures:A,failures:T,results:[],lastResult:void 0});_.type===3?P.push(F=I.clear()):P.push(F=I.delete(i(_)))}else{var W=x?E?[b,v]:[b,null]:[v,null],se=W[0],J=W[1];if(x)for(var ne=0;ne<N;++ne)P.push(F=J&&J[ne]!==void 0?I[y](se[ne],J[ne]):I[y](se[ne])),F.onerror=U;else for(var ne=0;ne<N;++ne)P.push(F=I[y](se[ne])),F.onerror=U}var ce=function(q){var Ke=q.target.result;P.forEach(function(Se,dt){return Se.error!=null&&(T[dt]=Se.error)}),C({numFailures:A,failures:T,results:y==="delete"?v:P.map(function(Se){return Se.result}),lastResult:Ke})};F.onerror=function(q){U(q),ce(q)},F.onsuccess=ce})}function h(g){var w=g.trans,y=g.values,v=g.query,b=g.reverse,_=g.unique;return new Promise(function(C,k){C=ae(C);var I=v.index,E=v.range,x=w.objectStore(p),N=I.isPrimaryKey?x:x.index(I.name),F=b?_?"prevunique":"prev":_?"nextunique":"next",P=y||!("openKeyCursor"in N)?N.openCursor(i(E),F):N.openKeyCursor(i(E),F);P.onerror=ot(k),P.onsuccess=ae(function(T){var A=P.result;if(!A){C(null);return}A.___id=++Gv,A.done=!1;var U=A.continue.bind(A),W=A.continuePrimaryKey;W&&(W=W.bind(A));var se=A.advance.bind(A),J=function(){throw new Error("Cursor not started")},ne=function(){throw new Error("Cursor not stopped")};A.trans=w,A.stop=A.continue=A.continuePrimaryKey=A.advance=J,A.fail=ae(k),A.next=function(){var ce=this,q=1;return this.start(function(){return q--?ce.continue():ce.stop()}).then(function(){return ce})},A.start=function(ce){var q=new Promise(function(Se,dt){Se=ae(Se),P.onerror=ot(dt),A.fail=dt,A.stop=function(De){A.stop=A.continue=A.continuePrimaryKey=A.advance=ne,Se(De)}}),Ke=function(){if(P.result)try{ce()}catch(Se){A.fail(Se)}else A.done=!0,A.start=function(){throw new Error("Cursor behind last entry")},A.stop()};return P.onsuccess=ae(function(Se){P.onsuccess=Ke,Ke()}),A.continue=U,A.continuePrimaryKey=W,A.advance=se,Ke(),q},C(A)},k)})}function m(g){return function(w){return new Promise(function(y,v){y=ae(y);var b=w.trans,_=w.values,C=w.limit,k=w.query,I=C===1/0?void 0:C,E=k.index,x=k.range,N=b.objectStore(p),F=E.isPrimaryKey?N:N.index(E.name),P=i(x);if(C===0)return y({result:[]});if(g){var T=_?F.getAll(P,I):F.getAllKeys(P,I);T.onsuccess=function(se){return y({result:se.target.result})},T.onerror=ot(v)}else{var A=0,U=_||!("openKeyCursor"in F)?F.openCursor(P):F.openKeyCursor(P),W=[];U.onsuccess=function(se){var J=U.result;if(!J)return y({result:W});if(W.push(_?J.value:J.primaryKey),++A===C)return y({result:W});J.continue()},U.onerror=ot(v)}})}}return{name:p,schema:d,mutate:f,getMany:function(g){var w=g.trans,y=g.keys;return new Promise(function(v,b){v=ae(v);for(var _=w.objectStore(p),C=y.length,k=new Array(C),I=0,E=0,x,N=function(A){var U=A.target;(k[U._pos]=U.result)!=null,++E===I&&v(k)},F=ot(b),P=0;P<C;++P){var T=y[P];T!=null&&(x=_.get(y[P]),x._pos=P,x.onsuccess=N,x.onerror=F,++I)}I===0&&v(k)})},get:function(g){var w=g.trans,y=g.key;return new Promise(function(v,b){v=ae(v);var _=w.objectStore(p),C=_.get(y);C.onsuccess=function(k){return v(k.target.result)},C.onerror=ot(b)})},query:m(u),openCursor:h,count:function(g){var w=g.query,y=g.trans,v=w.index,b=w.range;return new Promise(function(_,C){var k=y.objectStore(p),I=v.isPrimaryKey?k:k.index(v.name),E=i(b),x=E?I.count(E):I.count();x.onsuccess=ae(function(N){return _(N.target.result)}),x.onerror=ot(C)})}}}var a=r(e,n),s=a.schema,u=a.hasGetAll,c=s.tables.map(function(d){return o(d)}),l={};return c.forEach(function(d){return l[d.name]=d}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(d){var p=l[d];if(!p)throw new Error("Table '"+d+"' not found");return l[d]},MIN_KEY:-1/0,MAX_KEY:hr(t),schema:s}}function Wv(e,t){return t.reduce(function(n,r){var i=r.create;return j(j({},n),i(n))},e)}function qv(e,t,n,r){var i=n.IDBKeyRange;n.indexedDB;var o=Wv(zv(t,i,r),e.dbcore);return{dbcore:o}}function $a(e,t){var n=e._novip,r=t.db,i=qv(n._middlewares,r,n._deps,t);n.core=i.dbcore,n.tables.forEach(function(o){var a=o.name;n.core.schema.tables.some(function(s){return s.name===a})&&(o.core=n.core.table(a),n[a]instanceof n.Table&&(n[a].core=o.core))})}function Ci(e,t,n,r){var i=e._novip;n.forEach(function(o){var a=r[o];t.forEach(function(s){var u=Va(s,o);(!u||"value"in u&&u.value===void 0)&&(s===i.Transaction.prototype||s instanceof i.Transaction?Ct(s,o,{get:function(){return this.table(o)},set:function(c){bc(this,o,{value:c,writable:!0,configurable:!0,enumerable:!0})}}):s[o]=new i.Table(o,a))})})}function Xo(e,t){var n=e._novip;t.forEach(function(r){for(var i in r)r[i]instanceof n.Table&&delete r[i]})}function $v(e,t){return e._cfg.version-t._cfg.version}function Yv(e,t,n,r){var i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(n),o._completion.catch(r);var a=o._reject.bind(o),s=M.transless||M;Pt(function(){M.trans=o,M.transless=s,t===0?(me(i).forEach(function(u){Ya(n,u,i[u].primKey,i[u].indexes)}),$a(e,n),L.follow(function(){return e.on.populate.fire(o)}).catch(a)):Zv(e,t,o,n).catch(a)})}function Zv(e,t,n,r){var i=e._novip,o=[],a=i._versions,s=i._dbSchema=Za(i,i.idbdb,r),u=!1,c=a.filter(function(d){return d._cfg.version>=t});c.forEach(function(d){o.push(function(){var p=s,f=d._cfg.dbschema;ta(i,p,r),ta(i,f,r),s=i._dbSchema=f;var h=qc(p,f);h.add.forEach(function(b){Ya(r,b[0],b[1].primKey,b[1].indexes)}),h.change.forEach(function(b){if(b.recreate)throw new V.Upgrade("Not yet support for changing primary key");var _=r.objectStore(b.name);b.add.forEach(function(C){return ea(_,C)}),b.change.forEach(function(C){_.deleteIndex(C.name),ea(_,C)}),b.del.forEach(function(C){return _.deleteIndex(C)})});var m=d._cfg.contentUpgrade;if(m&&d._cfg.version>t){$a(i,r),n._memoizedTables={},u=!0;var g=Cc(f);h.del.forEach(function(b){g[b]=p[b]}),Xo(i,[i.Transaction.prototype]),Ci(i,[i.Transaction.prototype],me(g),g),n.schema=g;var w=Ba(m);w&&Hn();var y,v=L.follow(function(){if(y=m(n),y&&w){var b=Et.bind(null,null);y.then(b,b)}});return y&&typeof y.then=="function"?L.resolve(y):v.then(function(){return y})}}),o.push(function(p){if(!u||!Ev){var f=d._cfg.dbschema;Jv(f,p)}Xo(i,[i.Transaction.prototype]),Ci(i,[i.Transaction.prototype],i._storeNames,i._dbSchema),n.schema=i._dbSchema})});function l(){return o.length?L.resolve(o.shift()(n.idbtrans)).then(l):L.resolve()}return l().then(function(){Qv(s,r)})}function qc(e,t){var n={del:[],add:[],change:[]},r;for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(!i)n.add.push([r,o]);else{var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!Hi)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,u=o.idxByName,c=void 0;for(c in s)u[c]||a.del.push(c);for(c in u){var l=s[c],d=u[c];l?l.src!==d.src&&a.change.push(d):a.add.push(d)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}}return n}function Ya(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(o){return ea(i,o)}),i}function Qv(e,t){me(e).forEach(function(n){t.db.objectStoreNames.contains(n)||Ya(t,n,e[n].primKey,e[n].indexes)})}function Jv(e,t){[].slice.call(t.db.objectStoreNames).forEach(function(n){return e[n]==null&&t.db.deleteObjectStore(n)})}function ea(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Za(e,t,n){var r={},i=Bi(t.objectStoreNames,0);return i.forEach(function(o){for(var a=n.objectStore(o),s=a.keyPath,u=Qo(zc(s),s||"",!1,!1,!!a.autoIncrement,s&&typeof s!="string",!0),c=[],l=0;l<a.indexNames.length;++l){var d=a.index(a.indexNames[l]);s=d.keyPath;var p=Qo(d.name,s,!!d.unique,!!d.multiEntry,!1,s&&typeof s!="string",!1);c.push(p)}r[o]=Wc(o,u,c)}),r}function Xv(e,t,n){var r=e._novip;r.verno=t.version/10;var i=r._dbSchema=Za(r,t,n);r._storeNames=Bi(t.objectStoreNames,0),Ci(r,[r._allTables],me(i),i)}function ey(e,t){var n=Za(e,e.idbdb,t),r=qc(n,e._dbSchema);return!(r.add.length||r.change.some(function(i){return i.add.length||i.change.length}))}function ta(e,t,n){for(var r=e._novip,i=n.db.objectStoreNames,o=0;o<i.length;++o){var a=i[o],s=n.objectStore(a);r._hasGetAll="getAll"in s;for(var u=0;u<s.indexNames.length;++u){var c=s.indexNames[u],l=s.index(c).keyPath,d=typeof l=="string"?l:"["+Bi(l).join("+")+"]";if(t[a]){var p=t[a].idxByName[d];p&&(p.name=c,delete t[a].idxByName[d],t[a].idxByName[c]=p)}}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&re.WorkerGlobalScope&&re instanceof re.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function ty(e){return e.split(",").map(function(t,n){t=t.trim();var r=t.replace(/([&*]|\+\+)/g,""),i=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return Qo(r,i||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),Ae(i),n===0)})}var ny=function(){function e(){}return e.prototype._parseStoresSpec=function(t,n){me(t).forEach(function(r){if(t[r]!==null){var i=ty(t[r]),o=i.shift();if(o.multi)throw new V.Schema("Primary key cannot be multi-valued");i.forEach(function(a){if(a.auto)throw new V.Schema("Only primary key can be marked as autoIncrement (++)");if(!a.keyPath)throw new V.Schema("Index must have a name and cannot be an empty string")}),n[r]=Wc(r,o,i)}})},e.prototype.stores=function(t){var n=this.db;this._cfg.storesSource=this._cfg.storesSource?Le(this._cfg.storesSource,t):t;var r=n._versions,i={},o={};return r.forEach(function(a){Le(i,a._cfg.storesSource),o=a._cfg.dbschema={},a._parseStoresSpec(i,o)}),n._dbSchema=o,Xo(n,[n._allTables,n,n.Transaction.prototype]),Ci(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],me(o),o),n._storeNames=me(o),this},e.prototype.upgrade=function(t){return this._cfg.contentUpgrade=ja(this._cfg.contentUpgrade||ee,t),this},e}();function ry(e){return xr(ny.prototype,function(n){this.db=e,this._cfg={version:n,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}function Qa(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new ts(ji,{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Ja(e){return e&&typeof e.databases=="function"}function iy(e){var t=e.indexedDB,n=e.IDBKeyRange;return Ja(t)?Promise.resolve(t.databases()).then(function(r){return r.map(function(i){return i.name}).filter(function(i){return i!==ji})}):Qa(t,n).toCollection().primaryKeys()}function oy(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!Ja(n)&&t!==ji&&Qa(n,r).put({name:t}).catch(ee)}function ay(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!Ja(n)&&t!==ji&&Qa(n,r).delete(t).catch(ee)}function na(e){return Pt(function(){return M.letThrough=!0,e()})}function sy(){var e=!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent);if(!e||!indexedDB.databases)return Promise.resolve();var t;return new Promise(function(n){var r=function(){return indexedDB.databases().finally(n)};t=setInterval(r,100),r()}).finally(function(){return clearInterval(t)})}function uy(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?_e(t.dbOpenError):e});ct&&(t.openCanceller._stackHolder=cn()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller;function i(){if(t.openCanceller!==r)throw new V.DatabaseClosed("db.open() was cancelled")}var o=t.dbReadyResolve,a=null,s=!1;return L.race([r,(typeof navigator>"u"?L.resolve():sy()).then(function(){return new L(function(u,c){if(i(),!n)throw new V.MissingAPI;var l=e.name,d=t.autoSchema?n.open(l):n.open(l,Math.round(e.verno*10));if(!d)throw new V.MissingAPI;d.onerror=ot(c),d.onblocked=ae(e._fireOnBlocked),d.onupgradeneeded=ae(function(p){if(a=d.transaction,t.autoSchema&&!e._options.allowEmptyDB){d.onerror=fr,a.abort(),d.result.close();var f=n.deleteDatabase(l);f.onsuccess=f.onerror=ae(function(){c(new V.NoSuchDatabase("Database "+l+" doesnt exist"))})}else{a.onerror=ot(c);var h=p.oldVersion>Math.pow(2,62)?0:p.oldVersion;s=h<1,e._novip.idbdb=d.result,Yv(e,h/10,a,c)}},c),d.onsuccess=ae(function(){a=null;var p=e._novip.idbdb=d.result,f=Bi(p.objectStoreNames);if(f.length>0)try{var h=p.transaction(Hv(f),"readonly");t.autoSchema?Xv(e,p,h):(ta(e,e._dbSchema,h),ey(e,h)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),$a(e,h)}catch{}nr.push(e),p.onversionchange=ae(function(m){t.vcFired=!0,e.on("versionchange").fire(m)}),p.onclose=ae(function(m){e.on("close").fire(m)}),s&&oy(e._deps,l),u()},c)})})]).then(function(){return i(),t.onReadyBeingFired=[],L.resolve(na(function(){return e.on.ready.fire(e.vip)})).then(function u(){if(t.onReadyBeingFired.length>0){var c=t.onReadyBeingFired.reduce(ja,ee);return t.onReadyBeingFired=[],L.resolve(na(function(){return c(e.vip)})).then(u)}})}).finally(function(){t.onReadyBeingFired=null,t.isBeingOpened=!1}).then(function(){return e}).catch(function(u){t.dbOpenError=u;try{a&&a.abort()}catch{}return r===t.openCanceller&&e._close(),_e(u)}).finally(function(){t.openComplete=!0,o()})}function ra(e){var t=function(a){return e.next(a)},n=function(a){return e.throw(a)},r=o(t),i=o(n);function o(a){return function(s){var u=a(s),c=u.value;return u.done?c:!c||typeof c.then!="function"?Ae(c)?Promise.all(c).then(r,i):r(c):c.then(r,i)}}return o(t)()}function ly(e,t,n){var r=arguments.length;if(r<2)throw new V.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=Ec(i);return[e,o,n]}function $c(e,t,n,r,i){return L.resolve().then(function(){var o=M.transless||M,a=e._createTransaction(t,n,e._dbSchema,r),s={trans:a,transless:o};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(d){return d.name===Ha.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(function(){return $c(e,t,n,null,i)})):_e(d)}var u=Ba(i);u&&Hn();var c,l=L.follow(function(){if(c=i.call(a,a),c)if(u){var d=Et.bind(null,null);c.then(d,d)}else typeof c.next=="function"&&typeof c.throw=="function"&&(c=ra(c))},s);return(c&&typeof c.then=="function"?L.resolve(c).then(function(d){return a.active?d:_e(new V.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):l.then(function(){return c})).then(function(d){return r&&a._resolve(),a._completion.then(function(){return d})}).catch(function(d){return a._reject(d),_e(d)})})}function Gr(e,t,n){for(var r=Ae(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}function cy(e){return j(j({},e),{table:function(t){var n=e.table(t),r=n.schema,i={},o=[];function a(m,g,w){var y=rr(m),v=i[y]=i[y]||[],b=m==null?0:typeof m=="string"?1:m.length,_=g>0,C=j(j({},w),{isVirtual:_,keyTail:g,keyLength:b,extractKey:Jo(m),unique:!_&&w.unique});if(v.push(C),C.isPrimaryKey||o.push(C),b>1){var k=b===2?m[0]:m.slice(0,b-1);a(k,g+1,w)}return v.sort(function(I,E){return I.keyTail-E.keyTail}),C}var s=a(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[s];for(var u=0,c=r.indexes;u<c.length;u++){var l=c[u];a(l.keyPath,0,l)}function d(m){var g=i[rr(m)];return g&&g[0]}function p(m,g){return{type:m.type===1?2:m.type,lower:Gr(m.lower,m.lowerOpen?e.MAX_KEY:e.MIN_KEY,g),lowerOpen:!0,upper:Gr(m.upper,m.upperOpen?e.MIN_KEY:e.MAX_KEY,g),upperOpen:!0}}function f(m){var g=m.query.index;return g.isVirtual?j(j({},m),{query:{index:g,range:p(m.query.range,g.keyTail)}}):m}var h=j(j({},n),{schema:j(j({},r),{primaryKey:s,indexes:o,getIndexByKeyPath:d}),count:function(m){return n.count(f(m))},query:function(m){return n.query(f(m))},openCursor:function(m){var g=m.query.index,w=g.keyTail,y=g.isVirtual,v=g.keyLength;if(!y)return n.openCursor(m);function b(_){function C(I){I!=null?_.continue(Gr(I,m.reverse?e.MAX_KEY:e.MIN_KEY,w)):m.unique?_.continue(_.key.slice(0,v).concat(m.reverse?e.MIN_KEY:e.MAX_KEY,w)):_.continue()}var k=Object.create(_,{continue:{value:C},continuePrimaryKey:{value:function(I,E){_.continuePrimaryKey(Gr(I,e.MAX_KEY,w),E)}},primaryKey:{get:function(){return _.primaryKey}},key:{get:function(){var I=_.key;return v===1?I[0]:I.slice(0,v)}},value:{get:function(){return _.value}}});return k}return n.openCursor(f(m)).then(function(_){return _&&b(_)})}});return h}})}var dy={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:cy};function Xa(e,t,n,r){return n=n||{},r=r||"",me(e).forEach(function(i){if(!Be(t,i))n[r+i]=void 0;else{var o=e[i],a=t[i];if(typeof o=="object"&&typeof a=="object"&&o&&a){var s=Fo(o),u=Fo(a);s!==u?n[r+i]=t[i]:s==="Object"?Xa(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i])}else o!==a&&(n[r+i]=t[i])}}),me(t).forEach(function(i){Be(e,i)||(n[r+i]=t[i])}),n}function fy(e,t){return t.type==="delete"?t.keys:t.keys||t.values.map(e.extractKey)}var py={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return j(j({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey,i=j(j({},n),{mutate:function(o){var a=M.trans,s=a.table(t).hook,u=s.deleting,c=s.creating,l=s.updating;switch(o.type){case"add":if(c.fire===ee)break;return a._promise("readwrite",function(){return d(o)},!0);case"put":if(c.fire===ee&&l.fire===ee)break;return a._promise("readwrite",function(){return d(o)},!0);case"delete":if(u.fire===ee)break;return a._promise("readwrite",function(){return d(o)},!0);case"deleteRange":if(u.fire===ee)break;return a._promise("readwrite",function(){return p(o)},!0)}return n.mutate(o);function d(h){var m=M.trans,g=h.keys||fy(r,h);if(!g)throw new Error("Keys missing");return h=h.type==="add"||h.type==="put"?j(j({},h),{keys:g}):j({},h),h.type!=="delete"&&(h.values=Po([],h.values,!0)),h.keys&&(h.keys=Po([],h.keys,!0)),hy(n,h,g).then(function(w){var y=g.map(function(v,b){var _=w[b],C={onerror:null,onsuccess:null};if(h.type==="delete")u.fire.call(C,v,_,m);else if(h.type==="add"||_===void 0){var k=c.fire.call(C,v,h.values[b],m);v==null&&k!=null&&(v=k,h.keys[b]=v,r.outbound||tt(h.values[b],r.keyPath,v))}else{var I=Xa(_,h.values[b]),E=l.fire.call(C,I,v,_,m);if(E){var x=h.values[b];Object.keys(E).forEach(function(N){Be(x,N)?x[N]=E[N]:tt(x,N,E[N])})}}return C});return n.mutate(h).then(function(v){for(var b=v.failures,_=v.results,C=v.numFailures,k=v.lastResult,I=0;I<g.length;++I){var E=_?_[I]:g[I],x=y[I];E==null?x.onerror&&x.onerror(b[I]):x.onsuccess&&x.onsuccess(h.type==="put"&&w[I]?h.values[I]:E)}return{failures:b,results:_,numFailures:C,lastResult:k}}).catch(function(v){return y.forEach(function(b){return b.onerror&&b.onerror(v)}),Promise.reject(v)})})}function p(h){return f(h.trans,h.range,1e4)}function f(h,m,g){return n.query({trans:h,values:!1,query:{index:r,range:m},limit:g}).then(function(w){var y=w.result;return d({type:"delete",keys:y,trans:h}).then(function(v){return v.numFailures>0?Promise.reject(v.failures[0]):y.length<g?{failures:[],numFailures:0,lastResult:void 0}:f(h,j(j({},m),{lower:y[y.length-1],lowerOpen:!0}),g)})})}}});return i}})}};function hy(e,t,n){return t.type==="add"?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}function Yc(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],i=0,o=0;i<t.keys.length&&o<e.length;++i)Re(t.keys[i],e[o])===0&&(r.push(n?Ir(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch{return null}}var my={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return j(j({},n),{getMany:function(r){if(!r.cache)return n.getMany(r);var i=Yc(r.keys,r.trans._cache,r.cache==="clone");return i?L.resolve(i):n.getMany(r).then(function(o){return r.trans._cache={keys:r.keys,values:r.cache==="clone"?Ir(o):o},o})},mutate:function(r){return r.type!=="add"&&(r.trans._cache=null),n.mutate(r)}})}}}},go;function es(e){return!("from"in e)}var ht=function(e,t){if(this)Le(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0});else{var n=new ht;return e&&"d"in e&&Le(n,e),n}};Nn(ht.prototype,(go={add:function(e){return Ei(this,e),this},addKey:function(e){return mr(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(n){return mr(t,n,n)}),this}},go[Vo]=function(){return ia(this)},go));function mr(e,t,n){var r=Re(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(es(e))return Le(e,{from:t,to:n,d:1});var i=e.l,o=e.r;if(Re(n,e.from)<0)return i?mr(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},pu(e);if(Re(t,e.to)>0)return o?mr(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},pu(e);Re(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),Re(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;i&&!e.l&&Ei(e,i),o&&a&&Ei(e,o)}}function Ei(e,t){function n(r,i){var o=i.from,a=i.to,s=i.l,u=i.r;mr(r,o,a),s&&n(r,s),u&&n(r,u)}es(t)||n(e,t)}function gy(e,t){var n=ia(t),r=n.next();if(r.done)return!1;for(var i=r.value,o=ia(e),a=o.next(i.from),s=a.value;!r.done&&!a.done;){if(Re(s.from,i.to)<=0&&Re(s.to,i.from)>=0)return!0;Re(i.from,s.from)<0?i=(r=n.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}function ia(e){var t=es(e)?null:{s:0,n:e};return{next:function(n){for(var r=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&Re(n,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||Re(n,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function pu(e){var t,n,r=(((t=e.r)===null||t===void 0?void 0:t.d)||0)-(((n=e.l)===null||n===void 0?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){var o=i==="r"?"l":"r",a=j({},e),s=e[i];e.from=s.from,e.to=s.to,e[i]=s[i],a[i]=s[o],e[o]=a,a.d=hu(a)}e.d=hu(e)}function hu(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}var vy={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new ht(e.MIN_KEY,e.MAX_KEY);return j(j({},e),{table:function(r){var i=e.table(r),o=i.schema,a=o.primaryKey,s=a.extractKey,u=a.outbound,c=j(j({},i),{mutate:function(p){var f=p.trans,h=f.mutatedParts||(f.mutatedParts={}),m=function(k){var I="idb://"+t+"/"+r+"/"+k;return h[I]||(h[I]=new ht)},g=m(""),w=m(":dels"),y=p.type,v=p.type==="deleteRange"?[p.range]:p.type==="delete"?[p.keys]:p.values.length<50?[[],p.values]:[],b=v[0],_=v[1],C=p.trans._cache;return i.mutate(p).then(function(k){if(Ae(b)){y!=="delete"&&(b=k.results),g.addKeys(b);var I=Yc(b,C);!I&&y!=="add"&&w.addKeys(b),(I||_)&&yy(m,o,I,_)}else if(b){var E={from:b.lower,to:b.upper};w.add(E),g.add(E)}else g.add(n),w.add(n),o.indexes.forEach(function(x){return m(x.name).add(n)});return k})}}),l=function(p){var f,h,m=p.query,g=m.index,w=m.range;return[g,new ht((f=w.lower)!==null&&f!==void 0?f:e.MIN_KEY,(h=w.upper)!==null&&h!==void 0?h:e.MAX_KEY)]},d={get:function(p){return[a,new ht(p.key)]},getMany:function(p){return[a,new ht().addKeys(p.keys)]},count:l,query:l,openCursor:l};return me(d).forEach(function(p){c[p]=function(f){var h=M.subscr;if(h){var m=function(C){var k="idb://"+t+"/"+r+"/"+C;return h[k]||(h[k]=new ht)},g=m(""),w=m(":dels"),y=d[p](f),v=y[0],b=y[1];if(m(v.name||"").add(b),!v.isPrimaryKey)if(p==="count")w.add(n);else{var _=p==="query"&&u&&f.values&&i.query(j(j({},f),{values:!1}));return i[p].apply(this,arguments).then(function(C){if(p==="query"){if(u&&f.values)return _.then(function(x){var N=x.result;return g.addKeys(N),C});var k=f.values?C.result.map(s):C.result;f.values?g.addKeys(k):w.addKeys(k)}else if(p==="openCursor"){var I=C,E=f.values;return I&&Object.create(I,{key:{get:function(){return w.addKey(I.primaryKey),I.key}},primaryKey:{get:function(){var x=I.primaryKey;return w.addKey(x),x}},value:{get:function(){return E&&g.addKey(I.primaryKey),I.value}}})}return C})}}return i[p].apply(this,arguments)}}),c}})}};function yy(e,t,n,r){function i(o){var a=e(o.name||"");function s(c){return c!=null?o.extractKey(c):null}var u=function(c){return o.multiEntry&&Ae(c)?c.forEach(function(l){return a.addKey(l)}):a.addKey(c)};(n||r).forEach(function(c,l){var d=n&&s(n[l]),p=r&&s(r[l]);Re(d,p)!==0&&(d!=null&&u(d),p!=null&&u(p))})}t.indexes.forEach(i)}var ts=function(){function e(t,n){var r=this;this._middlewares={},this.verno=0;var i=e.dependencies;this._options=n=j({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var o=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var a={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ee,dbReadyPromise:null,cancelOpen:ee,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};a.dbReadyPromise=new L(function(s){a.dbReadyResolve=s}),a.openCanceller=new L(function(s,u){a.cancelOpen=u}),this._state=a,this.name=t,this.on=Ar(this,"populate","blocked","versionchange","close",{ready:[ja,ee]}),this.on.ready.subscribe=wc(this.on.ready.subscribe,function(s){return function(u,c){e.vip(function(){var l=r._state;if(l.openComplete)l.dbOpenError||L.resolve().then(u),c&&s(u);else if(l.onReadyBeingFired)l.onReadyBeingFired.push(u),c&&s(u);else{s(u);var d=r;c||s(function p(){d.on.ready.unsubscribe(u),d.on.ready.unsubscribe(p)})}})}}),this.Collection=Nv(this),this.Table=xv(this),this.Transaction=Kv(this),this.Version=ry(this),this.WhereClause=Vv(this),this.on("versionchange",function(s){s.newVersion>0?console.warn("Another connection wants to upgrade database '"+r.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+r.name+"'. Closing db now to resume the delete request."),r.close()}),this.on("blocked",function(s){!s.newVersion||s.newVersion<s.oldVersion?console.warn("Dexie.delete('"+r.name+"') was blocked"):console.warn("Upgrade '"+r.name+"' blocked by other connection holding version "+s.oldVersion/10)}),this._maxKey=hr(n.IDBKeyRange),this._createTransaction=function(s,u,c,l){return new r.Transaction(s,u,c,r._options.chromeTransactionDurability,l)},this._fireOnBlocked=function(s){r.on("blocked").fire(s),nr.filter(function(u){return u.name===r.name&&u!==r&&!u._state.vcFired}).map(function(u){return u.on("versionchange").fire(s)})},this.use(dy),this.use(py),this.use(vy),this.use(my),this.vip=Object.create(this,{_vip:{value:!0}}),o.forEach(function(s){return s(r)})}return e.prototype.version=function(t){if(isNaN(t)||t<.1)throw new V.Type("Given version is not a positive number");if(t=Math.round(t*10)/10,this.idbdb||this._state.isBeingOpened)throw new V.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);var n=this._versions,r=n.filter(function(i){return i._cfg.version===t})[0];return r||(r=new this.Version(t),n.push(r),n.sort($v),r.stores({}),this._state.autoSchema=!1,r)},e.prototype._whenReady=function(t){var n=this;return this.idbdb&&(this._state.openComplete||M.letThrough||this._vip)?t():new L(function(r,i){if(n._state.openComplete)return i(new V.DatabaseClosed(n._state.dbOpenError));if(!n._state.isBeingOpened){if(!n._options.autoOpen){i(new V.DatabaseClosed);return}n.open().catch(ee)}n._state.dbReadyPromise.then(r,i)}).then(t)},e.prototype.use=function(t){var n=t.stack,r=t.create,i=t.level,o=t.name;o&&this.unuse({stack:n,name:o});var a=this._middlewares[n]||(this._middlewares[n]=[]);return a.push({stack:n,create:r,level:i==null?10:i,name:o}),a.sort(function(s,u){return s.level-u.level}),this},e.prototype.unuse=function(t){var n=t.stack,r=t.name,i=t.create;return n&&this._middlewares[n]&&(this._middlewares[n]=this._middlewares[n].filter(function(o){return i?o.create!==i:r?o.name!==r:!1})),this},e.prototype.open=function(){return uy(this)},e.prototype._close=function(){var t=this._state,n=nr.indexOf(this);if(n>=0&&nr.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}t.dbReadyPromise=new L(function(r){t.dbReadyResolve=r}),t.openCanceller=new L(function(r,i){t.cancelOpen=i})},e.prototype.close=function(){this._close();var t=this._state;this._options.autoOpen=!1,t.dbOpenError=new V.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)},e.prototype.delete=function(){var t=this,n=arguments.length>0,r=this._state;return new L(function(i,o){var a=function(){t.close();var s=t._deps.indexedDB.deleteDatabase(t.name);s.onsuccess=ae(function(){ay(t._deps,t.name),i()}),s.onerror=ot(o),s.onblocked=t._fireOnBlocked};if(n)throw new V.InvalidArgument("Arguments not allowed in db.delete()");r.isBeingOpened?r.dbReadyPromise.then(a):a()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return this.idbdb!==null},e.prototype.hasBeenClosed=function(){var t=this._state.dbOpenError;return t&&t.name==="DatabaseClosed"},e.prototype.hasFailed=function(){return this._state.dbOpenError!==null},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var t=this;return me(this._allTables).map(function(n){return t._allTables[n]})},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var t=ly.apply(this,arguments);return this._transaction.apply(this,t)},e.prototype._transaction=function(t,n,r){var i=this,o=M.trans;(!o||o.db!==this||t.indexOf("!")!==-1)&&(o=null);var a=t.indexOf("?")!==-1;t=t.replace("!","").replace("?","");var s,u;try{if(u=n.map(function(l){var d=l instanceof i.Table?l.name:l;if(typeof d!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return d}),t=="r"||t===co)s=co;else if(t=="rw"||t==fo)s=fo;else throw new V.InvalidArgument("Invalid transaction mode: "+t);if(o){if(o.mode===co&&s===fo)if(a)o=null;else throw new V.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o&&u.forEach(function(l){if(o&&o.storeNames.indexOf(l)===-1)if(a)o=null;else throw new V.SubTransaction("Table "+l+" not included in parent transaction.")}),a&&o&&!o.active&&(o=null)}}catch(l){return o?o._promise(null,function(d,p){p(l)}):_e(l)}var c=$c.bind(null,this,s,u,o,r);return o?o._promise(s,c,"lock"):M.trans?jn(M.transless,function(){return i._whenReady(c)}):this._whenReady(c)},e.prototype.table=function(t){if(!Be(this._allTables,t))throw new V.InvalidTable("Table "+t+" does not exist");return this._allTables[t]},e}(),_y=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",by=function(){function e(t){this._subscribe=t}return e.prototype.subscribe=function(t,n,r){return this._subscribe(!t||typeof t=="function"?{next:t,error:n,complete:r}:t)},e.prototype[_y]=function(){return this},e}();function Zc(e,t){return me(t).forEach(function(n){var r=e[n]||(e[n]=new ht);Ei(r,t[n])}),e}function wy(e){var t=!1,n=void 0,r=new by(function(i){var o=Ba(e);function a(g){o&&Hn();var w=function(){return Pt(e,{subscr:g,trans:null})},y=M.trans?jn(M.transless,w):w();return o&&y.then(Et,Et),y}var s=!1,u={},c={},l={get closed(){return s},unsubscribe:function(){s=!0,Ft.storagemutated.unsubscribe(h)}};i.start&&i.start(l);var d=!1,p=!1;function f(){return me(c).some(function(g){return u[g]&&gy(u[g],c[g])})}var h=function(g){Zc(u,g),f()&&m()},m=function(){if(!(d||s)){u={};var g={},w=a(g);p||(Ft(pr,h),p=!0),d=!0,Promise.resolve(w).then(function(y){t=!0,n=y,d=!1,!s&&(f()?m():(u={},c=g,i.next&&i.next(y)))},function(y){d=!1,t=!1,i.error&&i.error(y),l.unsubscribe()})}};return m(),l});return r.hasValue=function(){return t},r.getValue=function(){return n},r}var oa;try{oa={indexedDB:re.indexedDB||re.mozIndexedDB||re.webkitIndexedDB||re.msIndexedDB,IDBKeyRange:re.IDBKeyRange||re.webkitIDBKeyRange}}catch{oa={indexedDB:null,IDBKeyRange:null}}var Wt=ts;Nn(Wt,j(j({},Ki),{delete:function(e){var t=new Wt(e,{addons:[]});return t.delete()},exists:function(e){return new Wt(e,{addons:[]}).open().then(function(t){return t.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return iy(Wt.dependencies).then(e)}catch{return _e(new V.MissingAPI)}},defineClass:function(){function e(t){Le(this,t)}return e},ignoreTransaction:function(e){return M.trans?jn(M.transless,e):e()},vip:na,async:function(e){return function(){try{var t=ra(e.apply(this,arguments));return!t||typeof t.then!="function"?L.resolve(t):t}catch(n){return _e(n)}}},spawn:function(e,t,n){try{var r=ra(e.apply(n,t||[]));return!r||typeof r.then!="function"?L.resolve(r):r}catch(i){return _e(i)}},currentTransaction:{get:function(){return M.trans||null}},waitFor:function(e,t){var n=L.resolve(typeof e=="function"?Wt.ignoreTransaction(e):e).timeout(t||6e4);return M.trans?M.trans.waitFor(n):n},Promise:L,debug:{get:function(){return ct},set:function(e){Ac(e,e==="dexie"?function(){return!0}:Kc)}},derive:Bn,extend:Le,props:Nn,override:wc,Events:Ar,on:Ft,liveQuery:wy,extendObservabilitySet:Zc,getByKeyPath:St,setByKeyPath:tt,delByKeyPath:Xg,shallowClone:Cc,deepClone:Ir,getObjectDiff:Xa,cmp:Re,asap:Sc,minKey:Zo,addons:[],connections:nr,errnames:Ha,dependencies:oa,semVer:su,version:su.split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,n*2)})}));Wt.maxKey=hr(Wt.dependencies.IDBKeyRange);typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Ft(pr,function(e){if(!_t){var t;Hi?(t=document.createEvent("CustomEvent"),t.initCustomEvent(Ut,!0,!0,e)):t=new CustomEvent(Ut,{detail:e}),_t=!0,dispatchEvent(t),_t=!1}}),addEventListener(Ut,function(e){var t=e.detail;_t||ki(t)}));function ki(e){var t=_t;try{_t=!0,Ft.storagemutated.fire(e)}finally{_t=t}}var _t=!1;if(typeof BroadcastChannel<"u"){var zr=new BroadcastChannel(Ut);typeof zr.unref=="function"&&zr.unref(),Ft(pr,function(e){_t||zr.postMessage(e)}),zr.onmessage=function(e){e.data&&ki(e.data)}}else if(typeof self<"u"&&typeof navigator<"u"){Ft(pr,function(e){try{_t||(typeof localStorage<"u"&&localStorage.setItem(Ut,JSON.stringify({trig:Math.random(),changedParts:e})),typeof self.clients=="object"&&Po([],self.clients.matchAll({includeUncontrolled:!0}),!0).forEach(function(t){return t.postMessage({type:Ut,changedParts:e})}))}catch{}}),typeof addEventListener<"u"&&addEventListener("storage",function(e){if(e.key===Ut){var t=JSON.parse(e.newValue);t&&ki(t.changedParts)}});var mu=self.document&&navigator.serviceWorker;mu&&mu.addEventListener("message",Sy)}function Sy(e){var t=e.data;t&&t.type===Ut&&ki(t.changedParts)}L.rejectionMapper=uv;Ac(ct,Kc);var Gn=(e=>(e.ReadyForUpload="ReadyForUpload",e.UploadComplete="UploadComplete",e))(Gn||{}),An=(e=>(e.After="after",e.Before="before",e.BeforeAndAfter="beforeAndAfter",e))(An||{});const aa="sprig.sessionId",Qc="sprig.disableReplayRecording",Iy=30,Jc=()=>{sessionStorage.setItem(Qc,"disabled")},un=()=>!!sessionStorage.getItem(Qc),Cy=["did not allow mutations","called in an invalid security context"],Ey=e=>{if(!e)return!0;for(const t of Cy)if(e.toLowerCase().includes(t))return!1;return!0},gu=(e,t,n)=>{un()||t instanceof Error&&(Jc(),Ey(t==null?void 0:t.message)&&(xy(),window.UserLeap.reportError(e,t,n)))},ky=(e,t)=>{var n,r;(r=(n=window.navigator)==null?void 0:n.storage)!=null&&r.estimate?window.navigator.storage.estimate().then(i=>{gu(e,t,i)}).catch(i=>{window.UserLeap.reportError("Error getting storage estimate",i)}):gu(e,t)},Ay=()=>{const e=sessionStorage.getItem(aa);return e?(sessionStorage.removeItem(aa),e):rn()},Ue=Ay();window.addEventListener("beforeunload",()=>{sessionStorage.setItem(aa,Ue)});const xy=()=>{Promise.all([X.events.clear(),X.chunkUploads.clear(),X.pendingCaptures.clear()]).catch(e=>{window.UserLeap.reportError("Error wiping database",e)})},vo=(e,t,n=()=>!0)=>X.table(t).where("timestamp").below(e).and(n).delete(),Ty=()=>{X.events.where("sessionId").equals(Ue).delete(),X.pendingCaptures.where("sessionId").equals(Ue).delete()},Ry=e=>{const t=e.map(n=>{var r;return{...n,sessionId:(r=n.sessionId)!=null?r:Ue}});return X.events.bulkAdd(t)},Ly=(e,t)=>X.events.where("[sessionId+timestamp]").between([Ue,e],[Ue,t]).toArray(),Oy=(e,t,n)=>{const r=new Date,i=r.setMinutes(r.getMinutes()+(n!=null?n:Iy));return X.events.where("[sessionId+timestamp]").between([Ue,e],[Ue,t]).modify({expiredAt:i})},Ny=e=>{var t;return X.chunkUploads.add({...e,sessionId:(t=e.sessionId)!=null?t:Ue})},Uy=(e,t)=>X.chunkUploads.update(e,{data:null,etag:t,status:Gn.UploadComplete}),Dy=({status:e,uploadId:t})=>t?X.chunkUploads.where({uploadId:t,status:e}).toArray():X.chunkUploads.where({sessionId:Ue,status:e}).toArray(),Py=e=>X.chunkUploads.where({uploadId:e,status:Gn.UploadComplete}).toArray(),My=e=>X.chunkUploads.where({uploadId:e,status:Gn.UploadComplete}).delete(),Fy=e=>{var t;return X.pendingCaptures.add({...e,sessionId:(t=e.sessionId)!=null?t:Ue,canUpload:!1})},Vy=()=>X.pendingCaptures.where("sessionId").equals(Ue).and(e=>e.targetTimestamp<Date.now()).toArray(),By=()=>X.pendingCaptures.where("sessionId").equals(Ue).toArray(),Ky=e=>X.pendingCaptures.where("sessionId").equals(Ue).and(t=>t.captureParams.responseGroupId===e).modify({canUpload:!0});class Hy extends ts{constructor(){super("replayStorage",{autoOpen:!1});Ce(this,"events");Ce(this,"chunkUploads");Ce(this,"pendingCaptures")}}const X=new Hy;X.version(1).stores({events:"uuid, timestamp, [sessionId+timestamp]",chunkUploads:"uuid, timestamp, [sessionId+status], [uploadId+status], [sessionId+status+uploadId]",pendingCaptures:"uuid, timestamp, [sessionId+targetTimestamp]"});X.open().catch(()=>{Jc()});let Xc=5e3,sa=6e4;const jy=5,vu=1e3,ed=30,Ai=ed+jy,ns="sprig.pendingCount";let yu=0,_u=Date.now(),rs=!1;const Gy=async(e,t,n,r=2,i)=>{try{if(un()||!t)return;i!=null&&i.minDuration&&(Xc=i.minDuration),i!=null&&i.batchDuration&&(sa=i.batchDuration),Wg(r),Qy(),qy(t+Ai,30*60,t+Ai),$y();const o=window.rrwebRecord;if(!o)return;let a=!0;o({checkoutEveryNms:ed*1e3,sampling:{input:"last",scroll:250,media:800},emit:(s,u)=>{if(un())return;_u=Date.now();const c=a||!!u;a=!1,zy({uuid:rn(),event:JSON.stringify(s),isValidStart:c,timestamp:Date.now()})},...i}),rs=!0,yu||(yu=window.setInterval(()=>{Date.now()-_u>vu&&Tr("Sprig_Noop",{})},vu))}catch(o){rt("Error initializing replay",o)}};let ua=!1,la=[];const zy=e=>{la.push(e),ua||Wy()},Wy=()=>{ua=!0,setTimeout(async()=>{if(un())return;const e=la;la=[],ua=!1;try{await Ry(e)}catch(t){rt("Error storing replay events",t)}},500)},qy=(e=6*60,t=30*60,n=4*60)=>{const r=setInterval(async()=>{const i=Date.now();un()||await X.transaction("rw",X.events,X.chunkUploads,X.pendingCaptures,()=>{vo(i-e*1e3,"events",o=>o.expiredAt===void 0||o.expiredAt<i-e*1e3),vo(i-t*1e3,"chunkUploads"),vo(i-n*1e3,"pendingCaptures",o=>o.canUpload===void 0||o.canUpload===!1)}).catch(o=>{clearInterval(r),rt("Error deleting table rows",o)})},3e4)},$y=(e=5)=>{setInterval(n_,e*1e3)},Yy=async(e,t,n,r,i)=>{try{const o=Math.min(e+i,n),a=await Ly(e,o);if(!(a!=null&&a.length))return[r,[]];if(!r){let s=-1;return a==null||a.forEach((u,c)=>{if(!u.isValidStart)return;const l=u.timestamp<=t;(s<0||l)&&(s=c)}),s<0?[]:[!0,a==null?void 0:a.slice(s)]}return[r,a]}catch(o){rt("Error getting events batch",o)}},Zy=(e,t,n)=>{const r=e.length,i=t*1024*1024,o=Math.ceil(r/n),a=Math.max(i,o),s=[];let u=0;for(;u<r;)s.push(e.slice(u,u+a)),u+=a;return s},td=e=>Promise.all(e.map(async t=>{const n=await $g(t);return await Uy(t.uuid,n),t.uploadId})),nd=async e=>{const t=await Py(e);if(!(t!=null&&t.length))return;t.sort((i,o)=>i.chunkIndex-o.chunkIndex);const n=t.map(i=>({ETag:i.etag,PartNumber:i.chunkIndex})).filter(i=>i.ETag!==null),r=t[0];await _c({apiUrl:r.apiUrl,surveyId:r.surveyId,uploadId:e,responseGroupUuid:r.responseGroupId,etags:n,headers:r.completeUploadHeaders,replayDuration:r.replayDuration}),await My(e)},Qy=async()=>{try{let e=[];if(await X.transaction("rw",X.chunkUploads,async()=>{e=await Dy({status:Gn.ReadyForUpload}).catch(n=>{rt("chunkUploads transaction error",n)})}),!(e!=null&&e.length))return;const t=await td(e);t!=null&&t.length&&await Promise.all(t.map(async n=>{n&&await nd(n)}))}catch(e){rt("Error getting chunk upload uuids",e)}},Jy=async(e,t)=>{await td(t),await Promise.all(e.map(n=>nd(n)))},Xy=e=>{let t=0;e.forEach(i=>{t+=i.length});const n=new Uint8Array(t);let r=0;return e.forEach(i=>{n.set(i,r),r+=i.length}),n},bu=async(e,t,n)=>{const r=new TextEncoder;let i=null,o=null,a=null,s=!1,u=!1,[c,l]=[0,0];const d=e-Ai*1e3,p=[];let f=[];for(let m=d;m<t;m+=sa){if([u,f]=await Yy(m,e,t,u,sa),!(f!=null&&f.length))continue;c===0&&(c=f[0].timestamp),l=f[f.length-1].timestamp;const g=`${s?",":"["}${f.map(y=>y.event).join(",")}`,w=r.encode(g);n?(o===null&&(a=new window.CompressionStream("gzip"),o=a.writable.getWriter()),o.write(w)):p.push(w),s=!0}if(l-c<Xc)return null;const h=r.encode("]");return o&&a?(o.write(h),o.close(),i=new Uint8Array(await new Response(a.readable).arrayBuffer())):(p.push(h),i=Xy(p)),i},e_=async(e,t)=>{const n=window.CompressionStream!==void 0;let r=null;const i=t!=null?t:Date.now(),o=i-e;try{r=await bu(o,i,n)}catch(a){if(a instanceof Error&&window.UserLeap.reportError("Error compressing replay",a),n)try{r=await bu(o,i,!1)}catch(s){rt("fileData fallback failed",s)}}return r},wu=async e=>{const{surveyId:t,responseGroupId:n,visitorId:r,apiUrl:i,completeUploadHeaders:o,replayParams:a,triggerTimestamp:s}=e,u=await e_(a.replayDurationSeconds*1e3,s);if(!(u!=null&&u.length))return;const c=Zy(u,a.minimumChunkSizeMb,a.signedUrls.length),l=await Promise.all(c.map(async(d,p)=>{const f=rn(),h={apiUrl:i,chunkIndex:p+1,completeUploadHeaders:o,etag:null,responseGroupId:n,status:Gn.ReadyForUpload,surveyId:t,timestamp:s,totalChunks:c.length,data:d,uploadId:a.uploadId,uploadUrl:a.signedUrls[p].url,uuid:f,visitorId:r};return await Ny(h),h}));await Jy([a.uploadId],l)},rd=async(e,t)=>{if(!un())try{const{isStandalone:n,replayParams:r,triggerTimestamp:i,responseGroupId:o}=e,a=async()=>{setTimeout(()=>z.removeListener(K.QuestionAnswered,a),0),r.replayDurationType===An.Before?await wu(e):await Ky(o)};if(r.replayDurationType===An.After||r.replayDurationType===An.BeforeAndAfter){n||z.on(K.QuestionAnswered,a),await t_(e);return}if(n||t)await wu(e);else{const s=Ai+r.replayDurationSeconds;await Oy(i-s*1e3,i,r.expirationTimeLimitMinutes),z.on(K.QuestionAnswered,a)}}catch(n){rt("Error scheduling or capturing replay",n)}},Su=()=>{if(!un())try{Ty()}catch(e){rt("Error clearing session event data",e)}};let vt=sessionStorage.getItem(ns);const t_=async e=>{const{surveyId:t}=e,n=await By(),r=n==null?void 0:n.filter(a=>a.captureParams.surveyId===t);if(r!=null&&r.length)return;const i={...e,replayParams:{...e.replayParams}};e.replayParams.replayDurationType===An.BeforeAndAfter&&(i.replayParams.replayDurationSeconds*=2),i.replayParams.replayDurationType=An.Before;const o=e.triggerTimestamp+e.replayParams.replayDurationSeconds*1e3;return i.triggerTimestamp=o,vt=vt?(parseInt(vt)+1).toString():"1",sessionStorage.setItem(ns,vt),Fy({uuid:rn(),targetTimestamp:o,timestamp:Date.now(),captureParams:i})},n_=async()=>{try{if(vt&&parseInt(vt)>0){const e=await Vy();e.length&&await Promise.all(e.map(async t=>{await X.pendingCaptures.delete(t.uuid),await rd(t.captureParams,t.canUpload)})),vt=(parseInt(vt)-e.length).toString(),sessionStorage.setItem(ns,vt)}}catch(e){rt("Error initiating pending captures",e)}},Tr=(e,t)=>{var n,r;if(!!rs)try{(r=(n=window.rrwebRecord)==null?void 0:n.addCustomEvent)==null||r.call(n,e,t)}catch(i){rt("Error recording custom event",i)}},Iu=e=>{Tr("Sprig_PageView",e)},r_=e=>{Tr("Sprig_TrackEvent",e)},i_=e=>{Tr("Sprig_ShowSurvey",e)},o_=e=>{Tr("Sprig_SubmitSurvey",e)},rt=(e,t)=>{rs=!1,ky(e,t)};var R=(e=>(e.ConsentLegal="consentlegal",e.Likert="likert",e.MultipleChoice="multiplechoice",e.MultipleSelect="multipleselect",e.NPS="nps",e.Open="open",e.RecordedTask="recordedtask",e.TextUrlPrompt="texturlprompt",e.Thanks="thanks",e.Uploading="uploading",e.VideoVoice="videovoice",e))(R||{}),yt=(e=>(e.Answered="answered",e.Equal="eq",e.NotEqual="neq",e.Skipped="skipped",e.LessThan="lt",e.LessThanOrEqual="lte",e.GivenUp="given_up",e.GreaterThan="gt",e.GreaterThanOrEqual="gte",e.ListAll="list_all",e.ListAtLeastOne="list_alo",e.ListExact="list_exact",e.DoesNotInclude="list_dni",e.Contains="contains",e.DoesNotContain="notcontains",e))(yt||{}),Un=(e=>(e.Camera="camera",e.Microphone="microphone",e.Screen="screen",e))(Un||{}),Ge=(e=>(e.AvPermission="av_permission",e.ScreenPermission="screen_permission",e.StartTask="start_task",e.CompleteTask="complete_task",e))(Ge||{}),Qt=(e=>(e.Number="number",e.Smiley="smiley",e.Star="star",e))(Qt||{}),Rr,D,id,Dn,qt,Cu,od,ad,xi={},sd=[],a_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function bt(e,t){for(var n in t)e[n]=t[n];return e}function ud(e){var t=e.parentNode;t&&t.removeChild(e)}function he(e,t,n){var r,i,o,a={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Rr.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return ir(e,a,r,i,null)}function ir(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++id:i};return i==null&&D.vnode!=null&&D.vnode(o),o}function ld(){return{current:null}}function $e(e){return e.children}function s_(e,t,n,r,i){var o;for(o in n)o==="children"||o==="key"||o in t||Ti(e,o,null,n[o],r);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||Ti(e,o,t[o],n[o],r)}function Eu(e,t,n){t[0]==="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||a_.test(t)?n:n+"px"}function Ti(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Eu(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Eu(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Au:ku,o):e.removeEventListener(t,o?Au:ku,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t.indexOf("-")==-1?e.removeAttribute(t):e.setAttribute(t,n))}}function ku(e){Dn=!0;try{return this.l[e.type+!1](D.event?D.event(e):e)}finally{Dn=!1}}function Au(e){Dn=!0;try{return this.l[e.type+!0](D.event?D.event(e):e)}finally{Dn=!1}}function nt(e,t){this.props=e,this.context=t}function gr(e,t){if(t==null)return e.__?gr(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?gr(e):null}function cd(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return cd(e)}}function u_(e){Dn?setTimeout(e):od(e)}function ca(e){(!e.__d&&(e.__d=!0)&&qt.push(e)&&!Ri.__r++||Cu!==D.debounceRendering)&&((Cu=D.debounceRendering)||u_)(Ri)}function Ri(){var e,t,n,r,i,o,a,s;for(qt.sort(function(u,c){return u.__v.__b-c.__v.__b});e=qt.shift();)e.__d&&(t=qt.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=bt({},o)).__v=o.__v+1,is(s,o,i,n.__n,s.ownerSVGElement!==void 0,o.__h!=null?[a]:null,r,a==null?gr(o):a,o.__h),md(r,o),o.__e!=a&&cd(o)),qt.length>t&&qt.sort(function(u,c){return u.__v.__b-c.__v.__b}));Ri.__r=0}function dd(e,t,n,r,i,o,a,s,u,c){var l,d,p,f,h,m,g,w=r&&r.__k||sd,y=w.length;for(n.__k=[],l=0;l<t.length;l++)if((f=n.__k[l]=(f=t[l])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?ir(null,f,null,null,f):Array.isArray(f)?ir($e,{children:f},null,null,null):f.__b>0?ir(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)!=null){if(f.__=n,f.__b=n.__b+1,(p=w[l])===null||p&&f.key==p.key&&f.type===p.type)w[l]=void 0;else for(d=0;d<y;d++){if((p=w[d])&&f.key==p.key&&f.type===p.type){w[d]=void 0;break}p=null}is(e,f,p=p||xi,i,o,a,s,u,c),h=f.__e,(d=f.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,f),g.push(d,f.__c||h,f)),h!=null?(m==null&&(m=h),typeof f.type=="function"&&f.__k===p.__k?f.__d=u=fd(f,u,e):u=pd(e,f,p,w,h,u),typeof n.type=="function"&&(n.__d=u)):u&&p.__e==u&&u.parentNode!=e&&(u=gr(p))}for(n.__e=m,l=y;l--;)w[l]!=null&&(typeof n.type=="function"&&w[l].__e!=null&&w[l].__e==n.__d&&(n.__d=hd(r).nextSibling),vd(w[l],w[l]));if(g)for(l=0;l<g.length;l++)gd(g[l],g[++l],g[++l])}function fd(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t=typeof r.type=="function"?fd(r,t,n):pd(n,r,r,i,r.__e,t));return t}function It(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(n){It(n,t)}):t.push(e)),t}function pd(e,t,n,r,i,o){var a,s,u;if(t.__d!==void 0)a=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,u=0;(s=s.nextSibling)&&u<r.length;u+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return a!==void 0?a:i.nextSibling}function hd(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=hd(n)))return r}return null}function is(e,t,n,r,i,o,a,s,u){var c,l,d,p,f,h,m,g,w,y,v,b,_,C,k,I=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(u=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=D.__b)&&c(t);try{e:if(typeof I=="function"){if(g=t.props,w=(c=I.contextType)&&r[c.__c],y=c?w?w.props.value:c.__:r,n.__c?m=(l=t.__c=n.__c).__=l.__E:("prototype"in I&&I.prototype.render?t.__c=l=new I(g,y):(t.__c=l=new nt(g,y),l.constructor=I,l.render=c_),w&&w.sub(l),l.props=g,l.state||(l.state={}),l.context=y,l.__n=r,d=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),I.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=bt({},l.__s)),bt(l.__s,I.getDerivedStateFromProps(g,l.__s))),p=l.props,f=l.state,l.__v=t,d)I.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(I.getDerivedStateFromProps==null&&g!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,y),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,y)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(l.props=g,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,y),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,f,h)})}if(l.context=y,l.props=g,l.__P=e,b=D.__r,_=0,"prototype"in I&&I.prototype.render){for(l.state=l.__s,l.__d=!1,b&&b(t),c=l.render(l.props,l.state,l.context),C=0;C<l._sb.length;C++)l.__h.push(l._sb[C]);l._sb=[]}else do l.__d=!1,b&&b(t),c=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++_<25);l.state=l.__s,l.getChildContext!=null&&(r=bt(bt({},r),l.getChildContext())),d||l.getSnapshotBeforeUpdate==null||(h=l.getSnapshotBeforeUpdate(p,f)),k=c!=null&&c.type===$e&&c.key==null?c.props.children:c,dd(e,Array.isArray(k)?k:[k],t,n,r,i,o,a,s,u),l.base=t.__e,t.__h=null,l.__h.length&&a.push(l),m&&(l.__E=l.__=null),l.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=l_(n.__e,t,n,r,i,o,a,u);(c=D.diffed)&&c(t)}catch(E){t.__v=null,(u||o!=null)&&(t.__e=s,t.__h=!!u,o[o.indexOf(s)]=null),D.__e(E,t,n)}}function md(e,t){D.__c&&D.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){D.__e(r,n.__v)}})}function l_(e,t,n,r,i,o,a,s){var u,c,l,d=n.props,p=t.props,f=t.type,h=0;if(f==="svg"&&(i=!0),o!=null){for(;h<o.length;h++)if((u=o[h])&&"setAttribute"in u==!!f&&(f?u.localName===f:u.nodeType===3)){e=u,o[h]=null;break}}if(e==null){if(f===null)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),o=null,s=!1}if(f===null)d===p||s&&e.data===p||(e.data=p);else{if(o=o&&Rr.call(e.childNodes),c=(d=n.props||xi).dangerouslySetInnerHTML,l=p.dangerouslySetInnerHTML,!s){if(o!=null)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(l||c)&&(l&&(c&&l.__html==c.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(s_(e,p,d,i,s),l)t.__k=[];else if(h=t.props.children,dd(e,Array.isArray(h)?h:[h],t,n,r,i&&f!=="foreignObject",o,a,o?o[0]:n.__k&&gr(n,0),s),o!=null)for(h=o.length;h--;)o[h]!=null&&ud(o[h]);s||("value"in p&&(h=p.value)!==void 0&&(h!==e.value||f==="progress"&&!h||f==="option"&&h!==d.value)&&Ti(e,"value",h,d.value,!1),"checked"in p&&(h=p.checked)!==void 0&&h!==e.checked&&Ti(e,"checked",h,d.checked,!1))}return e}function gd(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){D.__e(r,n)}}function vd(e,t,n){var r,i;if(D.unmount&&D.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||gd(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){D.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&vd(r[i],t,n||typeof e.type!="function");n||e.__e==null||ud(e.__e),e.__=e.__e=e.__d=void 0}function c_(e,t,n){return this.constructor(e,n)}function Pn(e,t,n){var r,i,o;D.__&&D.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],is(t,e=(!r&&n||t).__k=he($e,null,[e]),i||xi,xi,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?Rr.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),md(o,e)}function yd(e,t){Pn(e,t,yd)}function d_(e,t,n){var r,i,o,a=bt({},e.props);for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:a[o]=t[o];return arguments.length>2&&(a.children=arguments.length>3?Rr.call(arguments,2):n),ir(e.type,a,r||e.key,i||e.ref,null)}function _d(e,t){var n={__c:t="__cC"+ad++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(s){s.__e=!0,ca(s)})},this.sub=function(a){i.push(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),s&&s.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Rr=sd.slice,D={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},id=0,Dn=!1,nt.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=bt({},this.state),typeof e=="function"&&(e=e(bt({},n),this.props)),e&&bt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ca(this))},nt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ca(this))},nt.prototype.render=$e,qt=[],od=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ri.__r=0,ad=0;var Je=(e=>(e.Video="video",e.Audio="audio",e.Screen="screen",e))(Je||{}),Ee=(e=>(e.PermissionStatus="permission.status",e.AvPermission="av.permission",e.ScreenPermission="screen.permission",e.BeginRecording="begin.recording",e.StartTask="start.task",e.FinishTask="finish.task",e))(Ee||{}),ze=(e=>(e.Abandoned="abandoned",e.GivenUp="given.up",e.Completed="completed",e))(ze||{}),G=(e=>(e.ScreenPermissionRequested="screen.permission.requested",e.PermissionDescriptors="permission.descriptors",e.PermissionStatusCallback="permission.status.callback",e.StreamReadyCallback="stream.ready.callback",e.StreamCanceledCallback="stream.canceled.callback",e.TaskCompleteCallback="task.complete.callback",e.TaskResponse="task.response",e.TaskStatus="task.status",e.RecordingMediaTypes="recording.media.types",e.StartRecordingCallback="start.recording.callback",e.PassthroughData="passthrough.data",e.CurrentIndex="current.index",e.UploadCallback="upload.callback",e.ProgressCallback="progress.callback",e.BeginCallback="begin.callback",e))(G||{});const xu=e=>{let t;const n=new Set,r=(u,c)=>{const l=typeof u=="function"?u(t):u;if(!Object.is(l,t)){const d=t;t=(c!=null?c:typeof l!="object")?l:Object.assign({},t,l),n.forEach(p=>p(t,d))}},i=()=>t,s={setState:r,getState:i,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>n.clear()};return t=e(r,i,s),s},f_=e=>e?xu(e):xu;var Kt,ie,yo,Tu,Mn=0,bd=[],ni=[],Ru=D.__b,Lu=D.__r,Ou=D.diffed,Nu=D.__c,Uu=D.unmount;function dn(e,t){D.__h&&D.__h(ie,e,Mn||t),Mn=0;var n=ie.__H||(ie.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:ni}),n.__[e]}function Ve(e){return Mn=1,os(Ed,e)}function os(e,t,n){var r=dn(Kt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ed(void 0,t),function(o){var a=r.__N?r.__N[0]:r.__[0],s=r.t(a,o);a!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=ie,!ie.u)){ie.u=!0;var i=ie.shouldComponentUpdate;ie.shouldComponentUpdate=function(o,a,s){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(l){return l.__c});if(u.every(function(l){return!l.__N}))return!i||i.call(this,o,a,s);var c=!1;return u.forEach(function(l){if(l.__N){var d=l.__[0];l.__=l.__N,l.__N=void 0,d!==l.__[0]&&(c=!0)}}),!(!c&&r.__c.props===o)&&(!i||i.call(this,o,a,s))}}return r.__N||r.__}function We(e,t){var n=dn(Kt++,3);!D.__s&&ss(n.__H,t)&&(n.__=e,n.i=t,ie.__H.__h.push(n))}function Lr(e,t){var n=dn(Kt++,4);!D.__s&&ss(n.__H,t)&&(n.__=e,n.i=t,ie.__h.push(n))}function Vt(e){return Mn=5,Gi(function(){return{current:e}},[])}function wd(e,t,n){Mn=6,Lr(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Gi(e,t){var n=dn(Kt++,7);return ss(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Sd(e,t){return Mn=8,Gi(function(){return e},t)}function Id(e){var t=ie.context[e.__c],n=dn(Kt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(ie)),t.props.value):e.__}function as(e,t){D.useDebugValue&&D.useDebugValue(t?t(e):e)}function p_(e){var t=dn(Kt++,10),n=Ve();return t.__=e,ie.componentDidCatch||(ie.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Cd(){var e=dn(Kt++,11);if(!e.__){for(var t=ie.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function h_(){for(var e;e=bd.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ri),e.__H.__h.forEach(da),e.__H.__h=[]}catch(t){e.__H.__h=[],D.__e(t,e.__v)}}D.__b=function(e){ie=null,Ru&&Ru(e)},D.__r=function(e){Lu&&Lu(e),Kt=0;var t=(ie=e.__c).__H;t&&(yo===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=ni,n.__N=n.i=void 0})):(t.__h.forEach(ri),t.__h.forEach(da),t.__h=[])),yo=ie},D.diffed=function(e){Ou&&Ou(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(bd.push(t)!==1&&Tu===D.requestAnimationFrame||((Tu=D.requestAnimationFrame)||m_)(h_)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==ni&&(n.__=n.__V),n.i=void 0,n.__V=ni})),yo=ie=null},D.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ri),n.__h=n.__h.filter(function(r){return!r.__||da(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],D.__e(r,n.__v)}}),Nu&&Nu(e,t)},D.unmount=function(e){Uu&&Uu(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ri(r)}catch(i){t=i}}),n.__H=void 0,t&&D.__e(t,n.__v))};var Du=typeof requestAnimationFrame=="function";function m_(e){var t,n=function(){clearTimeout(r),Du&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Du&&(t=requestAnimationFrame(n))}function ri(e){var t=ie,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ie=t}function da(e){var t=ie;e.__c=e.__(),ie=t}function ss(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ed(e,t){return typeof t=="function"?t(e):t}function kd(e,t){for(var n in t)e[n]=t[n];return e}function fa(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function _o(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function Li(e){this.props=e}function Ad(e,t){function n(i){var o=this.props.ref,a=o==i.ref;return!a&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!a:fa(this.props,i)}function r(i){return this.shouldComponentUpdate=n,he(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Li.prototype=new nt).isPureReactComponent=!0,Li.prototype.shouldComponentUpdate=function(e,t){return fa(this.props,e)||fa(this.state,t)};var Pu=D.__b;D.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Pu&&Pu(e)};var g_=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function xd(e){function t(n){var r=kd({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=g_,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Mu=function(e,t){return e==null?null:It(It(e).map(t))},Td={map:Mu,forEach:Mu,count:function(e){return e?It(e).length:0},only:function(e){var t=It(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:It},v_=D.__e;D.__e=function(e,t,n,r){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}v_(e,t,n,r)};var Fu=D.unmount;function Rd(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=kd({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Rd(r,t,n)})),e}function Ld(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Ld(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function or(){this.__u=0,this.t=null,this.__b=null}function Od(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Nd(e){var t,n,r;function i(o){if(t||(t=e()).then(function(a){n=a.default||a},function(a){r=a}),r)throw r;if(!n)throw t;return he(n,o)}return i.displayName="Lazy",i.__f=!0,i}function In(){this.u=null,this.o=null}D.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Fu&&Fu(e)},(or.prototype=new nt).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=Od(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=Ld(c,c.__c.__P,c.__c.__O)}var l;for(r.setState({__a:r.__b=null});l=r.t.pop();)l.forceUpdate()}},u=t.__h===!0;r.__u++||u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},or.prototype.componentWillUnmount=function(){this.t=[]},or.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Rd(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&he($e,null,e.fallback);return i&&(i.__h=null),[he($e,null,t.__a?null:e.children),i]};var Vu=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function y_(e){return this.getChildContext=function(){return e.context},e.children}function __(e){var t=this,n=e.i;t.componentWillUnmount=function(){Pn(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),Pn(he(y_,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Ud(e,t){var n=he(__,{__v:e,i:t});return n.containerInfo=t,n}(In.prototype=new nt).__a=function(e){var t=this,n=Od(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Vu(t,e,r)):i()};n?n(o):o()}},In.prototype.render=function(e){this.u=null,this.o=new Map;var t=It(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},In.prototype.componentDidUpdate=In.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Vu(e,n,t)})};var Dd=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,b_=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,w_=typeof document<"u",S_=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Pd(e,t,n){return t.__k==null&&(t.textContent=""),Pn(e,t),typeof n=="function"&&n(),e?e.__c:null}function Md(e,t,n){return yd(e,t),typeof n=="function"&&n(),e?e.__c:null}nt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(nt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Bu=D.event;function I_(){}function C_(){return this.cancelBubble}function E_(){return this.defaultPrevented}D.event=function(e){return Bu&&(e=Bu(e)),e.persist=I_,e.isPropagationStopped=C_,e.isDefaultPrevented=E_,e.nativeEvent=e};var Fd,Ku={configurable:!0,get:function(){return this.class}},Hu=D.vnode;D.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){var i=t.indexOf("-")===-1;for(var o in r={},n){var a=n[o];w_&&o==="children"&&t==="noscript"||o==="value"&&"defaultValue"in n&&a==null||(o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&a===!0?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!S_(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():i&&b_.test(o)?o=o.replace(/[A-Z0-9]/g,"-$&").toLowerCase():a===null&&(a=void 0),/^oninput$/i.test(o)&&(o=o.toLowerCase(),r[o]&&(o="oninputCapture")),r[o]=a)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=It(n.children).forEach(function(s){s.props.selected=r.value.indexOf(s.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=It(n.children).forEach(function(s){s.props.selected=r.multiple?r.defaultValue.indexOf(s.props.value)!=-1:r.defaultValue==s.props.value})),e.props=r,n.class!=n.className&&(Ku.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",Ku))}e.$$typeof=Dd,Hu&&Hu(e)};var ju=D.__r;D.__r=function(e){ju&&ju(e),Fd=e.__c};var Vd={ReactCurrentDispatcher:{current:{readContext:function(e){return Fd.__n[e.__c].props.value}}}},k_="17.0.2";function Bd(e){return he.bind(null,e)}function us(e){return!!e&&e.$$typeof===Dd}function Kd(e){return us(e)?d_.apply(null,arguments):e}function Hd(e){return!!e.__k&&(Pn(null,e),!0)}function jd(e){return e&&(e.base||e.nodeType===1&&e)||null}var Gd=function(e,t){return e(t)},zd=function(e,t){return e(t)},Wd=$e;function ls(e){e()}function qd(e){return e}function $d(){return[!1,ls]}var Yd=Lr;function Zd(e,t){var n=t(),r=Ve({h:{__:n,v:t}}),i=r[0].h,o=r[1];return Lr(function(){i.__=n,i.v=t,_o(i.__,t())||o({h:i})},[e,n,t]),We(function(){return _o(i.__,i.v())||o({h:i}),e(function(){_o(i.__,i.v())||o({h:i})})},[e]),n}var A_={useState:Ve,useId:Cd,useReducer:os,useEffect:We,useLayoutEffect:Lr,useInsertionEffect:Yd,useTransition:$d,useDeferredValue:qd,useSyncExternalStore:Zd,startTransition:ls,useRef:Vt,useImperativeHandle:wd,useMemo:Gi,useCallback:Sd,useContext:Id,useDebugValue:as,version:"17.0.2",Children:Td,render:Pd,hydrate:Md,unmountComponentAtNode:Hd,createPortal:Ud,createElement:he,createContext:_d,createFactory:Bd,cloneElement:Kd,createRef:ld,Fragment:$e,isValidElement:us,findDOMNode:jd,Component:nt,PureComponent:Li,memo:Ad,forwardRef:xd,flushSync:zd,unstable_batchedUpdates:Gd,StrictMode:Wd,Suspense:or,SuspenseList:In,lazy:Nd,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Vd};const x_=Object.freeze(Object.defineProperty({__proto__:null,Children:Td,PureComponent:Li,StrictMode:Wd,Suspense:or,SuspenseList:In,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Vd,cloneElement:Kd,createFactory:Bd,createPortal:Ud,default:A_,findDOMNode:jd,flushSync:zd,forwardRef:xd,hydrate:Md,isValidElement:us,lazy:Nd,memo:Ad,render:Pd,startTransition:ls,unmountComponentAtNode:Hd,unstable_batchedUpdates:Gd,useDeferredValue:qd,useInsertionEffect:Yd,useSyncExternalStore:Zd,useTransition:$d,version:k_,Component:nt,Fragment:$e,createContext:_d,createElement:he,createRef:ld,useCallback:Sd,useContext:Id,useDebugValue:as,useEffect:We,useErrorBoundary:p_,useId:Cd,useImperativeHandle:wd,useLayoutEffect:Lr,useMemo:Gi,useReducer:os,useRef:Vt,useState:Ve},Symbol.toStringTag,{value:"Module"}));var Qd={exports:{}},Jd={};const Xd=Th(x_);var ef={exports:{}},tf={};/**
38
38
  * @license React
39
39
  * use-sync-external-store-shim.production.min.js
40
40
  *
@@ -42,15 +42,7 @@ From previous: `);return this._state!==null&&(this._stack=t),t}finally{ua=!1}}},
42
42
  *
43
43
  * This source code is licensed under the MIT license found in the
44
44
  * LICENSE file in the root directory of this source tree.
45
- */var fu;function d_(){if(fu)return Do;fu=1;var e=ro;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(d,p){var f=p(),h=r({inst:{value:f,getSnapshot:p}}),m=h[0].inst,g=h[1];return o(function(){m.value=f,m.getSnapshot=p,l(m)&&g({inst:m})},[d,f,p]),i(function(){return l(m)&&g({inst:m}),d(function(){l(m)&&g({inst:m})})},[d]),a(f),f}function l(d){var p=d.getSnapshot;d=d.value;try{var f=p();return!n(d,f)}catch{return!0}}function u(d,p){return p()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return Do.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Do}var Uo={};/**
46
- * @license React
47
- * use-sync-external-store-shim.development.js
48
- *
49
- * Copyright (c) Facebook, Inc. and its affiliates.
50
- *
51
- * This source code is licensed under the MIT license found in the
52
- * LICENSE file in the root directory of this source tree.
53
- */var pu;function f_(){return pu||(pu=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=ro,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(_){{for(var v=arguments.length,w=new Array(v>1?v-1:0),E=1;E<v;E++)w[E-1]=arguments[E];r("error",_,w)}}function r(_,v,w){{var E=t.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(v+="%s",w=w.concat([I]));var S=w.map(function(x){return String(x)});S.unshift("Warning: "+v),Function.prototype.apply.call(console[_],console,S)}}function i(_,v){return _===v&&(_!==0||1/_===1/v)||_!==_&&v!==v}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,c=!1,d=!1;function p(_,v,w){c||e.startTransition!==void 0&&(c=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=v();if(!d){var I=v();o(E,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var S=a({inst:{value:E,getSnapshot:v}}),x=S[0].inst,T=S[1];return l(function(){x.value=E,x.getSnapshot=v,f(x)&&T({inst:x})},[_,E,v]),s(function(){f(x)&&T({inst:x});var A=function(){f(x)&&T({inst:x})};return _(A)},[_]),u(E),E}function f(_){var v=_.getSnapshot,w=_.value;try{var E=v();return!o(w,E)}catch{return!0}}function h(_,v,w){return v()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!m,b=g?h:p,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b;Uo.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Uo}var hu;function Rf(){return hu||(hu=1,function(e){process.env.NODE_ENV==="production"?e.exports=d_():e.exports=f_()}(No)),No.exports}/**
45
+ */var Fn=Xd;function T_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var R_=typeof Object.is=="function"?Object.is:T_,L_=Fn.useState,O_=Fn.useEffect,N_=Fn.useLayoutEffect,U_=Fn.useDebugValue;function D_(e,t){var n=t(),r=L_({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return N_(function(){i.value=n,i.getSnapshot=t,bo(i)&&o({inst:i})},[e,n,t]),O_(function(){return bo(i)&&o({inst:i}),e(function(){bo(i)&&o({inst:i})})},[e]),U_(n),n}function bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!R_(e,n)}catch{return!0}}function P_(e,t){return t()}var M_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?P_:D_;tf.useSyncExternalStore=Fn.useSyncExternalStore!==void 0?Fn.useSyncExternalStore:M_;(function(e){e.exports=tf})(ef);/**
54
46
  * @license React
55
47
  * use-sync-external-store-shim/with-selector.production.min.js
56
48
  *
@@ -58,681 +50,16 @@ From previous: `);return this._state!==null&&(this._stack=t),t}finally{ua=!1}}},
58
50
  *
59
51
  * This source code is licensed under the MIT license found in the
60
52
  * LICENSE file in the root directory of this source tree.
61
- */var mu;function p_(){if(mu)return Oo;mu=1;var e=ro,t=Rf();function n(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Oo.useSyncExternalStoreWithSelector=function(u,c,d,p,f){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=s(function(){function b(E){if(!y){if(y=!0,_=E,E=p(E),f!==void 0&&m.hasValue){var I=m.value;if(f(I,E))return v=I}return v=E}if(I=v,r(_,E))return I;var S=p(E);return f!==void 0&&f(I,S)?I:(_=E,v=S)}var y=!1,_,v,w=d===void 0?null:d;return[function(){return b(c())},w===null?void 0:function(){return b(w())}]},[c,d,p,f]);var g=i(u,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},Oo}var Po={};/**
62
- * @license React
63
- * use-sync-external-store-shim/with-selector.development.js
64
- *
65
- * Copyright (c) Facebook, Inc. and its affiliates.
66
- *
67
- * This source code is licensed under the MIT license found in the
68
- * LICENSE file in the root directory of this source tree.
69
- */var gu;function h_(){return gu||(gu=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=ro,t=Rf();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;function u(c,d,p,f,h){var m=o(null),g;m.current===null?(g={hasValue:!1,value:null},m.current=g):g=m.current;var b=s(function(){var w=!1,E,I,S=function(L){if(!w){w=!0,E=L;var k=f(L);if(h!==void 0&&g.hasValue){var U=g.value;if(h(U,k))return I=U,U}return I=k,k}var R=E,V=I;if(r(R,L))return V;var K=f(L);return h!==void 0&&h(V,K)?V:(E=L,I=K,K)},x=p===void 0?null:p,T=function(){return S(d())},A=x===null?void 0:function(){return S(x())};return[T,A]},[d,p,f,h]),y=b[0],_=b[1],v=i(c,y,_);return a(function(){g.hasValue=!0,g.value=v},[v]),l(v),v}Po.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Po}(function(e){process.env.NODE_ENV==="production"?e.exports=p_():e.exports=h_()})(Tf);const m_=cm(Tf.exports),{useSyncExternalStoreWithSelector:g_}=m_;function v_(e,t=e.getState,n){const r=g_(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return ks(r),r}const vu=e=>{const t=typeof e=="function"?$0(e):e,n=(r,i)=>v_(t,r,i);return Object.assign(n,t),n},Lf=e=>e?vu(e):vu;var Na=(e=>(e[e.And=1]="And",e[e.Or=2]="Or",e))(Na||{});const yu=1,Rs={eq(e,t){return e==t},neq(e,t){return!this.eq(e,t)},gt(e,t){return e>t},gte(e,t){return e>=t},lt(e,t){return e<t},lte(e,t){return e<=t},list_exact(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:e.slice().sort().join(",")===t.slice().sort().join(",")},list_all(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:!t.some(n=>e.indexOf(n)===-1)},list_alo(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.some(i=>r.has(i))},list_dni(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.every(i=>!r.has(i))},contains(e,t){const n=e.toLowerCase(),r=t.toLowerCase();return n.includes(r)},notcontains(e,t){return!this.contains(e,t)}},y_=(e,t,n)=>{switch(t){case O.VideoVoice:return Boolean(e&&e.value);case O.Open:return!!n;case O.MultipleSelect:return Boolean(n&&!!Object.keys(n).length);case O.RecordedTask:return(n==null?void 0:n.taskStatus)===Ye.Completed;case O.TextUrlPrompt:return!e.value;case O.ConsentLegal:return n!==null;case O.MultipleChoice:return n!==void 0;case O.NPS:return n!==null;case O.Likert:return n!==null;default:return!0}},Of=({cards:e,index:t,hasEndCard:n,allResponses:r,uploadProgress:i={}})=>{if(t>=e.length||t<0)return null;const o=e[t];let a=t+1;const s=o.props.routingOptions||[];for(let c=0;c<s.length;c++){const{group:d,target:p}=s[c];if(!(d!=null&&d.length))continue;const f=d[0];if(f.questionIndex===void 0||f.questionIndex>r.length)continue;let h=_u({comparator:f.comparator,response:r[f.questionIndex],type:o.type,value:f.value});for(let m=1;m<d.length;m+=2){const g=d[m],b=d[m+1],y=_u({comparator:b.comparator,response:r[b.questionIndex],type:e[b.questionIndex].type,value:b.value});g===Na.And?h&&(h=y):g===Na.Or&&(h||(h=y))}if(h){a=p===-1&&n?e.length-1:p;break}}const l=e.findIndex(c=>c.type===O.Uploading);let u;return l>0?u=n?e.length-3:e.length-2:u=e.length-1,t>=u||a===-1||a!==null&&a>u?l>0&&Object.values(i).some(d=>d.isSubmitted&&!d.isComplete)?l:n?e.length-1:null:a===-1?null:a},_u=({comparator:e,response:t,type:n,value:r})=>{if(e===It.Answered)switch(n){case O.TextUrlPrompt:return t===void 0;case O.ConsentLegal:return t&&t.submitted===!0;case O.RecordedTask:return"taskStatus"in t&&t.taskStatus===Ye.Completed;case O.Likert:return Number.isInteger(t);case O.Open:return t&&t.length>0;case O.MultipleChoice:case O.MultipleSelect:return Object.keys(t).length>0;case O.NPS:return Number.isInteger(t);case O.VideoVoice:return!!(t!=null&&t.mediaRecordingUid);default:return!1}if(e===It.Skipped)switch(n){case O.TextUrlPrompt:return t==null?void 0:t.skipped;case O.ConsentLegal:return t===null;case O.RecordedTask:return"taskStatus"in t&&t.taskStatus===Ye.Abandoned;case O.Likert:return t===null;case O.Open:return(t==null?void 0:t.length)===0;case O.MultipleChoice:return t===void 0;case O.MultipleSelect:return(t==null?void 0:t.length)===0;case O.NPS:return t===null;case O.VideoVoice:return t===null;default:return!1}return e===It.GivenUp?n===O.RecordedTask?"taskStatus"in t&&t.taskStatus===Ye.GivenUp:!0:Rs[e](t,r)},__=13,b_=(e,t)=>e.reduce((n,r)=>n.concat(n.map(i=>[...i,r])),[[]]).filter(n=>t||n.length>0),w_=e=>{var t,n;switch(e.type){case O.MultipleSelect:return!e||!e.props||!e.props.options?null:e.props.options.length>__?e.props.options.map(r=>[r.value]):b_(e.props.options.map(r=>r.value),!e.props.properties.required);case O.MultipleChoice:{if(!e||!e.props||!e.props.options)return null;const r=e.props.options.map(i=>i.value);return e.props.properties.required||r.push(void 0),r}case O.Likert:{const r=Number((n=(t=e.props)==null?void 0:t.properties)==null?void 0:n.range)||5;return[...Array.from(Array(r).keys()).map(o=>o+1),...e.props.properties.required?[]:[null]]}case O.NPS:return[0,1,2,3,4,5,6,7,8,9,10,...e.props.properties.required?[]:[null]];case O.VideoVoice:case O.Open:return["1",...e.props.properties.required?[]:[""]];case O.RecordedTask:return[{taskStatus:Ye.Completed},{taskStatus:Ye.GivenUp},...e.props.properties.required?[]:[{taskStatus:Ye.Abandoned}]];case O.TextUrlPrompt:return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case O.ConsentLegal:return[yu,...e.props.properties.required?[]:[null]];default:return[yu]}},C_=e=>e in Rs,E_=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,S_=(e,t=[])=>t.reduce((n,r)=>{const{group:i,target:o}=r;if(!(i!=null&&i.length))return[...n];const a=i.filter(s=>Number(s)?!0:typeof s=="object"?s.questionIndex===e:!1).map(s=>{const{comparator:l,value:u}=s;return{comparator:l,target:o,value:u}});return[...n,...a]},[]),I_=(e,t)=>{const n=new Set([O.Thanks,O.Uploading]);if(t>=e.length||t<0||n.has(e[t].type))return 0;const r=e.filter(o=>!n.has(o.type));if(t===r.length-1)return 1;const i={[r.length-1]:1,[-1]:0};for(let o=r.length-2;o>=t;o--){const a=r[o],s=S_(o,a.props.routingOptions);if(s.length===0){i[o]=i[o+1]+1;continue}let l=0,u=w_(a);if(u===null)return r.length-1-t;for(let c=0;c<s.length&&u.length!==0;c++){const{comparator:d,target:p,value:f}=s[c],h=u.filter(m=>{const g=y_({value:m},a.type,m);return!(g&&d===It.Answered||!g&&d===It.Skipped||d===It.GivenUp&&E_(m)&&m.taskStatus===Ye.GivenUp||g&&a.type===O.Open&&(d===It.Contains||d===It.DoesNotContain)||g&&C_(d)&&Rs[d](m,f))});if(h.length<u.length){const m=parseInt(String(p),10);if(m!==-1&&m<=o||m>=r.length)return r.length-1-t;l=Math.max(i[m]+1,l)}u=h}u.length>0&&(l=Math.max(i[o+1]+1,l)),i[o]=l}return i[t]},k_=e=>!(e.type===O.Thanks||e.type===O.Uploading),ce=Lf()((e,t)=>({allResponses:[],answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=Nn)=>{const r=t(),{fadeout:i,remove:o,trackHistory:a}=r;await i(n),Mo(r)||a({event:"closed"}),Xo.enable(),o({initiator:dt.Closed})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:i,remove:o}=t();r(Qe.SurveyComplete),await i(n),Xo.enable(),o({initiator:dt.Complete})},endCard:{headline:""},envId:"",eventEmitFn:Z.emit.bind(Z),fadeout:async n=>{const{eventEmitFn:r,headers:i,viewDocument:o}=t();return Dn(i)?Promise.resolve():(r(G.SurveyFadingOut),new Promise(a=>{const s=o.getElementById(n);s?(s.addEventListener("transitionend",()=>{a()}),s.classList.remove("ul-app--visible")):a()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:i,index:o}=t();i(n,{[ln.QuestionId]:r[o].name,[ln.Props]:r[o].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:i,isSubmitted:o})=>{var p,f,h;const{cards:a,destroy:s,index:l,uploadProgress:u}=t(),c={...u,[n]:{progressPct:i||i===0?i:(p=u[n])==null?void 0:p.progressPct,isComplete:r||((f=u[n])==null?void 0:f.isComplete),isSubmitted:o||((h=u[n])==null?void 0:h.isSubmitted)}};if(a[l].type!==O.Uploading){e({uploadProgress:c});return}const d=Object.entries(u).every(([m,g])=>!g.isSubmitted||g.isComplete||n==m&&r);if(d&&l>=a.length-1){s(Nn);return}e({index:d?l+1:l,uploadingCardViewed:!0,uploadProgress:c})},hasViewedEmbed:!1,headers:{Authorization:"","Content-Type":"","userleap-platform":mn.Web,"x-ul-environment-id":"","x-ul-installation-method":Tt.Snippet,"x-ul-sdk-version":"","x-ul-visitor-id":""},index:0,isPreview:!1,marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:n=>{const{allResponses:r,cards:i,eventEmitFn:o,index:a,responseGroupUid:s,submit:l,trackHistory:u,uploadProgress:c,viewedCardCount:d}=t(),p=Date.now(),f=[...i],h=f[a],{type:m}=n.data,g={...n.data},b=g.value;k_(h)&&(h.value=b),g.answeredAt=p,delete g.type;const y={response:g,responseGroupUid:s,questionIndex:a};let _=m===O.MultipleChoice?Object.values(b).find(S=>S!==!1):b;m===O.MultipleSelect&&(_=f[a].props.options.reduce((S,x)=>(b[x.id]&&S.push(x.value),S),[]));const v=r.slice(0);v[a]=_,e({allResponses:v});const w=Of({cards:f,index:a,hasEndCard:!!n.endCard,uploadProgress:c,allResponses:v});if(w===null){y.completedAt=p,l(y),n.completeSurvey();return}else[O.Thanks,O.Uploading].includes(f[w].type)&&(y.completedAt=p);const E=l(y);[O.Thanks,O.Uploading].includes(f[w].type)||E.finally(()=>{u({event:"seen",index:w})});const I=f[w];f[w]&&o&&o(Qe.CurrentQuestion,{[ln.QuestionId]:I.name,[ln.Props]:I.props}),e({cards:f,hasViewedEmbed:!1,index:w,viewedCardCount:d+1})},previewKey:null,recorder:()=>{},recorderEventEmitter:Z,responseGroupUid:"",remove:({initiator:n})=>{const{frame:r,headers:i,eventEmitFn:o}=t();["ios","android"].includes(i["userleap-platform"])&&o(G.SurveyWillClose,{name:G.SurveyWillClose,initiator:n}),!Dn(i)&&(o(G.SurveyWillClose,{name:G.SurveyWillClose,initiator:n}),r.remove())},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,questionIndex:r,response:i,responseGroupUid:o})=>{const a=t();if(!o||Mo(a))return;const s={responseGroupUid:o,meta:a.meta,customMetadata:a.customMetadata,responses:[i],completedAt:n,previewKey:a.previewKey};n&&j0({id:a.surveyId});const l=await Rt(`${a.apiURL}/sdk/1/environments/${a.envId}/visitors/${a.userId}/responses/submit`,{body:JSON.stringify(s),headers:a.headers,method:"POST"});if(!l.ok){l.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",l.error),await bu(a,"submitResponse",l.error));return}a.eventEmitFn(G.QuestionAnswered,{...i,questionIndex:r})},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:i=!1})=>{const o=t();if(Mo(o))return;const{cards:a,index:s}=o,l=r!==void 0?a[r]:a[s],u={sid:o.surveyId,qid:l.name,action:n,vid:o.userId,eid:o.envId,isNew:i,responseGroupUid:o.responseGroupUid,previewKey:o.previewKey},c=await Rt(`${o.apiURL}/sdk/1/visitors/${o.userId}/surveys/${o.surveyId}/history`,{body:JSON.stringify(u),headers:o.headers,method:"POST"});!c.ok&&c.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",c.error),await bu(o,"trackHistory",c.error))},update:()=>{const{headers:n,eventEmitFn:r,frame:i,viewDocument:o}=t();setTimeout(()=>{var s;const a=Hc(o);Dn(n)?r(G.SurveyHeight,{name:G.SurveyHeight,contentFrameHeight:a}):(s=i.setHeight)==null||s.call(i,a)},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),Mo=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview,bu=async(e,t,n)=>{const{mode:r,userId:i,envId:o,apiURL:a,headers:s,viewDocument:l}=e,u=l.documentElement,c={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:u.clientWidth,clientHeight:u.clientHeight,location:window.location.href,language:window.navigator.language},d={action:t,err:{message:n==null?void 0:n.message,stack:n==null?void 0:n.stack},meta:c,vid:i,envId:o};(await Rt(`${a}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},s),body:JSON.stringify(d)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},x_=async(e,t)=>{var r;const n=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok){const i=await n.json();return(r=i==null?void 0:i.upload)==null?void 0:r.url}else return null},Nf=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",wu=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:Nf()};return new MediaRecorder(e,t)},Cu=(e,t,n)=>{n[t]=[],e.ondataavailable=function(r){n[t].push(r.data)},e.currentMediaRecordingUid=t,e.start()};function Eu(e,t,n,r,i,o){if(e&&e.state!=="inactive"){const{[Y.BeginCallback]:a}=r,s=e.currentMediaRecordingUid;if(!s)return;a&&a(s),e.onstop=()=>A_(t,e,n,r,s,i,o),e.stop()}}async function A_(e,t,n,r,i,o,a){const s=ce.getState().viewDocument,{[Y.UploadCallback]:l,[Y.ProgressCallback]:u}=r,c={mediaType:n,updatedAt:new Date().toISOString(),mediaRecordingUid:i,...r[Y.PassthroughData]},d=await x_(c,e);if(!d){l&&l(null,{message:"failed to get upload url"});return}const p=new Blob(a,{type:Nf()});if(!s.defaultView)return;const f=new s.defaultView.File([p],`recording video ${Date.now()}`),h=o.createUpload({endpoint:d,file:f,chunkSize:5120});h.on("error",m=>{l&&l(null,m)}),h.on("progress",m=>{u&&u(i,m)}),h.on("success",()=>{l&&l(i,!0)})}const T_={chunks:{}},R_={state:{...T_},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:n,screenRecorder:r,UpChunk:i}=this.state,o=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?nt.Video:nt.Audio;this.state.chunks&&t&&i&&(n!=null&&n.currentMediaRecordingUid&&Eu(n,t,o,e,i,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]),r!=null&&r.currentMediaRecordingUid&&Eu(r,t,nt.Screen,e,i,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),n=e.getAudioTracks();let r=t.length&&t[0];r=r||n.length&&n[0],r&&r.addEventListener("ended",()=>{[this.state.avRecorder,this.state.screenRecorder].map(i=>{i&&(i.state==="recording"&&i.stop(),i.stream.getTracks().map(o=>{o.readyState==="live"&&o.stop()}))}),Object.assign(this.state,{avStream:null,captureStream:null,avRecorder:null,screenRecorder:null})})},taskDurationMillisecond(){return this.state.startTime?new Date().getTime()-this.state.startTime.getTime():0},setUpChunk(e){this.state.UpChunk=e},configure(e,t){Object.assign(this.state,t),this.state.uploadApiEndpoint=`${t.apiURL}/2/environments/integrations/upload`,this.state.chunks={},e.on(Te.PermissionStatus,this.permissionStatusCallback.bind(this)),e.on(Te.AvPermission,async n=>{this.avPermissionCallback(n)}),e.on(Te.BeginRecording,this.beginRecordingCallback.bind(this)),e.on(Te.StartTask,this.startTaskCallback.bind(this)),e.on(Te.ScreenPermission,async n=>{this.screenPermissionCallback(n)}),e.on(Te.FinishTask,async n=>{this.finishTaskCallback(n)})},async avPermissionCallback(e){var r,i,o;const{[Y.StreamReadyCallback]:t,[Y.PermissionDescriptors]:n}=e;try{(r=this.state.avStream)!=null&&r.active&&(this.state.avStream.getTracks().map(a=>a.readyState==="live"&&a.stop()),((i=this.state.captureStream)==null?void 0:i.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:n.includes(Hn.Camera),audio:!0}),((o=this.state.captureStream)==null?void 0:o.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream)}catch(a){console.warn("Error: failed to get permissions: "+a),t&&t(null,null);return}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{[Y.ScreenPermissionRequested]:t,[Y.StreamReadyCallback]:n}=e;t==null||t(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(r){t==null||t(!1),console.warn("Error: failed to get permissions: "+r),n&&n(null,null);return}t==null||t(!1),this.state.avStream&&this.state.avStream.getAudioTracks().length>0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.captureStream),n&&n(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{[Y.RecordingMediaTypes]:t,[Y.StartRecordingCallback]:n}=e;if(!t)return;const r=[];if(t.includes(nt.Video)&&this.state.avStream){this.state.avRecorder=wu(this.state.avStream);const i=Kt();Cu(this.state.avRecorder,i,this.state.chunks),r.push(i)}if(t.includes(nt.Screen)&&this.state.captureStream){this.state.screenRecorder=wu(this.state.captureStream);const i=Kt();Cu(this.state.screenRecorder,i,this.state.chunks),r.push(i)}r&&n&&n(r)},async finishTaskCallback(e){const{[Y.CurrentIndex]:t,[Y.TaskResponse]:n,[Y.TaskCompleteCallback]:r}=e;await this.stopRecording(e),r&&r(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,n,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var r;const{[Y.PermissionStatusCallback]:t}=e,n=this.state.avStream;t&&t(n,n?(n==null?void 0:n.getVideoTracks().length)>0:!1,!!((r=this.state.captureStream)!=null&&r.active),this.state.captureStream)},lookAheadAndStopStream(e,t,n,r){const{avRecorder:i,screenRecorder:o}=this.state,{allResponses:a}=ce.getState(),s=Of({cards:n,index:e,hasEndCard:r,allResponses:a});s!==null&&n[s].type===O.RecordedTask||[i,o].map(l=>{l&&(l.state==="recording"&&l.stop(),l.stream.getTracks().map(u=>{u.readyState==="live"&&u.stop()}))})}},pi=Object.create(R_);Object.freeze(pi);function Df(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Df(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function H(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Df(e))&&(r&&(r+=" "),r+=t);return r}var L_=0;function C(e,t,n,r,i,o){var a,s,l={};for(s in t)s=="ref"?a=t[s]:l[s]=t[s];var u={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--L_,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return P.vnode&&P.vnode(u),u}const Ge=e=>C("button",{...e,className:H("ul-card-text__button",e.className),id:"ul-card-text__button"}),vt=({message:e,properties:t})=>{const n=t==null?void 0:t.captionText;return C(Je,{children:[e&&C("h1",{className:N.QuestionHeader,id:N.QuestionHeader,...n?{}:{style:{marginBottom:"15px"}},children:e}),n&&C("p",{className:N.Caption,id:N.Caption,children:n})]})},Su=({buttonText:e="View Prototype",handleClick:t})=>C("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),Jt=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var d;const{handleClickEmbedButton:r,hasViewedEmbed:i,headers:o,useDesktopPrototype:a}=ce(p=>({handleClickEmbedButton:p.handleClickEmbedButton,hasViewedEmbed:p.hasViewedEmbed,headers:p.headers,useDesktopPrototype:p.useDesktopPrototype})),s=(n==null?void 0:n.conceptUrl)||((d=n==null?void 0:n.consentDocument)==null?void 0:d.url),l=window.innerWidth<hv,u=o["userleap-platform"],c=(p,f)=>{p.preventDefault(),r(f)};if(!a&&l&&!i&&s&&["email","link"].includes(u)){if(t==="prototype")return C(Su,{handleClick:p=>{c(p,Qe.ViewPrototypeClick)}});if(t==="pdf")return C(Su,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:p=>{c(p,Qe.ViewAgreementClick)}})}return e()},Uf=(e,t)=>{const n=Yt(0),r=()=>{if(e.current){const i=e.current;i.style.height="1px";const o=i.scrollHeight,a=i.offsetHeight-i.clientHeight,s=o+a,l=parseInt(window.getComputedStyle(i).getPropertyValue("max-height")),u=s<=l?s:l;n.current!==u&&t(),n.current=u,i.style.height=`${u}px`}};return Ze(r,[]),r},Pf=({border:e,label:t,isSelected:n,value:r,text:i,id:o,isRadio:a,useMobileStyling:s,error:l,allowTextEntry:u,promptText:c,onUserInputChanged:d})=>{const{styleNonce:p,viewDocument:f}=ce(x=>({styleNonce:x.styleNonce,viewDocument:x.viewDocument})),[h,m]=xe(!1);D_(f,e,p);const g=({isSelected:x,userText:T})=>{d&&d({id:o||"",selected:x,value:r,userText:T})},b=x=>{x.stopPropagation(),g({isSelected:a||!n,userText:i}),m(!1)},y=()=>{h||m(!0)},_=()=>{h&&m(!1)},v=x=>{ur(x.target)||(x.key==="Enter"||x.key===" ")&&b(x)},w={onClick:x=>b(x),onKeyPress:x=>v(x)};"ontouchstart"in f.documentElement?(w.onTouchStart=_,w.onTouchCancel=_,w.onTouchEnd=_):(w.onMouseDown=y,w.onMouseLeave=_);const E=a?`radio-${o}`:`checkbox-${o}`,I=n||h?[hi]:[],S=[...l?[Mf]:[],...I];return C("div",{className:H([..._e(N.Choice,s),...S]),id:`choice-div-${o}`,style:l?{borderColor:lr}:{},...w,children:[C("div",{className:H([N.ChoiceLabelContainer]),children:[a?C("div",{"aria-labelledby":`label-${o}`,className:H([N.ChoiceRadio,...I]),id:E,role:"radio",tabIndex:0}):C("div",{"aria-checked":n,"aria-labelledby":`label-${o}`,className:N.ChoiceCheckbox,id:E,role:"checkbox",style:n?{backgroundColor:e,borderColor:e,boxShadow:"none"}:{},tabIndex:0,children:n&&C("svg",{fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})}),C("label",{className:H(_e(N.ChoiceLabel,s)),htmlFor:E,id:`label-${o}`,children:t})]}),u&&n&&C("div",{className:H([N.ChoiceTextEntryContainer,...I]),children:C(O_,{onTextChange:x=>g({isSelected:n,userText:x}),promptText:c||"Please specify",textValue:i,useMobileStyling:s})})]})},O_=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const i=Yt(null),{update:o}=ce(s=>({update:s.update})),a=Uf(i,()=>o());return Ze(()=>{i.current&&i.current.focus()},[]),C("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:H(_e(N.ChoiceTextInput,r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:s=>{a(),ur(s.target)&&(s.stopPropagation(),n(s.target.value))},onClick:s=>{s.stopPropagation()},onKeyPress:s=>{s.stopPropagation()},placeholder:e,ref:i,role:"textbox",rows:1,value:t})},Iu="ul-select-style-element",hi="ul-select-active-dynamic-style",Mf="ul-select-error-dynamic-style",N_=e=>e.tagName.toLowerCase()==="style",D_=(e,t,n)=>{let r=e.getElementById(Iu),i=!1;r||(r=e.createElement("style"),i=!0),N_(r)&&(r.id=Iu,n&&(r.nonce=n),r.textContent=U_(t),i&&e.head.appendChild(r))},U_=e=>`
70
- .${hi} {
53
+ */var zi=Xd,F_=ef.exports;function V_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var B_=typeof Object.is=="function"?Object.is:V_,K_=F_.useSyncExternalStore,H_=zi.useRef,j_=zi.useEffect,G_=zi.useMemo,z_=zi.useDebugValue;Jd.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=H_(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=G_(function(){function u(f){if(!c){if(c=!0,l=f,f=r(f),i!==void 0&&a.hasValue){var h=a.value;if(i(h,f))return d=h}return d=f}if(h=d,B_(l,f))return h;var m=r(f);return i!==void 0&&i(h,m)?h:(l=f,d=m)}var c=!1,l,d,p=n===void 0?null:n;return[function(){return u(t())},p===null?void 0:function(){return u(p())}]},[t,n,r,i]);var s=K_(e,o[0],o[1]);return j_(function(){a.hasValue=!0,a.value=s},[s]),z_(s),s};(function(e){e.exports=Jd})(Qd);const W_=xh(Qd.exports),{useSyncExternalStoreWithSelector:q_}=W_;function $_(e,t=e.getState,n){const r=q_(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return as(r),r}const Gu=e=>{const t=typeof e=="function"?f_(e):e,n=(r,i)=>$_(t,r,i);return Object.assign(n,t),n},nf=e=>e?Gu(e):Gu;var pa=(e=>(e[e.And=1]="And",e[e.Or=2]="Or",e))(pa||{});const zu=1,cs={eq(e,t){return e==t},neq(e,t){return!this.eq(e,t)},gt(e,t){return e>t},gte(e,t){return e>=t},lt(e,t){return e<t},lte(e,t){return e<=t},list_exact(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:e.slice().sort().join(",")===t.slice().sort().join(",")},list_all(e,t){return!Array.isArray(e)||!Array.isArray(t)?!1:!t.some(n=>e.indexOf(n)===-1)},list_alo(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.some(i=>r.has(i))},list_dni(e,t){if(!Array.isArray(t))return!1;const n=Array.isArray(e)?e:[e],r=new Set(n);return t.every(i=>!r.has(i))},contains(e,t){const n=e.toLowerCase(),r=t.toLowerCase();return n.includes(r)},notcontains(e,t){return!this.contains(e,t)}},Y_=(e,t,n)=>{switch(t){case R.VideoVoice:return Boolean(e&&e.value);case R.Open:return!!n;case R.MultipleSelect:return Boolean(n&&!!Object.keys(n).length);case R.RecordedTask:return(n==null?void 0:n.taskStatus)===ze.Completed;case R.TextUrlPrompt:return!e.value;case R.ConsentLegal:return n!==null;case R.MultipleChoice:return n!==void 0;case R.NPS:return n!==null;case R.Likert:return n!==null;default:return!0}},rf=({cards:e,index:t,hasEndCard:n,allResponses:r,uploadProgress:i={}})=>{if(t>=e.length||t<0)return null;const o=e[t];let a=t+1;const s=o.props.routingOptions||[];for(let l=0;l<s.length;l++){const{group:d,target:p}=s[l];if(!(d!=null&&d.length))continue;const f=d[0];if(f.questionIndex===void 0||f.questionIndex>r.length)continue;let h=Wu({comparator:f.comparator,response:r[f.questionIndex],type:o.type,value:f.value});for(let m=1;m<d.length;m+=2){const g=d[m],w=d[m+1],y=Wu({comparator:w.comparator,response:r[w.questionIndex],type:e[w.questionIndex].type,value:w.value});g===pa.And?h&&(h=y):g===pa.Or&&(h||(h=y))}if(h){a=p===-1&&n?e.length-1:p;break}}const u=e.findIndex(l=>l.type===R.Uploading);let c;return u>0?c=n?e.length-3:e.length-2:c=e.length-1,t>=c||a===-1||a!==null&&a>c?u>0&&Object.values(i).some(d=>d.isSubmitted&&!d.isComplete)?u:n?e.length-1:null:a===-1?null:a},Wu=({comparator:e,response:t,type:n,value:r})=>{if(e===yt.Answered)switch(n){case R.TextUrlPrompt:return t===void 0;case R.ConsentLegal:return t&&t.submitted===!0;case R.RecordedTask:return"taskStatus"in t&&t.taskStatus===ze.Completed;case R.Likert:return Number.isInteger(t);case R.Open:return t&&t.length>0;case R.MultipleChoice:case R.MultipleSelect:return Object.keys(t).length>0;case R.NPS:return Number.isInteger(t);case R.VideoVoice:return!!(t!=null&&t.mediaRecordingUid);default:return!1}if(e===yt.Skipped)switch(n){case R.TextUrlPrompt:return t==null?void 0:t.skipped;case R.ConsentLegal:return t===null;case R.RecordedTask:return"taskStatus"in t&&t.taskStatus===ze.Abandoned;case R.Likert:return t===null;case R.Open:return(t==null?void 0:t.length)===0;case R.MultipleChoice:return t===void 0;case R.MultipleSelect:return(t==null?void 0:t.length)===0;case R.NPS:return t===null;case R.VideoVoice:return t===null;default:return!1}return e===yt.GivenUp?n===R.RecordedTask?"taskStatus"in t&&t.taskStatus===ze.GivenUp:!0:cs[e](t,r)},Z_=13,Q_=(e,t)=>e.reduce((n,r)=>n.concat(n.map(i=>[...i,r])),[[]]).filter(n=>t||n.length>0),J_=e=>{var t,n;switch(e.type){case R.MultipleSelect:return!e||!e.props||!e.props.options?null:e.props.options.length>Z_?e.props.options.map(r=>[r.value]):Q_(e.props.options.map(r=>r.value),!e.props.properties.required);case R.MultipleChoice:{if(!e||!e.props||!e.props.options)return null;const r=e.props.options.map(i=>i.value);return e.props.properties.required||r.push(void 0),r}case R.Likert:{const r=Number((n=(t=e.props)==null?void 0:t.properties)==null?void 0:n.range)||5;return[...Array.from(Array(r).keys()).map(o=>o+1),...e.props.properties.required?[]:[null]]}case R.NPS:return[0,1,2,3,4,5,6,7,8,9,10,...e.props.properties.required?[]:[null]];case R.VideoVoice:case R.Open:return["1",...e.props.properties.required?[]:[""]];case R.RecordedTask:return[{taskStatus:ze.Completed},{taskStatus:ze.GivenUp},...e.props.properties.required?[]:[{taskStatus:ze.Abandoned}]];case R.TextUrlPrompt:return[void 0,...e.props.properties.required?[]:[{skipped:!0}]];case R.ConsentLegal:return[zu,...e.props.properties.required?[]:[null]];default:return[zu]}},X_=e=>e in cs,e0=e=>typeof e=="object"&&e!==null&&"taskStatus"in e,t0=(e,t=[])=>t.reduce((n,r)=>{const{group:i,target:o}=r;if(!(i!=null&&i.length))return[...n];const a=i.filter(s=>Number(s)?!0:typeof s=="object"?s.questionIndex===e:!1).map(s=>{const{comparator:u,value:c}=s;return{comparator:u,target:o,value:c}});return[...n,...a]},[]),n0=(e,t)=>{const n=new Set([R.Thanks,R.Uploading]);if(t>=e.length||t<0||n.has(e[t].type))return 0;const r=e.filter(o=>!n.has(o.type));if(t===r.length-1)return 1;const i={[r.length-1]:1,[-1]:0};for(let o=r.length-2;o>=t;o--){const a=r[o],s=t0(o,a.props.routingOptions);if(s.length===0){i[o]=i[o+1]+1;continue}let u=0,c=J_(a);if(c===null)return r.length-1-t;for(let l=0;l<s.length&&c.length!==0;l++){const{comparator:d,target:p,value:f}=s[l],h=c.filter(m=>{const g=Y_({value:m},a.type,m);return!(g&&d===yt.Answered||!g&&d===yt.Skipped||d===yt.GivenUp&&e0(m)&&m.taskStatus===ze.GivenUp||g&&a.type===R.Open&&(d===yt.Contains||d===yt.DoesNotContain)||g&&X_(d)&&cs[d](m,f))});if(h.length<c.length){const m=parseInt(String(p),10);if(m!==-1&&m<=o||m>=r.length)return r.length-1-t;u=Math.max(i[m]+1,u)}c=h}c.length>0&&(u=Math.max(i[o+1]+1,u)),i[o]=u}return i[t]},r0=e=>!(e.type===R.Thanks||e.type===R.Uploading),le=nf()((e,t)=>({allResponses:[],answers:void 0,apiURL:"",border:"#000000",cards:[],close:async(n=Cn)=>{const r=t(),{fadeout:i,remove:o,trackHistory:a}=r;await i(n),wo(r)||a({event:"closed"}),No.enable(),o({initiator:st.Closed})},configureExitOnOverlayClick:()=>{},customMetadata:{},destroy:async n=>{const{eventEmitFn:r,fadeout:i,remove:o}=t();r(qe.SurveyComplete),await i(n),No.enable(),o({initiator:st.Complete})},endCard:{headline:""},envId:"",eventEmitFn:z.emit.bind(z),fadeout:async n=>{const{eventEmitFn:r,headers:i,viewDocument:o}=t();return En(i)?Promise.resolve():(r(K.SurveyFadingOut),new Promise(a=>{const s=o.getElementById(n);s?(s.addEventListener("transitionend",()=>{a()}),s.classList.remove("ul-app--visible")):a()}))},forceBrandedLogo:!1,frame:document.createElement("iframe"),handleClickEmbedButton:n=>{const{cards:r,eventEmitFn:i,index:o}=t();i(n,{[Yt.QuestionId]:r[o].name,[Yt.Props]:r[o].props}),e(()=>({hasViewedEmbed:!0}))},handleUploadUpdate:({mediaRecordingUid:n,isComplete:r,progressPct:i,isSubmitted:o})=>{var p,f,h;const{cards:a,destroy:s,index:u,uploadProgress:c}=t(),l={...c,[n]:{progressPct:i||i===0?i:(p=c[n])==null?void 0:p.progressPct,isComplete:r||((f=c[n])==null?void 0:f.isComplete),isSubmitted:o||((h=c[n])==null?void 0:h.isSubmitted)}};if(a[u].type!==R.Uploading){e({uploadProgress:l});return}const d=Object.entries(c).every(([m,g])=>!g.isSubmitted||g.isComplete||n==m&&r);if(d&&u>=a.length-1){s(Cn);return}e({index:d?u+1:u,uploadingCardViewed:!0,uploadProgress:l})},hasViewedEmbed:!1,headers:{Authorization:"","Content-Type":"","userleap-platform":on.Web,"x-ul-environment-id":"","x-ul-installation-method":Xt.Snippet,"x-ul-sdk-version":"","x-ul-visitor-id":""},index:0,isPreview:!1,marketingUrl:"https://sprig.com",meta:{ch:0,cw:0,l:"",mode:null,p:"",sh:0,sw:0},mode:void 0,next:n=>{const{allResponses:r,cards:i,eventEmitFn:o,index:a,responseGroupUid:s,submit:u,trackHistory:c,uploadProgress:l,viewedCardCount:d}=t(),p=Date.now(),f=[...i],h=f[a],{type:m}=n.data,g={...n.data},w=g.value;r0(h)&&(h.value=w),g.answeredAt=p,delete g.type;const y={response:g,responseGroupUid:s,questionIndex:a};let v=m===R.MultipleChoice?Object.values(w).find(I=>I!==!1):w;m===R.MultipleSelect&&(v=f[a].props.options.reduce((I,E)=>(w[E.id]&&I.push(E.value),I),[]));const b=r.slice(0);b[a]=v,e({allResponses:b});const _=rf({cards:f,index:a,hasEndCard:!!n.endCard,uploadProgress:l,allResponses:b});if(_===null){y.completedAt=p,u(y),n.completeSurvey();return}else[R.Thanks,R.Uploading].includes(f[_].type)&&(y.completedAt=p);const C=u(y);[R.Thanks,R.Uploading].includes(f[_].type)||C.finally(()=>{c({event:"seen",index:_})});const k=f[_];f[_]&&o&&o(qe.CurrentQuestion,{[Yt.QuestionId]:k.name,[Yt.Props]:k.props}),e({cards:f,hasViewedEmbed:!1,index:_,viewedCardCount:d+1})},previewKey:null,recorder:()=>{},recorderEventEmitter:z,responseGroupUid:"",remove:({initiator:n})=>{const{frame:r,headers:i,eventEmitFn:o}=t();["ios","android"].includes(i["userleap-platform"])&&o(K.SurveyWillClose,{name:K.SurveyWillClose,initiator:n}),!En(i)&&(o(K.SurveyWillClose,{name:K.SurveyWillClose,initiator:n}),r.remove())},seen:async()=>{const{trackHistory:n}=t();return n({event:"seen",isNew:!0})},slugName:null,showStripes:!1,showSurveyBrand:!1,styleNonce:"",submit:async({completedAt:n,questionIndex:r,response:i,responseGroupUid:o})=>{const a=t();if(!o||wo(a))return;const s={responseGroupUid:o,meta:a.meta,customMetadata:a.customMetadata,responses:[i],completedAt:n,previewKey:a.previewKey};n&&o_({id:a.surveyId});const u=await wt(`${a.apiURL}/sdk/1/environments/${a.envId}/visitors/${a.userId}/responses/submit`,{body:JSON.stringify(s),headers:a.headers,method:"POST"});if(!u.ok){u.reportError&&(console.warn("[Sprig] (ERR-427) Failed to submit response",u.error),await qu(a,"submitResponse",u.error));return}a.eventEmitFn(K.QuestionAnswered,{...i,questionIndex:r})},surveyId:0,tabTitle:"",trackHistory:async({event:n,index:r,isNew:i=!1})=>{const o=t();if(wo(o))return;const{cards:a,index:s}=o,u=r!==void 0?a[r]:a[s],c={sid:o.surveyId,qid:u.name,action:n,vid:o.userId,eid:o.envId,isNew:i,responseGroupUid:o.responseGroupUid,previewKey:o.previewKey},l=await wt(`${o.apiURL}/sdk/1/visitors/${o.userId}/surveys/${o.surveyId}/history`,{body:JSON.stringify(c),headers:o.headers,method:"POST"});!l.ok&&l.reportError&&(console.warn("[Sprig] (ERR-428) Failed to track survey event",l.error),await qu(o,"trackHistory",l.error))},update:()=>{const{headers:n,eventEmitFn:r,frame:i,viewDocument:o}=t();setTimeout(()=>{var s;const a=dc(o);En(n)?r(K.SurveyHeight,{name:K.SurveyHeight,contentFrameHeight:a}):(s=i.setHeight)==null||s.call(i,a)},100)},uploadingCardViewed:!1,uploadProgress:{},useDesktopPrototype:void 0,useMobileStyling:!1,userId:"",viewDocument:window.document,viewedCardCount:0})),wo=e=>!e.userId||e.meta&&e.meta.mode==="test"||e.isPreview,qu=async(e,t,n)=>{const{mode:r,userId:i,envId:o,apiURL:a,headers:s,viewDocument:u}=e,c=u.documentElement,l={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:c.clientWidth,clientHeight:c.clientHeight,location:window.location.href,language:window.navigator.language},d={action:t,err:{message:n==null?void 0:n.message,stack:n==null?void 0:n.stack},meta:l,vid:i,envId:o};(await wt(`${a}/sdk/1/errors`,{method:"POST",headers:Object.assign({"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},s),body:JSON.stringify(d)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},i0=async(e,t)=>{var r;const n=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(n.ok){const i=await n.json();return(r=i==null?void 0:i.upload)==null?void 0:r.url}else return null},of=()=>MediaRecorder.isTypeSupported("video/webm")?"video/webm":"video/mp4",$u=e=>{const t={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:of()};return new MediaRecorder(e,t)},Yu=(e,t,n)=>{n[t]=[],e.ondataavailable=function(r){n[t].push(r.data)},e.currentMediaRecordingUid=t,e.start()};function Zu(e,t,n,r,i,o){if(e&&e.state!=="inactive"){const{[G.BeginCallback]:a}=r,s=e.currentMediaRecordingUid;if(!s)return;a&&a(s),e.onstop=()=>o0(t,e,n,r,s,i,o),e.stop()}}async function o0(e,t,n,r,i,o,a){const s=le.getState().viewDocument,{[G.UploadCallback]:u,[G.ProgressCallback]:c}=r,l={mediaType:n,updatedAt:new Date().toISOString(),mediaRecordingUid:i,...r[G.PassthroughData]},d=await i0(l,e);if(!d){u&&u(null,{message:"failed to get upload url"});return}const p=new Blob(a,{type:of()});if(!s.defaultView)return;const f=new s.defaultView.File([p],`recording video ${Date.now()}`),h=o.createUpload({endpoint:d,file:f,chunkSize:5120});h.on("error",m=>{u&&u(null,m)}),h.on("progress",m=>{c&&c(i,m)}),h.on("success",()=>{u&&u(i,!0)})}const a0={chunks:{}},s0={state:{...a0},stopRecording(e){const{uploadApiEndpoint:t,avRecorder:n,screenRecorder:r,UpChunk:i}=this.state,o=this.state.avStream&&this.state.avStream.getVideoTracks().length>0?Je.Video:Je.Audio;this.state.chunks&&t&&i&&(n!=null&&n.currentMediaRecordingUid&&Zu(n,t,o,e,i,this.state.chunks[n==null?void 0:n.currentMediaRecordingUid]),r!=null&&r.currentMediaRecordingUid&&Zu(r,t,Je.Screen,e,i,this.state.chunks[r==null?void 0:r.currentMediaRecordingUid]))},handleCancelledStream(e){const t=e.getVideoTracks(),n=e.getAudioTracks();let r=t.length&&t[0];r=r||n.length&&n[0],r&&r.addEventListener("ended",()=>{[this.state.avRecorder,this.state.screenRecorder].map(i=>{i&&(i.state==="recording"&&i.stop(),i.stream.getTracks().map(o=>{o.readyState==="live"&&o.stop()}))}),Object.assign(this.state,{avStream:null,captureStream:null,avRecorder:null,screenRecorder:null})})},taskDurationMillisecond(){return this.state.startTime?new Date().getTime()-this.state.startTime.getTime():0},setUpChunk(e){this.state.UpChunk=e},configure(e,t){Object.assign(this.state,t),this.state.uploadApiEndpoint=`${t.apiURL}/2/environments/integrations/upload`,this.state.chunks={},e.on(Ee.PermissionStatus,this.permissionStatusCallback.bind(this)),e.on(Ee.AvPermission,async n=>{this.avPermissionCallback(n)}),e.on(Ee.BeginRecording,this.beginRecordingCallback.bind(this)),e.on(Ee.StartTask,this.startTaskCallback.bind(this)),e.on(Ee.ScreenPermission,async n=>{this.screenPermissionCallback(n)}),e.on(Ee.FinishTask,async n=>{this.finishTaskCallback(n)})},async avPermissionCallback(e){var r,i,o;const{[G.StreamReadyCallback]:t,[G.PermissionDescriptors]:n}=e;try{(r=this.state.avStream)!=null&&r.active&&(this.state.avStream.getTracks().map(a=>a.readyState==="live"&&a.stop()),((i=this.state.captureStream)==null?void 0:i.getAudioTracks().length)===1&&this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])),this.state.avStream=await navigator.mediaDevices.getUserMedia({video:n.includes(Un.Camera),audio:!0}),((o=this.state.captureStream)==null?void 0:o.getAudioTracks().length)===0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.avStream)}catch(a){console.warn("Error: failed to get permissions: "+a),t&&t(null,null);return}t&&t(this.state.avStream,this.state.captureStream)},async screenPermissionCallback(e){const{[G.ScreenPermissionRequested]:t,[G.StreamReadyCallback]:n}=e;t==null||t(!0);try{this.state.captureStream=await navigator.mediaDevices.getDisplayMedia({video:!0,cursor:"always",displaySurface:"browser",preferCurrentTab:!0})}catch(r){t==null||t(!1),console.warn("Error: failed to get permissions: "+r),n&&n(null,null);return}t==null||t(!1),this.state.avStream&&this.state.avStream.getAudioTracks().length>0&&this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]),this.handleCancelledStream(this.state.captureStream),n&&n(this.state.avStream||null,this.state.captureStream)},beginRecordingCallback(e){const{[G.RecordingMediaTypes]:t,[G.StartRecordingCallback]:n}=e;if(!t)return;const r=[];if(t.includes(Je.Video)&&this.state.avStream){this.state.avRecorder=$u(this.state.avStream);const i=rn();Yu(this.state.avRecorder,i,this.state.chunks),r.push(i)}if(t.includes(Je.Screen)&&this.state.captureStream){this.state.screenRecorder=$u(this.state.captureStream);const i=rn();Yu(this.state.screenRecorder,i,this.state.chunks),r.push(i)}r&&n&&n(r)},async finishTaskCallback(e){const{[G.CurrentIndex]:t,[G.TaskResponse]:n,[G.TaskCompleteCallback]:r}=e;await this.stopRecording(e),r&&r(this.taskDurationMillisecond()),this.state.cards&&this.state.hasEndCard!==void 0&&this.lookAheadAndStopStream(t,n,this.state.cards,this.state.hasEndCard)},startTaskCallback(){this.state.startTime=new Date},permissionStatusCallback(e){var r;const{[G.PermissionStatusCallback]:t}=e,n=this.state.avStream;t&&t(n,n?(n==null?void 0:n.getVideoTracks().length)>0:!1,!!((r=this.state.captureStream)!=null&&r.active),this.state.captureStream)},lookAheadAndStopStream(e,t,n,r){const{avRecorder:i,screenRecorder:o}=this.state,{allResponses:a}=le.getState(),s=rf({cards:n,index:e,hasEndCard:r,allResponses:a});s!==null&&n[s].type===R.RecordedTask||[i,o].map(u=>{u&&(u.state==="recording"&&u.stop(),u.stream.getTracks().map(c=>{c.readyState==="live"&&c.stop()}))})}},ha=Object.create(s0);Object.freeze(ha);function af(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=af(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Y(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=af(e))&&(r&&(r+=" "),r+=t);return r}var u0=0;function S(e,t,n,r,i,o){var a,s,u={};for(s in t)s=="ref"?a=t[s]:u[s]=t[s];var c={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--u0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return D.vnode&&D.vnode(c),c}const Ye=e=>S("button",{...e,className:Y("ul-card-text__button",e.className),id:"ul-card-text__button"}),xt=({message:e,properties:t})=>{const n=t==null?void 0:t.captionText;return S($e,{children:[e&&S("h1",{className:O.QuestionHeader,id:O.QuestionHeader,...n?{}:{style:{marginBottom:"15px"}},children:e}),n&&S("p",{className:O.Caption,id:O.Caption,children:n})]})},Qu=({buttonText:e="View Prototype",handleClick:t})=>S("button",{className:"prototype-button",onClick:t,children:e},"prototype-btn"),fn=({defaultBody:e,embeddedType:t="prototype",properties:n})=>{var d;const{handleClickEmbedButton:r,hasViewedEmbed:i,headers:o,useDesktopPrototype:a}=le(p=>({handleClickEmbedButton:p.handleClickEmbedButton,hasViewedEmbed:p.hasViewedEmbed,headers:p.headers,useDesktopPrototype:p.useDesktopPrototype})),s=(n==null?void 0:n.conceptUrl)||((d=n==null?void 0:n.consentDocument)==null?void 0:d.url),u=window.innerWidth<Og,c=o["userleap-platform"],l=(p,f)=>{p.preventDefault(),r(f)};if(!a&&u&&!i&&s&&["email","link"].includes(c)){if(t==="prototype")return S(Qu,{handleClick:p=>{l(p,qe.ViewPrototypeClick)}});if(t==="pdf")return S(Qu,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:p=>{l(p,qe.ViewAgreementClick)}})}return e()},sf=(e,t)=>{const n=Vt(0),r=()=>{if(e.current){const i=e.current;i.style.height="1px";const o=i.scrollHeight,a=i.offsetHeight-i.clientHeight,s=o+a,u=parseInt(window.getComputedStyle(i).getPropertyValue("max-height")),c=s<=u?s:u;n.current!==c&&t(),n.current=c,i.style.height=`${c}px`}};return We(r,[]),r},uf=({border:e,label:t,isSelected:n,value:r,text:i,id:o,isRadio:a,useMobileStyling:s,error:u,allowTextEntry:c,promptText:l,onUserInputChanged:d})=>{const{styleNonce:p,viewDocument:f}=le(E=>({styleNonce:E.styleNonce,viewDocument:E.viewDocument})),[h,m]=Ve(!1);d0(f,e,p);const g=({isSelected:E,userText:x})=>{d&&d({id:o||"",selected:E,value:r,userText:x})},w=E=>{E.stopPropagation(),g({isSelected:a||!n,userText:i}),m(!1)},y=()=>{h||m(!0)},v=()=>{h&&m(!1)},b=E=>{er(E.target)||(E.key==="Enter"||E.key===" ")&&w(E)},_={onClick:E=>w(E),onKeyPress:E=>b(E)};"ontouchstart"in f.documentElement?(_.onTouchStart=v,_.onTouchCancel=v,_.onTouchEnd=v):(_.onMouseDown=y,_.onMouseLeave=v);const C=a?`radio-${o}`:`checkbox-${o}`,k=n||h?[ii]:[],I=[...u?[lf]:[],...k];return S("div",{className:Y([...ve(O.Choice,s),...I]),id:`choice-div-${o}`,style:u?{borderColor:Xn}:{},..._,children:[S("div",{className:Y([O.ChoiceLabelContainer]),children:[a?S("div",{"aria-labelledby":`label-${o}`,className:Y([O.ChoiceRadio,...k]),id:C,role:"radio",tabIndex:0}):S("div",{"aria-checked":n,"aria-labelledby":`label-${o}`,className:O.ChoiceCheckbox,id:C,role:"checkbox",style:n?{backgroundColor:e,borderColor:e,boxShadow:"none"}:{},tabIndex:0,children:n&&S("svg",{fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg",children:S("path",{d:"M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})}),S("label",{className:Y(ve(O.ChoiceLabel,s)),htmlFor:C,id:`label-${o}`,children:t})]}),c&&n&&S("div",{className:Y([O.ChoiceTextEntryContainer,...k]),children:S(l0,{onTextChange:E=>g({isSelected:n,userText:E}),promptText:l||"Please specify",textValue:i,useMobileStyling:s})})]})},l0=({promptText:e,textValue:t,onTextChange:n,useMobileStyling:r})=>{const i=Vt(null),{update:o}=le(s=>({update:s.update})),a=sf(i,()=>o());return We(()=>{i.current&&i.current.focus()},[]),S("textarea",{"aria-label":e,"aria-multiline":"true","aria-placeholder":e,className:Y(ve(O.ChoiceTextInput,r)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:s=>{a(),er(s.target)&&(s.stopPropagation(),n(s.target.value))},onClick:s=>{s.stopPropagation()},onKeyPress:s=>{s.stopPropagation()},placeholder:e,ref:i,role:"textbox",rows:1,value:t})},Ju="ul-select-style-element",ii="ul-select-active-dynamic-style",lf="ul-select-error-dynamic-style",c0=e=>e.tagName.toLowerCase()==="style",d0=(e,t,n)=>{let r=e.getElementById(Ju),i=!1;r||(r=e.createElement("style"),i=!0),c0(r)&&(r.id=Ju,n&&(r.nonce=n),r.textContent=f0(t),i&&e.head.appendChild(r))},f0=e=>`
54
+ .${ii} {
71
55
  border-color: ${e};
72
56
  }
73
- .${hi} .${N.ChoiceRadio}, .${hi}.${N.ChoiceRadio} {
57
+ .${ii} .${O.ChoiceRadio}, .${ii}.${O.ChoiceRadio} {
74
58
  border: 6px solid ${e};
75
59
  box-shadow: none;
76
60
  }
77
- .${Mf} {
78
- border-color: ${lr};
61
+ .${lf} {
62
+ border-color: ${Xn};
79
63
  }
80
- `,Jn=e=>(e==null?void 0:e.buttonText)||"Next",Ls=e=>(e==null?void 0:e.skipButtonText)||"Skip",P_=({className:e,message:t,next:n,properties:r,questionId:i,type:o})=>{const{headers:a,useMobileStyling:s,border:l}=ce(A=>({headers:A.headers,useMobileStyling:A.useMobileStyling,border:A.border})),[u,c]=xe(!1),[d,p]=xe(""),[f,h]=xe(!1),m=a["userleap-platform"],g=r==null?void 0:r.collectName,b=(r==null?void 0:r.nameLabelText)||"Full Name",y=(r==null?void 0:r.consentText)||"I agree to the stated conditions",_=(r==null?void 0:r.submitButtonText)||"Submit",v=!!d.trim(),w=u&&(!g||v),E=(A,L=!1)=>{A.preventDefault(),A.stopPropagation();let k=null;if(!L){if(!w){h(!0);return}k={submitted:!0},g&&(k.name=d)}n({value:k,questionId:i,type:o})},I=A=>{_v(A.target)&&(A.preventDefault(),A.stopPropagation(),p(A.target.value))},S=A=>{Bn(A.target)&&(A.target.style.borderColor=f&&!v?lr:l)},x=A=>{Bn(A.target)&&(A.target.style.borderColor=f&&!v?lr:is)},T=()=>C("div",{children:[C(Pf,{allowTextEntry:!1,border:l,error:f&&!u,index:0,isRadio:!1,isSelected:u,label:y,onUserInputChanged:({selected:A})=>{A!==u&&c(!u)},useMobileStyling:s}),g&&C("input",{"aria-label":b,"aria-placeholder":b,className:H(_e(N.ConsentLegalNameInput,s)),"data-gramm":"false",maxLength:250,name:"name",onBlur:x,onFocus:S,onInput:I,placeholder:b,style:f&&!v?{borderColor:lr}:{},tabIndex:0,value:d}),C("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[C(Ge,{className:w?"":N.ButtonDisabled,onClick:E,children:_}),r.required===!1&&C("button",{className:N.SkipButton,onClick:A=>E(A,!0),children:Ls(r)})]})]});return C("div",{className:H(mt(N.CardMainContent,m)),children:C("div",{className:H([e,"ul-card__consent-legal",N.FadeInTransition]),children:[C(vt,{message:t}),C("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r&&r.richTextBody?{__html:r&&r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"}),C(Jt,{properties:r,defaultBody:T,embeddedType:"pdf"})]},i)})},M_=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:i,range:o,scaleLabelType:a,setActiveValue:s,setIsPressed:l,useMobileStyling:u,value:c})=>{const d=`option-${c}`,p=a===cn.Number,f=a===cn.Star,h=p&&c===e,[m,g]=(()=>c<=e&&f||c===e?r?[t,1]:[t,.3]:["",1])(),b=()=>{switch(a){case cn.Star:return H([..._e(N.LikertStar,u),..._e(`${N.LikertStar}-${c}`,u)]);case cn.Smiley:return H([..._e(N.LikertSmiley,u),..._e(`${N.LikertSmiley}-${c}`,u)]);default:return H(c===o?[..._e(N.LikertNumber,u),..._e(`${N.LikertNumber}-${c}`,u),..._e("likert-last-option",u)]:[..._e(N.LikertNumber,u),..._e(`${N.LikertNumber}-${c}`,u)])}},y=()=>{s(-1),l(!1)};return C("div",{"aria-label":p?void 0:String(c),className:b(),dangerouslySetInnerHTML:{__html:n},id:d,onClick:()=>i(),onPointerDown:()=>l(!0),onPointerEnter:()=>s(c),onPointerLeave:y,role:"radio",style:{color:p?"":m,borderColor:h?m:"",fillOpacity:h?"":g,zIndex:h?3:"auto"},tabIndex:0})},V_=({className:e,labels:t,message:n,next:r,properties:i,questionId:o,type:a})=>{const{border:s,headers:l,useMobileStyling:u}=ce(T=>({border:T.border,headers:T.headers,useMobileStyling:T.useMobileStyling})),[c,d]=xe(-1),[p,f]=xe(!1),h=l["userleap-platform"],m=t&&t.left,g=t&&t.right;let b;const{range:y,scaleLabelType:_,ratingIcons:v}=i;y&&(b=Number(y));const w=b||5,E=T=>{var A,L;switch(_){case cn.Star:return(A=v[0])==null?void 0:A.svg;case cn.Smiley:return(L=v[T])==null?void 0:L.svg;default:return String(T+1)}},I=[...Array(w)].map((T,A)=>{const L=A+1;return C(M_,{activeValue:c,border:s,icon:E(A),isPressed:p,onSubmit:()=>r({value:L,questionId:o,type:a}),range:w,scaleLabelType:_,setActiveValue:d,setIsPressed:f,useMobileStyling:u,value:L},A)}),S=T=>{T.preventDefault(),T.stopPropagation(),r({value:null,questionId:o,type:a})},x=()=>C(Je,{children:[C("div",{"aria-label":`Rating (1 - ${w})`,className:"ul-card--likert__numbers",role:"radiogroup",children:I}),C("div",{className:"ul-card--likert__labels",children:[C("span",{children:m}),C("span",{children:g})]}),!i.required&&C("div",{className:"ul-vertical-centered-container",children:C(Ge,{onClick:S,children:Jn(i)})})]});return C("div",{className:H(mt(N.CardMainContent,h)),children:C("form",{className:H([e,"ul-card--likert",N.FadeInTransition]),children:[C(vt,{message:n,properties:i}),C(Jt,{properties:i,defaultBody:x})]},o)})},Vf=({className:e,message:t,onSubmit:n,options:r=[],properties:i,questionId:o,type:a})=>{const{border:s,headers:l,useMobileStyling:u}=ce(I=>({border:I.border,headers:I.headers,useMobileStyling:I.useMobileStyling})),c=r.reduce((I,S)=>(I[S.id]={isSelected:!1},I),{}),[d,p]=xe(c),f=l["userleap-platform"],h=a===O.MultipleChoice,m=i.required,g=Object.entries(d).some(([I,S])=>{var A;const x=r.find(L=>`${L.id}`===I),T=S.userText===void 0||S.userText.trim()==="";return((A=x==null?void 0:x.optionProperties)==null?void 0:A.allowsTextEntry)&&T&&S.isSelected}),b=Object.values(d).some(I=>I.isSelected),y=g||m&&!b,_=r.map(({id:I,label:S,value:x,optionProperties:T},A)=>{var U,R;const L=`${I}`,{allowsTextEntry:k}=T||{allowsTextEntry:!1};return C(Pf,{allowTextEntry:k,border:s,error:!1,id:L,index:A,isRadio:h,isSelected:!!((U=d[L])!=null&&U.isSelected),label:S,onUserInputChanged:V=>w(V.id,V.selected,V.userText),promptText:"Please specify",text:(R=d[I])==null?void 0:R.userText,useMobileStyling:u,value:x},L)}),v=I=>{I.preventDefault(),I.stopPropagation(),n(d)},w=(I,S,x)=>{const T=Object.assign({},d);if(h&&S)for(const A of Object.values(T))A.isSelected=!1,delete A.userText;T[I]={isSelected:S,userText:x},p(T)},E=()=>C("div",{children:[C("div",{className:H(_e(N.ChoiceGroup,u)),role:h?"radiogroup":"group",children:_}),C("div",{className:"ul-card__button-wrapper",children:C(Ge,{disabled:y,onClick:v,children:Jn(i)})})]});return C("div",{className:H(mt(N.CardMainContent,f)),children:C("form",{className:H([e,"ul-card--multiple",N.FadeInTransition]),id:"text-form",onSubmit:v,children:[C(vt,{message:t,properties:i}),C(Jt,{properties:i,defaultBody:E})]},o)})},F_=e=>{const{questionId:t,type:n,next:r,options:i}=e;return C(Vf,{...e,onSubmit:a=>{const s=Object.entries(a).find(([,p])=>p.isSelected)||[void 0,void 0],[l,u]=s,c=i.find(p=>`${p.id}`===l),d=u!=null&&u.userText?{[l]:{userText:u.userText}}:null;r({value:c&&l?{[l]:c.value}:{},secondaryValue:d,questionId:t,type:n})}})},B_=e=>{const{questionId:t,type:n,next:r}=e;return C(Vf,{...e,onSubmit:o=>{const a={},s=Object.entries(o).reduce((u,[c,d])=>(u[c]=d.isSelected,u),a),l=Object.entries(o).reduce((u,[c,d])=>{if(!d.userText)return u;const p=u||{};return p[c]={userText:d.userText},p},null);r({value:s,secondaryValue:l,questionId:t,type:n})}})},j_=({className:e,props:{labels:t,message:n,properties:r},next:i,questionId:o,type:a})=>{const{border:s,headers:l,useMobileStyling:u}=ce(g=>({border:g.border,headers:g.headers,useMobileStyling:g.useMobileStyling})),c=l["userleap-platform"],d=t&&t.left,p=t&&t.right,f=[...Array(11)].map((g,b)=>C("div",{className:H([..._e(N.NPSNumber,u),..._e(`${N.NPSNumber}-${b}`,u)]),id:`option-${b}`,onClick:()=>i({value:b,questionId:o,type:a}),onKeyPress:y=>{y.preventDefault(),(y.key==="Enter"||y.key===" ")&&i({value:b,questionId:o,type:a})},onPointerDown:y=>{Bn(y.target)&&(y.target.style.zIndex="2",y.target.style.borderColor=s)},onPointerLeave:y=>{Bn(y.target)&&(y.target.style.zIndex="auto",y.target.style.borderColor=is)},role:"radio",tabIndex:0,children:b},b)),h=g=>{g.preventDefault(),g.stopPropagation(),i({value:null,questionId:o,type:a})},m=()=>C("div",{children:[C("div",{className:"ul-card--nps__numbers",children:f}),C("div",{className:"ul-card--nps__labels",children:[C("span",{children:d}),C("span",{children:p})]}),!r.required&&C("div",{className:"ul-vertical-centered-container",children:C(Ge,{onClick:h,children:Jn(r)})})]});return C("div",{className:H(mt(N.CardMainContent,c)),children:C("form",{className:H([e,"ul-card--nps",N.FadeInTransition]),children:[C(vt,{message:n,properties:r}),C(Jt,{properties:r,defaultBody:m})]},o)})},H_=({className:e,message:t,next:n,properties:r,questionId:i,type:o})=>{const{border:a,headers:s,useMobileStyling:l,update:u}=ce(I=>({border:I.border,headers:I.headers,useMobileStyling:I.useMobileStyling,update:I.update})),[c,d]=xe(""),p=Yt(null),f=s["userleap-platform"],h=c.trim(),m=r.required===!0&&!h,g=Uf(p,()=>u()),b=I=>{g(),I.preventDefault(),I.stopPropagation(),ur(I.target)&&d(I.target.value)},y=I=>{I.preventDefault(),I.stopPropagation(),n({value:c,questionId:i,type:o})},_=r&&r.openTextPlaceholder?r.openTextPlaceholder:"",v=I=>{ur(I.target)&&(I.target.style.borderColor=a)},w=I=>{ur(I.target)&&(I.target.style.borderColor=is)},E=()=>C("div",{className:"ul-card-text",children:[C("div",{className:"ul-card-text__container",children:C("textarea",{"aria-label":_,"aria-labelledby":N.QuestionHeader,"aria-multiline":"true","aria-placeholder":_,className:H(_e(N.OpenTextInput,l)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:w,onChange:b,onFocus:v,placeholder:_,ref:p,role:"textbox",tabIndex:0})}),C(Ge,{disabled:m,onClick:y,style:{backgroundColor:m?"":a},children:Jn(r)})]});return C("div",{className:H(mt(N.CardMainContent,f)),children:C("form",{className:H([e,"ul-card--text",N.FadeInTransition]),id:"text-form",children:[C(vt,{message:t,properties:r}),C(Jt,{defaultBody:E,properties:r})]},i)})};var Gt=(e=>(e[e.RequestNeeded=1]="RequestNeeded",e[e.TryAgain=2]="TryAgain",e[e.Ready=3]="Ready",e))(Gt||{});const io=e=>e.type===$e.AvPermission,Ff=e=>e.type===$e.ScreenPermission,z_=(e,t)=>!(io(t)?t.permissionDescriptors:[]).includes(Hn.Camera)||e.getVideoTracks().length>0,Bf=(e,t)=>{if(e===void 0)return Gt.RequestNeeded;if(e){if(!z_(e,t))return Gt.RequestNeeded}else return Gt.TryAgain;return Gt.Ready},ku={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},ft=Lf(e=>({...ku,reset:()=>{e(ku)},updatePage:t=>{e(t)}}));function Da({currentPage:e,pages:t}){const{avStream:n,recordingMediaTypes:r,updatePage:i}=ft.getState(),{recorderEventEmitter:o}=ce.getState();o.emit(Te.AvPermission,{[Y.PermissionDescriptors]:e.permissionDescriptors,[Y.StreamReadyCallback]:(a,s)=>{if(n===a)return;let l=e;if(a&&!e.permissionDescriptors.includes(Hn.Camera)){const u=t.indexOf(e),c=s!=null&&s.active?u+2:u+1;(s==null?void 0:s.active)&&r&&o.emit(Te.BeginRecording,{[Y.RecordingMediaTypes]:r,[Y.StartRecordingCallback]:d=>i({mediaRecordingUids:d})}),l=t[c]}i({currentPage:l,avStream:a})}})}function G_({pages:e,userId:t,responseGroupUid:n,surveyId:r,questionId:i,next:o}){const{updatePage:a}=ft.getState(),{eventEmitFn:s,recorderEventEmitter:l}=ce.getState(),u={questionId:i,surveyId:r,visitorId:t,responseGroupUid:n};let c=0;l.emit(Qe.RecordedTaskPermissionScreen),s(Qe.RecordedTaskPermissionScreen),l.emit(Te.PermissionStatus,{[Y.PermissionStatusCallback]:(p,f,h,m)=>{const g=e[c],{type:b}=g,y=[nt.Screen];if(io(g)){const{permissionDescriptors:_}=g,v=_==null?void 0:_.includes(Hn.Microphone),w=_==null?void 0:_.includes(Hn.Camera);v&&y.push(nt.Audio),w&&y.push(nt.Video);const E=(p==null?void 0:p.active)&&!w,I=(p==null?void 0:p.active)&&f;(E||I)&&c++}Ff(e[c])&&h&&(c++,l.emit(Te.BeginRecording,{[Y.RecordingMediaTypes]:y,[Y.StartRecordingCallback]:_=>a({mediaRecordingUids:_})})),a({currentPage:e[c],avStream:p,screenPermissionRequested:h,nextQuestion:o,type:b,passthroughData:u,recordingMediaTypes:y,captureStream:m})}});const d=e[c];return d.type===$e.AvPermission&&Da({currentPage:d,pages:e}),d}function Ua({status:e}){const{nextQuestion:t,passthroughData:n,mediaRecordingUids:r,reset:i}=ft.getState(),{recorderEventEmitter:o,handleUploadUpdate:a,index:s}=ce.getState(),l={value:{taskStatus:e},type:O.RecordedTask,questionId:(n==null?void 0:n.questionId)||1};!n||o.emit(Te.FinishTask,{[Y.BeginCallback]:u=>{a({mediaRecordingUid:u,isSubmitted:!0,progressPct:0,isComplete:!1})},[Y.ProgressCallback]:(u,c)=>{a({mediaRecordingUid:u,progressPct:c.detail,isSubmitted:!1,isComplete:!1})},[Y.UploadCallback]:u=>{u&&a({mediaRecordingUid:u,isComplete:!0,isSubmitted:!0,progressPct:100})},[Y.PassthroughData]:n,[Y.CurrentIndex]:s,[Y.TaskResponse]:l,[Y.TaskCompleteCallback]:u=>{l.value.taskDurationMillisecond=u,r&&(l.value.mediaRecordingUids=r),i(),t(l)}})}function Os({pages:e,setIsRequestingPermission:t}){const{recorderEventEmitter:n,eventEmitFn:r}=ce.getState(),{updatePage:i,currentPage:o,recordingMediaTypes:a,screenPermissionRequested:s}=ft.getState();if(!o)return;const l=e.indexOf(o);switch(o.type){case $e.AvPermission:{const u=s?l+2:l+1;s&&a&&n.emit(Te.BeginRecording,{[Y.RecordingMediaTypes]:a,[Y.StartRecordingCallback]:c=>{i({mediaRecordingUids:c})}}),i({currentPage:e[u]});return}case $e.ScreenPermission:n.emit(Te.ScreenPermission,{[Y.ScreenPermissionRequested]:t,[Y.StreamReadyCallback]:(u,c)=>{const d=c?e[l+1]:o;c&&a&&n.emit(Te.BeginRecording,{[Y.RecordingMediaTypes]:a,[Y.StartRecordingCallback]:p=>{i({captureStream:c,mediaRecordingUids:p})}}),i({currentPage:d,screenPermissionRequested:!0,captureStream:c})}});return;case $e.StartTask:r(Qe.RecordedTaskStart),n.emit(Qe.RecordedTaskStart),n.emit(Te.StartTask),i({currentPage:e[l+1],screenPermissionRequested:!0});return;case $e.CompleteTask:return}}const jf="ul-permission-graphics-container",Hf="ul-permission-body",zf=H([jf,"ul_recorded-task-inset-spacing"]),oo=H(["ul-horizontal-button-container","ul-horizontal-button-container-left"]),Gf=({richTextBody:e})=>C("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),ao=({required:e,skipButtonText:t,bottom:n=!1})=>e?null:C(Ge,{className:H([n&&"ul-skip-button-below",N.InactiveButton]),onClick:Ua.bind(null,{status:Ye.Abandoned}),children:t||"Skip"}),Ns=e=>{const{avStream:t,captureStream:n,recordingMediaTypes:r,updatePage:i}=ft.getState(),o=(r==null?void 0:r.includes(nt.Audio))||(r==null?void 0:r.includes(nt.Video));Ze(()=>{const a=setInterval(()=>{o&&t&&!t.active?i({avStream:null,currentPage:e[0]}):(!n||!n.active)&&i({captureStream:void 0,currentPage:e[o?1:0]})},1e3);return()=>clearInterval(a)},[t,n,o,e,r,i])},K_=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:i,taskDetail:o}=e;return Ns(t),C("div",{className:"ul-task-page",children:[C(Gf,{richTextBody:o}),C("div",{className:oo,children:[C(Ge,{onClick:Os.bind(null,{pages:t}),children:r}),C(ao,{required:n,skipButtonText:i})]})]},"start-task")},W_=({content:e,pages:t,properties:n})=>{const{buttonText:r,skipButtonText:i}=e;Ns(t);const a=C(Jt,{properties:n,defaultBody:()=>C("div",{className:oo,children:[C(Ge,{className:"ul-complete-task-button",onClick:Ua.bind(null,{status:Ye.Completed}),children:r}),C(Ge,{className:H([N.InactiveButton]),onClick:Ua.bind(null,{status:Ye.GivenUp}),children:i})]})});return C("div",{className:"ul-task-page",children:[C(Gf,{richTextBody:e.taskDetail}),a]},"complete-task")},q_=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:i}=e,[o]=ce(l=>[l.tabTitle]),[a,s]=xe(!1);return C("div",{children:[C("div",{className:zf,children:[C("p",{style:{marginTop:"auto"},children:e.selectTabText}),C("div",{className:"ul-select-tab-container",children:C("p",{className:Hf,children:o})})]}),C("div",{className:n?"":oo,children:[C(Ge,{disabled:a,onClick:Os.bind(null,{pages:t,setIsRequestingPermission:s}),children:r}),C(ao,{required:n,skipButtonText:i})]})]})},$_=({content:e})=>C("div",{className:H([jf,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"]),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),Y_=({content:e,pages:t,required:n})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:i,skipButtonText:o,tryAgainButtonText:a}=e,s=io(t[0])?t[0]:null;return Ze(()=>{const l=setInterval(()=>{s!==null&&Da({currentPage:s,pages:t})},1e3);return()=>clearInterval(l)},[s,t]),s?C("div",{children:[C("div",{className:zf,children:C("p",{className:"ul-av-permission-denied-paragraph",children:[C("span",{className:"ul-av-permission-denied-headline",children:r}),C("span",{className:Hf,children:i})]})}),C("div",{className:oo,children:[C(Ge,{onClick:Da.bind(null,{currentPage:s,pages:t}),children:a}),C(ao,{required:n,skipButtonText:o})]})]}):null},Z_=({stream:e})=>C("video",{autoPlay:!0,className:H(["ul_recorded-task-inset-spacing"]),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),Q_=({content:e,pages:t,required:n})=>{const{skipButtonText:r}=e,{avStream:i}=ft.getState();return Ns(t),C("div",{children:[C(Z_,{stream:i}),C("div",{className:"ul-vertical-button-container-center",children:[C(Ge,{onClick:Os.bind(null,{pages:t}),children:e.buttonText}),C(ao,{bottom:!0,required:n,skipButtonText:r})]})]})},J_=({properties:e})=>{const{pages:t,required:n}=e,{avStream:r,currentPage:i}=ft.getState();if(i===void 0)return null;switch(i==null?void 0:i.type){case $e.AvPermission:{const o=Bf(r,i);return o===Gt.RequestNeeded?C($_,{content:i}):o===Gt.TryAgain?C(Y_,{content:i,pages:t,required:n}):C(Q_,{content:i,pages:t,required:n})}case $e.ScreenPermission:return C(q_,{content:i,pages:t,required:n});case $e.StartTask:return C(K_,{content:i,pages:t,required:n});case $e.CompleteTask:return C(W_,{content:i,pages:t,properties:e});default:return null}},X_=({className:e,properties:t,next:n,questionId:r})=>{const i=ce(),{headers:o,surveyId:a,responseGroupUid:s,userId:l}=i,u=ft(),{screenPermissionRequested:c}=u,d=ft(g=>g.avStream);let p=ft(g=>g.currentPage);p||(p=G_({questionId:r,surveyId:a,next:g=>{n(g)},pages:t.pages,responseGroupUid:s,userId:l}));let f=p.headline,h=p.captionText;const m=Bf(d,p);return Ff(p)&&c&&(f=p.permissionDeniedHeadline,h=p.permissionDeniedCaptionText),io(p)&&m===Gt.Ready&&(f=p.permissionGrantedHeadline,h=p.permissionGrantedCaptionText),C("div",{className:H([...mt(N.CardMainContent,o["userleap-platform"])]),children:C("div",{className:H([e,"ul-center-horizontally",N.FadeInTransition]),children:[C(vt,{message:f,properties:{captionText:h}}),C(J_,{properties:t})]})})},e1={"{{user_id}}":"externalUserId","{{email}}":"email"},t1=(e=void 0,t={})=>{if(!e)return e;let n=e;const r=[];for(const[l,u]of Object.entries(e1))if(n.toLowerCase().includes(l))if(t[u]){const c=new RegExp(l,"gi");n=n.replace(c,t[u])}else r.push(l);if(r.length===0||!n.includes("?"))return n;const i=n.slice(0,n.indexOf("?")),a=n.slice(n.indexOf("?")+1).split("&").map(l=>l.split("=")).filter(l=>!r.includes(l[1]));if(a.length===0)return i;const s=a.map(l=>l.join("=")).join("&");return`${i}?${s}`},n1=({className:e,message:t,next:n,properties:r,questionId:i,type:o})=>{const{headers:a,visitorAttributes:s}=ce(f=>({headers:f.headers,visitorAttributes:f.visitorAttributes})),l=a["userleap-platform"],u=(f,h=!1)=>{n({value:h?{skipped:!0}:void 0,questionId:i,type:o})},c=f=>{(f.key==="Enter"||f.key===" ")&&n({value:void 0,questionId:i,type:o})},d=()=>C("div",{className:"ul-card-button-group",children:[C("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:t1(r&&r.buttonUrl,s),id:"ul-card-text__button",onClick:u,onKeyPress:c,rel:"noreferrer",role:"button",tabIndex:0,target:"_blank",children:Jn(r)}),r.required===!1&&C("button",{className:N.SkipButton,onClick:f=>u(f,!0),children:Ls(r)})]}),p=(f,h)=>f?C("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:f},id:"ul-card__text-url-body-container"}):C("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(h?h.split(/\n\s*\n/g):[]).map((m,g)=>C("p",{children:m},g))});return C("div",{className:H(mt(N.CardMainContent,l)),children:C("div",{className:H([e,"ul-card__text-url-prompt",N.FadeInTransition]),children:[C(vt,{message:t}),p(r&&r.richTextBody,r&&r.body),C(Jt,{defaultBody:d,properties:r})]},i)})},r1=({className:e,questionId:t})=>{const{border:n,destroy:r,endCard:i,forceBrandedLogo:o,headers:a}=ce(u=>({border:u.border,destroy:u.destroy,endCard:u.endCard,forceBrandedLogo:u.forceBrandedLogo,headers:u.headers}));Ze(()=>{setTimeout(()=>{r(Nn)},o?4e3:2e3)},[r,o]);const s=i&&i.subheader?C("p",{className:N.Caption,children:i.subheader}):null,l=i&&i.headline?i.headline:"";return C("div",{className:H(mt(N.CardMainContent,a["userleap-platform"])),children:C("div",{className:H([e,"ul-card--thanks",N.FadeInTransition]),children:C("div",{children:C("div",{className:"ul-card--thanks-content",children:[C("div",{className:"ul-thanks-check",children:C("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[C("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:n,fillRule:"evenodd"}),C("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:n,fillRule:"evenodd"}),C("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),C(vt,{message:l}),s]})})},t)})},an="https://cdn.sprig.com",F={document:void 0,videojs:void 0},i1=`/* progress control styles */
81
- .video-js .vjs-control {
82
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
83
- }
84
-
85
- .video-js .vjs-progress-control .vjs-progress-holder {
86
- margin: 0 0px;
87
- }
88
-
89
- .video-js .vjs-progress-control {
90
- position: absolute;
91
- height: 3px;
92
- width: 100%;
93
- }
94
- /* position and align the buttons and button texts */
95
- .ul-control-panel {
96
- bottom: 0;
97
- width: 100%;
98
- flex-direction: column;
99
- background-color: white;
100
- height: fit-content;
101
- z-index: 2;
102
- }
103
-
104
- .ul-buttons-panel {
105
- color: black;
106
- display: flex;
107
- gap: 20px;
108
- height: 50px;
109
- justify-content: center;
110
- margin: 10px;
111
- padding: 2px 14px 0;
112
- }
113
-
114
- .video-js .vjs-volume-panel {
115
- height: 30px;
116
- width: 40px;
117
- }
118
-
119
- .ul-inactive {
120
- opacity: 0.3;
121
- cursor: default;
122
- pointer-events: none;
123
- }
124
-
125
- /* buttons */
126
- .ul-buttons-panel > .vjs-button {
127
- background-color: rgba(0, 0, 0, 0.05);
128
- border-radius: 50%;
129
- display: flex;
130
- height: 3em;
131
- justify-content: center;
132
- width: 3em;
133
- }
134
-
135
- .vjs-button>.vjs-icon-placeholder:before {
136
- align-items: center;
137
- display: flex;
138
- font-size: unset;
139
- line-height: 0.5;
140
- justify-content: center;
141
- }
142
-
143
- span.ul-button-text {
144
- align-self: flex-end;
145
- position: relative;
146
- top: 14px;
147
- }
148
-
149
- #ul-camera-button {
150
- white-space: nowrap;
151
- }
152
-
153
- .video-js .vjs-volume-control.vjs-volume-horizontal {
154
- background-color: #fff;
155
- z-index: 1;
156
- }
157
-
158
- .vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {
159
- background-color: black;
160
- }
161
-
162
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,
163
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
164
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active {
165
- width: 40px;
166
- }
167
-
168
- .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,
169
- .video-js .vjs-volume-panel .vjs-volume-control:active,
170
- .video-js .vjs-volume-panel.vjs-hover .vjs-mute-control ~ .vjs-volume-control,
171
- .video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,
172
- .video-js .vjs-volume-panel:active .vjs-volume-control,
173
- .video-js .vjs-volume-panel:focus .vjs-volume-control {
174
- visibility: visible;
175
- left: 40px;
176
- position: absolute;
177
- transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s;
178
- }
179
-
180
- /* play button customization */
181
- .video-js .vjs-play-control {
182
- color: black;
183
- }
184
-
185
- .video-js .vjs-play-control .vjs-icon-placeholder:before {
186
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
187
- }
188
-
189
- /* position and style the current timer */
190
- .ul-time-panel {
191
- position: absolute;
192
- bottom: 80px;
193
- left: 10px;
194
- height: 22px;
195
- color: black;
196
- border: 1px solid #e0e0eb;
197
- border-radius: 23px;
198
- background-color: white;
199
- width: fit-content;
200
- }
201
-
202
- .video-js .vjs-current-time,
203
- .vjs-no-flex .vjs-current-time {
204
- display: flex;
205
- align-items: center;
206
- text-align: center;
207
- }
208
-
209
- /* remove the dot progress indicator */
210
- .video-js .vjs-play-progress:before,
211
- .video-js .vjs-volume-level:before,
212
- .vjs-icon-circle:before,
213
- .vjs-seek-to-live-control .vjs-icon-placeholder:before {
214
- content: none;
215
- }
216
-
217
- .video-js .vjs-mute-control .vjs-icon-placeholder:before {
218
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.825.324A.75.75 0 019.25 1v11.667a.75.75 0 01-1.219.585l-3.96-3.169H1a.75.75 0 01-.75-.75v-5a.75.75 0 01.75-.75h3.07L8.031.414a.75.75 0 01.794-.09zM7.75 2.56L4.802 4.92a.75.75 0 01-.469.164H1.75v3.5h2.583a.75.75 0 01.469.165l2.948 2.358V2.56zM14.911.47a.75.75 0 011.061 0 9.084 9.084 0 010 12.844.75.75 0 01-1.06-1.06 7.584 7.584 0 000-10.724.75.75 0 010-1.06zM11.97 3.41a.75.75 0 011.06 0 4.917 4.917 0 010 6.953.75.75 0 11-1.06-1.06 3.417 3.417 0 000-4.832.75.75 0 010-1.06z' fill='%23262136'/%3E%3C/svg%3E");
219
- }
220
-
221
- .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {
222
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.5 1.167L4.333 4.5H1v5h3.333L8.5 12.833V1.167zM17.17 4.5l-5 5M12.17 4.5l5 5' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
223
- }
224
-
225
- .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {
226
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3C/svg%3E%0A");
227
- }
228
-
229
- .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {
230
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.9698 3.41124C12.2627 3.11839 12.7376 3.11846 13.0304 3.4114C13.9521 4.33341 14.4699 5.58376 14.4699 6.88748C14.4699 8.19121 13.9521 9.44156 13.0304 10.3636C12.7376 10.6565 12.2627 10.6566 11.9698 10.3637C11.6768 10.0709 11.6767 9.596 11.9696 9.30307C12.6101 8.66235 12.9699 7.79346 12.9699 6.88748C12.9699 5.98151 12.6101 5.11262 11.9696 4.4719C11.6767 4.17896 11.6768 3.70409 11.9698 3.41124Z' fill='%23262136'/%3E%3C/svg%3E%0A");
231
- }
232
-
233
- .video-js .vjs-volume-control:hover .vjs-mouse-display {
234
- display: none !important;
235
- }
236
-
237
- .video-js .vjs-play-progress {
238
- background-color: black;
239
- }
240
-
241
- /* position video player inside the container */
242
- .video-js .vjs-tech {
243
- position: static;
244
- }
245
-
246
- .video-js .vjs-time-tooltip {
247
- padding: 0.25em 0.75em;
248
- align-items: center;
249
- color: #333;
250
- background: #FCFCFD;
251
- border-radius: 99px;
252
- text-align: center;
253
- border: 1px solid #E0E0EB;
254
- display: flex;
255
- align-items: center;
256
- justify-content: center;
257
- top: -25px;
258
- font-size: 12px !important;
259
- width: 50px !important;
260
- }
261
-
262
- .video-js .vjs-play-progress.vjs-slider-bar .vjs-time-tooltip {
263
- visibility: hidden !important;
264
- }
265
-
266
- .video-js .vjs-progress-control .vjs-mouse-display {
267
- z-index: 2;
268
- }
269
-
270
- .ul-video-player {
271
- width: 100%;
272
- display: flex;
273
- flex-direction: column;
274
- height: auto;
275
- border: 1px solid #E6E6E6;
276
- background-color: white;
277
- box-sizing: border-box;
278
- border-radius: 4px;
279
- background-clip: border-box;
280
- overflow: hidden;
281
- }
282
-
283
- .video-js.vjs-fullscreen:not(.vjs-ios-native-fs) {
284
- border: none;
285
- }
286
-
287
- #video-response-player-secondary-video-player {
288
- max-width: 200px;
289
- margin-right: 20px;
290
- background-color: transparent;
291
- }
292
-
293
- #ul-card-video__player_recorder-video-recorder.vjs-fullscreen {
294
- display: table;
295
- }
296
-
297
- .video-js div.vjs-progress-control {
298
- margin-top: -3px;
299
- }
300
-
301
- .video-js .vjs-progress-control .vjs-slider {
302
- background-color: #B2BBBD;
303
- }
304
-
305
- .vjs-record.video-js .vjs-control.vjs-button.vjs-fullscreen-control {
306
- position:relative;
307
- }
308
-
309
- .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {
310
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.82143 2.54004L12.2614 2.54004C12.9242 2.54004 13.4614 3.0773 13.4614 3.74004L13.4614 6.18004' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.17955 13.46L3.73955 13.46C3.07681 13.46 2.53955 12.9227 2.53955 12.26L2.53955 9.81996' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12.7772 3.22266L9.36475 6.63516' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.29434 9.70605L2.88184 13.1186' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
311
- }
312
-
313
- .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {
314
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.583 9.813H5.25a1 1 0 011 1v3.666M5.375 10.688L1 15.061M14.917 5.813H11.25a1 1 0 01-1-1V1.146M15.063 1l-4.376 4.375' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
315
- }
316
-
317
- .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before, .video-js .vjs-icon-replay:before {
318
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
319
- }
320
-
321
- .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before, .vjs-icon-pause:before {
322
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3.61885' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3Crect x='9.21797' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3C/svg%3E%0A");
323
- padding: 2px;
324
- }
325
-
326
- .vjs-error-display {
327
- display: none;
328
- }
329
-
330
- .ul-video-player-video {
331
- position: relative;
332
- top: 0;
333
- left: 0;
334
- width: 100%;
335
- }
336
-
337
- .ul-video-container {
338
- width: 100%;
339
- height: auto;
340
- left: 0px;
341
- top: 0px;
342
-
343
- background-color: transparent;
344
- border-radius: 4px;
345
-
346
- align-items: start;
347
- display: flex;
348
- flex-direction: column;
349
-
350
- /* Inside Auto Layout */
351
-
352
- flex: none;
353
- order: 0;
354
- flex-grow: 0;
355
- margin: 10px 0px;
356
- position: relative;
357
- }
358
-
359
- .vjs-record button.vjs-device-button.vjs-control {
360
- background: rgba(255, 255, 255, 96);
361
- width: 100%;
362
- height: 100%;
363
- left: 0;
364
- top: 0;
365
- margin: 0;
366
- border-radius: 0;
367
- line-height: 0.6;
368
- padding: 10px;
369
- display: flex;
370
- align-items: center;
371
- flex-direction: column;
372
- justify-content: center;
373
- z-index: 3;
374
- }
375
-
376
- .vjs-record .vjs-device-button.vjs-control:before {
377
- font-size: 14px !important;
378
- color: #333;
379
- content: "Your browser needs to access your camera and microphone for video recording";
380
- line-height: 135%;
381
- }
382
-
383
- .vjs-record .vjs-device-button.vjs-control.permission-denied:before {
384
- font-size: 16px !important;
385
- color: #262136;
386
- content: "Unable to access your camera and microphone";
387
- }
388
-
389
- .vjs-record .vjs-device-button.vjs-control:after {
390
- display: inline-block;
391
- background: #F0F0F5;
392
- font-size: 13px;
393
- border-radius: 4px;
394
- content: "Request Permissions";
395
- padding: 1em 2em;
396
- color: #333;
397
- margin-top: 20px;
398
- }
399
-
400
- .vjs-record .vjs-device-button.vjs-control.permission-denied:after {
401
- display: inline-block;
402
- background: white;
403
- font-size: 13px;
404
- content: "Please go to your browser settings and update permissions to enable recording";
405
- padding: 1em;
406
- color: #4B575D;
407
- margin: 5px;
408
- line-height: 135%;
409
- text-align: center;
410
- }
411
-
412
- .vjs-control.vjs-button.ul-video-recorder-delete-button, .vjs-control.vjs-button.ul-video-recorder-toggle-button, .vjs-control.vjs-button.ul-video-recorder-camera-off-button-audio-only, .vjs-control.vjs-button.ul-video-recorder-camera-off-button {
413
- cursor: pointer;
414
- }
415
-
416
- .ul-video-recorder-delete-button .vjs-icon-placeholder:before {
417
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.21234 7.37549V11.1193M2.53931 4.25595H13.4593H2.53931ZM5.57234 4.25595V3.00833C5.57222 2.84433 5.60354 2.68192 5.6645 2.53038C5.72546 2.37884 5.81488 2.24115 5.92762 2.12519C6.04037 2.00922 6.17424 1.91726 6.32158 1.85456C6.46892 1.79185 6.62683 1.75964 6.78628 1.75977H9.21234C9.37179 1.75964 9.5297 1.79185 9.67703 1.85456C9.82437 1.91726 9.95824 2.00922 10.071 2.12519C10.1837 2.24115 10.2732 2.37884 10.3341 2.53038C10.3951 2.68192 10.4264 2.84433 10.4263 3.00833V4.25595H5.57234ZM12.2463 4.25595V12.9912C12.2463 13.3223 12.1184 13.6399 11.8907 13.8741C11.6631 14.1082 11.3543 14.2398 11.0323 14.2398H4.96628C4.64432 14.2398 4.33555 14.1082 4.10789 13.8741C3.88023 13.6399 3.75234 13.3223 3.75234 12.9912V4.25595H12.2463ZM6.78628 7.37549V11.1193V7.37549Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
418
- }
419
-
420
- .ul-video-recorder-toggle-button .vjs-icon-placeholder:before {
421
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0Z' fill='%23D15153'/%3E%3C/svg%3E");
422
- }
423
-
424
- .ul-video-recorder-toggle-button.ul-recording-in-session .vjs-icon-placeholder:before {
425
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 10L12 2C12 0.89543 11.1046 -4.85396e-07 10 -4.37114e-07L2 -8.74228e-08C0.89543 -3.91405e-08 -4.85396e-07 0.895431 -4.37114e-07 2L-8.74228e-08 10C-3.91405e-08 11.1046 0.895431 12 2 12L10 12C11.1046 12 12 11.1046 12 10Z' fill='%23D15153'/%3E%3C/svg%3E%0A");
426
- }
427
-
428
- .ul-video-recorder-camera-off-button .vjs-icon-placeholder:before {
429
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
430
- }
431
-
432
- .ul-video-recorder-camera-off-button-audio-only .vjs-icon-placeholder:before {
433
- content: url("data:image/svg+xml,%3Csvg width='22' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.75 3A2.75 2.75 0 013.5.25h9.081A2.75 2.75 0 0115.331 3v9a2.75 2.75 0 01-2.75 2.75H3.5A2.75 2.75 0 01.75 12V3zM3.5 1.75c-.69 0-1.25.56-1.25 1.25v9c0 .69.56 1.25 1.25 1.25h9.081c.69 0 1.25-.56 1.25-1.25V3c0-.69-.56-1.25-1.25-1.25H3.5z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.53 2.03l-12 12-1.06-1.06 12-12 1.06 1.06zM20.87 1.525a.75.75 0 01.38.652v10.588a.75.75 0 01-1.134.644l-5.92-3.53a.75.75 0 01-.365-.643v-3.53a.75.75 0 01.366-.644l5.919-3.53a.75.75 0 01.754-.007zm-5.539 4.607V8.81l4.419 2.635V3.497l-4.419 2.635z' fill='%23262136'/%3E%3C/svg%3E");
434
- transform: scale(0.75);
435
- }
436
-
437
- .ul-upload-progress-label {
438
- padding: 0.15em 0.75em;
439
- align-items: center;
440
- font-size: 12px;
441
- color: #333;
442
- background: #FCFCFD;
443
- border-radius: 99px;
444
- text-align: center;
445
- border: 1px solid #E0E0EB;
446
- display: flex;
447
- align-items: center;
448
- justify-content: center;
449
- position: absolute;
450
- bottom: 75px;
451
- left: calc(50% - 65px);
452
- width: 130px;
453
- z-index: 5;
454
- }
455
-
456
- .ul-upload-progress-label__time {
457
- display: inline-flex;
458
- margin-left: 0.8em;
459
- align-items: center;
460
- }
461
-
462
- .ul-upload-progress-label__time:before {
463
- content: "";
464
- display: inline-flex;
465
- width: 1px;
466
- height: 12px;
467
- background-color: #E0E0EB;
468
- margin-right: 0.8em;
469
- }
470
-
471
- @keyframes grow {
472
- 0% {
473
- transform: scale(1);
474
- background-color: #EEECFC;
475
- }
476
- 50% {
477
- transform: scale(1.2);
478
- background-color: #E1DFF4;
479
- }
480
- 100% {
481
- transform: scale(1);
482
- background-color: #EEECFC;
483
- }
484
- }
485
-
486
- .ul-audio-recorder-placeholder:before {
487
- width: 80px;
488
- height: 80px;
489
- border-radius: 120px;
490
- background-color: #EEECFC;
491
- content: "";
492
- position: absolute;
493
- left: calc(50% - 40px);
494
- top: calc(50% - 40px);
495
- animation: 6s infinite grow;
496
- transform-origin: 50% 60%;
497
- }
498
-
499
- .ul-audio-recorder-placeholder:after {
500
- content: url("data:image/svg+xml,%3Csvg width='98' height='98' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='a' maskUnits='userSpaceOnUse' x='0' y='0' width='98' height='98'%3E%3Ccircle cx='49' cy='49' r='49' fill='%23EDECF8'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Ccircle cx='49' cy='49' r='50' fill='%23645CC2'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.422 81.812c5.405-15.547 20.187-26.706 37.576-26.706 17.39 0 32.172 11.159 37.577 26.707-9.164 10.43-22.601 17.013-37.576 17.013-14.976 0-28.414-6.583-37.577-17.014z' fill='%23fff' fill-opacity='.6'/%3E%3Ccircle cx='49' cy='29' r='17' fill='%23fff' fill-opacity='.7'/%3E%3C/g%3E%3C/svg%3E");
501
- position: absolute;
502
- left: 50%;
503
- top: 50%;
504
- transform: translate(-50%, -50%);
505
- transform: translate(-50%, -50%) scale(0.6);
506
- }
507
-
508
- .ul-audio-recorder-placeholder {
509
- min-height: 150px;
510
- width: 100%;
511
- background-color: #fcfcfd;
512
- display: block;
513
- position: relative;
514
- }
515
-
516
- .vjs-fullscreen .ul-audio-recorder-placeholder {
517
- vertical-align: middle;
518
- display: table-cell;
519
- }
520
-
521
- .vjs-fullscreen .ul-control-panel {
522
- height: 80px;
523
- position: absolute;
524
- bottom: 0;
525
- left: 0;
526
- width: 100%;
527
- max-width: 100%;
528
- background-color: #F8F8F8;
529
- }
530
-
531
- .vjs-playback-rate .vjs-playback-rate-value {
532
- align-items: center;
533
- display: flex;
534
- font-size: 12px;
535
- justify-content: center;
536
- }
537
-
538
- .vjs-playback-rate .vjs-menu {
539
- left: -5px;
540
- bottom: 3px;
541
- }
542
-
543
- .vjs-menu-button-popup .vjs-menu .vjs-menu-content {
544
- background-color: white;
545
- border: 1px solid rgba(0, 0, 0, 0.1);
546
- box-sizing: border-box;
547
- border-radius: 4px;
548
- }
549
-
550
- .vjs-menu li {
551
- font-size: 12px;
552
- padding: 5px 0;
553
- }
554
-
555
- .vjs-menu li.vjs-selected {
556
- color: lightgray;
557
- }
558
-
559
- .vjs-menu li.vjs-menu-item:hover {
560
- background-color: rgba(0, 0, 0, 0.05);
561
- }
562
-
563
- .vjs-fullscreen .ul-buttons-panel {
564
- top: calc(50% - 30px);
565
- position: relative;
566
- }
567
-
568
- .vjs-fullscreen .vjs-record-indicator.vjs-control {
569
- bottom: 90px !important;
570
- }
571
-
572
- .vjs-record.video-js div.vjs-control.vjs-record-indicator {
573
- padding: 0.3em 0.75em 0.15em 15px;
574
- align-items: center;
575
- font-size: 12px;
576
- color: #333;
577
- background: #FCFCFD;
578
- border-radius: 99px;
579
- text-align: center;
580
- border: 1px solid #E0E0EB;
581
- display: flex;
582
- justify-content: center;
583
- align-items: center;
584
- position: absolute;
585
- bottom: 75px;
586
- top: auto;
587
- left: calc(50% - 21px);
588
- width: 43px;
589
- height: 16px;
590
- z-index: 4;
591
- }
592
-
593
- .vjs-record.video-js div.vjs-control.vjs-record-indicator:after {
594
- content: "";
595
- background-color: #EB5757;
596
- width: 6px;
597
- height: 6px;
598
- border-radius: 8px;
599
- animation: none;
600
- top: 4px;
601
- left: 5px;
602
- }
603
-
604
- .vjs-record.video-js div.vjs-control.vjs-record-indicator:before {
605
- position: relative;
606
- font-size: 9px;
607
- animation: none;
608
- opacity: 1;
609
- color: #333;
610
- top: auto;
611
- left: auto;
612
- }
613
-
614
- .ul-video-player-loading {
615
- display: inline-block;
616
- position: relative;
617
- width: 6rem;
618
- height: 6rem;
619
-
620
- }
621
- .ul-video-player-loading div {
622
- box-sizing: border-box;
623
- position: absolute;
624
- display: block;
625
- width: 80%;
626
- height: 80%;
627
- margin: 5px;
628
- border: 5px solid #666;
629
- border-radius: 50%;
630
- animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
631
- border-color: #666 transparent transparent transparent;
632
- }
633
-
634
- .first {
635
- animation-delay: -0.45s;
636
- }
637
- .second {
638
- animation-delay: -0.3s;
639
- }
640
- .third {
641
- animation-delay: -0.15s;
642
- }
643
-
644
- @keyframes lds-ring {
645
- 0% {
646
- transform: rotate(0deg);
647
- }
648
- 100% {
649
- transform: rotate(360deg);
650
- }
651
- }
652
-
653
- .ul-video-btn {
654
- width: 100%;
655
- border: 1px solid #E6E6E6;
656
- border-radius: 4px;
657
- background-color: rgba(0, 0, 0, 0.02);
658
- padding: 8px;
659
- font-weight: 500;
660
- font-size: 15px;
661
- }
662
-
663
- .ul-record-response-btn:before, .ul-record-response-btn:after, .ul-back-question-btn:before, .ul-back-question-btn:after {
664
- margin: 0 5px;
665
- vertical-align: middle;
666
- }
667
-
668
- .ul-record-response-btn:before {
669
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
670
- display: inline-block;
671
- transform: translate(0px, 2px);
672
- }
673
-
674
- .ul-record-response-btn:after {
675
- content: 'Record your Response';
676
- }
677
-
678
- .ul-back-question-btn:before {
679
- content: url("data:image/svg+xml,%3Csvg width='15' height='16' viewBox='0 0 15 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.8757 8.22361L1.1118 14.6056C0.945578 14.6887 0.75 14.5678 0.75 14.382V1.61803C0.75 1.43219 0.945579 1.31131 1.1118 1.39443L13.8757 7.77639C14.06 7.86852 14.06 8.13148 13.8757 8.22361Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
680
- display: inline-block;
681
- transform: scale(0.85) translate(0, 1px);
682
- -moz-transform: scale(0.85) translate(0, 2px);
683
- }
684
-
685
- .ul-back-question-btn:after {
686
- content: 'Back to Question';
687
- }
688
-
689
- .hidden {
690
- display: none !important;
691
- opacity: 0;
692
- visibility: hidden;
693
- }
694
-
695
- .visible {
696
- visibility: visible;
697
- opacity: 1;
698
- animation: fade 0.3s;
699
- }
700
-
701
- @keyframes fade {
702
- 0% {
703
- opacity: 0;
704
- }
705
-
706
- 100% {
707
- opacity: 1;
708
- }
709
- }
710
-
711
- #ul-recording-countdown-screen {
712
- width: 100%;
713
- height: 100%;
714
- color: black;
715
- background-color: rgba(255, 255, 255, 0.8);
716
- position: absolute;
717
- text-align: center;
718
- font-size: 15px;
719
- z-index: 1;
720
- display: table;
721
- }
722
-
723
- .ul-countdown-text {
724
- vertical-align: middle;
725
- display: table-cell;
726
- transform: translate(0, -25px);
727
- }
728
-
729
- .vjs-fullscreen > #ul-recording-countdown-screen {
730
- font-size: 25px;
731
- transform: unset;
732
- }
733
-
734
- .vjs-poster {
735
- background-size: cover;
736
- }
737
- `,o1=e=>{const t=F.document.createElement("div");return t.className="ul-video-player-loading",t.id=Ds(e),["first","second","third","fourth"].map(n=>{const r=F.document.createElement("div");r.className=n,t.appendChild(r)}),t},Ds=e=>e+"-loading-spiner",Ee="hidden",xu=".m3u8",Vo="questionId",Fo="ul-video-recorder-camera-off-button",Bo="ul-recording-in-session",a1=[{type:"link",content:`${an}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${an}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${an}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${an}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${an}/userleap-web-upchunk-v2.2.2.js`}],Kf=[{type:"link",content:`${an}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${an}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:i1}],Wf="-video-player",qf="-secondary-video-player",$f="-video-recorder";let ut,Au;const Ht=async({event:e,apiBase:t,headers:n,visitorId:r,envId:i,metadata:o})=>{const a=F.document.documentElement;if(!r||!i)return;const s={event:`SDK - ${e}`,visitorId:r,environmentId:i,metadata:{...o||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:a.clientWidth,clientHeight:a.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${t}/sdk/1/visitors/${r}/analytics`,{method:"POST",cache:"no-cache",headers:n,body:JSON.stringify(s)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",e)},kt=async(e,t,n,r,i,o)=>{Ht({event:`Video Error ${t}`,apiBase:n,headers:r,visitorId:i,envId:o,metadata:{errorMessage:e.message}});const a=F.document.documentElement,s={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:a.clientWidth,clientHeight:a.clientHeight,location:window.location.href,language:navigator.language},l={action:t,err:{message:e.message,stack:e.stack},meta:s,vid:i,envId:o};(await fetch(`${n}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...r,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(l)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",e)},s1=(e,{type:t,content:n})=>new Promise(function(r,i){let o;t==="script"?(o=F.document.createElement("script"),o.src=n):t==="link"?(o=F.document.createElement("link"),o.rel="stylesheet",o.href=n,o.type="text/css"):(o=F.document.createElement("style"),o.innerHTML=n),o.onload=function(){r(n)},o.onerror=function(){i(n)},o.async=!1,o.id=btoa(n),e.appendChild(o)}),Yf=(e,t)=>{if(e.length===0)return t&&t();Promise.all(e.reduce((n,r)=>(n.push(s1(F.document.head,r)),n),[])).then(()=>{F.videojs=F.document.defaultView.videojs,t&&t()}).catch(function(n){console.log(n+" failed to load")})},Tu=(e,t,n)=>{if(t==="start"&&(e.style.visibility="visible"),t==="none")e.style.visibility=Ee;else if(t==="success")e.style.visibility=Ee,e.innerHTML="Upload succeeded!";else{const r=Math.round(parseFloat(n));e.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${r}%</span>`,e.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`}},jo=(e,t)=>{const n=F.videojs(e.id());return n==null?void 0:n.payload[t]},l1=(e,t,n,r,i)=>{const{surveyId:o,responseGroupUid:a,visitorId:s,envId:l}=e.payload;e.on("deviceError",function(){console.warn("device error: ",e.deviceErrorCode),e.deviceErrorCode.message==="Permission denied"?(e.deviceButton.addClass("permission-denied"),n&&n(W.ERROR,{type:W.PERMISSION_DENIED}),Ht({event:"Video Permission Denied",apiBase:t,headers:i,visitorId:s,envId:l,metadata:{questionId:jo(e,Vo),responseGroupUid:a,surveyId:o}})):(n&&n(W.ERROR,{type:W.OTHER}),kt(new Error(e.deviceErrorCode.message),"recorderDeviceError",t,i,s,l))}),e.on("error",function(u,c){kt(c||e.error(),"recorderError",t,i,s,l)}),e.on("startRecord",function(u,c){r(e.uploadProgressLabel,"none"),Ht({event:"Video Record Start",apiBase:t,headers:i,visitorId:s,envId:l,metadata:{questionId:jo(e,Vo),responseGroupUid:a,surveyId:o}})}),e.on("finishRecord",async function(){r(e.uploadProgressLabel,"start",0);const u=jo(e,Vo);if(!o){const m="internal error: missing fields in payload";return n&&n(W.ERROR,{type:W.OTHER}),kt(new Error(m),"finishRecord",t,i,s,l),null}e.record().stopDevice();const c=e.cameraOff?W.MEDIA_TYPE_AUDIO:W.MEDIA_TYPE_VIDEO,d=Kt();Ht({event:"Video Record Finish",apiBase:t,headers:i,visitorId:s,envId:l,metadata:{mediaRecordingUid:d,questionId:u,responseGroupUid:a,surveyId:o,mediaType:c}});const p={surveyId:o,updatedAt:new Date().toISOString(),mediaType:c,mediaRecordingUid:d};u&&(p.questionId=u),a&&(p.responseGroupUid=a),s&&(p.visitorId=s);const h=await(async()=>{const m=await fetch(`${t}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(m.ok){const g=await m.json();return n&&n(W.UPLOAD_STARTED,{[W.UPLOAD_ID]:g.upload.id,[W.MEDIA_TYPE]:c,[W.MEDIA_RECORDING_UID]:d}),g.upload.url}else return n&&n(W.ERROR,{type:W.OTHER,response:m}),kt(new Error("failed to get upload response with url"),"finishRecord",t,i,s,l),null})();!h||(ut=F.document.defaultView.UpChunk.createUpload({endpoint:h,file:new F.document.defaultView.File([e.recordedData],`recording ${c} ${Date.now()}`),chunkSize:5120}),ut.startTime=Date.now(),Ht({event:"Video Upload Start",apiBase:t,headers:i,visitorId:s,envId:l,metadata:{mediaRecordingUid:d,questionId:u,responseGroupUid:a,surveyId:o,mediaType:c,url:h}}),ut.on("error",m=>{r(e.uploadProgressLabel,"none"),n&&n(W.UPLOAD_FINISHED,{[W.MEDIA_RECORDING_UID]:d}),kt(m,"finishRecord",t,i,s,l)}),ut.on("progress",m=>{n&&n(W.UPLOAD_PROGRESS,{[W.MEDIA_RECORDING_UID]:d,[W.UPLOAD_PROGRESS_PCT]:m.detail}),r(e.uploadProgressLabel,"progress",m.detail)}),ut.on("success",()=>{r(e.uploadProgressLabel,"success"),n&&n(W.UPLOAD_FINISHED,{[W.MEDIA_RECORDING_UID]:d}),Ht({event:"Video Upload Success",apiBase:t,headers:i,visitorId:s,envId:l,metadata:{mediaRecordingUid:d,questionId:u,responseGroupUid:a,surveyId:o,mediaType:c,url:h,elapsedMs:ut.startTime&&Date.now()-ut.startTime}})}))})},Zf=(e,t)=>{const n=new(F.videojs.getComponent("Component"))(e);return n.addClass("ul-buttons-panel"),t.map(r=>{n.addChild(r)}),u1(n),n},u1=e=>{e.children().forEach(t=>{if(tt[t.name_]){const n=mi(tt[t.name_],`ul-${tt[t.name_]}`);t.el_.appendChild(n)}})},mi=(e,t="")=>{const n=F.document.createElement("span");return n.className="ul-button-text",n.innerHTML=e,n.id=t,n},Qf=(e,t,n,r,i=!1,o)=>{e.addClass("ul-video-player");const a=new(F.videojs.getComponent("Component"))(e);a.addClass("ul-control-panel"),e.progressBar=a.addChild("ProgressControl"),n&&e.src(n),e.audioPlayerPlaceholder=new(F.videojs.getComponent("Component"))(e),e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const s=n&&n.src?v1(n.src):null;n&&(i||!s)?(e.children()[0].classList.add("vjs-hidden"),F.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.audioPlayerPlaceholder.hide(),F.document.getElementById(`${e.id()}_html5_api`).style.height="100%",s&&e.poster(s)),e.on("play",()=>{!i&&n&&!s&&f1(e,!1),o==null||o.play()}),e.on("pause",()=>{o==null||o.pause()}),e.on("seeked",()=>{o==null||o.currentTime(e.currentTime())}),e.on("ratechange",()=>{o==null||o.playbackRate(e.playbackRate())}),e.addChild(e.audioPlayerPlaceholder,{},1),a.addChild(t),e.addChild(a),r&&r(e)},c1=(e,t,n)=>{e.addClass(`ul${qf}`);const r=new(F.videojs.getComponent("Component"))(e);t&&e.src(t),e.addChild(r),n&&n(e)},d1=(e,t,n,r,i,o,a,s=!1)=>{Au=Date.now();const u=zi(t,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!u)return;u.payload=n;const{surveyId:c,questionId:d,responseGroupUid:p,visitorId:f,envId:h}=n;let m;const g=A=>{const L=Fo,k=Fo+"-audio-only";Tu(u.uploadProgressLabel,"none"),ut&&ut.startTime>=Au&&ut.abort();const U=F.document.getElementById("ul-camera-button");A?(u.children()[0].classList.add("vjs-hidden"),v.removeClass(L),v.addClass(k),U.innerHTML=tt.TurnOnCamera,u.audioPlayerPlaceholder.removeClass("vjs-hidden"),m==null||m.getTracks().forEach(R=>{R.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(R=>{m=R,R.getVideoTracks().forEach(V=>{V.enabled=!1}),u.record().onDeviceReady(R)}).catch(u.record().onDeviceError.bind(u.record()))):(m==null||m.getVideoTracks().forEach(R=>{R.enabled=!0}),u.children()[0].classList.remove("vjs-hidden"),u.record().getDevice(),v.removeClass(k),v.addClass(L),U.innerHTML=tt.TurnOffCamera,u.audioPlayerPlaceholder.addClass("vjs-hidden"))},b=new(F.videojs.getComponent("Button"))(u,{clickHandler:()=>{b.hasClass(Ee)||(Ht({event:"Video Delete Button Clicked",apiBase:r,headers:a,visitorId:f,envId:h,metadata:{questionId:d,responseGroupUid:p,surveyId:c}}),g(u.cameraOff),i(W.DELETE,{}),v.removeClass(Ee),b.addClass(Ee))}});b.addClass("ul-video-recorder-delete-button"),b.el_.appendChild(mi(tt.DeleteButton,"ul-delete-button"));const y=F.document.getElementById(t),_=()=>{y.classList.contains("vjs-fullscreen")&&u.cameraOff?y.style.display="table":y.style.display="flex"};_();const v=new(F.videojs.getComponent("Button"))(u,{clickHandler:()=>{u.record().isRecording()||(u.cameraOff=!u.cameraOff,Ht({event:"Video Camera Button Clicked",apiBase:r,headers:a,visitorId:n.visitorId,envId:n.envId,metadata:{questionId:d,responseGroupUid:p,surveyId:c,cameraOff:u.cameraOff}}),g(u.cameraOff),!b.hasClass(Ee)&&b.addClass(Ee),i(W.DELETE,{}),_())}});v.addClass(Fo),v.el_.appendChild(mi(tt.TurnOffCamera,"ul-camera-button"));const w=new(F.videojs.getComponent("Button"))(u,{clickHandler:()=>{const A=F.document.getElementById("ul-recorder-toggle");if(u.record().isRecording())u.record().stop(),A&&(A.innerHTML=tt.RecordButton),w.removeClass(Bo),b.removeClass(Ee);else{const L=F.document.getElementById("ul-recording-countdown-screen");if(L)L.remove(),A&&(A.innerHTML=tt.RecordButton),g(u.cameraOff),i(W.DELETE,{}),v.removeClass(Ee),b.addClass(Ee),w.removeClass(Bo),S.show();else{w.addClass(Bo),S.hide(),v.addClass(Ee),b.addClass(Ee),A&&(A.innerHTML=tt.StopButton);const k=F.document.createElement("div");k.id="ul-recording-countdown-screen",y.insertBefore(k,y.children[1]),k.style.height=`${y.offsetHeight}px`,Jf(u,3)}}}});w.addClass("ul-video-recorder-toggle-button"),w.el_.appendChild(mi(tt.RecordButton,"ul-recorder-toggle"));const E=F.document.createElement("p");E.style.visibility="hidden",E.className="ul-upload-progress-label",e.appendChild(E),u.uploadProgressLabel=E;const I=Zf(u,[b,v,"PlayToggle",w,"FullscreenToggle"]),S=I.children().find(A=>A.name_==="FullscreenToggle");S.hasClass("vjs-disabled")&&S.hide();const x=I.children().find(A=>A.name_==="PlayToggle");x.hide(),o&&v.addClass(Ee),!o&&b.addClass(Ee),Qf(u,I,o,!1,s),u.on("stopRecord",()=>{w.hide(),x.show(),S.show(),b.removeClass(Ee)}),u.on("deviceReady",()=>{w.show(),x.hide(),b.addClass(Ee)}),l1(u,r,i,Tu,a),o&&(u.deviceButton&&u.deviceButton.hide(),u.src(o),x.show(),w.hide(),b.removeClass(Ee));const T=[{name:"microphone"}];!u.cameraOff&&T.push({name:"camera"}),Promise.all(T.map(A=>{var L;return(L=navigator==null?void 0:navigator.permissions)==null?void 0:L.query(A)})).then(A=>{A.reduce((k,U)=>k&U.state==="granted",!0)&&u&&(u.deviceButton&&u.deviceButton.hide(),!o&&u.record().getDevice())}).catch(A=>{})},Jf=(e,t=3)=>{const n=F.document.getElementById("ul-recording-countdown-screen");n&&t===0?(n.remove(),e.record().start()):n&&(n.innerHTML=`<span class='ul-countdown-text'>Recording in... ${t}</span>`,setTimeout(()=>{Jf(e,t-1)},1e3))},Xf=e=>{const t=F.document.createElement("div");return t.className="ul-video-container",t.appendChild(o1(e)),t},Pa=(e,t)=>{const n=F.document.createElement("video");n.id=e,n.className="video-js vjs-default-skin ul-video-player-video";const r=F.document.createElement("p");r.className="vjs-no-js",r.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const i=F.document.createElement("a");return i.href="https://videojs.com/html5-video-support/",i.target="_blank",i.innerHTML="supports HTML5 video",r.appendChild(i),n.appendChild(r),t.appendChild(n),t},f1=(e,t)=>{t?(e.children()[0].classList.add("vjs-hidden"),e.audioPlayerPlaceholder.show(),F.document.getElementById(`${e.id()}_html5_api`).style.height="0px"):(e.children()[0].classList.remove("vjs-hidden"),e.audioPlayerPlaceholder.hide(),F.document.getElementById(`${e.id()}_html5_api`).style.height="100%")},zi=(e,t)=>F.document.getElementById(e)?t?F.videojs(e,t):F.videojs(e):(console.error(`Error in finding player element with ID, ${e}`),null),p1=(e,t,n,r=!1,i="https://api.sprig.com",o=document,a=null,s=null)=>{F.document=o;const l=e+Wf,u=Xf(l);return F.document.addEventListener("securitypolicyviolation",c=>{kt(new Error(`Voice & Video feature violates ${c.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",i,{})}),Yf(Kf,()=>{F.document.getElementById(Ds(l)).remove(),Pa(l,u);const c={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const d=e+qf;Pa(d,u);const p=zi(l,c),f=zi(d,{muted:!0,...c});if(!p||!f)return;c1(f,a,s),a||f.addClass(Ee);const h=Zf(p,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),m=h.children().find(g=>g.name_==="FullscreenToggle");m.hasClass("vjs-disabled")&&m.hide(),Qf(p,h,t,n,r,f)}catch(d){kt(new Error(`Error when creating video player object ${d}`),"playerDeviceError",i,{});return}}),u},h1=(e,t={},n="https://api.userleap.com",r,i,o,a=!1,s=document)=>{F.document=s;const l=e+$f,u=Xf(l);return F.document.addEventListener("securitypolicyviolation",c=>{kt(new Error(`Voice & Video feature violates ${c.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",n,o,t.visitorId,t.envId)}),Yf(Kf.concat(a1),()=>{Pa(l,u),F.document.getElementById(Ds(l)).remove();try{d1(u,l,t,n,r,i,o,a)}catch(c){kt(new Error(`Error when creating video recorder player object ${c}`),"recorderDeviceError",n,o,t.visitorId,t.envId);return}}),u},m1=e=>{const t=e+$f;if(!!F.document.getElementById(t)&&!!F.videojs){try{if(!F.videojs(t).record().stream)return}catch{return}F.videojs(t).record().stop(),F.videojs(t).record().stopDevice()}},g1=e=>{const t=zi(e+Wf);t==null||t.pause()},v1=e=>{if(!e)return null;const t=e.match(/https:\/\/stream.mux.com\/(.*)/);let n=t?t[1]:null;return n.includes(xu)&&(n=n.replace(xu,"")),n?`https://image.mux.com/${n}/thumbnail.jpg?time=0`:null},W={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},tt={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},Xn="ul-card-video__player_recorder",y1="ul-card-video__skip_button",_1="ul-video-interview-form",Ru="ul-video-btn",b1=({className:e,message:t,next:n,properties:r,questionId:i,type:o})=>{const{apiURL:a,envId:s,handleUploadUpdate:l,headers:u,responseGroupUid:c,surveyId:d,viewDocument:p,visitorId:f}=ce(k=>({apiURL:k.apiURL,envId:k.envId,handleUploadUpdate:k.handleUploadUpdate,headers:k.headers,responseGroupUid:k.responseGroupUid,surveyId:k.surveyId,viewDocument:k.viewDocument,visitorId:k.userId})),[h,m]=xe(!1),[g,b]=xe(null),[y,_]=xe(null),[v,w]=xe(0),E=u["userleap-platform"],I=r&&r.videoUrl,S=(k,U)=>{k===W.UPLOAD_STARTED?(b(U[W.UPLOAD_ID]),_(U[W.MEDIA_RECORDING_UID]),m(!0)):k===W.DELETE?(b(null),_(null),m(!1)):k===W.UPLOAD_PROGRESS?isNaN(U[W.UPLOAD_PROGRESS_PCT])?l({mediaRecordingUid:U[W.MEDIA_RECORDING_UID],isComplete:!0}):l({mediaRecordingUid:U[W.MEDIA_RECORDING_UID],progressPct:U[W.UPLOAD_PROGRESS_PCT]}):k===W.UPLOAD_FINISHED&&l({mediaRecordingUid:U[W.MEDIA_RECORDING_UID],isComplete:!0})},x=k=>{if(k&&k.children.length===0){const U=p1(Xn,{src:I,type:"application/x-mpegURL"},void 0,r.mediaType===W.MEDIA_TYPE_AUDIO,a,p);k.appendChild(U)}},T=k=>{if(k&&k.children.length===0){const U=h1(Xn,{surveyId:d,responseGroupUid:c,questionId:i,visitorId:f,envId:s},a,S,void 0,{...u,"x-ul-video-recorder-origin":"sdk"},r.mediaType===W.MEDIA_TYPE_AUDIO,p);k.appendChild(U)}},A=k=>{k.preventDefault(),k.stopPropagation(),m1(Xn),g&&y?(l({mediaRecordingUid:y,isSubmitted:!0}),n({value:{mediaRecordingUid:y},questionId:i,type:o})):n({value:null,questionId:i,type:o})},L=()=>C(Jt,{defaultBody:()=>C("button",{className:`${Ru} ul-record-response-btn`,onClick:k=>{k.preventDefault(),k.stopPropagation(),g1(Xn),w(1)}}),properties:r});return C("div",{className:H(mt(N.CardMainContent,E)),style:{marginTop:"unset"},children:C("form",{className:H([e,N.VideoCard,N.FadeInTransition]),id:_1,children:[C(vt,{message:t,properties:r}),C("div",{id:"ul-card-voice__video",children:[C("div",{children:[C("div",{id:"ul-question-player-container",style:{display:v===0?"":"none"},children:[C("div",{id:Xn,ref:x}),L()]}),C("div",{style:{display:v===1?"block":"none"},children:[C("button",{className:`${Ru} ul-back-question-btn`,onClick:k=>{k.preventDefault(),k.stopPropagation(),w(0)}}),C("div",{id:"ul-recorder-player-container",ref:T})]})]}),C(Ge,{disabled:!h,onClick:A,children:Jn(r)}),C("button",{className:`ul-card-text__button ${N.InactiveButton} ${N.SkipButton}`,id:y1,onClick:A,style:{display:r.required?"none":"block",...h?{display:"none"}:{}},children:Ls(r)})]})]})})},w1=({className:e})=>{const{headers:t,uploadProgress:n}=ce(a=>({headers:a.headers,uploadProgress:a.uploadProgress}));let r,i;Object.values(n).filter(a=>a.isSubmitted).length>1?(r="Your responses are processing",i="Please keep this tab open until your responses are fully processed."):(r="Your response is processing",i="Please keep this tab open until your response is fully processed.");const o=Math.round(Math.min(99,...Object.values(n).filter(a=>a.isSubmitted).map(a=>a.progressPct)));return C("div",{className:H(mt(N.CardMainContent,t["userleap-platform"])),children:C("div",{className:H([e,"ul-card--uploading",N.FadeInTransition]),children:[C("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:N.LoadingSpinnerContainer,role:"progressbar",children:C("div",{className:N.LoadingSpinner,children:[C("div",{className:N.LoadingSpinnerFirst}),C("div",{className:N.LoadingSpinnerSecond}),C("div",{className:N.LoadingSpinnerThird}),C("div",{className:N.LoadingSpinnerFourth})]})}),C(vt,{message:`${r} (${o}% complete)`}),C("p",{className:N.Caption,children:i})]})})},Lu=({logoOnly:e=!1,style:t={}})=>C("svg",{alt:`${e?"Powered by ":""}Sprig`,width:e?"35":"112",height:"15",viewBox:e?"79 0 31 15":"0 0 112 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...t},children:[!e&&C("path",{d:"M0.648926 12.0181V2.8584H4.21631C6.0127 2.8584 7.25684 4.06445 7.25684 5.86084V5.87354C7.25684 7.66357 6.0127 8.88867 4.21631 8.88867H2.0708V12.0181H0.648926ZM3.86084 4.05811H2.0708V7.69531H3.86084C5.09229 7.69531 5.80957 7.02881 5.80957 5.87988V5.86719C5.80957 4.72461 5.09229 4.05811 3.86084 4.05811ZM11.6621 12.1514C9.63721 12.1514 8.39941 10.7993 8.39941 8.57764V8.56494C8.39941 6.34961 9.64355 4.99121 11.6621 4.99121C13.6743 4.99121 14.9185 6.34326 14.9185 8.56494V8.57764C14.9185 10.7993 13.6807 12.1514 11.6621 12.1514ZM11.6621 11.0024C12.8428 11.0024 13.5156 10.1011 13.5156 8.57764V8.56494C13.5156 7.03516 12.8428 6.14014 11.6621 6.14014C10.4751 6.14014 9.80859 7.03516 9.80859 8.56494V8.57764C9.80859 10.1074 10.4751 11.0024 11.6621 11.0024ZM17.6226 12.0181L15.7183 5.12451H17.1021L18.3398 10.4438H18.4414L19.8633 5.12451H21.1709L22.5928 10.4438H22.7007L23.9321 5.12451H25.2969L23.3989 12.0181H21.9834L20.5552 6.87646H20.4473L19.0254 12.0181H17.6226ZM29.334 12.1514C27.3154 12.1514 26.0967 10.7739 26.0967 8.59033V8.58398C26.0967 6.43213 27.3408 4.99121 29.2642 4.99121C31.1875 4.99121 32.3682 6.38135 32.3682 8.45068V8.93311H27.4805C27.5059 10.2534 28.2295 11.0215 29.3657 11.0215C30.248 11.0215 30.7749 10.5835 30.9399 10.228L30.9653 10.1772L32.292 10.1709L32.2793 10.228C32.0508 11.1357 31.0986 12.1514 29.334 12.1514ZM29.2705 6.12109C28.3311 6.12109 27.6201 6.76221 27.4995 7.94922H31.0034C30.8955 6.71777 30.2036 6.12109 29.2705 6.12109ZM34.0059 12.0181V5.12451H35.3833V6.16553H35.4849C35.7324 5.43555 36.3735 5.00391 37.2939 5.00391C37.5161 5.00391 37.7573 5.03564 37.897 5.06738V6.33691C37.6494 6.28613 37.4146 6.25439 37.1543 6.25439C36.1006 6.25439 35.3833 6.90186 35.3833 7.89844V12.0181H34.0059ZM41.9277 12.1514C39.9092 12.1514 38.6904 10.7739 38.6904 8.59033V8.58398C38.6904 6.43213 39.9346 4.99121 41.8579 4.99121C43.7812 4.99121 44.9619 6.38135 44.9619 8.45068V8.93311H40.0742C40.0996 10.2534 40.8232 11.0215 41.9595 11.0215C42.8418 11.0215 43.3687 10.5835 43.5337 10.228L43.5591 10.1772L44.8857 10.1709L44.873 10.228C44.6445 11.1357 43.6924 12.1514 41.9277 12.1514ZM41.8643 6.12109C40.9248 6.12109 40.2139 6.76221 40.0933 7.94922H43.5972C43.4893 6.71777 42.7974 6.12109 41.8643 6.12109ZM49.1133 12.1323C47.3804 12.1323 46.2568 10.7422 46.2568 8.57764V8.56494C46.2568 6.38135 47.3613 5.00391 49.1133 5.00391C50.0591 5.00391 50.8652 5.47363 51.2334 6.21631H51.3413V2.42041H52.7124V12.0181H51.3413V10.9326H51.2334C50.8335 11.688 50.0781 12.1323 49.1133 12.1323ZM49.5068 10.958C50.6558 10.958 51.3604 10.0503 51.3604 8.57764V8.56494C51.3604 7.09229 50.6494 6.18457 49.5068 6.18457C48.3516 6.18457 47.6597 7.08594 47.6597 8.56494V8.57764C47.6597 10.0566 48.3516 10.958 49.5068 10.958ZM61.98 12.1323C61.0151 12.1323 60.2598 11.688 59.8599 10.9326H59.7583V12.0181H58.3809V2.42041H59.7583V6.21631H59.8599C60.228 5.47363 61.0342 5.00391 61.98 5.00391C63.7319 5.00391 64.8364 6.38135 64.8364 8.56494V8.57764C64.8364 10.7422 63.7192 12.1323 61.98 12.1323ZM61.5928 10.958C62.7417 10.958 63.4336 10.0566 63.4336 8.57764V8.56494C63.4336 7.08594 62.7417 6.18457 61.5928 6.18457C60.4438 6.18457 59.7329 7.09229 59.7329 8.56494V8.57764C59.7329 10.0503 60.4438 10.958 61.5928 10.958ZM66.8867 14.4429C66.7153 14.4429 66.5122 14.4302 66.3345 14.4111V13.3257C66.4678 13.3447 66.6392 13.3511 66.7979 13.3511C67.439 13.3511 67.8262 13.0781 68.0293 12.3799L68.1309 12.0244L65.6299 5.12451H67.1152L68.8418 10.6343H68.9624L70.6826 5.12451H72.1299L69.5654 12.2847C68.9814 13.9287 68.2832 14.4429 66.8867 14.4429Z",fill:"black",fillOpacity:"0.7"}),C("path",{d:"M81.1088 6.63629C79.6878 6.32154 78.9672 5.76865 78.9672 4.99369C78.9672 4.19299 79.736 3.5886 80.7556 3.5886C81.8066 3.5886 82.5995 4.25285 82.5995 5.13336V5.20352H84.0518V5.13336C84.0518 3.52424 82.6405 2.30774 80.7693 2.30774C79.8676 2.30774 79.0414 2.58451 78.4433 3.08655C78.1463 3.33144 77.9077 3.63818 77.7448 3.98479C77.5818 4.33141 77.4984 4.70934 77.5005 5.09153C77.4946 5.44197 77.5675 5.78934 77.714 6.10857C77.8605 6.42779 78.0769 6.71092 78.3475 6.93752C78.8512 7.37584 79.5659 7.70024 80.4709 7.90299C81.9949 8.23898 82.7676 8.81054 82.7676 9.60094C82.7676 10.4576 81.9258 11.1032 80.813 11.1032C79.6571 11.1032 78.7854 10.3856 78.7854 9.43424V9.36408H77.3318V9.43424C77.3318 11.1167 78.8219 12.3847 80.7973 12.3847C81.7421 12.3847 82.6093 12.0983 83.2393 11.5769C83.5519 11.3237 83.8034 11.0048 83.9753 10.6433C84.1472 10.2818 84.2352 9.88702 84.2329 9.48766C84.2329 8.05875 83.1833 7.09907 81.1088 6.63629Z",fill:"black",fillOpacity:"0.7"}),C("path",{d:"M89.2394 4.68276C88.6963 4.67605 88.1596 4.79915 87.6751 5.04156C87.1905 5.28397 86.7725 5.63851 86.4566 6.07497V4.85204H85.0747V14.8479H86.4566V11.0356C86.7725 11.472 87.1906 11.8265 87.6751 12.0688C88.1596 12.3111 88.6963 12.434 89.2394 12.4272C91.3836 12.4272 93 10.7627 93 8.55495C93 6.34723 91.3836 4.68276 89.2394 4.68276ZM91.5608 8.84202C91.5057 9.41605 91.2512 9.95356 90.8406 10.3633C90.4299 10.773 89.8883 11.0296 89.3078 11.0896C88.5363 11.1669 87.8177 10.9461 87.2841 10.4692C86.7505 9.99222 86.4566 9.3106 86.4566 8.55495C86.4566 7.10159 87.5538 6.00546 89.0087 6.00546C89.7619 6.00546 90.4421 6.29124 90.9171 6.81002C91.407 7.34232 91.6357 8.06385 91.5608 8.84202Z",fill:"black",fillOpacity:"0.7"}),C("path",{d:"M109.95 4.85407V6.06349C109.298 5.18298 108.292 4.68286 107.153 4.68286C105.017 4.68286 103.406 6.31709 103.406 8.48426C103.406 10.6514 105.017 12.285 107.153 12.285C108.296 12.285 109.303 11.79 109.95 10.9185V11.1046C109.95 12.6101 108.993 13.5826 107.513 13.5826C106.513 13.5826 105.68 13.1494 105.284 12.424L105.264 12.3867H103.838L103.871 12.48C104.112 13.1892 104.583 13.8001 105.211 14.2179C105.841 14.6324 106.637 14.8512 107.513 14.8512C108.637 14.8512 109.594 14.4972 110.28 13.8285C110.967 13.1597 111.332 12.2194 111.332 11.1213V4.85407H109.95ZM109.175 10.3502C108.588 10.905 107.752 11.138 106.879 10.9887C106.361 10.8984 105.886 10.6475 105.523 10.2725C105.16 9.89751 104.927 9.41787 104.859 8.90328C104.736 8.03757 104.999 7.21756 105.581 6.655C106.069 6.19093 106.723 5.93643 107.401 5.94699C107.565 5.94713 107.729 5.96026 107.891 5.98625C108.946 6.15489 109.781 7.01609 109.921 8.0852C110.039 8.96507 109.766 9.78958 109.175 10.3502Z",fill:"black",fillOpacity:"0.7"}),C("path",{d:"M101.89 2.12378C101.63 2.06766 101.358 2.11486 101.133 2.25518C100.908 2.39551 100.747 2.61769 100.687 2.87371C100.626 3.12973 100.67 3.39902 100.809 3.62339C100.947 3.84775 101.17 4.00917 101.428 4.07275C101.503 4.08936 101.58 4.09778 101.657 4.09786C101.906 4.09824 102.146 4.0083 102.331 3.84518C102.517 3.68206 102.636 3.45714 102.664 3.21327C102.693 2.9694 102.63 2.72361 102.487 2.5227C102.344 2.32179 102.132 2.17981 101.89 2.12378Z",fill:"black",fillOpacity:"0.7"}),C("path",{d:"M100.967 10.934H99.7755C98.9285 10.934 98.4196 10.3644 98.4196 9.40982C98.4196 8.4791 98.8757 7.36945 99.8054 6.01778L99.8178 5.99976V5.61807L95.8571 5.06453C95.8585 4.90331 95.8162 4.74466 95.7346 4.60501C95.653 4.46536 95.5352 4.34979 95.3932 4.27027C95.0381 4.07718 94.6498 4.07717 94.3279 4.26383C94.1667 4.35799 94.035 4.4945 93.9476 4.65816C93.8602 4.82182 93.8205 5.00623 93.8328 5.19087C93.8452 5.37552 93.9092 5.55315 94.0176 5.70402C94.1261 5.85489 94.2748 5.97309 94.4472 6.04546L93.2151 12.258H94.5833L95.7196 6.35891L97.8593 6.7155C97.284 7.73439 96.9921 8.68442 96.9921 9.53919C96.9921 11.1168 97.9577 12.1498 99.5187 12.2496V12.258H102.346V4.87723H100.967V10.934Z",fill:"black",fillOpacity:"0.7"})]}),C1=()=>{const{border:e,cards:t,forceBrandedLogo:n,headers:r,index:i,marketingUrl:o,showSurveyBrand:a,slugName:s,surveyId:l,viewedCardCount:u}=ce(_=>({border:_.border,cards:_.cards,forceBrandedLogo:_.forceBrandedLogo,headers:_.headers,index:_.index,marketingUrl:_.marketingUrl,showSurveyBrand:_.showSurveyBrand,slugName:_.slugName,surveyId:_.surveyId,viewedCardCount:_.viewedCardCount})),c=Yt(null),d=t.filter(_=>_.type!==O.Uploading&&_.type!==O.Thanks),p=I_(t,i),f=u+1,h=f/(f+p),m=`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${s}&utm_content=${l}${n&&"&utm_term=poweredby_pill"}`;Ze(()=>{c.current&&(c.current.style.width=`${h*100}%`)},[h]);const g=()=>C(Je,{children:[d.length>1&&C("div",{id:"ul-progress-bar-container",children:C("div",{id:"ul-progress-bar-current",ref:c,style:{border:`1px solid ${e||"#000"}`}})}),a?C("div",{className:n?"yellow-footer-logo":"",style:{marginTop:"4px"},children:C("a",{href:m,rel:"noreferrer",target:"_blank",children:C("div",{style:{display:"flex"},children:[C(Lu,{logoOnly:!1}),n&&C(Ou,{style:{display:"block",margin:"auto 0 auto 4px",transform:"rotateY(0deg) rotate(-45deg)"}})]})})}):null]}),b=()=>C("a",{href:m,rel:"noreferrer",target:"_blank",children:C("div",{className:"thank-you-card-link",children:[C("div",{className:"sprig-box-logo",children:C(Lu,{logoOnly:!0,style:{margin:"auto"}})}),C("div",{children:C("p",{children:["Capture insights about your own product",C(Ou,{style:{margin:"auto 0 auto 4px",display:"inline-flex"}})]})})]})}),y=t[i].type===O.Thanks;return C("footer",{className:`ul-footer ${r["userleap-platform"]==="link"?"ul-footer__link":""}`,style:a?{}:{marginBottom:"10px"},children:y&&n?b():g()})},Ou=({style:e})=>C("svg",{width:"12",height:"10",viewBox:"0 0 12 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,children:[C("path",{d:"M1.47839 5.2085L10.9384 5.2085",stroke:"black",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),C("path",{d:"M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",stroke:"black",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})]}),E1=()=>{const{answers:e,border:t,cards:n,close:r,configureExitOnOverlayClick:i,destroy:o,endCard:a,eventEmitFn:s,fontFamily:l,headers:u,index:c,next:d,showStripes:p,update:f,useMobileStyling:h,viewDocument:m}=ce(k=>({answers:k.answers,border:k.border,cards:k.cards,close:k.close,configureExitOnOverlayClick:k.configureExitOnOverlayClick,destroy:k.destroy,endCard:k.endCard,eventEmitFn:k.eventEmitFn,fontFamily:k.fontFamily,headers:k.headers,index:k.index,next:k.next,showStripes:k.showStripes,update:k.update,useMobileStyling:k.useMobileStyling,viewDocument:k.viewDocument})),g=Yt(null),b=Yt(!1),{props:y,type:_,name:v}=n[c],w=n.length;Ze(()=>{g.current&&(g.current.classList.contains("ul-app--visible")||g.current.classList.add("ul-app--visible"),!b.current&&s&&(b.current=!0,s(G.SurveyAppeared)))},[s]),Ze(()=>{f()},[c,f]),Ze(()=>{i(()=>r())},[r,i]);const E=()=>r(Nn),I=k=>{k.key==="Enter"&&E()},S=async function(k){d({data:k,completeSurvey:()=>{o(Nn)},endCard:a}),bv(m)};if(e){for(const k of e)if(k.questionId===v){let U;if(_===O.MultipleChoice){const R=y.options.find(({value:V})=>V===k.value);if(!R)break;U={[R.id]:R.value}}else U=k.value;S({value:U,type:_,questionId:k.questionId});break}}const x=()=>[mn.Email,mn.Link].includes(u["userleap-platform"])?!1:!a||c+1!==w,T=()=>h?{borderColor:t}:{borderColor:t,margin:"15px"},A=()=>{const k={className:"ul-card",next:S,questionId:v,type:_};switch(_){case O.ConsentLegal:return he(P_,{...k,...y,key:v});case O.Likert:return he(V_,{...k,...y,key:v});case O.MultipleChoice:return he(F_,{...k,...y,key:v});case O.MultipleSelect:return he(B_,{...k,...y,key:v});case O.NPS:return he(j_,{...k,key:v,props:y});case O.Open:return he(H_,{...k,...y,key:v});case O.RecordedTask:return he(X_,{...k,...y,key:v});case O.TextUrlPrompt:return he(n1,{...k,...y,key:v});case O.Thanks:return he(r1,{...k,...y,key:v});case O.Uploading:return he(w1,{...k,...y,key:v});case O.VideoVoice:return he(b1,{...k,...y,key:v});default:return null}},L=k=>{var K;const U=window.sprigAPI,R=k.target;if(!U||!R)return;const V=[R,R.parentElement];for(const z of V)if(((K=z==null?void 0:z.tagName)==null?void 0:K.toLowerCase())==="a"){k.preventDefault(),U==null||U.openUrl(z.href);return}};return C("div",{className:H("ul-app",Dn(u)?"ul-app--visible":"ul-app--overlay"),id:Nn,onClick:L,ref:g,style:{"--theme":t,...l?{fontFamily:l.replace(";","")}:{}},children:C("div",{className:"ul-app__container",children:[C("div",{className:H(_e(N.CardContainer,h)),style:T(),children:[p&&C("div",{className:"ul-header__container",children:C("div",{className:"ul-header",children:"For development purposes only"})}),A(),C(C1,{})]}),x()&&C("div",{className:H(_e(N.CloseContainer,h)),children:C("div",{"aria-label":"Close button",className:N.CloseButton,onClick:E,onKeyPress:I,role:"button",tabIndex:0,children:C("svg",{fill:"none",height:"18px",viewBox:"0 0 13 13",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})})]})})},S1=`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:left;margin:auto}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container{background:#ffffff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;margin-bottom:3px;display:flex;gap:16px;justify-content:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0 5px 20px}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:left;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{padding-top:15px;margin-bottom:5px}.ul-question{color:#343442;display:block;font-size:20px;line-height:125%;font-weight:500;cursor:default;text-align:left}.ul-caption{flex:1 0 auto;margin-top:8px;margin-bottom:15px;font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:left}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%;height:fit-content;flex:0 0 fit-content}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.select-checkbox{height:16px;width:16px;border-radius:3px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 3px 3px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.fade-in-transition{animation:fadeIn .4s ease-in;-webkit-animation:fadeIn .4s ease-in;-moz-animation:fadeIn .4s ease-in;-o-animation:fadeIn .4s ease-in;-ms-animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{box-shadow:unset;border-radius:unset;border:none!important;position:unset}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:white}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.likert-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.likert-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-number-1{border-top-left-radius:5px;border-bottom-left-radius:5px}.likert-last-option{border-top-right-radius:5px;border-bottom-right-radius:5px}.likert-star--mobile{margin-left:-2px}.likert-star--desktop{margin-left:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px}.likert-smiley--mobile{margin-left:-2px}.likert-smiley--desktop{margin-left:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels span:last-child{text-align:right}.select-label{flex:1;overflow-wrap:anywhere;cursor:pointer;padding-left:15px}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6;margin-left:-2px}.nps-number--desktop{border:1px solid #e6e6e6;margin-left:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.nps-number-0{border-top-left-radius:5px;border-bottom-left-radius:5px}.nps-number-10{border-top-right-radius:5px;border-bottom-right-radius:5px}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--nps__labels span:last-child{text-align:right}.ul-card-text{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:white}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}#ul-card-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#ffffff;border-radius:5px;text-align:left;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:30px;justify-content:center}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%;margin-bottom:8px}.ul-footer>.yellow-footer-logo{background:#FAD133;border:1px solid #F9C600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#F9C600}.ul-footer .thank-you-card-link{background:rgba(0,0,0,.01);border:1px solid #E6E6E6;border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;margin-bottom:15px;padding:12px;text-align:left}.ul-footer .thank-you-card-link:hover{background:rgba(0,0,0,.03)}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:rgba(249,198,0,1);border-radius:5px;display:flex;margin-right:8px;padding:4px}.close-container--desktop,.close-container--mobile{height:22px;width:22px;border-radius:22px;background-color:#fff;align-items:center;justify-content:center}.close-container--desktop{top:25px;right:25px}.close-container--mobile{top:15px;right:10px}.close-container{background:transparent;box-sizing:border-box;display:flex;position:absolute}.close-btn{height:18px;width:18px;align-items:center;justify-content:center;display:flex;cursor:pointer}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:rgba(0,0,0,.01);border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}
738
- `,I1=(e,t)=>{const n=[...e],r=new Set([O.VideoVoice,O.RecordedTask]);return e.some(i=>r.has(i.type))&&n.push({name:-2,props:{routingOptions:[]},type:O.Uploading}),t&&n.push({name:-1,props:{routingOptions:[]},type:O.Thanks}),n},k1=({mode:e=null,viewWindow:t,viewDocument:n})=>{const r=n.documentElement;return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:r.clientWidth,ch:r.clientHeight,p:t.location.href,l:t.navigator.language}};function x1(e,t=!0){var w;const{answers:n,apiURL:r,customStyles:i,endCard:o,eventEmitFn:a,fontFamilyURL:s,frame:l,previewKey:u,viewDocument:c,viewWindow:d}=e,p=Dn(e.headers)?e.frame:c.body,f=e.UpChunk||window.UpChunk,h=Z,m=I1(e.cards,!!o);pi.configure(h,{cards:m,hasEndCard:!!o,apiURL:r,UpChunk:f}),ce.setState({apiURL:r,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:m,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:a,fontFamily:e.fontFamily,forceBrandedLogo:e.forceBrandedLogo,frame:l,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:k1({mode:e.mode,viewWindow:d,viewDocument:c}),mode:e.mode,previewKey:u,recorder:pi,recorderEventEmitter:h,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,surveyId:e.surveyId,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:e.startingQuestionIdx||0});const{seen:g}=ce.getState();g();const{head:b}=c,y=c.createElement("style");if(y.id="sprig-style",y.textContent=S1,y.nonce=e.styleNonce,b.appendChild(y),e.fontFamily&&s&&parent){const E=c.createElement("link");E.rel="stylesheet",E.href=s,b.appendChild(E)}if(e.customStyles&&jc(c,i,e.styleNonce),!f)if(e.installationMethod!==Tt.Npm){const E=c.createElement("script");E.src="https://cdn.sprig.com/userleap-web-upchunk-v2.2.2.js",E.onload=()=>{pi.setUpChunk(d.UpChunk)},E.onerror=()=>{console.warn("[Sprig] - recording functionality not configured due to UpChunk library load failure")},b.appendChild(E)}else console.warn("[Sprig] - recording functionality not configured due to missing UpChunk dependency");const _=__SDK_VERSION__,v=a||((w=l.eventEmitter)==null?void 0:w.emit);v==null||v(Qe.VerifyViewVersion,{[ln.ViewVersion]:_}),p&&t&&Gn(C(E1,{}),p)}const A1={configure:x1};window.UserLeap&&window.Sprig&&(window.Sprig._gtm?window.Sprig=window.UserLeap:window.UserLeap=window.Sprig);window.UserLeap||(window.UserLeap=window.Sprig);window.Sprig||(window.Sprig=window.UserLeap);const T1="rgba(255,255,255, 0.95)",R1="rgba(0,0,0,0.9)",L1="360px",Ho="0px",ep=()=>{window.UserLeap.container=document.createElement("div"),window.UserLeap.container.className="ul-container",document.body.appendChild(window.UserLeap.container)},tp=e=>{P1();const t=window.UserLeap.container;if(!(!t||!t.parentNode))try{t.parentNode.removeChild(t),window.UserLeap.container=null,je("trackStartUrl",null),Z.emit(G.SurveyLifeCycle,{state:"dismissed"}),Z.emit(G.SurveyClosed,{name:G.SurveyClosed,initiator:e})}catch(n){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+t),n instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",n)}},np=()=>{Z.on(G.SurveyWillClose,({initiator:e})=>{tp(e)})},O1=(e,t)=>{const r={...{position:"fixed",overflow:"auto",top:"0px",left:"0px",display:"none",height:"100%",width:"100%",transition:"background-color 0.3s ease-out",zIndex:2147483646}},i=t?e.overlayStyleMobile:e.overlayStyle;r["background-color"]=i==="light"?T1:R1,t||(r.margin="auto"),window.UserLeap.container&&Object.assign(window.UserLeap.container.style,r)},N1=(e,t,n)=>{var s,l;const r={position:"fixed",bottom:"0px",right:Ho,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646},i=Object.assign({},t,window.UserLeap);let o,a=!1;return n?((s=window.UserLeap.windowDimensions)!=null&&s.width?r.width=`${window.UserLeap.windowDimensions.width}px`:r.width="100%",(l=window.UserLeap.windowDimensions)!=null&&l.height?r.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`:window.UserLeap.maxHeight?r.maxHeight=window.UserLeap.maxHeight:r.maxHeight=`${document.body.clientHeight-20}px`,["light","dark"].includes(i.overlayStyleMobile)&&(a=!0)):(r.width=L1,r.maxHeight=window.UserLeap.maxHeight||"66vh",i.framePosition===nr.BottomLeft?o={left:Ho}:i.framePosition===nr.TopLeft?o={left:Ho,top:"0px"}:i.framePosition===nr.TopRight?o={top:"0px"}:i.framePosition===nr.Center&&(a=!0,o={margin:"auto",position:"static"},r.maxHeight=null)),a&&O1(i,n),Object.assign(e.style,r,o),a},D1=(e,t)=>{var s,l;const n="ul-frame";ep(),U1();const r=document.createElement("iframe");r.id=n,r.setAttribute("title","Sprig User Feedback Dialog");const i=N1(r,e,t);np(),r.setHeight=u=>{parseInt(r.style.height)!=u&&(r.style.height=`${u}px`,Z.emit(G.SurveyHeight,{name:G.SurveyHeight,contentFrameHeight:u}))},(s=window.UserLeap.container)==null||s.appendChild(r),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{Z.emit(G.CloseSurveyOnOverlayClick)}),Z.emit(G.SurveyLifeCycle,{state:"presented"}),Z.emit(G.SurveyPresented,{name:G.SurveyPresented});const o=(l=r.contentWindow)==null?void 0:l.document;o&&(o.open("text/html","replace"),o.write("<!doctype html><head></head><body></body></html>"),o.close());const a=o==null?void 0:o.head;return{frameId:n,contentWinDocHead:a,contentWindow:r.contentWindow,hasOverlay:i,iframe:r}},rp={[G.SurveyFadingOut]:()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}},U1=()=>{Object.entries(rp).forEach(([e,t])=>{Z.on(e,t)})},P1=()=>{Object.entries(rp).forEach(([e,t])=>{Z.off(e,t)})},M1="!launch_darkly_";class V1{constructor(){Ae(this,"_ldData",{})}getAllLaunchDarklyVariations(){return this._ldData}setLDFlagsVariations(t){try{return!t||typeof t!="object"||Array.isArray(t)?!1:(Object.keys(this._ldData).forEach(n=>{delete this._ldData[n]}),Object.keys(t).forEach(n=>{var r;return this._ldData[`${M1}${n}`]=((r=t[n])!=null?r:0)+1}),!0)}catch(n){return n instanceof Error&&window.UserLeap.reportError("setAllLDFlagsVariations",n),console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."),!1}}}const Ma=new V1;Object.freeze(Ma);const F1="!optimizely_experiments_";class B1{constructor(){Ae(this,"_optimizelyData",{})}setOptimizelyExperiment(t,n=!0){if(!t||typeof t!="object")return!1;const{experiments:r}=t;try{return n&&Object.keys(this._optimizelyData).map(i=>{delete this._optimizelyData[i]}),r&&r.map(i=>{const{id:o,variation:a}=i,s=this.transformExperimentId(o);a&&typeof a=="string"&&(this._optimizelyData[s]=a)}),!0}catch(i){return i instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",i),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(t){return this._optimizelyData[this.transformExperimentId(t)]}transformExperimentId(t){return F1+t}getAndSetWebOptimizelyExperiments(){var t;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const n=(t=window.optimizely.get("state"))==null?void 0:t.getExperimentStates({isActive:!0});if(n){const r=Object.keys(n).map(i=>{var o,a;return(o=n[i].variation)!=null&&o.name?{id:i,variation:(a=n[i].variation)==null?void 0:a.name}:{id:i,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r},!1),!0}return!1}return!1}catch(n){return n instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",n),!1}}}const gi=new B1;Object.freeze(gi);class j1{constructor(t,n){Ae(this,"paused");Ae(this,"queue");Ae(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(n)}flush(t){const n=t.length;if(n)for(let r=0;r<n;r++)this.push(t[r])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const n=Array.prototype.slice.call(t,1),r=t[0],i=this.ul[r];i instanceof Function?i.apply(this.ul,n):r&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",r)}}perform(t){if(this.paused){let n=()=>{};const r=new Promise(function(i){n=function(){i(t())}});return this.queue.push(n),r}else return t()}empty(){this.queue.length=0}}var qe=(e=>(e.Ready="ready",e.NoSurvey="no survey",e))(qe||{}),ip=(e=>(e.Preview="sprigPreviewKey",e))(ip||{});const H1=["popState","pushState","replaceState"],z1={test:"test"},er="!email",G1=["ios","android"],dn="environments",Va="pageUrl",tn="visitors",Nu="ul-view-sdk-script",Du=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function Us(e,t){const{matchType:n,pattern:r}=e,i=n?Du[n]:Du.legacy;let o=!1;try{o=i(r,t)}catch(a){const s=`[Sprig] (ERR-445) Failed to check url match with pattern ${r}`;a instanceof Error&&(console.warn(s,a),a.stack=JSON.stringify(e),window.UserLeap.reportError(s,a))}return o}function K1(e,t){const{pageUrlEvents:n,interactiveEvents:r,dismissOnPageChange:i}=window.UserLeap._config;if(!i)return!0;const o=[];n&&n.length&&o.push(...n),r&&r.length&&o.push(...r);const a=e&&o.find(s=>s.id===e);return a?Us(a,window.location.href):t===window.location.href}function kr(e){const{pageUrlEvents:t,interactiveEvents:n,dismissOnPageChange:r,platform:i}=window.UserLeap._config;if(i&&i!==mn.Web)return;const o=nn("trackStartUrl"),a=o?String(o):null;t&&up(window.location.href),n&&(ap(),W1()),r&&a&&a!==window.location.href&&e&&H1.includes(e.type)&&window.UserLeap("dismissActiveSurvey",dt.PageChange)}const op={capture:!0},W1=()=>{const t=window.UserLeap._config.interactiveEvents.filter(r=>Us(r,window.location.href)).map(r=>{const{name:i,properties:o}=r,{selector:a,innerText:s}=o;return a?l=>{if(Bn(l.target))try{l.target.closest(a)&&window.UserLeap("track",i)}catch{}return!1}:l=>(Bn(l.target)&&l.target.innerText===s&&window.UserLeap("track",i),!1)}),n=r=>t.forEach(i=>i(r));window.UserLeap._config.interactiveEventsHandler=n,window.addEventListener("click",n,op)},ap=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,op),delete window.UserLeap._config.interactiveEventsHandler};function q1(){["hashchange","popstate"].forEach(e=>window.addEventListener(e,kr,!0))}function $1(){["hashchange","popstate"].forEach(e=>window.removeEventListener(e,kr,!0)),window.UserLeap._config.interactiveEvents&&ap()}function Ct(e,t,n){const r=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(i=>{r.push(i),i===dn?r.push(window.UserLeap.envId):i===tn&&r.push(Ps())}),n&&r.push(n),r.join("/")}function Y1(e,t){let n=Ct("1",[dn],"questions?");return e!=null&&(n+=`&vid=${e}`),t&&(t.surveyId&&(n+=`&surveyid=${t.surveyId}`),t.surveyTemplateId&&(n+=`&surveytemplateid=${t.surveyTemplateId}`)),n}function sp(){try{if(typeof localStorage<"u"&&(localStorage.setItem("is_available","yes"),localStorage.getItem("is_available")==="yes"))return localStorage.removeItem("is_available"),!0}catch{return!1}return!1}function nn(e){if(!window.UserLeap.localStorageAvailable)return null;const t=localStorage.getItem(He.Credentials);if(t)try{const r=JSON.parse(t)[window.UserLeap.envId];return r&&r[e]||null}catch(n){n instanceof Error&&(n.stack=t,window.UserLeap.reportError("Failed to parse local storage credentials",n)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",n)}return null}function je(e,t){if(!window.UserLeap.localStorageAvailable)return;const n=localStorage.getItem(He.Credentials);let r={};if(n)try{r=JSON.parse(n)}catch(o){o instanceof Error&&(o.stack=n,window.UserLeap.reportError("Failed to parse local storage credentials",o)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",o)}let i=r[window.UserLeap.envId];i?i[e]=t:i={[e]:t},r[window.UserLeap.envId]=i;try{localStorage.setItem(He.Credentials,JSON.stringify(r))}catch(o){o instanceof Error&&console.warn(`[Sprig] (ERR-426) Unable to write to Local Storage:: ${o.message}`)}}function lp(){window.previewMode||(window.UserLeap.visitorId=Kt(),je("vid",window.UserLeap.visitorId),Z.emit(G.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}))}function Ps(){return window.previewMode?"0":window.UserLeap.visitorId||""}function up(e,t,n){if(!window.UserLeap.localStorageAvailable||e.endsWith("mock_snippet.html"))return;const r=window.UserLeap._config.pageUrlEvents;if(r&&r.length){let u=!1;for(let c=0;c<r.length&&(u=Us(r[c],e),!u);c++);if(!u)return}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const i=10,o=1;let a=[];const s={viewedAt:Date.now(),location:e},l=localStorage.getItem(He.PageViews);try{if(a=l?JSON.parse(l):[],Array.isArray(a)||(a=[]),a.length>0){const u=a[a.length-1],c=(Date.now()-u.viewedAt)/1e3;u.location!=e&&c>o&&Kl({url:e}),(u.location!=e&&c>o||c>i)&&(window.UserLeap._queue.push(["track",Va,t,{url:e},n]),a.push(s))}else window.UserLeap._queue.push(["track",Va,t,{url:e},n]),a.push(s),Kl({url:e});a.length>5&&a.splice(0,a.length-5);try{localStorage.setItem(He.PageViews,JSON.stringify(a))}catch(u){u instanceof Error&&console.warn(`[Sprig] Unable to write to Local Storage: ${u.message}`)}}catch(u){u instanceof Error&&window.UserLeap.reportError("trackPageView",u,{pageViewsStorage:l}),console.warn("[Sprig] (ERR-425) Failed to update page views in local storage")}}function Z1(){const e="Backbone"in window&&window.Backbone&&window.Backbone.history?window.Backbone.history:window.history;"pushState"in e&&(e.pushState=(t=>function(...r){const i=t.apply(this,r),o=new Event("pushState");return window.dispatchEvent(o),kr(o),i})(e.pushState)),"replaceState"in e&&(e.replaceState=(t=>function(...r){const i=t.apply(this,r),o=new Event("replaceState");return window.dispatchEvent(o),kr(o),i})(e.replaceState)),q1()}async function zo(e,t){const n=Ps();e&&!t&&(window.UserLeap._config.mode=z1.test);const r=await jt(Y1(n,e),{},0,!0);return r.ok?(r.json.delay&&await Ai(r.json.delay),cp(r.json)):(r.reportError&&r.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",r.error),window.UserLeap.reportError("getQuestions",r.error)),{success:!1,surveyState:qe.NoSurvey})}const Q1=e=>e.some(t=>t.type===O.VideoVoice),cp=async e=>{var L,k,U,R,V,K;const{context:t,forceBrandedLogo:n,endCard:r,locale:i,productConfig:o,questions:a,responseGroupUid:s,surveyId:l,uuid:u,vid:c,sessionReplay:d}=e,p=Or(window.UserLeap),f=Ms(p),h=J1(p);if(d&&Dd({responseGroupId:s,surveyId:l,visitorId:c,replayParams:d,completeUploadHeaders:p,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:a.length===0}),c==null||!a||!a.length)return{success:!1,message:"[Sprig] no survey found",surveyState:qe.NoSurvey};if(((k=(L=window.UserLeap)==null?void 0:L._config)==null?void 0:k.installationMethod)===Tt.NpmBundled&&Q1(a))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:qe.NoSurvey};if(window.UserLeap.container){const z="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(z),{success:!1,message:z,surveyState:qe.NoSurvey}}if(c!==window.UserLeap.visitorId&&u!==window.UserLeap.visitorId&&!window.previewMode){const z="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(z)),{success:!1,message:z,surveyState:qe.NoSurvey}}B0({id:l}),Xo.disable(),Z.emit(G.SurveyWillPresent,{name:G.SurveyWillPresent,[Cc.SurveyId]:l});let m,g=document.createElement("div"),b,y,_;const v=z=>{const{[ln.ViewVersion]:ie}=z;ie!==p["x-ul-sdk-version"]&&tp(),Z.removeListener(Qe.VerifyViewVersion,v)};Z.on(Qe.VerifyViewVersion,v),Dn(p)?(m="ul-direct-embeded-frame",b=document.head,y=window,_=!1,f&&(ep(),g.id=m,window.UserLeap.container.appendChild(g),np(),Z.emit(G.SurveyLifeCycle,{state:"presented"}),Z.emit(G.SurveyPresented,{name:G.SurveyPresented}))):{frameId:m,contentWinDocHead:b,contentWindow:y,hasOverlay:_,iframe:g}=D1(o,h),window.UserLeap.frameId=m,window.UserLeap.useMobileStyling=h;const w=z=>{Z.on(G.CloseSurveyOnOverlayClick,z)},E=Object.assign({frame:g,envId:window.UserLeap.envId,surveyId:l,userId:u,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},cards:a,context:t,locale:i,fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,apiURL:window.UserLeap._API_URL,responseGroupUid:s,headers:p,endCard:r,useMobileStyling:h,mobileSDKVersion:window.UserLeap.mobileSDKVersion,configureExitOnOverlayClick:w,eventEmitFn:Z.emit.bind(Z),ulEvents:Ga,viewDocument:y==null?void 0:y.document,viewWindow:y,tabTitle:document.title,startingQuestionIdx:(U=window.UserLeap.config)==null?void 0:U.startingQuestionIdx,styleNonce:window.UserLeap.styleNonce,previewKey:(R=window.UserLeap)!=null&&R.localStorageAvailable?(V=window.localStorage)==null?void 0:V.getItem(He.Preview):null,forceBrandedLogo:n},window.UserLeap._config);(K=window.UserLeap.config)!=null&&K.startingQuestionIdx&&(window.UserLeap.config={...window.UserLeap.config,startingQuestionIdx:null}),window.UserLeap.customStyles&&(E.customStyles=window.UserLeap.customStyles),y&&(y.__cfg=E);function I(){const z=document.createElement("script");return window.UserLeap.nonce&&z.setAttribute("nonce",window.UserLeap.nonce),z.id=Nu,z}const S=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:E.path,x=document.getElementById(Nu);x&&x.remove();const T=I(),A=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};return E.installationMethod===Tt.Npm||E.installationMethod===Tt.NpmBundled?(A1.configure(E),_&&window.UserLeap.container&&A()):S&&(T.src=S,_&&T.addEventListener("load",()=>{window.UserLeap.container&&A()}),y==null||y.addEventListener("error",z=>{z.target instanceof HTMLScriptElement&&z.target.src===S&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0})),b==null||b.appendChild(T),{success:!0,surveyState:qe.Ready,surveyId:l,responseGroupUid:s}};function J1(e){if(window.UserLeap.useMobileStyling!==void 0)return window.UserLeap.useMobileStyling;const t=window.UserLeap.windowDimensions&&window.UserLeap.windowDimensions.width||document.body.clientWidth;return Ms(e)||t>10&&t<pv}function Ms(e){return G1.includes(e[ct.Platform])}function X1(e){let t=e.length;for(;t;){const n=Math.floor(Math.random()*t);t-=1;const r=e[t];e[t]=e[n],e[n]=r}}function eb(e){if(!e)return;window.UserLeap._config=e,e.mute&&window.UserLeap._queue.pause();const{interactiveEvents:t,pageUrlEvents:n,dismissOnPageChange:r}=e;t&&X1(t),(t||n||r)&&(Z1(),kr())}async function jt(e,t,n=0,r=!1){var o,a;t.headers=Object.assign(Or(window.UserLeap),t.headers);const i=await Rt(e,t,n,r);if(i.ok){const s=(o=i.headers)==null?void 0:o.get("Authorization"),l=s?s.split(" "):void 0,u=l&&l.length===2?l[1]:void 0,c=(a=i.headers)==null?void 0:a.get(ct.VisitorID);u&&c&&(c!==window.UserLeap.visitorId||window.UserLeap.token!==u)&&(je("token",u),je("vid",c),Z.emit(G.VisitorIDUpdated,{visitorId:c}),window.UserLeap.token=u,window.UserLeap.visitorId=c)}return i.json&&i.json.logMessage&&console.warn(`[Sprig] ${i.json.logMessage}`),i}async function tb(e,t){var r,i;let n=!0;return t&&((r=e==null?void 0:e.json)==null?void 0:r.surveyId)&&(window.UserLeap.delayingSurvey=!0,n=await t(e.json.surveyId),window.UserLeap.delayingSurvey=!1,!n)?!1:((i=e==null?void 0:e.json)!=null&&i.delay&&(window.UserLeap.delayingSurvey=!0,await Ai(e.json.delay),window.UserLeap.delayingSurvey=!1),n)}const nb=function(e){if(!window.UserLeap)return;const t=async(r={})=>{var m,g,b,y,_;const{userId:i,anonymousId:o,metadata:a={},properties:s,showSurveyCallback:l}=r;let{eventName:u}=r;if(window.UserLeap.debugMode&&u!==Va&&console.info("[DEBUG] Sprig track",r),e.mode==="test")return;const c=window.UserLeap.localStorageAvailable&&(m=localStorage.getItem(He.Preview))!=null?m:void 0;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const v="[Sprig] - Skipping tracking without userId";return console.warn(v),{success:!1,message:v,surveyState:qe.NoSurvey}}if(!u||u.trim().length===0){u=u?String(u):"";const v="[Sprig] - Invalid event name "+u;return console.warn(v),{success:!1,message:v,surveyState:qe.NoSurvey}}const d=window.location.href;if(a.url||(a.url=d),je("trackStartUrl",d),(b=(g=window.UserLeap)==null?void 0:g._config)!=null&&b.optimizelyEnabled){const v=Or(window.UserLeap);Ms(v)||gi.getAndSetWebOptimizelyExperiments(),a.optimizelyExperiments=Object.assign({},gi.getAllOptimizelyExperiments())}(_=(y=window.UserLeap)==null?void 0:y._config)!=null&&_.launchDarklyEnabled&&(a.launchDarklyFlags=Ma.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),o&&(window.UserLeap.partnerAnonymousId=o),s&&(a.eventProperties=s),F0({name:u});const p=window.UserLeap.delayingSurvey?await jt(Ct("1",[tn],"events/batch"),{body:JSON.stringify({events:[{event:u,metadata:a}],previewKey:c}),method:"POST"},0,!0):await jt(Ct("1",[tn],"events"),{body:JSON.stringify({event:u,metadata:a,previewKey:c}),method:"POST"},0,!0);if(!p.ok){const v="[Sprig] (ERR-421) Failed to track event";return p.reportError&&(console.warn(v,p.error),p.error&&window.UserLeap.reportError("track",p.error)),{success:!1,message:v,error:p.error,surveyState:qe.NoSurvey}}i&&je("uid",i),o&&je("aid",o);const f=p.json;return f.invalidPreviewKey&&window.UserLeap.localStorageAvailable&&localStorage.removeItem(He.Preview),await tb(p,l)?K1(f.eventId,d)?cp(f):{success:!1,message:"Study should not be displayed after page navigation",surveyState:qe.NoSurvey}:{success:!1,message:"[Sprig] Callback returned false, aborting rendering of survey",surveyState:qe.NoSurvey}},n={async displaySurvey(r){return console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",dt.Override),zo({surveyId:r},!0)},_previewSurvey(r){window.UserLeap("dismissActiveSurvey",dt.Override),zo({surveyTemplateId:r},!1)},_reviewSurvey(r){window.UserLeap("dismissActiveSurvey",dt.Override),zo({surveyId:r},!1)},previewSurvey(r){n._previewSurvey(r)},reviewSurvey(r){n._reviewSurvey(r)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(r=dt.API){Z.emit(G.SurveyWillClose,{name:G.SurveyWillClose,initiator:r})},async setAttribute(r,i){if(!r||!i&&i!==0){const o="[Sprig] - Disregarding empty attribute / value provided";return console.warn(o),{success:!1,message:o}}return this.setAttributes({[r]:i})},async setAttributes(r){if(r==null||Object.keys(r).length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}return this.identifyAndSetAttributes({attributes:r})},async identifyAndSetAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",r),e.mode==="test")return;if(r===null||typeof r!="object"||!(r.userId||r.anonymousId||r.attributes)){const u="[Sprig] - Disregarding empty payload provided";return console.warn(u),{success:!1,message:u}}const{userId:i,anonymousId:o,attributes:a}=r;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const u="[Sprig] - Skipping tracking without userId";return console.warn(u),{success:!1,message:u}}if(!a&&(!i||window.UserLeap.userId===i)&&(!o||window.UserLeap.partnerAnonymousId===o))return{success:!0};const s={};i&&(s.userId=window.UserLeap.userId=i),o&&(s.partnerAnonymousId=window.UserLeap.partnerAnonymousId=o);let l;return a?(a.email&&!Object.prototype.hasOwnProperty.call(a,er)&&(a[er]=a.email,delete a.email),l=await jt(Ct("1",[dn,tn],"attributes"),{body:JSON.stringify(a),method:"PUT"}),!l.ok&&l.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",l.error),l.error&&window.UserLeap.reportError("identifyAndSetAttributes",l.error))):l=await jt(Ct("1",[dn,tn]),{body:JSON.stringify(s),method:"PUT"}),a&&a[er]&&(window.UserLeap.email=a[er]),l.ok&&(i&&je("uid",i),o&&je("aid",o)),{success:!!l.ok}},async removeAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",r),e.mode==="test")return;if(r==null||r.length===0){const o="[Sprig] - Disregarding empty attributes provided";return console.warn(o),{success:!1,message:o}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const o="[Sprig] - Skipping tracking without userId";return console.warn(o),{success:!1,message:o}}const i=await jt(Ct("1",[dn,tn],"attributes"),{body:JSON.stringify({delete:r}),method:"DELETE"});return!i.ok&&i.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",i.error),i.error&&window.UserLeap.reportError("removeAttributes",i.error)),{success:!!i.ok}},async addSurveyListener(r){Z.on(G.SurveyLifeCycle,r)},async removeSurveyListener(r){Z.removeListener(G.SurveyLifeCycle,r)},async addListener(r,i){Z.on(r,i)},async removeListener(r,i){Z.removeListener(r,i)},async removeAllListeners(){Z.removeAllListeners()},setPreviewKey(r){if(!r||typeof r!="string")return;const i=sp();window.UserLeap.localStorageAvailable=i,i&&r&&localStorage.setItem(He.Preview,r)},async setUserId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",r),r==null){const a=`[Sprig] - Invalid userId ${r}`;return console.warn(a),{success:!1,message:a}}if(e.mode==="test"||r===window.UserLeap.userId)return;window.UserLeap.userId=r;const i=window.UserLeap.visitorId,o=await jt(Ct("1",[dn,tn]),{body:JSON.stringify({userId:r}),method:"PUT"});if(!o.ok){o.reportError&&(console.warn("[Sprig] (ERR-420) Failed to set user id",o.error),o.error&&window.UserLeap.reportError("setUserId",o.error));return}i!==window.UserLeap.visitorId&&Gl(),je("uid",r)},async setPartnerAnonymousId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setPartnerAnonymousId",r),r==null){const i=`[Sprig] - Invalid partnerAnonymousId ${r}`;return console.warn(i),{success:!1,message:i}}return window.UserLeap.partnerAnonymousId=r,je("aid",r),{success:!0}},async track(r,i,o={},a=void 0){return t({eventName:r,properties:i,metadata:o,showSurveyCallback:a})},async identifyAndTrack(r){return await t(r)},trackPageView(r,i=void 0,o=void 0){up(r,i,o)},applyStyles(r){if(window.UserLeap.customStyles=r,window.UserLeap.container){const i=window.UserLeap.container.children[0].contentDocument;if(i){const o=i.getElementById(N.CustomStyle);o?o.textContent=r:jc(i,r,window.UserLeap.styleNonce)}}},setWindowDimensions(r,i){var l,u;const o=typeof r=="string"?parseInt(r,10):r,a=typeof i=="string"?parseInt(i,10):i;if(!isNaN(o)&&!isNaN(a)&&(window.UserLeap.windowDimensions={width:o,height:a}),!window.UserLeap.frameId)return;const s=document.getElementById(window.UserLeap.frameId);!s||(window.UserLeap.useMobileStyling&&((l=window.UserLeap.windowDimensions)!=null&&l.width&&(s.style.width=`${window.UserLeap.windowDimensions.width}px`),(u=window.UserLeap.windowDimensions)!=null&&u.height&&(s.style.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`),s.contentDocument&&(s.style.height=String(Hc(s.contentDocument))+"px")),Z.emit(G.SurveyDimensions,{name:G.SurveyDimensions,contentFrameWidth:s.clientWidth,contentFrameHeight:s.clientHeight}))},logoutUser(){window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,window.UserLeap.localStorageAvailable&&(localStorage.removeItem(He.Credentials),localStorage.removeItem(He.PageViews)),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),lp(),Gl(),window.UserLeap._queue.unpause()},teardown(){$1(),window.UserLeap("dismissActiveSurvey",dt.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(r,i=!0){var o,a;if(!((a=(o=window.UserLeap)==null?void 0:o._config)!=null&&a.optimizelyEnabled)){console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");return}try{const s=typeof r=="string"?JSON.parse(r):r;gi.setOptimizelyExperiment(s,i)}catch(s){console.warn("[Sprig] Error with integrating Optimizely data"),s instanceof Error&&window.UserLeap.reportError("integrateOptimizely",s)}},integrateOptimizelyClient(r){var o,a;if(!((a=(o=window.UserLeap)==null?void 0:o._config)!=null&&a.optimizelyEnabled)){console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");return}const i=({experiment:s,variation:l})=>{const u={experiments:[{id:s.id,variation:l.key}]};window.UserLeap("integrateOptimizely",u,!1)};r.notificationCenter.addNotificationListener(sv.NOTIFICATION_TYPES.ACTIVATE,i)},importLaunchDarklyData(r){var i,o;if(!((o=(i=window.UserLeap)==null?void 0:i._config)!=null&&o.launchDarklyEnabled)){console.warn("[SPRIG] LaunchDarkly integration is currently not enabled for your product.");return}Ma.setLDFlagsVariations(r)},setVisitorAttribute(r,i){return console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"),n.setAttribute(r,i)},async setEmail(r){return n.setAttribute(er,r)},async setVisitorEmail(r){return console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"),n.setEmail(r)},async _generateVideoUploadUrl(r){return ob(r)},async _completeSessionReplay({surveyId:r,responseGroupUuid:i,eventDigest:o}){if(!r||!i)return;const a=window.UserLeap._API_URL;try{await Zc({surveyId:r,responseGroupUuid:i,eventDigest:o,apiUrl:a},!0)}catch(s){console.warn("[Sprig] Error with completing session replay"),s instanceof Error&&window.UserLeap.reportError("completeSessionReplay",s)}}};Object.assign(window.UserLeap,n)};async function rb(e){const t=Or(window.UserLeap);document.addEventListener("securitypolicyviolation",ea);let n=await Rt(Ct("1",[dn],"config"),{headers:t});const r="TypeError";if(window.UserLeap.error=n.error,!n.ok&&n.error&&n.error.name===r?(window.UserLeap._API_URL="https://api.sprig.com",window.UserLeap.reportError("sprigDomainRequest",n.error)):document.removeEventListener("securitypolicyviolation",ea),!n.ok)return n.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",n.error),n.error&&window.UserLeap.reportError("applyRemoteConfig",n.error)),ta("Disabled: failed to fetch configuration"),e;const i=n.json;return i!=null&&i.disabled?(ta(`Disabled: ${i.disabled}`),{disabled:i.disabled}):Object.assign({},i,e)}async function ib(e,t,n={}){const r=window.__cfg&&window.__cfg.mode,i=Ps(),o=window.UserLeap.envId,a=window.document.documentElement,s={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:a.clientWidth,clientHeight:a.clientHeight,location:window.location.href,language:window.navigator.language,...n},l={action:e,err:{message:t.message,stack:t.stack},meta:s,vid:i,envId:o};(await jt(Ct("1",null,"errors"),{method:"POST",headers:{[ct.Error]:window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(l)},0,!0)).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}async function ob(e){var n;if(!e)return;const t=`${window.UserLeap._API_URL}/2/environments/integrations/upload`;try{const r=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.ok){const i=await r.json();return(n=i==null?void 0:i.upload)==null?void 0:n.url}else return null}catch(r){console.warn("[Sprig] Error with generating video upload url"),r instanceof Error&&window.UserLeap.reportError("generateVideoUploadUrl",r)}}function ab(e={}){var i;const t=(i=new URLSearchParams(window.location.search).get(ip.Preview))!=null?i:"",n=sp();window.UserLeap.localStorageAvailable=n,window.UserLeap.UPDATES=Ga,window.UserLeap("setPreviewKey",t);async function r(){if(window.UserLeap.loaded)return;if(window.UserLeap.reportError=ib,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const u in window.UserLeap._config)window.UserLeap[u]=window.UserLeap._config[u];if(!window.UserLeap.envId)if(window.UserLeap.appId)window.UserLeap.envId=window.UserLeap.appId;else throw new Error("Missing Environment id");window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const o=window.UserLeap.sampleRate;if(o)if(!n)window.UserLeap.debugMode&&console.info("[DEBUG] Sprig cannot sample users without localStorage permissions");else{let u=nn("sampled");if(u===null&&(u=Math.random()<o,je("sampled",u)),!u)return}else n&&nn("sampled")!==null&&je("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const a=[...window.UserLeap._queue];window.UserLeap._queue=new j1(window.UserLeap,[]),window.UserLeap._queue.pause();for(let u=0;u<a.length;u++)window.UserLeap._queue.push(a[u]);const s=nn("token");s?(window.UserLeap.token=s,window.UserLeap.visitorId=nn("vid"),window.UserLeap.userId=nn("uid"),window.UserLeap.partnerAnonymousId=nn("aid")):(window.UserLeap.localStorageAvailable&&localStorage.removeItem(He.Credentials),lp());const l=await rb(e);k0(window.document,l.maxReplayDurationSeconds,window.UserLeap.replayNonce,window.UserLeap.maxInflightReplayRequests,l.replaySettings),nb(l),await eb(l),window.UserLeap._queue.unpause(),Z.emit(G.SDKReady),Z.emit(G.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",r,!1)}class Gi{constructor(){Ae(this,"UPDATES",Ga)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,n){window.Sprig("setAttribute",t,n)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,n){window.Sprig("addListener",t,n)}removeListener(t,n){window.Sprig("removeListener",t,n)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,n={},r={}){window.Sprig("track",t,n,r)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}trackPageView(t,n,r){window.Sprig("trackPageView",t,n,r)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,n){window.Sprig("setWindowDimensions",t,n)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}}const Fa={configure:e=>{if(!e.envId&&!e.environmentId)throw new Error("Initialization Error: Sprig configure requires an environmentId");if(e.envId||(e.envId=e.environmentId||""),e.installationMethod="web-npm-bundled",window.Sprig)return window.Sprig;window.Sprig=function(){window.Sprig._queue.push(arguments)},Object.getOwnPropertyNames(Gi.prototype).map(n=>{n!=="constructor"&&(window.Sprig[n]=Gi.prototype[n])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,ab(e),window.Sprig}};Fa.configure;window.UpChunk={createUpload:Qp};window.rrwebRecord=Rr;exports.DismissReason=dt;exports.SprigAPI=Gi;exports.SprigEvent=G;exports.sprig=Fa;
64
+ `,Or=e=>(e==null?void 0:e.buttonText)||"Next",cf=e=>(e==null?void 0:e.skipButtonText)||"Skip",p0=({className:e,message:t,next:n,properties:r,questionId:i,type:o})=>{const{useMobileStyling:a,border:s}=le(E=>({useMobileStyling:E.useMobileStyling,border:E.border})),[u,c]=Ve(!1),[l,d]=Ve(""),[p,f]=Ve(!1),h=r==null?void 0:r.collectName,m=(r==null?void 0:r.nameLabelText)||"Full Name",g=(r==null?void 0:r.consentText)||"I agree to the stated conditions",w=(r==null?void 0:r.submitButtonText)||"Submit",y=!!l.trim(),v=u&&(!h||y),b=(E,x=!1)=>{E.preventDefault(),E.stopPropagation();let N=null;if(!x){if(!v){f(!0);return}N={submitted:!0},h&&(N.name=l)}n({value:N,questionId:i,type:o})},_=E=>{Mg(E.target)&&(E.preventDefault(),E.stopPropagation(),d(E.target.value))},C=E=>{Ln(E.target)&&(E.target.style.borderColor=p&&!y?Xn:s)},k=E=>{Ln(E.target)&&(E.target.style.borderColor=p&&!y?Xn:Fa)},I=()=>S("div",{children:[S(uf,{allowTextEntry:!1,border:s,error:p&&!u,index:0,isRadio:!1,isSelected:u,label:g,onUserInputChanged:({selected:E})=>{E!==u&&c(!u)},useMobileStyling:a}),h&&S("input",{"aria-label":m,"aria-placeholder":m,className:Y(ve(O.ConsentLegalNameInput,a)),"data-gramm":"false",maxLength:250,name:"name",onBlur:k,onFocus:C,onInput:_,placeholder:m,style:p&&!y?{borderColor:Xn}:{},tabIndex:0,value:l}),S("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[S(Ye,{className:v?"":O.ButtonDisabled,onClick:b,children:w}),r.required===!1&&S("button",{className:O.SkipButton,onClick:E=>b(E,!0),children:cf(r)})]})]});return S("div",{className:Y([e,"ul-card__consent-legal",O.FadeInTransition]),children:[S(xt,{message:t}),S("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:r&&r.richTextBody?{__html:r&&r.richTextBody}:void 0,id:"ul-card__consent-legal-body-container"}),S(fn,{properties:r,defaultBody:I,embeddedType:"pdf"})]},i)},h0=({activeValue:e,border:t,icon:n,isPressed:r,onSubmit:i,range:o,scaleLabelType:a,setActiveValue:s,setIsPressed:u,useMobileStyling:c,value:l})=>{const d=`option-${l}`,p=a===Qt.Number,f=a===Qt.Star,h=p&&l===e,[m,g]=(()=>l<=e&&f||l===e?r?[t,1]:[t,.3]:["",1])(),w=()=>{switch(a){case Qt.Star:return Y([...ve(O.LikertStar,c),...ve(`${O.LikertStar}-${l}`,c)]);case Qt.Smiley:return Y([...ve(O.LikertSmiley,c),...ve(`${O.LikertSmiley}-${l}`,c)]);default:return Y(l===o?[...ve(O.LikertNumber,c),...ve(`${O.LikertNumber}-${l}`,c),...ve("likert-last-option",c)]:[...ve(O.LikertNumber,c),...ve(`${O.LikertNumber}-${l}`,c)])}},y=()=>{s(-1),u(!1)};return S("div",{"aria-label":p?void 0:String(l),className:w(),dangerouslySetInnerHTML:{__html:n},id:d,onClick:()=>i(),onPointerDown:()=>u(!0),onPointerEnter:()=>s(l),onPointerLeave:y,role:"radio",style:{color:p?"":m,borderColor:h?m:"",fillOpacity:h?"":g,zIndex:h?3:"auto"},tabIndex:0})},m0=({className:e,labels:t,message:n,next:r,properties:i,questionId:o,type:a})=>{const{border:s,useMobileStyling:u}=le(I=>({border:I.border,useMobileStyling:I.useMobileStyling})),[c,l]=Ve(-1),[d,p]=Ve(!1),f=t&&t.left,h=t&&t.right;let m;const{range:g,scaleLabelType:w,ratingIcons:y}=i;g&&(m=Number(g));const v=m||5,b=I=>{var E,x;switch(w){case Qt.Star:return(E=y[0])==null?void 0:E.svg;case Qt.Smiley:return(x=y[I])==null?void 0:x.svg;default:return String(I+1)}},_=[...Array(v)].map((I,E)=>{const x=E+1;return S(h0,{activeValue:c,border:s,icon:b(E),isPressed:d,onSubmit:()=>r({value:x,questionId:o,type:a}),range:v,scaleLabelType:w,setActiveValue:l,setIsPressed:p,useMobileStyling:u,value:x},E)}),C=I=>{I.preventDefault(),I.stopPropagation(),r({value:null,questionId:o,type:a})},k=()=>S($e,{children:[S("div",{"aria-label":`Rating (1 - ${v})`,className:"ul-card--likert__numbers",role:"radiogroup",children:_}),S("div",{className:"ul-card--likert__labels",children:[S("span",{children:f}),S("span",{children:h})]}),!i.required&&S("div",{className:"ul-vertical-centered-container",children:S(Ye,{onClick:C,children:Or(i)})})]});return S("form",{className:Y([e,"ul-card--likert",O.FadeInTransition]),children:[S(xt,{message:n,properties:i}),S(fn,{properties:i,defaultBody:k})]},o)},df=({className:e,message:t,onSubmit:n,options:r=[],properties:i,questionId:o,type:a})=>{const{border:s,useMobileStyling:u}=le(_=>({border:_.border,useMobileStyling:_.useMobileStyling})),c=r.reduce((_,C)=>(_[C.id]={isSelected:!1},_),{}),[l,d]=Ve(c),p=a===R.MultipleChoice,f=i.required,h=Object.entries(l).some(([_,C])=>{var E;const k=r.find(x=>`${x.id}`===_),I=C.userText===void 0||C.userText.trim()==="";return((E=k==null?void 0:k.optionProperties)==null?void 0:E.allowsTextEntry)&&I&&C.isSelected}),m=Object.values(l).some(_=>_.isSelected),g=h||f&&!m,w=r.map(({id:_,label:C,value:k,optionProperties:I},E)=>{var F,P;const x=`${_}`,{allowsTextEntry:N}=I||{allowsTextEntry:!1};return S(uf,{allowTextEntry:N,border:s,error:!1,id:x,index:E,isRadio:p,isSelected:!!((F=l[x])!=null&&F.isSelected),label:C,onUserInputChanged:T=>v(T.id,T.selected,T.userText),promptText:"Please specify",text:(P=l[_])==null?void 0:P.userText,useMobileStyling:u,value:k},x)}),y=_=>{_.preventDefault(),_.stopPropagation(),n(l)},v=(_,C,k)=>{const I=Object.assign({},l);if(p&&C)for(const E of Object.values(I))E.isSelected=!1,delete E.userText;I[_]={isSelected:C,userText:k},d(I)},b=()=>S("div",{children:[S("div",{className:Y(ve(O.ChoiceGroup,u)),role:p?"radiogroup":"group",children:w}),S("div",{className:"ul-card__button-wrapper",children:S(Ye,{disabled:g,onClick:y,children:Or(i)})})]});return S("form",{className:Y([e,"ul-card--multiple",O.FadeInTransition]),id:"text-form",onSubmit:y,children:[S(xt,{message:t,properties:i}),S(fn,{properties:i,defaultBody:b})]},o)},g0=e=>{const{questionId:t,type:n,next:r,options:i}=e;return S(df,{...e,onSubmit:a=>{const s=Object.entries(a).find(([,p])=>p.isSelected)||[void 0,void 0],[u,c]=s,l=i.find(p=>`${p.id}`===u),d=c!=null&&c.userText?{[u]:{userText:c.userText}}:null;r({value:l&&u?{[u]:l.value}:{},secondaryValue:d,questionId:t,type:n})}})},v0=e=>{const{questionId:t,type:n,next:r}=e;return S(df,{...e,onSubmit:o=>{const a={},s=Object.entries(o).reduce((c,[l,d])=>(c[l]=d.isSelected,c),a),u=Object.entries(o).reduce((c,[l,d])=>{if(!d.userText)return c;const p=c||{};return p[l]={userText:d.userText},p},null);r({value:s,secondaryValue:u,questionId:t,type:n})}})},y0=({className:e,props:{labels:t,message:n,properties:r},next:i,questionId:o,type:a})=>{const{border:s,useMobileStyling:u}=le(h=>({border:h.border,useMobileStyling:h.useMobileStyling})),c=t&&t.left,l=t&&t.right,d=[...Array(11)].map((h,m)=>S("div",{className:Y([...ve(O.NPSNumber,u),...ve(`${O.NPSNumber}-${m}`,u)]),id:`option-${m}`,onClick:()=>i({value:m,questionId:o,type:a}),onKeyPress:g=>{g.preventDefault(),(g.key==="Enter"||g.key===" ")&&i({value:m,questionId:o,type:a})},onPointerDown:g=>{Ln(g.target)&&(g.target.style.zIndex="2",g.target.style.borderColor=s)},onPointerLeave:g=>{Ln(g.target)&&(g.target.style.zIndex="auto",g.target.style.borderColor=Fa)},role:"radio",tabIndex:0,children:m},m)),p=h=>{h.preventDefault(),h.stopPropagation(),i({value:null,questionId:o,type:a})},f=()=>S("div",{children:[S("div",{className:"ul-card--nps__numbers",children:d}),S("div",{className:"ul-card--nps__labels",children:[S("span",{children:c}),S("span",{children:l})]}),!r.required&&S("div",{className:"ul-vertical-centered-container",children:S(Ye,{onClick:p,children:Or(r)})})]});return S("form",{className:Y([e,"ul-card--nps",O.FadeInTransition]),children:[S(xt,{message:n,properties:r}),S(fn,{properties:r,defaultBody:f})]},o)},_0=({className:e,message:t,next:n,properties:r,questionId:i,type:o})=>{const{border:a,useMobileStyling:s,update:u}=le(_=>({border:_.border,useMobileStyling:_.useMobileStyling,update:_.update})),[c,l]=Ve(""),d=Vt(null),p=c.trim(),f=r.required===!0&&!p,h=sf(d,()=>u()),m=_=>{h(),_.preventDefault(),_.stopPropagation(),er(_.target)&&l(_.target.value)},g=_=>{_.preventDefault(),_.stopPropagation(),n({value:c,questionId:i,type:o})},w=r&&r.openTextPlaceholder?r.openTextPlaceholder:"",y=_=>{er(_.target)&&(_.target.style.borderColor=a)},v=_=>{er(_.target)&&(_.target.style.borderColor=Fa)},b=()=>S("div",{className:"ul-card-text",children:[S("div",{className:"ul-card-text__container",children:S("textarea",{"aria-label":w,"aria-labelledby":O.QuestionHeader,"aria-multiline":"true","aria-placeholder":w,className:Y(ve(O.OpenTextInput,s)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:v,onChange:m,onFocus:y,placeholder:w,ref:d,role:"textbox",tabIndex:0})}),S(Ye,{disabled:f,onClick:g,style:{backgroundColor:f?"":a},children:Or(r)})]});return S("form",{className:Y([e,"ul-card--text",O.FadeInTransition]),id:"text-form",children:[S(xt,{message:t,properties:r}),S(fn,{defaultBody:b,properties:r})]},i)};var Dt=(e=>(e[e.RequestNeeded=1]="RequestNeeded",e[e.TryAgain=2]="TryAgain",e[e.Ready=3]="Ready",e))(Dt||{});const Wi=e=>e.type===Ge.AvPermission,ff=e=>e.type===Ge.ScreenPermission,b0=(e,t)=>!(Wi(t)?t.permissionDescriptors:[]).includes(Un.Camera)||e.getVideoTracks().length>0,pf=(e,t)=>{if(e===void 0)return Dt.RequestNeeded;if(e){if(!b0(e,t))return Dt.RequestNeeded}else return Dt.TryAgain;return Dt.Ready},Xu={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},ut=nf(e=>({...Xu,reset:()=>{e(Xu)},updatePage:t=>{e(t)}}));function ma({currentPage:e,pages:t}){const{avStream:n,recordingMediaTypes:r,updatePage:i}=ut.getState(),{recorderEventEmitter:o}=le.getState();o.emit(Ee.AvPermission,{[G.PermissionDescriptors]:e.permissionDescriptors,[G.StreamReadyCallback]:(a,s)=>{if(n===a)return;let u=e;if(a&&!e.permissionDescriptors.includes(Un.Camera)){const c=t.indexOf(e),l=s!=null&&s.active?c+2:c+1;(s==null?void 0:s.active)&&r&&o.emit(Ee.BeginRecording,{[G.RecordingMediaTypes]:r,[G.StartRecordingCallback]:d=>i({mediaRecordingUids:d})}),u=t[l]}i({currentPage:u,avStream:a})}})}function w0({pages:e,userId:t,responseGroupUid:n,surveyId:r,questionId:i,next:o}){const{updatePage:a}=ut.getState(),{eventEmitFn:s,recorderEventEmitter:u}=le.getState(),c={questionId:i,surveyId:r,visitorId:t,responseGroupUid:n};let l=0;u.emit(qe.RecordedTaskPermissionScreen),s(qe.RecordedTaskPermissionScreen),u.emit(Ee.PermissionStatus,{[G.PermissionStatusCallback]:(p,f,h,m)=>{const g=e[l],{type:w}=g,y=[Je.Screen];if(Wi(g)){const{permissionDescriptors:v}=g,b=v==null?void 0:v.includes(Un.Microphone),_=v==null?void 0:v.includes(Un.Camera);b&&y.push(Je.Audio),_&&y.push(Je.Video);const C=(p==null?void 0:p.active)&&!_,k=(p==null?void 0:p.active)&&f;(C||k)&&l++}ff(e[l])&&h&&(l++,u.emit(Ee.BeginRecording,{[G.RecordingMediaTypes]:y,[G.StartRecordingCallback]:v=>a({mediaRecordingUids:v})})),a({currentPage:e[l],avStream:p,screenPermissionRequested:h,nextQuestion:o,type:w,passthroughData:c,recordingMediaTypes:y,captureStream:m})}});const d=e[l];return d.type===Ge.AvPermission&&ma({currentPage:d,pages:e}),d}function ga({status:e}){const{nextQuestion:t,passthroughData:n,mediaRecordingUids:r,reset:i}=ut.getState(),{recorderEventEmitter:o,handleUploadUpdate:a,index:s}=le.getState(),u={value:{taskStatus:e},type:R.RecordedTask,questionId:(n==null?void 0:n.questionId)||1};!n||o.emit(Ee.FinishTask,{[G.BeginCallback]:c=>{a({mediaRecordingUid:c,isSubmitted:!0,progressPct:0,isComplete:!1})},[G.ProgressCallback]:(c,l)=>{a({mediaRecordingUid:c,progressPct:l.detail,isSubmitted:!1,isComplete:!1})},[G.UploadCallback]:c=>{c&&a({mediaRecordingUid:c,isComplete:!0,isSubmitted:!0,progressPct:100})},[G.PassthroughData]:n,[G.CurrentIndex]:s,[G.TaskResponse]:u,[G.TaskCompleteCallback]:c=>{u.value.taskDurationMillisecond=c,r&&(u.value.mediaRecordingUids=r),i(),t(u)}})}function ds({pages:e,setIsRequestingPermission:t}){const{recorderEventEmitter:n,eventEmitFn:r}=le.getState(),{updatePage:i,currentPage:o,recordingMediaTypes:a,screenPermissionRequested:s}=ut.getState();if(!o)return;const u=e.indexOf(o);switch(o.type){case Ge.AvPermission:{const c=s?u+2:u+1;s&&a&&n.emit(Ee.BeginRecording,{[G.RecordingMediaTypes]:a,[G.StartRecordingCallback]:l=>{i({mediaRecordingUids:l})}}),i({currentPage:e[c]});return}case Ge.ScreenPermission:n.emit(Ee.ScreenPermission,{[G.ScreenPermissionRequested]:t,[G.StreamReadyCallback]:(c,l)=>{const d=l?e[u+1]:o;l&&a&&n.emit(Ee.BeginRecording,{[G.RecordingMediaTypes]:a,[G.StartRecordingCallback]:p=>{i({captureStream:l,mediaRecordingUids:p})}}),i({currentPage:d,screenPermissionRequested:!0,captureStream:l})}});return;case Ge.StartTask:r(qe.RecordedTaskStart),n.emit(qe.RecordedTaskStart),n.emit(Ee.StartTask),i({currentPage:e[u+1],screenPermissionRequested:!0});return;case Ge.CompleteTask:return}}const hf="ul-permission-graphics-container",mf="ul-permission-body",gf=Y([hf,"ul_recorded-task-inset-spacing"]),qi=Y(["ul-horizontal-button-container","ul-horizontal-button-container-left"]),vf=({richTextBody:e})=>S("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:e},id:"ul-task-detail-container"}),$i=({required:e,skipButtonText:t,bottom:n=!1})=>e?null:S(Ye,{className:Y([n&&"ul-skip-button-below",O.InactiveButton]),onClick:ga.bind(null,{status:ze.Abandoned}),children:t||"Skip"}),fs=e=>{const{avStream:t,captureStream:n,recordingMediaTypes:r,updatePage:i}=ut.getState(),o=(r==null?void 0:r.includes(Je.Audio))||(r==null?void 0:r.includes(Je.Video));We(()=>{const a=setInterval(()=>{o&&t&&!t.active?i({avStream:null,currentPage:e[0]}):(!n||!n.active)&&i({captureStream:void 0,currentPage:e[o?1:0]})},1e3);return()=>clearInterval(a)},[t,n,o,e,r,i])},S0=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:i,taskDetail:o}=e;return fs(t),S("div",{className:"ul-task-page",children:[S(vf,{richTextBody:o}),S("div",{className:qi,children:[S(Ye,{onClick:ds.bind(null,{pages:t}),children:r}),S($i,{required:n,skipButtonText:i})]})]},"start-task")},I0=({content:e,pages:t,properties:n})=>{const{buttonText:r,skipButtonText:i}=e;fs(t);const a=S(fn,{properties:n,defaultBody:()=>S("div",{className:qi,children:[S(Ye,{className:"ul-complete-task-button",onClick:ga.bind(null,{status:ze.Completed}),children:r}),S(Ye,{className:Y([O.InactiveButton]),onClick:ga.bind(null,{status:ze.GivenUp}),children:i})]})});return S("div",{className:"ul-task-page",children:[S(vf,{richTextBody:e.taskDetail}),a]},"complete-task")},C0=({content:e,pages:t,required:n})=>{const{buttonText:r,skipButtonText:i}=e,[o]=le(u=>[u.tabTitle]),[a,s]=Ve(!1);return S("div",{children:[S("div",{className:gf,children:[S("p",{style:{marginTop:"auto"},children:e.selectTabText}),S("div",{className:"ul-select-tab-container",children:S("p",{className:mf,children:o})})]}),S("div",{className:n?"":qi,children:[S(Ye,{disabled:a,onClick:ds.bind(null,{pages:t,setIsRequestingPermission:s}),children:r}),S($i,{required:n,skipButtonText:i})]})]})},E0=({content:e})=>S("div",{className:Y([hf,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"]),dangerouslySetInnerHTML:{__html:e.svg}},"ul-permission-request-graphic"),k0=({content:e,pages:t,required:n})=>{const{permissionDeniedHeadline:r,permissionDeniedBody:i,skipButtonText:o,tryAgainButtonText:a}=e,s=Wi(t[0])?t[0]:null;return We(()=>{const u=setInterval(()=>{s!==null&&ma({currentPage:s,pages:t})},1e3);return()=>clearInterval(u)},[s,t]),s?S("div",{children:[S("div",{className:gf,children:S("p",{className:"ul-av-permission-denied-paragraph",children:[S("span",{className:"ul-av-permission-denied-headline",children:r}),S("span",{className:mf,children:i})]})}),S("div",{className:qi,children:[S(Ye,{onClick:ma.bind(null,{currentPage:s,pages:t}),children:a}),S($i,{required:n,skipButtonText:o})]})]}):null},A0=({stream:e})=>S("video",{autoPlay:!0,className:Y(["ul_recorded-task-inset-spacing"]),id:"ul-record-task-video-preview",muted:!0,ref:t=>{t&&(t.srcObject=e||null)}}),x0=({content:e,pages:t,required:n})=>{const{skipButtonText:r}=e,{avStream:i}=ut.getState();return fs(t),S("div",{children:[S(A0,{stream:i}),S("div",{className:"ul-vertical-button-container-center",children:[S(Ye,{onClick:ds.bind(null,{pages:t}),children:e.buttonText}),S($i,{bottom:!0,required:n,skipButtonText:r})]})]})},T0=({properties:e})=>{const{pages:t,required:n}=e,{avStream:r,currentPage:i}=ut.getState();if(i===void 0)return null;switch(i==null?void 0:i.type){case Ge.AvPermission:{const o=pf(r,i);return o===Dt.RequestNeeded?S(E0,{content:i}):o===Dt.TryAgain?S(k0,{content:i,pages:t,required:n}):S(x0,{content:i,pages:t,required:n})}case Ge.ScreenPermission:return S(C0,{content:i,pages:t,required:n});case Ge.StartTask:return S(S0,{content:i,pages:t,required:n});case Ge.CompleteTask:return S(I0,{content:i,pages:t,properties:e});default:return null}},R0=({className:e,properties:t,next:n,questionId:r})=>{const i=le(),{surveyId:o,responseGroupUid:a,userId:s}=i,u=ut(),{screenPermissionRequested:c}=u,l=ut(m=>m.avStream);let d=ut(m=>m.currentPage);d||(d=w0({questionId:r,surveyId:o,next:m=>{n(m)},pages:t.pages,responseGroupUid:a,userId:s}));let p=d.headline,f=d.captionText;const h=pf(l,d);return ff(d)&&c&&(p=d.permissionDeniedHeadline,f=d.permissionDeniedCaptionText),Wi(d)&&h===Dt.Ready&&(p=d.permissionGrantedHeadline,f=d.permissionGrantedCaptionText),S("div",{className:Y([e,"ul-center-horizontally",O.FadeInTransition]),children:[S(xt,{message:p,properties:{captionText:f}}),S(T0,{properties:t})]})},L0={"{{user_id}}":"externalUserId","{{email}}":"email"},O0=(e=void 0,t={})=>{if(!e)return e;let n=e;const r=[];for(const[u,c]of Object.entries(L0))if(n.toLowerCase().includes(u))if(t[c]){const l=new RegExp(u,"gi");n=n.replace(l,t[c])}else r.push(u);if(r.length===0||!n.includes("?"))return n;const i=n.slice(0,n.indexOf("?")),a=n.slice(n.indexOf("?")+1).split("&").map(u=>u.split("=")).filter(u=>!r.includes(u[1]));if(a.length===0)return i;const s=a.map(u=>u.join("=")).join("&");return`${i}?${s}`},N0=({className:e,message:t,next:n,properties:r,questionId:i,type:o})=>{const{visitorAttributes:a}=le(d=>({visitorAttributes:d.visitorAttributes})),s=(d,p=!1)=>{n({value:p?{skipped:!0}:void 0,questionId:i,type:o})},u=d=>{(d.key==="Enter"||d.key===" ")&&n({value:void 0,questionId:i,type:o})},c=()=>S("div",{className:"ul-card-button-group",children:[S("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:O0(r&&r.buttonUrl,a),id:"ul-card-text__button",onClick:s,onKeyPress:u,rel:"noreferrer",role:"button",tabIndex:0,target:"_blank",children:Or(r)}),r.required===!1&&S("button",{className:O.SkipButton,onClick:d=>s(d,!0),children:cf(r)})]}),l=(d,p)=>d?S("div",{className:"ul-rich-text-body",dangerouslySetInnerHTML:{__html:d},id:"ul-card__text-url-body-container"}):S("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(p?p.split(/\n\s*\n/g):[]).map((f,h)=>S("p",{children:f},h))});return S("div",{className:Y([e,"ul-card__text-url-prompt",O.FadeInTransition]),children:[S(xt,{message:t}),l(r&&r.richTextBody,r&&r.body),S(fn,{defaultBody:c,properties:r})]},i)},U0=({className:e,questionId:t})=>{const{border:n,destroy:r,endCard:i,forceBrandedLogo:o}=le(u=>({border:u.border,destroy:u.destroy,endCard:u.endCard,forceBrandedLogo:u.forceBrandedLogo}));We(()=>{setTimeout(()=>{r(Cn)},o?4e3:2e3)},[r,o]);const a=i&&i.subheader?S("p",{className:O.Caption,children:i.subheader}):null,s=i&&i.headline?i.headline:"";return S("div",{className:Y([e,"ul-card--thanks",O.FadeInTransition]),children:S("div",{children:S("div",{className:"ul-card--thanks-content",children:[S("div",{className:"ul-thanks-check",children:S("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[S("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:n,fillRule:"evenodd"}),S("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:n,fillRule:"evenodd"}),S("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),S(xt,{message:s}),a]})})},t)},D0=({className:e})=>{const{uploadProgress:t}=le(o=>({uploadProgress:o.uploadProgress}));let n,r;Object.values(t).filter(o=>o.isSubmitted).length>1?(n="Your responses are processing",r="Please keep this tab open until your responses are fully processed."):(n="Your response is processing",r="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(t).filter(o=>o.isSubmitted).map(o=>o.progressPct)));return S("div",{className:Y([e,"ul-card--uploading",O.FadeInTransition]),children:[S("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:O.LoadingSpinnerContainer,role:"progressbar",children:S("div",{className:O.LoadingSpinner,children:[S("div",{className:O.LoadingSpinnerFirst}),S("div",{className:O.LoadingSpinnerSecond}),S("div",{className:O.LoadingSpinnerThird}),S("div",{className:O.LoadingSpinnerFourth})]})}),S(xt,{message:`${n} (${i}% complete)`}),S("p",{className:O.Caption,children:r})]})},el=({logoOnly:e=!1,style:t={}})=>S("svg",{alt:`${e?"Powered by ":""}Sprig`,width:e?"35":"112",height:"15",viewBox:e?"79 0 31 15":"0 0 112 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...t},children:[!e&&S("path",{d:"M0.648926 12.0181V2.8584H4.21631C6.0127 2.8584 7.25684 4.06445 7.25684 5.86084V5.87354C7.25684 7.66357 6.0127 8.88867 4.21631 8.88867H2.0708V12.0181H0.648926ZM3.86084 4.05811H2.0708V7.69531H3.86084C5.09229 7.69531 5.80957 7.02881 5.80957 5.87988V5.86719C5.80957 4.72461 5.09229 4.05811 3.86084 4.05811ZM11.6621 12.1514C9.63721 12.1514 8.39941 10.7993 8.39941 8.57764V8.56494C8.39941 6.34961 9.64355 4.99121 11.6621 4.99121C13.6743 4.99121 14.9185 6.34326 14.9185 8.56494V8.57764C14.9185 10.7993 13.6807 12.1514 11.6621 12.1514ZM11.6621 11.0024C12.8428 11.0024 13.5156 10.1011 13.5156 8.57764V8.56494C13.5156 7.03516 12.8428 6.14014 11.6621 6.14014C10.4751 6.14014 9.80859 7.03516 9.80859 8.56494V8.57764C9.80859 10.1074 10.4751 11.0024 11.6621 11.0024ZM17.6226 12.0181L15.7183 5.12451H17.1021L18.3398 10.4438H18.4414L19.8633 5.12451H21.1709L22.5928 10.4438H22.7007L23.9321 5.12451H25.2969L23.3989 12.0181H21.9834L20.5552 6.87646H20.4473L19.0254 12.0181H17.6226ZM29.334 12.1514C27.3154 12.1514 26.0967 10.7739 26.0967 8.59033V8.58398C26.0967 6.43213 27.3408 4.99121 29.2642 4.99121C31.1875 4.99121 32.3682 6.38135 32.3682 8.45068V8.93311H27.4805C27.5059 10.2534 28.2295 11.0215 29.3657 11.0215C30.248 11.0215 30.7749 10.5835 30.9399 10.228L30.9653 10.1772L32.292 10.1709L32.2793 10.228C32.0508 11.1357 31.0986 12.1514 29.334 12.1514ZM29.2705 6.12109C28.3311 6.12109 27.6201 6.76221 27.4995 7.94922H31.0034C30.8955 6.71777 30.2036 6.12109 29.2705 6.12109ZM34.0059 12.0181V5.12451H35.3833V6.16553H35.4849C35.7324 5.43555 36.3735 5.00391 37.2939 5.00391C37.5161 5.00391 37.7573 5.03564 37.897 5.06738V6.33691C37.6494 6.28613 37.4146 6.25439 37.1543 6.25439C36.1006 6.25439 35.3833 6.90186 35.3833 7.89844V12.0181H34.0059ZM41.9277 12.1514C39.9092 12.1514 38.6904 10.7739 38.6904 8.59033V8.58398C38.6904 6.43213 39.9346 4.99121 41.8579 4.99121C43.7812 4.99121 44.9619 6.38135 44.9619 8.45068V8.93311H40.0742C40.0996 10.2534 40.8232 11.0215 41.9595 11.0215C42.8418 11.0215 43.3687 10.5835 43.5337 10.228L43.5591 10.1772L44.8857 10.1709L44.873 10.228C44.6445 11.1357 43.6924 12.1514 41.9277 12.1514ZM41.8643 6.12109C40.9248 6.12109 40.2139 6.76221 40.0933 7.94922H43.5972C43.4893 6.71777 42.7974 6.12109 41.8643 6.12109ZM49.1133 12.1323C47.3804 12.1323 46.2568 10.7422 46.2568 8.57764V8.56494C46.2568 6.38135 47.3613 5.00391 49.1133 5.00391C50.0591 5.00391 50.8652 5.47363 51.2334 6.21631H51.3413V2.42041H52.7124V12.0181H51.3413V10.9326H51.2334C50.8335 11.688 50.0781 12.1323 49.1133 12.1323ZM49.5068 10.958C50.6558 10.958 51.3604 10.0503 51.3604 8.57764V8.56494C51.3604 7.09229 50.6494 6.18457 49.5068 6.18457C48.3516 6.18457 47.6597 7.08594 47.6597 8.56494V8.57764C47.6597 10.0566 48.3516 10.958 49.5068 10.958ZM61.98 12.1323C61.0151 12.1323 60.2598 11.688 59.8599 10.9326H59.7583V12.0181H58.3809V2.42041H59.7583V6.21631H59.8599C60.228 5.47363 61.0342 5.00391 61.98 5.00391C63.7319 5.00391 64.8364 6.38135 64.8364 8.56494V8.57764C64.8364 10.7422 63.7192 12.1323 61.98 12.1323ZM61.5928 10.958C62.7417 10.958 63.4336 10.0566 63.4336 8.57764V8.56494C63.4336 7.08594 62.7417 6.18457 61.5928 6.18457C60.4438 6.18457 59.7329 7.09229 59.7329 8.56494V8.57764C59.7329 10.0503 60.4438 10.958 61.5928 10.958ZM66.8867 14.4429C66.7153 14.4429 66.5122 14.4302 66.3345 14.4111V13.3257C66.4678 13.3447 66.6392 13.3511 66.7979 13.3511C67.439 13.3511 67.8262 13.0781 68.0293 12.3799L68.1309 12.0244L65.6299 5.12451H67.1152L68.8418 10.6343H68.9624L70.6826 5.12451H72.1299L69.5654 12.2847C68.9814 13.9287 68.2832 14.4429 66.8867 14.4429Z",fill:"black",fillOpacity:"0.7"}),S("path",{d:"M81.1088 6.63629C79.6878 6.32154 78.9672 5.76865 78.9672 4.99369C78.9672 4.19299 79.736 3.5886 80.7556 3.5886C81.8066 3.5886 82.5995 4.25285 82.5995 5.13336V5.20352H84.0518V5.13336C84.0518 3.52424 82.6405 2.30774 80.7693 2.30774C79.8676 2.30774 79.0414 2.58451 78.4433 3.08655C78.1463 3.33144 77.9077 3.63818 77.7448 3.98479C77.5818 4.33141 77.4984 4.70934 77.5005 5.09153C77.4946 5.44197 77.5675 5.78934 77.714 6.10857C77.8605 6.42779 78.0769 6.71092 78.3475 6.93752C78.8512 7.37584 79.5659 7.70024 80.4709 7.90299C81.9949 8.23898 82.7676 8.81054 82.7676 9.60094C82.7676 10.4576 81.9258 11.1032 80.813 11.1032C79.6571 11.1032 78.7854 10.3856 78.7854 9.43424V9.36408H77.3318V9.43424C77.3318 11.1167 78.8219 12.3847 80.7973 12.3847C81.7421 12.3847 82.6093 12.0983 83.2393 11.5769C83.5519 11.3237 83.8034 11.0048 83.9753 10.6433C84.1472 10.2818 84.2352 9.88702 84.2329 9.48766C84.2329 8.05875 83.1833 7.09907 81.1088 6.63629Z",fill:"black",fillOpacity:"0.7"}),S("path",{d:"M89.2394 4.68276C88.6963 4.67605 88.1596 4.79915 87.6751 5.04156C87.1905 5.28397 86.7725 5.63851 86.4566 6.07497V4.85204H85.0747V14.8479H86.4566V11.0356C86.7725 11.472 87.1906 11.8265 87.6751 12.0688C88.1596 12.3111 88.6963 12.434 89.2394 12.4272C91.3836 12.4272 93 10.7627 93 8.55495C93 6.34723 91.3836 4.68276 89.2394 4.68276ZM91.5608 8.84202C91.5057 9.41605 91.2512 9.95356 90.8406 10.3633C90.4299 10.773 89.8883 11.0296 89.3078 11.0896C88.5363 11.1669 87.8177 10.9461 87.2841 10.4692C86.7505 9.99222 86.4566 9.3106 86.4566 8.55495C86.4566 7.10159 87.5538 6.00546 89.0087 6.00546C89.7619 6.00546 90.4421 6.29124 90.9171 6.81002C91.407 7.34232 91.6357 8.06385 91.5608 8.84202Z",fill:"black",fillOpacity:"0.7"}),S("path",{d:"M109.95 4.85407V6.06349C109.298 5.18298 108.292 4.68286 107.153 4.68286C105.017 4.68286 103.406 6.31709 103.406 8.48426C103.406 10.6514 105.017 12.285 107.153 12.285C108.296 12.285 109.303 11.79 109.95 10.9185V11.1046C109.95 12.6101 108.993 13.5826 107.513 13.5826C106.513 13.5826 105.68 13.1494 105.284 12.424L105.264 12.3867H103.838L103.871 12.48C104.112 13.1892 104.583 13.8001 105.211 14.2179C105.841 14.6324 106.637 14.8512 107.513 14.8512C108.637 14.8512 109.594 14.4972 110.28 13.8285C110.967 13.1597 111.332 12.2194 111.332 11.1213V4.85407H109.95ZM109.175 10.3502C108.588 10.905 107.752 11.138 106.879 10.9887C106.361 10.8984 105.886 10.6475 105.523 10.2725C105.16 9.89751 104.927 9.41787 104.859 8.90328C104.736 8.03757 104.999 7.21756 105.581 6.655C106.069 6.19093 106.723 5.93643 107.401 5.94699C107.565 5.94713 107.729 5.96026 107.891 5.98625C108.946 6.15489 109.781 7.01609 109.921 8.0852C110.039 8.96507 109.766 9.78958 109.175 10.3502Z",fill:"black",fillOpacity:"0.7"}),S("path",{d:"M101.89 2.12378C101.63 2.06766 101.358 2.11486 101.133 2.25518C100.908 2.39551 100.747 2.61769 100.687 2.87371C100.626 3.12973 100.67 3.39902 100.809 3.62339C100.947 3.84775 101.17 4.00917 101.428 4.07275C101.503 4.08936 101.58 4.09778 101.657 4.09786C101.906 4.09824 102.146 4.0083 102.331 3.84518C102.517 3.68206 102.636 3.45714 102.664 3.21327C102.693 2.9694 102.63 2.72361 102.487 2.5227C102.344 2.32179 102.132 2.17981 101.89 2.12378Z",fill:"black",fillOpacity:"0.7"}),S("path",{d:"M100.967 10.934H99.7755C98.9285 10.934 98.4196 10.3644 98.4196 9.40982C98.4196 8.4791 98.8757 7.36945 99.8054 6.01778L99.8178 5.99976V5.61807L95.8571 5.06453C95.8585 4.90331 95.8162 4.74466 95.7346 4.60501C95.653 4.46536 95.5352 4.34979 95.3932 4.27027C95.0381 4.07718 94.6498 4.07717 94.3279 4.26383C94.1667 4.35799 94.035 4.4945 93.9476 4.65816C93.8602 4.82182 93.8205 5.00623 93.8328 5.19087C93.8452 5.37552 93.9092 5.55315 94.0176 5.70402C94.1261 5.85489 94.2748 5.97309 94.4472 6.04546L93.2151 12.258H94.5833L95.7196 6.35891L97.8593 6.7155C97.284 7.73439 96.9921 8.68442 96.9921 9.53919C96.9921 11.1168 97.9577 12.1498 99.5187 12.2496V12.258H102.346V4.87723H100.967V10.934Z",fill:"black",fillOpacity:"0.7"})]}),P0=()=>{const{border:e,cards:t,forceBrandedLogo:n,headers:r,index:i,marketingUrl:o,showSurveyBrand:a,slugName:s,surveyId:u,viewedCardCount:c}=le(v=>({border:v.border,cards:v.cards,forceBrandedLogo:v.forceBrandedLogo,headers:v.headers,index:v.index,marketingUrl:v.marketingUrl,showSurveyBrand:v.showSurveyBrand,slugName:v.slugName,surveyId:v.surveyId,viewedCardCount:v.viewedCardCount})),l=Vt(null),d=t.filter(v=>v.type!==R.Uploading&&v.type!==R.Thanks),p=n0(t,i),f=c+1,h=f/(f+p),m=`${o}?utm_source=survey_branding&utm_medium=website&utm_campaign=${s}&utm_content=${u}${n&&"&utm_term=poweredby_pill"}`;We(()=>{l.current&&(l.current.style.width=`${h*100}%`)},[h]);const g=()=>S($e,{children:[d.length>1&&S("div",{id:"ul-progress-bar-container",children:S("div",{id:"ul-progress-bar-current",ref:l,style:{border:`1px solid ${e||"#000"}`}})}),a?S("div",{className:n?"yellow-footer-logo":"",style:{marginTop:"4px"},children:S("a",{href:m,rel:"noreferrer",target:"_blank",children:S("div",{style:{display:"flex"},children:[S(el,{logoOnly:!1}),n&&S(tl,{style:{display:"block",margin:"auto 0 auto 4px",transform:"rotateY(0deg) rotate(-45deg)"}})]})})}):null]}),w=()=>S("a",{dir:"ltr",href:m,rel:"noreferrer",target:"_blank",children:S("div",{className:"thank-you-card-link",children:[S("div",{className:"sprig-box-logo",children:S(el,{logoOnly:!0,style:{margin:"auto"}})}),S("div",{children:S("p",{children:["Capture insights about your own product",S(tl,{style:{display:"inline-flex",marginInlineStart:"4px",verticalAlign:"middle"}})]})})]})}),y=t[i].type===R.Thanks;return S("footer",{className:`ul-footer ${r["userleap-platform"]==="link"?"ul-footer__link":""}`,style:a?{}:{marginBottom:"10px"},children:y&&n?w():g()})},tl=({style:e})=>S("svg",{fill:"none",height:"10",style:e,viewBox:"0 0 12 10",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[S("path",{d:"M1.47839 5.2085L10.9384 5.2085",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"}),S("path",{d:"M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.35"})]}),M0=()=>{const{answers:e,border:t,cards:n,close:r,configureExitOnOverlayClick:i,destroy:o,endCard:a,eventEmitFn:s,fontFamily:u,headers:c,index:l,next:d,showStripes:p,update:f,useMobileStyling:h,viewDocument:m}=le(T=>({answers:T.answers,border:T.border,cards:T.cards,close:T.close,configureExitOnOverlayClick:T.configureExitOnOverlayClick,destroy:T.destroy,endCard:T.endCard,eventEmitFn:T.eventEmitFn,fontFamily:T.fontFamily,headers:T.headers,index:T.index,next:T.next,showStripes:T.showStripes,update:T.update,useMobileStyling:T.useMobileStyling,viewDocument:T.viewDocument})),g=Vt(null),w=Vt(!1),y=c["userleap-platform"],{props:v,type:b,name:_}=n[l],C=n.length;We(()=>{g.current&&(g.current.classList.contains("ul-app--visible")||g.current.classList.add("ul-app--visible"),!w.current&&s&&(w.current=!0,s(K.SurveyAppeared)))},[s]),We(()=>{f()},[l,f]),We(()=>{i(()=>r())},[r,i]);const k=()=>r(Cn),I=T=>{T.key==="Enter"&&k()},E=async function(T){d({data:T,completeSurvey:()=>{o(Cn)},endCard:a}),Fg(m)};if(e){for(const T of e)if(T.questionId===_){let A;if(b===R.MultipleChoice){const U=v.options.find(({value:W})=>W===T.value);if(!U)break;A={[U.id]:U.value}}else A=T.value;E({value:A,type:b,questionId:T.questionId});break}}const x=()=>[on.Email,on.Link].includes(c["userleap-platform"])?!1:!a||l+1!==C,N=()=>h?{borderColor:t}:{borderColor:t,margin:"15px"},F=()=>{const T={className:"ul-card",next:E,questionId:_,type:b};switch(b){case R.ConsentLegal:return he(p0,{...T,...v,key:_});case R.Likert:return he(m0,{...T,...v,key:_});case R.MultipleChoice:return he(g0,{...T,...v,key:_});case R.MultipleSelect:return he(v0,{...T,...v,key:_});case R.NPS:return he(y0,{...T,key:_,props:v});case R.Open:return he(_0,{...T,...v,key:_});case R.RecordedTask:return he(R0,{...T,...v,key:_});case R.TextUrlPrompt:return he(N0,{...T,...v,key:_});case R.Thanks:return he(U0,{...T,...v,key:_});case R.Uploading:return he(D0,{...T,...v,key:_});case R.VideoVoice:return null;default:return null}},P=T=>{var se;const A=window.sprigAPI,U=T.target;if(!A||!U)return;const W=[U,U.parentElement];for(const J of W)if(((se=J==null?void 0:J.tagName)==null?void 0:se.toLowerCase())==="a"){T.preventDefault(),A==null||A.openUrl(J.href);return}};return S("div",{className:Y("ul-app",En(c)?"ul-app--visible":"ul-app--overlay"),dir:"auto",id:Cn,onClick:P,ref:g,style:{"--theme":t,...u?{fontFamily:u.replace(";","")}:{}},children:S("div",{className:"ul-app__container",children:S("div",{className:Y(ve(O.CardContainer,h)),style:N(),children:[x()&&S("div",{className:Y(ve(O.CloseContainer,h)),children:S("div",{"aria-label":"Close button",className:O.CloseButton,onClick:k,onKeyPress:I,role:"button",tabIndex:0,children:S("svg",{fill:"none",height:"18px",viewBox:"0 0 13 13",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:S("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})}),p&&S("div",{className:"ul-header__container",dir:"ltr",children:S("div",{className:"ul-header",children:"For development purposes only"})}),S("div",{className:Y(Bg(O.CardMainContent,y)),children:F()}),S(P0,{})]})})})},F0=`html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:start;margin:auto}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container{background:#ffffff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;overflow:auto;padding:20px 20px 5px;position:relative;text-align:center;word-break:break-word}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;margin-bottom:3px;display:flex;gap:16px;justify-content:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:start;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email{flex-grow:55;display:flex}.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{margin-bottom:5px}.ul-question{color:#343442;display:block;font-size:20px;line-height:125%;font-weight:500;cursor:default;text-align:start}.ul-caption{flex:1 0 auto;margin-top:8px;margin-bottom:15px;font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:start}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{align-items:center;display:flex;flex-direction:row;flex:0 0 fit-content;gap:15px;height:fit-content;justify-content:flex-start;width:100%}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.select-checkbox{height:16px;width:16px;border-radius:3px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 3px 3px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.fade-in-transition{animation:fadeIn .4s ease-in;-webkit-animation:fadeIn .4s ease-in;-moz-animation:fadeIn .4s ease-in;-o-animation:fadeIn .4s ease-in;-ms-animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-ms-keyframes fadeIn{0%{opacity:0}to{opacity:1}}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{box-shadow:unset;border-radius:unset;border:none!important;position:unset}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:white}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.likert-number--mobile{border:2px solid #e6e6e6}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid #e6e6e6}.likert-number--desktop:not(:first-child){margin-inline-start:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.likert-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-star--mobile:not(:first-child){margin-inline-start:-2px}.likert-star--desktop:not(:first-child){margin-inline-start:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px}.likert-smiley--mobile:not(:first-child){margin-inline-start:-2px}.likert-smiley--desktop:not(:first-child){margin-inline-start:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid #e6e6e6}.nps-number--desktop:not(:first-child){margin-inline-start:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.nps-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.nps-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card-text{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:rgba(0,0,0,.01);box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:white}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}#ul-card-voice__video{align-items:center;display:flex;flex-direction:column}#ul-card-voice__video>div{margin-bottom:10px;width:100%}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#ffffff;border-radius:5px;text-align:start;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:30px;justify-content:center}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;left:0;position:absolute;top:0;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:auto;flex-grow:1;width:100%}.ul-footer>.yellow-footer-logo{background:#fad133;border:1px solid #f9c600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#f9c600}.ul-footer .thank-you-card-link{background:rgba(0,0,0,.01);border:1px solid #e6e6e6;border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;gap:8px;margin-bottom:15px;padding:12px;text-align:initial}.ul-footer .thank-you-card-link:hover{background:rgba(0,0,0,.03)}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:rgba(249,198,0,1);border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%}.close-btn{cursor:pointer;height:18px;margin-inline-end:-10px;position:relative;top:-10px;width:18px;z-index:1}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}#ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px;max-width:250px;margin:25px 0}#ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{width:100%;background:rgba(0,0,0,.01);border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:1;margin:0;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}
65
+ `,V0=(e,t)=>{const n=[...e],r=new Set([R.VideoVoice,R.RecordedTask]);return e.some(i=>r.has(i.type))&&n.push({name:-2,props:{routingOptions:[]},type:R.Uploading}),t&&n.push({name:-1,props:{routingOptions:[]},type:R.Thanks}),n},B0=({mode:e=null,viewWindow:t,viewDocument:n})=>{const r=n.documentElement;return{mode:e,sw:t.screen.width,sh:t.screen.height,cw:r.clientWidth,ch:r.clientHeight,p:t.location.href,l:t.navigator.language}};function K0(e,t=!0){var _;const{answers:n,apiURL:r,customStyles:i,endCard:o,eventEmitFn:a,fontFamilyURL:s,frame:u,previewKey:c,viewDocument:l,viewWindow:d}=e,p=En(e.headers)?e.frame:l.body,f=e.UpChunk||window.UpChunk,h=z,m=V0(e.cards,!!o);ha.configure(h,{cards:m,hasEndCard:!!o,apiURL:r,UpChunk:f}),le.setState({apiURL:r,answers:n,border:e.border,index:e.startingQuestionIdx||0,cards:m,configureExitOnOverlayClick:e.configureExitOnOverlayClick,customMetadata:e.customMetadata,endCard:e.endCard,envId:e.envId,eventEmitFn:a,fontFamily:e.fontFamily,forceBrandedLogo:e.forceBrandedLogo,frame:u,headers:e.headers,hasViewedEmbed:!1,isPreview:e.isPreview,marketingUrl:"https://sprig.com",meta:B0({mode:e.mode,viewWindow:d,viewDocument:l}),mode:e.mode,previewKey:c,recorder:ha,recorderEventEmitter:h,responseGroupUid:e.responseGroupUid,showStripes:e.showStripes,showSurveyBrand:e.showSurveyBrand,slugName:e.slugName,styleNonce:e.styleNonce,surveyId:e.surveyId,tabTitle:e.tabTitle,uploadingCardViewed:!1,uploadProgress:{},useMobileStyling:e.useMobileStyling,useDesktopPrototype:e.useDesktopPrototype,userId:e.userId,viewDocument:e.viewDocument,visitorAttributes:e.visitorAttributes,viewedCardCount:e.startingQuestionIdx||0});const{seen:g}=le.getState();g();const{head:w}=l,y=l.createElement("style");if(y.id="sprig-style",y.textContent=F0,y.nonce=e.styleNonce,w.appendChild(y),e.fontFamily&&s&&parent){const C=l.createElement("link");C.rel="stylesheet",C.href=s,w.appendChild(C)}e.customStyles&&cc(l,i,e.styleNonce);const v="2.24.10",b=a||((_=u.eventEmitter)==null?void 0:_.emit);b==null||b(qe.VerifyViewVersion,{[Yt.ViewVersion]:v}),p&&t&&Pn(S(M0,{}),p)}const H0={configure:K0};window.UserLeap&&window.Sprig&&(window.Sprig._gtm?window.Sprig=window.UserLeap:window.UserLeap=window.Sprig);window.UserLeap||(window.UserLeap=window.Sprig);window.Sprig||(window.Sprig=window.UserLeap);const j0="rgba(255,255,255, 0.95)",G0="rgba(0,0,0,0.9)",z0="360px",So="0px",yf=()=>{window.UserLeap.container=document.createElement("div"),window.UserLeap.container.className="ul-container",document.body.appendChild(window.UserLeap.container)},_f=e=>{Z0();const t=window.UserLeap.container;if(!(!t||!t.parentNode))try{t.parentNode.removeChild(t),window.UserLeap.container=null,Me("trackStartUrl",null),z.emit(K.SurveyLifeCycle,{state:"dismissed"}),z.emit(K.SurveyClosed,{name:K.SurveyClosed,initiator:e})}catch(n){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+t),n instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",n)}},bf=()=>{z.on(K.SurveyWillClose,({initiator:e})=>{_f(e)})},W0=(e,t)=>{const r={...{position:"fixed",overflow:"auto",top:"0px",left:"0px",display:"none",height:"100%",width:"100%",transition:"background-color 0.3s ease-out",zIndex:2147483646}},i=t?e.overlayStyleMobile:e.overlayStyle;r["background-color"]=i==="light"?j0:G0,t||(r.margin="auto"),window.UserLeap.container&&Object.assign(window.UserLeap.container.style,r)},q0=(e,t,n)=>{var s,u;const r={position:"fixed",bottom:"0px",right:So,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646},i=Object.assign({},t,window.UserLeap);let o,a=!1;return n?((s=window.UserLeap.windowDimensions)!=null&&s.width?r.width=`${window.UserLeap.windowDimensions.width}px`:r.width="100%",(u=window.UserLeap.windowDimensions)!=null&&u.height?r.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`:window.UserLeap.maxHeight?r.maxHeight=window.UserLeap.maxHeight:r.maxHeight=`${document.body.clientHeight-20}px`,["light","dark"].includes(i.overlayStyleMobile)&&(a=!0)):(r.width=z0,r.maxHeight=window.UserLeap.maxHeight||"66vh",i.framePosition===qn.BottomLeft?o={left:So}:i.framePosition===qn.TopLeft?o={left:So,top:"0px"}:i.framePosition===qn.TopRight?o={top:"0px"}:i.framePosition===qn.Center&&(a=!0,o={margin:"auto",position:"static"},r.maxHeight=null)),a&&W0(i,n),Object.assign(e.style,r,o),a},$0=(e,t)=>{var s,u;const n="ul-frame";yf(),Y0();const r=document.createElement("iframe");r.id=n,r.setAttribute("title","Sprig User Feedback Dialog");const i=q0(r,e,t);bf(),r.setHeight=c=>{parseInt(r.style.height)!=c&&(r.style.height=`${c}px`,z.emit(K.SurveyHeight,{name:K.SurveyHeight,contentFrameHeight:c}))},(s=window.UserLeap.container)==null||s.appendChild(r),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{z.emit(K.CloseSurveyOnOverlayClick)}),z.emit(K.SurveyLifeCycle,{state:"presented"}),z.emit(K.SurveyPresented,{name:K.SurveyPresented});const o=(u=r.contentWindow)==null?void 0:u.document;o&&(o.open("text/html","replace"),o.write("<!doctype html><head></head><body></body></html>"),o.close());const a=o==null?void 0:o.head;return{frameId:n,contentWinDocHead:a,contentWindow:r.contentWindow,hasOverlay:i,iframe:r}},wf={[K.SurveyFadingOut]:()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}},Y0=()=>{Object.entries(wf).forEach(([e,t])=>{z.on(e,t)})},Z0=()=>{Object.entries(wf).forEach(([e,t])=>{z.off(e,t)})},Q0="!launch_darkly_";class J0{constructor(){Ce(this,"_ldData",{})}getAllLaunchDarklyVariations(){return this._ldData}setLDFlagsVariations(t){try{return!t||typeof t!="object"||Array.isArray(t)?!1:(Object.keys(this._ldData).forEach(n=>{delete this._ldData[n]}),Object.keys(t).forEach(n=>{var r;return this._ldData[`${Q0}${n}`]=((r=t[n])!=null?r:0)+1}),!0)}catch(n){return n instanceof Error&&window.UserLeap.reportError("setAllLDFlagsVariations",n),console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."),!1}}}const va=new J0;Object.freeze(va);const X0="!optimizely_experiments_";class eb{constructor(){Ce(this,"_optimizelyData",{})}setOptimizelyExperiment(t,n=!0){if(!t||typeof t!="object")return!1;const{experiments:r}=t;try{return n&&Object.keys(this._optimizelyData).map(i=>{delete this._optimizelyData[i]}),r&&r.map(i=>{const{id:o,variation:a}=i,s=this.transformExperimentId(o);a&&typeof a=="string"&&(this._optimizelyData[s]=a)}),!0}catch(i){return i instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",i),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(t){return this._optimizelyData[this.transformExperimentId(t)]}transformExperimentId(t){return X0+t}getAndSetWebOptimizelyExperiments(){var t;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const n=(t=window.optimizely.get("state"))==null?void 0:t.getExperimentStates({isActive:!0});if(n){const r=Object.keys(n).map(i=>{var o,a;return(o=n[i].variation)!=null&&o.name?{id:i,variation:(a=n[i].variation)==null?void 0:a.name}:{id:i,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r},!1),!0}return!1}return!1}catch(n){return n instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",n),!1}}}const oi=new eb;Object.freeze(oi);class tb{constructor(t,n){Ce(this,"paused");Ce(this,"queue");Ce(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(n)}flush(t){const n=t.length;if(n)for(let r=0;r<n;r++)this.push(t[r])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const n=Array.prototype.slice.call(t,1),r=t[0],i=this.ul[r];i instanceof Function?i.apply(this.ul,n):r&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",r)}}perform(t){if(this.paused){let n=()=>{};const r=new Promise(function(i){n=function(){i(t())}});return this.queue.push(n),r}else return t()}empty(){this.queue.length=0}}var je=(e=>(e.Ready="ready",e.NoSurvey="no survey",e))(je||{}),Sf=(e=>(e.Preview="sprigPreviewKey",e))(Sf||{});const nb=["popState","pushState","replaceState"],rb={test:"test"},zn="!email",ib=["ios","android"],Jt="environments",ya="pageUrl",Gt="visitors",nl="ul-view-sdk-script",rl=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function ps(e,t){const{matchType:n,pattern:r}=e,i=n?rl[n]:rl.legacy;let o=!1;try{o=i(r,t)}catch(a){const s=`[Sprig] (ERR-445) Failed to check url match with pattern ${r}`;a instanceof Error&&(console.warn(s,a),a.stack=JSON.stringify(e),window.UserLeap.reportError(s,a))}return o}function ob(e,t){const{pageUrlEvents:n,interactiveEvents:r,dismissOnPageChange:i}=window.UserLeap._config;if(!i)return!0;const o=[];n&&n.length&&o.push(...n),r&&r.length&&o.push(...r);const a=e&&o.find(s=>s.id===e);return a?ps(a,window.location.href):t===window.location.href}function vr(e){const{pageUrlEvents:t,interactiveEvents:n,dismissOnPageChange:r,platform:i}=window.UserLeap._config;if(i&&i!==on.Web)return;const o=zt("trackStartUrl"),a=o?String(o):null;t&&Af(window.location.href),n&&(Cf(),ab()),r&&a&&a!==window.location.href&&e&&nb.includes(e.type)&&window.UserLeap("dismissActiveSurvey",st.PageChange)}const If={capture:!0},ab=()=>{const t=window.UserLeap._config.interactiveEvents.filter(r=>ps(r,window.location.href)).map(r=>{const{name:i,properties:o}=r,{selector:a,innerText:s}=o;return a?u=>{if(Ln(u.target))try{u.target.closest(a)&&window.UserLeap("track",i)}catch{}return!1}:u=>(Ln(u.target)&&u.target.innerText===s&&window.UserLeap("track",i),!1)}),n=r=>t.forEach(i=>i(r));window.UserLeap._config.interactiveEventsHandler=n,window.addEventListener("click",n,If)},Cf=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,If),delete window.UserLeap._config.interactiveEventsHandler};function sb(){["hashchange","popstate"].forEach(e=>window.addEventListener(e,vr,!0))}function ub(){["hashchange","popstate"].forEach(e=>window.removeEventListener(e,vr,!0)),window.UserLeap._config.interactiveEvents&&Cf()}function mt(e,t,n){const r=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(i=>{r.push(i),i===Jt?r.push(window.UserLeap.envId):i===Gt&&r.push(hs())}),n&&r.push(n),r.join("/")}function lb(e,t){let n=mt("1",[Jt],"questions?");return e!=null&&(n+=`&vid=${e}`),t&&(t.surveyId&&(n+=`&surveyid=${t.surveyId}`),t.surveyTemplateId&&(n+=`&surveytemplateid=${t.surveyTemplateId}`),t.previewLanguage&&(n+=`&previewLanguage=${encodeURIComponent(t.previewLanguage)}`)),n}function Ef(){try{if(typeof localStorage<"u"&&(localStorage.setItem("is_available","yes"),localStorage.getItem("is_available")==="yes"))return localStorage.removeItem("is_available"),!0}catch{return!1}return!1}function zt(e){if(!window.UserLeap.localStorageAvailable)return null;const t=localStorage.getItem(Fe.Credentials);if(t)try{const r=JSON.parse(t)[window.UserLeap.envId];return r&&r[e]||null}catch(n){n instanceof Error&&(n.stack=t,window.UserLeap.reportError("Failed to parse local storage credentials",n)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",n)}return null}function Me(e,t){if(!window.UserLeap.localStorageAvailable)return;const n=localStorage.getItem(Fe.Credentials);let r={};if(n)try{r=JSON.parse(n)}catch(o){o instanceof Error&&(o.stack=n,window.UserLeap.reportError("Failed to parse local storage credentials",o)),console.warn("[Sprig] (ERR-427) Failed to lookup saved ids",o)}let i=r[window.UserLeap.envId];i?i[e]=t:i={[e]:t},r[window.UserLeap.envId]=i;try{localStorage.setItem(Fe.Credentials,JSON.stringify(r))}catch(o){o instanceof Error&&console.warn(`[Sprig] (ERR-426) Unable to write to Local Storage:: ${o.message}`)}}function kf(){window.previewMode||(window.UserLeap.visitorId=rn(),Me("vid",window.UserLeap.visitorId),z.emit(K.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}))}function hs(){return window.previewMode?"0":window.UserLeap.visitorId||""}function Af(e,t,n){if(!window.UserLeap.localStorageAvailable||e.endsWith("mock_snippet.html"))return;const r=window.UserLeap._config.pageUrlEvents;let i=!1;if(r&&r.length)for(let l=0;l<r.length&&(i=ps(r[l],e),!i);l++);if(!i)return;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const o=10,a=1;let s=[];const u={viewedAt:Date.now(),location:e},c=localStorage.getItem(Fe.PageViews);try{if(s=c?JSON.parse(c):[],Array.isArray(s)||(s=[]),s.length>0){const l=s[s.length-1],d=(Date.now()-l.viewedAt)/1e3;l.location!=e&&d>a&&Iu({url:e}),(l.location!=e&&d>a||d>o)&&(window.UserLeap._queue.push(["track",ya,t,{url:e},n]),s.push(u))}else window.UserLeap._queue.push(["track",ya,t,{url:e},n]),s.push(u),Iu({url:e});s.length>5&&s.splice(0,s.length-5);try{localStorage.setItem(Fe.PageViews,JSON.stringify(s))}catch(l){l instanceof Error&&console.warn(`[Sprig] Unable to write to Local Storage: ${l.message}`)}}catch(l){l instanceof Error&&window.UserLeap.reportError("trackPageView",l,{pageViewsStorage:c}),console.warn("[Sprig] (ERR-425) Failed to update page views in local storage")}}function cb(){const e="Backbone"in window&&window.Backbone&&window.Backbone.history?window.Backbone.history:window.history;"pushState"in e&&(e.pushState=(t=>function(...r){const i=t.apply(this,r),o=new Event("pushState");return window.dispatchEvent(o),vr(o),i})(e.pushState)),"replaceState"in e&&(e.replaceState=(t=>function(...r){const i=t.apply(this,r),o=new Event("replaceState");return window.dispatchEvent(o),vr(o),i})(e.replaceState)),sb()}async function Io(e,t){const n=hs();e&&!t&&(window.UserLeap._config.mode=rb.test);const r=await Nt(lb(n,{...e,previewLanguage:window.UserLeap._config.previewLanguage}),{},0,!0);return r.ok?(r.json.delay&&await vi(r.json.delay),xf(r.json)):(r.reportError&&r.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",r.error),window.UserLeap.reportError("getQuestions",r.error)),{success:!1,surveyState:je.NoSurvey})}const db=e=>e.some(t=>t.type===R.VideoVoice),xf=async e=>{var F,P,T,A;const{context:t,forceBrandedLogo:n,endCard:r,locale:i,productConfig:o,questions:a,responseGroupUid:s,surveyId:u,uuid:c,vid:l,sessionReplay:d}=e,p=On(window.UserLeap),f=ms(p),h=fb(p);if(d&&rd({responseGroupId:s,surveyId:u,visitorId:l,replayParams:d,completeUploadHeaders:p,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:a.length===0}),l==null||!a||!a.length)return{success:!1,message:"[Sprig] no survey found",surveyState:je.NoSurvey};if(db(a))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:je.NoSurvey};if(window.UserLeap.container){const U="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(U),{success:!1,message:U,surveyState:je.NoSurvey}}if(l!==window.UserLeap.visitorId&&c!==window.UserLeap.visitorId&&!window.previewMode){const U="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(U)),{success:!1,message:U,surveyState:je.NoSurvey}}i_({id:u}),No.disable(),z.emit(K.SurveyWillPresent,{name:K.SurveyWillPresent,[zl.SurveyId]:u});let m,g=document.createElement("div"),w,y,v;const b=U=>{const{[Yt.ViewVersion]:W}=U;W!==p["x-ul-sdk-version"]&&_f(),z.removeListener(qe.VerifyViewVersion,b)};z.on(qe.VerifyViewVersion,b),En(p)?(m="ul-direct-embeded-frame",w=document.head,y=window,v=!1,f&&(yf(),g.id=m,window.UserLeap.container.appendChild(g),bf(),z.emit(K.SurveyLifeCycle,{state:"presented"}),z.emit(K.SurveyPresented,{name:K.SurveyPresented}))):{frameId:m,contentWinDocHead:w,contentWindow:y,hasOverlay:v,iframe:g}=$0(o,h),window.UserLeap.frameId=m,window.UserLeap.useMobileStyling=h;const _=U=>{z.on(K.CloseSurveyOnOverlayClick,U)},C=Object.assign({frame:g,envId:window.UserLeap.envId,surveyId:u,userId:c,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},cards:a,context:t,locale:i,fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,apiURL:window.UserLeap._API_URL,responseGroupUid:s,headers:p,endCard:r,useMobileStyling:h,mobileSDKVersion:window.UserLeap.mobileSDKVersion,configureExitOnOverlayClick:_,eventEmitFn:z.emit.bind(z),ulEvents:Ca,viewDocument:y==null?void 0:y.document,viewWindow:y,tabTitle:document.title,startingQuestionIdx:(F=window.UserLeap.config)==null?void 0:F.startingQuestionIdx,styleNonce:window.UserLeap.styleNonce,previewKey:(P=window.UserLeap)!=null&&P.localStorageAvailable?(T=window.localStorage)==null?void 0:T.getItem(Fe.Preview):null,forceBrandedLogo:n},window.UserLeap._config);(A=window.UserLeap.config)!=null&&A.startingQuestionIdx&&(window.UserLeap.config={...window.UserLeap.config,startingQuestionIdx:null}),window.UserLeap.customStyles&&(C.customStyles=window.UserLeap.customStyles),y&&(y.__cfg=C);function k(){const U=document.createElement("script");return window.UserLeap.nonce&&U.setAttribute("nonce",window.UserLeap.nonce),U.id=nl,U}const I=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:C.path,E=document.getElementById(nl);E&&E.remove();const x=k(),N=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};return C.installationMethod===Xt.Npm||C.installationMethod===Xt.NpmBundled?(H0.configure(C),v&&window.UserLeap.container&&N()):I&&(x.src=I,v&&x.addEventListener("load",()=>{window.UserLeap.container&&N()}),y==null||y.addEventListener("error",U=>{U.target instanceof HTMLScriptElement&&U.target.src===I&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0})),w==null||w.appendChild(x),{success:!0,surveyState:je.Ready,surveyId:u,responseGroupUid:s}};function fb(e){if(window.UserLeap.useMobileStyling!==void 0)return window.UserLeap.useMobileStyling;const t=window.UserLeap.windowDimensions&&window.UserLeap.windowDimensions.width||document.body.clientWidth;return ms(e)||t>10&&t<Lg}function ms(e){return ib.includes(e[at.Platform])}function pb(e){let t=e.length;for(;t;){const n=Math.floor(Math.random()*t);t-=1;const r=e[t];e[t]=e[n],e[n]=r}}function hb(e){if(!e)return;window.UserLeap._config=e,e.mute&&window.UserLeap._queue.pause();const{interactiveEvents:t,pageUrlEvents:n,dismissOnPageChange:r}=e;t&&pb(t),(t||n||r)&&(cb(),vr())}async function Nt(e,t,n=0,r=!1){var o,a;t.headers=Object.assign(On(window.UserLeap),t.headers);const i=await wt(e,t,n,r);if(i.ok){const s=(o=i.headers)==null?void 0:o.get("Authorization"),u=s?s.split(" "):void 0,c=u&&u.length===2?u[1]:void 0,l=(a=i.headers)==null?void 0:a.get(at.VisitorID);c&&l&&(l!==window.UserLeap.visitorId||window.UserLeap.token!==c)&&(Me("token",c),Me("vid",l),z.emit(K.VisitorIDUpdated,{visitorId:l}),window.UserLeap.token=c,window.UserLeap.visitorId=l)}return i.json&&i.json.logMessage&&console.warn(`[Sprig] ${i.json.logMessage}`),i}async function mb(e,t){var r,i;let n=!0;return t&&((r=e==null?void 0:e.json)==null?void 0:r.surveyId)&&(window.UserLeap.delayingSurvey=!0,n=await t(e.json.surveyId),window.UserLeap.delayingSurvey=!1,!n)?!1:((i=e==null?void 0:e.json)!=null&&i.delay&&(window.UserLeap.delayingSurvey=!0,await vi(e.json.delay),window.UserLeap.delayingSurvey=!1),n)}const gb=function(e){if(!window.UserLeap)return;const t=async(r={})=>{var m,g,w,y,v;const{userId:i,anonymousId:o,metadata:a={},properties:s,showSurveyCallback:u}=r;let{eventName:c}=r;if(window.UserLeap.debugMode&&c!==ya&&console.info("[DEBUG] Sprig track",r),e.mode==="test")return;const l=window.UserLeap.localStorageAvailable&&(m=localStorage.getItem(Fe.Preview))!=null?m:void 0;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const b="[Sprig] - Skipping tracking without userId";return console.warn(b),{success:!1,message:b,surveyState:je.NoSurvey}}if(!c||c.trim().length===0){c=c?String(c):"";const b="[Sprig] - Invalid event name "+c;return console.warn(b),{success:!1,message:b,surveyState:je.NoSurvey}}const d=window.location.href;if(a.url||(a.url=d),Me("trackStartUrl",d),(w=(g=window.UserLeap)==null?void 0:g._config)!=null&&w.optimizelyEnabled){const b=On(window.UserLeap);ms(b)||oi.getAndSetWebOptimizelyExperiments(),a.optimizelyExperiments=Object.assign({},oi.getAllOptimizelyExperiments())}(v=(y=window.UserLeap)==null?void 0:y._config)!=null&&v.launchDarklyEnabled&&(a.launchDarklyFlags=va.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),o&&(window.UserLeap.partnerAnonymousId=o),s&&(a.eventProperties=s),r_({name:c});const p=window.UserLeap.delayingSurvey?await Nt(mt("1",[Gt],"events/batch"),{body:JSON.stringify({events:[{event:c,metadata:a}],previewKey:l}),method:"POST"},0,!0):await Nt(mt("1",[Gt],"events"),{body:JSON.stringify({event:c,metadata:a,previewKey:l}),method:"POST"},0,!0);if(!p.ok){const b="[Sprig] (ERR-421) Failed to track event";return p.reportError&&(console.warn(b,p.error),p.error&&window.UserLeap.reportError("track",p.error)),{success:!1,message:b,error:p.error,surveyState:je.NoSurvey}}i&&Me("uid",i),o&&Me("aid",o);const f=p.json;return f.invalidPreviewKey&&window.UserLeap.localStorageAvailable&&localStorage.removeItem(Fe.Preview),await mb(p,u)?ob(f.eventId,d)?xf(f):{success:!1,message:"Study should not be displayed after page navigation",surveyState:je.NoSurvey}:{success:!1,message:"[Sprig] Callback returned false, aborting rendering of survey",surveyState:je.NoSurvey}},n={async displaySurvey(r){return console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",st.Override),Io({surveyId:r},!0)},_previewSurvey(r){window.UserLeap("dismissActiveSurvey",st.Override),Io({surveyTemplateId:r},!1)},_reviewSurvey(r){window.UserLeap("dismissActiveSurvey",st.Override),Io({surveyId:r},!1)},previewSurvey(r){n._previewSurvey(r)},reviewSurvey(r){n._reviewSurvey(r)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(r=st.API){z.emit(K.SurveyWillClose,{name:K.SurveyWillClose,initiator:r})},async setAttribute(r,i){if(!r||!i&&i!==0){const o="[Sprig] - Disregarding empty attribute / value provided";return console.warn(o),{success:!1,message:o}}return this.setAttributes({[r]:i})},async setAttributes(r){if(r==null||Object.keys(r).length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}return this.identifyAndSetAttributes({attributes:r})},async identifyAndSetAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",r),e.mode==="test")return;if(r===null||typeof r!="object"||!(r.userId||r.anonymousId||r.attributes)){const c="[Sprig] - Disregarding empty payload provided";return console.warn(c),{success:!1,message:c}}const{userId:i,anonymousId:o,attributes:a}=r;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const c="[Sprig] - Skipping tracking without userId";return console.warn(c),{success:!1,message:c}}if(!a&&(!i||window.UserLeap.userId===i)&&(!o||window.UserLeap.partnerAnonymousId===o))return{success:!0};const s={};i&&(s.userId=window.UserLeap.userId=i),o&&(s.partnerAnonymousId=window.UserLeap.partnerAnonymousId=o);let u;return a?(a.email&&!Object.prototype.hasOwnProperty.call(a,zn)&&(a[zn]=a.email,delete a.email),u=await Nt(mt("1",[Jt,Gt],"attributes"),{body:JSON.stringify(a),method:"PUT"}),!u.ok&&u.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",u.error),u.error&&window.UserLeap.reportError("identifyAndSetAttributes",u.error))):u=await Nt(mt("1",[Jt,Gt]),{body:JSON.stringify(s),method:"PUT"}),a&&a[zn]&&(window.UserLeap.email=a[zn]),u.ok&&(i&&Me("uid",i),o&&Me("aid",o)),{success:!!u.ok}},async removeAttributes(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",r),e.mode==="test")return;if(r==null||r.length===0){const o="[Sprig] - Disregarding empty attributes provided";return console.warn(o),{success:!1,message:o}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const o="[Sprig] - Skipping tracking without userId";return console.warn(o),{success:!1,message:o}}const i=await Nt(mt("1",[Jt,Gt],"attributes"),{body:JSON.stringify({delete:r}),method:"DELETE"});return!i.ok&&i.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",i.error),i.error&&window.UserLeap.reportError("removeAttributes",i.error)),{success:!!i.ok}},async addSurveyListener(r){z.on(K.SurveyLifeCycle,r)},async removeSurveyListener(r){z.removeListener(K.SurveyLifeCycle,r)},async addListener(r,i){z.on(r,i)},async removeListener(r,i){z.removeListener(r,i)},async removeAllListeners(){z.removeAllListeners()},setPreviewKey(r){if(!r||typeof r!="string")return;const i=Ef();window.UserLeap.localStorageAvailable=i,i&&r&&localStorage.setItem(Fe.Preview,r)},async setUserId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",r),r==null){const a=`[Sprig] - Invalid userId ${r}`;return console.warn(a),{success:!1,message:a}}if(e.mode==="test"||r===window.UserLeap.userId)return;window.UserLeap.userId=r;const i=window.UserLeap.visitorId,o=await Nt(mt("1",[Jt,Gt]),{body:JSON.stringify({userId:r}),method:"PUT"});if(!o.ok){o.reportError&&(console.warn("[Sprig] (ERR-420) Failed to set user id",o.error),o.error&&window.UserLeap.reportError("setUserId",o.error));return}i!==window.UserLeap.visitorId&&Su(),Me("uid",r)},async setPartnerAnonymousId(r){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setPartnerAnonymousId",r),r==null){const i=`[Sprig] - Invalid partnerAnonymousId ${r}`;return console.warn(i),{success:!1,message:i}}return window.UserLeap.partnerAnonymousId=r,Me("aid",r),{success:!0}},async track(r,i,o={},a=void 0){return t({eventName:r,properties:i,metadata:o,showSurveyCallback:a})},async identifyAndTrack(r){return await t(r)},trackPageView(r,i=void 0,o=void 0){Af(r,i,o)},applyStyles(r){if(window.UserLeap.customStyles=r,window.UserLeap.container){const i=window.UserLeap.container.children[0].contentDocument;if(i){const o=i.getElementById(O.CustomStyle);o?o.textContent=r:cc(i,r,window.UserLeap.styleNonce)}}},setWindowDimensions(r,i){var u,c;const o=typeof r=="string"?parseInt(r,10):r,a=typeof i=="string"?parseInt(i,10):i;if(!isNaN(o)&&!isNaN(a)&&(window.UserLeap.windowDimensions={width:o,height:a}),!window.UserLeap.frameId)return;const s=document.getElementById(window.UserLeap.frameId);!s||(window.UserLeap.useMobileStyling&&((u=window.UserLeap.windowDimensions)!=null&&u.width&&(s.style.width=`${window.UserLeap.windowDimensions.width}px`),(c=window.UserLeap.windowDimensions)!=null&&c.height&&(s.style.maxHeight=`${window.UserLeap.windowDimensions.height-20}px`),s.contentDocument&&(s.style.height=String(dc(s.contentDocument))+"px")),z.emit(K.SurveyDimensions,{name:K.SurveyDimensions,contentFrameWidth:s.clientWidth,contentFrameHeight:s.clientHeight}))},logoutUser(){window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,window.UserLeap.localStorageAvailable&&(localStorage.removeItem(Fe.Credentials),localStorage.removeItem(Fe.PageViews)),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),kf(),Su(),window.UserLeap._queue.unpause()},teardown(){ub(),window.UserLeap("dismissActiveSurvey",st.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(r,i=!0){var o,a;if(!((a=(o=window.UserLeap)==null?void 0:o._config)!=null&&a.optimizelyEnabled)){console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");return}try{const s=typeof r=="string"?JSON.parse(r):r;oi.setOptimizelyExperiment(s,i)}catch(s){console.warn("[Sprig] Error with integrating Optimizely data"),s instanceof Error&&window.UserLeap.reportError("integrateOptimizely",s)}},integrateOptimizelyClient(r){var o,a;if(!((a=(o=window.UserLeap)==null?void 0:o._config)!=null&&a.optimizelyEnabled)){console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");return}const i=({experiment:s,variation:u})=>{const c={experiments:[{id:s.id,variation:u.key}]};window.UserLeap("integrateOptimizely",c,!1)};r.notificationCenter.addNotificationListener(Eg.NOTIFICATION_TYPES.ACTIVATE,i)},importLaunchDarklyData(r){var i,o;if(!((o=(i=window.UserLeap)==null?void 0:i._config)!=null&&o.launchDarklyEnabled)){console.warn("[SPRIG] LaunchDarkly integration is currently not enabled for your product.");return}va.setLDFlagsVariations(r)},setVisitorAttribute(r,i){return console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"),n.setAttribute(r,i)},async setEmail(r){return n.setAttribute(zn,r)},async setVisitorEmail(r){return console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"),n.setEmail(r)},async _generateVideoUploadUrl(r){return _b(r)},async _completeSessionReplay({surveyId:r,responseGroupUuid:i,eventDigest:o}){if(!r||!i)return;const a=window.UserLeap._API_URL;try{await _c({surveyId:r,responseGroupUuid:i,eventDigest:o,apiUrl:a,headers:On(window.UserLeap)},!0)}catch(s){console.warn("[Sprig] Error with completing session replay"),s instanceof Error&&window.UserLeap.reportError("completeSessionReplay",s)}}};Object.assign(window.UserLeap,n)};async function vb(e){const t=On(window.UserLeap);document.addEventListener("securitypolicyviolation",Uo);const n=await wt(mt("1",[Jt],"config"),{headers:t}),r="TypeError";if(window.UserLeap.error=n.error,!n.ok&&n.error&&n.error.name===r?(window.UserLeap._API_URL="https://api.sprig.com",window.UserLeap.reportError("sprigDomainRequest",n.error)):document.removeEventListener("securitypolicyviolation",Uo),!n.ok)return n.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",n.error),n.error&&window.UserLeap.reportError("applyRemoteConfig",n.error)),Do("Disabled: failed to fetch configuration"),e;const i=n.json;return i!=null&&i.disabled?(Do(`Disabled: ${i.disabled}`),{disabled:i.disabled}):Object.assign({},i,e)}async function yb(e,t,n={}){const r=window.__cfg&&window.__cfg.mode,i=hs(),o=window.UserLeap.envId,a=window.document.documentElement,s={mode:r,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:a.clientWidth,clientHeight:a.clientHeight,location:window.location.href,language:window.navigator.language,...n},u={action:e,err:{message:t.message,stack:t.stack},meta:s,vid:i,envId:o};(await Nt(mt("1",null,"errors"),{method:"POST",headers:{[at.Error]:window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(u)},0,!0)).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}async function _b(e){var n;if(!e)return;const t=`${window.UserLeap._API_URL}/2/environments/integrations/upload`;try{const r=await fetch(t,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.ok){const i=await r.json();return(n=i==null?void 0:i.upload)==null?void 0:n.url}else return null}catch(r){console.warn("[Sprig] Error with generating video upload url"),r instanceof Error&&window.UserLeap.reportError("generateVideoUploadUrl",r)}}function bb(e={}){var i;const t=(i=new URLSearchParams(window.location.search).get(Sf.Preview))!=null?i:"",n=Ef();window.UserLeap.localStorageAvailable=n,window.UserLeap.UPDATES=Ca,window.UserLeap("setPreviewKey",t);async function r(){if(window.UserLeap.loaded)return;if(window.UserLeap.reportError=yb,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const c in window.UserLeap._config)window.UserLeap[c]=window.UserLeap._config[c];if(!window.UserLeap.envId)if(window.UserLeap.appId)window.UserLeap.envId=window.UserLeap.appId;else throw new Error("Missing Environment id");window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const o=window.UserLeap.sampleRate;if(o)if(!n)window.UserLeap.debugMode&&console.info("[DEBUG] Sprig cannot sample users without localStorage permissions");else{let c=zt("sampled");if(c===null&&(c=Math.random()<o,Me("sampled",c)),!c)return}else n&&zt("sampled")!==null&&Me("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const a=[...window.UserLeap._queue];window.UserLeap._queue=new tb(window.UserLeap,[]),window.UserLeap._queue.pause();for(let c=0;c<a.length;c++)window.UserLeap._queue.push(a[c]);const s=zt("token");s?(window.UserLeap.token=s,window.UserLeap.visitorId=zt("vid"),window.UserLeap.userId=zt("uid"),window.UserLeap.partnerAnonymousId=zt("aid")):(window.UserLeap.localStorageAvailable&&localStorage.removeItem(Fe.Credentials),kf());const u=await vb(e);Gy(window.document,u.maxReplayDurationSeconds,window.UserLeap.replayNonce,window.UserLeap.maxInflightReplayRequests,u.replaySettings),gb(u),await hb(u),window.UserLeap._queue.unpause(),z.emit(K.SDKReady),z.emit(K.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",r,!1)}class Oi{constructor(){Ce(this,"UPDATES",Ca)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,n){window.Sprig("setAttribute",t,n)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,n){window.Sprig("addListener",t,n)}removeListener(t,n){window.Sprig("removeListener",t,n)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,n={},r={}){window.Sprig("track",t,n,r)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}trackPageView(t,n,r){window.Sprig("trackPageView",t,n,r)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,n){window.Sprig("setWindowDimensions",t,n)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}}const _a={configure:e=>{if(!e.envId&&!e.environmentId)throw new Error("Initialization Error: Sprig configure requires an environmentId");if(e.envId||(e.envId=e.environmentId||""),e.installationMethod="web-npm-bundled",window.Sprig)return window.Sprig;window.Sprig=function(){window.Sprig._queue.push(arguments)},Object.getOwnPropertyNames(Oi.prototype).map(n=>{n!=="constructor"&&(window.Sprig[n]=Oi.prototype[n])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,bb(e),window.Sprig}};_a.configure;window.UpChunk={createUpload:mp};window.rrwebRecord=wr;exports.DismissReason=st;exports.SprigAPI=Oi;exports.SprigEvent=K;exports.sprig=_a;