@sprig-technologies/sprig-bundled 2.35.0 → 2.36.0

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,6 +1,6 @@
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 ue=(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,mr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kd=mr((e,t)=>{var r;r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t.exports=r}),Ed=mr((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=mr((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(),d=r(l.slice(c+1));i[u]===void 0?i[u]=d:n(i[u])?i[u].push(d):i[u]=[i[u],d]}return i}}),Rd=mr((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=mr((e,t)=>{var r=kd(),n=Ed(),s=xd(),i=Rd();function a(c,u,d){var p=c;return n(u)?(d=u,typeof c=="string"&&(p={uri:c})):p=i(u,{uri:c}),p.callback=d,p}function o(c,u,d){return l(u=a(c,u,d))}function l(c){if(c.callback===void 0)throw new Error("callback argument missing");var u=!1,d=function(R,O,S){u||(u=!0,c.callback(R,O,S))};function p(){var R=void 0;if(R=h.response?h.response:h.responseText||function(O){try{if(O.responseType==="document")return O.responseXML;var S=O.responseXML&&O.responseXML.documentElement.nodeName==="parsererror";if(O.responseType===""&&!S)return O.responseXML}catch{}return null}(h),A)try{R=JSON.parse(R)}catch{}return R}function f(R){return clearTimeout(g),R instanceof Error||(R=new Error(""+(R||"Unknown XMLHttpRequest Error"))),R.statusCode=0,d(R,k)}function y(){if(!m){var R;clearTimeout(g),R=c.useXDR&&h.status===void 0?200:h.status===1223?204:h.status;var O=k,S=null;return R!==0?(O={body:p(),statusCode:R,method:I,headers:{},url:v,rawRequest:h},h.getAllResponseHeaders&&(O.headers=s(h.getAllResponseHeaders()))):S=new Error("Internal XMLHttpRequest Error"),d(S,O,O.body)}}var h=c.xhr||null;h||(h=c.cors||c.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var C,m,g,v=h.url=c.uri||c.url,I=h.method=c.method||"GET",M=c.body||c.data,E=h.headers=c.headers||{},U=!!c.sync,A=!1,k={body:void 0,headers:{},statusCode:0,method:I,url:v,rawRequest:h};if("json"in c&&c.json!==!1&&(A=!0,E.accept||E.Accept||(E.Accept="application/json"),I!=="GET"&&I!=="HEAD"&&(E["content-type"]||E["Content-Type"]||(E["Content-Type"]="application/json"),M=JSON.stringify(c.json===!0?M: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(I,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 R=new Error("XMLHttpRequest timeout");R.code="ETIMEDOUT",f(R)}},c.timeout)),h.setRequestHeader)for(C in E)E.hasOwnProperty(C)&&h.setRequestHeader(C,E[C]);else if(c.headers&&!function(R){for(var O in R)if(R.hasOwnProperty(O))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(M||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 d=0;d<c.length;d++)u(c[d])}(["get","put","post","patch","head","delete"],function(c){o[c==="delete"?"del":c]=function(u,d,p){return(d=a(u,d,p)).method=c.toUpperCase(),l(d)}})});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 Te=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});Te!==void 0&&Te.Event!==void 0&&Object.setPrototypeOf(Xe.prototype,Te.Event.prototype);var wt,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 fn=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 gn=new WeakMap;function pl(e){let t=Object.getPrototypeOf(e);if(t==null)return fn;let r=gn.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),gn.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)}gn.set(Object.prototype,fn),Te!==void 0&&Te.Event!==void 0&&gn.set(Te.Event.prototype,fn);var Tn=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(p,f,y){var h;return Co(f),typeof y=="object"&&y!==null?{type:String(p),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(p),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(p,f){var y;return(y=p[f])!==null&&y!==void 0?y:p[f]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(n,c),d=fl(u,s,i);d===-1?function(p,f,y,h,C,m){let g;m&&(g=Io.bind(null,p,f,y),m.addEventListener("abort",g));let v=function(I,M,E,U,A,k){return{callback:I,flags:(M?1:0)|(E?2:0)|(U?4:0),signal:A,signalListener:k}}(f,y,h,C,m,g);p.cow?(p.cow=!1,p.listeners=[...p.listeners,v]):p.listeners.push(v)}(u,s,i,o,a,l):function(p,f,y,h){Dd.warn(ml(p)?"capture":"bubble",p.callback),bo(p)!==f&&Xn.warn("passive"),So(p)!==y&&Xn.warn("once"),p.signal!==h&&Xn.warn("signal")}(u.listeners[d],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:fn.wrap(e),n=he(r,"event");if(n.dispatchFlag)throw s="This event has been in dispatching.",Te.DOMException?new Te.DOMException(s,"InvalidStateError"):(wt==null&&(wt=class yl extends Error{constructor(a){super(a),Error.captureStackTrace&&Error.captureStackTrace(this,yl)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(wt.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),vo(wt),vo(wt.prototype)),new wt(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(Tn.prototype);for(let e=0;e<Qn.length;++e)Qn[e]!=="constructor"&&Object.defineProperty(Tn.prototype,Qn[e],{enumerable:!0});Te!==void 0&&Te.EventTarget!==void 0&&Object.setPrototypeOf(Tn.prototype,Te.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()),Dn=512e3,Pn=256,ks=(e,{minChunkSize:t=Pn,maxChunkSize:r=Dn}={})=>e==null||typeof e=="number"&&e>=256&&e%256==0&&e>=t&&e<=r,Es=(e,{minChunkSize:t=Pn,maxChunkSize:r=Dn}={})=>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:Pn,this.maxChunkSize=(s=t.maxChunkSize)!=null?s:Dn}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 Tn,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:Dn}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:Pn}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,x=(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"]},Sr={};function Ui(e){if(Sr[e])return Sr[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 Sr[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?Sr[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 ge={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 qt(e){const t=e&&"host"in e&&"mode"in e&&ge.host(e)||null;return!!(t&&"shadowRoot"in t&&ge.shadowRoot(t)===e)}function Xt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Jr(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=Jr(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?yn(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?yn(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 yn(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(p){let f="";return f=p.indexOf("//")>-1?p.split("/").slice(0,3).join("/"):p.split("/")[0],f=f.split("?")[0],f}(t)+l}${c})`;const u=t.split("/"),d=l.split("/");u.pop();for(const p of d)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}let Jd=1;const qd=new RegExp("[^a-z0-9-_:]");function El(){return Jd++}let vt,Mo;const Xd=/^[^ \t\n\r\u000c]+/,Zd=/^[, \t\n\r\u000c]+/,Uo=new WeakMap;function _t(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]!=="#"?_t(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 d=c.exec(i.substring(a));return d?(u=d[0],a+=u.length,u):""}const l=[];for(;o(Zd),!(a>=i.length);){let c=o(Xd);if(c.slice(-1)===",")c=_t(s,c.substring(0,c.length-1)),l.push(c);else{let u="";c=_t(s,c);let d=!1;for(;;){const p=i.charAt(a);if(p===""){l.push((c+u).trim());break}if(d)p===")"&&(d=!1);else{if(p===","){a+=1,l.push((c+u).trim());break}p==="("&&(d=!0)}u+=p,a+=1}}}return l.join(", ")}(e,n):r==="style"?yn(n,Pi(e)):t==="object"&&r==="data"?_t(e,n):n:_t(e,n))}function Rl(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function wn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&wn(ge.parentNode(e),t,r);for(let n=e.classList.length;n--;){const s=e.classList[n];if(t.test(s))return!0}return!!r&&wn(ge.parentNode(e),t,r)}function Ll(e,t,r,n){let s;if(Il(e)){if(s=e,!ge.childNodes(s).length)return!1}else{if(ge.parentElement(e)===null)return!1;s=ge.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(wn(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:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:h=!1}=t,C=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:C};case e.ELEMENT_NODE:return function(m,g){const{doc:v,blockClass:I,blockSelector:M,inlineStylesheet:E,maskInputOptions:U={},maskInputFn:A,dataURLOptions:k={},inlineImages:R,recordCanvas:O,keepIframeSrcFn:S,newlyAddedElement:N=!1,rootId:D}=g,b=function(L,_,F){try{if(typeof _=="string"){if(L.classList.contains(_))return!0}else for(let J=L.classList.length;J--;){const pe=L.classList[J];if(_.test(pe))return!0}if(F)return L.matches(F)}catch{}return!1}(m,I,M),w=function(L){if(L instanceof HTMLFormElement)return"form";const _=ht(L.tagName);return qd.test(_)?"div":_}(m);let T={};const z=m.attributes.length;for(let L=0;L<z;L++){const _=m.attributes[L];Rl(w,_.name,_.value)||(T[_.name]=xl(v,w,ht(_.name),_.value))}if(w==="link"&&E){const L=Array.from(v.styleSheets).find(F=>F.href===m.href);let _=null;L&&(_=Jr(L)),_&&(delete T.rel,delete T.href,T._cssText=_)}if(w==="style"&&m.sheet&&!(m.innerText||ge.textContent(m)||"").trim().length){const L=Jr(m.sheet);L&&(T._cssText=L)}if(w==="input"||w==="textarea"||w==="select"){const L=m.value,_=m.checked;T.type!=="radio"&&T.type!=="checkbox"&&T.type!=="submit"&&T.type!=="button"&&L?T.value=Ti({element:m,type:Di(m),tagName:w,value:L,maskInputOptions:U,maskInputFn:A}):_&&(T.checked=_)}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"&&O){if(m.__context==="2d")(function(L){const _=L.getContext("2d");if(!_)return!0;for(let F=0;F<L.width;F+=50)for(let J=0;J<L.height;J+=50){const pe=_.getImageData,Le=Oo in pe?pe[Oo]:pe;if(new Uint32Array(Le.call(_,F,J,Math.min(50,L.width-F),Math.min(50,L.height-J)).data.buffer).some(ye=>ye!==0))return!1}return!0})(m)||(T.rr_dataURL=m.toDataURL(k.type,k.quality));else if(!("__context"in m)){const L=m.toDataURL(k.type,k.quality),_=v.createElement("canvas");_.width=m.width,_.height=m.height,L!==_.toDataURL(k.type,k.quality)&&(T.rr_dataURL=L)}}if(w==="img"&&R){vt||(vt=v.createElement("canvas"),Mo=vt.getContext("2d"));const L=m,_=L.currentSrc||L.getAttribute("src")||"<unknown-src>",F=L.crossOrigin,J=()=>{L.removeEventListener("load",J);try{vt.width=L.naturalWidth,vt.height=L.naturalHeight,Mo.drawImage(L,0,0),T.rr_dataURL=vt.toDataURL(k.type,k.quality)}catch(pe){if(L.crossOrigin!=="anonymous")return L.crossOrigin="anonymous",void(L.complete&&L.naturalWidth!==0?J():L.addEventListener("load",J));console.warn(`Cannot inline img src=${_}! Error: ${pe}`)}L.crossOrigin==="anonymous"&&(F?T.crossOrigin=F:L.removeAttribute("crossorigin"))};L.complete&&L.naturalWidth!==0?J():L.addEventListener("load",J)}if(w==="audio"||w==="video"){const L=T;L.rr_mediaState=m.paused?"paused":"played",L.rr_mediaCurrentTime=m.currentTime,L.rr_mediaPlaybackRate=m.playbackRate,L.rr_mediaMuted=m.muted,L.rr_mediaLoop=m.loop,L.rr_mediaVolume=m.volume}if(N||(m.scrollLeft&&(T.rr_scrollLeft=m.scrollLeft),m.scrollTop&&(T.rr_scrollTop=m.scrollTop)),b){const{width:L,height:_}=m.getBoundingClientRect();T={class:T.class,rr_width:`${L}px`,rr_height:`${_}px`}}w!=="iframe"||S(T.src)||(m.contentDocument||(T.rr_src=T.src),delete T.src);let W;try{customElements.get(w)&&(W=!0)}catch{}return{type:me.Element,tagName:w,attributes:T,childNodes:[],isSVG:Kd(m)||void 0,needBlock:b,rootId:D,isCustom:W}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:h,rootId:C});case e.TEXT_NODE:return function(m,g){var v;const{needsMask:I,maskTextFn:M,rootId:E}=g,U=ge.parentNode(m),A=U&&U.tagName;let k=ge.textContent(m);const R=A==="STYLE"||void 0,O=A==="SCRIPT"||void 0;if(R&&k){try{m.nextSibling||m.previousSibling||(v=U.sheet)!=null&&v.cssRules&&(k=Jr(U.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,m)}k=yn(k,Pi(g.doc))}return O&&(k="SCRIPT_PLACEHOLDER"),!R&&!O&&k&&I&&(k=M?M(k,ge.parentElement(m)):k.replace(/[\S]/g,"*")),{type:me.Text,textContent:k||"",isStyle:R,rootId:E}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:C});case e.CDATA_SECTION_NODE:return{type:me.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:me.Comment,textContent:ge.textContent(e)||"",rootId:C};default:return!1}}function ee(e){return e==null?"":e.toLowerCase()}function kt(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y={},inlineImages:h=!1,recordCanvas:C=!1,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:E=()=>!1,newlyAddedElement:U=!1}=t;let{needsMask:A}=t,{preserveWhiteSpace:k=!0}=t;A||(A=Ll(e,a,o,A===void 0));const R=Qd(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:A,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:y,inlineImages:h,recordCanvas:C,keepIframeSrcFn:E,newlyAddedElement:U});if(!R)return console.warn(e,"not serialized"),null;let O;O=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"&&(ee(b.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(b.attributes.name)==="application-name"||ee(b.attributes.rel)==="icon"||ee(b.attributes.rel)==="apple-touch-icon"||ee(b.attributes.rel)==="shortcut icon"))||b.tagName==="meta"&&(w.headMetaDescKeywords&&ee(b.attributes.name).match(/^description|keywords$/)||w.headMetaSocial&&(ee(b.attributes.property).match(/^(og|twitter|fb):/)||ee(b.attributes.name).match(/^(og|twitter):/)||ee(b.attributes.name)==="pinterest")||w.headMetaRobots&&(ee(b.attributes.name)==="robots"||ee(b.attributes.name)==="googlebot"||ee(b.attributes.name)==="bingbot")||w.headMetaHttpEquiv&&b.attributes["http-equiv"]!==void 0||w.headMetaAuthorship&&(ee(b.attributes.name)==="author"||ee(b.attributes.name)==="generator"||ee(b.attributes.name)==="framework"||ee(b.attributes.name)==="publisher"||ee(b.attributes.name)==="progid"||ee(b.attributes.property).match(/^article:/)||ee(b.attributes.property).match(/^product:/))||w.headMetaVerification&&(ee(b.attributes.name)==="google-site-verification"||ee(b.attributes.name)==="yandex-verification"||ee(b.attributes.name)==="csrf-token"||ee(b.attributes.name)==="p:domain_verify"||ee(b.attributes.name)==="verify-v1"||ee(b.attributes.name)==="verification"||ee(b.attributes.name)==="shopify-checkout-api-token"))))}(R,f)&&(k||R.type!==me.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?El():-2;const S=Object.assign(R,{id:O});if(n.add(e,S),O===-2)return null;m&&m(e);let N=!l;if(S.type===me.Element){N=N&&!S.needBlock,delete S.needBlock;const b=ge.shadowRoot(e);b&&Xt(b)&&(S.isShadowHost=!0)}if((S.type===me.Document||S.type===me.Element)&&N){f.headWhitespace&&S.type===me.Element&&S.tagName==="head"&&(k=!1);const b={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:A,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:C,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:E};if(!(S.type===me.Element&&S.tagName==="textarea"&&S.attributes.value!==void 0))for(const T of Array.from(ge.childNodes(e))){const z=kt(T,b);z&&S.childNodes.push(z)}let w=null;if(Il(e)&&(w=ge.shadowRoot(e)))for(const T of Array.from(ge.childNodes(w))){const z=kt(T,b);z&&(Xt(w)&&(z.isShadow=!0),S.childNodes.push(z))}}const D=ge.parentNode(e);return D&&qt(D)&&Xt(D)&&(S.isShadow=!0),S.type===me.Element&&S.tagName==="iframe"&&function(b,w,T){const z=b.contentWindow;if(!z)return;let W,L=!1;try{W=z.document.readyState}catch{return}if(W!=="complete"){const F=setTimeout(()=>{L||(w(),L=!0)},T);return void b.addEventListener("load",()=>{clearTimeout(F),L=!0,w()})}const _="about:blank";if(z.location.href!==_||b.src===_||b.src==="")return setTimeout(w,0),b.addEventListener("load",w);b.addEventListener("load",w)}(e,()=>{const b=e.contentDocument;if(b&&g){const w=kt(b,{doc:b,mirror:n,blockClass:s,blockSelector:i,needsMask:A,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:C,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:E});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 z,W=!1;try{z=b.sheet}catch{return}if(z)return;const L=setTimeout(()=>{W||(w(),W=!0)},T);b.addEventListener("load",()=>{clearTimeout(L),W=!0,w()})}(e,()=>{if(I){const b=kt(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:A,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:C,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:E});b&&I(e,b)}},M),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:{}},ne=String,To=function(){return{isColorSupported:!1,reset:ne,bold:ne,dim:ne,italic:ne,underline:ne,inverse:ne,hidden:ne,strikethrough:ne,black:ne,red:ne,green:ne,yellow:ne,blue:ne,magenta:ne,cyan:ne,white:ne,gray:ne,bgBlack:ne,bgRed:ne,bgGreen:ne,bgYellow:ne,bgBlue:ne,bgMagenta:ne,bgCyan:ne,bgWhite:ne}};xs.exports=To(),xs.exports.createColors=To;var rp=xs.exports;const Pe=tp(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Do=rp,Po=Pe,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:d}=Do.createColors(!0);n=p=>c(d(p)),s=p=>u(p)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,p=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(p)+c+`
1
+ "use strict";var Sd=Object.defineProperty;var Id=(e,t,r)=>t in e?Sd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ue=(e,t,r)=>Id(e,typeof t!="symbol"?t+"":t,r);var Cd=Object.create,uo=Object.defineProperty,kd=Object.getOwnPropertyDescriptor,Ed=Object.getOwnPropertyNames,xd=Object.getPrototypeOf,Rd=Object.prototype.hasOwnProperty,mr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ld=mr((e,t)=>{var r;r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t.exports=r}),Od=mr((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}),Ad=mr((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(),d=r(l.slice(c+1));i[u]===void 0?i[u]=d:n(i[u])?i[u].push(d):i[u]=[i[u],d]}return i}}),Md=mr((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}),Ud=mr((e,t)=>{var r=Ld(),n=Od(),s=Ad(),i=Md();function a(c,u,d){var p=c;return n(u)?(d=u,typeof c=="string"&&(p={uri:c})):p=i(u,{uri:c}),p.callback=d,p}function o(c,u,d){return l(u=a(c,u,d))}function l(c){if(c.callback===void 0)throw new Error("callback argument missing");var u=!1,d=function(L,O,S){u||(u=!0,c.callback(L,O,S))};function p(){var L=void 0;if(L=h.response?h.response:h.responseText||function(O){try{if(O.responseType==="document")return O.responseXML;var S=O.responseXML&&O.responseXML.documentElement.nodeName==="parsererror";if(O.responseType===""&&!S)return O.responseXML}catch{}return null}(h),A)try{L=JSON.parse(L)}catch{}return L}function f(L){return clearTimeout(g),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,d(L,E)}function y(){if(!m){var L;clearTimeout(g),L=c.useXDR&&h.status===void 0?200:h.status===1223?204:h.status;var O=E,S=null;return L!==0?(O={body:p(),statusCode:L,method:I,headers:{},url:v,rawRequest:h},h.getAllResponseHeaders&&(O.headers=s(h.getAllResponseHeaders()))):S=new Error("Internal XMLHttpRequest Error"),d(S,O,O.body)}}var h=c.xhr||null;h||(h=c.cors||c.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var k,m,g,v=h.url=c.uri||c.url,I=h.method=c.method||"GET",M=c.body||c.data,x=h.headers=c.headers||{},U=!!c.sync,A=!1,E={body:void 0,headers:{},statusCode:0,method:I,url:v,rawRequest:h};if("json"in c&&c.json!==!1&&(A=!0,x.accept||x.Accept||(x.Accept="application/json"),I!=="GET"&&I!=="HEAD"&&(x["content-type"]||x["Content-Type"]||(x["Content-Type"]="application/json"),M=JSON.stringify(c.json===!0?M: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(I,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 L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",f(L)}},c.timeout)),h.setRequestHeader)for(k in x)x.hasOwnProperty(k)&&h.setRequestHeader(k,x[k]);else if(c.headers&&!function(L){for(var O in L)if(L.hasOwnProperty(O))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(M||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 d=0;d<c.length;d++)u(c[d])}(["get","put","post","patch","head","delete"],function(c){o[c==="delete"?"del":c]=function(u,d,p){return(d=a(u,d,p)).method=c.toUpperCase(),l(d)}})});function Mi(e,t,...r){if(!e)throw new TypeError(dl(t,r))}function dl(e,t){let r=0;return e.replace(/%[os]/gu,()=>pl(t[r++]))}function pl(e){return typeof e!="object"||e===null?String(e):Object.prototype.toString.call(e)}var Ue=typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:typeof globalThis<"u"?globalThis:void 0,lt=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{}}},Td=new lt("W01","Unable to initialize event under dispatching."),Dd=new lt("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),Pd=new lt("W03","Assigning any truthy value to 'returnValue' property has no effect."),_d=new lt("W04","Unable to preventDefault on non-cancelable events."),Nd=new lt("W05","Unable to preventDefault inside passive event listener invocation."),Fd=new lt("W06","An event listener wasn't added because it has been added already: %o, %o"),Xn=new lt("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),po=new lt("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o"),Je=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 pe(this).type}get target(){return pe(this).target}get srcElement(){return pe(this).target}get currentTarget(){return pe(this).currentTarget}composedPath(){let e=pe(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 pe(this).dispatchFlag?2:0}stopPropagation(){pe(this).stopPropagationFlag=!0}get cancelBubble(){return pe(this).stopPropagationFlag}set cancelBubble(e){e?pe(this).stopPropagationFlag=!0:Dd.warn()}stopImmediatePropagation(){let e=pe(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return pe(this).bubbles}get cancelable(){return pe(this).cancelable}get returnValue(){return!pe(this).canceledFlag}set returnValue(e){e?Pd.warn():yo(pe(this))}preventDefault(){yo(pe(this))}get defaultPrevented(){return pe(this).canceledFlag}get composed(){return pe(this).composed}get isTrusted(){return!1}get timeStamp(){return pe(this).timeStamp}initEvent(e,t=!1,r=!1){let n=pe(this);n.dispatchFlag?Td.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 pe(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?Nd.warn():e.cancelable?e.canceledFlag=!0:_d.warn()}Object.defineProperty(Je,"NONE",{enumerable:!0}),Object.defineProperty(Je,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(Je,"AT_TARGET",{enumerable:!0}),Object.defineProperty(Je,"BUBBLING_PHASE",{enumerable:!0});var Kn=Object.getOwnPropertyNames(Je.prototype);for(let e=0;e<Kn.length;++e)Kn[e]!=="constructor"&&Object.defineProperty(Je.prototype,Kn[e],{enumerable:!0});Ue!==void 0&&Ue.Event!==void 0&&Object.setPrototypeOf(Je.prototype,Ue.Event.prototype);var wt,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 fn=class extends Je{static wrap(e){return new(ml(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),hl.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,fl(e,n))}}stopPropagation(){super.stopPropagation();let{original:e}=rt(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;let{original:t}=rt(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();let{original:e}=rt(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;let{original:t}=rt(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();let{original:e}=rt(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){let{original:e}=rt(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}},hl=new WeakMap;function rt(e){let t=hl.get(e);return Mi(t!=null,"'this' is expected an Event object, but got",e),t}var gn=new WeakMap;function ml(e){let t=Object.getPrototypeOf(e);if(t==null)return fn;let r=gn.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],fl(s,a[o]));return i}(ml(t),t),gn.set(t,r)),r}function fl(e,t){let r=Object.getOwnPropertyDescriptor(e,t);return{get(){let n=rt(this).original,s=n[t];return typeof s=="function"?s.bind(n):s},set(n){rt(this).original[t]=n},configurable:r.configurable,enumerable:r.enumerable}}function gl(e){return!(1&~e.flags)}function bo(e){return!(2&~e.flags)}function So(e){return!(4&~e.flags)}function Bd(e){return!(8&~e.flags)}function zd({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(pl(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 yl({listeners:e},t,r){for(let n=0;n<e.length;++n)if(e[n].callback===t&&gl(e[n])===r)return n;return-1}function Io(e,t,r){let n=yl(e,t,r);return n!==-1&&wl(e,n)}function wl(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)}gn.set(Object.prototype,fn),Ue!==void 0&&Ue.Event!==void 0&&gn.set(Ue.Event.prototype,fn);var Tn=class{constructor(){bl.set(this,Object.create(null))}addEventListener(e,t,r){let n=Zn(this),{callback:s,capture:i,once:a,passive:o,signal:l,type:c}=function(p,f,y){var h;return Co(f),typeof y=="object"&&y!==null?{type:String(p),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(p),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(p,f){var y;return(y=p[f])!==null&&y!==void 0?y:p[f]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(n,c),d=yl(u,s,i);d===-1?function(p,f,y,h,k,m){let g;m&&(g=Io.bind(null,p,f,y),m.addEventListener("abort",g));let v=function(I,M,x,U,A,E){return{callback:I,flags:(M?1:0)|(x?2:0)|(U?4:0),signal:A,signalListener:E}}(f,y,h,k,m,g);p.cow?(p.cow=!1,p.listeners=[...p.listeners,v]):p.listeners.push(v)}(u,s,i,o,a,l):function(p,f,y,h){Fd.warn(gl(p)?"capture":"bubble",p.callback),bo(p)!==f&&Xn.warn("passive"),So(p)!==y&&Xn.warn("once"),p.signal!==h&&Xn.warn("signal")}(u.listeners[d],o,a,l)}removeEventListener(e,t,r){let n=Zn(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=Zn(this)[String(e.type)];if(t==null)return!0;let r=e instanceof Je?e:fn.wrap(e),n=pe(r,"event");if(n.dispatchFlag)throw s="This event has been in dispatching.",Ue.DOMException?new Ue.DOMException(s,"InvalidStateError"):(wt==null&&(wt=class vl extends Error{constructor(a){super(a),Error.captureStackTrace&&Error.captureStackTrace(this,vl)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(wt.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),vo(wt),vo(wt.prototype)),new wt(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(!Bd(l)&&(So(l)&&wl(t,o,!i)&&(o-=1),n.inPassiveListenerFlag=bo(l),zd(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}},bl=new WeakMap;function Zn(e,t="this"){let r=bl.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(dl(po.message,[e]))}}var Qn=Object.getOwnPropertyNames(Tn.prototype);for(let e=0;e<Qn.length;++e)Qn[e]!=="constructor"&&Object.defineProperty(Tn.prototype,Qn[e],{enumerable:!0});Ue!==void 0&&Ue.EventTarget!==void 0&&Object.setPrototypeOf(Tn.prototype,Ue.EventTarget.prototype);var ko,jd=((e,t,r)=>(r=e!=null?Cd(xd(e)):{},((n,s,i,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of Ed(s))!Rd.call(n,o)&&o!==i&&uo(n,o,{get:()=>s[o],enumerable:!(a=kd(s,o))||a.enumerable});return n})(e&&e.__esModule?r:uo(r,"default",{value:e,enumerable:!0}),e)))(Ud()),Dn=512e3,Pn=256,ks=(e,{minChunkSize:t=Pn,maxChunkSize:r=Dn}={})=>e==null||typeof e=="number"&&e>=256&&e%256==0&&e>=t&&e<=r,Es=(e,{minChunkSize:t=Pn,maxChunkSize:r=Dn}={})=>new TypeError(`chunkSize ${e} must be a positive number in multiples of 256, between ${t} and ${r}`),Wd=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:Pn,this.maxChunkSize=(s=t.maxChunkSize)!=null?s:Dn}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()}}},Vd=[200,201,202,204,308],Sl=[408,502,503,504],Il=(e,t)=>!!e&&Vd.includes(e.statusCode),Hd=(e,t)=>t.attemptCount>=t.attempts||!(Il(e)||((r,{retryCodes:n=Sl})=>!r||n.includes(r.statusCode))(e,t)),Cl=class{static createUpload(e){return new Cl(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||Sl,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 Wd(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 Tn,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:Dn}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:Pn}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,jd.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 Il(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):Hd(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}}},Gd=Cl.createUpload,Yd=Object.defineProperty,R=(e,t,r)=>((n,s,i)=>s in n?Yd(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r),$d=Object.defineProperty,Eo=(e,t,r)=>((n,s,i)=>s in n?$d(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"]},Sr={};function Ui(e){if(Sr[e])return Sr[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 Sr[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?Sr[e]=c:r}catch{return r}}const es={};function Qe(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 ge={childNodes:function(e){return Qe("Node",e,"childNodes")},parentNode:function(e){return Qe("Node",e,"parentNode")},parentElement:function(e){return Qe("Node",e,"parentElement")},textContent:function(e){return Qe("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?Qe("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qe("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qe("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qe("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ui("MutationObserver").constructor}};function kl(e){return e.nodeType===e.ELEMENT_NODE}function Jt(e){const t=e&&"host"in e&&"mode"in e&&ge.host(e)||null;return!!(t&&"shadowRoot"in t&&ge.shadowRoot(t)===e)}function Xt(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=>El(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 El(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?yn(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?yn(r,t):r}}class xl{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 qd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Jd=/^(?:[a-z+]+:)?\/\//i,Xd=/^www\..*/i,Kd=/^(data:)([^,]*),(.*)/i;function yn(e,t){return(e||"").replace(qd,(r,n,s,i,a,o)=>{const l=s||a||o,c=n||i||"";if(!l)return r;if(Jd.test(l)||Xd.test(l))return`url(${c}${l}${c})`;if(Kd.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${function(p){let f="";return f=p.indexOf("//")>-1?p.split("/").slice(0,3).join("/"):p.split("/")[0],f=f.split("?")[0],f}(t)+l}${c})`;const u=t.split("/"),d=l.split("/");u.pop();for(const p of d)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}let Zd=1;const Qd=new RegExp("[^a-z0-9-_:]");function Rl(){return Zd++}let vt,Mo;const ep=/^[^ \t\n\r\u000c]+/,tp=/^[, \t\n\r\u000c]+/,Uo=new WeakMap;function _t(e,t){return t&&t.trim()!==""?Pi(e,t):t}function rp(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 Ll(e,t,r,n){return n&&(r==="src"||r==="href"&&(t!=="use"||n[0]!=="#")||r==="xlink:href"&&n[0]!=="#"?_t(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 d=c.exec(i.substring(a));return d?(u=d[0],a+=u.length,u):""}const l=[];for(;o(tp),!(a>=i.length);){let c=o(ep);if(c.slice(-1)===",")c=_t(s,c.substring(0,c.length-1)),l.push(c);else{let u="";c=_t(s,c);let d=!1;for(;;){const p=i.charAt(a);if(p===""){l.push((c+u).trim());break}if(d)p===")"&&(d=!1);else{if(p===","){a+=1,l.push((c+u).trim());break}p==="("&&(d=!0)}u+=p,a+=1}}}return l.join(", ")}(e,n):r==="style"?yn(n,Pi(e)):t==="object"&&r==="data"?_t(e,n):n:_t(e,n))}function Ol(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function wn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&wn(ge.parentNode(e),t,r);for(let n=e.classList.length;n--;){const s=e.classList[n];if(t.test(s))return!0}return!!r&&wn(ge.parentNode(e),t,r)}function Al(e,t,r,n){let s;if(kl(e)){if(s=e,!ge.childNodes(s).length)return!1}else{if(ge.parentElement(e)===null)return!1;s=ge.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(wn(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 np(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:a,inlineStylesheet:o,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:h=!1}=t,k=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:k};case e.ELEMENT_NODE:return function(m,g){const{doc:v,blockClass:I,blockSelector:M,inlineStylesheet:x,maskInputOptions:U={},maskInputFn:A,dataURLOptions:E={},inlineImages:L,recordCanvas:O,keepIframeSrcFn:S,newlyAddedElement:N=!1,rootId:P}=g,b=function(C,D,K){try{if(typeof D=="string"){if(C.classList.contains(D))return!0}else for(let $=C.classList.length;$--;){const he=C.classList[$];if(D.test(he))return!0}if(K)return C.matches(K)}catch{}return!1}(m,I,M),w=function(C){if(C instanceof HTMLFormElement)return"form";const D=ht(C.tagName);return Qd.test(D)?"div":D}(m);let T={};const B=m.attributes.length;for(let C=0;C<B;C++){const D=m.attributes[C];Ol(w,D.name,D.value)||(T[D.name]=Ll(v,w,ht(D.name),D.value))}if(w==="link"&&x){const C=Array.from(v.styleSheets).find(K=>K.href===m.href);let D=null;C&&(D=qr(C)),D&&(delete T.rel,delete T.href,T._cssText=D)}if(w==="style"&&m.sheet&&!(m.innerText||ge.textContent(m)||"").trim().length){const C=qr(m.sheet);C&&(T._cssText=C)}if(w==="input"||w==="textarea"||w==="select"){const C=m.value,D=m.checked;T.type!=="radio"&&T.type!=="checkbox"&&T.type!=="submit"&&T.type!=="button"&&C?T.value=Ti({element:m,type:Di(m),tagName:w,value:C,maskInputOptions:U,maskInputFn:A}):D&&(T.checked=D)}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"&&O){if(m.__context==="2d")(function(C){const D=C.getContext("2d");if(!D)return!0;for(let K=0;K<C.width;K+=50)for(let $=0;$<C.height;$+=50){const he=D.getImageData,ct=Oo in he?he[Oo]:he;if(new Uint32Array(ct.call(D,K,$,Math.min(50,C.width-K),Math.min(50,C.height-$)).data.buffer).some(Se=>Se!==0))return!1}return!0})(m)||(T.rr_dataURL=m.toDataURL(E.type,E.quality));else if(!("__context"in m)){const C=m.toDataURL(E.type,E.quality),D=v.createElement("canvas");D.width=m.width,D.height=m.height,C!==D.toDataURL(E.type,E.quality)&&(T.rr_dataURL=C)}}if(w==="img"&&L){vt||(vt=v.createElement("canvas"),Mo=vt.getContext("2d"));const C=m,D=C.currentSrc||C.getAttribute("src")||"<unknown-src>",K=C.crossOrigin,$=()=>{C.removeEventListener("load",$);try{vt.width=C.naturalWidth,vt.height=C.naturalHeight,Mo.drawImage(C,0,0),T.rr_dataURL=vt.toDataURL(E.type,E.quality)}catch(he){if(C.crossOrigin!=="anonymous")return C.crossOrigin="anonymous",void(C.complete&&C.naturalWidth!==0?$():C.addEventListener("load",$));console.warn(`Cannot inline img src=${D}! Error: ${he}`)}C.crossOrigin==="anonymous"&&(K?T.crossOrigin=K:C.removeAttribute("crossorigin"))};C.complete&&C.naturalWidth!==0?$():C.addEventListener("load",$)}if(w==="audio"||w==="video"){const C=T;C.rr_mediaState=m.paused?"paused":"played",C.rr_mediaCurrentTime=m.currentTime,C.rr_mediaPlaybackRate=m.playbackRate,C.rr_mediaMuted=m.muted,C.rr_mediaLoop=m.loop,C.rr_mediaVolume=m.volume}if(N||(m.scrollLeft&&(T.rr_scrollLeft=m.scrollLeft),m.scrollTop&&(T.rr_scrollTop=m.scrollTop)),b){const{width:C,height:D}=m.getBoundingClientRect();T={class:T.class,rr_width:`${C}px`,rr_height:`${D}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:rp(m)||void 0,needBlock:b,rootId:P,isCustom:j}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:y,newlyAddedElement:h,rootId:k});case e.TEXT_NODE:return function(m,g){var v;const{needsMask:I,maskTextFn:M,rootId:x}=g,U=ge.parentNode(m),A=U&&U.tagName;let E=ge.textContent(m);const L=A==="STYLE"||void 0,O=A==="SCRIPT"||void 0;if(L&&E){try{m.nextSibling||m.previousSibling||(v=U.sheet)!=null&&v.cssRules&&(E=qr(U.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,m)}E=yn(E,Pi(g.doc))}return O&&(E="SCRIPT_PLACEHOLDER"),!L&&!O&&E&&I&&(E=M?M(E,ge.parentElement(m)):E.replace(/[\S]/g,"*")),{type:me.Text,textContent:E||"",isStyle:L,rootId:x}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:k});case e.CDATA_SECTION_NODE:return{type:me.CDATA,textContent:"",rootId:k};case e.COMMENT_NODE:return{type:me.Comment,textContent:ge.textContent(e)||"",rootId:k};default:return!1}}function ee(e){return e==null?"":e.toLowerCase()}function kt(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y={},inlineImages:h=!1,recordCanvas:k=!1,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v=5e3,onStylesheetLoad:I,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:U=!1}=t;let{needsMask:A}=t,{preserveWhiteSpace:E=!0}=t;A||(A=Al(e,a,o,A===void 0));const L=np(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:A,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:y,inlineImages:h,recordCanvas:k,keepIframeSrcFn:x,newlyAddedElement:U});if(!L)return console.warn(e,"not serialized"),null;let O;O=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"&&(ee(b.attributes.name).match(/^msapplication-tile(image|color)$/)||ee(b.attributes.name)==="application-name"||ee(b.attributes.rel)==="icon"||ee(b.attributes.rel)==="apple-touch-icon"||ee(b.attributes.rel)==="shortcut icon"))||b.tagName==="meta"&&(w.headMetaDescKeywords&&ee(b.attributes.name).match(/^description|keywords$/)||w.headMetaSocial&&(ee(b.attributes.property).match(/^(og|twitter|fb):/)||ee(b.attributes.name).match(/^(og|twitter):/)||ee(b.attributes.name)==="pinterest")||w.headMetaRobots&&(ee(b.attributes.name)==="robots"||ee(b.attributes.name)==="googlebot"||ee(b.attributes.name)==="bingbot")||w.headMetaHttpEquiv&&b.attributes["http-equiv"]!==void 0||w.headMetaAuthorship&&(ee(b.attributes.name)==="author"||ee(b.attributes.name)==="generator"||ee(b.attributes.name)==="framework"||ee(b.attributes.name)==="publisher"||ee(b.attributes.name)==="progid"||ee(b.attributes.property).match(/^article:/)||ee(b.attributes.property).match(/^product:/))||w.headMetaVerification&&(ee(b.attributes.name)==="google-site-verification"||ee(b.attributes.name)==="yandex-verification"||ee(b.attributes.name)==="csrf-token"||ee(b.attributes.name)==="p:domain_verify"||ee(b.attributes.name)==="verify-v1"||ee(b.attributes.name)==="verification"||ee(b.attributes.name)==="shopify-checkout-api-token"))))}(L,f)&&(E||L.type!==me.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?Rl():-2;const S=Object.assign(L,{id:O});if(n.add(e,S),O===-2)return null;m&&m(e);let N=!l;if(S.type===me.Element){N=N&&!S.needBlock,delete S.needBlock;const b=ge.shadowRoot(e);b&&Xt(b)&&(S.isShadowHost=!0)}if((S.type===me.Document||S.type===me.Element)&&N){f.headWhitespace&&S.type===me.Element&&S.tagName==="head"&&(E=!1);const b={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:A,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:k,preserveWhiteSpace:E,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:x};if(!(S.type===me.Element&&S.tagName==="textarea"&&S.attributes.value!==void 0))for(const T of Array.from(ge.childNodes(e))){const B=kt(T,b);B&&S.childNodes.push(B)}let w=null;if(kl(e)&&(w=ge.shadowRoot(e)))for(const T of Array.from(ge.childNodes(w))){const B=kt(T,b);B&&(Xt(w)&&(B.isShadow=!0),S.childNodes.push(B))}}const P=ge.parentNode(e);return P&&Jt(P)&&Xt(P)&&(S.isShadow=!0),S.type===me.Element&&S.tagName==="iframe"&&function(b,w,T){const B=b.contentWindow;if(!B)return;let j,C=!1;try{j=B.document.readyState}catch{return}if(j!=="complete"){const K=setTimeout(()=>{C||(w(),C=!0)},T);return void b.addEventListener("load",()=>{clearTimeout(K),C=!0,w()})}const D="about:blank";if(B.location.href!==D||b.src===D||b.src==="")return setTimeout(w,0),b.addEventListener("load",w);b.addEventListener("load",w)}(e,()=>{const b=e.contentDocument;if(b&&g){const w=kt(b,{doc:b,mirror:n,blockClass:s,blockSelector:i,needsMask:A,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:k,preserveWhiteSpace:E,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:I,stylesheetLoadTimeout:M,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 B,j=!1;try{B=b.sheet}catch{return}if(B)return;const C=setTimeout(()=>{j||(w(),j=!0)},T);b.addEventListener("load",()=>{clearTimeout(C),j=!0,w()})}(e,()=>{if(I){const b=kt(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:A,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:y,inlineImages:h,recordCanvas:k,preserveWhiteSpace:E,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:v,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:x});b&&I(e,b)}},M),S}function sp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ip(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:{}},ne=String,To=function(){return{isColorSupported:!1,reset:ne,bold:ne,dim:ne,italic:ne,underline:ne,inverse:ne,hidden:ne,strikethrough:ne,black:ne,red:ne,green:ne,yellow:ne,blue:ne,magenta:ne,cyan:ne,white:ne,gray:ne,bgBlack:ne,bgRed:ne,bgGreen:ne,bgYellow:ne,bgBlue:ne,bgMagenta:ne,bgCyan:ne,bgWhite:ne}};xs.exports=To(),xs.exports.createColors=To;var op=xs.exports;const De=ip(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Do=op,Po=De,Rs=class Ml 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,Ml)}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:d}=Do.createColors(!0);n=p=>c(d(p)),s=p=>u(p)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,p=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(p)+c+`
4
4
  `+f+n("^")}return" "+s(p)+c}).join(`
5
5
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
6
6
 
@@ -16,51 +16,57 @@
16
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
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
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 _n=Os;Os.default=Os;let{isClean:Ir,my:sp}=nr,ip=_i,op=Al,ap=_n;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[Ir]=!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[Ir]){this[Ir]=!1;let e=this;for(;e=e.parent;)e[Ir]=!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 Nn=Ms;Ms.default=Ms;let lp=Nn,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 Fn=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}=Pe,{existsSync:up,readFileSync:dp}=Pe,{dirname:rs,join:pp}=Pe,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}=Pe,{fileURLToPath:Bo,pathToFileURL:Cr}=Pe,{isAbsolute:Ds,resolve:Ps}=Pe,{nanoid:fp}=cp,ns=Pe,zo=_i,gp=Ml,ss=Symbol("fromOffsetCache"),yp=!!(hp&&mp),jo=!!(Ps&&Ds),qr=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&&(Cr&&(s.input.url=Cr(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)?Cr(o.source):new URL(o.source,this.map.consumer().sourceRoot||Cr(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 Bn=qr;qr.default=qr,ns&&ns.registerInput&&ns.registerInput(qr);let{SourceMapConsumer:Ul,SourceMapGenerator:Xr}=Pe,{dirname:Zr,relative:Tl,resolve:Dl,sep:Pl}=Pe,{pathToFileURL:Wo}=Pe,wp=Bn,vp=!!(Ul&&Xr),bp=!!(Zr&&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=`
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 Ul=Ls;Ls.default=Ls;let ap=Ul;function Os(e,t){new ap(t).stringify(e)}var _n=Os;Os.default=Os;let{isClean:Ir,my:lp}=nr,cp=_i,up=Ul,dp=_n;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[Ir]=!1,this[lp]=!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 cp(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[Ir]){this[Ir]=!1;let e=this;for(;e=e.parent;)e[Ir]=!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 up().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=dp){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 Nn=Ms;Ms.default=Ms;let pp=Nn,Us=class extends pp{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 Fn=Us;Us.default=Us;var hp={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:No,SourceMapGenerator:Fo}=De,{existsSync:mp,readFileSync:fp}=De,{dirname:rs,join:gp}=De,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),mp(e))return this.mapFile=e,fp(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=gp(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 Tl=Ts;Ts.default=Ts;let{SourceMapConsumer:yp,SourceMapGenerator:wp}=De,{fileURLToPath:Bo,pathToFileURL:Cr}=De,{isAbsolute:Ds,resolve:Ps}=De,{nanoid:vp}=hp,ns=De,zo=_i,bp=Tl,ss=Symbol("fromOffsetCache"),Sp=!!(yp&&wp),jo=!!(Ps&&Ds),Jr=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&&Sp){let r=new bp(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 "+vp(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&&(Cr&&(s.input.url=Cr(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)?Cr(o.source):new URL(o.source,this.map.consumer().sourceRoot||Cr(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 Bn=Jr;Jr.default=Jr,ns&&ns.registerInput&&ns.registerInput(Jr);let{SourceMapConsumer:Dl,SourceMapGenerator:Xr}=De,{dirname:Kr,relative:Pl,resolve:_l,sep:Nl}=De,{pathToFileURL:Wo}=De,Ip=Bn,Cp=!!(Dl&&Xr),kp=!!(Kr&&_l&&Pl&&Nl);var Fl=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
22
  `;this.css.includes(`\r
23
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||Zr(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=Xr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Xr({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 Xr({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?Zr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Zr(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=Nn,_s=class extends Sp{constructor(e){super(e),this.type="comment"}};var zn=_s;_s.default=_s;let Nl,Ni,Fi,Fl,{isClean:Bl,my:zl}=nr,jl=Fn,Wl=zn,Ip=Nn;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,sr=class extends Cp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new $l(new Yl,this,e).stringify()}};sr.registerLazyResult=e=>{$l=e},sr.registerProcessor=e=>{Yl=e};var Bi=sr;sr.default=sr;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,kr=92,Ho=47,Er=10,Nt=32,xr=12,Rr=9,Lr=13,Ep=91,xp=93,Rp=40,Lp=41,Op=123,Ap=125,Mp=59,Up=42,Tp=58,Dp=64,Or=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ar=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Pp=/.[\r\n"'(/\\]/,Go=/[\da-f]/i;let ql=ft,Kr=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=Kr;Kr.default=Kr,ql.registerAtRule(Kr);let Xl,Zl,Kl=ft,Lt=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()}};Lt.registerLazyResult=e=>{Xl=e},Lt.registerProcessor=e=>{Zl=e};var fr=Lt;Lt.default=Lt,Kl.registerRoot(Lt);let ir={comma:e=>ir.split(e,[","],!0),space:e=>ir.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=ir;ir.default=ir;let ec=ft,_p=Ql,Qr=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=Qr;Qr.default=Qr,ec.registerRule(Qr);let Np=Fn,Fp=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,p=e.css.valueOf(),f=t.ignoreErrors,y=p.length,h=0,C=[],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 I=!!v&&v.ignoreUnclosed;switch(r=p.charCodeAt(h),r){case Er:case Nt:case Rr:case Lr:case xr:n=h;do n+=1,r=p.charCodeAt(n);while(r===Nt||r===Er||r===Rr||r===Lr||r===xr);d=["space",p.slice(h,n)],h=n-1;break;case Ep:case xp:case Op:case Ap:case Tp:case Mp:case Lp:{let M=String.fromCharCode(r);d=[M,M,h];break}case Rp:if(c=C.length?C.pop()[1]:"",u=p.charCodeAt(h+1),c==="url"&&u!==is&&u!==Vo&&u!==Nt&&u!==Er&&u!==Rr&&u!==xr&&u!==Lr){n=h;do{if(o=!1,n=p.indexOf(")",n+1),n===-1){if(f||I){n=h;break}g("bracket")}for(l=n;p.charCodeAt(l-1)===kr;)l-=1,o=!o}while(o);d=["brackets",p.slice(h,n+1),h,n],h=n}else n=p.indexOf(")",h+1),i=p.slice(h,n+1),n===-1||Pp.test(i)?d=["(","(",h]:(d=["brackets",i,h,n],h=n);break;case is:case Vo:s=r===is?"'":'"',n=h;do{if(o=!1,n=p.indexOf(s,n+1),n===-1){if(f||I){n=h+1;break}g("string")}for(l=n;p.charCodeAt(l-1)===kr;)l-=1,o=!o}while(o);d=["string",p.slice(h,n+1),h,n],h=n;break;case Dp:Or.lastIndex=h+1,Or.test(p),n=Or.lastIndex===0?p.length-1:Or.lastIndex-2,d=["at-word",p.slice(h,n+1),h,n],h=n;break;case kr:for(n=h,a=!0;p.charCodeAt(n+1)===kr;)n+=1,a=!a;if(r=p.charCodeAt(n+1),a&&r!==Ho&&r!==Nt&&r!==Er&&r!==Rr&&r!==Lr&&r!==xr&&(n+=1,Go.test(p.charAt(n)))){for(;Go.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===Nt&&(n+=1)}d=["word",p.slice(h,n+1),h,n],h=n;break;default:r===Ho&&p.charCodeAt(h+1)===Up?(n=p.indexOf("*/",h+2)+1,n===0&&(f||I?n=p.length:g("comment")),d=["comment",p.slice(h,n+1),h,n],h=n):(Ar.lastIndex=h+1,Ar.test(p),n=Ar.lastIndex===0?p.length-1:Ar.lastIndex-2,d=["word",p.slice(h,n+1),h,n],C.push(d),h=n)}return h++,d},position:function(){return h}}},Bp=zn,zp=ji,jp=fr,$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 d=l[u][0];if(c.trim().indexOf("!")===0&&d!=="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 d=0;d<l;d+=1)s=r[d],i=s[0],i!=="space"||d!==l-1||n?i==="comment"?(o=r[d-1]?r[d-1][0]:"empty",a=r[d+1]?r[d+1][0]:"empty",Yo[o]||Yo[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((p,f)=>p+f[1],"");e.raws[t]={raw:d,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=Bn;function en(e,t){let r=new Gp(e,t),n=new Hp(r);try{n.parse()}catch(s){throw s}return n.root}var Vi=en;en.default=en,Vp.registerParse(en);let{isClean:Fe,my:$p}=nr,Yp=_l,Jp=_n,qp=ft,Xp=Bi,Jo=zi,Zp=Vi,Kp=fr;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 Ft(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={},Et=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(Ft(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(Ft(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 Ft(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(Ft(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(Ft(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"}};Et.registerPostcss=e=>{zs=e};var nc=Et;Et.default=Et,Kp.registerLazyResult(Et),Xp.registerLazyResult(Et);let rh=_l,nh=_n,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=fr,Wt=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=Wt;Wt.default=Wt,uh.registerProcessor(Wt),ch.registerProcessor(Wt);let ph=Fn,hh=Ml,mh=zn,fh=ji,gh=Bn,yh=fr,wh=Wi;function or(e,t){if(Array.isArray(e))return e.map(s=>or(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=>or(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=or;or.default=or;let bh=_i,Xo=Fn,Sh=nc,Ih=ft,Ws=dh,Ch=_n,kh=vh,Zo=Bi,Eh=Jl,Ko=zn,Qo=ji,xh=zi,Rh=Bn,Lh=Vi,Oh=Ql,ea=Wi,ta=fr,Ah=Nn;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:
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 Dl(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(),kp&&Cp&&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=Xr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Xr({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 Xr({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(_l(r,this.mapOpts.annotation)));let n=Pl(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 Ip(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;Nl==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Ep=Nn,_s=class extends Ep{constructor(e){super(e),this.type="comment"}};var zn=_s;_s.default=_s;let Bl,Ni,Fi,zl,{isClean:jl,my:Wl}=nr,Vl=Fn,Hl=zn,xp=Nn;function Gl(e){return e.map(t=>(t.nodes&&(t.nodes=Gl(t.nodes)),delete t.source,t))}function Yl(e){if(e[jl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Yl(t)}let Xe=class $l extends xp{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=Gl(Bl(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 Vl(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 Hl(t)]}return t.map(n=>(n[Wl]||$l.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[jl]&&Yl(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]}};Xe.registerParse=e=>{Bl=e},Xe.registerRule=e=>{Ni=e},Xe.registerAtRule=e=>{Fi=e},Xe.registerRoot=e=>{zl=e};var ft=Xe;Xe.default=Xe,Xe.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Fi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ni.prototype):e.type==="decl"?Object.setPrototypeOf(e,Vl.prototype):e.type==="comment"?Object.setPrototypeOf(e,Hl.prototype):e.type==="root"&&Object.setPrototypeOf(e,zl.prototype),e[Wl]=!0,e.nodes&&e.nodes.forEach(t=>{Xe.rebuild(t)})};let ql,Jl,Rp=ft,sr=class extends Rp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ql(new Jl,this,e).stringify()}};sr.registerLazyResult=e=>{ql=e},sr.registerProcessor=e=>{Jl=e};var Bi=sr;sr.default=sr;let Vo={};var Xl=function(e){Vo[e]||(Vo[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};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 Kl=Ns;Ns.default=Ns;let Lp=Kl,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 Lp(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,Ho=34,kr=92,Go=47,Er=10,Nt=32,xr=12,Rr=9,Lr=13,Op=91,Ap=93,Mp=40,Up=41,Tp=123,Dp=125,Pp=59,_p=42,Np=58,Fp=64,Or=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ar=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Bp=/.[\r\n"'(/\\]/,Yo=/[\da-f]/i;let Zl=ft,Zr=class extends Zl{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=Zr;Zr.default=Zr,Zl.registerAtRule(Zr);let Ql,ec,tc=ft,Lt=class extends tc{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 Ql(new ec,this,e).stringify()}};Lt.registerLazyResult=e=>{Ql=e},Lt.registerProcessor=e=>{ec=e};var fr=Lt;Lt.default=Lt,tc.registerRoot(Lt);let ir={comma:e=>ir.split(e,[","],!0),space:e=>ir.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 rc=ir;ir.default=ir;let nc=ft,zp=rc,Qr=class extends nc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return zp.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=Qr;Qr.default=Qr,nc.registerRule(Qr);let jp=Fn,Wp=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,p=e.css.valueOf(),f=t.ignoreErrors,y=p.length,h=0,k=[],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 I=!!v&&v.ignoreUnclosed;switch(r=p.charCodeAt(h),r){case Er:case Nt:case Rr:case Lr:case xr:n=h;do n+=1,r=p.charCodeAt(n);while(r===Nt||r===Er||r===Rr||r===Lr||r===xr);d=["space",p.slice(h,n)],h=n-1;break;case Op:case Ap:case Tp:case Dp:case Np:case Pp:case Up:{let M=String.fromCharCode(r);d=[M,M,h];break}case Mp:if(c=k.length?k.pop()[1]:"",u=p.charCodeAt(h+1),c==="url"&&u!==is&&u!==Ho&&u!==Nt&&u!==Er&&u!==Rr&&u!==xr&&u!==Lr){n=h;do{if(o=!1,n=p.indexOf(")",n+1),n===-1){if(f||I){n=h;break}g("bracket")}for(l=n;p.charCodeAt(l-1)===kr;)l-=1,o=!o}while(o);d=["brackets",p.slice(h,n+1),h,n],h=n}else n=p.indexOf(")",h+1),i=p.slice(h,n+1),n===-1||Bp.test(i)?d=["(","(",h]:(d=["brackets",i,h,n],h=n);break;case is:case Ho:s=r===is?"'":'"',n=h;do{if(o=!1,n=p.indexOf(s,n+1),n===-1){if(f||I){n=h+1;break}g("string")}for(l=n;p.charCodeAt(l-1)===kr;)l-=1,o=!o}while(o);d=["string",p.slice(h,n+1),h,n],h=n;break;case Fp:Or.lastIndex=h+1,Or.test(p),n=Or.lastIndex===0?p.length-1:Or.lastIndex-2,d=["at-word",p.slice(h,n+1),h,n],h=n;break;case kr:for(n=h,a=!0;p.charCodeAt(n+1)===kr;)n+=1,a=!a;if(r=p.charCodeAt(n+1),a&&r!==Go&&r!==Nt&&r!==Er&&r!==Rr&&r!==Lr&&r!==xr&&(n+=1,Yo.test(p.charAt(n)))){for(;Yo.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===Nt&&(n+=1)}d=["word",p.slice(h,n+1),h,n],h=n;break;default:r===Go&&p.charCodeAt(h+1)===_p?(n=p.indexOf("*/",h+2)+1,n===0&&(f||I?n=p.length:g("comment")),d=["comment",p.slice(h,n+1),h,n],h=n):(Ar.lastIndex=h+1,Ar.test(p),n=Ar.lastIndex===0?p.length-1:Ar.lastIndex-2,d=["word",p.slice(h,n+1),h,n],k.push(d),h=n)}return h++,d},position:function(){return h}}},Vp=zn,Hp=ji,Gp=fr,$o=Wi;const qo={empty:!0,space:!0};var Yp=class{constructor(e){this.input=e,this.root=new Gp,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 Hp;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 Vp;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=Wp(this.input)}decl(e,t){let r=new jp;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 d=l[u][0];if(c.trim().indexOf("!")===0&&d!=="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 d=0;d<l;d+=1)s=r[d],i=s[0],i!=="space"||d!==l-1||n?i==="comment"?(o=r[d-1]?r[d-1][0]:"empty",a=r[d+1]?r[d+1][0]:"empty",qo[o]||qo[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((p,f)=>p+f[1],"");e.raws[t]={raw:d,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 $p=ft,qp=Yp,Jp=Bn;function en(e,t){let r=new Jp(e,t),n=new qp(r);try{n.parse()}catch(s){throw s.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?s.message+=`
27
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?s.message+=`
28
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(s.message+=`
29
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),s}return n.root}var Vi=en;en.default=en,$p.registerParse(en);let{isClean:Ne,my:Xp}=nr,Kp=Fl,Zp=_n,Qp=ft,eh=Bi,th=Xl,Jo=zi,rh=Vi,nh=fr;const sh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ih={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},oh={Once:!0,postcssPlugin:!0,prepare:!0};function Ft(e){return typeof e=="object"&&typeof e.then=="function"}function sc(e){let t=!1,r=sh[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 Xo(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:sc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Bs(e){return e[Ne]=!1,e.nodes&&e.nodes.forEach(t=>Bs(t)),e}let zs={},Et=class ic{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 ic||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=rh;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[Xp]&&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{if(r&&r.addToError(t),this.error=t,t.name!=="CssSyntaxError"||t.plugin){if(n.postcssVersion){let s=n.postcssPlugin,i=n.postcssVersion,a=this.result.processor.version,o=i.split("."),l=a.split(".");(o[0]!==l[0]||parseInt(o[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+s+" uses "+i+". Perhaps this is the source of the error below.")}}else 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(!ih[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!oh[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(Ft(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ne];){t[Ne]=!0;let r=[Xo(t)];for(;r.length>0;){let n=this.visitTick(r);if(Ft(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 Ft(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=Zp;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new Kp(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(Ft(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ne];)t[Ne]=!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"from"in this.opts||th("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),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(Ft(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[Ne])return a[Ne]=!0,void t.push(Xo(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[Ne]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Ne]=!0;let r=sc(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Ne]||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"}};Et.registerPostcss=e=>{zs=e};var oc=Et;Et.default=Et,nh.registerLazyResult(Et),eh.registerLazyResult(Et);let ah=Fl,lh=_n,ch=Xl,uh=Vi;const dh=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=lh;this.result=new dh(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new ah(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"from"in this._opts||ch("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),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=uh;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 ph=js;js.default=js;let hh=ph,mh=oc,fh=Bi,gh=fr,Wt=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")throw typeof r=="object"&&(r.parse||r.stringify)?new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation."):new Error(r+" is not a PostCSS plugin");t.push(r)}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new mh(this,e,t):new hh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var yh=Wt;Wt.default=Wt,gh.registerProcessor(Wt),fh.registerProcessor(Wt);let wh=Fn,vh=Tl,bh=zn,Sh=ji,Ih=Bn,Ch=fr,kh=Wi;function or(e,t){if(Array.isArray(e))return e.map(s=>or(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:Ih.prototype};i.map&&(i.map={...i.map,__proto__:vh.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>or(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 Ch(n);if(n.type==="decl")return new wh(n);if(n.type==="rule")return new kh(n);if(n.type==="comment")return new bh(n);if(n.type==="atrule")return new Sh(n);throw new Error("Unknown node type: "+e.type)}var Eh=or;or.default=or;let xh=_i,Ko=Fn,Rh=oc,Lh=ft,Ws=yh,Oh=_n,Ah=Eh,Zo=Bi,Mh=Kl,Qo=zn,ea=ji,Uh=zi,Th=Bn,Dh=Vi,Ph=rc,ta=Wi,ra=fr,_h=Nn;function J(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Ws(e)}J.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
30
  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 oe=ep(Mh);oe.stringify,oe.fromJSON,oe.plugin,oe.parse,oe.list,oe.document,oe.comment,oe.atRule,oe.rule,oe.decl,oe.root,oe.CssSyntaxError,oe.Declaration,oe.Container,oe.Processor,oe.Document,oe.Comment,oe.Warning,oe.AtRule,oe.Result,oe.Input,oe.Rule,oe.Root,oe.Node;var Uh=Object.defineProperty,Re=(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:{}},se=String,ra=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}};Vs.exports=ra(),Vs.exports.createColors=ra;var Ph=Vs.exports;const _e=Dh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let na=Ph,sa=_e,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:d}=na.createColors(!0);n=p=>c(d(p)),s=p=>u(p)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,p=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(p)+c+`
31
+ 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 J([s(o)]).process(i,a)},s},J.stringify=Oh,J.parse=Dh,J.fromJSON=Ah,J.list=Ph,J.comment=e=>new Qo(e),J.atRule=e=>new ea(e),J.decl=e=>new Ko(e),J.rule=e=>new ta(e),J.root=e=>new ra(e),J.document=e=>new Zo(e),J.CssSyntaxError=xh,J.Declaration=Ko,J.Container=Lh,J.Processor=Ws,J.Document=Zo,J.Comment=Qo,J.Warning=Mh,J.AtRule=ea,J.Result=Uh,J.Input=Th,J.Rule=ta,J.Root=ra,J.Node=_h,Rh.registerPostcss(J);var Nh=J;J.default=J;const oe=sp(Nh);oe.stringify,oe.fromJSON,oe.plugin,oe.parse,oe.list,oe.document,oe.comment,oe.atRule,oe.rule,oe.decl,oe.root,oe.CssSyntaxError,oe.Declaration,oe.Container,oe.Processor,oe.Document,oe.Comment,oe.Warning,oe.AtRule,oe.Result,oe.Input,oe.Rule,oe.Root,oe.Node;var Fh=Object.defineProperty,Re=(e,t,r)=>((n,s,i)=>s in n?Fh(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r);function Bh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zh(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:{}},se=String,na=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}};Vs.exports=na(),Vs.exports.createColors=na;var jh=Vs.exports;const Pe=zh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let sa=jh,ia=Pe,Hs=class ac 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,ac)}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=sa.isColorSupported),ia&&t&&(r=ia(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:d}=sa.createColors(!0);n=p=>c(d(p)),s=p=>u(p)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,p=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(p)+c+`
29
32
  `+f+n("^")}return" "+s(p)+c}).join(`
30
33
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
31
34
 
32
35
  `+t+`
33
- `),this.name+": "+this.message+t}};var Hi=Hs;Hs.default=Hs;var ar={};ar.isClean=Symbol("isClean"),ar.my=Symbol("my");const ia={after:`
36
+ `),this.name+": "+this.message+t}};var Hi=Hs;Hs.default=Hs;var ar={};ar.isClean=Symbol("isClean"),ar.my=Symbol("my");const oa={after:`
34
37
  `,beforeClose:`
35
38
  `,beforeComment:`
36
39
  `,beforeDecl:`
37
40
  `,beforeOpen:" ",beforeRule:`
38
41
  `,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(`
42
+ `)){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 oa[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=oa[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
43
  `)&&(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
44
  `)&&(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
45
  `)&&(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
46
  `)&&(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 jn=$s;$s.default=$s;let{isClean:Mr,my:Nh}=ar,Fh=Hi,Bh=ic,zh=jn;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[Mr]=!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[Mr]){this[Mr]=!1;let e=this;for(;e=e.parent;)e[Mr]=!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 Wn=Js;Js.default=Js;let jh=Wn,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 Vn=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}=_e,{existsSync:Vh,readFileSync:Hh}=_e,{dirname:os,join:Gh}=_e,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}=_e,{fileURLToPath:la,pathToFileURL:Ur}=_e,{isAbsolute:Zs,resolve:Ks}=_e,{nanoid:Jh}=Wh,as=_e,ca=Hi,qh=oc,ls=Symbol("fromOffsetCache"),Xh=!!($h&&Yh),ua=!!(Ks&&Zs),tn=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&&(Ur&&(s.input.url=Ur(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)?Ur(o.source):new URL(o.source,this.map.consumer().sourceRoot||Ur(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 Hn=tn;tn.default=tn,as&&as.registerInput&&as.registerInput(tn);let{SourceMapConsumer:ac,SourceMapGenerator:rn}=_e,{dirname:nn,relative:lc,resolve:cc,sep:uc}=_e,{pathToFileURL:da}=_e,Zh=Hn,Kh=!!(ac&&rn),Qh=!!(nn&&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
+ `);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 lc=Gs;Gs.default=Gs;let Wh=lc;function Ys(e,t){new Wh(t).stringify(e)}var jn=Ys;Ys.default=Ys;let{isClean:Mr,my:Vh}=ar,Hh=Hi,Gh=lc,Yh=jn;function $s(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=>$s(a,r)):(i==="object"&&s!==null&&(s=$s(s)),r[n]=s)}return r}let qs=class{constructor(e={}){this.raws={},this[Mr]=!1,this[Vh]=!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=$s(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 Hh(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[Mr]){this[Mr]=!1;let e=this;for(;e=e.parent;)e[Mr]=!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]===`
48
+ `?(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 Gh().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=Yh){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 Wn=qs;qs.default=qs;let $h=Wn,Js=class extends $h{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 Vn=Js;Js.default=Js;var qh={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:aa,SourceMapGenerator:la}=Pe,{existsSync:Jh,readFileSync:Xh}=Pe,{dirname:os,join:Kh}=Pe,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 aa(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),Jh(e))return this.mapFile=e,Xh(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 aa)return la.fromSourceMap(t).toString();if(t instanceof la)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=Kh(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 cc=Xs;Xs.default=Xs;let{SourceMapConsumer:Zh,SourceMapGenerator:Qh}=Pe,{fileURLToPath:ca,pathToFileURL:Ur}=Pe,{isAbsolute:Ks,resolve:Zs}=Pe,{nanoid:em}=qh,as=Pe,ua=Hi,tm=cc,ls=Symbol("fromOffsetCache"),rm=!!(Zh&&Qh),da=!!(Zs&&Ks),tn=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&&(!da||/^\w+:\/\//.test(t.from)||Ks(t.from)?this.file=t.from:this.file=Zs(t.from)),da&&rm){let r=new tm(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 "+em(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 ua(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 ua(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&&(Ur&&(s.input.url=Ur(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(`
49
+ `);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:Zs(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=Ks(o.source)?Ur(o.source):new URL(o.source,this.map.consumer().sourceRoot||Ur(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(!ca)throw new Error("file: protocol is not available in this PostCSS build");l.file=ca(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 Hn=tn;tn.default=tn,as&&as.registerInput&&as.registerInput(tn);let{SourceMapConsumer:uc,SourceMapGenerator:rn}=Pe,{dirname:nn,relative:dc,resolve:pc,sep:hc}=Pe,{pathToFileURL:pa}=Pe,nm=Hn,sm=!!(uc&&rn),im=!!(nn&&pc&&dc&&hc);var mc=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
50
  `;this.css.includes(`\r
48
51
  `)&&(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||nn(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=rn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new rn({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 rn({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?nn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=nn(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=Wn,Qs=class extends em{constructor(e){super(e),this.type="comment"}};var Gn=Qs;Qs.default=Qs;let pc,Gi,$i,hc,{isClean:mc,my:fc}=ar,gc=Vn,yc=Gn,tm=Wn;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,lr=class extends rm{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Sc(new Ic,this,e).stringify()}};lr.registerLazyResult=e=>{Sc=e},lr.registerProcessor=e=>{Ic=e};var Yi=lr;lr.default=lr;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,Tr=92,ha=47,Dr=10,Bt=32,Pr=12,_r=9,Nr=13,sm=91,im=93,om=40,am=41,lm=123,cm=125,um=59,dm=42,pm=58,hm=64,Fr=/[\t\n\f\r "#'()/;[\\\]{}]/g,Br=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,mm=/.[\r\n"'(/\\]/,ma=/[\da-f]/i;let kc=gt,sn=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=sn;sn.default=sn,kc.registerAtRule(sn);let Ec,xc,Rc=gt,Ot=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()}};Ot.registerLazyResult=e=>{Ec=e},Ot.registerProcessor=e=>{xc=e};var gr=Ot;Ot.default=Ot,Rc.registerRoot(Ot);let cr={comma:e=>cr.split(e,[","],!0),space:e=>cr.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=cr;cr.default=cr;let Oc=gt,fm=Lc,on=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=on;on.default=on,Oc.registerRule(on);let gm=Vn,ym=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,p=e.css.valueOf(),f=t.ignoreErrors,y=p.length,h=0,C=[],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 I=!!v&&v.ignoreUnclosed;switch(r=p.charCodeAt(h),r){case Dr:case Bt:case _r:case Nr:case Pr:n=h;do n+=1,r=p.charCodeAt(n);while(r===Bt||r===Dr||r===_r||r===Nr||r===Pr);d=["space",p.slice(h,n)],h=n-1;break;case sm:case im:case lm:case cm:case pm:case um:case am:{let M=String.fromCharCode(r);d=[M,M,h];break}case om:if(c=C.length?C.pop()[1]:"",u=p.charCodeAt(h+1),c==="url"&&u!==cs&&u!==pa&&u!==Bt&&u!==Dr&&u!==_r&&u!==Pr&&u!==Nr){n=h;do{if(o=!1,n=p.indexOf(")",n+1),n===-1){if(f||I){n=h;break}g("bracket")}for(l=n;p.charCodeAt(l-1)===Tr;)l-=1,o=!o}while(o);d=["brackets",p.slice(h,n+1),h,n],h=n}else n=p.indexOf(")",h+1),i=p.slice(h,n+1),n===-1||mm.test(i)?d=["(","(",h]:(d=["brackets",i,h,n],h=n);break;case cs:case pa:s=r===cs?"'":'"',n=h;do{if(o=!1,n=p.indexOf(s,n+1),n===-1){if(f||I){n=h+1;break}g("string")}for(l=n;p.charCodeAt(l-1)===Tr;)l-=1,o=!o}while(o);d=["string",p.slice(h,n+1),h,n],h=n;break;case hm:Fr.lastIndex=h+1,Fr.test(p),n=Fr.lastIndex===0?p.length-1:Fr.lastIndex-2,d=["at-word",p.slice(h,n+1),h,n],h=n;break;case Tr:for(n=h,a=!0;p.charCodeAt(n+1)===Tr;)n+=1,a=!a;if(r=p.charCodeAt(n+1),a&&r!==ha&&r!==Bt&&r!==Dr&&r!==_r&&r!==Nr&&r!==Pr&&(n+=1,ma.test(p.charAt(n)))){for(;ma.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===Bt&&(n+=1)}d=["word",p.slice(h,n+1),h,n],h=n;break;default:r===ha&&p.charCodeAt(h+1)===dm?(n=p.indexOf("*/",h+2)+1,n===0&&(f||I?n=p.length:g("comment")),d=["comment",p.slice(h,n+1),h,n],h=n):(Br.lastIndex=h+1,Br.test(p),n=Br.lastIndex===0?p.length-1:Br.lastIndex-2,d=["word",p.slice(h,n+1),h,n],C.push(d),h=n)}return h++,d},position:function(){return h}}},wm=Gn,vm=qi,bm=gr,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 d=l[u][0];if(c.trim().indexOf("!")===0&&d!=="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 d=0;d<l;d+=1)s=r[d],i=s[0],i!=="space"||d!==l-1||n?i==="comment"?(o=r[d-1]?r[d-1][0]:"empty",a=r[d+1]?r[d+1][0]:"empty",ga[o]||ga[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((p,f)=>p+f[1],"");e.raws[t]={raw:d,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=Hn;function an(e,t){let r=new km(e,t),n=new Cm(r);try{n.parse()}catch(s){throw s}return n.root}var Zi=an;an.default=an,Im.registerParse(an);let{isClean:Be,my:Em}=ar,xm=dc,Rm=jn,Lm=gt,Om=Yi,ya=Ji,Am=Zi,Mm=gr;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 zt(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={},xt=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(zt(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(zt(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 zt(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(zt(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(zt(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"}};xt.registerPostcss=e=>{ni=e};var Uc=xt;xt.default=xt,Mm.registerLazyResult(xt),Om.registerLazyResult(xt);let Pm=dc,_m=jn,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=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 jm(this,e,t):new zm(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Hm=Vt;Vt.default=Vt,Vm.registerProcessor(Vt),Wm.registerProcessor(Vt);let Gm=Vn,$m=oc,Ym=Gn,Jm=qi,qm=Hn,Xm=gr,Zm=Xi;function ur(e,t){if(Array.isArray(e))return e.map(s=>ur(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=>ur(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=ur;ur.default=ur;let Qm=Hi,va=Vn,ef=Uc,tf=gt,ii=Hm,rf=jn,nf=Km,ba=Yi,sf=Cc,Sa=Gn,Ia=qi,of=Ji,af=Hn,lf=Zi,cf=Lc,Ca=Xi,ka=gr,uf=Wn;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
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||nn(e.file);this.mapOpts.sourcesContent===!1?(t=new uc(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(),im&&sm&&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=rn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new rn({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 rn({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(`
53
+ `),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?nn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=nn(pc(r,this.mapOpts.annotation)));let n=dc(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 nm(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(pa){let r=pa(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;hc==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let om=Wn,Qs=class extends om{constructor(e){super(e),this.type="comment"}};var Gn=Qs;Qs.default=Qs;let fc,Gi,Yi,gc,{isClean:yc,my:wc}=ar,vc=Vn,bc=Gn,am=Wn;function Sc(e){return e.map(t=>(t.nodes&&(t.nodes=Sc(t.nodes)),delete t.source,t))}function Ic(e){if(e[yc]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ic(t)}let Ke=class Cc extends am{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=Sc(fc(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 vc(t)]}else if(t.selector)t=[new Gi(t)];else if(t.name)t=[new Yi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new bc(t)]}return t.map(n=>(n[wc]||Cc.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[yc]&&Ic(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=>{fc=e},Ke.registerRule=e=>{Gi=e},Ke.registerAtRule=e=>{Yi=e},Ke.registerRoot=e=>{gc=e};var gt=Ke;Ke.default=Ke,Ke.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Yi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Gi.prototype):e.type==="decl"?Object.setPrototypeOf(e,vc.prototype):e.type==="comment"?Object.setPrototypeOf(e,bc.prototype):e.type==="root"&&Object.setPrototypeOf(e,gc.prototype),e[wc]=!0,e.nodes&&e.nodes.forEach(t=>{Ke.rebuild(t)})};let kc,Ec,lm=gt,lr=class extends lm{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new kc(new Ec,this,e).stringify()}};lr.registerLazyResult=e=>{kc=e},lr.registerProcessor=e=>{Ec=e};var $i=lr;lr.default=lr;let ha={};var xc=function(e){ha[e]||(ha[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};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 Rc=ei;ei.default=ei;let cm=Rc,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 cm(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var qi=ti;ti.default=ti;const cs=39,ma=34,Tr=92,fa=47,Dr=10,Bt=32,Pr=12,_r=9,Nr=13,um=91,dm=93,pm=40,hm=41,mm=123,fm=125,gm=59,ym=42,wm=58,vm=64,Fr=/[\t\n\f\r "#'()/;[\\\]{}]/g,Br=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bm=/.[\r\n"'(/\\]/,ga=/[\da-f]/i;let Lc=gt,sn=class extends Lc{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=sn;sn.default=sn,Lc.registerAtRule(sn);let Oc,Ac,Mc=gt,Ot=class extends Mc{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 Oc(new Ac,this,e).stringify()}};Ot.registerLazyResult=e=>{Oc=e},Ot.registerProcessor=e=>{Ac=e};var gr=Ot;Ot.default=Ot,Mc.registerRoot(Ot);let cr={comma:e=>cr.split(e,[","],!0),space:e=>cr.split(e,[" ",`
54
+ `," "]),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 Uc=cr;cr.default=cr;let Tc=gt,Sm=Uc,on=class extends Tc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Sm.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=on;on.default=on,Tc.registerRule(on);let Im=Vn,Cm=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,p=e.css.valueOf(),f=t.ignoreErrors,y=p.length,h=0,k=[],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 I=!!v&&v.ignoreUnclosed;switch(r=p.charCodeAt(h),r){case Dr:case Bt:case _r:case Nr:case Pr:n=h;do n+=1,r=p.charCodeAt(n);while(r===Bt||r===Dr||r===_r||r===Nr||r===Pr);d=["space",p.slice(h,n)],h=n-1;break;case um:case dm:case mm:case fm:case wm:case gm:case hm:{let M=String.fromCharCode(r);d=[M,M,h];break}case pm:if(c=k.length?k.pop()[1]:"",u=p.charCodeAt(h+1),c==="url"&&u!==cs&&u!==ma&&u!==Bt&&u!==Dr&&u!==_r&&u!==Pr&&u!==Nr){n=h;do{if(o=!1,n=p.indexOf(")",n+1),n===-1){if(f||I){n=h;break}g("bracket")}for(l=n;p.charCodeAt(l-1)===Tr;)l-=1,o=!o}while(o);d=["brackets",p.slice(h,n+1),h,n],h=n}else n=p.indexOf(")",h+1),i=p.slice(h,n+1),n===-1||bm.test(i)?d=["(","(",h]:(d=["brackets",i,h,n],h=n);break;case cs:case ma:s=r===cs?"'":'"',n=h;do{if(o=!1,n=p.indexOf(s,n+1),n===-1){if(f||I){n=h+1;break}g("string")}for(l=n;p.charCodeAt(l-1)===Tr;)l-=1,o=!o}while(o);d=["string",p.slice(h,n+1),h,n],h=n;break;case vm:Fr.lastIndex=h+1,Fr.test(p),n=Fr.lastIndex===0?p.length-1:Fr.lastIndex-2,d=["at-word",p.slice(h,n+1),h,n],h=n;break;case Tr:for(n=h,a=!0;p.charCodeAt(n+1)===Tr;)n+=1,a=!a;if(r=p.charCodeAt(n+1),a&&r!==fa&&r!==Bt&&r!==Dr&&r!==_r&&r!==Nr&&r!==Pr&&(n+=1,ga.test(p.charAt(n)))){for(;ga.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===Bt&&(n+=1)}d=["word",p.slice(h,n+1),h,n],h=n;break;default:r===fa&&p.charCodeAt(h+1)===ym?(n=p.indexOf("*/",h+2)+1,n===0&&(f||I?n=p.length:g("comment")),d=["comment",p.slice(h,n+1),h,n],h=n):(Br.lastIndex=h+1,Br.test(p),n=Br.lastIndex===0?p.length-1:Br.lastIndex-2,d=["word",p.slice(h,n+1),h,n],k.push(d),h=n)}return h++,d},position:function(){return h}}},km=Gn,Em=Ji,xm=gr,ya=Xi;const wa={empty:!0,space:!0};var Rm=class{constructor(e){this.input=e,this.root=new xm,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 Em;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 km;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=Cm(this.input)}decl(e,t){let r=new Im;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 d=l[u][0];if(c.trim().indexOf("!")===0&&d!=="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 ya;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 d=0;d<l;d+=1)s=r[d],i=s[0],i!=="space"||d!==l-1||n?i==="comment"?(o=r[d-1]?r[d-1][0]:"empty",a=r[d+1]?r[d+1][0]:"empty",wa[o]||wa[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((p,f)=>p+f[1],"");e.raws[t]={raw:d,value:c}}e[t]=c}rule(e){e.pop();let t=new ya;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 Lm=gt,Om=Rm,Am=Hn;function an(e,t){let r=new Am(e,t),n=new Om(r);try{n.parse()}catch(s){throw s.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?s.message+=`
55
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?s.message+=`
56
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(s.message+=`
57
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),s}return n.root}var Ki=an;an.default=an,Lm.registerParse(an);let{isClean:Fe,my:Mm}=ar,Um=mc,Tm=jn,Dm=gt,Pm=$i,_m=xc,va=qi,Nm=Ki,Fm=gr;const Bm={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},zm={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},jm={Once:!0,postcssPlugin:!0,prepare:!0};function zt(e){return typeof e=="object"&&typeof e.then=="function"}function Dc(e){let t=!1,r=Bm[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 ba(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:Dc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ri(e){return e[Fe]=!1,e.nodes&&e.nodes.forEach(t=>ri(t)),e}let ni={},xt=class Pc{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 Pc||r instanceof va)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=Nm;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[Mm]&&Dm.rebuild(s)}else s=ri(r);this.result=new va(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{if(r&&r.addToError(t),this.error=t,t.name!=="CssSyntaxError"||t.plugin){if(n.postcssVersion){let s=n.postcssPlugin,i=n.postcssVersion,a=this.result.processor.version,o=i.split("."),l=a.split(".");(o[0]!==l[0]||parseInt(o[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+s+" uses "+i+". Perhaps this is the source of the error below.")}}else 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(!zm[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!jm[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(zt(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=[ba(t)];for(;r.length>0;){let n=this.visitTick(r);if(zt(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 zt(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=Tm;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new Um(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(zt(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"from"in this.opts||_m("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),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(zt(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(ba(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=Dc(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=>{ni=e};var _c=xt;xt.default=xt,Fm.registerLazyResult(xt),Pm.registerLazyResult(xt);let Wm=mc,Vm=jn,Hm=xc,Gm=Ki;const Ym=qi;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=Vm;this.result=new Ym(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new Wm(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"from"in this._opts||Hm("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),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=Gm;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 $m=si;si.default=si;let qm=$m,Jm=_c,Xm=$i,Km=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")throw typeof r=="object"&&(r.parse||r.stringify)?new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation."):new Error(r+" is not a PostCSS plugin");t.push(r)}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Jm(this,e,t):new qm(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Zm=Vt;Vt.default=Vt,Km.registerProcessor(Vt),Xm.registerProcessor(Vt);let Qm=Vn,ef=cc,tf=Gn,rf=Ji,nf=Hn,sf=gr,of=Xi;function ur(e,t){if(Array.isArray(e))return e.map(s=>ur(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:nf.prototype};i.map&&(i.map={...i.map,__proto__:ef.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>ur(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 sf(n);if(n.type==="decl")return new Qm(n);if(n.type==="rule")return new of(n);if(n.type==="comment")return new tf(n);if(n.type==="atrule")return new rf(n);throw new Error("Unknown node type: "+e.type)}var af=ur;ur.default=ur;let lf=Hi,Sa=Vn,cf=_c,uf=gt,ii=Zm,df=jn,pf=af,Ia=$i,hf=Rc,Ca=Gn,ka=Ji,mf=qi,ff=Hn,gf=Ki,yf=Uc,Ea=Xi,xa=gr,wf=Wn;function X(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new ii(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:
52
58
  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 ae=Th(df);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;class Ki{constructor(...t){Re(this,"parentElement",null),Re(this,"parentNode",null),Re(this,"ownerDocument"),Re(this,"firstChild",null),Re(this,"lastChild",null),Re(this,"previousSibling",null),Re(this,"nextSibling",null),Re(this,"ELEMENT_NODE",1),Re(this,"TEXT_NODE",3),Re(this,"nodeType"),Re(this,"nodeName"),Re(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"]},zr={};function Qi(e){if(zr[e])return zr[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 zr[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?zr[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 we(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const St=`Please stop import mirror directly. Instead of that,\r
59
+ 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 X([s(o)]).process(i,a)},s},X.stringify=df,X.parse=gf,X.fromJSON=pf,X.list=yf,X.comment=e=>new Ca(e),X.atRule=e=>new ka(e),X.decl=e=>new Sa(e),X.rule=e=>new Ea(e),X.root=e=>new xa(e),X.document=e=>new Ia(e),X.CssSyntaxError=lf,X.Declaration=Sa,X.Container=uf,X.Processor=ii,X.Document=Ia,X.Comment=Ca,X.Warning=hf,X.AtRule=ka,X.Result=mf,X.Input=ff,X.Rule=Ea,X.Root=xa,X.Node=wf,cf.registerPostcss(X);var vf=X;X.default=X;const ae=Bh(vf);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;class Zi{constructor(...t){Re(this,"parentElement",null),Re(this,"parentNode",null),Re(this,"ownerDocument"),Re(this,"firstChild",null),Re(this,"lastChild",null),Re(this,"previousSibling",null),Re(this,"nextSibling",null),Re(this,"ELEMENT_NODE",1),Re(this,"TEXT_NODE",3),Re(this,"nodeType"),Re(this,"nodeName"),Re(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 Zi)||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 Ra={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},La={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zr={};function Qi(e){if(zr[e])return zr[e];const t=globalThis[e],r=t.prototype,n=e in Ra?Ra[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 La?La[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 zr[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?zr[e]=c:r}catch{return r}}const us={};function et(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 Oa(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 Nc(){return Qi("MutationObserver").constructor}const V={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 Oa("Node",e,"contains")(t)},getRootNode:function(e){return Oa("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:Nc};function ye(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const St=`Please stop import mirror directly. Instead of that,\r
54
60
  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(St),-1),getNode:()=>(console.error(St),null),removeNodeFromMap(){console.error(St)},has:()=>(console.error(St),!1),reset(){console.error(St)}};function Ht(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 $n(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)}}),()=>$n(e,t,i||{},!0)}function At(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(St),Reflect.get(e,t,r))}));let vn=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 be(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(wn(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(qt(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())||(vn=()=>new Date().getTime());class pf{constructor(){x(this,"id",1),x(this,"styleIDMap",new WeakMap),x(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||{}),Se=(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))(Se||{}),Ye=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ye||{}),It=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(It||{}),Ct=(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))(Ct||{});function Oa(e){return"__ln"in e}class mf{constructor(){x(this,"length",0),x(this,"head",null),x(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(){x(this,"frozen",!1),x(this,"locked",!1),x(this,"texts",[]),x(this,"attributes",[]),x(this,"attributeMap",new WeakMap),x(this,"removes",[]),x(this,"mapRemoves",[]),x(this,"movedMap",{}),x(this,"addedSet",new Set),x(this,"movedSet",new Set),x(this,"droppedSet",new Set),x(this,"mutationCb"),x(this,"blockClass"),x(this,"blockSelector"),x(this,"maskTextClass"),x(this,"maskTextSelector"),x(this,"inlineStylesheet"),x(this,"maskInputOptions"),x(this,"maskTextFn"),x(this,"maskInputFn"),x(this,"keepIframeSrcFn"),x(this,"recordCanvas"),x(this,"inlineImages"),x(this,"slimDOMOptions"),x(this,"dataURLOptions"),x(this,"doc"),x(this,"mirror"),x(this,"iframeManager"),x(this,"stylesheetManager"),x(this,"shadowDomManager"),x(this,"canvasManager"),x(this,"processedNodeManager"),x(this,"unattachedDoc"),x(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),x(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=qt(c)?this.mirror.getId(jc(l)):this.mirror.getId(c),d=s(l);if(u===-1||d===-1)return n.addNode(l);const p=kt(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)}});p&&(t.push({parentId:u,nextId:d,node:p}),r.add(p.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 d=this.mirror.getId(H.parentNode(u.value));if(s(u.value)===-1)continue;if(d!==-1){l=u;break}{const p=u.value,f=H.parentNode(p);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),d=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+d).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))}),x(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("")}),x(this,"processMutation",t=>{if(!ps(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=H.textContent(t.target);be(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(be(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(be(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=qt(t.target)?this.mirror.getId(H.host(t.target)):this.mirror.getId(t.target);be(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:!(!qt(t.target)||!Xt(t.target))||void 0})),this.mapRemoves.push(r))})}}),x(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);be(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 Zt;const $=e=>Zt?(...t)=>{try{return e(...t)}catch(r){if(Zt&&Zt(r)===!0)return;throw r}}:e,pt=[];function Kt(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(Se).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let u=ht(c);const d=(p=>f=>{const y=Kt(f);if(be(y,n,s,!0))return;let h=null,C=p;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?Se[p]===Se.MouseDown?C="TouchStart":Se[p]===Se.MouseUp&&(C="TouchEnd"):Ye.Pen}else oi(f)&&(h=Ye.Touch);h!==null?(l=h,(C.startsWith("Touch")&&h===Ye.Touch||C.startsWith("Mouse")&&h===Ye.Mouse)&&(h=null)):Se[p]===Se.Click&&(h=l,l=null);const m=oi(f)?f.changedTouches[0]:f;if(!m)return;const g=r.getId(y),{clientX:v,clientY:I}=m;$(e)({type:Se[C],id:g,x:v,y:I,...h!==null&&{pointerType:h}})})(c);if(window.PointerEvent)switch(Se[c]){case Se.MouseDown:case Se.MouseUp:u=u.replace("mouse","pointer");break;case Se.TouchStart:case Se.TouchEnd:return}o.push(we(u,d,t))}),$(()=>{o.forEach(c=>c())})}function Gc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){return we("scroll",$(Ht($(a=>{const o=Kt(a);if(!o||be(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 jr(e){return function(t,r){if(Wr("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Wr("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Wr("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Wr("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 d=(u=l.set)==null?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return d}}),$(()=>{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:I,mouseInteractionCb:M,scrollCb:E,viewportResizeCb:U,inputCb:A,mediaInteractionCb:k,styleSheetRuleCb:R,styleDeclarationCb:O,canvasMutationCb:S,fontCb:N,selectionCb:D,customElementCb:b}=m;m.mutationCb=(...w)=>{g.mutation&&g.mutation(...w),v(...w)},m.mousemoveCb=(...w)=>{g.mousemove&&g.mousemove(...w),I(...w)},m.mouseInteractionCb=(...w)=>{g.mouseInteraction&&g.mouseInteraction(...w),M(...w)},m.scrollCb=(...w)=>{g.scroll&&g.scroll(...w),E(...w)},m.viewportResizeCb=(...w)=>{g.viewportResize&&g.viewportResize(...w),U(...w)},m.inputCb=(...w)=>{g.input&&g.input(...w),A(...w)},m.mediaInteractionCb=(...w)=>{g.mediaInteaction&&g.mediaInteaction(...w),k(...w)},m.styleSheetRuleCb=(...w)=>{g.styleSheetRule&&g.styleSheetRule(...w),R(...w)},m.styleDeclarationCb=(...w)=>{g.styleDeclaration&&g.styleDeclaration(...w),O(...w)},m.canvasMutationCb=(...w)=>{g.canvasMutation&&g.canvasMutation(...w),S(...w)},m.fontCb=(...w)=>{g.font&&g.font(...w),N(...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:I}){if(g.mousemove===!1)return()=>{};const M=typeof g.mousemove=="number"?g.mousemove:50,E=typeof g.mousemoveCallback=="number"?g.mousemoveCallback:500;let U,A=[];const k=Ht($(S=>{const N=Date.now()-U;m(A.map(D=>(D.timeOffset-=N,D)),S),A=[],U=null}),E),R=$(Ht($(S=>{const N=Kt(S),{clientX:D,clientY:b}=oi(S)?S.changedTouches[0]:S;U||(U=vn()),A.push({x:D,y:b,id:I.getId(N),timeOffset:vn()-U}),k(typeof DragEvent<"u"&&S instanceof DragEvent?G.Drag:S instanceof MouseEvent?G.MouseMove:G.TouchMove)}),M,{trailing:!1})),O=[we("mousemove",R,v),we("touchmove",R,v),we("drag",R,v)];return $(()=>{O.forEach(S=>S())})}(e),i=gf(e),a=Gc(e),o=function({viewportResizeCb:m},{win:g}){let v=-1,I=-1;return we("resize",$(Ht($(()=>{const M=Pc(),E=_c();v===M&&I===E||(m({width:Number(E),height:Number(M)}),v=M,I=E)}),200)),g)}(e,{win:r}),l=function({inputCb:m,doc:g,mirror:v,blockClass:I,blockSelector:M,ignoreClass:E,ignoreSelector:U,maskInputOptions:A,maskInputFn:k,sampling:R,userTriggeredOnInput:O}){function S(z){let W=Kt(z);const L=z.isTrusted,_=W&&W.tagName;if(W&&_==="OPTION"&&(W=H.parentElement(W)),!W||!_||yf.indexOf(_)<0||be(W,I,M,!0)||W.classList.contains(E)||U&&W.matches(U))return;let F=W.value,J=!1;const pe=Di(W)||"";pe==="radio"||pe==="checkbox"?J=W.checked:(A[_.toLowerCase()]||A[pe])&&(F=Ti({element:W,maskInputOptions:A,tagName:_,type:pe,value:F,maskInputFn:k})),N(W,O?{text:F,isChecked:J,userTriggered:L}:{text:F,isChecked:J});const Le=W.name;pe==="radio"&&Le&&J&&g.querySelectorAll(`input[type="radio"][name="${Le}"]`).forEach(ye=>{if(ye!==W){const Ne=ye.value;N(ye,O?{text:Ne,isChecked:!J,userTriggered:!1}:{text:Ne,isChecked:!J})}})}function N(z,W){const L=Ta.get(z);if(!L||L.text!==W.text||L.isChecked!==W.isChecked){Ta.set(z,W);const _=v.getId(z);$(m)({...W,id:_})}}const D=(R.input==="last"?["change"]:["input","change"]).map(z=>we(z,$(S),g)),b=g.defaultView;if(!b)return()=>{D.forEach(z=>z())};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(z=>$n(z[0],z[1],{set(){$(S)({target:this,isTrusted:!1})}},!1,b))),$(()=>{D.forEach(z=>z())})}(e),c=function({mediaInteractionCb:m,blockClass:g,blockSelector:v,mirror:I,sampling:M,doc:E}){const U=$(k=>Ht($(R=>{const O=Kt(R);if(!O||be(O,g,v,!0))return;const{currentTime:S,volume:N,muted:D,playbackRate:b,loop:w}=O;m({type:k,id:I.getId(O),currentTime:S,volume:N,muted:D,playbackRate:b,loop:w})}),M.media||500)),A=[we("play",U(Ct.Play),E),we("pause",U(Ct.Pause),E),we("seeked",U(Ct.Seeked),E),we("volumechange",U(Ct.VolumeChange),E),we("ratechange",U(Ct.RateChange),E)];return $(()=>{A.forEach(k=>k())})}(e);let u=()=>{},d=()=>{},p=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:m,mirror:g,stylesheetManager:v},{win:I}){if(!I.CSSStyleSheet||!I.CSSStyleSheet.prototype)return()=>{};const M=I.CSSStyleSheet.prototype.insertRule;I.CSSStyleSheet.prototype.insertRule=new Proxy(M,{apply:$((O,S,N)=>{const[D,b]=N,{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}]}),O.apply(S,N)})}),I.CSSStyleSheet.prototype.addRule=function(O,S,N=this.cssRules.length){const D=`${O} { ${S} }`;return I.CSSStyleSheet.prototype.insertRule.apply(this,[D,N])};const E=I.CSSStyleSheet.prototype.deleteRule;let U,A;I.CSSStyleSheet.prototype.deleteRule=new Proxy(E,{apply:$((O,S,N)=>{const[D]=N,{id:b,styleId:w}=rt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,removes:[{index:D}]}),O.apply(S,N)})}),I.CSSStyleSheet.prototype.removeRule=function(O){return I.CSSStyleSheet.prototype.deleteRule.apply(this,[O])},I.CSSStyleSheet.prototype.replace&&(U=I.CSSStyleSheet.prototype.replace,I.CSSStyleSheet.prototype.replace=new Proxy(U,{apply:$((O,S,N)=>{const[D]=N,{id:b,styleId:w}=rt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,replace:D}),O.apply(S,N)})})),I.CSSStyleSheet.prototype.replaceSync&&(A=I.CSSStyleSheet.prototype.replaceSync,I.CSSStyleSheet.prototype.replaceSync=new Proxy(A,{apply:$((O,S,N)=>{const[D]=N,{id:b,styleId:w}=rt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,replaceSync:D}),O.apply(S,N)})}));const k={};Vr("CSSGroupingRule")?k.CSSGroupingRule=I.CSSGroupingRule:(Vr("CSSMediaRule")&&(k.CSSMediaRule=I.CSSMediaRule),Vr("CSSConditionRule")&&(k.CSSConditionRule=I.CSSConditionRule),Vr("CSSSupportsRule")&&(k.CSSSupportsRule=I.CSSSupportsRule));const R={};return Object.entries(k).forEach(([O,S])=>{R[O]={insertRule:S.prototype.insertRule,deleteRule:S.prototype.deleteRule},S.prototype.insertRule=new Proxy(R[O].insertRule,{apply:$((N,D,b)=>{const[w,T]=b,{id:z,styleId:W}=rt(D.parentStyleSheet,g,v.styleMirror);return(z&&z!==-1||W&&W!==-1)&&m({id:z,styleId:W,adds:[{rule:w,index:[...jr(D),T||0]}]}),N.apply(D,b)})}),S.prototype.deleteRule=new Proxy(R[O].deleteRule,{apply:$((N,D,b)=>{const[w]=b,{id:T,styleId:z}=rt(D.parentStyleSheet,g,v.styleMirror);return(T&&T!==-1||z&&z!==-1)&&m({id:T,styleId:z,removes:[{index:[...jr(D),w]}]}),N.apply(D,b)})})}),$(()=>{I.CSSStyleSheet.prototype.insertRule=M,I.CSSStyleSheet.prototype.deleteRule=E,U&&(I.CSSStyleSheet.prototype.replace=U),A&&(I.CSSStyleSheet.prototype.replaceSync=A),Object.entries(k).forEach(([O,S])=>{S.prototype.insertRule=R[O].insertRule,S.prototype.deleteRule=R[O].deleteRule})})}(e,{win:r}),d=$c(e,e.doc),p=function({styleDeclarationCb:m,mirror:g,ignoreCSSAttributes:v,stylesheetManager:I},{win:M}){const E=M.CSSStyleDeclaration.prototype.setProperty;M.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:$((A,k,R)=>{var O;const[S,N,D]=R;if(v.has(S))return E.apply(k,[S,N,D]);const{id:b,styleId:w}=rt((O=k.parentRule)==null?void 0:O.parentStyleSheet,g,I.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,set:{property:S,value:N,priority:D},index:jr(k.parentRule)}),A.apply(k,R)})});const U=M.CSSStyleDeclaration.prototype.removeProperty;return M.CSSStyleDeclaration.prototype.removeProperty=new Proxy(U,{apply:$((A,k,R)=>{var O;const[S]=R;if(v.has(S))return U.apply(k,[S]);const{id:N,styleId:D}=rt((O=k.parentRule)==null?void 0:O.parentStyleSheet,g,I.styleMirror);return(N&&N!==-1||D&&D!==-1)&&m({id:N,styleId:D,remove:{property:S},index:jr(k.parentRule)}),A.apply(k,R)})}),$(()=>{M.CSSStyleDeclaration.prototype.setProperty=E,M.CSSStyleDeclaration.prototype.removeProperty=U})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:m,doc:g}){const v=g.defaultView;if(!v)return()=>{};const I=[],M=new WeakMap,E=v.FontFace;v.FontFace=function(A,k,R){const O=new E(A,k,R);return M.set(O,{family:A,buffer:typeof k!="string",descriptors:R,fontSource:typeof k=="string"?k:JSON.stringify(Array.from(new Uint8Array(k)))}),O};const U=At(g.fonts,"add",function(A){return function(k){return setTimeout($(()=>{const R=M.get(k);R&&(m(R),M.delete(k))}),0),A.apply(this,[k])}});return I.push(()=>{v.FontFace=E}),I.push(U),$(()=>{I.forEach(A=>A())})}(e)));const y=function(m){const{doc:g,mirror:v,blockClass:I,blockSelector:M,selectionCb:E}=m;let U=!0;const A=$(()=>{const k=g.getSelection();if(!k||U&&(k!=null&&k.isCollapsed))return;U=k.isCollapsed||!1;const R=[],O=k.rangeCount||0;for(let S=0;S<O;S++){const N=k.getRangeAt(S),{startContainer:D,startOffset:b,endContainer:w,endOffset:T}=N;be(D,I,M,!0)||be(w,I,M,!0)||R.push({start:v.getId(D),startOffset:b,end:v.getId(w),endOffset:T})}E({ranges:R})});return A(),we("selectionchange",A)}(e),h=function({doc:m,customElementCb:g}){const v=m.defaultView;return v&&v.customElements?At(v.customElements,"define",function(I){return function(M,E,U){try{g({define:{name:M}})}catch{console.warn(`Custom element callback failed for ${M}`)}return I.apply(this,[M,E,U])}}):()=>{}}(e),C=[];for(const m of e.plugins)C.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(),d(),p(),f(),y(),h(),C.forEach(m=>m())})}function Wr(e){return window[e]!==void 0}function Vr(e){return!!(window[e]!==void 0&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Da{constructor(t){x(this,"iframeIdToRemoteIdMap",new WeakMap),x(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){x(this,"iframes",new WeakMap),x(this,"crossOriginIframeMap",new WeakMap),x(this,"crossOriginIframeMirror",new Da(El)),x(this,"crossOriginIframeStyleMirror"),x(this,"crossOriginIframeRootIdMap",new WeakMap),x(this,"mirror"),x(this,"mutationCb"),x(this,"wrappedEmit"),x(this,"loadListener"),x(this,"stylesheetManager"),x(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){x(this,"shadowDoms",new WeakSet),x(this,"mutationCb"),x(this,"scrollCb"),x(this,"bypassOptions"),x(this,"mirror"),x(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(!Xt(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(At(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 Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sf=typeof Uint8Array>"u"?[]:new Uint8Array(256),Hr=0;Hr<64;Hr++)Sf[Gt.charCodeAt(Hr)]=Hr;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 ln(e,t,r){if(e instanceof Array)return e.map(n=>ln(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+=Gt[i[s]>>2],o+=Gt[(3&i[s])<<4|i[s+1]>>4],o+=Gt[(15&i[s+1])<<2|i[s+2]>>6],o+=Gt[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:[ln(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:[ln(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=>ln(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=At(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(o,...l){if(!be(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=At(e,l,function(u){return function(...d){const p=u.apply(this,d);if(Yc(p,i,this),"tagName"in this.canvas&&!be(this.canvas,n,s,!0)){const f=Jc(d,i,this),y={type:t,property:l,args:f};r(this.canvas,y)}return p}});a.push(c)}catch{const c=$n(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){x(this,"pendingCanvasMutations",new Map),x(this,"rafStamps",{latestId:0,invokeId:null}),x(this,"mirror"),x(this,"mutationCb"),x(this,"resetObservers"),x(this,"frozen",!1),x(this,"locked",!1),x(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:C,width:m,height:g}=f.data;this.mutationCb({id:y,type:It["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:C}]},0,0]}]})};const c=1e3/t;let u,d=0;const p=f=>{d&&f-d<c||(d=f,(()=>{const y=[];return r.document.querySelectorAll("canvas").forEach(h=>{be(h,n,s,!0)||y.push(h)}),y})().forEach(async y=>{var h;const C=this.mirror.getId(y);if(o.get(C)||y.width===0||y.height===0)return;if(o.set(C,!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:C,bitmap:m,width:y.width,height:y.height,dataURLOptions:i.dataURLOptions},[m])})),u=requestAnimationFrame(p)};u=requestAnimationFrame(p),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 d=[],p=Object.getOwnPropertyNames(l.CanvasRenderingContext2D.prototype);for(const f of p)try{if(typeof l.CanvasRenderingContext2D.prototype[f]!="function")continue;const y=At(l.CanvasRenderingContext2D.prototype,f,function(h){return function(...C){return be(this.canvas,c,u,!0)||setTimeout(()=>{const m=Jc(C,l,this);o(this.canvas,{type:It["2D"],property:f,args:m})},0),h.apply(this,C)}});d.push(y)}catch{const y=$n(l.CanvasRenderingContext2D.prototype,f,{set(h){o(this.canvas,{type:It["2D"],property:f,args:[h],setter:!0})}});d.push(y)}return()=>{d.forEach(f=>f())}}(this.processMutation.bind(this),t,r,n),a=function(o,l,c,u){const d=[];return d.push(...Na(l.WebGLRenderingContext.prototype,It.WebGL,o,c,u,l)),l.WebGL2RenderingContext!==void 0&&d.push(...Na(l.WebGL2RenderingContext.prototype,It.WebGL2,o,c,u,l)),()=>{d.forEach(p=>p())}}(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){x(this,"trackedLinkElements",new WeakSet),x(this,"mutationCb"),x(this,"adoptedStyleSheetCb"),x(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(){x(this,"nodeMap",new WeakMap),x(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 le,cn,hs,bn=!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 Ae=new kl;function $t(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:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:y,maskTextFn:h,hooks:C,packFn:m,sampling:g={},dataURLOptions:v={},mousemoveWait:I,recordDOM:M=!0,recordCanvas:E=!1,recordCrossOriginIframes:U=!1,recordAfter:A=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:R=!1,inlineImages:O=!1,plugins:S,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:D=new Set([]),errorHandler:b}=e;Zt=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()=>{};I!==void 0&&g.mousemove===void 0&&(g.mousemove=I),Ae.reset();const z=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},W=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 L;(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 _=0;const F=V=>{for(const Oe of S||[])Oe.eventProcessor&&(V=Oe.eventProcessor(V));return m&&!T&&(V=m(V)),V};le=(V,Oe)=>{var re;const ie=V;if(ie.timestamp=vn(),!((re=pt[0])!=null&&re.isFrozen())||ie.type===Y.FullSnapshot||ie.type===Y.IncrementalSnapshot&&ie.data.source===G.Mutation||pt.forEach(xe=>xe.unfreeze()),w)t==null||t(F(ie),Oe);else if(T){const xe={type:"rrweb",event:F(ie),origin:window.location.origin,isCheckout:Oe};window.parent.postMessage(xe,"*")}if(ie.type===Y.FullSnapshot)L=ie,_=0;else if(ie.type===Y.IncrementalSnapshot){if(ie.data.source===G.Mutation&&ie.data.isAttachIframe)return;_++;const xe=n&&_>=n,q=r&&ie.timestamp-L.timestamp>r;(xe||q)&&cn(!0)}};const J=V=>{le({type:Y.IncrementalSnapshot,data:{source:G.Mutation,...V}})},pe=V=>le({type:Y.IncrementalSnapshot,data:{source:G.Scroll,...V}}),Le=V=>le({type:Y.IncrementalSnapshot,data:{source:G.CanvasMutation,...V}}),ye=new kf({mutationCb:J,adoptedStyleSheetCb:V=>le({type:Y.IncrementalSnapshot,data:{source:G.AdoptedStyleSheet,...V}})}),Ne=new vf({mirror:Ae,mutationCb:J,stylesheetManager:ye,recordCrossOriginIframes:U,wrappedEmit:le});for(const V of S||[])V.getMirror&&V.getMirror({nodeMirror:Ae,crossOriginIframeMirror:Ne.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ne.crossOriginIframeStyleMirror});const Jn=new Ef;hs=new Cf({recordCanvas:E,mutationCb:Le,win:window,blockClass:s,blockSelector:i,mirror:Ae,sampling:g.canvas,dataURLOptions:v});const br=new bf({mutationCb:J,scrollCb:pe,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:z,dataURLOptions:v,maskTextFn:h,maskInputFn:y,recordCanvas:E,inlineImages:O,sampling:g,slimDOMOptions:W,iframeManager:Ne,stylesheetManager:ye,canvasManager:hs,keepIframeSrcFn:N,processedNodeManager:Jn},mirror:Ae});cn=(V=!1)=>{if(!M)return;le({type:Y.Meta,data:{href:window.location.href,width:_c(),height:Pc()}},V),ye.reset(),br.init(),pt.forEach(re=>re.lock());const Oe=function(re,ie){const{mirror:xe=new kl,blockClass:q="rr-block",blockSelector:Dt=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:Pt=!1,dataURLOptions:cd,preserveWhiteSpace:ud,onSerialize:dd,onIframeLoad:pd,iframeLoadTimeout:hd,onStylesheetLoad:md,stylesheetLoadTimeout:fd,keepIframeSrcFn:gd=()=>!1}=ie||{};return kt(re,{doc:re,mirror:xe,blockClass:q,blockSelector:Dt,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:Pt===!0||Pt==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:Pt==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:Pt===!1?{}:Pt,dataURLOptions:cd,inlineImages:id,recordCanvas:od,preserveWhiteSpace:ud,onSerialize:dd,onIframeLoad:pd,iframeLoadTimeout:hd,onStylesheetLoad:md,stylesheetLoadTimeout:fd,keepIframeSrcFn:gd,newlyAddedElement:!1})}(document,{mirror:Ae,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:z,maskTextFn:h,maskInputFn:y,slimDOM:W,dataURLOptions:v,recordCanvas:E,inlineImages:O,onSerialize:re=>{Bc(re,Ae)&&Ne.addIframe(re),zc(re,Ae)&&ye.trackLinkElement(re),ai(re)&&br.addShadowRoot(H.shadowRoot(re),document)},onIframeLoad:(re,ie)=>{Ne.attachIframe(re,ie),br.observeAttachShadow(re)},onStylesheetLoad:(re,ie)=>{ye.attachLinkElement(re,ie)},keepIframeSrcFn:N});if(!Oe)return console.warn("Failed to snapshot the document");le({type:Y.FullSnapshot,data:{node:Oe,initialOffset:Dc(window)}},V),pt.forEach(re=>re.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,Ae.getId(document))};try{const V=[],Oe=ie=>{var xe;return $(wf)({mutationCb:J,mousemoveCb:(q,Dt)=>le({type:Y.IncrementalSnapshot,data:{source:Dt,positions:q}}),mouseInteractionCb:q=>le({type:Y.IncrementalSnapshot,data:{source:G.MouseInteraction,...q}}),scrollCb:pe,viewportResizeCb:q=>le({type:Y.IncrementalSnapshot,data:{source:G.ViewportResize,...q}}),inputCb:q=>le({type:Y.IncrementalSnapshot,data:{source:G.Input,...q}}),mediaInteractionCb:q=>le({type:Y.IncrementalSnapshot,data:{source:G.MediaInteraction,...q}}),styleSheetRuleCb:q=>le({type:Y.IncrementalSnapshot,data:{source:G.StyleSheetRule,...q}}),styleDeclarationCb:q=>le({type:Y.IncrementalSnapshot,data:{source:G.StyleDeclaration,...q}}),canvasMutationCb:Le,fontCb:q=>le({type:Y.IncrementalSnapshot,data:{source:G.Font,...q}}),selectionCb:q=>{le({type:Y.IncrementalSnapshot,data:{source:G.Selection,...q}})},customElementCb:q=>{le({type:Y.IncrementalSnapshot,data:{source:G.CustomElement,...q}})},blockClass:s,ignoreClass:a,ignoreSelector:o,maskTextClass:l,maskTextSelector:c,maskInputOptions:z,inlineStylesheet:u,sampling:g,recordDOM:M,recordCanvas:E,inlineImages:O,userTriggeredOnInput:k,collectFonts:R,doc:ie,maskInputFn:y,maskTextFn:h,keepIframeSrcFn:N,blockSelector:i,slimDOMOptions:W,dataURLOptions:v,mirror:Ae,iframeManager:Ne,stylesheetManager:ye,shadowDomManager:br,processedNodeManager:Jn,canvasManager:hs,ignoreCSSAttributes:D,plugins:((xe=S==null?void 0:S.filter(q=>q.observer))==null?void 0:xe.map(q=>({observer:q.observer,options:q.options,callback:Dt=>le({type:Y.Plugin,data:{plugin:q.name,payload:Dt}})})))||[]},C)};Ne.addLoadListener(ie=>{try{V.push(Oe(ie.contentDocument))}catch(xe){console.warn(xe)}});const re=()=>{cn(),V.push(Oe(document)),bn=!0};return document.readyState==="interactive"||document.readyState==="complete"?re():(V.push(we("DOMContentLoaded",()=>{le({type:Y.DomContentLoaded,data:{}}),A==="DOMContentLoaded"&&re()})),V.push(we("load",()=>{le({type:Y.Load,data:{}}),A==="load"&&re()},window))),()=>{V.forEach(ie=>ie()),Jn.destroy(),bn=!1,Zt=void 0}}catch(V){console.warn(V)}}var za,bt;$t.addCustomEvent=(e,t)=>{if(!bn)throw new Error("please add custom event after start recording");le({type:Y.Custom,data:{tag:e,payload:t}})},$t.freezePage=()=>{pt.forEach(e=>e.freeze())},$t.takeFullSnapshot=e=>{if(!bn)throw new Error("please take full snapshot after start recording");cn(e)},$t.mirror=Ae,(bt=za||(za={}))[bt.NotStarted=0]="NotStarted",bt[bt.Running=1]="Running",bt[bt.Stopped=2]="Stopped";var Me=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.FeedbackClosed="feedback.closed",e.PageChange="page.change",e.API="api",e.Override="override",e))(Me||{}),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 dr={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 Gr;const xf=new Uint8Array(16);function Rf(){if(!Gr&&(Gr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gr(xf)}const fe=[];for(let e=0;e<256;++e)fe.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 fe[s[i+0]]+fe[s[i+1]]+fe[s[i+2]]+fe[s[i+3]]+"-"+fe[s[i+4]]+fe[s[i+5]]+"-"+fe[s[i+6]]+fe[s[i+7]]+"-"+fe[s[i+8]]+fe[s[i+9]]+"-"+fe[s[i+10]]+fe[s[i+11]]+fe[s[i+12]]+fe[s[i+13]]+fe[s[i+14]]+fe[s[i+15]]}(n)}const P=new class{constructor(){ue(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 j=new Qc,Sn=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){ue(this,"storage");ue(this,"tempStorage",{});ue(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 ce=new eu("sessionStorage"),Ce=new eu("localStorage");class Of{constructor(t){ue(this,"payload");ue(this,"promise");ue(this,"reject",()=>{});ue(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((r,n)=>{this.reject=n,this.resolve=r})}resolveRequest(t){this.resolve(t)}}const te={replay:null},Af=()=>{const e=[];return te.replay&&e.push("replay"),e.join(",")},Mf=10;let tu=!1,ru="",$r=!1,nu=!1,un=[];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 De(e={}){const t={"Content-Type":"application/json","userleap-platform":"web","x-ul-sdk-version":"2.35.0","x-ul-installation-method":Uf(e),"sprig-modules":Af(),"x-ul-package-version":"2.35.0"};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 un.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($r&&!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(!$r&&!n||s){$r=!0;const c=l.headers.has("ratelimit-reset")?Number(l.headers.get("ratelimit-reset")):Mf;return await Sn(1e3*c),Ge(e,{...i,shouldDropOnRateLimit:n,shouldRetryRequest:!0})}return Ga(a)}if($r=!1,un.length&&(un.map(c=>{const u=c.payload;Ge(u.url,{...u.options,retries:u.retries,shouldDropOnRateLimit:u.shouldDropOnRateLimit}).then(d=>{c.resolveRequest(d)})}),un=[]),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 Sn(1e3*Math.pow(2,r)),Ge(e,{...i,retries:c}))}},$a="ul-view-sdk-script",Tf=["ios","android"],st="visitors",it="environments";async function je(e,t){var i,a,o;const{shouldDropOnRateLimit:r,...n}=t;n.headers=Object.assign(De(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,d=(a=s.headers)==null?void 0:a.get("x-ul-visitor-id");if(window.UserLeap.userId&&d===window.UserLeap.visitorId){const p=Ce.getItemObject("sprig.anon.env.vid.map");p&&p[window.UserLeap.envId]===d&&(delete p[window.UserLeap.envId],Ce.setItemObject("sprig.anon.env.vid.map",p))}u&&d&&(d!==window.UserLeap.visitorId||window.UserLeap.token!==u)&&(Ie("token",u),Ie("vid",d),j.emit(B.VisitorIDUpdated,{visitorId:d}),window.UserLeap.token=u,window.UserLeap.visitorId=d)}return(o=s.json)!=null&&o.logMessage&&console.warn(`[Sprig] ${s.json.logMessage}`),s}function Ie(e,t){const r=Ce.getItemObject("userleap.ids");let n=r[window.UserLeap.envId];n?n[e]=t:n={[e]:t},r[window.UserLeap.envId]=n,Ce.setItemObject("userleap.ids",r)}function to(){return window.previewMode?"0":window.UserLeap.visitorId??""}function Ue(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 Qt=async(e,t,r)=>{var W,L,_;const{context:n,delay:s,forceBrandedLogo:i,endCard:a,isFeedback:o=!1,heatmap:l,locale:c,previewMode:u,productConfig:d,questions:p,responseGroupUid:f,surveyId:y,uuid:h,vid:C,sessionReplay:m,studyType:g}=e,v=De(window.UserLeap),I=pr(v),M=Yn(v);if(m)if(I)j.emit(B.ReplayCapture,{responseGroupUid:f,hasQuestions:!!(p!=null&&p.length),surveyId:y,uploadId:m.uploadId,replayType:m.replayDurationType??"before",seconds:m.replayDurationSeconds,generateVideoUploadUrlPayload:{mediaRecordingUid:yt(),mediaType:"screen",questionId:1,responseGroupUid:f,surveyId:y,updatedAt:new Date().toISOString(),visitorId:window.UserLeap.visitorId,isReplay:!0}});else{if(!te.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};te.replay.scheduleOrCaptureReplay({responseGroupId:f,surveyId:y,visitorId:C,replayParams:m,completeUploadHeaders:v,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:p.length===0})}if(l){if(!te.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};const{eventId:F,replayParams:J,responseGroupUid:pe,surveyId:Le}=l;await te.replay.initializeReplay({maxReplayDurationSeconds:300,maxInflightRequests:window.UserLeap.maxInflightReplayRequests,teardownAfter:!0,apiUrl:window.UserLeap._API_URL,replaySettings:r}),te.replay.tryReplayAction(()=>{var ye;return(ye=te.replay)==null?void 0:ye.scheduleCapture({apiUrl:window.UserLeap._API_URL,completeUploadHeaders:v,eventId:F,isHeatmap:!0,replayParams:J,responseGroupId:pe,surveyId:Le,triggerTimestamp:Date.now(),visitorId:C})},"Error in scheduling/capturing replay")}if(C==null||!(p!=null&&p.length))return P.info("CannotDisplaySurvey",{vid:C}),{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(Df(p))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:"no survey"};if(window.UserLeap.container){P.info("AlreadyDisplayingSurvey");const F="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(F),{success:!1,message:F,surveyState:"no survey"}}if(C!==window.UserLeap.visitorId&&h!==window.UserLeap.visitorId&&!window.previewMode){const F="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(F)),{success:!1,message:F,surveyState:"no survey"}}P.info("ShowingSurvey",{surveyId:y}),(W=te.replay)==null||W.RecordSurveyShown({id:y,userAgent:window.navigator.userAgent}),Zc.disable(),j.emit(B.SurveyWillPresent,{name:B.SurveyWillPresent,"survey.id":y});let E,U,A,k,R=document.createElement("div");const O=F=>{const{"view.version":J}=F;J!==v["x-ul-sdk-version"]&&iu(),j.removeListener("verify.view.version",O)};j.on("verify.view.version",O),window.UserLeap.useMobileStyling=M,eo(v)?(E="ul-direct-embeded-frame",U=document.head,A=window,k=!1,(()=>{const F=De(window.UserLeap),J=pr(F),pe=window.UserLeap.forceDirectEmbed,Le=F["userleap-platform"]==="web";return J||pe&&Le})()&&(su(y,o),R.id=E,window.UserLeap.container.appendChild(R),ou(),j.emit(B.SurveyLifeCycle,{state:"presented"}),j.emit(B.SurveyPresented,{name:B.SurveyPresented,"survey.id":y}))):{frameId:E,contentWinDocHead:U,contentWindow:A,hasOverlay:k,iframe:R}=_f({productConfig:d,useMobileStyling:M,surveyId:y,isFeedback:o}),window.UserLeap.frameId=E;const S={apiURL:window.UserLeap._API_URL,cards:p,configureExitOnOverlayClick:F=>{j.once(B.CloseSurveyOnOverlayClick,F)},context:n,endCard:a,envId:window.UserLeap.envId,eventEmitFn:j.emit.bind(j),fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,forceBrandedLogo:i,frame:R,headers:v,locale:c,mobileSDKVersion:window.UserLeap.mobileSDKVersion,previewKey:Ce.getItem("sprig.previewKey"),previewMode:u,productConfig:{framePosition:d==null?void 0:d.framePosition,desktopDisplay:d==null?void 0:d.desktopDisplay,placement:d==null?void 0:d.placement},responseGroupUid:f,startingQuestionIdx:(L=window.UserLeap.config)==null?void 0:L.startingQuestionIdx,studyType:g,styleNonce:window.UserLeap.styleNonce,surveyId:y,tabTitle:document.title,trackPageViewUrl:t,ulEvents:dr,upchunkLibraryURL:window.UserLeap.upchunkLibraryURL,useMobileStyling:M,userId:h,viewDocument:A==null?void 0:A.document,viewWindow:A,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},...window.UserLeap._config};(_=window.UserLeap._config)!=null&&_.startingQuestionIdx&&(window.UserLeap._config={...window.UserLeap._config,startingQuestionIdx:null});const N=(o?window.UserLeap.feedbackCustomStyles:window.UserLeap.customStyles)??d.customStyles;S.customStyles=N,A&&(A.__cfg=S);const D=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:S.path,b=document.getElementById($a);b&&b.remove();const w=function(){const F=document.createElement("script");return window.UserLeap.nonce&&F.setAttribute("nonce",window.UserLeap.nonce),F.id=$a,F}(),T=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};if(S.installationMethod==="web-npm"||S.installationMethod==="web-npm-bundled"){const{default:F}=await Promise.resolve().then(()=>require("./view-DkgdLDj2.cjs"));F.configure(S),k&&window.UserLeap.container&&T()}else D&&(w.src=D,k&&w.addEventListener("load",()=>{window.UserLeap.container&&T()}),A==null||A.addEventListener("error",F=>{F.target instanceof HTMLScriptElement&&F.target.src===D&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0}));U==null||U.appendChild(w);const z={success:!0,surveyState:"ready",surveyId:y,responseGroupUid:f};return window.UserLeap.isMobileSDK&&s&&(z.delay=s),z};function Yn(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 pr(e)||t>10&&t<500}function pr(e){return Tf.includes(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,Ie("trackStartUrl",null),j.emit(B.SurveyLifeCycle,{state:"dismissed"}),j.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=()=>{j.once(B.SurveyWillClose,({initiator:e,studyType:t})=>{j.removeAllListeners(B.CloseSurveyOnOverlayClick),iu(e,t)})},Pf=(e,t,r,n)=>{var u,d;const s={position:"fixed",bottom:"0px",right:ms,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646,transition:"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%",(d=window.UserLeap.windowDimensions)!=null&&d.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 p=()=>{c=!0,l={margin:"auto",position:"static"}};if(n)o?p():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":p()}}return c&&((p,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?p.overlayStyleMobile:p.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 p,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`,j.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`,j.emit(B.SurveyWidth,{name:B.SurveyWidth,contentFrameWidth:y,"survey.id":r}))},(p=window.UserLeap.container)==null||p.appendChild(a),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{j.emit(B.CloseSurveyOnOverlayClick)}),j.emit(B.SurveyLifeCycle,{state:"presented"}),j.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 d=u==null?void 0:u.head;return{frameId:s,contentWinDocHead:d,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])=>{j.on(e,t)})},Ff=()=>{Object.entries(au).forEach(([e,t])=>{j.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,hr=({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+=(p=>{const f=p.querySelector(".sprig-question-body"),y=p.querySelector(".ul-card"),h=p.querySelector(".ul-card-main-content"),C=p.querySelector(".ul-footer"),m=p.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(C)&&ze(m)&&m.clientHeight===0&&(g+=C.clientHeight),g})(e);const u=getComputedStyle(n);o=i;const d=parseFloat(u.marginTop)+parseFloat(u.marginBottom);i+=d+(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,Rt=()=>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,er=null,ut=null;const zf=["bottom-left","bottom-right","center-left","center-right"],In=()=>{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")},Cn=e=>{const t=Rt();t&&(ut!=null&&ut.endsWith("right")?t.style.right=`${e}px`:ut!=null&&ut.endsWith("left")&&(t.style.left=`${e}px`))},fs=()=>{if(K&&(In()||pu())){j.off(B.SurveyAppeared,Yt),di();const e=hu();return Cn(-e),!0}return!1},Yt=()=>{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=`
61
+ or you can use record.mirror to access the mirror instance during recording.`;let Aa={map:{},getId:()=>(console.error(St),-1),getNode:()=>(console.error(St),null),removeNodeFromMap(){console.error(St)},has:()=>(console.error(St),!1),reset(){console.error(St)}};function Ht(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 At(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&&(Aa=new Proxy(Aa,{get:(e,t,r)=>(t==="map"&&console.error(St),Reflect.get(e,t,r))}));let vn=Date.now;function Fc(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=V.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=V.parentElement(i.body))==null?void 0:n.scrollTop)||((s=i==null?void 0:i.body)==null?void 0:s.scrollTop)||0}}function Bc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jc(e){return e?e.nodeType===e.ELEMENT_NODE?e:V.parentElement(e):null}function ve(e,t,r,n){if(!e)return!1;const s=jc(e);if(!s)return!1;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return!0}else if(wn(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 Wc(e,t){if(Jt(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=V.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Wc(n,t))}function oi(e){return!!e.changedTouches}function Vc(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Hc(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 Zi&&"shadowRoot"in e?!!e.shadowRoot:!!V.shadowRoot(e))}/[1-9][0-9]{12}/.test(Date.now().toString())||(vn=()=>new Date().getTime());class bf{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 Gc(e){var t;let r=null;return"getRootNode"in e&&((t=V.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&V.host(V.getRootNode(e))&&(r=V.host(V.getRootNode(e))),r}function Sf(e){const t=e.ownerDocument;if(!t)return!1;const r=function(n){let s,i=n;for(;s=Gc(i);)i=s;return i}(e);return V.contains(t,r)}function Yc(e){const t=e.ownerDocument;return!!t&&(V.contains(t,e)||Sf(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||{}),H=(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))(H||{}),be=(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))(be||{}),Ye=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ye||{}),It=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(It||{}),Ct=(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))(Ct||{});function Ma(e){return"__ln"in e}class If{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&&Ma(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&&Ma(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 Ua=(e,t)=>`${e}@${t}`;class Cf{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 If,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=V.parentNode(l);if(!c||!Yc(l)||c.tagName==="TEXTAREA")return;const u=Jt(c)?this.mirror.getId(Gc(l)):this.mirror.getId(c),d=s(l);if(u===-1||d===-1)return n.addNode(l);const p=kt(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=>{Vc(f,this.mirror)&&this.iframeManager.addIframe(f),Hc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),ai(l)&&this.shadowDomManager.addShadowRoot(V.shadowRoot(l),this.doc)},onIframeLoad:(f,y)=>{this.iframeManager.attachIframe(f,y),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,y)=>{this.stylesheetManager.attachLinkElement(f,y)}});p&&(t.push({parentId:u,nextId:d,node:p}),r.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Ta(this.removes,l,this.mirror)&&!this.movedSet.has(V.parentNode(l))||i(l);for(const l of this.addedSet)Da(this.droppedSet,l)||Ta(this.removes,l,this.mirror)?Da(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(V.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 d=this.mirror.getId(V.parentNode(u.value));if(s(u.value)===-1)continue;if(d!==-1){l=u;break}{const p=u.value,f=V.parentNode(p);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=V.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=V.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),d=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+d).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(V.childNodes(t),n=>V.textContent(n)||"").join("")}),R(this,"processMutation",t=>{if(!ps(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=V.textContent(t.target);ve(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue||this.texts.push({value:Al(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,jc(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(ve(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"),!Ol(r.tagName,n))if(i.attributes[n]=Ll(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(ve(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=Jt(t.target)?this.mirror.getId(V.host(t.target)):this.mirror.getId(t.target);ve(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||Wc(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ua(n,s)]?li(this.movedSet,r):this.removes.push({parentId:s,id:n,isShadow:!(!Jt(t.target)||!Xt(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[Ua(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ve(t,this.blockClass,this.blockSelector,!1)||(V.childNodes(t).forEach(n=>this.genAdds(n)),ai(t)&&V.childNodes(V.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),V.childNodes(t).forEach(r=>li(e,r))}function Ta(e,t,r){return e.length!==0&&function(n,s,i){let a=V.parentNode(s);for(;a;){const o=i.getId(a);if(n.some(l=>l.id===o))return!0;a=V.parentNode(a)}return!1}(e,t,r)}function Da(e,t){return e.size!==0&&$c(e,t)}function $c(e,t){const r=V.parentNode(t);return!!r&&(!!e.has(r)||$c(e,r))}let Kt;const G=e=>Kt?(...t)=>{try{return e(...t)}catch(r){if(Kt&&Kt(r)===!0)return;throw r}}:e,pt=[];function Zt(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 qc(e,t){const r=new Cf;pt.push(r),r.init(e);const n=new(Nc())(G(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function kf({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(be).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let u=ht(c);const d=(p=>f=>{const y=Zt(f);if(ve(y,n,s,!0))return;let h=null,k=p;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?be[p]===be.MouseDown?k="TouchStart":be[p]===be.MouseUp&&(k="TouchEnd"):Ye.Pen}else oi(f)&&(h=Ye.Touch);h!==null?(l=h,(k.startsWith("Touch")&&h===Ye.Touch||k.startsWith("Mouse")&&h===Ye.Mouse)&&(h=null)):be[p]===be.Click&&(h=l,l=null);const m=oi(f)?f.changedTouches[0]:f;if(!m)return;const g=r.getId(y),{clientX:v,clientY:I}=m;G(e)({type:be[k],id:g,x:v,y:I,...h!==null&&{pointerType:h}})})(c);if(window.PointerEvent)switch(be[c]){case be.MouseDown:case be.MouseUp:u=u.replace("mouse","pointer");break;case be.TouchStart:case be.TouchEnd:return}o.push(ye(u,d,t))}),G(()=>{o.forEach(c=>c())})}function Jc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){return ye("scroll",G(Ht(G(a=>{const o=Zt(a);if(!o||ve(o,n,s,!0))return;const l=r.getId(o);if(o===t&&t.defaultView){const c=Fc(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 Ef=["INPUT","TEXTAREA","SELECT"],Pa=new WeakMap;function jr(e){return function(t,r){if(Wr("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Wr("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Wr("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Wr("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 tt(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Xc({mirror:e,stylesheetManager:t},r){var n,s,i;let a=null;a=r.nodeName==="#document"?e.getId(r):e.getId(V.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 d=(u=l.set)==null?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return d}}),G(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function xf(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;(function(m,g){const{mutationCb:v,mousemoveCb:I,mouseInteractionCb:M,scrollCb:x,viewportResizeCb:U,inputCb:A,mediaInteractionCb:E,styleSheetRuleCb:L,styleDeclarationCb:O,canvasMutationCb:S,fontCb:N,selectionCb:P,customElementCb:b}=m;m.mutationCb=(...w)=>{g.mutation&&g.mutation(...w),v(...w)},m.mousemoveCb=(...w)=>{g.mousemove&&g.mousemove(...w),I(...w)},m.mouseInteractionCb=(...w)=>{g.mouseInteraction&&g.mouseInteraction(...w),M(...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),A(...w)},m.mediaInteractionCb=(...w)=>{g.mediaInteaction&&g.mediaInteaction(...w),E(...w)},m.styleSheetRuleCb=(...w)=>{g.styleSheetRule&&g.styleSheetRule(...w),L(...w)},m.styleDeclarationCb=(...w)=>{g.styleDeclaration&&g.styleDeclaration(...w),O(...w)},m.canvasMutationCb=(...w)=>{g.canvasMutation&&g.canvasMutation(...w),S(...w)},m.fontCb=(...w)=>{g.font&&g.font(...w),N(...w)},m.selectionCb=(...w)=>{g.selection&&g.selection(...w),P(...w)},m.customElementCb=(...w)=>{g.customElement&&g.customElement(...w),b(...w)}})(e,t),e.recordDOM&&(n=qc(e,e.doc));const s=function({mousemoveCb:m,sampling:g,doc:v,mirror:I}){if(g.mousemove===!1)return()=>{};const M=typeof g.mousemove=="number"?g.mousemove:50,x=typeof g.mousemoveCallback=="number"?g.mousemoveCallback:500;let U,A=[];const E=Ht(G(S=>{const N=Date.now()-U;m(A.map(P=>(P.timeOffset-=N,P)),S),A=[],U=null}),x),L=G(Ht(G(S=>{const N=Zt(S),{clientX:P,clientY:b}=oi(S)?S.changedTouches[0]:S;U||(U=vn()),A.push({x:P,y:b,id:I.getId(N),timeOffset:vn()-U}),E(typeof DragEvent<"u"&&S instanceof DragEvent?H.Drag:S instanceof MouseEvent?H.MouseMove:H.TouchMove)}),M,{trailing:!1})),O=[ye("mousemove",L,v),ye("touchmove",L,v),ye("drag",L,v)];return G(()=>{O.forEach(S=>S())})}(e),i=kf(e),a=Jc(e),o=function({viewportResizeCb:m},{win:g}){let v=-1,I=-1;return ye("resize",G(Ht(G(()=>{const M=Bc(),x=zc();v===M&&I===x||(m({width:Number(x),height:Number(M)}),v=M,I=x)}),200)),g)}(e,{win:r}),l=function({inputCb:m,doc:g,mirror:v,blockClass:I,blockSelector:M,ignoreClass:x,ignoreSelector:U,maskInputOptions:A,maskInputFn:E,sampling:L,userTriggeredOnInput:O}){function S(B){let j=Zt(B);const C=B.isTrusted,D=j&&j.tagName;if(j&&D==="OPTION"&&(j=V.parentElement(j)),!j||!D||Ef.indexOf(D)<0||ve(j,I,M,!0)||j.classList.contains(x)||U&&j.matches(U))return;let K=j.value,$=!1;const he=Di(j)||"";he==="radio"||he==="checkbox"?$=j.checked:(A[D.toLowerCase()]||A[he])&&(K=Ti({element:j,maskInputOptions:A,tagName:D,type:he,value:K,maskInputFn:E})),N(j,O?{text:K,isChecked:$,userTriggered:C}:{text:K,isChecked:$});const ct=j.name;he==="radio"&&ct&&$&&g.querySelectorAll(`input[type="radio"][name="${ct}"]`).forEach(Se=>{if(Se!==j){const _e=Se.value;N(Se,O?{text:_e,isChecked:!$,userTriggered:!1}:{text:_e,isChecked:!$})}})}function N(B,j){const C=Pa.get(B);if(!C||C.text!==j.text||C.isChecked!==j.isChecked){Pa.set(B,j);const D=v.getId(B);G(m)({...j,id:D})}}const P=(L.input==="last"?["change"]:["input","change"]).map(B=>ye(B,G(S),g)),b=g.defaultView;if(!b)return()=>{P.forEach(B=>B())};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&&P.push(...T.map(B=>Yn(B[0],B[1],{set(){G(S)({target:this,isTrusted:!1})}},!1,b))),G(()=>{P.forEach(B=>B())})}(e),c=function({mediaInteractionCb:m,blockClass:g,blockSelector:v,mirror:I,sampling:M,doc:x}){const U=G(E=>Ht(G(L=>{const O=Zt(L);if(!O||ve(O,g,v,!0))return;const{currentTime:S,volume:N,muted:P,playbackRate:b,loop:w}=O;m({type:E,id:I.getId(O),currentTime:S,volume:N,muted:P,playbackRate:b,loop:w})}),M.media||500)),A=[ye("play",U(Ct.Play),x),ye("pause",U(Ct.Pause),x),ye("seeked",U(Ct.Seeked),x),ye("volumechange",U(Ct.VolumeChange),x),ye("ratechange",U(Ct.RateChange),x)];return G(()=>{A.forEach(E=>E())})}(e);let u=()=>{},d=()=>{},p=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:m,mirror:g,stylesheetManager:v},{win:I}){if(!I.CSSStyleSheet||!I.CSSStyleSheet.prototype)return()=>{};const M=I.CSSStyleSheet.prototype.insertRule;I.CSSStyleSheet.prototype.insertRule=new Proxy(M,{apply:G((O,S,N)=>{const[P,b]=N,{id:w,styleId:T}=tt(S,g,v.styleMirror);return(w&&w!==-1||T&&T!==-1)&&m({id:w,styleId:T,adds:[{rule:P,index:b}]}),O.apply(S,N)})}),I.CSSStyleSheet.prototype.addRule=function(O,S,N=this.cssRules.length){const P=`${O} { ${S} }`;return I.CSSStyleSheet.prototype.insertRule.apply(this,[P,N])};const x=I.CSSStyleSheet.prototype.deleteRule;let U,A;I.CSSStyleSheet.prototype.deleteRule=new Proxy(x,{apply:G((O,S,N)=>{const[P]=N,{id:b,styleId:w}=tt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,removes:[{index:P}]}),O.apply(S,N)})}),I.CSSStyleSheet.prototype.removeRule=function(O){return I.CSSStyleSheet.prototype.deleteRule.apply(this,[O])},I.CSSStyleSheet.prototype.replace&&(U=I.CSSStyleSheet.prototype.replace,I.CSSStyleSheet.prototype.replace=new Proxy(U,{apply:G((O,S,N)=>{const[P]=N,{id:b,styleId:w}=tt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,replace:P}),O.apply(S,N)})})),I.CSSStyleSheet.prototype.replaceSync&&(A=I.CSSStyleSheet.prototype.replaceSync,I.CSSStyleSheet.prototype.replaceSync=new Proxy(A,{apply:G((O,S,N)=>{const[P]=N,{id:b,styleId:w}=tt(S,g,v.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,replaceSync:P}),O.apply(S,N)})}));const E={};Vr("CSSGroupingRule")?E.CSSGroupingRule=I.CSSGroupingRule:(Vr("CSSMediaRule")&&(E.CSSMediaRule=I.CSSMediaRule),Vr("CSSConditionRule")&&(E.CSSConditionRule=I.CSSConditionRule),Vr("CSSSupportsRule")&&(E.CSSSupportsRule=I.CSSSupportsRule));const L={};return Object.entries(E).forEach(([O,S])=>{L[O]={insertRule:S.prototype.insertRule,deleteRule:S.prototype.deleteRule},S.prototype.insertRule=new Proxy(L[O].insertRule,{apply:G((N,P,b)=>{const[w,T]=b,{id:B,styleId:j}=tt(P.parentStyleSheet,g,v.styleMirror);return(B&&B!==-1||j&&j!==-1)&&m({id:B,styleId:j,adds:[{rule:w,index:[...jr(P),T||0]}]}),N.apply(P,b)})}),S.prototype.deleteRule=new Proxy(L[O].deleteRule,{apply:G((N,P,b)=>{const[w]=b,{id:T,styleId:B}=tt(P.parentStyleSheet,g,v.styleMirror);return(T&&T!==-1||B&&B!==-1)&&m({id:T,styleId:B,removes:[{index:[...jr(P),w]}]}),N.apply(P,b)})})}),G(()=>{I.CSSStyleSheet.prototype.insertRule=M,I.CSSStyleSheet.prototype.deleteRule=x,U&&(I.CSSStyleSheet.prototype.replace=U),A&&(I.CSSStyleSheet.prototype.replaceSync=A),Object.entries(E).forEach(([O,S])=>{S.prototype.insertRule=L[O].insertRule,S.prototype.deleteRule=L[O].deleteRule})})}(e,{win:r}),d=Xc(e,e.doc),p=function({styleDeclarationCb:m,mirror:g,ignoreCSSAttributes:v,stylesheetManager:I},{win:M}){const x=M.CSSStyleDeclaration.prototype.setProperty;M.CSSStyleDeclaration.prototype.setProperty=new Proxy(x,{apply:G((A,E,L)=>{var O;const[S,N,P]=L;if(v.has(S))return x.apply(E,[S,N,P]);const{id:b,styleId:w}=tt((O=E.parentRule)==null?void 0:O.parentStyleSheet,g,I.styleMirror);return(b&&b!==-1||w&&w!==-1)&&m({id:b,styleId:w,set:{property:S,value:N,priority:P},index:jr(E.parentRule)}),A.apply(E,L)})});const U=M.CSSStyleDeclaration.prototype.removeProperty;return M.CSSStyleDeclaration.prototype.removeProperty=new Proxy(U,{apply:G((A,E,L)=>{var O;const[S]=L;if(v.has(S))return U.apply(E,[S]);const{id:N,styleId:P}=tt((O=E.parentRule)==null?void 0:O.parentStyleSheet,g,I.styleMirror);return(N&&N!==-1||P&&P!==-1)&&m({id:N,styleId:P,remove:{property:S},index:jr(E.parentRule)}),A.apply(E,L)})}),G(()=>{M.CSSStyleDeclaration.prototype.setProperty=x,M.CSSStyleDeclaration.prototype.removeProperty=U})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:m,doc:g}){const v=g.defaultView;if(!v)return()=>{};const I=[],M=new WeakMap,x=v.FontFace;v.FontFace=function(A,E,L){const O=new x(A,E,L);return M.set(O,{family:A,buffer:typeof E!="string",descriptors:L,fontSource:typeof E=="string"?E:JSON.stringify(Array.from(new Uint8Array(E)))}),O};const U=At(g.fonts,"add",function(A){return function(E){return setTimeout(G(()=>{const L=M.get(E);L&&(m(L),M.delete(E))}),0),A.apply(this,[E])}});return I.push(()=>{v.FontFace=x}),I.push(U),G(()=>{I.forEach(A=>A())})}(e)));const y=function(m){const{doc:g,mirror:v,blockClass:I,blockSelector:M,selectionCb:x}=m;let U=!0;const A=G(()=>{const E=g.getSelection();if(!E||U&&(E!=null&&E.isCollapsed))return;U=E.isCollapsed||!1;const L=[],O=E.rangeCount||0;for(let S=0;S<O;S++){const N=E.getRangeAt(S),{startContainer:P,startOffset:b,endContainer:w,endOffset:T}=N;ve(P,I,M,!0)||ve(w,I,M,!0)||L.push({start:v.getId(P),startOffset:b,end:v.getId(w),endOffset:T})}x({ranges:L})});return A(),ye("selectionchange",A)}(e),h=function({doc:m,customElementCb:g}){const v=m.defaultView;return v&&v.customElements?At(v.customElements,"define",function(I){return function(M,x,U){try{g({define:{name:M}})}catch{console.warn(`Custom element callback failed for ${M}`)}return I.apply(this,[M,x,U])}}):()=>{}}(e),k=[];for(const m of e.plugins)k.push(m.observer(m.callback,r,m.options));return G(()=>{pt.forEach(m=>m.reset()),n==null||n.disconnect(),s(),i(),a(),o(),l(),c(),u(),d(),p(),f(),y(),h(),k.forEach(m=>m())})}function Wr(e){return window[e]!==void 0}function Vr(e){return!!(window[e]!==void 0&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class _a{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 Rf{constructor(t){R(this,"iframes",new WeakMap),R(this,"crossOriginIframeMap",new WeakMap),R(this,"crossOriginIframeMirror",new _a(Rl)),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 _a(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:H.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 H.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 H.Drag:case H.TouchMove:case H.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case H.ViewportResize:return!1;case H.MediaInteraction:case H.MouseInteraction:case H.Scroll:case H.CanvasMutation:case H.Input:return this.replaceIds(r.data,t,["id"]),r;case H.StyleSheetRule:case H.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case H.Font:return r;case H.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),r;case H.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 Lf{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(!Xt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=qc({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Jc({...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(V.host(t))),this.restoreHandlers.push(Xc({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(At(t.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i),o=V.shadowRoot(this);return o&&Yc(this)&&n.addShadowRoot(o,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Of=typeof Uint8Array>"u"?[]:new Uint8Array(256),Hr=0;Hr<64;Hr++)Of[Gt.charCodeAt(Hr)]=Hr;const Na=new Map,Kc=(e,t,r)=>{if(!e||!Qc(e,t)&&typeof e!="object")return;const n=function(i,a){let o=Na.get(i);return o||(o=new Map,Na.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 ln(e,t,r){if(e instanceof Array)return e.map(n=>ln(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+=Gt[i[s]>>2],o+=Gt[(3&i[s])<<4|i[s+1]>>4],o+=Gt[(15&i[s+1])<<2|i[s+2]>>6],o+=Gt[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:[ln(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:[ln(e.data,t,r),e.width,e.height]}:Qc(e,t)||typeof e=="object"?{rr_type:e.constructor.name,index:Kc(e,t,r)}:e}const Zc=(e,t,r)=>e.map(n=>ln(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 Fa(e,t,r,n){const s=[];try{const i=At(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(o,...l){if(!ve(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 Ba(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=At(e,l,function(u){return function(...d){const p=u.apply(this,d);if(Kc(p,i,this),"tagName"in this.canvas&&!ve(this.canvas,n,s,!0)){const f=Zc(d,i,this),y={type:t,property:l,args:f};r(this.canvas,y)}return p}});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 eu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",za=typeof window<"u"&&window.Blob&&new Blob([(ja=eu,Uint8Array.from(atob(ja),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var ja;function Af(e){let t;try{if(t=za&&(window.URL||window.webkitURL).createObjectURL(za),!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,"+eu,{name:e==null?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Mf{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=Fa(r,n,s,!0),o=new Map,l=new Af;l.onmessage=f=>{const{id:y}=f.data;if(o.set(y,!1),!("base64"in f.data))return;const{base64:h,type:k,width:m,height:g}=f.data;this.mutationCb({id:y,type:It["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:k}]},0,0]}]})};const c=1e3/t;let u,d=0;const p=f=>{d&&f-d<c||(d=f,(()=>{const y=[];return r.document.querySelectorAll("canvas").forEach(h=>{ve(h,n,s,!0)||y.push(h)}),y})().forEach(async y=>{var h;const k=this.mirror.getId(y);if(o.get(k)||y.width===0||y.height===0)return;if(o.set(k,!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:k,bitmap:m,width:y.width,height:y.height,dataURLOptions:i.dataURLOptions},[m])})),u=requestAnimationFrame(p)};u=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Fa(t,r,n,!1),i=function(o,l,c,u){const d=[],p=Object.getOwnPropertyNames(l.CanvasRenderingContext2D.prototype);for(const f of p)try{if(typeof l.CanvasRenderingContext2D.prototype[f]!="function")continue;const y=At(l.CanvasRenderingContext2D.prototype,f,function(h){return function(...k){return ve(this.canvas,c,u,!0)||setTimeout(()=>{const m=Zc(k,l,this);o(this.canvas,{type:It["2D"],property:f,args:m})},0),h.apply(this,k)}});d.push(y)}catch{const y=Yn(l.CanvasRenderingContext2D.prototype,f,{set(h){o(this.canvas,{type:It["2D"],property:f,args:[h],setter:!0})}});d.push(y)}return()=>{d.forEach(f=>f())}}(this.processMutation.bind(this),t,r,n),a=function(o,l,c,u){const d=[];return d.push(...Ba(l.WebGLRenderingContext.prototype,It.WebGL,o,c,u,l)),l.WebGL2RenderingContext!==void 0&&d.push(...Ba(l.WebGL2RenderingContext.prototype,It.WebGL2,o,c,u,l)),()=>{d.forEach(p=>p())}}(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 Uf{constructor(t){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new bf),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:El(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 Tf{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 le,cn,hs,bn=!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 Oe=new xl;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:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:y,maskTextFn:h,hooks:k,packFn:m,sampling:g={},dataURLOptions:v={},mousemoveWait:I,recordDOM:M=!0,recordCanvas:x=!1,recordCrossOriginIframes:U=!1,recordAfter:A=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:E=!1,collectFonts:L=!1,inlineImages:O=!1,plugins:S,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:P=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()=>{};I!==void 0&&g.mousemove===void 0&&(g.mousemove=I),Oe.reset();const B=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},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 C;(function(W=window){"NodeList"in W&&!W.NodeList.prototype.forEach&&(W.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in W&&!W.DOMTokenList.prototype.forEach&&(W.DOMTokenList.prototype.forEach=Array.prototype.forEach)})();let D=0;const K=W=>{for(const Le of S||[])Le.eventProcessor&&(W=Le.eventProcessor(W));return m&&!T&&(W=m(W)),W};le=(W,Le)=>{var re;const ie=W;if(ie.timestamp=vn(),!((re=pt[0])!=null&&re.isFrozen())||ie.type===Y.FullSnapshot||ie.type===Y.IncrementalSnapshot&&ie.data.source===H.Mutation||pt.forEach(xe=>xe.unfreeze()),w)t==null||t(K(ie),Le);else if(T){const xe={type:"rrweb",event:K(ie),origin:window.location.origin,isCheckout:Le};window.parent.postMessage(xe,"*")}if(ie.type===Y.FullSnapshot)C=ie,D=0;else if(ie.type===Y.IncrementalSnapshot){if(ie.data.source===H.Mutation&&ie.data.isAttachIframe)return;D++;const xe=n&&D>=n,q=r&&ie.timestamp-C.timestamp>r;(xe||q)&&cn(!0)}};const $=W=>{le({type:Y.IncrementalSnapshot,data:{source:H.Mutation,...W}})},he=W=>le({type:Y.IncrementalSnapshot,data:{source:H.Scroll,...W}}),ct=W=>le({type:Y.IncrementalSnapshot,data:{source:H.CanvasMutation,...W}}),Se=new Uf({mutationCb:$,adoptedStyleSheetCb:W=>le({type:Y.IncrementalSnapshot,data:{source:H.AdoptedStyleSheet,...W}})}),_e=new Rf({mirror:Oe,mutationCb:$,stylesheetManager:Se,recordCrossOriginIframes:U,wrappedEmit:le});for(const W of S||[])W.getMirror&&W.getMirror({nodeMirror:Oe,crossOriginIframeMirror:_e.crossOriginIframeMirror,crossOriginIframeStyleMirror:_e.crossOriginIframeStyleMirror});const qn=new Tf;hs=new Mf({recordCanvas:x,mutationCb:ct,win:window,blockClass:s,blockSelector:i,mirror:Oe,sampling:g.canvas,dataURLOptions:v});const br=new Lf({mutationCb:$,scrollCb:he,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:B,dataURLOptions:v,maskTextFn:h,maskInputFn:y,recordCanvas:x,inlineImages:O,sampling:g,slimDOMOptions:j,iframeManager:_e,stylesheetManager:Se,canvasManager:hs,keepIframeSrcFn:N,processedNodeManager:qn},mirror:Oe});cn=(W=!1)=>{if(!M)return;le({type:Y.Meta,data:{href:window.location.href,width:zc(),height:Bc()}},W),Se.reset(),br.init(),pt.forEach(re=>re.lock());const Le=function(re,ie){const{mirror:xe=new xl,blockClass:q="rr-block",blockSelector:Dt=null,maskTextClass:od="rr-mask",maskTextSelector:ad=null,inlineStylesheet:ld=!0,inlineImages:cd=!1,recordCanvas:ud=!1,maskAllInputs:Jn=!1,maskTextFn:dd,maskInputFn:pd,slimDOM:Pt=!1,dataURLOptions:hd,preserveWhiteSpace:md,onSerialize:fd,onIframeLoad:gd,iframeLoadTimeout:yd,onStylesheetLoad:wd,stylesheetLoadTimeout:vd,keepIframeSrcFn:bd=()=>!1}=ie||{};return kt(re,{doc:re,mirror:xe,blockClass:q,blockSelector:Dt,maskTextClass:od,maskTextSelector:ad,skipChild:!1,inlineStylesheet:ld,maskInputOptions:Jn===!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}:Jn===!1?{password:!0}:Jn,maskTextFn:dd,maskInputFn:pd,slimDOMOptions:Pt===!0||Pt==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:Pt==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:Pt===!1?{}:Pt,dataURLOptions:hd,inlineImages:cd,recordCanvas:ud,preserveWhiteSpace:md,onSerialize:fd,onIframeLoad:gd,iframeLoadTimeout:yd,onStylesheetLoad:wd,stylesheetLoadTimeout:vd,keepIframeSrcFn:bd,newlyAddedElement:!1})}(document,{mirror:Oe,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:B,maskTextFn:h,maskInputFn:y,slimDOM:j,dataURLOptions:v,recordCanvas:x,inlineImages:O,onSerialize:re=>{Vc(re,Oe)&&_e.addIframe(re),Hc(re,Oe)&&Se.trackLinkElement(re),ai(re)&&br.addShadowRoot(V.shadowRoot(re),document)},onIframeLoad:(re,ie)=>{_e.attachIframe(re,ie),br.observeAttachShadow(re)},onStylesheetLoad:(re,ie)=>{Se.attachLinkElement(re,ie)},keepIframeSrcFn:N});if(!Le)return console.warn("Failed to snapshot the document");le({type:Y.FullSnapshot,data:{node:Le,initialOffset:Fc(window)}},W),pt.forEach(re=>re.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Se.adoptStyleSheets(document.adoptedStyleSheets,Oe.getId(document))};try{const W=[],Le=ie=>{var xe;return G(xf)({mutationCb:$,mousemoveCb:(q,Dt)=>le({type:Y.IncrementalSnapshot,data:{source:Dt,positions:q}}),mouseInteractionCb:q=>le({type:Y.IncrementalSnapshot,data:{source:H.MouseInteraction,...q}}),scrollCb:he,viewportResizeCb:q=>le({type:Y.IncrementalSnapshot,data:{source:H.ViewportResize,...q}}),inputCb:q=>le({type:Y.IncrementalSnapshot,data:{source:H.Input,...q}}),mediaInteractionCb:q=>le({type:Y.IncrementalSnapshot,data:{source:H.MediaInteraction,...q}}),styleSheetRuleCb:q=>le({type:Y.IncrementalSnapshot,data:{source:H.StyleSheetRule,...q}}),styleDeclarationCb:q=>le({type:Y.IncrementalSnapshot,data:{source:H.StyleDeclaration,...q}}),canvasMutationCb:ct,fontCb:q=>le({type:Y.IncrementalSnapshot,data:{source:H.Font,...q}}),selectionCb:q=>{le({type:Y.IncrementalSnapshot,data:{source:H.Selection,...q}})},customElementCb:q=>{le({type:Y.IncrementalSnapshot,data:{source:H.CustomElement,...q}})},blockClass:s,ignoreClass:a,ignoreSelector:o,maskTextClass:l,maskTextSelector:c,maskInputOptions:B,inlineStylesheet:u,sampling:g,recordDOM:M,recordCanvas:x,inlineImages:O,userTriggeredOnInput:E,collectFonts:L,doc:ie,maskInputFn:y,maskTextFn:h,keepIframeSrcFn:N,blockSelector:i,slimDOMOptions:j,dataURLOptions:v,mirror:Oe,iframeManager:_e,stylesheetManager:Se,shadowDomManager:br,processedNodeManager:qn,canvasManager:hs,ignoreCSSAttributes:P,plugins:((xe=S==null?void 0:S.filter(q=>q.observer))==null?void 0:xe.map(q=>({observer:q.observer,options:q.options,callback:Dt=>le({type:Y.Plugin,data:{plugin:q.name,payload:Dt}})})))||[]},k)};_e.addLoadListener(ie=>{try{W.push(Le(ie.contentDocument))}catch(xe){console.warn(xe)}});const re=()=>{cn(),W.push(Le(document)),bn=!0};return document.readyState==="interactive"||document.readyState==="complete"?re():(W.push(ye("DOMContentLoaded",()=>{le({type:Y.DomContentLoaded,data:{}}),A==="DOMContentLoaded"&&re()})),W.push(ye("load",()=>{le({type:Y.Load,data:{}}),A==="load"&&re()},window))),()=>{W.forEach(ie=>ie()),qn.destroy(),bn=!1,Kt=void 0}}catch(W){console.warn(W)}}var Wa,bt;Yt.addCustomEvent=(e,t)=>{if(!bn)throw new Error("please add custom event after start recording");le({type:Y.Custom,data:{tag:e,payload:t}})},Yt.freezePage=()=>{pt.forEach(e=>e.freeze())},Yt.takeFullSnapshot=e=>{if(!bn)throw new Error("please take full snapshot after start recording");cn(e)},Yt.mirror=Oe,(bt=Wa||(Wa={}))[bt.NotStarted=0]="NotStarted",bt[bt.Running=1]="Running",bt[bt.Stopped=2]="Stopped";var Ae=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.FeedbackClosed="feedback.closed",e.PageChange="page.change",e.API="api",e.Override="override",e))(Ae||{}),F=(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))(F||{});const dr={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 Gr;const Df=new Uint8Array(16);function Pf(){if(!Gr&&(Gr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gr(Df)}const fe=[];for(let e=0;e<256;++e)fe.push((e+256).toString(16).slice(1));const Va={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function yt(e,t,r){if(Va.randomUUID&&!e)return Va.randomUUID();const n=(e=e||{}).random||(e.rng||Pf)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(s,i=0){return fe[s[i+0]]+fe[s[i+1]]+fe[s[i+2]]+fe[s[i+3]]+"-"+fe[s[i+4]]+fe[s[i+5]]+"-"+fe[s[i+6]]+fe[s[i+7]]+"-"+fe[s[i+8]]+fe[s[i+9]]+"-"+fe[s[i+10]]+fe[s[i+11]]+fe[s[i+12]]+fe[s[i+13]]+fe[s[i+14]]+fe[s[i+15]]}(n)}const _=new class{constructor(){ue(this,"breadcrumbs",[])}getTimeStamp(){return new Date().toISOString()}addBreadcrumb(e){{const{data:t,message:r}=e,n=t&&Object.keys(t).length?t:null;n?console.info(r,n):console.info(r)}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"})}},Ha=()=>{try{return window.parent.Intercom}catch{return null}},Ga=[Object.freeze(Object.defineProperty({__proto__:null,disable:()=>{const e=Ha();e&&(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},enable:()=>{const e=Ha();e&&(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)}},Symbol.toStringTag,{value:"Module"}))];class tu{static disable(){Ga.forEach(t=>t.disable())}static enable(){Ga.forEach(t=>t.enable())}}var _f=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"}},ru=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=ru.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 _f(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)}},nu=ru;nu.defaultMaxListeners=10;const z=new nu,Sn=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 su{constructor(t){ue(this,"storage");ue(this,"tempStorage",{});ue(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 ce=new su("sessionStorage"),Ce=new su("localStorage");class Nf{constructor(t){ue(this,"payload");ue(this,"promise");ue(this,"reject",()=>{});ue(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((r,n)=>{this.reject=n,this.resolve=r})}resolveRequest(t){this.resolve(t)}}const te={replay:null},Ff=()=>{const e=[];return te.replay&&e.push("replay"),e.join(",")},Bf=10;let iu=!1,ou="",Yr=!1,au=!1,un=[];const zf=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?"web-gtm":e._segment?"web-segment":"web-snippet",Ya=e=>{var t;(t=e==null?void 0:e.blockedURI)!=null&&t.includes(window.UserLeap._API_URL)&&(au=!0,console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`))},ci=(e="")=>{iu=!0,ou=e};function Te(e={}){const t={"Content-Type":"application/json","userleap-platform":"web","x-ul-sdk-version":"2.36.0","x-ul-installation-method":zf(e),"sprig-modules":Ff(),"x-ul-package-version":"2.36.0"};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 $a=async({shouldDropOnRateLimit:e,...t})=>{if(e)return{status:429};{const r=new Nf(t);return un.push(r),r.promise}},He=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 $a(a);const o={ok:!1,reportError:!1};if(iu)return console.info(`UserLeap - ${ou}`),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")):Bf;return await Sn(1e3*c),He(e,{...i,shouldDropOnRateLimit:n,shouldRetryRequest:!0})}return $a(a)}if(Yr=!1,un.length&&(un.map(c=>{const u=c.payload;He(u.url,{...u.options,retries:u.retries,shouldDropOnRateLimit:u.shouldDropOnRateLimit}).then(d=>{c.resolveRequest(d)})}),un=[]),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||au?{ok:!1,reportError:!1,error:l}:(await Sn(1e3*Math.pow(2,r)),He(e,{...i,retries:c}))}},qa="ul-view-sdk-script",jf=["ios","android"],nt="visitors",st="environments";async function ze(e,t){var i,a,o;const{shouldDropOnRateLimit:r,...n}=t;n.headers=Object.assign(Te(window.UserLeap),n.headers);const s=await He(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,d=(a=s.headers)==null?void 0:a.get("x-ul-visitor-id");if(window.UserLeap.userId&&d===window.UserLeap.visitorId){const p=Ce.getItemObject("sprig.anon.env.vid.map");p&&p[window.UserLeap.envId]===d&&(delete p[window.UserLeap.envId],Ce.setItemObject("sprig.anon.env.vid.map",p))}u&&d&&(d!==window.UserLeap.visitorId||window.UserLeap.token!==u)&&(Ie("token",u),Ie("vid",d),z.emit(F.VisitorIDUpdated,{visitorId:d}),window.UserLeap.token=u,window.UserLeap.visitorId=d)}return(o=s.json)!=null&&o.logMessage&&console.warn(`[Sprig] ${s.json.logMessage}`),s}function Ie(e,t){const r=Ce.getItemObject("userleap.ids");let n=r[window.UserLeap.envId];n?n[e]=t:n={[e]:t},r[window.UserLeap.envId]=n,Ce.setItemObject("userleap.ids",r)}function to(){return window.previewMode?"0":window.UserLeap.visitorId??""}function Me(e,t,r){const n=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(s=>{n.push(s),s===st?n.push(window.UserLeap.envId):s===nt&&n.push(to())}),r&&n.push(r),n.join("/")}const Qt=async(e,t,r)=>{var T,B,j;const{context:n,delay:s,forceBrandedLogo:i,endCard:a,isFeedback:o=!1,heatmap:l,locale:c,previewMode:u,productConfig:d,questions:p,responseGroupUid:f,surveyId:y,uuid:h,vid:k,sessionReplay:m,studyType:g}=e,v=Te(window.UserLeap),I=pr(v),M=$n(v);if(m)if(I)z.emit(F.ReplayCapture,{responseGroupUid:f,hasQuestions:!!(p!=null&&p.length),surveyId:y,uploadId:m.uploadId,replayType:m.replayDurationType??"before",seconds:m.replayDurationSeconds,generateVideoUploadUrlPayload:{mediaRecordingUid:yt(),mediaType:"screen",questionId:1,responseGroupUid:f,surveyId:y,updatedAt:new Date().toISOString(),visitorId:window.UserLeap.visitorId,isReplay:!0}});else{if(!te.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};te.replay.scheduleOrCaptureReplay({responseGroupId:f,surveyId:y,visitorId:k,replayParams:m,completeUploadHeaders:v,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:p.length===0})}if(l){if(!te.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};const{eventId:C,replayParams:D,responseGroupUid:K,surveyId:$}=l;await te.replay.initializeReplay({maxReplayDurationSeconds:300,maxInflightRequests:window.UserLeap.maxInflightReplayRequests,teardownAfter:!0,apiUrl:window.UserLeap._API_URL,replaySettings:r}),te.replay.tryReplayAction(()=>{var he;return(he=te.replay)==null?void 0:he.scheduleCapture({apiUrl:window.UserLeap._API_URL,completeUploadHeaders:v,eventId:C,isHeatmap:!0,replayParams:D,responseGroupId:K,surveyId:$,triggerTimestamp:Date.now(),visitorId:k})},"Error in scheduling/capturing replay")}if(k==null||!(p!=null&&p.length))return _.info("CannotDisplaySurvey",{vid:k}),{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(Wf(p))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:"no survey"};if(window.UserLeap.container){_.info("AlreadyDisplayingSurvey");const C="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(C),{success:!1,message:C,surveyState:"no survey"}}if(k!==window.UserLeap.visitorId&&h!==window.UserLeap.visitorId&&!window.previewMode){const C="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(C)),{success:!1,message:C,surveyState:"no survey"}}_.info("ShowingSurvey",{surveyId:y}),(T=te.replay)==null||T.RecordSurveyShown({id:y,userAgent:window.navigator.userAgent}),tu.disable(),z.emit(F.SurveyWillPresent,{name:F.SurveyWillPresent,"survey.id":y});let x,U,A,E,L=document.createElement("div");const O=C=>{const{"view.version":D}=C;D!==v["x-ul-sdk-version"]&&cu(),z.removeListener("verify.view.version",O)};z.on("verify.view.version",O),window.UserLeap.useMobileStyling=M,eo(v)?(x="ul-direct-embeded-frame",U=document.head,A=window,E=!1,(()=>{const C=Te(window.UserLeap),D=pr(C),K=window.UserLeap.forceDirectEmbed,$=C["userleap-platform"]==="web";return D||K&&$})()&&(lu(y,o),L.id=x,window.UserLeap.container.appendChild(L),uu(),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.SurveyPresented,"survey.id":y}))):{frameId:x,contentWinDocHead:U,contentWindow:A,hasOverlay:E,iframe:L}=Hf({productConfig:d,useMobileStyling:M,surveyId:y,isFeedback:o}),window.UserLeap.frameId=x;const S={apiURL:window.UserLeap._API_URL,cards:p,configureExitOnOverlayClick:C=>{z.once(F.CloseSurveyOnOverlayClick,C)},context:n,endCard:a,envId:window.UserLeap.envId,eventEmitFn:z.emit.bind(z),fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,forceBrandedLogo:i,frame:L,headers:v,locale:c,mobileSDKVersion:window.UserLeap.mobileSDKVersion,previewKey:Ce.getItem("sprig.previewKey"),previewMode:u,productConfig:{framePosition:d==null?void 0:d.framePosition,desktopDisplay:d==null?void 0:d.desktopDisplay,placement:d==null?void 0:d.placement},responseGroupUid:f,startingQuestionIdx:(B=window.UserLeap.config)==null?void 0:B.startingQuestionIdx,studyType:g,styleNonce:window.UserLeap.styleNonce,surveyId:y,tabTitle:document.title,trackPageViewUrl:t,ulEvents:dr,upchunkLibraryURL:window.UserLeap.upchunkLibraryURL,useMobileStyling:M,userId:h,viewDocument:A==null?void 0:A.document,viewWindow:A,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 N=(o?window.UserLeap.feedbackCustomStyles:window.UserLeap.customStyles)??d.customStyles;S.customStyles=N,A&&(A.__cfg=S),window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:S.path;const P=document.getElementById(qa);P&&P.remove();const b=function(){const C=document.createElement("script");return window.UserLeap.nonce&&C.setAttribute("nonce",window.UserLeap.nonce),C.id=qa,C}();S.installationMethod==="web-npm"||S.installationMethod;{const{default:C}=await Promise.resolve().then(()=>require("./view-DtYclioL.cjs"));C.configure(S),E&&window.UserLeap.container&&window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})}U==null||U.appendChild(b);const w={success:!0,surveyState:"ready",surveyId:y,responseGroupUid:f};return window.UserLeap.isMobileSDK&&s&&(w.delay=s),w};function $n(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 pr(e)||t>10&&t<500}function pr(e){return jf.includes(e["userleap-platform"])}const Wf=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",lu=(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=mu();r&&n&&!window.UserLeap.useMobileStyling?n.appendChild(window.UserLeap.container):document.body.appendChild(window.UserLeap.container)},cu=(e,t)=>{var n;Yf();const r=window.UserLeap.container;if(r)try{(n=r.parentNode)==null||n.removeChild(r),window.UserLeap.container=null,Ie("trackStartUrl",null),z.emit(F.SurveyLifeCycle,{state:"dismissed"}),z.emit(F.SurveyClosed,{name:F.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)}},uu=()=>{z.once(F.SurveyWillClose,({initiator:e,studyType:t})=>{z.removeAllListeners(F.CloseSurveyOnOverlayClick),cu(e,t)})},Vf=(e,t,r,n)=>{var u,d;const s={position:"fixed",bottom:"0px",right:ms,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646,transition:"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%",(d=window.UserLeap.windowDimensions)!=null&&d.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 p=()=>{c=!0,l={margin:"auto",position:"static"}};if(n)o?p():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":p()}}return c&&((p,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?p.overlayStyleMobile:p.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},Hf=({productConfig:e,useMobileStyling:t,surveyId:r,isFeedback:n})=>{var p,f;const s=ro,i=n&&e.desktopDisplay==="slider";lu(r,n,i),Gf();const a=document.createElement("iframe");a.id=s,a.setAttribute("title","Sprig User Feedback Dialog");const o=Vf(a,e,t,n);uu();let l=!1;a.setHeight=y=>{parseInt(a.style.height)==y&&l||(l=!0,a.style.height=`${y}px`,z.emit(F.SurveyHeight,{name:F.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(F.SurveyWidth,{name:F.SurveyWidth,contentFrameWidth:y,"survey.id":r}))},(p=window.UserLeap.container)==null||p.appendChild(a),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{z.emit(F.CloseSurveyOnOverlayClick)}),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.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 d=u==null?void 0:u.head;return{frameId:s,contentWinDocHead:d,contentWindow:a.contentWindow,hasOverlay:o,iframe:a}},du={[F.SurveyFadingOut]:()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}},Gf=()=>{Object.entries(du).forEach(([e,t])=>{z.on(e,t)})},Yf=()=>{Object.entries(du).forEach(([e,t])=>{z.off(e,t)})},Ja=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?Ja[r]:Ja.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 pu=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)},Be=e=>!!e&&e.nodeType===Node.ELEMENT_NODE,Xa=e=>e instanceof HTMLElement||e instanceof SVGElement,hr=({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)},$f=(e,t)=>{const r=t.querySelector(".sprig-question-body");if(!Be(r))return e;const n=r.scrollHeight;return n<100?e:e-(n-100)},Ka=(e,t)=>{const r=t.querySelector(e);if(!Be(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))},hu=(e,t,r)=>{const n=e.querySelector(".ul-card__container"),s=e.querySelector(".ul-app");let i=600,a=360,o=0;if(Be(n)&&Be(s)){const l=n.querySelector(".ul-card--matrix_grid"),c=!l&&t&&r;try{c&&(s.style.width="360px"),i=n.clientHeight,i+=(p=>{const f=p.querySelector(".sprig-question-body"),y=p.querySelector(".ul-card"),h=p.querySelector(".ul-card-main-content"),k=p.querySelector(".ul-footer"),m=p.querySelector(".sprig-container");let g=0;return Be(y)&&(g+=y.scrollHeight-y.clientHeight),Be(h)&&(g+=h.scrollHeight-h.clientHeight),Be(f)&&(g+=f.scrollHeight-f.clientHeight),Be(k)&&Be(m)&&m.clientHeight===0&&(g+=k.clientHeight),g})(e);const u=getComputedStyle(n);o=i;const d=parseFloat(u.marginTop)+parseFloat(u.marginBottom);i+=d+(parseFloat(u.borderTopWidth)+parseFloat(u.borderBottomWidth)),l&&(a=l.scrollWidth,a+=Ka(".ul-card__container",e),a+=Ka(".sprig-question-body",e))}finally{c&&s.style.removeProperty("width")}}return[i+1,a,$f(o,e)]},mu=()=>Z,Rt=()=>document.getElementById("sprig-feedback-container"),ui=()=>document.getElementById("sprig-feedback-loading-animation"),fu=()=>!!document.getElementById(ro);let Za=!1,Z=null,je=null,so=!1,er=null,ut=null;const qf=["bottom-left","bottom-right","center-left","center-right"],In=()=>{var t;const e=window.UserLeap.container;return((t=e==null?void 0:e.parentElement)==null?void 0:t.id)==="sprig-feedback-loading-container"},gu=()=>document.getElementById("sprig-feedback-error-container"),yu=()=>{if(!Z)return 0;const e=Z==null?void 0:Z.clientWidth,t=window.getComputedStyle(Z);return e+parseInt(t.borderRightWidth||"0")+parseInt(t.borderLeftWidth||"0")},Cn=e=>{const t=Rt();t&&(ut!=null&&ut.endsWith("right")?t.style.right=`${e}px`:ut!=null&&ut.endsWith("left")&&(t.style.left=`${e}px`))},fs=()=>{if(Z&&(In()||gu())){z.off(F.SurveyAppeared,$t),di();const e=yu();return Cn(-e),!0}return!1},$t=()=>{if(!Z||!je)return;const e=ui();e&&e.remove(),Z.style.height="auto",Z.style.width="auto",je.disabled=!1,so=!1},di=()=>{if(Z&&!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
62
  <div class="ul-loading-spinner">
57
63
  <div class="first"></div>
58
64
  <div class="second"></div>
59
65
  <div class="third"></div>
60
66
  <div class="fourth"></div>
61
67
  </div>
62
- `,t})();e&&(K.style.height="300px",K.style.width="360px",K.appendChild(e))}},Za=()=>{K&&We&&(Cn(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 d=Rt();if(d){if(!t&&i===er)return;d.remove(),j.off(dr.SURVEY_FADING_OUT,fs)}er=i,hr({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}),hr({document,elementId:"ul-custom-style",styleString:s??"",nonce:window.UserLeap.styleNonce}),Xa=o==="center-modal",ut=a;const[p,f]=a.split("-");(m=>{if(Rt()||!zf.includes(m))return;const[g,v]=m.split("-"),I=document.createElement("div");I.id="sprig-feedback-container",I.classList.add(`sprig-feedback-container-${v}`,`sprig-feedback-container-${g}`),document.body.appendChild(I)})(a),d=Rt(),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-${p}`,`sprig-feedback-button-${n}`,"fade-in-transition"),j.on(dr.SURVEY_FADING_OUT,fs),We.addEventListener("click",async()=>{const m=document.getElementById("sprig-feedback-error-container");if(du()||pu()){if(fs()){j.emit(B.SurveyCloseRequested,{name:B.SurveyCloseRequested,initiator:Me.FeedbackClosed,studyType:"feedbackButton","survey.id":u}),j.emit(B.SurveyWillClose,{name:B.SurveyWillClose,initiator:Me.FeedbackClosed,studyType:"feedbackButton","survey.id":u});const v=Rt();m&&v&&(v.remove(),er=null,K=null)}return}if(Yn(De(window.UserLeap))||so||Za(),t)return K&&K.classList.add("sprig-feedback-loading-container-previews"),await Qt(t),void Yt();const g=await(async v=>{const I=await je(Ue("1",[st],"startFeedbackStudy"),{body:JSON.stringify({surveyUuid:v}),method:"POST"});return I.ok?I.json:null})(c);if(g)j.once(B.SurveyAppeared,Yt),Qt({...g,studyType:"feedbackButton"},r);else if(K){const v=jf();K.appendChild(v),Yt(),K.style.height="300px",K.style.width="360px"}}),d==null||d.appendChild(We),j.emit(B.FeedbackButtonLoaded,{name:B.FeedbackButtonLoaded,"survey.id":u});const{useMobileStyling:h,_config:{border:C}}=window.UserLeap;if(Xa||h)Cn(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",C),K=m,di(),d==null||d.appendChild(m);const g=hu();Cn(-g)}window.UserLeap._config.isOnQuestionsTab&&t&&!In()&&K&&(Za(),di(),K&&K.classList.add("sprig-feedback-loading-container-previews"),Qt(t),Yt())},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">
68
+ `,t})();e&&(Z.style.height="300px",Z.style.width="360px",Z.appendChild(e))}},Qa=()=>{Z&&je&&(Cn(0),je.disabled=!0,so=!0)},wu=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 d=Rt();if(d){if(!t&&i===er)return;d.remove(),z.off(dr.SURVEY_FADING_OUT,fs)}er=i,hr({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}),hr({document,elementId:"ul-custom-style",styleString:s??"",nonce:window.UserLeap.styleNonce}),Za=o==="center-modal",ut=a;const[p,f]=a.split("-");(m=>{if(Rt()||!qf.includes(m))return;const[g,v]=m.split("-"),I=document.createElement("div");I.id="sprig-feedback-container",I.classList.add(`sprig-feedback-container-${v}`,`sprig-feedback-container-${g}`),document.body.appendChild(I)})(a),d=Rt(),je=document.createElement("button");const y=document.createElement("div");y.className="sprig-feedback-button-label",y.innerText=l,je.appendChild(y),je.id="sprig-feedback-button",je.classList.add(`sprig-feedback-button-${f}`,`sprig-feedback-button-${p}`,`sprig-feedback-button-${n}`,"fade-in-transition"),z.on(dr.SURVEY_FADING_OUT,fs),je.addEventListener("click",async()=>{const m=document.getElementById("sprig-feedback-error-container");if(fu()||gu()){if(fs()){z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:Ae.FeedbackClosed,studyType:"feedbackButton","survey.id":u}),z.emit(F.SurveyWillClose,{name:F.SurveyWillClose,initiator:Ae.FeedbackClosed,studyType:"feedbackButton","survey.id":u});const v=Rt();m&&v&&(v.remove(),er=null,Z=null)}return}if($n(Te(window.UserLeap))||so||Qa(),t)return Z&&Z.classList.add("sprig-feedback-loading-container-previews"),await Qt(t),void $t();const g=await(async v=>{const I=await ze(Me("1",[nt],"startFeedbackStudy"),{body:JSON.stringify({surveyUuid:v}),method:"POST"});return I.ok?I.json:null})(c);if(g)z.once(F.SurveyAppeared,$t),Qt({...g,studyType:"feedbackButton"},r);else if(Z){const v=Jf();Z.appendChild(v),$t(),Z.style.height="300px",Z.style.width="360px"}}),d==null||d.appendChild(je),z.emit(F.FeedbackButtonLoaded,{name:F.FeedbackButtonLoaded,"survey.id":u});const{useMobileStyling:h,_config:{border:k}}=window.UserLeap;if(Za||h)Cn(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",k),Z=m,di(),d==null||d.appendChild(m);const g=yu();Cn(-g)}window.UserLeap._config.isOnQuestionsTab&&t&&!In()&&Z&&(Qa(),di(),Z&&Z.classList.add("sprig-feedback-loading-container-previews"),Qt(t),$t())},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
69
  <circle cx="20" cy="20" r="14.5" stroke="#B0B5B7" stroke-width="3"/>
64
70
  <path d="M20 12L20 21.6" stroke="#B0B5B7" stroke-width="3" stroke-linecap="round"/>
65
71
  <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(){ue(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 dn=new class{constructor(){ue(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(dn);class Wf{constructor(t,r){ue(this,"paused");ue(this,"queue");ue(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,Jt={};class Hf{constructor(t){ue(this,"_values",[]);ue(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=Jt[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 yr={},He=e=>{const t=new Hf(e);return yr[e]=t,t},gu=(e,t)=>{let r=yr[e];return r||(r=He(e)),r.report(t)},Gf=({reportingIntervalSeconds:e,postMetrics:t})=>{e?setInterval(()=>{(async r=>{const n=Object.values(yr).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 kn,En,xn,Rn,Qa,dt={};const Yr=(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 Yr(kn,el(e.addedNodes)),void Yr(En,el(e.removedNodes));case"attributes":return void Yr(xn);case"characterData":return void Yr(Rn)}},Yf=e=>e.forEach($f),Jf=()=>{kn.report(dt[kn.name]||0),En.report(dt[En.name]||0),xn.report(dt[xn.name]||0),Rn.report(dt[Rn.name]||0),dt={}},qf=(e=1e3)=>{kn=He("sdk_mutations_nodes_added"),En=He("sdk_mutations_nodes_removed"),xn=He("sdk_mutations_attributes_changed"),Rn=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)=>{Jt={},hi=!1,s==null||s.forEach(a=>{var o;a.metric in Jt||(Jt[a.metric]=[]),(o=Jt[a.metric])==null||o.push(a)}),mi=i})(r,(s,i)=>{var a,o;if((a=te.replay)!=null&&a.isReplayRecording()){const l=`Value: ${s} on ${i.metric} violated threshold of ${i.type} ${i.value}`;(o=te.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,tr;const Ln={},jt="!email",bu="pageUrl";let gs=window.location.href;function rr(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(In())return;const c=Rt();c&&(lu(er)||(c.remove(),er=null,K=null))})(),ce.getItem("sprig.isCapturingHeatmap")&&((l=(o=te.replay)==null?void 0:o.checkPendingHeatmapsUrl())==null||l.then(c=>{var u;c&&((u=te.replay)==null||u.uploadReadyPendingCaptures(!0))})),!In()&&n&&a&&a!==window.location.href&&e&&Kf.includes(e.type)&&window.UserLeap("dismissActiveSurvey",Me.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=Ce.getItemObject("userleap.ids");return e&&e[window.UserLeap.envId]||{}}function ku(){if(window.previewMode)return;const e=Ce.getItemObject("sprig.anon.env.vid.map")||{},t=e[window.UserLeap.envId];window.UserLeap.visitorId=t||yt(),P.info("NewVid",{vid:window.UserLeap.visitorId}),Ie("vid",window.UserLeap.visitorId),t||(e[window.UserLeap.envId]=window.UserLeap.visitorId,Ce.setItemObject("sprig.anon.env.vid.map",e)),j.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=te.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),rr(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),rr(s),n})(e.replaceState)),["hashchange","popstate"].forEach(t=>window.addEventListener(t,rr,!0))}async function ys(e,t){const r=to();e&&!t&&(window.UserLeap._config.mode=Zf);const n=Yn(De(window.UserLeap)),s=await je(function(i){const a=new URL(Ue("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 Sn(s.json.delay),!s.json.isFeedback)return Qt(s.json,tr,io);{const{feedbackLabel:i,productConfig:a,surveyUuid:o,feedbackCustomStyles:l}=s.json,{buttonTheme:c,placement:u,desktopDisplay:d}=a;mu({customStyles:l,buttonTheme:c,desktopDisplay:d,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(),rr())}const rg=function(e){if(!window.UserLeap)return;const t=async(s={})=>{var m,g,v,I,M;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 d=Ce.getItem("sprig.previewKey")??void 0;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const E="[Sprig] - Skipping tracking without userId";return console.warn(E),{success:!1,message:E,surveyState:"no survey"}}if(!u||u.trim().length===0){u=u?String(u):"";const E="[Sprig] - Invalid event name "+u;return console.warn(E),{success:!1,message:E,surveyState:"no survey"}}const p=tr??window.location.href;o.url||(o.url=p),Ie("trackStartUrl",p),(g=(m=window.UserLeap)==null?void 0:m._config)!=null&&g.optimizelyEnabled&&(pr(De(window.UserLeap))||dn.getAndSetWebOptimizelyExperiments(),o.optimizelyExperiments=Object.assign({},dn.getAllOptimizelyExperiments())),(I=(v=window.UserLeap)==null?void 0:v._config)!=null&&I.launchDarklyEnabled&&(o.launchDarklyFlags=pi.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),a&&(window.UserLeap.partnerAnonymousId=a),l&&(o.eventProperties=l),(M=te.replay)==null||M.RecordEvent({name:u,url:o.url}),P.info("TrackEvent",{eventName:u});const f=window.UserLeap.delayingSurvey||du()?await je(Ue("1",[st],"events/batch"),{body:JSON.stringify({events:[{event:u,metadata:o}],previewKey:d}),method:"POST",shouldDropOnRateLimit:!0}):await je(Ue("1",[st],"events"),{body:JSON.stringify({event:u,metadata:o,previewKey:d}),method:"POST",shouldDropOnRateLimit:!0});if(!f.ok){const E="[Sprig] (ERR-421) Failed to track event";return f.reportError&&(console.warn(E,f.error),f.error&&window.UserLeap.reportError("track",f.error)),{success:!1,message:E,error:f.error,surveyState:"no survey"}}i&&Ie("uid",i),a&&Ie("aid",a);const y=f.json;y.invalidPreviewKey&&Ce.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(E,U){var k,R;let A=!0;return!(U&&((k=E==null?void 0:E.json)!=null&&k.surveyId)&&(window.UserLeap.delayingSurvey=!0,A=await U(E.json.surveyId),window.UserLeap.delayingSurvey=!1,!A))&&((R=E==null?void 0:E.json)!=null&&R.delay&&!window.UserLeap.isMobileSDK&&(window.UserLeap.delayingSurvey=!0,await Sn(E.json.delay),window.UserLeap.delayingSurvey=!1),A)}(f,c)?function(E){if(!window.UserLeap._config.dismissOnPageChange)return!0;const U=new URL(E),A=new URL(tr??window.location.href);return U.hostname===A.hostname&&U.pathname===A.pathname}(p)?Qt(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&&hr({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",Me.Override),ys({surveyId:s},!0)),_previewSurvey(s){window.UserLeap("dismissActiveSurvey",Me.Override),ys({surveyTemplateId:s},!1)},_reviewSurvey(s){window.UserLeap("dismissActiveSurvey",Me.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=Me.API){window.UserLeap.container&&(s===Me.Closed&&window.Sprig.trackHistory&&window.Sprig.trackHistory({event:"closed"}),j.emit(B.SurveyCloseRequested,{name:B.SurveyCloseRequested,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}),j.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[jt]&&(o[jt]=o.email,delete o.email);const u=Object.keys(o);for(const d of u)o[d]===Ln[d]&&delete o[d]}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(Ue("1",[it,st],"attributes"),{body:JSON.stringify(o),method:"PUT"}),c.ok?Object.assign(Ln,o):c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await je(Ue("1",[it,st]),{body:JSON.stringify(l),method:"PUT"}),o&&o[jt]&&(window.UserLeap.email=o[jt]),c.ok&&(i&&Ie("uid",i),a&&Ie("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(Ue("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){j.on(B.SurveyLifeCycle,s)},async removeSurveyListener(s){j.removeListener(B.SurveyLifeCycle,s)},async addListener(s,i){j.on(s,i)},async removeListener(s,i){j.removeListener(s,i)},async removeAllListeners(){j.removeAllListeners()},setPreviewKey(s){s&&typeof s=="string"&&Ce.isStorageAvailable&&s&&Ce.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(Ue("1",[it,st]),{body:JSON.stringify({userId:s}),method:"PUT"});a.ok?(i!==window.UserLeap.visitorId&&((o=te.replay)==null||o.clearUserReplayData()),Ie("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,Ie("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){tr=s,Eu(s,i,a,o)},applyFeedbackStyles({button:s="",view:i=""}){window.UserLeap.feedbackCustomStyles=i,document.getElementById("sprig-feedback-style")&&hr({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 p,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=De(window.UserLeap),c=Yn(l),u=l["userleap-platform"]==="web";if(!window.UserLeap.frameId)return;const d=document.getElementById(window.UserLeap.frameId);d&&(window.UserLeap.useMobileStyling&&((p=window.UserLeap.windowDimensions)!=null&&p.width&&(d.style.width=`${window.UserLeap.windowDimensions.width}px`),(f=window.UserLeap.windowDimensions)!=null&&f.height&&(d.style.maxHeight=window.UserLeap.windowDimensions.height-20+"px"),d.contentDocument&&(d.style.height=String(cu(d.contentDocument,u&&!c,eo(l))[0])+"px")),j.emit(B.SurveyDimensions,{name:B.SurveyDimensions,contentFrameWidth:d.clientWidth,contentFrameHeight:d.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,Ce.removeItem("userleap.ids"),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),ku(),(s=te.replay)==null||s.clearUserReplayData(),window.UserLeap._queue.unpause()},teardown(){["hashchange","popstate"].forEach(s=>window.removeEventListener(s,rr,!0)),window.UserLeap._config.interactiveEvents&&Iu(),window.UserLeap("dismissActiveSurvey",Me.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;dn.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(jt,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 te.replay?(o=te.replay)==null?void 0:o._completeSessionReplay({surveyId:s,responseGroupUuid:i,eventDigest:a,headers:De(window.UserLeap)}):(window.UserLeap.reportError("_completeSessionReplay",new Error("Replay module not registered")),!1)},pauseReplayRecording(){var s,i,a,o;(i=(s=te.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)||((o=(a=te.replay)==null?void 0:a.recordReplayPaused)==null||o.call(a))},resumeReplayRecording(){var s,i,a,o,l,c;(i=(s=te.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)&&((o=(a=te.replay)==null?void 0:a.recordReplayResumed)==null||o.call(a),(c=(l=te.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:tr??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(Ue("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 d,p,f,y,h;if(window.UserLeap.loaded)return;if((d=window.SprigLoggerCallback)==null||d.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 C in window.UserLeap._config)window.UserLeap[C]=window.UserLeap._config[C];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,Ie("sampled",a)),!a)return}else a!==null&&Ie("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 C=0;C<o.length;C++)window.UserLeap._queue.push(o[C]);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=pr(De(window.UserLeap));(p=window.SprigLoggerCallback)==null||p.call(window,"Sprig fetching config");const u=await async function(C){var I,M;const m=De(window.UserLeap);document.addEventListener("securitypolicyviolation",Ha);const g=await Ge(Ue("1",[it],"config"),{headers:m});if(document.removeEventListener("securitypolicyviolation",Ha),!g.ok)return(I=window.SprigLoggerCallback)==null||I.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"),C;const v=g.json;return v!=null&&v.disabled?((M=window.SprigLoggerCallback)==null||M.call(window,"Sprig config fetch disabled"),ci(`Disabled: ${v.disabled}`),{disabled:v.disabled}):Object.assign({},v,C)}(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 C=>{var m;await je(Ue("1",[it],"metrics"),{body:C,method:"POST",headers:{"x-ul-replay-enabled":`${!!((m=te.replay)!=null&&m.isReplayRecording())}`},shouldDropOnRateLimit:!0})}}),!c){const C=u.alwaysOnReplay?{userAgent:window.navigator.userAgent,surveyId:u.alwaysOnReplay.surveyId,responseGroupUuid:u.alwaysOnReplay.responseGroupUuid,sdkVersion:"2.35.0",maxDurationSeconds:u.alwaysOnReplay.maxDurationSeconds}:void 0;await((y=te.replay)==null?void 0:y.initializeReplay({maxReplayDurationSeconds:u.maxReplayDurationSeconds,maxInflightRequests:window.UserLeap.maxInflightReplayRequests??2,replaySettings:u.replaySettings,apiUrl:window.UserLeap._API_URL,alwaysOnConfig:C})),io=u.replaySettings}rg(u),await tg(u),window.UserLeap._queue.unpause(),(h=window.SprigLoggerCallback)==null||h.call(window,"SdkReady"),j.emit(B.SDKReady,{mobileMetricsReportingEnabled:!!u.mobileMetricsReportingEnabled,metricsReportingInterval:u.metricsReportingIntervalSeconds||0,metricsThresholds:u.metricThresholds||[],maxMobileReplayDurationSeconds:u.maxMobileReplayDurationSeconds,mobileReplaySettings:u.mobileReplaySettings}),j.emit(B.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}),j.on(B.VisitorIDUpdated,()=>{for(const C in Ln)delete Ln[C]})}window.UserLeap.UPDATES=dr,window.UserLeap("setPreviewKey",t),document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",()=>{r()},!1)}class yi{constructor(){ue(this,"UPDATES",dr)}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,On=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 On.set(n,r),n}(e);if(ws.has(e))return ws.get(e);const t=ag(e);return t!==e&&(ws.set(e,t),On.set(t,e)),t}const Si=e=>On.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),On.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){ue(this,"awaitingResolvers",[]);ue(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 An=!1,Ee=null,pn=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?{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)),Ee==null||Ee("Sprig_Click",n)},Uu=e=>{var t;vg.includes(e.key)&&(t={key:e.key},Ee==null||Ee("Sprig_Keystroke",t))},Sg=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("reload")&&(e={url:window.location.href,currentPageTitle:document.title},Ee==null||Ee("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)),Ee==null||Ee("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),pn==null||pn({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)},de={isRecording:!1,scrollEventUuids:{},stopRecording:()=>{}},Nu=()=>window.indexedDB&&window.IDBKeyRange&&window.CompressionStream,ve=(()=>{const e=ce.getItem("sprig.sessionId");if(e)return P.info("SessionIDFound",{savedSessionId:e}),ce.removeItem("sprig.sessionId"),e;const t=yt();return P.info("GeneratedSessionID",{uuid:t}),t})(),ki=()=>{ce.setItem("sprig.disableReplayRecording","disabled")},$e=()=>!!ce.getItem("sprig.disableReplayRecording"),Mn=()=>!!ce.getItem("sprig.isReplayPaused");window.addEventListener("beforeunload",()=>{P.info("BeforeUnload",{sessionId:ve}),ce.setItem("sprig.sessionId",ve)});const qe=(e,t)=>{var r,n;if(!$e()&&de.isRecording&&!Mn())try{(n=(r=window.rrwebRecord)==null?void 0:r.addCustomEvent)==null||n.call(r,e,t)}catch(s){wr("Error recording custom event",s)}},Cg=async e=>{const{x:t,xPath:r,y:n}=e,s=de.scrollEventUuids[r];if(s)return ke(async()=>{var o,l,c,u;const i=await Q.openDB(),a=await i.get("events",s);if(a!=null&&a.event){const d=JSON.parse(a.event),p=t>((l=(o=d.data)==null?void 0:o.payload)==null?void 0:l.x),f=n>((u=(c=d.data)==null?void 0:c.payload)==null?void 0:u.y);if(!p&&!f)return null;p&&(d.data.payload.x=t),f&&(d.data.payload.y=n),d.data.payload.elementAttributes=e.elementAttributes,a.event=JSON.stringify(d),await i.put("events",a)}else qe("Sprig_Scroll",e)},"Error updating scroll event");qe("Sprig_Scroll",e)},Fu=()=>{de.stopRecording&&(de.stopRecording(),de.stopRecording=void 0),de.isRecording=!1,["cleanupInterval","inactivityInterval","pendingCheckInterval"].forEach(e=>{de[e]&&(clearInterval(de[e]),de[e]=void 0)}),An&&(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),An=!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())}},wr=(e,t,{reportError:r}={reportError:!0})=>{Fu(),P.error("ReplayErr",{code:t.code,name:t.name}),Eg(e,t,{reportError:r})},ke=async(e,t)=>{try{return await e()}catch(r){wr(t,r)}},Ei=()=>{de.isRecording&&(ke(()=>{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(){ue(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";wr(i,new Error(i),{reportError:!1})}bs++,e.done.finally(()=>{bs--})});ue(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&&ce.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([ve,e],[ve,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([ve,e],[ve,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",ve)).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(ve)){const s=n.value;s.captureParams.responseGroupId===e&&await n.update({...s,canUpload:!0})}await t.done}async markPendingHeatmapsReady(e){if(parseInt(ce.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(ve)){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 vr,Bu,Un,zu,hn,ju,mt=[],Ut=!1,Mt=0,mn=!1,Wu=!1,lo=[],Ss=!1;const Tt=()=>mn&&!Ut&&Date.now()<=Un,xg=({apiUrl:e,config:t,triggerSnapshot:r,forceInit:n=!1})=>{mn&&!n||(ce.isStorageAvailable?(mt=[],lo.splice(0),Qe.splice(0),Mt=0,hn=r,Bu=e,vr={responseGroupUuid:t.responseGroupUuid,surveyId:t.surveyId,userAgent:t.userAgent,sdkVersion:t.sdkVersion},zu=t.maxDurationSeconds,Ag(),mn||(ju=window.setInterval(Og,500)),mn=!0):Ut=!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(!Tt())return void window.clearInterval(ju);if(Vu(),!co(Qe))return;const e=Qe[0].timestamp;Date.now()-e>35e3&&(hn==null||hn())},Vu=async()=>{if(mt.length||Ss)return;Ss=!0;const e=await Ug();if(!e)return void(Ut=!0);lo.splice(0,e.length).forEach(t=>t(e.shift())),e.forEach(t=>mt.push(t)),Ss=!1},Ag=()=>{const e=ce.getItem("sprig.alwayson.info");if(e){P.info("Read stored session state",e);const t=JSON.parse(e);Ut=t.disabled,vr=t.metadata,mt=t.uploadUrls,Mt=t.currentIndex,Un=t.expirationTimestamp,t.pendingEventTimestamp&&(P.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`),Mg(t.pendingEventTimestamp))}else Un=1e3*zu+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{Ut=!0}},Gu=async(e,t)=>{if(!Tt()||!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(!Tt())return;const{surveyId:e,responseGroupUuid:t}=vr,r={responseGroupUuid:t,surveyId:e,index:Mt+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:De(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=Mt,n=((i=(s=window.UserLeap)==null?void 0:s.config)==null?void 0:i.customMetadata)??((a=window.__cfg)==null?void 0:a.customMetadata);Mt++,e.push({timestamp:t,type:ot.Custom,data:{tag:"Sprig_Meta",payload:{...vr,index:r,visitorId:window.UserLeap.visitorId??"",timestamp:t,customMetadata:n}}})},Tg=(e,t)=>{Tt()&&!Wu&&(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()=>{Wu=!0,Tt()&&(P.info("Always On handle page unload"),(()=>{let e;Qe.length&&(e=Qe[0].timestamp);const t={disabled:Ut,metadata:vr,uploadUrls:mt,currentIndex:Mt,pendingEventTimestamp:e,expirationTimestamp:Un};P.info("Storing session state on unload",t),ce.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=yr[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=yr[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;de.scrollEventUuids[i]=e.uuid}Oi.push(e),Li||Pg()},Pg=()=>{Li=!0,setTimeout(async()=>{if($e()||Mn())return;const e=Oi;Oi=[],Li=!1,qu(async()=>{await(async t=>{const r=t.map(n=>({...n,sessionId:n.sessionId??ve}));if(r.length!==0)return ke(()=>Q.bulkAdd("events",r),"Error storing replay events")})(e)},"sdk_replay_add_event_batch_seconds")},500)},_g=(e,t,r)=>{de.cleanupInterval=window.setInterval(()=>{const n=Date.now();Ju(()=>ke(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=()=>{de.pendingCheckInterval=window.setInterval(async()=>{ke(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(),ce.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=()=>{ke(async()=>{const e=await Q.getChunkUploadsByStatus({sessionId:ve,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,[d,p]=[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}d===0&&(d=f[0].timestamp),p=f[f.length-1].timestamp;const C=f.map(v=>v.event);C.push(`{"timestamp":${s}}`);const m=`${c?",":"["}${C}`,g=i.encode(m);qu(()=>{l.write(g)},"sdk_replay_compression_seconds"),c=!0}if(p-d<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=((d,p,f)=>{const y=d.length,h=1024*p*1024,C=Math.ceil(y/f),m=Math.max(h,C),g=[];let v=0;for(;v<y;)g.push(d.slice(v,v+m)),v+=m;return g})(l,a.minimumChunkSizeMb,a.signedUrls.length),u=await Promise.all(c.map(async(d,p)=>{const f=yt(),y={apiUrl:s,chunkIndex:p+1,completeUploadHeaders:i,etag:null,responseGroupId:r,status:"ReadyForUpload",surveyId:t,timestamp:o,totalChunks:c.length,data:d,uploadId:a.uploadId,uploadUrl:a.signedUrls[p].url,uuid:f,visitorId:n};return await(await Q.openDB()).add("chunkUploads",{...y,sessionId:y.sessionId??ve}),y}));await(async(d,p)=>{await Zu(p),await Promise.all(d.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(()=>j.removeListener(B.QuestionAnswered,o),0),ke(async()=>{s.replayDurationType==="before"?await ll(e):await Q.markPendingCaptureToCanUpload(a)},"Error in schedule/capture callback")};ke(async()=>{if(s.replayDurationType==="after"||s.replayDurationType==="beforeAndAfter")return!n&&!r&&j.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),j.on(B.QuestionAnswered,o)}},"Error in scheduling/capturing replay")},jg=async()=>{parseInt(lt??"0")||ce.removeItem("sprig.isCapturingHeatmap"),ce.getItem("sprig.teardownAfterCapture")&&(Fu(),ed(),ce.removeItem("sprig.teardownAfterCapture"))},ed=async()=>$e()?P.debug("ReplayDisabled-ClearData"):Promise.all([Q.deleteBySessionId("events",ve),Q.deleteBySessionId("pendingCaptures",ve)]).catch(e=>{wr("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(),ce.setItem("sprig.isCapturingHeatmap","true"),Ri=Date.now(),de.inactivityInterval||(de.inactivityInterval=window.setInterval(()=>{var l;l=Ri,Date.now()-l>=3e4&&ke(()=>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(),ce.setItem("sprig.pendingCount",lt),await(await Q.openDB()).add("pendingCaptures",{canUpload:!1,captureParams:i,sessionId:ve,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"):ke(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:wr,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=ce.getItem("sprig.pendingCount"),de.isRecording)return;if(n&&ce.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(),d=(c-u)/1024**3;return P.info("Storage",{availableGb:d}),d<.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()}ke(async()=>{await Ai(!0)},"Error uploading ready pending captures");const a=Tt()?30:0,o=Math.max(e??0,a);if(!o)return P.debug("MissingDuration");P.debug("ReplayInit"),await ke(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-2.0.0-alpha.17.min.js",u=window.rrwebRecord;if(!u)return P.error("RecordScriptFailed");let d=!0,p=0;const f={checkoutEveryNms:3e4,sampling:{input:"last",scroll:250,media:800},...r};var y,h;de.stopRecording=u({emit:(C,m)=>{if(C.type===ot.Custom&&(Ri=Date.now()),$e()||Mn())return;if(m&&C.type===ot.Meta)p=performance.now();else if(m&&p&&C.type===ot.FullSnapshot){const v=performance.now()-p;gu("sdk_replay_snapshot_seconds",v/1e3)}const g=d||!!m&&C.type===ot.Meta;d=!1,Tg(g,C),Dg({uuid:yt(),event:JSON.stringify(C),isValidStart:g,timestamp:Date.now()})},...f}),de.isRecording=!!de.stopRecording,de.isRecording&&(((C,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:C,replayLibraryUrl:m},{targetOrigin:g.origin}))})})(f,c),j.on("survey.complete",C=>{var m;m={id:C,userAgent:window.navigator.userAgent},qe("Sprig_SubmitSurvey",m)}),y=qe,h=Cg,An||(Ee=y,pn=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),An=!0,Sg(),Ig()))},"Error initializing replay")},isReplayPaused:Mn,isReplayRecording:()=>de.isRecording,recordFullSnapshot:Ei,recordReplayPaused:()=>{qe("Sprig_ReplayPaused",{timestamp:Date.now()}),ce.setItem("sprig.isReplayPaused","true")},recordReplayResumed:()=>{ce.removeItem("sprig.isReplayPaused"),qe("Sprig_ReplayResumed",{timestamp:Date.now()})},scheduleCapture:td,scheduleOrCaptureReplay:Qu,tryReplayAction:ke,uploadReadyPendingCaptures:Ai},Symbol.toStringTag,{value:"Module"}));(e=>{te.replay=e})(Wg),window.UpChunk={createUpload:jd},window.rrwebRecord=$t,exports.APP_ID="ul-app",exports.ConflictingWidgets=Zc,exports.DEFAULT_BORDER_COLOR="#e6e6e6",exports.DEFAULT_WIDTH_PX=360,exports.DismissReason=Me,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=j,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=hr,exports.shouldDirectEmbed=eo,exports.sprig=ig,exports.sprigFetch=Ge,exports.v4=yt;
72
+ </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(){ue(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 dn=new class{constructor(){ue(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(dn);class Xf{constructor(t,r){ue(this,"paused");ue(this,"queue");ue(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 vu=!0,hi=!1;const Kf=["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 Zf{constructor(t){ue(this,"_values",[]);ue(this,"_isWebMetric");this.name=t,this._isWebMetric=Kf.includes(this.name)}report(t){if(vu&&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 yr={},Ve=e=>{const t=new Zf(e);return yr[e]=t,t},bu=(e,t)=>{let r=yr[e];return r||(r=Ve(e)),r.report(t)},Qf=({reportingIntervalSeconds:e,postMetrics:t})=>{e?setInterval(()=>{(async r=>{const n=Object.values(yr).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&&_.error("MetricsErr",{error:{message:s.message,name:s.name}})}})(t)},1e3*e):vu=!1};let Su,Iu;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},el=()=>{Su.report(fi(document.body)),Iu.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 kn,En,xn,Rn,tl,dt={};const $r=(e,t=1)=>{const{name:r}=e;dt[r]=(dt[r]||0)+t},Cu=e=>{let t=1;return e.childNodes.forEach(r=>{t+=Cu(r)}),t},rl=e=>{let t=0;return e.forEach(r=>{t+=Cu(r)}),t},eg=e=>{switch(e.type){case"childList":return $r(kn,rl(e.addedNodes)),void $r(En,rl(e.removedNodes));case"attributes":return void $r(xn);case"characterData":return void $r(Rn)}},tg=e=>e.forEach(eg),rg=()=>{kn.report(dt[kn.name]||0),En.report(dt[En.name]||0),xn.report(dt[xn.name]||0),Rn.report(dt[Rn.name]||0),dt={}},ng=(e=1e3)=>{kn=Ve("sdk_mutations_nodes_added"),En=Ve("sdk_mutations_nodes_removed"),xn=Ve("sdk_mutations_attributes_changed"),Rn=Ve("sdk_mutations_character_data"),tl=new MutationObserver(tg),tl.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),setInterval(rg,e)},sg=({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=te.replay)!=null&&a.isReplayRecording()){const l=`Value: ${s} on ${i.metric} violated threshold of ${i.type} ${i.value}`;(o=te.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}}),Qf({reportingIntervalSeconds:t,postMetrics:n}),e&&(((s=1e3)=>{const i=Ve("sdk_event_queue_latency_seconds");gi(s,i)})(),((s=1e4)=>{Su=Ve("sdk_dom_nodes_count"),Iu=Ve("sdk_page_html_characters"),el(),setInterval(el,s)})(),ng())},ig="test",og=["popState","pushState","replaceState"];let io,tr;const Ln={},jt="!email",ku="pageUrl";let gs=window.location.href;function rr(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&&_.navigation("LocationChange",{from:gs,to:window.location.href}),gs=window.location.href;const i=Ru().trackStartUrl,a=i?String(i):null;t&&Ou(window.location.href),r&&(xu(),ag()),mu()&&(()=>{if(In())return;const c=Rt();c&&(pu(er)||(c.remove(),er=null,Z=null))})(),ce.getItem("sprig.isCapturingHeatmap")&&((l=(o=te.replay)==null?void 0:o.checkPendingHeatmapsUrl())==null||l.then(c=>{var u;c&&((u=te.replay)==null||u.uploadReadyPendingCaptures(!0))})),!In()&&n&&a&&a!==window.location.href&&e&&og.includes(e.type)&&window.UserLeap("dismissActiveSurvey",Ae.PageChange)}const Eu={capture:!0},ag=()=>{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(Xa(o.target))try{o.target.closest(i)&&window.UserLeap("track",n)}catch{}return!1}:o=>(Xa(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,Eu)},xu=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,Eu),delete window.UserLeap._config.interactiveEventsHandler};function Ru(){const e=Ce.getItemObject("userleap.ids");return e&&e[window.UserLeap.envId]||{}}function Lu(){if(window.previewMode)return;const e=Ce.getItemObject("sprig.anon.env.vid.map")||{},t=e[window.UserLeap.envId];window.UserLeap.visitorId=t||yt(),_.info("NewVid",{vid:window.UserLeap.visitorId}),Ie("vid",window.UserLeap.visitorId),t||(e[window.UserLeap.envId]=window.UserLeap.visitorId,Ce.setItemObject("sprig.anon.env.vid.map",e)),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}function Ou(e,t,r,n){var s,i;try{if(e.endsWith("mock_snippet.html"))return;_.info("PageView",{url:e});const a=(s=document==null?void 0:document.querySelector('meta[name="description"]'))==null?void 0:s.getAttribute("content");(i=te.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",ku,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 lg(){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),rr(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),rr(s),n})(e.replaceState)),["hashchange","popstate"].forEach(t=>window.addEventListener(t,rr,!0))}async function ys(e,t){const r=to();e&&!t&&(window.UserLeap._config.mode=ig);const n=$n(Te(window.UserLeap)),s=await ze(function(i){const a=new URL(Me("1",[st],"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 Sn(s.json.delay),!s.json.isFeedback)return Qt(s.json,tr,io);{const{feedbackLabel:i,productConfig:a,surveyUuid:o,feedbackCustomStyles:l}=s.json,{buttonTheme:c,placement:u,desktopDisplay:d}=a;wu({customStyles:l,buttonTheme:c,desktopDisplay:d,eventId:0,feedbackLabel:i,placement:u,surveyUuid:o,surveyId:e==null?void 0:e.surveyId},s.json)}}function cg(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)&&(lg(),rr())}const ug=function(e){if(!window.UserLeap)return;const t=async(s={})=>{var m,g,v,I,M;const{userId:i,anonymousId:a,metadata:o={},properties:l,showSurveyCallback:c}=s;let{eventName:u}=s;if(window.UserLeap.debugMode&&u!==ku&&console.info("[DEBUG] Sprig track",s),e.mode==="test")return;const d=Ce.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 p=tr??window.location.href;o.url||(o.url=p),Ie("trackStartUrl",p),(g=(m=window.UserLeap)==null?void 0:m._config)!=null&&g.optimizelyEnabled&&(pr(Te(window.UserLeap))||dn.getAndSetWebOptimizelyExperiments(),o.optimizelyExperiments=Object.assign({},dn.getAllOptimizelyExperiments())),(I=(v=window.UserLeap)==null?void 0:v._config)!=null&&I.launchDarklyEnabled&&(o.launchDarklyFlags=pi.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),a&&(window.UserLeap.partnerAnonymousId=a),l&&(o.eventProperties=l),(M=te.replay)==null||M.RecordEvent({name:u,url:o.url}),_.info("TrackEvent",{eventName:u});const f=window.UserLeap.delayingSurvey||fu()?await ze(Me("1",[nt],"events/batch"),{body:JSON.stringify({events:[{event:u,metadata:o}],previewKey:d}),method:"POST",shouldDropOnRateLimit:!0}):await ze(Me("1",[nt],"events"),{body:JSON.stringify({event:u,metadata:o,previewKey:d}),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&&Ie("uid",i),a&&Ie("aid",a);const y=f.json;y.invalidPreviewKey&&Ce.removeItem("sprig.previewKey");const h=o.trackPageView?o.url:void 0;return y!=null&&y.feedbackButton&&wu(y.feedbackButton,void 0,h),await async function(x,U){var E,L;let A=!0;return!(U&&((E=x==null?void 0:x.json)!=null&&E.surveyId)&&(window.UserLeap.delayingSurvey=!0,A=await U(x.json.surveyId),window.UserLeap.delayingSurvey=!1,!A))&&((L=x==null?void 0:x.json)!=null&&L.delay&&!window.UserLeap.isMobileSDK&&(window.UserLeap.delayingSurvey=!0,await Sn(x.json.delay),window.UserLeap.delayingSurvey=!1),A)}(f,c)?function(x){if(!window.UserLeap._config.dismissOnPageChange)return!0;const U=new URL(x),A=new URL(tr??window.location.href);return U.hostname===A.hostname&&U.pathname===A.pathname}(p)?Qt(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&&hr({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",Ae.Override),ys({surveyId:s},!0)),_previewSurvey(s){window.UserLeap("dismissActiveSurvey",Ae.Override),ys({surveyTemplateId:s},!1)},_reviewSurvey(s){window.UserLeap("dismissActiveSurvey",Ae.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=Ae.API){window.UserLeap.container&&(s===Ae.Closed&&window.Sprig.trackHistory&&window.Sprig.trackHistory({event:"closed"}),z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}),z.emit(F.SurveyWillClose,{name:F.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[jt]&&(o[jt]=o.email,delete o.email);const u=Object.keys(o);for(const d of u)o[d]===Ln[d]&&delete o[d]}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 ze(Me("1",[st,nt],"attributes"),{body:JSON.stringify(o),method:"PUT"}),c.ok?Object.assign(Ln,o):c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await ze(Me("1",[st,nt]),{body:JSON.stringify(l),method:"PUT"}),o&&o[jt]&&(window.UserLeap.email=o[jt]),c.ok&&(i&&Ie("uid",i),a&&Ie("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 ze(Me("1",[st,nt],"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(F.SurveyLifeCycle,s)},async removeSurveyListener(s){z.removeListener(F.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"&&Ce.isStorageAvailable&&s&&Ce.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 ze(Me("1",[st,nt]),{body:JSON.stringify({userId:s}),method:"PUT"});a.ok?(i!==window.UserLeap.visitorId&&((o=te.replay)==null||o.clearUserReplayData()),Ie("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,Ie("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){tr=s,Ou(s,i,a,o)},applyFeedbackStyles({button:s="",view:i=""}){window.UserLeap.feedbackCustomStyles=i,document.getElementById("sprig-feedback-style")&&hr({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 p,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=Te(window.UserLeap),c=$n(l),u=l["userleap-platform"]==="web";if(!window.UserLeap.frameId)return;const d=document.getElementById(window.UserLeap.frameId);d&&(window.UserLeap.useMobileStyling&&((p=window.UserLeap.windowDimensions)!=null&&p.width&&(d.style.width=`${window.UserLeap.windowDimensions.width}px`),(f=window.UserLeap.windowDimensions)!=null&&f.height&&(d.style.maxHeight=window.UserLeap.windowDimensions.height-20+"px"),d.contentDocument&&(d.style.height=String(hu(d.contentDocument,u&&!c,eo(l))[0])+"px")),z.emit(F.SurveyDimensions,{name:F.SurveyDimensions,contentFrameWidth:d.clientWidth,contentFrameHeight:d.clientHeight,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},logoutUser(){var s;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),_.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,Ce.removeItem("userleap.ids"),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),Lu(),(s=te.replay)==null||s.clearUserReplayData(),window.UserLeap._queue.unpause()},teardown(){["hashchange","popstate"].forEach(s=>window.removeEventListener(s,rr,!0)),window.UserLeap._config.interactiveEvents&&xu(),window.UserLeap("dismissActiveSurvey",Ae.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;dn.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(jt,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){bu(s,i)},_completeSessionReplay:async({surveyId:s,responseGroupUuid:i,eventDigest:a})=>{var o;return te.replay?(o=te.replay)==null?void 0:o._completeSessionReplay({surveyId:s,responseGroupUuid:i,eventDigest:a,headers:Te(window.UserLeap)}):(window.UserLeap.reportError("_completeSessionReplay",new Error("Replay module not registered")),!1)},pauseReplayRecording(){var s,i,a,o;(i=(s=te.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)||((o=(a=te.replay)==null?void 0:a.recordReplayPaused)==null||o.call(a))},resumeReplayRecording(){var s,i,a,o,l,c;(i=(s=te.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)&&((o=(a=te.replay)==null?void 0:a.recordReplayResumed)==null||o.call(a),(c=(l=te.replay)==null?void 0:l.recordFullSnapshot)==null||c.call(l))}};Object.assign(window.UserLeap,n)};async function dg(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:tr??window.location.href,language:window.navigator.language,...r},c={action:e,breadcrumbs:_.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 ze(Me("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 pg(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 d,p,f,y,h;if(window.UserLeap.loaded)return;if((d=window.SprigLoggerCallback)==null||d.call(window,"Loading Sprig"),window.UserLeap.reportError=dg,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 k in window.UserLeap._config)window.UserLeap[k]=window.UserLeap._config[k];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=Ru(),i=window.UserLeap.sampleRate;let a=s.sampled;if(i){if(a===null&&(a=Math.random()<i,Ie("sampled",a)),!a)return}else a!==null&&Ie("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new Xf(window.UserLeap,[]),window.UserLeap._queue.pause();for(let k=0;k<o.length;k++)window.UserLeap._queue.push(o[k]);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):Lu();const c=pr(Te(window.UserLeap));(p=window.SprigLoggerCallback)==null||p.call(window,"Sprig fetching config");const u=await async function(k){var I,M;const m=Te(window.UserLeap);document.addEventListener("securitypolicyviolation",Ya);const g=await He(Me("1",[st],"config"),{headers:m});if(document.removeEventListener("securitypolicyviolation",Ya),!g.ok)return(I=window.SprigLoggerCallback)==null||I.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"),k;const v=g.json;return v!=null&&v.disabled?((M=window.SprigLoggerCallback)==null||M.call(window,"Sprig config fetch disabled"),ci(`Disabled: ${v.disabled}`),{disabled:v.disabled}):Object.assign({},v,k)}(e);if((f=window.SprigLoggerCallback)==null||f.call(window,"Sprig fetched config"),sg({isWeb:!c,reportingIntervalSeconds:u.metricsReportingEnabled||u.mobileMetricsReportingEnabled?u.metricsReportingIntervalSeconds:0,thresholds:u.metricThresholds,postMetrics:async k=>{var m;await ze(Me("1",[st],"metrics"),{body:k,method:"POST",headers:{"x-ul-replay-enabled":`${!!((m=te.replay)!=null&&m.isReplayRecording())}`},shouldDropOnRateLimit:!0})}}),!c){const k=u.alwaysOnReplay?{userAgent:window.navigator.userAgent,surveyId:u.alwaysOnReplay.surveyId,responseGroupUuid:u.alwaysOnReplay.responseGroupUuid,sdkVersion:"2.36.0",maxDurationSeconds:u.alwaysOnReplay.maxDurationSeconds}:void 0;await((y=te.replay)==null?void 0:y.initializeReplay({maxReplayDurationSeconds:u.maxReplayDurationSeconds,maxInflightRequests:window.UserLeap.maxInflightReplayRequests??2,replaySettings:u.replaySettings,apiUrl:window.UserLeap._API_URL,alwaysOnConfig:k})),io=u.replaySettings}ug(u),await cg(u),window.UserLeap._queue.unpause(),(h=window.SprigLoggerCallback)==null||h.call(window,"SdkReady"),z.emit(F.SDKReady,{mobileMetricsReportingEnabled:!!u.mobileMetricsReportingEnabled,metricsReportingInterval:u.metricsReportingIntervalSeconds||0,metricsThresholds:u.metricThresholds||[],maxMobileReplayDurationSeconds:u.maxMobileReplayDurationSeconds,mobileReplaySettings:u.mobileReplaySettings}),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}),z.on(F.VisitorIDUpdated,()=>{for(const k in Ln)delete Ln[k]})}window.UserLeap.UPDATES=dr,window.UserLeap("setPreviewKey",t),document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",()=>{r()},!1)}class yi{constructor(){ue(this,"UPDATES",dr)}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 hg={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,pg(e),window.Sprig}};var it=(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))(it||{}),$e=(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))($e||{});const wi=(e,t)=>t.some(r=>e instanceof r);let nl,sl;const vi=new WeakMap,ws=new WeakMap,On=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 ot(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&(t==="done"||t==="store")||t in e};function Au(e){bi=e(bi)}function mg(e){return(sl||(sl=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Si(this),t),ot(this.request)}:function(...t){return ot(e.apply(Si(this),t))}}function fg(e){return typeof e=="function"?mg(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,nl||(nl=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,bi):e)}function ot(e){if(e instanceof IDBRequest)return function(r){const n=new Promise((s,i)=>{r.onsuccess=()=>{s(ot(r.result))},r.onerror=()=>{i(r.error)}});return On.set(n,r),n}(e);if(ws.has(e))return ws.get(e);const t=fg(e);return t!==e&&(ws.set(e,t),On.set(t,e)),t}const Si=e=>On.get(e);function Ii(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);return t&&(r.onblocked=n=>t(n.oldVersion,n)),ot(r).then(()=>{})}const gg=["get","getKey","getAll","getAllKeys","count"],yg=["put","add","delete","clear"],vs=new Map;function il(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=yg.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!gg.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}Au(e=>({...e,get:(t,r,n)=>il(t,r)||e.get(t,r,n),has:(t,r)=>!!il(t,r)||e.has(t,r)}));const wg=["continue","continuePrimaryKey","advance"],ol={},Ci=new WeakMap,Mu=new WeakMap,vg={get(e,t){if(!wg.includes(t))return e[t];let r=ol[t];return r||(r=ol[t]=function(...n){Ci.set(this,Mu.get(this)[t](...n))}),r}};async function*bg(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,vg);for(Mu.set(r,t),On.set(r,Si(t));t;)yield r,t=await(Ci.get(r)||t.continue()),Ci.delete(r)}function al(e,t){return t===Symbol.asyncIterator&&wi(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&wi(e,[IDBIndex,IDBObjectStore])}Au(e=>({...e,get:(t,r,n)=>al(t,r)?bg:e.get(t,r,n),has:(t,r)=>al(t,r)||e.has(t,r)}));const Sg="sprigReplayIframeLoaded",Ig="sprigReplayIframeSettings",Cg="sprigReplayIframeTakeFullSnapshot",kg="sprigReplayTeardown",oo=[],Uu=new class{constructor(e){ue(this,"awaitingResolvers",[]);ue(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),Tu=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 _.error("UploadErr",{isMobile:l,uploadId:r,etags:n});_.info("MarkUploadComplete",{surveyId:t});const c=await He(`${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 _.info("MarkUploadDone",{surveyId:t}),c},Eg=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},Du=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=Eg(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),We={capture:!0,passive:!0},xg=["a","button","input","option","li","link"],Rg=["Escape","Enter","Backspace","F5","Tab"];let An=!1,Ee=null,pn=null;const ll=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},Lg=e=>{var n;if(!e)return{};const t={...ll(e)},r=e.parentElement;if(r&&xg.includes((n=r.tagName)==null?void 0:n.toLowerCase())){const s=ll(r);Object.assign(t,s)}return t},Pu=(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:Lg(r),windowHeight:window.innerHeight,windowWidth:window.innerWidth,...r instanceof HTMLElement?{rect:r==null?void 0:r.getBoundingClientRect(),xPath:Du(r)}:{}},(i=n==null?void 0:n.elementAttributes)!=null&&i.text&&(n.elementAttributes.text=ao(n.elementAttributes.text)),Ee==null||Ee("Sprig_Click",n)},_u=e=>{var t;Rg.includes(e.key)&&(t={key:e.key},Ee==null||Ee("Sprig_Keystroke",t))},Og=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("reload")&&(e={url:window.location.href,currentPageTitle:document.title},Ee==null||Ee("Sprig_Refresh",e))},Ag=()=>{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)),Ee==null||Ee("Sprig_BackForward",e))},Nu=((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),pn==null||pn({xPath:Du(t),x:t.scrollLeft,y:t.scrollTop,elementAttributes:{targetScrollWidth:t.scrollWidth,targetClientWidth:t.clientWidth,targetScrollHeight:t.scrollHeight,targetClientHeight:t.clientHeight}})},750),Fu=(cl="left_click",e=>Pu(cl,e));var cl;const Bu=e=>{e.button===2&&Pu("right_click",e)},zu=e=>{window.Sprig&&(window.Sprig.pointerDownTarget=e.target)},de={isRecording:!1,scrollEventUuids:{},stopRecording:()=>{}},ju=()=>window.indexedDB&&window.IDBKeyRange&&window.CompressionStream,we=(()=>{const e=ce.getItem("sprig.sessionId");if(e)return _.info("SessionIDFound",{savedSessionId:e}),ce.removeItem("sprig.sessionId"),e;const t=yt();return _.info("GeneratedSessionID",{uuid:t}),t})(),ki=()=>{ce.setItem("sprig.disableReplayRecording","disabled")},Ge=()=>!!ce.getItem("sprig.disableReplayRecording"),Mn=()=>!!ce.getItem("sprig.isReplayPaused");window.addEventListener("beforeunload",()=>{_.info("BeforeUnload",{sessionId:we}),ce.setItem("sprig.sessionId",we)});const qe=(e,t)=>{var r,n;if(!Ge()&&de.isRecording&&!Mn())try{(n=(r=window.rrwebRecord)==null?void 0:r.addCustomEvent)==null||n.call(r,e,t)}catch(s){wr("Error recording custom event",s)}},Mg=async e=>{const{x:t,xPath:r,y:n}=e,s=de.scrollEventUuids[r];if(s)return ke(async()=>{var o,l,c,u;const i=await Q.openDB(),a=await i.get("events",s);if(a!=null&&a.event){const d=JSON.parse(a.event),p=t>((l=(o=d.data)==null?void 0:o.payload)==null?void 0:l.x),f=n>((u=(c=d.data)==null?void 0:c.payload)==null?void 0:u.y);if(!p&&!f)return null;p&&(d.data.payload.x=t),f&&(d.data.payload.y=n),d.data.payload.elementAttributes=e.elementAttributes,a.event=JSON.stringify(d),await i.put("events",a)}else qe("Sprig_Scroll",e)},"Error updating scroll event");qe("Sprig_Scroll",e)},Wu=()=>{de.stopRecording&&(de.stopRecording(),de.stopRecording=void 0),de.isRecording=!1,["cleanupInterval","inactivityInterval","pendingCheckInterval"].forEach(e=>{de[e]&&(clearInterval(de[e]),de[e]=void 0)}),An&&(window.removeEventListener("click",Fu,We),window.removeEventListener("pointerdown",zu,We),window.removeEventListener("mousedown",Bu,We),window.removeEventListener("keydown",_u,We),window.removeEventListener("scroll",Nu,We),An=!1),oo.forEach(e=>{var t;(t=e.source)==null||t.postMessage({type:kg},{targetOrigin:e.origin})})},Ug=["did not allow mutations","called in an invalid security context"],Tg=(e,t,{reportError:r=!0,extraInfo:n={}})=>{if(!Ge()&&t instanceof Error){if(ki(),t.name==="VersionError")return _.error("VersionErr",{message:e}),void Q.deleteDB();(s=>{if(!s)return!0;for(const i of Ug)if(s.toLowerCase().includes(i))return!1;return!0})(t==null?void 0:t.message)&&(r&&window.UserLeap.reportError(e,t,n),Q.clearAll())}},wr=(e,t,{reportError:r}={reportError:!0})=>{Wu(),_.error("ReplayErr",{code:t.code,name:t.name}),Tg(e,t,{reportError:r})},ke=async(e,t)=>{try{return await e()}catch(r){wr(t,r)}},Ei=()=>{de.isRecording&&(ke(()=>{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:Cg},{targetOrigin:e.origin})}))};let bs=0;(async()=>ju()&&Promise.allSettled([Ii("replayStorage"),Ii("sprig.replay")]))();const Q=new class{constructor(){ue(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";wr(i,new Error(i),{reportError:!1})}bs++,e.done.finally(()=>{bs--})});ue(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=ot(a);return n&&(a.onupgradeneeded=l=>{n(ot(a.result),l.oldVersion,l.newVersion,ot(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&&ce.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([we,e],[we,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([we,e],[we,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",we)).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(we)){const s=n.value;s.captureParams.responseGroupId===e&&await n.update({...s,canUpload:!0})}await t.done}async markPendingHeatmapsReady(e){if(parseInt(ce.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(we)){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}},Ze=[];let vr,Vu,Un,Hu,hn,Gu,mt=[],Ut=!1,Mt=0,mn=!1,Yu=!1,lo=[],Ss=!1;const Tt=()=>mn&&!Ut&&Date.now()<=Un,Dg=({apiUrl:e,config:t,triggerSnapshot:r,forceInit:n=!1})=>{mn&&!n||(ce.isStorageAvailable?(mt=[],lo.splice(0),Ze.splice(0),Mt=0,hn=r,Vu=e,vr={responseGroupUuid:t.responseGroupUuid,surveyId:t.surveyId,userAgent:t.userAgent,sdkVersion:t.sdkVersion},Hu=t.maxDurationSeconds,Fg(),mn||(Gu=window.setInterval(Ng,500)),mn=!0):Ut=!0)},Pg=[$e.Drag,$e.Input,$e.MediaInteraction,$e.MouseInteraction,$e.MouseMove,$e.Scroll,$e.Selection,$e.TouchMove],_g=e=>e.type===it.Custom||e.type===it.IncrementalSnapshot&&Pg.includes(e.data.source),co=e=>e.some(_g),Ng=async()=>{if(!Tt())return void window.clearInterval(Gu);if($u(),!co(Ze))return;const e=Ze[0].timestamp;Date.now()-e>35e3&&(hn==null||hn())},$u=async()=>{if(mt.length||Ss)return;Ss=!0;const e=await zg();if(!e)return void(Ut=!0);lo.splice(0,e.length).forEach(t=>t(e.shift())),e.forEach(t=>mt.push(t)),Ss=!1},Fg=()=>{const e=ce.getItem("sprig.alwayson.info");if(e){_.info("Read stored session state",e);const t=JSON.parse(e);Ut=t.disabled,vr=t.metadata,mt=t.uploadUrls,Mt=t.currentIndex,Un=t.expirationTimestamp,t.pendingEventTimestamp&&(_.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`),Bg(t.pendingEventTimestamp))}else Un=1e3*Hu+Date.now()},Bg=async e=>{const t=Date.now(),r=(await Q.getEventsBetween(e,t)).map(s=>JSON.parse(s.event));if(!co(r))return;Ku(r);const n=await Xu();n&&await Ju(n,r)},qu=async(e,t)=>{try{const r=await e();if(!r.ok)throw new Error(`Error ${t}`);return r}catch{Ut=!0}},Ju=async(e,t)=>{if(!Tt()||!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);_.info("Uploading always-on events with presigned url"),await qu(()=>He(e,{body:r,method:"PUT"}),"uploading always-on with presigned url")},zg=async()=>{if(!Tt())return;const{surveyId:e,responseGroupUuid:t}=vr,r={responseGroupUuid:t,surveyId:e,index:Mt+1};_.info("Fetching always-on upload urls",r);const n=await qu(()=>He(`${Vu}/sdk/1/replayUrls`,{method:"POST",body:JSON.stringify(r),headers:Te(window.UserLeap)}),"fetching always-on signed urls");if(!n)return;const s=n.json.signedUrls;return _.info("Fetched more always-on upload urls",{body:r,urls:s}),s},Xu=async()=>{if(mt.length)return mt.shift();const e=new Promise(t=>{lo.push(t)});return $u(),e},Ku=e=>{var s,i,a;const t=e.length?e[e.length-1].timestamp:Date.now(),r=Mt,n=((i=(s=window.UserLeap)==null?void 0:s.config)==null?void 0:i.customMetadata)??((a=window.__cfg)==null?void 0:a.customMetadata);Mt++,e.push({timestamp:t,type:it.Custom,data:{tag:"Sprig_Meta",payload:{...vr,index:r,visitorId:window.UserLeap.visitorId??"",timestamp:t,customMetadata:n}}})},jg=(e,t)=>{Tt()&&!Yu&&(e||Ze.length)&&(e&&Ze.length&&(async()=>{const r=Ze.splice(0);if(!co(r))return;_.info("Capturing always-on event array to upload"),Ku(r);const n=await Xu();n&&await Ju(n,r)})(),Ze.push(t))};window.addEventListener("beforeunload",async()=>{Yu=!0,Tt()&&(_.info("Always On handle page unload"),(()=>{let e;Ze.length&&(e=Ze[0].timestamp);const t={disabled:Ut,metadata:vr,uploadUrls:mt,currentIndex:Mt,pendingEventTimestamp:e,expirationTimestamp:Un};_.info("Storing session state on unload",t),ce.setItem("sprig.alwayson.info",JSON.stringify(t))})())});const Zu=async(e,t)=>{const r=performance.now();let n;try{n=await e()}finally{const s=performance.now()-r;let i=yr[t];i||(i=Ve(t)),i.report(s/1e3)}return n},Qu=(e,t)=>{const r=performance.now();try{e()}finally{const n=performance.now()-r;let s=yr[t];s||(s=Ve(t)),s.report(n/1e3)}};let ed=5e3,xi=6e4,Ri=0,at,Li=!1,Oi=[];const Wg=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;de.scrollEventUuids[i]=e.uuid}Oi.push(e),Li||Vg()},Vg=()=>{Li=!0,setTimeout(async()=>{if(Ge()||Mn())return;const e=Oi;Oi=[],Li=!1,Qu(async()=>{await(async t=>{const r=t.map(n=>({...n,sessionId:n.sessionId??we}));if(r.length!==0)return ke(()=>Q.bulkAdd("events",r),"Error storing replay events")})(e)},"sdk_replay_add_event_batch_seconds")},500)},Hg=(e,t,r)=>{de.cleanupInterval=window.setInterval(()=>{const n=Date.now();Zu(()=>ke(async()=>{Ge()||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"),_.debug("CleanupComplete")},3e4)},Gg=()=>{de.pendingCheckInterval=window.setInterval(async()=>{ke(async()=>{await Ai()},"Error initiating pending captures")},5e3)};let Is=!1;const Ai=async(e=!1)=>{if(!Is)try{Is=!0;const t=parseInt(at??"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),nd(s.captureParams,s.canUpload)))),at=(t-r.length).toString(),ce.setItem("sprig.pendingCount",at)}finally{Is=!1}},Yg=async(e,t,r,n,s)=>{const i=Math.min(e+s,r),a=await Zu(()=>Q.getEventsBetween(e,i),"sdk_replay_get_events_between_seconds");if(!(a!=null&&a.length))return _.debug("NoEventsFound"),{validStartFound:n,events:[]};if(!n){_.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?(_.debug("ValidStartNotFound"),{validStartFound:n,events:[]}):{validStartFound:!0,events:a==null?void 0:a.slice(o)}}return{validStartFound:n,events:a}},td=e=>Promise.all(e.map(async t=>{const r=await(async n=>Uu.execute(async()=>{var a;_.info("UploadChunkStart",{chunkIndex:n.chunkIndex,surveyId:n.surveyId});const s=await He(n.uploadUrl,{body:n.data,method:"PUT"});_.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})),rd=async e=>{const t=await Q.getChunkUploadsByStatus({status:"UploadComplete",uploadId:e});if(!(t!=null&&t.length))return void _.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 Tu({apiUrl:s.apiUrl,surveyId:s.surveyId,uploadId:e,responseGroupUuid:s.responseGroupId,etags:n,headers:s.completeUploadHeaders,replayDuration:s.replayDuration}),await Q.deleteChunkUploads("UploadComplete",e)},$g=()=>{ke(async()=>{const e=await Q.getChunkUploadsByStatus({sessionId:we,status:"ReadyForUpload"});if(!(e!=null&&e.length))return;const t=await td(e);t!=null&&t.length&&await Promise.all(t.map(r=>{if(r)return rd(r)}))},"Error uploading unfinished chunks")},qg=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,[d,p]=[0,0],f=[];for(let h=n-35e3;h<s;h+=xi){if({validStartFound:u,events:f}=await Yg(h,n,s,u,xi),!(f!=null&&f.length)){_.debug("NoEventsFound");continue}d===0&&(d=f[0].timestamp),p=f[f.length-1].timestamp;const k=f.map(v=>v.event);k.push(`{"timestamp":${s}}`);const m=`${c?",":"["}${k}`,g=i.encode(m);Qu(()=>{l.write(g)},"sdk_replay_compression_seconds"),c=!0}if(p-d<ed)return _.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)},ul=async e=>{const{surveyId:t,responseGroupId:r,visitorId:n,apiUrl:s,completeUploadHeaders:i,replayParams:a,triggerTimestamp:o}=e,l=await qg(1e3*a.replayDurationSeconds,o);if(!(l!=null&&l.length))return void _.info("FileDataEmpty",{surveyId:t});const c=((d,p,f)=>{const y=d.length,h=1024*p*1024,k=Math.ceil(y/f),m=Math.max(h,k),g=[];let v=0;for(;v<y;)g.push(d.slice(v,v+m)),v+=m;return g})(l,a.minimumChunkSizeMb,a.signedUrls.length),u=await Promise.all(c.map(async(d,p)=>{const f=yt(),y={apiUrl:s,chunkIndex:p+1,completeUploadHeaders:i,etag:null,responseGroupId:r,status:"ReadyForUpload",surveyId:t,timestamp:o,totalChunks:c.length,data:d,uploadId:a.uploadId,uploadUrl:a.signedUrls[p].url,uuid:f,visitorId:n};return await(await Q.openDB()).add("chunkUploads",{...y,sessionId:y.sessionId??we}),y}));await(async(d,p)=>{await td(p),await Promise.all(d.map(f=>rd(f)))})([a.uploadId],u)},nd=async(e,t)=>{if(Ge())return _.debug("ReplayDisabled-ScheduleOrCapture");const{isHeatmap:r,isStandalone:n,replayParams:s,triggerTimestamp:i,responseGroupId:a}=e,o=async()=>{setTimeout(()=>z.removeListener(F.QuestionAnswered,o),0),ke(async()=>{s.replayDurationType==="before"?await ul(e):await Q.markPendingCaptureToCanUpload(a)},"Error in schedule/capture callback")};ke(async()=>{if(s.replayDurationType==="after"||s.replayDurationType==="beforeAndAfter")return!n&&!r&&z.on(F.QuestionAnswered,o),void await id(e);if(n||r||t)await ul(e),r&&Jg();else{const l=35+s.replayDurationSeconds,c=i-1e3*l,u=i;await Q.updateEventsExpiredAt(c,u,s.expirationTimeLimitMinutes),z.on(F.QuestionAnswered,o)}},"Error in scheduling/capturing replay")},Jg=async()=>{parseInt(at??"0")||ce.removeItem("sprig.isCapturingHeatmap"),ce.getItem("sprig.teardownAfterCapture")&&(Wu(),sd(),ce.removeItem("sprig.teardownAfterCapture"))},sd=async()=>Ge()?_.debug("ReplayDisabled-ClearData"):Promise.all([Q.deleteBySessionId("events",we),Q.deleteBySessionId("pendingCaptures",we)]).catch(e=>{wr("Error clearing user replay data",e)}),id=async e=>{if(Ge())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 _.info("PendingCaptureExists",{surveyId:r});t&&(Ei(),ce.setItem("sprig.isCapturingHeatmap","true"),Ri=Date.now(),de.inactivityInterval||(de.inactivityInterval=window.setInterval(()=>{var l;l=Ri,Date.now()-l>=3e4&&ke(()=>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,at=(parseInt(at??"0")+1).toString(),ce.setItem("sprig.pendingCount",at),await(await Q.openDB()).add("pendingCaptures",{canUpload:!1,captureParams:i,sessionId:we,targetTimestamp:a,timestamp:Date.now(),uuid:yt()})},Xg=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 Tu({surveyId:e,responseGroupUuid:t,eventDigest:r,apiUrl:s,headers:n},!0);return!(i!=null&&i.error)},checkPendingHeatmapsUrl:()=>Ge()?_.debug("ReplayDisabled-PendingHeatmaps"):ke(async()=>{const e=(await Q.getPendingCaptures({isHeatmap:!0})).map(t=>({eventId:t.captureParams.eventId,uuid:t.uuid})).filter(({eventId:t})=>!pu(t)).map(({uuid:t})=>t);return _.info("PendingHeatmapsToComplete",{count:e.length}),e.length&&(await Q.markPendingHeatmapsReady(e),_.info("MarkedPendingHeatmapsReady")),e.length},"Error marking pending heatmaps ready"),clearUserReplayData:sd,disableRecording:wr,initializeReplay:async({maxReplayDurationSeconds:e,maxInflightRequests:t=2,replaySettings:r,teardownAfter:n=!1,apiUrl:s,alwaysOnConfig:i})=>{if(i&&Dg({apiUrl:s,config:i,triggerSnapshot:()=>{Ei()}}),at=ce.getItem("sprig.pendingCount"),de.isRecording)return;if(n&&ce.setItem("sprig.teardownAfterCapture","true"),Ge())return _.debug("ReplayDisabled");if(await(async()=>{var l;if(!ju())return!0;if((l=window.navigator.storage)!=null&&l.estimate)try{const{quota:c=0,usage:u=0}=await window.navigator.storage.estimate(),d=(c-u)/1024**3;return _.info("Storage",{availableGb:d}),d<.5}catch{return!0}return!1})())return _.debug("IDBNotSupported"),ki();try{const l=await Q.openDB();_.info("DBVersion",{version:l.version})}catch(l){return _.error("ReplayOpenErr",{name:l.name}),l.name==="VersionError"&&Q.deleteDB(),ki()}ke(async()=>{await Ai(!0)},"Error uploading ready pending captures");const a=Tt()?30:0,o=Math.max(e??0,a);if(!o)return _.debug("MissingDuration");_.debug("ReplayInit"),await ke(async()=>{var l;r!=null&&r.minDuration&&(ed=r.minDuration),r!=null&&r.batchDuration&&(xi=r.batchDuration),l=t,Uu.setLimit(l),$g(),Hg(o+35,1800,o+35),Gg();const c=window.UserLeap.replayLibraryURL??"https://cdn.sprig.com/dependencies/record-2.0.0-alpha.17.min.js",u=window.rrwebRecord;if(!u)return _.error("RecordScriptFailed");let d=!0,p=0;const f={checkoutEveryNms:3e4,sampling:{input:"last",scroll:250,media:800},...r};var y,h;de.stopRecording=u({emit:(k,m)=>{if(k.type===it.Custom&&(Ri=Date.now()),Ge()||Mn())return;if(m&&k.type===it.Meta)p=performance.now();else if(m&&p&&k.type===it.FullSnapshot){const v=performance.now()-p;bu("sdk_replay_snapshot_seconds",v/1e3)}const g=d||!!m&&k.type===it.Meta;d=!1,jg(g,k),Wg({uuid:yt(),event:JSON.stringify(k),isValidStart:g,timestamp:Date.now()})},...f}),de.isRecording=!!de.stopRecording,de.isRecording&&(((k,m)=>{window.addEventListener("message",g=>{var v;g.data.type===Sg&&(oo.push({source:g.source,origin:g.origin}),(v=g.source)==null||v.postMessage({type:Ig,settings:k,replayLibraryUrl:m},{targetOrigin:g.origin}))})})(f,c),z.on("survey.complete",k=>{var m;m={id:k,userAgent:window.navigator.userAgent},qe("Sprig_SubmitSurvey",m)}),y=qe,h=Mg,An||(Ee=y,pn=h,window.addEventListener("click",Fu,We),window.addEventListener("pointerdown",zu,We),window.addEventListener("mousedown",Bu,We),window.addEventListener("keydown",_u,We),window.addEventListener("scroll",Nu,We),An=!0,Og(),Ag()))},"Error initializing replay")},isReplayPaused:Mn,isReplayRecording:()=>de.isRecording,recordFullSnapshot:Ei,recordReplayPaused:()=>{qe("Sprig_ReplayPaused",{timestamp:Date.now()}),ce.setItem("sprig.isReplayPaused","true")},recordReplayResumed:()=>{ce.removeItem("sprig.isReplayPaused"),qe("Sprig_ReplayResumed",{timestamp:Date.now()})},scheduleCapture:id,scheduleOrCaptureReplay:nd,tryReplayAction:ke,uploadReadyPendingCaptures:Ai},Symbol.toStringTag,{value:"Module"}));(e=>{te.replay=e})(Xg),window.UpChunk={createUpload:Gd},window.rrwebRecord=Yt,exports.APP_ID="ul-app",exports.ConflictingWidgets=tu,exports.DEFAULT_BORDER_COLOR="#e6e6e6",exports.DEFAULT_WIDTH_PX=360,exports.DismissReason=Ae,exports.EMBED_MOBILE_MAX_WIDTH=1030,exports.ERROR_BORDER_COLOR="#bd282a",exports.SprigAPI=yi,exports.SprigEvent=F,exports.breadcrumbsLogger=_,exports.calculateFrameDimensions=hu,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=Be,exports.isLongFormSurvey=e=>e==="longFormSurvey",exports.resetScrollPosition=e=>{const t=e.querySelector(".ul-card__container");t&&(t.scrollTop=0)},exports.setSurveyStyles=hr,exports.shouldDirectEmbed=eo,exports.sprig=hg,exports.sprigFetch=He,exports.v4=yt;