@sprig-technologies/sprig-bundled 1.1.5 → 1.1.6

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