@sprig-technologies/sprig-bundled 2.41.1 → 2.41.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use strict";var bd=Object.defineProperty;var Sd=(e,t,r)=>t in e?bd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var de=(e,t,r)=>Sd(e,typeof t!="symbol"?t+"":t,r);var Id=Object.create,po=Object.defineProperty,Cd=Object.getOwnPropertyDescriptor,kd=Object.getOwnPropertyNames,Ed=Object.getPrototypeOf,xd=Object.prototype.hasOwnProperty,gr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rd=gr((e,t)=>{var r;r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t.exports=r}),Ld=gr((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}),Od=gr((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}}),Ad=gr((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}),Md=gr((e,t)=>{var r=Rd(),n=Ld(),s=Od(),i=Ad();function a(c,u,d){var h=c;return n(u)?(d=u,typeof c=="string"&&(h={uri:c})):h=i(u,{uri:c}),h.callback=d,h}function o(c,u,d){return l(u=a(c,u,d))}function l(c){if(c.callback===void 0)throw new Error("callback argument missing");var u=!1,d=function(R,x,S){u||(u=!0,c.callback(R,x,S))};function h(){var R=void 0;if(R=p.response?p.response:p.responseText||function(x){try{if(x.responseType==="document")return x.responseXML;var S=x.responseXML&&x.responseXML.documentElement.nodeName==="parsererror";if(x.responseType===""&&!S)return x.responseXML}catch{}return null}(p),M)try{R=JSON.parse(R)}catch{}return R}function f(R){return clearTimeout(g),R instanceof Error||(R=new Error(""+(R||"Unknown XMLHttpRequest Error"))),R.statusCode=0,d(R,k)}function v(){if(!m){var R;clearTimeout(g),R=c.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var x=k,S=null;return R!==0?(x={body:h(),statusCode:R,method:C,headers:{},url:b,rawRequest:p},p.getAllResponseHeaders&&(x.headers=s(p.getAllResponseHeaders()))):S=new Error("Internal XMLHttpRequest Error"),d(S,x,x.body)}}var p=c.xhr||null;p||(p=c.cors||c.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var I,m,g,b=p.url=c.uri||c.url,C=p.method=c.method||"GET",A=c.body||c.data,E=p.headers=c.headers||{},T=!!c.sync,M=!1,k={body:void 0,headers:{},statusCode:0,method:C,url:b,rawRequest:p};if("json"in c&&c.json!==!1&&(M=!0,E.accept||E.Accept||(E.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(E["content-type"]||E["Content-Type"]||(E["Content-Type"]="application/json"),A=JSON.stringify(c.json===!0?A:c.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout(v,0)},p.onload=v,p.onerror=f,p.onprogress=function(){},p.onabort=function(){m=!0},p.ontimeout=f,p.open(C,b,!T,c.username,c.password),T||(p.withCredentials=!!c.withCredentials),!T&&c.timeout>0&&(g=setTimeout(function(){if(!m){m=!0,p.abort("timeout");var R=new Error("XMLHttpRequest timeout");R.code="ETIMEDOUT",f(R)}},c.timeout)),p.setRequestHeader)for(I in E)E.hasOwnProperty(I)&&p.setRequestHeader(I,E[I]);else if(c.headers&&!function(R){for(var x in R)if(R.hasOwnProperty(x))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(p.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(p),p.send(A||null),p}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,h){return(d=a(u,d,h)).method=c.toUpperCase(),l(d)}})});function Ui(e,t,...r){if(!e)throw new TypeError(dl(t,r))}function dl(e,t){let r=0;return e.replace(/%[os]/gu,()=>pl(t[r++]))}function pl(e){return typeof e!="object"||e===null?String(e):Object.prototype.toString.call(e)}var Te=typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:typeof globalThis<"u"?globalThis:void 0,ut=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{}}},Ud=new ut("W01","Unable to initialize event under dispatching."),Td=new ut("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),Dd=new ut("W03","Assigning any truthy value to 'returnValue' property has no effect."),Pd=new ut("W04","Unable to preventDefault on non-cancelable events."),_d=new ut("W05","Unable to preventDefault inside passive event listener invocation."),Nd=new ut("W06","An event listener wasn't added because it has been added already: %o, %o"),Xn=new ut("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),ho=new ut("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o"),Ke=class{static get NONE(){return mo}static get CAPTURING_PHASE(){return fo}static get AT_TARGET(){return go}static get BUBBLING_PHASE(){return yo}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=t??{};ks.set(this,{type:String(e),bubbles:!!r.bubbles,cancelable:!!r.cancelable,composed:!!r.composed,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return he(this).type}get target(){return he(this).target}get srcElement(){return he(this).target}get currentTarget(){return he(this).currentTarget}composedPath(){let e=he(this).currentTarget;return e?[e]:[]}get NONE(){return mo}get CAPTURING_PHASE(){return fo}get AT_TARGET(){return go}get BUBBLING_PHASE(){return yo}get eventPhase(){return he(this).dispatchFlag?2:0}stopPropagation(){he(this).stopPropagationFlag=!0}get cancelBubble(){return he(this).stopPropagationFlag}set cancelBubble(e){e?he(this).stopPropagationFlag=!0:Td.warn()}stopImmediatePropagation(){let e=he(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return he(this).bubbles}get cancelable(){return he(this).cancelable}get returnValue(){return!he(this).canceledFlag}set returnValue(e){e?Dd.warn():wo(he(this))}preventDefault(){wo(he(this))}get defaultPrevented(){return he(this).canceledFlag}get composed(){return he(this).composed}get isTrusted(){return!1}get timeStamp(){return he(this).timeStamp}initEvent(e,t=!1,r=!1){let n=he(this);n.dispatchFlag?Ud.warn():ks.set(this,{...n,type:String(e),bubbles:!!t,cancelable:!!r,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}},mo=0,fo=1,go=2,yo=3,ks=new WeakMap;function he(e,t="this"){let r=ks.get(e);return Ui(r!=null,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),r}function wo(e){e.inPassiveListenerFlag?_d.warn():e.cancelable?e.canceledFlag=!0:Pd.warn()}Object.defineProperty(Ke,"NONE",{enumerable:!0}),Object.defineProperty(Ke,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(Ke,"AT_TARGET",{enumerable:!0}),Object.defineProperty(Ke,"BUBBLING_PHASE",{enumerable:!0});var Zn=Object.getOwnPropertyNames(Ke.prototype);for(let e=0;e<Zn.length;++e)Zn[e]!=="constructor"&&Object.defineProperty(Ke.prototype,Zn[e],{enumerable:!0});Te!==void 0&&Te.Event!==void 0&&Object.setPrototypeOf(Ke.prototype,Te.Event.prototype);var bt,vo={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 bo(e){let t=Object.keys(vo);for(let r=0;r<t.length;++r){let n=t[r],s=vo[n];Object.defineProperty(e,n,{get:()=>s,configurable:!0,enumerable:!0})}}var gn=class extends Ke{static wrap(e){return new(ml(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),hl.set(this,{original:e});let t=Object.keys(e);for(let r=0;r<t.length;++r){let n=t[r];n in this||Object.defineProperty(this,n,fl(e,n))}}stopPropagation(){super.stopPropagation();let{original:e}=st(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;let{original:t}=st(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();let{original:e}=st(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;let{original:t}=st(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();let{original:e}=st(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){let{original:e}=st(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}},hl=new WeakMap;function st(e){let t=hl.get(e);return Ui(t!=null,"'this' is expected an Event object, but got",e),t}var yn=new WeakMap;function ml(e){let t=Object.getPrototypeOf(e);if(t==null)return gn;let r=yn.get(t);return r==null&&(r=function(n,s){class i extends n{}let a=Object.keys(s);for(let o=0;o<a.length;++o)Object.defineProperty(i.prototype,a[o],fl(s,a[o]));return i}(ml(t),t),yn.set(t,r)),r}function fl(e,t){let r=Object.getOwnPropertyDescriptor(e,t);return{get(){let n=st(this).original,s=n[t];return typeof s=="function"?s.bind(n):s},set(n){st(this).original[t]=n},configurable:r.configurable,enumerable:r.enumerable}}function gl(e){return!(1&~e.flags)}function So(e){return!(2&~e.flags)}function Io(e){return!(4&~e.flags)}function Fd(e){return!(8&~e.flags)}function Bd({callback:e},t,r){try{typeof e=="function"?e.call(t,r):typeof e.handleEvent=="function"&&e.handleEvent(r)}catch(n){(function(s){try{let i=s instanceof Error?s:new Error(pl(s));if(typeof dispatchEvent=="function"&&typeof ErrorEvent=="function")dispatchEvent(new ErrorEvent("error",{error:i,message:i.message}));else if(typeof process<"u"&&typeof process.emit=="function")return void process.emit("uncaughtException",i);console.error(i)}catch{}})(n)}}function yl({listeners:e},t,r){for(let n=0;n<e.length;++n)if(e[n].callback===t&&gl(e[n])===r)return n;return-1}function Co(e,t,r){let n=yl(e,t,r);return n!==-1&&wl(e,n)}function wl(e,t,r=!1){let n=e.listeners[t];return function(s){s.flags|=8}(n),n.signal&&n.signal.removeEventListener("abort",n.signalListener),e.cow&&!r?(e.cow=!1,e.listeners=e.listeners.filter((s,i)=>i!==t),!1):(e.listeners.splice(t,1),!0)}yn.set(Object.prototype,gn),Te!==void 0&&Te.Event!==void 0&&yn.set(Te.Event.prototype,gn);var Dn=class{constructor(){bl.set(this,Object.create(null))}addEventListener(e,t,r){let n=Qn(this),{callback:s,capture:i,once:a,passive:o,signal:l,type:c}=function(h,f,v){var p;return ko(f),typeof v=="object"&&v!==null?{type:String(h),callback:f??void 0,capture:!!v.capture,passive:!!v.passive,once:!!v.once,signal:(p=v.signal)!==null&&p!==void 0?p:void 0}:{type:String(h),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(h,f){var v;return(v=h[f])!==null&&v!==void 0?v:h[f]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(n,c),d=yl(u,s,i);d===-1?function(h,f,v,p,I,m){let g;m&&(g=Co.bind(null,h,f,v),m.addEventListener("abort",g));let b=function(C,A,E,T,M,k){return{callback:C,flags:(A?1:0)|(E?2:0)|(T?4:0),signal:M,signalListener:k}}(f,v,p,I,m,g);h.cow?(h.cow=!1,h.listeners=[...h.listeners,b]):h.listeners.push(b)}(u,s,i,o,a,l):function(h,f,v,p){Nd.warn(gl(h)?"capture":"bubble",h.callback),So(h)!==f&&Xn.warn("passive"),Io(h)!==v&&Xn.warn("once"),h.signal!==p&&Xn.warn("signal")}(u.listeners[d],o,a,l)}removeEventListener(e,t,r){let n=Qn(this),{callback:s,capture:i,type:a}=function(l,c,u){return ko(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&&Co(o,s,i)}dispatchEvent(e){let t=Qn(this)[String(e.type)];if(t==null)return!0;let r=e instanceof Ke?e:gn.wrap(e),n=he(r,"event");if(n.dispatchFlag)throw s="This event has been in dispatching.",Te.DOMException?new Te.DOMException(s,"InvalidStateError"):(bt==null&&(bt=class vl extends Error{constructor(a){super(a),Error.captureStackTrace&&Error.captureStackTrace(this,vl)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(bt.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),bo(bt),bo(bt.prototype)),new bt(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(!Fd(l)&&(Io(l)&&wl(t,o,!i)&&(o-=1),n.inPassiveListenerFlag=So(l),Bd(l,this,r),n.inPassiveListenerFlag=!1,n.stopImmediatePropagationFlag))break}i||(t.cow=!1)}return n.target=null,n.currentTarget=null,n.stopImmediatePropagationFlag=!1,n.stopPropagationFlag=!1,n.dispatchFlag=!1,!n.canceledFlag}},bl=new WeakMap;function Qn(e,t="this"){let r=bl.get(e);return Ui(r!=null,"'%s' must be an object that EventTarget constructor created, but got another one: %o",t,e),r}function ko(e){if(typeof e!="function"&&(typeof e!="object"||e===null||typeof e.handleEvent!="function")){if(e==null||typeof e=="object")return void ho.warn(e);throw new TypeError(dl(ho.message,[e]))}}var es=Object.getOwnPropertyNames(Dn.prototype);for(let e=0;e<es.length;++e)es[e]!=="constructor"&&Object.defineProperty(Dn.prototype,es[e],{enumerable:!0});Te!==void 0&&Te.EventTarget!==void 0&&Object.setPrototypeOf(Dn.prototype,Te.EventTarget.prototype);var Eo,zd=((e,t,r)=>(r=e!=null?Id(Ed(e)):{},((n,s,i,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of kd(s))!xd.call(n,o)&&o!==i&&po(n,o,{get:()=>s[o],enumerable:!(a=Cd(s,o))||a.enumerable});return n})(e&&e.__esModule?r:po(r,"default",{value:e,enumerable:!0}),e)))(Md()),Pn=512e3,_n=256,Es=(e,{minChunkSize:t=_n,maxChunkSize:r=Pn}={})=>e==null||typeof e=="number"&&e>=256&&e%256==0&&e>=t&&e<=r,xs=(e,{minChunkSize:t=_n,maxChunkSize:r=Pn}={})=>new TypeError(`chunkSize ${e} must be a positive number in multiples of 256, between ${t} and ${r}`),jd=class{constructor(e,t={}){var r,n,s;if(this.readableStream=e,!Es(t.defaultChunkSize,t))throw xs(t.defaultChunkSize,t);this.defaultChunkSize=(r=t.defaultChunkSize)!=null?r:30720,this.minChunkSize=(n=t.minChunkSize)!=null?n:_n,this.maxChunkSize=(s=t.maxChunkSize)!=null?s:Pn}get chunkSize(){var e;return(e=this._chunkSize)!=null?e:this.defaultChunkSize}set chunkSize(e){if(!Es(e,this))throw xs(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()}}},Wd=[200,201,202,204,308],Sl=[408,502,503,504],Il=(e,t)=>!!e&&Wd.includes(e.statusCode),Vd=(e,t)=>t.attemptCount>=t.attempts||!(Il(e)||((r,{retryCodes:n=Sl})=>!r||n.includes(r.statusCode))(e,t)),Cl=class{static createUpload(e){return new Cl(e)}constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.headers=e.headers||{},this.method=e.method||"PUT",this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.retryCodes=e.retryCodes||Sl,this.dynamicChunkSize=e.dynamicChunkSize||!1,this.maxFileBytes=1024*(e.maxFileSize||0),this.chunkCount=0,this.attemptCount=0,this.offline=!1,this._paused=!1,this.success=!1,this.nextChunkRangeStart=0,this.chunkedStreamIterable=new jd(this.file.stream(),{...e,defaultChunkSize:e.chunkSize}),this.chunkedStreamIterator=this.chunkedStreamIterable[Symbol.asyncIterator](),this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.eventTarget=new Dn,this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{!this.offline||(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}get maxChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.maxChunkSize)!=null?t:Pn}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:_n}get chunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.chunkSize)!=null?t:30720}set chunkSize(e){this.chunkedStreamIterable.chunkSize=e}get chunkByteSize(){return this.chunkedStreamIterable.chunkByteSize}get totalChunkSize(){return Math.ceil(this.file.size/this.chunkByteSize)}on(e,t){this.eventTarget.addEventListener(e,t)}once(e,t){this.eventTarget.addEventListener(e,t,{once:!0})}off(e,t){this.eventTarget.removeEventListener(e,t)}get paused(){return this._paused}abort(){var e;this.pause(),(e=this.currentXhr)==null||e.abort()}pause(){this._paused=!0}resume(){this._paused&&(this._paused=!1,this.sendChunks())}dispatch(e,t){let r=new CustomEvent(e,{detail:t});this.eventTarget.dispatchEvent(r)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint must be defined as a string or a function that returns a promise");if(!(this.file instanceof File))throw new TypeError("file must be a File object");if(this.headers&&typeof this.headers!="function"&&typeof this.headers!="object")throw new TypeError("headers must be null, an object, or a function that returns an object or a promise");if(!Es(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize}))throw xs(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,zd.default)({...e,beforeSend:t},(s,i)=>(this.currentXhr=void 0,s?n(s):r(i)))})}async sendChunk(e){let t=this.nextChunkRangeStart,r=t+e.size-1,n={...await(typeof this.headers=="function"?this.headers():this.headers),"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${r}/${this.file.size}`};return this.dispatch("attempt",{chunkNumber:this.chunkCount,totalChunks:this.totalChunks,chunkSize:this.chunkSize}),this.xhrPromise({headers:n,url:this.endpointValue,method:this.method,body:e})}async sendChunkWithRetries(e){let t;try{this.attemptCount=this.attemptCount+1,this.lastChunkStart=new Date,t=await this.sendChunk(e)}catch{}let r={retryCodes:this.retryCodes,attemptCount:this.attemptCount,attempts:this.attempts};return Il(t)?(async n=>{var s;let i=(new Date().getTime()-this.lastChunkStart.getTime())/1e3;if(this.dispatch("chunkSuccess",{chunk:this.chunkCount,chunkSize:this.chunkSize,attempts:this.attemptCount,timeInterval:i,response:n}),this.attemptCount=0,this.chunkCount=((s=this.chunkCount)!=null?s:0)+1,this.nextChunkRangeStart=this.nextChunkRangeStart+this.chunkByteSize,this.dynamicChunkSize){let a=this.chunkSize;i<10?a=Math.min(2*this.chunkSize,this.maxChunkSize):i>30&&(a=Math.max(this.chunkSize/2,this.minChunkSize)),this.chunkSize=256*Math.ceil(a/256);let o=(this.file.size-this.nextChunkRangeStart)/this.chunkByteSize;this.totalChunks=Math.ceil(this.chunkCount+o)}return!0})(t):Vd(t,r)?(async n=>(this.dispatch("error",{message:`Server responded with ${n.statusCode}. Stopping upload.`,chunk:this.chunkCount,attempts:this.attemptCount}),!1))(t):(async()=>(this.dispatch("attemptFailure",{message:`An error occured uploading chunk ${this.chunkCount}. ${this.attempts-this.attemptCount} retries left.`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount}),new Promise(n=>{setTimeout(async()=>{if(this._paused||this.offline)return this.pendingChunk=e,void n(!1);let s=await this.sendChunkWithRetries(e);n(s)},1e3*this.delayBeforeAttempt)})))()}async sendChunks(){if(this.pendingChunk&&!this._paused&&!this.offline){let e=this.pendingChunk;this.pendingChunk=void 0;let t=await this.sendChunkWithRetries(e);this.success&&t&&this.dispatch("success")}for(;!(this.success||this._paused||this.offline);){let{value:e,done:t}=await this.chunkedStreamIterator.next(),r=!e&&t;if(e&&(r=await this.sendChunkWithRetries(e)),this.success=!!t,this.success&&r&&this.dispatch("success"),!r)return}}},Gd=Cl.createUpload,Hd=Object.defineProperty,L=(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),$d=Object.defineProperty,xo=(e,t,r)=>((n,s,i)=>s in n?$d(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r),fe=(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))(fe||{});const Ro={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ir={};function Ti(e){if(Ir[e])return Ir[e];const t=globalThis[e],r=t.prototype,n=e in Ro?Ro[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 Lo?Lo[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return Ir[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?Ir[e]=c:r}catch{return r}}const ts={};function tt(e,t,r){var n;const s=`${e}.${String(r)}`;if(ts[s])return ts[s].call(t);const i=Ti(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(ts[s]=a,a.call(t)):t[r]}const rs={};function Oo(e,t,r){const n=`${e}.${String(r)}`;if(rs[n])return rs[n].bind(t);const s=Ti(e)[r];return typeof s!="function"?t[r]:(rs[n]=s,s.bind(t))}const we={childNodes:function(e){return tt("Node",e,"childNodes")},parentNode:function(e){return tt("Node",e,"parentNode")},parentElement:function(e){return tt("Node",e,"parentElement")},textContent:function(e){return tt("Node",e,"textContent")},contains:function(e,t){return Oo("Node",e,"contains")(t)},getRootNode:function(e){return Oo("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?tt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?tt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return tt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return tt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ti("MutationObserver").constructor}};function kl(e){return e.nodeType===e.ELEMENT_NODE}function Xt(e){const t=e&&"host"in e&&"mode"in e&&we.host(e)||null;return!!(t&&"shadowRoot"in t&&we.shadowRoot(t)===e)}function Zt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Jr(e){try{const r=e.rules||e.cssRules;return r?((t=Array.from(r,s=>El(s,e.href)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch{return null}var t}function El(e,t){if(function(r){return"styleSheet"in r}(e)){let r;try{r=Jr(e.styleSheet)||function(n){const{cssText:s}=n;if(s.split('"').length<3)return s;const i=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?i.push("layer"):n.layerName&&i.push(`layer(${n.layerName})`),n.supportsText&&i.push(`supports(${n.supportsText})`),n.media.length&&i.push(n.media.mediaText),i.join(" ")+";"}(e)}catch{r=e.cssText}return e.styleSheet.href?wn(r,e.styleSheet.href):r}{let r=e.cssText;return function(n){return"selectorText"in n}(e)&&e.selectorText.includes(":")&&(r=function(n){const s=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(s,"$1\\$2")}(r)),t?wn(r,t):r}}class xl{constructor(){xo(this,"idNodeMap",new Map),xo(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 Di({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let a=s||"";const o=n&&ft(n);return(t[r.toLowerCase()]||o&&t[o])&&(a=i?i(a,e):"*".repeat(a.length)),a}function ft(e){return e.toLowerCase()}const Ao="__rrweb_original__";function Pi(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ft(t):null}function Mo(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 Yd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qd=/^(?:[a-z+]+:)?\/\//i,Jd=/^www\..*/i,Kd=/^(data:)([^,]*),(.*)/i;function wn(e,t){return(e||"").replace(Yd,(r,n,s,i,a,o)=>{const l=s||a||o,c=n||i||"";if(!l)return r;if(qd.test(l)||Jd.test(l))return`url(${c}${l}${c})`;if(Kd.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${function(h){let f="";return f=h.indexOf("//")>-1?h.split("/").slice(0,3).join("/"):h.split("/")[0],f=f.split("?")[0],f}(t)+l}${c})`;const u=t.split("/"),d=l.split("/");u.pop();for(const h of d)h!=="."&&(h===".."?u.pop():u.push(h));return`url(${c}${u.join("/")}${c})`})}let Xd=1;const Zd=new RegExp("[^a-z0-9-_:]");function Rl(){return Xd++}let St,Uo;const Qd=/^[^ \t\n\r\u000c]+/,ep=/^[, \t\n\r\u000c]+/,To=new WeakMap;function Ft(e,t){return t&&t.trim()!==""?_i(e,t):t}function tp(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function _i(e,t){let r=To.get(e);if(r||(r=e.createElement("a"),To.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Ll(e,t,r,n){return n&&(r==="src"||r==="href"&&(t!=="use"||n[0]!=="#")||r==="xlink:href"&&n[0]!=="#"?Ft(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(ep),!(a>=i.length);){let c=o(Qd);if(c.slice(-1)===",")c=Ft(s,c.substring(0,c.length-1)),l.push(c);else{let u="";c=Ft(s,c);let d=!1;for(;;){const h=i.charAt(a);if(h===""){l.push((c+u).trim());break}if(d)h===")"&&(d=!1);else{if(h===","){a+=1,l.push((c+u).trim());break}h==="("&&(d=!0)}u+=h,a+=1}}}return l.join(", ")}(e,n):r==="style"?wn(n,_i(e)):t==="object"&&r==="data"?Ft(e,n):n:Ft(e,n))}function Ol(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function vn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&vn(we.parentNode(e),t,r);for(let n=e.classList.length;n--;){const s=e.classList[n];if(t.test(s))return!0}return!!r&&vn(we.parentNode(e),t,r)}function Al(e,t,r,n){let s;if(kl(e)){if(s=e,!we.childNodes(s).length)return!1}else{if(we.parentElement(e)===null)return!1;s=we.parentElement(e)}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(vn(s,t,n))return!0;if(r){if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}}catch{}return!1}function rp(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:a,inlineStylesheet:o,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:v,newlyAddedElement:p=!1}=t,I=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:fe.Document,childNodes:[],compatMode:e.compatMode}:{type:fe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:fe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return function(m,g){const{doc:b,blockClass:C,blockSelector:A,inlineStylesheet:E,maskInputOptions:T={},maskInputFn:M,dataURLOptions:k={},inlineImages:R,recordCanvas:x,keepIframeSrcFn:S,newlyAddedElement:D=!1,rootId:P}=g,w=function(O,N,ee){try{if(typeof N=="string"){if(O.classList.contains(N))return!0}else for(let q=O.classList.length;q--;){const me=O.classList[q];if(N.test(me))return!0}if(ee)return O.matches(ee)}catch{}return!1}(m,C,A),y=function(O){if(O instanceof HTMLFormElement)return"form";const N=ft(O.tagName);return Zd.test(N)?"div":N}(m);let U={};const B=m.attributes.length;for(let O=0;O<B;O++){const N=m.attributes[O];Ol(y,N.name,N.value)||(U[N.name]=Ll(b,y,ft(N.name),N.value))}if(y==="link"&&E){const O=Array.from(b.styleSheets).find(ee=>ee.href===m.href);let N=null;O&&(N=Jr(O)),N&&(delete U.rel,delete U.href,U._cssText=N)}if(y==="style"&&m.sheet&&!(m.innerText||we.textContent(m)||"").trim().length){const O=Jr(m.sheet);O&&(U._cssText=O)}if(y==="input"||y==="textarea"||y==="select"){const O=m.value,N=m.checked;U.type!=="radio"&&U.type!=="checkbox"&&U.type!=="submit"&&U.type!=="button"&&O?U.value=Di({element:m,type:Pi(m),tagName:y,value:O,maskInputOptions:T,maskInputFn:M}):N&&(U.checked=N)}if(y==="option"&&(m.selected&&!T.select?U.selected=!0:delete U.selected),y==="dialog"&&m.open&&(U.rr_open_mode=m.matches("dialog:modal")?"modal":"non-modal"),y==="canvas"&&x){if(m.__context==="2d")(function(O){const N=O.getContext("2d");if(!N)return!0;for(let ee=0;ee<O.width;ee+=50)for(let q=0;q<O.height;q+=50){const me=N.getImageData,Ne=Ao in me?me[Ao]:me;if(new Uint32Array(Ne.call(N,ee,q,Math.min(50,O.width-ee),Math.min(50,O.height-q)).data.buffer).some(V=>V!==0))return!1}return!0})(m)||(U.rr_dataURL=m.toDataURL(k.type,k.quality));else if(!("__context"in m)){const O=m.toDataURL(k.type,k.quality),N=b.createElement("canvas");N.width=m.width,N.height=m.height,O!==N.toDataURL(k.type,k.quality)&&(U.rr_dataURL=O)}}if(y==="img"&&R){St||(St=b.createElement("canvas"),Uo=St.getContext("2d"));const O=m,N=O.currentSrc||O.getAttribute("src")||"<unknown-src>",ee=O.crossOrigin,q=()=>{O.removeEventListener("load",q);try{St.width=O.naturalWidth,St.height=O.naturalHeight,Uo.drawImage(O,0,0),U.rr_dataURL=St.toDataURL(k.type,k.quality)}catch(me){if(O.crossOrigin!=="anonymous")return O.crossOrigin="anonymous",void(O.complete&&O.naturalWidth!==0?q():O.addEventListener("load",q));console.warn(`Cannot inline img src=${N}! Error: ${me}`)}O.crossOrigin==="anonymous"&&(ee?U.crossOrigin=ee:O.removeAttribute("crossorigin"))};O.complete&&O.naturalWidth!==0?q():O.addEventListener("load",q)}if(y==="audio"||y==="video"){const O=U;O.rr_mediaState=m.paused?"paused":"played",O.rr_mediaCurrentTime=m.currentTime,O.rr_mediaPlaybackRate=m.playbackRate,O.rr_mediaMuted=m.muted,O.rr_mediaLoop=m.loop,O.rr_mediaVolume=m.volume}if(D||(m.scrollLeft&&(U.rr_scrollLeft=m.scrollLeft),m.scrollTop&&(U.rr_scrollTop=m.scrollTop)),w){const{width:O,height:N}=m.getBoundingClientRect();U={class:U.class,rr_width:`${O}px`,rr_height:`${N}px`}}y!=="iframe"||S(U.src)||(m.contentDocument||(U.rr_src=U.src),delete U.src);let j;try{customElements.get(y)&&(j=!0)}catch{}return{type:fe.Element,tagName:y,attributes:U,childNodes:[],isSVG:tp(m)||void 0,needBlock:w,rootId:P,isCustom:j}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:v,newlyAddedElement:p,rootId:I});case e.TEXT_NODE:return function(m,g){var b;const{needsMask:C,maskTextFn:A,rootId:E}=g,T=we.parentNode(m),M=T&&T.tagName;let k=we.textContent(m);const R=M==="STYLE"||void 0,x=M==="SCRIPT"||void 0;if(R&&k){try{m.nextSibling||m.previousSibling||(b=T.sheet)!=null&&b.cssRules&&(k=Jr(T.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,m)}k=wn(k,_i(g.doc))}return x&&(k="SCRIPT_PLACEHOLDER"),!R&&!x&&k&&C&&(k=A?A(k,we.parentElement(m)):k.replace(/[\S]/g,"*")),{type:fe.Text,textContent:k||"",isStyle:R,rootId:E}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:I});case e.CDATA_SECTION_NODE:return{type:fe.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:fe.Comment,textContent:we.textContent(e)||"",rootId:I};default:return!1}}function te(e){return e==null?"":e.toLowerCase()}function xt(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:h,slimDOMOptions:f,dataURLOptions:v={},inlineImages:p=!1,recordCanvas:I=!1,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:E=()=>!1,newlyAddedElement:T=!1}=t;let{needsMask:M}=t,{preserveWhiteSpace:k=!0}=t;M||(M=Al(e,a,o,M===void 0));const R=rp(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:v,inlineImages:p,recordCanvas:I,keepIframeSrcFn:E,newlyAddedElement:T});if(!R)return console.warn(e,"not serialized"),null;let x;x=n.hasNode(e)?n.getId(e):!function(w,y){return!!(y.comment&&w.type===fe.Comment||w.type===fe.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"&&Mo(w.attributes.href)==="js")||y.headFavicon&&(w.tagName==="link"&&w.attributes.rel==="shortcut icon"||w.tagName==="meta"&&(te(w.attributes.name).match(/^msapplication-tile(image|color)$/)||te(w.attributes.name)==="application-name"||te(w.attributes.rel)==="icon"||te(w.attributes.rel)==="apple-touch-icon"||te(w.attributes.rel)==="shortcut icon"))||w.tagName==="meta"&&(y.headMetaDescKeywords&&te(w.attributes.name).match(/^description|keywords$/)||y.headMetaSocial&&(te(w.attributes.property).match(/^(og|twitter|fb):/)||te(w.attributes.name).match(/^(og|twitter):/)||te(w.attributes.name)==="pinterest")||y.headMetaRobots&&(te(w.attributes.name)==="robots"||te(w.attributes.name)==="googlebot"||te(w.attributes.name)==="bingbot")||y.headMetaHttpEquiv&&w.attributes["http-equiv"]!==void 0||y.headMetaAuthorship&&(te(w.attributes.name)==="author"||te(w.attributes.name)==="generator"||te(w.attributes.name)==="framework"||te(w.attributes.name)==="publisher"||te(w.attributes.name)==="progid"||te(w.attributes.property).match(/^article:/)||te(w.attributes.property).match(/^product:/))||y.headMetaVerification&&(te(w.attributes.name)==="google-site-verification"||te(w.attributes.name)==="yandex-verification"||te(w.attributes.name)==="csrf-token"||te(w.attributes.name)==="p:domain_verify"||te(w.attributes.name)==="verify-v1"||te(w.attributes.name)==="verification"||te(w.attributes.name)==="shopify-checkout-api-token"))))}(R,f)&&(k||R.type!==fe.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?Rl():-2;const S=Object.assign(R,{id:x});if(n.add(e,S),x===-2)return null;m&&m(e);let D=!l;if(S.type===fe.Element){D=D&&!S.needBlock,delete S.needBlock;const w=we.shadowRoot(e);w&&Zt(w)&&(S.isShadowHost=!0)}if((S.type===fe.Document||S.type===fe.Element)&&D){f.headWhitespace&&S.type===fe.Element&&S.tagName==="head"&&(k=!1);const w={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:v,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:E};if(!(S.type===fe.Element&&S.tagName==="textarea"&&S.attributes.value!==void 0))for(const U of Array.from(we.childNodes(e))){const B=xt(U,w);B&&S.childNodes.push(B)}let y=null;if(kl(e)&&(y=we.shadowRoot(e)))for(const U of Array.from(we.childNodes(y))){const B=xt(U,w);B&&(Zt(y)&&(B.isShadow=!0),S.childNodes.push(B))}}const P=we.parentNode(e);return P&&Xt(P)&&Zt(P)&&(S.isShadow=!0),S.type===fe.Element&&S.tagName==="iframe"&&function(w,y,U){const B=w.contentWindow;if(!B)return;let j,O=!1;try{j=B.document.readyState}catch{return}if(j!=="complete"){const ee=setTimeout(()=>{O||(y(),O=!0)},U);return void w.addEventListener("load",()=>{clearTimeout(ee),O=!0,y()})}const N="about:blank";if(B.location.href!==N||w.src===N||w.src==="")return setTimeout(y,0),w.addEventListener("load",y);w.addEventListener("load",y)}(e,()=>{const w=e.contentDocument;if(w&&g){const y=xt(w,{doc:w,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:v,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:E});y&&g(e,y)}},b),S.type===fe.Element&&S.tagName==="link"&&typeof S.attributes.rel=="string"&&(S.attributes.rel==="stylesheet"||S.attributes.rel==="preload"&&typeof S.attributes.href=="string"&&Mo(S.attributes.href)==="css")&&function(w,y,U){let B,j=!1;try{B=w.sheet}catch{return}if(B)return;const O=setTimeout(()=>{j||(y(),j=!0)},U);w.addEventListener("load",()=>{clearTimeout(O),j=!0,y()})}(e,()=>{if(C){const w=xt(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:v,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:E});w&&C(e,w)}},A),S}function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sp(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:{}},se=String,Do=function(){return{isColorSupported:!1,reset:se,bold:se,dim:se,italic:se,underline:se,inverse:se,hidden:se,strikethrough:se,black:se,red:se,green:se,yellow:se,blue:se,magenta:se,cyan:se,white:se,gray:se,bgBlack:se,bgRed:se,bgGreen:se,bgYellow:se,bgBlue:se,bgMagenta:se,bgCyan:se,bgWhite:se}};Rs.exports=Do(),Rs.exports.createColors=Do;var ip=Rs.exports;const Pe=sp(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Po=ip,_o=Pe,Ls=class Ml extends Error{constructor(t,r,n,s,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),a&&(this.plugin=a),r!==void 0&&n!==void 0&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ml)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=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=h=>c(d(h)),s=h=>u(h)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,h=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(h.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(h)+c+`
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}}),Ad=gr((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}),Md=gr((e,t)=>{var r=Rd(),n=Ld(),s=Od(),i=Ad();function a(c,u,d){var h=c;return n(u)?(d=u,typeof c=="string"&&(h={uri:c})):h=i(u,{uri:c}),h.callback=d,h}function o(c,u,d){return l(u=a(c,u,d))}function l(c){if(c.callback===void 0)throw new Error("callback argument missing");var u=!1,d=function(R,x,S){u||(u=!0,c.callback(R,x,S))};function h(){var R=void 0;if(R=p.response?p.response:p.responseText||function(x){try{if(x.responseType==="document")return x.responseXML;var S=x.responseXML&&x.responseXML.documentElement.nodeName==="parsererror";if(x.responseType===""&&!S)return x.responseXML}catch{}return null}(p),M)try{R=JSON.parse(R)}catch{}return R}function f(R){return clearTimeout(g),R instanceof Error||(R=new Error(""+(R||"Unknown XMLHttpRequest Error"))),R.statusCode=0,d(R,k)}function v(){if(!m){var R;clearTimeout(g),R=c.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var x=k,S=null;return R!==0?(x={body:h(),statusCode:R,method:C,headers:{},url:b,rawRequest:p},p.getAllResponseHeaders&&(x.headers=s(p.getAllResponseHeaders()))):S=new Error("Internal XMLHttpRequest Error"),d(S,x,x.body)}}var p=c.xhr||null;p||(p=c.cors||c.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var I,m,g,b=p.url=c.uri||c.url,C=p.method=c.method||"GET",A=c.body||c.data,E=p.headers=c.headers||{},T=!!c.sync,M=!1,k={body:void 0,headers:{},statusCode:0,method:C,url:b,rawRequest:p};if("json"in c&&c.json!==!1&&(M=!0,E.accept||E.Accept||(E.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(E["content-type"]||E["Content-Type"]||(E["Content-Type"]="application/json"),A=JSON.stringify(c.json===!0?A:c.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout(v,0)},p.onload=v,p.onerror=f,p.onprogress=function(){},p.onabort=function(){m=!0},p.ontimeout=f,p.open(C,b,!T,c.username,c.password),T||(p.withCredentials=!!c.withCredentials),!T&&c.timeout>0&&(g=setTimeout(function(){if(!m){m=!0,p.abort("timeout");var R=new Error("XMLHttpRequest timeout");R.code="ETIMEDOUT",f(R)}},c.timeout)),p.setRequestHeader)for(I in E)E.hasOwnProperty(I)&&p.setRequestHeader(I,E[I]);else if(c.headers&&!function(R){for(var x in R)if(R.hasOwnProperty(x))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(p.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(p),p.send(A||null),p}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,h){return(d=a(u,d,h)).method=c.toUpperCase(),l(d)}})});function Ui(e,t,...r){if(!e)throw new TypeError(dl(t,r))}function dl(e,t){let r=0;return e.replace(/%[os]/gu,()=>pl(t[r++]))}function pl(e){return typeof e!="object"||e===null?String(e):Object.prototype.toString.call(e)}var Ue=typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:typeof globalThis<"u"?globalThis:void 0,ut=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{}}},Ud=new ut("W01","Unable to initialize event under dispatching."),Td=new ut("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),Dd=new ut("W03","Assigning any truthy value to 'returnValue' property has no effect."),Pd=new ut("W04","Unable to preventDefault on non-cancelable events."),_d=new ut("W05","Unable to preventDefault inside passive event listener invocation."),Nd=new ut("W06","An event listener wasn't added because it has been added already: %o, %o"),Xn=new ut("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),ho=new ut("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o"),Je=class{static get NONE(){return mo}static get CAPTURING_PHASE(){return fo}static get AT_TARGET(){return go}static get BUBBLING_PHASE(){return yo}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let r=t??{};ks.set(this,{type:String(e),bubbles:!!r.bubbles,cancelable:!!r.cancelable,composed:!!r.composed,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return he(this).type}get target(){return he(this).target}get srcElement(){return he(this).target}get currentTarget(){return he(this).currentTarget}composedPath(){let e=he(this).currentTarget;return e?[e]:[]}get NONE(){return mo}get CAPTURING_PHASE(){return fo}get AT_TARGET(){return go}get BUBBLING_PHASE(){return yo}get eventPhase(){return he(this).dispatchFlag?2:0}stopPropagation(){he(this).stopPropagationFlag=!0}get cancelBubble(){return he(this).stopPropagationFlag}set cancelBubble(e){e?he(this).stopPropagationFlag=!0:Td.warn()}stopImmediatePropagation(){let e=he(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return he(this).bubbles}get cancelable(){return he(this).cancelable}get returnValue(){return!he(this).canceledFlag}set returnValue(e){e?Dd.warn():wo(he(this))}preventDefault(){wo(he(this))}get defaultPrevented(){return he(this).canceledFlag}get composed(){return he(this).composed}get isTrusted(){return!1}get timeStamp(){return he(this).timeStamp}initEvent(e,t=!1,r=!1){let n=he(this);n.dispatchFlag?Ud.warn():ks.set(this,{...n,type:String(e),bubbles:!!t,cancelable:!!r,target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}},mo=0,fo=1,go=2,yo=3,ks=new WeakMap;function he(e,t="this"){let r=ks.get(e);return Ui(r!=null,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),r}function wo(e){e.inPassiveListenerFlag?_d.warn():e.cancelable?e.canceledFlag=!0:Pd.warn()}Object.defineProperty(Je,"NONE",{enumerable:!0}),Object.defineProperty(Je,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(Je,"AT_TARGET",{enumerable:!0}),Object.defineProperty(Je,"BUBBLING_PHASE",{enumerable:!0});var Zn=Object.getOwnPropertyNames(Je.prototype);for(let e=0;e<Zn.length;++e)Zn[e]!=="constructor"&&Object.defineProperty(Je.prototype,Zn[e],{enumerable:!0});Ue!==void 0&&Ue.Event!==void 0&&Object.setPrototypeOf(Je.prototype,Ue.Event.prototype);var bt,vo={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 bo(e){let t=Object.keys(vo);for(let r=0;r<t.length;++r){let n=t[r],s=vo[n];Object.defineProperty(e,n,{get:()=>s,configurable:!0,enumerable:!0})}}var gn=class extends Je{static wrap(e){return new(ml(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),hl.set(this,{original:e});let t=Object.keys(e);for(let r=0;r<t.length;++r){let n=t[r];n in this||Object.defineProperty(this,n,fl(e,n))}}stopPropagation(){super.stopPropagation();let{original:e}=nt(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;let{original:t}=nt(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();let{original:e}=nt(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;let{original:t}=nt(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();let{original:e}=nt(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){let{original:e}=nt(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}},hl=new WeakMap;function nt(e){let t=hl.get(e);return Ui(t!=null,"'this' is expected an Event object, but got",e),t}var yn=new WeakMap;function ml(e){let t=Object.getPrototypeOf(e);if(t==null)return gn;let r=yn.get(t);return r==null&&(r=function(n,s){class i extends n{}let a=Object.keys(s);for(let o=0;o<a.length;++o)Object.defineProperty(i.prototype,a[o],fl(s,a[o]));return i}(ml(t),t),yn.set(t,r)),r}function fl(e,t){let r=Object.getOwnPropertyDescriptor(e,t);return{get(){let n=nt(this).original,s=n[t];return typeof s=="function"?s.bind(n):s},set(n){nt(this).original[t]=n},configurable:r.configurable,enumerable:r.enumerable}}function gl(e){return!(1&~e.flags)}function So(e){return!(2&~e.flags)}function Io(e){return!(4&~e.flags)}function Fd(e){return!(8&~e.flags)}function Bd({callback:e},t,r){try{typeof e=="function"?e.call(t,r):typeof e.handleEvent=="function"&&e.handleEvent(r)}catch(n){(function(s){try{let i=s instanceof Error?s:new Error(pl(s));if(typeof dispatchEvent=="function"&&typeof ErrorEvent=="function")dispatchEvent(new ErrorEvent("error",{error:i,message:i.message}));else if(typeof process<"u"&&typeof process.emit=="function")return void process.emit("uncaughtException",i);console.error(i)}catch{}})(n)}}function yl({listeners:e},t,r){for(let n=0;n<e.length;++n)if(e[n].callback===t&&gl(e[n])===r)return n;return-1}function Co(e,t,r){let n=yl(e,t,r);return n!==-1&&wl(e,n)}function wl(e,t,r=!1){let n=e.listeners[t];return function(s){s.flags|=8}(n),n.signal&&n.signal.removeEventListener("abort",n.signalListener),e.cow&&!r?(e.cow=!1,e.listeners=e.listeners.filter((s,i)=>i!==t),!1):(e.listeners.splice(t,1),!0)}yn.set(Object.prototype,gn),Ue!==void 0&&Ue.Event!==void 0&&yn.set(Ue.Event.prototype,gn);var Dn=class{constructor(){bl.set(this,Object.create(null))}addEventListener(e,t,r){let n=Qn(this),{callback:s,capture:i,once:a,passive:o,signal:l,type:c}=function(h,f,v){var p;return ko(f),typeof v=="object"&&v!==null?{type:String(h),callback:f??void 0,capture:!!v.capture,passive:!!v.passive,once:!!v.once,signal:(p=v.signal)!==null&&p!==void 0?p:void 0}:{type:String(h),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(h,f){var v;return(v=h[f])!==null&&v!==void 0?v:h[f]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(n,c),d=yl(u,s,i);d===-1?function(h,f,v,p,I,m){let g;m&&(g=Co.bind(null,h,f,v),m.addEventListener("abort",g));let b=function(C,A,E,T,M,k){return{callback:C,flags:(A?1:0)|(E?2:0)|(T?4:0),signal:M,signalListener:k}}(f,v,p,I,m,g);h.cow?(h.cow=!1,h.listeners=[...h.listeners,b]):h.listeners.push(b)}(u,s,i,o,a,l):function(h,f,v,p){Nd.warn(gl(h)?"capture":"bubble",h.callback),So(h)!==f&&Xn.warn("passive"),Io(h)!==v&&Xn.warn("once"),h.signal!==p&&Xn.warn("signal")}(u.listeners[d],o,a,l)}removeEventListener(e,t,r){let n=Qn(this),{callback:s,capture:i,type:a}=function(l,c,u){return ko(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&&Co(o,s,i)}dispatchEvent(e){let t=Qn(this)[String(e.type)];if(t==null)return!0;let r=e instanceof Je?e:gn.wrap(e),n=he(r,"event");if(n.dispatchFlag)throw s="This event has been in dispatching.",Ue.DOMException?new Ue.DOMException(s,"InvalidStateError"):(bt==null&&(bt=class vl extends Error{constructor(a){super(a),Error.captureStackTrace&&Error.captureStackTrace(this,vl)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(bt.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),bo(bt),bo(bt.prototype)),new bt(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(!Fd(l)&&(Io(l)&&wl(t,o,!i)&&(o-=1),n.inPassiveListenerFlag=So(l),Bd(l,this,r),n.inPassiveListenerFlag=!1,n.stopImmediatePropagationFlag))break}i||(t.cow=!1)}return n.target=null,n.currentTarget=null,n.stopImmediatePropagationFlag=!1,n.stopPropagationFlag=!1,n.dispatchFlag=!1,!n.canceledFlag}},bl=new WeakMap;function Qn(e,t="this"){let r=bl.get(e);return Ui(r!=null,"'%s' must be an object that EventTarget constructor created, but got another one: %o",t,e),r}function ko(e){if(typeof e!="function"&&(typeof e!="object"||e===null||typeof e.handleEvent!="function")){if(e==null||typeof e=="object")return void ho.warn(e);throw new TypeError(dl(ho.message,[e]))}}var es=Object.getOwnPropertyNames(Dn.prototype);for(let e=0;e<es.length;++e)es[e]!=="constructor"&&Object.defineProperty(Dn.prototype,es[e],{enumerable:!0});Ue!==void 0&&Ue.EventTarget!==void 0&&Object.setPrototypeOf(Dn.prototype,Ue.EventTarget.prototype);var Eo,zd=((e,t,r)=>(r=e!=null?Id(Ed(e)):{},((n,s,i,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of kd(s))!xd.call(n,o)&&o!==i&&po(n,o,{get:()=>s[o],enumerable:!(a=Cd(s,o))||a.enumerable});return n})(e&&e.__esModule?r:po(r,"default",{value:e,enumerable:!0}),e)))(Md()),Pn=512e3,_n=256,Es=(e,{minChunkSize:t=_n,maxChunkSize:r=Pn}={})=>e==null||typeof e=="number"&&e>=256&&e%256==0&&e>=t&&e<=r,xs=(e,{minChunkSize:t=_n,maxChunkSize:r=Pn}={})=>new TypeError(`chunkSize ${e} must be a positive number in multiples of 256, between ${t} and ${r}`),jd=class{constructor(e,t={}){var r,n,s;if(this.readableStream=e,!Es(t.defaultChunkSize,t))throw xs(t.defaultChunkSize,t);this.defaultChunkSize=(r=t.defaultChunkSize)!=null?r:30720,this.minChunkSize=(n=t.minChunkSize)!=null?n:_n,this.maxChunkSize=(s=t.maxChunkSize)!=null?s:Pn}get chunkSize(){var e;return(e=this._chunkSize)!=null?e:this.defaultChunkSize}set chunkSize(e){if(!Es(e,this))throw xs(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()}}},Wd=[200,201,202,204,308],Sl=[408,502,503,504],Il=(e,t)=>!!e&&Wd.includes(e.statusCode),Vd=(e,t)=>t.attemptCount>=t.attempts||!(Il(e)||((r,{retryCodes:n=Sl})=>!r||n.includes(r.statusCode))(e,t)),Cl=class{static createUpload(e){return new Cl(e)}constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.headers=e.headers||{},this.method=e.method||"PUT",this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.retryCodes=e.retryCodes||Sl,this.dynamicChunkSize=e.dynamicChunkSize||!1,this.maxFileBytes=1024*(e.maxFileSize||0),this.chunkCount=0,this.attemptCount=0,this.offline=!1,this._paused=!1,this.success=!1,this.nextChunkRangeStart=0,this.chunkedStreamIterable=new jd(this.file.stream(),{...e,defaultChunkSize:e.chunkSize}),this.chunkedStreamIterator=this.chunkedStreamIterable[Symbol.asyncIterator](),this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.eventTarget=new Dn,this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{!this.offline||(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}get maxChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.maxChunkSize)!=null?t:Pn}get minChunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.minChunkSize)!=null?t:_n}get chunkSize(){var e,t;return(t=(e=this.chunkedStreamIterable)==null?void 0:e.chunkSize)!=null?t:30720}set chunkSize(e){this.chunkedStreamIterable.chunkSize=e}get chunkByteSize(){return this.chunkedStreamIterable.chunkByteSize}get totalChunkSize(){return Math.ceil(this.file.size/this.chunkByteSize)}on(e,t){this.eventTarget.addEventListener(e,t)}once(e,t){this.eventTarget.addEventListener(e,t,{once:!0})}off(e,t){this.eventTarget.removeEventListener(e,t)}get paused(){return this._paused}abort(){var e;this.pause(),(e=this.currentXhr)==null||e.abort()}pause(){this._paused=!0}resume(){this._paused&&(this._paused=!1,this.sendChunks())}dispatch(e,t){let r=new CustomEvent(e,{detail:t});this.eventTarget.dispatchEvent(r)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint must be defined as a string or a function that returns a promise");if(!(this.file instanceof File))throw new TypeError("file must be a File object");if(this.headers&&typeof this.headers!="function"&&typeof this.headers!="object")throw new TypeError("headers must be null, an object, or a function that returns an object or a promise");if(!Es(this.chunkSize,{maxChunkSize:this.maxChunkSize,minChunkSize:this.minChunkSize}))throw xs(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,zd.default)({...e,beforeSend:t},(s,i)=>(this.currentXhr=void 0,s?n(s):r(i)))})}async sendChunk(e){let t=this.nextChunkRangeStart,r=t+e.size-1,n={...await(typeof this.headers=="function"?this.headers():this.headers),"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${r}/${this.file.size}`};return this.dispatch("attempt",{chunkNumber:this.chunkCount,totalChunks:this.totalChunks,chunkSize:this.chunkSize}),this.xhrPromise({headers:n,url:this.endpointValue,method:this.method,body:e})}async sendChunkWithRetries(e){let t;try{this.attemptCount=this.attemptCount+1,this.lastChunkStart=new Date,t=await this.sendChunk(e)}catch{}let r={retryCodes:this.retryCodes,attemptCount:this.attemptCount,attempts:this.attempts};return Il(t)?(async n=>{var s;let i=(new Date().getTime()-this.lastChunkStart.getTime())/1e3;if(this.dispatch("chunkSuccess",{chunk:this.chunkCount,chunkSize:this.chunkSize,attempts:this.attemptCount,timeInterval:i,response:n}),this.attemptCount=0,this.chunkCount=((s=this.chunkCount)!=null?s:0)+1,this.nextChunkRangeStart=this.nextChunkRangeStart+this.chunkByteSize,this.dynamicChunkSize){let a=this.chunkSize;i<10?a=Math.min(2*this.chunkSize,this.maxChunkSize):i>30&&(a=Math.max(this.chunkSize/2,this.minChunkSize)),this.chunkSize=256*Math.ceil(a/256);let o=(this.file.size-this.nextChunkRangeStart)/this.chunkByteSize;this.totalChunks=Math.ceil(this.chunkCount+o)}return!0})(t):Vd(t,r)?(async n=>(this.dispatch("error",{message:`Server responded with ${n.statusCode}. Stopping upload.`,chunk:this.chunkCount,attempts:this.attemptCount}),!1))(t):(async()=>(this.dispatch("attemptFailure",{message:`An error occured uploading chunk ${this.chunkCount}. ${this.attempts-this.attemptCount} retries left.`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount}),new Promise(n=>{setTimeout(async()=>{if(this._paused||this.offline)return this.pendingChunk=e,void n(!1);let s=await this.sendChunkWithRetries(e);n(s)},1e3*this.delayBeforeAttempt)})))()}async sendChunks(){if(this.pendingChunk&&!this._paused&&!this.offline){let e=this.pendingChunk;this.pendingChunk=void 0;let t=await this.sendChunkWithRetries(e);this.success&&t&&this.dispatch("success")}for(;!(this.success||this._paused||this.offline);){let{value:e,done:t}=await this.chunkedStreamIterator.next(),r=!e&&t;if(e&&(r=await this.sendChunkWithRetries(e)),this.success=!!t,this.success&&r&&this.dispatch("success"),!r)return}}},Gd=Cl.createUpload,Hd=Object.defineProperty,L=(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),$d=Object.defineProperty,xo=(e,t,r)=>((n,s,i)=>s in n?$d(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r),fe=(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))(fe||{});const Ro={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ir={};function Ti(e){if(Ir[e])return Ir[e];const t=globalThis[e],r=t.prototype,n=e in Ro?Ro[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 Lo?Lo[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return Ir[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?Ir[e]=c:r}catch{return r}}const ts={};function et(e,t,r){var n;const s=`${e}.${String(r)}`;if(ts[s])return ts[s].call(t);const i=Ti(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(ts[s]=a,a.call(t)):t[r]}const rs={};function Oo(e,t,r){const n=`${e}.${String(r)}`;if(rs[n])return rs[n].bind(t);const s=Ti(e)[r];return typeof s!="function"?t[r]:(rs[n]=s,s.bind(t))}const we={childNodes:function(e){return et("Node",e,"childNodes")},parentNode:function(e){return et("Node",e,"parentNode")},parentElement:function(e){return et("Node",e,"parentElement")},textContent:function(e){return et("Node",e,"textContent")},contains:function(e,t){return Oo("Node",e,"contains")(t)},getRootNode:function(e){return Oo("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?et("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?et("Element",e,"shadowRoot"):null},querySelector:function(e,t){return et("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return et("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ti("MutationObserver").constructor}};function kl(e){return e.nodeType===e.ELEMENT_NODE}function Xt(e){const t=e&&"host"in e&&"mode"in e&&we.host(e)||null;return!!(t&&"shadowRoot"in t&&we.shadowRoot(t)===e)}function Zt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Jr(e){try{const r=e.rules||e.cssRules;return r?((t=Array.from(r,s=>El(s,e.href)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch{return null}var t}function El(e,t){if(function(r){return"styleSheet"in r}(e)){let r;try{r=Jr(e.styleSheet)||function(n){const{cssText:s}=n;if(s.split('"').length<3)return s;const i=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?i.push("layer"):n.layerName&&i.push(`layer(${n.layerName})`),n.supportsText&&i.push(`supports(${n.supportsText})`),n.media.length&&i.push(n.media.mediaText),i.join(" ")+";"}(e)}catch{r=e.cssText}return e.styleSheet.href?wn(r,e.styleSheet.href):r}{let r=e.cssText;return function(n){return"selectorText"in n}(e)&&e.selectorText.includes(":")&&(r=function(n){const s=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(s,"$1\\$2")}(r)),t?wn(r,t):r}}class xl{constructor(){xo(this,"idNodeMap",new Map),xo(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 Di({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let a=s||"";const o=n&&ft(n);return(t[r.toLowerCase()]||o&&t[o])&&(a=i?i(a,e):"*".repeat(a.length)),a}function ft(e){return e.toLowerCase()}const Ao="__rrweb_original__";function Pi(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ft(t):null}function Mo(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 Yd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qd=/^(?:[a-z+]+:)?\/\//i,Jd=/^www\..*/i,Kd=/^(data:)([^,]*),(.*)/i;function wn(e,t){return(e||"").replace(Yd,(r,n,s,i,a,o)=>{const l=s||a||o,c=n||i||"";if(!l)return r;if(qd.test(l)||Jd.test(l))return`url(${c}${l}${c})`;if(Kd.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${function(h){let f="";return f=h.indexOf("//")>-1?h.split("/").slice(0,3).join("/"):h.split("/")[0],f=f.split("?")[0],f}(t)+l}${c})`;const u=t.split("/"),d=l.split("/");u.pop();for(const h of d)h!=="."&&(h===".."?u.pop():u.push(h));return`url(${c}${u.join("/")}${c})`})}let Xd=1;const Zd=new RegExp("[^a-z0-9-_:]");function Rl(){return Xd++}let St,Uo;const Qd=/^[^ \t\n\r\u000c]+/,ep=/^[, \t\n\r\u000c]+/,To=new WeakMap;function Ft(e,t){return t&&t.trim()!==""?_i(e,t):t}function tp(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function _i(e,t){let r=To.get(e);if(r||(r=e.createElement("a"),To.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Ll(e,t,r,n){return n&&(r==="src"||r==="href"&&(t!=="use"||n[0]!=="#")||r==="xlink:href"&&n[0]!=="#"?Ft(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(ep),!(a>=i.length);){let c=o(Qd);if(c.slice(-1)===",")c=Ft(s,c.substring(0,c.length-1)),l.push(c);else{let u="";c=Ft(s,c);let d=!1;for(;;){const h=i.charAt(a);if(h===""){l.push((c+u).trim());break}if(d)h===")"&&(d=!1);else{if(h===","){a+=1,l.push((c+u).trim());break}h==="("&&(d=!0)}u+=h,a+=1}}}return l.join(", ")}(e,n):r==="style"?wn(n,_i(e)):t==="object"&&r==="data"?Ft(e,n):n:Ft(e,n))}function Ol(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function vn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&vn(we.parentNode(e),t,r);for(let n=e.classList.length;n--;){const s=e.classList[n];if(t.test(s))return!0}return!!r&&vn(we.parentNode(e),t,r)}function Al(e,t,r,n){let s;if(kl(e)){if(s=e,!we.childNodes(s).length)return!1}else{if(we.parentElement(e)===null)return!1;s=we.parentElement(e)}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(vn(s,t,n))return!0;if(r){if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}}catch{}return!1}function rp(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:a,inlineStylesheet:o,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:v,newlyAddedElement:p=!1}=t,I=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:fe.Document,childNodes:[],compatMode:e.compatMode}:{type:fe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:fe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return function(m,g){const{doc:b,blockClass:C,blockSelector:A,inlineStylesheet:E,maskInputOptions:T={},maskInputFn:M,dataURLOptions:k={},inlineImages:R,recordCanvas:x,keepIframeSrcFn:S,newlyAddedElement:D=!1,rootId:P}=g,w=function(O,N,te){try{if(typeof N=="string"){if(O.classList.contains(N))return!0}else for(let q=O.classList.length;q--;){const me=O.classList[q];if(N.test(me))return!0}if(te)return O.matches(te)}catch{}return!1}(m,C,A),y=function(O){if(O instanceof HTMLFormElement)return"form";const N=ft(O.tagName);return Zd.test(N)?"div":N}(m);let U={};const B=m.attributes.length;for(let O=0;O<B;O++){const N=m.attributes[O];Ol(y,N.name,N.value)||(U[N.name]=Ll(b,y,ft(N.name),N.value))}if(y==="link"&&E){const O=Array.from(b.styleSheets).find(te=>te.href===m.href);let N=null;O&&(N=Jr(O)),N&&(delete U.rel,delete U.href,U._cssText=N)}if(y==="style"&&m.sheet&&!(m.innerText||we.textContent(m)||"").trim().length){const O=Jr(m.sheet);O&&(U._cssText=O)}if(y==="input"||y==="textarea"||y==="select"){const O=m.value,N=m.checked;U.type!=="radio"&&U.type!=="checkbox"&&U.type!=="submit"&&U.type!=="button"&&O?U.value=Di({element:m,type:Pi(m),tagName:y,value:O,maskInputOptions:T,maskInputFn:M}):N&&(U.checked=N)}if(y==="option"&&(m.selected&&!T.select?U.selected=!0:delete U.selected),y==="dialog"&&m.open&&(U.rr_open_mode=m.matches("dialog:modal")?"modal":"non-modal"),y==="canvas"&&x){if(m.__context==="2d")(function(O){const N=O.getContext("2d");if(!N)return!0;for(let te=0;te<O.width;te+=50)for(let q=0;q<O.height;q+=50){const me=N.getImageData,_e=Ao in me?me[Ao]:me;if(new Uint32Array(_e.call(N,te,q,Math.min(50,O.width-te),Math.min(50,O.height-q)).data.buffer).some(V=>V!==0))return!1}return!0})(m)||(U.rr_dataURL=m.toDataURL(k.type,k.quality));else if(!("__context"in m)){const O=m.toDataURL(k.type,k.quality),N=b.createElement("canvas");N.width=m.width,N.height=m.height,O!==N.toDataURL(k.type,k.quality)&&(U.rr_dataURL=O)}}if(y==="img"&&R){St||(St=b.createElement("canvas"),Uo=St.getContext("2d"));const O=m,N=O.currentSrc||O.getAttribute("src")||"<unknown-src>",te=O.crossOrigin,q=()=>{O.removeEventListener("load",q);try{St.width=O.naturalWidth,St.height=O.naturalHeight,Uo.drawImage(O,0,0),U.rr_dataURL=St.toDataURL(k.type,k.quality)}catch(me){if(O.crossOrigin!=="anonymous")return O.crossOrigin="anonymous",void(O.complete&&O.naturalWidth!==0?q():O.addEventListener("load",q));console.warn(`Cannot inline img src=${N}! Error: ${me}`)}O.crossOrigin==="anonymous"&&(te?U.crossOrigin=te:O.removeAttribute("crossorigin"))};O.complete&&O.naturalWidth!==0?q():O.addEventListener("load",q)}if(y==="audio"||y==="video"){const O=U;O.rr_mediaState=m.paused?"paused":"played",O.rr_mediaCurrentTime=m.currentTime,O.rr_mediaPlaybackRate=m.playbackRate,O.rr_mediaMuted=m.muted,O.rr_mediaLoop=m.loop,O.rr_mediaVolume=m.volume}if(D||(m.scrollLeft&&(U.rr_scrollLeft=m.scrollLeft),m.scrollTop&&(U.rr_scrollTop=m.scrollTop)),w){const{width:O,height:N}=m.getBoundingClientRect();U={class:U.class,rr_width:`${O}px`,rr_height:`${N}px`}}y!=="iframe"||S(U.src)||(m.contentDocument||(U.rr_src=U.src),delete U.src);let j;try{customElements.get(y)&&(j=!0)}catch{}return{type:fe.Element,tagName:y,attributes:U,childNodes:[],isSVG:tp(m)||void 0,needBlock:w,rootId:P,isCustom:j}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:v,newlyAddedElement:p,rootId:I});case e.TEXT_NODE:return function(m,g){var b;const{needsMask:C,maskTextFn:A,rootId:E}=g,T=we.parentNode(m),M=T&&T.tagName;let k=we.textContent(m);const R=M==="STYLE"||void 0,x=M==="SCRIPT"||void 0;if(R&&k){try{m.nextSibling||m.previousSibling||(b=T.sheet)!=null&&b.cssRules&&(k=Jr(T.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,m)}k=wn(k,_i(g.doc))}return x&&(k="SCRIPT_PLACEHOLDER"),!R&&!x&&k&&C&&(k=A?A(k,we.parentElement(m)):k.replace(/[\S]/g,"*")),{type:fe.Text,textContent:k||"",isStyle:R,rootId:E}}(e,{doc:r,needsMask:a,maskTextFn:c,rootId:I});case e.CDATA_SECTION_NODE:return{type:fe.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:fe.Comment,textContent:we.textContent(e)||"",rootId:I};default:return!1}}function re(e){return e==null?"":e.toLowerCase()}function xt(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:h,slimDOMOptions:f,dataURLOptions:v={},inlineImages:p=!1,recordCanvas:I=!1,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:E=()=>!1,newlyAddedElement:T=!1}=t;let{needsMask:M}=t,{preserveWhiteSpace:k=!0}=t;M||(M=Al(e,a,o,M===void 0));const R=rp(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:v,inlineImages:p,recordCanvas:I,keepIframeSrcFn:E,newlyAddedElement:T});if(!R)return console.warn(e,"not serialized"),null;let x;x=n.hasNode(e)?n.getId(e):!function(w,y){return!!(y.comment&&w.type===fe.Comment||w.type===fe.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"&&Mo(w.attributes.href)==="js")||y.headFavicon&&(w.tagName==="link"&&w.attributes.rel==="shortcut icon"||w.tagName==="meta"&&(re(w.attributes.name).match(/^msapplication-tile(image|color)$/)||re(w.attributes.name)==="application-name"||re(w.attributes.rel)==="icon"||re(w.attributes.rel)==="apple-touch-icon"||re(w.attributes.rel)==="shortcut icon"))||w.tagName==="meta"&&(y.headMetaDescKeywords&&re(w.attributes.name).match(/^description|keywords$/)||y.headMetaSocial&&(re(w.attributes.property).match(/^(og|twitter|fb):/)||re(w.attributes.name).match(/^(og|twitter):/)||re(w.attributes.name)==="pinterest")||y.headMetaRobots&&(re(w.attributes.name)==="robots"||re(w.attributes.name)==="googlebot"||re(w.attributes.name)==="bingbot")||y.headMetaHttpEquiv&&w.attributes["http-equiv"]!==void 0||y.headMetaAuthorship&&(re(w.attributes.name)==="author"||re(w.attributes.name)==="generator"||re(w.attributes.name)==="framework"||re(w.attributes.name)==="publisher"||re(w.attributes.name)==="progid"||re(w.attributes.property).match(/^article:/)||re(w.attributes.property).match(/^product:/))||y.headMetaVerification&&(re(w.attributes.name)==="google-site-verification"||re(w.attributes.name)==="yandex-verification"||re(w.attributes.name)==="csrf-token"||re(w.attributes.name)==="p:domain_verify"||re(w.attributes.name)==="verify-v1"||re(w.attributes.name)==="verification"||re(w.attributes.name)==="shopify-checkout-api-token"))))}(R,f)&&(k||R.type!==fe.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?Rl():-2;const S=Object.assign(R,{id:x});if(n.add(e,S),x===-2)return null;m&&m(e);let D=!l;if(S.type===fe.Element){D=D&&!S.needBlock,delete S.needBlock;const w=we.shadowRoot(e);w&&Zt(w)&&(S.isShadowHost=!0)}if((S.type===fe.Document||S.type===fe.Element)&&D){f.headWhitespace&&S.type===fe.Element&&S.tagName==="head"&&(k=!1);const w={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:v,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:E};if(!(S.type===fe.Element&&S.tagName==="textarea"&&S.attributes.value!==void 0))for(const U of Array.from(we.childNodes(e))){const B=xt(U,w);B&&S.childNodes.push(B)}let y=null;if(kl(e)&&(y=we.shadowRoot(e)))for(const U of Array.from(we.childNodes(y))){const B=xt(U,w);B&&(Zt(y)&&(B.isShadow=!0),S.childNodes.push(B))}}const P=we.parentNode(e);return P&&Xt(P)&&Zt(P)&&(S.isShadow=!0),S.type===fe.Element&&S.tagName==="iframe"&&function(w,y,U){const B=w.contentWindow;if(!B)return;let j,O=!1;try{j=B.document.readyState}catch{return}if(j!=="complete"){const te=setTimeout(()=>{O||(y(),O=!0)},U);return void w.addEventListener("load",()=>{clearTimeout(te),O=!0,y()})}const N="about:blank";if(B.location.href!==N||w.src===N||w.src==="")return setTimeout(y,0),w.addEventListener("load",y);w.addEventListener("load",y)}(e,()=>{const w=e.contentDocument;if(w&&g){const y=xt(w,{doc:w,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:v,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:E});y&&g(e,y)}},b),S.type===fe.Element&&S.tagName==="link"&&typeof S.attributes.rel=="string"&&(S.attributes.rel==="stylesheet"||S.attributes.rel==="preload"&&typeof S.attributes.href=="string"&&Mo(S.attributes.href)==="css")&&function(w,y,U){let B,j=!1;try{B=w.sheet}catch{return}if(B)return;const O=setTimeout(()=>{j||(y(),j=!0)},U);w.addEventListener("load",()=>{clearTimeout(O),j=!0,y()})}(e,()=>{if(C){const w=xt(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:M,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:v,inlineImages:p,recordCanvas:I,preserveWhiteSpace:k,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:A,keepIframeSrcFn:E});w&&C(e,w)}},A),S}function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sp(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:{}},ie=String,Do=function(){return{isColorSupported:!1,reset:ie,bold:ie,dim:ie,italic:ie,underline:ie,inverse:ie,hidden:ie,strikethrough:ie,black:ie,red:ie,green:ie,yellow:ie,blue:ie,magenta:ie,cyan:ie,white:ie,gray:ie,bgBlack:ie,bgRed:ie,bgGreen:ie,bgYellow:ie,bgBlue:ie,bgMagenta:ie,bgCyan:ie,bgWhite:ie}};Rs.exports=Do(),Rs.exports.createColors=Do;var ip=Rs.exports;const De=sp(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Po=ip,_o=De,Ls=class Ml extends Error{constructor(t,r,n,s,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),a&&(this.plugin=a),r!==void 0&&n!==void 0&&(typeof r=="number"?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ml)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=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=h=>c(d(h)),s=h=>u(h)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,h=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(h.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(h)+c+`
4
4
  `+f+n("^")}return" "+s(h)+c}).join(`
5
5
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
6
6
 
@@ -17,15 +17,15 @@
17
17
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r===void 0?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&r.raws.before!==void 0)return t=r.raws.before,t.includes(`
18
18
  `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(r.raws.between!==void 0)return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&r.raws.before!==void 0){let s=r.raws.before.split(`
19
19
  `);return t=s[s.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Ul=Os;Os.default=Os;let op=Ul;function As(e,t){new op(t).stringify(e)}var Nn=As;As.default=As;let{isClean:Cr,my:ap}=ir,lp=Ni,cp=Ul,up=Nn;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[Cr]=!1,this[ap]=!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 lp(e)}getProxyProcessor(){return{get:(e,t)=>t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,t!=="prop"&&t!=="value"&&t!=="name"&&t!=="params"&&t!=="important"&&t!=="text"||e.markDirty()),!0)}}markDirty(){if(this[Cr]){this[Cr]=!1;let e=this;for(;e=e.parent;)e[Cr]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
20
- `?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);s!==-1&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new cp().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=up){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Fn=Us;Us.default=Us;let dp=Fn,Ts=class extends dp{constructor(e){e&&e.value!==void 0&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Bn=Ts;Ts.default=Ts;var pp={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Fo,SourceMapGenerator:Bo}=Pe,{existsSync:hp,readFileSync:mp}=Pe,{dirname:ns,join:fp}=Pe,Ds=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=ns(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=ns(e),hp(e))return this.mapFile=e,mp(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=fp(ns(e),r)),this.loadFile(r)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Tl=Ds;Ds.default=Ds;let{SourceMapConsumer:gp,SourceMapGenerator:yp}=Pe,{fileURLToPath:zo,pathToFileURL:kr}=Pe,{isAbsolute:Ps,resolve:_s}=Pe,{nanoid:wp}=pp,ss=Pe,jo=Ni,vp=Tl,is=Symbol("fromOffsetCache"),bp=!!(gp&&yp),Wo=!!(_s&&Ps),Kr=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&&bp){let r=new vp(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 "+wp(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&&(kr&&(s.input.url=kr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[is])r=this[is];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[is]=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)?kr(o.source):new URL(o.source,this.map.consumer().sourceRoot||kr(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!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 zn=Kr;Kr.default=Kr,ss&&ss.registerInput&&ss.registerInput(Kr);let{SourceMapConsumer:Dl,SourceMapGenerator:Xr}=Pe,{dirname:Zr,relative:Pl,resolve:_l,sep:Nl}=Pe,{pathToFileURL:Vo}=Pe,Sp=zn,Ip=!!(Dl&&Xr),Cp=!!(Zr&&_l&&Pl&&Nl);var Fl=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t=`
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 cp().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=up){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Fn=Us;Us.default=Us;let dp=Fn,Ts=class extends dp{constructor(e){e&&e.value!==void 0&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Bn=Ts;Ts.default=Ts;var pp={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Fo,SourceMapGenerator:Bo}=De,{existsSync:hp,readFileSync:mp}=De,{dirname:ns,join:fp}=De,Ds=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=ns(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=ns(e),hp(e))return this.mapFile=e,mp(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=fp(ns(e),r)),this.loadFile(r)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Tl=Ds;Ds.default=Ds;let{SourceMapConsumer:gp,SourceMapGenerator:yp}=De,{fileURLToPath:zo,pathToFileURL:kr}=De,{isAbsolute:Ps,resolve:_s}=De,{nanoid:wp}=pp,ss=De,jo=Ni,vp=Tl,is=Symbol("fromOffsetCache"),bp=!!(gp&&yp),Wo=!!(_s&&Ps),Kr=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&&bp){let r=new vp(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 "+wp(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&&(kr&&(s.input.url=kr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[is])r=this[is];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[is]=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)?kr(o.source):new URL(o.source,this.map.consumer().sourceRoot||kr(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!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 zn=Kr;Kr.default=Kr,ss&&ss.registerInput&&ss.registerInput(Kr);let{SourceMapConsumer:Dl,SourceMapGenerator:Xr}=De,{dirname:Zr,relative:Pl,resolve:_l,sep:Nl}=De,{pathToFileURL:Vo}=De,Sp=zn,Ip=!!(Dl&&Xr),Cp=!!(Zr&&_l&&Pl&&Nl);var Fl=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t=`
22
22
  `;this.css.includes(`\r
23
23
  `)&&(t=`\r
24
24
  `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Zr(e.file);this.mapOpts.sourcesContent===!1?(t=new Dl(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Cp&&Ip&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Xr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Xr({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Xr({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(a,o,l)=>{if(this.css+=a,o&&l!=="end"&&(i.generated.line=r,i.generated.column=n-1,o.source&&o.source.start?(i.source=this.sourcePath(o),i.original.line=o.source.start.line,i.original.column=o.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=a.match(/\n/g),e?(r+=e.length,t=a.lastIndexOf(`
25
- `),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Zr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Zr(_l(r,this.mapOpts.annotation)));let n=Pl(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Sp(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;Nl==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let kp=Fn,Ns=class extends kp{constructor(e){super(e),this.type="comment"}};var jn=Ns;Ns.default=Ns;let Bl,Fi,Bi,zl,{isClean:jl,my:Wl}=ir,Vl=Bn,Gl=jn,Ep=Fn;function Hl(e){return e.map(t=>(t.nodes&&(t.nodes=Hl(t.nodes)),delete t.source,t))}function $l(e){if(e[jl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)$l(t)}let Xe=class Yl extends Ep{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=Hl(Bl(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Vl(t)]}else if(t.selector)t=[new Fi(t)];else if(t.name)t=[new Bi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Gl(t)]}return t.map(n=>(n[Wl]||Yl.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[jl]&&$l(n),n.raws.before===void 0&&r&&r.raws.before!==void 0&&(n.raws.before=r.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let r;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(s=>{r.props&&!r.props.includes(s.prop)||r.fast&&!s.value.includes(r.fast)||(s.value=s.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let s;try{s=t(r,n)}catch(i){throw r.addToError(i)}return s!==!1&&r.walk&&(s=r.walk(t)),s})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="atrule")return r(n,s)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="decl")return r(n,s)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="rule")return r(n,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Xe.registerParse=e=>{Bl=e},Xe.registerRule=e=>{Fi=e},Xe.registerAtRule=e=>{Bi=e},Xe.registerRoot=e=>{zl=e};var yt=Xe;Xe.default=Xe,Xe.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Bi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Fi.prototype):e.type==="decl"?Object.setPrototypeOf(e,Vl.prototype):e.type==="comment"?Object.setPrototypeOf(e,Gl.prototype):e.type==="root"&&Object.setPrototypeOf(e,zl.prototype),e[Wl]=!0,e.nodes&&e.nodes.forEach(t=>{Xe.rebuild(t)})};let ql,Jl,xp=yt,or=class extends xp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ql(new Jl,this,e).stringify()}};or.registerLazyResult=e=>{ql=e},or.registerProcessor=e=>{Jl=e};var zi=or;or.default=or;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 Kl=Fs;Fs.default=Fs;let Rp=Kl,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 Rp(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var ji=Bs;Bs.default=Bs;const os=39,Go=34,Er=92,Ho=47,xr=10,Bt=32,Rr=12,Lr=9,Or=13,Lp=91,Op=93,Ap=40,Mp=41,Up=123,Tp=125,Dp=59,Pp=42,_p=58,Np=64,Ar=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Fp=/.[\r\n"'(/\\]/,$o=/[\da-f]/i;let Xl=yt,Qr=class extends Xl{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 Wi=Qr;Qr.default=Qr,Xl.registerAtRule(Qr);let Zl,Ql,ec=yt,At=class extends ec{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 Zl(new Ql,this,e).stringify()}};At.registerLazyResult=e=>{Zl=e},At.registerProcessor=e=>{Ql=e};var yr=At;At.default=At,ec.registerRoot(At);let ar={comma:e=>ar.split(e,[","],!0),space:e=>ar.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 tc=ar;ar.default=ar;let rc=yt,Bp=tc,en=class extends rc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Bp.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 Vi=en;en.default=en,rc.registerRule(en);let zp=Bn,jp=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,h=e.css.valueOf(),f=t.ignoreErrors,v=h.length,p=0,I=[],m=[];function g(b){throw e.error("Unclosed "+b,p)}return{back:function(b){m.push(b)},endOfFile:function(){return m.length===0&&p>=v},nextToken:function(b){if(m.length)return m.pop();if(p>=v)return;let C=!!b&&b.ignoreUnclosed;switch(r=h.charCodeAt(p),r){case xr:case Bt:case Lr:case Or:case Rr:n=p;do n+=1,r=h.charCodeAt(n);while(r===Bt||r===xr||r===Lr||r===Or||r===Rr);d=["space",h.slice(p,n)],p=n-1;break;case Lp:case Op:case Up:case Tp:case _p:case Dp:case Mp:{let A=String.fromCharCode(r);d=[A,A,p];break}case Ap:if(c=I.length?I.pop()[1]:"",u=h.charCodeAt(p+1),c==="url"&&u!==os&&u!==Go&&u!==Bt&&u!==xr&&u!==Lr&&u!==Rr&&u!==Or){n=p;do{if(o=!1,n=h.indexOf(")",n+1),n===-1){if(f||C){n=p;break}g("bracket")}for(l=n;h.charCodeAt(l-1)===Er;)l-=1,o=!o}while(o);d=["brackets",h.slice(p,n+1),p,n],p=n}else n=h.indexOf(")",p+1),i=h.slice(p,n+1),n===-1||Fp.test(i)?d=["(","(",p]:(d=["brackets",i,p,n],p=n);break;case os:case Go:s=r===os?"'":'"',n=p;do{if(o=!1,n=h.indexOf(s,n+1),n===-1){if(f||C){n=p+1;break}g("string")}for(l=n;h.charCodeAt(l-1)===Er;)l-=1,o=!o}while(o);d=["string",h.slice(p,n+1),p,n],p=n;break;case Np:Ar.lastIndex=p+1,Ar.test(h),n=Ar.lastIndex===0?h.length-1:Ar.lastIndex-2,d=["at-word",h.slice(p,n+1),p,n],p=n;break;case Er:for(n=p,a=!0;h.charCodeAt(n+1)===Er;)n+=1,a=!a;if(r=h.charCodeAt(n+1),a&&r!==Ho&&r!==Bt&&r!==xr&&r!==Lr&&r!==Or&&r!==Rr&&(n+=1,$o.test(h.charAt(n)))){for(;$o.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===Bt&&(n+=1)}d=["word",h.slice(p,n+1),p,n],p=n;break;default:r===Ho&&h.charCodeAt(p+1)===Pp?(n=h.indexOf("*/",p+2)+1,n===0&&(f||C?n=h.length:g("comment")),d=["comment",h.slice(p,n+1),p,n],p=n):(Mr.lastIndex=p+1,Mr.test(h),n=Mr.lastIndex===0?h.length-1:Mr.lastIndex-2,d=["word",h.slice(p,n+1),p,n],I.push(d),p=n)}return p++,d},position:function(){return p}}},Wp=jn,Vp=Wi,Gp=yr,Yo=Vi;const qo={empty:!0,space:!0};var Hp=class{constructor(e){this.input=e,this.root=new Gp,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Vp;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 Wp;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=jp(this.input)}decl(e,t){let r=new zp;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",qo[o]||qo[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((h,f)=>h+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 $p=yt,Yp=Hp,qp=zn;function tn(e,t){let r=new qp(e,t),n=new Yp(r);try{n.parse()}catch(s){throw s}return n.root}var Gi=tn;tn.default=tn,$p.registerParse(tn);let{isClean:Fe,my:Jp}=ir,Kp=Fl,Xp=Nn,Zp=yt,Qp=zi,Jo=ji,eh=Gi,th=yr;const rh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},nh={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},sh={Once:!0,postcssPlugin:!0,prepare:!0};function zt(e){return typeof e=="object"&&typeof e.then=="function"}function nc(e){let t=!1,r=rh[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 Ko(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:nc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function zs(e){return e[Fe]=!1,e.nodes&&e.nodes.forEach(t=>zs(t)),e}let js={},Rt=class sc{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 sc||r instanceof Jo)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=eh;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[Jp]&&Zp.rebuild(s)}else s=zs(r);this.result=new Jo(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(!nh[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sh[n])if(typeof r[n]=="object")for(let s in r[n])t(r,s==="*"?n:n+"-"+s.toLowerCase(),r[n][s]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(zt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Fe];){t[Fe]=!0;let r=[Ko(t)];for(;r.length>0;){let n=this.visitTick(r);if(zt(n))try{await n}catch(s){let i=r[r.length-1].node;throw this.handleError(s,i)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let s=t.nodes.map(i=>n(i,this.helpers));await Promise.all(s)}else await n(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return zt(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=Xp;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new Kp(r,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins)if(zt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Fe];)t[Fe]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(zt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[Fe])return a[Fe]=!0,void t.push(Ko(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[Fe]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Fe]=!0;let r=nc(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Fe]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Rt.registerPostcss=e=>{js=e};var ic=Rt;Rt.default=Rt,th.registerLazyResult(Rt),Qp.registerLazyResult(Rt);let ih=Fl,oh=Nn,ah=Gi;const lh=ji;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=oh;this.result=new lh(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new ih(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=ah;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 ch=Ws;Ws.default=Ws;let uh=ch,dh=ic,ph=zi,hh=yr,Gt=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 dh(this,e,t):new uh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var mh=Gt;Gt.default=Gt,hh.registerProcessor(Gt),ph.registerProcessor(Gt);let fh=Bn,gh=Tl,yh=jn,wh=Wi,vh=zn,bh=yr,Sh=Vi;function lr(e,t){if(Array.isArray(e))return e.map(s=>lr(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:vh.prototype};i.map&&(i.map={...i.map,__proto__:gh.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>lr(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 bh(n);if(n.type==="decl")return new fh(n);if(n.type==="rule")return new Sh(n);if(n.type==="comment")return new yh(n);if(n.type==="atrule")return new wh(n);throw new Error("Unknown node type: "+e.type)}var Ih=lr;lr.default=lr;let Ch=Ni,Xo=Bn,kh=ic,Eh=yt,Vs=mh,xh=Nn,Rh=Ih,Zo=zi,Lh=Kl,Qo=jn,ea=Wi,Oh=ji,Ah=zn,Mh=Gi,Uh=tc,ta=Vi,ra=yr,Th=Fn;function K(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Vs(e)}K.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:
25
+ `),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Zr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Zr(_l(r,this.mapOpts.annotation)));let n=Pl(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Sp(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;Nl==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let kp=Fn,Ns=class extends kp{constructor(e){super(e),this.type="comment"}};var jn=Ns;Ns.default=Ns;let Bl,Fi,Bi,zl,{isClean:jl,my:Wl}=ir,Vl=Bn,Gl=jn,Ep=Fn;function Hl(e){return e.map(t=>(t.nodes&&(t.nodes=Hl(t.nodes)),delete t.source,t))}function $l(e){if(e[jl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)$l(t)}let Ke=class Yl extends Ep{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=Hl(Bl(t).nodes);else if(t===void 0)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type)t=[t];else if(t.prop){if(t.value===void 0)throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Vl(t)]}else if(t.selector)t=[new Fi(t)];else if(t.name)t=[new Bi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Gl(t)]}return t.map(n=>(n[Wl]||Yl.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[jl]&&$l(n),n.raws.before===void 0&&r&&r.raws.before!==void 0&&(n.raws.before=r.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let r;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(s=>{r.props&&!r.props.includes(s.prop)||r.fast&&!s.value.includes(r.fast)||(s.value=s.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let s;try{s=t(r,n)}catch(i){throw r.addToError(i)}return s!==!1&&r.walk&&(s=r.walk(t)),s})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="atrule")return r(n,s)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="decl")return r(n,s)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="rule")return r(n,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ke.registerParse=e=>{Bl=e},Ke.registerRule=e=>{Fi=e},Ke.registerAtRule=e=>{Bi=e},Ke.registerRoot=e=>{zl=e};var yt=Ke;Ke.default=Ke,Ke.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Bi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Fi.prototype):e.type==="decl"?Object.setPrototypeOf(e,Vl.prototype):e.type==="comment"?Object.setPrototypeOf(e,Gl.prototype):e.type==="root"&&Object.setPrototypeOf(e,zl.prototype),e[Wl]=!0,e.nodes&&e.nodes.forEach(t=>{Ke.rebuild(t)})};let ql,Jl,xp=yt,or=class extends xp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ql(new Jl,this,e).stringify()}};or.registerLazyResult=e=>{ql=e},or.registerProcessor=e=>{Jl=e};var zi=or;or.default=or;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 Kl=Fs;Fs.default=Fs;let Rp=Kl,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 Rp(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var ji=Bs;Bs.default=Bs;const os=39,Go=34,Er=92,Ho=47,xr=10,Bt=32,Rr=12,Lr=9,Or=13,Lp=91,Op=93,Ap=40,Mp=41,Up=123,Tp=125,Dp=59,Pp=42,_p=58,Np=64,Ar=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Fp=/.[\r\n"'(/\\]/,$o=/[\da-f]/i;let Xl=yt,Qr=class extends Xl{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 Wi=Qr;Qr.default=Qr,Xl.registerAtRule(Qr);let Zl,Ql,ec=yt,At=class extends ec{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 Zl(new Ql,this,e).stringify()}};At.registerLazyResult=e=>{Zl=e},At.registerProcessor=e=>{Ql=e};var yr=At;At.default=At,ec.registerRoot(At);let ar={comma:e=>ar.split(e,[","],!0),space:e=>ar.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 tc=ar;ar.default=ar;let rc=yt,Bp=tc,en=class extends rc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Bp.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 Vi=en;en.default=en,rc.registerRule(en);let zp=Bn,jp=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,h=e.css.valueOf(),f=t.ignoreErrors,v=h.length,p=0,I=[],m=[];function g(b){throw e.error("Unclosed "+b,p)}return{back:function(b){m.push(b)},endOfFile:function(){return m.length===0&&p>=v},nextToken:function(b){if(m.length)return m.pop();if(p>=v)return;let C=!!b&&b.ignoreUnclosed;switch(r=h.charCodeAt(p),r){case xr:case Bt:case Lr:case Or:case Rr:n=p;do n+=1,r=h.charCodeAt(n);while(r===Bt||r===xr||r===Lr||r===Or||r===Rr);d=["space",h.slice(p,n)],p=n-1;break;case Lp:case Op:case Up:case Tp:case _p:case Dp:case Mp:{let A=String.fromCharCode(r);d=[A,A,p];break}case Ap:if(c=I.length?I.pop()[1]:"",u=h.charCodeAt(p+1),c==="url"&&u!==os&&u!==Go&&u!==Bt&&u!==xr&&u!==Lr&&u!==Rr&&u!==Or){n=p;do{if(o=!1,n=h.indexOf(")",n+1),n===-1){if(f||C){n=p;break}g("bracket")}for(l=n;h.charCodeAt(l-1)===Er;)l-=1,o=!o}while(o);d=["brackets",h.slice(p,n+1),p,n],p=n}else n=h.indexOf(")",p+1),i=h.slice(p,n+1),n===-1||Fp.test(i)?d=["(","(",p]:(d=["brackets",i,p,n],p=n);break;case os:case Go:s=r===os?"'":'"',n=p;do{if(o=!1,n=h.indexOf(s,n+1),n===-1){if(f||C){n=p+1;break}g("string")}for(l=n;h.charCodeAt(l-1)===Er;)l-=1,o=!o}while(o);d=["string",h.slice(p,n+1),p,n],p=n;break;case Np:Ar.lastIndex=p+1,Ar.test(h),n=Ar.lastIndex===0?h.length-1:Ar.lastIndex-2,d=["at-word",h.slice(p,n+1),p,n],p=n;break;case Er:for(n=p,a=!0;h.charCodeAt(n+1)===Er;)n+=1,a=!a;if(r=h.charCodeAt(n+1),a&&r!==Ho&&r!==Bt&&r!==xr&&r!==Lr&&r!==Or&&r!==Rr&&(n+=1,$o.test(h.charAt(n)))){for(;$o.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===Bt&&(n+=1)}d=["word",h.slice(p,n+1),p,n],p=n;break;default:r===Ho&&h.charCodeAt(p+1)===Pp?(n=h.indexOf("*/",p+2)+1,n===0&&(f||C?n=h.length:g("comment")),d=["comment",h.slice(p,n+1),p,n],p=n):(Mr.lastIndex=p+1,Mr.test(h),n=Mr.lastIndex===0?h.length-1:Mr.lastIndex-2,d=["word",h.slice(p,n+1),p,n],I.push(d),p=n)}return p++,d},position:function(){return p}}},Wp=jn,Vp=Wi,Gp=yr,Yo=Vi;const qo={empty:!0,space:!0};var Hp=class{constructor(e){this.input=e,this.root=new Gp,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Vp;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 Wp;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=jp(this.input)}decl(e,t){let r=new zp;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",qo[o]||qo[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((h,f)=>h+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 $p=yt,Yp=Hp,qp=zn;function tn(e,t){let r=new qp(e,t),n=new Yp(r);try{n.parse()}catch(s){throw s}return n.root}var Gi=tn;tn.default=tn,$p.registerParse(tn);let{isClean:Ne,my:Jp}=ir,Kp=Fl,Xp=Nn,Zp=yt,Qp=zi,Jo=ji,eh=Gi,th=yr;const rh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},nh={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},sh={Once:!0,postcssPlugin:!0,prepare:!0};function zt(e){return typeof e=="object"&&typeof e.then=="function"}function nc(e){let t=!1,r=rh[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 Ko(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:nc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function zs(e){return e[Ne]=!1,e.nodes&&e.nodes.forEach(t=>zs(t)),e}let js={},Rt=class sc{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 sc||r instanceof Jo)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=eh;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[Jp]&&Zp.rebuild(s)}else s=zs(r);this.result=new Jo(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(!nh[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sh[n])if(typeof r[n]=="object")for(let s in r[n])t(r,s==="*"?n:n+"-"+s.toLowerCase(),r[n][s]);else typeof r[n]=="function"&&t(r,n,r[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],n=this.runOnRoot(r);if(zt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ne];){t[Ne]=!0;let r=[Ko(t)];for(;r.length>0;){let n=this.visitTick(r);if(zt(n))try{await n}catch(s){let i=r[r.length-1].node;throw this.handleError(s,i)}}}if(this.listeners.OnceExit)for(let[r,n]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let s=t.nodes.map(i=>n(i,this.helpers));await Promise.all(s)}else await n(t,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map(n=>t.Once(n,this.helpers));return zt(r[0])?Promise.all(r):r}return t.Once(this.result.root,this.helpers)}if(typeof t=="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=Xp;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new Kp(r,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins)if(zt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ne];)t[Ne]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(zt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[Ne])return a[Ne]=!0,void t.push(Ko(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[Ne]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Ne]=!0;let r=nc(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Ne]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Rt.registerPostcss=e=>{js=e};var ic=Rt;Rt.default=Rt,th.registerLazyResult(Rt),Qp.registerLazyResult(Rt);let ih=Fl,oh=Nn,ah=Gi;const lh=ji;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=oh;this.result=new lh(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new ih(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=ah;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 ch=Ws;Ws.default=Ws;let uh=ch,dh=ic,ph=zi,hh=yr,Gt=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 dh(this,e,t):new uh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var mh=Gt;Gt.default=Gt,hh.registerProcessor(Gt),ph.registerProcessor(Gt);let fh=Bn,gh=Tl,yh=jn,wh=Wi,vh=zn,bh=yr,Sh=Vi;function lr(e,t){if(Array.isArray(e))return e.map(s=>lr(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:vh.prototype};i.map&&(i.map={...i.map,__proto__:gh.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>lr(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 bh(n);if(n.type==="decl")return new fh(n);if(n.type==="rule")return new Sh(n);if(n.type==="comment")return new yh(n);if(n.type==="atrule")return new wh(n);throw new Error("Unknown node type: "+e.type)}var Ih=lr;lr.default=lr;let Ch=Ni,Xo=Bn,kh=ic,Eh=yt,Vs=mh,xh=Nn,Rh=Ih,Zo=zi,Lh=Kl,Qo=jn,ea=Wi,Oh=ji,Ah=zn,Mh=Gi,Uh=tc,ta=Vi,ra=yr,Th=Fn;function K(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Vs(e)}K.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
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 Vs().version,a}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(i,a,o){return K([s(o)]).process(i,a)},s},K.stringify=xh,K.parse=Mh,K.fromJSON=Rh,K.list=Uh,K.comment=e=>new Qo(e),K.atRule=e=>new ea(e),K.decl=e=>new Xo(e),K.rule=e=>new ta(e),K.root=e=>new ra(e),K.document=e=>new Zo(e),K.CssSyntaxError=Ch,K.Declaration=Xo,K.Container=Eh,K.Processor=Vs,K.Document=Zo,K.Comment=Qo,K.Warning=Lh,K.AtRule=ea,K.Result=Oh,K.Input=Ah,K.Rule=ta,K.Root=ra,K.Node=Th,kh.registerPostcss(K);var Dh=K;K.default=K;const ae=np(Dh);ae.stringify,ae.fromJSON,ae.plugin,ae.parse,ae.list,ae.document,ae.comment,ae.atRule,ae.rule,ae.decl,ae.root,ae.CssSyntaxError,ae.Declaration,ae.Container,ae.Processor,ae.Document,ae.Comment,ae.Warning,ae.AtRule,ae.Result,ae.Input,ae.Rule,ae.Root,ae.Node;var Ph=Object.defineProperty,Le=(e,t,r)=>((n,s,i)=>s in n?Ph(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r);function _h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nh(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 Gs={exports:{}},ie=String,na=function(){return{isColorSupported:!1,reset:ie,bold:ie,dim:ie,italic:ie,underline:ie,inverse:ie,hidden:ie,strikethrough:ie,black:ie,red:ie,green:ie,yellow:ie,blue:ie,magenta:ie,cyan:ie,white:ie,gray:ie,bgBlack:ie,bgRed:ie,bgGreen:ie,bgYellow:ie,bgBlue:ie,bgMagenta:ie,bgCyan:ie,bgWhite:ie}};Gs.exports=na(),Gs.exports.createColors=na;var Fh=Gs.exports;const _e=Nh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let sa=Fh,ia=_e,Hs=class oc 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,oc)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=sa.isColorSupported),ia&&t&&(r=ia(r));let n,s,i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),l=String(o).length;if(t){let{bold:c,gray:u,red:d}=sa.createColors(!0);n=h=>c(d(h)),s=h=>u(h)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,h=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(h.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(h)+c+`
28
+ 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 K([s(o)]).process(i,a)},s},K.stringify=xh,K.parse=Mh,K.fromJSON=Rh,K.list=Uh,K.comment=e=>new Qo(e),K.atRule=e=>new ea(e),K.decl=e=>new Xo(e),K.rule=e=>new ta(e),K.root=e=>new ra(e),K.document=e=>new Zo(e),K.CssSyntaxError=Ch,K.Declaration=Xo,K.Container=Eh,K.Processor=Vs,K.Document=Zo,K.Comment=Qo,K.Warning=Lh,K.AtRule=ea,K.Result=Oh,K.Input=Ah,K.Rule=ta,K.Root=ra,K.Node=Th,kh.registerPostcss(K);var Dh=K;K.default=K;const le=np(Dh);le.stringify,le.fromJSON,le.plugin,le.parse,le.list,le.document,le.comment,le.atRule,le.rule,le.decl,le.root,le.CssSyntaxError,le.Declaration,le.Container,le.Processor,le.Document,le.Comment,le.Warning,le.AtRule,le.Result,le.Input,le.Rule,le.Root,le.Node;var Ph=Object.defineProperty,Re=(e,t,r)=>((n,s,i)=>s in n?Ph(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i)(e,typeof t!="symbol"?t+"":t,r);function _h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nh(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 Gs={exports:{}},oe=String,na=function(){return{isColorSupported:!1,reset:oe,bold:oe,dim:oe,italic:oe,underline:oe,inverse:oe,hidden:oe,strikethrough:oe,black:oe,red:oe,green:oe,yellow:oe,blue:oe,magenta:oe,cyan:oe,white:oe,gray:oe,bgBlack:oe,bgRed:oe,bgGreen:oe,bgYellow:oe,bgBlue:oe,bgMagenta:oe,bgCyan:oe,bgWhite:oe}};Gs.exports=na(),Gs.exports.createColors=na;var Fh=Gs.exports;const Pe=Nh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let sa=Fh,ia=Pe,Hs=class oc 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,oc)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",this.line!==void 0&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;t==null&&(t=sa.isColorSupported),ia&&t&&(r=ia(r));let n,s,i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),l=String(o).length;if(t){let{bold:c,gray:u,red:d}=sa.createColors(!0);n=h=>c(d(h)),s=h=>u(h)}else n=s=c=>c;return i.slice(a,o).map((c,u)=>{let d=a+1+u,h=" "+(" "+d).slice(-l)+" | ";if(d===this.line){let f=s(h.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+s(h)+c+`
29
29
  `+f+n("^")}return" "+s(h)+c}).join(`
30
30
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
31
31
 
@@ -42,25 +42,25 @@ https://www.w3ctech.com/topic/2226`));let a=t(...i);return a.postcssPlugin=e,a.p
42
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
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
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 ac=$s;$s.default=$s;let Bh=ac;function Ys(e,t){new Bh(t).stringify(e)}var Wn=Ys;Ys.default=Ys;let{isClean:Ur,my:zh}=cr,jh=Hi,Wh=ac,Vh=Wn;function qs(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=>qs(a,r)):(i==="object"&&s!==null&&(s=qs(s)),r[n]=s)}return r}let Js=class{constructor(e={}){this.raws={},this[Ur]=!1,this[zh]=!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=qs(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 jh(e)}getProxyProcessor(){return{get:(e,t)=>t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,t!=="prop"&&t!=="value"&&t!=="name"&&t!=="params"&&t!=="important"&&t!=="text"||e.markDirty()),!0)}}markDirty(){if(this[Ur]){this[Ur]=!1;let e=this;for(;e=e.parent;)e[Ur]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
45
- `?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);s!==-1&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Wh().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=Vh){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Vn=Js;Js.default=Js;let Gh=Vn,Ks=class extends Gh{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 Gn=Ks;Ks.default=Ks;var Hh={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:aa,SourceMapGenerator:la}=_e,{existsSync:$h,readFileSync:Yh}=_e,{dirname:as,join:qh}=_e,Xs=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=as(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new aa(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e=="object"&&(typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=as(e),$h(e))return this.mapFile=e,Yh(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t!="function"){if(t instanceof aa)return la.fromSourceMap(t).toString();if(t instanceof la)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=qh(as(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 lc=Xs;Xs.default=Xs;let{SourceMapConsumer:Jh,SourceMapGenerator:Kh}=_e,{fileURLToPath:ca,pathToFileURL:Tr}=_e,{isAbsolute:Zs,resolve:Qs}=_e,{nanoid:Xh}=Hh,ls=_e,ua=Hi,Zh=lc,cs=Symbol("fromOffsetCache"),Qh=!!(Jh&&Kh),da=!!(Qs&&Zs),rn=class{constructor(e,t={}){if(e==null||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!da||/^\w+:\/\//.test(t.from)||Zs(t.from)?this.file=t.from:this.file=Qs(t.from)),da&&Qh){let r=new Zh(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 "+Xh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,a;if(t&&typeof t=="object"){let l=t,c=r;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);t=u.line,r=u.col}else t=l.line,r=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);i=u.line,a=u.col}else i=c.line,a=c.column}else if(!r){let l=this.fromOffset(t);t=l.line,r=l.col}let o=this.origin(t,r,i,a);return s=o?new ua(e,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,n.plugin):new ua(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:a,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(Tr&&(s.input.url=Tr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[cs])r=this[cs];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[cs]=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:Qs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;typeof r=="number"&&(s=a.originalPositionFor({column:n,line:r})),i=Zs(o.source)?Tr(o.source):new URL(o.source,this.map.consumer().sourceRoot||Tr(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!ca)throw new Error("file: protocol is not available in this PostCSS build");l.file=ca(i)}let c=a.sourceContentFor(o.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Hn=rn;rn.default=rn,ls&&ls.registerInput&&ls.registerInput(rn);let{SourceMapConsumer:cc,SourceMapGenerator:nn}=_e,{dirname:sn,relative:uc,resolve:dc,sep:pc}=_e,{pathToFileURL:pa}=_e,em=Hn,tm=!!(cc&&nn),rm=!!(sn&&dc&&uc&&pc);var hc=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=`
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 Wh().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=Vh){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}};var Vn=Js;Js.default=Js;let Gh=Vn,Ks=class extends Gh{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 Gn=Ks;Ks.default=Ks;var Hh={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:aa,SourceMapGenerator:la}=Pe,{existsSync:$h,readFileSync:Yh}=Pe,{dirname:as,join:qh}=Pe,Xs=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=as(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new aa(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e=="object"&&(typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=as(e),$h(e))return this.mapFile=e,Yh(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t!="function"){if(t instanceof aa)return la.fromSourceMap(t).toString();if(t instanceof la)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=qh(as(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 lc=Xs;Xs.default=Xs;let{SourceMapConsumer:Jh,SourceMapGenerator:Kh}=Pe,{fileURLToPath:ca,pathToFileURL:Tr}=Pe,{isAbsolute:Zs,resolve:Qs}=Pe,{nanoid:Xh}=Hh,ls=Pe,ua=Hi,Zh=lc,cs=Symbol("fromOffsetCache"),Qh=!!(Jh&&Kh),da=!!(Qs&&Zs),rn=class{constructor(e,t={}){if(e==null||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!da||/^\w+:\/\//.test(t.from)||Zs(t.from)?this.file=t.from:this.file=Qs(t.from)),da&&Qh){let r=new Zh(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 "+Xh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,a;if(t&&typeof t=="object"){let l=t,c=r;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);t=u.line,r=u.col}else t=l.line,r=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);i=u.line,a=u.col}else i=c.line,a=c.column}else if(!r){let l=this.fromOffset(t);t=l.line,r=l.col}let o=this.origin(t,r,i,a);return s=o?new ua(e,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,n.plugin):new ua(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:a,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(Tr&&(s.input.url=Tr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[cs])r=this[cs];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[cs]=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:Qs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,a=this.map.consumer(),o=a.originalPositionFor({column:t,line:e});if(!o.source)return!1;typeof r=="number"&&(s=a.originalPositionFor({column:n,line:r})),i=Zs(o.source)?Tr(o.source):new URL(o.source,this.map.consumer().sourceRoot||Tr(this.map.mapFile));let l={column:o.column,endColumn:s&&s.column,endLine:s&&s.line,line:o.line,url:i.toString()};if(i.protocol==="file:"){if(!ca)throw new Error("file: protocol is not available in this PostCSS build");l.file=ca(i)}let c=a.sourceContentFor(o.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Hn=rn;rn.default=rn,ls&&ls.registerInput&&ls.registerInput(rn);let{SourceMapConsumer:cc,SourceMapGenerator:nn}=Pe,{dirname:sn,relative:uc,resolve:dc,sep:pc}=Pe,{pathToFileURL:pa}=Pe,em=Hn,tm=!!(cc&&nn),rm=!!(sn&&dc&&uc&&pc);var hc=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
47
  `;this.css.includes(`\r
48
48
  `)&&(t=`\r
49
49
  `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||sn(e.file);this.mapOpts.sourcesContent===!1?(t=new cc(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(),rm&&tm&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=nn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new nn({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new nn({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(a,o,l)=>{if(this.css+=a,o&&l!=="end"&&(i.generated.line=r,i.generated.column=n-1,o.source&&o.source.start?(i.source=this.sourcePath(o),i.original.line=o.source.start.line,i.original.column=o.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=a.match(/\n/g),e?(r+=e.length,t=a.lastIndexOf(`
50
- `),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?sn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=sn(dc(r,this.mapOpts.annotation)));let n=uc(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 em(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(pa){let r=pa(e).toString();return this.memoizedFileURLs.set(e,r),r}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;pc==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let nm=Vn,ei=class extends nm{constructor(e){super(e),this.type="comment"}};var $n=ei;ei.default=ei;let mc,$i,Yi,fc,{isClean:gc,my:yc}=cr,wc=Gn,vc=$n,sm=Vn;function bc(e){return e.map(t=>(t.nodes&&(t.nodes=bc(t.nodes)),delete t.source,t))}function Sc(e){if(e[gc]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Sc(t)}let Ze=class Ic extends sm{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=bc(mc(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 wc(t)]}else if(t.selector)t=[new $i(t)];else if(t.name)t=[new Yi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new vc(t)]}return t.map(n=>(n[yc]||Ic.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[gc]&&Sc(n),n.raws.before===void 0&&r&&r.raws.before!==void 0&&(n.raws.before=r.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let r of t){let n=this.normalize(r,this.first,"prepend").reverse();for(let s of n)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let r;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let n in this.indexes)r=this.indexes[n],r>=t&&(this.indexes[n]=r-1);return this.markDirty(),this}replaceValues(t,r,n){return n||(n=r,r={}),this.walkDecls(s=>{r.props&&!r.props.includes(s.prop)||r.fast&&!s.value.includes(r.fast)||(s.value=s.value.replace(t,n))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((r,n)=>{let s;try{s=t(r,n)}catch(i){throw r.addToError(i)}return s!==!1&&r.walk&&(s=r.walk(t)),s})}walkAtRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="atrule"&&t.test(n.name))return r(n,s)}):this.walk((n,s)=>{if(n.type==="atrule"&&n.name===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="atrule")return r(n,s)}))}walkComments(t){return this.walk((r,n)=>{if(r.type==="comment")return t(r,n)})}walkDecls(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="decl"&&t.test(n.prop))return r(n,s)}):this.walk((n,s)=>{if(n.type==="decl"&&n.prop===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="decl")return r(n,s)}))}walkRules(t,r){return r?t instanceof RegExp?this.walk((n,s)=>{if(n.type==="rule"&&t.test(n.selector))return r(n,s)}):this.walk((n,s)=>{if(n.type==="rule"&&n.selector===t)return r(n,s)}):(r=t,this.walk((n,s)=>{if(n.type==="rule")return r(n,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ze.registerParse=e=>{mc=e},Ze.registerRule=e=>{$i=e},Ze.registerAtRule=e=>{Yi=e},Ze.registerRoot=e=>{fc=e};var wt=Ze;Ze.default=Ze,Ze.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Yi.prototype):e.type==="rule"?Object.setPrototypeOf(e,$i.prototype):e.type==="decl"?Object.setPrototypeOf(e,wc.prototype):e.type==="comment"?Object.setPrototypeOf(e,vc.prototype):e.type==="root"&&Object.setPrototypeOf(e,fc.prototype),e[yc]=!0,e.nodes&&e.nodes.forEach(t=>{Ze.rebuild(t)})};let Cc,kc,im=wt,ur=class extends im{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Cc(new kc,this,e).stringify()}};ur.registerLazyResult=e=>{Cc=e},ur.registerProcessor=e=>{kc=e};var qi=ur;ur.default=ur;let ti=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 Ec=ti;ti.default=ti;let om=Ec,ri=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 om(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Ji=ri;ri.default=ri;const us=39,ha=34,Dr=92,ma=47,Pr=10,jt=32,_r=12,Nr=9,Fr=13,am=91,lm=93,cm=40,um=41,dm=123,pm=125,hm=59,mm=42,fm=58,gm=64,Br=/[\t\n\f\r "#'()/;[\\\]{}]/g,zr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ym=/.[\r\n"'(/\\]/,fa=/[\da-f]/i;let xc=wt,on=class extends xc{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 Ki=on;on.default=on,xc.registerAtRule(on);let Rc,Lc,Oc=wt,Mt=class extends Oc{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 Rc(new Lc,this,e).stringify()}};Mt.registerLazyResult=e=>{Rc=e},Mt.registerProcessor=e=>{Lc=e};var wr=Mt;Mt.default=Mt,Oc.registerRoot(Mt);let dr={comma:e=>dr.split(e,[","],!0),space:e=>dr.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 Ac=dr;dr.default=dr;let Mc=wt,wm=Ac,an=class extends Mc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return wm.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Xi=an;an.default=an,Mc.registerRule(an);let vm=Gn,bm=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,h=e.css.valueOf(),f=t.ignoreErrors,v=h.length,p=0,I=[],m=[];function g(b){throw e.error("Unclosed "+b,p)}return{back:function(b){m.push(b)},endOfFile:function(){return m.length===0&&p>=v},nextToken:function(b){if(m.length)return m.pop();if(p>=v)return;let C=!!b&&b.ignoreUnclosed;switch(r=h.charCodeAt(p),r){case Pr:case jt:case Nr:case Fr:case _r:n=p;do n+=1,r=h.charCodeAt(n);while(r===jt||r===Pr||r===Nr||r===Fr||r===_r);d=["space",h.slice(p,n)],p=n-1;break;case am:case lm:case dm:case pm:case fm:case hm:case um:{let A=String.fromCharCode(r);d=[A,A,p];break}case cm:if(c=I.length?I.pop()[1]:"",u=h.charCodeAt(p+1),c==="url"&&u!==us&&u!==ha&&u!==jt&&u!==Pr&&u!==Nr&&u!==_r&&u!==Fr){n=p;do{if(o=!1,n=h.indexOf(")",n+1),n===-1){if(f||C){n=p;break}g("bracket")}for(l=n;h.charCodeAt(l-1)===Dr;)l-=1,o=!o}while(o);d=["brackets",h.slice(p,n+1),p,n],p=n}else n=h.indexOf(")",p+1),i=h.slice(p,n+1),n===-1||ym.test(i)?d=["(","(",p]:(d=["brackets",i,p,n],p=n);break;case us:case ha:s=r===us?"'":'"',n=p;do{if(o=!1,n=h.indexOf(s,n+1),n===-1){if(f||C){n=p+1;break}g("string")}for(l=n;h.charCodeAt(l-1)===Dr;)l-=1,o=!o}while(o);d=["string",h.slice(p,n+1),p,n],p=n;break;case gm:Br.lastIndex=p+1,Br.test(h),n=Br.lastIndex===0?h.length-1:Br.lastIndex-2,d=["at-word",h.slice(p,n+1),p,n],p=n;break;case Dr:for(n=p,a=!0;h.charCodeAt(n+1)===Dr;)n+=1,a=!a;if(r=h.charCodeAt(n+1),a&&r!==ma&&r!==jt&&r!==Pr&&r!==Nr&&r!==Fr&&r!==_r&&(n+=1,fa.test(h.charAt(n)))){for(;fa.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===jt&&(n+=1)}d=["word",h.slice(p,n+1),p,n],p=n;break;default:r===ma&&h.charCodeAt(p+1)===mm?(n=h.indexOf("*/",p+2)+1,n===0&&(f||C?n=h.length:g("comment")),d=["comment",h.slice(p,n+1),p,n],p=n):(zr.lastIndex=p+1,zr.test(h),n=zr.lastIndex===0?h.length-1:zr.lastIndex-2,d=["word",h.slice(p,n+1),p,n],I.push(d),p=n)}return p++,d},position:function(){return p}}},Sm=$n,Im=Ki,Cm=wr,ga=Xi;const ya={empty:!0,space:!0};var km=class{constructor(e){this.input=e,this.root=new Cm,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 Im;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 Sm;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=bm(this.input)}decl(e,t){let r=new vm;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 ga;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",ya[o]||ya[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((h,f)=>h+f[1],"");e.raws[t]={raw:d,value:c}}e[t]=c}rule(e){e.pop();let t=new ga;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 Em=wt,xm=km,Rm=Hn;function ln(e,t){let r=new Rm(e,t),n=new xm(r);try{n.parse()}catch(s){throw s}return n.root}var Zi=ln;ln.default=ln,Em.registerParse(ln);let{isClean:Be,my:Lm}=cr,Om=hc,Am=Wn,Mm=wt,Um=qi,wa=Ji,Tm=Zi,Dm=wr;const Pm={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},_m={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},Nm={Once:!0,postcssPlugin:!0,prepare:!0};function Wt(e){return typeof e=="object"&&typeof e.then=="function"}function Uc(e){let t=!1,r=Pm[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 va(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:Uc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ni(e){return e[Be]=!1,e.nodes&&e.nodes.forEach(t=>ni(t)),e}let si={},Lt=class Tc{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 Tc||r instanceof wa)s=ni(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=Tm;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[Lm]&&Mm.rebuild(s)}else s=ni(r);this.result=new wa(t,s,n),this.helpers={...si,postcss:si,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(!_m[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Nm[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(Wt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];){t[Be]=!0;let r=[va(t)];for(;r.length>0;){let n=this.visitTick(r);if(Wt(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 Wt(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=Am;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new Om(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(Wt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];)t[Be]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Wt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[Be])return a[Be]=!0,void t.push(va(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[Be]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Be]=!0;let r=Uc(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Be]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Lt.registerPostcss=e=>{si=e};var Dc=Lt;Lt.default=Lt,Dm.registerLazyResult(Lt),Um.registerLazyResult(Lt);let Fm=hc,Bm=Wn,zm=Zi;const jm=Ji;let ii=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=Bm;this.result=new jm(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new Fm(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=zm;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 Wm=ii;ii.default=ii;let Vm=Wm,Gm=Dc,Hm=qi,$m=wr,Ht=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r!="object"||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Gm(this,e,t):new Vm(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ym=Ht;Ht.default=Ht,$m.registerProcessor(Ht),Hm.registerProcessor(Ht);let qm=Gn,Jm=lc,Km=$n,Xm=Ki,Zm=Hn,Qm=wr,ef=Xi;function pr(e,t){if(Array.isArray(e))return e.map(s=>pr(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:Zm.prototype};i.map&&(i.map={...i.map,__proto__:Jm.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>pr(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 Qm(n);if(n.type==="decl")return new qm(n);if(n.type==="rule")return new ef(n);if(n.type==="comment")return new Km(n);if(n.type==="atrule")return new Xm(n);throw new Error("Unknown node type: "+e.type)}var tf=pr;pr.default=pr;let rf=Hi,ba=Gn,nf=Dc,sf=wt,oi=Ym,of=Wn,af=tf,Sa=qi,lf=Ec,Ia=$n,Ca=Ki,cf=Ji,uf=Hn,df=Zi,pf=Ac,ka=Xi,Ea=wr,hf=Vn;function X(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new oi(e)}X.plugin=function(e,t){let r,n=!1;function s(...i){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
50
+ `),n=a.length-t):n+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(o.type==="decl"||o.type==="atrule"&&!o.nodes)&&o===c.last&&!c.raws.semicolon||(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(this.mapOpts.annotation!==void 0?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(e===void 0||e===!0)&&(!this.previous().length||this.previous().some(t=>t.inline))}isMap(){return this.opts.map!==void 0?!!this.opts.map:this.previous().length>0}isSourcesContent(){return this.mapOpts.sourcesContent!==void 0?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?sn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=sn(dc(r,this.mapOpts.annotation)));let n=uc(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 em(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(pa){let r=pa(e).toString();return this.memoizedFileURLs.set(e,r),r}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;pc==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let nm=Vn,ei=class extends nm{constructor(e){super(e),this.type="comment"}};var $n=ei;ei.default=ei;let mc,$i,Yi,fc,{isClean:gc,my:yc}=cr,wc=Gn,vc=$n,sm=Vn;function bc(e){return e.map(t=>(t.nodes&&(t.nodes=bc(t.nodes)),delete t.source,t))}function Sc(e){if(e[gc]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Sc(t)}let Xe=class Ic extends sm{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=bc(mc(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 wc(t)]}else if(t.selector)t=[new $i(t)];else if(t.name)t=[new Yi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new vc(t)]}return t.map(n=>(n[yc]||Ic.rebuild(n),(n=n.proxyOf).parent&&n.parent.removeChild(n),n[gc]&&Sc(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=>{mc=e},Xe.registerRule=e=>{$i=e},Xe.registerAtRule=e=>{Yi=e},Xe.registerRoot=e=>{fc=e};var wt=Xe;Xe.default=Xe,Xe.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Yi.prototype):e.type==="rule"?Object.setPrototypeOf(e,$i.prototype):e.type==="decl"?Object.setPrototypeOf(e,wc.prototype):e.type==="comment"?Object.setPrototypeOf(e,vc.prototype):e.type==="root"&&Object.setPrototypeOf(e,fc.prototype),e[yc]=!0,e.nodes&&e.nodes.forEach(t=>{Xe.rebuild(t)})};let Cc,kc,im=wt,ur=class extends im{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Cc(new kc,this,e).stringify()}};ur.registerLazyResult=e=>{Cc=e},ur.registerProcessor=e=>{kc=e};var qi=ur;ur.default=ur;let ti=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 Ec=ti;ti.default=ti;let om=Ec,ri=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 om(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Ji=ri;ri.default=ri;const us=39,ha=34,Dr=92,ma=47,Pr=10,jt=32,_r=12,Nr=9,Fr=13,am=91,lm=93,cm=40,um=41,dm=123,pm=125,hm=59,mm=42,fm=58,gm=64,Br=/[\t\n\f\r "#'()/;[\\\]{}]/g,zr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ym=/.[\r\n"'(/\\]/,fa=/[\da-f]/i;let xc=wt,on=class extends xc{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 Ki=on;on.default=on,xc.registerAtRule(on);let Rc,Lc,Oc=wt,Mt=class extends Oc{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 Rc(new Lc,this,e).stringify()}};Mt.registerLazyResult=e=>{Rc=e},Mt.registerProcessor=e=>{Lc=e};var wr=Mt;Mt.default=Mt,Oc.registerRoot(Mt);let dr={comma:e=>dr.split(e,[","],!0),space:e=>dr.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 Ac=dr;dr.default=dr;let Mc=wt,wm=Ac,an=class extends Mc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return wm.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Xi=an;an.default=an,Mc.registerRule(an);let vm=Gn,bm=function(e,t={}){let r,n,s,i,a,o,l,c,u,d,h=e.css.valueOf(),f=t.ignoreErrors,v=h.length,p=0,I=[],m=[];function g(b){throw e.error("Unclosed "+b,p)}return{back:function(b){m.push(b)},endOfFile:function(){return m.length===0&&p>=v},nextToken:function(b){if(m.length)return m.pop();if(p>=v)return;let C=!!b&&b.ignoreUnclosed;switch(r=h.charCodeAt(p),r){case Pr:case jt:case Nr:case Fr:case _r:n=p;do n+=1,r=h.charCodeAt(n);while(r===jt||r===Pr||r===Nr||r===Fr||r===_r);d=["space",h.slice(p,n)],p=n-1;break;case am:case lm:case dm:case pm:case fm:case hm:case um:{let A=String.fromCharCode(r);d=[A,A,p];break}case cm:if(c=I.length?I.pop()[1]:"",u=h.charCodeAt(p+1),c==="url"&&u!==us&&u!==ha&&u!==jt&&u!==Pr&&u!==Nr&&u!==_r&&u!==Fr){n=p;do{if(o=!1,n=h.indexOf(")",n+1),n===-1){if(f||C){n=p;break}g("bracket")}for(l=n;h.charCodeAt(l-1)===Dr;)l-=1,o=!o}while(o);d=["brackets",h.slice(p,n+1),p,n],p=n}else n=h.indexOf(")",p+1),i=h.slice(p,n+1),n===-1||ym.test(i)?d=["(","(",p]:(d=["brackets",i,p,n],p=n);break;case us:case ha:s=r===us?"'":'"',n=p;do{if(o=!1,n=h.indexOf(s,n+1),n===-1){if(f||C){n=p+1;break}g("string")}for(l=n;h.charCodeAt(l-1)===Dr;)l-=1,o=!o}while(o);d=["string",h.slice(p,n+1),p,n],p=n;break;case gm:Br.lastIndex=p+1,Br.test(h),n=Br.lastIndex===0?h.length-1:Br.lastIndex-2,d=["at-word",h.slice(p,n+1),p,n],p=n;break;case Dr:for(n=p,a=!0;h.charCodeAt(n+1)===Dr;)n+=1,a=!a;if(r=h.charCodeAt(n+1),a&&r!==ma&&r!==jt&&r!==Pr&&r!==Nr&&r!==Fr&&r!==_r&&(n+=1,fa.test(h.charAt(n)))){for(;fa.test(h.charAt(n+1));)n+=1;h.charCodeAt(n+1)===jt&&(n+=1)}d=["word",h.slice(p,n+1),p,n],p=n;break;default:r===ma&&h.charCodeAt(p+1)===mm?(n=h.indexOf("*/",p+2)+1,n===0&&(f||C?n=h.length:g("comment")),d=["comment",h.slice(p,n+1),p,n],p=n):(zr.lastIndex=p+1,zr.test(h),n=zr.lastIndex===0?h.length-1:zr.lastIndex-2,d=["word",h.slice(p,n+1),p,n],I.push(d),p=n)}return p++,d},position:function(){return p}}},Sm=$n,Im=Ki,Cm=wr,ga=Xi;const ya={empty:!0,space:!0};var km=class{constructor(e){this.input=e,this.root=new Cm,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 Im;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 Sm;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=bm(this.input)}decl(e,t){let r=new vm;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 ga;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",ya[o]||ya[a]||c.slice(-1)===","?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let d=r.reduce((h,f)=>h+f[1],"");e.raws[t]={raw:d,value:c}}e[t]=c}rule(e){e.pop();let t=new ga;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 Em=wt,xm=km,Rm=Hn;function ln(e,t){let r=new Rm(e,t),n=new xm(r);try{n.parse()}catch(s){throw s}return n.root}var Zi=ln;ln.default=ln,Em.registerParse(ln);let{isClean:Fe,my:Lm}=cr,Om=hc,Am=Wn,Mm=wt,Um=qi,wa=Ji,Tm=Zi,Dm=wr;const Pm={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},_m={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},Nm={Once:!0,postcssPlugin:!0,prepare:!0};function Wt(e){return typeof e=="object"&&typeof e.then=="function"}function Uc(e){let t=!1,r=Pm[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 va(e){let t;return t=e.type==="document"?["Document",0,"DocumentExit"]:e.type==="root"?["Root",0,"RootExit"]:Uc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ni(e){return e[Fe]=!1,e.nodes&&e.nodes.forEach(t=>ni(t)),e}let si={},Lt=class Tc{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 Tc||r instanceof wa)s=ni(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=Tm;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[Lm]&&Mm.rebuild(s)}else s=ni(r);this.result=new wa(t,s,n),this.helpers={...si,postcss:si,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(!_m[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Nm[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(Wt(n))try{await n}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Fe];){t[Fe]=!0;let r=[va(t)];for(;r.length>0;){let n=this.visitTick(r);if(Wt(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 Wt(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=Am;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);let n=new Om(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(Wt(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Fe];)t[Fe]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[n,s]of t){let i;this.result.lastPlugin=n;try{i=s(r,this.helpers)}catch(a){throw this.handleError(a,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(Wt(i))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if(n.type!=="root"&&n.type!=="document"&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[a,o]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=a;try{return o(n.toProxy(),this.helpers)}catch(l){throw this.handleError(l,n)}}if(r.iterator!==0){let a,o=r.iterator;for(;a=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!a[Fe])return a[Fe]=!0,void t.push(va(a));r.iterator=0,delete n.indexes[o]}let i=r.events;for(;r.eventIndex<i.length;){let a=i[r.eventIndex];if(r.eventIndex+=1,a===0)return void(n.nodes&&n.nodes.length&&(n[Fe]=!0,r.iterator=n.getIterator()));if(this.listeners[a])return void(r.visitors=this.listeners[a])}t.pop()}walkSync(t){t[Fe]=!0;let r=Uc(t);for(let n of r)if(n===0)t.nodes&&t.each(s=>{s[Fe]||this.walkSync(s)});else{let s=this.listeners[n];if(s&&this.visitSync(s,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Lt.registerPostcss=e=>{si=e};var Dc=Lt;Lt.default=Lt,Dm.registerLazyResult(Lt),Um.registerLazyResult(Lt);let Fm=hc,Bm=Wn,zm=Zi;const jm=Ji;let ii=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=Bm;this.result=new jm(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let a=new Fm(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=zm;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 Wm=ii;ii.default=ii;let Vm=Wm,Gm=Dc,Hm=qi,$m=wr,Ht=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r!="object"||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Gm(this,e,t):new Vm(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ym=Ht;Ht.default=Ht,$m.registerProcessor(Ht),Hm.registerProcessor(Ht);let qm=Gn,Jm=lc,Km=$n,Xm=Ki,Zm=Hn,Qm=wr,ef=Xi;function pr(e,t){if(Array.isArray(e))return e.map(s=>pr(s));let{inputs:r,...n}=e;if(r){t=[];for(let s of r){let i={...s,__proto__:Zm.prototype};i.map&&(i.map={...i.map,__proto__:Jm.prototype}),t.push(i)}}if(n.nodes&&(n.nodes=e.nodes.map(s=>pr(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 Qm(n);if(n.type==="decl")return new qm(n);if(n.type==="rule")return new ef(n);if(n.type==="comment")return new Km(n);if(n.type==="atrule")return new Xm(n);throw new Error("Unknown node type: "+e.type)}var tf=pr;pr.default=pr;let rf=Hi,ba=Gn,nf=Dc,sf=wt,oi=Ym,of=Wn,af=tf,Sa=qi,lf=Ec,Ia=$n,Ca=Ki,cf=Ji,uf=Hn,df=Zi,pf=Ac,ka=Xi,Ea=wr,hf=Vn;function X(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new oi(e)}X.plugin=function(e,t){let r,n=!1;function s(...i){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
52
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 oi().version,a}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(i,a,o){return X([s(o)]).process(i,a)},s},X.stringify=of,X.parse=df,X.fromJSON=af,X.list=pf,X.comment=e=>new Ia(e),X.atRule=e=>new Ca(e),X.decl=e=>new ba(e),X.rule=e=>new ka(e),X.root=e=>new Ea(e),X.document=e=>new Sa(e),X.CssSyntaxError=rf,X.Declaration=ba,X.Container=sf,X.Processor=oi,X.Document=Sa,X.Comment=Ia,X.Warning=lf,X.AtRule=Ca,X.Result=cf,X.Input=uf,X.Rule=ka,X.Root=Ea,X.Node=hf,nf.registerPostcss(X);var mf=X;X.default=X;const le=_h(mf);le.stringify,le.fromJSON,le.plugin,le.parse,le.list,le.document,le.comment,le.atRule,le.rule,le.decl,le.root,le.CssSyntaxError,le.Declaration,le.Container,le.Processor,le.Document,le.Comment,le.Warning,le.AtRule,le.Result,le.Input,le.Rule,le.Root,le.Node;class Qi{constructor(...t){Le(this,"parentElement",null),Le(this,"parentNode",null),Le(this,"ownerDocument"),Le(this,"firstChild",null),Le(this,"lastChild",null),Le(this,"previousSibling",null),Le(this,"nextSibling",null),Le(this,"ELEMENT_NODE",1),Le(this,"TEXT_NODE",3),Le(this,"nodeType"),Le(this,"nodeName"),Le(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 Qi)||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 xa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ra={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},jr={};function eo(e){if(jr[e])return jr[e];const t=globalThis[e],r=t.prototype,n=e in xa?xa[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 Ra?Ra[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return jr[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?jr[e]=c:r}catch{return r}}const ds={};function rt(e,t,r){var n;const s=`${e}.${String(r)}`;if(ds[s])return ds[s].call(t);const i=eo(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(ds[s]=a,a.call(t)):t[r]}const ps={};function La(e,t,r){const n=`${e}.${String(r)}`;if(ps[n])return ps[n].bind(t);const s=eo(e)[r];return typeof s!="function"?t[r]:(ps[n]=s,s.bind(t))}function Pc(){return eo("MutationObserver").constructor}const G={childNodes:function(e){return rt("Node",e,"childNodes")},parentNode:function(e){return rt("Node",e,"parentNode")},parentElement:function(e){return rt("Node",e,"parentElement")},textContent:function(e){return rt("Node",e,"textContent")},contains:function(e,t){return La("Node",e,"contains")(t)},getRootNode:function(e){return La("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?rt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?rt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return rt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return rt("Element",e,"querySelectorAll")(t)},mutationObserver:Pc};function ve(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Ct=`Please stop import mirror directly. Instead of that,\r
53
+ https://www.w3ctech.com/topic/2226`));let a=t(...i);return a.postcssPlugin=e,a.postcssVersion=new oi().version,a}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(i,a,o){return X([s(o)]).process(i,a)},s},X.stringify=of,X.parse=df,X.fromJSON=af,X.list=pf,X.comment=e=>new Ia(e),X.atRule=e=>new Ca(e),X.decl=e=>new ba(e),X.rule=e=>new ka(e),X.root=e=>new Ea(e),X.document=e=>new Sa(e),X.CssSyntaxError=rf,X.Declaration=ba,X.Container=sf,X.Processor=oi,X.Document=Sa,X.Comment=Ia,X.Warning=lf,X.AtRule=Ca,X.Result=cf,X.Input=uf,X.Rule=ka,X.Root=Ea,X.Node=hf,nf.registerPostcss(X);var mf=X;X.default=X;const ce=_h(mf);ce.stringify,ce.fromJSON,ce.plugin,ce.parse,ce.list,ce.document,ce.comment,ce.atRule,ce.rule,ce.decl,ce.root,ce.CssSyntaxError,ce.Declaration,ce.Container,ce.Processor,ce.Document,ce.Comment,ce.Warning,ce.AtRule,ce.Result,ce.Input,ce.Rule,ce.Root,ce.Node;class Qi{constructor(...t){Re(this,"parentElement",null),Re(this,"parentNode",null),Re(this,"ownerDocument"),Re(this,"firstChild",null),Re(this,"lastChild",null),Re(this,"previousSibling",null),Re(this,"nextSibling",null),Re(this,"ELEMENT_NODE",1),Re(this,"TEXT_NODE",3),Re(this,"nodeType"),Re(this,"nodeName"),Re(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(!(t instanceof Qi)||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 xa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ra={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},jr={};function eo(e){if(jr[e])return jr[e];const t=globalThis[e],r=t.prototype,n=e in xa?xa[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 Ra?Ra[e]:void 0,a=!!(i&&i.every(o=>{var l;return typeof r[o]=="function"&&((l=r[o])==null?void 0:l.toString().includes("[native code]"))}));if(s&&a)return jr[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");document.body.appendChild(o);const l=o.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;return document.body.removeChild(o),c?jr[e]=c:r}catch{return r}}const ds={};function tt(e,t,r){var n;const s=`${e}.${String(r)}`;if(ds[s])return ds[s].call(t);const i=eo(e),a=(n=Object.getOwnPropertyDescriptor(i,r))==null?void 0:n.get;return a?(ds[s]=a,a.call(t)):t[r]}const ps={};function La(e,t,r){const n=`${e}.${String(r)}`;if(ps[n])return ps[n].bind(t);const s=eo(e)[r];return typeof s!="function"?t[r]:(ps[n]=s,s.bind(t))}function Pc(){return eo("MutationObserver").constructor}const G={childNodes:function(e){return tt("Node",e,"childNodes")},parentNode:function(e){return tt("Node",e,"parentNode")},parentElement:function(e){return tt("Node",e,"parentElement")},textContent:function(e){return tt("Node",e,"textContent")},contains:function(e,t){return La("Node",e,"contains")(t)},getRootNode:function(e){return La("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?tt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?tt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return tt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return tt("Element",e,"querySelectorAll")(t)},mutationObserver:Pc};function ve(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Ct=`Please stop import mirror directly. Instead of that,\r
54
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(Ct),-1),getNode:()=>(console.error(Ct),null),removeNodeFromMap(){console.error(Ct)},has:()=>(console.error(Ct),!1),reset(){console.error(Ct)}};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 Yn(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Yn(e,t,i||{},!0)}function Ut(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(Ct),Reflect.get(e,t,r))}));let bn=Date.now;function _c(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=G.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=G.parentElement(i.body))==null?void 0:n.scrollTop)||((s=i==null?void 0:i.body)==null?void 0:s.scrollTop)||0}}function Nc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Bc(e){return e?e.nodeType===e.ELEMENT_NODE?e:G.parentElement(e):null}function Se(e,t,r,n){if(!e)return!1;const s=Bc(e);if(!s)return!1;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return!0}else if(vn(s,t,n))return!0}catch{}return!!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function hs(e,t,r){return!(e.tagName!=="TITLE"||!r.headTitleMutations)||t.getId(e)===-2}function zc(e,t){if(Xt(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=G.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||zc(n,t))}function ai(e){return!!e.changedTouches}function jc(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 li(e){return!!e&&(e instanceof Qi&&"shadowRoot"in e?!!e.shadowRoot:!!G.shadowRoot(e))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bn=()=>new Date().getTime());class ff{constructor(){L(this,"id",1),L(this,"styleIDMap",new WeakMap),L(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=G.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&G.host(G.getRootNode(e))&&(r=G.host(G.getRootNode(e))),r}function gf(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 G.contains(t,r)}function Gc(e){const t=e.ownerDocument;return!!t&&(G.contains(t,e)||gf(e))}var Y=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Y||{}),H=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(H||{}),Ie=(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))(Ie||{}),$e=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))($e||{}),kt=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(kt||{}),Et=(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))(Et||{});function Aa(e){return"__ln"in e}class yf{constructor(){L(this,"length",0),L(this,"head",null),L(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 Ma=(e,t)=>`${e}@${t}`;class wf{constructor(){L(this,"frozen",!1),L(this,"locked",!1),L(this,"texts",[]),L(this,"attributes",[]),L(this,"attributeMap",new WeakMap),L(this,"removes",[]),L(this,"mapRemoves",[]),L(this,"movedMap",{}),L(this,"addedSet",new Set),L(this,"movedSet",new Set),L(this,"droppedSet",new Set),L(this,"mutationCb"),L(this,"blockClass"),L(this,"blockSelector"),L(this,"maskTextClass"),L(this,"maskTextSelector"),L(this,"inlineStylesheet"),L(this,"maskInputOptions"),L(this,"maskTextFn"),L(this,"maskInputFn"),L(this,"keepIframeSrcFn"),L(this,"recordCanvas"),L(this,"inlineImages"),L(this,"slimDOMOptions"),L(this,"dataURLOptions"),L(this,"doc"),L(this,"mirror"),L(this,"iframeManager"),L(this,"stylesheetManager"),L(this,"shadowDomManager"),L(this,"canvasManager"),L(this,"processedNodeManager"),L(this,"unattachedDoc"),L(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),L(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new yf,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=G.parentNode(l);if(!c||!Gc(l)||c.tagName==="TEXTAREA")return;const u=Xt(c)?this.mirror.getId(Vc(l)):this.mirror.getId(c),d=s(l);if(u===-1||d===-1)return n.addNode(l);const h=xt(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=>{jc(f,this.mirror)&&this.iframeManager.addIframe(f),Wc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),li(l)&&this.shadowDomManager.addShadowRoot(G.shadowRoot(l),this.doc)},onIframeLoad:(f,v)=>{this.iframeManager.attachIframe(f,v),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,v)=>{this.stylesheetManager.attachLinkElement(f,v)}});h&&(t.push({parentId:u,nextId:d,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Ua(this.removes,l,this.mirror)&&!this.movedSet.has(G.parentNode(l))||i(l);for(const l of this.addedSet)Ta(this.droppedSet,l)||Ua(this.removes,l,this.mirror)?Ta(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(G.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(G.parentNode(u.value));if(s(u.value)===-1)continue;if(d!==-1){l=u;break}{const h=u.value,f=G.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const v=G.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=G.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))}),L(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(G.childNodes(t),n=>G.textContent(n)||"").join("")}),L(this,"processMutation",t=>{if(!hs(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=G.textContent(t.target);Se(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue||this.texts.push({value:Al(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Bc(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=Pi(r);s=Di({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(Se(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(s)){if(r.contentDocument)return;n="rr_src"}if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ol(r.tagName,n))if(i.attributes[n]=Ll(this.doc,ft(r.tagName),ft(n),s),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const o of Array.from(r.style)){const l=r.style.getPropertyValue(o),c=r.style.getPropertyPriority(o);l!==a.style.getPropertyValue(o)||c!==a.style.getPropertyPriority(o)?i.styleDiff[o]=c===""?l:[l,c]:i._unchangedStyles[o]=[l,c]}for(const o of Array.from(a.style))r.style.getPropertyValue(o)===""&&(i.styleDiff[o]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Se(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA")return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),s=Xt(t.target)?this.mirror.getId(G.host(t.target)):this.mirror.getId(t.target);Se(t.target,this.blockClass,this.blockSelector,!1)||hs(r,this.mirror,this.slimDOMOptions)||!function(i,a){return a.getId(i)!==-1}(r,this.mirror)||(this.addedSet.has(r)?(ci(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||zc(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ma(n,s)]?ci(this.movedSet,r):this.removes.push({parentId:s,id:n,isShadow:!(!Xt(t.target)||!Zt(t.target))||void 0})),this.mapRemoves.push(r))})}}),L(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(hs(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[Ma(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Se(t,this.blockClass,this.blockSelector,!1)||(G.childNodes(t).forEach(n=>this.genAdds(n)),li(t)&&G.childNodes(G.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 ci(e,t){e.delete(t),G.childNodes(t).forEach(r=>ci(e,r))}function Ua(e,t,r){return e.length!==0&&function(n,s,i){let a=G.parentNode(s);for(;a;){const o=i.getId(a);if(n.some(l=>l.id===o))return!0;a=G.parentNode(a)}return!1}(e,t,r)}function Ta(e,t){return e.size!==0&&Hc(e,t)}function Hc(e,t){const r=G.parentNode(t);return!!r&&(!!e.has(r)||Hc(e,r))}let Qt;const $=e=>Qt?(...t)=>{try{return e(...t)}catch(r){if(Qt&&Qt(r)===!0)return;throw r}}:e,mt=[];function er(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 $c(e,t){const r=new wf;mt.push(r),r.init(e);const n=new(Pc())($(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function vf({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(Ie).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let u=ft(c);const d=(h=>f=>{const v=er(f);if(Se(v,n,s,!0))return;let p=null,I=h;if("pointerType"in f){switch(f.pointerType){case"mouse":p=$e.Mouse;break;case"touch":p=$e.Touch;break;case"pen":p=$e.Pen}p===$e.Touch?Ie[h]===Ie.MouseDown?I="TouchStart":Ie[h]===Ie.MouseUp&&(I="TouchEnd"):$e.Pen}else ai(f)&&(p=$e.Touch);p!==null?(l=p,(I.startsWith("Touch")&&p===$e.Touch||I.startsWith("Mouse")&&p===$e.Mouse)&&(p=null)):Ie[h]===Ie.Click&&(p=l,l=null);const m=ai(f)?f.changedTouches[0]:f;if(!m)return;const g=r.getId(v),{clientX:b,clientY:C}=m;$(e)({type:Ie[I],id:g,x:b,y:C,...p!==null&&{pointerType:p}})})(c);if(window.PointerEvent)switch(Ie[c]){case Ie.MouseDown:case Ie.MouseUp:u=u.replace("mouse","pointer");break;case Ie.TouchStart:case Ie.TouchEnd:return}o.push(ve(u,d,t))}),$(()=>{o.forEach(c=>c())})}function Yc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){return ve("scroll",$($t($(a=>{const o=er(a);if(!o||Se(o,n,s,!0))return;const l=r.getId(o);if(o===t&&t.defaultView){const c=_c(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 bf=["INPUT","TEXTAREA","SELECT"],Da=new WeakMap;function Wr(e){return function(t,r){if(Vr("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Vr("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Vr("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Vr("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const n=Array.from(t.parentRule.cssRules).indexOf(t);r.unshift(n)}else if(t.parentStyleSheet){const n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function nt(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function qc({mirror:e,stylesheetManager:t},r){var n,s,i;let a=null;a=r.nodeName==="#document"?e.getId(r):e.getId(G.host(r));const o=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:i.ShadowRoot,l=o!=null&&o.prototype?Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets"):void 0;return a!==null&&a!==-1&&o&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;const d=(u=l.set)==null?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return d}}),$(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Sf(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;(function(m,g){const{mutationCb:b,mousemoveCb:C,mouseInteractionCb:A,scrollCb:E,viewportResizeCb:T,inputCb:M,mediaInteractionCb:k,styleSheetRuleCb:R,styleDeclarationCb:x,canvasMutationCb:S,fontCb:D,selectionCb:P,customElementCb:w}=m;m.mutationCb=(...y)=>{g.mutation&&g.mutation(...y),b(...y)},m.mousemoveCb=(...y)=>{g.mousemove&&g.mousemove(...y),C(...y)},m.mouseInteractionCb=(...y)=>{g.mouseInteraction&&g.mouseInteraction(...y),A(...y)},m.scrollCb=(...y)=>{g.scroll&&g.scroll(...y),E(...y)},m.viewportResizeCb=(...y)=>{g.viewportResize&&g.viewportResize(...y),T(...y)},m.inputCb=(...y)=>{g.input&&g.input(...y),M(...y)},m.mediaInteractionCb=(...y)=>{g.mediaInteaction&&g.mediaInteaction(...y),k(...y)},m.styleSheetRuleCb=(...y)=>{g.styleSheetRule&&g.styleSheetRule(...y),R(...y)},m.styleDeclarationCb=(...y)=>{g.styleDeclaration&&g.styleDeclaration(...y),x(...y)},m.canvasMutationCb=(...y)=>{g.canvasMutation&&g.canvasMutation(...y),S(...y)},m.fontCb=(...y)=>{g.font&&g.font(...y),D(...y)},m.selectionCb=(...y)=>{g.selection&&g.selection(...y),P(...y)},m.customElementCb=(...y)=>{g.customElement&&g.customElement(...y),w(...y)}})(e,t),e.recordDOM&&(n=$c(e,e.doc));const s=function({mousemoveCb:m,sampling:g,doc:b,mirror:C}){if(g.mousemove===!1)return()=>{};const A=typeof g.mousemove=="number"?g.mousemove:50,E=typeof g.mousemoveCallback=="number"?g.mousemoveCallback:500;let T,M=[];const k=$t($(S=>{const D=Date.now()-T;m(M.map(P=>(P.timeOffset-=D,P)),S),M=[],T=null}),E),R=$($t($(S=>{const D=er(S),{clientX:P,clientY:w}=ai(S)?S.changedTouches[0]:S;T||(T=bn()),M.push({x:P,y:w,id:C.getId(D),timeOffset:bn()-T}),k(typeof DragEvent<"u"&&S instanceof DragEvent?H.Drag:S instanceof MouseEvent?H.MouseMove:H.TouchMove)}),A,{trailing:!1})),x=[ve("mousemove",R,b),ve("touchmove",R,b),ve("drag",R,b)];return $(()=>{x.forEach(S=>S())})}(e),i=vf(e),a=Yc(e),o=function({viewportResizeCb:m},{win:g}){let b=-1,C=-1;return ve("resize",$($t($(()=>{const A=Nc(),E=Fc();b===A&&C===E||(m({width:Number(E),height:Number(A)}),b=A,C=E)}),200)),g)}(e,{win:r}),l=function({inputCb:m,doc:g,mirror:b,blockClass:C,blockSelector:A,ignoreClass:E,ignoreSelector:T,maskInputOptions:M,maskInputFn:k,sampling:R,userTriggeredOnInput:x}){function S(B){let j=er(B);const O=B.isTrusted,N=j&&j.tagName;if(j&&N==="OPTION"&&(j=G.parentElement(j)),!j||!N||bf.indexOf(N)<0||Se(j,C,A,!0)||j.classList.contains(E)||T&&j.matches(T))return;let ee=j.value,q=!1;const me=Pi(j)||"";me==="radio"||me==="checkbox"?q=j.checked:(M[N.toLowerCase()]||M[me])&&(ee=Di({element:j,maskInputOptions:M,tagName:N,type:me,value:ee,maskInputFn:k})),D(j,x?{text:ee,isChecked:q,userTriggered:O}:{text:ee,isChecked:q});const Ne=j.name;me==="radio"&&Ne&&q&&g.querySelectorAll(`input[type="radio"][name="${Ne}"]`).forEach(V=>{if(V!==j){const ge=V.value;D(V,x?{text:ge,isChecked:!q,userTriggered:!1}:{text:ge,isChecked:!q})}})}function D(B,j){const O=Da.get(B);if(!O||O.text!==j.text||O.isChecked!==j.isChecked){Da.set(B,j);const N=b.getId(B);$(m)({...j,id:N})}}const P=(R.input==="last"?["change"]:["input","change"]).map(B=>ve(B,$(S),g)),w=g.defaultView;if(!w)return()=>{P.forEach(B=>B())};const y=w.Object.getOwnPropertyDescriptor(w.HTMLInputElement.prototype,"value"),U=[[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&&P.push(...U.map(B=>Yn(B[0],B[1],{set(){$(S)({target:this,isTrusted:!1})}},!1,w))),$(()=>{P.forEach(B=>B())})}(e),c=function({mediaInteractionCb:m,blockClass:g,blockSelector:b,mirror:C,sampling:A,doc:E}){const T=$(k=>$t($(R=>{const x=er(R);if(!x||Se(x,g,b,!0))return;const{currentTime:S,volume:D,muted:P,playbackRate:w,loop:y}=x;m({type:k,id:C.getId(x),currentTime:S,volume:D,muted:P,playbackRate:w,loop:y})}),A.media||500)),M=[ve("play",T(Et.Play),E),ve("pause",T(Et.Pause),E),ve("seeked",T(Et.Seeked),E),ve("volumechange",T(Et.VolumeChange),E),ve("ratechange",T(Et.RateChange),E)];return $(()=>{M.forEach(k=>k())})}(e);let u=()=>{},d=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:m,mirror:g,stylesheetManager:b},{win:C}){if(!C.CSSStyleSheet||!C.CSSStyleSheet.prototype)return()=>{};const A=C.CSSStyleSheet.prototype.insertRule;C.CSSStyleSheet.prototype.insertRule=new Proxy(A,{apply:$((x,S,D)=>{const[P,w]=D,{id:y,styleId:U}=nt(S,g,b.styleMirror);return(y&&y!==-1||U&&U!==-1)&&m({id:y,styleId:U,adds:[{rule:P,index:w}]}),x.apply(S,D)})}),C.CSSStyleSheet.prototype.addRule=function(x,S,D=this.cssRules.length){const P=`${x} { ${S} }`;return C.CSSStyleSheet.prototype.insertRule.apply(this,[P,D])};const E=C.CSSStyleSheet.prototype.deleteRule;let T,M;C.CSSStyleSheet.prototype.deleteRule=new Proxy(E,{apply:$((x,S,D)=>{const[P]=D,{id:w,styleId:y}=nt(S,g,b.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,removes:[{index:P}]}),x.apply(S,D)})}),C.CSSStyleSheet.prototype.removeRule=function(x){return C.CSSStyleSheet.prototype.deleteRule.apply(this,[x])},C.CSSStyleSheet.prototype.replace&&(T=C.CSSStyleSheet.prototype.replace,C.CSSStyleSheet.prototype.replace=new Proxy(T,{apply:$((x,S,D)=>{const[P]=D,{id:w,styleId:y}=nt(S,g,b.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,replace:P}),x.apply(S,D)})})),C.CSSStyleSheet.prototype.replaceSync&&(M=C.CSSStyleSheet.prototype.replaceSync,C.CSSStyleSheet.prototype.replaceSync=new Proxy(M,{apply:$((x,S,D)=>{const[P]=D,{id:w,styleId:y}=nt(S,g,b.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,replaceSync:P}),x.apply(S,D)})}));const k={};Gr("CSSGroupingRule")?k.CSSGroupingRule=C.CSSGroupingRule:(Gr("CSSMediaRule")&&(k.CSSMediaRule=C.CSSMediaRule),Gr("CSSConditionRule")&&(k.CSSConditionRule=C.CSSConditionRule),Gr("CSSSupportsRule")&&(k.CSSSupportsRule=C.CSSSupportsRule));const R={};return Object.entries(k).forEach(([x,S])=>{R[x]={insertRule:S.prototype.insertRule,deleteRule:S.prototype.deleteRule},S.prototype.insertRule=new Proxy(R[x].insertRule,{apply:$((D,P,w)=>{const[y,U]=w,{id:B,styleId:j}=nt(P.parentStyleSheet,g,b.styleMirror);return(B&&B!==-1||j&&j!==-1)&&m({id:B,styleId:j,adds:[{rule:y,index:[...Wr(P),U||0]}]}),D.apply(P,w)})}),S.prototype.deleteRule=new Proxy(R[x].deleteRule,{apply:$((D,P,w)=>{const[y]=w,{id:U,styleId:B}=nt(P.parentStyleSheet,g,b.styleMirror);return(U&&U!==-1||B&&B!==-1)&&m({id:U,styleId:B,removes:[{index:[...Wr(P),y]}]}),D.apply(P,w)})})}),$(()=>{C.CSSStyleSheet.prototype.insertRule=A,C.CSSStyleSheet.prototype.deleteRule=E,T&&(C.CSSStyleSheet.prototype.replace=T),M&&(C.CSSStyleSheet.prototype.replaceSync=M),Object.entries(k).forEach(([x,S])=>{S.prototype.insertRule=R[x].insertRule,S.prototype.deleteRule=R[x].deleteRule})})}(e,{win:r}),d=qc(e,e.doc),h=function({styleDeclarationCb:m,mirror:g,ignoreCSSAttributes:b,stylesheetManager:C},{win:A}){const E=A.CSSStyleDeclaration.prototype.setProperty;A.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:$((M,k,R)=>{var x;const[S,D,P]=R;if(b.has(S))return E.apply(k,[S,D,P]);const{id:w,styleId:y}=nt((x=k.parentRule)==null?void 0:x.parentStyleSheet,g,C.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,set:{property:S,value:D,priority:P},index:Wr(k.parentRule)}),M.apply(k,R)})});const T=A.CSSStyleDeclaration.prototype.removeProperty;return A.CSSStyleDeclaration.prototype.removeProperty=new Proxy(T,{apply:$((M,k,R)=>{var x;const[S]=R;if(b.has(S))return T.apply(k,[S]);const{id:D,styleId:P}=nt((x=k.parentRule)==null?void 0:x.parentStyleSheet,g,C.styleMirror);return(D&&D!==-1||P&&P!==-1)&&m({id:D,styleId:P,remove:{property:S},index:Wr(k.parentRule)}),M.apply(k,R)})}),$(()=>{A.CSSStyleDeclaration.prototype.setProperty=E,A.CSSStyleDeclaration.prototype.removeProperty=T})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:m,doc:g}){const b=g.defaultView;if(!b)return()=>{};const C=[],A=new WeakMap,E=b.FontFace;b.FontFace=function(M,k,R){const x=new E(M,k,R);return A.set(x,{family:M,buffer:typeof k!="string",descriptors:R,fontSource:typeof k=="string"?k:JSON.stringify(Array.from(new Uint8Array(k)))}),x};const T=Ut(g.fonts,"add",function(M){return function(k){return setTimeout($(()=>{const R=A.get(k);R&&(m(R),A.delete(k))}),0),M.apply(this,[k])}});return C.push(()=>{b.FontFace=E}),C.push(T),$(()=>{C.forEach(M=>M())})}(e)));const v=function(m){const{doc:g,mirror:b,blockClass:C,blockSelector:A,selectionCb:E}=m;let T=!0;const M=$(()=>{const k=g.getSelection();if(!k||T&&(k!=null&&k.isCollapsed))return;T=k.isCollapsed||!1;const R=[],x=k.rangeCount||0;for(let S=0;S<x;S++){const D=k.getRangeAt(S),{startContainer:P,startOffset:w,endContainer:y,endOffset:U}=D;Se(P,C,A,!0)||Se(y,C,A,!0)||R.push({start:b.getId(P),startOffset:w,end:b.getId(y),endOffset:U})}E({ranges:R})});return M(),ve("selectionchange",M)}(e),p=function({doc:m,customElementCb:g}){const b=m.defaultView;return b&&b.customElements?Ut(b.customElements,"define",function(C){return function(A,E,T){try{g({define:{name:A}})}catch{console.warn(`Custom element callback failed for ${A}`)}return C.apply(this,[A,E,T])}}):()=>{}}(e),I=[];for(const m of e.plugins)I.push(m.observer(m.callback,r,m.options));return $(()=>{mt.forEach(m=>m.reset()),n==null||n.disconnect(),s(),i(),a(),o(),l(),c(),u(),d(),h(),f(),v(),p(),I.forEach(m=>m())})}function Vr(e){return window[e]!==void 0}function Gr(e){return!!(window[e]!==void 0&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pa{constructor(t){L(this,"iframeIdToRemoteIdMap",new WeakMap),L(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 If{constructor(t){L(this,"iframes",new WeakMap),L(this,"crossOriginIframeMap",new WeakMap),L(this,"crossOriginIframeMirror",new Pa(Rl)),L(this,"crossOriginIframeStyleMirror"),L(this,"crossOriginIframeRootIdMap",new WeakMap),L(this,"mirror"),L(this,"mutationCb"),L(this,"wrappedEmit"),L(this,"loadListener"),L(this,"stylesheetManager"),L(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 Y.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:Y.IncrementalSnapshot,data:{source:H.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return r;case Y.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case Y.IncrementalSnapshot:switch(r.data.source){case H.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case H.Drag:case H.TouchMove:case H.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case H.ViewportResize:return!1;case H.MediaInteraction:case H.MouseInteraction:case H.Scroll:case H.CanvasMutation:case H.Input:return this.replaceIds(r.data,t,["id"]),r;case H.StyleSheetRule:case H.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case H.Font:return r;case H.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),r;case H.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),r}}return!1}replace(t,r,n,s){for(const i of s)(Array.isArray(r[i])||typeof r[i]=="number")&&(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type===fe.Document||t.rootId||(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class Cf{constructor(t){L(this,"shadowDoms",new WeakSet),L(this,"mutationCb"),L(this,"scrollCb"),L(this,"bypassOptions"),L(this,"mirror"),L(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!Zt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=$c({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Yc({...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(G.host(t))),this.restoreHandlers.push(qc({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(Ut(t.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i),o=G.shadowRoot(this);return o&&Gc(this)&&n.addShadowRoot(o,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kf=typeof Uint8Array>"u"?[]:new Uint8Array(256),Hr=0;Hr<64;Hr++)kf[Yt.charCodeAt(Hr)]=Hr;const _a=new Map,Jc=(e,t,r)=>{if(!e||!Xc(e,t)&&typeof e!="object")return;const n=function(i,a){let o=_a.get(i);return o||(o=new Map,_a.set(i,o)),o.has(a)||o.set(a,[]),o.get(a)}(r,e.constructor.name);let s=n.indexOf(e);return s===-1&&(s=n.length,n.push(e)),s};function cn(e,t,r){if(e instanceof Array)return e.map(n=>cn(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(n){var s,i=new Uint8Array(n),a=i.length,o="";for(s=0;s<a;s+=3)o+=Yt[i[s]>>2],o+=Yt[(3&i[s])<<4|i[s+1]>>4],o+=Yt[(15&i[s+1])<<2|i[s+2]>>6],o+=Yt[63&i[s+2]];return a%3==2?o=o.substring(0,o.length-1)+"=":a%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[cn(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:s}=e;return{rr_type:n,src:s}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[cn(e.data,t,r),e.width,e.height]}:Xc(e,t)||typeof e=="object"?{rr_type:e.constructor.name,index:Jc(e,t,r)}:e}const Kc=(e,t,r)=>e.map(n=>cn(n,t,r)),Xc=(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 Na(e,t,r,n){const s=[];try{const i=Ut(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(o,...l){if(!Se(this,t,r,!0)){const c=function(u){return u==="experimental-webgl"?"webgl":u}(o);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){const u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[o,...l])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function 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=Ut(e,l,function(u){return function(...d){const h=u.apply(this,d);if(Jc(h,i,this),"tagName"in this.canvas&&!Se(this.canvas,n,s,!0)){const f=Kc(d,i,this),v={type:t,property:l,args:f};r(this.canvas,v)}return h}});a.push(c)}catch{const c=Yn(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});a.push(c)}return a}const Zc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ba=typeof window<"u"&&window.Blob&&new Blob([(za=Zc,Uint8Array.from(atob(za),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var za;function Ef(e){let t;try{if(t=Ba&&(window.URL||window.webkitURL).createObjectURL(Ba),!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,"+Zc,{name:e==null?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class xf{constructor(t){L(this,"pendingCanvasMutations",new Map),L(this,"rafStamps",{latestId:0,invokeId:null}),L(this,"mirror"),L(this,"mutationCb"),L(this,"resetObservers"),L(this,"frozen",!1),L(this,"locked",!1),L(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=Na(r,n,s,!0),o=new Map,l=new Ef;l.onmessage=f=>{const{id:v}=f.data;if(o.set(v,!1),!("base64"in f.data))return;const{base64:p,type:I,width:m,height:g}=f.data;this.mutationCb({id:v,type:kt["2D"],commands:[{property:"clearRect",args:[0,0,m,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:p}],type:I}]},0,0]}]})};const c=1e3/t;let u,d=0;const h=f=>{d&&f-d<c||(d=f,(()=>{const v=[];return r.document.querySelectorAll("canvas").forEach(p=>{Se(p,n,s,!0)||v.push(p)}),v})().forEach(async v=>{var p;const I=this.mirror.getId(v);if(o.get(I)||v.width===0||v.height===0)return;if(o.set(I,!0),["webgl","webgl2"].includes(v.__context)){const g=v.getContext(v.__context);((p=g==null?void 0:g.getContextAttributes())==null?void 0:p.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const m=await createImageBitmap(v);l.postMessage({id:I,bitmap:m,width:v.width,height:v.height,dataURLOptions:i.dataURLOptions},[m])})),u=requestAnimationFrame(h)};u=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Na(t,r,n,!1),i=function(o,l,c,u){const d=[],h=Object.getOwnPropertyNames(l.CanvasRenderingContext2D.prototype);for(const f of h)try{if(typeof l.CanvasRenderingContext2D.prototype[f]!="function")continue;const v=Ut(l.CanvasRenderingContext2D.prototype,f,function(p){return function(...I){return Se(this.canvas,c,u,!0)||setTimeout(()=>{const m=Kc(I,l,this);o(this.canvas,{type:kt["2D"],property:f,args:m})},0),p.apply(this,I)}});d.push(v)}catch{const v=Yn(l.CanvasRenderingContext2D.prototype,f,{set(p){o(this.canvas,{type:kt["2D"],property:f,args:[p],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,kt.WebGL,o,c,u,l)),l.WebGL2RenderingContext!==void 0&&d.push(...Fa(l.WebGL2RenderingContext.prototype,kt.WebGL2,o,c,u,l)),()=>{d.forEach(h=>h())}}(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 Rf{constructor(t){L(this,"trackedLinkElements",new WeakSet),L(this,"mutationCb"),L(this,"adoptedStyleSheetCb"),L(this,"styleMirror",new ff),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},s=[];for(const i of t){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),s.push({styleId:a,rules:Array.from(i.rules||CSSRule,(o,l)=>({rule:El(o,i.href),index:l}))})),n.styleIds.push(a)}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Lf{constructor(){L(this,"nodeMap",new WeakMap),L(this,"active",!1)}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let ce,un,ms,Sn=!1;try{if(Array.from([1],e=>2*e)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Eo=e.contentWindow)==null?void 0:Eo.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Ae=new xl;function qt(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:h,slimDOMOptions:f,maskInputFn:v,maskTextFn:p,hooks:I,packFn:m,sampling:g={},dataURLOptions:b={},mousemoveWait:C,recordDOM:A=!0,recordCanvas:E=!1,recordCrossOriginIframes:T=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:R=!1,inlineImages:x=!1,plugins:S,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:w}=e;Qt=w;const y=!T||window.parent===window;let U=!1;if(!y)try{window.parent.document&&(U=!1)}catch{U=!0}if(y&&!t)throw new Error("emit function is required");if(!y&&!U)return()=>{};C!==void 0&&g.mousemove===void 0&&(g.mousemove=C),Ae.reset();const B=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},j=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all",headTitleMutations:f==="all"}:f||{};let O;(function(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 N=0;const ee=W=>{for(const Oe of S||[])Oe.eventProcessor&&(W=Oe.eventProcessor(W));return m&&!U&&(W=m(W)),W};ce=(W,Oe)=>{var ne;const oe=W;if(oe.timestamp=bn(),!((ne=mt[0])!=null&&ne.isFrozen())||oe.type===Y.FullSnapshot||oe.type===Y.IncrementalSnapshot&&oe.data.source===H.Mutation||mt.forEach(Re=>Re.unfreeze()),y)t==null||t(ee(oe),Oe);else if(U){const Re={type:"rrweb",event:ee(oe),origin:window.location.origin,isCheckout:Oe};window.parent.postMessage(Re,"*")}if(oe.type===Y.FullSnapshot)O=oe,N=0;else if(oe.type===Y.IncrementalSnapshot){if(oe.data.source===H.Mutation&&oe.data.isAttachIframe)return;N++;const Re=n&&N>=n,J=r&&oe.timestamp-O.timestamp>r;(Re||J)&&un(!0)}};const q=W=>{ce({type:Y.IncrementalSnapshot,data:{source:H.Mutation,...W}})},me=W=>ce({type:Y.IncrementalSnapshot,data:{source:H.Scroll,...W}}),Ne=W=>ce({type:Y.IncrementalSnapshot,data:{source:H.CanvasMutation,...W}}),V=new Rf({mutationCb:q,adoptedStyleSheetCb:W=>ce({type:Y.IncrementalSnapshot,data:{source:H.AdoptedStyleSheet,...W}})}),ge=new If({mirror:Ae,mutationCb:q,stylesheetManager:V,recordCrossOriginIframes:T,wrappedEmit:ce});for(const W of S||[])W.getMirror&&W.getMirror({nodeMirror:Ae,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror});const dt=new Lf;ms=new xf({recordCanvas:E,mutationCb:Ne,win:window,blockClass:s,blockSelector:i,mirror:Ae,sampling:g.canvas,dataURLOptions:b});const et=new Cf({mutationCb:q,scrollCb:me,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:B,dataURLOptions:b,maskTextFn:p,maskInputFn:v,recordCanvas:E,inlineImages:x,sampling:g,slimDOMOptions:j,iframeManager:ge,stylesheetManager:V,canvasManager:ms,keepIframeSrcFn:D,processedNodeManager:dt},mirror:Ae});un=(W=!1)=>{if(!A)return;ce({type:Y.Meta,data:{href:window.location.href,width:Fc(),height:Nc()}},W),V.reset(),et.init(),mt.forEach(ne=>ne.lock());const Oe=function(ne,oe){const{mirror:Re=new xl,blockClass:J="rr-block",blockSelector:_t=null,maskTextClass:id="rr-mask",maskTextSelector:od=null,inlineStylesheet:ad=!0,inlineImages:ld=!1,recordCanvas:cd=!1,maskAllInputs:Kn=!1,maskTextFn:ud,maskInputFn:dd,slimDOM:Nt=!1,dataURLOptions:pd,preserveWhiteSpace:hd,onSerialize:md,onIframeLoad:fd,iframeLoadTimeout:gd,onStylesheetLoad:yd,stylesheetLoadTimeout:wd,keepIframeSrcFn:vd=()=>!1}=oe||{};return xt(ne,{doc:ne,mirror:Re,blockClass:J,blockSelector:_t,maskTextClass:id,maskTextSelector:od,skipChild:!1,inlineStylesheet:ad,maskInputOptions:Kn===!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}:Kn===!1?{password:!0}:Kn,maskTextFn:ud,maskInputFn:dd,slimDOMOptions:Nt===!0||Nt==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:Nt==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:Nt===!1?{}:Nt,dataURLOptions:pd,inlineImages:ld,recordCanvas:cd,preserveWhiteSpace:hd,onSerialize:md,onIframeLoad:fd,iframeLoadTimeout:gd,onStylesheetLoad:yd,stylesheetLoadTimeout:wd,keepIframeSrcFn:vd,newlyAddedElement:!1})}(document,{mirror:Ae,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:B,maskTextFn:p,maskInputFn:v,slimDOM:j,dataURLOptions:b,recordCanvas:E,inlineImages:x,onSerialize:ne=>{jc(ne,Ae)&&ge.addIframe(ne),Wc(ne,Ae)&&V.trackLinkElement(ne),li(ne)&&et.addShadowRoot(G.shadowRoot(ne),document)},onIframeLoad:(ne,oe)=>{ge.attachIframe(ne,oe),et.observeAttachShadow(ne)},onStylesheetLoad:(ne,oe)=>{V.attachLinkElement(ne,oe)},keepIframeSrcFn:D});if(!Oe)return console.warn("Failed to snapshot the document");ce({type:Y.FullSnapshot,data:{node:Oe,initialOffset:_c(window)}},W),mt.forEach(ne=>ne.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Ae.getId(document))};try{const W=[],Oe=oe=>{var Re;return $(Sf)({mutationCb:q,mousemoveCb:(J,_t)=>ce({type:Y.IncrementalSnapshot,data:{source:_t,positions:J}}),mouseInteractionCb:J=>ce({type:Y.IncrementalSnapshot,data:{source:H.MouseInteraction,...J}}),scrollCb:me,viewportResizeCb:J=>ce({type:Y.IncrementalSnapshot,data:{source:H.ViewportResize,...J}}),inputCb:J=>ce({type:Y.IncrementalSnapshot,data:{source:H.Input,...J}}),mediaInteractionCb:J=>ce({type:Y.IncrementalSnapshot,data:{source:H.MediaInteraction,...J}}),styleSheetRuleCb:J=>ce({type:Y.IncrementalSnapshot,data:{source:H.StyleSheetRule,...J}}),styleDeclarationCb:J=>ce({type:Y.IncrementalSnapshot,data:{source:H.StyleDeclaration,...J}}),canvasMutationCb:Ne,fontCb:J=>ce({type:Y.IncrementalSnapshot,data:{source:H.Font,...J}}),selectionCb:J=>{ce({type:Y.IncrementalSnapshot,data:{source:H.Selection,...J}})},customElementCb:J=>{ce({type:Y.IncrementalSnapshot,data:{source:H.CustomElement,...J}})},blockClass:s,ignoreClass:a,ignoreSelector:o,maskTextClass:l,maskTextSelector:c,maskInputOptions:B,inlineStylesheet:u,sampling:g,recordDOM:A,recordCanvas:E,inlineImages:x,userTriggeredOnInput:k,collectFonts:R,doc:oe,maskInputFn:v,maskTextFn:p,keepIframeSrcFn:D,blockSelector:i,slimDOMOptions:j,dataURLOptions:b,mirror:Ae,iframeManager:ge,stylesheetManager:V,shadowDomManager:et,processedNodeManager:dt,canvasManager:ms,ignoreCSSAttributes:P,plugins:((Re=S==null?void 0:S.filter(J=>J.observer))==null?void 0:Re.map(J=>({observer:J.observer,options:J.options,callback:_t=>ce({type:Y.Plugin,data:{plugin:J.name,payload:_t}})})))||[]},I)};ge.addLoadListener(oe=>{try{W.push(Oe(oe.contentDocument))}catch(Re){console.warn(Re)}});const ne=()=>{un(),W.push(Oe(document)),Sn=!0};return document.readyState==="interactive"||document.readyState==="complete"?ne():(W.push(ve("DOMContentLoaded",()=>{ce({type:Y.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&ne()})),W.push(ve("load",()=>{ce({type:Y.Load,data:{}}),M==="load"&&ne()},window))),()=>{W.forEach(oe=>oe()),dt.destroy(),Sn=!1,Qt=void 0}}catch(W){console.warn(W)}}var ja,It;qt.addCustomEvent=(e,t)=>{if(!Sn)throw new Error("please add custom event after start recording");ce({type:Y.Custom,data:{tag:e,payload:t}})},qt.freezePage=()=>{mt.forEach(e=>e.freeze())},qt.takeFullSnapshot=e=>{if(!Sn)throw new Error("please take full snapshot after start recording");un(e)},qt.mirror=Ae,(It=ja||(ja={}))[It.NotStarted=0]="NotStarted",It[It.Running=1]="Running",It[It.Stopped=2]="Stopped";var Me=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.FeedbackClosed="feedback.closed",e.PageChange="page.change",e.API="api",e.Override="override",e))(Me||{}),F=(e=>(e.ReplayCapture="replay.capture",e.ReplayPaused="replay.paused",e.ReplayResumed="replay.resumed",e.FeedbackButtonLoaded="feedback.button.loaded",e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyCloseRequested="survey.closeRequested",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWidth="survey.width",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e.QuestionAnswered="question.answered",e))(F||{});const hr={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 Of=new Uint8Array(16);function Af(){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(Of)}const ye=[];for(let e=0;e<256;++e)ye.push((e+256).toString(16).slice(1));const Wa={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vt(e,t,r){if(Wa.randomUUID&&!e)return Wa.randomUUID();const n=(e=e||{}).random||(e.rng||Af)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(s,i=0){return ye[s[i+0]]+ye[s[i+1]]+ye[s[i+2]]+ye[s[i+3]]+"-"+ye[s[i+4]]+ye[s[i+5]]+"-"+ye[s[i+6]]+ye[s[i+7]]+"-"+ye[s[i+8]]+ye[s[i+9]]+"-"+ye[s[i+10]]+ye[s[i+11]]+ye[s[i+12]]+ye[s[i+13]]+ye[s[i+14]]+ye[s[i+15]]}(n)}const _=new class{constructor(){de(this,"breadcrumbs",[])}getTimeStamp(){return new Date().toISOString()}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>300&&this.breadcrumbs.shift()}debug(e,t="debug"){this.addBreadcrumb({category:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"debug"})}error(e,t={}){this.addBreadcrumb({category:"error",data:t,level:"error",message:e,timestamp:this.getTimeStamp(),type:"error"})}http(e,t){this.addBreadcrumb({category:"xhr",data:t,message:e,timestamp:this.getTimeStamp(),type:"http"})}info(e,t={}){this.addBreadcrumb({category:"info",data:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"info"})}navigation(e,t){this.addBreadcrumb({category:"navigation",data:t,message:e,timestamp:this.getTimeStamp(),type:"navigation"})}},Va=()=>{try{return window.parent.Intercom}catch{return null}},Ga=[Object.freeze(Object.defineProperty({__proto__:null,disable:()=>{const e=Va();e&&(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},enable:()=>{const e=Va();e&&(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)}},Symbol.toStringTag,{value:"Module"}))];class Qc{static disable(){Ga.forEach(t=>t.disable())}static enable(){Ga.forEach(t=>t.enable())}}var Mf=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"}},eu=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=eu.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 Mf(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)}},tu=eu;tu.defaultMaxListeners=10;const z=new tu,In=async e=>{await new Promise(t=>{setTimeout(t,e)})},to=({"userleap-platform":e})=>{var t;return((t=window.UserLeap)==null?void 0:t.forceDirectEmbed)||e!=="web"};class ru{constructor(t){de(this,"storage");de(this,"tempStorage",{});de(this,"isStorageAvailable");try{this.storage=window[t];const r="__storage_test__";this.storage.setItem(r,r),this.storage.removeItem(r),this.isStorageAvailable=!0}catch{this.isStorageAvailable=!1}}setItem(t,r){this.isStorageAvailable&&this.storage?this.storage.setItem(t,r):this.tempStorage[t]=r}setItemObject(t,r){try{this.setItem(t,JSON.stringify(r))}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to save to local storage",n))}}getItem(t){return this.isStorageAvailable&&this.storage?this.storage.getItem(t):this.tempStorage[t]}getItemObject(t){const r=this.getItem(t);if(r)try{return JSON.parse(r)}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to parse local storage",n))}return{}}removeItem(t){this.isStorageAvailable&&this.storage?this.storage.removeItem(t):delete this.tempStorage[t]}clear(){this.isStorageAvailable&&this.storage?this.storage.clear():this.tempStorage={}}}const ue=new ru("sessionStorage"),ke=new ru("localStorage");class Uf{constructor(t){de(this,"payload");de(this,"promise");de(this,"reject",()=>{});de(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((r,n)=>{this.reject=n,this.resolve=r})}resolveRequest(t){this.resolve(t)}}const re={replay:null},Tf=()=>{const e=[];return re.replay&&e.push("replay"),e.join(",")},Df=10;let nu=!1,su="",Yr=!1,iu=!1,dn=[];const Pf=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?"web-gtm":e._segment?"web-segment":"web-snippet",Ha=e=>{var t;(t=e==null?void 0:e.blockedURI)!=null&&t.includes(window.UserLeap._API_URL)&&(iu=!0,console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`))},ui=(e="")=>{nu=!0,su=e};function De(e={}){const t={"Content-Type":"application/json","userleap-platform":"web","x-ul-sdk-version":"2.41.1","x-ul-installation-method":Pf(e),"sprig-modules":Tf(),"x-ul-package-version":"2.41.1"};if(e.envId&&(t["x-ul-environment-id"]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t["x-ul-user-id"]=e.userId),e.visitorId&&(t["x-ul-visitor-id"]=e.visitorId),e.partnerAnonymousId&&(t["x-ul-anonymous-id"]=e.partnerAnonymousId),e.mobileHeadersJSON){const r=JSON.parse(e.mobileHeadersJSON);Object.assign(t,r)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t["x-ul-preview-mode"]="1"),t}const $a=async({shouldDropOnRateLimit:e,...t})=>{if(e)return{status:429};{const r=new Uf(t);return dn.push(r),r.promise}},Ge=async(e,t)=>{const{retries:r=0,shouldDropOnRateLimit:n=!1,shouldRetryRequest:s=!1,...i}=t,a={url:e,options:i,retries:r,shouldDropOnRateLimit:n};if(Yr&&!s)return $a(a);const o={ok:!1,reportError:!1};if(nu)return console.info(`UserLeap - ${su}`),o;try{const l=await fetch(e,i);if(l.status===429){if(!Yr&&!n||s){Yr=!0;const c=l.headers.has("ratelimit-reset")?Number(l.headers.get("ratelimit-reset")):Df;return await In(1e3*c),Ge(e,{...i,shouldDropOnRateLimit:n,shouldRetryRequest:!0})}return $a(a)}if(Yr=!1,dn.length&&(dn.map(c=>{const u=c.payload;Ge(u.url,{...u.options,retries:u.retries,shouldDropOnRateLimit:u.shouldDropOnRateLimit}).then(d=>{c.resolveRequest(d)})}),dn=[]),l.ok){if(l.status===249)return ui(),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||iu?{ok:!1,reportError:!1,error:l}:(await In(1e3*Math.pow(2,r)),Ge(e,{...i,retries:c}))}},Ya="ul-view-sdk-script",_f=new Set(["ios","android"]),it="visitors",ot="environments";async function ze(e,t){var i,a,o;const{shouldDropOnRateLimit:r,...n}=t;n.headers=Object.assign(De(window.UserLeap),n.headers);const s=await Ge(e,{...n,shouldDropOnRateLimit:r});if(s.ok){const l=(i=s.headers)==null?void 0:i.get("Authorization"),c=l?l.split(" "):void 0,u=c&&c.length===2?c[1]:void 0,d=(a=s.headers)==null?void 0:a.get("x-ul-visitor-id");if(window.UserLeap.userId&&d===window.UserLeap.visitorId){const h=ke.getItemObject("sprig.anon.env.vid.map");h&&h[window.UserLeap.envId]===d&&(delete h[window.UserLeap.envId],ke.setItemObject("sprig.anon.env.vid.map",h))}u&&d&&(d!==window.UserLeap.visitorId||window.UserLeap.token!==u)&&(Ce("token",u),Ce("vid",d),z.emit(F.VisitorIDUpdated,{visitorId:d}),window.UserLeap.token=u,window.UserLeap.visitorId=d)}return(o=s.json)!=null&&o.logMessage&&console.warn(`[Sprig] ${s.json.logMessage}`),s}function Ce(e,t){const r=ke.getItemObject("userleap.ids");let n=r[window.UserLeap.envId];n?n[e]=t:n={[e]:t},r[window.UserLeap.envId]=n,ke.setItemObject("userleap.ids",r)}function ro(){return window.previewMode?"0":window.UserLeap.visitorId??""}function Ue(e,t,r){const n=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(s=>{n.push(s),s===ot?n.push(window.UserLeap.envId):s===it&&n.push(ro())}),r&&n.push(r),n.join("/")}const tr=async(e,t,r)=>{var ee,q,me,Ne;const{context:n,delay:s,avatars:i,forceBrandedLogo:a,endCard:o,isFeedback:l=!1,heatmap:c,locale:u,layout:d,previewMode:h,productConfig:f,questions:v,responseGroupUid:p,surveyId:I,uuid:m,vid:g,sessionReplay:b,studyType:C,surveyVisitorAttributes:A}=e,E=De(window.UserLeap),T=mr(E),M=qn(E);if(b)if(T)z.emit(F.ReplayCapture,{responseGroupUid:p,hasQuestions:!!(v!=null&&v.length),surveyId:I,uploadId:b.uploadId,replayType:b.replayDurationType??"before",seconds:b.replayDurationSeconds,generateVideoUploadUrlPayload:{mediaRecordingUid:vt(),mediaType:"screen",questionId:1,responseGroupUid:p,surveyId:I,updatedAt:new Date().toISOString(),visitorId:window.UserLeap.visitorId,isReplay:!0}});else{if(!re.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};re.replay.scheduleOrCaptureReplay({responseGroupId:p,surveyId:I,visitorId:g,replayParams:b,completeUploadHeaders:E,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:v.length===0})}if(c){if(!re.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};const{eventId:V,replayParams:ge,responseGroupUid:dt,surveyId:et}=c;await re.replay.initializeReplay({maxReplayDurationSeconds:300,maxInflightRequests:window.UserLeap.maxInflightReplayRequests,teardownAfter:!0,apiUrl:window.UserLeap._API_URL,replaySettings:r}),re.replay.tryReplayAction(()=>{var W;return(W=re.replay)==null?void 0:W.scheduleCapture({apiUrl:window.UserLeap._API_URL,completeUploadHeaders:E,eventId:V,isHeatmap:!0,replayParams:ge,responseGroupId:dt,surveyId:et,triggerTimestamp:Date.now(),visitorId:g})},"Error in scheduling/capturing replay")}if(g==null||!(v!=null&&v.length))return _.info("CannotDisplaySurvey",{vid:g}),{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(Nf(v))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:"no survey"};if(window.UserLeap.container){_.info("AlreadyDisplayingSurvey");const V="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(V),{success:!1,message:V,surveyState:"no survey"}}if(g!==window.UserLeap.visitorId&&m!==window.UserLeap.visitorId&&!window.previewMode){const V="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(V)),{success:!1,message:V,surveyState:"no survey"}}_.info("ShowingSurvey",{surveyId:I}),(ee=re.replay)==null||ee.RecordSurveyShown({id:I,userAgent:window.navigator.userAgent}),Qc.disable(),z.emit(F.SurveyWillPresent,{name:F.SurveyWillPresent,"survey.id":I,layout:d});let k,R,x,S,D=document.createElement("div");const P=V=>{const{"view.version":ge}=V;ge!==E["x-ul-sdk-version"]&&au(),z.removeListener("verify.view.version",P)};z.on("verify.view.version",P),window.UserLeap.useMobileStyling=M,to(E)?(k="ul-direct-embeded-frame",R=document.head,x=window,S=!1,(()=>{const V=De(window.UserLeap),ge=mr(V),dt=window.UserLeap.forceDirectEmbed,et=V["userleap-platform"]==="web";return ge||dt&&et})()&&(ou(I,l),D.id=k,window.UserLeap.container.appendChild(D),lu(),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.SurveyPresented,"survey.id":I}))):{frameId:k,contentWinDocHead:R,contentWindow:x,hasOverlay:S,iframe:D}=zf({productConfig:f,useMobileStyling:M,surveyId:I,isFeedback:l,enableCspTrustedTypes:(q=window.UserLeap._config)==null?void 0:q.enableCspTrustedTypes}),window.UserLeap.frameId=k;const w={apiURL:window.UserLeap._API_URL,avatars:i,cards:v,configureExitOnOverlayClick:V=>{z.once(F.CloseSurveyOnOverlayClick,V)},context:n,endCard:o,envId:window.UserLeap.envId,eventEmitFn:z.emit.bind(z),fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,forceBrandedLogo:a,frame:D,headers:E,layout:d,locale:u,mobileSDKVersion:window.UserLeap.mobileSDKVersion,previewKey:ke.getItem("sprig.previewKey"),previewMode:h,productConfig:{framePosition:f==null?void 0:f.framePosition,desktopDisplay:f==null?void 0:f.desktopDisplay,placement:f==null?void 0:f.placement},responseGroupUid:p,startingQuestionIdx:(me=window.UserLeap.config)==null?void 0:me.startingQuestionIdx,studyType:C,styleNonce:window.UserLeap.styleNonce,surveyId:I,tabTitle:document.title,trackPageViewUrl:t,ulEvents:hr,upchunkLibraryURL:window.UserLeap.upchunkLibraryURL,useMobileStyling:M,userId:m,viewDocument:x==null?void 0:x.document,viewWindow:x,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},surveyVisitorAttributes:A||{},...window.UserLeap._config};(Ne=window.UserLeap._config)!=null&&Ne.startingQuestionIdx&&(window.UserLeap._config={...window.UserLeap._config,startingQuestionIdx:null});const y=(l?window.UserLeap.feedbackCustomStyles:window.UserLeap.customStyles)??f.customStyles;w.customStyles=y,x&&(x.__cfg=w);const U=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:w.path,B=document.getElementById(Ya);B&&B.remove();const j=function(){const V=document.createElement("script");return window.UserLeap.isMobileSDK||V.setAttribute("type","module"),window.UserLeap.nonce&&V.setAttribute("nonce",window.UserLeap.nonce),V.id=Ya,V}(),O=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};if(w.installationMethod==="web-npm"||w.installationMethod==="web-npm-bundled"){const{default:V}=await Promise.resolve().then(()=>require("./view-rFRtvibL.cjs")).then(ge=>ge.view);V.configure(w),S&&window.UserLeap.container&&O()}else U&&(j.src=`${U}${window.UserLeap.isMobileSDK?"":`?t=${Date.now()}`}`,S&&j.addEventListener("load",()=>{window.UserLeap.container&&O()}),x==null||x.addEventListener("error",V=>{V.target instanceof HTMLScriptElement&&V.target.src===U&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0}));R==null||R.appendChild(j);const N={success:!0,surveyState:"ready",surveyId:I,responseGroupUid:p};return window.UserLeap.isMobileSDK&&s&&(N.delay=s),N};function qn(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 mr(e)||t>10&&t<500}function mr(e){return _f.has(e["userleap-platform"])}const Nf=e=>e.some(t=>t.type==="videovoice"),qa=new WeakMap,Ff=(e,t)=>{try{return(n=>{var a,o;const s=qa.get(n);if(s)return s;if(!((a=n.trustedTypes)!=null&&a.createPolicy))throw new Error("Trusted types not supported");const i=(o=n.trustedTypes)==null?void 0:o.createPolicy("sprig-sdk",{createHTML:l=>l,createScript:l=>l,createScriptURL:l=>l});return qa.set(n,i),i})(t).createHTML(e)}catch(r){return console.warn("Could not create TrustedHTML object",r),e}},Jn=(e,t,r=window)=>{var n;return t&&((n=r.trustedTypes)!=null&&n.createPolicy)?Ff(e,r):e},no="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 fs="0px",ou=(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=pu();r&&n&&!window.UserLeap.useMobileStyling?n.appendChild(window.UserLeap.container):document.body.appendChild(window.UserLeap.container)},au=(e,t)=>{var n;Wf();const r=window.UserLeap.container;if(r)try{(n=r.parentNode)==null||n.removeChild(r),window.UserLeap.container=null,Ce("trackStartUrl",null),z.emit(F.SurveyLifeCycle,{state:"dismissed"}),z.emit(F.SurveyClosed,{name:F.SurveyClosed,initiator:e,"survey.id":parseInt(r.dataset.studyId),...t&&{studyType:t}})}catch(s){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+r),s instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",s)}},lu=()=>{z.once(F.SurveyWillClose,({initiator:e,studyType:t})=>{z.removeAllListeners(F.CloseSurveyOnOverlayClick),au(e,t)})},Bf=(e,t,r,n)=>{var u,d;const s={position:"fixed",bottom:"0px",right:fs,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646,transition:"width 0.2s ease-in-out, height 0.2s ease-in-out",maxWidth:"100%"},i=Object.assign({},t,window.UserLeap),{desktopDisplay:a}=t||{},o=a==="center-modal";let l;o&&(i.framePosition="center");let c=!1;if(r)(u=window.UserLeap.windowDimensions)!=null&&u.width?s.width=`${window.UserLeap.windowDimensions.width}px`:s.width="100%",(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 h=()=>{c=!0,l={margin:"auto",position:"static"}};if(n)o?h():l={position:"relative",height:"300px"};else switch(i.framePosition){case"bottomLeft":l={left:fs};break;case"topLeft":l={left:fs,top:0};break;case"topRight":l={top:0};break;case"center":h()}}return c&&((h,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},p=f?h.overlayStyleMobile:h.overlayStyle;v["background-color"]=p==="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},zf=({productConfig:e,useMobileStyling:t,surveyId:r,isFeedback:n,enableCspTrustedTypes:s})=>{var f,v;const i=no,a=n&&e.desktopDisplay==="slider";ou(r,n,a),jf();const o=document.createElement("iframe");o.id=i,o.setAttribute("title","Sprig User Feedback Dialog");const l=Bf(o,e,t,n);lu();let c=!1;o.setHeight=p=>{parseInt(o.style.height)==p&&c||(c=!0,o.style.height=`${p}px`,z.emit(F.SurveyHeight,{name:F.SurveyHeight,contentFrameHeight:p,"survey.id":r}))};let u=!1;o.setWidth=p=>{parseInt(o.style.width)==p&&u||(u=!0,o.style.width=`${p}px`,z.emit(F.SurveyWidth,{name:F.SurveyWidth,contentFrameWidth:p,"survey.id":r}))},(f=window.UserLeap.container)==null||f.appendChild(o),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{z.emit(F.CloseSurveyOnOverlayClick)}),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.SurveyPresented,"survey.id":r});const d=(v=o.contentWindow)==null?void 0:v.document;if(d&&(d.open("text/html","replace"),d.write(Jn("<!doctype html><head></head><body></body></html>",s,o.contentWindow)),d.close(),!t)){const p=d.body;p.style.display="flex",p.style.alignItems="center"}const h=d==null?void 0:d.head;return{frameId:i,contentWinDocHead:h,contentWindow:o.contentWindow,hasOverlay:l,iframe:o}},cu={[F.SurveyFadingOut]:()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}},jf=()=>{Object.entries(cu).forEach(([e,t])=>{z.on(e,t)})},Wf=()=>{Object.entries(cu).forEach(([e,t])=>{z.off(e,t)})},Ja=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function so(e,t){const{matchType:r,pattern:n}=e,s=r?Ja[r]:Ja.legacy;let i=!1;try{i=s(n,t)}catch(a){const o=`[Sprig] (ERR-445) Failed to check url match with pattern ${n}`;a instanceof Error&&(console.warn(o,a),a.stack=JSON.stringify(e),window.UserLeap.reportError(o,a))}return i}const uu=e=>{const{pageUrlEvents:t}=window.UserLeap._config,r=t==null?void 0:t.find(n=>n.id===e);return!!r&&so(r,window.location.href)},qe=e=>!!e&&e.nodeType===Node.ELEMENT_NODE,Ka=e=>e instanceof HTMLElement||e instanceof SVGElement,fr=({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)},Xa=(e,t)=>{const r=t.querySelector(e);if(!qe(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))},du=(e,t,r)=>{const n=e.querySelector(".ul-card__container"),s=e.querySelector(".ul-app");let i=600,a=360;if(qe(n)&&qe(s)){const o=n.querySelector(".ul-card--matrix_grid"),l=!o&&t&&r;try{l&&(s.style.width="360px"),i=n.scrollHeight,i+=(d=>{const h=d.querySelector(".sprig-question-body"),f=d.querySelector(".ul-card"),v=d.querySelector(".ul-card-main-content"),p=d.querySelector(".ul-footer"),I=d.querySelector(".sprig-container");let m=0;return qe(f)&&(m+=f.scrollHeight-f.clientHeight),qe(v)&&(m+=v.scrollHeight-v.clientHeight),qe(h)&&(m+=h.scrollHeight-h.clientHeight),qe(p)&&qe(I)&&I.clientHeight===0&&(m+=p.clientHeight),m})(e);const c=getComputedStyle(n),u=parseFloat(c.marginTop)+parseFloat(c.marginBottom);i+=u+(parseFloat(c.borderTopWidth)+parseFloat(c.borderBottomWidth)),o&&(a=o.scrollWidth,a+=Xa(".ul-card__container",e),a+=Xa(".sprig-question-body",e))}finally{l&&s.style.removeProperty("width")}}return[i+2,a]},pu=()=>Z,Ot=()=>document.getElementById("sprig-feedback-container"),di=()=>document.getElementById("sprig-feedback-loading-animation"),hu=()=>!!document.getElementById(no);let Za=!1,Z=null,je=null,io=!1,rr=null,pt=null;const Vf=["bottom-left","bottom-right","center-left","center-right"],Cn=()=>{var t;const e=window.UserLeap.container;return((t=e==null?void 0:e.parentElement)==null?void 0:t.id)==="sprig-feedback-loading-container"},mu=()=>document.getElementById("sprig-feedback-error-container"),fu=()=>{if(!Z)return 0;const e=Z==null?void 0:Z.clientWidth,t=window.getComputedStyle(Z);return e+parseInt(t.borderRightWidth||"0")+parseInt(t.borderLeftWidth||"0")},kn=e=>{const t=Ot();t&&(pt!=null&&pt.endsWith("right")?t.style.right=`${e}px`:pt!=null&&pt.endsWith("left")&&(t.style.left=`${e}px`))},gs=()=>{if(Z&&(Cn()||mu())){z.off(F.SurveyAppeared,Jt),pi();const e=fu();return kn(-e),!0}return!1},Jt=()=>{if(!Z||!je)return;const e=di();e&&e.remove(),Z.style.height="auto",Z.style.width="auto",je.disabled=!1,io=!1},pi=()=>{if(Z&&!di()){const e=(()=>{var r;if(di())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=Jn(`
55
+ or you can use record.mirror to access the mirror instance during recording.`;let Oa={map:{},getId:()=>(console.error(Ct),-1),getNode:()=>(console.error(Ct),null),removeNodeFromMap(){console.error(Ct)},has:()=>(console.error(Ct),!1),reset(){console.error(Ct)}};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 Yn(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Yn(e,t,i||{},!0)}function Ut(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(Ct),Reflect.get(e,t,r))}));let bn=Date.now;function _c(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=G.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=G.parentElement(i.body))==null?void 0:n.scrollTop)||((s=i==null?void 0:i.body)==null?void 0:s.scrollTop)||0}}function Nc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Bc(e){return e?e.nodeType===e.ELEMENT_NODE?e:G.parentElement(e):null}function Se(e,t,r,n){if(!e)return!1;const s=Bc(e);if(!s)return!1;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return!0}else if(vn(s,t,n))return!0}catch{}return!!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function hs(e,t,r){return!(e.tagName!=="TITLE"||!r.headTitleMutations)||t.getId(e)===-2}function zc(e,t){if(Xt(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=G.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||zc(n,t))}function ai(e){return!!e.changedTouches}function jc(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 li(e){return!!e&&(e instanceof Qi&&"shadowRoot"in e?!!e.shadowRoot:!!G.shadowRoot(e))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bn=()=>new Date().getTime());class ff{constructor(){L(this,"id",1),L(this,"styleIDMap",new WeakMap),L(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=G.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&G.host(G.getRootNode(e))&&(r=G.host(G.getRootNode(e))),r}function gf(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 G.contains(t,r)}function Gc(e){const t=e.ownerDocument;return!!t&&(G.contains(t,e)||gf(e))}var Y=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Y||{}),H=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(H||{}),Ie=(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))(Ie||{}),He=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(He||{}),kt=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(kt||{}),Et=(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))(Et||{});function Aa(e){return"__ln"in e}class yf{constructor(){L(this,"length",0),L(this,"head",null),L(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 Ma=(e,t)=>`${e}@${t}`;class wf{constructor(){L(this,"frozen",!1),L(this,"locked",!1),L(this,"texts",[]),L(this,"attributes",[]),L(this,"attributeMap",new WeakMap),L(this,"removes",[]),L(this,"mapRemoves",[]),L(this,"movedMap",{}),L(this,"addedSet",new Set),L(this,"movedSet",new Set),L(this,"droppedSet",new Set),L(this,"mutationCb"),L(this,"blockClass"),L(this,"blockSelector"),L(this,"maskTextClass"),L(this,"maskTextSelector"),L(this,"inlineStylesheet"),L(this,"maskInputOptions"),L(this,"maskTextFn"),L(this,"maskInputFn"),L(this,"keepIframeSrcFn"),L(this,"recordCanvas"),L(this,"inlineImages"),L(this,"slimDOMOptions"),L(this,"dataURLOptions"),L(this,"doc"),L(this,"mirror"),L(this,"iframeManager"),L(this,"stylesheetManager"),L(this,"shadowDomManager"),L(this,"canvasManager"),L(this,"processedNodeManager"),L(this,"unattachedDoc"),L(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),L(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new yf,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=G.parentNode(l);if(!c||!Gc(l)||c.tagName==="TEXTAREA")return;const u=Xt(c)?this.mirror.getId(Vc(l)):this.mirror.getId(c),d=s(l);if(u===-1||d===-1)return n.addNode(l);const h=xt(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=>{jc(f,this.mirror)&&this.iframeManager.addIframe(f),Wc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),li(l)&&this.shadowDomManager.addShadowRoot(G.shadowRoot(l),this.doc)},onIframeLoad:(f,v)=>{this.iframeManager.attachIframe(f,v),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,v)=>{this.stylesheetManager.attachLinkElement(f,v)}});h&&(t.push({parentId:u,nextId:d,node:h}),r.add(h.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Ua(this.removes,l,this.mirror)&&!this.movedSet.has(G.parentNode(l))||i(l);for(const l of this.addedSet)Ta(this.droppedSet,l)||Ua(this.removes,l,this.mirror)?Ta(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(G.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(G.parentNode(u.value));if(s(u.value)===-1)continue;if(d!==-1){l=u;break}{const h=u.value,f=G.parentNode(h);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const v=G.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=G.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))}),L(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(G.childNodes(t),n=>G.textContent(n)||"").join("")}),L(this,"processMutation",t=>{if(!hs(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=G.textContent(t.target);Se(t.target,this.blockClass,this.blockSelector,!1)||r===t.oldValue||this.texts.push({value:Al(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Bc(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=Pi(r);s=Di({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(Se(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(s)){if(r.contentDocument)return;n="rr_src"}if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ol(r.tagName,n))if(i.attributes[n]=Ll(this.doc,ft(r.tagName),ft(n),s),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const o of Array.from(r.style)){const l=r.style.getPropertyValue(o),c=r.style.getPropertyPriority(o);l!==a.style.getPropertyValue(o)||c!==a.style.getPropertyPriority(o)?i.styleDiff[o]=c===""?l:[l,c]:i._unchangedStyles[o]=[l,c]}for(const o of Array.from(a.style))r.style.getPropertyValue(o)===""&&(i.styleDiff[o]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Se(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA")return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),s=Xt(t.target)?this.mirror.getId(G.host(t.target)):this.mirror.getId(t.target);Se(t.target,this.blockClass,this.blockSelector,!1)||hs(r,this.mirror,this.slimDOMOptions)||!function(i,a){return a.getId(i)!==-1}(r,this.mirror)||(this.addedSet.has(r)?(ci(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||zc(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ma(n,s)]?ci(this.movedSet,r):this.removes.push({parentId:s,id:n,isShadow:!(!Xt(t.target)||!Zt(t.target))||void 0})),this.mapRemoves.push(r))})}}),L(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(hs(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[Ma(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Se(t,this.blockClass,this.blockSelector,!1)||(G.childNodes(t).forEach(n=>this.genAdds(n)),li(t)&&G.childNodes(G.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 ci(e,t){e.delete(t),G.childNodes(t).forEach(r=>ci(e,r))}function Ua(e,t,r){return e.length!==0&&function(n,s,i){let a=G.parentNode(s);for(;a;){const o=i.getId(a);if(n.some(l=>l.id===o))return!0;a=G.parentNode(a)}return!1}(e,t,r)}function Ta(e,t){return e.size!==0&&Hc(e,t)}function Hc(e,t){const r=G.parentNode(t);return!!r&&(!!e.has(r)||Hc(e,r))}let Qt;const $=e=>Qt?(...t)=>{try{return e(...t)}catch(r){if(Qt&&Qt(r)===!0)return;throw r}}:e,mt=[];function er(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 $c(e,t){const r=new wf;mt.push(r),r.init(e);const n=new(Pc())($(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function vf({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(Ie).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&a[c]!==!1).forEach(c=>{let u=ft(c);const d=(h=>f=>{const v=er(f);if(Se(v,n,s,!0))return;let p=null,I=h;if("pointerType"in f){switch(f.pointerType){case"mouse":p=He.Mouse;break;case"touch":p=He.Touch;break;case"pen":p=He.Pen}p===He.Touch?Ie[h]===Ie.MouseDown?I="TouchStart":Ie[h]===Ie.MouseUp&&(I="TouchEnd"):He.Pen}else ai(f)&&(p=He.Touch);p!==null?(l=p,(I.startsWith("Touch")&&p===He.Touch||I.startsWith("Mouse")&&p===He.Mouse)&&(p=null)):Ie[h]===Ie.Click&&(p=l,l=null);const m=ai(f)?f.changedTouches[0]:f;if(!m)return;const g=r.getId(v),{clientX:b,clientY:C}=m;$(e)({type:Ie[I],id:g,x:b,y:C,...p!==null&&{pointerType:p}})})(c);if(window.PointerEvent)switch(Ie[c]){case Ie.MouseDown:case Ie.MouseUp:u=u.replace("mouse","pointer");break;case Ie.TouchStart:case Ie.TouchEnd:return}o.push(ve(u,d,t))}),$(()=>{o.forEach(c=>c())})}function Yc({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){return ve("scroll",$($t($(a=>{const o=er(a);if(!o||Se(o,n,s,!0))return;const l=r.getId(o);if(o===t&&t.defaultView){const c=_c(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 bf=["INPUT","TEXTAREA","SELECT"],Da=new WeakMap;function Wr(e){return function(t,r){if(Vr("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Vr("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Vr("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Vr("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const n=Array.from(t.parentRule.cssRules).indexOf(t);r.unshift(n)}else if(t.parentStyleSheet){const n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function rt(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function qc({mirror:e,stylesheetManager:t},r){var n,s,i;let a=null;a=r.nodeName==="#document"?e.getId(r):e.getId(G.host(r));const o=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:i.ShadowRoot,l=o!=null&&o.prototype?Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets"):void 0;return a!==null&&a!==-1&&o&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;const d=(u=l.set)==null?void 0:u.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch{}return d}}),$(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Sf(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;(function(m,g){const{mutationCb:b,mousemoveCb:C,mouseInteractionCb:A,scrollCb:E,viewportResizeCb:T,inputCb:M,mediaInteractionCb:k,styleSheetRuleCb:R,styleDeclarationCb:x,canvasMutationCb:S,fontCb:D,selectionCb:P,customElementCb:w}=m;m.mutationCb=(...y)=>{g.mutation&&g.mutation(...y),b(...y)},m.mousemoveCb=(...y)=>{g.mousemove&&g.mousemove(...y),C(...y)},m.mouseInteractionCb=(...y)=>{g.mouseInteraction&&g.mouseInteraction(...y),A(...y)},m.scrollCb=(...y)=>{g.scroll&&g.scroll(...y),E(...y)},m.viewportResizeCb=(...y)=>{g.viewportResize&&g.viewportResize(...y),T(...y)},m.inputCb=(...y)=>{g.input&&g.input(...y),M(...y)},m.mediaInteractionCb=(...y)=>{g.mediaInteaction&&g.mediaInteaction(...y),k(...y)},m.styleSheetRuleCb=(...y)=>{g.styleSheetRule&&g.styleSheetRule(...y),R(...y)},m.styleDeclarationCb=(...y)=>{g.styleDeclaration&&g.styleDeclaration(...y),x(...y)},m.canvasMutationCb=(...y)=>{g.canvasMutation&&g.canvasMutation(...y),S(...y)},m.fontCb=(...y)=>{g.font&&g.font(...y),D(...y)},m.selectionCb=(...y)=>{g.selection&&g.selection(...y),P(...y)},m.customElementCb=(...y)=>{g.customElement&&g.customElement(...y),w(...y)}})(e,t),e.recordDOM&&(n=$c(e,e.doc));const s=function({mousemoveCb:m,sampling:g,doc:b,mirror:C}){if(g.mousemove===!1)return()=>{};const A=typeof g.mousemove=="number"?g.mousemove:50,E=typeof g.mousemoveCallback=="number"?g.mousemoveCallback:500;let T,M=[];const k=$t($(S=>{const D=Date.now()-T;m(M.map(P=>(P.timeOffset-=D,P)),S),M=[],T=null}),E),R=$($t($(S=>{const D=er(S),{clientX:P,clientY:w}=ai(S)?S.changedTouches[0]:S;T||(T=bn()),M.push({x:P,y:w,id:C.getId(D),timeOffset:bn()-T}),k(typeof DragEvent<"u"&&S instanceof DragEvent?H.Drag:S instanceof MouseEvent?H.MouseMove:H.TouchMove)}),A,{trailing:!1})),x=[ve("mousemove",R,b),ve("touchmove",R,b),ve("drag",R,b)];return $(()=>{x.forEach(S=>S())})}(e),i=vf(e),a=Yc(e),o=function({viewportResizeCb:m},{win:g}){let b=-1,C=-1;return ve("resize",$($t($(()=>{const A=Nc(),E=Fc();b===A&&C===E||(m({width:Number(E),height:Number(A)}),b=A,C=E)}),200)),g)}(e,{win:r}),l=function({inputCb:m,doc:g,mirror:b,blockClass:C,blockSelector:A,ignoreClass:E,ignoreSelector:T,maskInputOptions:M,maskInputFn:k,sampling:R,userTriggeredOnInput:x}){function S(B){let j=er(B);const O=B.isTrusted,N=j&&j.tagName;if(j&&N==="OPTION"&&(j=G.parentElement(j)),!j||!N||bf.indexOf(N)<0||Se(j,C,A,!0)||j.classList.contains(E)||T&&j.matches(T))return;let te=j.value,q=!1;const me=Pi(j)||"";me==="radio"||me==="checkbox"?q=j.checked:(M[N.toLowerCase()]||M[me])&&(te=Di({element:j,maskInputOptions:M,tagName:N,type:me,value:te,maskInputFn:k})),D(j,x?{text:te,isChecked:q,userTriggered:O}:{text:te,isChecked:q});const _e=j.name;me==="radio"&&_e&&q&&g.querySelectorAll(`input[type="radio"][name="${_e}"]`).forEach(V=>{if(V!==j){const ge=V.value;D(V,x?{text:ge,isChecked:!q,userTriggered:!1}:{text:ge,isChecked:!q})}})}function D(B,j){const O=Da.get(B);if(!O||O.text!==j.text||O.isChecked!==j.isChecked){Da.set(B,j);const N=b.getId(B);$(m)({...j,id:N})}}const P=(R.input==="last"?["change"]:["input","change"]).map(B=>ve(B,$(S),g)),w=g.defaultView;if(!w)return()=>{P.forEach(B=>B())};const y=w.Object.getOwnPropertyDescriptor(w.HTMLInputElement.prototype,"value"),U=[[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&&P.push(...U.map(B=>Yn(B[0],B[1],{set(){$(S)({target:this,isTrusted:!1})}},!1,w))),$(()=>{P.forEach(B=>B())})}(e),c=function({mediaInteractionCb:m,blockClass:g,blockSelector:b,mirror:C,sampling:A,doc:E}){const T=$(k=>$t($(R=>{const x=er(R);if(!x||Se(x,g,b,!0))return;const{currentTime:S,volume:D,muted:P,playbackRate:w,loop:y}=x;m({type:k,id:C.getId(x),currentTime:S,volume:D,muted:P,playbackRate:w,loop:y})}),A.media||500)),M=[ve("play",T(Et.Play),E),ve("pause",T(Et.Pause),E),ve("seeked",T(Et.Seeked),E),ve("volumechange",T(Et.VolumeChange),E),ve("ratechange",T(Et.RateChange),E)];return $(()=>{M.forEach(k=>k())})}(e);let u=()=>{},d=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:m,mirror:g,stylesheetManager:b},{win:C}){if(!C.CSSStyleSheet||!C.CSSStyleSheet.prototype)return()=>{};const A=C.CSSStyleSheet.prototype.insertRule;C.CSSStyleSheet.prototype.insertRule=new Proxy(A,{apply:$((x,S,D)=>{const[P,w]=D,{id:y,styleId:U}=rt(S,g,b.styleMirror);return(y&&y!==-1||U&&U!==-1)&&m({id:y,styleId:U,adds:[{rule:P,index:w}]}),x.apply(S,D)})}),C.CSSStyleSheet.prototype.addRule=function(x,S,D=this.cssRules.length){const P=`${x} { ${S} }`;return C.CSSStyleSheet.prototype.insertRule.apply(this,[P,D])};const E=C.CSSStyleSheet.prototype.deleteRule;let T,M;C.CSSStyleSheet.prototype.deleteRule=new Proxy(E,{apply:$((x,S,D)=>{const[P]=D,{id:w,styleId:y}=rt(S,g,b.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,removes:[{index:P}]}),x.apply(S,D)})}),C.CSSStyleSheet.prototype.removeRule=function(x){return C.CSSStyleSheet.prototype.deleteRule.apply(this,[x])},C.CSSStyleSheet.prototype.replace&&(T=C.CSSStyleSheet.prototype.replace,C.CSSStyleSheet.prototype.replace=new Proxy(T,{apply:$((x,S,D)=>{const[P]=D,{id:w,styleId:y}=rt(S,g,b.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,replace:P}),x.apply(S,D)})})),C.CSSStyleSheet.prototype.replaceSync&&(M=C.CSSStyleSheet.prototype.replaceSync,C.CSSStyleSheet.prototype.replaceSync=new Proxy(M,{apply:$((x,S,D)=>{const[P]=D,{id:w,styleId:y}=rt(S,g,b.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,replaceSync:P}),x.apply(S,D)})}));const k={};Gr("CSSGroupingRule")?k.CSSGroupingRule=C.CSSGroupingRule:(Gr("CSSMediaRule")&&(k.CSSMediaRule=C.CSSMediaRule),Gr("CSSConditionRule")&&(k.CSSConditionRule=C.CSSConditionRule),Gr("CSSSupportsRule")&&(k.CSSSupportsRule=C.CSSSupportsRule));const R={};return Object.entries(k).forEach(([x,S])=>{R[x]={insertRule:S.prototype.insertRule,deleteRule:S.prototype.deleteRule},S.prototype.insertRule=new Proxy(R[x].insertRule,{apply:$((D,P,w)=>{const[y,U]=w,{id:B,styleId:j}=rt(P.parentStyleSheet,g,b.styleMirror);return(B&&B!==-1||j&&j!==-1)&&m({id:B,styleId:j,adds:[{rule:y,index:[...Wr(P),U||0]}]}),D.apply(P,w)})}),S.prototype.deleteRule=new Proxy(R[x].deleteRule,{apply:$((D,P,w)=>{const[y]=w,{id:U,styleId:B}=rt(P.parentStyleSheet,g,b.styleMirror);return(U&&U!==-1||B&&B!==-1)&&m({id:U,styleId:B,removes:[{index:[...Wr(P),y]}]}),D.apply(P,w)})})}),$(()=>{C.CSSStyleSheet.prototype.insertRule=A,C.CSSStyleSheet.prototype.deleteRule=E,T&&(C.CSSStyleSheet.prototype.replace=T),M&&(C.CSSStyleSheet.prototype.replaceSync=M),Object.entries(k).forEach(([x,S])=>{S.prototype.insertRule=R[x].insertRule,S.prototype.deleteRule=R[x].deleteRule})})}(e,{win:r}),d=qc(e,e.doc),h=function({styleDeclarationCb:m,mirror:g,ignoreCSSAttributes:b,stylesheetManager:C},{win:A}){const E=A.CSSStyleDeclaration.prototype.setProperty;A.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:$((M,k,R)=>{var x;const[S,D,P]=R;if(b.has(S))return E.apply(k,[S,D,P]);const{id:w,styleId:y}=rt((x=k.parentRule)==null?void 0:x.parentStyleSheet,g,C.styleMirror);return(w&&w!==-1||y&&y!==-1)&&m({id:w,styleId:y,set:{property:S,value:D,priority:P},index:Wr(k.parentRule)}),M.apply(k,R)})});const T=A.CSSStyleDeclaration.prototype.removeProperty;return A.CSSStyleDeclaration.prototype.removeProperty=new Proxy(T,{apply:$((M,k,R)=>{var x;const[S]=R;if(b.has(S))return T.apply(k,[S]);const{id:D,styleId:P}=rt((x=k.parentRule)==null?void 0:x.parentStyleSheet,g,C.styleMirror);return(D&&D!==-1||P&&P!==-1)&&m({id:D,styleId:P,remove:{property:S},index:Wr(k.parentRule)}),M.apply(k,R)})}),$(()=>{A.CSSStyleDeclaration.prototype.setProperty=E,A.CSSStyleDeclaration.prototype.removeProperty=T})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:m,doc:g}){const b=g.defaultView;if(!b)return()=>{};const C=[],A=new WeakMap,E=b.FontFace;b.FontFace=function(M,k,R){const x=new E(M,k,R);return A.set(x,{family:M,buffer:typeof k!="string",descriptors:R,fontSource:typeof k=="string"?k:JSON.stringify(Array.from(new Uint8Array(k)))}),x};const T=Ut(g.fonts,"add",function(M){return function(k){return setTimeout($(()=>{const R=A.get(k);R&&(m(R),A.delete(k))}),0),M.apply(this,[k])}});return C.push(()=>{b.FontFace=E}),C.push(T),$(()=>{C.forEach(M=>M())})}(e)));const v=function(m){const{doc:g,mirror:b,blockClass:C,blockSelector:A,selectionCb:E}=m;let T=!0;const M=$(()=>{const k=g.getSelection();if(!k||T&&(k!=null&&k.isCollapsed))return;T=k.isCollapsed||!1;const R=[],x=k.rangeCount||0;for(let S=0;S<x;S++){const D=k.getRangeAt(S),{startContainer:P,startOffset:w,endContainer:y,endOffset:U}=D;Se(P,C,A,!0)||Se(y,C,A,!0)||R.push({start:b.getId(P),startOffset:w,end:b.getId(y),endOffset:U})}E({ranges:R})});return M(),ve("selectionchange",M)}(e),p=function({doc:m,customElementCb:g}){const b=m.defaultView;return b&&b.customElements?Ut(b.customElements,"define",function(C){return function(A,E,T){try{g({define:{name:A}})}catch{console.warn(`Custom element callback failed for ${A}`)}return C.apply(this,[A,E,T])}}):()=>{}}(e),I=[];for(const m of e.plugins)I.push(m.observer(m.callback,r,m.options));return $(()=>{mt.forEach(m=>m.reset()),n==null||n.disconnect(),s(),i(),a(),o(),l(),c(),u(),d(),h(),f(),v(),p(),I.forEach(m=>m())})}function Vr(e){return window[e]!==void 0}function Gr(e){return!!(window[e]!==void 0&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pa{constructor(t){L(this,"iframeIdToRemoteIdMap",new WeakMap),L(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 If{constructor(t){L(this,"iframes",new WeakMap),L(this,"crossOriginIframeMap",new WeakMap),L(this,"crossOriginIframeMirror",new Pa(Rl)),L(this,"crossOriginIframeStyleMirror"),L(this,"crossOriginIframeRootIdMap",new WeakMap),L(this,"mirror"),L(this,"mutationCb"),L(this,"wrappedEmit"),L(this,"loadListener"),L(this,"stylesheetManager"),L(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 Y.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:Y.IncrementalSnapshot,data:{source:H.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return r;case Y.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case Y.IncrementalSnapshot:switch(r.data.source){case H.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case H.Drag:case H.TouchMove:case H.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case H.ViewportResize:return!1;case H.MediaInteraction:case H.MouseInteraction:case H.Scroll:case H.CanvasMutation:case H.Input:return this.replaceIds(r.data,t,["id"]),r;case H.StyleSheetRule:case H.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case H.Font:return r;case H.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),r;case H.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),r}}return!1}replace(t,r,n,s){for(const i of s)(Array.isArray(r[i])||typeof r[i]=="number")&&(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type===fe.Document||t.rootId||(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class Cf{constructor(t){L(this,"shadowDoms",new WeakSet),L(this,"mutationCb"),L(this,"scrollCb"),L(this,"bypassOptions"),L(this,"mirror"),L(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!Zt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=$c({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Yc({...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(G.host(t))),this.restoreHandlers.push(qc({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(Ut(t.prototype,"attachShadow",function(s){return function(i){const a=s.call(this,i),o=G.shadowRoot(this);return o&&Gc(this)&&n.addShadowRoot(o,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kf=typeof Uint8Array>"u"?[]:new Uint8Array(256),Hr=0;Hr<64;Hr++)kf[Yt.charCodeAt(Hr)]=Hr;const _a=new Map,Jc=(e,t,r)=>{if(!e||!Xc(e,t)&&typeof e!="object")return;const n=function(i,a){let o=_a.get(i);return o||(o=new Map,_a.set(i,o)),o.has(a)||o.set(a,[]),o.get(a)}(r,e.constructor.name);let s=n.indexOf(e);return s===-1&&(s=n.length,n.push(e)),s};function cn(e,t,r){if(e instanceof Array)return e.map(n=>cn(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(n){var s,i=new Uint8Array(n),a=i.length,o="";for(s=0;s<a;s+=3)o+=Yt[i[s]>>2],o+=Yt[(3&i[s])<<4|i[s+1]>>4],o+=Yt[(15&i[s+1])<<2|i[s+2]>>6],o+=Yt[63&i[s+2]];return a%3==2?o=o.substring(0,o.length-1)+"=":a%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[cn(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:s}=e;return{rr_type:n,src:s}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[cn(e.data,t,r),e.width,e.height]}:Xc(e,t)||typeof e=="object"?{rr_type:e.constructor.name,index:Jc(e,t,r)}:e}const Kc=(e,t,r)=>e.map(n=>cn(n,t,r)),Xc=(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 Na(e,t,r,n){const s=[];try{const i=Ut(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(o,...l){if(!Se(this,t,r,!0)){const c=function(u){return u==="experimental-webgl"?"webgl":u}(o);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){const u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[o,...l])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function 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=Ut(e,l,function(u){return function(...d){const h=u.apply(this,d);if(Jc(h,i,this),"tagName"in this.canvas&&!Se(this.canvas,n,s,!0)){const f=Kc(d,i,this),v={type:t,property:l,args:f};r(this.canvas,v)}return h}});a.push(c)}catch{const c=Yn(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});a.push(c)}return a}const Zc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ba=typeof window<"u"&&window.Blob&&new Blob([(za=Zc,Uint8Array.from(atob(za),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var za;function Ef(e){let t;try{if(t=Ba&&(window.URL||window.webkitURL).createObjectURL(Ba),!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,"+Zc,{name:e==null?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class xf{constructor(t){L(this,"pendingCanvasMutations",new Map),L(this,"rafStamps",{latestId:0,invokeId:null}),L(this,"mirror"),L(this,"mutationCb"),L(this,"resetObservers"),L(this,"frozen",!1),L(this,"locked",!1),L(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=Na(r,n,s,!0),o=new Map,l=new Ef;l.onmessage=f=>{const{id:v}=f.data;if(o.set(v,!1),!("base64"in f.data))return;const{base64:p,type:I,width:m,height:g}=f.data;this.mutationCb({id:v,type:kt["2D"],commands:[{property:"clearRect",args:[0,0,m,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:p}],type:I}]},0,0]}]})};const c=1e3/t;let u,d=0;const h=f=>{d&&f-d<c||(d=f,(()=>{const v=[];return r.document.querySelectorAll("canvas").forEach(p=>{Se(p,n,s,!0)||v.push(p)}),v})().forEach(async v=>{var p;const I=this.mirror.getId(v);if(o.get(I)||v.width===0||v.height===0)return;if(o.set(I,!0),["webgl","webgl2"].includes(v.__context)){const g=v.getContext(v.__context);((p=g==null?void 0:g.getContextAttributes())==null?void 0:p.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const m=await createImageBitmap(v);l.postMessage({id:I,bitmap:m,width:v.width,height:v.height,dataURLOptions:i.dataURLOptions},[m])})),u=requestAnimationFrame(h)};u=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Na(t,r,n,!1),i=function(o,l,c,u){const d=[],h=Object.getOwnPropertyNames(l.CanvasRenderingContext2D.prototype);for(const f of h)try{if(typeof l.CanvasRenderingContext2D.prototype[f]!="function")continue;const v=Ut(l.CanvasRenderingContext2D.prototype,f,function(p){return function(...I){return Se(this.canvas,c,u,!0)||setTimeout(()=>{const m=Kc(I,l,this);o(this.canvas,{type:kt["2D"],property:f,args:m})},0),p.apply(this,I)}});d.push(v)}catch{const v=Yn(l.CanvasRenderingContext2D.prototype,f,{set(p){o(this.canvas,{type:kt["2D"],property:f,args:[p],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,kt.WebGL,o,c,u,l)),l.WebGL2RenderingContext!==void 0&&d.push(...Fa(l.WebGL2RenderingContext.prototype,kt.WebGL2,o,c,u,l)),()=>{d.forEach(h=>h())}}(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 Rf{constructor(t){L(this,"trackedLinkElements",new WeakSet),L(this,"mutationCb"),L(this,"adoptedStyleSheetCb"),L(this,"styleMirror",new ff),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},s=[];for(const i of t){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),s.push({styleId:a,rules:Array.from(i.rules||CSSRule,(o,l)=>({rule:El(o,i.href),index:l}))})),n.styleIds.push(a)}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Lf{constructor(){L(this,"nodeMap",new WeakMap),L(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 ue,un,ms,Sn=!1;try{if(Array.from([1],e=>2*e)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Eo=e.contentWindow)==null?void 0:Eo.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Oe=new xl;function qt(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:h,slimDOMOptions:f,maskInputFn:v,maskTextFn:p,hooks:I,packFn:m,sampling:g={},dataURLOptions:b={},mousemoveWait:C,recordDOM:A=!0,recordCanvas:E=!1,recordCrossOriginIframes:T=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:R=!1,inlineImages:x=!1,plugins:S,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:w}=e;Qt=w;const y=!T||window.parent===window;let U=!1;if(!y)try{window.parent.document&&(U=!1)}catch{U=!0}if(y&&!t)throw new Error("emit function is required");if(!y&&!U)return()=>{};C!==void 0&&g.mousemove===void 0&&(g.mousemove=C),Oe.reset();const B=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},j=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all",headTitleMutations:f==="all"}:f||{};let O;(function(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 N=0;const te=W=>{for(const Le of S||[])Le.eventProcessor&&(W=Le.eventProcessor(W));return m&&!U&&(W=m(W)),W};ue=(W,Le)=>{var se;const ae=W;if(ae.timestamp=bn(),!((se=mt[0])!=null&&se.isFrozen())||ae.type===Y.FullSnapshot||ae.type===Y.IncrementalSnapshot&&ae.data.source===H.Mutation||mt.forEach(xe=>xe.unfreeze()),y)t==null||t(te(ae),Le);else if(U){const xe={type:"rrweb",event:te(ae),origin:window.location.origin,isCheckout:Le};window.parent.postMessage(xe,"*")}if(ae.type===Y.FullSnapshot)O=ae,N=0;else if(ae.type===Y.IncrementalSnapshot){if(ae.data.source===H.Mutation&&ae.data.isAttachIframe)return;N++;const xe=n&&N>=n,J=r&&ae.timestamp-O.timestamp>r;(xe||J)&&un(!0)}};const q=W=>{ue({type:Y.IncrementalSnapshot,data:{source:H.Mutation,...W}})},me=W=>ue({type:Y.IncrementalSnapshot,data:{source:H.Scroll,...W}}),_e=W=>ue({type:Y.IncrementalSnapshot,data:{source:H.CanvasMutation,...W}}),V=new Rf({mutationCb:q,adoptedStyleSheetCb:W=>ue({type:Y.IncrementalSnapshot,data:{source:H.AdoptedStyleSheet,...W}})}),ge=new If({mirror:Oe,mutationCb:q,stylesheetManager:V,recordCrossOriginIframes:T,wrappedEmit:ue});for(const W of S||[])W.getMirror&&W.getMirror({nodeMirror:Oe,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror});const dt=new Lf;ms=new xf({recordCanvas:E,mutationCb:_e,win:window,blockClass:s,blockSelector:i,mirror:Oe,sampling:g.canvas,dataURLOptions:b});const Qe=new Cf({mutationCb:q,scrollCb:me,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:B,dataURLOptions:b,maskTextFn:p,maskInputFn:v,recordCanvas:E,inlineImages:x,sampling:g,slimDOMOptions:j,iframeManager:ge,stylesheetManager:V,canvasManager:ms,keepIframeSrcFn:D,processedNodeManager:dt},mirror:Oe});un=(W=!1)=>{if(!A)return;ue({type:Y.Meta,data:{href:window.location.href,width:Fc(),height:Nc()}},W),V.reset(),Qe.init(),mt.forEach(se=>se.lock());const Le=function(se,ae){const{mirror:xe=new xl,blockClass:J="rr-block",blockSelector:_t=null,maskTextClass:id="rr-mask",maskTextSelector:od=null,inlineStylesheet:ad=!0,inlineImages:ld=!1,recordCanvas:cd=!1,maskAllInputs:Kn=!1,maskTextFn:ud,maskInputFn:dd,slimDOM:Nt=!1,dataURLOptions:pd,preserveWhiteSpace:hd,onSerialize:md,onIframeLoad:fd,iframeLoadTimeout:gd,onStylesheetLoad:yd,stylesheetLoadTimeout:wd,keepIframeSrcFn:vd=()=>!1}=ae||{};return xt(se,{doc:se,mirror:xe,blockClass:J,blockSelector:_t,maskTextClass:id,maskTextSelector:od,skipChild:!1,inlineStylesheet:ad,maskInputOptions:Kn===!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}:Kn===!1?{password:!0}:Kn,maskTextFn:ud,maskInputFn:dd,slimDOMOptions:Nt===!0||Nt==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:Nt==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:Nt===!1?{}:Nt,dataURLOptions:pd,inlineImages:ld,recordCanvas:cd,preserveWhiteSpace:hd,onSerialize:md,onIframeLoad:fd,iframeLoadTimeout:gd,onStylesheetLoad:yd,stylesheetLoadTimeout:wd,keepIframeSrcFn:vd,newlyAddedElement:!1})}(document,{mirror:Oe,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:B,maskTextFn:p,maskInputFn:v,slimDOM:j,dataURLOptions:b,recordCanvas:E,inlineImages:x,onSerialize:se=>{jc(se,Oe)&&ge.addIframe(se),Wc(se,Oe)&&V.trackLinkElement(se),li(se)&&Qe.addShadowRoot(G.shadowRoot(se),document)},onIframeLoad:(se,ae)=>{ge.attachIframe(se,ae),Qe.observeAttachShadow(se)},onStylesheetLoad:(se,ae)=>{V.attachLinkElement(se,ae)},keepIframeSrcFn:D});if(!Le)return console.warn("Failed to snapshot the document");ue({type:Y.FullSnapshot,data:{node:Le,initialOffset:_c(window)}},W),mt.forEach(se=>se.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Oe.getId(document))};try{const W=[],Le=ae=>{var xe;return $(Sf)({mutationCb:q,mousemoveCb:(J,_t)=>ue({type:Y.IncrementalSnapshot,data:{source:_t,positions:J}}),mouseInteractionCb:J=>ue({type:Y.IncrementalSnapshot,data:{source:H.MouseInteraction,...J}}),scrollCb:me,viewportResizeCb:J=>ue({type:Y.IncrementalSnapshot,data:{source:H.ViewportResize,...J}}),inputCb:J=>ue({type:Y.IncrementalSnapshot,data:{source:H.Input,...J}}),mediaInteractionCb:J=>ue({type:Y.IncrementalSnapshot,data:{source:H.MediaInteraction,...J}}),styleSheetRuleCb:J=>ue({type:Y.IncrementalSnapshot,data:{source:H.StyleSheetRule,...J}}),styleDeclarationCb:J=>ue({type:Y.IncrementalSnapshot,data:{source:H.StyleDeclaration,...J}}),canvasMutationCb:_e,fontCb:J=>ue({type:Y.IncrementalSnapshot,data:{source:H.Font,...J}}),selectionCb:J=>{ue({type:Y.IncrementalSnapshot,data:{source:H.Selection,...J}})},customElementCb:J=>{ue({type:Y.IncrementalSnapshot,data:{source:H.CustomElement,...J}})},blockClass:s,ignoreClass:a,ignoreSelector:o,maskTextClass:l,maskTextSelector:c,maskInputOptions:B,inlineStylesheet:u,sampling:g,recordDOM:A,recordCanvas:E,inlineImages:x,userTriggeredOnInput:k,collectFonts:R,doc:ae,maskInputFn:v,maskTextFn:p,keepIframeSrcFn:D,blockSelector:i,slimDOMOptions:j,dataURLOptions:b,mirror:Oe,iframeManager:ge,stylesheetManager:V,shadowDomManager:Qe,processedNodeManager:dt,canvasManager:ms,ignoreCSSAttributes:P,plugins:((xe=S==null?void 0:S.filter(J=>J.observer))==null?void 0:xe.map(J=>({observer:J.observer,options:J.options,callback:_t=>ue({type:Y.Plugin,data:{plugin:J.name,payload:_t}})})))||[]},I)};ge.addLoadListener(ae=>{try{W.push(Le(ae.contentDocument))}catch(xe){console.warn(xe)}});const se=()=>{un(),W.push(Le(document)),Sn=!0};return document.readyState==="interactive"||document.readyState==="complete"?se():(W.push(ve("DOMContentLoaded",()=>{ue({type:Y.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&se()})),W.push(ve("load",()=>{ue({type:Y.Load,data:{}}),M==="load"&&se()},window))),()=>{W.forEach(ae=>ae()),dt.destroy(),Sn=!1,Qt=void 0}}catch(W){console.warn(W)}}var ja,It;qt.addCustomEvent=(e,t)=>{if(!Sn)throw new Error("please add custom event after start recording");ue({type:Y.Custom,data:{tag:e,payload:t}})},qt.freezePage=()=>{mt.forEach(e=>e.freeze())},qt.takeFullSnapshot=e=>{if(!Sn)throw new Error("please take full snapshot after start recording");un(e)},qt.mirror=Oe,(It=ja||(ja={}))[It.NotStarted=0]="NotStarted",It[It.Running=1]="Running",It[It.Stopped=2]="Stopped";var Ae=(e=>(e.Closed="close.click",e.Complete="survey.completed",e.FeedbackClosed="feedback.closed",e.PageChange="page.change",e.API="api",e.Override="override",e))(Ae||{}),F=(e=>(e.ReplayCapture="replay.capture",e.ReplayPaused="replay.paused",e.ReplayResumed="replay.resumed",e.FeedbackButtonLoaded="feedback.button.loaded",e.SDKReady="sdk.ready",e.SurveyAppeared="survey.appeared",e.SurveyCloseRequested="survey.closeRequested",e.SurveyClosed="survey.closed",e.SurveyDimensions="survey.dimensions",e.SurveyFadingOut="survey.fadingOut",e.SurveyHeight="survey.height",e.SurveyPresented="survey.presented",e.SurveyLifeCycle="survey.lifeCycle",e.SurveyWidth="survey.width",e.SurveyWillClose="survey.willClose",e.SurveyWillPresent="survey.will.present",e.CloseSurveyOnOverlayClick="close.survey.overlayClick",e.VisitorIDUpdated="visitor.id.updated",e.QuestionAnswered="question.answered",e))(F||{});const hr={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 Of=new Uint8Array(16);function Af(){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(Of)}const ye=[];for(let e=0;e<256;++e)ye.push((e+256).toString(16).slice(1));const Wa={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vt(e,t,r){if(Wa.randomUUID&&!e)return Wa.randomUUID();const n=(e=e||{}).random||(e.rng||Af)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(s,i=0){return ye[s[i+0]]+ye[s[i+1]]+ye[s[i+2]]+ye[s[i+3]]+"-"+ye[s[i+4]]+ye[s[i+5]]+"-"+ye[s[i+6]]+ye[s[i+7]]+"-"+ye[s[i+8]]+ye[s[i+9]]+"-"+ye[s[i+10]]+ye[s[i+11]]+ye[s[i+12]]+ye[s[i+13]]+ye[s[i+14]]+ye[s[i+15]]}(n)}const _=new class{constructor(){de(this,"breadcrumbs",[])}getTimeStamp(){return new Date().toISOString()}addBreadcrumb(e){this.breadcrumbs.push(e),this.breadcrumbs.length>300&&this.breadcrumbs.shift()}debug(e,t="debug"){this.addBreadcrumb({category:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"debug"})}error(e,t={}){this.addBreadcrumb({category:"error",data:t,level:"error",message:e,timestamp:this.getTimeStamp(),type:"error"})}http(e,t){this.addBreadcrumb({category:"xhr",data:t,message:e,timestamp:this.getTimeStamp(),type:"http"})}info(e,t={}){this.addBreadcrumb({category:"info",data:t,level:"info",message:e,timestamp:this.getTimeStamp(),type:"info"})}navigation(e,t){this.addBreadcrumb({category:"navigation",data:t,message:e,timestamp:this.getTimeStamp(),type:"navigation"})}},Va=()=>{try{return window.parent.Intercom}catch{return null}},Ga=[Object.freeze(Object.defineProperty({__proto__:null,disable:()=>{const e=Va();e&&(e.ul_wasVisible=!!document.querySelector("iframe.intercom-launcher-frame"),e.ul_wasVisible&&e("update",{hide_default_launcher:!0}))},enable:()=>{const e=Va();e&&(e.ul_wasVisible&&e("update",{hide_default_launcher:!1}),delete e.ul_wasVisible)}},Symbol.toStringTag,{value:"Module"}))];class Qc{static disable(){Ga.forEach(t=>t.disable())}static enable(){Ga.forEach(t=>t.enable())}}var Mf=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"}},eu=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=eu.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 Mf(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)}},tu=eu;tu.defaultMaxListeners=10;const z=new tu,In=async e=>{await new Promise(t=>{setTimeout(t,e)})},to=({"userleap-platform":e})=>{var t;return((t=window.UserLeap)==null?void 0:t.forceDirectEmbed)||e!=="web"};class ru{constructor(t){de(this,"storage");de(this,"tempStorage",{});de(this,"isStorageAvailable");try{this.storage=window[t];const r="__storage_test__";this.storage.setItem(r,r),this.storage.removeItem(r),this.isStorageAvailable=!0}catch{this.isStorageAvailable=!1}}setItem(t,r){this.isStorageAvailable&&this.storage?this.storage.setItem(t,r):this.tempStorage[t]=r}setItemObject(t,r){try{this.setItem(t,JSON.stringify(r))}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to save to local storage",n))}}getItem(t){return this.isStorageAvailable&&this.storage?this.storage.getItem(t):this.tempStorage[t]}getItemObject(t){const r=this.getItem(t);if(r)try{return JSON.parse(r)}catch(n){n instanceof Error&&(n.stack=t+": "+r,window.UserLeap.reportError("Failed to parse local storage",n))}return{}}removeItem(t){this.isStorageAvailable&&this.storage?this.storage.removeItem(t):delete this.tempStorage[t]}clear(){this.isStorageAvailable&&this.storage?this.storage.clear():this.tempStorage={}}}const Q=new ru("sessionStorage"),ct=new ru("localStorage");class Uf{constructor(t){de(this,"payload");de(this,"promise");de(this,"reject",()=>{});de(this,"resolve",()=>{});this.payload=t,this.promise=new Promise((r,n)=>{this.reject=n,this.resolve=r})}resolveRequest(t){this.resolve(t)}}const ne={replay:null},Tf=()=>{const e=[];return ne.replay&&e.push("replay"),e.join(",")},Df=10;let nu=!1,su="",Yr=!1,iu=!1,dn=[];const Pf=e=>e._config&&e._config.installationMethod?e._config.installationMethod:e._gtm?"web-gtm":e._segment?"web-segment":"web-snippet",Ha=e=>{var t;(t=e==null?void 0:e.blockedURI)!=null&&t.includes(window.UserLeap._API_URL)&&(iu=!0,console.warn(`[Sprig] ${e.blockedURI} is blocked by Content-Security-Policy`))},ui=(e="")=>{nu=!0,su=e};function Te(e={}){const t={"Content-Type":"application/json","userleap-platform":"web","x-ul-sdk-version":"2.41.3","x-ul-installation-method":Pf(e),"sprig-modules":Tf(),"x-ul-package-version":"2.41.3"};if(e.envId&&(t["x-ul-environment-id"]=e.envId),e.token&&(t.Authorization="Bearer "+e.token),e.userId&&(t["x-ul-user-id"]=e.userId),e.visitorId&&(t["x-ul-visitor-id"]=e.visitorId),e.partnerAnonymousId&&(t["x-ul-anonymous-id"]=e.partnerAnonymousId),e.mobileHeadersJSON){const r=JSON.parse(e.mobileHeadersJSON);Object.assign(t,r)}return e.locale&&(t["accept-language"]=e.locale),window.previewMode&&(t["x-ul-preview-mode"]="1"),t}const $a=async({shouldDropOnRateLimit:e,...t})=>{if(e)return{status:429};{const r=new Uf(t);return dn.push(r),r.promise}},Ve=async(e,t)=>{const{retries:r=0,shouldDropOnRateLimit:n=!1,shouldRetryRequest:s=!1,...i}=t,a={url:e,options:i,retries:r,shouldDropOnRateLimit:n};if(Yr&&!s)return $a(a);const o={ok:!1,reportError:!1};if(nu)return console.info(`UserLeap - ${su}`),o;try{const l=await fetch(e,i);if(l.status===429){if(!Yr&&!n||s){Yr=!0;const c=l.headers.has("ratelimit-reset")?Number(l.headers.get("ratelimit-reset")):Df;return await In(1e3*c),Ve(e,{...i,shouldDropOnRateLimit:n,shouldRetryRequest:!0})}return $a(a)}if(Yr=!1,dn.length&&(dn.map(c=>{const u=c.payload;Ve(u.url,{...u.options,retries:u.retries,shouldDropOnRateLimit:u.shouldDropOnRateLimit}).then(d=>{c.resolveRequest(d)})}),dn=[]),l.ok){if(l.status===249)return ui(),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||iu?{ok:!1,reportError:!1,error:l}:(await In(1e3*Math.pow(2,r)),Ve(e,{...i,retries:c}))}},Ya="ul-view-sdk-script",_f=new Set(["ios","android"]),st="visitors",it="environments";async function Be(e,t){var i,a,o;const{shouldDropOnRateLimit:r,...n}=t;n.headers=Object.assign(Te(window.UserLeap),n.headers);const s=await Ve(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 h=ct.getItemObject("sprig.anon.env.vid.map");h&&h[window.UserLeap.envId]===d&&(delete h[window.UserLeap.envId],ct.setItemObject("sprig.anon.env.vid.map",h))}u&&d&&(d!==window.UserLeap.visitorId||window.UserLeap.token!==u)&&(Ce("token",u),Ce("vid",d),z.emit(F.VisitorIDUpdated,{visitorId:d}),window.UserLeap.token=u,window.UserLeap.visitorId=d)}return(o=s.json)!=null&&o.logMessage&&console.warn(`[Sprig] ${s.json.logMessage}`),s}function Ce(e,t){const r=ct.getItemObject("userleap.ids");let n=r[window.UserLeap.envId];n?n[e]=t:n={[e]:t},r[window.UserLeap.envId]=n,ct.setItemObject("userleap.ids",r)}function ro(){return window.previewMode?"0":window.UserLeap.visitorId??""}function Me(e,t,r){const n=[window.UserLeap._API_URL,"sdk",e];return t&&t.forEach(s=>{n.push(s),s===it?n.push(window.UserLeap.envId):s===st&&n.push(ro())}),r&&n.push(r),n.join("/")}const tr=async(e,t,r)=>{var te,q,me,_e;const{context:n,delay:s,avatars:i,forceBrandedLogo:a,endCard:o,isFeedback:l=!1,heatmap:c,locale:u,layout:d,previewMode:h,productConfig:f,questions:v,responseGroupUid:p,surveyId:I,uuid:m,vid:g,sessionReplay:b,studyType:C,surveyVisitorAttributes:A}=e,E=Te(window.UserLeap),T=mr(E),M=qn(E);if(b)if(T)z.emit(F.ReplayCapture,{responseGroupUid:p,hasQuestions:!!(v!=null&&v.length),surveyId:I,uploadId:b.uploadId,replayType:b.replayDurationType??"before",seconds:b.replayDurationSeconds,generateVideoUploadUrlPayload:{mediaRecordingUid:vt(),mediaType:"screen",questionId:1,responseGroupUid:p,surveyId:I,updatedAt:new Date().toISOString(),visitorId:window.UserLeap.visitorId,isReplay:!0}});else{if(!ne.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};ne.replay.scheduleOrCaptureReplay({responseGroupId:p,surveyId:I,visitorId:g,replayParams:b,completeUploadHeaders:E,apiUrl:window.UserLeap._API_URL,triggerTimestamp:Date.now(),isStandalone:v.length===0})}if(c){if(!ne.replay)return window.UserLeap.reportError("displayQuestions",new Error("Replay module not registered")),{success:!1,message:"Replay module not registered",surveyState:"no survey"};const{eventId:V,replayParams:ge,responseGroupUid:dt,surveyId:Qe}=c;await ne.replay.initializeReplay({maxReplayDurationSeconds:300,maxInflightRequests:window.UserLeap.maxInflightReplayRequests,teardownAfter:!0,apiUrl:window.UserLeap._API_URL,replaySettings:r}),ne.replay.tryReplayAction(()=>{var W;return(W=ne.replay)==null?void 0:W.scheduleCapture({apiUrl:window.UserLeap._API_URL,completeUploadHeaders:E,eventId:V,isHeatmap:!0,replayParams:ge,responseGroupId:dt,surveyId:Qe,triggerTimestamp:Date.now(),visitorId:g})},"Error in scheduling/capturing replay")}if(g==null||!(v!=null&&v.length))return _.info("CannotDisplaySurvey",{vid:g}),{success:!1,message:"[Sprig] no survey found",surveyState:"no survey"};if(Nf(v))return{success:!1,message:"[Sprig] bundled version does not support video voice",surveyState:"no survey"};if(window.UserLeap.container){_.info("AlreadyDisplayingSurvey");const V="[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";return console.warn(V),{success:!1,message:V,surveyState:"no survey"}}if(g!==window.UserLeap.visitorId&&m!==window.UserLeap.visitorId&&!window.previewMode){const V="Attempted to display survey to a different visitor";return window.UserLeap.reportError("DisplaySurvey",new Error(V)),{success:!1,message:V,surveyState:"no survey"}}_.info("ShowingSurvey",{surveyId:I}),(te=ne.replay)==null||te.RecordSurveyShown({id:I,userAgent:window.navigator.userAgent}),Qc.disable(),z.emit(F.SurveyWillPresent,{name:F.SurveyWillPresent,"survey.id":I,layout:d});let k,R,x,S,D=document.createElement("div");const P=V=>{const{"view.version":ge}=V;ge!==E["x-ul-sdk-version"]&&au(),z.removeListener("verify.view.version",P)};z.on("verify.view.version",P),window.UserLeap.useMobileStyling=M,to(E)?(k="ul-direct-embeded-frame",R=document.head,x=window,S=!1,(()=>{const V=Te(window.UserLeap),ge=mr(V),dt=window.UserLeap.forceDirectEmbed,Qe=V["userleap-platform"]==="web";return ge||dt&&Qe})()&&(ou(I,l),D.id=k,window.UserLeap.container.appendChild(D),lu(),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.SurveyPresented,"survey.id":I}))):{frameId:k,contentWinDocHead:R,contentWindow:x,hasOverlay:S,iframe:D}=zf({productConfig:f,useMobileStyling:M,surveyId:I,isFeedback:l,enableCspTrustedTypes:(q=window.UserLeap._config)==null?void 0:q.enableCspTrustedTypes}),window.UserLeap.frameId=k;const w={apiURL:window.UserLeap._API_URL,avatars:i,cards:v,configureExitOnOverlayClick:V=>{z.once(F.CloseSurveyOnOverlayClick,V)},context:n,endCard:o,envId:window.UserLeap.envId,eventEmitFn:z.emit.bind(z),fontFamily:window.UserLeap.fontFamily,fontFamilyURL:window.UserLeap.fontFamilyURL,forceBrandedLogo:a,frame:D,headers:E,layout:d,locale:u,mobileSDKVersion:window.UserLeap.mobileSDKVersion,previewKey:Q.getItem("sprig.previewKey"),previewMode:h||!!window.previewMode,productConfig:{framePosition:f==null?void 0:f.framePosition,desktopDisplay:f==null?void 0:f.desktopDisplay,placement:f==null?void 0:f.placement},responseGroupUid:p,startingQuestionIdx:(me=window.UserLeap.config)==null?void 0:me.startingQuestionIdx,studyType:C,styleNonce:window.UserLeap.styleNonce,surveyId:I,tabTitle:document.title,trackPageViewUrl:t,ulEvents:hr,upchunkLibraryURL:window.UserLeap.upchunkLibraryURL,useMobileStyling:M,userId:m,viewDocument:x==null?void 0:x.document,viewWindow:x,visitorAttributes:{externalUserId:window.UserLeap.userId,email:window.UserLeap.email},surveyVisitorAttributes:A||{},...window.UserLeap._config};(_e=window.UserLeap._config)!=null&&_e.startingQuestionIdx&&(window.UserLeap._config={...window.UserLeap._config,startingQuestionIdx:null});const y=(l?window.UserLeap.feedbackCustomStyles:window.UserLeap.customStyles)??f.customStyles;w.customStyles=y,x&&(x.__cfg=w);const U=window.UserLeap.viewSDKURL?window.UserLeap.viewSDKURL:w.path,B=document.getElementById(Ya);B&&B.remove();const j=function(){const V=document.createElement("script");return window.UserLeap.isMobileSDK||V.setAttribute("type","module"),window.UserLeap.nonce&&V.setAttribute("nonce",window.UserLeap.nonce),V.id=Ya,V}(),O=()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{display:"flex"})};if(w.installationMethod==="web-npm"||w.installationMethod==="web-npm-bundled"){const{default:V}=await Promise.resolve().then(()=>require("./view-CxEE_Iml.cjs")).then(ge=>ge.view);V.configure(w),S&&window.UserLeap.container&&O()}else U&&(j.src=`${U}${window.UserLeap.isMobileSDK?"":`?t=${Date.now()}`}`,S&&j.addEventListener("load",()=>{window.UserLeap.container&&O()}),x==null||x.addEventListener("error",V=>{V.target instanceof HTMLScriptElement&&V.target.src===U&&window.UserLeap.reportError("loadFrameScript",new Error("Frame script failed to load"))},{capture:!0,once:!0}));R==null||R.appendChild(j);const N={success:!0,surveyState:"ready",surveyId:I,responseGroupUid:p};return window.UserLeap.isMobileSDK&&s&&(N.delay=s),N};function qn(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 mr(e)||t>10&&t<500}function mr(e){return _f.has(e["userleap-platform"])}const Nf=e=>e.some(t=>t.type==="videovoice"),qa=new WeakMap,Ff=(e,t)=>{try{return(n=>{var a,o;const s=qa.get(n);if(s)return s;if(!((a=n.trustedTypes)!=null&&a.createPolicy))throw new Error("Trusted types not supported");const i=(o=n.trustedTypes)==null?void 0:o.createPolicy("sprig-sdk",{createHTML:l=>l,createScript:l=>l,createScriptURL:l=>l});return qa.set(n,i),i})(t).createHTML(e)}catch(r){return console.warn("Could not create TrustedHTML object",r),e}},Jn=(e,t,r=window)=>{var n;return t&&((n=r.trustedTypes)!=null&&n.createPolicy)?Ff(e,r):e},no="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 fs="0px",ou=(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=pu();r&&n&&!window.UserLeap.useMobileStyling?n.appendChild(window.UserLeap.container):document.body.appendChild(window.UserLeap.container)},au=(e,t)=>{var n;Wf();const r=window.UserLeap.container;if(r)try{(n=r.parentNode)==null||n.removeChild(r),window.UserLeap.container=null,Ce("trackStartUrl",null),z.emit(F.SurveyLifeCycle,{state:"dismissed"}),z.emit(F.SurveyClosed,{name:F.SurveyClosed,initiator:e,"survey.id":parseInt(r.dataset.studyId),...t&&{studyType:t}})}catch(s){console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${e} `+r),s instanceof Error&&window.UserLeap.reportError("dismissActiveSurvey",s)}},lu=()=>{z.once(F.SurveyWillClose,({initiator:e,studyType:t})=>{z.removeAllListeners(F.CloseSurveyOnOverlayClick),au(e,t)})},Bf=(e,t,r,n)=>{var u,d;const s={position:"fixed",bottom:"0px",right:fs,border:0,backgroundColor:"rgba(0,0,0,0)",zIndex:2147483646,transition:"width 0.2s ease-in-out, height 0.2s ease-in-out",maxWidth:"100%"},i=Object.assign({},t,window.UserLeap),{desktopDisplay:a}=t||{},o=a==="center-modal";let l;o&&(i.framePosition="center");let c=!1;if(r)(u=window.UserLeap.windowDimensions)!=null&&u.width?s.width=`${window.UserLeap.windowDimensions.width}px`:s.width="100%",(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 h=()=>{c=!0,l={margin:"auto",position:"static"}};if(n)o?h():l={position:"relative",height:"300px"};else switch(i.framePosition){case"bottomLeft":l={left:fs};break;case"topLeft":l={left:fs,top:0};break;case"topRight":l={top:0};break;case"center":h()}}return c&&((h,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},p=f?h.overlayStyleMobile:h.overlayStyle;v["background-color"]=p==="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},zf=({productConfig:e,useMobileStyling:t,surveyId:r,isFeedback:n,enableCspTrustedTypes:s})=>{var f,v;const i=no,a=n&&e.desktopDisplay==="slider";ou(r,n,a),jf();const o=document.createElement("iframe");o.id=i,o.setAttribute("title","Sprig User Feedback Dialog");const l=Bf(o,e,t,n);lu();let c=!1;o.setHeight=p=>{parseInt(o.style.height)==p&&c||(c=!0,o.style.height=`${p}px`,z.emit(F.SurveyHeight,{name:F.SurveyHeight,contentFrameHeight:p,"survey.id":r}))};let u=!1;o.setWidth=p=>{parseInt(o.style.width)==p&&u||(u=!0,o.style.width=`${p}px`,z.emit(F.SurveyWidth,{name:F.SurveyWidth,contentFrameWidth:p,"survey.id":r}))},(f=window.UserLeap.container)==null||f.appendChild(o),e&&(t?e.exitOnOverlayClickMobile:e.exitOnOverlayClick)&&window.UserLeap.container&&(window.UserLeap.container.onclick=()=>{z.emit(F.CloseSurveyOnOverlayClick)}),z.emit(F.SurveyLifeCycle,{state:"presented"}),z.emit(F.SurveyPresented,{name:F.SurveyPresented,"survey.id":r});const d=(v=o.contentWindow)==null?void 0:v.document;if(d&&(d.open("text/html","replace"),d.write(Jn("<!doctype html><head></head><body></body></html>",s,o.contentWindow)),d.close(),!t)){const p=d.body;p.style.display="flex",p.style.alignItems="center"}const h=d==null?void 0:d.head;return{frameId:i,contentWinDocHead:h,contentWindow:o.contentWindow,hasOverlay:l,iframe:o}},cu={[F.SurveyFadingOut]:()=>{window.UserLeap.container&&Object.assign(window.UserLeap.container.style,{"background-color":"rgba(0,0,0,0)"})}},jf=()=>{Object.entries(cu).forEach(([e,t])=>{z.on(e,t)})},Wf=()=>{Object.entries(cu).forEach(([e,t])=>{z.off(e,t)})},Ja=Object.freeze({contains:(e,t)=>t.includes(e),notContains:(e,t)=>!t.includes(e),exactly:(e,t)=>t===e,notExactly:(e,t)=>t!==e,startsWith:(e,t)=>t.startsWith(e),endsWith:(e,t)=>t.endsWith(e),regex:(e,t)=>new RegExp(e).test(t),legacy:(e,t)=>new RegExp(e,"i").test(t)});function so(e,t){const{matchType:r,pattern:n}=e,s=r?Ja[r]:Ja.legacy;let i=!1;try{i=s(n,t)}catch(a){const o=`[Sprig] (ERR-445) Failed to check url match with pattern ${n}`;a instanceof Error&&(console.warn(o,a),a.stack=JSON.stringify(e),window.UserLeap.reportError(o,a))}return i}const uu=e=>{const{pageUrlEvents:t}=window.UserLeap._config,r=t==null?void 0:t.find(n=>n.id===e);return!!r&&so(r,window.location.href)},Ye=e=>!!e&&e.nodeType===Node.ELEMENT_NODE,Ka=e=>e instanceof HTMLElement||e instanceof SVGElement,fr=({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)},Xa=(e,t)=>{const r=t.querySelector(e);if(!Ye(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))},du=(e,t,r)=>{const n=e.querySelector(".ul-card__container"),s=e.querySelector(".ul-app");let i=600,a=360;if(Ye(n)&&Ye(s)){const o=n.querySelector(".ul-card--matrix_grid"),l=!o&&t&&r;try{l&&(s.style.width="360px"),i=n.scrollHeight,i+=(d=>{const h=d.querySelector(".sprig-question-body"),f=d.querySelector(".ul-card"),v=d.querySelector(".ul-card-main-content"),p=d.querySelector(".ul-footer"),I=d.querySelector(".sprig-container");let m=0;return Ye(f)&&(m+=f.scrollHeight-f.clientHeight),Ye(v)&&(m+=v.scrollHeight-v.clientHeight),Ye(h)&&(m+=h.scrollHeight-h.clientHeight),Ye(p)&&Ye(I)&&I.clientHeight===0&&(m+=p.clientHeight),m})(e);const c=getComputedStyle(n),u=parseFloat(c.marginTop)+parseFloat(c.marginBottom);i+=u+(parseFloat(c.borderTopWidth)+parseFloat(c.borderBottomWidth)),o&&(a=o.scrollWidth,a+=Xa(".ul-card__container",e),a+=Xa(".sprig-question-body",e))}finally{l&&s.style.removeProperty("width")}}return[i+2,a]},pu=()=>Z,Ot=()=>document.getElementById("sprig-feedback-container"),di=()=>document.getElementById("sprig-feedback-loading-animation"),hu=()=>!!document.getElementById(no);let Za=!1,Z=null,ze=null,io=!1,rr=null,pt=null;const Vf=["bottom-left","bottom-right","center-left","center-right"],Cn=()=>{var t;const e=window.UserLeap.container;return((t=e==null?void 0:e.parentElement)==null?void 0:t.id)==="sprig-feedback-loading-container"},mu=()=>document.getElementById("sprig-feedback-error-container"),fu=()=>{if(!Z)return 0;const e=Z==null?void 0:Z.clientWidth,t=window.getComputedStyle(Z);return e+parseInt(t.borderRightWidth||"0")+parseInt(t.borderLeftWidth||"0")},kn=e=>{const t=Ot();t&&(pt!=null&&pt.endsWith("right")?t.style.right=`${e}px`:pt!=null&&pt.endsWith("left")&&(t.style.left=`${e}px`))},gs=()=>{if(Z&&(Cn()||mu())){z.off(F.SurveyAppeared,Jt),pi();const e=fu();return kn(-e),!0}return!1},Jt=()=>{if(!Z||!ze)return;const e=di();e&&e.remove(),Z.style.height="auto",Z.style.width="auto",ze.disabled=!1,io=!1},pi=()=>{if(Z&&!di()){const e=(()=>{var r;if(di())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=Jn(`
56
56
  <div class="ul-loading-spinner">
57
57
  <div class="first"></div>
58
58
  <div class="second"></div>
59
59
  <div class="third"></div>
60
60
  <div class="fourth"></div>
61
61
  </div>
62
- `,(r=window.UserLeap._config)==null?void 0:r.enableCspTrustedTypes),t})();e&&(Z.style.height="300px",Z.style.width="360px",Z.appendChild(e))}},Qa=()=>{Z&&je&&(kn(0),je.disabled=!0,io=!0)},gu=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=Ot();if(d){if(!t&&i===rr)return;d.remove(),z.off(hr.SURVEY_FADING_OUT,gs)}rr=i,fr({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}),fr({document,elementId:"ul-custom-style",styleString:s??"",nonce:window.UserLeap.styleNonce}),Za=o==="center-modal",pt=a;const[h,f]=a.split("-");(m=>{if(Ot()||!Vf.includes(m))return;const[g,b]=m.split("-"),C=document.createElement("div");C.id="sprig-feedback-container",C.classList.add(`sprig-feedback-container-${b}`,`sprig-feedback-container-${g}`),document.body.appendChild(C)})(a),d=Ot(),je=document.createElement("button");const v=document.createElement("div");v.className="sprig-feedback-button-label",v.innerText=l,je.appendChild(v),je.id="sprig-feedback-button",je.classList.add(`sprig-feedback-button-${f}`,`sprig-feedback-button-${h}`,`sprig-feedback-button-${n}`,"fade-in-transition"),z.on(hr.SURVEY_FADING_OUT,gs),je.addEventListener("click",async()=>{const m=document.getElementById("sprig-feedback-error-container");if(hu()||mu()){if(gs()){z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:Me.FeedbackClosed,studyType:"feedbackButton","survey.id":u}),z.emit(F.SurveyWillClose,{name:F.SurveyWillClose,initiator:Me.FeedbackClosed,studyType:"feedbackButton","survey.id":u});const b=Ot();m&&b&&(b.remove(),rr=null,Z=null)}return}if(qn(De(window.UserLeap))||io||Qa(),t)return Z&&Z.classList.add("sprig-feedback-loading-container-previews"),await tr(t),void Jt();const g=await(async b=>{const C=await ze(Ue("1",[it],"startFeedbackStudy"),{body:JSON.stringify({surveyUuid:b}),method:"POST"});return C.ok?C.json:null})(c);if(g)z.once(F.SurveyAppeared,Jt),tr({...g,studyType:"feedbackButton"},r);else if(Z){const b=Gf();Z.appendChild(b),Jt(),Z.style.height="300px",Z.style.width="360px"}}),d==null||d.appendChild(je),z.emit(F.FeedbackButtonLoaded,{name:F.FeedbackButtonLoaded,"survey.id":u});const{useMobileStyling:p,_config:{border:I}}=window.UserLeap;if(Za||p)kn(0);else{const m=document.createElement("div");m.id="sprig-feedback-loading-container",m.className=`sprig-feedback-loading-container sprig-feedback-loading-container-${f}`,m.style.setProperty("--feedback-border",I),Z=m,pi(),d==null||d.appendChild(m);const g=fu();kn(-g)}window.UserLeap._config.isOnQuestionsTab&&t&&!Cn()&&Z&&(Qa(),pi(),Z&&Z.classList.add("sprig-feedback-loading-container-previews"),tr(t),Jt())},Gf=()=>{var r;const e=document.createElement("div");e.id="sprig-feedback-error-container",e.innerHTML=Jn(`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
62
+ `,(r=window.UserLeap._config)==null?void 0:r.enableCspTrustedTypes),t})();e&&(Z.style.height="300px",Z.style.width="360px",Z.appendChild(e))}},Qa=()=>{Z&&ze&&(kn(0),ze.disabled=!0,io=!0)},gu=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=Ot();if(d){if(!t&&i===rr)return;d.remove(),z.off(hr.SURVEY_FADING_OUT,gs)}rr=i,fr({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}),fr({document,elementId:"ul-custom-style",styleString:s??"",nonce:window.UserLeap.styleNonce}),Za=o==="center-modal",pt=a;const[h,f]=a.split("-");(m=>{if(Ot()||!Vf.includes(m))return;const[g,b]=m.split("-"),C=document.createElement("div");C.id="sprig-feedback-container",C.classList.add(`sprig-feedback-container-${b}`,`sprig-feedback-container-${g}`),document.body.appendChild(C)})(a),d=Ot(),ze=document.createElement("button");const v=document.createElement("div");v.className="sprig-feedback-button-label",v.innerText=l,ze.appendChild(v),ze.id="sprig-feedback-button",ze.classList.add(`sprig-feedback-button-${f}`,`sprig-feedback-button-${h}`,`sprig-feedback-button-${n}`,"fade-in-transition"),z.on(hr.SURVEY_FADING_OUT,gs),ze.addEventListener("click",async()=>{const m=document.getElementById("sprig-feedback-error-container");if(hu()||mu()){if(gs()){z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:Ae.FeedbackClosed,studyType:"feedbackButton","survey.id":u}),z.emit(F.SurveyWillClose,{name:F.SurveyWillClose,initiator:Ae.FeedbackClosed,studyType:"feedbackButton","survey.id":u});const b=Ot();m&&b&&(b.remove(),rr=null,Z=null)}return}if(qn(Te(window.UserLeap))||io||Qa(),t)return Z&&Z.classList.add("sprig-feedback-loading-container-previews"),await tr(t),void Jt();const g=await(async b=>{const C=await Be(Me("1",[st],"startFeedbackStudy"),{body:JSON.stringify({surveyUuid:b}),method:"POST"});return C.ok?C.json:null})(c);if(g)z.once(F.SurveyAppeared,Jt),tr({...g,studyType:"feedbackButton"},r);else if(Z){const b=Gf();Z.appendChild(b),Jt(),Z.style.height="300px",Z.style.width="360px"}}),d==null||d.appendChild(ze),z.emit(F.FeedbackButtonLoaded,{name:F.FeedbackButtonLoaded,"survey.id":u});const{useMobileStyling:p,_config:{border:I}}=window.UserLeap;if(Za||p)kn(0);else{const m=document.createElement("div");m.id="sprig-feedback-loading-container",m.className=`sprig-feedback-loading-container sprig-feedback-loading-container-${f}`,m.style.setProperty("--feedback-border",I),Z=m,pi(),d==null||d.appendChild(m);const g=fu();kn(-g)}window.UserLeap._config.isOnQuestionsTab&&t&&!Cn()&&Z&&(Qa(),pi(),Z&&Z.classList.add("sprig-feedback-loading-container-previews"),tr(t),Jt())},Gf=()=>{var r;const e=document.createElement("div");e.id="sprig-feedback-error-container",e.innerHTML=Jn(`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
63
63
  <circle cx="20" cy="20" r="14.5" stroke="#B0B5B7" stroke-width="3"/>
64
64
  <path d="M20 12L20 21.6" stroke="#B0B5B7" stroke-width="3" stroke-linecap="round"/>
65
65
  <circle cx="19.9984" cy="27.6" r="1.6" fill="#B0B5B7"/>
66
- </svg>`,(r=window.UserLeap._config)==null?void 0:r.enableCspTrustedTypes);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},hi=new class{constructor(){de(this,"_ldData",{})}getAllLaunchDarklyVariations(){return this._ldData}setLDFlagsVariations(e){try{return!(!e||typeof e!="object"||Array.isArray(e))&&(Object.keys(this._ldData).forEach(t=>{delete this._ldData[t]}),Object.keys(e).forEach(t=>this._ldData[`!launch_darkly_${t}`]=(e[t]??0)+1),!0)}catch(t){return t instanceof Error&&window.UserLeap.reportError("setAllLDFlagsVariations",t),console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."),!1}}};Object.freeze(hi);const pn=new class{constructor(){de(this,"_optimizelyData",{})}setOptimizelyExperiment(e,t=!0){if(!e||typeof e!="object")return!1;const{experiments:r}=e;try{return t&&Object.keys(this._optimizelyData).map(n=>{delete this._optimizelyData[n]}),r&&r.map(n=>{const{id:s,variation:i}=n,a=this.transformExperimentId(s);i&&typeof i=="string"&&(this._optimizelyData[a]=i)}),!0}catch(n){return n instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",n),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(e){return this._optimizelyData[this.transformExperimentId(e)]}transformExperimentId(e){return"!optimizely_experiments_"+e}getAndSetWebOptimizelyExperiments(){var e;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const t=(e=window.optimizely.get("state"))==null?void 0:e.getExperimentStates({isActive:!0});if(t){const r=Object.keys(t).map(n=>{var s,i;return(s=t[n].variation)!=null&&s.name?{id:n,variation:(i=t[n].variation)==null?void 0:i.name}:{id:n,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r},!1),!0}return!1}return!1}catch(t){return t instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",t),!1}}};Object.freeze(pn);class Hf{constructor(t,r){de(this,"paused");de(this,"queue");de(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(r)}flush(t){const r=t.length;if(r)for(let n=0;n<r;n++)this.push(t[n])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const r=Array.prototype.slice.call(t,1),n=t[0],s=this.ul[n];s instanceof Function?s.apply(this.ul,r):n&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",n)}}perform(t){if(this.paused){let r=()=>{};const n=new Promise(function(s){r=function(){s(t())}});return this.queue.push(r),n}return t()}empty(){this.queue.length=0}}let yu=!0,mi=!1;const $f=["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 fi,Kt={};class Yf{constructor(t){de(this,"_values",[]);de(this,"_isWebMetric");this.name=t,this._isWebMetric=$f.includes(this.name)}report(t){if(yu&&this._values.push({time:Date.now(),value:t}),mi||!this._isWebMetric)return;const r=this.findExceededThreshold(t);r&&fi&&fi(t,r)}collect(){const t=this._values;return this._values=[],t}findExceededThreshold(t){const r=Kt[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 vr={},Ve=e=>{const t=new Yf(e);return vr[e]=t,t},wu=(e,t)=>{let r=vr[e];return r||(r=Ve(e)),r.report(t)},qf=({reportingIntervalSeconds:e,postMetrics:t})=>{e?setInterval(()=>{(async r=>{const n=Object.values(vr).map(s=>({name:s.name,values:s.collect()}));if(n.some(s=>s.values.length))try{await r(JSON.stringify(n))}catch(s){s instanceof Error&&_.error("MetricsErr",{error:{message:s.message,name:s.name}})}})(t)},1e3*e):yu=!1};let vu,bu;const gi=e=>{let t=0,r=e.firstElementChild;for(;r;)t+=gi(r),r.shadowRoot&&(t+=gi(r.shadowRoot)),r=r.nextElementSibling,t++;return t},el=()=>{vu.report(gi(document.body)),bu.report(document.documentElement.innerHTML.toString().length)},yi=(e,t)=>{const r=performance.now();document.hidden?setTimeout(()=>yi(e,t),e):setTimeout(()=>{const n=performance.now()-r;t.report(n/1e3),setTimeout(()=>yi(e,t),e)},0)};let En,xn,Rn,Ln,tl,ht={};const qr=(e,t=1)=>{const{name:r}=e;ht[r]=(ht[r]||0)+t},Su=e=>{let t=1;return e.childNodes.forEach(r=>{t+=Su(r)}),t},rl=e=>{let t=0;return e.forEach(r=>{t+=Su(r)}),t},Jf=e=>{switch(e.type){case"childList":return qr(En,rl(e.addedNodes)),void qr(xn,rl(e.removedNodes));case"attributes":return void qr(Rn);case"characterData":return void qr(Ln)}},Kf=e=>e.forEach(Jf),Xf=()=>{En.report(ht[En.name]||0),xn.report(ht[xn.name]||0),Rn.report(ht[Rn.name]||0),Ln.report(ht[Ln.name]||0),ht={}},Zf=(e=1e3)=>{En=Ve("sdk_mutations_nodes_added"),xn=Ve("sdk_mutations_nodes_removed"),Rn=Ve("sdk_mutations_attributes_changed"),Ln=Ve("sdk_mutations_character_data"),tl=new MutationObserver(Kf),tl.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),setInterval(Xf,e)},Qf=({isWeb:e,reportingIntervalSeconds:t,thresholds:r,postMetrics:n})=>{((s,i)=>{Kt={},mi=!1,s==null||s.forEach(a=>{var o;a.metric in Kt||(Kt[a.metric]=[]),(o=Kt[a.metric])==null||o.push(a)}),fi=i})(r,(s,i)=>{var a,o;if((a=re.replay)!=null&&a.isReplayRecording()){const l=`Value: ${s} on ${i.metric} violated threshold of ${i.type} ${i.value}`;(o=re.replay)==null||o.disableRecording("Threshold violated",new Error(l),{reportError:!1}),window.UserLeap.reportError("Sdk Performance Metric threshold violated",new Error("Sdk Performance Metric threshold violated"),{metricName:i.metric,type:i.type,value:i.value},{metricName:i.metric}),mi=!0}}),qf({reportingIntervalSeconds:t,postMetrics:n}),e&&(((s=1e3)=>{const i=Ve("sdk_event_queue_latency_seconds");yi(s,i)})(),((s=1e4)=>{vu=Ve("sdk_dom_nodes_count"),bu=Ve("sdk_page_html_characters"),el(),setInterval(el,s)})(),Zf())},eg="test",tg=["popState","pushState","replaceState"];let oo,nr;const On={},Vt="!email",Iu="pageUrl";let ys=window.location.href;function sr(e){var o,l;const{pageUrlEvents:t,interactiveEvents:r,dismissOnPageChange:n,platform:s}=window.UserLeap._config;if(s&&s!=="web")return;ys!==window.location.href&&_.navigation("LocationChange",{from:ys,to:window.location.href}),ys=window.location.href;const i=Eu().trackStartUrl,a=i?String(i):null;t&&Ru(window.location.href),r&&(ku(),rg()),pu()&&(()=>{if(Cn())return;const c=Ot();c&&(uu(rr)||(c.remove(),rr=null,Z=null))})(),ue.getItem("sprig.isCapturingHeatmap")&&((l=(o=re.replay)==null?void 0:o.checkPendingHeatmapsUrl())==null||l.then(c=>{var u;c&&((u=re.replay)==null||u.uploadReadyPendingCaptures(!0))})),!Cn()&&n&&a&&a!==window.location.href&&e&&tg.includes(e.type)&&window.UserLeap("dismissActiveSurvey",Me.PageChange)}const Cu={capture:!0},rg=()=>{const e=window.UserLeap._config.interactiveEvents.filter(r=>so(r,window.location.href)).map(r=>{const{name:n,properties:s}=r,{selector:i,innerText:a}=s;return i?o=>{if(Ka(o.target))try{o.target.closest(i)&&window.UserLeap("track",n)}catch{}return!1}:o=>(Ka(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,Cu)},ku=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,Cu),delete window.UserLeap._config.interactiveEventsHandler};function Eu(){const e=ke.getItemObject("userleap.ids");return e&&e[window.UserLeap.envId]||{}}function xu(){if(window.previewMode)return;const e=ke.getItemObject("sprig.anon.env.vid.map")||{},t=e[window.UserLeap.envId];window.UserLeap.visitorId=t||vt(),_.info("NewVid",{vid:window.UserLeap.visitorId}),Ce("vid",window.UserLeap.visitorId),t||(e[window.UserLeap.envId]=window.UserLeap.visitorId,ke.setItemObject("sprig.anon.env.vid.map",e)),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}function Ru(e,t,r,n){var s,i;try{if(e.endsWith("mock_snippet.html"))return;_.info("PageView",{url:e});const a=(s=document==null?void 0:document.querySelector('meta[name="description"]'))==null?void 0:s.getAttribute("content");(i=re.replay)==null||i.RecordPageView({...a&&{description:a},url:e,referrer:document.referrer,pageTitle:document.title});const o=window.UserLeap._config.pageUrlEvents;let l=!1;if(o&&o.length)for(let u=0;u<o.length&&(l=so(o[u],e),!l);u++);if(!l)return;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const c={url:e};n&&(c.trackPageView=!0),window.UserLeap._queue.push(["track",Iu,t,c,r])}catch(a){a instanceof Error&&(a.stack=e,window.UserLeap.reportError("trackPageView",a)),console.warn("[Sprig] (ERR-428) Failed to track page view",a)}}function ng(){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),sr(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),sr(s),n})(e.replaceState)),["hashchange","popstate"].forEach(t=>window.addEventListener(t,sr,!0))}async function ws(e,t){const r=ro();e&&!t&&(window.UserLeap._config.mode=eg);const n=qn(De(window.UserLeap)),s=await ze(function(i){const a=new URL(Ue("1",[ot],"questions"));return Object.entries(i||{}).forEach(([o,l])=>{l&&a.searchParams.append(o,String(l))}),a.toString()}({desktopDisplay:window.UserLeap._config.desktopDisplay,isMobile:n,previewLanguage:window.UserLeap._config.previewLanguage,surveyid:e==null?void 0:e.surveyId,surveytemplateid:e==null?void 0:e.surveyTemplateId,vid:r}),{shouldDropOnRateLimit:!0});if(!s.ok)return s.reportError&&s.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",s.error),window.UserLeap.reportError("getQuestions",s.error)),{success:!1,surveyState:"no survey"};if(s.json.delay&&await In(s.json.delay),!s.json.isFeedback)return tr(s.json,nr,oo);{const{feedbackLabel:i,productConfig:a,surveyUuid:o,feedbackCustomStyles:l}=s.json,{buttonTheme:c,placement:u,desktopDisplay:d}=a;gu({customStyles:l,buttonTheme:c,desktopDisplay:d,eventId:0,feedbackLabel:i,placement:u,surveyUuid:o,surveyId:e==null?void 0:e.surveyId},s.json)}}function sg(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)&&(ng(),sr())}const ig=function(e){if(!window.UserLeap)return;const t=async(s={})=>{var m,g,b,C,A;const{userId:i,anonymousId:a,metadata:o={},properties:l,showSurveyCallback:c}=s;let{eventName:u}=s;if(window.UserLeap.debugMode&&u!==Iu&&console.info("[DEBUG] Sprig track",s),e.mode==="test")return;const d=ke.getItem("sprig.previewKey")??void 0;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const E="[Sprig] - Skipping tracking without userId";return console.warn(E),{success:!1,message:E,surveyState:"no survey"}}if(!u||u.trim().length===0){u=u?String(u):"";const E="[Sprig] - Invalid event name "+u;return console.warn(E),{success:!1,message:E,surveyState:"no survey"}}const h=nr??window.location.href;o.url||(o.url=h),Ce("trackStartUrl",h),(g=(m=window.UserLeap)==null?void 0:m._config)!=null&&g.optimizelyEnabled&&(mr(De(window.UserLeap))||pn.getAndSetWebOptimizelyExperiments(),o.optimizelyExperiments=Object.assign({},pn.getAllOptimizelyExperiments())),(C=(b=window.UserLeap)==null?void 0:b._config)!=null&&C.launchDarklyEnabled&&(o.launchDarklyFlags=hi.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),a&&(window.UserLeap.partnerAnonymousId=a),l&&(o.eventProperties=l),(A=re.replay)==null||A.RecordEvent({name:u,url:o.url}),_.info("TrackEvent",{eventName:u});const f=window.UserLeap.delayingSurvey||hu()?await ze(Ue("1",[it],"events/batch"),{body:JSON.stringify({events:[{event:u,metadata:o}],previewKey:d}),method:"POST",shouldDropOnRateLimit:!0}):await ze(Ue("1",[it],"events"),{body:JSON.stringify({event:u,metadata:o,previewKey:d}),method:"POST",shouldDropOnRateLimit:!0});if(!f.ok){const E="[Sprig] (ERR-421) Failed to track event";return f.reportError&&(console.warn(E,f.error),f.error&&window.UserLeap.reportError("track",f.error)),{success:!1,message:E,error:f.error,surveyState:"no survey"}}i&&Ce("uid",i),a&&Ce("aid",a);const v=f.json;v.invalidPreviewKey&&ke.removeItem("sprig.previewKey");const p=o.trackPageView?o.url:void 0;return v!=null&&v.feedbackButton&&gu(v.feedbackButton,void 0,p),await async function(E,T){var k,R;let M=!0;return!(T&&((k=E==null?void 0:E.json)!=null&&k.surveyId)&&(window.UserLeap.delayingSurvey=!0,M=await T(E.json.surveyId),window.UserLeap.delayingSurvey=!1,!M))&&((R=E==null?void 0:E.json)!=null&&R.delay&&!window.UserLeap.isMobileSDK&&(window.UserLeap.delayingSurvey=!0,await In(E.json.delay),window.UserLeap.delayingSurvey=!1),M)}(f,c)?function(E){if(!window.UserLeap._config.dismissOnPageChange)return!0;const T=new URL(E),M=new URL(nr??window.location.href);return T.hostname===M.hostname&&T.pathname===M.pathname}(h)?tr(v,p,oo):{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="${no}"]`))==null?void 0:o.contentDocument;a&&fr({document:a,elementId:"ul-custom-style",styleString:i})},n={displaySurvey:async s=>(console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",Me.Override),ws({surveyId:s},!0)),_previewSurvey(s){window.UserLeap("dismissActiveSurvey",Me.Override),ws({surveyTemplateId:s},!1)},_reviewSurvey(s){window.UserLeap("dismissActiveSurvey",Me.Override),ws({surveyId:s},!1)},previewSurvey(s){n._previewSurvey(s)},reviewSurvey(s){n._reviewSurvey(s)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(s=Me.API){window.UserLeap.container&&(s===Me.Closed&&window.Sprig.trackHistory&&window.Sprig.trackHistory({event:"closed"}),z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}),z.emit(F.SurveyWillClose,{name:F.SurveyWillClose,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},async setAttribute(s,i){if(!s||!i&&i!==0&&i!==!1){const a="[Sprig] - Disregarding empty attribute / value provided";return console.warn(a),{success:!1,message:a}}return this.setAttributes({[s]:i})},async setAttributes(s){if(s==null||Object.keys(s).length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}return this.identifyAndSetAttributes({attributes:s})},async identifyAndSetAttributes(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",s),e.mode==="test")return;if(s===null||typeof s!="object"||!(s.userId||s.anonymousId||s.attributes)){const u="[Sprig] - Disregarding empty payload provided";return console.warn(u),{success:!1,message:u}}const{userId:i,anonymousId:a,attributes:o}=s;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const u="[Sprig] - Skipping tracking without userId";return console.warn(u),{success:!1,message:u}}if(o){o.email&&!o[Vt]&&(o[Vt]=o.email,delete o.email);const u=Object.keys(o);for(const d of u)o[d]===On[d]&&delete o[d]}if(!(o&&Object.keys(o).length!==0||i&&window.UserLeap.userId!==i||a&&window.UserLeap.partnerAnonymousId!==a))return{success:!0};const l={};let c;return i&&(l.userId=window.UserLeap.userId=i),a&&(l.partnerAnonymousId=window.UserLeap.partnerAnonymousId=a),o&&Object.keys(o).length>0?(c=await ze(Ue("1",[ot,it],"attributes"),{body:JSON.stringify(o),method:"PUT"}),c.ok?Object.assign(On,o):c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await ze(Ue("1",[ot,it]),{body:JSON.stringify(l),method:"PUT"}),o&&o[Vt]&&(window.UserLeap.email=o[Vt]),c.ok&&(i&&Ce("uid",i),a&&Ce("aid",a)),{success:!!c.ok}},async removeAttributes(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig removeAttributes",s),e.mode==="test")return;if(s==null||s.length===0){const a="[Sprig] - Disregarding empty attributes provided";return console.warn(a),{success:!1,message:a}}if(e.requireUserIdForTracking&&!window.UserLeap.userId){const a="[Sprig] - Skipping tracking without userId";return console.warn(a),{success:!1,message:a}}const i=await ze(Ue("1",[ot,it],"attributes"),{body:JSON.stringify({delete:s}),method:"DELETE"});return!i.ok&&i.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",i.error),i.error&&window.UserLeap.reportError("removeAttributes",i.error)),{success:!!i.ok}},async addSurveyListener(s){z.on(F.SurveyLifeCycle,s)},async removeSurveyListener(s){z.removeListener(F.SurveyLifeCycle,s)},async addListener(s,i){z.on(s,i)},async removeListener(s,i){z.removeListener(s,i)},async removeAllListeners(){z.removeAllListeners()},setPreviewKey(s){s&&typeof s=="string"&&ke.isStorageAvailable&&s&&ke.setItem("sprig.previewKey",s)},async setUserId(s){var o;if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig setUserId",s),s==null){const l=`[Sprig] - Invalid userId ${s}`;return console.warn(l),{success:!1,message:l}}if(e.mode==="test"||s===window.UserLeap.userId)return;window.UserLeap.userId=s;const i=window.UserLeap.visitorId,a=await ze(Ue("1",[ot,it]),{body:JSON.stringify({userId:s}),method:"PUT"});a.ok?(i!==window.UserLeap.visitorId&&((o=re.replay)==null||o.clearUserReplayData()),Ce("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,Ce("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){nr=s,Ru(s,i,a,o)},applyFeedbackStyles({button:s="",view:i=""}){window.UserLeap.feedbackCustomStyles=i,document.getElementById("sprig-feedback-style")&&fr({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 h,f;const a=typeof s=="string"?parseInt(s,10):s,o=typeof i=="string"?parseInt(i,10):i;isNaN(a)||isNaN(o)||(window.UserLeap.windowDimensions={width:a,height:o});const l=De(window.UserLeap),c=qn(l),u=l["userleap-platform"]==="web";if(!window.UserLeap.frameId)return;const d=document.getElementById(window.UserLeap.frameId);d&&(window.UserLeap.useMobileStyling&&((h=window.UserLeap.windowDimensions)!=null&&h.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(du(d.contentDocument,u&&!c,to(l))[0])+"px")),z.emit(F.SurveyDimensions,{name:F.SurveyDimensions,contentFrameWidth:d.clientWidth,contentFrameHeight:d.clientHeight,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},logoutUser(){var s;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),_.info("LogOut",{vid:window.UserLeap.visitorId,userId:window.UserLeap.userId}),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,ke.removeItem("userleap.ids"),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),xu(),(s=re.replay)==null||s.clearUserReplayData(),window.UserLeap._queue.unpause()},teardown(){["hashchange","popstate"].forEach(s=>window.removeEventListener(s,sr,!0)),window.UserLeap._config.interactiveEvents&&ku(),window.UserLeap("dismissActiveSurvey",Me.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(s,i=!0){var a,o;if((o=(a=window.UserLeap)==null?void 0:a._config)!=null&&o.optimizelyEnabled)try{const l=typeof s=="string"?JSON.parse(s):s;pn.setOptimizelyExperiment(l,i)}catch(l){console.warn("[Sprig] Error with integrating Optimizely data"),l instanceof Error&&window.UserLeap.reportError("integrateOptimizely",l)}else console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.")},integrateOptimizelyClient(s){var i,a;if(!((a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.optimizelyEnabled))return void console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");s.notificationCenter.addNotificationListener("ACTIVATE:experiment, user_id,attributes, variation, event",({experiment:o,variation:l})=>{const c={experiments:[{id:o.id,variation:l.key}]};window.UserLeap("integrateOptimizely",c,!1)})},importLaunchDarklyData(s){var i,a;(a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.launchDarklyEnabled?hi.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(Vt,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){wu(s,i)},_completeSessionReplay:async({surveyId:s,responseGroupUuid:i,eventDigest:a})=>{var o;return re.replay?(o=re.replay)==null?void 0:o._completeSessionReplay({surveyId:s,responseGroupUuid:i,eventDigest:a,headers:De(window.UserLeap)}):(window.UserLeap.reportError("_completeSessionReplay",new Error("Replay module not registered")),!1)},pauseReplayRecording(){var s,i,a,o;(i=(s=re.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)||((o=(a=re.replay)==null?void 0:a.recordReplayPaused)==null||o.call(a))},resumeReplayRecording(){var s,i,a,o,l,c;(i=(s=re.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)&&((o=(a=re.replay)==null?void 0:a.recordReplayResumed)==null||o.call(a),(c=(l=re.replay)==null?void 0:l.recordFullSnapshot)==null||c.call(l))}};Object.assign(window.UserLeap,n)};async function og(e,t,r={},n={}){const s=window.__cfg&&window.__cfg.mode,i=ro(),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:nr??window.location.href,language:window.navigator.language,...r},c={action:e,breadcrumbs:_.breadcrumbs,err:{message:`${t==null?void 0:t.name} - ${t==null?void 0:t.message}`,stack:t==null?void 0:t.stack},meta:l,vid:i,envId:a,...n};(await ze(Ue("1",null,"errors"),{method:"POST",headers:{"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(c),shouldDropOnRateLimit:!0})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}function ag(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,h,f,v,p;if(window.UserLeap.loaded)return;if((d=window.SprigLoggerCallback)==null||d.call(window,"Loading Sprig"),window.UserLeap.reportError=og,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const I in window.UserLeap._config)window.UserLeap[I]=window.UserLeap._config[I];if(window.Sprig.outstandingTransactionLimit!==void 0&&(e.outstandingTransactionLimit=window.Sprig.outstandingTransactionLimit),!window.UserLeap.envId){if(!window.UserLeap.appId)throw new Error("Missing Environment id");window.UserLeap.envId=window.UserLeap.appId}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const s=Eu(),i=window.UserLeap.sampleRate;let a=s.sampled;if(i){if(a===null&&(a=Math.random()<i,Ce("sampled",a)),!a)return}else a!==null&&Ce("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new Hf(window.UserLeap,[]),window.UserLeap._queue.pause();for(let I=0;I<o.length;I++)window.UserLeap._queue.push(o[I]);const l=s.token;l?(window.UserLeap.token=l,window.UserLeap.visitorId=s.vid??null,window.UserLeap.userId=s.uid??null,window.UserLeap.partnerAnonymousId=s.aid??null):xu();const c=mr(De(window.UserLeap));(h=window.SprigLoggerCallback)==null||h.call(window,"Sprig fetching config");const u=await async function(I){var C,A;const m=De(window.UserLeap);document.addEventListener("securitypolicyviolation",Ha);const g=await Ge(Ue("1",[ot],"config"),{headers:m});if(document.removeEventListener("securitypolicyviolation",Ha),!g.ok)return(C=window.SprigLoggerCallback)==null||C.call(window,"Sprig config fetch failed"),g.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",g.error),g.error&&window.UserLeap.reportError("applyRemoteConfig",g.error)),ui("Disabled: failed to fetch configuration"),I;const b=g.json;return b!=null&&b.disabled?((A=window.SprigLoggerCallback)==null||A.call(window,"Sprig config fetch disabled"),ui(`Disabled: ${b.disabled}`),{disabled:b.disabled}):Object.assign({},b,I)}(e);if((f=window.SprigLoggerCallback)==null||f.call(window,"Sprig fetched config"),Qf({isWeb:!c,reportingIntervalSeconds:u.metricsReportingEnabled||u.mobileMetricsReportingEnabled?u.metricsReportingIntervalSeconds:0,thresholds:u.metricThresholds,postMetrics:async I=>{var m;await ze(Ue("1",[ot],"metrics"),{body:I,method:"POST",headers:{"x-ul-replay-enabled":`${!!((m=re.replay)!=null&&m.isReplayRecording())}`},shouldDropOnRateLimit:!0})}}),!c){const I=u.alwaysOnReplay?{userAgent:window.navigator.userAgent,surveyId:u.alwaysOnReplay.surveyId,responseGroupUuid:u.alwaysOnReplay.responseGroupUuid,sdkVersion:"2.41.1",maxDurationSeconds:u.alwaysOnReplay.maxDurationSeconds}:void 0;await((v=re.replay)==null?void 0:v.initializeReplay({maxReplayDurationSeconds:u.maxReplayDurationSeconds,maxInflightRequests:window.UserLeap.maxInflightReplayRequests??2,replaySettings:u.replaySettings,apiUrl:window.UserLeap._API_URL,alwaysOnConfig:I})),oo=u.replaySettings}ig(u),await sg(u),window.UserLeap._queue.unpause(),(p=window.SprigLoggerCallback)==null||p.call(window,"SdkReady"),z.emit(F.SDKReady,{mobileMetricsReportingEnabled:!!u.mobileMetricsReportingEnabled,metricsReportingInterval:u.metricsReportingIntervalSeconds||0,metricsThresholds:u.metricThresholds||[],maxMobileReplayDurationSeconds:u.maxMobileReplayDurationSeconds,mobileReplaySettings:u.mobileReplaySettings}),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}),z.on(F.VisitorIDUpdated,()=>{for(const I in On)delete On[I]})}window.UserLeap.UPDATES=hr,window.UserLeap("setPreviewKey",t),document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",()=>{r()},!1)}class wi{constructor(){de(this,"UPDATES",hr)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,r){window.Sprig("setAttribute",t,r)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,r){window.Sprig("addListener",t,r)}removeListener(t,r){window.Sprig("removeListener",t,r)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,r={},n={}){window.Sprig("track",t,r,n)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}trackPageView(t,r,n){window.Sprig("trackPageView",t,r,n)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,r){window.Sprig("setWindowDimensions",t,r)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}pauseReplayRecording(){window.Sprig("pauseReplayRecording")}resumeReplayRecording(){window.Sprig("resumeReplayRecording")}}const lg={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(wi.prototype).map(r=>{r!=="constructor"&&(window.Sprig[r]=wi.prototype[r])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,ag(e),window.Sprig}};var at=(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))(at||{}),Ye=(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))(Ye||{});const vi=(e,t)=>t.some(r=>e instanceof r);let nl,sl;const bi=new WeakMap,vs=new WeakMap,An=new WeakMap;let Si={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return bi.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return lt(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&(t==="done"||t==="store")||t in e};function Lu(e){Si=e(Si)}function cg(e){return(sl||(sl=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Ii(this),t),lt(this.request)}:function(...t){return lt(e.apply(Ii(this),t))}}function ug(e){return typeof e=="function"?cg(e):(e instanceof IDBTransaction&&function(t){if(bi.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});bi.set(t,r)}(e),vi(e,nl||(nl=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Si):e)}function lt(e){if(e instanceof IDBRequest)return function(r){const n=new Promise((s,i)=>{r.onsuccess=()=>{s(lt(r.result))},r.onerror=()=>{i(r.error)}});return An.set(n,r),n}(e);if(vs.has(e))return vs.get(e);const t=ug(e);return t!==e&&(vs.set(e,t),An.set(t,e)),t}const Ii=e=>An.get(e);function Ci(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);return t&&(r.onblocked=n=>t(n.oldVersion,n)),lt(r).then(()=>{})}const dg=["get","getKey","getAll","getAllKeys","count"],pg=["put","add","delete","clear"],bs=new Map;function il(e,t){if(!(e instanceof IDBDatabase)||t in e||typeof t!="string")return;if(bs.get(t))return bs.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=pg.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!dg.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 bs.set(t,i),i}Lu(e=>({...e,get:(t,r,n)=>il(t,r)||e.get(t,r,n),has:(t,r)=>!!il(t,r)||e.has(t,r)}));const hg=["continue","continuePrimaryKey","advance"],ol={},ki=new WeakMap,Ou=new WeakMap,mg={get(e,t){if(!hg.includes(t))return e[t];let r=ol[t];return r||(r=ol[t]=function(...n){ki.set(this,Ou.get(this)[t](...n))}),r}};async function*fg(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,mg);for(Ou.set(r,t),An.set(r,Ii(t));t;)yield r,t=await(ki.get(r)||t.continue()),ki.delete(r)}function al(e,t){return t===Symbol.asyncIterator&&vi(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&vi(e,[IDBIndex,IDBObjectStore])}Lu(e=>({...e,get:(t,r,n)=>al(t,r)?fg:e.get(t,r,n),has:(t,r)=>al(t,r)||e.has(t,r)}));const gg="sprigReplayIframeLoaded",yg="sprigReplayIframeSettings",wg="sprigReplayIframeTakeFullSnapshot",vg="sprigReplayTeardown",ao=[],Au=new class{constructor(e){de(this,"awaitingResolvers",[]);de(this,"activeCount",0);this.capacity=e}async acquire(){if(!(this.activeCount<this.capacity))return new Promise(e=>{this.awaitingResolvers.push(e)});this.activeCount++}release(){const e=this.awaitingResolvers.shift();e&&this.activeCount<=this.capacity?e():this.activeCount--}async execute(e){try{return await this.acquire(),await e()}finally{this.release()}}setLimit(e){this.capacity=e}}(2),Mu=async({apiUrl:e,surveyId:t,uploadId:r,etags:n,headers:s,responseGroupUuid:i,replayDuration:a,eventDigest:o},l=!1)=>{var u;if(!l&&!r&&!n)return void _.error("UploadErr",{isMobile:l,uploadId:r,etags:n});_.info("MarkUploadComplete",{surveyId:t});const c=await Ge(`${e}/sdk/1/completeSessionReplay`,{method:"POST",body:JSON.stringify({etags:n,uploadId:r,responseGroupUuid:i,surveyId:t,replayDuration:a,eventDigest:o,userAgent:(u=window==null?void 0:window.navigator)==null?void 0:u.userAgent}),headers:s,shouldRetryRequest:!0});return _.info("MarkUploadDone",{surveyId:t}),c},bg=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},Uu=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=bg(r)}return"/"+t.reverse().map(r=>r.position!==null?`/${r.name}[${r.position}]`:`/${r.name}`).join("")},lo=e=>e&&e.trim().substring(0,500).replace(/\s\s+/g," ").replace(/\r?\n|\r/g," ").substring(0,250),Tu=(e,t)=>{let r;return n=>{clearTimeout(r),r=window.setTimeout(()=>e(n),t)}},We={capture:!0,passive:!0},Sg=["a","button","input","option","li","link"],Ig=["Escape","Enter","Backspace","F5","Tab"];let Mn=!1,xe=null,hn=null;const ll=e=>{var r;if(((r=e.tagName)==null?void 0:r.toLowerCase())==="html")return{element:"html"};const t={};return t.element=(n=>{if(!n.tagName)return"No tagName";const s=n.getAttribute("type");return s?`${s} ${n.tagName.toLowerCase()}`:n.tagName.toLowerCase()})(e),t},Cg=e=>{var n;if(!e)return{};const t={...ll(e)},r=e.parentElement;if(r&&Sg.includes((n=r.tagName)==null?void 0:n.toLowerCase())){const s=ll(r);Object.assign(t,s)}return t},Du=(e,t)=>{var s,i;let r=t.target;var n;t.target===((s=window.document)==null?void 0:s.body)&&window.Sprig.pointerDownTarget&&(r=window.Sprig.pointerDownTarget),n={x:t.x,y:t.y,type:e,elementAttributes:Cg(r),windowHeight:window.innerHeight,windowWidth:window.innerWidth,...r instanceof HTMLElement||r instanceof SVGElement||r instanceof MathMLElement?{rect:r==null?void 0:r.getBoundingClientRect(),xPath:Uu(r)}:{}},(i=n==null?void 0:n.elementAttributes)!=null&&i.text&&(n.elementAttributes.text=lo(n.elementAttributes.text)),xe==null||xe("Sprig_Click",n)},Pu=e=>{var t;Ig.includes(e.key)&&(t={key:e.key},xe==null||xe("Sprig_Keystroke",t))},kg=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("reload")&&(e={url:window.location.href,currentPageTitle:document.title},xe==null||xe("Sprig_Refresh",e))},Eg=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("back_forward")&&((e={curUrl:window.location.href,fromUrl:document.referrer,currentPageTitle:document.title}).currentPageTitle&&(e.currentPageTitle=lo(e.currentPageTitle)),xe==null||xe("Sprig_BackForward",e))},_u=Tu(e=>{if(!(e.target instanceof HTMLElement||e.target instanceof Document))return;let t=e.target;"scrollTop"in t||(t=t.documentElement),hn==null||hn({xPath:Uu(t),x:t.scrollLeft,y:t.scrollTop,elementAttributes:{targetScrollWidth:t.scrollWidth,targetClientWidth:t.clientWidth,targetScrollHeight:t.scrollHeight,targetClientHeight:t.clientHeight}})},750),Nu=(cl="left_click",e=>Du(cl,e));var cl;const Fu=e=>{e.button===2&&Du("right_click",e)},Bu=e=>{window.Sprig&&(window.Sprig.pointerDownTarget=e.target)},pe={isRecording:!1,scrollEventUuids:{},stopRecording:()=>{}},zu=()=>window.indexedDB&&window.IDBKeyRange&&window.CompressionStream,be=(()=>{const e=ue.getItem("sprig.sessionId");if(e)return _.info("SessionIDFound",{savedSessionId:e}),ue.removeItem("sprig.sessionId"),e;const t=vt();return _.info("GeneratedSessionID",{uuid:t}),t})(),Ei=()=>{ue.setItem("sprig.disableReplayRecording","disabled")},He=()=>!!ue.getItem("sprig.disableReplayRecording"),Un=()=>!!ue.getItem("sprig.isReplayPaused");window.addEventListener("beforeunload",()=>{_.info("BeforeUnload",{sessionId:be}),ue.setItem("sprig.sessionId",be)});const Je=(e,t)=>{var r,n;if(!He()&&pe.isRecording&&!Un())try{(n=(r=window.rrwebRecord)==null?void 0:r.addCustomEvent)==null||n.call(r,e,t)}catch(s){br("Error recording custom event",s)}},xg=async e=>{const{x:t,xPath:r,y:n}=e,s=pe.scrollEventUuids[r];if(s)return Ee(async()=>{var o,l,c,u;const i=await Q.openDB(),a=await i.get("events",s);if(a!=null&&a.event){const d=JSON.parse(a.event),h=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(!h&&!f)return null;h&&(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 Je("Sprig_Scroll",e)},"Error updating scroll event");Je("Sprig_Scroll",e)},ju=()=>{pe.stopRecording&&(pe.stopRecording(),pe.stopRecording=void 0),pe.isRecording=!1,["cleanupInterval","inactivityInterval","pendingCheckInterval"].forEach(e=>{pe[e]&&(clearInterval(pe[e]),pe[e]=void 0)}),Mn&&(window.removeEventListener("click",Nu,We),window.removeEventListener("pointerdown",Bu,We),window.removeEventListener("mousedown",Fu,We),window.removeEventListener("keydown",Pu,We),window.removeEventListener("scroll",_u,We),Mn=!1),ao.forEach(e=>{var t;(t=e.source)==null||t.postMessage({type:vg},{targetOrigin:e.origin})})},Rg=["did not allow mutations","called in an invalid security context"],Lg=(e,t,{reportError:r=!0,extraInfo:n={}})=>{if(!He()&&t instanceof Error){if(Ei(),t.name==="VersionError")return _.error("VersionErr",{message:e}),void Q.deleteDB();(s=>{if(!s)return!0;for(const i of Rg)if(s.toLowerCase().includes(i))return!1;return!0})(t==null?void 0:t.message)&&(r&&window.UserLeap.reportError(e,t,n),Q.clearAll())}},br=(e,t,{reportError:r}={reportError:!0})=>{ju(),_.error("ReplayErr",{code:t.code,name:t.name}),Lg(e,t,{reportError:r})},Ee=async(e,t)=>{try{return await e()}catch(r){br(t,r)}},xi=()=>{pe.isRecording&&(Ee(()=>{var e,t;return(t=(e=window.rrwebRecord)==null?void 0:e.takeFullSnapshot)==null?void 0:t.call(e,!0)},"Error recording full snapshot"),ao.forEach(e=>{var t;(t=e.source)==null||t.postMessage({type:wg},{targetOrigin:e.origin})}))};let Ss=0;(async()=>zu()&&Promise.allSettled([Ci("replayStorage"),Ci("sprig.replay")]))();const Q=new class{constructor(){de(this,"wrapTransactionWithCounter",e=>{var n,s;const t=(s=(n=window.Sprig)==null?void 0:n._config)==null?void 0:s.outstandingTransactionLimit,r=t===void 0?100:t;if(r&&Ss>r){const i="Too many outstanding transactions";br(i,new Error(i),{reportError:!1})}Ss++,e.done.finally(()=>{Ss--})});de(this,"getTransaction",async e=>{const t=(await this.openDB()).transaction(e,"readwrite");return this.wrapTransactionWithCounter(t),t})}openDB(){return function(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const a=indexedDB.open(e,t),o=lt(a);return n&&(a.onupgradeneeded=l=>{n(lt(a.result),l.oldVersion,l.newVersion,lt(a.transaction),l)}),r&&(a.onblocked=l=>r(l.oldVersion,l.newVersion,l)),o.then(l=>{i&&(l.onclose=()=>i()),s&&(l.onversionchange=c=>s(c.oldVersion,c.newVersion,c))}).catch(()=>{}),o}("sprigReplay",1,{upgrade:(e,t,r)=>{if(r===0&&ue.setItem("sprig.pendingCount","0"),!e.objectStoreNames.contains("events")){const n=e.createObjectStore("events",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+timestamp]",["sessionId","timestamp"])}if(!e.objectStoreNames.contains("chunkUploads")){const n=e.createObjectStore("chunkUploads",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+status]",["sessionId","status"]),n.createIndex("[uploadId+status]",["uploadId","status"]),n.createIndex("[sessionId+status+uploadId]",["sessionId","status","uploadId"])}if(!e.objectStoreNames.contains("pendingCaptures")){const n=e.createObjectStore("pendingCaptures",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+targetTimestamp]",["sessionId","targetTimestamp"])}}})}async deleteDB(){try{await Ci("sprigReplay")}catch{}}async bulkAdd(e,t){const r=await this.getTransaction(e);return Promise.all([...t.map(n=>r.store.add(n)),r.done])}async clearAll(){const e=(await this.openDB()).transaction(["events","chunkUploads","pendingCaptures"],"readwrite");return this.wrapTransactionWithCounter(e),Promise.all([e.objectStore("events").clear(),e.objectStore("chunkUploads").clear(),e.objectStore("pendingCaptures").clear()])}async deleteBySessionId(e,t){const r=IDBKeyRange.only(t),n=await this.getTransaction(e),s=n.store.index("sessionId");for await(const i of s.iterate(r))await i.delete();await n.done}async updatePartial(e,t,r){const n=await this.getTransaction(e),s=await n.store.get(t);s&&await n.store.put({...s,...r}),await n.done}async deleteRowsBefore(e,t,r=()=>!0){const n=IDBKeyRange.upperBound(t,!0),s=await this.getTransaction(e),i=s.store.index("timestamp");for await(const a of i.iterate(n))r(a.value)&&await a.delete();await s.done}async getEventsBetween(e,t=Date.now()){if(e>=t)return Promise.resolve([]);const r=IDBKeyRange.bound([be,e],[be,t],!1,!0);return(await this.openDB()).getAllFromIndex("events","[sessionId+timestamp]",r)}async updateEventsExpiredAt(e,t,r=30){const n=new Date,s=n.setMinutes(n.getMinutes()+(r??30)),i=await this.getTransaction("events"),a=i.store.index("[sessionId+timestamp]"),o=IDBKeyRange.bound([be,e],[be,t],!1,!0);for await(const l of a.iterate(o))await l.update({...l.value,expiredAt:s});await i.done}async deleteChunkUploads(e,t){const r=IDBKeyRange.only([t,e]),n=await this.getTransaction("chunkUploads");let i=await n.store.index("[uploadId+status]").openCursor(r);for(;i;)i.delete(),i=await i.continue();await n.done}async getChunkUploadsByStatus({sessionId:e,status:t,uploadId:r}){const n=(await this.openDB()).transaction("chunkUploads","readonly");this.wrapTransactionWithCounter(n);const s=r?n.store.index("[uploadId+status]"):n.store.index("[sessionId+status]"),i=r?IDBKeyRange.only([r,t]):IDBKeyRange.only([e,t]);return s.getAll(i)}async getPendingCaptures(e={}){return(await(await this.openDB()).getAllFromIndex("pendingCaptures","sessionId",be)).filter(r=>!e.beforePresent||r.targetTimestamp<Date.now()).filter(r=>!e.isBeforeType||r.captureParams.replayParams.replayDurationType==="before").filter(r=>!e.isHeatmap||(r.captureParams.isHeatmap??!1))}async markPendingCaptureToCanUpload(e){const t=await this.getTransaction("pendingCaptures"),r=t.store.index("sessionId");for await(const n of r.iterate(be)){const s=n.value;s.captureParams.responseGroupId===e&&await n.update({...s,canUpload:!0})}await t.done}async markPendingHeatmapsReady(e){if(parseInt(ue.getItem("sprig.pendingCount")??"0")===0)return null;const t=Date.now(),r=await this.getTransaction("pendingCaptures"),n=r.store.index("sessionId");for await(const s of n.iterate(be)){const i=s.value;!i.captureParams.isHeatmap||e&&!e.includes(i.uuid)||await s.update({...i,targetTimestamp:t,captureParams:{...i.captureParams,triggerTimestamp:t,replayParams:{...i.captureParams.replayParams,replayDurationSeconds:Math.floor((t-i.timestamp)/1e3)}}})}await r.done}},Qe=[];let Sr,Wu,gt=[],Dt=!1,Tt=0,mn=!1,Vu=!1;const co=[];let Tn,Gu,fn,Hu,Is=!1;const Pt=()=>mn&&!Dt&&Date.now()<=Tn,Og=({apiUrl:e,config:t,triggerSnapshot:r,forceInit:n=!1})=>{mn&&!n||(ue.isStorageAvailable?(gt=[],co.splice(0),Qe.splice(0),Tt=0,fn=r,Wu=e,Sr={responseGroupUuid:t.responseGroupUuid,surveyId:t.surveyId,userAgent:t.userAgent,sdkVersion:t.sdkVersion},Gu=t.maxDurationSeconds,Tg(),mn||(Hu=window.setInterval(Ug,500)),mn=!0):Dt=!0)},Ag=[Ye.Drag,Ye.Input,Ye.MediaInteraction,Ye.MouseInteraction,Ye.MouseMove,Ye.Scroll,Ye.Selection,Ye.TouchMove],Mg=e=>e.type===at.Custom||e.type===at.IncrementalSnapshot&&Ag.includes(e.data.source),uo=e=>e.some(Mg),Ug=async()=>{if(!Pt())return void window.clearInterval(Hu);if($u(),!uo(Qe))return;const e=Qe[0].timestamp;Date.now()-e>35e3&&(fn==null||fn())},$u=async()=>{if(gt.length||Is)return;Is=!0;const e=await Pg();if(!e)return void(Dt=!0);co.splice(0,e.length).forEach(t=>t(e.shift())),e.forEach(t=>gt.push(t)),Is=!1},Tg=()=>{const e=ue.getItem("sprig.alwayson.info");if(e){_.info("Read stored session state",e);const t=JSON.parse(e);Dt=t.disabled,Sr=t.metadata,gt=t.uploadUrls,Tt=t.currentIndex,Tn=t.expirationTimestamp,t.pendingEventTimestamp&&(_.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`),Dg(t.pendingEventTimestamp))}else Tn=1e3*Gu+Date.now()},Dg=async e=>{const t=Date.now(),r=(await Q.getEventsBetween(e,t)).map(s=>JSON.parse(s.event));if(!uo(r))return;Ku(r);const n=await Ju();n&&await qu(n,r)},Yu=async(e,t)=>{try{const r=await e();if(!r.ok)throw new Error(`Error ${t}`);return r}catch{Dt=!0}},qu=async(e,t)=>{if(!Pt()||!e)return;const r=await(async n=>{const s=new TextEncoder,i=new CompressionStream("gzip"),a=i.writable.getWriter(),o=s.encode(JSON.stringify(n));return a.write(o),a.close(),new Uint8Array(await new Response(i.readable).arrayBuffer())})(t);_.info("Uploading always-on events with presigned url"),await Yu(()=>Ge(e,{body:r,method:"PUT"}),"uploading always-on with presigned url")},Pg=async()=>{if(!Pt())return;const{surveyId:e,responseGroupUuid:t}=Sr,r={responseGroupUuid:t,surveyId:e,index:Tt+1};_.info("Fetching always-on upload urls",r);const n=await Yu(()=>Ge(`${Wu}/sdk/1/replayUrls`,{method:"POST",body:JSON.stringify(r),headers:De(window.UserLeap)}),"fetching always-on signed urls");if(!n)return;const s=n.json.signedUrls;return _.info("Fetched more always-on upload urls",{body:r,urls:s}),s},Ju=async()=>{if(gt.length)return gt.shift();const e=new Promise(t=>{co.push(t)});return $u(),e},Ku=e=>{var s,i,a;const t=e.length?e[e.length-1].timestamp:Date.now(),r=Tt,n=((i=(s=window.UserLeap)==null?void 0:s.config)==null?void 0:i.customMetadata)??((a=window.__cfg)==null?void 0:a.customMetadata);Tt++,e.push({timestamp:t,type:at.Custom,data:{tag:"Sprig_Meta",payload:{...Sr,index:r,visitorId:window.UserLeap.visitorId??"",timestamp:t,customMetadata:n}}})},_g=(e,t)=>{Pt()&&!Vu&&(e||Qe.length)&&(e&&Qe.length&&(async()=>{const r=Qe.splice(0);if(!uo(r))return;_.info("Capturing always-on event array to upload"),Ku(r);const n=await Ju();n&&await qu(n,r)})(),Qe.push(t))};window.addEventListener("beforeunload",async()=>{Vu=!0,Pt()&&(_.info("Always On handle page unload"),(()=>{let e;Qe.length&&(e=Qe[0].timestamp);const t={disabled:Dt,metadata:Sr,uploadUrls:gt,currentIndex:Tt,pendingEventTimestamp:e,expirationTimestamp:Tn};_.info("Storing session state on unload",t),ue.setItem("sprig.alwayson.info",JSON.stringify(t))})())});const Xu=async(e,t)=>{const r=performance.now();let n;try{n=await e()}finally{const s=performance.now()-r;let i=vr[t];i||(i=Ve(t)),i.report(s/1e3)}return n},Zu=(e,t)=>{const r=performance.now();try{e()}finally{const n=performance.now()-r;let s=vr[t];s||(s=Ve(t)),s.report(n/1e3)}};let Qu=5e3,Ri=6e4,Li=0,ct,Oi=!1,Ai=[];const Ng=e=>{var t,r,n,s;if((t=e.event)!=null&&t.includes("Sprig_Scroll")){const i=(s=(n=(r=JSON.parse(e.event))==null?void 0:r.data)==null?void 0:n.payload)==null?void 0:s.xPath;if(!i)return;pe.scrollEventUuids[i]=e.uuid}Ai.push(e),Oi||Fg()},Fg=()=>{Oi=!0,setTimeout(async()=>{if(He()||Un())return;const e=Ai;Ai=[],Oi=!1,Zu(async()=>{await(async t=>{const r=t.map(n=>({...n,sessionId:n.sessionId??be}));if(r.length!==0)return Ee(()=>Q.bulkAdd("events",r),"Error storing replay events")})(e)},"sdk_replay_add_event_batch_seconds")},500)},Bg=(e,t,r)=>{pe.cleanupInterval=window.setInterval(()=>{const n=Date.now();Xu(()=>Ee(async()=>{He()||await Promise.all([Q.deleteRowsBefore("events",n-1e3*e,s=>s.expiredAt===void 0||s.expiredAt<n-1e3*e),Q.deleteRowsBefore("chunkUploads",n-1e3*t),Q.deleteRowsBefore("pendingCaptures",n-1e3*r,s=>!s.canUpload)])},"Error deleting table rows"),"sdk_replay_cleanup_seconds"),_.debug("CleanupComplete")},3e4)},zg=()=>{pe.pendingCheckInterval=window.setInterval(async()=>{Ee(async()=>{await Mi()},"Error initiating pending captures")},5e3)};let Cs=!1;const Mi=async(e=!1)=>{if(!Cs)try{Cs=!0;const t=parseInt(ct??"0");if(t===0)return;const r=await Q.getPendingCaptures({beforePresent:!0,isBeforeType:e}),n=await Q.openDB();await Promise.all(r.map(async s=>(await n.delete("pendingCaptures",s.uuid),rd(s.captureParams,s.canUpload)))),ct=(t-r.length).toString(),ue.setItem("sprig.pendingCount",ct)}finally{Cs=!1}},jg=async(e,t,r,n,s)=>{const i=Math.min(e+s,r),a=await Xu(()=>Q.getEventsBetween(e,i),"sdk_replay_get_events_between_seconds");if(!(a!=null&&a.length))return _.debug("NoEventsFound"),{validStartFound:n,events:[]};if(!n){_.debug("ValidStartSearch");let o=-1;return a==null||a.forEach((l,c)=>{if(!l.isValidStart)return;const u=l.timestamp<=t;(o<0||u)&&(o=c)}),o<0?(_.debug("ValidStartNotFound"),{validStartFound:n,events:[]}):{validStartFound:!0,events:a==null?void 0:a.slice(o)}}return{validStartFound:n,events:a}},ed=e=>Promise.all(e.map(async t=>{const r=await(async n=>Au.execute(async()=>{var a;_.info("UploadChunkStart",{chunkIndex:n.chunkIndex,surveyId:n.surveyId});const s=await Ge(n.uploadUrl,{body:n.data,method:"PUT"});_.http("UploadChunkEnd",{url:n.uploadUrl,method:"PUT",status_code:s.status,reason:s.statusText??"OK",chunkIndex:n.chunkIndex,surveyId:n.surveyId});const i=(a=s.headers)==null?void 0:a.get("ETag");if(!i)throw new Error(`Upload response did not include etag for upload ${n.uploadId}, part ${n.chunkIndex}`);return i}))(t);return await Q.updatePartial("chunkUploads",t.uuid,{data:null,etag:r,status:"UploadComplete"}),t.uploadId})),td=async e=>{const t=await Q.getChunkUploadsByStatus({status:"UploadComplete",uploadId:e});if(!(t!=null&&t.length))return void _.info("NoChunksForUpload",{uploadId:e});const r=t.reduce((i,a)=>(i.find(o=>o.chunkIndex===a.chunkIndex)||i.push(a),i),[]);r.sort((i,a)=>i.chunkIndex-a.chunkIndex);const n=r.map(i=>({ETag:i.etag,PartNumber:i.chunkIndex})).filter(i=>i.ETag!==null),s=r[0];await Mu({apiUrl:s.apiUrl,surveyId:s.surveyId,uploadId:e,responseGroupUuid:s.responseGroupId,etags:n,headers:s.completeUploadHeaders,replayDuration:s.replayDuration}),await Q.deleteChunkUploads("UploadComplete",e)},Wg=()=>{Ee(async()=>{const e=await Q.getChunkUploadsByStatus({sessionId:be,status:"ReadyForUpload"});if(!(e!=null&&e.length))return;const t=await ed(e);t!=null&&t.length&&await Promise.all(t.map(r=>{if(r)return td(r)}))},"Error uploading unfinished chunks")},Vg=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,h]=[0,0],f=[];for(let p=n-35e3;p<s;p+=Ri){if({validStartFound:u,events:f}=await jg(p,n,s,u,Ri),!(f!=null&&f.length)){_.debug("NoEventsFound");continue}d===0&&(d=f[0].timestamp),h=f[f.length-1].timestamp;const I=f.map(b=>b.event);I.push(`{"timestamp":${s}}`);const m=`${c?",":"["}${I}`,g=i.encode(m);Zu(()=>{l.write(g)},"sdk_replay_compression_seconds"),c=!0}if(h-d<Qu)return _.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)},ul=async e=>{const{surveyId:t,responseGroupId:r,visitorId:n,apiUrl:s,completeUploadHeaders:i,replayParams:a,triggerTimestamp:o}=e,l=await Vg(1e3*a.replayDurationSeconds,o);if(!(l!=null&&l.length))return void _.info("FileDataEmpty",{surveyId:t});const c=((d,h,f)=>{const v=d.length,p=1024*h*1024,I=Math.ceil(v/f),m=Math.max(p,I),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,h)=>{const f=vt(),v={apiUrl:s,chunkIndex:h+1,completeUploadHeaders:i,etag:null,responseGroupId:r,status:"ReadyForUpload",surveyId:t,timestamp:o,totalChunks:c.length,data:d,uploadId:a.uploadId,uploadUrl:a.signedUrls[h].url,uuid:f,visitorId:n};return await(await Q.openDB()).add("chunkUploads",{...v,sessionId:v.sessionId??be}),v}));await(async(d,h)=>{await ed(h),await Promise.all(d.map(f=>td(f)))})([a.uploadId],u)},rd=async(e,t)=>{if(He())return _.debug("ReplayDisabled-ScheduleOrCapture");const{isHeatmap:r,isStandalone:n,replayParams:s,triggerTimestamp:i,responseGroupId:a}=e,o=async()=>{setTimeout(()=>z.removeListener(F.QuestionAnswered,o),0),Ee(async()=>{s.replayDurationType==="before"?await ul(e):await Q.markPendingCaptureToCanUpload(a)},"Error in schedule/capture callback")};Ee(async()=>{if(s.replayDurationType==="after"||s.replayDurationType==="beforeAndAfter")return!n&&!r&&z.on(F.QuestionAnswered,o),void await sd(e);if(n||r||t)await ul(e),r&&Gg();else{const l=35+s.replayDurationSeconds,c=i-1e3*l,u=i;await Q.updateEventsExpiredAt(c,u,s.expirationTimeLimitMinutes),z.on(F.QuestionAnswered,o)}},"Error in scheduling/capturing replay")},Gg=async()=>{parseInt(ct??"0")||ue.removeItem("sprig.isCapturingHeatmap"),ue.getItem("sprig.teardownAfterCapture")&&(ju(),nd(),ue.removeItem("sprig.teardownAfterCapture"))},nd=async()=>He()?_.debug("ReplayDisabled-ClearData"):Promise.all([Q.deleteBySessionId("events",be),Q.deleteBySessionId("pendingCaptures",be)]).catch(e=>{br("Error clearing user replay data",e)}),sd=async e=>{if(He())return;const{isHeatmap:t,surveyId:r}=e,n=await Q.getPendingCaptures(),s=n==null?void 0:n.filter(l=>l.captureParams.surveyId===r);if(s!=null&&s.length)return void _.info("PendingCaptureExists",{surveyId:r});t&&(xi(),ue.setItem("sprig.isCapturingHeatmap","true"),Li=Date.now(),pe.inactivityInterval||(pe.inactivityInterval=window.setInterval(()=>{var l;l=Li,Date.now()-l>=3e4&&Ee(()=>Q.markPendingHeatmapsReady(),"Error in heatmap inactivity")},1e3)));const i={...e,replayParams:{...e.replayParams}};e.replayParams.replayDurationType==="beforeAndAfter"&&(i.replayParams.replayDurationSeconds*=2),i.replayParams.replayDurationType="before";const a=e.triggerTimestamp+1e3*e.replayParams.replayDurationSeconds;i.triggerTimestamp=a,ct=(parseInt(ct??"0")+1).toString(),ue.setItem("sprig.pendingCount",ct),await(await Q.openDB()).add("pendingCaptures",{canUpload:!1,captureParams:i,sessionId:be,targetTimestamp:a,timestamp:Date.now(),uuid:vt()})},Hg=Object.freeze(Object.defineProperty({__proto__:null,RecordEvent:e=>{Je("Sprig_TrackEvent",e)},RecordPageView:e=>{e.description&&(e.description=lo(e.description)),Je("Sprig_PageView",e)},RecordSurveyShown:e=>{Je("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 Mu({surveyId:e,responseGroupUuid:t,eventDigest:r,apiUrl:s,headers:n},!0);return!(i!=null&&i.error)},checkPendingHeatmapsUrl:()=>He()?_.debug("ReplayDisabled-PendingHeatmaps"):Ee(async()=>{const e=(await Q.getPendingCaptures({isHeatmap:!0})).map(t=>({eventId:t.captureParams.eventId,uuid:t.uuid})).filter(({eventId:t})=>!uu(t)).map(({uuid:t})=>t);return _.info("PendingHeatmapsToComplete",{count:e.length}),e.length&&(await Q.markPendingHeatmapsReady(e),_.info("MarkedPendingHeatmapsReady")),e.length},"Error marking pending heatmaps ready"),clearUserReplayData:nd,disableRecording:br,initializeReplay:async({maxReplayDurationSeconds:e,maxInflightRequests:t=2,replaySettings:r,teardownAfter:n=!1,apiUrl:s,alwaysOnConfig:i})=>{if(i&&Og({apiUrl:s,config:i,triggerSnapshot:()=>{xi()}}),ct=ue.getItem("sprig.pendingCount"),pe.isRecording)return;if(n&&ue.setItem("sprig.teardownAfterCapture","true"),He())return _.debug("ReplayDisabled");if(await(async()=>{var l;if(!zu())return!0;if((l=window.navigator.storage)!=null&&l.estimate)try{const{quota:c=0,usage:u=0}=await window.navigator.storage.estimate(),d=(c-u)/1024**3;return _.info("Storage",{availableGb:d}),d<.5}catch{return!0}return!1})())return _.debug("IDBNotSupported"),Ei();try{const l=await Q.openDB();_.info("DBVersion",{version:l.version})}catch(l){return _.error("ReplayOpenErr",{name:l.name}),l.name==="VersionError"&&Q.deleteDB(),Ei()}Ee(async()=>{await Mi(!0)},"Error uploading ready pending captures");const a=Pt()?30:0,o=Math.max(e??0,a);if(!o)return _.debug("MissingDuration");_.debug("ReplayInit"),await Ee(async()=>{var l;r!=null&&r.minDuration&&(Qu=r.minDuration),r!=null&&r.batchDuration&&(Ri=r.batchDuration),l=t,Au.setLimit(l),Wg(),Bg(o+35,1800,o+35),zg();const c=window.UserLeap.replayLibraryURL??"https://cdn.sprig.com/dependencies/record.min.js",u=window.rrwebRecord;if(!u)return _.error("RecordScriptFailed");let d=!0,h=0;const f={checkoutEveryNms:3e4,sampling:{input:"last",scroll:250,media:800},...r,mutationQueueEnabled:r==null?void 0:r.enableMutationQueue};var v,p;pe.stopRecording=u({emit:(I,m)=>{if(I.type===at.Custom&&(Li=Date.now()),He()||Un())return;if(m&&I.type===at.Meta)h=performance.now();else if(m&&h&&I.type===at.FullSnapshot){const b=performance.now()-h;wu("sdk_replay_snapshot_seconds",b/1e3)}const g=d||!!m&&I.type===at.Meta;d=!1,_g(g,I),Ng({uuid:vt(),event:JSON.stringify(I),isValidStart:g,timestamp:Date.now()})},...f}),pe.isRecording=!!pe.stopRecording,pe.isRecording&&(((I,m)=>{window.addEventListener("message",g=>{var b;g.data.type===gg&&(ao.push({source:g.source,origin:g.origin}),(b=g.source)==null||b.postMessage({type:yg,settings:I,replayLibraryUrl:m},{targetOrigin:g.origin}))})})(f,c),z.on("survey.complete",I=>{var m;m={id:I,userAgent:window.navigator.userAgent},Je("Sprig_SubmitSurvey",m)}),v=Je,p=xg,Mn||(xe=v,hn=p,window.addEventListener("click",Nu,We),window.addEventListener("pointerdown",Bu,We),window.addEventListener("mousedown",Fu,We),window.addEventListener("keydown",Pu,We),window.addEventListener("scroll",_u,We),Mn=!0,kg(),Eg()))},"Error initializing replay")},isReplayPaused:Un,isReplayRecording:()=>pe.isRecording,recordFullSnapshot:xi,recordReplayPaused:()=>{Je("Sprig_ReplayPaused",{timestamp:Date.now()}),ue.setItem("sprig.isReplayPaused","true")},recordReplayResumed:()=>{ue.removeItem("sprig.isReplayPaused"),Je("Sprig_ReplayResumed",{timestamp:Date.now()})},scheduleCapture:sd,scheduleOrCaptureReplay:rd,tryReplayAction:Ee,uploadReadyPendingCaptures:Mi},Symbol.toStringTag,{value:"Module"}));(e=>{re.replay=e})(Hg),window.UpChunk={createUpload:Gd},window.rrwebRecord=qt,exports.APP_ID="ul-app",exports.ConflictingWidgets=Qc,exports.DEFAULT_BORDER_COLOR="#e6e6e6",exports.DEFAULT_WIDTH_PX=360,exports.DismissReason=Me,exports.EMBED_MOBILE_MAX_WIDTH=1030,exports.ERROR_BORDER_COLOR="#bd282a",exports.SprigAPI=wi,exports.SprigEvent=F,exports.breadcrumbsLogger=_,exports.calculateFrameDimensions=du,exports.debounce=Tu,exports.eventEmitter=z,exports.getHtml=Jn,exports.groupCards=(e,t)=>{const r=[e[t]],n=e[t].groupId;return n?e.slice(t).reduce((s,i)=>(i.groupId===n&&s.push(i),s),[]):r},exports.isHTMLElement=qe,exports.isLongFormSurvey=e=>e==="longFormSurvey",exports.resetScrollPosition=e=>{const t=e.querySelector(".ul-card__container");t&&(t.scrollTop=0)},exports.setSurveyStyles=fr,exports.shouldDirectEmbed=to,exports.sprig=lg,exports.sprigFetch=Ge,exports.v4=vt;
66
+ </svg>`,(r=window.UserLeap._config)==null?void 0:r.enableCspTrustedTypes);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},hi=new class{constructor(){de(this,"_ldData",{})}getAllLaunchDarklyVariations(){return this._ldData}setLDFlagsVariations(e){try{return!(!e||typeof e!="object"||Array.isArray(e))&&(Object.keys(this._ldData).forEach(t=>{delete this._ldData[t]}),Object.keys(e).forEach(t=>this._ldData[`!launch_darkly_${t}`]=(e[t]??0)+1),!0)}catch(t){return t instanceof Error&&window.UserLeap.reportError("setAllLDFlagsVariations",t),console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."),!1}}};Object.freeze(hi);const pn=new class{constructor(){de(this,"_optimizelyData",{})}setOptimizelyExperiment(e,t=!0){if(!e||typeof e!="object")return!1;const{experiments:r}=e;try{return t&&Object.keys(this._optimizelyData).map(n=>{delete this._optimizelyData[n]}),r&&r.map(n=>{const{id:s,variation:i}=n,a=this.transformExperimentId(s);i&&typeof i=="string"&&(this._optimizelyData[a]=i)}),!0}catch(n){return n instanceof Error&&window.UserLeap.reportError("setOptimizelyExperiment",n),!1}}getAllOptimizelyExperiments(){return this._optimizelyData}getOptimizelyVariationName(e){return this._optimizelyData[this.transformExperimentId(e)]}transformExperimentId(e){return"!optimizely_experiments_"+e}getAndSetWebOptimizelyExperiments(){var e;try{if(window&&window.optimizely&&typeof window.optimizely.get=="function"){const t=(e=window.optimizely.get("state"))==null?void 0:e.getExperimentStates({isActive:!0});if(t){const r=Object.keys(t).map(n=>{var s,i;return(s=t[n].variation)!=null&&s.name?{id:n,variation:(i=t[n].variation)==null?void 0:i.name}:{id:n,variation:"Original"}});return this.setOptimizelyExperiment({experiments:r},!1),!0}return!1}return!1}catch(t){return t instanceof Error&&window.UserLeap.reportError("getAndSetWebOptimizely",t),!1}}};Object.freeze(pn);class Hf{constructor(t,r){de(this,"paused");de(this,"queue");de(this,"ul");this.ul=t,this.paused=!1,this.queue=[],this.flush(r)}flush(t){const r=t.length;if(r)for(let n=0;n<r;n++)this.push(t[n])}isPaused(){return this.paused}pause(){this.paused=!0}unpause(){this.paused=!1;const t=this.queue.slice();this.empty(),this.flush(t)}push(t){if(this.paused)this.queue.push(t);else if(t instanceof Function)t();else{const r=Array.prototype.slice.call(t,1),n=t[0],s=this.ul[n];s instanceof Function?s.apply(this.ul,r):n&&console.warn("[Sprig] (ERR-100) No valid UserLeap action called",n)}}perform(t){if(this.paused){let r=()=>{};const n=new Promise(function(s){r=function(){s(t())}});return this.queue.push(r),n}return t()}empty(){this.queue.length=0}}let yu=!0,mi=!1;const $f=["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 fi,Kt={};class Yf{constructor(t){de(this,"_values",[]);de(this,"_isWebMetric");this.name=t,this._isWebMetric=$f.includes(this.name)}report(t){if(yu&&this._values.push({time:Date.now(),value:t}),mi||!this._isWebMetric)return;const r=this.findExceededThreshold(t);r&&fi&&fi(t,r)}collect(){const t=this._values;return this._values=[],t}findExceededThreshold(t){const r=Kt[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 vr={},We=e=>{const t=new Yf(e);return vr[e]=t,t},wu=(e,t)=>{let r=vr[e];return r||(r=We(e)),r.report(t)},qf=({reportingIntervalSeconds:e,postMetrics:t})=>{e?setInterval(()=>{(async r=>{const n=Object.values(vr).map(s=>({name:s.name,values:s.collect()}));if(n.some(s=>s.values.length))try{await r(JSON.stringify(n))}catch(s){s instanceof Error&&_.error("MetricsErr",{error:{message:s.message,name:s.name}})}})(t)},1e3*e):yu=!1};let vu,bu;const gi=e=>{let t=0,r=e.firstElementChild;for(;r;)t+=gi(r),r.shadowRoot&&(t+=gi(r.shadowRoot)),r=r.nextElementSibling,t++;return t},el=()=>{vu.report(gi(document.body)),bu.report(document.documentElement.innerHTML.toString().length)},yi=(e,t)=>{const r=performance.now();document.hidden?setTimeout(()=>yi(e,t),e):setTimeout(()=>{const n=performance.now()-r;t.report(n/1e3),setTimeout(()=>yi(e,t),e)},0)};let En,xn,Rn,Ln,tl,ht={};const qr=(e,t=1)=>{const{name:r}=e;ht[r]=(ht[r]||0)+t},Su=e=>{let t=1;return e.childNodes.forEach(r=>{t+=Su(r)}),t},rl=e=>{let t=0;return e.forEach(r=>{t+=Su(r)}),t},Jf=e=>{switch(e.type){case"childList":return qr(En,rl(e.addedNodes)),void qr(xn,rl(e.removedNodes));case"attributes":return void qr(Rn);case"characterData":return void qr(Ln)}},Kf=e=>e.forEach(Jf),Xf=()=>{En.report(ht[En.name]||0),xn.report(ht[xn.name]||0),Rn.report(ht[Rn.name]||0),Ln.report(ht[Ln.name]||0),ht={}},Zf=(e=1e3)=>{En=We("sdk_mutations_nodes_added"),xn=We("sdk_mutations_nodes_removed"),Rn=We("sdk_mutations_attributes_changed"),Ln=We("sdk_mutations_character_data"),tl=new MutationObserver(Kf),tl.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),setInterval(Xf,e)},Qf=({isWeb:e,reportingIntervalSeconds:t,thresholds:r,postMetrics:n})=>{((s,i)=>{Kt={},mi=!1,s==null||s.forEach(a=>{var o;a.metric in Kt||(Kt[a.metric]=[]),(o=Kt[a.metric])==null||o.push(a)}),fi=i})(r,(s,i)=>{var a,o;if((a=ne.replay)!=null&&a.isReplayRecording()){const l=`Value: ${s} on ${i.metric} violated threshold of ${i.type} ${i.value}`;(o=ne.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}),mi=!0}}),qf({reportingIntervalSeconds:t,postMetrics:n}),e&&(((s=1e3)=>{const i=We("sdk_event_queue_latency_seconds");yi(s,i)})(),((s=1e4)=>{vu=We("sdk_dom_nodes_count"),bu=We("sdk_page_html_characters"),el(),setInterval(el,s)})(),Zf())},eg="test",tg=["popState","pushState","replaceState"];let oo,nr;const On={},Vt="!email",Iu="pageUrl";let ys=window.location.href;function sr(e){var o,l;const{pageUrlEvents:t,interactiveEvents:r,dismissOnPageChange:n,platform:s}=window.UserLeap._config;if(s&&s!=="web")return;ys!==window.location.href&&_.navigation("LocationChange",{from:ys,to:window.location.href}),ys=window.location.href;const i=Eu().trackStartUrl,a=i?String(i):null;t&&Ru(window.location.href),r&&(ku(),rg()),pu()&&(()=>{if(Cn())return;const c=Ot();c&&(uu(rr)||(c.remove(),rr=null,Z=null))})(),Q.getItem("sprig.isCapturingHeatmap")&&((l=(o=ne.replay)==null?void 0:o.checkPendingHeatmapsUrl())==null||l.then(c=>{var u;c&&((u=ne.replay)==null||u.uploadReadyPendingCaptures(!0))})),!Cn()&&n&&a&&a!==window.location.href&&e&&tg.includes(e.type)&&window.UserLeap("dismissActiveSurvey",Ae.PageChange)}const Cu={capture:!0},rg=()=>{const e=window.UserLeap._config.interactiveEvents.filter(r=>so(r,window.location.href)).map(r=>{const{name:n,properties:s}=r,{selector:i,innerText:a}=s;return i?o=>{if(Ka(o.target))try{o.target.closest(i)&&window.UserLeap("track",n)}catch{}return!1}:o=>(Ka(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,Cu)},ku=()=>{window.UserLeap._config.interactiveEventsHandler&&window.removeEventListener("click",window.UserLeap._config.interactiveEventsHandler,Cu),delete window.UserLeap._config.interactiveEventsHandler};function Eu(){const e=ct.getItemObject("userleap.ids");return e&&e[window.UserLeap.envId]||{}}function xu(){if(window.previewMode)return;const e=ct.getItemObject("sprig.anon.env.vid.map")||{},t=e[window.UserLeap.envId];window.UserLeap.visitorId=t||vt(),_.info("NewVid",{vid:window.UserLeap.visitorId}),Ce("vid",window.UserLeap.visitorId),t||(e[window.UserLeap.envId]=window.UserLeap.visitorId,ct.setItemObject("sprig.anon.env.vid.map",e)),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId})}function Ru(e,t,r,n){var s,i;try{if(e.endsWith("mock_snippet.html"))return;_.info("PageView",{url:e});const a=(s=document==null?void 0:document.querySelector('meta[name="description"]'))==null?void 0:s.getAttribute("content");(i=ne.replay)==null||i.RecordPageView({...a&&{description:a},url:e,referrer:document.referrer,pageTitle:document.title});const o=window.UserLeap._config.pageUrlEvents;let l=!1;if(o&&o.length)for(let u=0;u<o.length&&(l=so(o[u],e),!l);u++);if(!l)return;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig trackPageView",e);const c={url:e};n&&(c.trackPageView=!0),window.UserLeap._queue.push(["track",Iu,t,c,r])}catch(a){a instanceof Error&&(a.stack=e,window.UserLeap.reportError("trackPageView",a)),console.warn("[Sprig] (ERR-428) Failed to track page view",a)}}function ng(){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),sr(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),sr(s),n})(e.replaceState)),["hashchange","popstate"].forEach(t=>window.addEventListener(t,sr,!0))}async function ws(e,t){const r=ro();e&&!t&&(window.UserLeap._config.mode=eg);const n=qn(Te(window.UserLeap)),s=await Be(function(i){const a=new URL(Me("1",[it],"questions"));return Object.entries(i||{}).forEach(([o,l])=>{l&&a.searchParams.append(o,String(l))}),a.toString()}({desktopDisplay:window.UserLeap._config.desktopDisplay,isMobile:n,previewLanguage:window.UserLeap._config.previewLanguage,surveyid:e==null?void 0:e.surveyId,surveytemplateid:e==null?void 0:e.surveyTemplateId,vid:r}),{shouldDropOnRateLimit:!0});if(!s.ok)return s.reportError&&s.error&&(console.warn("[Sprig] (ERR-414) Failed to request questions from the server",s.error),window.UserLeap.reportError("getQuestions",s.error)),{success:!1,surveyState:"no survey"};if(s.json.delay&&await In(s.json.delay),!s.json.isFeedback)return tr(s.json,nr,oo);{const{feedbackLabel:i,productConfig:a,surveyUuid:o,feedbackCustomStyles:l}=s.json,{buttonTheme:c,placement:u,desktopDisplay:d}=a;gu({customStyles:l,buttonTheme:c,desktopDisplay:d,eventId:0,feedbackLabel:i,placement:u,surveyUuid:o,surveyId:e==null?void 0:e.surveyId},s.json)}}function sg(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)&&(ng(),sr())}const ig=function(e){if(!window.UserLeap)return;const t=async(s={})=>{var m,g,b,C,A;const{userId:i,anonymousId:a,metadata:o={},properties:l,showSurveyCallback:c}=s;let{eventName:u}=s;if(window.UserLeap.debugMode&&u!==Iu&&console.info("[DEBUG] Sprig track",s),e.mode==="test")return;const d=Q.getItem("sprig.previewKey")??void 0;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const E="[Sprig] - Skipping tracking without userId";return console.warn(E),{success:!1,message:E,surveyState:"no survey"}}if(!u||u.trim().length===0){u=u?String(u):"";const E="[Sprig] - Invalid event name "+u;return console.warn(E),{success:!1,message:E,surveyState:"no survey"}}const h=nr??window.location.href;o.url||(o.url=h),Ce("trackStartUrl",h),(g=(m=window.UserLeap)==null?void 0:m._config)!=null&&g.optimizelyEnabled&&(mr(Te(window.UserLeap))||pn.getAndSetWebOptimizelyExperiments(),o.optimizelyExperiments=Object.assign({},pn.getAllOptimizelyExperiments())),(C=(b=window.UserLeap)==null?void 0:b._config)!=null&&C.launchDarklyEnabled&&(o.launchDarklyFlags=hi.getAllLaunchDarklyVariations()),i&&(window.UserLeap.userId=i),a&&(window.UserLeap.partnerAnonymousId=a),l&&(o.eventProperties=l),(A=ne.replay)==null||A.RecordEvent({name:u,url:o.url}),_.info("TrackEvent",{eventName:u});const f=window.UserLeap.delayingSurvey||hu()?await Be(Me("1",[st],"events/batch"),{body:JSON.stringify({events:[{event:u,metadata:o}],previewKey:d}),method:"POST",shouldDropOnRateLimit:!0}):await Be(Me("1",[st],"events"),{body:JSON.stringify({event:u,metadata:o,previewKey:d}),method:"POST",shouldDropOnRateLimit:!0});if(!f.ok){const E="[Sprig] (ERR-421) Failed to track event";return f.reportError&&(console.warn(E,f.error),f.error&&window.UserLeap.reportError("track",f.error)),{success:!1,message:E,error:f.error,surveyState:"no survey"}}i&&Ce("uid",i),a&&Ce("aid",a);const v=f.json;v.invalidPreviewKey&&Q.removeItem("sprig.previewKey");const p=o.trackPageView?o.url:void 0;return v!=null&&v.feedbackButton&&gu(v.feedbackButton,void 0,p),await async function(E,T){var k,R;let M=!0;return!(T&&((k=E==null?void 0:E.json)!=null&&k.surveyId)&&(window.UserLeap.delayingSurvey=!0,M=await T(E.json.surveyId),window.UserLeap.delayingSurvey=!1,!M))&&((R=E==null?void 0:E.json)!=null&&R.delay&&!window.UserLeap.isMobileSDK&&(window.UserLeap.delayingSurvey=!0,await In(E.json.delay),window.UserLeap.delayingSurvey=!1),M)}(f,c)?function(E){if(!window.UserLeap._config.dismissOnPageChange)return!0;const T=new URL(E),M=new URL(nr??window.location.href);return T.hostname===M.hostname&&T.pathname===M.pathname}(h)?tr(v,p,oo):{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="${no}"]`))==null?void 0:o.contentDocument;a&&fr({document:a,elementId:"ul-custom-style",styleString:i})},n={displaySurvey:async s=>(console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."),window.UserLeap("dismissActiveSurvey",Ae.Override),ws({surveyId:s},!0)),_previewSurvey(s){window.UserLeap("dismissActiveSurvey",Ae.Override),ws({surveyTemplateId:s},!1)},_reviewSurvey(s){window.UserLeap("dismissActiveSurvey",Ae.Override),ws({surveyId:s},!1)},previewSurvey(s){n._previewSurvey(s)},reviewSurvey(s){n._reviewSurvey(s)},mute(){window.UserLeap._queue.pause()},unmute(){window.UserLeap._queue.unpause()},setVisitorToken(){console.warn("[Sprig] setVisitorToken is deprecated.")},dismissActiveSurvey(s=Ae.API){window.UserLeap.container&&(s===Ae.Closed&&window.Sprig.trackHistory&&window.Sprig.trackHistory({event:"closed"}),z.emit(F.SurveyCloseRequested,{name:F.SurveyCloseRequested,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}),z.emit(F.SurveyWillClose,{name:F.SurveyWillClose,initiator:s,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},async setAttribute(s,i){if(!s||!i&&i!==0&&i!==!1){const a="[Sprig] - Disregarding empty attribute / value provided";return console.warn(a),{success:!1,message:a}}return this.setAttributes({[s]:i})},async setAttributes(s){if(s==null||Object.keys(s).length===0){const i="[Sprig] - Disregarding empty attributes provided";return console.warn(i),{success:!1,message:i}}return this.identifyAndSetAttributes({attributes:s})},async identifyAndSetAttributes(s){if(window.UserLeap.debugMode&&console.info("[DEBUG] Sprig identifyAndSetAttributes",s),e.mode==="test")return;if(s===null||typeof s!="object"||!(s.userId||s.anonymousId||s.attributes)){const u="[Sprig] - Disregarding empty payload provided";return console.warn(u),{success:!1,message:u}}const{userId:i,anonymousId:a,attributes:o}=s;if(e.requireUserIdForTracking&&!window.UserLeap.userId&&!i){const u="[Sprig] - Skipping tracking without userId";return console.warn(u),{success:!1,message:u}}if(o){o.email&&!o[Vt]&&(o[Vt]=o.email,delete o.email);const u=Object.keys(o);for(const d of u)o[d]===On[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 Be(Me("1",[it,st],"attributes"),{body:JSON.stringify(o),method:"PUT"}),c.ok?Object.assign(On,o):c.reportError&&(console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed",c.error),c.error&&window.UserLeap.reportError("identifyAndSetAttributes",c.error))):c=await Be(Me("1",[it,st]),{body:JSON.stringify(l),method:"PUT"}),o&&o[Vt]&&(window.UserLeap.email=o[Vt]),c.ok&&(i&&Ce("uid",i),a&&Ce("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 Be(Me("1",[it,st],"attributes"),{body:JSON.stringify({delete:s}),method:"DELETE"});return!i.ok&&i.reportError&&(console.warn("[Sprig] (ERR-433) Remove attributes failed",i.error),i.error&&window.UserLeap.reportError("removeAttributes",i.error)),{success:!!i.ok}},async addSurveyListener(s){z.on(F.SurveyLifeCycle,s)},async removeSurveyListener(s){z.removeListener(F.SurveyLifeCycle,s)},async addListener(s,i){z.on(s,i)},async removeListener(s,i){z.removeListener(s,i)},async removeAllListeners(){z.removeAllListeners()},setPreviewKey(s){s&&typeof s=="string"&&Q.isStorageAvailable&&s&&Q.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 Be(Me("1",[it,st]),{body:JSON.stringify({userId:s}),method:"PUT"});a.ok?(i!==window.UserLeap.visitorId&&((o=ne.replay)==null||o.clearUserReplayData()),Ce("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,Ce("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){nr=s,Ru(s,i,a,o)},applyFeedbackStyles({button:s="",view:i=""}){window.UserLeap.feedbackCustomStyles=i,document.getElementById("sprig-feedback-style")&&fr({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 h,f;const a=typeof s=="string"?parseInt(s,10):s,o=typeof i=="string"?parseInt(i,10):i;isNaN(a)||isNaN(o)||(window.UserLeap.windowDimensions={width:a,height:o});const l=Te(window.UserLeap),c=qn(l),u=l["userleap-platform"]==="web";if(!window.UserLeap.frameId)return;const d=document.getElementById(window.UserLeap.frameId);d&&(window.UserLeap.useMobileStyling&&((h=window.UserLeap.windowDimensions)!=null&&h.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(du(d.contentDocument,u&&!c,to(l))[0])+"px")),z.emit(F.SurveyDimensions,{name:F.SurveyDimensions,contentFrameWidth:d.clientWidth,contentFrameHeight:d.clientHeight,"survey.id":parseInt(window.UserLeap.container.dataset.studyId)}))},logoutUser(){var s;window.UserLeap.debugMode&&console.info("[DEBUG] Sprig logout"),_.info("LogOut",{vid:window.UserLeap.visitorId,userId:window.UserLeap.userId}),window.UserLeap.visitorId=null,window.UserLeap.userId=null,window.UserLeap.partnerAnonymousId=null,window.UserLeap.token=null,window.UserLeap.email=null,ct.removeItem("userleap.ids"),window.UserLeap._queue.isPaused()&&window.UserLeap._queue.empty(),xu(),(s=ne.replay)==null||s.clearUserReplayData(),window.UserLeap._queue.unpause()},teardown(){["hashchange","popstate"].forEach(s=>window.removeEventListener(s,sr,!0)),window.UserLeap._config.interactiveEvents&&ku(),window.UserLeap("dismissActiveSurvey",Ae.API),delete window.UserLeap,delete window.Sprig,delete window._Sprig},integrateOptimizely(s,i=!0){var a,o;if((o=(a=window.UserLeap)==null?void 0:a._config)!=null&&o.optimizelyEnabled)try{const l=typeof s=="string"?JSON.parse(s):s;pn.setOptimizelyExperiment(l,i)}catch(l){console.warn("[Sprig] Error with integrating Optimizely data"),l instanceof Error&&window.UserLeap.reportError("integrateOptimizely",l)}else console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.")},integrateOptimizelyClient(s){var i,a;if(!((a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.optimizelyEnabled))return void console.warn("[SPRIG] Optimizely integration is currently not enabled for your product.");s.notificationCenter.addNotificationListener("ACTIVATE:experiment, user_id,attributes, variation, event",({experiment:o,variation:l})=>{const c={experiments:[{id:o.id,variation:l.key}]};window.UserLeap("integrateOptimizely",c,!1)})},importLaunchDarklyData(s){var i,a;(a=(i=window.UserLeap)==null?void 0:i._config)!=null&&a.launchDarklyEnabled?hi.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(Vt,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){wu(s,i)},_completeSessionReplay:async({surveyId:s,responseGroupUuid:i,eventDigest:a})=>{var o;return ne.replay?(o=ne.replay)==null?void 0:o._completeSessionReplay({surveyId:s,responseGroupUuid:i,eventDigest:a,headers:Te(window.UserLeap)}):(window.UserLeap.reportError("_completeSessionReplay",new Error("Replay module not registered")),!1)},pauseReplayRecording(){var s,i,a,o;(i=(s=ne.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)||((o=(a=ne.replay)==null?void 0:a.recordReplayPaused)==null||o.call(a))},resumeReplayRecording(){var s,i,a,o,l,c;(i=(s=ne.replay)==null?void 0:s.isReplayPaused)!=null&&i.call(s)&&((o=(a=ne.replay)==null?void 0:a.recordReplayResumed)==null||o.call(a),(c=(l=ne.replay)==null?void 0:l.recordFullSnapshot)==null||c.call(l))}};Object.assign(window.UserLeap,n)};async function og(e,t,r={},n={}){const s=window.__cfg&&window.__cfg.mode,i=ro(),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:nr??window.location.href,language:window.navigator.language,...r},c={action:e,breadcrumbs:_.breadcrumbs,err:{message:`${t==null?void 0:t.name} - ${t==null?void 0:t.message}`,stack:t==null?void 0:t.stack},meta:l,vid:i,envId:a,...n};(await Be(Me("1",null,"errors"),{method:"POST",headers:{"x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(c),shouldDropOnRateLimit:!0})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",t)}function ag(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,h,f,v,p;if(window.UserLeap.loaded)return;if((d=window.SprigLoggerCallback)==null||d.call(window,"Loading Sprig"),window.UserLeap.reportError=og,window.UserLeap.loaded=!0,window.UserLeap._config=Object.assign({},e,window.UserLeap.config),window.UserLeap.delayingSurvey=!1,window.UserLeap._config&&typeof window.UserLeap._config=="object")for(const I in window.UserLeap._config)window.UserLeap[I]=window.UserLeap._config[I];if(window.Sprig.outstandingTransactionLimit!==void 0&&(e.outstandingTransactionLimit=window.Sprig.outstandingTransactionLimit),!window.UserLeap.envId){if(!window.UserLeap.appId)throw new Error("Missing Environment id");window.UserLeap.envId=window.UserLeap.appId}window.UserLeap.debugMode&&console.info("[DEBUG] Sprig debug mode enabled");const s=Eu(),i=window.UserLeap.sampleRate;let a=s.sampled;if(i){if(a===null&&(a=Math.random()<i,Ce("sampled",a)),!a)return}else a!==null&&Ce("sampled",null);window.UserLeap._API_URL||(window.UserLeap._API_URL="https://api.sprig.com");const o=[...window.UserLeap._queue];window.UserLeap._queue=new Hf(window.UserLeap,[]),window.UserLeap._queue.pause();for(let I=0;I<o.length;I++)window.UserLeap._queue.push(o[I]);const l=s.token;l?(window.UserLeap.token=l,window.UserLeap.visitorId=s.vid??null,window.UserLeap.userId=s.uid??null,window.UserLeap.partnerAnonymousId=s.aid??null):xu();const c=mr(Te(window.UserLeap));(h=window.SprigLoggerCallback)==null||h.call(window,"Sprig fetching config");const u=await async function(I){var C,A;const m=Te(window.UserLeap);document.addEventListener("securitypolicyviolation",Ha);const g=await Ve(Me("1",[it],"config"),{headers:m});if(document.removeEventListener("securitypolicyviolation",Ha),!g.ok)return(C=window.SprigLoggerCallback)==null||C.call(window,"Sprig config fetch failed"),g.reportError&&(console.warn("[Sprig] (ERR-422) Failed to load configuration",g.error),g.error&&window.UserLeap.reportError("applyRemoteConfig",g.error)),ui("Disabled: failed to fetch configuration"),I;const b=g.json;return b!=null&&b.disabled?((A=window.SprigLoggerCallback)==null||A.call(window,"Sprig config fetch disabled"),ui(`Disabled: ${b.disabled}`),{disabled:b.disabled}):Object.assign({},b,I)}(e);if((f=window.SprigLoggerCallback)==null||f.call(window,"Sprig fetched config"),Qf({isWeb:!c,reportingIntervalSeconds:u.metricsReportingEnabled||u.mobileMetricsReportingEnabled?u.metricsReportingIntervalSeconds:0,thresholds:u.metricThresholds,postMetrics:async I=>{var m;await Be(Me("1",[it],"metrics"),{body:I,method:"POST",headers:{"x-ul-replay-enabled":`${!!((m=ne.replay)!=null&&m.isReplayRecording())}`},shouldDropOnRateLimit:!0})}}),!c){const I=u.alwaysOnReplay?{userAgent:window.navigator.userAgent,surveyId:u.alwaysOnReplay.surveyId,responseGroupUuid:u.alwaysOnReplay.responseGroupUuid,sdkVersion:"2.41.3",maxDurationSeconds:u.alwaysOnReplay.maxDurationSeconds}:void 0;await((v=ne.replay)==null?void 0:v.initializeReplay({maxReplayDurationSeconds:u.maxReplayDurationSeconds,maxInflightRequests:window.UserLeap.maxInflightReplayRequests??2,replaySettings:u.replaySettings,apiUrl:window.UserLeap._API_URL,alwaysOnConfig:I})),oo=u.replaySettings}ig(u),await sg(u),window.UserLeap._queue.unpause(),(p=window.SprigLoggerCallback)==null||p.call(window,"SdkReady"),z.emit(F.SDKReady,{mobileMetricsReportingEnabled:!!u.mobileMetricsReportingEnabled,metricsReportingInterval:u.metricsReportingIntervalSeconds||0,metricsThresholds:u.metricThresholds||[],maxMobileReplayDurationSeconds:u.maxMobileReplayDurationSeconds,mobileReplaySettings:u.mobileReplaySettings}),z.emit(F.VisitorIDUpdated,{visitorId:window.UserLeap.visitorId}),z.on(F.VisitorIDUpdated,()=>{for(const I in On)delete On[I]})}window.UserLeap.UPDATES=hr,window.UserLeap("setPreviewKey",t),document.readyState==="complete"?r():window.attachEvent?window.attachEvent("onload",r):window.addEventListener("load",()=>{r()},!1)}class wi{constructor(){de(this,"UPDATES",hr)}displaySurvey(t){window.Sprig("displaySurvey",t)}mute(){window.Sprig("mute")}unmute(){window.Sprig("unmute")}dismissActiveSurvey(){window.Sprig("dismissActiveSurvey")}setAttribute(t,r){window.Sprig("setAttribute",t,r)}setAttributes(t){window.Sprig("setAttributes",t)}identifyAndSetAttributes(t){window.Sprig("identifyAndSetAttributes",t)}removeAttributes(t){window.Sprig("removeAttributes",t)}addListener(t,r){window.Sprig("addListener",t,r)}removeListener(t,r){window.Sprig("removeListener",t,r)}removeAllListeners(){window.Sprig("removeAllListeners")}setEmail(t){window.Sprig("setAttribute","!email",t)}setUserId(t){window.Sprig("setUserId",t)}setPartnerAnonymousId(t){window.Sprig("setPartnerAnonymousId",t)}track(t,r={},n={}){window.Sprig("track",t,r,n)}identifyAndTrack(t){window.Sprig("identifyAndTrack",t)}trackPageView(t,r,n){window.Sprig("trackPageView",t,r,n)}applyStyles(t){window.Sprig("applyStyles",t)}setWindowDimensions(t,r){window.Sprig("setWindowDimensions",t,r)}logoutUser(){window.Sprig("logoutUser")}teardown(){window.Sprig("teardown")}pauseReplayRecording(){window.Sprig("pauseReplayRecording")}resumeReplayRecording(){window.Sprig("resumeReplayRecording")}}const lg={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(wi.prototype).map(r=>{r!=="constructor"&&(window.Sprig[r]=wi.prototype[r])});const t=window.Sprig;return t.appId=e.envId,t._queue=[],window.UserLeap=t,ag(e),window.Sprig}};var ot=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ot||{}),$e=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))($e||{});const vi=(e,t)=>t.some(r=>e instanceof r);let nl,sl;const bi=new WeakMap,vs=new WeakMap,An=new WeakMap;let Si={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return bi.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return at(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&(t==="done"||t==="store")||t in e};function Lu(e){Si=e(Si)}function cg(e){return(sl||(sl=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Ii(this),t),at(this.request)}:function(...t){return at(e.apply(Ii(this),t))}}function ug(e){return typeof e=="function"?cg(e):(e instanceof IDBTransaction&&function(t){if(bi.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});bi.set(t,r)}(e),vi(e,nl||(nl=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Si):e)}function at(e){if(e instanceof IDBRequest)return function(r){const n=new Promise((s,i)=>{r.onsuccess=()=>{s(at(r.result))},r.onerror=()=>{i(r.error)}});return An.set(n,r),n}(e);if(vs.has(e))return vs.get(e);const t=ug(e);return t!==e&&(vs.set(e,t),An.set(t,e)),t}const Ii=e=>An.get(e);function Ci(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);return t&&(r.onblocked=n=>t(n.oldVersion,n)),at(r).then(()=>{})}const dg=["get","getKey","getAll","getAllKeys","count"],pg=["put","add","delete","clear"],bs=new Map;function il(e,t){if(!(e instanceof IDBDatabase)||t in e||typeof t!="string")return;if(bs.get(t))return bs.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=pg.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!dg.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 bs.set(t,i),i}Lu(e=>({...e,get:(t,r,n)=>il(t,r)||e.get(t,r,n),has:(t,r)=>!!il(t,r)||e.has(t,r)}));const hg=["continue","continuePrimaryKey","advance"],ol={},ki=new WeakMap,Ou=new WeakMap,mg={get(e,t){if(!hg.includes(t))return e[t];let r=ol[t];return r||(r=ol[t]=function(...n){ki.set(this,Ou.get(this)[t](...n))}),r}};async function*fg(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,mg);for(Ou.set(r,t),An.set(r,Ii(t));t;)yield r,t=await(ki.get(r)||t.continue()),ki.delete(r)}function al(e,t){return t===Symbol.asyncIterator&&vi(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&vi(e,[IDBIndex,IDBObjectStore])}Lu(e=>({...e,get:(t,r,n)=>al(t,r)?fg:e.get(t,r,n),has:(t,r)=>al(t,r)||e.has(t,r)}));const gg="sprigReplayIframeLoaded",yg="sprigReplayIframeSettings",wg="sprigReplayIframeTakeFullSnapshot",vg="sprigReplayTeardown",ao=[],Au=new class{constructor(e){de(this,"awaitingResolvers",[]);de(this,"activeCount",0);this.capacity=e}async acquire(){if(!(this.activeCount<this.capacity))return new Promise(e=>{this.awaitingResolvers.push(e)});this.activeCount++}release(){const e=this.awaitingResolvers.shift();e&&this.activeCount<=this.capacity?e():this.activeCount--}async execute(e){try{return await this.acquire(),await e()}finally{this.release()}}setLimit(e){this.capacity=e}}(2),Mu=async({apiUrl:e,surveyId:t,uploadId:r,etags:n,headers:s,responseGroupUuid:i,replayDuration:a,eventDigest:o},l=!1)=>{var u;if(!l&&!r&&!n)return void _.error("UploadErr",{isMobile:l,uploadId:r,etags:n});_.info("MarkUploadComplete",{surveyId:t});const c=await Ve(`${e}/sdk/1/completeSessionReplay`,{method:"POST",body:JSON.stringify({etags:n,uploadId:r,responseGroupUuid:i,surveyId:t,replayDuration:a,eventDigest:o,userAgent:(u=window==null?void 0:window.navigator)==null?void 0:u.userAgent}),headers:s,shouldRetryRequest:!0});return _.info("MarkUploadDone",{surveyId:t}),c},bg=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},Uu=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=bg(r)}return"/"+t.reverse().map(r=>r.position!==null?`/${r.name}[${r.position}]`:`/${r.name}`).join("")},lo=e=>e&&e.trim().substring(0,500).replace(/\s\s+/g," ").replace(/\r?\n|\r/g," ").substring(0,250),Tu=(e,t)=>{let r;return n=>{clearTimeout(r),r=window.setTimeout(()=>e(n),t)}},je={capture:!0,passive:!0},Sg=["a","button","input","option","li","link"],Ig=["Escape","Enter","Backspace","F5","Tab"];let Mn=!1,Ee=null,hn=null;const ll=e=>{var r;if(((r=e.tagName)==null?void 0:r.toLowerCase())==="html")return{element:"html"};const t={};return t.element=(n=>{if(!n.tagName)return"No tagName";const s=n.getAttribute("type");return s?`${s} ${n.tagName.toLowerCase()}`:n.tagName.toLowerCase()})(e),t},Cg=e=>{var n;if(!e)return{};const t={...ll(e)},r=e.parentElement;if(r&&Sg.includes((n=r.tagName)==null?void 0:n.toLowerCase())){const s=ll(r);Object.assign(t,s)}return t},Du=(e,t)=>{var s,i;let r=t.target;var n;t.target===((s=window.document)==null?void 0:s.body)&&window.Sprig.pointerDownTarget&&(r=window.Sprig.pointerDownTarget),n={x:t.x,y:t.y,type:e,elementAttributes:Cg(r),windowHeight:window.innerHeight,windowWidth:window.innerWidth,...r instanceof HTMLElement||r instanceof SVGElement||r instanceof MathMLElement?{rect:r==null?void 0:r.getBoundingClientRect(),xPath:Uu(r)}:{}},(i=n==null?void 0:n.elementAttributes)!=null&&i.text&&(n.elementAttributes.text=lo(n.elementAttributes.text)),Ee==null||Ee("Sprig_Click",n)},Pu=e=>{var t;Ig.includes(e.key)&&(t={key:e.key},Ee==null||Ee("Sprig_Keystroke",t))},kg=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("reload")&&(e={url:window.location.href,currentPageTitle:document.title},Ee==null||Ee("Sprig_Refresh",e))},Eg=()=>{var e;window.performance.getEntriesByType("navigation").map(t=>t.type).includes("back_forward")&&((e={curUrl:window.location.href,fromUrl:document.referrer,currentPageTitle:document.title}).currentPageTitle&&(e.currentPageTitle=lo(e.currentPageTitle)),Ee==null||Ee("Sprig_BackForward",e))},_u=Tu(e=>{if(!(e.target instanceof HTMLElement||e.target instanceof Document))return;let t=e.target;"scrollTop"in t||(t=t.documentElement),hn==null||hn({xPath:Uu(t),x:t.scrollLeft,y:t.scrollTop,elementAttributes:{targetScrollWidth:t.scrollWidth,targetClientWidth:t.clientWidth,targetScrollHeight:t.scrollHeight,targetClientHeight:t.clientHeight}})},750),Nu=(cl="left_click",e=>Du(cl,e));var cl;const Fu=e=>{e.button===2&&Du("right_click",e)},Bu=e=>{window.Sprig&&(window.Sprig.pointerDownTarget=e.target)},pe={isRecording:!1,scrollEventUuids:{},stopRecording:()=>{}},zu=()=>window.indexedDB&&window.IDBKeyRange&&window.CompressionStream,be=(()=>{const e=Q.getItem("sprig.sessionId");if(e)return _.info("SessionIDFound",{savedSessionId:e}),Q.removeItem("sprig.sessionId"),e;const t=vt();return _.info("GeneratedSessionID",{uuid:t}),t})(),Ei=()=>{Q.setItem("sprig.disableReplayRecording","disabled")},Ge=()=>!!Q.getItem("sprig.disableReplayRecording"),Un=()=>!!Q.getItem("sprig.isReplayPaused");window.addEventListener("beforeunload",()=>{_.info("BeforeUnload",{sessionId:be}),Q.setItem("sprig.sessionId",be)});const qe=(e,t)=>{var r,n;if(!Ge()&&pe.isRecording&&!Un())try{(n=(r=window.rrwebRecord)==null?void 0:r.addCustomEvent)==null||n.call(r,e,t)}catch(s){br("Error recording custom event",s)}},xg=async e=>{const{x:t,xPath:r,y:n}=e,s=pe.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),h=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(!h&&!f)return null;h&&(d.data.payload.x=t),f&&(d.data.payload.y=n),d.data.payload.elementAttributes=e.elementAttributes,a.event=JSON.stringify(d),await i.put("events",a)}else qe("Sprig_Scroll",e)},"Error updating scroll event");qe("Sprig_Scroll",e)},ju=()=>{pe.stopRecording&&(pe.stopRecording(),pe.stopRecording=void 0),pe.isRecording=!1,["cleanupInterval","inactivityInterval","pendingCheckInterval"].forEach(e=>{pe[e]&&(clearInterval(pe[e]),pe[e]=void 0)}),Mn&&(window.removeEventListener("click",Nu,je),window.removeEventListener("pointerdown",Bu,je),window.removeEventListener("mousedown",Fu,je),window.removeEventListener("keydown",Pu,je),window.removeEventListener("scroll",_u,je),Mn=!1),ao.forEach(e=>{var t;(t=e.source)==null||t.postMessage({type:vg},{targetOrigin:e.origin})})},Rg=["did not allow mutations","called in an invalid security context"],Lg=(e,t,{reportError:r=!0,extraInfo:n={}})=>{if(!Ge()&&t instanceof Error){if(Ei(),t.name==="VersionError")return _.error("VersionErr",{message:e}),void ee.deleteDB();(s=>{if(!s)return!0;for(const i of Rg)if(s.toLowerCase().includes(i))return!1;return!0})(t==null?void 0:t.message)&&(r&&window.UserLeap.reportError(e,t,n),ee.clearAll())}},br=(e,t,{reportError:r}={reportError:!0})=>{ju(),_.error("ReplayErr",{code:t.code,name:t.name}),Lg(e,t,{reportError:r})},ke=async(e,t)=>{try{return await e()}catch(r){br(t,r)}},xi=()=>{pe.isRecording&&(ke(()=>{var e,t;return(t=(e=window.rrwebRecord)==null?void 0:e.takeFullSnapshot)==null?void 0:t.call(e,!0)},"Error recording full snapshot"),ao.forEach(e=>{var t;(t=e.source)==null||t.postMessage({type:wg},{targetOrigin:e.origin})}))};let Ss=0;(async()=>zu()&&Promise.allSettled([Ci("replayStorage"),Ci("sprig.replay")]))();const ee=new class{constructor(){de(this,"wrapTransactionWithCounter",e=>{var n,s;const t=(s=(n=window.Sprig)==null?void 0:n._config)==null?void 0:s.outstandingTransactionLimit,r=t===void 0?100:t;if(r&&Ss>r){const i="Too many outstanding transactions";br(i,new Error(i),{reportError:!1})}Ss++,e.done.finally(()=>{Ss--})});de(this,"getTransaction",async e=>{const t=(await this.openDB()).transaction(e,"readwrite");return this.wrapTransactionWithCounter(t),t})}openDB(){return function(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const a=indexedDB.open(e,t),o=at(a);return n&&(a.onupgradeneeded=l=>{n(at(a.result),l.oldVersion,l.newVersion,at(a.transaction),l)}),r&&(a.onblocked=l=>r(l.oldVersion,l.newVersion,l)),o.then(l=>{i&&(l.onclose=()=>i()),s&&(l.onversionchange=c=>s(c.oldVersion,c.newVersion,c))}).catch(()=>{}),o}("sprigReplay",1,{upgrade:(e,t,r)=>{if(r===0&&Q.setItem("sprig.pendingCount","0"),!e.objectStoreNames.contains("events")){const n=e.createObjectStore("events",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+timestamp]",["sessionId","timestamp"])}if(!e.objectStoreNames.contains("chunkUploads")){const n=e.createObjectStore("chunkUploads",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+status]",["sessionId","status"]),n.createIndex("[uploadId+status]",["uploadId","status"]),n.createIndex("[sessionId+status+uploadId]",["sessionId","status","uploadId"])}if(!e.objectStoreNames.contains("pendingCaptures")){const n=e.createObjectStore("pendingCaptures",{keyPath:"uuid"});n.createIndex("sessionId","sessionId"),n.createIndex("timestamp","timestamp"),n.createIndex("[sessionId+targetTimestamp]",["sessionId","targetTimestamp"])}}})}async deleteDB(){try{await Ci("sprigReplay")}catch{}}async bulkAdd(e,t){const r=await this.getTransaction(e);return Promise.all([...t.map(n=>r.store.add(n)),r.done])}async clearAll(){const e=(await this.openDB()).transaction(["events","chunkUploads","pendingCaptures"],"readwrite");return this.wrapTransactionWithCounter(e),Promise.all([e.objectStore("events").clear(),e.objectStore("chunkUploads").clear(),e.objectStore("pendingCaptures").clear()])}async deleteBySessionId(e,t){const r=IDBKeyRange.only(t),n=await this.getTransaction(e),s=n.store.index("sessionId");for await(const i of s.iterate(r))await i.delete();await n.done}async updatePartial(e,t,r){const n=await this.getTransaction(e),s=await n.store.get(t);s&&await n.store.put({...s,...r}),await n.done}async deleteRowsBefore(e,t,r=()=>!0){const n=IDBKeyRange.upperBound(t,!0),s=await this.getTransaction(e),i=s.store.index("timestamp");for await(const a of i.iterate(n))r(a.value)&&await a.delete();await s.done}async getEventsBetween(e,t=Date.now()){if(e>=t)return Promise.resolve([]);const r=IDBKeyRange.bound([be,e],[be,t],!1,!0);return(await this.openDB()).getAllFromIndex("events","[sessionId+timestamp]",r)}async updateEventsExpiredAt(e,t,r=30){const n=new Date,s=n.setMinutes(n.getMinutes()+(r??30)),i=await this.getTransaction("events"),a=i.store.index("[sessionId+timestamp]"),o=IDBKeyRange.bound([be,e],[be,t],!1,!0);for await(const l of a.iterate(o))await l.update({...l.value,expiredAt:s});await i.done}async deleteChunkUploads(e,t){const r=IDBKeyRange.only([t,e]),n=await this.getTransaction("chunkUploads");let i=await n.store.index("[uploadId+status]").openCursor(r);for(;i;)i.delete(),i=await i.continue();await n.done}async getChunkUploadsByStatus({sessionId:e,status:t,uploadId:r}){const n=(await this.openDB()).transaction("chunkUploads","readonly");this.wrapTransactionWithCounter(n);const s=r?n.store.index("[uploadId+status]"):n.store.index("[sessionId+status]"),i=r?IDBKeyRange.only([r,t]):IDBKeyRange.only([e,t]);return s.getAll(i)}async getPendingCaptures(e={}){return(await(await this.openDB()).getAllFromIndex("pendingCaptures","sessionId",be)).filter(r=>!e.beforePresent||r.targetTimestamp<Date.now()).filter(r=>!e.isBeforeType||r.captureParams.replayParams.replayDurationType==="before").filter(r=>!e.isHeatmap||(r.captureParams.isHeatmap??!1))}async markPendingCaptureToCanUpload(e){const t=await this.getTransaction("pendingCaptures"),r=t.store.index("sessionId");for await(const n of r.iterate(be)){const s=n.value;s.captureParams.responseGroupId===e&&await n.update({...s,canUpload:!0})}await t.done}async markPendingHeatmapsReady(e){if(parseInt(Q.getItem("sprig.pendingCount")??"0")===0)return null;const t=Date.now(),r=await this.getTransaction("pendingCaptures"),n=r.store.index("sessionId");for await(const s of n.iterate(be)){const i=s.value;!i.captureParams.isHeatmap||e&&!e.includes(i.uuid)||await s.update({...i,targetTimestamp:t,captureParams:{...i.captureParams,triggerTimestamp:t,replayParams:{...i.captureParams.replayParams,replayDurationSeconds:Math.floor((t-i.timestamp)/1e3)}}})}await r.done}},Ze=[];let Sr,Wu,gt=[],Dt=!1,Tt=0,mn=!1,Vu=!1;const co=[];let Tn,Gu,fn,Hu,Is=!1;const Pt=()=>mn&&!Dt&&Date.now()<=Tn,Og=({apiUrl:e,config:t,triggerSnapshot:r,forceInit:n=!1})=>{mn&&!n||(Q.isStorageAvailable?(gt=[],co.splice(0),Ze.splice(0),Tt=0,fn=r,Wu=e,Sr={responseGroupUuid:t.responseGroupUuid,surveyId:t.surveyId,userAgent:t.userAgent,sdkVersion:t.sdkVersion},Gu=t.maxDurationSeconds,Tg(),mn||(Hu=window.setInterval(Ug,500)),mn=!0):Dt=!0)},Ag=[$e.Drag,$e.Input,$e.MediaInteraction,$e.MouseInteraction,$e.MouseMove,$e.Scroll,$e.Selection,$e.TouchMove],Mg=e=>e.type===ot.Custom||e.type===ot.IncrementalSnapshot&&Ag.includes(e.data.source),uo=e=>e.some(Mg),Ug=async()=>{if(!Pt())return void window.clearInterval(Hu);if($u(),!uo(Ze))return;const e=Ze[0].timestamp;Date.now()-e>35e3&&(fn==null||fn())},$u=async()=>{if(gt.length||Is)return;Is=!0;const e=await Pg();if(!e)return void(Dt=!0);co.splice(0,e.length).forEach(t=>t(e.shift())),e.forEach(t=>gt.push(t)),Is=!1},Tg=()=>{const e=Q.getItem("sprig.alwayson.info");if(e){_.info("Read stored session state",e);const t=JSON.parse(e);Dt=t.disabled,Sr=t.metadata,gt=t.uploadUrls,Tt=t.currentIndex,Tn=t.expirationTimestamp,t.pendingEventTimestamp&&(_.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`),Dg(t.pendingEventTimestamp))}else Tn=1e3*Gu+Date.now()},Dg=async e=>{const t=Date.now(),r=(await ee.getEventsBetween(e,t)).map(s=>JSON.parse(s.event));if(!uo(r))return;Ku(r);const n=await Ju();n&&await qu(n,r)},Yu=async(e,t)=>{try{const r=await e();if(!r.ok)throw new Error(`Error ${t}`);return r}catch{Dt=!0}},qu=async(e,t)=>{if(!Pt()||!e)return;const r=await(async n=>{const s=new TextEncoder,i=new CompressionStream("gzip"),a=i.writable.getWriter(),o=s.encode(JSON.stringify(n));return a.write(o),a.close(),new Uint8Array(await new Response(i.readable).arrayBuffer())})(t);_.info("Uploading always-on events with presigned url"),await Yu(()=>Ve(e,{body:r,method:"PUT"}),"uploading always-on with presigned url")},Pg=async()=>{if(!Pt())return;const{surveyId:e,responseGroupUuid:t}=Sr,r={responseGroupUuid:t,surveyId:e,index:Tt+1};_.info("Fetching always-on upload urls",r);const n=await Yu(()=>Ve(`${Wu}/sdk/1/replayUrls`,{method:"POST",body:JSON.stringify(r),headers:Te(window.UserLeap)}),"fetching always-on signed urls");if(!n)return;const s=n.json.signedUrls;return _.info("Fetched more always-on upload urls",{body:r,urls:s}),s},Ju=async()=>{if(gt.length)return gt.shift();const e=new Promise(t=>{co.push(t)});return $u(),e},Ku=e=>{var s,i,a;const t=e.length?e[e.length-1].timestamp:Date.now(),r=Tt,n=((i=(s=window.UserLeap)==null?void 0:s.config)==null?void 0:i.customMetadata)??((a=window.__cfg)==null?void 0:a.customMetadata);Tt++,e.push({timestamp:t,type:ot.Custom,data:{tag:"Sprig_Meta",payload:{...Sr,index:r,visitorId:window.UserLeap.visitorId??"",timestamp:t,customMetadata:n}}})},_g=(e,t)=>{Pt()&&!Vu&&(e||Ze.length)&&(e&&Ze.length&&(async()=>{const r=Ze.splice(0);if(!uo(r))return;_.info("Capturing always-on event array to upload"),Ku(r);const n=await Ju();n&&await qu(n,r)})(),Ze.push(t))};window.addEventListener("beforeunload",async()=>{Vu=!0,Pt()&&(_.info("Always On handle page unload"),(()=>{let e;Ze.length&&(e=Ze[0].timestamp);const t={disabled:Dt,metadata:Sr,uploadUrls:gt,currentIndex:Tt,pendingEventTimestamp:e,expirationTimestamp:Tn};_.info("Storing session state on unload",t),Q.setItem("sprig.alwayson.info",JSON.stringify(t))})())});const Xu=async(e,t)=>{const r=performance.now();let n;try{n=await e()}finally{const s=performance.now()-r;let i=vr[t];i||(i=We(t)),i.report(s/1e3)}return n},Zu=(e,t)=>{const r=performance.now();try{e()}finally{const n=performance.now()-r;let s=vr[t];s||(s=We(t)),s.report(n/1e3)}};let Qu=5e3,Ri=6e4,Li=0,lt,Oi=!1,Ai=[];const Ng=e=>{var t,r,n,s;if((t=e.event)!=null&&t.includes("Sprig_Scroll")){const i=(s=(n=(r=JSON.parse(e.event))==null?void 0:r.data)==null?void 0:n.payload)==null?void 0:s.xPath;if(!i)return;pe.scrollEventUuids[i]=e.uuid}Ai.push(e),Oi||Fg()},Fg=()=>{Oi=!0,setTimeout(async()=>{if(Ge()||Un())return;const e=Ai;Ai=[],Oi=!1,Zu(async()=>{await(async t=>{const r=t.map(n=>({...n,sessionId:n.sessionId??be}));if(r.length!==0)return ke(()=>ee.bulkAdd("events",r),"Error storing replay events")})(e)},"sdk_replay_add_event_batch_seconds")},500)},Bg=(e,t,r)=>{pe.cleanupInterval=window.setInterval(()=>{const n=Date.now();Xu(()=>ke(async()=>{Ge()||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"),_.debug("CleanupComplete")},3e4)},zg=()=>{pe.pendingCheckInterval=window.setInterval(async()=>{ke(async()=>{await Mi()},"Error initiating pending captures")},5e3)};let Cs=!1;const Mi=async(e=!1)=>{if(!Cs)try{Cs=!0;const t=parseInt(lt??"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),rd(s.captureParams,s.canUpload)))),lt=(t-r.length).toString(),Q.setItem("sprig.pendingCount",lt)}finally{Cs=!1}},jg=async(e,t,r,n,s)=>{const i=Math.min(e+s,r),a=await Xu(()=>ee.getEventsBetween(e,i),"sdk_replay_get_events_between_seconds");if(!(a!=null&&a.length))return _.debug("NoEventsFound"),{validStartFound:n,events:[]};if(!n){_.debug("ValidStartSearch");let o=-1;return a==null||a.forEach((l,c)=>{if(!l.isValidStart)return;const u=l.timestamp<=t;(o<0||u)&&(o=c)}),o<0?(_.debug("ValidStartNotFound"),{validStartFound:n,events:[]}):{validStartFound:!0,events:a==null?void 0:a.slice(o)}}return{validStartFound:n,events:a}},ed=e=>Promise.all(e.map(async t=>{const r=await(async n=>Au.execute(async()=>{var a;_.info("UploadChunkStart",{chunkIndex:n.chunkIndex,surveyId:n.surveyId});const s=await Ve(n.uploadUrl,{body:n.data,method:"PUT"});_.http("UploadChunkEnd",{url:n.uploadUrl,method:"PUT",status_code:s.status,reason:s.statusText??"OK",chunkIndex:n.chunkIndex,surveyId:n.surveyId});const i=(a=s.headers)==null?void 0:a.get("ETag");if(!i)throw new Error(`Upload response did not include etag for upload ${n.uploadId}, part ${n.chunkIndex}`);return i}))(t);return await ee.updatePartial("chunkUploads",t.uuid,{data:null,etag:r,status:"UploadComplete"}),t.uploadId})),td=async e=>{const t=await ee.getChunkUploadsByStatus({status:"UploadComplete",uploadId:e});if(!(t!=null&&t.length))return void _.info("NoChunksForUpload",{uploadId:e});const r=t.reduce((i,a)=>(i.find(o=>o.chunkIndex===a.chunkIndex)||i.push(a),i),[]);r.sort((i,a)=>i.chunkIndex-a.chunkIndex);const n=r.map(i=>({ETag:i.etag,PartNumber:i.chunkIndex})).filter(i=>i.ETag!==null),s=r[0];await Mu({apiUrl:s.apiUrl,surveyId:s.surveyId,uploadId:e,responseGroupUuid:s.responseGroupId,etags:n,headers:s.completeUploadHeaders,replayDuration:s.replayDuration}),await ee.deleteChunkUploads("UploadComplete",e)},Wg=()=>{ke(async()=>{const e=await ee.getChunkUploadsByStatus({sessionId:be,status:"ReadyForUpload"});if(!(e!=null&&e.length))return;const t=await ed(e);t!=null&&t.length&&await Promise.all(t.map(r=>{if(r)return td(r)}))},"Error uploading unfinished chunks")},Vg=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,h]=[0,0],f=[];for(let p=n-35e3;p<s;p+=Ri){if({validStartFound:u,events:f}=await jg(p,n,s,u,Ri),!(f!=null&&f.length)){_.debug("NoEventsFound");continue}d===0&&(d=f[0].timestamp),h=f[f.length-1].timestamp;const I=f.map(b=>b.event);I.push(`{"timestamp":${s}}`);const m=`${c?",":"["}${I}`,g=i.encode(m);Zu(()=>{l.write(g)},"sdk_replay_compression_seconds"),c=!0}if(h-d<Qu)return _.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)},ul=async e=>{const{surveyId:t,responseGroupId:r,visitorId:n,apiUrl:s,completeUploadHeaders:i,replayParams:a,triggerTimestamp:o}=e,l=await Vg(1e3*a.replayDurationSeconds,o);if(!(l!=null&&l.length))return void _.info("FileDataEmpty",{surveyId:t});const c=((d,h,f)=>{const v=d.length,p=1024*h*1024,I=Math.ceil(v/f),m=Math.max(p,I),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,h)=>{const f=vt(),v={apiUrl:s,chunkIndex:h+1,completeUploadHeaders:i,etag:null,responseGroupId:r,status:"ReadyForUpload",surveyId:t,timestamp:o,totalChunks:c.length,data:d,uploadId:a.uploadId,uploadUrl:a.signedUrls[h].url,uuid:f,visitorId:n};return await(await ee.openDB()).add("chunkUploads",{...v,sessionId:v.sessionId??be}),v}));await(async(d,h)=>{await ed(h),await Promise.all(d.map(f=>td(f)))})([a.uploadId],u)},rd=async(e,t)=>{if(Ge())return _.debug("ReplayDisabled-ScheduleOrCapture");const{isHeatmap:r,isStandalone:n,replayParams:s,triggerTimestamp:i,responseGroupId:a}=e,o=async()=>{setTimeout(()=>z.removeListener(F.QuestionAnswered,o),0),ke(async()=>{s.replayDurationType==="before"?await ul(e):await ee.markPendingCaptureToCanUpload(a)},"Error in schedule/capture callback")};ke(async()=>{if(s.replayDurationType==="after"||s.replayDurationType==="beforeAndAfter")return!n&&!r&&z.on(F.QuestionAnswered,o),void await sd(e);if(n||r||t)await ul(e),r&&Gg();else{const l=35+s.replayDurationSeconds,c=i-1e3*l,u=i;await ee.updateEventsExpiredAt(c,u,s.expirationTimeLimitMinutes),z.on(F.QuestionAnswered,o)}},"Error in scheduling/capturing replay")},Gg=async()=>{parseInt(lt??"0")||Q.removeItem("sprig.isCapturingHeatmap"),Q.getItem("sprig.teardownAfterCapture")&&(ju(),nd(),Q.removeItem("sprig.teardownAfterCapture"))},nd=async()=>Ge()?_.debug("ReplayDisabled-ClearData"):Promise.all([ee.deleteBySessionId("events",be),ee.deleteBySessionId("pendingCaptures",be)]).catch(e=>{br("Error clearing user replay data",e)}),sd=async e=>{if(Ge())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 _.info("PendingCaptureExists",{surveyId:r});t&&(xi(),Q.setItem("sprig.isCapturingHeatmap","true"),Li=Date.now(),pe.inactivityInterval||(pe.inactivityInterval=window.setInterval(()=>{var l;l=Li,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,lt=(parseInt(lt??"0")+1).toString(),Q.setItem("sprig.pendingCount",lt),await(await ee.openDB()).add("pendingCaptures",{canUpload:!1,captureParams:i,sessionId:be,targetTimestamp:a,timestamp:Date.now(),uuid:vt()})},Hg=Object.freeze(Object.defineProperty({__proto__:null,RecordEvent:e=>{qe("Sprig_TrackEvent",e)},RecordPageView:e=>{e.description&&(e.description=lo(e.description)),qe("Sprig_PageView",e)},RecordSurveyShown:e=>{qe("Sprig_ShowSurvey",e)},_completeSessionReplay:async({surveyId:e,responseGroupUuid:t,eventDigest:r,headers:n})=>{if(!e||!t)return!1;const s=window.UserLeap._API_URL,i=await Mu({surveyId:e,responseGroupUuid:t,eventDigest:r,apiUrl:s,headers:n},!0);return!(i!=null&&i.error)},checkPendingHeatmapsUrl:()=>Ge()?_.debug("ReplayDisabled-PendingHeatmaps"):ke(async()=>{const e=(await ee.getPendingCaptures({isHeatmap:!0})).map(t=>({eventId:t.captureParams.eventId,uuid:t.uuid})).filter(({eventId:t})=>!uu(t)).map(({uuid:t})=>t);return _.info("PendingHeatmapsToComplete",{count:e.length}),e.length&&(await ee.markPendingHeatmapsReady(e),_.info("MarkedPendingHeatmapsReady")),e.length},"Error marking pending heatmaps ready"),clearUserReplayData:nd,disableRecording:br,initializeReplay:async({maxReplayDurationSeconds:e,maxInflightRequests:t=2,replaySettings:r,teardownAfter:n=!1,apiUrl:s,alwaysOnConfig:i})=>{if(i&&Og({apiUrl:s,config:i,triggerSnapshot:()=>{xi()}}),lt=Q.getItem("sprig.pendingCount"),pe.isRecording)return;if(n&&Q.setItem("sprig.teardownAfterCapture","true"),Ge())return _.debug("ReplayDisabled");if(await(async()=>{var l;if(!zu())return!0;if((l=window.navigator.storage)!=null&&l.estimate)try{const{quota:c=0,usage:u=0}=await window.navigator.storage.estimate(),d=(c-u)/1024**3;return _.info("Storage",{availableGb:d}),d<.5}catch{return!0}return!1})())return _.debug("IDBNotSupported"),Ei();try{const l=await ee.openDB();_.info("DBVersion",{version:l.version})}catch(l){return _.error("ReplayOpenErr",{name:l.name}),l.name==="VersionError"&&ee.deleteDB(),Ei()}ke(async()=>{await Mi(!0)},"Error uploading ready pending captures");const a=Pt()?30:0,o=Math.max(e??0,a);if(!o)return _.debug("MissingDuration");_.debug("ReplayInit"),await ke(async()=>{var l;r!=null&&r.minDuration&&(Qu=r.minDuration),r!=null&&r.batchDuration&&(Ri=r.batchDuration),l=t,Au.setLimit(l),Wg(),Bg(o+35,1800,o+35),zg();const c=window.UserLeap.replayLibraryURL??"https://cdn.sprig.com/dependencies/record.min.js",u=window.rrwebRecord;if(!u)return _.error("RecordScriptFailed");let d=!0,h=0;const f={checkoutEveryNms:3e4,sampling:{input:"last",scroll:250,media:800},...r,mutationQueueEnabled:r==null?void 0:r.enableMutationQueue};var v,p;pe.stopRecording=u({emit:(I,m)=>{if(I.type===ot.Custom&&(Li=Date.now()),Ge()||Un())return;if(m&&I.type===ot.Meta)h=performance.now();else if(m&&h&&I.type===ot.FullSnapshot){const b=performance.now()-h;wu("sdk_replay_snapshot_seconds",b/1e3)}const g=d||!!m&&I.type===ot.Meta;d=!1,_g(g,I),Ng({uuid:vt(),event:JSON.stringify(I),isValidStart:g,timestamp:Date.now()})},...f}),pe.isRecording=!!pe.stopRecording,pe.isRecording&&(((I,m)=>{window.addEventListener("message",g=>{var b;g.data.type===gg&&(ao.push({source:g.source,origin:g.origin}),(b=g.source)==null||b.postMessage({type:yg,settings:I,replayLibraryUrl:m},{targetOrigin:g.origin}))})})(f,c),z.on("survey.complete",I=>{var m;m={id:I,userAgent:window.navigator.userAgent},qe("Sprig_SubmitSurvey",m)}),v=qe,p=xg,Mn||(Ee=v,hn=p,window.addEventListener("click",Nu,je),window.addEventListener("pointerdown",Bu,je),window.addEventListener("mousedown",Fu,je),window.addEventListener("keydown",Pu,je),window.addEventListener("scroll",_u,je),Mn=!0,kg(),Eg()))},"Error initializing replay")},isReplayPaused:Un,isReplayRecording:()=>pe.isRecording,recordFullSnapshot:xi,recordReplayPaused:()=>{qe("Sprig_ReplayPaused",{timestamp:Date.now()}),Q.setItem("sprig.isReplayPaused","true")},recordReplayResumed:()=>{Q.removeItem("sprig.isReplayPaused"),qe("Sprig_ReplayResumed",{timestamp:Date.now()})},scheduleCapture:sd,scheduleOrCaptureReplay:rd,tryReplayAction:ke,uploadReadyPendingCaptures:Mi},Symbol.toStringTag,{value:"Module"}));(e=>{ne.replay=e})(Hg),window.UpChunk={createUpload:Gd},window.rrwebRecord=qt,exports.APP_ID="ul-app",exports.ConflictingWidgets=Qc,exports.DEFAULT_BORDER_COLOR="#e6e6e6",exports.DEFAULT_WIDTH_PX=360,exports.DismissReason=Ae,exports.EMBED_MOBILE_MAX_WIDTH=1030,exports.ERROR_BORDER_COLOR="#bd282a",exports.SprigAPI=wi,exports.SprigEvent=F,exports.breadcrumbsLogger=_,exports.calculateFrameDimensions=du,exports.debounce=Tu,exports.eventEmitter=z,exports.getHtml=Jn,exports.groupCards=(e,t)=>{const r=[e[t]],n=e[t].groupId;return n?e.slice(t).reduce((s,i)=>(i.groupId===n&&s.push(i),s),[]):r},exports.isHTMLElement=Ye,exports.isLongFormSurvey=e=>e==="longFormSurvey",exports.resetScrollPosition=e=>{const t=e.querySelector(".ul-card__container");t&&(t.scrollTop=0)},exports.setSurveyStyles=fr,exports.shouldDirectEmbed=to,exports.sprig=lg,exports.sprigFetch=Ve,exports.v4=vt;