@sprig-technologies/sprig-bundled 2.39.2 → 2.39.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,66 +0,0 @@
1
- "use strict";var yd=Object.defineProperty;var wd=(e,t,r)=>t in e?yd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var de=(e,t,r)=>wd(e,typeof t!="symbol"?t+"":t,r);var vd=Object.create,uo=Object.defineProperty,bd=Object.getOwnPropertyDescriptor,Sd=Object.getOwnPropertyNames,Id=Object.getPrototypeOf,Cd=Object.prototype.hasOwnProperty,fr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kd=fr((e,t)=>{var r;r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t.exports=r}),Ed=fr((e,t)=>{t.exports=function(n){if(!n)return!1;var s=r.call(n);return s==="[object Function]"||typeof n=="function"&&s!=="[object RegExp]"||typeof window<"u"&&(n===window.setTimeout||n===window.alert||n===window.confirm||n===window.prompt)};var r=Object.prototype.toString}),xd=fr((e,t)=>{var r=function(s){return s.replace(/^\s+|\s+$/g,"")},n=function(s){return Object.prototype.toString.call(s)==="[object Array]"};t.exports=function(s){if(!s)return{};for(var i={},a=r(s).split(`
2
- `),o=0;o<a.length;o++){var l=a[o],c=l.indexOf(":"),u=r(l.slice(0,c)).toLowerCase(),p=r(l.slice(c+1));i[u]===void 0?i[u]=p:n(i[u])?i[u].push(p):i[u]=[i[u],p]}return i}}),Rd=fr((e,t)=>{t.exports=function(){for(var n={},s=0;s<arguments.length;s++){var i=arguments[s];for(var a in i)r.call(i,a)&&(n[a]=i[a])}return n};var r=Object.prototype.hasOwnProperty}),Ld=fr((e,t)=>{var r=kd(),n=Ed(),s=xd(),i=Rd();function a(c,u,p){var d=c;return n(u)?(p=u,typeof c=="string"&&(d={uri:c})):d=i(u,{uri:c}),d.callback=p,d}function o(c,u,p){return l(u=a(c,u,p))}function l(c){if(c.callback===void 0)throw new Error("callback argument missing");var u=!1,p=function(E,L,S){u||(u=!0,c.callback(E,L,S))};function d(){var E=void 0;if(E=h.response?h.response:h.responseText||function(L){try{if(L.responseType==="document")return L.responseXML;var S=L.responseXML&&L.responseXML.documentElement.nodeName==="parsererror";if(L.responseType===""&&!S)return L.responseXML}catch{}return null}(h),M)try{E=JSON.parse(E)}catch{}return E}function f(E){return clearTimeout(g),E instanceof Error||(E=new Error(""+(E||"Unknown XMLHttpRequest Error"))),E.statusCode=0,p(E,k)}function y(){if(!m){var E;clearTimeout(g),E=c.useXDR&&h.status===void 0?200:h.status===1223?204:h.status;var L=k,S=null;return E!==0?(L={body:d(),statusCode:E,method:C,headers:{},url:v,rawRequest:h},h.getAllResponseHeaders&&(L.headers=s(h.getAllResponseHeaders()))):S=new Error("Internal XMLHttpRequest Error"),p(S,L,L.body)}}var h=c.xhr||null;h||(h=c.cors||c.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var I,m,g,v=h.url=c.uri||c.url,C=h.method=c.method||"GET",A=c.body||c.data,x=h.headers=c.headers||{},U=!!c.sync,M=!1,k={body:void 0,headers:{},statusCode:0,method:C,url:v,rawRequest:h};if("json"in c&&c.json!==!1&&(M=!0,x.accept||x.Accept||(x.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(x["content-type"]||x["Content-Type"]||(x["Content-Type"]="application/json"),A=JSON.stringify(c.json===!0?A:c.json))),h.onreadystatechange=function(){h.readyState===4&&setTimeout(y,0)},h.onload=y,h.onerror=f,h.onprogress=function(){},h.onabort=function(){m=!0},h.ontimeout=f,h.open(C,v,!U,c.username,c.password),U||(h.withCredentials=!!c.withCredentials),!U&&c.timeout>0&&(g=setTimeout(function(){if(!m){m=!0,h.abort("timeout");var E=new Error("XMLHttpRequest timeout");E.code="ETIMEDOUT",f(E)}},c.timeout)),h.setRequestHeader)for(I in x)x.hasOwnProperty(I)&&h.setRequestHeader(I,x[I]);else if(c.headers&&!function(E){for(var L in E)if(E.hasOwnProperty(L))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(h.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(h),h.send(A||null),h}t.exports=o,t.exports.default=o,o.XMLHttpRequest=r.XMLHttpRequest||function(){},o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:r.XDomainRequest,function(c,u){for(var p=0;p<c.length;p++)u(c[p])}(["get","put","post","patch","head","delete"],function(c){o[c==="delete"?"del":c]=function(u,p,d){return(p=a(u,p,d)).method=c.toUpperCase(),l(p)}})});function Mi(e,t,...r){if(!e)throw new TypeError(cl(t,r))}function cl(e,t){let r=0;return e.replace(/%[os]/gu,()=>ul(t[r++]))}function ul(e){return typeof e!="object"||e===null?String(e):Object.prototype.toString.call(e)}var De=typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:typeof globalThis<"u"?globalThis:void 0,ct=class{constructor(e,t){this.code=e,this.message=t}warn(...e){var t;try{let r=((t=new Error().stack)!==null&&t!==void 0?t:"").replace(/^(?:.+?\n){2}/gu,`
3
- `);console.warn(this.message,...e,r)}catch{}}},Od=new ct("W01","Unable to initialize event under dispatching."),Ad=new ct("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),Md=new ct("W03","Assigning any truthy value to 'returnValue' property has no effect."),Ud=new ct("W04","Unable to preventDefault on non-cancelable events."),Td=new ct("W05","Unable to preventDefault inside passive event listener invocation."),Dd=new ct("W06","An event listener wasn't added because it has been added already: %o, %o"),Xn=new ct("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),po=new ct("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o"),Xe=class{static get NONE(){return ho}static get CAPTURING_PHASE(){return mo}static get AT_TARGET(){return fo}static get BUBBLING_PHASE(){return go}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=t??{};Cs.set(this,{type:String(e),bubbles:!!r.bubbles,cancelable:!!r.cancelable,composed:!!r.composed,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return he(this).type}get target(){return he(this).target}get srcElement(){return he(this).target}get currentTarget(){return he(this).currentTarget}composedPath(){let e=he(this).currentTarget;return e?[e]:[]}get NONE(){return ho}get CAPTURING_PHASE(){return mo}get AT_TARGET(){return fo}get BUBBLING_PHASE(){return go}get eventPhase(){return he(this).dispatchFlag?2:0}stopPropagation(){he(this).stopPropagationFlag=!0}get cancelBubble(){return he(this).stopPropagationFlag}set cancelBubble(e){e?he(this).stopPropagationFlag=!0:Ad.warn()}stopImmediatePropagation(){let e=he(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return he(this).bubbles}get cancelable(){return he(this).cancelable}get returnValue(){return!he(this).canceledFlag}set returnValue(e){e?Md.warn():yo(he(this))}preventDefault(){yo(he(this))}get defaultPrevented(){return he(this).canceledFlag}get composed(){return he(this).composed}get isTrusted(){return!1}get timeStamp(){return he(this).timeStamp}initEvent(e,t=!1,r=!1){let n=he(this);n.dispatchFlag?Od.warn():Cs.set(this,{...n,type:String(e),bubbles:!!t,cancelable:!!r,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}},ho=0,mo=1,fo=2,go=3,Cs=new WeakMap;function he(e,t="this"){let r=Cs.get(e);return Mi(r!=null,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),r}function yo(e){e.inPassiveListenerFlag?Td.warn():e.cancelable?e.canceledFlag=!0:Ud.warn()}Object.defineProperty(Xe,"NONE",{enumerable:!0}),Object.defineProperty(Xe,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(Xe,"AT_TARGET",{enumerable:!0}),Object.defineProperty(Xe,"BUBBLING_PHASE",{enumerable:!0});var Zn=Object.getOwnPropertyNames(Xe.prototype);for(let e=0;e<Zn.length;++e)Zn[e]!=="constructor"&&Object.defineProperty(Xe.prototype,Zn[e],{enumerable:!0});De!==void 0&&De.Event!==void 0&&Object.setPrototypeOf(Xe.prototype,De.Event.prototype);var vt,wo={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 vo(e){let t=Object.keys(wo);for(let r=0;r<t.length;++r){let n=t[r],s=wo[n];Object.defineProperty(e,n,{get:()=>s,configurable:!0,enumerable:!0})}}var gn=class extends Xe{static wrap(e){return new(pl(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),dl.set(this,{original:e});let t=Object.keys(e);for(let r=0;r<t.length;++r){let n=t[r];n in this||Object.defineProperty(this,n,hl(e,n))}}stopPropagation(){super.stopPropagation();let{original:e}=nt(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;let{original:t}=nt(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();let{original:e}=nt(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;let{original:t}=nt(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();let{original:e}=nt(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){let{original:e}=nt(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}},dl=new WeakMap;function nt(e){let t=dl.get(e);return Mi(t!=null,"'this' is expected an Event object, but got",e),t}var yn=new WeakMap;function pl(e){let t=Object.getPrototypeOf(e);if(t==null)return gn;let r=yn.get(t);return r==null&&(r=function(n,s){class i extends n{}let a=Object.keys(s);for(let o=0;o<a.length;++o)Object.defineProperty(i.prototype,a[o],hl(s,a[o]));return i}(pl(t),t),yn.set(t,r)),r}function hl(e,t){let r=Object.getOwnPropertyDescriptor(e,t);return{get(){let n=nt(this).original,s=n[t];return typeof s=="function"?s.bind(n):s},set(n){nt(this).original[t]=n},configurable:r.configurable,enumerable:r.enumerable}}function ml(e){return!(1&~e.flags)}function bo(e){return!(2&~e.flags)}function So(e){return!(4&~e.flags)}function Pd(e){return!(8&~e.flags)}function _d({callback:e},t,r){try{typeof e=="function"?e.call(t,r):typeof e.handleEvent=="function"&&e.handleEvent(r)}catch(n){(function(s){try{let i=s instanceof Error?s:new Error(ul(s));if(typeof dispatchEvent=="function"&&typeof ErrorEvent=="function")dispatchEvent(new ErrorEvent("error",{error:i,message:i.message}));else if(typeof process<"u"&&typeof process.emit=="function")return void process.emit("uncaughtException",i);console.error(i)}catch{}})(n)}}function fl({listeners:e},t,r){for(let n=0;n<e.length;++n)if(e[n].callback===t&&ml(e[n])===r)return n;return-1}function Io(e,t,r){let n=fl(e,t,r);return n!==-1&&gl(e,n)}function gl(e,t,r=!1){let n=e.listeners[t];return function(s){s.flags|=8}(n),n.signal&&n.signal.removeEventListener("abort",n.signalListener),e.cow&&!r?(e.cow=!1,e.listeners=e.listeners.filter((s,i)=>i!==t),!1):(e.listeners.splice(t,1),!0)}yn.set(Object.prototype,gn),De!==void 0&&De.Event!==void 0&&yn.set(De.Event.prototype,gn);var Dn=class{constructor(){wl.set(this,Object.create(null))}addEventListener(e,t,r){let n=Kn(this),{callback:s,capture:i,once:a,passive:o,signal:l,type:c}=function(d,f,y){var h;return Co(f),typeof y=="object"&&y!==null?{type:String(d),callback:f??void 0,capture:!!y.capture,passive:!!y.passive,once:!!y.once,signal:(h=y.signal)!==null&&h!==void 0?h:void 0}:{type:String(d),callback:f??void 0,capture:!!y,passive:!1,once:!1,signal:void 0}}(e,t,r);if(s==null||l!=null&&l.aborted)return;let u=function(d,f){var y;return(y=d[f])!==null&&y!==void 0?y:d[f]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(n,c),p=fl(u,s,i);p===-1?function(d,f,y,h,I,m){let g;m&&(g=Io.bind(null,d,f,y),m.addEventListener("abort",g));let v=function(C,A,x,U,M,k){return{callback:C,flags:(A?1:0)|(x?2:0)|(U?4:0),signal:M,signalListener:k}}(f,y,h,I,m,g);d.cow?(d.cow=!1,d.listeners=[...d.listeners,v]):d.listeners.push(v)}(u,s,i,o,a,l):function(d,f,y,h){Dd.warn(ml(d)?"capture":"bubble",d.callback),bo(d)!==f&&Xn.warn("passive"),So(d)!==y&&Xn.warn("once"),d.signal!==h&&Xn.warn("signal")}(u.listeners[p],o,a,l)}removeEventListener(e,t,r){let n=Kn(this),{callback:s,capture:i,type:a}=function(l,c,u){return Co(c),typeof u=="object"&&u!==null?{type:String(l),callback:c??void 0,capture:!!u.capture}:{type:String(l),callback:c??void 0,capture:!!u}}(e,t,r),o=n[a];s!=null&&o&&Io(o,s,i)}dispatchEvent(e){let t=Kn(this)[String(e.type)];if(t==null)return!0;let r=e instanceof Xe?e:gn.wrap(e),n=he(r,"event");if(n.dispatchFlag)throw s="This event has been in dispatching.",De.DOMException?new De.DOMException(s,"InvalidStateError"):(vt==null&&(vt=class yl extends Error{constructor(a){super(a),Error.captureStackTrace&&Error.captureStackTrace(this,yl)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(vt.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),vo(vt),vo(vt.prototype)),new vt(s));var s;if(n.dispatchFlag=!0,n.target=n.currentTarget=this,!n.stopPropagationFlag){let{cow:i,listeners:a}=t;t.cow=!0;for(let o=0;o<a.length;++o){let l=a[o];if(!Pd(l)&&(So(l)&&gl(t,o,!i)&&(o-=1),n.inPassiveListenerFlag=bo(l),_d(l,this,r),n.inPassiveListenerFlag=!1,n.stopImmediatePropagationFlag))break}i||(t.cow=!1)}return n.target=null,n.currentTarget=null,n.stopImmediatePropagationFlag=!1,n.stopPropagationFlag=!1,n.dispatchFlag=!1,!n.canceledFlag}},wl=new WeakMap;function Kn(e,t="this"){let r=wl.get(e);return Mi(r!=null,"'%s' must be an object that EventTarget constructor created, but got another one: %o",t,e),r}function Co(e){if(typeof e!="function"&&(typeof e!="object"||e===null||typeof e.handleEvent!="function")){if(e==null||typeof e=="object")return void po.warn(e);throw new TypeError(cl(po.message,[e]))}}var Qn=Object.getOwnPropertyNames(Dn.prototype);for(let e=0;e<Qn.length;++e)Qn[e]!=="constructor"&&Object.defineProperty(Dn.prototype,Qn[e],{enumerable:!0});De!==void 0&&De.EventTarget!==void 0&&Object.setPrototypeOf(Dn.prototype,De.EventTarget.prototype);var ko,Nd=((e,t,r)=>(r=e!=null?vd(Id(e)):{},((n,s,i,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of Sd(s))!Cd.call(n,o)&&o!==i&&uo(n,o,{get:()=>s[o],enumerable:!(a=bd(s,o))||a.enumerable});return n})(e&&e.__esModule?r:uo(r,"default",{value:e,enumerable:!0}),e)))(Ld()),Pn=512e3,_n=256,ks=(e,{minChunkSize:t=_n,maxChunkSize:r=Pn}={})=>e==null||typeof e=="number"&&e>=256&&e%256==0&&e>=t&&e<=r,Es=(e,{minChunkSize:t=_n,maxChunkSize:r=Pn}={})=>new TypeError(`chunkSize ${e} must be a positive number in multiples of 256, between ${t} and ${r}`),Fd=class{constructor(e,t={}){var r,n,s;if(this.readableStream=e,!ks(t.defaultChunkSize,t))throw Es(t.defaultChunkSize,t);this.defaultChunkSize=(r=t.defaultChunkSize)!=null?r:30720,this.minChunkSize=(n=t.minChunkSize)!=null?n:_n,this.maxChunkSize=(s=t.maxChunkSize)!=null?s:Pn}get chunkSize(){var e;return(e=this._chunkSize)!=null?e:this.defaultChunkSize}set chunkSize(e){if(!ks(e,this))throw Es(e,this);this._chunkSize=e}get chunkByteSize(){return 1024*this.chunkSize}async*[Symbol.asyncIterator](){let e,t=this.readableStream.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r){if(e){let i=e;e=void 0,yield i}break}let s=n instanceof Uint8Array?new Blob([n],{type:"application/octet-stream"}):n;for(e=e?new Blob([e,s]):s;e;){if(e.size===this.chunkByteSize){let i=e;e=void 0,yield i;break}if(e.size<this.chunkByteSize)break;{let i=e.slice(0,this.chunkByteSize);e=e.slice(this.chunkByteSize),yield i}}}}finally{if(e){let r=e;e=void 0,yield r}return void t.releaseLock()}}},Bd=[200,201,202,204,308],vl=[408,502,503,504],bl=(e,t)=>!!e&&Bd.includes(e.statusCode),zd=(e,t)=>t.attemptCount>=t.attempts||!(bl(e)||((r,{retryCodes:n=vl})=>!r||n.includes(r.statusCode))(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||vl,this.dynamicChunkSize=e.dynamicChunkSize||!1,this.maxFileBytes=1024*(e.maxFileSize||0),this.chunkCount=0,this.attemptCount=0,this.offline=!1,this._paused=!1,this.success=!1,this.nextChunkRangeStart=0,this.chunkedStreamIterable=new Fd(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 Dn,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:Pn}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:_n}get chunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.chunkSize)!=null?t:30720}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 r=new CustomEvent(e,{detail:t});this.eventTarget.dispatchEvent(r)}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(!ks(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize}))throw Es(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=r=>{r.upload.onprogress=n=>{var s;let i=this.totalChunks-this.chunkCount,a=(this.file.size-this.nextChunkRangeStart)/this.file.size/i,o=this.nextChunkRangeStart/this.file.size,l=n.loaded/((s=n.total)!=null?s:this.chunkByteSize)*a;this.dispatch("progress",Math.min(100*(o+l),100))}};return new Promise((r,n)=>{this.currentXhr=(0,Nd.default)({...e,beforeSend:t},(s,i)=>(this.currentXhr=void 0,s?n(s):r(i)))})}async sendChunk(e){let t=this.nextChunkRangeStart,r=t+e.size-1,n={...await(typeof this.headers=="function"?this.headers():this.headers),"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${r}/${this.file.size}`};return this.dispatch("attempt",{chunkNumber:this.chunkCount,totalChunks:this.totalChunks,chunkSize:this.chunkSize}),this.xhrPromise({headers:n,url:this.endpointValue,method:this.method,body:e})}async sendChunkWithRetries(e){let t;try{this.attemptCount=this.attemptCount+1,this.lastChunkStart=new Date,t=await this.sendChunk(e)}catch{}let r={retryCodes:this.retryCodes,attemptCount:this.attemptCount,attempts:this.attempts};return bl(t)?(async n=>{var s;let i=(new Date().getTime()-this.lastChunkStart.getTime())/1e3;if(this.dispatch("chunkSuccess",{chunk:this.chunkCount,chunkSize:this.chunkSize,attempts:this.attemptCount,timeInterval:i,response:n}),this.attemptCount=0,this.chunkCount=((s=this.chunkCount)!=null?s:0)+1,this.nextChunkRangeStart=this.nextChunkRangeStart+this.chunkByteSize,this.dynamicChunkSize){let a=this.chunkSize;i<10?a=Math.min(2*this.chunkSize,this.maxChunkSize):i>30&&(a=Math.max(this.chunkSize/2,this.minChunkSize)),this.chunkSize=256*Math.ceil(a/256);let o=(this.file.size-this.nextChunkRangeStart)/this.chunkByteSize;this.totalChunks=Math.ceil(this.chunkCount+o)}return!0})(t):zd(t,r)?(async n=>(this.dispatch("error",{message:`Server responded with ${n.statusCode}. Stopping upload.`,chunk:this.chunkCount,attempts:this.attemptCount}),!1))(t):(async()=>(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(n=>{setTimeout(async()=>{if(this._paused||this.offline)return this.pendingChunk=e,void n(!1);let s=await this.sendChunkWithRetries(e);n(s)},1e3*this.delayBeforeAttempt)})))()}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(),r=!e&&t;if(e&&(r=await this.sendChunkWithRetries(e)),this.success=!!t,this.success&&r&&this.dispatch("success"),!r)return}}},jd=Sl.createUpload,Wd=Object.defineProperty,R=(e,t,r)=>((n,s,i)=>s in n?Wd(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r),Vd=Object.defineProperty,Eo=(e,t,r)=>((n,s,i)=>s in n?Vd(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r),me=(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",e))(me||{});const xo={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ro={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ir={};function Ui(e){if(Ir[e])return Ir[e];const t=globalThis[e],r=t.prototype,n=e in xo?xo[e]:void 0,s=!!(n&&n.every(o=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,o))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in Ro?Ro[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return Ir[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?Ir[e]=c:r}catch{return r}}const es={};function et(e,t,r){var n;const s=`${e}.${String(r)}`;if(es[s])return es[s].call(t);const i=Ui(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(es[s]=a,a.call(t)):t[r]}const ts={};function Lo(e,t,r){const n=`${e}.${String(r)}`;if(ts[n])return ts[n].bind(t);const s=Ui(e)[r];return typeof s!="function"?t[r]:(ts[n]=s,s.bind(t))}const ye={childNodes:function(e){return et("Node",e,"childNodes")},parentNode:function(e){return et("Node",e,"parentNode")},parentElement:function(e){return et("Node",e,"parentElement")},textContent:function(e){return et("Node",e,"textContent")},contains:function(e,t){return Lo("Node",e,"contains")(t)},getRootNode:function(e){return Lo("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?et("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?et("Element",e,"shadowRoot"):null},querySelector:function(e,t){return et("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return et("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ui("MutationObserver").constructor}};function Il(e){return e.nodeType===e.ELEMENT_NODE}function Xt(e){const t=e&&"host"in e&&"mode"in e&&ye.host(e)||null;return!!(t&&"shadowRoot"in t&&ye.shadowRoot(t)===e)}function Zt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function qr(e){try{const r=e.rules||e.cssRules;return r?((t=Array.from(r,s=>Cl(s,e.href)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch{return null}var t}function Cl(e,t){if(function(r){return"styleSheet"in r}(e)){let r;try{r=qr(e.styleSheet)||function(n){const{cssText:s}=n;if(s.split('"').length<3)return s;const i=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?i.push("layer"):n.layerName&&i.push(`layer(${n.layerName})`),n.supportsText&&i.push(`supports(${n.supportsText})`),n.media.length&&i.push(n.media.mediaText),i.join(" ")+";"}(e)}catch{r=e.cssText}return e.styleSheet.href?wn(r,e.styleSheet.href):r}{let r=e.cssText;return function(n){return"selectorText"in n}(e)&&e.selectorText.includes(":")&&(r=function(n){const s=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(s,"$1\\$2")}(r)),t?wn(r,t):r}}class kl{constructor(){Eo(this,"idNodeMap",new Map),Eo(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ti({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let a=s||"";const o=n&&ht(n);return(t[r.toLowerCase()]||o&&t[o])&&(a=i?i(a,e):"*".repeat(a.length)),a}function ht(e){return e.toLowerCase()}const Oo="__rrweb_original__";function Di(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ht(t):null}function Ao(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(n==null?void 0:n[1])??null}const Hd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Gd=/^(?:[a-z+]+:)?\/\//i,$d=/^www\..*/i,Yd=/^(data:)([^,]*),(.*)/i;function wn(e,t){return(e||"").replace(Hd,(r,n,s,i,a,o)=>{const l=s||a||o,c=n||i||"";if(!l)return r;if(Gd.test(l)||$d.test(l))return`url(${c}${l}${c})`;if(Yd.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${function(d){let f="";return f=d.indexOf("//")>-1?d.split("/").slice(0,3).join("/"):d.split("/")[0],f=f.split("?")[0],f}(t)+l}${c})`;const u=t.split("/"),p=l.split("/");u.pop();for(const d of p)d!=="."&&(d===".."?u.pop():u.push(d));return`url(${c}${u.join("/")}${c})`})}let Jd=1;const qd=new RegExp("[^a-z0-9-_:]");function El(){return Jd++}let bt,Mo;const Xd=/^[^ \t\n\r\u000c]+/,Zd=/^[, \t\n\r\u000c]+/,Uo=new WeakMap;function Nt(e,t){return t&&t.trim()!==""?Pi(e,t):t}function Kd(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Pi(e,t){let r=Uo.get(e);if(r||(r=e.createElement("a"),Uo.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function xl(e,t,r,n){return n&&(r==="src"||r==="href"&&(t!=="use"||n[0]!=="#")||r==="xlink:href"&&n[0]!=="#"?Nt(e,n):r!=="background"||t!=="table"&&t!=="td"&&t!=="th"?r==="srcset"?function(s,i){if(i.trim()==="")return i;let a=0;function o(c){let u;const p=c.exec(i.substring(a));return p?(u=p[0],a+=u.length,u):""}const l=[];for(;o(Zd),!(a>=i.length);){let c=o(Xd);if(c.slice(-1)===",")c=Nt(s,c.substring(0,c.length-1)),l.push(c);else{let u="";c=Nt(s,c);let p=!1;for(;;){const d=i.charAt(a);if(d===""){l.push((c+u).trim());break}if(p)d===")"&&(p=!1);else{if(d===","){a+=1,l.push((c+u).trim());break}d==="("&&(p=!0)}u+=d,a+=1}}}return l.join(", ")}(e,n):r==="style"?wn(n,Pi(e)):t==="object"&&r==="data"?Nt(e,n):n:Nt(e,n))}function Rl(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function vn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&vn(ye.parentNode(e),t,r);for(let n=e.classList.length;n--;){const s=e.classList[n];if(t.test(s))return!0}return!!r&&vn(ye.parentNode(e),t,r)}function Ll(e,t,r,n){let s;if(Il(e)){if(s=e,!ye.childNodes(s).length)return!1}else{if(ye.parentElement(e)===null)return!1;s=ye.parentElement(e)}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(vn(s,t,n))return!0;if(r){if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}}catch{}return!1}function Qd(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:a,inlineStylesheet:o,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:h=!1}=t,I=function(m,g){if(!g.hasNode(m))return;const v=g.getId(m);return v===1?void 0:v}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:me.Document,childNodes:[],compatMode:e.compatMode}:{type:me.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:me.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return function(m,g){const{doc:v,blockClass:C,blockSelector:A,inlineStylesheet:x,maskInputOptions:U={},maskInputFn:M,dataURLOptions:k={},inlineImages:E,recordCanvas:L,keepIframeSrcFn:S,newlyAddedElement:_=!1,rootId:D}=g,b=function(O,N,ee){try{if(typeof N=="string"){if(O.classList.contains(N))return!0}else for(let J=O.classList.length;J--;){const W=O.classList[J];if(N.test(W))return!0}if(ee)return O.matches(ee)}catch{}return!1}(m,C,A),w=function(O){if(O instanceof HTMLFormElement)return"form";const N=ht(O.tagName);return qd.test(N)?"div":N}(m);let T={};const F=m.attributes.length;for(let O=0;O<F;O++){const N=m.attributes[O];Rl(w,N.name,N.value)||(T[N.name]=xl(v,w,ht(N.name),N.value))}if(w==="link"&&x){const O=Array.from(v.styleSheets).find(ee=>ee.href===m.href);let N=null;O&&(N=qr(O)),N&&(delete T.rel,delete T.href,T._cssText=N)}if(w==="style"&&m.sheet&&!(m.innerText||ye.textContent(m)||"").trim().length){const O=qr(m.sheet);O&&(T._cssText=O)}if(w==="input"||w==="textarea"||w==="select"){const O=m.value,N=m.checked;T.type!=="radio"&&T.type!=="checkbox"&&T.type!=="submit"&&T.type!=="button"&&O?T.value=Ti({element:m,type:Di(m),tagName:w,value:O,maskInputOptions:U,maskInputFn:M}):N&&(T.checked=N)}if(w==="option"&&(m.selected&&!U.select?T.selected=!0:delete T.selected),w==="dialog"&&m.open&&(T.rr_open_mode=m.matches("dialog:modal")?"modal":"non-modal"),w==="canvas"&&L){if(m.__context==="2d")(function(O){const N=O.getContext("2d");if(!N)return!0;for(let ee=0;ee<O.width;ee+=50)for(let J=0;J<O.height;J+=50){const W=N.getImageData,we=Oo in W?W[Oo]:W;if(new Uint32Array(we.call(N,ee,J,Math.min(50,O.width-ee),Math.min(50,O.height-J)).data.buffer).some(fe=>fe!==0))return!1}return!0})(m)||(T.rr_dataURL=m.toDataURL(k.type,k.quality));else if(!("__context"in m)){const O=m.toDataURL(k.type,k.quality),N=v.createElement("canvas");N.width=m.width,N.height=m.height,O!==N.toDataURL(k.type,k.quality)&&(T.rr_dataURL=O)}}if(w==="img"&&E){bt||(bt=v.createElement("canvas"),Mo=bt.getContext("2d"));const O=m,N=O.currentSrc||O.getAttribute("src")||"<unknown-src>",ee=O.crossOrigin,J=()=>{O.removeEventListener("load",J);try{bt.width=O.naturalWidth,bt.height=O.naturalHeight,Mo.drawImage(O,0,0),T.rr_dataURL=bt.toDataURL(k.type,k.quality)}catch(W){if(O.crossOrigin!=="anonymous")return O.crossOrigin="anonymous",void(O.complete&&O.naturalWidth!==0?J():O.addEventListener("load",J));console.warn(`Cannot inline img src=${N}! Error: ${W}`)}O.crossOrigin==="anonymous"&&(ee?T.crossOrigin=ee:O.removeAttribute("crossorigin"))};O.complete&&O.naturalWidth!==0?J():O.addEventListener("load",J)}if(w==="audio"||w==="video"){const O=T;O.rr_mediaState=m.paused?"paused":"played",O.rr_mediaCurrentTime=m.currentTime,O.rr_mediaPlaybackRate=m.playbackRate,O.rr_mediaMuted=m.muted,O.rr_mediaLoop=m.loop,O.rr_mediaVolume=m.volume}if(_||(m.scrollLeft&&(T.rr_scrollLeft=m.scrollLeft),m.scrollTop&&(T.rr_scrollTop=m.scrollTop)),b){const{width:O,height:N}=m.getBoundingClientRect();T={class:T.class,rr_width:`${O}px`,rr_height:`${N}px`}}w!=="iframe"||S(T.src)||(m.contentDocument||(T.rr_src=T.src),delete T.src);let j;try{customElements.get(w)&&(j=!0)}catch{}return{type:me.Element,tagName:w,attributes:T,childNodes:[],isSVG:Kd(m)||void 0,needBlock:b,rootId:D,isCustom:j}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:d,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:h,rootId:I});case e.TEXT_NODE:return function(m,g){var v;const{needsMask:C,maskTextFn:A,rootId:x}=g,U=ye.parentNode(m),M=U&&U.tagName;let k=ye.textContent(m);const E=M==="STYLE"||void 0,L=M==="SCRIPT"||void 0;if(E&&k){try{m.nextSibling||m.previousSibling||(v=U.sheet)!=null&&v.cssRules&&(k=qr(U.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,m)}k=wn(k,Pi(g.doc))}return L&&(k="SCRIPT_PLACEHOLDER"),!E&&!L&&k&&C&&(k=A?A(k,ye.parentElement(m)):k.replace(/[\S]/g,"*")),{type:me.Text,textContent:k||"",isStyle:E,rootId:x}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:I});case e.CDATA_SECTION_NODE:return{type:me.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:me.Comment,textContent:ye.textContent(e)||"",rootId:I};default:return!1}}function te(e){return e==null?"":e.toLowerCase()}function Et(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:y={},inlineImages:h=!1,recordCanvas:I=!1,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:U=!1}=t;let{needsMask:M}=t,{preserveWhiteSpace:k=!0}=t;M||(M=Ll(e,a,o,M===void 0));const E=Qd(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,dataURLOptions:y,inlineImages:h,recordCanvas:I,keepIframeSrcFn:x,newlyAddedElement:U});if(!E)return console.warn(e,"not serialized"),null;let L;L=n.hasNode(e)?n.getId(e):!function(b,w){return!!(w.comment&&b.type===me.Comment||b.type===me.Element&&(w.script&&(b.tagName==="script"||b.tagName==="link"&&(b.attributes.rel==="preload"||b.attributes.rel==="modulepreload")&&b.attributes.as==="script"||b.tagName==="link"&&b.attributes.rel==="prefetch"&&typeof b.attributes.href=="string"&&Ao(b.attributes.href)==="js")||w.headFavicon&&(b.tagName==="link"&&b.attributes.rel==="shortcut icon"||b.tagName==="meta"&&(te(b.attributes.name).match(/^msapplication-tile(image|color)$/)||te(b.attributes.name)==="application-name"||te(b.attributes.rel)==="icon"||te(b.attributes.rel)==="apple-touch-icon"||te(b.attributes.rel)==="shortcut icon"))||b.tagName==="meta"&&(w.headMetaDescKeywords&&te(b.attributes.name).match(/^description|keywords$/)||w.headMetaSocial&&(te(b.attributes.property).match(/^(og|twitter|fb):/)||te(b.attributes.name).match(/^(og|twitter):/)||te(b.attributes.name)==="pinterest")||w.headMetaRobots&&(te(b.attributes.name)==="robots"||te(b.attributes.name)==="googlebot"||te(b.attributes.name)==="bingbot")||w.headMetaHttpEquiv&&b.attributes["http-equiv"]!==void 0||w.headMetaAuthorship&&(te(b.attributes.name)==="author"||te(b.attributes.name)==="generator"||te(b.attributes.name)==="framework"||te(b.attributes.name)==="publisher"||te(b.attributes.name)==="progid"||te(b.attributes.property).match(/^article:/)||te(b.attributes.property).match(/^product:/))||w.headMetaVerification&&(te(b.attributes.name)==="google-site-verification"||te(b.attributes.name)==="yandex-verification"||te(b.attributes.name)==="csrf-token"||te(b.attributes.name)==="p:domain_verify"||te(b.attributes.name)==="verify-v1"||te(b.attributes.name)==="verification"||te(b.attributes.name)==="shopify-checkout-api-token"))))}(E,f)&&(k||E.type!==me.Text||E.isStyle||E.textContent.replace(/^\s+|\s+$/gm,"").length)?El():-2;const S=Object.assign(E,{id:L});if(n.add(e,S),L===-2)return null;m&&m(e);let _=!l;if(S.type===me.Element){_=_&&!S.needBlock,delete S.needBlock;const b=ye.shadowRoot(e);b&&Zt(b)&&(S.isShadowHost=!0)}if((S.type===me.Document||S.type===me.Element)&&_){f.headWhitespace&&S.type===me.Element&&S.tagName==="head"&&(k=!1);const b={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:x};if(!(S.type===me.Element&&S.tagName==="textarea"&&S.attributes.value!==void 0))for(const T of Array.from(ye.childNodes(e))){const F=Et(T,b);F&&S.childNodes.push(F)}let w=null;if(Il(e)&&(w=ye.shadowRoot(e)))for(const T of Array.from(ye.childNodes(w))){const F=Et(T,b);F&&(Zt(w)&&(F.isShadow=!0),S.childNodes.push(F))}}const D=ye.parentNode(e);return D&&Xt(D)&&Zt(D)&&(S.isShadow=!0),S.type===me.Element&&S.tagName==="iframe"&&function(b,w,T){const F=b.contentWindow;if(!F)return;let j,O=!1;try{j=F.document.readyState}catch{return}if(j!=="complete"){const ee=setTimeout(()=>{O||(w(),O=!0)},T);return void b.addEventListener("load",()=>{clearTimeout(ee),O=!0,w()})}const N="about:blank";if(F.location.href!==N||b.src===N||b.src==="")return setTimeout(w,0),b.addEventListener("load",w);b.addEventListener("load",w)}(e,()=>{const b=e.contentDocument;if(b&&g){const w=Et(b,{doc:b,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:x});w&&g(e,w)}},v),S.type===me.Element&&S.tagName==="link"&&typeof S.attributes.rel=="string"&&(S.attributes.rel==="stylesheet"||S.attributes.rel==="preload"&&typeof S.attributes.href=="string"&&Ao(S.attributes.href)==="css")&&function(b,w,T){let F,j=!1;try{F=b.sheet}catch{return}if(F)return;const O=setTimeout(()=>{j||(w(),j=!0)},T);b.addEventListener("load",()=>{clearTimeout(O),j=!0,w()})}(e,()=>{if(C){const b=Et(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:x});b&&C(e,b)}},A),S}function ep(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tp(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var xs={exports:{}},se=String,To=function(){return{isColorSupported:!1,reset:se,bold:se,dim:se,italic:se,underline:se,inverse:se,hidden:se,strikethrough:se,black:se,red:se,green:se,yellow:se,blue:se,magenta:se,cyan:se,white:se,gray:se,bgBlack:se,bgRed:se,bgGreen:se,bgYellow:se,bgBlue:se,bgMagenta:se,bgCyan:se,bgWhite:se}};xs.exports=To(),xs.exports.createColors=To;var rp=xs.exports;const _e=tp(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Do=rp,Po=_e,Rs=class Ol extends Error{constructor(t,r,n,s,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),a&&(this.plugin=a),r!==void 0&&n!==void 0&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ol)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=Do.isColorSupported),Po&&t&&(r=Po(r));let n,s,i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),l=String(o).length;if(t){let{bold:c,gray:u,red:p}=Do.createColors(!0);n=d=>c(p(d)),s=d=>u(d)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let p=a+1+u,d=" "+(" "+p).slice(-l)+" | ";if(p===this.line){let f=s(d.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(d)+c+`
4
- `+f+n("^")}return" "+s(d)+c}).join(`
5
- `)}toString(){let t=this.showSourceCode();return t&&(t=`
6
-
7
- `+t+`
8
- `),this.name+": "+this.message+t}};var _i=Rs;Rs.default=Rs;var sr={};sr.isClean=Symbol("isClean"),sr.my=Symbol("my");const _o={after:`
9
- `,beforeClose:`
10
- `,beforeComment:`
11
- `,beforeDecl:`
12
- `,beforeOpen:" ",beforeRule:`
13
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ls=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(e.raws.afterName!==void 0?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r=e.type==="decl"?this.raw(e,null,"beforeDecl"):e.type==="comment"?this.raw(e,null,"beforeComment"):t==="before"?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&n.type!=="root";)s+=1,n=n.parent;if(r.includes(`
14
- `)){let i=this.raw(e,null,"indent");if(i.length)for(let a=0;a<s;a++)r+=i}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],n!==void 0))return n;let s=e.parent;if(r==="before"&&(!s||s.type==="root"&&s.first===e||s&&s.type==="document"))return"";if(!s)return _o[r];let i=e.root();if(i.rawCache||(i.rawCache={}),i.rawCache[r]!==void 0)return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let o="raw"+((a=r)[0].toUpperCase()+a.slice(1));this[o]?n=this[o](i,e):i.walk(l=>{if(n=l.raws[t],n!==void 0)return!1})}var a;return n===void 0&&(n=_o[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&r.raws.after!==void 0)return t=r.raws.after,t.includes(`
15
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
16
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
17
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&r.raws.before!==void 0)return t=r.raws.before,t.includes(`
18
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(r.raws.between!==void 0)return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&r.raws.before!==void 0){let s=r.raws.before.split(`
19
- `);return t=s[s.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Al=Ls;Ls.default=Ls;let np=Al;function Os(e,t){new np(t).stringify(e)}var Nn=Os;Os.default=Os;let{isClean:Cr,my:sp}=sr,ip=_i,op=Al,ap=Nn;function As(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let s=e[n],i=typeof s;n==="parent"&&i==="object"?t&&(r[n]=t):n==="source"?r[n]=s:Array.isArray(s)?r[n]=s.map(a=>As(a,r)):(i==="object"&&s!==null&&(s=As(s)),r[n]=s)}return r}let Ms=class{constructor(e={}){this.raws={},this[Cr]=!1,this[sp]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=As(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new ip(e)}getProxyProcessor(){return{get:(e,t)=>t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,t!=="prop"&&t!=="value"&&t!=="name"&&t!=="params"&&t!=="important"&&t!=="text"||e.markDirty()),!0)}}markDirty(){if(this[Cr]){this[Cr]=!1;let e=this;for(;e=e.parent;)e[Cr]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
20
- `?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);s!==-1&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new op().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},n=t==null;t=t||new Map;let s=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let a=this[i];if(Array.isArray(a))r[i]=a.map(o=>typeof o=="object"&&o.toJSON?o.toJSON(null,t):o);else if(typeof a=="object"&&a.toJSON)r[i]=a.toJSON(null,t);else if(i==="source"){let o=t.get(a.input);o==null&&(o=s,t.set(a.input,s),s++),r[i]={end:a.end,inputId:o,start:a.start}}else r[i]=a}return n&&(r.inputs=[...t.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ap){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Fn=Ms;Ms.default=Ms;let lp=Fn,Us=class extends lp{constructor(e){e&&e.value!==void 0&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Bn=Us;Us.default=Us;var cp={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:No,SourceMapGenerator:Fo}=_e,{existsSync:up,readFileSync:dp}=_e,{dirname:rs,join:pp}=_e,Ts=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=rs(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new No(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e=="object"&&(typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=rs(e),up(e))return this.mapFile=e,dp(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t!="function"){if(t instanceof No)return Fo.fromSourceMap(t).toString();if(t instanceof Fo)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=pp(rs(e),r)),this.loadFile(r)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Ml=Ts;Ts.default=Ts;let{SourceMapConsumer:hp,SourceMapGenerator:mp}=_e,{fileURLToPath:Bo,pathToFileURL:kr}=_e,{isAbsolute:Ds,resolve:Ps}=_e,{nanoid:fp}=cp,ns=_e,zo=_i,gp=Ml,ss=Symbol("fromOffsetCache"),yp=!!(hp&&mp),jo=!!(Ps&&Ds),Xr=class{constructor(e,t={}){if(e==null||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!jo||/^\w+:\/\//.test(t.from)||Ds(t.from)?this.file=t.from:this.file=Ps(t.from)),jo&&yp){let r=new gp(this.css,t);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+fp(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,a;if(t&&typeof t=="object"){let l=t,c=r;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);t=u.line,r=u.col}else t=l.line,r=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);i=u.line,a=u.col}else i=c.line,a=c.column}else if(!r){let l=this.fromOffset(t);t=l.line,r=l.col}let o=this.origin(t,r,i,a);return s=o?new zo(e,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,n.plugin):new zo(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:a,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(kr&&(s.input.url=kr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[ss])r=this[ss];else{let s=this.css.split(`
21
- `);r=new Array(s.length);let i=0;for(let a=0,o=s.length;a<o;a++)r[a]=i,i+=s[a].length+1;this[ss]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let s,i=r.length-2;for(;n<i;)if(s=n+(i-n>>1),e<r[s])i=s-1;else{if(!(e>=r[s+1])){n=s;break}n=s+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ps(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;typeof r=="number"&&(s=a.originalPositionFor({column:n,line:r})),i=Ds(o.source)?kr(o.source):new URL(o.source,this.map.consumer().sourceRoot||kr(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!Bo)throw new Error("file: protocol is not available in this PostCSS build");l.file=Bo(i)}let c=a.sourceContentFor(o.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var zn=Xr;Xr.default=Xr,ns&&ns.registerInput&&ns.registerInput(Xr);let{SourceMapConsumer:Ul,SourceMapGenerator:Zr}=_e,{dirname:Kr,relative:Tl,resolve:Dl,sep:Pl}=_e,{pathToFileURL:Wo}=_e,wp=zn,vp=!!(Ul&&Zr),bp=!!(Kr&&Dl&&Tl&&Pl);var _l=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t=`
22
- `;this.css.includes(`\r
23
- `)&&(t=`\r
24
- `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Kr(e.file);this.mapOpts.sourcesContent===!1?(t=new Ul(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),bp&&vp&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Zr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Zr({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Zr({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(a,o,l)=>{if(this.css+=a,o&&l!=="end"&&(i.generated.line=r,i.generated.column=n-1,o.source&&o.source.start?(i.source=this.sourcePath(o),i.original.line=o.source.start.line,i.original.column=o.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=a.match(/\n/g),e?(r+=e.length,t=a.lastIndexOf(`
25
- `),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Kr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Kr(Dl(r,this.mapOpts.annotation)));let n=Tl(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new wp(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Wo){let r=Wo(e).toString();return this.memoizedFileURLs.set(e,r),r}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Pl==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Sp=Fn,_s=class extends Sp{constructor(e){super(e),this.type="comment"}};var jn=_s;_s.default=_s;let Nl,Ni,Fi,Fl,{isClean:Bl,my:zl}=sr,jl=Bn,Wl=jn,Ip=Fn;function Vl(e){return e.map(t=>(t.nodes&&(t.nodes=Vl(t.nodes)),delete t.source,t))}function Hl(e){if(e[Bl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Hl(t)}let Ze=class Gl extends Ip{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let s of n)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r,n,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],n=t(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get:(t,r)=>r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(s=>typeof s=="function"?(i,a)=>s(i.toProxy(),a):s)):r==="every"||r==="some"?n=>t[r]((s,...i)=>n(s.toProxy(),...i)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r],set:(t,r,n)=>(t[r]===n||(t[r]=n,r!=="name"&&r!=="params"&&r!=="selector"||t.markDirty()),!0)}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n,s=this.index(t),i=this.normalize(r,this.proxyOf.nodes[s]).reverse();s=this.index(t);for(let a of i)this.proxyOf.nodes.splice(s+1,0,a);for(let a in this.indexes)n=this.indexes[a],s<n&&(this.indexes[a]=n+i.length);return this.markDirty(),this}insertBefore(t,r){let n,s=this.index(t),i=s===0&&"prepend",a=this.normalize(r,this.proxyOf.nodes[s],i).reverse();s=this.index(t);for(let o of a)this.proxyOf.nodes.splice(s,0,o);for(let o in this.indexes)n=this.indexes[o],s<=n&&(this.indexes[o]=n+a.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=Vl(Nl(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new jl(t)]}else if(t.selector)t=[new Ni(t)];else if(t.name)t=[new Fi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Wl(t)]}return t.map(n=>(n[zl]||Gl.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[Bl]&&Hl(n),n.raws.before===void 0&&r&&r.raws.before!==void 0&&(n.raws.before=r.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let r;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(s=>{r.props&&!r.props.includes(s.prop)||r.fast&&!s.value.includes(r.fast)||(s.value=s.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let s;try{s=t(r,n)}catch(i){throw r.addToError(i)}return s!==!1&&r.walk&&(s=r.walk(t)),s})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="atrule")return r(n,s)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="decl")return r(n,s)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="rule")return r(n,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ze.registerParse=e=>{Nl=e},Ze.registerRule=e=>{Ni=e},Ze.registerAtRule=e=>{Fi=e},Ze.registerRoot=e=>{Fl=e};var ft=Ze;Ze.default=Ze,Ze.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Fi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ni.prototype):e.type==="decl"?Object.setPrototypeOf(e,jl.prototype):e.type==="comment"?Object.setPrototypeOf(e,Wl.prototype):e.type==="root"&&Object.setPrototypeOf(e,Fl.prototype),e[zl]=!0,e.nodes&&e.nodes.forEach(t=>{Ze.rebuild(t)})};let $l,Yl,Cp=ft,ir=class extends Cp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new $l(new Yl,this,e).stringify()}};ir.registerLazyResult=e=>{$l=e},ir.registerProcessor=e=>{Yl=e};var Bi=ir;ir.default=ir;let Ns=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Jl=Ns;Ns.default=Ns;let kp=Jl,Fs=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new kp(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var zi=Fs;Fs.default=Fs;const is=39,Vo=34,Er=92,Ho=47,xr=10,Ft=32,Rr=12,Lr=9,Or=13,Ep=91,xp=93,Rp=40,Lp=41,Op=123,Ap=125,Mp=59,Up=42,Tp=58,Dp=64,Ar=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Pp=/.[\r\n"'(/\\]/,Go=/[\da-f]/i;let ql=ft,Qr=class extends ql{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ji=Qr;Qr.default=Qr,ql.registerAtRule(Qr);let Xl,Zl,Kl=ft,Ot=class extends Kl{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let s of n)s.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Xl(new Zl,this,e).stringify()}};Ot.registerLazyResult=e=>{Xl=e},Ot.registerProcessor=e=>{Zl=e};var gr=Ot;Ot.default=Ot,Kl.registerRoot(Ot);let or={comma:e=>or.split(e,[","],!0),space:e=>or.split(e,[" ",`
26
- `," "]),split(e,t,r){let n=[],s="",i=!1,a=0,o=!1,l="",c=!1;for(let u of e)c?c=!1:u==="\\"?c=!0:o?u===l&&(o=!1):u==='"'||u==="'"?(o=!0,l=u):u==="("?a+=1:u===")"?a>0&&(a-=1):a===0&&t.includes(u)&&(i=!0),i?(s!==""&&n.push(s.trim()),s="",i=!1):s+=u;return(r||s!=="")&&n.push(s.trim()),n}};var Ql=or;or.default=or;let ec=ft,_p=Ql,en=class extends ec{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return _p.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Wi=en;en.default=en,ec.registerRule(en);let Np=Bn,Fp=function(e,t={}){let r,n,s,i,a,o,l,c,u,p,d=e.css.valueOf(),f=t.ignoreErrors,y=d.length,h=0,I=[],m=[];function g(v){throw e.error("Unclosed "+v,h)}return{back:function(v){m.push(v)},endOfFile:function(){return m.length===0&&h>=y},nextToken:function(v){if(m.length)return m.pop();if(h>=y)return;let C=!!v&&v.ignoreUnclosed;switch(r=d.charCodeAt(h),r){case xr:case Ft:case Lr:case Or:case Rr:n=h;do n+=1,r=d.charCodeAt(n);while(r===Ft||r===xr||r===Lr||r===Or||r===Rr);p=["space",d.slice(h,n)],h=n-1;break;case Ep:case xp:case Op:case Ap:case Tp:case Mp:case Lp:{let A=String.fromCharCode(r);p=[A,A,h];break}case Rp:if(c=I.length?I.pop()[1]:"",u=d.charCodeAt(h+1),c==="url"&&u!==is&&u!==Vo&&u!==Ft&&u!==xr&&u!==Lr&&u!==Rr&&u!==Or){n=h;do{if(o=!1,n=d.indexOf(")",n+1),n===-1){if(f||C){n=h;break}g("bracket")}for(l=n;d.charCodeAt(l-1)===Er;)l-=1,o=!o}while(o);p=["brackets",d.slice(h,n+1),h,n],h=n}else n=d.indexOf(")",h+1),i=d.slice(h,n+1),n===-1||Pp.test(i)?p=["(","(",h]:(p=["brackets",i,h,n],h=n);break;case is:case Vo:s=r===is?"'":'"',n=h;do{if(o=!1,n=d.indexOf(s,n+1),n===-1){if(f||C){n=h+1;break}g("string")}for(l=n;d.charCodeAt(l-1)===Er;)l-=1,o=!o}while(o);p=["string",d.slice(h,n+1),h,n],h=n;break;case Dp:Ar.lastIndex=h+1,Ar.test(d),n=Ar.lastIndex===0?d.length-1:Ar.lastIndex-2,p=["at-word",d.slice(h,n+1),h,n],h=n;break;case Er:for(n=h,a=!0;d.charCodeAt(n+1)===Er;)n+=1,a=!a;if(r=d.charCodeAt(n+1),a&&r!==Ho&&r!==Ft&&r!==xr&&r!==Lr&&r!==Or&&r!==Rr&&(n+=1,Go.test(d.charAt(n)))){for(;Go.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Ft&&(n+=1)}p=["word",d.slice(h,n+1),h,n],h=n;break;default:r===Ho&&d.charCodeAt(h+1)===Up?(n=d.indexOf("*/",h+2)+1,n===0&&(f||C?n=d.length:g("comment")),p=["comment",d.slice(h,n+1),h,n],h=n):(Mr.lastIndex=h+1,Mr.test(d),n=Mr.lastIndex===0?d.length-1:Mr.lastIndex-2,p=["word",d.slice(h,n+1),h,n],I.push(p),h=n)}return h++,p},position:function(){return h}}},Bp=jn,zp=ji,jp=gr,$o=Wi;const Yo={empty:!0,space:!0};var Wp=class{constructor(e){this.input=e,this.root=new jp,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new zp;s.name=e[1].slice(1),s.name===""&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,a=!1,o=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],t==="("||t==="["?l.push(t==="("?")":"]"):t==="{"&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),l.length===0){if(t===";"){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if(t==="{"){a=!0;break}if(t==="}"){if(o.length>0){for(n=o.length-1,r=o[n];r&&r[0]==="space";)r=o[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}o.push(e)}else o.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(o),o.length?(s.raws.afterName=this.spacesAndCommentsFromStart(o),this.raw(s,"params",o),i&&(e=o[o.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),a&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],r[0]==="space"||(n+=1,n!==2));s--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,a]of e.entries()){if(t=a,r=t[0],r==="("&&(s+=1),r===")"&&(s-=1),s===0&&r===":"){if(n){if(n[0]==="word"&&n[1]==="progid")continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Bp;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=Fp(this.input)}decl(e,t){let r=new Np;this.init(r,e[0][2]);let n,s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(o){for(let l=o.length-1;l>=0;l--){let c=o[l],u=c[3]||c[2];if(u)return u}}(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let o=e[0][0];if(o===":"||o==="space"||o==="comment")break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}r.prop[0]!=="_"&&r.prop[0]!=="*"||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],i==="space"||i==="comment");)a.push(e.shift());this.precheckMissedSemicolon(e);for(let o=e.length-1;o>=0;o--){if(n=e[o],n[1].toLowerCase()==="!important"){r.important=!0;let l=this.stringFrom(e,o);l=this.spacesFromEnd(e)+l,l!==" !important"&&(r.raws.important=l);break}if(n[1].toLowerCase()==="important"){let l=e.slice(0),c="";for(let u=o;u>0;u--){let p=l[u][0];if(c.trim().indexOf("!")===0&&p!=="space")break;c=l.pop()[1]+c}c.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=c,e=l)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(o=>o[0]!=="space"&&o[0]!=="comment")&&(r.raws.between+=a.map(o=>o[1]).join(""),a=[]),this.raw(r,"value",a.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new $o;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,s=null,i=[],a=e[1].startsWith("--"),o=[],l=e;for(;l;){if(r=l[0],o.push(l),r==="("||r==="[")s||(s=l),i.push(r==="("?")":"]");else if(a&&n&&r==="{")s||(s=l),i.push("}");else if(i.length===0){if(r===";"){if(n)return void this.decl(o,a);break}if(r==="{")return void this.rule(o);if(r==="}"){this.tokenizer.back(o.pop()),t=!0;break}r===":"&&(n=!0)}else r===i[i.length-1]&&(i.pop(),i.length===0&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!a)for(;o.length&&(l=o[o.length-1][0],l==="space"||l==="comment");)this.tokenizer.back(o.pop());this.decl(o,a)}else this.unknownWord(o)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let s,i,a,o,l=r.length,c="",u=!0;for(let p=0;p<l;p+=1)s=r[p],i=s[0],i!=="space"||p!==l-1||n?i==="comment"?(o=r[p-1]?r[p-1][0]:"empty",a=r[p+1]?r[p+1][0]:"empty",Yo[o]||Yo[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let p=r.reduce((d,f)=>d+f[1],"");e.raws[t]={raw:p,value:c}}e[t]=c}rule(e){e.pop();let t=new $o;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space"||t==="comment");)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],t==="space"||t==="comment");)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Vp=ft,Hp=Wp,Gp=zn;function tn(e,t){let r=new Gp(e,t),n=new Hp(r);try{n.parse()}catch(s){throw s}return n.root}var Vi=tn;tn.default=tn,Vp.registerParse(tn);let{isClean:Fe,my:$p}=sr,Yp=_l,Jp=Nn,qp=ft,Xp=Bi,Jo=zi,Zp=Vi,Kp=gr;const Qp={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},eh={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},th={Once:!0,postcssPlugin:!0,prepare:!0};function Bt(e){return typeof e=="object"&&typeof e.then=="function"}function tc(e){let t=!1,r=Qp[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function qo(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:tc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Bs(e){return e[Fe]=!1,e.nodes&&e.nodes.forEach(t=>Bs(t)),e}let zs={},xt=class rc{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,typeof r!="object"||r===null||r.type!=="root"&&r.type!=="document")if(r instanceof rc||r instanceof Jo)s=Bs(r.root),r.map&&(n.map===void 0&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let i=Zp;n.syntax&&(i=n.syntax.parse),n.parser&&(i=n.parser),i.parse&&(i=i.parse);try{s=i(r,n)}catch(a){this.processed=!0,this.error=a}s&&!s[$p]&&qp.rebuild(s)}else s=Bs(r);this.result=new Jo(t,s,n),this.helpers={...zs,postcss:zs,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{r&&r.addToError(t),this.error=t,t.name!=="CssSyntaxError"||t.plugin?n.postcssVersion:(t.plugin=n.postcssPlugin,t.setMessage())}catch(s){console&&console.error&&console.error(s)}return t}prepareVisitors(){this.listeners={};let t=(r,n,s)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,s])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!eh[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!th[n])if(typeof r[n]=="object")for(let s in r[n])t(r,s==="*"?n:n+"-"+s.toLowerCase(),r[n][s]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(Bt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Fe];){t[Fe]=!0;let r=[qo(t)];for(;r.length>0;){let n=this.visitTick(r);if(Bt(n))try{await n}catch(s){let i=r[r.length-1].node;throw this.handleError(s,i)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let s=t.nodes.map(i=>n(i,this.helpers));await Promise.all(s)}else await n(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return Bt(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=Jp;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new Yp(r,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins)if(Bt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Fe];)t[Fe]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Bt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[Fe])return a[Fe]=!0,void t.push(qo(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[Fe]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Fe]=!0;let r=tc(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Fe]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};xt.registerPostcss=e=>{zs=e};var nc=xt;xt.default=xt,Kp.registerLazyResult(xt),Xp.registerLazyResult(xt);let rh=_l,nh=Nn,sh=Vi;const ih=zi;let js=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=nh;this.result=new ih(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new rh(s,n,this._opts,t);if(a.isMap()){let[o,l]=a.generate();o&&(this.result.css=o),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=sh;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var oh=js;js.default=js;let ah=oh,lh=nc,ch=Bi,uh=gr,Vt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r!="object"||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new lh(this,e,t):new ah(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var dh=Vt;Vt.default=Vt,uh.registerProcessor(Vt),ch.registerProcessor(Vt);let ph=Bn,hh=Ml,mh=jn,fh=ji,gh=zn,yh=gr,wh=Wi;function ar(e,t){if(Array.isArray(e))return e.map(s=>ar(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:gh.prototype};i.map&&(i.map={...i.map,__proto__:hh.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>ar(s,t))),n.source){let{inputId:s,...i}=n.source;n.source=i,s!=null&&(n.source.input=t[s])}if(n.type==="root")return new yh(n);if(n.type==="decl")return new ph(n);if(n.type==="rule")return new wh(n);if(n.type==="comment")return new mh(n);if(n.type==="atrule")return new fh(n);throw new Error("Unknown node type: "+e.type)}var vh=ar;ar.default=ar;let bh=_i,Xo=Bn,Sh=nc,Ih=ft,Ws=dh,Ch=Nn,kh=vh,Zo=Bi,Eh=Jl,Ko=jn,Qo=ji,xh=zi,Rh=zn,Lh=Vi,Oh=Ql,ea=Wi,ta=gr,Ah=Fn;function X(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Ws(e)}X.plugin=function(e,t){let r,n=!1;function s(...i){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
27
- https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
28
- https://www.w3ctech.com/topic/2226`));let a=t(...i);return a.postcssPlugin=e,a.postcssVersion=new Ws().version,a}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(i,a,o){return X([s(o)]).process(i,a)},s},X.stringify=Ch,X.parse=Lh,X.fromJSON=kh,X.list=Oh,X.comment=e=>new Ko(e),X.atRule=e=>new Qo(e),X.decl=e=>new Xo(e),X.rule=e=>new ea(e),X.root=e=>new ta(e),X.document=e=>new Zo(e),X.CssSyntaxError=bh,X.Declaration=Xo,X.Container=Ih,X.Processor=Ws,X.Document=Zo,X.Comment=Ko,X.Warning=Eh,X.AtRule=Qo,X.Result=xh,X.Input=Rh,X.Rule=ea,X.Root=ta,X.Node=Ah,Sh.registerPostcss(X);var Mh=X;X.default=X;const ae=ep(Mh);ae.stringify,ae.fromJSON,ae.plugin,ae.parse,ae.list,ae.document,ae.comment,ae.atRule,ae.rule,ae.decl,ae.root,ae.CssSyntaxError,ae.Declaration,ae.Container,ae.Processor,ae.Document,ae.Comment,ae.Warning,ae.AtRule,ae.Result,ae.Input,ae.Rule,ae.Root,ae.Node;var Uh=Object.defineProperty,Oe=(e,t,r)=>((n,s,i)=>s in n?Uh(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r);function Th(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Dh(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var Vs={exports:{}},ie=String,ra=function(){return{isColorSupported:!1,reset:ie,bold:ie,dim:ie,italic:ie,underline:ie,inverse:ie,hidden:ie,strikethrough:ie,black:ie,red:ie,green:ie,yellow:ie,blue:ie,magenta:ie,cyan:ie,white:ie,gray:ie,bgBlack:ie,bgRed:ie,bgGreen:ie,bgYellow:ie,bgBlue:ie,bgMagenta:ie,bgCyan:ie,bgWhite:ie}};Vs.exports=ra(),Vs.exports.createColors=ra;var Ph=Vs.exports;const Ne=Dh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let na=Ph,sa=Ne,Hs=class sc extends Error{constructor(t,r,n,s,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),a&&(this.plugin=a),r!==void 0&&n!==void 0&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,sc)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=na.isColorSupported),sa&&t&&(r=sa(r));let n,s,i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),l=String(o).length;if(t){let{bold:c,gray:u,red:p}=na.createColors(!0);n=d=>c(p(d)),s=d=>u(d)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let p=a+1+u,d=" "+(" "+p).slice(-l)+" | ";if(p===this.line){let f=s(d.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(d)+c+`
29
- `+f+n("^")}return" "+s(d)+c}).join(`
30
- `)}toString(){let t=this.showSourceCode();return t&&(t=`
31
-
32
- `+t+`
33
- `),this.name+": "+this.message+t}};var Hi=Hs;Hs.default=Hs;var lr={};lr.isClean=Symbol("isClean"),lr.my=Symbol("my");const ia={after:`
34
- `,beforeClose:`
35
- `,beforeComment:`
36
- `,beforeDecl:`
37
- `,beforeOpen:" ",beforeRule:`
38
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Gs=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(e.raws.afterName!==void 0?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r=e.type==="decl"?this.raw(e,null,"beforeDecl"):e.type==="comment"?this.raw(e,null,"beforeComment"):t==="before"?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&n.type!=="root";)s+=1,n=n.parent;if(r.includes(`
39
- `)){let i=this.raw(e,null,"indent");if(i.length)for(let a=0;a<s;a++)r+=i}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],n!==void 0))return n;let s=e.parent;if(r==="before"&&(!s||s.type==="root"&&s.first===e||s&&s.type==="document"))return"";if(!s)return ia[r];let i=e.root();if(i.rawCache||(i.rawCache={}),i.rawCache[r]!==void 0)return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let o="raw"+((a=r)[0].toUpperCase()+a.slice(1));this[o]?n=this[o](i,e):i.walk(l=>{if(n=l.raws[t],n!==void 0)return!1})}var a;return n===void 0&&(n=ia[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&r.raws.after!==void 0)return t=r.raws.after,t.includes(`
40
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
41
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(n.raws.before!==void 0)return r=n.raws.before,r.includes(`
42
- `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&r.raws.before!==void 0)return t=r.raws.before,t.includes(`
43
- `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(r.raws.between!==void 0)return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&r.raws.before!==void 0){let s=r.raws.before.split(`
44
- `);return t=s[s.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var ic=Gs;Gs.default=Gs;let _h=ic;function $s(e,t){new _h(t).stringify(e)}var Wn=$s;$s.default=$s;let{isClean:Ur,my:Nh}=lr,Fh=Hi,Bh=ic,zh=Wn;function Ys(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||n==="proxyCache")continue;let s=e[n],i=typeof s;n==="parent"&&i==="object"?t&&(r[n]=t):n==="source"?r[n]=s:Array.isArray(s)?r[n]=s.map(a=>Ys(a,r)):(i==="object"&&s!==null&&(s=Ys(s)),r[n]=s)}return r}let Js=class{constructor(e={}){this.raws={},this[Ur]=!1,this[Nh]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Ys(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Fh(e)}getProxyProcessor(){return{get:(e,t)=>t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,t!=="prop"&&t!=="value"&&t!=="name"&&t!=="params"&&t!=="important"&&t!=="text"||e.markDirty()),!0)}}markDirty(){if(this[Ur]){this[Ur]=!1;let e=this;for(;e=e.parent;)e[Ur]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
45
- `?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);s!==-1&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Bh().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},n=t==null;t=t||new Map;let s=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let a=this[i];if(Array.isArray(a))r[i]=a.map(o=>typeof o=="object"&&o.toJSON?o.toJSON(null,t):o);else if(typeof a=="object"&&a.toJSON)r[i]=a.toJSON(null,t);else if(i==="source"){let o=t.get(a.input);o==null&&(o=s,t.set(a.input,s),s++),r[i]={end:a.end,inputId:o,start:a.start}}else r[i]=a}return n&&(r.inputs=[...t.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=zh){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Vn=Js;Js.default=Js;let jh=Vn,qs=class extends jh{constructor(e){e&&e.value!==void 0&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Hn=qs;qs.default=qs;var Wh={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:oa,SourceMapGenerator:aa}=Ne,{existsSync:Vh,readFileSync:Hh}=Ne,{dirname:os,join:Gh}=Ne,Xs=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=os(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new oa(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e=="object"&&(typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=os(e),Vh(e))return this.mapFile=e,Hh(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t!="function"){if(t instanceof oa)return aa.fromSourceMap(t).toString();if(t instanceof aa)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Gh(os(e),r)),this.loadFile(r)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var oc=Xs;Xs.default=Xs;let{SourceMapConsumer:$h,SourceMapGenerator:Yh}=Ne,{fileURLToPath:la,pathToFileURL:Tr}=Ne,{isAbsolute:Zs,resolve:Ks}=Ne,{nanoid:Jh}=Wh,as=Ne,ca=Hi,qh=oc,ls=Symbol("fromOffsetCache"),Xh=!!($h&&Yh),ua=!!(Ks&&Zs),rn=class{constructor(e,t={}){if(e==null||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ua||/^\w+:\/\//.test(t.from)||Zs(t.from)?this.file=t.from:this.file=Ks(t.from)),ua&&Xh){let r=new qh(this.css,t);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+Jh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,a;if(t&&typeof t=="object"){let l=t,c=r;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);t=u.line,r=u.col}else t=l.line,r=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);i=u.line,a=u.col}else i=c.line,a=c.column}else if(!r){let l=this.fromOffset(t);t=l.line,r=l.col}let o=this.origin(t,r,i,a);return s=o?new ca(e,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,n.plugin):new ca(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:a,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(Tr&&(s.input.url=Tr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[ls])r=this[ls];else{let s=this.css.split(`
46
- `);r=new Array(s.length);let i=0;for(let a=0,o=s.length;a<o;a++)r[a]=i,i+=s[a].length+1;this[ls]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let s,i=r.length-2;for(;n<i;)if(s=n+(i-n>>1),e<r[s])i=s-1;else{if(!(e>=r[s+1])){n=s;break}n=s+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ks(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;typeof r=="number"&&(s=a.originalPositionFor({column:n,line:r})),i=Zs(o.source)?Tr(o.source):new URL(o.source,this.map.consumer().sourceRoot||Tr(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!la)throw new Error("file: protocol is not available in this PostCSS build");l.file=la(i)}let c=a.sourceContentFor(o.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Gn=rn;rn.default=rn,as&&as.registerInput&&as.registerInput(rn);let{SourceMapConsumer:ac,SourceMapGenerator:nn}=Ne,{dirname:sn,relative:lc,resolve:cc,sep:uc}=Ne,{pathToFileURL:da}=Ne,Zh=Gn,Kh=!!(ac&&nn),Qh=!!(sn&&cc&&lc&&uc);var dc=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t=`
47
- `;this.css.includes(`\r
48
- `)&&(t=`\r
49
- `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||sn(e.file);this.mapOpts.sourcesContent===!1?(t=new ac(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Qh&&Kh&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=nn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new nn({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new nn({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(a,o,l)=>{if(this.css+=a,o&&l!=="end"&&(i.generated.line=r,i.generated.column=n-1,o.source&&o.source.start?(i.source=this.sourcePath(o),i.original.line=o.source.start.line,i.original.column=o.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=a.match(/\n/g),e?(r+=e.length,t=a.lastIndexOf(`
50
- `),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?sn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=sn(cc(r,this.mapOpts.annotation)));let n=lc(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Zh(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(da){let r=da(e).toString();return this.memoizedFileURLs.set(e,r),r}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;uc==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let em=Vn,Qs=class extends em{constructor(e){super(e),this.type="comment"}};var $n=Qs;Qs.default=Qs;let pc,Gi,$i,hc,{isClean:mc,my:fc}=lr,gc=Hn,yc=$n,tm=Vn;function wc(e){return e.map(t=>(t.nodes&&(t.nodes=wc(t.nodes)),delete t.source,t))}function vc(e){if(e[mc]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)vc(t)}let Ke=class bc extends tm{append(...t){for(let r of t){let n=this.normalize(r,this.last);for(let s of n)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let r of this.nodes)r.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let r,n,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],n=t(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get:(t,r)=>r==="proxyOf"?t:t[r]?r==="each"||typeof r=="string"&&r.startsWith("walk")?(...n)=>t[r](...n.map(s=>typeof s=="function"?(i,a)=>s(i.toProxy(),a):s)):r==="every"||r==="some"?n=>t[r]((s,...i)=>n(s.toProxy(),...i)):r==="root"?()=>t.root().toProxy():r==="nodes"?t.nodes.map(n=>n.toProxy()):r==="first"||r==="last"?t[r].toProxy():t[r]:t[r],set:(t,r,n)=>(t[r]===n||(t[r]=n,r!=="name"&&r!=="params"&&r!=="selector"||t.markDirty()),!0)}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,r){let n,s=this.index(t),i=this.normalize(r,this.proxyOf.nodes[s]).reverse();s=this.index(t);for(let a of i)this.proxyOf.nodes.splice(s+1,0,a);for(let a in this.indexes)n=this.indexes[a],s<n&&(this.indexes[a]=n+i.length);return this.markDirty(),this}insertBefore(t,r){let n,s=this.index(t),i=s===0&&"prepend",a=this.normalize(r,this.proxyOf.nodes[s],i).reverse();s=this.index(t);for(let o of a)this.proxyOf.nodes.splice(s,0,o);for(let o in this.indexes)n=this.indexes[o],s<=n&&(this.indexes[o]=n+a.length);return this.markDirty(),this}normalize(t,r){if(typeof t=="string")t=wc(pc(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new gc(t)]}else if(t.selector)t=[new Gi(t)];else if(t.name)t=[new $i(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new yc(t)]}return t.map(n=>(n[fc]||bc.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[mc]&&vc(n),n.raws.before===void 0&&r&&r.raws.before!==void 0&&(n.raws.before=r.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let r;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(s=>{r.props&&!r.props.includes(s.prop)||r.fast&&!s.value.includes(r.fast)||(s.value=s.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let s;try{s=t(r,n)}catch(i){throw r.addToError(i)}return s!==!1&&r.walk&&(s=r.walk(t)),s})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="atrule")return r(n,s)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="decl")return r(n,s)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="rule")return r(n,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ke.registerParse=e=>{pc=e},Ke.registerRule=e=>{Gi=e},Ke.registerAtRule=e=>{$i=e},Ke.registerRoot=e=>{hc=e};var gt=Ke;Ke.default=Ke,Ke.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,$i.prototype):e.type==="rule"?Object.setPrototypeOf(e,Gi.prototype):e.type==="decl"?Object.setPrototypeOf(e,gc.prototype):e.type==="comment"?Object.setPrototypeOf(e,yc.prototype):e.type==="root"&&Object.setPrototypeOf(e,hc.prototype),e[fc]=!0,e.nodes&&e.nodes.forEach(t=>{Ke.rebuild(t)})};let Sc,Ic,rm=gt,cr=class extends rm{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Sc(new Ic,this,e).stringify()}};cr.registerLazyResult=e=>{Sc=e},cr.registerProcessor=e=>{Ic=e};var Yi=cr;cr.default=cr;let ei=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Cc=ei;ei.default=ei;let nm=Cc,ti=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new nm(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Ji=ti;ti.default=ti;const cs=39,pa=34,Dr=92,ha=47,Pr=10,zt=32,_r=12,Nr=9,Fr=13,sm=91,im=93,om=40,am=41,lm=123,cm=125,um=59,dm=42,pm=58,hm=64,Br=/[\t\n\f\r "#'()/;[\\\]{}]/g,zr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,mm=/.[\r\n"'(/\\]/,ma=/[\da-f]/i;let kc=gt,on=class extends kc{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var qi=on;on.default=on,kc.registerAtRule(on);let Ec,xc,Rc=gt,At=class extends Rc{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let s of n)s.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Ec(new xc,this,e).stringify()}};At.registerLazyResult=e=>{Ec=e},At.registerProcessor=e=>{xc=e};var yr=At;At.default=At,Rc.registerRoot(At);let ur={comma:e=>ur.split(e,[","],!0),space:e=>ur.split(e,[" ",`
51
- `," "]),split(e,t,r){let n=[],s="",i=!1,a=0,o=!1,l="",c=!1;for(let u of e)c?c=!1:u==="\\"?c=!0:o?u===l&&(o=!1):u==='"'||u==="'"?(o=!0,l=u):u==="("?a+=1:u===")"?a>0&&(a-=1):a===0&&t.includes(u)&&(i=!0),i?(s!==""&&n.push(s.trim()),s="",i=!1):s+=u;return(r||s!=="")&&n.push(s.trim()),n}};var Lc=ur;ur.default=ur;let Oc=gt,fm=Lc,an=class extends Oc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return fm.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Xi=an;an.default=an,Oc.registerRule(an);let gm=Hn,ym=function(e,t={}){let r,n,s,i,a,o,l,c,u,p,d=e.css.valueOf(),f=t.ignoreErrors,y=d.length,h=0,I=[],m=[];function g(v){throw e.error("Unclosed "+v,h)}return{back:function(v){m.push(v)},endOfFile:function(){return m.length===0&&h>=y},nextToken:function(v){if(m.length)return m.pop();if(h>=y)return;let C=!!v&&v.ignoreUnclosed;switch(r=d.charCodeAt(h),r){case Pr:case zt:case Nr:case Fr:case _r:n=h;do n+=1,r=d.charCodeAt(n);while(r===zt||r===Pr||r===Nr||r===Fr||r===_r);p=["space",d.slice(h,n)],h=n-1;break;case sm:case im:case lm:case cm:case pm:case um:case am:{let A=String.fromCharCode(r);p=[A,A,h];break}case om:if(c=I.length?I.pop()[1]:"",u=d.charCodeAt(h+1),c==="url"&&u!==cs&&u!==pa&&u!==zt&&u!==Pr&&u!==Nr&&u!==_r&&u!==Fr){n=h;do{if(o=!1,n=d.indexOf(")",n+1),n===-1){if(f||C){n=h;break}g("bracket")}for(l=n;d.charCodeAt(l-1)===Dr;)l-=1,o=!o}while(o);p=["brackets",d.slice(h,n+1),h,n],h=n}else n=d.indexOf(")",h+1),i=d.slice(h,n+1),n===-1||mm.test(i)?p=["(","(",h]:(p=["brackets",i,h,n],h=n);break;case cs:case pa:s=r===cs?"'":'"',n=h;do{if(o=!1,n=d.indexOf(s,n+1),n===-1){if(f||C){n=h+1;break}g("string")}for(l=n;d.charCodeAt(l-1)===Dr;)l-=1,o=!o}while(o);p=["string",d.slice(h,n+1),h,n],h=n;break;case hm:Br.lastIndex=h+1,Br.test(d),n=Br.lastIndex===0?d.length-1:Br.lastIndex-2,p=["at-word",d.slice(h,n+1),h,n],h=n;break;case Dr:for(n=h,a=!0;d.charCodeAt(n+1)===Dr;)n+=1,a=!a;if(r=d.charCodeAt(n+1),a&&r!==ha&&r!==zt&&r!==Pr&&r!==Nr&&r!==Fr&&r!==_r&&(n+=1,ma.test(d.charAt(n)))){for(;ma.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===zt&&(n+=1)}p=["word",d.slice(h,n+1),h,n],h=n;break;default:r===ha&&d.charCodeAt(h+1)===dm?(n=d.indexOf("*/",h+2)+1,n===0&&(f||C?n=d.length:g("comment")),p=["comment",d.slice(h,n+1),h,n],h=n):(zr.lastIndex=h+1,zr.test(d),n=zr.lastIndex===0?d.length-1:zr.lastIndex-2,p=["word",d.slice(h,n+1),h,n],I.push(p),h=n)}return h++,p},position:function(){return h}}},wm=$n,vm=qi,bm=yr,fa=Xi;const ga={empty:!0,space:!0};var Sm=class{constructor(e){this.input=e,this.root=new bm,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new vm;s.name=e[1].slice(1),s.name===""&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,a=!1,o=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],t==="("||t==="["?l.push(t==="("?")":"]"):t==="{"&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),l.length===0){if(t===";"){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if(t==="{"){a=!0;break}if(t==="}"){if(o.length>0){for(n=o.length-1,r=o[n];r&&r[0]==="space";)r=o[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}o.push(e)}else o.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(o),o.length?(s.raws.afterName=this.spacesAndCommentsFromStart(o),this.raw(s,"params",o),i&&(e=o[o.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),a&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],r[0]==="space"||(n+=1,n!==2));s--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,a]of e.entries()){if(t=a,r=t[0],r==="("&&(s+=1),r===")"&&(s-=1),s===0&&r===":"){if(n){if(n[0]==="word"&&n[1]==="progid")continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new wm;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=ym(this.input)}decl(e,t){let r=new gm;this.init(r,e[0][2]);let n,s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(o){for(let l=o.length-1;l>=0;l--){let c=o[l],u=c[3]||c[2];if(u)return u}}(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let o=e[0][0];if(o===":"||o==="space"||o==="comment")break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}r.prop[0]!=="_"&&r.prop[0]!=="*"||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],i==="space"||i==="comment");)a.push(e.shift());this.precheckMissedSemicolon(e);for(let o=e.length-1;o>=0;o--){if(n=e[o],n[1].toLowerCase()==="!important"){r.important=!0;let l=this.stringFrom(e,o);l=this.spacesFromEnd(e)+l,l!==" !important"&&(r.raws.important=l);break}if(n[1].toLowerCase()==="important"){let l=e.slice(0),c="";for(let u=o;u>0;u--){let p=l[u][0];if(c.trim().indexOf("!")===0&&p!=="space")break;c=l.pop()[1]+c}c.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=c,e=l)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(o=>o[0]!=="space"&&o[0]!=="comment")&&(r.raws.between+=a.map(o=>o[1]).join(""),a=[]),this.raw(r,"value",a.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new fa;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,s=null,i=[],a=e[1].startsWith("--"),o=[],l=e;for(;l;){if(r=l[0],o.push(l),r==="("||r==="[")s||(s=l),i.push(r==="("?")":"]");else if(a&&n&&r==="{")s||(s=l),i.push("}");else if(i.length===0){if(r===";"){if(n)return void this.decl(o,a);break}if(r==="{")return void this.rule(o);if(r==="}"){this.tokenizer.back(o.pop()),t=!0;break}r===":"&&(n=!0)}else r===i[i.length-1]&&(i.pop(),i.length===0&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!a)for(;o.length&&(l=o[o.length-1][0],l==="space"||l==="comment");)this.tokenizer.back(o.pop());this.decl(o,a)}else this.unknownWord(o)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let s,i,a,o,l=r.length,c="",u=!0;for(let p=0;p<l;p+=1)s=r[p],i=s[0],i!=="space"||p!==l-1||n?i==="comment"?(o=r[p-1]?r[p-1][0]:"empty",a=r[p+1]?r[p+1][0]:"empty",ga[o]||ga[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let p=r.reduce((d,f)=>d+f[1],"");e.raws[t]={raw:p,value:c}}e[t]=c}rule(e){e.pop();let t=new fa;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space"||t==="comment");)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],t==="space"||t==="comment");)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Im=gt,Cm=Sm,km=Gn;function ln(e,t){let r=new km(e,t),n=new Cm(r);try{n.parse()}catch(s){throw s}return n.root}var Zi=ln;ln.default=ln,Im.registerParse(ln);let{isClean:Be,my:Em}=lr,xm=dc,Rm=Wn,Lm=gt,Om=Yi,ya=Ji,Am=Zi,Mm=yr;const Um={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Tm={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Dm={Once:!0,postcssPlugin:!0,prepare:!0};function jt(e){return typeof e=="object"&&typeof e.then=="function"}function Ac(e){let t=!1,r=Um[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function wa(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:Ac(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ri(e){return e[Be]=!1,e.nodes&&e.nodes.forEach(t=>ri(t)),e}let ni={},Rt=class Mc{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,typeof r!="object"||r===null||r.type!=="root"&&r.type!=="document")if(r instanceof Mc||r instanceof ya)s=ri(r.root),r.map&&(n.map===void 0&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let i=Am;n.syntax&&(i=n.syntax.parse),n.parser&&(i=n.parser),i.parse&&(i=i.parse);try{s=i(r,n)}catch(a){this.processed=!0,this.error=a}s&&!s[Em]&&Lm.rebuild(s)}else s=ri(r);this.result=new ya(t,s,n),this.helpers={...ni,postcss:ni,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let n=this.result.lastPlugin;try{r&&r.addToError(t),this.error=t,t.name!=="CssSyntaxError"||t.plugin?n.postcssVersion:(t.plugin=n.postcssPlugin,t.setMessage())}catch(s){console&&console.error&&console.error(s)}return t}prepareVisitors(){this.listeners={};let t=(r,n,s)=>{this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push([r,s])};for(let r of this.plugins)if(typeof r=="object")for(let n in r){if(!Tm[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Dm[n])if(typeof r[n]=="object")for(let s in r[n])t(r,s==="*"?n:n+"-"+s.toLowerCase(),r[n][s]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(jt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];){t[Be]=!0;let r=[wa(t)];for(;r.length>0;){let n=this.visitTick(r);if(jt(n))try{await n}catch(s){let i=r[r.length-1].node;throw this.handleError(s,i)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let s=t.nodes.map(i=>n(i,this.helpers));await Promise.all(s)}else await n(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return jt(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=Rm;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new xm(r,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins)if(jt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];)t[Be]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(jt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[Be])return a[Be]=!0,void t.push(wa(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[Be]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Be]=!0;let r=Ac(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Be]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Rt.registerPostcss=e=>{ni=e};var Uc=Rt;Rt.default=Rt,Mm.registerLazyResult(Rt),Om.registerLazyResult(Rt);let Pm=dc,_m=Wn,Nm=Zi;const Fm=Ji;let si=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=_m;this.result=new Fm(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new Pm(s,n,this._opts,t);if(a.isMap()){let[o,l]=a.generate();o&&(this.result.css=o),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Nm;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Bm=si;si.default=si;let zm=Bm,jm=Uc,Wm=Yi,Vm=yr,Ht=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r!="object"||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new jm(this,e,t):new zm(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Hm=Ht;Ht.default=Ht,Vm.registerProcessor(Ht),Wm.registerProcessor(Ht);let Gm=Hn,$m=oc,Ym=$n,Jm=qi,qm=Gn,Xm=yr,Zm=Xi;function dr(e,t){if(Array.isArray(e))return e.map(s=>dr(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:qm.prototype};i.map&&(i.map={...i.map,__proto__:$m.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>dr(s,t))),n.source){let{inputId:s,...i}=n.source;n.source=i,s!=null&&(n.source.input=t[s])}if(n.type==="root")return new Xm(n);if(n.type==="decl")return new Gm(n);if(n.type==="rule")return new Zm(n);if(n.type==="comment")return new Ym(n);if(n.type==="atrule")return new Jm(n);throw new Error("Unknown node type: "+e.type)}var Km=dr;dr.default=dr;let Qm=Hi,va=Hn,ef=Uc,tf=gt,ii=Hm,rf=Wn,nf=Km,ba=Yi,sf=Cc,Sa=$n,Ia=qi,of=Ji,af=Gn,lf=Zi,cf=Lc,Ca=Xi,ka=yr,uf=Vn;function Z(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new ii(e)}Z.plugin=function(e,t){let r,n=!1;function s(...i){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
52
- https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
53
- https://www.w3ctech.com/topic/2226`));let a=t(...i);return a.postcssPlugin=e,a.postcssVersion=new ii().version,a}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(i,a,o){return Z([s(o)]).process(i,a)},s},Z.stringify=rf,Z.parse=lf,Z.fromJSON=nf,Z.list=cf,Z.comment=e=>new Sa(e),Z.atRule=e=>new Ia(e),Z.decl=e=>new va(e),Z.rule=e=>new Ca(e),Z.root=e=>new ka(e),Z.document=e=>new ba(e),Z.CssSyntaxError=Qm,Z.Declaration=va,Z.Container=tf,Z.Processor=ii,Z.Document=ba,Z.Comment=Sa,Z.Warning=sf,Z.AtRule=Ia,Z.Result=of,Z.Input=af,Z.Rule=Ca,Z.Root=ka,Z.Node=uf,ef.registerPostcss(Z);var df=Z;Z.default=Z;const le=Th(df);le.stringify,le.fromJSON,le.plugin,le.parse,le.list,le.document,le.comment,le.atRule,le.rule,le.decl,le.root,le.CssSyntaxError,le.Declaration,le.Container,le.Processor,le.Document,le.Comment,le.Warning,le.AtRule,le.Result,le.Input,le.Rule,le.Root,le.Node;class Ki{constructor(...t){Oe(this,"parentElement",null),Oe(this,"parentNode",null),Oe(this,"ownerDocument"),Oe(this,"firstChild",null),Oe(this,"lastChild",null),Oe(this,"previousSibling",null),Oe(this,"nextSibling",null),Oe(this,"ELEMENT_NODE",1),Oe(this,"TEXT_NODE",3),Oe(this,"nodeType"),Oe(this,"nodeName"),Oe(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(!(t instanceof Ki)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Ea={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},xa={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},jr={};function Qi(e){if(jr[e])return jr[e];const t=globalThis[e],r=t.prototype,n=e in Ea?Ea[e]:void 0,s=!!(n&&n.every(o=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,o))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in xa?xa[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return jr[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?jr[e]=c:r}catch{return r}}const us={};function tt(e,t,r){var n;const s=`${e}.${String(r)}`;if(us[s])return us[s].call(t);const i=Qi(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(us[s]=a,a.call(t)):t[r]}const ds={};function Ra(e,t,r){const n=`${e}.${String(r)}`;if(ds[n])return ds[n].bind(t);const s=Qi(e)[r];return typeof s!="function"?t[r]:(ds[n]=s,s.bind(t))}function Tc(){return Qi("MutationObserver").constructor}const H={childNodes:function(e){return tt("Node",e,"childNodes")},parentNode:function(e){return tt("Node",e,"parentNode")},parentElement:function(e){return tt("Node",e,"parentElement")},textContent:function(e){return tt("Node",e,"textContent")},contains:function(e,t){return Ra("Node",e,"contains")(t)},getRootNode:function(e){return Ra("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?tt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?tt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return tt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return tt("Element",e,"querySelectorAll")(t)},mutationObserver:Tc};function ve(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const It=`Please stop import mirror directly. Instead of that,\r
54
- now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
55
- or you can use record.mirror to access the mirror instance during recording.`;let La={map:{},getId:()=>(console.error(It),-1),getNode:()=>(console.error(It),null),removeNodeFromMap(){console.error(It)},has:()=>(console.error(It),!1),reset(){console.error(It)}};function Gt(e,t,r={}){let n=null,s=0;return function(...i){const a=Date.now();s||r.leading!==!1||(s=a);const o=t-(a-s),l=this;o<=0||o>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(l,i)):n||r.trailing===!1||(n=setTimeout(()=>{s=r.leading===!1?0:Date.now(),n=null,e.apply(l,i)},o))}}function Yn(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Yn(e,t,i||{},!0)}function Mt(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}typeof window<"u"&&window.Proxy&&window.Reflect&&(La=new Proxy(La,{get:(e,t,r)=>(t==="map"&&console.error(It),Reflect.get(e,t,r))}));let bn=Date.now;function Dc(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||(i==null?void 0:i.body)&&((t=H.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i==null?void 0:i.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(i==null?void 0:i.documentElement.scrollTop)||(i==null?void 0:i.body)&&((n=H.parentElement(i.body))==null?void 0:n.scrollTop)||((s=i==null?void 0:i.body)==null?void 0:s.scrollTop)||0}}function Pc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _c(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Nc(e){return e?e.nodeType===e.ELEMENT_NODE?e:H.parentElement(e):null}function Se(e,t,r,n){if(!e)return!1;const s=Nc(e);if(!s)return!1;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return!0}else if(vn(s,t,n))return!0}catch{}return!!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function ps(e,t,r){return!(e.tagName!=="TITLE"||!r.headTitleMutations)||t.getId(e)===-2}function Fc(e,t){if(Xt(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=H.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Fc(n,t))}function oi(e){return!!e.changedTouches}function Bc(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function zc(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ai(e){return!!e&&(e instanceof Ki&&"shadowRoot"in e?!!e.shadowRoot:!!H.shadowRoot(e))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bn=()=>new Date().getTime());class pf{constructor(){R(this,"id",1),R(this,"styleIDMap",new WeakMap),R(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return n=r===void 0?this.id++:r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}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 jc(e){var t;let r=null;return"getRootNode"in e&&((t=H.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&H.host(H.getRootNode(e))&&(r=H.host(H.getRootNode(e))),r}function hf(e){const t=e.ownerDocument;if(!t)return!1;const r=function(n){let s,i=n;for(;s=jc(i);)i=s;return i}(e);return H.contains(t,r)}function Wc(e){const t=e.ownerDocument;return!!t&&(H.contains(t,e)||hf(e))}var Y=(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))(Y||{}),G=(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[e.CustomElement=16]="CustomElement",e))(G||{}),Ce=(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))(Ce||{}),Ye=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ye||{}),Ct=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ct||{}),kt=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(kt||{});function Oa(e){return"__ln"in e}class mf{constructor(){R(this,"length",0),R(this,"head",null),R(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=(r==null?void 0:r.next)||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Oa(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Oa(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Aa=(e,t)=>`${e}@${t}`;class ff{constructor(){R(this,"frozen",!1),R(this,"locked",!1),R(this,"texts",[]),R(this,"attributes",[]),R(this,"attributeMap",new WeakMap),R(this,"removes",[]),R(this,"mapRemoves",[]),R(this,"movedMap",{}),R(this,"addedSet",new Set),R(this,"movedSet",new Set),R(this,"droppedSet",new Set),R(this,"mutationCb"),R(this,"blockClass"),R(this,"blockSelector"),R(this,"maskTextClass"),R(this,"maskTextSelector"),R(this,"inlineStylesheet"),R(this,"maskInputOptions"),R(this,"maskTextFn"),R(this,"maskInputFn"),R(this,"keepIframeSrcFn"),R(this,"recordCanvas"),R(this,"inlineImages"),R(this,"slimDOMOptions"),R(this,"dataURLOptions"),R(this,"doc"),R(this,"mirror"),R(this,"iframeManager"),R(this,"stylesheetManager"),R(this,"shadowDomManager"),R(this,"canvasManager"),R(this,"processedNodeManager"),R(this,"unattachedDoc"),R(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),R(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new mf,s=l=>{let c=l,u=-2;for(;u===-2;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{const c=H.parentNode(l);if(!c||!Wc(l)||c.tagName==="TEXTAREA")return;const u=Xt(c)?this.mirror.getId(jc(l)):this.mirror.getId(c),p=s(l);if(u===-1||p===-1)return n.addNode(l);const d=Et(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:f=>{Bc(f,this.mirror)&&this.iframeManager.addIframe(f),zc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),ai(l)&&this.shadowDomManager.addShadowRoot(H.shadowRoot(l),this.doc)},onIframeLoad:(f,y)=>{this.iframeManager.attachIframe(f,y),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,y)=>{this.stylesheetManager.attachLinkElement(f,y)}});d&&(t.push({parentId:u,nextId:p,node:d}),r.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Ma(this.removes,l,this.mirror)&&!this.movedSet.has(H.parentNode(l))||i(l);for(const l of this.addedSet)Ua(this.droppedSet,l)||Ma(this.removes,l,this.mirror)?Ua(this.movedSet,l)?i(l):this.droppedSet.add(l):i(l);let a=null;for(;n.length;){let l=null;if(a){const c=this.mirror.getId(H.parentNode(a.value)),u=s(a.value);c!==-1&&u!==-1&&(l=a)}if(!l){let c=n.tail;for(;c;){const u=c;if(c=c.previous,u){const p=this.mirror.getId(H.parentNode(u.value));if(s(u.value)===-1)continue;if(p!==-1){l=u;break}{const d=u.value,f=H.parentNode(d);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=H.host(f);if(this.mirror.getId(y)!==-1){l=u;break}}}}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}a=l.previous,n.removeNode(l.value),i(l.value)}const o={texts:this.texts.map(l=>{const c=l.node,u=H.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:c}=l;if(typeof c.style=="string"){const u=JSON.stringify(l.styleDiff),p=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+p).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))}),R(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r)),r.attributes.value=Array.from(H.childNodes(t),n=>H.textContent(n)||"").join("")}),R(this,"processMutation",t=>{if(!ps(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=H.textContent(t.target);Se(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue||this.texts.push({value:Ll(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Nc(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,s=t.target.getAttribute(n);if(n==="value"){const a=Di(r);s=Ti({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(Se(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(s)){if(r.contentDocument)return;n="rr_src"}if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Rl(r.tagName,n))if(i.attributes[n]=xl(this.doc,ht(r.tagName),ht(n),s),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const o of Array.from(r.style)){const l=r.style.getPropertyValue(o),c=r.style.getPropertyPriority(o);l!==a.style.getPropertyValue(o)||c!==a.style.getPropertyPriority(o)?i.styleDiff[o]=c===""?l:[l,c]:i._unchangedStyles[o]=[l,c]}for(const o of Array.from(a.style))r.style.getPropertyValue(o)===""&&(i.styleDiff[o]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Se(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA")return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),s=Xt(t.target)?this.mirror.getId(H.host(t.target)):this.mirror.getId(t.target);Se(t.target,this.blockClass,this.blockSelector,!1)||ps(r,this.mirror,this.slimDOMOptions)||!function(i,a){return a.getId(i)!==-1}(r,this.mirror)||(this.addedSet.has(r)?(li(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Fc(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Aa(n,s)]?li(this.movedSet,r):this.removes.push({parentId:s,id:n,isShadow:!(!Xt(t.target)||!Zt(t.target))||void 0})),this.mapRemoves.push(r))})}}),R(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ps(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Aa(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Se(t,this.blockClass,this.blockSelector,!1)||(H.childNodes(t).forEach(n=>this.genAdds(n)),ai(t)&&H.childNodes(H.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,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(r=>{this[r]=t[r]})}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 li(e,t){e.delete(t),H.childNodes(t).forEach(r=>li(e,r))}function Ma(e,t,r){return e.length!==0&&function(n,s,i){let a=H.parentNode(s);for(;a;){const o=i.getId(a);if(n.some(l=>l.id===o))return!0;a=H.parentNode(a)}return!1}(e,t,r)}function Ua(e,t){return e.size!==0&&Vc(e,t)}function Vc(e,t){const r=H.parentNode(t);return!!r&&(!!e.has(r)||Vc(e,r))}let Kt;const $=e=>Kt?(...t)=>{try{return e(...t)}catch(r){if(Kt&&Kt(r)===!0)return;throw r}}:e,pt=[];function Qt(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 Hc(e,t){const r=new ff;pt.push(r),r.init(e);const n=new(Tc())($(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function gf({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,o=[];let l=null;return Object.keys(Ce).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let u=ht(c);const p=(d=>f=>{const y=Qt(f);if(Se(y,n,s,!0))return;let h=null,I=d;if("pointerType"in f){switch(f.pointerType){case"mouse":h=Ye.Mouse;break;case"touch":h=Ye.Touch;break;case"pen":h=Ye.Pen}h===Ye.Touch?Ce[d]===Ce.MouseDown?I="TouchStart":Ce[d]===Ce.MouseUp&&(I="TouchEnd"):Ye.Pen}else oi(f)&&(h=Ye.Touch);h!==null?(l=h,(I.startsWith("Touch")&&h===Ye.Touch||I.startsWith("Mouse")&&h===Ye.Mouse)&&(h=null)):Ce[d]===Ce.Click&&(h=l,l=null);const m=oi(f)?f.changedTouches[0]:f;if(!m)return;const g=r.getId(y),{clientX:v,clientY:C}=m;$(e)({type:Ce[I],id:g,x:v,y:C,...h!==null&&{pointerType:h}})})(c);if(window.PointerEvent)switch(Ce[c]){case Ce.MouseDown:case Ce.MouseUp:u=u.replace("mouse","pointer");break;case Ce.TouchStart:case Ce.TouchEnd:return}o.push(ve(u,p,t))}),$(()=>{o.forEach(c=>c())})}function Gc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){return ve("scroll",$(Gt($(a=>{const o=Qt(a);if(!o||Se(o,n,s,!0))return;const l=r.getId(o);if(o===t&&t.defaultView){const c=Dc(t.defaultView);e({id:l,x:c.left,y:c.top})}else e({id:l,x:o.scrollLeft,y:o.scrollTop})}),i.scroll||100)),t)}const yf=["INPUT","TEXTAREA","SELECT"],Ta=new WeakMap;function Wr(e){return function(t,r){if(Vr("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Vr("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Vr("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Vr("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const n=Array.from(t.parentRule.cssRules).indexOf(t);r.unshift(n)}else if(t.parentStyleSheet){const n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function rt(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function $c({mirror:e,stylesheetManager:t},r){var n,s,i;let a=null;a=r.nodeName==="#document"?e.getId(r):e.getId(H.host(r));const o=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:i.ShadowRoot,l=o!=null&&o.prototype?Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets"):void 0;return a!==null&&a!==-1&&o&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;const p=(u=l.set)==null?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return p}}),$(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function wf(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;(function(m,g){const{mutationCb:v,mousemoveCb:C,mouseInteractionCb:A,scrollCb:x,viewportResizeCb:U,inputCb:M,mediaInteractionCb:k,styleSheetRuleCb:E,styleDeclarationCb:L,canvasMutationCb:S,fontCb:_,selectionCb:D,customElementCb:b}=m;m.mutationCb=(...w)=>{g.mutation&&g.mutation(...w),v(...w)},m.mousemoveCb=(...w)=>{g.mousemove&&g.mousemove(...w),C(...w)},m.mouseInteractionCb=(...w)=>{g.mouseInteraction&&g.mouseInteraction(...w),A(...w)},m.scrollCb=(...w)=>{g.scroll&&g.scroll(...w),x(...w)},m.viewportResizeCb=(...w)=>{g.viewportResize&&g.viewportResize(...w),U(...w)},m.inputCb=(...w)=>{g.input&&g.input(...w),M(...w)},m.mediaInteractionCb=(...w)=>{g.mediaInteaction&&g.mediaInteaction(...w),k(...w)},m.styleSheetRuleCb=(...w)=>{g.styleSheetRule&&g.styleSheetRule(...w),E(...w)},m.styleDeclarationCb=(...w)=>{g.styleDeclaration&&g.styleDeclaration(...w),L(...w)},m.canvasMutationCb=(...w)=>{g.canvasMutation&&g.canvasMutation(...w),S(...w)},m.fontCb=(...w)=>{g.font&&g.font(...w),_(...w)},m.selectionCb=(...w)=>{g.selection&&g.selection(...w),D(...w)},m.customElementCb=(...w)=>{g.customElement&&g.customElement(...w),b(...w)}})(e,t),e.recordDOM&&(n=Hc(e,e.doc));const s=function({mousemoveCb:m,sampling:g,doc:v,mirror:C}){if(g.mousemove===!1)return()=>{};const A=typeof g.mousemove=="number"?g.mousemove:50,x=typeof g.mousemoveCallback=="number"?g.mousemoveCallback:500;let U,M=[];const k=Gt($(S=>{const _=Date.now()-U;m(M.map(D=>(D.timeOffset-=_,D)),S),M=[],U=null}),x),E=$(Gt($(S=>{const _=Qt(S),{clientX:D,clientY:b}=oi(S)?S.changedTouches[0]:S;U||(U=bn()),M.push({x:D,y:b,id:C.getId(_),timeOffset:bn()-U}),k(typeof DragEvent<"u"&&S instanceof DragEvent?G.Drag:S instanceof MouseEvent?G.MouseMove:G.TouchMove)}),A,{trailing:!1})),L=[ve("mousemove",E,v),ve("touchmove",E,v),ve("drag",E,v)];return $(()=>{L.forEach(S=>S())})}(e),i=gf(e),a=Gc(e),o=function({viewportResizeCb:m},{win:g}){let v=-1,C=-1;return ve("resize",$(Gt($(()=>{const A=Pc(),x=_c();v===A&&C===x||(m({width:Number(x),height:Number(A)}),v=A,C=x)}),200)),g)}(e,{win:r}),l=function({inputCb:m,doc:g,mirror:v,blockClass:C,blockSelector:A,ignoreClass:x,ignoreSelector:U,maskInputOptions:M,maskInputFn:k,sampling:E,userTriggeredOnInput:L}){function S(F){let j=Qt(F);const O=F.isTrusted,N=j&&j.tagName;if(j&&N==="OPTION"&&(j=H.parentElement(j)),!j||!N||yf.indexOf(N)<0||Se(j,C,A,!0)||j.classList.contains(x)||U&&j.matches(U))return;let ee=j.value,J=!1;const W=Di(j)||"";W==="radio"||W==="checkbox"?J=j.checked:(M[N.toLowerCase()]||M[W])&&(ee=Ti({element:j,maskInputOptions:M,tagName:N,type:W,value:ee,maskInputFn:k})),_(j,L?{text:ee,isChecked:J,userTriggered:O}:{text:ee,isChecked:J});const we=j.name;W==="radio"&&we&&J&&g.querySelectorAll(`input[type="radio"][name="${we}"]`).forEach(fe=>{if(fe!==j){const Ie=fe.value;_(fe,L?{text:Ie,isChecked:!J,userTriggered:!1}:{text:Ie,isChecked:!J})}})}function _(F,j){const O=Ta.get(F);if(!O||O.text!==j.text||O.isChecked!==j.isChecked){Ta.set(F,j);const N=v.getId(F);$(m)({...j,id:N})}}const D=(E.input==="last"?["change"]:["input","change"]).map(F=>ve(F,$(S),g)),b=g.defaultView;if(!b)return()=>{D.forEach(F=>F())};const w=b.Object.getOwnPropertyDescriptor(b.HTMLInputElement.prototype,"value"),T=[[b.HTMLInputElement.prototype,"value"],[b.HTMLInputElement.prototype,"checked"],[b.HTMLSelectElement.prototype,"value"],[b.HTMLTextAreaElement.prototype,"value"],[b.HTMLSelectElement.prototype,"selectedIndex"],[b.HTMLOptionElement.prototype,"selected"]];return w&&w.set&&D.push(...T.map(F=>Yn(F[0],F[1],{set(){$(S)({target:this,isTrusted:!1})}},!1,b))),$(()=>{D.forEach(F=>F())})}(e),c=function({mediaInteractionCb:m,blockClass:g,blockSelector:v,mirror:C,sampling:A,doc:x}){const U=$(k=>Gt($(E=>{const L=Qt(E);if(!L||Se(L,g,v,!0))return;const{currentTime:S,volume:_,muted:D,playbackRate:b,loop:w}=L;m({type:k,id:C.getId(L),currentTime:S,volume:_,muted:D,playbackRate:b,loop:w})}),A.media||500)),M=[ve("play",U(kt.Play),x),ve("pause",U(kt.Pause),x),ve("seeked",U(kt.Seeked),x),ve("volumechange",U(kt.VolumeChange),x),ve("ratechange",U(kt.RateChange),x)];return $(()=>{M.forEach(k=>k())})}(e);let u=()=>{},p=()=>{},d=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:m,mirror:g,stylesheetManager:v},{win:C}){if(!C.CSSStyleSheet||!C.CSSStyleSheet.prototype)return()=>{};const A=C.CSSStyleSheet.prototype.insertRule;C.CSSStyleSheet.prototype.insertRule=new Proxy(A,{apply:$((L,S,_)=>{const[D,b]=_,{id:w,styleId:T}=rt(S,g,v.styleMirror);return(w&&w!==-1||T&&T!==-1)&&m({id:w,styleId:T,adds:[{rule:D,index:b}]}),L.apply(S,_)})}),C.CSSStyleSheet.prototype.addRule=function(L,S,_=this.cssRules.length){const D=`${L} { ${S} }`;return C.CSSStyleSheet.prototype.insertRule.apply(this,[D,_])};const x=C.CSSStyleSheet.prototype.deleteRule;let U,M;C.CSSStyleSheet.prototype.deleteRule=new Proxy(x,{apply:$((L,S,_)=>{const[D]=_,{id:b,styleId:w}=rt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,removes:[{index:D}]}),L.apply(S,_)})}),C.CSSStyleSheet.prototype.removeRule=function(L){return C.CSSStyleSheet.prototype.deleteRule.apply(this,[L])},C.CSSStyleSheet.prototype.replace&&(U=C.CSSStyleSheet.prototype.replace,C.CSSStyleSheet.prototype.replace=new Proxy(U,{apply:$((L,S,_)=>{const[D]=_,{id:b,styleId:w}=rt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,replace:D}),L.apply(S,_)})})),C.CSSStyleSheet.prototype.replaceSync&&(M=C.CSSStyleSheet.prototype.replaceSync,C.CSSStyleSheet.prototype.replaceSync=new Proxy(M,{apply:$((L,S,_)=>{const[D]=_,{id:b,styleId:w}=rt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,replaceSync:D}),L.apply(S,_)})}));const k={};Hr("CSSGroupingRule")?k.CSSGroupingRule=C.CSSGroupingRule:(Hr("CSSMediaRule")&&(k.CSSMediaRule=C.CSSMediaRule),Hr("CSSConditionRule")&&(k.CSSConditionRule=C.CSSConditionRule),Hr("CSSSupportsRule")&&(k.CSSSupportsRule=C.CSSSupportsRule));const E={};return Object.entries(k).forEach(([L,S])=>{E[L]={insertRule:S.prototype.insertRule,deleteRule:S.prototype.deleteRule},S.prototype.insertRule=new Proxy(E[L].insertRule,{apply:$((_,D,b)=>{const[w,T]=b,{id:F,styleId:j}=rt(D.parentStyleSheet,g,v.styleMirror);return(F&&F!==-1||j&&j!==-1)&&m({id:F,styleId:j,adds:[{rule:w,index:[...Wr(D),T||0]}]}),_.apply(D,b)})}),S.prototype.deleteRule=new Proxy(E[L].deleteRule,{apply:$((_,D,b)=>{const[w]=b,{id:T,styleId:F}=rt(D.parentStyleSheet,g,v.styleMirror);return(T&&T!==-1||F&&F!==-1)&&m({id:T,styleId:F,removes:[{index:[...Wr(D),w]}]}),_.apply(D,b)})})}),$(()=>{C.CSSStyleSheet.prototype.insertRule=A,C.CSSStyleSheet.prototype.deleteRule=x,U&&(C.CSSStyleSheet.prototype.replace=U),M&&(C.CSSStyleSheet.prototype.replaceSync=M),Object.entries(k).forEach(([L,S])=>{S.prototype.insertRule=E[L].insertRule,S.prototype.deleteRule=E[L].deleteRule})})}(e,{win:r}),p=$c(e,e.doc),d=function({styleDeclarationCb:m,mirror:g,ignoreCSSAttributes:v,stylesheetManager:C},{win:A}){const x=A.CSSStyleDeclaration.prototype.setProperty;A.CSSStyleDeclaration.prototype.setProperty=new Proxy(x,{apply:$((M,k,E)=>{var L;const[S,_,D]=E;if(v.has(S))return x.apply(k,[S,_,D]);const{id:b,styleId:w}=rt((L=k.parentRule)==null?void 0:L.parentStyleSheet,g,C.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,set:{property:S,value:_,priority:D},index:Wr(k.parentRule)}),M.apply(k,E)})});const U=A.CSSStyleDeclaration.prototype.removeProperty;return A.CSSStyleDeclaration.prototype.removeProperty=new Proxy(U,{apply:$((M,k,E)=>{var L;const[S]=E;if(v.has(S))return U.apply(k,[S]);const{id:_,styleId:D}=rt((L=k.parentRule)==null?void 0:L.parentStyleSheet,g,C.styleMirror);return(_&&_!==-1||D&&D!==-1)&&m({id:_,styleId:D,remove:{property:S},index:Wr(k.parentRule)}),M.apply(k,E)})}),$(()=>{A.CSSStyleDeclaration.prototype.setProperty=x,A.CSSStyleDeclaration.prototype.removeProperty=U})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:m,doc:g}){const v=g.defaultView;if(!v)return()=>{};const C=[],A=new WeakMap,x=v.FontFace;v.FontFace=function(M,k,E){const L=new x(M,k,E);return A.set(L,{family:M,buffer:typeof k!="string",descriptors:E,fontSource:typeof k=="string"?k:JSON.stringify(Array.from(new Uint8Array(k)))}),L};const U=Mt(g.fonts,"add",function(M){return function(k){return setTimeout($(()=>{const E=A.get(k);E&&(m(E),A.delete(k))}),0),M.apply(this,[k])}});return C.push(()=>{v.FontFace=x}),C.push(U),$(()=>{C.forEach(M=>M())})}(e)));const y=function(m){const{doc:g,mirror:v,blockClass:C,blockSelector:A,selectionCb:x}=m;let U=!0;const M=$(()=>{const k=g.getSelection();if(!k||U&&(k!=null&&k.isCollapsed))return;U=k.isCollapsed||!1;const E=[],L=k.rangeCount||0;for(let S=0;S<L;S++){const _=k.getRangeAt(S),{startContainer:D,startOffset:b,endContainer:w,endOffset:T}=_;Se(D,C,A,!0)||Se(w,C,A,!0)||E.push({start:v.getId(D),startOffset:b,end:v.getId(w),endOffset:T})}x({ranges:E})});return M(),ve("selectionchange",M)}(e),h=function({doc:m,customElementCb:g}){const v=m.defaultView;return v&&v.customElements?Mt(v.customElements,"define",function(C){return function(A,x,U){try{g({define:{name:A}})}catch{console.warn(`Custom element callback failed for ${A}`)}return C.apply(this,[A,x,U])}}):()=>{}}(e),I=[];for(const m of e.plugins)I.push(m.observer(m.callback,r,m.options));return $(()=>{pt.forEach(m=>m.reset()),n==null||n.disconnect(),s(),i(),a(),o(),l(),c(),u(),p(),d(),f(),y(),h(),I.forEach(m=>m())})}function Vr(e){return window[e]!==void 0}function Hr(e){return!!(window[e]!==void 0&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Da{constructor(t){R(this,"iframeIdToRemoteIdMap",new WeakMap),R(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,s){const i=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t);let o=i.get(r);return o||(o=this.generateIdFn(),i.set(r,o),a.set(o,r)),o}getIds(t,r){const n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,s))}getRemoteId(t,r,n){const s=n||this.getRemoteIdToIdMap(t);return typeof r!="number"?r:s.get(r)||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class vf{constructor(t){R(this,"iframes",new WeakMap),R(this,"crossOriginIframeMap",new WeakMap),R(this,"crossOriginIframeMirror",new Da(El)),R(this,"crossOriginIframeStyleMirror"),R(this,"crossOriginIframeRootIdMap",new WeakMap),R(this,"mirror"),R(this,"mutationCb"),R(this,"wrappedEmit"),R(this,"loadListener"),R(this,"stylesheetManager"),R(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Da(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,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.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 r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const s=this.transformCrossOriginEvent(n,r.data.event);s&&this.wrappedEmit(s,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case Y.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:Y.IncrementalSnapshot,data:{source:G.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return r;case Y.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case Y.IncrementalSnapshot:switch(r.data.source){case G.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case G.Drag:case G.TouchMove:case G.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case G.ViewportResize:return!1;case G.MediaInteraction:case G.MouseInteraction:case G.Scroll:case G.CanvasMutation:case G.Input:return this.replaceIds(r.data,t,["id"]),r;case G.StyleSheetRule:case G.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case G.Font:return r;case G.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),r;case G.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),r}}return!1}replace(t,r,n,s){for(const i of s)(Array.isArray(r[i])||typeof r[i]=="number")&&(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type===me.Document||t.rootId||(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class bf{constructor(t){R(this,"shadowDoms",new WeakSet),R(this,"mutationCb"),R(this,"scrollCb"),R(this,"bypassOptions"),R(this,"mirror"),R(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,r){if(!Zt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=Hc({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Gc({...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(H.host(t))),this.restoreHandlers.push($c({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(Mt(t.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i),o=H.shadowRoot(this);return o&&Wc(this)&&n.addShadowRoot(o,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var $t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sf=typeof Uint8Array>"u"?[]:new Uint8Array(256),Gr=0;Gr<64;Gr++)Sf[$t.charCodeAt(Gr)]=Gr;const Pa=new Map,Yc=(e,t,r)=>{if(!e||!qc(e,t)&&typeof e!="object")return;const n=function(i,a){let o=Pa.get(i);return o||(o=new Map,Pa.set(i,o)),o.has(a)||o.set(a,[]),o.get(a)}(r,e.constructor.name);let s=n.indexOf(e);return s===-1&&(s=n.length,n.push(e)),s};function cn(e,t,r){if(e instanceof Array)return e.map(n=>cn(n,t,r));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)return{rr_type:e.constructor.name,base64:function(n){var s,i=new Uint8Array(n),a=i.length,o="";for(s=0;s<a;s+=3)o+=$t[i[s]>>2],o+=$t[(3&i[s])<<4|i[s+1]>>4],o+=$t[(15&i[s+1])<<2|i[s+2]>>6],o+=$t[63&i[s+2]];return a%3==2?o=o.substring(0,o.length-1)+"=":a%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[cn(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:s}=e;return{rr_type:n,src:s}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[cn(e.data,t,r),e.width,e.height]}:qc(e,t)||typeof e=="object"?{rr_type:e.constructor.name,index:Yc(e,t,r)}:e}const Jc=(e,t,r)=>e.map(n=>cn(n,t,r)),qc=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function").find(n=>e instanceof t[n]);function _a(e,t,r,n){const s=[];try{const i=Mt(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(o,...l){if(!Se(this,t,r,!0)){const c=function(u){return u==="experimental-webgl"?"webgl":u}(o);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){const u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[o,...l])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function Na(e,t,r,n,s,i){const a=[],o=Object.getOwnPropertyNames(e);for(const l of o)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;const c=Mt(e,l,function(u){return function(...p){const d=u.apply(this,p);if(Yc(d,i,this),"tagName"in this.canvas&&!Se(this.canvas,n,s,!0)){const f=Jc(p,i,this),y={type:t,property:l,args:f};r(this.canvas,y)}return d}});a.push(c)}catch{const c=Yn(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});a.push(c)}return a}const Xc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Fa=typeof window<"u"&&window.Blob&&new Blob([(Ba=Xc,Uint8Array.from(atob(Ba),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Ba;function If(e){let t;try{if(t=Fa&&(window.URL||window.webkitURL).createObjectURL(Fa),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+Xc,{name:e==null?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Cf{constructor(t){R(this,"pendingCanvasMutations",new Map),R(this,"rafStamps",{latestId:0,invokeId:null}),R(this,"mirror"),R(this,"mutationCb"),R(this,"resetObservers"),R(this,"frozen",!1),R(this,"locked",!1),R(this,"processMutation",(l,c)=>{!(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(c)});const{sampling:r="all",win:n,blockClass:s,blockSelector:i,recordCanvas:a,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,i),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,i,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,s,i){const a=_a(r,n,s,!0),o=new Map,l=new If;l.onmessage=f=>{const{id:y}=f.data;if(o.set(y,!1),!("base64"in f.data))return;const{base64:h,type:I,width:m,height:g}=f.data;this.mutationCb({id:y,type:Ct["2D"],commands:[{property:"clearRect",args:[0,0,m,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:I}]},0,0]}]})};const c=1e3/t;let u,p=0;const d=f=>{p&&f-p<c||(p=f,(()=>{const y=[];return r.document.querySelectorAll("canvas").forEach(h=>{Se(h,n,s,!0)||y.push(h)}),y})().forEach(async y=>{var h;const I=this.mirror.getId(y);if(o.get(I)||y.width===0||y.height===0)return;if(o.set(I,!0),["webgl","webgl2"].includes(y.__context)){const g=y.getContext(y.__context);((h=g==null?void 0:g.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const m=await createImageBitmap(y);l.postMessage({id:I,bitmap:m,width:y.width,height:y.height,dataURLOptions:i.dataURLOptions},[m])})),u=requestAnimationFrame(d)};u=requestAnimationFrame(d),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=_a(t,r,n,!1),i=function(o,l,c,u){const p=[],d=Object.getOwnPropertyNames(l.CanvasRenderingContext2D.prototype);for(const f of d)try{if(typeof l.CanvasRenderingContext2D.prototype[f]!="function")continue;const y=Mt(l.CanvasRenderingContext2D.prototype,f,function(h){return function(...I){return Se(this.canvas,c,u,!0)||setTimeout(()=>{const m=Jc(I,l,this);o(this.canvas,{type:Ct["2D"],property:f,args:m})},0),h.apply(this,I)}});p.push(y)}catch{const y=Yn(l.CanvasRenderingContext2D.prototype,f,{set(h){o(this.canvas,{type:Ct["2D"],property:f,args:[h],setter:!0})}});p.push(y)}return()=>{p.forEach(f=>f())}}(this.processMutation.bind(this),t,r,n),a=function(o,l,c,u){const p=[];return p.push(...Na(l.WebGLRenderingContext.prototype,Ct.WebGL,o,c,u,l)),l.WebGL2RenderingContext!==void 0&&p.push(...Na(l.WebGL2RenderingContext.prototype,Ct.WebGL2,o,c,u,l)),()=>{p.forEach(d=>d())}}(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const s=n.map(a=>{const{type:o,...l}=a;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:s}),this.pendingCanvasMutations.delete(t)}}class kf{constructor(t){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new pf),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},s=[];for(const i of t){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),s.push({styleId:a,rules:Array.from(i.rules||CSSRule,(o,l)=>({rule:Cl(o,i.href),index:l}))})),n.styleIds.push(a)}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Ef{constructor(){R(this,"nodeMap",new WeakMap),R(this,"active",!1)}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let ce,un,hs,Sn=!1;try{if(Array.from([1],e=>2*e)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ko=e.contentWindow)==null?void 0:ko.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Me=new kl;function Yt(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:o=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:f,maskInputFn:y,maskTextFn:h,hooks:I,packFn:m,sampling:g={},dataURLOptions:v={},mousemoveWait:C,recordDOM:A=!0,recordCanvas:x=!1,recordCrossOriginIframes:U=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:E=!1,inlineImages:L=!1,plugins:S,keepIframeSrcFn:_=()=>!1,ignoreCSSAttributes:D=new Set([]),errorHandler:b}=e;Kt=b;const w=!U||window.parent===window;let T=!1;if(!w)try{window.parent.document&&(T=!1)}catch{T=!0}if(w&&!t)throw new Error("emit function is required");if(!w&&!T)return()=>{};C!==void 0&&g.mousemove===void 0&&(g.mousemove=C),Me.reset();const F=p===!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}:d!==void 0?d:{password:!0},j=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",headTitleMutations:f==="all"}:f||{};let O;(function(V=window){"NodeList"in V&&!V.NodeList.prototype.forEach&&(V.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in V&&!V.DOMTokenList.prototype.forEach&&(V.DOMTokenList.prototype.forEach=Array.prototype.forEach)})();let N=0;const ee=V=>{for(const Ae of S||[])Ae.eventProcessor&&(V=Ae.eventProcessor(V));return m&&!T&&(V=m(V)),V};ce=(V,Ae)=>{var ne;const oe=V;if(oe.timestamp=bn(),!((ne=pt[0])!=null&&ne.isFrozen())||oe.type===Y.FullSnapshot||oe.type===Y.IncrementalSnapshot&&oe.data.source===G.Mutation||pt.forEach(Le=>Le.unfreeze()),w)t==null||t(ee(oe),Ae);else if(T){const Le={type:"rrweb",event:ee(oe),origin:window.location.origin,isCheckout:Ae};window.parent.postMessage(Le,"*")}if(oe.type===Y.FullSnapshot)O=oe,N=0;else if(oe.type===Y.IncrementalSnapshot){if(oe.data.source===G.Mutation&&oe.data.isAttachIframe)return;N++;const Le=n&&N>=n,q=r&&oe.timestamp-O.timestamp>r;(Le||q)&&un(!0)}};const J=V=>{ce({type:Y.IncrementalSnapshot,data:{source:G.Mutation,...V}})},W=V=>ce({type:Y.IncrementalSnapshot,data:{source:G.Scroll,...V}}),we=V=>ce({type:Y.IncrementalSnapshot,data:{source:G.CanvasMutation,...V}}),fe=new kf({mutationCb:J,adoptedStyleSheetCb:V=>ce({type:Y.IncrementalSnapshot,data:{source:G.AdoptedStyleSheet,...V}})}),Ie=new vf({mirror:Me,mutationCb:J,stylesheetManager:fe,recordCrossOriginIframes:U,wrappedEmit:ce});for(const V of S||[])V.getMirror&&V.getMirror({nodeMirror:Me,crossOriginIframeMirror:Ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ie.crossOriginIframeStyleMirror});const wt=new Ef;hs=new Cf({recordCanvas:x,mutationCb:we,win:window,blockClass:s,blockSelector:i,mirror:Me,sampling:g.canvas,dataURLOptions:v});const Sr=new bf({mutationCb:J,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:F,dataURLOptions:v,maskTextFn:h,maskInputFn:y,recordCanvas:x,inlineImages:L,sampling:g,slimDOMOptions:j,iframeManager:Ie,stylesheetManager:fe,canvasManager:hs,keepIframeSrcFn:_,processedNodeManager:wt},mirror:Me});un=(V=!1)=>{if(!A)return;ce({type:Y.Meta,data:{href:window.location.href,width:_c(),height:Pc()}},V),fe.reset(),Sr.init(),pt.forEach(ne=>ne.lock());const Ae=function(ne,oe){const{mirror:Le=new kl,blockClass:q="rr-block",blockSelector:Pt=null,maskTextClass:rd="rr-mask",maskTextSelector:nd=null,inlineStylesheet:sd=!0,inlineImages:id=!1,recordCanvas:od=!1,maskAllInputs:qn=!1,maskTextFn:ad,maskInputFn:ld,slimDOM:_t=!1,dataURLOptions:cd,preserveWhiteSpace:ud,onSerialize:dd,onIframeLoad:pd,iframeLoadTimeout:hd,onStylesheetLoad:md,stylesheetLoadTimeout:fd,keepIframeSrcFn:gd=()=>!1}=oe||{};return Et(ne,{doc:ne,mirror:Le,blockClass:q,blockSelector:Pt,maskTextClass:rd,maskTextSelector:nd,skipChild:!1,inlineStylesheet:sd,maskInputOptions:qn===!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}:qn===!1?{password:!0}:qn,maskTextFn:ad,maskInputFn:ld,slimDOMOptions:_t===!0||_t==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:_t==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:_t===!1?{}:_t,dataURLOptions:cd,inlineImages:id,recordCanvas:od,preserveWhiteSpace:ud,onSerialize:dd,onIframeLoad:pd,iframeLoadTimeout:hd,onStylesheetLoad:md,stylesheetLoadTimeout:fd,keepIframeSrcFn:gd,newlyAddedElement:!1})}(document,{mirror:Me,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:F,maskTextFn:h,maskInputFn:y,slimDOM:j,dataURLOptions:v,recordCanvas:x,inlineImages:L,onSerialize:ne=>{Bc(ne,Me)&&Ie.addIframe(ne),zc(ne,Me)&&fe.trackLinkElement(ne),ai(ne)&&Sr.addShadowRoot(H.shadowRoot(ne),document)},onIframeLoad:(ne,oe)=>{Ie.attachIframe(ne,oe),Sr.observeAttachShadow(ne)},onStylesheetLoad:(ne,oe)=>{fe.attachLinkElement(ne,oe)},keepIframeSrcFn:_});if(!Ae)return console.warn("Failed to snapshot the document");ce({type:Y.FullSnapshot,data:{node:Ae,initialOffset:Dc(window)}},V),pt.forEach(ne=>ne.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&fe.adoptStyleSheets(document.adoptedStyleSheets,Me.getId(document))};try{const V=[],Ae=oe=>{var Le;return $(wf)({mutationCb:J,mousemoveCb:(q,Pt)=>ce({type:Y.IncrementalSnapshot,data:{source:Pt,positions:q}}),mouseInteractionCb:q=>ce({type:Y.IncrementalSnapshot,data:{source:G.MouseInteraction,...q}}),scrollCb:W,viewportResizeCb:q=>ce({type:Y.IncrementalSnapshot,data:{source:G.ViewportResize,...q}}),inputCb:q=>ce({type:Y.IncrementalSnapshot,data:{source:G.Input,...q}}),mediaInteractionCb:q=>ce({type:Y.IncrementalSnapshot,data:{source:G.MediaInteraction,...q}}),styleSheetRuleCb:q=>ce({type:Y.IncrementalSnapshot,data:{source:G.StyleSheetRule,...q}}),styleDeclarationCb:q=>ce({type:Y.IncrementalSnapshot,data:{source:G.StyleDeclaration,...q}}),canvasMutationCb:we,fontCb:q=>ce({type:Y.IncrementalSnapshot,data:{source:G.Font,...q}}),selectionCb:q=>{ce({type:Y.IncrementalSnapshot,data:{source:G.Selection,...q}})},customElementCb:q=>{ce({type:Y.IncrementalSnapshot,data:{source:G.CustomElement,...q}})},blockClass:s,ignoreClass:a,ignoreSelector:o,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:u,sampling:g,recordDOM:A,recordCanvas:x,inlineImages:L,userTriggeredOnInput:k,collectFonts:E,doc:oe,maskInputFn:y,maskTextFn:h,keepIframeSrcFn:_,blockSelector:i,slimDOMOptions:j,dataURLOptions:v,mirror:Me,iframeManager:Ie,stylesheetManager:fe,shadowDomManager:Sr,processedNodeManager:wt,canvasManager:hs,ignoreCSSAttributes:D,plugins:((Le=S==null?void 0:S.filter(q=>q.observer))==null?void 0:Le.map(q=>({observer:q.observer,options:q.options,callback:Pt=>ce({type:Y.Plugin,data:{plugin:q.name,payload:Pt}})})))||[]},I)};Ie.addLoadListener(oe=>{try{V.push(Ae(oe.contentDocument))}catch(Le){console.warn(Le)}});const ne=()=>{un(),V.push(Ae(document)),Sn=!0};return document.readyState==="interactive"||document.readyState==="complete"?ne():(V.push(ve("DOMContentLoaded",()=>{ce({type:Y.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ne()})),V.push(ve("load",()=>{ce({type:Y.Load,data:{}}),M==="load"&&ne()},window))),()=>{V.forEach(oe=>oe()),wt.destroy(),Sn=!1,Kt=void 0}}catch(V){console.warn(V)}}var za,St;Yt.addCustomEvent=(e,t)=>{if(!Sn)throw new Error("please add custom event after start recording");ce({type:Y.Custom,data:{tag:e,payload:t}})},Yt.freezePage=()=>{pt.forEach(e=>e.freeze())},Yt.takeFullSnapshot=e=>{if(!Sn)throw new Error("please take full snapshot after start recording");un(e)},Yt.mirror=Me,(St=za||(za={}))[St.NotStarted=0]="NotStarted",St[St.Running=1]="Running",St[St.Stopped=2]="Stopped";var Ue=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.FeedbackClosed="feedback.closed",e.PageChange="page.change",e.API="api",e.Override="override",e))(Ue||{}),B=(e=>(e.ReplayCapture="replay.capture",e.ReplayPaused="replay.paused",e.ReplayResumed="replay.resumed",e.FeedbackButtonLoaded="feedback.button.loaded",e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyCloseRequested="survey.closeRequested",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.SurveyWidth="survey.width",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e.QuestionAnswered="question.answered",e))(B||{});const pr={FEEDBACK_BUTTON_LOADED:"feedback.button.loaded",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_WIDTH:"survey.width",SURVEY_PRESENTED:"survey.presented",SURVEY_LIFE_CYCLE:"survey.lifeCycle",SURVEY_WILL_CLOSE:"survey.willClose",SURVEY_WILL_PRESENT:"survey.will.present",QUESTION_ANSWERED:"question.answered",REPLAY_CAPTURE:"replay.capture",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"}};let $r;const xf=new Uint8Array(16);function Rf(){if(!$r&&($r=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $r(xf)}const ge=[];for(let e=0;e<256;++e)ge.push((e+256).toString(16).slice(1));const ja={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function yt(e,t,r){if(ja.randomUUID&&!e)return ja.randomUUID();const n=(e=e||{}).random||(e.rng||Rf)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(s,i=0){return ge[s[i+0]]+ge[s[i+1]]+ge[s[i+2]]+ge[s[i+3]]+"-"+ge[s[i+4]]+ge[s[i+5]]+"-"+ge[s[i+6]]+ge[s[i+7]]+"-"+ge[s[i+8]]+ge[s[i+9]]+"-"+ge[s[i+10]]+ge[s[i+11]]+ge[s[i+12]]+ge[s[i+13]]+ge[s[i+14]]+ge[s[i+15]]}(n)}const P=new class{constructor(){de(this,"breadcrumbs",[])}getTimeStamp(){return new Date().toISOString()}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>300&&this.breadcrumbs.shift()}debug(e,t="debug"){this.addBreadcrumb({category:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"debug"})}error(e,t={}){this.addBreadcrumb({category:"error",data:t,level:"error",message:e,timestamp:this.getTimeStamp(),type:"error"})}http(e,t){this.addBreadcrumb({category:"xhr",data:t,message:e,timestamp:this.getTimeStamp(),type:"http"})}info(e,t={}){this.addBreadcrumb({category:"info",data:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"info"})}navigation(e,t){this.addBreadcrumb({category:"navigation",data:t,message:e,timestamp:this.getTimeStamp(),type:"navigation"})}},Wa=()=>{try{return window.parent.Intercom}catch{return null}},Va=[Object.freeze(Object.defineProperty({__proto__:null,disable:()=>{const e=Wa();e&&(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},enable:()=>{const e=Wa();e&&(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)}},Symbol.toStringTag,{value:"Module"}))];class Zc{static disable(){Va.forEach(t=>t.disable())}static enable(){Va.forEach(t=>t.enable())}}var Lf=class extends Error{constructor(e,t,r){super(`Possible EventEmitter memory leak detected. ${r} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=t,this.count=r,this.name="MaxListenersExceededWarning"}},Kc=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=Kc.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}_emitInternalEvent(e,t,r){this.emit(e,t,r)}_getListeners(e){return Array.prototype.concat.apply([],this.events.get(e))||[]}_removeListener(e,t){const r=e.indexOf(t);return r>-1&&e.splice(r,1),[]}_wrapOnceListener(e,t){const r=(...n)=>(this.removeListener(e,r),t.apply(this,n));return Object.defineProperty(r,"name",{value:t.name}),r}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(e,...t){const r=this._getListeners(e);return r.forEach(n=>{n.apply(this,t)}),r.length>0}addListener(e,t){this._emitInternalEvent("newListener",e,t);const r=this._getListeners(e).concat(t);if(this.events.set(e,r),this.maxListeners>0&&this.listenerCount(e)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;const n=new Lf(this,e,this.listenerCount(e));console.warn(n)}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 r=this._getListeners(e);if(r.length>0){const n=[t].concat(r);this.events.set(e,n)}else this.events.set(e,r.concat(t));return this}prependOnceListener(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}removeListener(e,t){const r=this._getListeners(e);return r.length>0&&(this._removeListener(r,t),this.events.set(e,r),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)}},Qc=Kc;Qc.defaultMaxListeners=10;const z=new Qc,In=async e=>{await new Promise(t=>{setTimeout(t,e)})},eo=({"userleap-platform":e})=>{var t;return((t=window.UserLeap)==null?void 0:t.forceDirectEmbed)||e!=="web"};class eu{constructor(t){de(this,"storage");de(this,"tempStorage",{});de(this,"isStorageAvailable");try{this.storage=window[t];const r="__storage_test__";this.storage.setItem(r,r),this.storage.removeItem(r),this.isStorageAvailable=!0}catch{this.isStorageAvailable=!1}}setItem(t,r){this.isStorageAvailable&&this.storage?this.storage.setItem(t,r):this.tempStorage[t]=r}setItemObject(t,r){try{this.setItem(t,JSON.stringify(r))}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to save to local storage",n))}}getItem(t){return this.isStorageAvailable&&this.storage?this.storage.getItem(t):this.tempStorage[t]}getItemObject(t){const r=this.getItem(t);if(r)try{return JSON.parse(r)}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to parse local storage",n))}return{}}removeItem(t){this.isStorageAvailable&&this.storage?this.storage.removeItem(t):delete this.tempStorage[t]}clear(){this.isStorageAvailable&&this.storage?this.storage.clear():this.tempStorage={}}}const ue=new eu("sessionStorage"),Ee=new eu("localStorage");class Of{constructor(t){de(this,"payload");de(this,"promise");de(this,"reject",()=>{});de(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((r,n)=>{this.reject=n,this.resolve=r})}resolveRequest(t){this.resolve(t)}}const re={replay:null},Af=()=>{const e=[];return re.replay&&e.push("replay"),e.join(",")},Mf=10;let tu=!1,ru="",Yr=!1,nu=!1,dn=[];const Uf=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?"web-gtm":e._segment?"web-segment":"web-snippet",Ha=e=>{var t;(t=e==null?void 0:e.blockedURI)!=null&&t.includes(window.UserLeap._API_URL)&&(nu=!0,console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`))},ci=(e="")=>{tu=!0,ru=e};function Pe(e={}){const t={"Content-Type":"application/json","userleap-platform":"web","x-ul-sdk-version":"2.39.2","x-ul-installation-method":Uf(e),"sprig-modules":Af(),"x-ul-package-version":"2.39.2"};if(e.envId&&(t["x-ul-environment-id"]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t["x-ul-user-id"]=e.userId),e.visitorId&&(t["x-ul-visitor-id"]=e.visitorId),e.partnerAnonymousId&&(t["x-ul-anonymous-id"]=e.partnerAnonymousId),e.mobileHeadersJSON){const r=JSON.parse(e.mobileHeadersJSON);Object.assign(t,r)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t["x-ul-preview-mode"]="1"),t}const Ga=async({shouldDropOnRateLimit:e,...t})=>{if(e)return{status:429};{const r=new Of(t);return dn.push(r),r.promise}},Ge=async(e,t)=>{const{retries:r=0,shouldDropOnRateLimit:n=!1,shouldRetryRequest:s=!1,...i}=t,a={url:e,options:i,retries:r,shouldDropOnRateLimit:n};if(Yr&&!s)return Ga(a);const o={ok:!1,reportError:!1};if(tu)return console.info(`UserLeap - ${ru}`),o;try{const l=await fetch(e,i);if(l.status===429){if(!Yr&&!n||s){Yr=!0;const c=l.headers.has("ratelimit-reset")?Number(l.headers.get("ratelimit-reset")):Mf;return await In(1e3*c),Ge(e,{...i,shouldDropOnRateLimit:n,shouldRetryRequest:!0})}return Ga(a)}if(Yr=!1,dn.length&&(dn.map(c=>{const u=c.payload;Ge(u.url,{...u.options,retries:u.retries,shouldDropOnRateLimit:u.shouldDropOnRateLimit}).then(p=>{c.resolveRequest(p)})}),dn=[]),l.ok){if(l.status===249)return ci(),o;const c=await l.text();try{return c&&c!=="OK"&&(l.json=JSON.parse(c)),l}catch{return{ok:!1,reportError:!1,error:new Error(`failed parsing response json for ${e} - ${c}`)}}}return l}catch(l){const c=r+1;return c>5||nu?{ok:!1,reportError:!1,error:l}:(await In(1e3*Math.pow(2,r)),Ge(e,{...i,retries:c}))}},$a="ul-view-sdk-script",Tf=new Set(["ios","android"]),st="visitors",it="environments";async function je(e,t){var i,a,o;const{shouldDropOnRateLimit:r,...n}=t;n.headers=Object.assign(Pe(window.UserLeap),n.headers);const s=await Ge(e,{...n,shouldDropOnRateLimit:r});if(s.ok){const l=(i=s.headers)==null?void 0:i.get("Authorization"),c=l?l.split(" "):void 0,u=c&&c.length===2?c[1]:void 0,p=(a=s.headers)==null?void 0:a.get("x-ul-visitor-id");if(window.UserLeap.userId&&p===window.UserLeap.visitorId){const d=Ee.getItemObject("sprig.anon.env.vid.map");d&&d[window.UserLeap.envId]===p&&(delete d[window.UserLeap.envId],Ee.setItemObject("sprig.anon.env.vid.map",d))}u&&p&&(p!==window.UserLeap.visitorId||window.UserLeap.token!==u)&&(ke("token",u),ke("vid",p),z.emit(B.VisitorIDUpdated,{visitorId:p}),window.UserLeap.token=u,window.UserLeap.visitorId=p)}return(o=s.json)!=null&&o.logMessage&&console.warn(`[Sprig] ${s.json.logMessage}`),s}function ke(e,t){const r=Ee.getItemObject("userleap.ids");let n=r[window.UserLeap.envId];n?n[e]=t:n={[e]:t},r[window.UserLeap.envId]=n,Ee.setItemObject("userleap.ids",r)}function to(){return window.previewMode?"0":window.UserLeap.visitorId??""}function Te(e,t,r){const n=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(s=>{n.push(s),s===it?n.push(window.UserLeap.envId):s===st&&n.push(to())}),r&&n.push(r),n.join("/")}const er=async(e,t,r)=>{var N,ee,J;const{context:n,delay:s,avatars:i,forceBrandedLogo:a,endCard:o,isFeedback:l=!1,heatmap:c,locale:u,layout:p,previewMode:d,productConfig:f,questions:y,responseGroupUid:h,surveyId:I,uuid:m,vid:g,sessionReplay:v,studyType:C}=e,A=Pe(window.UserLeap),x=hr(A),U=Jn(A);if(v)if(x)z.emit(B.ReplayCapture,{responseGroupUid:h,hasQuestions:!!(y!=null&&y.length),surveyId:I,uploadId:v.uploadId,replayType:v.replayDurationType??"before",seconds:v.replayDurationSeconds,generateVideoUploadUrlPayload:{mediaRecordingUid:yt(),mediaType:"screen",questionId:1,responseGroupUid:h,surveyId:I,updatedAt:new Date().toISOString(),visitorId:window.UserLeap.visitorId,isReplay:!0}});else{if(!re.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};re.replay.scheduleOrCaptureReplay({responseGroupId:h,surveyId:I,visitorId:g,replayParams:v,completeUploadHeaders:A,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:y.length===0})}if(c){if(!re.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};const{eventId:W,replayParams:we,responseGroupUid:fe,surveyId:Ie}=c;await re.replay.initializeReplay({maxReplayDurationSeconds:300,maxInflightRequests:window.UserLeap.maxInflightReplayRequests,teardownAfter:!0,apiUrl:window.UserLeap._API_URL,replaySettings:r}),re.replay.tryReplayAction(()=>{var wt;return(wt=re.replay)==null?void 0:wt.scheduleCapture({apiUrl:window.UserLeap._API_URL,completeUploadHeaders:A,eventId:W,isHeatmap:!0,replayParams:we,responseGroupId:fe,surveyId:Ie,triggerTimestamp:Date.now(),visitorId:g})},"Error in scheduling/capturing replay")}if(g==null||!(y!=null&&y.length))return P.info("CannotDisplaySurvey",{vid:g}),{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(Df(y))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:"no survey"};if(window.UserLeap.container){P.info("AlreadyDisplayingSurvey");const W="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(W),{success:!1,message:W,surveyState:"no survey"}}if(g!==window.UserLeap.visitorId&&m!==window.UserLeap.visitorId&&!window.previewMode){const W="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(W)),{success:!1,message:W,surveyState:"no survey"}}P.info("ShowingSurvey",{surveyId:I}),(N=re.replay)==null||N.RecordSurveyShown({id:I,userAgent:window.navigator.userAgent}),Zc.disable(),z.emit(B.SurveyWillPresent,{name:B.SurveyWillPresent,"survey.id":I,layout:p});let M,k,E,L,S=document.createElement("div");const _=W=>{const{"view.version":we}=W;we!==A["x-ul-sdk-version"]&&iu(),z.removeListener("verify.view.version",_)};z.on("verify.view.version",_),window.UserLeap.useMobileStyling=U,eo(A)?(M="ul-direct-embeded-frame",k=document.head,E=window,L=!1,(()=>{const W=Pe(window.UserLeap),we=hr(W),fe=window.UserLeap.forceDirectEmbed,Ie=W["userleap-platform"]==="web";return we||fe&&Ie})()&&(su(I,l),S.id=M,window.UserLeap.container.appendChild(S),ou(),z.emit(B.SurveyLifeCycle,{state:"presented"}),z.emit(B.SurveyPresented,{name:B.SurveyPresented,"survey.id":I}))):{frameId:M,contentWinDocHead:k,contentWindow:E,hasOverlay:L,iframe:S}=_f({productConfig:f,useMobileStyling:U,surveyId:I,isFeedback:l}),window.UserLeap.frameId=M;const D={apiURL:window.UserLeap._API_URL,avatars:i,cards:y,configureExitOnOverlayClick:W=>{z.once(B.CloseSurveyOnOverlayClick,W)},context:n,endCard:o,envId:window.UserLeap.envId,eventEmitFn:z.emit.bind(z),fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,forceBrandedLogo:a,frame:S,headers:A,layout:p,locale:u,mobileSDKVersion:window.UserLeap.mobileSDKVersion,previewKey:Ee.getItem("sprig.previewKey"),previewMode:d,productConfig:{framePosition:f==null?void 0:f.framePosition,desktopDisplay:f==null?void 0:f.desktopDisplay,placement:f==null?void 0:f.placement},responseGroupUid:h,startingQuestionIdx:(ee=window.UserLeap.config)==null?void 0:ee.startingQuestionIdx,studyType:C,styleNonce:window.UserLeap.styleNonce,surveyId:I,tabTitle:document.title,trackPageViewUrl:t,ulEvents:pr,upchunkLibraryURL:window.UserLeap.upchunkLibraryURL,useMobileStyling:U,userId:m,viewDocument:E==null?void 0:E.document,viewWindow:E,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},...window.UserLeap._config};(J=window.UserLeap._config)!=null&&J.startingQuestionIdx&&(window.UserLeap._config={...window.UserLeap._config,startingQuestionIdx:null});const b=(l?window.UserLeap.feedbackCustomStyles:window.UserLeap.customStyles)??f.customStyles;D.customStyles=b,E&&(E.__cfg=D);const w=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:D.path,T=document.getElementById($a);T&&T.remove();const F=function(){const W=document.createElement("script");return window.UserLeap.nonce&&W.setAttribute("nonce",window.UserLeap.nonce),W.id=$a,W}(),j=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};if(D.installationMethod==="web-npm"||D.installationMethod==="web-npm-bundled"){const{default:W}=await Promise.resolve().then(()=>require("./view-BKkN3Cj6.cjs")).then(we=>we.view);W.configure(D),L&&window.UserLeap.container&&j()}else w&&(F.src=w,L&&F.addEventListener("load",()=>{window.UserLeap.container&&j()}),E==null||E.addEventListener("error",W=>{W.target instanceof HTMLScriptElement&&W.target.src===w&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0}));k==null||k.appendChild(F);const O={success:!0,surveyState:"ready",surveyId:I,responseGroupUid:h};return window.UserLeap.isMobileSDK&&s&&(O.delay=s),O};function Jn(e){var r;if(window.UserLeap.useMobileStyling!==void 0)return window.UserLeap.useMobileStyling;const t=((r=window.UserLeap.windowDimensions)==null?void 0:r.width)??document.body.clientWidth;return hr(e)||t>10&&t<500}function hr(e){return Tf.has(e["userleap-platform"])}const Df=e=>e.some(t=>t.type==="videovoice"),ro="ul-frame";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 ms="0px",su=(e,t,r)=>{window.UserLeap.container=document.createElement("div"),window.UserLeap.container.className="ul-container"+(t?" ul-container-feedback":""),e&&(window.UserLeap.container.dataset.studyId=e.toString());const n=uu();r&&n&&!window.UserLeap.useMobileStyling?n.appendChild(window.UserLeap.container):document.body.appendChild(window.UserLeap.container)},iu=(e,t)=>{var n;Ff();const r=window.UserLeap.container;if(r)try{(n=r.parentNode)==null||n.removeChild(r),window.UserLeap.container=null,ke("trackStartUrl",null),z.emit(B.SurveyLifeCycle,{state:"dismissed"}),z.emit(B.SurveyClosed,{name:B.SurveyClosed,initiator:e,"survey.id":parseInt(r.dataset.studyId),...t&&{studyType:t}})}catch(s){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+r),s instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",s)}},ou=()=>{z.once(B.SurveyWillClose,({initiator:e,studyType:t})=>{z.removeAllListeners(B.CloseSurveyOnOverlayClick),iu(e,t)})},Pf=(e,t,r,n)=>{var u,p;const s={position:"fixed",bottom:"0px",right:ms,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646,transition:"width 0.2s ease-in-out, height 0.2s ease-in-out",maxWidth:"100%"},i=Object.assign({},t,window.UserLeap),{desktopDisplay:a}=t||{},o=a==="center-modal";let l;o&&(i.framePosition="center");let c=!1;if(r)(u=window.UserLeap.windowDimensions)!=null&&u.width?s.width=`${window.UserLeap.windowDimensions.width}px`:s.width="100%",(p=window.UserLeap.windowDimensions)!=null&&p.height?s.maxHeight=window.UserLeap.windowDimensions.height-20+"px":window.UserLeap.maxHeight?s.maxHeight=window.UserLeap.maxHeight:s.maxHeight=document.body.clientHeight-20+"px",["light","dark"].includes(i.overlayStyleMobile)&&(c=!0);else{s.width="360px",s.maxHeight=window.UserLeap.maxHeight||"66vh";const d=()=>{c=!0,l={margin:"auto",position:"static"}};if(n)o?d():l={position:"relative",height:"300px"};else switch(i.framePosition){case"bottomLeft":l={left:ms};break;case"topLeft":l={left:ms,top:0};break;case"topRight":l={top:0};break;case"center":d()}}return c&&((d,f)=>{const y={position:"fixed",overflow:"auto",top:"0px",left:"0px",display:"none",height:"100%",width:"100%",transition:"background-color 0.3s ease-out",zIndex:2147483646},h=f?d.overlayStyleMobile:d.overlayStyle;y["background-color"]=h==="light"?"rgba(255,255,255, 0.95)":"rgba(0,0,0,0.9)",f||(y.margin="auto"),window.UserLeap.container&&Object.assign(window.UserLeap.container.style,y)})(i,r),Object.assign(e.style,s,l),c},_f=({productConfig:e,useMobileStyling:t,surveyId:r,isFeedback:n})=>{var d,f;const s=ro,i=n&&e.desktopDisplay==="slider";su(r,n,i),Nf();const a=document.createElement("iframe");a.id=s,a.setAttribute("title","Sprig User Feedback Dialog");const o=Pf(a,e,t,n);ou();let l=!1;a.setHeight=y=>{parseInt(a.style.height)==y&&l||(l=!0,a.style.height=`${y}px`,z.emit(B.SurveyHeight,{name:B.SurveyHeight,contentFrameHeight:y,"survey.id":r}))};let c=!1;a.setWidth=y=>{parseInt(a.style.width)==y&&c||(c=!0,a.style.width=`${y}px`,z.emit(B.SurveyWidth,{name:B.SurveyWidth,contentFrameWidth:y,"survey.id":r}))},(d=window.UserLeap.container)==null||d.appendChild(a),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{z.emit(B.CloseSurveyOnOverlayClick)}),z.emit(B.SurveyLifeCycle,{state:"presented"}),z.emit(B.SurveyPresented,{name:B.SurveyPresented,"survey.id":r});const u=(f=a.contentWindow)==null?void 0:f.document;if(u&&(u.open("text/html","replace"),u.write("<!doctype html><head></head><body></body></html>"),u.close(),!t)){const y=u.body;y.style.display="flex",y.style.alignItems="center"}const p=u==null?void 0:u.head;return{frameId:s,contentWinDocHead:p,contentWindow:a.contentWindow,hasOverlay:o,iframe:a}},au={[B.SurveyFadingOut]:()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}},Nf=()=>{Object.entries(au).forEach(([e,t])=>{z.on(e,t)})},Ff=()=>{Object.entries(au).forEach(([e,t])=>{z.off(e,t)})},Ya=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 no(e,t){const{matchType:r,pattern:n}=e,s=r?Ya[r]:Ya.legacy;let i=!1;try{i=s(n,t)}catch(a){const o=`[Sprig] (ERR-445) Failed to check url match with pattern ${n}`;a instanceof Error&&(console.warn(o,a),a.stack=JSON.stringify(e),window.UserLeap.reportError(o,a))}return i}const lu=e=>{const{pageUrlEvents:t}=window.UserLeap._config,r=t==null?void 0:t.find(n=>n.id===e);return!!r&&no(r,window.location.href)},ze=e=>!!e&&e.nodeType===Node.ELEMENT_NODE,Ja=e=>e instanceof HTMLElement||e instanceof SVGElement,mr=({document:e,elementId:t,styleString:r,nonce:n})=>{const s=e.getElementById(t);if(s)return void(s.textContent=r);const i=e.createElement("style");n&&(i.nonce=n),i.textContent=r,i.id=t,e.head.appendChild(i)},Bf=(e,t)=>{const r=t.querySelector(".sprig-question-body");if(!ze(r))return e;const n=r.scrollHeight;return n<100?e:e-(n-100)},qa=(e,t)=>{const r=t.querySelector(e);if(!ze(r))return 0;const n=getComputedStyle(r);return parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+(parseFloat(n.marginLeft)+parseFloat(n.marginRight))+(parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth))},cu=(e,t,r)=>{const n=e.querySelector(".ul-card__container"),s=e.querySelector(".ul-app");let i=600,a=360,o=0;if(ze(n)&&ze(s)){const l=n.querySelector(".ul-card--matrix_grid"),c=!l&&t&&r;try{c&&(s.style.width="360px"),i=n.clientHeight,i+=(d=>{const f=d.querySelector(".sprig-question-body"),y=d.querySelector(".ul-card"),h=d.querySelector(".ul-card-main-content"),I=d.querySelector(".ul-footer"),m=d.querySelector(".sprig-container");let g=0;return ze(y)&&(g+=y.scrollHeight-y.clientHeight),ze(h)&&(g+=h.scrollHeight-h.clientHeight),ze(f)&&(g+=f.scrollHeight-f.clientHeight),ze(I)&&ze(m)&&m.clientHeight===0&&(g+=I.clientHeight),g})(e);const u=getComputedStyle(n);o=i;const p=parseFloat(u.marginTop)+parseFloat(u.marginBottom);i+=p+(parseFloat(u.borderTopWidth)+parseFloat(u.borderBottomWidth)),l&&(a=l.scrollWidth,a+=qa(".ul-card__container",e),a+=qa(".sprig-question-body",e))}finally{c&&s.style.removeProperty("width")}}return[i+1,a,Bf(o,e)]},uu=()=>K,Lt=()=>document.getElementById("sprig-feedback-container"),ui=()=>document.getElementById("sprig-feedback-loading-animation"),du=()=>!!document.getElementById(ro);let Xa=!1,K=null,We=null,so=!1,tr=null,ut=null;const zf=["bottom-left","bottom-right","center-left","center-right"],Cn=()=>{var t;const e=window.UserLeap.container;return((t=e==null?void 0:e.parentElement)==null?void 0:t.id)==="sprig-feedback-loading-container"},pu=()=>document.getElementById("sprig-feedback-error-container"),hu=()=>{if(!K)return 0;const e=K==null?void 0:K.clientWidth,t=window.getComputedStyle(K);return e+parseInt(t.borderRightWidth||"0")+parseInt(t.borderLeftWidth||"0")},kn=e=>{const t=Lt();t&&(ut!=null&&ut.endsWith("right")?t.style.right=`${e}px`:ut!=null&&ut.endsWith("left")&&(t.style.left=`${e}px`))},fs=()=>{if(K&&(Cn()||pu())){z.off(B.SurveyAppeared,Jt),di();const e=hu();return kn(-e),!0}return!1},Jt=()=>{if(!K||!We)return;const e=ui();e&&e.remove(),K.style.height="auto",K.style.width="auto",We.disabled=!1,so=!1},di=()=>{if(K&&!ui()){const e=(()=>{if(ui())return;const t=document.createElement("div");return t.className="ul-loading-spinner-container",t.id="sprig-feedback-loading-animation",t.role="progressbar",t.setAttribute("aria-live","polite"),t.setAttribute("aria-busy","true"),t.setAttribute("aria-label","Processing..."),t.innerHTML=`
56
- <div class="ul-loading-spinner">
57
- <div class="first"></div>
58
- <div class="second"></div>
59
- <div class="third"></div>
60
- <div class="fourth"></div>
61
- </div>
62
- `,t})();e&&(K.style.height="300px",K.style.width="360px",K.appendChild(e))}},Za=()=>{K&&We&&(kn(0),We.disabled=!0,so=!0)},mu=async(e,t,r)=>{const{buttonTheme:n,customStyles:s,eventId:i,placement:a,desktopDisplay:o,feedbackLabel:l,surveyUuid:c,surveyId:u}=e;window.UserLeap.feedbackCustomStyles=void 0;let p=Lt();if(p){if(!t&&i===tr)return;p.remove(),z.off(pr.SURVEY_FADING_OUT,fs)}tr=i,mr({document,elementId:"sprig-feedback-style",styleString:'.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)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}#sprig-feedback-button{border-left:0;border-radius:0 8px 8px 0;display:grid;padding:8px;text-align:center;transition:all ease-in-out 1s;z-index:inherit}#sprig-feedback-button:hover{cursor:pointer}.sprig-feedback-button-label{writing-mode:vertical-lr;text-orientation:sideways}.sprig-feedback-button-right{transform:rotate(180deg)}.sprig-feedback-button-bottom{align-self:flex-end;margin-bottom:20px}.sprig-feedback-button-light{background:#efefee;color:#000;border:1px solid #e2e3e1}.sprig-feedback-button-dark{background:#000;color:#fff;border:1px solid #000000}#sprig-feedback-container{display:flex;align-items:center;position:fixed;transition:right .2s linear,left .2s linear;z-index:2147483646}.sprig-feedback-container-left{flex-flow:row-reverse}.sprig-feedback-container-center{top:50%;transform:translateY(-50%)}.sprig-feedback-container-bottom{bottom:0%;margin-bottom:15px}.sprig-feedback-loading-container{align-items:center;background-color:#fff;border:2px solid var(--feedback-border);display:flex;max-height:90vh;max-width:90vw;min-width:0px}.sprig-feedback-loading-container-left{border-left:none;border-radius:0 8px 8px 0}.sprig-feedback-loading-container-right{border-right:none;border-radius:8px 0 0 8px}#sprig-feedback-error-container{margin:auto;text-align:center;width:360px}.sprig-feedback-error-text{font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}#sprig-feedback-loading-container .ul-container{position:relative;max-height:inherit}#sprig-feedback-loading-animation{position:absolute}.sprig-feedback-loading-container-previews iframe{max-height:inherit!important}',nonce:window.UserLeap.styleNonce}),mr({document,elementId:"ul-custom-style",styleString:s??"",nonce:window.UserLeap.styleNonce}),Xa=o==="center-modal",ut=a;const[d,f]=a.split("-");(m=>{if(Lt()||!zf.includes(m))return;const[g,v]=m.split("-"),C=document.createElement("div");C.id="sprig-feedback-container",C.classList.add(`sprig-feedback-container-${v}`,`sprig-feedback-container-${g}`),document.body.appendChild(C)})(a),p=Lt(),We=document.createElement("button");const y=document.createElement("div");y.className="sprig-feedback-button-label",y.innerText=l,We.appendChild(y),We.id="sprig-feedback-button",We.classList.add(`sprig-feedback-button-${f}`,`sprig-feedback-button-${d}`,`sprig-feedback-button-${n}`,"fade-in-transition"),z.on(pr.SURVEY_FADING_OUT,fs),We.addEventListener("click",async()=>{const m=document.getElementById("sprig-feedback-error-container");if(du()||pu()){if(fs()){z.emit(B.SurveyCloseRequested,{name:B.SurveyCloseRequested,initiator:Ue.FeedbackClosed,studyType:"feedbackButton","survey.id":u}),z.emit(B.SurveyWillClose,{name:B.SurveyWillClose,initiator:Ue.FeedbackClosed,studyType:"feedbackButton","survey.id":u});const v=Lt();m&&v&&(v.remove(),tr=null,K=null)}return}if(Jn(Pe(window.UserLeap))||so||Za(),t)return K&&K.classList.add("sprig-feedback-loading-container-previews"),await er(t),void Jt();const g=await(async v=>{const C=await je(Te("1",[st],"startFeedbackStudy"),{body:JSON.stringify({surveyUuid:v}),method:"POST"});return C.ok?C.json:null})(c);if(g)z.once(B.SurveyAppeared,Jt),er({...g,studyType:"feedbackButton"},r);else if(K){const v=jf();K.appendChild(v),Jt(),K.style.height="300px",K.style.width="360px"}}),p==null||p.appendChild(We),z.emit(B.FeedbackButtonLoaded,{name:B.FeedbackButtonLoaded,"survey.id":u});const{useMobileStyling:h,_config:{border:I}}=window.UserLeap;if(Xa||h)kn(0);else{const m=document.createElement("div");m.id="sprig-feedback-loading-container",m.className=`sprig-feedback-loading-container sprig-feedback-loading-container-${f}`,m.style.setProperty("--feedback-border",I),K=m,di(),p==null||p.appendChild(m);const g=hu();kn(-g)}window.UserLeap._config.isOnQuestionsTab&&t&&!Cn()&&K&&(Za(),di(),K&&K.classList.add("sprig-feedback-loading-container-previews"),er(t),Jt())},jf=()=>{const e=document.createElement("div");e.id="sprig-feedback-error-container",e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
63
- <circle cx="20" cy="20" r="14.5" stroke="#B0B5B7" stroke-width="3"/>
64
- <path d="M20 12L20 21.6" stroke="#B0B5B7" stroke-width="3" stroke-linecap="round"/>
65
- <circle cx="19.9984" cy="27.6" r="1.6" fill="#B0B5B7"/>
66
- </svg>`;const t=document.createElement("h3");return t.className="sprig-feedback-error-text",t.innerText="There was an error while loading the survey",e.appendChild(t),e},pi=new class{constructor(){de(this,"_ldData",{})}getAllLaunchDarklyVariations(){return this._ldData}setLDFlagsVariations(e){try{return!(!e||typeof e!="object"||Array.isArray(e))&&(Object.keys(this._ldData).forEach(t=>{delete this._ldData[t]}),Object.keys(e).forEach(t=>this._ldData[`!launch_darkly_${t}`]=(e[t]??0)+1),!0)}catch(t){return t instanceof Error&&window.UserLeap.reportError("setAllLDFlagsVariations",t),console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."),!1}}};Object.freeze(pi);const pn=new class{constructor(){de(this,"_optimizelyData",{})}setOptimizelyExperiment(e,t=!0){if(!e||typeof e!="object")return!1;const{experiments:r}=e;try{return t&&Object.keys(this._optimizelyData).map(n=>{delete this._optimizelyData[n]}),r&&r.map(n=>{const{id:s,variation:i}=n,a=this.transformExperimentId(s);i&&typeof i=="string"&&(this._optimizelyData[a]=i)}),!0}catch(n){return n instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",n),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(e){return this._optimizelyData[this.transformExperimentId(e)]}transformExperimentId(e){return"!optimizely_experiments_"+e}getAndSetWebOptimizelyExperiments(){var e;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const t=(e=window.optimizely.get("state"))==null?void 0:e.getExperimentStates({isActive:!0});if(t){const r=Object.keys(t).map(n=>{var s,i;return(s=t[n].variation)!=null&&s.name?{id:n,variation:(i=t[n].variation)==null?void 0:i.name}:{id:n,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r},!1),!0}return!1}return!1}catch(t){return t instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",t),!1}}};Object.freeze(pn);class Wf{constructor(t,r){de(this,"paused");de(this,"queue");de(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(r)}flush(t){const r=t.length;if(r)for(let n=0;n<r;n++)this.push(t[n])}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 r=Array.prototype.slice.call(t,1),n=t[0],s=this.ul[n];s instanceof Function?s.apply(this.ul,r):n&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",n)}}perform(t){if(this.paused){let r=()=>{};const n=new Promise(function(s){r=function(){s(t())}});return this.queue.push(r),n}return t()}empty(){this.queue.length=0}}let fu=!0,hi=!1;const Vf=["sdk_event_queue_latency_seconds","sdk_replay_add_event_batch_seconds","sdk_replay_cleanup_seconds","sdk_replay_compression_seconds","sdk_replay_get_events_between_seconds","sdk_replay_snapshot_seconds","sdk_mutations_nodes_added","sdk_mutations_nodes_removed","sdk_mutations_attributes_changed","sdk_mutations_character_data","sdk_dom_nodes_count","sdk_page_html_characters"];let mi,qt={};class Hf{constructor(t){de(this,"_values",[]);de(this,"_isWebMetric");this.name=t,this._isWebMetric=Vf.includes(this.name)}report(t){if(fu&&this._values.push({time:Date.now(),value:t}),hi||!this._isWebMetric)return;const r=this.findExceededThreshold(t);r&&mi&&mi(t,r)}collect(){const t=this._values;return this._values=[],t}findExceededThreshold(t){const r=qt[this.name];if(r)return r.find(n=>this.valueExceedsThreshold(t,n))}valueExceedsThreshold(t,r){return r.type==="max"?t>r.value:r.type==="min"&&t<r.value}}const wr={},He=e=>{const t=new Hf(e);return wr[e]=t,t},gu=(e,t)=>{let r=wr[e];return r||(r=He(e)),r.report(t)},Gf=({reportingIntervalSeconds:e,postMetrics:t})=>{e?setInterval(()=>{(async r=>{const n=Object.values(wr).map(s=>({name:s.name,values:s.collect()}));if(n.some(s=>s.values.length))try{await r(JSON.stringify(n))}catch(s){s instanceof Error&&P.error("MetricsErr",{error:{message:s.message,name:s.name}})}})(t)},1e3*e):fu=!1};let yu,wu;const fi=e=>{let t=0,r=e.firstElementChild;for(;r;)t+=fi(r),r.shadowRoot&&(t+=fi(r.shadowRoot)),r=r.nextElementSibling,t++;return t},Ka=()=>{yu.report(fi(document.body)),wu.report(document.documentElement.innerHTML.length)},gi=(e,t)=>{const r=performance.now();document.hidden?setTimeout(()=>gi(e,t),e):setTimeout(()=>{const n=performance.now()-r;t.report(n/1e3),setTimeout(()=>gi(e,t),e)},0)};let En,xn,Rn,Ln,Qa,dt={};const Jr=(e,t=1)=>{const{name:r}=e;dt[r]=(dt[r]||0)+t},vu=e=>{let t=1;return e.childNodes.forEach(r=>{t+=vu(r)}),t},el=e=>{let t=0;return e.forEach(r=>{t+=vu(r)}),t},$f=e=>{switch(e.type){case"childList":return Jr(En,el(e.addedNodes)),void Jr(xn,el(e.removedNodes));case"attributes":return void Jr(Rn);case"characterData":return void Jr(Ln)}},Yf=e=>e.forEach($f),Jf=()=>{En.report(dt[En.name]||0),xn.report(dt[xn.name]||0),Rn.report(dt[Rn.name]||0),Ln.report(dt[Ln.name]||0),dt={}},qf=(e=1e3)=>{En=He("sdk_mutations_nodes_added"),xn=He("sdk_mutations_nodes_removed"),Rn=He("sdk_mutations_attributes_changed"),Ln=He("sdk_mutations_character_data"),Qa=new MutationObserver(Yf),Qa.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),setInterval(Jf,e)},Xf=({isWeb:e,reportingIntervalSeconds:t,thresholds:r,postMetrics:n})=>{((s,i)=>{qt={},hi=!1,s==null||s.forEach(a=>{var o;a.metric in qt||(qt[a.metric]=[]),(o=qt[a.metric])==null||o.push(a)}),mi=i})(r,(s,i)=>{var a,o;if((a=re.replay)!=null&&a.isReplayRecording()){const l=`Value: ${s} on ${i.metric} violated threshold of ${i.type} ${i.value}`;(o=re.replay)==null||o.disableRecording("Threshold violated",new Error(l),{reportError:!1}),window.UserLeap.reportError("Sdk Performance Metric threshold violated",new Error("Sdk Performance Metric threshold violated"),{metricName:i.metric,type:i.type,value:i.value},{metricName:i.metric}),hi=!0}}),Gf({reportingIntervalSeconds:t,postMetrics:n}),e&&(((s=1e3)=>{const i=He("sdk_event_queue_latency_seconds");gi(s,i)})(),((s=1e4)=>{yu=He("sdk_dom_nodes_count"),wu=He("sdk_page_html_characters"),Ka(),setInterval(Ka,s)})(),qf())},Zf="test",Kf=["popState","pushState","replaceState"];let io,rr;const On={},Wt="!email",bu="pageUrl";let gs=window.location.href;function nr(e){var o,l;const{pageUrlEvents:t,interactiveEvents:r,dismissOnPageChange:n,platform:s}=window.UserLeap._config;if(s&&s!=="web")return;gs!==window.location.href&&P.navigation("LocationChange",{from:gs,to:window.location.href}),gs=window.location.href;const i=Cu().trackStartUrl,a=i?String(i):null;t&&Eu(window.location.href),r&&(Iu(),Qf()),uu()&&(()=>{if(Cn())return;const c=Lt();c&&(lu(tr)||(c.remove(),tr=null,K=null))})(),ue.getItem("sprig.isCapturingHeatmap")&&((l=(o=re.replay)==null?void 0:o.checkPendingHeatmapsUrl())==null||l.then(c=>{var u;c&&((u=re.replay)==null||u.uploadReadyPendingCaptures(!0))})),!Cn()&&n&&a&&a!==window.location.href&&e&&Kf.includes(e.type)&&window.UserLeap("dismissActiveSurvey",Ue.PageChange)}const Su={capture:!0},Qf=()=>{const e=window.UserLeap._config.interactiveEvents.filter(r=>no(r,window.location.href)).map(r=>{const{name:n,properties:s}=r,{selector:i,innerText:a}=s;return i?o=>{if(Ja(o.target))try{o.target.closest(i)&&window.UserLeap("track",n)}catch{}return!1}:o=>(Ja(o.target)&&o.target.innerText===a&&window.UserLeap("track",n),!1)}),t=r=>e.forEach(n=>n(r));window.UserLeap._config.interactiveEventsHandler=t,window.addEventListener("click",t,Su)},Iu=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,Su),delete window.UserLeap._config.interactiveEventsHandler};function Cu(){const e=Ee.getItemObject("userleap.ids");return e&&e[window.UserLeap.envId]||{}}function ku(){if(window.previewMode)return;const e=Ee.getItemObject("sprig.anon.env.vid.map")||{},t=e[window.UserLeap.envId];window.UserLeap.visitorId=t||yt(),P.info("NewVid",{vid:window.UserLeap.visitorId}),ke("vid",window.UserLeap.visitorId),t||(e[window.UserLeap.envId]=window.UserLeap.visitorId,Ee.setItemObject("sprig.anon.env.vid.map",e)),z.emit(B.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}function Eu(e,t,r,n){var s,i;try{if(e.endsWith("mock_snippet.html"))return;P.info("PageView",{url:e});const a=(s=document==null?void 0:document.querySelector('meta[name="description"]'))==null?void 0:s.getAttribute("content");(i=re.replay)==null||i.RecordPageView({...a&&{description:a},url:e,referrer:document.referrer,pageTitle:document.title});const o=window.UserLeap._config.pageUrlEvents;let l=!1;if(o&&o.length)for(let u=0;u<o.length&&(l=no(o[u],e),!l);u++);if(!l)return;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const c={url:e};n&&(c.trackPageView=!0),window.UserLeap._queue.push(["track",bu,t,c,r])}catch(a){a instanceof Error&&(a.stack=e,window.UserLeap.reportError("trackPageView",a)),console.warn("[Sprig] (ERR-428) Failed to track page view",a)}}function eg(){const e="Backbone"in window&&window.Backbone&&window.Backbone.history?window.Backbone.history:window.history;"pushState"in e&&(e.pushState=(t=>function(...r){const n=t.apply(this,r),s=new Event("pushState");return window.dispatchEvent(s),nr(s),n})(e.pushState)),"replaceState"in e&&(e.replaceState=(t=>function(...r){const n=t.apply(this,r),s=new Event("replaceState");return window.dispatchEvent(s),nr(s),n})(e.replaceState)),["hashchange","popstate"].forEach(t=>window.addEventListener(t,nr,!0))}async function ys(e,t){const r=to();e&&!t&&(window.UserLeap._config.mode=Zf);const n=Jn(Pe(window.UserLeap)),s=await je(function(i){const a=new URL(Te("1",[it],"questions"));return Object.entries(i||{}).forEach(([o,l])=>{l&&a.searchParams.append(o,String(l))}),a.toString()}({desktopDisplay:window.UserLeap._config.desktopDisplay,isMobile:n,previewLanguage:window.UserLeap._config.previewLanguage,surveyid:e==null?void 0:e.surveyId,surveytemplateid:e==null?void 0:e.surveyTemplateId,vid:r}),{shouldDropOnRateLimit:!0});if(!s.ok)return s.reportError&&s.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",s.error),window.UserLeap.reportError("getQuestions",s.error)),{success:!1,surveyState:"no survey"};if(s.json.delay&&await In(s.json.delay),!s.json.isFeedback)return er(s.json,rr,io);{const{feedbackLabel:i,productConfig:a,surveyUuid:o,feedbackCustomStyles:l}=s.json,{buttonTheme:c,placement:u,desktopDisplay:p}=a;mu({customStyles:l,buttonTheme:c,desktopDisplay:p,eventId:0,feedbackLabel:i,placement:u,surveyUuid:o,surveyId:e==null?void 0:e.surveyId},s.json)}}function tg(e){if(!e)return;window.UserLeap._config=e,e.mute&&window.UserLeap._queue.pause();const{interactiveEvents:t,pageUrlEvents:r,dismissOnPageChange:n}=e;t&&function(s){let i=s.length;for(;i;){const a=Math.floor(Math.random()*i);i-=1;const o=s[i];s[i]=s[a],s[a]=o}}(t),(t||r||n)&&(eg(),nr())}const rg=function(e){if(!window.UserLeap)return;const t=async(s={})=>{var m,g,v,C,A;const{userId:i,anonymousId:a,metadata:o={},properties:l,showSurveyCallback:c}=s;let{eventName:u}=s;if(window.UserLeap.debugMode&&u!==bu&&console.info("[DEBUG] Sprig track",s),e.mode==="test")return;const p=Ee.getItem("sprig.previewKey")??void 0;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const x="[Sprig] - Skipping tracking without userId";return console.warn(x),{success:!1,message:x,surveyState:"no survey"}}if(!u||u.trim().length===0){u=u?String(u):"";const x="[Sprig] - Invalid event name "+u;return console.warn(x),{success:!1,message:x,surveyState:"no survey"}}const d=rr??window.location.href;o.url||(o.url=d),ke("trackStartUrl",d),(g=(m=window.UserLeap)==null?void 0:m._config)!=null&&g.optimizelyEnabled&&(hr(Pe(window.UserLeap))||pn.getAndSetWebOptimizelyExperiments(),o.optimizelyExperiments=Object.assign({},pn.getAllOptimizelyExperiments())),(C=(v=window.UserLeap)==null?void 0:v._config)!=null&&C.launchDarklyEnabled&&(o.launchDarklyFlags=pi.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),a&&(window.UserLeap.partnerAnonymousId=a),l&&(o.eventProperties=l),(A=re.replay)==null||A.RecordEvent({name:u,url:o.url}),P.info("TrackEvent",{eventName:u});const f=window.UserLeap.delayingSurvey||du()?await je(Te("1",[st],"events/batch"),{body:JSON.stringify({events:[{event:u,metadata:o}],previewKey:p}),method:"POST",shouldDropOnRateLimit:!0}):await je(Te("1",[st],"events"),{body:JSON.stringify({event:u,metadata:o,previewKey:p}),method:"POST",shouldDropOnRateLimit:!0});if(!f.ok){const x="[Sprig] (ERR-421) Failed to track event";return f.reportError&&(console.warn(x,f.error),f.error&&window.UserLeap.reportError("track",f.error)),{success:!1,message:x,error:f.error,surveyState:"no survey"}}i&&ke("uid",i),a&&ke("aid",a);const y=f.json;y.invalidPreviewKey&&Ee.removeItem("sprig.previewKey");const h=o.trackPageView?o.url:void 0;return y!=null&&y.feedbackButton&&mu(y.feedbackButton,void 0,h),await async function(x,U){var k,E;let M=!0;return!(U&&((k=x==null?void 0:x.json)!=null&&k.surveyId)&&(window.UserLeap.delayingSurvey=!0,M=await U(x.json.surveyId),window.UserLeap.delayingSurvey=!1,!M))&&((E=x==null?void 0:x.json)!=null&&E.delay&&!window.UserLeap.isMobileSDK&&(window.UserLeap.delayingSurvey=!0,await In(x.json.delay),window.UserLeap.delayingSurvey=!1),M)}(f,c)?function(x){if(!window.UserLeap._config.dismissOnPageChange)return!0;const U=new URL(x),M=new URL(rr??window.location.href);return U.hostname===M.hostname&&U.pathname===M.pathname}(d)?er(y,h,io):{success:!1,message:"Study should not be displayed after page navigation",surveyState:"no survey"}:{success:!1,message:"[Sprig] Callback returned false, aborting rendering of survey",surveyState:"no survey"}},r=(s,i)=>{var o;const a=(o=s==null?void 0:s.querySelector(`[id="${ro}"]`))==null?void 0:o.contentDocument;a&&mr({document:a,elementId:"ul-custom-style",styleString:i})},n={displaySurvey:async s=>(console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",Ue.Override),ys({surveyId:s},!0)),_previewSurvey(s){window.UserLeap("dismissActiveSurvey",Ue.Override),ys({surveyTemplateId:s},!1)},_reviewSurvey(s){window.UserLeap("dismissActiveSurvey",Ue.Override),ys({surveyId:s},!1)},previewSurvey(s){n._previewSurvey(s)},reviewSurvey(s){n._reviewSurvey(s)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(s=Ue.API){window.UserLeap.container&&(s===Ue.Closed&&window.Sprig.trackHistory&&window.Sprig.trackHistory({event:"closed"}),z.emit(B.SurveyCloseRequested,{name:B.SurveyCloseRequested,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}),z.emit(B.SurveyWillClose,{name:B.SurveyWillClose,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},async setAttribute(s,i){if(!s||!i&&i!==0&&i!==!1){const a="[Sprig] - Disregarding empty attribute / value provided";return console.warn(a),{success:!1,message:a}}return this.setAttributes({[s]:i})},async setAttributes(s){if(s==null||Object.keys(s).length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}return this.identifyAndSetAttributes({attributes:s})},async identifyAndSetAttributes(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",s),e.mode==="test")return;if(s===null||typeof s!="object"||!(s.userId||s.anonymousId||s.attributes)){const u="[Sprig] - Disregarding empty payload provided";return console.warn(u),{success:!1,message:u}}const{userId:i,anonymousId:a,attributes:o}=s;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const u="[Sprig] - Skipping tracking without userId";return console.warn(u),{success:!1,message:u}}if(o){o.email&&!o[Wt]&&(o[Wt]=o.email,delete o.email);const u=Object.keys(o);for(const p of u)o[p]===On[p]&&delete o[p]}if(!(o&&Object.keys(o).length!==0||i&&window.UserLeap.userId!==i||a&&window.UserLeap.partnerAnonymousId!==a))return{success:!0};const l={};let c;return i&&(l.userId=window.UserLeap.userId=i),a&&(l.partnerAnonymousId=window.UserLeap.partnerAnonymousId=a),o&&Object.keys(o).length>0?(c=await je(Te("1",[it,st],"attributes"),{body:JSON.stringify(o),method:"PUT"}),c.ok?Object.assign(On,o):c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await je(Te("1",[it,st]),{body:JSON.stringify(l),method:"PUT"}),o&&o[Wt]&&(window.UserLeap.email=o[Wt]),c.ok&&(i&&ke("uid",i),a&&ke("aid",a)),{success:!!c.ok}},async removeAttributes(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",s),e.mode==="test")return;if(s==null||s.length===0){const a="[Sprig] - Disregarding empty attributes provided";return console.warn(a),{success:!1,message:a}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const a="[Sprig] - Skipping tracking without userId";return console.warn(a),{success:!1,message:a}}const i=await je(Te("1",[it,st],"attributes"),{body:JSON.stringify({delete:s}),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(s){z.on(B.SurveyLifeCycle,s)},async removeSurveyListener(s){z.removeListener(B.SurveyLifeCycle,s)},async addListener(s,i){z.on(s,i)},async removeListener(s,i){z.removeListener(s,i)},async removeAllListeners(){z.removeAllListeners()},setPreviewKey(s){s&&typeof s=="string"&&Ee.isStorageAvailable&&s&&Ee.setItem("sprig.previewKey",s)},async setUserId(s){var o;if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",s),s==null){const l=`[Sprig] - Invalid userId ${s}`;return console.warn(l),{success:!1,message:l}}if(e.mode==="test"||s===window.UserLeap.userId)return;window.UserLeap.userId=s;const i=window.UserLeap.visitorId,a=await je(Te("1",[it,st]),{body:JSON.stringify({userId:s}),method:"PUT"});a.ok?(i!==window.UserLeap.visitorId&&((o=re.replay)==null||o.clearUserReplayData()),ke("uid",s)):a.reportError&&(console.warn("[Sprig] (ERR-420) Failed to set user id",a.error),a.error&&window.UserLeap.reportError("setUserId",a.error))},async setPartnerAnonymousId(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setPartnerAnonymousId",s),s==null){const i=`[Sprig] - Invalid partnerAnonymousId ${s}`;return console.warn(i),{success:!1,message:i}}return window.UserLeap.partnerAnonymousId=s,ke("aid",s),{success:!0}},track:async(s,i,a={},o=void 0)=>t({eventName:s,properties:i,metadata:a,showSurveyCallback:o}),identifyAndTrack:async s=>await t(s),trackPageView(s,i=void 0,a=void 0,o=!0){rr=s,Eu(s,i,a,o)},applyFeedbackStyles({button:s="",view:i=""}){window.UserLeap.feedbackCustomStyles=i,document.getElementById("sprig-feedback-style")&&mr({document,elementId:"ul-custom-style",styleString:s,nonce:window.UserLeap.styleNonce}),r(document.querySelector(".ul-container-feedback"),i)},applyStyles(s){window.UserLeap.customStyles=s,r(window.UserLeap.container,s)},setWindowDimensions(s,i){var d,f;const a=typeof s=="string"?parseInt(s,10):s,o=typeof i=="string"?parseInt(i,10):i;isNaN(a)||isNaN(o)||(window.UserLeap.windowDimensions={width:a,height:o});const l=Pe(window.UserLeap),c=Jn(l),u=l["userleap-platform"]==="web";if(!window.UserLeap.frameId)return;const p=document.getElementById(window.UserLeap.frameId);p&&(window.UserLeap.useMobileStyling&&((d=window.UserLeap.windowDimensions)!=null&&d.width&&(p.style.width=`${window.UserLeap.windowDimensions.width}px`),(f=window.UserLeap.windowDimensions)!=null&&f.height&&(p.style.maxHeight=window.UserLeap.windowDimensions.height-20+"px"),p.contentDocument&&(p.style.height=String(cu(p.contentDocument,u&&!c,eo(l))[0])+"px")),z.emit(B.SurveyDimensions,{name:B.SurveyDimensions,contentFrameWidth:p.clientWidth,contentFrameHeight:p.clientHeight,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},logoutUser(){var s;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),P.info("LogOut",{vid:window.UserLeap.visitorId,userId:window.UserLeap.userId}),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,Ee.removeItem("userleap.ids"),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),ku(),(s=re.replay)==null||s.clearUserReplayData(),window.UserLeap._queue.unpause()},teardown(){["hashchange","popstate"].forEach(s=>window.removeEventListener(s,nr,!0)),window.UserLeap._config.interactiveEvents&&Iu(),window.UserLeap("dismissActiveSurvey",Ue.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(s,i=!0){var a,o;if((o=(a=window.UserLeap)==null?void 0:a._config)!=null&&o.optimizelyEnabled)try{const l=typeof s=="string"?JSON.parse(s):s;pn.setOptimizelyExperiment(l,i)}catch(l){console.warn("[Sprig] Error with integrating Optimizely data"),l instanceof Error&&window.UserLeap.reportError("integrateOptimizely",l)}else console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.")},integrateOptimizelyClient(s){var i,a;if(!((a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.optimizelyEnabled))return void console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");s.notificationCenter.addNotificationListener("ACTIVATE:experiment, user_id,attributes, variation, event",({experiment:o,variation:l})=>{const c={experiments:[{id:o.id,variation:l.key}]};window.UserLeap("integrateOptimizely",c,!1)})},importLaunchDarklyData(s){var i,a;(a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.launchDarklyEnabled?pi.setLDFlagsVariations(s):console.warn("[SPRIG] LaunchDarkly integration is currently not enabled for your product.")},setVisitorAttribute:(s,i)=>(console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"),n.setAttribute(s,i)),setEmail:async s=>n.setAttribute(Wt,s),setVisitorEmail:async s=>(console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"),n.setEmail(s)),_generateVideoUploadUrl:async s=>async function(i){var o;if(!i)return;const a=`${window.UserLeap._API_URL}/2/environments/integrations/upload`;try{const l=await fetch(a,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(l.ok){const c=await l.json();return(o=c==null?void 0:c.upload)==null?void 0:o.url}return null}catch(l){console.warn("[Sprig] Error with generating video upload url"),l instanceof Error&&window.UserLeap.reportError("generateVideoUploadUrl",l)}}(s),_reportMetric(s,i){gu(s,i)},_completeSessionReplay:async({surveyId:s,responseGroupUuid:i,eventDigest:a})=>{var o;return re.replay?(o=re.replay)==null?void 0:o._completeSessionReplay({surveyId:s,responseGroupUuid:i,eventDigest:a,headers:Pe(window.UserLeap)}):(window.UserLeap.reportError("_completeSessionReplay",new Error("Replay module not registered")),!1)},pauseReplayRecording(){var s,i,a,o;(i=(s=re.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)||((o=(a=re.replay)==null?void 0:a.recordReplayPaused)==null||o.call(a))},resumeReplayRecording(){var s,i,a,o,l,c;(i=(s=re.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)&&((o=(a=re.replay)==null?void 0:a.recordReplayResumed)==null||o.call(a),(c=(l=re.replay)==null?void 0:l.recordFullSnapshot)==null||c.call(l))}};Object.assign(window.UserLeap,n)};async function ng(e,t,r={},n={}){const s=window.__cfg&&window.__cfg.mode,i=to(),a=window.UserLeap.envId,o=window.document.documentElement,l={mode:s,screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:o.clientWidth,clientHeight:o.clientHeight,location:rr??window.location.href,language:window.navigator.language,...r},c={action:e,breadcrumbs:P.breadcrumbs,err:{message:`${t==null?void 0:t.name} - ${t==null?void 0:t.message}`,stack:t==null?void 0:t.stack},meta:l,vid:i,envId:a,...n};(await je(Te("1",null,"errors"),{method:"POST",headers:{"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(c),shouldDropOnRateLimit:!0})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}function sg(e={}){var n;(n=window.SprigLoggerCallback)==null||n.call(window,"Initializing Sprig");const t=new URLSearchParams(window.location.search).get("sprigPreviewKey")??"";async function r(){var p,d,f,y,h;if(window.UserLeap.loaded)return;if((p=window.SprigLoggerCallback)==null||p.call(window,"Loading Sprig"),window.UserLeap.reportError=ng,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 I in window.UserLeap._config)window.UserLeap[I]=window.UserLeap._config[I];if(window.Sprig.outstandingTransactionLimit!==void 0&&(e.outstandingTransactionLimit=window.Sprig.outstandingTransactionLimit),!window.UserLeap.envId){if(!window.UserLeap.appId)throw new Error("Missing Environment id");window.UserLeap.envId=window.UserLeap.appId}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const s=Cu(),i=window.UserLeap.sampleRate;let a=s.sampled;if(i){if(a===null&&(a=Math.random()<i,ke("sampled",a)),!a)return}else a!==null&&ke("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new Wf(window.UserLeap,[]),window.UserLeap._queue.pause();for(let I=0;I<o.length;I++)window.UserLeap._queue.push(o[I]);const l=s.token;l?(window.UserLeap.token=l,window.UserLeap.visitorId=s.vid??null,window.UserLeap.userId=s.uid??null,window.UserLeap.partnerAnonymousId=s.aid??null):ku();const c=hr(Pe(window.UserLeap));(d=window.SprigLoggerCallback)==null||d.call(window,"Sprig fetching config");const u=await async function(I){var C,A;const m=Pe(window.UserLeap);document.addEventListener("securitypolicyviolation",Ha);const g=await Ge(Te("1",[it],"config"),{headers:m});if(document.removeEventListener("securitypolicyviolation",Ha),!g.ok)return(C=window.SprigLoggerCallback)==null||C.call(window,"Sprig config fetch failed"),g.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",g.error),g.error&&window.UserLeap.reportError("applyRemoteConfig",g.error)),ci("Disabled: failed to fetch configuration"),I;const v=g.json;return v!=null&&v.disabled?((A=window.SprigLoggerCallback)==null||A.call(window,"Sprig config fetch disabled"),ci(`Disabled: ${v.disabled}`),{disabled:v.disabled}):Object.assign({},v,I)}(e);if((f=window.SprigLoggerCallback)==null||f.call(window,"Sprig fetched config"),Xf({isWeb:!c,reportingIntervalSeconds:u.metricsReportingEnabled||u.mobileMetricsReportingEnabled?u.metricsReportingIntervalSeconds:0,thresholds:u.metricThresholds,postMetrics:async I=>{var m;await je(Te("1",[it],"metrics"),{body:I,method:"POST",headers:{"x-ul-replay-enabled":`${!!((m=re.replay)!=null&&m.isReplayRecording())}`},shouldDropOnRateLimit:!0})}}),!c){const I=u.alwaysOnReplay?{userAgent:window.navigator.userAgent,surveyId:u.alwaysOnReplay.surveyId,responseGroupUuid:u.alwaysOnReplay.responseGroupUuid,sdkVersion:"2.39.2",maxDurationSeconds:u.alwaysOnReplay.maxDurationSeconds}:void 0;await((y=re.replay)==null?void 0:y.initializeReplay({maxReplayDurationSeconds:u.maxReplayDurationSeconds,maxInflightRequests:window.UserLeap.maxInflightReplayRequests??2,replaySettings:u.replaySettings,apiUrl:window.UserLeap._API_URL,alwaysOnConfig:I})),io=u.replaySettings}rg(u),await tg(u),window.UserLeap._queue.unpause(),(h=window.SprigLoggerCallback)==null||h.call(window,"SdkReady"),z.emit(B.SDKReady,{mobileMetricsReportingEnabled:!!u.mobileMetricsReportingEnabled,metricsReportingInterval:u.metricsReportingIntervalSeconds||0,metricsThresholds:u.metricThresholds||[],maxMobileReplayDurationSeconds:u.maxMobileReplayDurationSeconds,mobileReplaySettings:u.mobileReplaySettings}),z.emit(B.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}),z.on(B.VisitorIDUpdated,()=>{for(const I in On)delete On[I]})}window.UserLeap.UPDATES=pr,window.UserLeap("setPreviewKey",t),document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",()=>{r()},!1)}class yi{constructor(){de(this,"UPDATES",pr)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,r){window.Sprig("setAttribute",t,r)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,r){window.Sprig("addListener",t,r)}removeListener(t,r){window.Sprig("removeListener",t,r)}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,r={},n={}){window.Sprig("track",t,r,n)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}trackPageView(t,r,n){window.Sprig("trackPageView",t,r,n)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,r){window.Sprig("setWindowDimensions",t,r)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}pauseReplayRecording(){window.Sprig("pauseReplayRecording")}resumeReplayRecording(){window.Sprig("resumeReplayRecording")}}const ig={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(yi.prototype).map(r=>{r!=="constructor"&&(window.Sprig[r]=yi.prototype[r])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,sg(e),window.Sprig}};var ot=(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))(ot||{}),Je=(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[e.CustomElement=16]="CustomElement",e))(Je||{});const wi=(e,t)=>t.some(r=>e instanceof r);let tl,rl;const vi=new WeakMap,ws=new WeakMap,An=new WeakMap;let bi={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return vi.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return at(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&(t==="done"||t==="store")||t in e};function xu(e){bi=e(bi)}function og(e){return(rl||(rl=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Si(this),t),at(this.request)}:function(...t){return at(e.apply(Si(this),t))}}function ag(e){return typeof e=="function"?og(e):(e instanceof IDBTransaction&&function(t){if(vi.has(t))return;const r=new Promise((n,s)=>{const i=()=>{s(t.error||new DOMException("AbortError","AbortError"))};t.oncomplete=()=>{n()},t.onerror=i,t.onabort=i});vi.set(t,r)}(e),wi(e,tl||(tl=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,bi):e)}function at(e){if(e instanceof IDBRequest)return function(r){const n=new Promise((s,i)=>{r.onsuccess=()=>{s(at(r.result))},r.onerror=()=>{i(r.error)}});return An.set(n,r),n}(e);if(ws.has(e))return ws.get(e);const t=ag(e);return t!==e&&(ws.set(e,t),An.set(t,e)),t}const Si=e=>An.get(e);function Ii(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);return t&&(r.onblocked=n=>t(n.oldVersion,n)),at(r).then(()=>{})}const lg=["get","getKey","getAll","getAllKeys","count"],cg=["put","add","delete","clear"],vs=new Map;function nl(e,t){if(!(e instanceof IDBDatabase)||t in e||typeof t!="string")return;if(vs.get(t))return vs.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=cg.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!lg.includes(r))return;const i=async function(a,...o){const l=this.transaction(a,s?"readwrite":"readonly");let c=l.store;return n&&(c=c.index(o.shift())),(await Promise.all([c[r](...o),s&&l.done]))[0]};return vs.set(t,i),i}xu(e=>({...e,get:(t,r,n)=>nl(t,r)||e.get(t,r,n),has:(t,r)=>!!nl(t,r)||e.has(t,r)}));const ug=["continue","continuePrimaryKey","advance"],sl={},Ci=new WeakMap,Ru=new WeakMap,dg={get(e,t){if(!ug.includes(t))return e[t];let r=sl[t];return r||(r=sl[t]=function(...n){Ci.set(this,Ru.get(this)[t](...n))}),r}};async function*pg(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,dg);for(Ru.set(r,t),An.set(r,Si(t));t;)yield r,t=await(Ci.get(r)||t.continue()),Ci.delete(r)}function il(e,t){return t===Symbol.asyncIterator&&wi(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&wi(e,[IDBIndex,IDBObjectStore])}xu(e=>({...e,get:(t,r,n)=>il(t,r)?pg:e.get(t,r,n),has:(t,r)=>il(t,r)||e.has(t,r)}));const hg="sprigReplayIframeLoaded",mg="sprigReplayIframeSettings",fg="sprigReplayIframeTakeFullSnapshot",gg="sprigReplayTeardown",oo=[],Lu=new class{constructor(e){de(this,"awaitingResolvers",[]);de(this,"activeCount",0);this.capacity=e}async acquire(){if(!(this.activeCount<this.capacity))return new Promise(e=>{this.awaitingResolvers.push(e)});this.activeCount++}release(){const e=this.awaitingResolvers.shift();e&&this.activeCount<=this.capacity?e():this.activeCount--}async execute(e){try{return await this.acquire(),await e()}finally{this.release()}}setLimit(e){this.capacity=e}}(2),Ou=async({apiUrl:e,surveyId:t,uploadId:r,etags:n,headers:s,responseGroupUuid:i,replayDuration:a,eventDigest:o},l=!1)=>{var u;if(!l&&!r&&!n)return void P.error("UploadErr",{isMobile:l,uploadId:r,etags:n});P.info("MarkUploadComplete",{surveyId:t});const c=await Ge(`${e}/sdk/1/completeSessionReplay`,{method:"POST",body:JSON.stringify({etags:n,uploadId:r,responseGroupUuid:i,surveyId:t,replayDuration:a,eventDigest:o,userAgent:(u=window==null?void 0:window.navigator)==null?void 0:u.userAgent}),headers:s,shouldRetryRequest:!0});return P.info("MarkUploadDone",{surveyId:t}),c},yg=e=>{if(e instanceof Attr)return null;let t=1;for(let r=e.previousSibling;r;r=r.previousSibling)r.nodeName===e.nodeName&&++t;return t},Au=e=>{if(e===null)return"";const t=[];if(e instanceof Document)return"/";for(let r=e;r&&!(r instanceof Document)&&r!==null;r=r instanceof Attr?r.ownerElement:r.parentElement){const n=t[t.length]={name:void 0,position:null};switch(r.nodeType){case Node.TEXT_NODE:n.name="text()";break;case Node.ATTRIBUTE_NODE:n.name="@"+r.nodeName;break;case Node.PROCESSING_INSTRUCTION_NODE:n.name="processing-instruction()";break;case Node.COMMENT_NODE:n.name="comment()";break;case Node.ELEMENT_NODE:n.name=r.nodeName}n.position=yg(r)}return"/"+t.reverse().map(r=>r.position!==null?`/${r.name}[${r.position}]`:`/${r.name}`).join("")},ao=e=>e&&e.trim().substring(0,500).replace(/\s\s+/g," ").replace(/\r?\n|\r/g," ").substring(0,250),Ve={capture:!0,passive:!0},wg=["a","button","input","option","li","link"],vg=["Escape","Enter","Backspace","F5","Tab"];let Mn=!1,Re=null,hn=null;const ol=e=>{var r;if(((r=e.tagName)==null?void 0:r.toLowerCase())==="html")return{element:"html"};const t={};return t.element=(n=>{if(!n.tagName)return"No tagName";const s=n.getAttribute("type");return s?`${s} ${n.tagName.toLowerCase()}`:n.tagName.toLowerCase()})(e),t},bg=e=>{var n;if(!e)return{};const t={...ol(e)},r=e.parentElement;if(r&&wg.includes((n=r.tagName)==null?void 0:n.toLowerCase())){const s=ol(r);Object.assign(t,s)}return t},Mu=(e,t)=>{var s,i;let r=t.target;var n;t.target===((s=window.document)==null?void 0:s.body)&&window.Sprig.pointerDownTarget&&(r=window.Sprig.pointerDownTarget),n={x:t.x,y:t.y,type:e,elementAttributes:bg(r),windowHeight:window.innerHeight,windowWidth:window.innerWidth,...r instanceof HTMLElement||r instanceof SVGElement||r instanceof MathMLElement?{rect:r==null?void 0:r.getBoundingClientRect(),xPath:Au(r)}:{}},(i=n==null?void 0:n.elementAttributes)!=null&&i.text&&(n.elementAttributes.text=ao(n.elementAttributes.text)),Re==null||Re("Sprig_Click",n)},Uu=e=>{var t;vg.includes(e.key)&&(t={key:e.key},Re==null||Re("Sprig_Keystroke",t))},Sg=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("reload")&&(e={url:window.location.href,currentPageTitle:document.title},Re==null||Re("Sprig_Refresh",e))},Ig=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("back_forward")&&((e={curUrl:window.location.href,fromUrl:document.referrer,currentPageTitle:document.title}).currentPageTitle&&(e.currentPageTitle=ao(e.currentPageTitle)),Re==null||Re("Sprig_BackForward",e))},Tu=((e,t)=>{let r;return n=>{clearTimeout(r),r=window.setTimeout(()=>e(n),t)}})(e=>{if(!(e.target instanceof HTMLElement||e.target instanceof Document))return;let t=e.target;"scrollTop"in t||(t=t.documentElement),hn==null||hn({xPath:Au(t),x:t.scrollLeft,y:t.scrollTop,elementAttributes:{targetScrollWidth:t.scrollWidth,targetClientWidth:t.clientWidth,targetScrollHeight:t.scrollHeight,targetClientHeight:t.clientHeight}})},750),Du=(al="left_click",e=>Mu(al,e));var al;const Pu=e=>{e.button===2&&Mu("right_click",e)},_u=e=>{window.Sprig&&(window.Sprig.pointerDownTarget=e.target)},pe={isRecording:!1,scrollEventUuids:{},stopRecording:()=>{}},Nu=()=>window.indexedDB&&window.IDBKeyRange&&window.CompressionStream,be=(()=>{const e=ue.getItem("sprig.sessionId");if(e)return P.info("SessionIDFound",{savedSessionId:e}),ue.removeItem("sprig.sessionId"),e;const t=yt();return P.info("GeneratedSessionID",{uuid:t}),t})(),ki=()=>{ue.setItem("sprig.disableReplayRecording","disabled")},$e=()=>!!ue.getItem("sprig.disableReplayRecording"),Un=()=>!!ue.getItem("sprig.isReplayPaused");window.addEventListener("beforeunload",()=>{P.info("BeforeUnload",{sessionId:be}),ue.setItem("sprig.sessionId",be)});const qe=(e,t)=>{var r,n;if(!$e()&&pe.isRecording&&!Un())try{(n=(r=window.rrwebRecord)==null?void 0:r.addCustomEvent)==null||n.call(r,e,t)}catch(s){vr("Error recording custom event",s)}},Cg=async e=>{const{x:t,xPath:r,y:n}=e,s=pe.scrollEventUuids[r];if(s)return xe(async()=>{var o,l,c,u;const i=await Q.openDB(),a=await i.get("events",s);if(a!=null&&a.event){const p=JSON.parse(a.event),d=t>((l=(o=p.data)==null?void 0:o.payload)==null?void 0:l.x),f=n>((u=(c=p.data)==null?void 0:c.payload)==null?void 0:u.y);if(!d&&!f)return null;d&&(p.data.payload.x=t),f&&(p.data.payload.y=n),p.data.payload.elementAttributes=e.elementAttributes,a.event=JSON.stringify(p),await i.put("events",a)}else qe("Sprig_Scroll",e)},"Error updating scroll event");qe("Sprig_Scroll",e)},Fu=()=>{pe.stopRecording&&(pe.stopRecording(),pe.stopRecording=void 0),pe.isRecording=!1,["cleanupInterval","inactivityInterval","pendingCheckInterval"].forEach(e=>{pe[e]&&(clearInterval(pe[e]),pe[e]=void 0)}),Mn&&(window.removeEventListener("click",Du,Ve),window.removeEventListener("pointerdown",_u,Ve),window.removeEventListener("mousedown",Pu,Ve),window.removeEventListener("keydown",Uu,Ve),window.removeEventListener("scroll",Tu,Ve),Mn=!1),oo.forEach(e=>{var t;(t=e.source)==null||t.postMessage({type:gg},{targetOrigin:e.origin})})},kg=["did not allow mutations","called in an invalid security context"],Eg=(e,t,{reportError:r=!0,extraInfo:n={}})=>{if(!$e()&&t instanceof Error){if(ki(),t.name==="VersionError")return P.error("VersionErr",{message:e}),void Q.deleteDB();(s=>{if(!s)return!0;for(const i of kg)if(s.toLowerCase().includes(i))return!1;return!0})(t==null?void 0:t.message)&&(r&&window.UserLeap.reportError(e,t,n),Q.clearAll())}},vr=(e,t,{reportError:r}={reportError:!0})=>{Fu(),P.error("ReplayErr",{code:t.code,name:t.name}),Eg(e,t,{reportError:r})},xe=async(e,t)=>{try{return await e()}catch(r){vr(t,r)}},Ei=()=>{pe.isRecording&&(xe(()=>{var e,t;return(t=(e=window.rrwebRecord)==null?void 0:e.takeFullSnapshot)==null?void 0:t.call(e,!0)},"Error recording full snapshot"),oo.forEach(e=>{var t;(t=e.source)==null||t.postMessage({type:fg},{targetOrigin:e.origin})}))};let bs=0;(async()=>Nu()&&Promise.allSettled([Ii("replayStorage"),Ii("sprig.replay")]))();const Q=new class{constructor(){de(this,"wrapTransactionWithCounter",e=>{var n,s;const t=(s=(n=window.Sprig)==null?void 0:n._config)==null?void 0:s.outstandingTransactionLimit,r=t===void 0?100:t;if(r&&bs>r){const i="Too many outstanding transactions";vr(i,new Error(i),{reportError:!1})}bs++,e.done.finally(()=>{bs--})});de(this,"getTransaction",async e=>{const t=(await this.openDB()).transaction(e,"readwrite");return this.wrapTransactionWithCounter(t),t})}openDB(){return function(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const a=indexedDB.open(e,t),o=at(a);return n&&(a.onupgradeneeded=l=>{n(at(a.result),l.oldVersion,l.newVersion,at(a.transaction),l)}),r&&(a.onblocked=l=>r(l.oldVersion,l.newVersion,l)),o.then(l=>{i&&(l.onclose=()=>i()),s&&(l.onversionchange=c=>s(c.oldVersion,c.newVersion,c))}).catch(()=>{}),o}("sprigReplay",1,{upgrade:(e,t,r)=>{if(r===0&&ue.setItem("sprig.pendingCount","0"),!e.objectStoreNames.contains("events")){const n=e.createObjectStore("events",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+timestamp]",["sessionId","timestamp"])}if(!e.objectStoreNames.contains("chunkUploads")){const n=e.createObjectStore("chunkUploads",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+status]",["sessionId","status"]),n.createIndex("[uploadId+status]",["uploadId","status"]),n.createIndex("[sessionId+status+uploadId]",["sessionId","status","uploadId"])}if(!e.objectStoreNames.contains("pendingCaptures")){const n=e.createObjectStore("pendingCaptures",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+targetTimestamp]",["sessionId","targetTimestamp"])}}})}async deleteDB(){try{await Ii("sprigReplay")}catch{}}async bulkAdd(e,t){const r=await this.getTransaction(e);return Promise.all([...t.map(n=>r.store.add(n)),r.done])}async clearAll(){const e=(await this.openDB()).transaction(["events","chunkUploads","pendingCaptures"],"readwrite");return this.wrapTransactionWithCounter(e),Promise.all([e.objectStore("events").clear(),e.objectStore("chunkUploads").clear(),e.objectStore("pendingCaptures").clear()])}async deleteBySessionId(e,t){const r=IDBKeyRange.only(t),n=await this.getTransaction(e),s=n.store.index("sessionId");for await(const i of s.iterate(r))await i.delete();await n.done}async updatePartial(e,t,r){const n=await this.getTransaction(e),s=await n.store.get(t);s&&await n.store.put({...s,...r}),await n.done}async deleteRowsBefore(e,t,r=()=>!0){const n=IDBKeyRange.upperBound(t,!0),s=await this.getTransaction(e),i=s.store.index("timestamp");for await(const a of i.iterate(n))r(a.value)&&await a.delete();await s.done}async getEventsBetween(e,t=Date.now()){if(e>=t)return Promise.resolve([]);const r=IDBKeyRange.bound([be,e],[be,t],!1,!0);return(await this.openDB()).getAllFromIndex("events","[sessionId+timestamp]",r)}async updateEventsExpiredAt(e,t,r=30){const n=new Date,s=n.setMinutes(n.getMinutes()+(r??30)),i=await this.getTransaction("events"),a=i.store.index("[sessionId+timestamp]"),o=IDBKeyRange.bound([be,e],[be,t],!1,!0);for await(const l of a.iterate(o))await l.update({...l.value,expiredAt:s});await i.done}async deleteChunkUploads(e,t){const r=IDBKeyRange.only([t,e]),n=await this.getTransaction("chunkUploads");let i=await n.store.index("[uploadId+status]").openCursor(r);for(;i;)i.delete(),i=await i.continue();await n.done}async getChunkUploadsByStatus({sessionId:e,status:t,uploadId:r}){const n=(await this.openDB()).transaction("chunkUploads","readonly");this.wrapTransactionWithCounter(n);const s=r?n.store.index("[uploadId+status]"):n.store.index("[sessionId+status]"),i=r?IDBKeyRange.only([r,t]):IDBKeyRange.only([e,t]);return s.getAll(i)}async getPendingCaptures(e={}){return(await(await this.openDB()).getAllFromIndex("pendingCaptures","sessionId",be)).filter(r=>!e.beforePresent||r.targetTimestamp<Date.now()).filter(r=>!e.isBeforeType||r.captureParams.replayParams.replayDurationType==="before").filter(r=>!e.isHeatmap||(r.captureParams.isHeatmap??!1))}async markPendingCaptureToCanUpload(e){const t=await this.getTransaction("pendingCaptures"),r=t.store.index("sessionId");for await(const n of r.iterate(be)){const s=n.value;s.captureParams.responseGroupId===e&&await n.update({...s,canUpload:!0})}await t.done}async markPendingHeatmapsReady(e){if(parseInt(ue.getItem("sprig.pendingCount")??"0")===0)return null;const t=Date.now(),r=await this.getTransaction("pendingCaptures"),n=r.store.index("sessionId");for await(const s of n.iterate(be)){const i=s.value;!i.captureParams.isHeatmap||e&&!e.includes(i.uuid)||await s.update({...i,targetTimestamp:t,captureParams:{...i.captureParams,triggerTimestamp:t,replayParams:{...i.captureParams.replayParams,replayDurationSeconds:Math.floor((t-i.timestamp)/1e3)}}})}await r.done}},Qe=[];let br,Bu,mt=[],Tt=!1,Ut=0,mn=!1,zu=!1;const lo=[];let Tn,ju,fn,Wu,Ss=!1;const Dt=()=>mn&&!Tt&&Date.now()<=Tn,xg=({apiUrl:e,config:t,triggerSnapshot:r,forceInit:n=!1})=>{mn&&!n||(ue.isStorageAvailable?(mt=[],lo.splice(0),Qe.splice(0),Ut=0,fn=r,Bu=e,br={responseGroupUuid:t.responseGroupUuid,surveyId:t.surveyId,userAgent:t.userAgent,sdkVersion:t.sdkVersion},ju=t.maxDurationSeconds,Ag(),mn||(Wu=window.setInterval(Og,500)),mn=!0):Tt=!0)},Rg=[Je.Drag,Je.Input,Je.MediaInteraction,Je.MouseInteraction,Je.MouseMove,Je.Scroll,Je.Selection,Je.TouchMove],Lg=e=>e.type===ot.Custom||e.type===ot.IncrementalSnapshot&&Rg.includes(e.data.source),co=e=>e.some(Lg),Og=async()=>{if(!Dt())return void window.clearInterval(Wu);if(Vu(),!co(Qe))return;const e=Qe[0].timestamp;Date.now()-e>35e3&&(fn==null||fn())},Vu=async()=>{if(mt.length||Ss)return;Ss=!0;const e=await Ug();if(!e)return void(Tt=!0);lo.splice(0,e.length).forEach(t=>t(e.shift())),e.forEach(t=>mt.push(t)),Ss=!1},Ag=()=>{const e=ue.getItem("sprig.alwayson.info");if(e){P.info("Read stored session state",e);const t=JSON.parse(e);Tt=t.disabled,br=t.metadata,mt=t.uploadUrls,Ut=t.currentIndex,Tn=t.expirationTimestamp,t.pendingEventTimestamp&&(P.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`),Mg(t.pendingEventTimestamp))}else Tn=1e3*ju+Date.now()},Mg=async e=>{const t=Date.now(),r=(await Q.getEventsBetween(e,t)).map(s=>JSON.parse(s.event));if(!co(r))return;Yu(r);const n=await $u();n&&await Gu(n,r)},Hu=async(e,t)=>{try{const r=await e();if(!r.ok)throw new Error(`Error ${t}`);return r}catch{Tt=!0}},Gu=async(e,t)=>{if(!Dt()||!e)return;const r=await(async n=>{const s=new TextEncoder,i=new CompressionStream("gzip"),a=i.writable.getWriter(),o=s.encode(JSON.stringify(n));return a.write(o),a.close(),new Uint8Array(await new Response(i.readable).arrayBuffer())})(t);P.info("Uploading always-on events with presigned url"),await Hu(()=>Ge(e,{body:r,method:"PUT"}),"uploading always-on with presigned url")},Ug=async()=>{if(!Dt())return;const{surveyId:e,responseGroupUuid:t}=br,r={responseGroupUuid:t,surveyId:e,index:Ut+1};P.info("Fetching always-on upload urls",r);const n=await Hu(()=>Ge(`${Bu}/sdk/1/replayUrls`,{method:"POST",body:JSON.stringify(r),headers:Pe(window.UserLeap)}),"fetching always-on signed urls");if(!n)return;const s=n.json.signedUrls;return P.info("Fetched more always-on upload urls",{body:r,urls:s}),s},$u=async()=>{if(mt.length)return mt.shift();const e=new Promise(t=>{lo.push(t)});return Vu(),e},Yu=e=>{var s,i,a;const t=e.length?e[e.length-1].timestamp:Date.now(),r=Ut,n=((i=(s=window.UserLeap)==null?void 0:s.config)==null?void 0:i.customMetadata)??((a=window.__cfg)==null?void 0:a.customMetadata);Ut++,e.push({timestamp:t,type:ot.Custom,data:{tag:"Sprig_Meta",payload:{...br,index:r,visitorId:window.UserLeap.visitorId??"",timestamp:t,customMetadata:n}}})},Tg=(e,t)=>{Dt()&&!zu&&(e||Qe.length)&&(e&&Qe.length&&(async()=>{const r=Qe.splice(0);if(!co(r))return;P.info("Capturing always-on event array to upload"),Yu(r);const n=await $u();n&&await Gu(n,r)})(),Qe.push(t))};window.addEventListener("beforeunload",async()=>{zu=!0,Dt()&&(P.info("Always On handle page unload"),(()=>{let e;Qe.length&&(e=Qe[0].timestamp);const t={disabled:Tt,metadata:br,uploadUrls:mt,currentIndex:Ut,pendingEventTimestamp:e,expirationTimestamp:Tn};P.info("Storing session state on unload",t),ue.setItem("sprig.alwayson.info",JSON.stringify(t))})())});const Ju=async(e,t)=>{const r=performance.now();let n;try{n=await e()}finally{const s=performance.now()-r;let i=wr[t];i||(i=He(t)),i.report(s/1e3)}return n},qu=(e,t)=>{const r=performance.now();try{e()}finally{const n=performance.now()-r;let s=wr[t];s||(s=He(t)),s.report(n/1e3)}};let Xu=5e3,xi=6e4,Ri=0,lt,Li=!1,Oi=[];const Dg=e=>{var t,r,n,s;if((t=e.event)!=null&&t.includes("Sprig_Scroll")){const i=(s=(n=(r=JSON.parse(e.event))==null?void 0:r.data)==null?void 0:n.payload)==null?void 0:s.xPath;if(!i)return;pe.scrollEventUuids[i]=e.uuid}Oi.push(e),Li||Pg()},Pg=()=>{Li=!0,setTimeout(async()=>{if($e()||Un())return;const e=Oi;Oi=[],Li=!1,qu(async()=>{await(async t=>{const r=t.map(n=>({...n,sessionId:n.sessionId??be}));if(r.length!==0)return xe(()=>Q.bulkAdd("events",r),"Error storing replay events")})(e)},"sdk_replay_add_event_batch_seconds")},500)},_g=(e,t,r)=>{pe.cleanupInterval=window.setInterval(()=>{const n=Date.now();Ju(()=>xe(async()=>{$e()||await Promise.all([Q.deleteRowsBefore("events",n-1e3*e,s=>s.expiredAt===void 0||s.expiredAt<n-1e3*e),Q.deleteRowsBefore("chunkUploads",n-1e3*t),Q.deleteRowsBefore("pendingCaptures",n-1e3*r,s=>!s.canUpload)])},"Error deleting table rows"),"sdk_replay_cleanup_seconds"),P.debug("CleanupComplete")},3e4)},Ng=()=>{pe.pendingCheckInterval=window.setInterval(async()=>{xe(async()=>{await Ai()},"Error initiating pending captures")},5e3)};let Is=!1;const Ai=async(e=!1)=>{if(!Is)try{Is=!0;const t=parseInt(lt??"0");if(t===0)return;const r=await Q.getPendingCaptures({beforePresent:!0,isBeforeType:e}),n=await Q.openDB();await Promise.all(r.map(async s=>(await n.delete("pendingCaptures",s.uuid),Qu(s.captureParams,s.canUpload)))),lt=(t-r.length).toString(),ue.setItem("sprig.pendingCount",lt)}finally{Is=!1}},Fg=async(e,t,r,n,s)=>{const i=Math.min(e+s,r),a=await Ju(()=>Q.getEventsBetween(e,i),"sdk_replay_get_events_between_seconds");if(!(a!=null&&a.length))return P.debug("NoEventsFound"),{validStartFound:n,events:[]};if(!n){P.debug("ValidStartSearch");let o=-1;return a==null||a.forEach((l,c)=>{if(!l.isValidStart)return;const u=l.timestamp<=t;(o<0||u)&&(o=c)}),o<0?(P.debug("ValidStartNotFound"),{validStartFound:n,events:[]}):{validStartFound:!0,events:a==null?void 0:a.slice(o)}}return{validStartFound:n,events:a}},Zu=e=>Promise.all(e.map(async t=>{const r=await(async n=>Lu.execute(async()=>{var a;P.info("UploadChunkStart",{chunkIndex:n.chunkIndex,surveyId:n.surveyId});const s=await Ge(n.uploadUrl,{body:n.data,method:"PUT"});P.http("UploadChunkEnd",{url:n.uploadUrl,method:"PUT",status_code:s.status,reason:s.statusText??"OK",chunkIndex:n.chunkIndex,surveyId:n.surveyId});const i=(a=s.headers)==null?void 0:a.get("ETag");if(!i)throw new Error(`Upload response did not include etag for upload ${n.uploadId}, part ${n.chunkIndex}`);return i}))(t);return await Q.updatePartial("chunkUploads",t.uuid,{data:null,etag:r,status:"UploadComplete"}),t.uploadId})),Ku=async e=>{const t=await Q.getChunkUploadsByStatus({status:"UploadComplete",uploadId:e});if(!(t!=null&&t.length))return void P.info("NoChunksForUpload",{uploadId:e});const r=t.reduce((i,a)=>(i.find(o=>o.chunkIndex===a.chunkIndex)||i.push(a),i),[]);r.sort((i,a)=>i.chunkIndex-a.chunkIndex);const n=r.map(i=>({ETag:i.etag,PartNumber:i.chunkIndex})).filter(i=>i.ETag!==null),s=r[0];await Ou({apiUrl:s.apiUrl,surveyId:s.surveyId,uploadId:e,responseGroupUuid:s.responseGroupId,etags:n,headers:s.completeUploadHeaders,replayDuration:s.replayDuration}),await Q.deleteChunkUploads("UploadComplete",e)},Bg=()=>{xe(async()=>{const e=await Q.getChunkUploadsByStatus({sessionId:be,status:"ReadyForUpload"});if(!(e!=null&&e.length))return;const t=await Zu(e);t!=null&&t.length&&await Promise.all(t.map(r=>{if(r)return Ku(r)}))},"Error uploading unfinished chunks")},zg=async(e,t)=>{const r=t??Date.now();return(async(n,s)=>{const i=new TextEncoder;let a=null;const o=new CompressionStream("gzip"),l=o.writable.getWriter();let c=!1,u=!1,[p,d]=[0,0],f=[];for(let h=n-35e3;h<s;h+=xi){if({validStartFound:u,events:f}=await Fg(h,n,s,u,xi),!(f!=null&&f.length)){P.debug("NoEventsFound");continue}p===0&&(p=f[0].timestamp),d=f[f.length-1].timestamp;const I=f.map(v=>v.event);I.push(`{"timestamp":${s}}`);const m=`${c?",":"["}${I}`,g=i.encode(m);qu(()=>{l.write(g)},"sdk_replay_compression_seconds"),c=!0}if(d-p<Xu)return P.debug("ReplayTooShort"),null;const y=i.encode("]");return l.write(y),l.close(),a=new Uint8Array(await new Response(o.readable).arrayBuffer()),a})(r-e,r)},ll=async e=>{const{surveyId:t,responseGroupId:r,visitorId:n,apiUrl:s,completeUploadHeaders:i,replayParams:a,triggerTimestamp:o}=e,l=await zg(1e3*a.replayDurationSeconds,o);if(!(l!=null&&l.length))return void P.info("FileDataEmpty",{surveyId:t});const c=((p,d,f)=>{const y=p.length,h=1024*d*1024,I=Math.ceil(y/f),m=Math.max(h,I),g=[];let v=0;for(;v<y;)g.push(p.slice(v,v+m)),v+=m;return g})(l,a.minimumChunkSizeMb,a.signedUrls.length),u=await Promise.all(c.map(async(p,d)=>{const f=yt(),y={apiUrl:s,chunkIndex:d+1,completeUploadHeaders:i,etag:null,responseGroupId:r,status:"ReadyForUpload",surveyId:t,timestamp:o,totalChunks:c.length,data:p,uploadId:a.uploadId,uploadUrl:a.signedUrls[d].url,uuid:f,visitorId:n};return await(await Q.openDB()).add("chunkUploads",{...y,sessionId:y.sessionId??be}),y}));await(async(p,d)=>{await Zu(d),await Promise.all(p.map(f=>Ku(f)))})([a.uploadId],u)},Qu=async(e,t)=>{if($e())return P.debug("ReplayDisabled-ScheduleOrCapture");const{isHeatmap:r,isStandalone:n,replayParams:s,triggerTimestamp:i,responseGroupId:a}=e,o=async()=>{setTimeout(()=>z.removeListener(B.QuestionAnswered,o),0),xe(async()=>{s.replayDurationType==="before"?await ll(e):await Q.markPendingCaptureToCanUpload(a)},"Error in schedule/capture callback")};xe(async()=>{if(s.replayDurationType==="after"||s.replayDurationType==="beforeAndAfter")return!n&&!r&&z.on(B.QuestionAnswered,o),void await td(e);if(n||r||t)await ll(e),r&&jg();else{const l=35+s.replayDurationSeconds,c=i-1e3*l,u=i;await Q.updateEventsExpiredAt(c,u,s.expirationTimeLimitMinutes),z.on(B.QuestionAnswered,o)}},"Error in scheduling/capturing replay")},jg=async()=>{parseInt(lt??"0")||ue.removeItem("sprig.isCapturingHeatmap"),ue.getItem("sprig.teardownAfterCapture")&&(Fu(),ed(),ue.removeItem("sprig.teardownAfterCapture"))},ed=async()=>$e()?P.debug("ReplayDisabled-ClearData"):Promise.all([Q.deleteBySessionId("events",be),Q.deleteBySessionId("pendingCaptures",be)]).catch(e=>{vr("Error clearing user replay data",e)}),td=async e=>{if($e())return;const{isHeatmap:t,surveyId:r}=e,n=await Q.getPendingCaptures(),s=n==null?void 0:n.filter(l=>l.captureParams.surveyId===r);if(s!=null&&s.length)return void P.info("PendingCaptureExists",{surveyId:r});t&&(Ei(),ue.setItem("sprig.isCapturingHeatmap","true"),Ri=Date.now(),pe.inactivityInterval||(pe.inactivityInterval=window.setInterval(()=>{var l;l=Ri,Date.now()-l>=3e4&&xe(()=>Q.markPendingHeatmapsReady(),"Error in heatmap inactivity")},1e3)));const i={...e,replayParams:{...e.replayParams}};e.replayParams.replayDurationType==="beforeAndAfter"&&(i.replayParams.replayDurationSeconds*=2),i.replayParams.replayDurationType="before";const a=e.triggerTimestamp+1e3*e.replayParams.replayDurationSeconds;i.triggerTimestamp=a,lt=(parseInt(lt??"0")+1).toString(),ue.setItem("sprig.pendingCount",lt),await(await Q.openDB()).add("pendingCaptures",{canUpload:!1,captureParams:i,sessionId:be,targetTimestamp:a,timestamp:Date.now(),uuid:yt()})},Wg=Object.freeze(Object.defineProperty({__proto__:null,RecordEvent:e=>{qe("Sprig_TrackEvent",e)},RecordPageView:e=>{e.description&&(e.description=ao(e.description)),qe("Sprig_PageView",e)},RecordSurveyShown:e=>{qe("Sprig_ShowSurvey",e)},_completeSessionReplay:async({surveyId:e,responseGroupUuid:t,eventDigest:r,headers:n})=>{if(!e||!t)return!1;const s=window.UserLeap._API_URL,i=await Ou({surveyId:e,responseGroupUuid:t,eventDigest:r,apiUrl:s,headers:n},!0);return!(i!=null&&i.error)},checkPendingHeatmapsUrl:()=>$e()?P.debug("ReplayDisabled-PendingHeatmaps"):xe(async()=>{const e=(await Q.getPendingCaptures({isHeatmap:!0})).map(t=>({eventId:t.captureParams.eventId,uuid:t.uuid})).filter(({eventId:t})=>!lu(t)).map(({uuid:t})=>t);return P.info("PendingHeatmapsToComplete",{count:e.length}),e.length&&(await Q.markPendingHeatmapsReady(e),P.info("MarkedPendingHeatmapsReady")),e.length},"Error marking pending heatmaps ready"),clearUserReplayData:ed,disableRecording:vr,initializeReplay:async({maxReplayDurationSeconds:e,maxInflightRequests:t=2,replaySettings:r,teardownAfter:n=!1,apiUrl:s,alwaysOnConfig:i})=>{if(i&&xg({apiUrl:s,config:i,triggerSnapshot:()=>{Ei()}}),lt=ue.getItem("sprig.pendingCount"),pe.isRecording)return;if(n&&ue.setItem("sprig.teardownAfterCapture","true"),$e())return P.debug("ReplayDisabled");if(await(async()=>{var l;if(!Nu())return!0;if((l=window.navigator.storage)!=null&&l.estimate)try{const{quota:c=0,usage:u=0}=await window.navigator.storage.estimate(),p=(c-u)/1024**3;return P.info("Storage",{availableGb:p}),p<.5}catch{return!0}return!1})())return P.debug("IDBNotSupported"),ki();try{const l=await Q.openDB();P.info("DBVersion",{version:l.version})}catch(l){return P.error("ReplayOpenErr",{name:l.name}),l.name==="VersionError"&&Q.deleteDB(),ki()}xe(async()=>{await Ai(!0)},"Error uploading ready pending captures");const a=Dt()?30:0,o=Math.max(e??0,a);if(!o)return P.debug("MissingDuration");P.debug("ReplayInit"),await xe(async()=>{var l;r!=null&&r.minDuration&&(Xu=r.minDuration),r!=null&&r.batchDuration&&(xi=r.batchDuration),l=t,Lu.setLimit(l),Bg(),_g(o+35,1800,o+35),Ng();const c=window.UserLeap.replayLibraryURL??"https://cdn.sprig.com/dependencies/record.min.js",u=window.rrwebRecord;if(!u)return P.error("RecordScriptFailed");let p=!0,d=0;const f={checkoutEveryNms:3e4,sampling:{input:"last",scroll:250,media:800},...r,mutationQueueEnabled:r==null?void 0:r.enableMutationQueue};var y,h;pe.stopRecording=u({emit:(I,m)=>{if(I.type===ot.Custom&&(Ri=Date.now()),$e()||Un())return;if(m&&I.type===ot.Meta)d=performance.now();else if(m&&d&&I.type===ot.FullSnapshot){const v=performance.now()-d;gu("sdk_replay_snapshot_seconds",v/1e3)}const g=p||!!m&&I.type===ot.Meta;p=!1,Tg(g,I),Dg({uuid:yt(),event:JSON.stringify(I),isValidStart:g,timestamp:Date.now()})},...f}),pe.isRecording=!!pe.stopRecording,pe.isRecording&&(((I,m)=>{window.addEventListener("message",g=>{var v;g.data.type===hg&&(oo.push({source:g.source,origin:g.origin}),(v=g.source)==null||v.postMessage({type:mg,settings:I,replayLibraryUrl:m},{targetOrigin:g.origin}))})})(f,c),z.on("survey.complete",I=>{var m;m={id:I,userAgent:window.navigator.userAgent},qe("Sprig_SubmitSurvey",m)}),y=qe,h=Cg,Mn||(Re=y,hn=h,window.addEventListener("click",Du,Ve),window.addEventListener("pointerdown",_u,Ve),window.addEventListener("mousedown",Pu,Ve),window.addEventListener("keydown",Uu,Ve),window.addEventListener("scroll",Tu,Ve),Mn=!0,Sg(),Ig()))},"Error initializing replay")},isReplayPaused:Un,isReplayRecording:()=>pe.isRecording,recordFullSnapshot:Ei,recordReplayPaused:()=>{qe("Sprig_ReplayPaused",{timestamp:Date.now()}),ue.setItem("sprig.isReplayPaused","true")},recordReplayResumed:()=>{ue.removeItem("sprig.isReplayPaused"),qe("Sprig_ReplayResumed",{timestamp:Date.now()})},scheduleCapture:td,scheduleOrCaptureReplay:Qu,tryReplayAction:xe,uploadReadyPendingCaptures:Ai},Symbol.toStringTag,{value:"Module"}));(e=>{re.replay=e})(Wg),window.UpChunk={createUpload:jd},window.rrwebRecord=Yt,exports.APP_ID="ul-app",exports.ConflictingWidgets=Zc,exports.DEFAULT_BORDER_COLOR="#e6e6e6",exports.DEFAULT_WIDTH_PX=360,exports.DismissReason=Ue,exports.EMBED_MOBILE_MAX_WIDTH=1030,exports.ERROR_BORDER_COLOR="#bd282a",exports.SprigAPI=yi,exports.SprigEvent=B,exports.breadcrumbsLogger=P,exports.calculateFrameDimensions=cu,exports.eventEmitter=z,exports.groupCards=(e,t)=>{const r=[e[t]],n=e[t].groupId;return n?e.slice(t).reduce((s,i)=>(i.groupId===n&&s.push(i),s),[]):r},exports.isHTMLElement=ze,exports.isLongFormSurvey=e=>e==="longFormSurvey",exports.resetScrollPosition=e=>{const t=e.querySelector(".ul-card__container");t&&(t.scrollTop=0)},exports.setSurveyStyles=mr,exports.shouldDirectEmbed=eo,exports.sprig=ig,exports.sprigFetch=Ge,exports.v4=yt;